function validateIns(f){
	if(f.zipcode.value == ''){
		alert('Please enter your zipcode.');
		f.zipcode.focus();
		return false;
	} else if(!validZIP(f.zipcode.value)){
		alert('Please enter valid 5-digits zipcode.');
		f.zipcode.focus();
		return false;
	}

	var ni_var1 = f.ni_var1.value;

	len = f.srcid.length * 1;

	srcid = '';
	if(!isNaN(len)){
		for(i = 0; i < len; i++){
			if(f.srcid[i].checked){
				srcid = f.srcid[i].value;
			}
		}
	} else {
		srcid = f.srcid.value;
	}

	if(srcid == 'auto')
	{
		xmlHttp.onreadystatechange = function(){
			if(xmlHttp.readyState == 4){
				if(xmlHttp.status == 200){
					if(xmlHttp.responseText == 'FormsInsuranceAgents'){
						FormsInsuranceAgents(f.zipcode.value, ni_var1);
					} else if(xmlHttp.responseText == 'AutoFrame'){
						AutoFrame(f.zipcode.value, ni_var1 + '_x');
					}
					return false;
				}
			}
		}
		xmlUrl = '/toggle.php?toggle=auto';
		xmlHttp.open('GET', xmlUrl, true);
		xmlHttp.send(null);
	}
	else if(srcid == 'life')
	{
		tgUrl = 'https://forms.insuranceagents.com/life';
		_url = tgUrl + '?zip=' + f.zipcode.value + '&a=38402&c=' + ni_var1 + '&t=397';
		AffID = 38402;
		Theme = 397;

		xmlHttp.onreadystatechange = function(){
			if(xmlHttp.readyState == 4){
				if(xmlHttp.status == 200){
					document.location = _url;
				}
			}
		}
		xmlUrl = '/savestat.php?tgUrl=' + escape(tgUrl) + '&Zip=' + f.zipcode.value + '&AffID=' + AffID + '&Nivar=' + ni_var1 + '&Theme=' + Theme;
		xmlHttp.open('GET', xmlUrl, true);
		xmlHttp.send(null);
	}
	else if(srcid == 'home')
	{
		tgUrl = 'https://forms.insuranceagents.com/home';
		_url = tgUrl + '?zip=' + f.zipcode.value + '&a=38402&c=' + ni_var1 + '&t=397';
		AffID = 38402;
		Theme = 397;

		xmlHttp.onreadystatechange = function(){
			if(xmlHttp.readyState == 4){
				if(xmlHttp.status == 200){
					document.location = _url;
				}
			}
		}
		xmlUrl = '/savestat.php?tgUrl=' + escape(tgUrl) + '&Zip=' + f.zipcode.value + '&AffID=' + AffID + '&Nivar=' + ni_var1 + '&Theme=' + Theme;
		xmlHttp.open('GET', xmlUrl, true);
		xmlHttp.send(null);
	}
	else if(srcid == 'health')
	{
		tgUrl = 'http://www.ehealthinsurance.com/ehi/Alliance?allid=AOV28265&type=IFP';
		_url  = tgUrl + '&zip=' + f.zipcode.value + '&sid=' + ni_var1;
		AffID = '';
		Theme = '';

		xmlHttp.onreadystatechange = function(){
			if(xmlHttp.readyState == 4){
				if(xmlHttp.status == 200){
					document.location = _url;
				}
			}
		}
		xmlUrl = '/savestat.php?tgUrl=' + escape(tgUrl) + '&Zip=' + f.zipcode.value + '&AffID=' + AffID + '&Nivar=' + ni_var1 + '&Theme=' + Theme;
		xmlHttp.open('GET', xmlUrl, true);
		xmlHttp.send(null);
	}

	return false;
}
