
	
	function chgBlue(){
		document.getElementById("Apts").style.backgroundColor="#ECF0EF";
	}
	function chgWhite(){
		document.getElementById("Apts").style.backgroundColor="#FFFFFF";
	}
	
	function txtExpand(txtid,hotelid, lng){
		document.body.style.cursor = "wait";
		queryStr = escape(txtid);
		if (lng == "gr") {
			url = "/gr/hotels/amenities/"+hotelid+".asp?nid=" + queryStr;
		} else {
			url = "/hotels/amenities/"+hotelid+".asp?nid=" + queryStr;
		}
		request.open("GET", url, true);
		request.onreadystatechange = function(){ updatePageTxtExpand(txtid, hotelid);};
		request.send(null);
		//lCount('hotel',hotelid);
		//document.getElementById(txtid).className="clip";
		//document.getElementById(txtid).style.zIndex="30";
	}
	function updatePageTxtExpand(txtid, hotelid) {	
	if (request.readyState == 4)
	{
		if (request.status == 200)
		{
			document.body.style.cursor = "default";
			var response = request.responseText;
			document.getElementById(txtid).innerHTML = response;
			document.getElementById(txtid).className="clip";
			document.getElementById(txtid).style.zIndex="30";
			request = renewRequest();
			lCount('hotel',hotelid);
		}
    	else if (request.status == 404)
		{
			alert("Page Does Not Exist!");
		}
		else
		{
			document.body.style.cursor = "default";
			alert("Unexpected Error Occurred!");	
		}
	}	
}
	function txtClose(txtid){
		document.getElementById(txtid).className="clipped";
		document.getElementById(txtid).style.zIndex="10";
	}
	
	function switchOrder(qryString){
		var query = window.location.search.substring(1);
		var url = document.URL;
		url = url.replace("?"+query,"");
		window.location = url + qryString;
	}
	
	function jumpPage(newlocation){	window.location = newlocation;}

var browser = navigator.appName;

	function FindPos(obj,hotelname,hotelemail) 
	{
	var curtop = 0;
	var posdiff = 78;
	if (obj.offsetParent)
		{
		while (obj.offsetParent)
			{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
			}
		}
	else if (obj.y)
		curtop += obj.y;
	var newtop = curtop - posdiff;
	if (browser=="Microsoft Internet Explorer"){
		//newtop = newtop - 0;
		document.getElementById("emailHotel").style.top=newtop+"px";
		document.getElementById("emailHotel").style.display="block";
		}
	else{
		document.getElementById("emailHotel").style.top=newtop+"px";
		document.getElementById("emailHotel").style.visibility="visible";
		}
	document.emailForm.txtAccName.value=hotelname;
	document.emailForm.txtAccEmail.value=hotelemail;
	document.getElementById("pHotelName").innerHTML=hotelname;
	}
	
	function FindPosCompany(obj,hotelname,hotelemail) 
	{
	var curtop = 0;
	var posdiff = 30;
	if (obj.offsetParent)
		{
		while (obj.offsetParent)
			{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
			}
		}
	else if (obj.y)
		curtop += obj.y;
	var newtop = curtop - posdiff;
	if (browser=="Microsoft Internet Explorer"){
		//newtop = newtop - 0;
		document.getElementById("emailHotel").style.top=newtop+"px";
		document.getElementById("emailHotel").style.display="block";
		}
	else{
		document.getElementById("emailHotel").style.top=newtop+"px";
		document.getElementById("emailHotel").style.visibility="visible";
		}
	document.getElementById("txtAccName").value=hotelname;
	document.getElementById("txtAccEmail").value=hotelemail;
	document.getElementById("pHotelName").innerHTML=hotelname;
	}
	
	function validateForm(lang)
	{		
	formLang = document.emailForm.txtLanguage
	formLang.value = lang;
	
	if (document.emailForm.txtName.value == "")
		{self.alert("You must make an entry in Name!");
		document.emailForm.txtName.focus();formLang.value = "";return false;}
	
	if (document.emailForm.txtEmail.value == "")
		{self.alert("You must make an entry in Email!");
		document.emailForm.txtEmail.focus();formLang.value = "";return false;}
	if (document.emailForm.txtEmail.value.indexOf("@") != "-1" && document.emailForm.txtEmail.value.indexOf(".") != "-1")
		{}
	else
		{self.alert("You must enter a valid Email address!");
		document.emailForm.txtEmail.focus();formLang.value = "";return false;}
	
	if (document.emailForm.txtEmailV.value == "")
		{self.alert("You must verify your Email address!");
		document.emailForm.txtEmailV.focus();formLang.value = "";return false;}
	if (document.emailForm.txtEmailV.value == document.emailForm.txtEmail.value)
		{}
	else
		{self.alert("The Email addresses do not match!");formLang.value = "";return false;}	
		
	if (document.emailForm.txtRequest.value == "")
		{self.alert("You must make an entry in Request!");
		document.emailForm.txtRequest.focus();formLang.value = "";return false;}

	SendMail();
	}
	
	function validateForm_new(lang)
	{		
	formLang = document.emailForm.txtLanguage
	formLang.value = lang;
	
	if (document.emailForm.txtName.value == "")
		{self.alert("You must make an entry in Name!");
		document.emailForm.txtName.focus();formLang.value = "";return false;}
	
	if (document.emailForm.txtEmail.value == "")
		{self.alert("You must make an entry in Email!");
		document.emailForm.txtEmail.focus();formLang.value = "";return false;}
	if (document.emailForm.txtEmail.value.indexOf("@") != "-1" && document.emailForm.txtEmail.value.indexOf(".") != "-1")
		{}
	else
		{self.alert("You must enter a valid Email address!");
		document.emailForm.txtEmail.focus();formLang.value = "";return false;}
	
	if (document.emailForm.txtEmailV.value == "")
		{self.alert("You must verify your Email address!");
		document.emailForm.txtEmailV.focus();formLang.value = "";return false;}
	if (document.emailForm.txtEmailV.value == document.emailForm.txtEmail.value)
		{}
	else
		{self.alert("The Email addresses do not match!");formLang.value = "";return false;}	
		
	if (document.emailForm.txtRequest.value == "")
		{self.alert("You must make an entry in Request!");
		document.emailForm.txtRequest.focus();formLang.value = "";return false;}

		var statusRecaptcha = Recaptcha.test();
	if (statusRecaptcha == "true")
		{
			//alert ("Correct code");
		//return true;
		}
		else
		{
		self.alert ("Wrong CAPTCHA code. Please try again.");
		Recaptcha.reload();
		return false;
		}
	SendMail();
	}	
	
	function SendMail()
	{
	if (browser=="Microsoft Internet Explorer"){
		document.getElementById("emailHotel").style.display="none";
		}
	else{
		document.getElementById("emailHotel").style.visibility="hidden";
		}
		var userEmail = document.getElementById('txtEmail').value;
		var hotelEmail = document.getElementById('txtAccEmail').value;

		document.getElementById("mail_replyto1").value = userEmail;
		
		document.getElementById("mail_to2").value = userEmail;
		document.getElementById("mail_replyto2").value = hotelEmail;
		
		document.getElementById("mail_to3").value = hotelEmail;
		document.getElementById("mail_replyto3").value = userEmail;
	}
	
	function CloseMail()
	{
	if (browser=="Microsoft Internet Explorer"){
		document.getElementById("emailHotel").style.display="none";
		}
	else{
		document.getElementById("emailHotel").style.visibility="hidden";
		}
	}
	
//email_window = null;
	function openEmailWindow(){
		email_window = window.open('','email_window','width=5,height=5');
		alert("Your message has been sent successfully.");
	  // return true;
	}