function SelFav(str){
		
		document.getElementById("3starMenu").style.background = "url(images/top_nvr.gif) no-repeat left";
		document.getElementById("4starMenu").style.background = "url(images/top_nvr.gif) no-repeat left";
		document.getElementById("5starMenu").style.background = "url(images/top_nvr.gif) no-repeat left";
		
		document.getElementById("3starHotel").style.display = "none";
		document.getElementById("4starHotel").style.display = "none";
		document.getElementById("5starHotel").style.display = "none";
		
		document.getElementById(str+"starMenu").style.background = "url(images/top_hvr.gif) no-repeat left";
		document.getElementById(str+"starHotel").style.display = "";
		
		
	}


function GetXmlHttpObject(){
		var objXMLHttp=null;
		if (window.XMLHttpRequest){
			objXMLHttp=new XMLHttpRequest()
		}else if (window.ActiveXObject){
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
		}
		return objXMLHttp;
	}
	

function GetList(){
	
xmlHttp = GetXmlHttpObject()
		xmlHttp.onreadystatechange=function(){
						
						if(xmlHttp.readyState==4){
								CityList = xmlHttp.responseText
								}
									
						}
		currentTime = new Date();

		xmlHttp.open("GET","coci.xml",true)
		xmlHttp.send(null);

	
	}
GetList();
//CityList = "589|100 MILE HOUSE|35|CANADA#8841|A CORUŅA|161|SPAIN#4738|A ESTRADA|161|SPAIN#4739|A POBRA DO CARAMINAL|161|SPAIN#1770|AACHEN|67|GERMANY#1189|AALBORG|50|DENMARK#8761|AALESUND|131|NORWAY#3908|AALSMEER|123|NETHERLANDS#401|AALST|19|BELGIUM#5265|AARAU|171|SWITZERLAND#1190|AARHUS|50|DENMARK#381|ABACO ISLAND|14|BAHAMAS#2946|ABANO TERME|88|ITALY"

function cSelectCity(ciId,ciNm,coId,coNm){
		document.getElementById("City").value = ciId
		document.getElementById("Country").value = coId
		document.getElementById("tmpCit").value= ciNm+" , "+coNm;
		document.getElementById("cityarea").style.display='none';
	}

function SearchCity(val){
			if (val.length<4){
			document.getElementById("cityarea").style.display='none';
			return false;
			}
			val = val.toUpperCase()
			var tCnt = 0;
			var strHtml="";
			var SelCities = CityList.split('#')
			for(var i=0;i<SelCities.length;i++){
					
					var CityProp   = SelCities[i].split('|')
					var CityId 	= CityProp[0]
					var CityName= CityProp[1]
					var CountryId= CityProp[2]
					var CountryName= CityProp[3]

					if(CityName.indexOf(val)!=-1 || CountryName.indexOf(val)!=-1){
						strHtml = strHtml+"<a href=javascript:; class=hvrCityItem onClick="+String.fromCharCode(34)+"cSelectCity("+CityId+",'"+CityName+"',"+CountryId+",'"+CountryName+"');"+String.fromCharCode(34)+">"+CityName+" , "+CountryName+"</a>";
						tCnt = tCnt+1;
						}
					
				}
				document.getElementById("cityarea").style.display='';
						if(tCnt!=0){
							document.getElementById("cityarea").innerHTML = strHtml;
						}else{
							document.getElementById("cityarea").innerHTML =  '<a href=javascript:; class=hvrCityItem>No record for <b>'+val+'</b></a>'
						}
								
	}

function DateAdd(timeU,byMany,dateObj) {
	var millisecond=1;
	var second=millisecond*1000;
	var minute=second*60;
	var hour=minute*60;
	var day=hour*24;
	var year=day*365;

	var newDate;
	var dVal=dateObj.valueOf();
	switch(timeU) {
		case "ms": newDate=new Date(dVal+millisecond*byMany); break;
		case "s": newDate=new Date(dVal+second*byMany); break;
		case "mi": newDate=new Date(dVal+minute*byMany); break;
		case "h": newDate=new Date(dVal+hour*byMany); break;
		case "d": newDate=new Date(dVal+day*byMany); break;
		case "y": newDate=new Date(dVal+year*byMany); break;
	}
	return newDate;
}

function FindCheckOutDate(dayVal){
		
		cInDate = document.getElementById("CheckIn").value
		cInSplit = cInDate.split("/")
		cInDay	= cInSplit[1]
		cInMonth= cInSplit[0]
		cInYear	= cInSplit[2]
			
		var d = new Date(cInYear, cInMonth-1, cInDay);
		if(cInDay<10){cInDay=cInDay.replace(0,'')}
		topVal = parseInt(dayVal)+parseInt(cInDay)
		
		d.setDate(topVal);
		if (d.getYear()<2010){
			rsYear = d.getYear()+1900
		}else{
			rsYear = d.getYear()
		}

		rsMonth = d.getMonth()+1
		document.getElementById("cOutTxt").innerHTML = "( "+rsMonth +"/"+d.getDate()+"/"+rsYear+" )"
		document.getElementById("CheckOut").value = rsMonth+"/"+d.getDate()+"/"+rsYear

	}

	function DisplayRoomProperty(iVal){
		
		for(i=1;i<=4;i++){
			if(i<=iVal){
				document.getElementById("Room"+i).style.display='';
			}else{
				document.getElementById("Room"+i).style.display='none';
			}
		}
		
	}
	
	
	function DisplayChildProperty(RoomId,ChildCount){
		
		for(i=1;i<=4;i++){
			
			if(i<=ChildCount){
				document.getElementById("ChildAge"+RoomId+i).style.display='';
			}else{
				document.getElementById("ChildAge"+RoomId+i).style.display='none';
			}
			
		}
		
	}


	function CheckForm(frm){
			
			if(frm.tmpCit.value==""){
				alert("Please check destination area.");
				return false;
				}
			FindCheckOutDate(document.getElementById("TotalNight").value);	
			frm.action="SearchLoad.html";
			
		}

