
//Rollovers used for site tools

/*
st1_idle=new Image (67,22); st1_roll=new Image (67,22);
st1_idle.src="https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/sitetools/st1_idle.gif"; st1_roll.src="https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/sitetools/st1_roll.gif";

st2_idle=new Image (67,22); st2_roll=new Image (67,22);
st2_idle.src="https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/sitetools/st2_idle.gif"; st2_roll.src="https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/sitetools/st2_roll.gif";

st3_idle=new Image (67,22); st3_roll=new Image (67,22);
st3_idle.src="https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/sitetools/st3_idle.gif"; st3_roll.src="https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/sitetools/st3_roll.gif";

st4_idle=new Image (67,22); st4_roll=new Image (67,22);
st4_idle.src="https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/sitetools/st4_idle.gif"; st4_roll.src="https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/sitetools/st4_roll.gif";

st5_idle=new Image (67,22); st5_roll=new Image (67,22);
st5_idle.src="https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/sitetools/st5_idle.gif"; st5_roll.src="https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/sitetools/st5_roll.gif";

st6_idle=new Image (107,22); st6_roll=new Image (107,22);
st6_idle.src="https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/sitetools/st6_idle.gif"; st6_roll.src="https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/sitetools/st6_roll.gif";

st7_idle=new Image (107,22); st7_roll=new Image (107,22);
st7_idle.src="https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/sitetools/st7_idle.gif"; st7_roll.src="https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/sitetools/st7_roll.gif"; 

*/
//Rollovers used on homepage form images

/*
var picked = "none";
var current_image=1;
var NoOfImages=12;


qb1_roll = new Image(60,65);
qb1_roll.src = "https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/qb1_roll.gif";
qb1_idle = new Image(60,65);
qb1_idle.src = "https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/qb1_idle.gif";
qb1_act = new Image(60,65);
qb1_act.src = "https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/qb1_act.gif";
qb1_strapline = new Image(123,90);
qb1_strapline.src = "https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/qb1_strapline.gif";

qb2_roll = new Image(59,65);
qb2_roll.src = "https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/qb2_roll.gif";
qb2_idle = new Image(59,65);
qb2_idle.src = "https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/qb2_idle.gif";
qb2_act = new Image(59,65);
qb2_act.src = "https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/qb2_act.gif";
qb2_strapline = new Image(123,90);
qb2_strapline.src = "https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/qb2_strapline.gif";

qb3_roll = new Image(48,65);
qb3_roll.src = "https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/qb3_roll.gif";
qb3_idle = new Image(48,65);
qb3_idle.src = "https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/qb3_idle.gif";
qb3_act = new Image(48,65);
qb3_act.src = "https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/qb3_act.gif";
qb3_strapline = new Image(123,90);
qb3_strapline.src = "https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/qb3_strapline.gif";

qb4_roll = new Image(79,65);
qb4_roll.src = "https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/qb4_roll.gif";
qb4_idle = new Image(79,65);
qb4_idle.src = "https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/qb4_idle.gif";
qb4_act = new Image(79,65);
qb4_act.src = "https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/qb4_act.gif";
qb4_strapline = new Image(123,90);
qb4_strapline.src = "https://a248.e.akamai.net/f/248/1/24h/www.travel.com.au/gifs/qb4_strapline.gif";

*/

function overImg(objName){
		if (picked != objName){
			imgSrc = eval(objName + "_roll.src");
			document[objName].src = imgSrc;
			document["strapline"].src=eval(objName+"_strapline.src");
		}
}


function outImg(objName){
	if (picked != objName){
			imgSrc = eval(objName + "_idle.src");
			document[objName].src = imgSrc;
			document["strapline"].src=eval(picked+"_strapline.src");
		}
	
}


function onImg(objName){
 		if (picked != "none" && picked != objName){
			imgSrc = eval(objName + "_act.src");
 			imgSrc2 = eval(picked + "_idle.src");
			// document.clear();
 			document[objName].src = imgSrc;
 			document[picked].src = imgSrc2;
 			picked = (objName);
		}
		else if (picked == objName){
		}
else{
 			imgSrc = eval(objName + "_act.src");
 			document[objName].src = imgSrc;
 			picked = (objName);
		}
	
}


function onHome(objName){
 		if (picked != "none"){
 			imgSrc = eval(picked + "_idle.src");
 			document[picked].src = imgSrc;
 			picked = "none";
		}
	
}


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'block':(v=='hide')?'none':v; }
    obj.display=v; }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function onKeyPress_Return() 
{     
	if (event.keyCode == 13) 
	{   
		event.cancelBubble = true;
		event.returnValue = false;
	}
}

var _HiderContainer = null;

function BrowserDetect() {
	var ua = navigator.userAgent.toLowerCase();
	// browser name
	this.isIE = ( (ua.indexOf('msie') != -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) );
	// browser version
	this.versionMinor = parseFloat(navigator.appVersion);
	if (this.isIE && this.versionMinor >= 4) {
		this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
	}
	this.versionMajor = parseInt(this.versionMinor);
	// specific browser shortcuts
	this.isIE5x = (this.isIE && this.versionMajor == 5);
	this.isIE55 = (this.isIE && this.versionMinor == 5.5);
	this.isMac   = (ua.indexOf('mac') != -1);
}


// Assign Rollovers to the main navigation

function Main(strNavAbbrev) {
	BrowserDetect();
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById(strNavAbbrev);
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				if(this.versionMinor >=5.5)
				{
					var aUL = new Array();
					for (var z=0;z<node.childNodes.length;z++) {
						if (node.childNodes[z].nodeName == "UL") {
							aUL[aUL.length] = node.childNodes[z];
						}
					}
					oUL = aUL[0];
					node.nIndex = 0;
					node.parentMenu = navRoot;
					node.submenu = oUL;
				}
				node.onmouseover=function() {
					this.className+=" over";
					if (typeof(iFrameCtrl) != "undefined" && typeof(this.submenu) != "undefined")
					{ 
						iFrameCtrl(this.submenu, this);
						xShow(this.submenu);
						this.parentMenu.shownMenu = this.submenu;
					}
				}
				node.onmouseout=function() {
					this.className = "";
					if (typeof(this.submenu) != "undefined")
					{
						xHide(this.submenu);
						HideMenu(navRoot);
					}
				}
			}
		}
	}
}

// Similar to Main() above, but this function is for DL instead of UL
function DefinitionListMain(strNavAbbrev) {
	BrowserDetect();
		navRoot = document.getElementById(strNavAbbrev);
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="DL") {
				node.onmouseover=function() {
					this.className+=" over";
					//this line is unique to intrinsic site
					document.getElementById('mod_mainnav_1').style.zIndex="2"
				}
				node.onmouseout=function() {
					this.className = "";
					//this line is unique to intrinsic site
					document.getElementById('mod_mainnav_1').style.zIndex="0"
				}
			}
	}
}

function HideMenu(oMenu) {
	var curmenu = oMenu.shownMenu;
	var prevMenu;
	while ( curmenu ) {
		if (typeof(HideiFrame) != "undefined") HideiFrame(curmenu);
		prevMenu = curmenu;
		curmenu = curmenu.shownMenu;
		prevMenu.shownMenu = null;
	}
}

// Assign Rollovers to the footer navigation
function simpleNav(sElement) {
	if (document.all&&document.getElementById) {
		footer = document.getElementById(sElement);
		for (i=0; i<footer.childNodes.length; i++) {
			node = footer.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className = "";
				}
			}
		}
	}
}
/*
window.onload=function()
{
	simpleNav("ft");
	Main("nb");
}
*/



// Calculates heights of 4 feature panels on homepage

function getMax(height, max)
{
    return (height>max?height:max);
}

 

function setMax()
{
      var maxval = 0;
	  for(i=1;i<5;i++)
		if(document.getElementById("panel"+i))
			maxval =  getMax(document.getElementById("panel"+i).offsetHeight, maxval)
	  for(i=1;i<5;i++)
		if(document.getElementById("panel"+i))
			document.getElementById("panel"+i).style.height = maxval
}







function iFrame(oLayer, oNewHiderContainer) {
	sFilter = "filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);";

	var zIndex = oLayer.style.zIndex;
	if (zIndex == "")
		zIndex = xGetAnyCS(oLayer, "z-index");
	zIndex = parseInt(zIndex);
	if ( isNaN(zIndex) ) {
		zIndex = 2;
	}
	
	var oHiderContainer;
	if ( (oNewHiderContainer = xGetElementById(oNewHiderContainer)) ) {
		oHiderContainer = oNewHiderContainer;
	} else {
		oHiderContainer = _HiderContainer;
	}

	oIframe = document.getElementById("hider" + oLayer.id);
	if (!oIframe) {
		zIndex--;
		oHiderContainer.insertAdjacentHTML("afterBegin", '<iframe id="hider' + oLayer.id + '" scroll="no" frameborder="0" src="about:blank" style="position:absolute;visibility:hidden;border:0px;' + sFilter + 'top:0px;left;0px;width:0px;height:0px;background-color:#999;z-index:' + zIndex + ';"></iframe>');
		oIframe = document.getElementById("hider" + oLayer.id);
	}
	return oIframe;
}

function iFrameCtrl(oLayer, oNewHiderContainer) {
	oIframe = iFrame(oLayer, oNewHiderContainer);
	if (oIframe) {
		xMoveTo( oIframe, xLeft(oLayer), xTop(oLayer) );
		xResizeTo( oIframe, xWidth(oLayer), xHeight(oLayer) );
		xShow( oIframe );
	}
}

function HideiFrame(oLayer, oNewHiderContainer) {
	oIframe = iFrame(oLayer, oNewHiderContainer);
	if (oIframe) 
		xHide( oIframe );
}



//Show Hide Layers function used on homepage forms

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);




function AddToList(email_address)
{
	if (typeof(email_address) == "undefined")
	{
		//alert(event.srcElement.document.form.name);
		with (document.joining)
		{
			email_address = Email_Address.value;

		}
	}
	var url = "http://www.travel.com.au/index.cgi?E=bemaillst&ST=TTS&Mail_List=TTS&Email_Address=" + email_address;
	var options ="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=300,height=180,copyhistory=no";
	window.open(url,"Joining",options);
	document.joining.Email_Address.value = "Your Email Address Here";
	return false;
}

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("mainnav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;
