
function getCookie(cookieHeader)
{	var search = cookieHeader + "=", cookieString = "";
	if (document.cookie.length > 0)
	{
		findNameIndex = document.cookie.indexOf(search);
		if (findNameIndex != -1)
		{
			findNameIndex += search.length;
			endIndex = document.cookie.indexOf(";", findNameIndex);
			if (endIndex == -1) endIndex = document.cookie.length;
			cookieString = document.cookie.substring(findNameIndex, endIndex);
		}
	}
	return (cookieString);
}

//cookieString = ""; cookieString = getCookie("Country");
//if (cookieString == "Canada") { parent.location = "/cgi/cad.pl?" + location.href; }
//if (cookieString == "Canada") { alert(location.href); }

function onTop() {
  newVar = "onTop";
}

browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (browserName == "Netscape" && browserVer >= 3) version = "n3";
else version = "n2";
if (version == "n2" && browserName == "Microsoft Internet Explorer" && browserVer >= 4) version = "n3";
if (version == "n3") {
  searchon = new Image(125, 21);
  searchon.src = "/pics/buttons/searchbutton_on.gif";

  searchoff = new Image(125, 21);
  searchoff.src = "/pics/buttons/searchbutton_off.gif";
}

function img_act(imgName) {
	if (version == "n3") {
	imgOn = eval(imgName + "on.src");
	document[imgName].src = imgOn;
	}
}
function img_inact(imgName) {
	if (version == "n3") {
	imgOff = eval(imgName + "off.src");
	document[imgName].src = imgOff;
	}
}

function searchWindow() {
  search = window.open('/search.shtml','search','toolbar=no,width=238,height=300,directories=no,location=no,status=no,scrollbars=no,resizable=yes,menubar=no');
  if (search.opener == null) search.opener = window;
  search.opener.name = "opener";
}

function sendWindow(pageName) {
  document.cookie = "Webpage=" + pageName + ";path=/";
window.open('/cruiseplanner/sendtofriend.html','send','toolbar=no,width=350,height=375,directories=no,location=no,status=no,scrollbars=no,resize=no,menubar=no');
}

function jumpLink(formname) {
	newLink = eval("document." + formname + ".menu.options[document." + formname + ".menu.selectedIndex].value");
//	alert("newLink:  " + newLink);
//	if (newLink != "") parent.location = newLink;
//	else document." + formname + ".menu.selectedIndex = 0;

	if (newLink == "") {
		if (formname == "form1") document.form1.menu.selectedIndex = 0;
		if (formname == "form2") document.form2.menu.selectedIndex = 0;
	}
	else {
		if (newLink.substring(0, 3) == "../") newLink = newLink.substring(2, newLink.length);
		if (newLink == "/search.shtml" || newLink == "/airfare/index.html" || newLink == "/suggestions/" || newLink == "/contact.html" || newLink == "/select.html") {
			if (newLink == "/search.shtml") searchWindow();
			if (newLink == "/airfare/index.html") window.open('/airfare/index.html','Quotes');
			if (newLink == "/suggestions/") window.open('/suggestions/index.html','suggestions','toolbar=no,width=352,height=380,directories=no,location=no,status=no,scrollbars=yes,resize=no,menubar=no');
			if (newLink == "/contact.html") window.open('/contact.html','contact','toolbar=no,width=346,height=450,directories=no,location=no,status=no,scrollbars=no,resize=no,menubar=no');
			if (newLink == "/select.html") window.open('/select.html','select','toolbar=no,width=350,height=380,directories=no,location=no,status=no,scrollbars=yes,resize=no,menubar=no');
		}
		else {
			if (window.opener && !window.opener.closed) opener.location = newLink;
			else parent.location = newLink;
		}
	}
}

function message(txt) { window.status = txt; }
function remove_message() { window.status = ""; }

