
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") {
	b2on = new Image(148, 19);
	b2on.src = "images/buttons/b2_on.gif";
	b3on = new Image(148, 19);
	b3on.src = "images/buttons/b3_on.gif";
	b4on = new Image(148, 19);
	b4on.src = "images/buttons/b4_on.gif";
	b5on = new Image(148, 19);
	b5on.src = "images/buttons/b5_on.gif";
	b6on = new Image(148, 19);
	b6on.src = "images/buttons/b6_on.gif";
	b7on = new Image(148, 19);
	b7on.src = "images/buttons/b7_on.gif";
	b8on = new Image(148, 19);
	b8on.src = "images/buttons/b8_on.gif";
	b9on = new Image(148, 19);
	b9on.src = "images/buttons/b9_on.gif";
	b10on = new Image(148, 19);
	b10on.src = "images/buttons/b10_on.gif";
	b11on = new Image(148, 19);
	b11on.src = "images/buttons/b11_on.gif";
	b12on = new Image(148, 19);
	b12on.src = "images/buttons/b12_on.gif";
	b13on = new Image(148, 19);
	b13on.src = "images/buttons/b13_on.gif";

	bsearchon = new Image(99, 16);
	bsearchon.src = "images/buttons/bsearch_on.gif";
	bcontacton = new Image(84, 16);
	bcontacton.src = "images/buttons/bcontact_on.gif";

	cruisespecialson = new Image(210, 96);
	cruisespecialson.src = "images/cruisespecials_on.jpg";
	calon = new Image(210, 96);
	calon.src = "images/cal_on.jpg";
	golfon = new Image(210, 96);
	golfon.src = "images/golf_on.gif";
	hotelson = new Image(210, 96);
	hotelson.src = "images/hotels_on.gif";
	newsletterson = new Image(210, 100);
	newsletterson.src = "images/newsletters_on.gif";
	winon = new Image(210, 100);
	winon.src = "images/win_on.gif";
	economyon = new Image(210, 96);
	economyon.src = "whynow/economy_on.jpg";

	b1off = new Image(148, 19);
	b1off.src = "images/buttons/b1_off.gif";
	b2off = new Image(148, 19);
	b2off.src = "images/buttons/b2_off.gif";
	b3off = new Image(148, 19);
	b3off.src = "images/buttons/b3_off.gif";
	b4off = new Image(148, 19);
	b4off.src = "images/buttons/b4_off.gif";
	b5off = new Image(148, 19);
	b5off.src = "images/buttons/b5_off.gif";
	b6off = new Image(148, 19);
	b6off.src = "images/buttons/b6_off.gif";
	b7off = new Image(148, 19);
	b7off.src = "images/buttons/b7_off.gif";
	b8off = new Image(148, 19);
	b8off.src = "images/buttons/b8_off.gif";
	b9off = new Image(148, 19);
	b9off.src = "images/buttons/b9_off.gif";
	b10off = new Image(148, 19);
	b10off.src = "images/buttons/b10_off.gif";
	b11off = new Image(148, 19);
	b11off.src = "images/buttons/b11_off.gif";
	b12off = new Image(148, 19);
	b12off.src = "images/buttons/b12_off.gif";
	b13off = new Image(148, 19);
	b13off.src = "images/buttons/b13_off.gif";

	bsearchoff = new Image(99, 16);
	bsearchoff.src = "images/buttons/bsearch_off.gif";
	bcontactoff = new Image(84, 16);
	bcontactoff.src = "images/buttons/bcontact_off.gif";

	cruisespecialsoff = new Image(210, 96);
	cruisespecialsoff.src = "images/cruisespecials_off.jpg";
	caloff = new Image(210, 96);
	caloff.src = "images/cal_off.jpg";
	golfoff = new Image(210, 100);
	golfoff.src = "images/golf_off.gif";
	hotelsoff = new Image(210, 100);
	hotelsoff.src = "images/hotels_off.gif";
	newslettersoff = new Image(210, 100);
	newslettersoff.src = "images/newsletters_off.gif";
	winoff = new Image(210, 100);
	winoff.src = "images/win_off.gif";
	economyoff = new Image(210, 96);
	economyoff.src = "whynow/economy_off.jpg";
	}
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 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);
}


var clval = new Array(10), clshow = new Array(10), clitin = new Array(10);
var itinval = new Array(7), itinshow = new Array(7), itincl = new Array(7);

clval[0] = "all";	clshow[0] = "No preference";		clitin[0] = "0123456";
clval[1] = "princess";	clshow[1] = "Princess Cruises";		clitin[1] = "023456";
clval[2] = "hal";	clshow[2] = "Holland America Line";	clitin[2] = "012456";
clval[3] = "rci";	clshow[3] = "Royal Caribbean";		clitin[3] = "01456";
clval[4] = "celebrity";	clshow[4] = "Celebrity Cruises";	clitin[4] = "0145";
clval[5] = "norwegian";	clshow[5] = "Norwegian Cruise Line";	clitin[5] = "012";
clval[6] = "carnival";	clshow[6] = "Carnival Cruise Line";	clitin[6] = "0145";
clval[7] = "crystal";	clshow[7] = "Crystal Cruises";		clitin[7] = "03";
clval[8] = "silversea";	clshow[8] = "Silversea Cruises";	clitin[8] = "01235";
clval[9] = "radisson";	clshow[9] = "Radisson Seven Seas";	clitin[9] = "0145";

itinval[0] = "all";	itinshow[0] = "No preference";		itincl[0] = "0123456789";
itinval[1] = "vn";	itinshow[1] = "Vancouver Roundtrip";	itincl[1] = "02345689";
itinval[2] = "se";	itinshow[2] = "Seattle Roundtrip";	itincl[2] = "01258";
itinval[3] = "sf";	itinshow[3] = "San Francisco Roundtrip";itincl[3] = "0178";
itinval[4] = "nb";	itinshow[4] = "Northbound One-way";	itincl[4] = "0123469";
itinval[5] = "sb";	itinshow[5] = "Southbound One-way";	itincl[5] = "01234689";
itinval[6] = "ct";	itinshow[6] = "Cruisetour (land packages)";itincl[6] = "0123";

function change_itin() {
  selectFlag = 0; selectFlag2 = 0;
// Find Value And Index Of Selected Item
  newVal = document.form3.cruiseline.options[document.form3.cruiseline.selectedIndex].value;
  for (arrayLoop=0; arrayLoop<clval.length; arrayLoop++) {
	if (clval[arrayLoop] == newVal) { selectFlag = arrayLoop; }
  }
// Find Value Of Selected Item In Target Menu
  newVal2 = document.form3.itinerary.options[document.form3.itinerary.selectedIndex].value;
// Remove All Options In Target Menu
  while (document.form3.itinerary.options.length > 0) { document.form3.itinerary.options[0] = null; }
// Insert New Options Based On Selection
  for (arrayLoop=0; arrayLoop<clitin[selectFlag].length; arrayLoop++) {
	document.form3.itinerary.options[arrayLoop] = new Option(itinshow[eval(clitin[selectFlag].substring(arrayLoop, arrayLoop+1))]);
	document.form3.itinerary.options[arrayLoop].value = itinval[eval(clitin[selectFlag].substring(arrayLoop, arrayLoop+1))];
	if (document.form3.itinerary.options[arrayLoop].value == newVal2) { selectFlag2 = arrayLoop; }
  }
  document.form3.itinerary.selectedIndex = selectFlag2;
}

function change_cl() {
  selectFlag = 0; selectFlag2 = 0;
  newVal = document.form3.itinerary.options[document.form3.itinerary.selectedIndex].value;
  for (arrayLoop=0; arrayLoop<itinval.length; arrayLoop++) {
	if (itinval[arrayLoop] == newVal) { selectFlag = arrayLoop; }
  }
  newVal2 = document.form3.cruiseline.options[document.form3.cruiseline.selectedIndex].value;
  while (document.form3.cruiseline.options.length > 0) { document.form3.cruiseline.options[0] = null; }
  for (arrayLoop=0; arrayLoop<itincl[selectFlag].length; arrayLoop++) {
	document.form3.cruiseline.options[arrayLoop] = new Option(clshow[eval(itincl[selectFlag].substring(arrayLoop, arrayLoop+1))]);
	document.form3.cruiseline.options[arrayLoop].value = clval[eval(itincl[selectFlag].substring(arrayLoop, arrayLoop+1))];
	if (document.form3.cruiseline.options[arrayLoop].value == newVal2) { selectFlag2 = arrayLoop; }
  }
  document.form3.cruiseline.selectedIndex = selectFlag2;
}

function reset_menus() {
  if (document.form3.cruiseline.options.length != clval.length) {
	while (document.form3.cruiseline.options.length > 0) { document.form3.cruiseline.options[0] = null; }
	for (arrayLoop=0; arrayLoop<clval.length; arrayLoop++) {
		document.form3.cruiseline.options[arrayLoop] = new Option(clshow[arrayLoop]);
		document.form3.cruiseline.options[arrayLoop].value = clval[arrayLoop];
	}
  }

  if (document.form3.itinerary.options.length != itinval.length) {
	while (document.form3.itinerary.options.length > 0) { document.form3.itinerary.options[0] = null; }
	for (arrayLoop=0; arrayLoop<itinval.length; arrayLoop++) {
		document.form3.itinerary.options[arrayLoop] = new Option(itinshow[arrayLoop]);
		document.form3.itinerary.options[arrayLoop].value = itinval[arrayLoop];
	}
  }

  if (document.form3.month.selectedIndex != 0) { document.form3.month.selectedIndex = 0; }
  if (document.form3.cruiseline.selectedIndex != 0) { document.form3.cruiseline.selectedIndex = 0; }
//  if (document.form3.price.selectedIndex != 0) { document.form3.price.selectedIndex = 0; }
  if (document.form3.itinerary.selectedIndex != 0) { document.form3.itinerary.selectedIndex = 0; }

}


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

function shipWindow() {
  shipName = document.form2.links4.value;
  if (shipName == "") { document.form2.links4.selectedIndex = 0; }
  else { window.open('/cgi/shipinfo.pl?' + shipName,'shipInfo','toolbar=no,width=640,height=350,directories=no,location=no,status=no,scrollbars=yes,resizable=yes,menubar=no'); }
}

function otherWindow() {
  locName = document.form2.links3.value;
  if (locName == "") { document.form2.links3.selectedIndex = 0; }
  else {
	if (locName.indexOf('http://') != -1) { window.open(locName,'otherPage','toolbar=no,width=760,height=580,directories=no,location=no,status=no,scrollbars=yes,resizable=yes,menubar=no'); }
	else { parent.location = locName; }
  }
}

currentDiv = "inside";
function toggle(idName) {
  document.all[currentDiv].style.display = "none";
  document.all[idName].style.display = "block";
  currentDiv = idName;
}

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