<!--
//****************************************
//Floaty banners written by Chris Creevy 
//V1.0
//Date 26th February 2003
//****************************************


function myFloatyLayerOn(strTempValue,intFloatID,intTempHeight) //,intTempHeight,strTempText)
{
	myLayerBox = document.getElementById("myBox");
	myLayerBox.style.height = intTempHeight;
	
	if (document.all)	{
		myLayerBox1 = document.getElementById("myBox1");
		myLayerBox1.style.height = intTempHeight-4;
	}
	
	if (myLayerBox.style.visibility != 'visible') 
	{	
		eval("myTarget = document.getElementById('" + strTempValue + "')");
		myHelpText = myTarget.innerText;
			
		myTargetX = findPosX(myTarget);
		myTargetY = findPosY(myTarget);
		
		myLayerBox.style.top = (myTargetY+10).toString() + 'px';
		myLayerBox.style.left = myTargetX.toString() + 'px';
				
		document.images["top"].src = myFloatyImages[0].src;
		document.images["left"].src = myFloatyImages[1].src;
		document.images["right"].src = myFloatyImages[2].src;
		document.images["bottom"].src = myFloatyImages[3].src;
		document.images["downarrow"].src = myFloatyImages[4].src;
		document.images["left"].height = intTempHeight-8;
		document.images["right"].height = intTempHeight-8;
		
		myBoxLeft = document.images["left"];
		myBoxRight = document.images["right"];
		myBoxLeft.height = intTempHeight;
		myBoxRight.height = intTempHeight;
		
	
		myFloatContent = document.getElementById("FloatContent");
		myFloatContent.innerHTML = myFloatyText[intFloatID];
		myLayerBox.style.visibility = "visible";

		if ((document.all) && (navigator.appVersion.indexOf("MSIE 5.0")==-1) && (!is_opera))
        {
			myLayerBox1.style.top = myTargetY+15;
			myLayerBox1.style.left = myTargetX;
			myLayerBox1.style.width = "130px";//myLayerBox.style.width;
			myLayerBox1.style.visibility = "visible";
			
		}
	}
}

function myFloatyLayerOff(strTempValue)
{
	myLayerBox = document.getElementById("myBox");
	myLayerBox.style.visibility = "hidden";
	if (document.all)	{
		myLayerBox1 = document.getElementById("myBox1");
		myLayerBox1.style.visibility = "hidden";
	}

}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft;
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;	
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop;
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function myFloatText(strTempText)
{
	myFloatyText[txtCount] = strTempText;
	txtCount++;
}

function cacheFloatyImages(bitSecure,strImgName)
{
	myFloatyImages[imgCount]=new Image();
	strAmendPath = 'http://www.travelsupermarket.com/images/';
	strWindowHref = window.location.href
	
	if (strWindowHref.indexOf("secure") != -1)	{
		strAmendPath = 'http://www.travelsupermarket.com/images/secure/'
	}	
	
	myFloatyImages[imgCount].src= strAmendPath + "FloatyBanner/" + strImgName;
	imgCount++;
}

// Declare variables and arrays

var myFloatyImages=new Array();
myFloatyText = new Array();
imgCount = 0;
txtCount = 0;

// Load floaty images into cache
cacheFloatyImages(1,"top.gif");
cacheFloatyImages(1,"left.gif");
cacheFloatyImages(1,"right.gif");
cacheFloatyImages(1,"bottom.gif");
cacheFloatyImages(1,"uparrow.gif");

//-->
