//var base = "http://andypc/LNOF/";
var base = "http://www.lastnightoffreedom.co.uk/";

var url = window.location.toString();
if(url.indexOf("https:") != -1)
{
	base = base.replace("http:","https:");
}
var m_imgPfx = base.substring(0,base.length-1);

//var callbackpage = "http://andypc/LNOF/RequestCallback.aspx";
var callbackpage = "http://www.lastnightoffreedom.co.uk/RequestCallback.aspx";



// *******************************************************************************************************
// JavaScript Document
// This is used onload so that IE can render the drop down navigation properly
// AJH - 18/05/2006
// *******************************************************************************************************
function sfHover()
{
     var sfEls = document.getElementById("topnav").getElementsByTagName("li");
     for (var i=0; i<sfEls.length; i++)
     {
          sfEls[i].onmouseover=function()
          {
               this.className+=" sfhover";
          }
          sfEls[i].onmouseout=function()
          {
               if(navigator.appName.indexOf("Internet Explorer")>-1)
               {
                         this.className=this.className.replace(" sfhover", "");
               }else{
                         this.className=this.className.replace(new RegExp("sfhover\\b"), "");
               }
          }
     }
	setwindowstatus();
	hidecontactforms();
}
function hidecontactforms()
{
	if($('ShowContactUs1') != null)	
	{ 
        if($('ShowContactUs1').style != null)
	        $('ShowContactUs1').style.display = 'none'; 
	}
	if($('ShowContactUs2') != null) 
	{ 
        if($('ShowContactUs2').style != null)
	        $('ShowContactUs2').style.display = 'none'; 
	}
	if($('EmailAFriend') != null) 	
	{ 
        if($('EmailAFriend').style != null)
	        $('EmailAFriend').style.display = 'none'; 
	}
}

function setwindowstatus()
{
	window.defaultStatus = "Probably the best stag and hen website in the world!";
}

// *******************************************************************************************************
// JavaScript Document
// This is to display the side navigation when user clicks
// AJH - 09/06/2006
// *******************************************************************************************************
function toggleLayer(whichLayer)
{
	if(whichLayer == "UKSideLinks")
	{	
		if (document.getElementById)
		{
			if($('UKSideLinks') != null)			{ $('UKSideLinks').style.display = 'block'; }
			if($('AbroadSideLinks') != null)		{ $('AbroadSideLinks').style.display = 'none'; }
			if($('ActivitiesSideLinks') != null)	{ $('ActivitiesSideLinks').style.display = 'none'; }
			if($('PlanningSideLinks') != null)		{ $('PlanningSideLinks').style.display = 'none'; }
			if($('MainSections') != null)			{ $('MainSections').style.display = 'none'; }
			if($('ShopSideLinks') != null)			{ $('ShopSideLinks').style.display = 'none'; }
		}
	}
	if(whichLayer == "AbroadSideLinks")
	{		
		if (document.getElementById)
		{
			if($('UKSideLinks') != null)			{ $('UKSideLinks').style.display = 'none'; }
			if($('AbroadSideLinks') != null)		{ $('AbroadSideLinks').style.display = 'block'; }
			if($('ActivitiesSideLinks') != null)	{ $('ActivitiesSideLinks').style.display = 'none'; }
			if($('PlanningSideLinks') != null)		{ $('PlanningSideLinks').style.display = 'none'; }
			if($('MainSections') != null)			{ $('MainSections').style.display = 'none'; }
			if($('ShopSideLinks') != null)			{ $('ShopSideLinks').style.display = 'none'; }				
		}
	}
	if(whichLayer == "ActivitiesSideLinks")
	{
		if (document.getElementById)
		{
			if($('UKSideLinks') != null)			{ $('UKSideLinks').style.display = 'none'; }
			if($('AbroadSideLinks') != null)		{ $('AbroadSideLinks').style.display = 'none'; }
			if($('ActivitiesSideLinks') != null)	{ $('ActivitiesSideLinks').style.display = 'block'; }
			if($('PlanningSideLinks') != null)		{ $('PlanningSideLinks').style.display = 'none'; }
			if($('MainSections') != null)			{ $('MainSections').style.display = 'none'; }
			if($('ShopSideLinks') != null)			{ $('ShopSideLinks').style.display = 'none'; }					
		}
	}	
	if(whichLayer == "PlanningSideLinks")
	{
		if (document.getElementById)
		{
			if($('UKSideLinks') != null)			{ $('UKSideLinks').style.display = 'none'; }
			if($('AbroadSideLinks') != null)		{ $('AbroadSideLinks').style.display = 'none'; }
			if($('ActivitiesSideLinks') != null)	{ $('ActivitiesSideLinks').style.display = 'none'; }
			if($('PlanningSideLinks') != null)		{ $('PlanningSideLinks').style.display = 'block'; }
			if($('MainSections') != null)			{ $('MainSections').style.display = 'none'; }
			if($('ShopSideLinks') != null)			{ $('ShopSideLinks').style.display = 'none'; }					
		}
	}	
	if(whichLayer == "MainSections")
	{
		if (document.getElementById)
		{
			if($('UKSideLinks') != null)			{ $('UKSideLinks').style.display = 'none'; }
			if($('AbroadSideLinks') != null)		{ $('AbroadSideLinks').style.display = 'none'; }
			if($('ActivitiesSideLinks') != null)	{ $('ActivitiesSideLinks').style.display = 'none'; }
			if($('PlanningSideLinks') != null)		{ $('PlanningSideLinks').style.display = 'none'; }
			if($('MainSections') != null)			{ $('MainSections').style.display = 'block'; }
			if($('ShopSideLinks') != null)			{ $('ShopSideLinks').style.display = 'none'; }					
		}
	}
	if(whichLayer == "ShopSideLinks")
	{
		if (document.getElementById)
		{
			if($('UKSideLinks') != null)			{ $('UKSideLinks').style.display = 'none'; }
			if($('AbroadSideLinks') != null)		{ $('AbroadSideLinks').style.display = 'none'; }
			if($('ActivitiesSideLinks') != null)	{ $('ActivitiesSideLinks').style.display = 'none'; }
			if($('PlanningSideLinks') != null)		{ $('PlanningSideLinks').style.display = 'none'; }
			if($('MainSections') != null)			{ $('MainSections').style.display = 'none'; }
			if($('ShopSideLinks') != null)			{ $('ShopSideLinks').style.display = 'block'; }				
		}
	}				
}
// *******************************************************************************************************
// JavaScript Document
// AJAX scripting
// AJH - 12/06/2006
// *******************************************************************************************************
function setNavigation(res)
{
	if(res.value == "UKLocation")
	{
		if($('UKSideLinks') != null)			{ $('UKSideLinks').style.display = 'block'; }
		if($('AbroadSideLinks') != null)		{ $('AbroadSideLinks').style.display = 'block'; }
		if($('ActivitiesSideLinks') != null)	{ $('ActivitiesSideLinks').style.display = 'none'; }
		if($('PlanningSideLinks') != null)		{ $('PlanningSideLinks').style.display = 'none'; }
		if($('MainSections') != null)			{ $('MainSections').style.display = 'none'; }
		if($('ShopSideLinks') != null)			{ $('ShopSideLinks').style.display = 'none'; }	
	}
	else if(res.value == "AbroadLocation")
	{
		if($('UKSideLinks') != null)			{ $('UKSideLinks').style.display = 'none'; }
		if($('AbroadSideLinks') != null)		{ $('AbroadSideLinks').style.display = 'block'; }
		if($('ActivitiesSideLinks') != null)	{ $('ActivitiesSideLinks').style.display = 'none'; }
		if($('PlanningSideLinks') != null)		{ $('PlanningSideLinks').style.display = 'none'; }
		if($('MainSections') != null)			{ $('MainSections').style.display = 'none'; }
		if($('ShopSideLinks') != null)			{ $('ShopSideLinks').style.display = 'none'; }				
	}
	else if(res.value == "Activities")
	{
		if($('UKSideLinks') != null)			{ $('UKSideLinks').style.display = 'none'; }
		if($('AbroadSideLinks') != null)		{ $('AbroadSideLinks').style.display = 'none'; }
		if($('ActivitiesSideLinks') != null)	{ $('ActivitiesSideLinks').style.display = 'block'; }
		if($('PlanningSideLinks') != null)		{ $('PlanningSideLinks').style.display = 'none'; }
		if($('MainSections') != null)			{ $('MainSections').style.display = 'none'; }
		if($('ShopSideLinks') != null)			{ $('ShopSideLinks').style.display = 'none'; }	
	}
	else if(res.value == "Planning")
	{
		if($('UKSideLinks') != null)			{ $('UKSideLinks').style.display = 'none'; }
		if($('AbroadSideLinks') != null)		{ $('AbroadSideLinks').style.display = 'none'; }
		if($('ActivitiesSideLinks') != null)	{ $('ActivitiesSideLinks').style.display = 'none'; }
		if($('PlanningSideLinks') != null)		{ $('PlanningSideLinks').style.display = 'block'; }
		if($('MainSections') != null)			{ $('MainSections').style.display = 'none'; }
		if($('ShopSideLinks') != null)			{ $('ShopSideLinks').style.display = 'block'; }	
	}	
	else if(res.value == "Shop")
	{
		if($('UKSideLinks') != null)			{ $('UKSideLinks').style.display = 'none'; }
		if($('AbroadSideLinks') != null)		{ $('AbroadSideLinks').style.display = 'none'; }
		if($('ActivitiesSideLinks') != null)	{ $('ActivitiesSideLinks').style.display = 'none'; }
		if($('PlanningSideLinks') != null)		{ $('PlanningSideLinks').style.display = 'none'; }
		if($('MainSections') != null)			{ $('MainSections').style.display = 'none'; }
		if($('ShopSideLinks') != null)			{ $('ShopSideLinks').style.display = 'block'; }		
	}		
	else if(res.value == "MainSections")
	{
		if($('UKSideLinks') != null)			{ $('UKSideLinks').style.display = 'none'; }
		if($('AbroadSideLinks') != null)		{ $('AbroadSideLinks').style.display = 'none'; }
		if($('ActivitiesSideLinks') != null)	{ $('ActivitiesSideLinks').style.display = 'none'; }
		if($('PlanningSideLinks') != null)		{ $('PlanningSideLinks').style.display = 'none'; }
		if($('MainSections') != null)			{ $('MainSections').style.display = 'none'; }
		if($('ShopSideLinks') != null)			{ $('ShopSideLinks').style.display = 'block'; }
	}
}
function getActivity()
{	
	var activityID = getQueryVariable("act");
	if(activityID != null)
	{
		setActivitiesVisible();
		colorlinkactivity(activityID);
	}
}
function setActivitiesVisible()
{
	if($('UKSideLinks') != null)			{ $('UKSideLinks').style.display = 'none'; }
	if($('AbroadSideLinks') != null)		{ $('AbroadSideLinks').style.display = 'none'; }
	if($('ActivitiesSideLinks') != null)	{ $('ActivitiesSideLinks').style.display = 'none'; }
	if($('PlanningSideLinks') != null)		{ $('PlanningSideLinks').style.display = 'block'; }
	if($('MainSections') != null)			{ $('MainSections').style.display = 'none'; }
	if($('ShopSideLinks') != null)			{ $('ShopSideLinks').style.display = 'none'; }
}
// *******************************************************************************************************
// JavaScript Document
// Colorize the side nav link
// AJH - 12/06/2006
// *******************************************************************************************************
function colorlinkactivity(actID)
{
	if(actID != null)
	{
		if($('actd' + actID) != null)	{ $('actd' + actID).style.color = '#FFA500'; }
		if($('actn' + actID) != null)	{ $('actn' + actID).style.color = '#FFA500'; }
	}
}
// *******************************************************************************************************
// JavaScript Document
// Roll over images
// AJH - 13/06/2006
// *******************************************************************************************************
function roll_over(img_src)
{
	if($2('mainImgShow') != null)	
	{ 
	    $2('mainImgShow').src = "images/locations/" + img_src; 
	}
}

// *******************************************************************************************************
// JavaScript Document
// how-to-get-to.aspx
// Get Flights Data: Uses AJAX 
// AJH - 25/07/2006
// *******************************************************************************************************

function LinkToAirline()
{
	var listAirportLinks = document.getElementById("HowToGetTo1_listAirportLinks");
    var link = listAirportLinks.options[listAirportLinks.selectedIndex].value;	
    window.open(link);
}
function DownLoadGE()
{
	var url = "http://earth.google.com/download-earth.html";
	zzz = window.open(url,'','width=800,height=600,scrollbars=yes,left=0,top=0');
	zzz.focus();
}
function ShowGETour()
{
	var url = "http://earth.google.com/tour/";
	zzz = window.open(url,'','width=800,height=600,scrollbars=yes,left=0,top=0');
	zzz.focus();
}
function showTerms(SchemeID)
{
	var url = base + "terms.aspx?SchemeID=" + SchemeID;
	zzz = window.open(url,'','width=500,height=620,scrollbars=yes,left=400,top=100')
	zzz.focus()		
}

// *******************************************************************************************************
// JavaScript Document
// Show/Hide Map
// AJH - 03/08/2006
// *******************************************************************************************************
function ShowMap()
{
	var map = document.getElementById('map').style;
	map.visibility = map.visibility = "visible";
}
function HideMap()
{
	var map = document.getElementById('map').style;
	map.visibility = map.visibility = "hidden";
}
// *******************************************************************************************************
// JavaScript Document
// Get Google Map
// AJH - 08/08/2006
// *******************************************************************************************************
function loadmap(longitude,latitude) 
{
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("googlemap"));
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		map.setCenter(new GLatLng(longitude, latitude), 10);

	}
}
// *******************************************************************************************************
// JavaScript Document
// Embed Flash elements using swfobject.js
// Courtesy of: http://blog.deconcept.com/swfobject/
// AJH - 09/08/2006
// *******************************************************************************************************
//var so = new SWFObject("movie.swf", "mymovie", "200", "100", "7", "#336699");
//Create a new SWFObject and pass in the required parameters:
//    * swf - The file path and name to your swf file.
//    * id - The ID of your object or embed tag. The embed tag will also have this value set as it's name attribute for files that take advantage of swliveconnect.
//    * width - The width of your Flash movie.
//    * height - The height of your Flash movie.
//    * version - The required player version for your Flash content. This can be a string in the format of 'majorVersion.minorVersion.revision'. An example would be: "6.0.65". Or you can just require the major version, such as "6".
//    * background color - This is the hex value of the background color of your Flash movie.
function embeddenzilbanner()
{
//	var so = new SWFObject("flash/denzil-banner.swf","SpecialOffers","420","90","6","#FFFFFF");
//	so.addParam("wmode", "transparent");
//	so.addVariable("myURL", window.location);
//	so.write("denzilbanner");
}
function embedflashweather()
{
	var so = new SWFObject("flash/weather/Newcastle.swf","Weather","530","290","7","#FFFFFF");
	so.addParam("wmode", "transparent");
	so.write("flashcontent");
}
function embedflashfeedback1(a1,a2,a3,a4,a5,t1)
{
	//alert("a1=" + a1 + "\n" + "a2=" + a2 + "\n" + "a3=" + a3 + "\n" + "a4=" + a4 + "\n" + "a5=" + a5 + "\n" + "t1=" + t1 + "\n");
	var so = new SWFObject("flash/feedback/LocationFeedback6.swf","Feedback","500","380","7","#FFFFFF");
	so.addParam("wmode", "transparent");
	so.addVariable("a1", a1);
	so.addVariable("a2", a2);
	so.addVariable("a3", a3);
	so.addVariable("a4", a4);
	so.addVariable("a5", a5);
	so.addVariable("t1", t1);
	so.write("LocationFeedbackFlash");
}
function embedflashhome()
{
	var so = new SWFObject("flash/LNOFhome.swf","Feedback","320","270","7","#FFFFFF");
	so.addParam("wmode", "opaque");
	so.write("homeflash");
}
function embedflashVO(location,soundfile)
{
	var so = new SWFObject("flash/voiceovers/denzil3.swf","VoiceOver","180","125","7","#FFFFFF");
	so.addVariable("mylocation", location);
	so.addVariable("soundfile", "voiceovers/" + soundfile);	
	so.addParam("wmode", "transparent");
	so.write("flashVO");
}
function embedflashAverageScore(average,people)
{
	var so = new SWFObject("flash/AverageScore.swf","VoiceOver","510","60","7","#FFFFFF");
	so.addVariable("average", average);
	so.addVariable("people", people);	
	so.addParam("wmode", "transparent");
	so.write("WhatYouSayBox");
}

// *******************************************************************************************************
// JavaScript Document
// Change Resources DIV border on hover
// AJH - 14/08/2006
// *******************************************************************************************************
function showCaveat()
{
	var caveat = document.getElementById("resourcecaveat").style;
	caveat.display = caveat.display = "block";
}
function hideCaveat()
{
	var caveat = document.getElementById("resourcecaveat").style;
	caveat.display = caveat.display = "none";
}
// *******************************************************************************************************
// JavaScript Document
// Change gallery Image using AJAX
// AJH - 16/08/2006
// *******************************************************************************************************
function loadGallery(galleryID)
{
	if(galleryID != null)
	{
		LNOF.classes.ajax.loadGallery(galleryID,setImage);
	}
}
function prevGallery()
{
	piccounter = piccounter - 1;
	if(piccounter < 0)
	{
		piccounter = nopics;
	}
	document.images.ctl00_ctl00_ContentPlaceHolder1_ThreeColRightWhiteBox_GalleryImage.src = mypics[piccounter];
	$('ctl00_ctl00_ContentPlaceHolder1_ThreeColRightWhiteBox_GFLeft').innerHTML = "<p>" + mycaptions[piccounter].replace('"','\"') + "</p>";
	$('ctl00_ctl00_ContentPlaceHolder1_ThreeColRightWhiteBox_GFRight').innerHTML = "<p>" + (piccounter + 1) + " of " + (nopics + 1) + "</p>";
	$('ctl00_ctl00_ContentPlaceHolder1_ThreeColRightWhiteBox_GHLeft').innerHTML = "<p><b>" + mytitles[piccounter].replace('"','\"') + "</b></p>";
	
}
function nextGallery()
{
	piccounter = piccounter + 1;
	if(piccounter > nopics)
	{
		piccounter = 0;
	}

	document.images.ctl00_ctl00_ContentPlaceHolder1_ThreeColRightWhiteBox_GalleryImage.src = mypics[piccounter];
	$('ctl00_ctl00_ContentPlaceHolder1_ThreeColRightWhiteBox_GFLeft').innerHTML = "<p>" + mycaptions[piccounter].replace('"','\"') + "</p>";
	$('ctl00_ctl00_ContentPlaceHolder1_ThreeColRightWhiteBox_GFRight').innerHTML = "<p>" + (piccounter + 1) + " of " + (nopics + 1) + "</p>";
	$('ctl00_ctl00_ContentPlaceHolder1_ThreeColRightWhiteBox_GHLeft').innerHTML = "<p><b>" + mytitles[piccounter].replace('"','\"') + "</b></p>";
	

}
function setImage(res)
{
	if(res.error == null)
	{
		var ds = res.value;
		if(ds != null && typeof(ds) == "object" && ds.Tables != null)
		{
			
			if($('GHLeft') != null)			{ $('ctl00_ctl00_ContentPlaceHolder1_ThreeColRightWhiteBox_GHLeft').innerHTML = "<p><b>" + ds.Tables[0].Rows[0]["ImageTitle"] + "</b></p>"; }
			if($('GFLeft') != null)			{ $('ctl00_ctl00_ContentPlaceHolder1_ThreeColRightWhiteBox_GFLeft').innerHTML = "<p>" + ds.Tables[0].Rows[0]["Caption"] + "</p>"; }
			if($('GFRight') != null)		{ $('ctl00_ctl00_ContentPlaceHolder1_ThreeColRightWhiteBox_GFRight').innerHTML = "<p>" + ds.Tables[0].Rows[0]["Rank"] + " of " + ds.Tables[0].Rows[0]["NoImages"] + "</p>"; }
			
			if($('ctl00_ctl00_ContentPlaceHolder1_ThreeColRightWhiteBox_GalleryImage') != null)	
			{ 
				$('ctl00_ctl00_ContentPlaceHolder1_ThreeColRightWhiteBox_GalleryImage').style.display = 'block'; 
				var sb = new StringBuilder();
				sb.append("<img src='" + ds.Tables[0].Rows[0]["ImgFolder"] + ds.Tables[0].Rows[0]["ImageName"] + "'");
				sb.append(" width='" + ds.Tables[0].Rows[0]["Width"] + "' ");
				sb.append(" alt='" + ds.Tables[0].Rows[0]["ImageTitle"] + "' />");

				$('ctl00_ctl00_ContentPlaceHolder1_ThreeColRightWhiteBox_GalleryImage').innerHTML = replaceIt(sb.toString(), "'","\"");
			}
		}
	}
}

// *******************************************************************************************************
// JavaScript Document
// Toggle Build Your Own Options
// AJH - 25/08/2006
// *******************************************************************************************************
function toggleBYO(sender)
{
	if($("BuildYourOwn1_gv" + sender.id) != null)
	{
		if($("BuildYourOwn1_gv" + sender.id).style.display == "block")
		{
			$("BuildYourOwn1_gv" + sender.id).style.display = "none";
			sender.src = replaceIt(sender.src, "minus", "plus");
		}
		else
		{
			$("BuildYourOwn1_gv" + sender.id).style.display = "block";
			sender.src = replaceIt(sender.src, "plus", "minus");
		}
	}
}
// *******************************************************************************************************
// JavaScript Document
// Toggle Build Your Own Terms
// AJH - 29/08/2006
// *******************************************************************************************************
function toggleYBYOTerms(ID)
{
	if($("Show" + ID).style.display == "none" || $("Show" + ID).style.display == "")
	{
		$("Show" + ID).style.display = $("Show" + ID).style.display = "block";
		$(ID).src = replaceIt($(ID).src, "plus", "minus");
	}
	else
	{
		$("Show" + ID).style.display = $("Show" + ID).style.display = "none";
		$(ID).src = replaceIt($(ID).src, "minus", "plus");
	}
}

// *******************************************************************************************************
// JavaScript Document
// Google Mini Form
// This is a dirty Javascript hack to capture the search term from a textbox within my ASP.NET page (note:
// only 1 server form is allowed and forms cannot be nested)
// AJH - 25/09/2006
// *******************************************************************************************************
function ClearSearch()
{
	if($('Generaltopnav1_Searchbox1_txtSearch') != null)	
	{
		$('Generaltopnav1_Searchbox1_txtSearch').value = 'Search';
	}
	else
	{
		if($('Topnav1_Searchbox1_txtSearch') != null)
		{
			$('Topnav1_Searchbox1_txtSearch').value = 'Search';
		}
	}
}
// *******************************************************************************************************
// JavaScript Document
// Show/Hide a div within the stag-ideas.aspx pages predominantly
// AJH - 25/09/2006
// *******************************************************************************************************
function ShowPage(page)
{
	switch(page)
	{
		case 2:
			if($('Page1') != null) {$('Page1').style.display = 'none';}
			if($('Page2') != null) {$('Page2').style.display = 'block';}
			break;
		default:
			if($('Page1') != null) {$('Page1').style.display = 'block';}
			if($('Page2') != null) {$('Page2').style.display = 'none';}
			break;
	}
}
// *******************************************************************************************************
// JavaScript Document
// Show/Hide a div s on the site-map page
// AJH - 09/10/2006
// *******************************************************************************************************
function ShowSiteMap(ID)
{
	switch(ID)
	{
		case 2:
			if($('SMStags') != null) {$('SMStags').style.display = 'none';}
			if($('SMHens') != null) {$('SMHens').style.display = 'block';}
			if($('SMAboutUs') != null) {$('SMAboutUs').style.display = 'none';}
			break;
		case 3:
			if($('SMStags') != null) {$('SMStags').style.display = 'none';}
			if($('SMHens') != null) {$('SMHens').style.display = 'none';}
			if($('SMAboutUs') != null) {$('SMAboutUs').style.display = 'block';}
			break;
		default:
			if($('SMStags') != null) {$('SMStags').style.display = 'block';}
			if($('SMHens') != null) {$('SMHens').style.display = 'none';}
			if($('SMAboutUs') != null) {$('SMAboutUs').style.display = 'none';}
			break;	
	}
}

function toggleSiteMap(id)
{
	var ShowDiv = document.getElementById(id).style;
	var imgID = "img" + id
	var img = document.getElementById(imgID);

	if($(id) != null)
	{
		if($(id).style.display == "none" || $(id).style.display == "")
		{
			$(id).style.display = $(id).style.display = "block";	
			if($("img" + id) != null) {$("img" + id).src = replaceIt($("img" + id).src, "plus", "minus");}
		}
		else
		{
			$(id).style.display = $(id).style.display = "none";
			if($("img" + id) != null) {$("img" + id).src = replaceIt($("img" + id).src, "minus", "plus");}
		}
	}
}

// *******************************************************************************************************
// JavaScript Document
// Show the contact us forms
// AJH - 31/10/2006
// *******************************************************************************************************
function setContactForm(id)
{
	hide_contact_elements(id);
}
function hide_contact_elements(id)
{
	var HasLocation = false;
	var LocNumber = -1;

	for(var i=0;i<document.getElementsByTagName('select').length;i++)
	{
		var id = document.getElementsByTagName('select').item(i).id;
		var found = id.indexOf("ddlLocation" + id);
		if(found != -1)
		{
			HasLocation = true;
			LocNumber = i;
		}
	}
	if(HasLocation)
	{
		if($(document.getElementsByTagName('select').item(LocNumber).id) != null)
		{
			if($(document.getElementsByTagName('select').item(LocNumber).id).value == "-1" || $(document.getElementsByTagName('select').item(LocNumber).id).value == "0")
			{
				$("ContactSection" + id + "_1").style.display = 'none';
			}
		}
	}
}
function show_contact_elements(num)
{
	var HasLocation = false;
	var LocNumber = -1;

	for(var i=0;i<document.getElementsByTagName('select').length;i++)
	{
		var myid = document.getElementsByTagName('select').item(i).id;
		var found = myid.indexOf("ddlLocation" + num);

		if(found != -1)
		{
			HasLocation = true;
			LocNumber = i;
		}
	}
	if(HasLocation)
	{
		if($(document.getElementsByTagName('select').item(LocNumber).id) != null)
		{
			if($(document.getElementsByTagName('select').item(LocNumber).id).value != "-1" && $(document.getElementsByTagName('select').item(LocNumber).id).value != "0")
			{
				$("ContactSection" + num + "_1").style.display = 'block';
			}
			else
			{
				$("ContactSection" + num + "_1").style.display = 'none';	
			}
		}
	}
}
function checkContactLocation(id)
{
	show_contact_elements(id);
}
function showContactUs(id)
{
	if($("ShowContactUs" + id) != null) {$("ShowContactUs" + id).style.display = 'block';}
	if($("ShowContactUs" + id) != null) {$("ShowContactUs" + id).style.display = 'block';}
	
	ContactUsBannerNEW1_ShowHideContactData
}

function SetGoogleEnquiryThanks()
{
	//Google Conversion Tracking:
	var google_conversion_id = 1064403959;
	var google_conversion_language = "en_GB";
	var google_conversion_format = "1";
	var google_conversion_color = "666666";
	if (1.0) { 
		var google_conversion_value = 1.0;
	}
	var google_conversion_label = "lead";

	//urchinTracker("/contact-received/");
	pageTracker._trackPageview("/contact-received/");
}
// *******************************************************************************************************
// JavaScript Document
// Show the email a friend CUF
// AJH - 02/11/2006
// *******************************************************************************************************
function ShowEmailaFriend()
{
	if($("EmailAFriend") != null)
	{
		switch($("EmailAFriend").style.display)
		{
			case '':
				$("EmailAFriend").style.display = 'block';
				break;	
			case 'block':
				$("EmailAFriend").style.display = 'none';
				break;
			case 'none':
				$("EmailAFriend").style.display = 'block';
				break;
			default:
				$("EmailAFriend").style.display = 'none';
				break;
		}
	}
}	
// *******************************************************************************************************
// JavaScript Document
// Show the FAQ's
// AJH - 07/11/2006
// *******************************************************************************************************
function ShowFAQ(number)
{
	if(number > 0)
	{
		if($("FAQ" + number) != null)
		{
			switch($("FAQ" + number).style.display)
			{
				case '':
					$("FAQ" + number).style.display = 'block';
					break;	
				case 'block':
					$("FAQ" + number).style.display = 'none';
					break;
				case 'none':
					$("FAQ" + number).style.display = 'block';
					break;
				default:
					$("FAQ" + number).style.display = 'none';
					break;
			}
		}	
	}
}
function ShowAffiliateTerms()
{
	var url = base + "affiliate-terms.aspx";
	zzz = window.open(url,'','width=500,height=620,scrollbars=yes,left=400,top=100')
	zzz.focus()		
}
function ShowLocationHowToBook(locID)
{
	if(locID > 0)
	{
		var url = base + "how-to-book-window.aspx?LocationID=" + locID;
		zzz = window.open(url,'','width=500,height=620,scrollbars=yes,left=400,top=100')
		zzz.focus()		
	}
}
// *******************************************************************************************************
// JavaScript Document
// Activity More Details
// AJH - 05/12/2006
// *******************************************************************************************************
function ActivityDetails(ActivityID,LocationID,GenderID)
{
	var url = base + "ActivityDetails.aspx?ActivityID=" + ActivityID + "&LocationID=" + LocationID + "&GenderID=" + GenderID;
	zzz = window.open(url,'','width=500,height=540,scrollbars=yes,left=400,top=100')
	zzz.focus()		
}
// *******************************************************************************************************
// JavaScript Document
// New Tabs
// AJH - 10/04/2007
// *******************************************************************************************************
function switchDescArea(area,what)
{
	var els = getElementsByClass('active tablink');
	for(var i = 0; i<els.length;i++)
	{
		els[i].setAttribute("class","tablink");
	}
	what.setAttribute("class","active tablink");
	if(area == 1)
	{
		$2('pdc1').style.display = 'block';
		$2('pdc2').style.display = 'none';
		$2('pdc3').style.display = 'none';
	}
	else if(area == 2)
	{
		$2('pdc1').style.display = 'none';
		$2('pdc2').style.display = 'block';
		$2('pdc3').style.display = 'none';
	}
	else if(area == 3)
	{
		$2('pdc1').style.display = 'none';
		$2('pdc2').style.display = 'none';
		$2('pdc3').style.display = 'block';
	}
	else if(area == 4)
	{
		$2('pdc1').style.display = 'none';
		$2('pdc2').style.display = 'none';
		$2('pdc3').style.display = 'none';	
	}
	else if(area == 5)
	{
		$2('pdc1').style.display = 'none';
		$2('pdc2').style.display = 'none';
		$2('pdc3').style.display = 'none';
	}
}
function ShowDescArea(area)
{
	var els = getElementsByClass('active tablink');
	for(var i = 0; i<els.length;i++)
	{
		els[i].setAttribute("class","tablink");
	}
	els = getElementsByClass('tablink');
	els[area-1].setAttribute("class","active tablink");
	
	if(area == 1)
	{
		$2('pdc1').style.display = 'block';
		$2('pdc2').style.display = 'none';
		$2('pdc3').style.display = 'none';
	}
	else if(area == 2)
	{
		$2('pdc1').style.display = 'none';
		$2('pdc2').style.display = 'block';
		$2('pdc3').style.display = 'none';
	}
	else if(area == 3)
	{
		$2('pdc1').style.display = 'none';
		$2('pdc2').style.display = 'none';
		$2('pdc3').style.display = 'block';
	}
	else if(area == 4)
	{
		$2('pdc1').style.display = 'none';
		$2('pdc2').style.display = 'none';
		$2('pdc3').style.display = 'none';	
	}
	else if(area == 5)
	{
		$2('pdc1').style.display = 'none';
		$2('pdc2').style.display = 'none';
		$2('pdc3').style.display = 'none';
	}
}


/******************/
/* FUNCTIONS      */
/******************/
// Initializes a new instance of the StringBuilder class
// and appends the given value if supplied
function StringBuilder(value)
{
    this.strings = new Array("");
    this.append(value);
}
// Appends the given value to the end of this instance.
StringBuilder.prototype.append = function (value)
{
    if (value)
    {
        this.strings.push(value);
    }
}
// Clears the string buffer
StringBuilder.prototype.clear = function ()
{
    this.strings.length = 1;
}
// Converts this instance to a String.
StringBuilder.prototype.toString = function ()
{
    return this.strings.join("");
}
function replaceIt(sString, sReplaceThis, sWithThis) 
{
	if (sReplaceThis != "" && sReplaceThis != sWithThis) 
	{
		var counter = 0;
		var start = 0;
		var before = "";
		var after = "";
		while (counter<sString.length) 
		{
			start = sString.indexOf(sReplaceThis, counter);
			if (start == -1) {
				break;
			} else {
				before = sString.substr(0, start);
				after = sString.substr(start + sReplaceThis.length, sString.length);
				sString = before + sWithThis + after;
				counter = before.length + sWithThis.length;
			}
		}
	}
	return sString;
}
function $() {
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1)
      return element;

    elements.push(element);
  }

  return elements;
}

function $2() {
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1)
      return element;

    elements.push(element);
  }

  return elements;
}

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\s)"+searchClass+"(\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}
function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  } 
}
// *******************************************************************************************************
// JavaScript Document
// CSS Pop Ups
// AJH - 25/09/2006
// *******************************************************************************************************
/*
Simple Image Trail script- By JavaScriptKit.com
Edited by awestmoreland: http://www.sitepoint.com/forums/member.php?u=22198
*/
var offsetfrommouse = [15,15]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration = 0; //duration in seconds image should remain visible. 0 for always.
var currentimageheight = 5;	// maximum image size.

if (document.getElementById || document.all){
	document.write('<div id="CssPopUp">');
	document.write('</div>');
}
function gettrailobj()
{
	if (document.getElementById)
		return document.getElementById("CssPopUp").style
	else if (document.all)
		return document.all.trailimagid.style
}

function gettrailobjnostyle()
{
	if (document.getElementById)
		return document.getElementById("CssPopUp")
	else if (document.all)
		return document.all.trailimagid
}
function truebody()
{
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function showtrail(title,description)
{
	document.onmousemove=followmouse;
	var newHTML = new StringBuilder();
	newHTML.append('<div class="CssRollOver">');
	newHTML.append('<b>' + title + '</b><br /><br />');
	newHTML.append(description + '<br />');
	newHTML.append('</div>');
	gettrailobjnostyle().innerHTML = newHTML.toString();
	gettrailobj().visibility="visible";
}
function showtrail2(title,description)
{
	document.onmousemove=followmouse;
	var newHTML = new StringBuilder();
	newHTML.append('<div class="CssRollOver2">');
	newHTML.append('<b>' + title + '</b><br /><br />');
	newHTML.append(description + '<br />');
	newHTML.append('</div>');
	gettrailobjnostyle().innerHTML = newHTML.toString();
	gettrailobj().visibility="visible";
}
function hidetrail(){
	gettrailobj().visibility="hidden"
	document.onmousemove=""
	gettrailobj().left="-500px"
}
function followmouse(e){

	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

	if (typeof e != "undefined"){
		if (docwidth - e.pageX < 300){
			xcoord = e.pageX - xcoord - 286; // Move to the left side of the cursor
		} else {
			xcoord += e.pageX;
		}
		if (docheight - e.pageY < (currentimageheight + 110)){
			ycoord += e.pageY - Math.max(0,(110 + currentimageheight + e.pageY - docheight - truebody().scrollTop));
		} else {
			ycoord += e.pageY;
		}

	} else if (typeof window.event != "undefined"){

		if (docwidth - event.clientX < 300){
			xcoord = event.clientX + truebody().scrollLeft - xcoord - 286; // Move to the left side of the cursor
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}
		if (docheight - event.clientY < (currentimageheight + 110)){
			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(110 + currentimageheight + event.clientY - docheight));
		} else {
			ycoord += truebody().scrollTop + event.clientY;
		}
	}

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
	if(ycoord < 0) { ycoord = ycoord*-1; }
	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"

}






function ShowFixtureInfo(ID)
{
	if($('Fixture-' + ID) != null)
	{ 
		if($('Fixture-' + ID).style.display == null || $('Fixture-' + ID).style.display == '' || $('Fixture-' + ID).style.display == 'none')
		{
			$('Fixture-' + ID).style.display = 'block'; 
		}
		else
		{
			$('Fixture-' + ID).style.display = 'none'; 
		}
	}
}









function fnRedirectThis(res)
{
	window.location = window.location;
}



































function IsNumeric(strString)
{
//  check for valid numeric strings
	var strValidChars = "0123456789";
	var strChar;
	var blnResult = true;

	if (strString.length == 0) return false;

	//  test strString consists of valid characters listed above
	for (i = 0; i < strString.length && blnResult == true; i++)
	{
		strChar = strString.charAt(i);
		if (strValidChars.indexOf(strChar) == -1)
		{
			blnResult = false;
		}
	}
	return blnResult;
}













function ShowHideEnquiry(id)
{
    if(id == "ContactUsBannerNEW1_EnquiryLink")
    {
	    if($('ContactUsBannerNEW1_EnquiryBox') != null)	
	    {
	        if($('ContactUsBannerNEW1_EnquiryBox').style.display == 'block')
	        {
	            $('ContactUsBannerNEW1_EnquiryBox').style.display = 'none'; 
	        }
	        else
	        {
	            $('ContactUsBannerNEW1_EnquiryBox').style.display = 'block';
	        }
	    }
	}
	if(id == "ContactUsBannerNEW2_EnquiryLink")
    {
	    if($('ContactUsBannerNEW2_EnquiryBox') != null)	
	    {
	        if($('ContactUsBannerNEW2_EnquiryBox').style.display == 'block')
	        {
	            $('ContactUsBannerNEW2_EnquiryBox').style.display = 'none'; 
	        }
	        else
	        {
	            $('ContactUsBannerNEW2_EnquiryBox').style.display = 'block';
	        }
	    }
	}
}

function Show10thBirthdayPopUp()
{     
    $find('ctl00_ctl00_Header1_ModalPopupExtender1').show();
}

function OnlinePaymentRollOver(img_src)
{
	if($2('ctl00_ctl00_ContentPlaceHolder1_ThreeColRightWhiteBox_imgMain') != null)	
	{ 
		$2('ctl00_ctl00_ContentPlaceHolder1_ThreeColRightWhiteBox_imgMain').src = img_src; 
	}
}




