
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") {
	b1on = new Image(148, 19);
	b1on.src = "/images/buttons/b1_on.gif";
	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";
	b14on = new Image(148, 19);
	b14on.src = "/images/buttons/b14_on.gif";

	bhomeon = new Image(47, 16);
	bhomeon.src = "/images/buttons/bhome_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";
	bcruiseson = new Image(60, 15);
	bcruiseson.src = "/images/buttons/cruises_on.gif";
	bctson = new Image(87, 15);
	bctson.src = "/images/buttons/cruisetours_on.gif";
	redon = new Image(27, 15);
	redon.src = "/images/buttons/red_on.gif";
	may2012on = new Image(60, 15);
	may2012on.src = "/images/buttons/may2012_on.gif";
	jun2012on = new Image(60, 15);
	jun2012on.src = "/images/buttons/jun2012_on.gif";
	jul2012on = new Image(60, 15);
	jul2012on.src = "/images/buttons/jul2012_on.gif";
	aug2012on = new Image(60, 15);
	aug2012on.src = "/images/buttons/aug2012_on.gif";
	sep2012on = new Image(60, 15);
	sep2012on.src = "/images/buttons/sep2012_on.gif";
	may2013on = new Image(60, 15);
	may2013on.src = "/images/buttons/may2013_on.gif";
	jun2013on = new Image(60, 15);
	jun2013on.src = "/images/buttons/jun2013_on.gif";
	jul2013on = new Image(60, 15);
	jul2013on.src = "/images/buttons/jul2013_on.gif";
	aug2013on = new Image(60, 15);
	aug2013on.src = "/images/buttons/aug2013_on.gif";
	sep2013on = new Image(60, 15);
	sep2013on.src = "/images/buttons/sep2013_on.gif";

	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";
	b14off = new Image(148, 19);
	b14off.src = "/images/buttons/b14_off.gif";

	bhomeoff = new Image(47, 16);
	bhomeoff.src = "/images/buttons/bhome_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";
	bcruisesoff = new Image(60, 15);
	bcruisesoff.src = "/images/buttons/cruises_off.gif";
	bctsoff = new Image(87, 15);
	bctsoff.src = "/images/buttons/cruisetours_off.gif";
	blueoff = new Image(27, 15);
	blueoff.src = "/images/buttons/blue_off.gif";
	may2012off = new Image(60, 15);
	may2012off.src = "/images/buttons/may2012_off.gif";
	jun2012off = new Image(60, 15);
	jun2012off.src = "/images/buttons/jun2012_off.gif";
	jul2012off = new Image(60, 15);
	jul2012off.src = "/images/buttons/jul2012_off.gif";
	aug2012off = new Image(60, 15);
	aug2012off.src = "/images/buttons/aug2012_off.gif";
	sep2012off = new Image(60, 15);
	sep2012off.src = "/images/buttons/sep2012_off.gif";
	may2013off = new Image(60, 15);
	may2013off.src = "/images/buttons/may2013_off.gif";
	jun2013off = new Image(60, 15);
	jun2013off.src = "/images/buttons/jun2013_off.gif";
	jul2013off = new Image(60, 15);
	jul2013off.src = "/images/buttons/jul2013_off.gif";
	aug2013off = new Image(60, 15);
	aug2013off.src = "/images/buttons/aug2013_off.gif";
	sep2013off = new Image(60, 15);
	sep2013off.src = "/images/buttons/sep2013_off.gif";
	}
function img_act(imgName) {
  if (version == "n3") {
	origName = imgName; prefix = imgName.substring(0, 2);
	if ((prefix == "cr" || prefix == "ct") && imgName.substring(0, 6) != "cruise") { imgName = origName.substring(2, origName.length); }
	imgOn = eval(imgName + "on.src");
	if (imgName != origName) { imgName = origName; }
	document[imgName].src = imgOn;
	if (prefix == "ct") { document["cx" + origName.substring(2, origName.length)].src = redon.src; }
  }
}

function img_inact(imgName) {
  if (version == "n3") {
	origName = imgName; prefix = imgName.substring(0, 2);
	if ((prefix == "cr" || prefix == "ct") && imgName.substring(0, 6) != "cruise") { imgName = origName.substring(2, origName.length); }
	imgOff = eval(imgName + "off.src");
	if (imgName != origName) { imgName = origName; }
	document[imgName].src = imgOff;
	if (prefix == "ct") { document["cx" + origName.substring(2, origName.length)].src = blueoff.src; }
  }
}


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);
}


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 checkMenu(thisMenu) {
  thisLoc = "";
  if (thisMenu == "cruises") {
	thisLoc = document.formlinks.cruises.options[document.formlinks.cruises.selectedIndex].value;
	if (thisLoc == "") { document.formlinks.cruises.selectedIndex = 0; }
  }
  else if (thisMenu == "cruisetours") {
	thisLoc = document.formlinks.cruisetours.options[document.formlinks.cruisetours.selectedIndex].value;
	if (thisLoc == "") { document.formlinks.cruisetours.selectedIndex = 0; }
  }
  if (thisLoc != "") { parent.location = thisLoc; }
}


function createWindow(target,width,height) {
  targetName = target;
  targetName = target.substring(0, target.lastIndexOf('.'));
  if (target.indexOf('/') != -1) { targetName = targetName.substring(targetName.lastIndexOf('/')+1, length.targetName); }
//  params = "toolbar=no,width=" + width + ",height=" + height + ",directories=no,location=no,status=no,scrollbars=no,resizable=yes,menubar=no";
//  alert("x" + targetName + "x");

  window.open(target, targetName, "toolbar=no,width=" + width + ",height=" + height + ",directories=no,location=no,status=no,scrollbars=no,resizable=yes,menubar=no");
}


  var agt = navigator.userAgent.toLowerCase();
  var appVer = navigator.appVersion.toLowerCase();

  var is_minor = parseFloat(appVer);
  var is_major = parseInt(is_minor);

  var is_opera = (agt.indexOf("opera") != -1);

  var is_mac = (agt.indexOf("mac")!=-1);
  var iePos  = appVer.indexOf('msie');
  if (iePos !=-1) {
	if(is_mac) {
		var iePos = agt.indexOf('msie');
		is_minor = parseFloat(agt.substring(iePos+5,agt.indexOf(';',iePos)));
	}
	else is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));
	is_major = parseInt(is_minor);
  }

  var is_konq = false;
  var kqPos = agt.indexOf('konqueror');
  if (kqPos !=-1) {                 
	is_konq = true;
	is_minor = parseFloat(agt.substring(kqPos+10,agt.indexOf(';',kqPos)));
	is_major = parseInt(is_minor);
  }                                 

  var is_safari = ((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))?true:false;
  var is_khtml = (is_safari || is_konq);

  var is_gecko = ((!is_khtml)&&(navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?true:false;
  var is_gver = 0;
  if (is_gecko) is_gver=navigator.productSub;

  var is_fb = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) && (is_gecko) && (navigator.vendor=="Firebird"));

  var is_fx = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) && (is_gecko) && ((navigator.vendor=="Firefox")||(agt.indexOf('firefox')!=-1)));

  var is_moz = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) && (is_gecko) && (!is_fb) && (!is_fx) && ((navigator.vendor=="")||(navigator.vendor=="Mozilla")||(navigator.vendor=="Debian")));

  if ((is_moz)||(is_fb)||(is_fx)) {
	var is_moz_ver = (navigator.vendorSub)?navigator.vendorSub:0;
	if (is_fx&&!is_moz_ver) {
		is_moz_ver = agt.indexOf('firefox/');
		is_moz_ver = agt.substring(is_moz_ver+8);
		is_moz_ver = parseFloat(is_moz_ver);
	}
	if (!(is_moz_ver)) {
		is_moz_ver = agt.indexOf('rv:');
		is_moz_ver = agt.substring(is_moz_ver+3);
		is_paren   = is_moz_ver.indexOf(')');
		is_moz_ver = is_moz_ver.substring(0,is_paren);
	}
	is_minor = is_moz_ver;
	is_major = parseInt(is_moz_ver);
  }
  var is_fb_ver = is_moz_ver;
  var is_fx_ver = is_moz_ver;

  var is_ie = ((iePos!=-1) && (!is_opera) && (!is_khtml));

  var is_ie6 = (is_ie && is_major == 6);
  var is_ie6up = (is_ie && is_minor >= 6);

  var is_ie7 = (is_ie && is_major == 7);
  var is_ie7up = (is_ie && is_minor >= 7);

  var is_all = (document.all) ? "true" : "false";
  var is_getElementById = (document.getElementById) ? "true" : "false";


  var bName = navigator.appName;
  var bVer = parseInt(navigator.appVersion);
  var NS6 = (bName == "Netscape" && bVer >= 5);
  var NS4 = (bName == "Netscape" && bVer >= 4 && bVer < 5);
  var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
  var NS3 = (bName == "Netscape" && bVer < 4);
  var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);
  var fxpx = ""; if (is_fx == true) { fxpx = "px"; }
  window.onerror = null;
  var menuActive = 0;
  var menuOn = 0;
  var onLayer;
  var timeOn = null;

// LAYER SWITCHING CODE
  if (NS4 || IE4 || NS6) {
	if (navigator.appName == "Netscape" && !document.getElementById) {
		layerStyleRef="layer.";
		layerRef="document.layers";
		styleSwitch="";
		layerVis="show";
		layerHid="hide";
	}
	else if (!document.all && document.getElementById) {
		layerStyleRef="layer.style.";
		layerRef="document.getElementById";
		styleSwitch=".style";
		layerVis="visible";
		layerHid="hidden";
	}
	else {
		layerStyleRef="layer.style.";
		layerRef="document.all";
		styleSwitch=".style";
		layerVis="visible";
		layerHid="hidden";
	}
  }

// SHOW MENU
function shLayer(layerName) {
  img = getImage("bcruises");
  x = getImagePageLeft(img);
  y = getImagePageTop(img);// alert(bName + " " + bVer + is_ie + is_fx + IE4 + NS6 + " " + x + " " + y);
  menuTop = y + 16; // LAYER TOP POSITION
  crmonthsL = x;
  ctmonthsL = x + 61;

if (NS4 || IE4 || NS6) {
  if (timeOn != null) {
	clearTimeout(timeOn);
	hideLayer(onLayer);
  }
  if ((NS4 || IE4) && is_fx == false) {
	eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerVis+'"');
	eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.top="'+menuTop+'"');
	eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.left="'+eval(layerName+'L')+'"');
  } 
  if (NS6 || is_fx == true) {
	eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="'+layerVis+'"');
	eval(layerRef+'("'+layerName+'")'+styleSwitch+'.top="'+menuTop+fxpx+'"');
	eval(layerRef+'("'+layerName+'")'+styleSwitch+'.left="'+eval(layerName+'L')+fxpx+'"');
  } 
  onLayer = layerName;
  }
}

// HIDE MENU
function hideLayer(layerName) {
  if (menuActive == 0) {
	if (NS4 || IE4) {
		eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerHid+'"');
	}
	if (NS6) {
		eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="'+layerHid+'"');
	}
  }
}

// TIMER FOR BUTTON MOUSE OUT
function btnTimer() { timeOn = setTimeout("btnOut()",20); }

// BUTTON MOUSE OUT
function btnOut(layerName) {
  if (menuActive == 0) { hideLayer(onLayer); }
}

// MENU MOUSE OVER 
function menuOver(itemName) {
  clearTimeout(timeOn);
  menuActive = 1;
//  img_act(itemName); playsound(0);
}

// MENU MOUSE OUT 
function menuOut(itemName) {
  menuActive = 0;
  timeOn = setTimeout("hideLayer(onLayer)", 100);
}

function getImage(name) {
  if (NS4 || NS6) { return findImage(name, document); }
  if (IE4 || NS6) 
	return eval('document.all.' + name);
  return null;
}

function findImage(name, doc) {
  var i, img;
  for (i = 0; i < doc.images.length; i++)
    if (doc.images[i].name == name)
      return doc.images[i];
  for (i = 0; i < doc.layers.length; i++)
    if ((img = findImage(name, doc.layers[i].document)) != null) {
      img.container = doc.layers[i];
      return img;
    }
  return null;
}

function getImagePageLeft(img) {
  var x, obj;// alert(is_fx + " " + x);
  if ((NS4 || NS6) && is_fx == false) {
    if (img.container != null)
      return img.container.pageX + img.x - 1;
    else
      return img.x - 1;
  }
  if (IE4 || is_fx == true) {
    x = 0;
    obj = img;
    while (obj.offsetParent != null) {
      x += obj.offsetLeft;
      obj = obj.offsetParent;
    }
    x += obj.offsetLeft;
    return x;
  }
  return -1;
}

function getImagePageTop(img) {
  var y, obj;
  if ((NS4 || NS6) && is_fx == false) {
    if (img.container != null)
      return img.container.pageY + img.y;
    else
      return img.y;
  }
  if (IE4 || is_fx == true) {
    y = 0;
    obj = img;
    while (obj.offsetParent != null) {
      y += obj.offsetTop;
      obj = obj.offsetParent;
    }
    y += obj.offsetTop;
    return y;
  }
  return -1;
}


var soundArray = new Array("/images/buttons/ding.wav");
//soundArray[0] = "/images/buttons/ding.wav";

document.write('<BGSOUND ID="auIEContainer">')
IE = (navigator.appVersion.indexOf("MSIE") != -1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
ver4 = IE||NS? 1:0;
onload = auPreload;

function auPreload() {
  if (!ver4) return;
  if (NS) auEmb = new Layer(0,window);
  else {
	Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
	document.body.insertAdjacentHTML("BeforeEnd", Str);
  }
  var Str = '';
  for (i=0; i<soundArray.length; i++);
  Str += "<EMBED SRC='" + soundArray[i] + "' AUTOSTART='FALSE' HIDDEN='TRUE' VOLUME=50 width=1 height=1>";
  if (IE) auEmb.innerHTML = Str;
  else {
	auEmb.document.open();
	auEmb.document.write(Str);
	auEmb.document.close();
  }
  auCon = IE? document.all.auIEContainer:auEmb;
  auCon.control = auCtrl;
}

function auCtrl(whSound,play) {
  if (IE) this.src = play? soundArray[whSound]:'';
  else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"));
}

function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }


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

