<!--

// Global JavaScript Library
// Copyright 2005 CSI Manchester Ltd - All Rights Reserved


// Browser sniffer
var ns4 = (document.layers); 
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById);

// Attaches objects dependent on browser
function object_attach(id)
{
	var obj;
	if(ns4) obj = document.layers[id];
	else if(ie4) obj = document.all[id];
	else if(ie5 || ns6) obj = document.getElementById(id);
	return obj;
}

function validateEshoutz(fId) {
	var m = '';
	if(!fId.name.value) {m+='- Please enter your name\n'}
	if(!/.+@[^.]+(\.[^.]+)+/.test(fId.email.value) || isValidField(fId.email.value,2) == false){m+='- Please enter a valid email address\n'}
	if(m){
		alert(m);
		return false;		
	}else{
		return true;		
	}
}

// Shows/hides div objects
function div_switch(id, bShow, bBlock)
{
	temp_Obj = object_attach(id);
	if(ns4)
	{
		if(bShow==true)
		{
			if(bBlock==true) { temp_Obj.display = "block"; }
			else { temp_Obj.visibility = "show"; }
		}
		else
		{
			if(bBlock==true) { temp_Obj.display = "none"; }
			else { temp_Obj.visibility = "hide"; }
		}
	}
	else
	{
		if(bShow==true)
		{
			if(bBlock==true) { temp_Obj.style.display = "block"; }
			else { temp_Obj.style.visibility = "visible"; }
		}
		else
		{
			if(bBlock==true) { temp_Obj.style.display = "none"; }
			else { temp_Obj.style.visibility = "hidden"; }
		}
	}
}

function valEnquiry(form) {
	var e = form.elements, m = '';
	if(!e['name'].value) {m += '- Name is required.\n';}
	if(!/.+@[^.]+(\.[^.]+)+/.test(e['email'].value)) {
	m += '- Email requires a valid email address.\n';
	}
	if(!e['enquiry'].value) {m += '- Enquiry is required.\n';}
	if(m) {
		alert('The following error(s) occurred:\n\n' + m);
		return false;
	}else{
		return true;
	}
}


  var PrevItem = 0
  var NextItem = 1
  var interval;
function SwitchPhoto(PlaceHolderName,ThumbImg)
  {
  //get array item image path
  var ImagePath = ThumbImg
  if (document.all)
  {
	document.getElementById(PlaceHolderName).style.filter="blendTrans(duration=1)";
	document.getElementById(PlaceHolderName).filters.blendTrans.Apply();
  }
  //is document.getElementById supported?
  if (document.getElementById) {
	document.getElementById(PlaceHolderName).src = ImagePath;
	}
  //if not supported use document.pictureName.src
   else{
	document.HotelImage.src = ImagePath;
	}
  // if fade transition is supported play it
  if (document.all)
  {
	document.getElementById(PlaceHolderName).filters.blendTrans.Play();
  }
}

// Cross-browser function to change the contents inside a DIV tag
function writeInDiv(text, id)
{
	//alert(text+', '+id);
	if (document.getElementById) { 
		x = document.getElementById(id); x.innerHTML = ''; x.innerHTML = text; 
	}
	else if (document.all) { 
		x = document.all[id]; x.innerHTML = text; 
	}
	else if (document.layers){ 
		x = document.layers[id]; text2 = '<p>' + text + '</p>'; x.document.open(); x.document.write(text2); x.document.close(); 
	}
}

// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
//document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0
var mouseX = 0
var mouseY = 0

// Main function to retrieve mouse x-y pos.s
var sShowing = 0;
function UserGroups(hideshow) {
	if(hideshow=='show') {
		
		//if(sShowing!=1) {
			//sDiv = document.getElementById('divUserGroups');
			//sDiv.style.left = event.clientX;
			div_switch('divUserGroups', true, true);
			//sShowing = 1;
		//}
	}else{
		//if(sShowing!=0) {
			div_switch('divUserGroups', false, true);
			//sShowing = 0;
		//}
	}
	
}

// Opens a popup window
function openPopupWin(popUrl, popWid, popHgt, popScroll, popResize)
{
	popupWin=window.open(popUrl,"popupWin","width=" + popWid + ",height=" + popHgt + ",left=" + ((screen.width-popWid)/2) + ",top=" + ((screen.height-popHgt)/2) + ",status=yes,toolbar=no,menubar=no,scrollbars=" + popScroll + ",resizable=" + popResize);
	if(!popupWin.opener) popupWin.opener=self;
}

// Opens a better popup window
function openWindow(url,name,extra) { 
	newwindow = window.open(url,name,extra); 
	if (window.focus) {newwindow.focus()}
}

function changeSearchHotel(ddlbox) {
	var ddlrooms = document.getElementById('ddlRooms');
	if(ddlrooms) {
		while(ddlrooms.options.length > 0) {
			ddlrooms.options[0] = null;
			ddlrooms.disabled=true;
		}
		while(ddlrooms.hasChildNodes()) {
			ddlrooms.removeChild(ddlrooms.firstChild);
		}
		ddlrooms.options[0] = new Option(0, '');
		if(ddlbox.value) {
			var iRooms = 5;
			if(ddlbox.value=='14313') {
				iRooms = 3;
			}
			for(x=0;x<iRooms;x++) {
				ddlrooms.options[x] = new Option(x+1, x+1);
			}
			ddlrooms.disabled=false;
		}
	}
}

-->