function passparams(formobj)
{
	var prodid=0;
	var prodid=formobj.prodid[formobj.prodid.selectedIndex].value;
	var zipcodevalue = formobj.zipcodetb.value;
	if (prodid == 0){alert("Please select an Insurance Type");return;}	
	if (zipcodevalue=="") {alert("Please enter a valid zip code");return;}
	var stateselected = "NJ";
	if (prodid=='200')
	{
		location='http://onlinelocalinsurance.com/results.html?zip=' + zipcodevalue + '&prodid=' + prodid;
	}

	if (prodid=='220')
	{
		location='http://onlinelocalinsurance.com/results-life-insurance.html?zipcode=' + zipcodevalue + '&search=Get+Quotes';
	}

	if (prodid=='210')
	{
		location='http://onlinelocalinsurance.com/results-auto-insurance.html?zipcode=' + zipcodevalue + '&search=Get+Quotes';
	}

	if (prodid=='250')
	{
		location='http://onlinelocalinsurance.com/results-home-insurance.html?zipcode=' + zipcodevalue + '&search=Get+Quotes';
	}


/*
        <option value="200" selected="selected">Health Insurance</option>
        <option value="220">Life Insurance</option>
        <option value="210">Auto Insurance</option>
        <option value="250">Home Insurance</option>
*/

}

function numbersonly(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==27) )
   return true;

if  (key==13) {  
	passparams(document.insuranceform1) ;
//submit the form;
}


// numbers
else if ((("0123456789").indexOf(keychar) > -1))
   return true;

// decimal point jump
else if (dec && (keychar == "."))
   {
   myfield.form.elements[dec].focus();
   return false;
   }
else
   return false;
}

function checkEnter(e){ //e is event object passed from function invocation
var characterCode //literal character code will be stored in this variable

if(e && e.which){ //if which property of event object is supported (NN4)
e = e
characterCode = e.which //character code is contained in NN4's which property
}
else{
e = event
characterCode = e.keyCode //character code is contained in IE's keyCode property
}

if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
document.document.insuranceform1.submit() //submit the form
return false
}
else{
return true
}

}

function setfocus()
{
	document.insuranceform1.zipcodetb.focus();
}




