
$(document).ready(function(e){
init();
});

function init(){
$("#zip").val("");
$("#zip").bind("keypress",function(e){return justDigit(e);});
//$("#zip").bind("focus",function(e){zipFocus();});
//$("#zip").bind("blur",function(e){zipLostFocus();});
$("#gof").bind("click",function(e){cForm(e);});
}

function zipFocus(){
if($("#zip").val()=="TYPE YOUR ZIP CODE") $("#zip").val("");
}

function zipLostFocus(){
if($("#zip").val().length==0)  $("#zip").val("TYPE YOUR ZIP CODE");
}

function cForm(e){
if($("#zip").val().length!=5) {$("#zip").css("border","1px solid red");return;}
//if($("#quotetype").val().length==0) return;
//if($("#quotetype").val()=="lf") $("#insurancef").attr("action","http://www.smartquote.com/smarthome/insurance/lifeins/info.jsp");
$("#getQuote").submit();
}

function justDigit(evt){

var eve = evt ? evt : window.event;
var charCode = 0;

if(eve) charCode = eve.charCode ? eve.charCode : (eve.keyCode? eve.keyCode : (eve.which ? eve.which : 0)); 
if(charCode == 44) return true;//allow ,
if(charCode == 46) return true;//allow .
if(charCode > 31 && (charCode < 48 || charCode>57)) return false;

else return true;

}
