<!-- //
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 == "red")
    {
        testo.style.color = "blue";
    }
    else
    {
        testo.style.color = "red";
    }*/
	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);
}
// -->





<!-- Preso da /home_file/AdjustQuery.js //-->

var dbName = new String("Applicazioni/hotelbenessere.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 cercaArticolo(db){
	var ricerca = trim(document.all.FreeText.value);
	ricerca = AdjustFreeQuery(ricerca);
	if(ricerca == ""){
		alert("Impossibile procedere con la ricerca!\nNessuna parola da ricercare specificata.");
	}
	else{
		var Ses = new Session();
		Ses.Set("Sreload", "SI");
		var addE = true;
		Ses.Set("HITS","");
		
		//pagina = "/" + db + "/Articolo!SearchView&SearchMax=1500&query=" + ricerca + "&SearchOrder=1" + "&SearchFuzzy=TRUE";
		pagina = "/" + db + "/Articolo!SearchView&SearchMax=1500&query=" + ricerca + "&SearchOrder=1";
		window.location.href = pagina;
	}
	
}

function AdvancedSearchArticolo(db, ricerca){
	//var FreeText = new String(document.all.FreeText.value);
	var FreeText = new String(ricerca);
	if (FreeText==""){
		alert("Impossibile procedere con la ricerca!\nNessuna parola da ricercare specificata.");
		return 0;
	}
	var Ses = new Session();
	Ses.Set("Sreload", "SI");
	var urlSearch="/"+db+"/Articolo!SearchView&SearchMax=1500&query=";
	var addE = false;
	if (FreeText !=""){
		//urlSearch+=AdjustFreeQuery(FreeTex);
		urlSearch+=FreeText;
		addE = true;
	}
	Ses.Set("HITS","");
	urlSearch+="&SearchOrder=1";
	alert(urlSearch);
	//window.location.href=urlSearch + "&SearchFuzzy=TRUE";
}
	
	function RicercaArticoloKeyPress() 
{key = window.event.keyCode;
if (key==13)
{var src = new String(window.event.srcElement.parentForm);
if (src == "RicercaArticolo")
{document.all.RicercaArticolo.click();}
}
}

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-->
var colBack = "#BFE7FF";
var colFore = "#000000";
var colBackA = "FFD7AE";
var colForeA = "#000000";
var myback = colBack;
var mybackA = colBackA;
var mycount = 0;
var h_blink = null;
var actLink1 = "http://www.hotelbenessere.it";
var actLink2 = "http://www.hotelbenessere.it";

function C2(city) {ct=new String(document.all.Categoria[document.all.Categoria.selectedIndex].value);
myf = document.vSearch;
myf.txtCity.value = city.replace(/\+/g , ' ');
if (h_blink != null) window.clearInterval(h_blink);
h_blink = window.setInterval("changeBackground()", 150);}
	
function R2(city) {ct=new String(document.all.Categoria[document.all.Categoria.selectedIndex].value);
myf = document.vSearch;
myf.txtCity.value = city.replace(/\+/g , ' ');
if (h_blink != null) window.clearInterval(h_blink);
h_blink = window.setInterval("changeBackgroundA()", 150);}

function aggiorna()
{document.all.Categoria.value = "DOC*";document.all.Geografica.value = "";}

function DC(Categoria){var ct=new String(document.all.Categoria[document.all.Categoria.selectedIndex].value);if (document.all.Settori.value !== '')
document.all.Categoria.disabled = 'disabled';else document.all.Categoria.disabled =  'enabled';}

function PA(name) {window.location.href = '#top';
A2(name);}
	
function Italia(regione){
	window.location.href='Applicazioni/hotelbenessere.nsf/StrutturaWeb!SearchView&SearchMax=15000&query=field specialiofferte=si and Field%20regione='+regione+' and field superconsigliato=no&SearchOrder=1&Folder=ricerca&regione='+regione+'';
}

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+"/StrutturaWeb!SearchView&SearchMax=15000&query= Field Form=DOC";return 0;}
if (G!="" && ct=="DOC*"){window.location.href="/"+db+"/StrutturaWeb!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+"/StrutturaWeb!SearchView&SearchMax=15000&query= Field Categoria="+ct+" and field Geografica="+G;return 0;}
if (G!="" && ct=="") {window.location.href="/"+db+"/StrutturaWeb!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+"/StrutturaWeb!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()}



<!-- Preso da /home_file/ieupdate.js //-->

var bo_noscript_id = 0;

function isIE() {
  var strBrowser = navigator.userAgent.toLowerCase();
  return (strBrowser.indexOf("msie") > -1 && strBrowser.indexOf("mac") < 0);
}

function startIeFix() {
  if (isIE()) {
   document.write('<div style="display: none;" id="bo_noscript_id_' + bo_noscript_id + '">');
  }
}

function endIeFix() {
  if (isIE()) {
   document.write('</div>');
   var theObject = document.getElementById("bo_noscript_id_" + bo_noscript_id++);
   theObject.outerHTML = theObject.innerHTML;
  }
}
