<!--
function CSURLPopupShow(formName, popupName, target) {
	var form  = CSFindElement(formName);
	var popup = form.elements[popupName];
	window.open(popup.options[popup.selectedIndex].value, target);
	popup.selectedIndex = 0;
}

var content1;
function OpenWin(str) {
	self.name='body';
	if (!content1) content1 =  window.open(str,'content1','scrollbars=yes,resizable=yes,width=650,height=450,status=no,location=no,toolbar=no');
	else {
		content1 =  window.open('','content1','scrollbars=yes,resizable=yes,width=650,height=450,status=no,location=no,toolbar=no');
		content1.location.href = str;
		content1.focus();
	}
}

function search_db(Key_Type,Key_QUERY){

var ReturnValue = "" ;
var Parole;
var i;

	//esegue il Parsel della TextBox
	//il metodo Split spezza la stringa in piu' sottostr. 
	//qundo incontra il carattere di Spazio

if (Key_QUERY){

	Parole=Key_QUERY.split(" ")		
	for (i=0; i<Parole.length; i++){
		if (Parole[i]!=""){
			ReturnValue=Parole[i]							
			break
		}	
	}

	//esegue  uno swich della scelta fatta nella combo
	if (Key_Type == 0) 
		
		//"Qualsiasi termine"
		for (var j=i+1; j<Parole.length; j++){
		if (Parole[j]!="" && Parole[j].toUpperCase()!="AND" && Parole[j].toUpperCase()!="OR")
		ReturnValue += " OR " + Parole[j]						
		}
		
	else if (Key_Type == 1)  
		// "Tutti i termini"
		for (var j=i+1; j<Parole.length; j++){
		if (Parole[j]!="" && Parole[j].toUpperCase()!="AND" && Parole[j].toUpperCase()!="OR" )
		ReturnValue +=" AND " + Parole[j]				
		}
		
	else if (Key_Type == 2)  
		// "Frase esatta"
		ReturnValue = Key_QUERY
	else 
		ReturnValue = "" ;
	
		
	document.query.WRQuery.value=ReturnValue;
	
	return true
}
else
	return false	
}

-->



