// global find a doctor

$(function(){
    $("#floatBoxBg").animate({"opacity":0},1);
    $(".zip_go > input").mouseover(function(){
        if($(this).val() == "Zip Code" )
        {
            $(this).val("");
            $(this).focus();
        }
    }).focus(function(){
         $(this).attr("maxLength",5);
    }).blur(function(){
        if($(this).val() == "Zip Code" || $(this).val() == "")
        {
             $(this).attr("maxLength",8);
             $(this).val("Zip Code");
        }
    });
     $(".zip_go > img").click(function(){
        var zipcode = "";
        if($(".zip_go > input").val() != "" )
        {
            var reg = new RegExp("^[0-9]{5}");
            if(reg.test($(".zip_go > input").val()))
            {
                $(".zip_go > input").removeClass("input_err");
                zipcode = $(".zip_go > input").val();
            }
            else
            {
                $(".zip_go > input").addClass("input_err");
            }
        }
        else
        {
             $(".zip_go > input").addClass("input_err");
        }
        if(zipcode != "")
        {
             location.href="FindaDoctor.aspx?state=15&zip="+zipcode;
        }
        else
        {
             location.href="FindaDoctor.aspx?state=15";
        }
     });
});
