var wwwroot = '../';

function cercaOnC(elem, cat) {
  var valore = MM_findObj(elem).value;
  if (valore!="")
  {
	//var lingua=getQueryVariable("L");
	var cercaTipoGoogle = MM_findObj("cercaTipoGoogle");
	if (cercaTipoGoogle && cercaTipoGoogle.checked) location = "http://www.google.it/search?hl=it&q="+ valore;
	else location = "pagina.aspx?ID=Motore_di_ri001&L="+lingua+"&CERCA="+ valore + (cat!=-1? "&CAT="+cat: "");
  }
}

function cercaOnF(elem, cat){
  document.forms[0].onsubmit= new Function("cercaOnC('"+elem+"',"+ cat +"); return false;");
}

function inizCerca(elemId, cat) {
  var elem = MM_findObj(elemId);
  elem.onfocus = new Function("cercaOnF('"+ elemId +"',"+ cat +")");
  elem.onblur = new Function ("document.forms[0].onsubmit=null");
  elem = MM_findObj(elemId+"B");
  if (elem) elem.onclick = new Function("cercaOnC('"+ elemId +"',"+ cat +"); return false");
}

function versioneStampabile(){

  var str = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html><head><title>"+ document.title +"</title>"+
  		"<link href='"+wwwroot+"style/css.css' rel='stylesheet' type='text/css'>"+
  		"<link href='"+wwwroot+"style/custom-styles.css' rel='stylesheet' type='text/css'>"+
  		"<style type='text/css'>BODY {margin:10;background-color:#FFFFFF; text-align:left;background-image:url(../img/c_trasp.gif);color:#000000;}</style>"+
  		"</head><body>"+
		"<table cellpadding='0' cellspacing='0' width='815' border='0'><tr><td><img src='../img/layout08/logo.gif' ><br><br>";

	if (MM_findObj("LayoutTemplate_panelcxi") != null){
		str +=MM_findObj("LayoutTemplate_panelcxi").innerHTML +"<br>";
	}else{
		str +=MM_findObj("LayoutTemplate_panelcx").innerHTML +"<hr>";		
		}
	str +="</td></tr></table></body></html>";

  win2 = open();
  win2.document.open();
  win2.document.write(str);
  win2.document.close();
}

function changeStyle(param, numTab){

	for(i=0; i<numTab; i++){
	
		var objDivPanelButt = document.getElementById('containerPanelButt_01_' + i);
	
		if(param.id == objDivPanelButt.id){
			objDivPanelButt.className = 'labelBoxOn';
		}else{
			objDivPanelButt.className = 'labelBoxOff';
		}
		
	}
}

function changeStyle2(param2, numTab2){

	for(i=0; i<numTab2; i++){
	
		var objDivPanelButt2 = document.getElementById('tabButt_' + i);
	
		if(param2.id == objDivPanelButt2.id){
			objDivPanelButt2.className = 'labelBoxOn2';
		}else{
			objDivPanelButt2.className = 'labelBoxOff2';
		}
		
	}
}

function changePanel(param, num){
for(i=0; i<num; i++){

	objDivPanel = document.getElementById('containerPanel_' + i);
	
	if(objDivPanel.id == param ){
		document.getElementById('containerPanel_' + i).style.display="block";
	}else{
		document.getElementById('containerPanel_' + i).style.display="none";}
	}
	
}

function changePanel2(param2, num2){
for(i=0; i<num2; i++){

	objDivPanel2 = document.getElementById('containerPanelTab_' + i);
	
	if(objDivPanel2.id == param2 ){
		document.getElementById('containerPanelTab_' + i).style.display="block";
	}else{
		document.getElementById('containerPanelTab_' + i).style.display="none";}
	}
	
}