$(window).load(function()
        {
            populate();
        });

                $(document).ready(  
                    function() 
                    { 
                       $("#landingForm_zipCode").keydown(function(e)
                        {
                            if(e.keyCode == 13)
                            {
                                  subclickSGK();
                                return false;
                            }
                        }
                        );

                       
                       var path = window.location.pathname;
                       path = path.replace("/","");
                       var host_array = window.location.hostname.split(".");
                       var lookup = host_array[1].toLowerCase() + "_" + path.toLowerCase();
                       $("#landingForm_content_name").val(lookup);
                        
                        if( $("#zipCartForm_needZip").val() == "true" ) 
                        { 
                            //$("#landingZipCartForm").attr("disabled","disabled"); 
                            $("#zipCartForm_needZipView").show(); 
                            //$("#zipCartForm_zipCode").focus(); 
                            $("#zipCartForm_zipCode").val(""); 
 
                            if( $("#homePageZipCartModule").length > 0 ) $("#zipCartForm_extendedVersion").show(); 
                            if( $("#zipCartModule").length > 0 ) $("#zipCartForm_extendedVersion").hide(); 
                        } 
                        else 
                        { 
                            $("#zipCartForm_haveZipView").show(); 
                            if( $("#zipCartForm_productsCount").val() > 0 ) $("#zipCartForm_proceedToCheckout").show(); 
                            else $("#zipCartForm_proceedToCheckout").hide(); 
                        } 
                    } 
                ); 
 
                function isNumberKey(evt) 
                { 
                    var charCode = (evt.which) ? evt.which : evt.keyCode 
                    if (charCode > 31 && (charCode < 48 || charCode > 57)) 
                        return false; 
                    return true; 
                } 
 
                function checkEnabled() 
                { 
                    if ($("#landingForm_zipCode").val().length == 5) $("#zipCartForm_submitProxy").removeAttr("disabled"); 
                    else $("#zipCartForm_submitProxy").attr("disabled","disabled"); 
                } 
 
                function editZipCode() 
                { 
                    $("#zipCartForm_haveZipView").hide() 
                    $("#zipCartForm_submitProxy").attr("disabled","disabled"); 
                    $("#zipCartForm_needZipView").show(); 
                    $("#landingForm_zipCode").focus(); 
                    $("#landingForm_zipCode").val($("#landingForm_zipCode").text()); 
 
                    if( $("#homePageZipCartModule").length > 0 ) $("#zipCartForm_extendedVersion").show(); 
                    if( $("#zipCartModule").length > 0 ) $("#zipCartForm_extendedVersion").hide(); 
                } 

function validateZip()
    {
      if ($("#landingForm_zipCode").val().length < 5) 
         {
            alert("Please enter your delivery zip code");
            return false;
         } else{
            return true;
         }
    }
function subclickSGK()
    { 
       var obj = document.getElementById("landingZipCartForm:submit");
       var shoppingCartSize =  $("#productcount").val();
       if (shoppingCartSize > 0){
          var x=window.confirm("Continuing will remove everything from your cart and will give you the opportunity to add the Komen Budget Plan.  Do you want to continue?")
          if (x){
            if (validateZip()){
              obj.click();
              return true;
           } 
          } else {
            return false;
          }
         
       } else {
           if (validateZip()){
              obj.click();
           } 
       }
    }

