function validateAdvancedform()	{
	if (isValidZip(document.AdvancedForm.shoppingZipCode.value)){
		hide_inlinemsg('errShowZipMsg');
    		return true;}
    	else	{
    		display_inlinemsg('errShowZipMsg') ;
    		return false;}
}

var Cruise1Array = new Array("('-- All Ships -------------------------','ALL',true,true)",
"('Carnival Conquest','405')", 
"('Carnival Destiny','28')", 
"('Carnival Glory','414')", 
"('Carnival Legend','406')", 
"('Carnival Liberty','441')", 
"('Carnival Miracle','426')", 
"('Carnival Pride','398')", 
"('Carnival Spirit','29')", 
"('Carnival Triumph','30')", 
"('Carnival Valor','436')", 
"('Carnival Victory','31')", 
"('Celebration','33')", 
"('Ecstasy','34')", 
"('Elation','35')", 
"('Fantasy','36')", 
"('Fascination','37')", 
"('Holiday','39')", 
"('Imagination','40')", 
"('Inspiration','41')", 
"('Paradise','45')", 
"('Sensation','46')");

var Cruise11Array = new Array("('-- All Ships -------------------------','ALL',true,true)",
"('Century','51')", 
"('Constellation','403')", 
"('Galaxy','53')", 
"('Horizon','54')", 
"('Infinity','55')", 
"('Kapitan Khlebnikov','442')", 
"('Mercury','56')", 
"('Millennium','58')", 
"('Summit','60')", 
"('Xpedition','438')", 
"('Zenith','62')");

var Cruise14Array = new Array("('-- All Ships -------------------------','ALL',true,true)",
"('Costa Allegra','73')", 
"('Costa Atlantica','74')", 
"('Costa Classica','75')", 
"('Costa Europa','412')", 
"('Costa Fortuna','433')", 
"('Costa Magica','437')", 
"('Costa Mediterranea','425')", 
"('Costa Romantica','79')", 
"('Costa Tropicale','48')", 
"('Costa Victoria','80')");

var Cruise17Array = new Array("('-- All Ships -------------------------','ALL',true,true)",
"('Crystal Harmony','86')", 
"('Crystal Serenity','419')", 
"('Crystal Symphony','87')");

var Cruise18Array = new Array("('-- All Ships -------------------------','ALL',true,true)",
"('Queen Elizabeth 2','93')", 
"('Queen Mary 2','420')");

var Cruise20Array = new Array("('-- All Ships -------------------------','ALL',true,true)",
"('Disney Magic','99')", 
"('Disney Wonder','100')");

var Cruise24Array = new Array("('-- All Ships -------------------------','ALL',true,true)",
"('Amsterdam','108')", 
"('Maasdam','110')", 
"('Oosterdam','410')", 
"('Prinsendam','407')", 
"('Rotterdam','113')", 
"('Ryndam','114')", 
"('Statendam','117')", 
"('Veendam','118')", 
"('Volendam','119')", 
"('Westerdam','434')", 
"('Zaandam','121')", 
"('Zuiderdam','409')");

var Cruise34Array = new Array("('-- All Ships -------------------------','ALL',true,true)",
"('Norwegian Crown','424')", 
"('Norwegian Dawn','411')", 
"('Norwegian Dream','136')", 
"('Norwegian Jewel','444')", 
"('Norwegian Majesty','137')", 
"('Norwegian Sea','138')", 
"('Norwegian Spirit','439')", 
"('Norwegian Star','402')", 
"('Norwegian Sun','116')", 
"('Norwegian Wind','141')", 
"('Pride of Aloha','435')", 
"('Pride of America','431')");

var Cruise36Array = new Array("('-- All Ships -------------------------','ALL',true,true)",
"('Marco Polo','333')");

var Cruise40Array = new Array("('-- All Ships -------------------------','ALL',true,true)",
"('Caribbean Princess','428')", 
"('Coral Princess','404')", 
"('Dawn Princess','172')", 
"('Diamond Princess','418')", 
"('Golden Princess','174')", 
"('Grand Princess','175')", 
"('Island Princess','415')", 
"('Pacific Princess','423')", 
"('Regal Princess','180')", 
"('Royal Princess','181')", 
"('Sapphire Princess','427')", 
"('Sea Princess','182')", 
"('Star Princess','185')", 
"('Sun Princess','186')", 
"('Tahitian Princess','422')");

var Cruise41Array = new Array("('-- All Ships -------------------------','ALL',true,true)",
"('Paul Gauguin','188')", 
"('Regent Diamond','189')", 
"('Seven Seas Mariner','190')", 
"('Seven Seas Navigator','191')", 
"('Seven Seas Voyager','421')");

var Cruise44Array = new Array("('-- All Ships -------------------------','ALL',true,true)",
"('Adventure of the Seas','378')", 
"('Brilliance of the Seas','399')", 
"('Empress of the Seas','223')", 
"('Enchantment of the Seas','216')", 
"('Explorer of the Seas','217')", 
"('Freedom of the Seas','502')", 
"('Grandeur of the Seas','218')", 
"('Jewel of the Seas','432')", 
"('Legend of the Seas','219')", 
"('Majesty of the Seas','220')", 
"('Mariner of the Seas','417')", 
"('Monarch of the Seas','221')", 
"('Navigator of the Seas','408')", 
"('Radiance of the Seas','225')", 
"('Rhapsody of the Seas','228')", 
"('Serenade of the Seas','416')", 
"('Sovereign of the Seas','232')", 
"('Splendour of the Seas','233')", 
"('Vision of the Seas','236')", 
"('Voyager of the Seas','237')");

var Cruise48Array = new Array("('-- All Ships -------------------------','ALL',true,true)",
"('Seabourn Legend','247')", 
"('Seabourn Pride','248')", 
"('Seabourn Spirit','249')");

var Cruise50Array = new Array("('-- All Ships -------------------------','ALL',true,true)",
"('Silver Cloud','367')", 
"('Silver Shadow','368')", 
"('Silver Whisper','377')", 
"('Silver Wind','369')");

var Cruise64Array = new Array("('-- All Ships -------------------------','ALL',true,true)",
"('Wind Spirit','277')", 
"('Wind Star','278')", 
"('Wind Surf','279')");

var Cruise67Array = new Array("('-- All Ships -------------------------','ALL',true,true)",
"('Insignia','429')", 
"('Nautica','495')", 
"('Regatta','430')");

var CruiseALLArray = new Array("('-- All Ships -------------------------','ALL',true,true)");

function setSelectedValue(as_element, as_value) {
    var lo_thisEl = eval('document.AdvancedForm.' + as_element);
    var li_length = lo_thisEl.length;
    
    for(var i = 0; i < li_length; i++) {
		if (lo_thisEl.options[i].value == as_value) {
			lo_thisEl.selectedIndex = i;
			break;
		}
	}
} 

function removeByValue(fromEl, sValue) 
{
    var formElement=eval('document.AdvancedForm.' + fromEl );
    var fromLength = formElement.length;
    for (var x = 0; x < fromLength; x++) 
    {
        if (formElement.options[x].value == sValue) 
        {
        	formElement.options[x] = null;
        	break;
        }
    }
}  

function setValues() {
    //first, remove the NS 4.x placeholders fron the ship element
    removeByValue('vessel_id', 'ph1');
    removeByValue('vessel_id', 'ph2');
    removeByValue('vessel_id', 'ph3');
    removeByValue('vessel_id', 'ph4');
    
    //now, set any selected values that were passed into the sub
    setSelectedValue('places', 'C');
    setSelectedValue('operator', '');
    setSelectedValue('days', '');
    setSelectedValue('sort', '');    
    
    //after the line is selected, populate the vessel dropdown
    //the file: /Code/JavaScript/DynamicSelect_Cruises.js needs to be included on the calling page
    
    populateVessels(document.AdvancedForm);    
    setSelectedValue('vessel_id', '');
}
