﻿var ships = new Array();
var allships = new Array();

ships[6] = new Array(); 
ships[6][0] = new Array('M.S. Davinci','M.S. Fleurette'); 
ships[6][1] = new Array('356','453');
ships[66] = new Array(); 
ships[66][0] = new Array('Journey','Quest'); 
ships[66][1] = new Array('414','415'); 
ships[8] = new Array(); 
ships[8][0] = new Array('Conquest','Destiny','Dream','Ecstasy','Elation','Fantasy','Fascination','Freedom','Glory','Holiday','Imagination','Inspiration','Legend','Liberty','Miracle','Paradise','Pride','Sensation','Spirit','Splendor','Triumph','Valor','Victory'); 
ships[8][1] = new Array('34','41','466','35','31','36','38','364','39','40','33','30','28','246','27','21','26','32','25','409','24','245','22'); 
ships[3] = new Array(); 
ships[3][0] = new Array('Century','Constellation','Eclipse','Equinox','Galaxy','Infinity','Mercury','Millennium','Solstice','Summit','Xpedition'); 
ships[3][1] = new Array('9','8','476','442','7','13','14','6','427','12','205'); 
ships[9] = new Array(); 
ships[9][0] = new Array('Costa Allegra','Costa Atlantica','Costa Classica','Costa Concordia','Costa Deliziosa','Costa Europa','Costa Fortuna','Costa Luminosa','Costa Magica','Costa Mediterranea','Costa Pacifica','Costa Romantica','Costa Serena','Costa Victoria'); 
ships[9][1] = new Array('49','50','48','334','475','47','52','438','42','45','439','43','365','51'); 
ships[10] = new Array(); 
ships[10][0] = new Array('Crystal Serenity','Crystal Symphony'); 
ships[10][1] = new Array('54','55'); 
ships[5] = new Array(); 
ships[5][0] = new Array('Queen Mary 2','Queen Victoria','Queen Elizabeth'); 
ships[5][1] = new Array('56','57','472'); 
ships[15] = new Array(); 
ships[15][0] = new Array('Amsterdam','Eurodam','Maasdam','Noordam','Oosterdam','Prinsendam','Rotterdam','Ryndam','Statendam','Veendam','Volendam','Westerdam','Zaandam','Zuiderdam'); 
ships[15][1] = new Array('73','399','82','81','80','79','78','83','77','76','75','72','74','84'); 
ships[2] = new Array(); 
ships[2][0] = new Array('Island Escape'); 
ships[2][1] = new Array('5'); 
ships[16] = new Array(); 
ships[16][0] = new Array('Armonia','Fantasia','Lirica','Magnifica','Melody','Musica','Opera','Orchestra','Poesia','Rhapsody','Sinfonia','Splendida'); 
ships[16][1] = new Array('185','458','89','463','88','326','86','379','428','85','244','462'); 
ships[17] = new Array(); 
ships[17][0] = new Array('Norwegian Dawn','Norwegian Dream','Norwegian Epic','Norwegian Gem','Norwegian Jade','Norwegian Jewel','Norwegian Majesty','Norwegian Pearl','Norwegian Spirit','Norwegian Star','Norwegian Sun','Pride of America'); 
ships[17][1] = new Array('94','95','478','371','410','248','96','368','268','99','100','103'); 
ships[4] = new Array(); 
ships[4][0] = new Array('Ocean Village','Ocean Village 2'); 
ships[4][1] = new Array('106','363'); 
ships[48] = new Array(); 
ships[48][0] = new Array('Insignia','Nautica','Regatta'); 
ships[48][1] = new Array('261','260','259'); 
ships[1] = new Array(); 
ships[1][0] = new Array('Arcadia','Artemis','Aurora','Azura','Oceana','Oriana','Ventura'); 
ships[1][1] = new Array('180','181','3','471','2','4','396'); 
ships[20] = new Array(); 
ships[20][0] = new Array('Caribbean Princess','Coral Princess','Crown Princess','Dawn Princess','Diamond Princess','Emerald Princess','Golden Princess','Grand Princess','Island Princess','Ocean Princess','Pacific Princess','Royal Princess','Ruby Princess','Sapphire Princess','Sea Princess','Star Princess','Sun Princess','Tahitian Princess'); 
ships[20][1] = new Array('117','121','269','120','119','367','118','110','116','456','122','115','416','114','179','113','112','111'); 
ships[69] = new Array(); 
ships[69][0] = new Array('Holiday Dream','Pacific Dream','Sky Wonder','Sovereign','Zenith'); 
ships[69][1] = new Array('430','434','433','1000','432'); 
ships[21] = new Array(); 
ships[21][0] = new Array('Paul Gauguin','Seven Seas Mariner','Seven Seas Navigator','Seven Seas Voyager'); 
ships[21][1] = new Array('127','125','123','124'); 
ships[22] = new Array(); 
ships[22][0] = new Array('Adventure of the Seas','Allure of the Seas','Brilliance of the Seas','Enchantment of the Seas','Explorer of the Seas','Freedom of the Seas','Grandeur of the Seas','Independence of the Seas','Jewel of the Seas','Legend of the Seas','Liberty of the Seas','Majesty of the Seas','Mariner of the Seas','Monarch of the Seas','Navigator of the Seas','Oasis of the Seas','Radiance of the Seas','Rhapsody of the Seas','Serenade of the Seas','Splendour of the Seas','Vision of the Seas','Voyager of the Seas'); 
ships[22][1] = new Array('140','481','147','146','136','270','144','393','145','143','369','142','141','148','130','457','138','137','135','133','132','131'); 
ships[28] = new Array(); 
ships[28][0] = new Array('Emerald','The Calypso','Thomson Celebration','Thomson Destiny','Thomson Spirit'); 
ships[28][1] = new Array('173','366','183','184','174'); 
ships[29] = new Array(); 
ships[29][0] = new Array('Wind Surf', 'Wind Spirit', 'Wind Star'); 
ships[29][1] = new Array('175', '176', '177'); 
ships[11] = new Array(); 
ships[11][0] = new Array('MS Darakum','MS Sunray'); 
ships[11][1] = new Array('1001','1002'); 

function updateships(box, selecteditem ) {
	if (box.value == "") {
		list = allships[0];
		emptyList( document.getElementById("ddlShip"), 1 );
		fillList( document.getElementById("ddlShip"), list, selecteditem );
	} else {
		list = ships[box.options[box.selectedIndex].value];
		emptyList( document.getElementById("ddlShip"), 1 );
		fillList( document.getElementById("ddlShip"), list, selecteditem );
	}
}

function updateheaderships(box, selecteditem ) {
	if (box.value == "") {
		list = allships[0];
		emptyList( document.getElementById("ctl00_ddlShip"), 1 );
		fillList( document.getElementById("ctl00_ddlShip"), list, selecteditem );
	} else {
		list = ships[box.options[box.selectedIndex].value];
		emptyList( document.getElementById("ctl00_ddlShip"), 1 );
		fillList( document.getElementById("ctl00_ddlShip"), list, selecteditem );
	}
}

function emptyList( box, start ) {
	var size = box.options.length;
	for (i = size; i >= start; i--) {
		box.options[i] = null;
	}
}
function fillList( box, arr, selecteditem ) {
	for ( i = 0; i < arr[0].length; i++ ) {
		option = new Option( arr[0][i], arr[1][i] );
		box.options[box.length] = option;
	}
	if (selecteditem) {
		box.value = selecteditem;
	} else {
		box.value = "";
	}
}

function ShowSupplier(event,Id)
{
    LookupPanel.startCallback(event,"ID=" + Id.toString(),null,OnError);    
}   
function HideSupplier()
{
    LookupPanel.hide();
}

function ShowCabin(event,Code, Id)
{
    LookupCabinPanel.startCallback(event,"CCode=" + Code.toString() + "&ShipId="+ Id.toString(),null,OnError);    
}   
function HideCabin()
{
    LookupCabinPanel.hide();
}

function OnError(Result)
{
}
function selectedDeck(deckid){
	var totaldecks = 11;
	for (i=0; i<totaldecks; i++) {
		eval(document.getElementById("deck"+i).className=selecteddeck);
		var changefield=eval(document.getElementById("deck"+i).className=selecteddeck);	
	}
	var selecteddeck = ('selecteddeck');
	var changefield=eval(document.getElementById(deckid).className=selecteddeck);
}

  var dec = (typeof decodeURIComponent == 'function') ? decodeURIComponent : decode;
  function resize_ifrm() {
    var ifrm = document.getElementById('ifrm');
    if(window.frames['ifrm'] && window.frames['ifrm'].document) {
      window.frames['ifrm'].window.scroll(0,0);
      var body = window.frames['ifrm'].document.body;
      if(body) {
        ifrm.style.height = (body.scrollHeight || body.offsetHeight) + 'px';
      }
    }
  }
  src_checked = false;
  function check_src(URL) {
    if(src_checked) return;
    src_checked = true;
    var ifrm = document.getElementById('ifrm');
    var urlPos = location.search.indexOf("iframeUrl=");
    if(urlPos > -1) {
      var src = dec(location.search.substring(urlPos+10));
    } else {
      var src = URL;
    }
    if(src != ifrm.src) ifrm.src = src;
  }
