/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// -- 3 / set up -- Find operating system, publisher & browser version, 
//		boolean variables: Fx, Ie, Ie5, Ie6, Mz, Mz1, Nt, Nt4, Nt6, Op, Op8, Op9, Sf
//          for FireFox, Internet Explorer (v5-, v6+), Mozilla (Pre-Release, v1), Netscape (v4, v6+), Opera (v8-, v9+), Safari
//		Position Variables: aPos, ePos, fPos, mPos, nPos, oPos, sPos, wPos
//          for Apple, Internet Explorer (MSIE), Firefox, Mozilla (rv:), Netscape, Opera, Safari, Windows
//		Version:  bVr
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

var bVr;

var Ch;
var Ch4;
var Fx;
var Ie;
var Ie5;
var Ie6;
var Ie7;
var Ie8;
var Mz;
var Mz1;
var Mz2;
var Mz3;
var Nt;
var Nt4;
var Nt6;
var Op;
var Op8;
var Op9;
var Sf;

var aPos = navigator.userAgent.indexOf('Apple');
var cPos = navigator.userAgent.indexOf('Chrome');
var ePos = navigator.userAgent.indexOf('MSIE');
var fPos = navigator.userAgent.indexOf('Firefox');
var mPos = navigator.userAgent.indexOf('rv:');
var nPos = navigator.userAgent.indexOf('Netscape');
var oPos = navigator.userAgent.indexOf('Opera');
var sPos = navigator.userAgent.indexOf('Safari');
var wPos = navigator.userAgent.indexOf('Windows');

if (oPos != -1) {
	Op = true;
	bVr = parseInt(navigator.userAgent.substring(oPos+6));}
else if (ePos != -1) {
	Ie = true;
	bVr = parseInt(navigator.userAgent.substring(ePos+5,navigator.userAgent.indexOf(';',ePos)));}
else if (nPos != -1) {
	Nt = true;
	bVr = parseInt(navigator.userAgent.substring(nPos+9));
	if(bVr == 'NaN') {bVr = parseInt(navigator.userAgent.substring(nPos+10));}}
else if (fPos != -1) {
	Fx = true;
	bVr = parseInt(navigator.userAgent.substring(fPos+8));}
else if (mPos != -1) {
	Mz = true;
	bVr = parseInt(navigator.userAgent.substring(mPos+3));}
else if (sPos != -1) {
	Sf = true;
	bVr = parseInt(navigator.userAgent.substring(sPos+6));}
else if (navigator.appName == "Netscape") {
	nPos = navigator.userAgent.indexOf('/');
	Nt = true;
	bVr = parseInt(navigator.userAgent.substring(nPos+1));}
Ie5 = (Ie && bVr <= 5);
Ie6 = (Ie && bVr == 6);
Ie7 = (Ie && bVr == 7);
Ie8 = (Ie && bVr >= 8);
Mz1 = (Mz && bVr == 1);
Mz2 = (Mz && bVr == 2);
Mz3 = (Mz && bVr >= 3);
Nt4 = (Nt && bVr == 4);
Nt6 = (Nt && bVr >= 6);
Op8 = (Op && bVr <= 8);
Op9 = (Op && bVr == 9);
OpA = (Op && bVr >= 10);

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// -- 70 / Choose proper css style sheets & image location according to the browser and page
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if (location.href.indexOf('htm') != -1 || location.href.indexOf('asp') != -1){ 	// if this is a page with the end of .htm or .asp
	{document.write ('<link rel="STYLESHEET" type="text/css" href="/travel.css">'); }
}
else
{  // the home page does not have an ending in its path when linked to by sight and not page name.
	{document.write ('<link rel="STYLESHEET" type="text/css" href="/travel.css">'); }
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// -- 92 / end of setup, start of different functions
//
///////////////////////////////////////////////////////////////////////////////////////////////////////

var btntxt = null;
var mnutxt = null;
var itmtxt = null;
var removeall = 'n'
var itmoff = 0;
var btnoff = 0;
var btnup = new Image();
var btndn = new Image();
btnup.src = "../images/button_off.jpg";
btndn.src = "../images/button_on.jpg";

function dsplybtn (btnnm, mnunm) {
	removeall = 'n'
	window.clearTimeout(btnoff);
	btnoff = 0;
	clrbtn();
	if (btnnm) {
		if (Ie5) {btntxt = eval ('document.all.'+btnnm+'.style');}
		if (Ie6||Ie7||Ie8||Fx||Mz||Nt6||Op||Sf) {btntxt = eval ('document.getElementById("'+btnnm+'").style');}
		if (Nt4) {btntxt = eval ('document.layers["'+btnnm+'"].style');}
		}
	if (mnunm) {
		if (Ie5) {mnutxt = eval ('document.all.'+mnunm+'.style'); }
		if (Ie6||Ie7||Ie8||Fx||Mz||Nt6||Op||Sf) {mnutxt = eval ('document.getElementById("'+mnunm+'").style');}
		if (Nt4) {mnutxt = eval ('document.layers["'+mnunm+'"].style');}
		}
	if (btntxt != null) {btntxt.background = "url(" + btndn.src + ")"};
	if (mnutxt != null) {
		if (Nt4) {mnutxt.visibility = 'show';}
		else {mnutxt.visibility = 'visible';}
		}
	}

function clrbtn() {
	if (btntxt != null) {
		btntxt.background = "url(" + btnup.src + ")";
		btntxt = null;
		}
	if (mnutxt != null) {
		if (Nt4) {mnutxt.visibility = 'hide';}
		else {mnutxt.visibility = 'hidden';}
		mnutxt = null;
		}
	}

function cnclbtn() {btnoff = setTimeout("clrbtn()",250);}

function colorontxt(itmnm) {
	removeall = 'n'
	window.clearTimeout(itmoff);
	window.clearTimeout(btnoff);
	removeclr();
	itmoff = 0;
	btnoff = 0;
	if (itmnm) {
		if (Ie5) {itmtxt = eval ('document.all.'+itmnm +'.style'); }
		if (Ie6||Ie7||Ie8||Fx||Mz||Nt6||Op||Sf) {itmtxt = eval ('document.getElementById("'+itmnm +'").style');}
		if (Nt4) {itmtxt = eval ('document.layers["'+itmnm +'"].style');}
		}
	if (itmtxt != null) {itmtxt.color='#0000BB';}
	}

function removeclr() {
	if (itmtxt != null) {itmtxt.color='#212D33';}
	if (removeall == 'y') {clrbtn();}
	}

function colorofftxt() {
	removeall = 'y'
	itmoff = setTimeout("removeclr()",250)
	}
