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();
}