function formJump(url)
{
	if (url != '')
		self.location = url;
}

function changeButtonClass(b)
{
	if ((b.style.color == '#000000') || (b.style.color == 'rgb(0, 0, 0)'))
	{
		b.style.color='#008000';
	}
	else
	{
		b.style.color='#000000';
		b.style.cursor='pointer';
	}
}

function changeButtonClassGrey(b)
{
	if ((b.style.color == '#000000') || (b.style.color == 'rgb(0, 0, 0)'))
	{
		b.style.color='#808080';
	}
	else
	{
		b.style.color='#000000';
		b.style.cursor='pointer';
	}
}

function openCalendar(url)
{
  var params="menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,dependent,top=0,left=0,width=680,height=210";
  popupWin = window.open(url, 'calendar',params);
  popupWin.focus();
}

function createDropdown(b,e,s)
{
	for (i=b; i<=e; i++)
	{
		if (i==s)
			document.write('<option value="'+i+'" selected="selected">'+i+'</option>');
		else
			document.write('<option value="'+i+'">'+i+'</option>');
	}
}

function showRooms(r, c)
{
	kids=document.form.kidsage.value;
	if (kids=='') kidspace=0;
	else kidspace=31;
	for (i=2; i<=5; i++)
	{
		document.getElementById('otherRooms'+i).style.display = 'none';
	}
	document.form.roomtype2.selectedIndex=0;
	document.form.roomtype3.selectedIndex=0;
	document.form.roomtype4.selectedIndex=0;
	document.form.roomtype5.selectedIndex=0;
	if (r>1)
	{
		for (i=2; i<=r; i++)
		{
			document.getElementById('otherRooms'+i).style.display = 'block';
		}
	}
}

function setGuests(br)
{
	f = document.form;
	adults = 0;
	children = 0;
	m = f.rooms.options[f.rooms.selectedIndex].value;
	lb = "";
	if (br==1)
		lb = "<br />";
	for (i=1; i<=m; i++)
	{
		if ((f['roomtype'+i].options[f['roomtype'+i].selectedIndex].value=='doubleroom')||(f['roomtype'+i].options[f['roomtype'+i].selectedIndex].value=='twin')||(f['roomtype'+i].options[f['roomtype'+i].selectedIndex].value=='family3'))
			adults = adults + 2;
		if (f['roomtype'+i].options[f['roomtype'+i].selectedIndex].value=='single')
			adults = adults + 1;
		if (f['roomtype'+i].options[f['roomtype'+i].selectedIndex].value=='triple')
			adults = adults + 3;
		if (f['roomtype'+i].options[f['roomtype'+i].selectedIndex].value=='family1')
		{
			adults = adults + 2;
			children = children + 1;
		}
		if (f['roomtype'+i].options[f['roomtype'+i].selectedIndex].value=='family2')
		{
			adults = adults + 2;
			children = children + 2;
		}
	}

	if (br!=2)
	{
		if ((children==0)&&(adults>0))
			document.getElementById('guestText').innerHTML = adults + ' Adults';
		else if (adults>0)
			document.getElementById('guestText').innerHTML = adults + ' Adults, ' + lb + children + ' Children (age:' + f.kidsage.value + ')';
		else
			document.getElementById('guestText').innerHTML = '';
	}
	f.adults.value = adults;
	f.children.value = children;
}

function setGuestsFree()
{
	f = document.form;
	adults = 0;
	children = 0;

	if (f.family1.selectedIndex>0)
	{
		adults = adults + (2 * f.family1.selectedIndex);
		children = children + (1 * f.family1.selectedIndex);
	}
	if (f.family2.selectedIndex>0)
	{
		adults = adults + (2 * f.family2.selectedIndex);
		children = children + (2 * f.family2.selectedIndex);
	}
	f.adults.value = adults;
	f.children.value = children;
}

function blankOtherCities()
{
	f = document.form;
	c = f.city.length;
	for (i=0; i<c; i++)
	{
		if (f.city[i].checked==true)
			f.other_city.selectedIndex = 0;
	}
}

function blankCities()
{
	f = document.form;
	c = f.city.length;
	if (f.other_city.selectedIndex!=0)
	{
		f.city.value = f.other_city.options[f.other_city.selectedIndex].value;
	}
}

function showAdvanced(c)
{
	f = document.form;
	s = document.getElementById('advancedSearch');
	a = document.getElementById('advancedLink');
	l = document.getElementById('selectEither');
	r = document.form.rooms.options[document.form.rooms.selectedIndex].value;
	kids=document.form.kidsage.value;
	if (kids=='') kidspace=0;
	else kidspace=31;

	if ((s.style.display=='')||(s.style.display=='none'))
	{
		s.style.display = 'block';
		a.className = 'black8';
		l.style.visibility = 'visible';
		document.cookie = "advanced=1";
	}
	else
	{
		s.style.display = 'none';
		a.className = 'green8';
		l.style.visibility = 'hidden';
		//f.price.selectedIndex = 0;
		f.category.selectedIndex = 0;
		f.location.selectedIndex = 0;
		f.hotelname.selectedIndex = 0;
		f.facilities.selectedIndex = 0;
		document.cookie = "advanced=0";
	}
}

function showAdvanced2(c)
{
	f = document.form;
	s = document.getElementById('advancedSearch');
	a = document.getElementById('advancedLink');
	l = document.getElementById('selectEither');
	r = document.form.rooms.options[document.form.rooms.selectedIndex].value;
	kids=document.form.kidsage.value;
	if (kids=='') kidspace=0;
	else kidspace=31;

	if ((s.style.display=='')||(s.style.display=='none'))
	{
		s.style.display = 'block';
		a.className = 'black8';
		l.style.visibility = 'visible';
		document.cookie = "advanced=1";
	}
	else
	{
		s.style.display = 'none';
		a.className = 'green8';
		l.style.visibility = 'hidden';
		document.cookie = "advanced=0";
	}
}

function clearAdvanced()
{
	f = document.form;

	f.attraction.selectedIndex = 0;
	if (f.tube)
		f.tube.selectedIndex = 0;
	if (f.rail)
		f.rail.selectedIndex = 0;
	//f.price.selectedIndex = 0;
	f.category.selectedIndex = 0;
	f.location.selectedIndex = 0;
	f.hotelname.selectedIndex = 0;
	f.facilities.selectedIndex = 0;
}

function blankAdvanced(a)
{
	f = document.form;
	i = a.selectedIndex;
	n = a.name;

	clearAdvanced();

	f[n].selectedIndex = i;
}

function resetAdvancedSearch(x)
{
	f = document.form;
	cookie = document.cookie;
	broken_cookie = cookie.split(";");
	m = broken_cookie.length;

	for (i=0; i<m; i++)
	{
		broken_cookie[i] = trimCookie(broken_cookie[i]);
		if (broken_cookie[i] == 'advanced=0')
		{
			clearAdvanced();
		}
		else if (broken_cookie[i] == 'advanced=1')
		{
			showAdvanced(0);
		}
	}
	advancedLinkCookie(x);
}

function resetAdvancedSearch2(x)
{
	f = document.form;
	cookie = document.cookie;
	broken_cookie = cookie.split(";");
	m = broken_cookie.length;

	for (i=0; i<m; i++)
	{
		broken_cookie[i] = trimCookie(broken_cookie[i]);
		if (broken_cookie[i] == 'advanced=0')
		{
			clearAdvanced();
		}
		else if (broken_cookie[i] == 'advanced=1')
		{
			showAdvanced2(0);
		}
	}
	advancedLinkCookie(x);
}

function advancedLinkCookie(x)
{
	f = document.form;
	cookie = document.cookie;
	broken_cookie = cookie.split(";");
	m = broken_cookie.length;

	for (i=0; i<m; i++)
	{
		if ((broken_cookie[i] == 'advancedLink=1') && (x == 1))
		{
			showAdvancedLink();
		}
	}
}

function moveOffers(p)
{
	document.getElementById('offer2').style.paddingTop = p + 'px';
	document.getElementById('offer3').style.paddingTop = p + 'px';
	document.getElementById('offer4').style.paddingTop = p + 'px';
}

function showGallery(image, n , m)
{
	document.getElementById('mainImage').src = 'http://www.hoteldirect.co.uk/images/' + image;
	for (i=1; i<=m; i++)
	{
		document.getElementById('thumb'+i).style.filter = 'alpha(opacity=50)';
		document.getElementById('thumbLink'+i).className = 'green8';
	}
	document.getElementById('thumb'+n).style.filter = 'alpha(opacity=100)';
	document.getElementById('thumbLink'+n).className = 'black8_noline';
	document.getElementById('galleryText').innerHTML = document.getElementById('thumbLink'+n).innerText;
}

function changeGalleryLink(m, t)
{
	if (m > -1)
		SLIDES.goto_slide(m);
	document.getElementById('slideshowImage').style.display = "block";
	document.getElementById('map').style.display = "none";
	document.getElementById('slideShowLink').className = 'green9';
	document.getElementById('mapLink').className = 'hotelMapGreen';
	for (i=0; i<=t; i++)
	{
		document.getElementById('thumbLink'+i).className = 'green7';
	}
	if (m == -1)
	{
		document.getElementById('slideShowLink').className = 'black9_noline';
		for (i=0; i<=t; i++)
		{
			document.getElementById('thumbLink'+i).className = 'green7';
		}
	}
	else
		document.getElementById('thumbLink'+m).className = 'black7_noline';
}

function showSlideshow(m, t)
{
	changeGalleryLink(m, t);
	document.getElementById('slideshowImage').style.display = "block";
	document.getElementById('map').style.display = "none";
	document.getElementById('mapLink').className = 'hotelMapGreen';
}

function showMap()
{
	document.getElementById('mapLink').className = 'hotelMapBlack';
	document.getElementById('slideShowLink').className = 'green9';
	document.getElementById('slideshowImage').style.display = "none";
	document.getElementById('map').style.display = "block";
}

function showMap2()
{
	document.getElementById('mapLink').className = 'hotelMapBlack';
	document.getElementById('slideshowImage').style.display = "none";
	document.getElementById('map').style.display = "block";
}

function numbersOnly(field)
{
	var valid = "0123456789"
	ok = 1;
	var temp;
	for (var i=0; i<field.value.length; i++)
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1")
			ok = 0;
	}
	if (ok==0)
	{
		alert("Please only enter numbers in this field!");
		field.focus();
		field.select();
	}
}

function sameAddress()
{
	f = document.form;
	if (f.copy_address.checked==true)
	{
		f.ccaddress.value = f.address.value;
		f.cccity.value = f.custcity.value;
		if (f.ccstate && f.county) f.ccstate.value = f.county.value;
		f.ccpostcode.value = f.postcode.value;
		f.cccountry.selectedIndex = f.country.selectedIndex;
	}
	else
	{
		f.ccaddress.value = '';
		f.cccity.value = '';
		if (f.ccstate) f.ccstate.value = '';
		f.ccpostcode.value = '';
	}
}

function sameAddress2()
{
	f = document.form;
	f.ccaddress.value = f.address.value;
	f.cccity.value = f.custcity.value;
	f.ccpostcode.value = f.postcode.value;
	f.cccountry.selectedIndex = f.country.selectedIndex;
}

function setKids(t)
{
        showKidsAge();
/*
	f=document.form;
	if (((t.options[t.selectedIndex].value=='family1')||(t.options[t.selectedIndex].value=='family2'))&&(f.kidsage.value==''))
	{
		openWindow('http://www.hoteldirect.co.uk/kidsage.htm',365,180,'no');
	}
*/
}

function showKidsAge()
{

	f = document.form;
	s = document.getElementById('kidsagediv');
	r1 = document.form.roomtype1.options[document.form.roomtype1.selectedIndex].value;
	r2 = document.form.roomtype2.options[document.form.roomtype2.selectedIndex].value;
	r3 = document.form.roomtype3.options[document.form.roomtype3.selectedIndex].value;
	r4 = document.form.roomtype4.options[document.form.roomtype4.selectedIndex].value;
	r5 = document.form.roomtype5.options[document.form.roomtype5.selectedIndex].value;
	r = document.form.rooms.options[document.form.rooms.selectedIndex].value;

	if ((r1.indexOf('family1')>-1) || (r2.indexOf('family1')>-1) || (r3.indexOf('family1')>-1) || (r4.indexOf('family1')>-1) || (r5.indexOf('family1')>-1) || (r1.indexOf('family2')>-1) || (r2.indexOf('family2')>-1) || (r3.indexOf('family2')>-1) || (r4.indexOf('family2')>-1) || (r5.indexOf('family2')>-1))
	{
		s.style.display = 'block';
		kidspace=31;
	}
	else
	{
		s.style.display = 'none';
		kidspace=0;
	}
}

function showKidsAge2()
{

	f = document.form;
	s = document.getElementById('kidsagediv');
	r1 = document.form.roomtype1.options[document.form.roomtype1.selectedIndex].value;
	r2 = document.form.roomtype2.options[document.form.roomtype2.selectedIndex].value;
	r3 = document.form.roomtype3.options[document.form.roomtype3.selectedIndex].value;
	r4 = document.form.roomtype4.options[document.form.roomtype4.selectedIndex].value;
	r5 = document.form.roomtype5.options[document.form.roomtype5.selectedIndex].value;

	if ((r1.indexOf('family1')>-1) || (r2.indexOf('family1')>-1) || (r3.indexOf('family1')>-1) || (r4.indexOf('family1')>-1) || (r5.indexOf('family1')>-1) || (r1.indexOf('family2')>-1) || (r2.indexOf('family2')>-1) || (r3.indexOf('family2')>-1) || (r4.indexOf('family2')>-1) || (r5.indexOf('family2')>-1))
	{
		s.style.display = 'block';
	}
	else
	{
		s.style.display = 'none';
	}
}


function openWindow(url, w, h, s)
{
	var params="menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars="+s+",resizable=yes,dependent,top=0,left=0,width="+w+",height="+h;
	popupWin = window.open(url, 'popup',params);
	popupWin.focus();
}

function openMap(url, w, h)
{
	url=url.replace('2&3','2%263');
	var params="menubar=yes,toolbar=yes,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,dependent,top=0,left=0,width="+w+",height="+h;
	popupWin = window.open(url, 'popup',params);
	popupWin.focus();
}

function ageOnly(field)
{
	var valid = "0123456789,"
	ok = 1;
	var temp;
	for (var i=0; i<field.value.length; i++)
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1")
			ok = 0;
	}
	if (ok==0)
	{
		alert("Please only enter numbers in this field!");
		field.focus();
		field.select();
	}
}

function setAge()
{
	w=window.opener.document.form;
	f=document.form;

	if (f.kidsage.value=='')
	{
		alert('Please enter the age of the child/children');
	}
	errors="";
	errorcheck=0;
	stripNumber(f.kidsage.value,w.maxage.value);
	if (errorcheck==1)
		alert(errors);
	else
	{
		w.kidsage.value=f.kidsage.value;
		window.close();
	}
}

function stripNumber(number,maxage)
{
	age = 0;
	max = parseInt(maxage);
	var comma = number.indexOf(',');
	if (comma!=-1)
	{
		age = number.substring(0,comma);
		if (age>max)
		{
			errors = errors + 'The age '+age+' is too old for a child at this hotel. Maximum age: '+maxage+'\n\n';
			errorcheck = 1;
		}
		var newnumber = number.substring(comma+1);
		stripNumber(newnumber,max);
	}
	if (comma==-1)
	{
		age = number;
		if (age>max)
		{
			errors = errors + 'The age '+age+' is too old for a child at this hotel. Maximum age: '+maxage+'\n\n';
			errorcheck = 1;
		}
	}
}

function setCurrency(c)
{
	if (c=='usdollar') c='usd';
	document.cookie = "currency=" + c;
	url = document.URL;
	pos=url.indexOf('?_$ja=');
	if (pos>-1)
	{
		pos2=url.indexOf('&');
		if (pos2>-1) url=url.substring(0,pos)+"?"+url.substring(pos2+1);
		else url=url.substring(0,pos);
	}
	if (url.indexOf('?')>-1)
	{
		pos=url.indexOf('currency=');
		if (pos>-1)
		{
			url=url.replace('currency=','currency2=');
			document.location = url + "&currency=" + c;
		}
		else document.location = url + "&currency=" + c;
	}
	else if (url.indexOf('?')==-1 && url.indexOf('HDFront')>-1)
	{
		if (c=='usd') c='usdollar';
		document.hiddencurrencyform.currency.value=c;
		document.hiddencurrencyform.submit();
	}
	else if (url.indexOf('?')==-1 && url.indexOf('HDSearchDate')>-1)
	{
		if (c=='usd') c='usdollar';
		document.mainform.currency.value=c;
		document.mainform.submit();
	}
	else
	{
		if (url.indexOf('currency=')>-1)
			document.location = url.substring(0, url.indexOf('currency=')) + "currency=" + c;
		else
		{
		  lastchar=url.length;
		  if (url.indexOf('.htm')==-1 && url.indexOf('servlet')==-1)
			document.location = url + "index_" + c+".htm";
		  else
		  {
		    if (url.indexOf('index_')>-1)
		    {
			if (c=='gbp')
			{
			   pos=url.indexOf('index_');
			   document.location = url.substring(0,pos);		  	   
			}
			else
		  	{
			   pos=url.indexOf('index_');
	  	  	   document.location = url.substring(0,pos)+ "index_" + c+".htm";  
			}
		    }
		    else if (url.indexOf('.htm')>-1)
		    {
			pos=url.indexOf(".htm");
			if (c=='gbp')
			{
			   pos2=url.indexOf('_usd.htm');
			   if (pos2>-1) document.location = url.substring(0,pos2)+".htm";  		  	   
			   else 
			   {	
				pos2=url.indexOf('_euro.htm');
				if (pos2>-1) document.location = url.substring(0,pos2)+".htm";  		  	   
			   }
			}
			else
			{
			   pos2=url.indexOf('_usd.htm');
			   if (pos2>-1) document.location = url.substring(0,pos2)+"_"+c+".htm";  		  	   
			   else 
			   {	
				pos2=url.indexOf('_euro.htm');
				if (pos2>-1) document.location = url.substring(0,pos2)+"_"+c+".htm";  		  	   
				else document.location = url.substring(0,pos)+"_"+c+".htm";
			   }
			}
		    }
		    else
			document.location = url + "?currency=" + c;
		  }
		}
	}
}

function getCurrency()
{
/*
	cookie = document.cookie;
	broken_cookie = cookie.split(";");
	m = broken_cookie.length;

	for (i=0; i<m; i++)
	{
		broken_cookie[i] = trimCookie(broken_cookie[i]);
		if (broken_cookie[i]=='currency=usd')
			document.getElementById('usd').className = document.getElementById('usd').className + " sel";
		else if (broken_cookie[i]=='currency=euro')
			document.getElementById('euro').className = document.getElementById('euro').className + " sel";
		else
			document.getElementById('gbp').className = document.getElementById('gbp').className + " sel";
	}
*/
}

function setHotelcookie(hotelid,hname,city,thumbnail,hotelcurrency)
{
	var now = new Date();
	now.setTime(now.getTime() + 7 * 24 * 60 * 60 * 1000);
	document.cookie = "hotelid=" + hotelid+"; domain=www.hoteldirect.co.uk; path=/;expires="+now.toGMTString()+";";
	document.cookie = "hname=" + hname+"; domain=www.hoteldirect.co.uk; path=/;expires="+now.toGMTString()+";";
	document.cookie = "city=" + city+"; domain=www.hoteldirect.co.uk; path=/;expires="+now.toGMTString()+";";
	document.cookie = "thumbnail=" + thumbnail+"; domain=www.hoteldirect.co.uk; path=/;expires="+now.toGMTString()+";";
	document.cookie = "hotelcurrency=" + hotelcurrency+"; domain=www.hoteldirect.co.uk; path=/;expires="+now.toGMTString()+";";
}

function getHotelcookie(page,thiscity)
{
	cookie = document.cookie;
	broken_cookie = cookie.split(";");
	m = broken_cookie.length;
	hotelid=0;hname='';thumbnail='';hotelcurrency='';city='';

	for (i=0; i<m; i++)
	{
		broken_cookie[i] = trimCookie(broken_cookie[i]);
		if (broken_cookie[i].indexOf('hotelid=')>-1) hotelid=broken_cookie[i].substring(8);
		if (broken_cookie[i].indexOf('hname=')>-1) hname=broken_cookie[i].substring(6);
		if (broken_cookie[i].indexOf('city=')>-1) city=broken_cookie[i].substring(5);
		if (broken_cookie[i].indexOf('thumbnail=')>-1) thumbnail=broken_cookie[i].substring(10);
		if (broken_cookie[i].indexOf('hotelcurrency=')>-1) hotelcurrency=broken_cookie[i].substring(14);
		if (hotelid!=0 && hname!='' && city!='' && thumbnail!='' && hotelcurrency!='') 
		{
		   if (page=='city') 
		   {
			if (city==thiscity) break;
			else 
			{
				hotelid=0;hname='';thumbnail='';hotelcurrency='';city='';
			}
		   }
		   else break;
		}
	}
	if (hotelid!=0 && hname!='' && city!='' && thumbnail!='' && hotelcurrency!='')
	{
		thumbnailurl="http://www.hoteldirect.co.uk/images/";
		if (thumbnail.indexOf("hotels/")>-1) thumbnailurl="http://extimages.hoteldirect.co.uk/";
		document.write("<tr><td align=\"center\"><TABLE WIDTH=\"203\"><TR><TD style=\"border:solid 2px #EEC5FF\"><B>YOUR BROWSING HISTORY</B><BR><a class=\"offer\" href=\"http://www.hoteldirect.co.uk/webapp/hoteldirect/servlet/HDViewPage?web=yes&purpose=hotel&hotelid="+hotelid+"&city="+city+"&currency="+hotelcurrency+"\"><img border=\"0\" style=\"border:1px solid #008800\" height=\"47\" src=\""+thumbnailurl+thumbnail+"\" width=\"72\" onclick=\"logOCPV('isconv=0|pover=Browsing_History');\" alt=\""+hname+"\"/></a><BR>You previously viewed the<BR><a class=\"offer\" onclick=\"logOCPV('isconv=0|pover=Browsing_History');\" href=\"http://www.hoteldirect.co.uk/webapp/hoteldirect/servlet/HDViewPage?web=yes&purpose=hotel&hotelid="+hotelid+"&city="+city+"&currency="+hotelcurrency+"\">"+hname+" Hotel</a></TD></TR></TABLE></td></tr><tr><td height=\"3\"></td></tr>");
	}
}

function checkHotelcookiecitypage(thiscity)
{
	cookie = document.cookie;
	broken_cookie = cookie.split(";");
	m = broken_cookie.length;
	hotelid=0;hname='';thumbnail='';hotelcurrency='';city='';

	for (i=0; i<m; i++)
	{
		broken_cookie[i] = trimCookie(broken_cookie[i]);
		if (broken_cookie[i].indexOf('hotelid=')>-1) hotelid=broken_cookie[i].substring(8);
		if (broken_cookie[i].indexOf('hname=')>-1) hname=broken_cookie[i].substring(6);
		if (broken_cookie[i].indexOf('city=')>-1) city=broken_cookie[i].substring(5);
		if (broken_cookie[i].indexOf('thumbnail=')>-1) thumbnail=broken_cookie[i].substring(10);
		if (broken_cookie[i].indexOf('hotelcurrency=')>-1) hotelcurrency=broken_cookie[i].substring(14);
		if (hotelid!=0 && hname!='' && city!='' && thumbnail!='' && hotelcurrency!='') 
		{
			if (city==thiscity) break;
			else 
			{
				hotelid=0;hname='';thumbnail='';hotelcurrency='';city='';
			}
		}
	}
	if (hotelid!=0 && hname!='' && city!='' && thumbnail!='' && hotelcurrency!='')
		document.getElementById('extraelems').style.display = 'none';
}


function trimCookie(str)
{
	return str.replace(/^\s+/,"").replace(/\s+$/,"").replace(/\s+/g," ");
}


function checkCompareForm()
{
 f=document.compareform;
 max=f.total.value;
 found=false;
 i=1;
 while (!found && i<=max)
 {
  if (f['hotel'+i].checked==true) found=true;
  else i++;
 }
 if (!found)
 {
   window.alert('Please select at least one hotel');
   return false;
 }
 else f.submit();
}

function showYear()
{
 now = new Date();
 document.write(now.getFullYear()); 
}

function changeRow(n)
{
	document.getElementById('row'+n).className = "resultsHover";
}

function changeRowmap(n)
{
	document.getElementById('row'+n).className = "resultsHover2";
}

function resetRow(n)
{
	document.getElementById('row'+n).className = "";
}

var lock = false;
var run;
	
//loading the slideshow based on the play/pause button
function auto() {
	//document.getElementById("SLIDESIMG").style.display = 'block';
	if (lock == true) {		lock = false;		SLIDES.pause();	}	else if (lock == false) {		lock = true;		SLIDES.next(); 		SLIDES.play();
	}
}

function loadImage() {
	//the line below used to cause misaligns slideshow in firefox 
	document.getElementById("SLIDESIMG").style.display = 'block';
	SLIDES.pause();
	lock = false;
}

function homepagecity()
{

		if (document.form.city2.options[document.form.city2.selectedIndex].value == "London" || document.form.city2.options[document.form.city2.selectedIndex].value == "Barcelona" || document.form.city2.options[document.form.city2.selectedIndex].value == "Dublin" || document.form.city2.options[document.form.city2.selectedIndex].value == "Edinburgh" || document.form.city2.options[document.form.city2.selectedIndex].value == "Paris")
		{
			showAdvancedLink2();
		}
		else 
		{
			hideAdvancedLink2();
		}

		c = document.form.city.length;
		for (i=0; i<c; i++)
			document.form.city[i].checked=false;
}

function changebackgroundcolourcat(total,thisname,cellname,optionnumber)
{
  for (i=1;i<=total;i++)
    document.getElementById('cellcat'+i).style.background="#ffffff";
  for (i=0;i<total;i++)
    if (i!=optionnumber) document.thisform.category[i].checked=false;
  if (thisname.checked) document.getElementById(cellname).style.background="#EEC5FF";
}
function changebackgroundcolourloc(total,thisname,cellname,optionnumber)
{
  for (i=1;i<=total;i++)
    document.getElementById('cellloc'+i).style.background="#ffffff";  
  for (i=0;i<total;i++)
    if (i!=optionnumber) document.thisform.location[i].checked=false;
  if (thisname.checked) document.getElementById(cellname).style.background="#EEC5FF";
}
function changebackgroundcolourfac(total,thisname,cellname,optionnumber)
{
  for (i=1;i<=total;i++)
     document.getElementById('cellfac'+i).style.background="#ffffff";
  for (i=0;i<total;i++)
    if (i!=optionnumber) document.thisform.facilities[i].checked=false;
  if (thisname.checked) document.getElementById(cellname).style.background="#EEC5FF";
}

function gothere(thisname,url,paramname)
{
  if (!thisname.checked)
  {
     url=url.replace(paramname,paramname+"3");
     url=url.replace(paramname+"2",paramname+"4");
  }
  if (url.indexOf("category=")==-1 && url.indexOf("location=")==-1 && url.indexOf("facilities=")==-1)
     url=url.replace("category2=","category=");
  if (url.indexOf("category=")==-1 && url.indexOf("location=")==-1 && url.indexOf("facilities=")==-1)
     url=url.replace("location2=","location=");
  if (url.indexOf("category=")==-1 && url.indexOf("location=")==-1 && url.indexOf("facilities=")==-1)
     url=url.replace("facilities2=","facilities=");
  if (url.indexOf("category=")==-1 && url.indexOf("location=")==-1 && url.indexOf("facilities=")==-1 && url.indexOf("category2=")==-1 && url.indexOf("location2=")==-1 && url.indexOf("facilities2=")==-1)
     url=url+"&allhotels=yes";
  window.location=url;
}

function showlocations(ini,total)
{
  if (document.getElementById('moreloc').innerHTML == "Show more locations")
  {
    for (i=parseInt(ini);i<=parseInt(total);i++)
    {
      document.getElementById('cellloc'+i).style.display= 'block';
    }
    document.getElementById('moreloc').innerHTML= 'Show fewer locations';
  }
  else 
  {
    for (i=parseInt(ini);i<=parseInt(total);i++)
      document.getElementById('cellloc'+i).style.display= 'none';
    document.getElementById('moreloc').innerHTML= 'Show more locations';
  }
}

function h_usetrackscript()
{
/*
if(typeof(_gat)!='object')document.write('<sc'+'ript src="http'+
(document.location.protocol=='https:'?'s://ssl':'://www')+
'.google-analytics.com/ga.js"></sc'+'ript>')

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/1816597459/goal");
}catch(err){}


if(typeof(_gat)!='object')document.write('<sc'+'ript src="http'+
(document.location.protocol=='https:'?'s://ssl':'://www')+
'.google-analytics.com/ga.js"></sc'+'ript>')

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/3144323754/goal");
}catch(err){}


if(typeof(_gat)!='object')document.write('<sc'+'ript src="http'+
(document.location.protocol=='https:'?'s://ssl':'://www')+
'.google-analytics.com/ga.js"></sc'+'ript>')

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/1303719417/goal");
}catch(err){}


if(typeof(_gat)!='object')document.write('<sc'+'ript src="http'+
(document.location.protocol=='https:'?'s://ssl':'://www')+
'.google-analytics.com/ga.js"></sc'+'ript>');

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/3488345035/goal");
}catch(err){}

if(typeof(_gat)!='object')document.write('<sc'+'ript src="http'+
(document.location.protocol=='https:'?'s://ssl':'://www')+
'.google-analytics.com/ga.js"></sc'+'ript>');

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/0688357079/goal");
}catch(err){}
*/

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/3672949867/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/2014552412/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/2219024885/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/0465445023/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/3055157577/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/2301743133/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/2504550131/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/3285729961/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/4170681435/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/3899416491/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/2142509639/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/3518587889/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/0094412978/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/0253871119/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/1077636006/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/4140358200/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/3704322212/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/0032646490/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/2037950656/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/2892985305/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/0653775711/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/3760638927/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/0150957039/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/2702919600/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/2884013543/goal");
}catch(err){}

try {
var gwoTracker=_gat._getTracker("UA-9365323-1");
gwoTracker._trackPageview("/0775257921/goal");
}catch(err){}

}