<!-- //
var l=screen.width;
switch(l) {
 case 800:
  document.write("<link rel='stylesheet' href='/css/800_layout.css' type='text/css'>");
 break;
 case 1024:
  document.write("<link rel='stylesheet' href='/css/1024_layout.css' type='text/css'>");
 break;
  case 1152:
  document.write("<link rel='stylesheet' href='/css/1152_layout.css' type='text/css'>");
 break;
  case 1280:
  document.write("<link rel='stylesheet' href='/css/1280_layout.css' type='text/css'>");
 break;
 default:
  document.write("<link rel='stylesheet' href='/css/1024_layout.css'' type='text/css'>");
}
// -->
<!-- //
function TestoLampeggiante()
{
    var testo = document.getElementById("lampeggia1");
    if (testo.style.color == "white")
    {
        testo.style.color = "gold";
    }
    else
    {
        testo.style.color = "white";
    }
	var testo = document.getElementById("lampeggia2");
    if (testo.style.color == "red")
    {
        testo.style.color = "blue";
    }
    else
    {
        testo.style.color = "red";
    }
}
window.setInterval("TestoLampeggiante()", 500);
// -->
<!-- //
function cambiaColore(numero, totale){
	
	for(var i = 1; i < totale + 1; i++){
		document.getElementById("testo"+i).style.backgroundColor = "#FFFFFF";
	}
	
	if(parseInt(numero) > parseInt(totale)){
		numero = 0;
	}
	else{
		document.getElementById("testo"+numero).style.backgroundColor = "#BFE8FF";
	}
	window.setTimeout("cambiaColore("+parseInt(numero+1)+","+totale+")", 1000);
}
// -->

var dbName = new String("applicazioni/bfh_at_de.nsf");
function MenuSH(src){if (src.collapsed=="true"){eval (src.id+ "Elements.style.display='inline'");src.collapsed="false";} else{eval (src.id+"Elements.style.display='none'");src.collapsed="true";}}

  <!--   window.focus(); 
//-->

function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

	
	
function Session() {this.Set = Set;this.Get = Get;}function Get(Name){var arg = Name + "=";var alen = arg.length;var clen = document.cookie.length;
var i = 0; while (i < clen) {var j = i + alen;if (document.cookie.substring(i, j) == arg){var endstr = document.cookie.indexOf (";", j);
if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(j, endstr));}  i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break; }return null;}function Set(Name, Value){document.cookie = Name + "=" + escape (Value);}

function Extract(str){
var N=new String(str);var W=new Array();var nd=true;
while (nd){if (N.search("  ")==-1)
nd=false; else N=new String(N.replace("  ", " "));}
W=N.split(" ");return W;}

function AdjustFreeQuery(query){
var uS="";var tQ=new String(query);var lQ=new String(tQ.toLowerCase());
var AQ=(lQ.search(" and ")!=-1 && lQ.search(" or ")!=-1 && lQ.search(" not ")!=-1  )? false : true; 
var tW=Extract(tQ);
if (!AQ){tQ=tW[0];for (i=1; i<tW.length;i++) tQ+= (" and "+tW[i]);uS+=tQ;}else {tQ=tW[0];for (i=1; i<tW.length;i++)
tQ+= (" and "+tW[i]);uS+=tQ;}return uS;}

function AdjustFieldQuery(Field, FV){
var uS="";var tN=new String(FV);var lQ=new String(tN.toLowerCase());
var AQ=(lQ.search(" and ")!=-1 || lQ.search(" or ")!=-1 || lQ.search(" not ")!=-1  ) ? "A" : "N"; 
var tW=Extract(tN);
if (FV!=""){if (AQ=="N"){tN='Field '+Field+'='+tW[0]+"*";for (i=1; i<tW.length;i++){tN+= (' or Field '+Field+'='+tW[i]+"*");}
}else{tN="Field "+Field+"="+tW[0];for (i=1; i<tW.length;i++){if (tW[i]=="and" || tW[i]=="or" || tW[i]=="not" )
{tN+= " "+tW[i];}else tN+= (" Field "+Field+"="+tW[i]+"*");}
} uS+=tN;}return uS;}

function AdjustTotalFieldQuery(Field, FV){
var uS="";var tN=new String(FV);var lQ=new String(tN.toLowerCase());var tW=Extract(tN);
if (FV!=""){tN='Field '+Field+'="'+tW[0] +"*";for (i=1; i<tW.length;i++){tN+= (' '+tW[i]+ "*" );}tN+='"';uS+=tN;}
return uS;}

function AdjustTotalFieldQueryusc(Field, FV){
var uSC="";var tN=new String(FV);var lQ=new String(tN.toLowerCase());var tW=Extract(tN);
if (FV!=""){tN='Field '+Field+'="'+tW[0] +"*";for (i=1; i<tW.length;i++){tN+= (' '+tW[i]+ "*" );}tN+='"';uSC+=tN;}
return uSC;}

function AdjustMultiFieldQuery(Field, FV){
var uS="";var tN=new String(FV);var lQ=new String(tN.toLowerCase());
var AQ=(lQ.search(" and ")!=-1 || lQ.search(" or ")!=-1 || lQ.search(" not ")!=-1  ) ? "A" : "N"; 
var tW=Extract(tN);
if (FV!=""){if (AQ=="N"){tN="";for (j=0; j<Field.length; j++){tN+= ' or Field '+Field[j]+'='+tW[0];
if (j==0)  tN+= "*";for (i=1; i<tW.length;i++){tN+= (' or Field '+Field[j]+'='+tW[i]);if (j==0)  tN+= "*";}}tN=tN.substr(3);}
else{tN="";for (j=0; j<Field.length; j++){oper=new String("");mN=new String("");for (i=0; i<tW.length;i++){ 
if (tW[i]=="and" || tW[i]=="or" || tW[i]=="not" ){oper += tW[i]+" ";}else mN+= (" or Field "+Field[j]+"="+tW[i]+"*");}
mN=mN.substr(3);
if (oper=="and not ") {mN=mN.replace("or","and not");}tN+=mN+" or ";}tN=tN.substr(0, tN.length-3);
}uS+=tN;} return uS;}

function EnterPressed(parentForm){
parentForm=new String(parentForm);key = window.event.keyCode;
if (key==13)
{var src = new String(window.event.srcElement.parentForm);
eval('document.all.'+src+'.click();');}}

  <!--   window.focus(); 
//-->

<!-- script home page-->

function aggiorna()
{document.all.Categoria.value = "DOC*";document.all.Geografica.value = "";}

function advancedsearchhotel(db){
var G=new String(document.all.Geografica.value);
var ct=new String(document.all.Categoria[document.all.Categoria.selectedIndex].value);

if (G=="" && ct=="") {alert("Impossibile procedere con la ricerca dell'hotel!  Selezionare \n Categoria Hotel \n            e/o \n Provincia Hotel \n            e/o \n Regione Hotel");return 0;}
if (G=="" && ct=="DOC*"){window.location.href="/"+db+"/Struttura?SearchView&SearchMax=15000&query= Field Form=DOC";return 0;}
if (G!="" && ct=="DOC*"){window.location.href="/"+db+"/Struttura?SearchView&SearchMax=15000&query= Field Form=DOC and field Geografica="+G;return 0;}
if (G=="" && ct!="DOC*"){window.location.href="/"+db+"/StrutturaByCategory!OpenView&RestrictToCategory="+ct;return 0;}
if (G!="" && ct!="DOC*"){window.location.href="/"+db+"/Struttura?SearchView&SearchMax=15000&query= Field Categoria="+ct+" and field Geografica="+G;return 0;}
if (G!="" && ct=="") {window.location.href="/"+db+"/Struttura?SearchView&SearchMax=15000&query= Field Form=DOC and Field Geografica="+G+"&SearchFuzzy=TRUE";return 0;}

var Ses=new Session();Ses.Set("Sreload", "SI");
var uS="/"+db+"/Struttura?SearchView&SearchMax=15000&query= ";
var E=false;
Ses.Set("HITS","");uS+="&SearchOrder=1";window.location.href=uS+"&Folder=ricerca";}
// -->

function foc() 
{document.getElementById("txtCity").focus()}
