
<!--


// Declaring valid date character, minimum year and maximum year
var dtCh= "/";
var minYear=1900;
var maxYear=2100;

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   }
   return this
}


function isDate(dtStr, bEnableCorrectDateDetection){
  // 2010-05-18 DWR: This method used to require that date be of the form "dd/mm/yyyy", which
  // is a nightmare for international formats (British/American date switching issues). This
  // method should really test using the below method but since it's used all over the place,
  // this needs to be an option for now.
  if (bEnableCorrectDateDetection !== true) {
    bEnableCorrectDateDetection = false;
  }
  if (bEnableCorrectDateDetection) {
    if (!isNaN(new Date(dtStr))) {
      return true;
    }
  }
  
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strDay=dtStr.substring(0,pos1)
	var strMonth=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : dd MMM yyyy, for example 01 Sep 2010")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date, format dd/mm/yyyy")
		return false
	}

  return true;
}


function validateIATA(strValue, arrAllowedValues) {
  // 2010-07-13 DWR: If a list of allowed values is passed in then ensure strValue is one
  // of these values. If not, fall back to previous validation (3 alpha characters).
  if (arrAllowedValues && isArray(arrAllowedValues)) {
    for (var i = 0; i < arrAllowedValues.length; i++) {
      if (arrAllowedValues[i] === strValue) {
        return true;
      }
    }
    return false;
  }
  var objRegExp  = /^[A-Z]+$/;
  if (!objRegExp.test(strValue)) {
    return false;
  }
  return (strValue.length == 3);
}

function isArray(obj) {
  return (obj.constructor === Array);
}


function popUpURL(url,message,size)
{	
	if (size!="")
	{
		if (size==1)
		var properties = "height=210,width="+((window.screen.width)-170)+",location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,left=85,top="+(window.screen.height/4);

		else if (size==2)
		var properties = "height=520,width=650,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,left="+((window.screen.width-650)/2)+",top="+((window.screen.height-520)/4);
		else if (size==3)
		var properties = "height=520,width=450,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,left="+((window.screen.width-650)/2)+",top="+((window.screen.height-520)/4);
		
		else if (size==5)
		var properties = "height=800,width=720,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,left="+((window.screen.width-650)/2)+",top="+((window.screen.height-520)/4);
		
		else
		var properties = "height="+(window.screen.height/2)+",width="+((window.screen.width)-200)+",location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,left=100,top="+(window.screen.height/4);
	

}
	else
		var properties = "height="+(window.screen.height/2)+",width="+((window.screen.width)-200)+",location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,left=100,top="+(window.screen.height/4);
		
	var win = window.open(url, message, properties);
	win.focus()
		
}




function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  var win = window.open(theURL,winName,features);
  win.focus();
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function SH(x,y){

	//DISPLAY AGE OF CHILD boxes, exactly how many we need: 

	//first, reset all fields on visible none: 
	for (i = 1; i < 5; i++)	{
	var inputname = "Child"+i;
	document.getElementById(inputname).style.display="none";
		}
	//now, make fiedls visible as applicable: 
	for (i = 1; i < ((x)*(y+1))+1; i++)	{
	var inputname = "Child"+i;
		if (i < 5)	{
			document.getElementById(inputname).style.display="inline";
		}
	}

	//make sure values for hidden boxes are reset to 0
	for (i = 4; i > ((x)*(y+1)); i--)
	//inputname = "roomType1Age"+i;

		{//alert ("clear roomType1Age"+i);
		document.getElementById("roomType1Age"+i).selectedIndex=0
		}

	if (x > 0)
		{document.getElementById('childrenlabel').style.display="block";}
	else
		{document.getElementById('childrenlabel').style.display="none";}

	}
	


function CheckNoAdults(x)	{
	//when 4 or more adults in the room, no children suppose to be travel. 
	//Sergio June 2006
	

	if (x>6)
		{

		if (!document.getElementById("form1"))	{
		
		document.frmSearch.ChildrenPerRoom.selectedIndex=0;
		document.frmSearch.roomType1Age1.selectedIndex=0;
		document.frmSearch.roomType1Age2.selectedIndex=0;
		document.frmSearch.roomType1Age3.selectedIndex=0;
		document.frmSearch.roomType1Age4.selectedIndex=0;		
	
					}
		else
			{
		
		//form 1 is the main form on search form
		//frmSearch is the form on the results page - shame they are not called the same:

		document.form1.ChildrenPerRoom.selectedIndex=0;
		document.form1.roomType1Age1.selectedIndex=0;
		document.form1.roomType1Age2.selectedIndex=0;
		document.form1.roomType1Age3.selectedIndex=0;
		document.form1.roomType1Age4.selectedIndex=0;		

			}


	
		//document.getElementById("ChildrenPerRoom").style.display="none";
		document.getElementById("roomType1Age1").style.display="none";
		document.getElementById("roomType1Age2").style.display="none";
		document.getElementById("roomType1Age3").style.display="none";
		document.getElementById("roomType1Age4").style.display="none";
		//document.getElementById('childrenlabel').style.display="none";
		}
	else
		{
		//document.getElementById("ChildrenPerRoom").style.display="inline";
		document.getElementById("roomType1Age1").style.display="inline";
		document.getElementById("roomType1Age2").style.display="inline";
		document.getElementById("roomType1Age3").style.display="inline";
		document.getElementById("roomType1Age4").style.display="inline";
		//document.getElementById('childrenlabel').style.display="inline";
		}


}





function changeDate()
{	
	//-------------------------------------------------
	return;
	var checkIn = document.form1.startDate.value;
	var numDays	= document.form1.numnight[document.form1.numnight.selectedIndex].value;
	var checkOut= calCheckOutDate(checkIn,numDays);
	var lyr = document.all["CheckOut"];
	lyr.innerHTML = checkOut;
}
//---------------------------------------------------------------------------------------------------

function submitForm(form)
{		

		//NOTE THAT THIS CODE IS ONLY CALLED BY THE OPENING PAGE 
		//NOT BY THE SEARCH RESULT PAGE - SEE ALSO hotelsearchresult.js




		if (eval(form.ABTANo))
		{
			if (form.ABTACorrect.value!='yes')
			{
				alert("The entered ABTA is not recognized for this network.");
				return false;
			}

		}



		gSelectedRoomCount = 0;
		if ((form.country[form.country.selectedIndex].value=="")||(form.country[form.country.selectedIndex].value==null) )
		{
			alert("Please specify a country");
			form.country.focus();
			return false;
		}
		if ((form.city[form.city.selectedIndex].value=="")||(form.city[form.city.selectedIndex].value==null) )
		{
			alert("Please specify a city");
			form.city.focus();
			return false;
		}



		// if no of children > 0 then 
		// check whether ages are completed 

		if (form.ChildrenPerRoom[form.ChildrenPerRoom.selectedIndex].value!=0)	{
	
		
		var k=form.ChildrenPerRoom[form.ChildrenPerRoom.selectedIndex].value*form.numRooms1[form.numRooms1.selectedIndex].value;
		var selectAge;
		
		for(var i=0;i<k;i++)	{

			selectAge = "roomType1Age"+(i+1);
			//alert(selectAge);
			//alert (document.getElementById(selectAge).selectedIndex);

			if (document.getElementById(selectAge) && (document.getElementById(selectAge).selectedIndex == 0))
				{
				alert ("Please select the age of the child(ren)");
				return false;
				}
			}

		}





		if (eval(form.roomType1))
		{


		if ((form.roomType1.selectedIndex==0)&&(form.roomType2.selectedIndex==0)&&(form.roomType3.selectedIndex==0) )
		{
			alert("Please specify a roomtype");
			form.roomType1.focus();
			return false;
		}

		}


		



		//find if there is a child rate and how many
		//pick the number of rooms selected
		//in a loop check if all the ages have been entered

		

		if (eval(form.roomType1))
		{

			if (form.roomType1.selectedIndex>0)
			{
				if(!validateRoomType(form.roomType1,1) ) 
				{alertMessage(1);return false;}
			}
			if (form.roomType2.selectedIndex>0)
			{
			if(!validateRoomType(form.roomType2,2) )
				{alertMessage(2);return false;}
			}
			if (form.roomType3.selectedIndex>0)
			{
			if(!validateRoomType(form.roomType3,3) ) 
				{alertMessage(3);return false;}
		
			}
		}

		if(!isValidBooking())
			{alert("Please select the group booking form for above 9 travellers");return false;}
		if (form.hotelname.value!='')
		{	var hotelname = form.hotelname.value
			if (hotelname.match("Enter")!=null )
				form.hotelname.value='';
		}
		StartSearch();
		return true;
		
}
function initSearchAgain()
{
	buildCitySelection(document.form1.country,document.form1.city);
	//chgRoomType(document.form1.roomType1,1);
	//chgRoomType(document.form1.roomType2,2);
	//chgRoomType(document.form1.roomType3,3);
}
function populate(selectedIndex){
	if(selectedIndex == "2"){
		getCountry(document.form1.country,'Portugal');
		getCity(document.form1.country,document.form1.city,'Algarve+0');
	}
	else if(selectedIndex == "3"){
		getCountry(document.form1.country,'Mexico');
		getCity(document.form1.country,document.form1.city,'All Resorts Inc Cancun+0');
	}

	else if(selectedIndex == "4"){
		getCountry(document.form1.country,'Spain');
		getCity(document.form1.country,document.form1.city,'Costa Blanca+0');
	}

	else if(selectedIndex == "5"){
		getCountry(document.form1.country,'Spain');
		getCity(document.form1.country,document.form1.city,'Costa Del Sol+0');
	}

	else if(selectedIndex == "6"){
		getCountry(document.form1.country,'DominicanRepublic'); 
		getCity(document.form1.country,document.form1.city,'DomRepNorth-POP+0');
	}
	else if(selectedIndex == "7"){
		getCountry(document.form1.country,'DominicanRepublic'); 
		getCity(document.form1.country,document.form1.city,'DomRepSouthEast-PUJ+0');
	}

	else if(selectedIndex == "8"){
		getCountry(document.form1.country,'Spain');
		getCity(document.form1.country,document.form1.city,'Fuerteventura+0');
	}
	else if(selectedIndex == "9"){
		getCountry(document.form1.country,'Spain');
		getCity(document.form1.country,document.form1.city,'Gran Canaria+0');
	}

	else if(selectedIndex == "10"){
		getCountry(document.form1.country,'Jamaica');
		getCity(document.form1.country,document.form1.city,'Jamaica+0');
	}

	else if(selectedIndex == "11"){
		getCountry(document.form1.country,'Spain');
		getCity(document.form1.country,document.form1.city,'Lanzarote+0');
	}

	else if(selectedIndex == "12"){
		getCountry(document.form1.country,'Spain');
		getCity(document.form1.country,document.form1.city,'Majorca+0');
	}

	else if(selectedIndex == "13"){
		getCountry(document.form1.country,'Egypt');
		getCity(document.form1.country,document.form1.city,'Sharm El Sheikh+0');
	}

	else if(selectedIndex == "14"){
		getCountry(document.form1.country,'Spain');
		getCity(document.form1.country,document.form1.city,'Tenerife+0');
	}

	else if(selectedIndex == "16"){
		getCountry(document.form1.country,'UnitedKingdom');
		getCity(document.form1.country,document.form1.city,'London+0');
	}

	else if(selectedIndex == "17"){
		getCountry(document.form1.country,'CzechRepublic');
		getCity(document.form1.country,document.form1.city,'Prague+0');
	}
	else if(selectedIndex == "18"){
		getCountry(document.form1.country,'Italy');
		getCity(document.form1.country,document.form1.city,'Rome+0');
	}
	else if(selectedIndex == "19"){
		getCountry(document.form1.country,'Netherlands');
		getCity(document.form1.country,document.form1.city,'Amsterdam+0');
	}

}



function resetSortOrder(searchID)
{
	//if (document.form1.sortorder.selectedIndex ==1){document.form1.pageNo.value=1;}
	document.form1.pageNo.value=1;
	document.form1.action='hotel_search_result.asp';
	document.form1.SearchID.value=searchID;//
	StartSearch();
	document.form1.submit();
}
function resetPageNo(searchID)
{
	
	//alert('test53');
	window.document.form1.FindInSearch.value='';
	//alert('test54');
	//window.document.fddorm1.FindInSearch.value='';

	document.form1.pageNo.value=document.form1.pageNo1[document.form1.pageNo1.selectedIndex].value;
	document.form1.action='hotel_search_result.asp';
	document.form1.SearchID.value=searchID;//
	StartSearch();
	document.form1.submit();
}
function scrollPages(searchID)
{	
	document.form1.action='hotel_search_result.asp';
	document.form1.SearchID.value=searchID;//
	StartSearch();
	document.form1.submit();
}
function StartSearch()
{	
	document.all.blkSearchResult.style.display="none";
	document.all.blkSearch.style.display="block";
	$(".TopLinks").hide();
	window.status = 'Please wait while we find properties for your selected dates.';
}



function buildCountryList(countrycitySTR)
{
	if (countrycitySTR!="")
	{
		var CountryCityARR = countrycitySTR.split("|");	//long string
		for (var i=0;i<CountryCityARR.length;i++)
		{
			var cityArr = CountryCityARR[i].split("~");	//join of country and city
			
			CityNameArr[i]	=	new Array();
			
			for (var j=0;j<cityArr.length;j++)
			{
				//if (j==0) alert(cityArr[j]);
				
				CityNameArr[i][j] = cityArr[j];
			}
			//alert(CountryCityARR[i]);
			
			/*alert(CityNameArr[i][0]);
			alert(CityNameArr[i][1]);
			alert(CityNameArr[i][2]);*/
			// alert(CityNameArr[i].length);
		}
	}
}



function buildCitySelection(objCountry,objCity)
{

	
	var aCity;
	var countryval = objCountry.options[objCountry.selectedIndex].value;	//the selected country
	//alert(countryval)
	var RetriveCity = objCity;//document.form1.city;					//the city object
	RetriveCity.length=0;
	RetriveCity.options[0]=new Option('-- Select --  ','')
	if (countryval!='')
	{



		//alert(obj.options[obj.selectedIndex].value)
		
		//refresh the city drop down 
		for (k=0;k<CityNameArr.length;k++)
		{
			//if ((CityNameArr[k][0])==countryval)
			var arrcountryval = CityNameArr[k][0];
			if (arrcountryval.toUpperCase() ==countryval.toUpperCase() )
				{ 
					//alert(CityNameArr[k].length) 
					for (c=1;c<CityNameArr[k].length;c++)
					{
						aCity = CityNameArr[k][c].split("+");//split for location(supplier or h2h)
						
						RetriveCity.options[c]=new Option(aCity[0],CityNameArr[k][c])
					}
				}			
		}
		
	}


if (objCountry.options[objCountry.selectedIndex].value=="")
	{objCity.options[0].text="(Select country first)";}
else
	{objCity.options[0].text="-- Select --";}
}

function getCountry(obj,countryname)
{
	var oCountry = obj				//the country object
	oCountry.length=0;
	oCountry.options[0]=new Option('-- Select --  ','')
	//retrive the country(s)
	for (k=0;k<CityNameArr.length;k++)
	{
		oCountry.options[k]=new Option(CityNameArr[k][0],CityNameArr[k][0]);
//		alert(countryname+'--'+(CityNameArr[k][0]))
		if (countryname == (CityNameArr[k][0]))
			{oCountry.options[k].selected=true;}
	}
}

function getCity(objCountry,objCity,valSelected)
{
	buildCitySelection(objCountry,objCity);
	
	//select the city -------------------------------------------
	for(i=0;i<objCity.length;i++)//CITY
	{
		var val = objCity.options[i].value;
		if (val==valSelected){objCity.options[i].selected=true;}
	}
}
//----------------------------------
expand = new Image()
expand.src = "images/clickhere.gif"
collapse = new Image()
collapse.src = "images/clickhere.gif"
var newarray;
newarray = new Array(expand,collapse)

//----------------------------------
function displayOI(img_id,obj)
{	if (img_id!="")
	{	for (var j=0;j<document.images.length;j++)
		{	//alert(document.images[j].name)
			var imgname = document.images[j].name
			if ((imgname)==("img"+img_id))
			{	//Check if its blocked (swap) on click
				if (obj.style.display=='none')
				{	obj.style.display="block";	
					for(var b=0;b<8;b++)
					{
						document.all['blk_OI'+b].style.display="block";
					}	
					document.images[j].src = newarray[0].src;	
				}
				else
				{	obj.style.display="none";
					for(var b=0;b<8;b++)
					{
						document.all['blk_OI'+b].style.display="none";
					}		
					document.images[j].src = newarray[1].src;	}
			}
		}
	}
}

//Locations - AJAX:

var xmlHttp

function showLocation(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="location/getlocation.asp"
url=url+"?q="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("txtLocation").innerHTML=xmlHttp.responseText 
} 
} 

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}



//Pop up layers  when hovering over grid

var pleaseShow=0;
var leaveText=0
var xxx=0;
var yyy=0;
//  #########  CREATES POP UP BOXES 
function popLayer(a){
	document.getElementById("gridPopup").style.visibility='visible';
	document.getElementById("gridPopupShadow").style.visibility='visible';
	desc = 	  "<div style='color:#000;font-family:arial;font-size:11px;padding:5px;'>"+descarray[a]+"</div>"
	document.getElementById("gridPopup").innerHTML=desc;
	document.getElementById("gridPopup").style.left=xxx -150;
	
	document.getElementById("gridPopupShadow").style.left=xxx -145;
	

	if(navigator.appName.indexOf("Netscape") !=-1)
		{document.getElementById("gridPopupShadow").style.left=xxx -137;}


	
	if (document.getElementById("gridPopup").offsetHeight<100)
		{document.getElementById("gridPopup").style.height=100}
	
	document.getElementById("gridPopupShadow").style.height=(document.getElementById("gridPopup").offsetHeight);

	document.getElementById("gridPopup").style.top=yyy-document.getElementById("gridPopup").offsetHeight-10;
	document.getElementById("gridPopupShadow").style.top=yyy-document.getElementById("gridPopup").offsetHeight-5;




}


function check(form){
	if(form.abtaNumber.value==""){
		alert("Please enter a valid abta number");
		form.abtaNumber.focus();
		return false;
	}	
	if(form.groupReference.value==""){
		alert("Please enter a group reference");
		form.groupReference.focus();
		return false;
	}
	if(form.telephoneNumber.value==""){
		alert("Please enter a telephone number");
		form.telephoneNumber.focus();
		return false;
	}	
	if(form.emailAddress.value==""){
		alert("Please enter a valid email address");
		form.emailAddress.focus();
		return false;
	}
	if(form.country.value==""){
		alert("Please select a country");
		form.country.focus();
		return false;
	}	
	if(form.city.value==""){
		alert("Please select a city");
		form.city.focus();
		return false;
	}
	if(form.starRating.value==""){
		alert("Please select a star rating");
		form.starRating.focus();
		return false;
	}
	if(form.budgetPerPerson.value==""){
		alert("Please enter a maximum budget per person")
		form.budgetPerPerson.focus();
		return false;
	}
	if(form.leadName.value==""){
		alert("Please enter a lead name for you group");
		form.leadName.focus();
		return false;
	}
	if(form.numberOfAdults.value=="0"){
		alert("There must be at least one adult in the group");
		form.numberOfAdults.focus();
		return false;
	}
	if(form.totalNoPassengers.value=="0"){
		alert("There must be at least one passenger in the group");
		form.totalNoPassengers.focus();
		return false;
	}
	if(form.numberOfChildren.value!="0" && form.childrenAges==""){
		alert("Please enter the ages of the children in the group");
		form.childrenAges.focus()
		return false;
	}
	
	/*if(sumRooms(form)==0){
		alert("Please select some room types");
		form.numberOfHotelSingles.focus();
		return false;
	}*/
	if(parseInt(form.numberOfChildren.value)+
	   parseInt(form.numberOfAdults.value) !=
	   parseInt(form.totalNoPassengers.value)){
		alert("Please make sure that the number of number of children and adults equates to the total number of passengers");   
		form.totalNoPassengers.focus();
		return false;
	}
	
		
	return true;
}

/*function sumRooms(form){
	var sumOfRooms = 0;
	
	sumOfRooms += parseInt(form.numberOfHotelSingles.value)
	sumOfRooms += parseInt(form.numberOfHotelDoubles.value)
	sumOfRooms += parseInt(form.numberOfHotelTwins.value)
	sumOfRooms += parseInt(form.numberOfHotelQuads.value)
	sumOfRooms += parseInt(form.numberOfApartmentStudios.value)
	sumOfRooms += parseInt(form.numberOfApartments1Bed.value)
	sumOfRooms += parseInt(form.numberOfApartments2Bed.value)
	sumOfRooms += parseInt(form.numberOfApartments3Bed.value)
	sumOfRooms += parseInt(form.numberOfVillasSleeps2.value)
	sumOfRooms += parseInt(form.numberOfVillasSleeps3.value)
	sumOfRooms += parseInt(form.numberOfVillasSleeps4.value)
	sumOfRooms += parseInt(form.numberOfVillasSleeps5.value)	
	return sumOfRooms;
}*/








function hideLayer(){

if (pleaseShow==0) {
		document.getElementById("gridPopup").style.visibility='hidden';
		document.getElementById("gridPopupShadow").style.visibility='hidden';
	}
}

// Mouse position...
var isNav = (navigator.appName.indexOf("Netscape") !=-1);
function handlerMM(e){
xxx = (isNav) ? (window.innerWidth/2)-50 : (document.body.offsetWidth/2)-50;
yyy = (isNav) ? e.pageY : event.clientY + document.body.scrollTop;
}
if (isNav){document.captureEvents(Event.MOUSEMOVE);}
document.onmousemove = handlerMM;






