//ships array
var cships = new Array();

//function for adding cruise lines to the array
function addCShip(shipCode, lineCode, ship){
	cshipline = ship + "|" + shipCode + "|" + lineCode;
	cships.push(cshipline);
}

//function to fill option box with cruise ships for the propper cruise line
function fillCShip(lineSelectFullName,shipSelectFullName){
	cline = lineSelectFullName.value;
	x = cships.length;
	i = 0;
	j = 2;
	
	if (cline == ""){
		shipSelectFullName.options.length = 0;
		shipSelectFullName.options[0] = new Option("Select a cruise ship...","",true,true);
		shipSelectFullName.options[1] = new Option("All Ships","");
		shipSelectFullName.options[2] = new Option("Please select a cruise line first","");
	}else{
		shipSelectFullName.options.length = 0;
		shipSelectFullName.options[0] = new Option("Select a cruise ship...","",true,true);
		shipSelectFullName.options[1] = new Option("All Ships","");
		while ( i < x ){
			ldata = cships[i].split("|");
			if ( ldata.length == 3 ){
				if ( ldata[2] == cline ){
					shipSelectFullName.options[j] = new Option(ldata[0],ldata[1]);
					j = j + 1;
				}
			}
			i = i + 1;
		}
	}
}

//fill the array with ships (ships in alpha order)
addCShip("324","2","Azamara Journey");
addCShip("325","2","Azamara Quest");
//Carnival
addCShip("5","1","Carnival Conquest"); 
addCShip("6","1","Carnival Destiny");
addCShip("305","1","Carnival Freedom");
addCShip("126","1","Carnival Glory");
addCShip("7","1","Carnival Legend");
addCShip("228","1","Carnival Liberty");
addCShip("171","1","Carnival Miracle");
addCShip("8","1","Carnival Pride");
addCShip("9","1","Carnival Spirit");
addCShip("53974","1","Carnival Splendor");
addCShip("22","1","Carnival Triumph");
addCShip("212","1","Carnival Valor");
addCShip("10","1","Carnival Victory");
addCShip("11","1","Celebration");
addCShip("12","1","Ecstasy");
addCShip("13","1","Elation");
addCShip("14","1","Fantasy");
addCShip("15","1","Fascination");
addCShip("16","1","Holiday"); 
addCShip("17","1","Imagination");
addCShip("18","1","Inspiration");
addCShip("20","1","Paradise");
addCShip("21","1","Sensation"); 
//Celebrity
addCShip("324","2","Celebrity Journey");
addCShip("225","2","Celebrity Quest");
addCShip("215","2","Celebrity Xpedition");
addCShip("27","2","Century");
addCShip("28","2","Constellation");
addCShip("29","2","Galaxy");
addCShip("31","2","Infinity"); 
addCShip("32","2","Mercury");
addCShip("33","2","Millennium");
addCShip("34","2","Summit");
addCShip("36","2","Zenith");
//Costa
addCShip("97","16","Costa Allegra"); 
addCShip("98","16","Costa Atlantica");
addCShip("99","16","Costa Classica");
addCShip("291","16","Costa Concordia");
addCShip("99","16","Costa Classica");
addCShip("117","16","Costa Europa");
addCShip("202","16","Costa Fortuna");
addCShip("232","16","Costa Magica");
addCShip("203","16","Costa Marina");
addCShip("136","16","Costa Mediterranea"); 
addCShip("102","16","Costa Romantica");
addCShip("318","16","Costa Serena");
addCShip("103","16","Costa Victoria");
//Crystal
addCShip("124","3","Crystal Serenity");
addCShip("57","3","Crystal Symphony");
//Cunard
addCShip("105","17","Queen Elizabeth 2");
addCShip("130","17","Queen Mary 2");
addCShip("201","17","Queen Victoria");
//Disney
addCShip("119","20","Disney Magic");
addCShip("120","20","Disney Wonder");
//Holland 
addCShip("64","4","Amsterdam");
addCShip("330","4","Eurodam")
addCShip("68","4","Maasdam");
addCShip("254","4","Noordam");
addCShip("125","4","Oosterdam");
addCShip("71","4","Prinsendam"); 
addCShip("73","4","Rotterdam");
addCShip("96","4","Ryndam");
addCShip("74","4","Statendam");
addCShip("75","4","Veendam");
addCShip("76","4","Volendam"); 
addCShip("190","4","Westerdam");
addCShip("78","4","Zaandam");
addCShip("115","4","Zuiderdam");
//Norwegian
addCShip("135","5","Norwegian Crown"); 
addCShip("86","5","Norwegian Dawn");
addCShip("87","5","Norwegian Dream");
addCShip("319","5","Norwegian Gem");
addCShip("53923","5","Norwegian Jade");
addCShip("231","5","Norwegian Jewel");
addCShip("88","5","Norwegian Majesty");
addCShip("301","5","Norwegian Pearl");
addCShip("173","5","Norwegian Sky");
addCShip("214","5","Nowegian Spirit"); 
addCShip("91","5","Norwegian Star");
addCShip("92","5","Norwegian Sun");
addCShip("93","5","Norwegian Wind");
addCShip("172","5","Pride of America");
//Oceania 
addCShip("168","61","Insignia");
addCShip("237","61","Nautica");
addCShip("167","61","Regatta");
//Princess
addCShip("189","6","Caribbean Princess");
addCShip("127","6","Coral Princess");
addCShip("253","6","Crown Princess");
addCShip("66","6","Dawn Princess");
addCShip("128","6","Diamond Princess");
addCShip("306","6","Emerald Princess");
addCShip("67","6","Golden Princess"); 
addCShip("69","6","Grand Princess");
addCShip("129","6","Island Princess");
addCShip("132","6","Pacific Princess");
addCShip("80","6","Regal Princess");
addCShip("308","6","Royal Princess"); 
addCShip("54597","6","Ruby Princess");
addCShip("169","6","Sapphire Princess");
addCShip("82","6","Sea Princess");
addCShip("83","6","Star Princess");
addCShip("84","6","Sun Princess");
addCShip("131","6","Tahitian Princess");
//Royal Caribbean
addCShip("2","8","Adventure of the Seas");
addCShip("35","8","Brilliance of the Seas");
addCShip("42","8","Empress of the Seas");
addCShip("37","8","Enchantment of the Seas");
addCShip("1","8","Explorer of the Seas");
addCShip("248","8","Freedom of the Seas");
addCShip("38","8","Grandeur of the Seas"); 
addCShip("187","8","Jewel of the Seas");
addCShip("39","8","Legend of the Seas");
addCShip("307","8","Liberty of the Seas");
addCShip("40","8","Majesty of the Seas");
addCShip("162","8","Mariner of the Seas");
addCShip("41","8","Monarch of the Seas"); 
addCShip("116","8","Navigator of the Seas");
addCShip("43","8","Radiance of the Seas");
addCShip("45","8","Rhapsody of the Seas");
addCShip("137","8","Serenade of the Seas"); 
addCShip("47","8","Sovereign of the Seas");
addCShip("50","8","Splendour of the Seas");
addCShip("55","8","Vision of the Seas");
addCShip("3","8","Voyager of the Seas");
//Seabourne
addCShip("106","18","Seabourn Legend"); 
addCShip("107","18","Seabourn Pride");
addCShip("108","18","Seabourn Spirit");
//windstar 
addCShip("24","9","Wind Spirit");
addCShip("25","9","Wind Star");
addCShip("26","9","Wind Surf");
//Discovery World
addCShip("227","71","MV Discovery");


