	var DL_bNS4=(document.layers);
	var DL_bNS6 = (navigator.vendor == ("Netscape6") || navigator.product == ("Gecko"));
	var DL_bDOM=(document.getElementById);
	var DL_bIE=(document.all);
	var DL_bIE4=(DL_bIE && !DL_bDOM);
	var DL_bMac = (navigator.appVersion.indexOf("Mac") != -1);
	var DL_bIEMac=(DL_bIE && DL_bMac);
	var DL_bIE4Mac=(DL_bIE4 && DL_bMac);
	var DL_bNS =(DL_bNS4 || DL_bNS6);
	

	var timerT = false;

	function imgCancel(img) {
		clearTimeout(timerT);
	}

	function imgHover(img) {
		
			
		//clear prvious timers
		if(timerT) {
			clearTimeout(timerT);
		}

		var box = document.getElementById('imgbox' + img.id);
		if (! box) return;

		var pop = document.getElementById('popup');
		if (! pop) return;

		var popshadow = document.getElementById('popupshadow');
		var popimage = document.getElementById('popupimage');
		var poplink = document.getElementById('popuplink');

		// reset any previous stuff that was set.
		pop.style.display = 'none';
		popimage.src = '/images/spacer.gif';

		var smallH = parseFloat(img.style.height);
		var smallW = parseFloat(img.style.width);

		// Adjust height and width based on current image
		/*if(smallH > smallW) {
			var medH = '270'
			var medW = parseInt((270/110) * smallW);
			var adjW = 50;

			// center the image + 20 for shading and padding
			var adjP = parseInt( (medW + 10) );
			var adjW = parseInt( (270 - adjP - 10) / 2 ) - 30;

		} else {
			var medW = '270'
			var medH = parseInt((270/110) * smallH);
			var adjP = 280;
			var adjW = 30;
		}*/
		if(smallH > smallW) {
			var medH = '270'
			var medW = '160';
			var adjW = 50;

			// center the image + 20 for shading and padding
			var adjP = parseInt( (medW + 10) );
			var adjW = parseInt( (270 - adjP - 10) / 2 ) - 30;

		} else {
			var medW = '270'
			var medH = '160';
			var adjP = 280;
			var adjW = 30;
		}	
		
		popimage.style.height = medH;
		popimage.style.width = medW;
		
		var contain = document.getElementById('popupcontain');
		pop.style.width = adjP + 'px';

		// and position the box
		var top = objGetRealTop(box);
		var left = objGetRealLeft(box);
		if (DL_bIE) {
			pop.style.top = (top + 49) + 'px';
			pop.style.left = (left - 0) + 'px';
		} else {
			pop.style.top = (top + 48) + 'px';
			pop.style.left = (left - 3) + 'px';
		}

		//popimage.style.width  = medW + 'px';
		//popimage.style.height = medH + 'px';

		popimage.src = 'http://travelmodule.csiadmin.co.uk/data/accommodation_images/' + img.id + '.jpg';
		var cmd = "delayShow('http://travelmodule.csiadmin.co.uk/data/accommodation_images/" + img.id + ".jpg')";
		
		
		// delay to prevent the user gettting popups while moving the mouse
		
		timerT = setTimeout(cmd, 300);

	}

	function delayShow(imgsrc) {

		// clear the timer
		clearTimeout(timerT);

		// and show the area.
		var pop = document.getElementById('popup');
		pop.style.display = 'block';
	}
	
	function windowWidth() { 
		if (window.innerWidth != null){ return window.innerWidth; }    
		if (document.body.clientWidth != null) { return document.body.clientWidth;  }    
		return (0);    
	}
	
	function windowHeight() {
		if (window.innerHeight != null){ return window.innerHeight; }    
		if (document.body.clientHeight != null) { return document.body.clientHeight;  }    
		return (0);    
	}
	
	function objGetScreenLeft(oElement) 
	{
		var  lA = window.screenY? window.screenY: window.screenTop;
		return objGetRealLeft(oElement) + lA; 
	}
	
	function findPosition( oLink ) {
		if( oLink.offsetParent ) {
			for( var posX = 0, posY = 0; oLink.offsetParent; oLink =
					oLink.offsetParent ) {
				posX += oLink.offsetLeft;
				posY += oLink.offsetTop;
			}
			this.x = posX;
			this.y = posY;
			return this;
		} else {
			this.x = oLink.x;
			this.y = oLink.y;
			return this;
		}
	}
	function objGetRealLeft(oElement)
	{
		var nXPos = oElement.offsetLeft;
		var oParentEl = (DL_bIE4Mac) ? oElement.parentElement : oElement.offsetParent;
	
		while (oParentEl != null)
		{
			if(DL_bIE4Mac)
			{
				if(oParentEl.tagName=="SPAN")
				{
					oParentEl = oParentEl.parentElement;
				}
				if(oParentEl.tagName=="HTML")
				{
					break;
				}
			}
	
			nXPos += oParentEl.offsetLeft;
			oParentEl = (DL_bIE4Mac) ? oParentEl.parentElement : oParentEl.offsetParent;
		}
		return nXPos;
	
	}
	
	
	function objGetScreenTop(oElement) 
	{
		var  tA = window.screenY? window.screenY: window.screenTop;
		return objGetRealTop(oElement) + tA; 
	}
	function objGetRealTop(oElement)
	{
		var nYPos = oElement.offsetTop;
		var oParentEl = (DL_bIE4Mac) ? oElement.parentElement : oElement.offsetParent;
		while (oParentEl != null)
		{
			if(DL_bIE4Mac)
			{
				if(oParentEl.tagName=="SPAN")
				{
					oParentEl = oParentEl.parentElement;
				}
				if(oParentEl.tagName=="HTML")
				{
					break;
				}
			}
			nYPos += oParentEl.offsetTop;
			oParentEl = (DL_bIE4Mac) ? oParentEl.parentElement : oParentEl.offsetParent;
		}
		return nYPos;
	}
	
	function confirmSubmit()
	{
	var agree=confirm("Are you sure?");
	if (agree)
		return true ;
	else
		return false ;
	}
	
	
	

