function check_frm_ricerca(redirect, tiporicerca)
{
	switch (tiporicerca)
	{
	case "1":
		var testo=""; 
		try	{ testo=document.frm_menu.strRicerca1.value;}
		catch (e){testo="";}
		window.location = redirect+"&tiporicerca=1&strRicerca1="+testo + "&RicInt1=1";			
		break;	
	case "2":
		var frm=document.frmCambio
		termine1=frm.strRicerca1.value
		termine2=frm.strRicerca2.value
		termine3=frm.strRicerca3.value
		sel1 = frm.sel1[frm.sel1.selectedIndex].value 
		sel2 = frm.sel2[frm.sel2.selectedIndex].value		
		frm.RicInt[0].checked ? Ric1=1 : Ric1=0; 
		frm.RicInt[1].checked ? Ric2=1 : Ric2=0; 
		frm.RicInt[2].checked ? Ric3=1 : Ric3=0; 
		//if (!vuoto(termine1) || !vuoto(termine2) || !vuoto(termine3))
		//{
			window.location = redirect	+ "&tiporicerca=2" + "&strRicerca1=" + termine1 + "&strRicerca2=" + termine2 + "&strRicerca3=" + termine3 + "&sel1=" + sel1 + "&sel2=" + sel2 + "&RicInt1=" + Ric1 + "&RicInt2=" + Ric2 + "&RicInt3=" + Ric3
		//}	
		break;
	}
}

function check_frm_reg(redirect)
{
	window.location = redirect;			
}


function MM_openBrWindow(theURL, winName, features, width, height, bReturnObject)
{ 
	var window_width;
	var window_height;

	if(!width) 
			window_width = (screen.width/2)+150;
	else
		window_width = width;

	if(!height) 
		window_height = (screen.height/2)+130;
	else
		window_height = height;
			
	var window_top = (screen.height-window_height)/2;
	var window_left = (screen.width-window_width)/2;
	var newfeatures = features+",width="+window_width+",height="+window_height+",top="+window_top+",left="+window_left
	objWindow = window.open(theURL,winName,newfeatures);
	if(typeof(objWindow)=='object') { 
		objWindow.focus(); 
	} else {
		alert('Attenzione! Attivare popup!');
	}
	if (bReturnObject)
	{
		return objWindow;
	}
}

function BrowserSniff(){
	if (document.layers) return "NS";
	if (document.all) return "IE";
	if (document.getElementById) return "MOZ";
	return "OTHER";
}

function printit(){ 
	var Browser = BrowserSniff();
	switch( Browser ) {
		case 'NS':
			return; 
			break;
		case 'IE':
			var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
			document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
			WebBrowser1.ExecWB(6, 2);   
			WebBrowser1.outerHTML = "";  
			break;
		case 'MOZ':
			window.print(); 
			break;
		case 'OTHER':
			return;
			break;
	}
}

function addBookmark(title,url) {
	if (window.sidebar) {
		window.sidebar.addPanel(title, url,"");
	} else if( document.all ) {
		window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
		return true;
	}
}

function homepage(url) { 
	if(document.all) {
		try
		{
			document.body.style.behavior='url(#default#homepage)';
			document.body.setHomePage(url);
		}
		catch (e)
		{
			var testo = "";
			testo += "Per Internet Explorer fino alla versione 4: \n";
			testo += "- Dal menu 'Visualizza' andare su 'Opzioni Internet'\n";
			testo += "- Nella cartella 'Generale' premere il pulsante 'Pagina Corrente'\n\n";
			testo += "PER NETSCAPE versione 4 o superiore, seguire questi passi: \n";
			testo += "- Dal menu 'Modifica' andare a 'Preferenze'\n";
			testo += "- Nella finestra di dialogo selezionare 'Navigator'\n";
			testo += "- Premere il pulsante 'Usa pagina corrente'";
			alert(testo);
		}
	}
} 

function mailThisUrl(){
   u = window.location;
   m = "Ti segnalo questo sito";
   campo=prompt("Inserisci l'e-mail:","")
   if(campo) window.location = "mailto:"+campo+"?subject="+m+"&body="+document.title+" "+u;
}

var _sLinkOver;
function LinkOver() {
	status=_sLinkOver; 
	return true;
}

function LinkOut() {
	status='';
}

function impostaPaginaWeb(sLinkText) {
	var thelinks = document.links;

	_sLinkOver = sLinkText;
	status =_sLinkOver;
	for (var j = 0; j < thelinks.length; j++) {
			if(document.links[j].name!='NORESET') {
				//thelinks[j].onmouseover = LinkOver;  	//modificato da Simone
				//thelinks[j].onmouseout = LinkOut;		//modificato da Simone
			}
		}
}

