 /* 
 ' $Header: /WebSites/library/javascript/general/VOSubHomePage.js 2     2/24/09 12:43p Sampsonm $
 ' $Workfile: VOSubHomePage.js $ 
 ' $Author: Sampsonm $ 
 ' $Date: 2/24/09 12:43p $ 
 ' used by secondary vo home pages-package, cruise, lm
 */

 function submitForm(){
    // if called from the cruise search or vacation search
		if(isValidZip(document.SearchFormCru.shoppingZipCode.value))
		{
			hide_inlinemsg('errShowZipMsg');
			return true;
		}
		else
		{
			display_inlinemsg('errShowZipMsg'); 
			return false;
		}				
    }
    
 function submitFormV(){
        if (isValidSearchForm('<%= packagePhoneNumber %>')){
            EntirePage.style.display = 'none';
    		WaitPage.style.display = 'block';
    		doc = window.document;
    		SubmitFormSP(doc);
            
            return true;
        }
        else
        {
            return false;
        }
    }
	function emailSignupValidate(){
    		if (document.EmailForm.email.value == ""){
    			alert ("Your email address is a required field.");
    			document.EmailForm.email.focus();
                return false;
    		}else if (!ValidEmail(document.EmailForm.email)){
    			alert ("Please enter a Valid Email Address.\r(e.g., yourname@provider.com)")
    			document.EmailForm.email.select();		
                return false;
            }else if (document.EmailForm.zip.value == ""){
    			alert ("Your zip code is a required field.")
    			document.EmailForm.zip.select();	
                return false;
            }else if (parseFloat(document.EmailForm.zip.value)<=0 || isNaN(document.EmailForm.zip.value)  || (document.EmailForm.zip.value.indexOf('.') !== -1) || (trim(document.EmailForm.zip.value).length >= 1 && trim(document.EmailForm.zip.value).length < 5)){
    			alert ("Please enter your 5 digit zip code.")
    			document.EmailForm.zip.select();	
                return false;
    		}else{
    			document.EmailForm.submit();
    		}		 
    	} 
    	
    	 function goDestinationList(){		
		var gateway = escape(document.SearchForm.gateway.options[document.SearchForm.gateway.selectedIndex].value);
		var gatewaycode = "";		
		if (gateway.length > 3) gatewaycode = gateway.substring(0,3).toUpperCase();
		var queryString = "&gatewaycodeadd=" + gatewaycode;
		location.href = "/s/v/destinationlist.asp?p=p" + queryString;
	}
	
	function showDiv(as_name) {
		var el = document.getElementById(as_name);
		if(el) {
			el.style.display = "block";
		    el.style.visibility = "visible";
		}
	}
    
    function hideDiv(as_name) {
        var el = document.getElementById(as_name);

        if(el) {
            el.style.display = "none";
            el.style.visibility = "hidden";
        }
    }
 