function show(elementId)
{document.getElementById(elementId).style.display='';}
function hide(elementId)
{document.getElementById(elementId).style.display='none';}
function highlight(ElementId,color)
{prevColor=document.getElementById(ElementId).style.backgroundColor;if(prevColor=='')
prevColor=document.getElementById(ElementId).bgColor;document.getElementById(ElementId).style.backgroundColor=color;}
function makenormal(ElementId,color)
{document.getElementById(ElementId).style.backgroundColor=prevColor;prevColor='';}
function SetText(myControl,myText)
{myControl.value=myText;}
function GetMyInnerText(node)
{return(node.textContent||node.innerText||node.text);}
function GetAttribute(node,attributename)
{return (node.getAttribute(attributename));}
function Open_Child_Window(myURL)
{myheight=parseInt(0.60*window.screen.height);mywidth=parseInt(0.60*window.screen.width);mytop=parseInt(window.screen.height - (0.60*window.screen.height))/4;myleft=parseInt(window.screen.width - (0.60*window.screen.width))/2;sFeatures = 'height='+myheight+',left='+myleft+',top='+mytop+',width='+mywidth+',scrollbars=1,location=0';sURL = myURL;window.open(sURL , "_blank", sFeatures );return true;}
function GetCities()
{if(window.XMLHttpRequest)
{xmlhttp=new XMLHttpRequest();}
else
{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
myCountry='United Kingdom';myCityControl=document.getElementById("city");myCity=myCityControl.value;url="/cities.xml"
xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4&&xmlhttp.status==200)
{txt="<table align='left' border='0' bgcolor='#B7D1F6' cellpadding='1' cellspacing='1' width='200px'>";myXMlDoc=xmlhttp.responseXML
cityNodes=myXMlDoc.getElementsByTagName('city');var idValue;var textValue;var optionItem;for(var count=0;count<cityNodes.length;count++)
{textValue=GetMyInnerText(cityNodes[count]);idValue=cityNodes[count].getAttribute("id");textValue_temp=textValue.toString().toUpperCase();myCity=myCity.toString().toUpperCase();if(textValue_temp.search(myCity)==0)
{txt=txt+"<tr bgcolor='#FFFFFF'><td id='tdcities_"+count+"' onClick='hide("+'"divcitylist"'+");' onMouseOver='highlight("+'"tdcities_'+count+'"'+","+'"#d3d3d3"'+");SetText(document.getElementById("+'"city"'+"),"+'"'+textValue+'"'+");' onMouseOut='makenormal("+'"tdcities_'+count+'"'+","+'""'+")'>"+textValue+"</td></tr>"}}
txt=txt+"</table>";show('divcitylist');document.getElementById('divcitylist').innerHTML=txt;}}
xmlhttp.open("GET",url,true);xmlhttp.send(null);}
function GetAreasAndCities(idArea,idDiv,idTD_pre,myCountry)
{if(window.XMLHttpRequest)
{xmlhttp=new XMLHttpRequest()}
else
{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}
if(myCountry=='')myCountry='United Kingdom';
myCityControl=document.getElementById(idArea);
myCity=myCityControl.value;
url="/areas_and_cities.xml";
if(myCity.toString().length>=3)	 
{xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4&&xmlhttp.status==200)
{txt="<table align='left' border='0' bgcolor='#B7D1F6' cellpadding='1' cellspacing='1' width='200px'>";
myXMlDoc=xmlhttp.responseXML;
myParentNodes=myXMlDoc.getElementsByTagName('country');
var idValue;var textValue;var optionItem;
for(var pcount=0;pcount<myParentNodes.length;pcount++)
{textValue=GetMyInnerText(myParentNodes[pcount]);
myParentValNameAttribute=GetAttribute(myParentNodes[pcount],"name");
if(myParentValNameAttribute==myCountry)
{myNodes=myParentNodes[pcount].getElementsByTagName('city');
for(var count=0;count<myNodes.length;count++)
{textValue=GetMyInnerText(myNodes[count]);
idValue=myNodes[count].getAttribute("id");
textValue_temp=textValue.toString().toUpperCase();
myCity=myCity.toString().toUpperCase();
if(textValue_temp.search(myCity)==0)
{txt=txt+"<tr bgcolor='#FFFFFF'><td id='"+idTD_pre+count+"' onClick='hide("+'"'+idDiv+'"'+");' onMouseOver='highlight("+'"'+idTD_pre+count+'"'+","+'"#d3d3d3"'+");SetText(document.getElementById("+'"'+idArea+'"'+"),"+'"'+textValue+'"'+");' onMouseOut='makenormal("+'"'+idTD_pre+count+'"'+","+'""'+")'>"+textValue+"</td></tr>"}
}break}}
txt=txt+"</table>";
show(idDiv);
document.getElementById(idDiv).innerHTML=txt}}
xmlhttp.open("GET",url,true);
xmlhttp.send(null)}
else if(myCity.toString().length<=3)	
{hide('divareacitylist_head');}}

function GetClients(myControlId,myControlId2,myDivId,idTD_pre)
{if (window.XMLHttpRequest)
{xmlhttp=new XMLHttpRequest();}
else
{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
myCountry = 'United Kingdom';
myclientControl = document.getElementById(myControlId);
myclient = myclientControl.value;
url = "XML_Data/clients.xml"	
xmlhttp.onreadystatechange=function()
{if (xmlhttp.readyState==4 && xmlhttp.status==200)
{txt="<table align='left' border='0' bgcolor='#B7D1F6' cellpadding='1' cellspacing='1' width='200px'>";
myXMlDoc = xmlhttp.responseXML			
clientNodes = myXMlDoc.getElementsByTagName('client');						
var idValue;var textValue;var optionItem;
for (var count = 0; count < clientNodes.length; count++)
{if(clientNodes[count].hasChildNodes())
{myChildNodes = clientNodes[count].childNodes
for (ChCount=0; ChCount < myChildNodes.length; ChCount++)
{if(myChildNodes[ChCount].nodeName=='name')
{	textValue = GetMyInnerText(myChildNodes[ChCount]);}
if(myChildNodes[ChCount].nodeName=='id')
{idValue = GetMyInnerText(myChildNodes[ChCount]);}}}				
textValue_temp = textValue.toString().toUpperCase();
myclient = myclient.toString().toUpperCase();
if(textValue_temp.search(myclient)==0)
{txt=txt + "<tr bgcolor='#FFFFFF'><td id='"+idTD_pre+count+"' onClick='hide(" + '"' + myDivId + '"' + ");' onMouseOver='highlight(" + '"' + idTD_pre+count + '"' + "," + '"#d3d3d3"' + ");SetText(document.getElementById(" + '"' + myControlId + '"' + ")," + '"' + textValue + '"' + ");SetText(document.getElementById(" + '"' + myControlId2 + '"' + ")," + '"' + idValue + '"' + ");' onMouseOut='makenormal(" + '"' + idTD_pre+count + '"' + "," + '""' + ")'>" + textValue + "</td></tr>"}}
txt=txt + "</table>";			
show(myDivId);
document.getElementById(myDivId).innerHTML=txt;}}
xmlhttp.open("GET",url,true);xmlhttp.send(null);}
function GetClipBoard()
{if(window.XMLHttpRequest)
{xmlhttp=new XMLHttpRequest();}
else
{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
url='/clipboard.asp'
xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4&&xmlhttp.status==200)
{document.getElementById('mycomparision_panel').innerHTML=xmlhttp.responseText;}}
xmlhttp.open("GET",url,true);xmlhttp.send(null);}
function AddToClipBoard(id,hotel_name)
{if(window.XMLHttpRequest)
{xmlhttp=new XMLHttpRequest();}
else
{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
url='/clipboard.asp?id='+id+'&hotel_name='+hotel_name+'&hdnclipaction=add'
xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4&&xmlhttp.status==200)
{document.getElementById('mycomparision_panel').innerHTML=xmlhttp.responseText;}}
xmlhttp.open("GET",url,true);xmlhttp.send(null);}
function RemoveFromClipBoard(id,hotel_name)
{if(window.XMLHttpRequest)
{xmlhttp=new XMLHttpRequest();}
else
{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
url='/clipboard.asp?id='+id+'&hotel_name='+hotel_name+'&hdnclipaction=delete'
xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4&&xmlhttp.status==200)
{document.getElementById('mycomparision_panel').innerHTML=xmlhttp.responseText;}}
xmlhttp.open("GET",url,true);xmlhttp.send(null);}
function AddRemoveSavedVenues(venue_id,hotel_name,sAction,page_url)
{if(window.XMLHttpRequest)
{xmlhttp=new XMLHttpRequest();}
else
{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
url='/corporatelogin/add_remove_saved_venues.asp?venue_id='+venue_id+'&hotel_name='+hotel_name+'&hdnclipaction='+sAction
xmlhttp.onreadystatechange=function()
{if(xmlhttp.readyState==4&&xmlhttp.status==200)
{if(sAction=='delete')
{window.location.href='/corporatelogin/list_saved_venues.asp'}
else if(xmlhttp.responseText=='Please login to save property')
{	window.location.href='/corporatelogin/login.asp?save_venue=f&venue_id='+venue_id+'&hotel_name='+hotel_name+'&page_url='+encodeURI(page_url)
	//window.location.href='/corporatelogin/registration.asp?save_venue=f&venue_id='+venue_id+'&hotel_name='+hotel_name+'&page_url='+encodeURI(page_url)
}
else
{alert(xmlhttp.responseText)}}}
xmlhttp.open("GET",url,true);xmlhttp.send(null);}
