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;
	}

	ni_var1 = f.ni_var1.value;

	len = parseInt(f.srcid.length);

	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){
					//alert('response: ' + xmlHttp.responseText);
					if(xmlHttp.responseText == 'InsuranceLeadzAuto'){
						InsuranceLeadzAuto(f.zipcode.value, ni_var1);
					} else if(xmlHttp.responseText == 'AutoFrame'){
						AutoFrame(f.zipcode.value, ni_var1 + '_x');
					} else if(xmlHttp.responseText == 'AutoFrameMOSS'){
						AutoFrameMOSS(f.zipcode.value, ni_var1 + '_x');
					}
					else if(xmlHttp.responseText == 'BW'){
						if(window.location.host == 'nyci'){
							document.location = 'http://nyci/autoinsurancequotes.php?zipcode=' + f.zipcode.value + '&ni_var1=' + ni_var1;
						} else {
							document.location = 'http://www.newyorkcarinsurance.com/autoinsurancequotes.php?zipcode=' + f.zipcode.value + '&ni_var1=' + ni_var1;
						}
					}
					return false;
				}
			}
		}
		xmlUrl = '/toggle.php?toggle=auto';
		xmlHttp.open('GET', xmlUrl, true);
		xmlHttp.send(null);*/
		
		if(window.location.host == 'nyci'){
			document.location = 'http://nyci/autoinsurancequotes.php?zipcode=' + f.zipcode.value + '&ni_var1=' + ni_var1;
		} else {
			document.location = 'http://69.93.179.26/autoinsurancequotes.php?zipcode=' + f.zipcode.value + '&ni_var1=' + ni_var1;
		}
	}
	else if(srcid == 'life')
	{
		/*xmlHttp.onreadystatechange = function(){
			if(xmlHttp.readyState == 4){
				if(xmlHttp.status == 200){
					alert('response: ' + xmlHttp.responseText);
					if(xmlHttp.responseText == 'InsuranceLeadzLife'){
						InsuranceLeadzLife(f.zipcode.value, ni_var1);
					} else if(xmlHttp.responseText == 'LifeFrame'){
						LifeFrame(f.zipcode.value, ni_var1 + '_x');
					} else if(xmlHttp.responseText == 'LifeFrameSQ'){
						ni_var1 = 'anone-F-nyci-main';
						if(document.getElementById('KWT')){
							if(document.getElementById('KWT').value){
								ni_var1 = document.getElementById('KWT').value;
							}
						}
						LifeFrameSQ(f.zipcode.value, ni_var1);
					}
					return false;
				}
			}
		}
		xmlUrl = '/toggle.php?toggle=life';
		xmlHttp.open('GET', xmlUrl, true);
		xmlHttp.send(null);*/
		
		if(window.location.host == 'nyci'){
			tgUrl = 'http://nyci/Instant-Life-Insurance-Quotes/';
		}
		else {
			tgUrl = 'http://69.93.179.26/Instant-Life-Insurance-Quotes/';
		}
		_url = tgUrl + '?zip=' + f.zipcode.value + '&a=38402&c=' + ni_var1 + '&t=401';
		
		document.location = _url;
		return false;
		
	}
	else if(srcid == 'home')
	{
		/*xmlHttp.onreadystatechange = function(){
			if(xmlHttp.readyState == 4){
				if(xmlHttp.status == 200){
					if(xmlHttp.responseText == 'InsuranceLeadzHome'){
						InsuranceLeadzHome(f.zipcode.value, ni_var1);
					} else if(xmlHttp.responseText == 'HomeFrame'){
						HomeFrame(f.zipcode.value, ni_var1 + '_x');
					} else if(xmlHttp.responseText == 'HomeFrameSQ'){
						ni_var1 = 'anone-F-nyci-main';
						if(document.getElementById('KWT')){
							if(document.getElementById('KWT').value){
								ni_var1 = document.getElementById('KWT').value;
							}
						}
						HomeFrameSQ(f.zipcode.value, ni_var1);
					}
					return false;
				}
			}
		}
		xmlUrl = '/toggle.php?toggle=home';
		xmlHttp.open('GET', xmlUrl, true);
		xmlHttp.send(null);*/
		
		
		if(window.location.host == 'nyci'){
			tgUrl = 'http://nyci/Instant-Home-Insurance-Quotes/';
		}
		else {
			tgUrl = 'http://69.93.179.26/Instant-Home-Insurance-Quotes/';
		}
		_url = tgUrl + '?zip=' + f.zipcode.value + '&a=38402&c=' + ni_var1 + '&t=401';
		
		document.location = _url;
		return false;
	}
	else if(srcid == 'health')
	{
		/*xmlHttp.onreadystatechange = function(){
			if(xmlHttp.readyState == 4){
				if(xmlHttp.status == 200){
					if(xmlHttp.responseText == 'InsuranceLeadzHealth'){
						InsuranceLeadzHealth(f.zipcode.value, ni_var1);
					} else if(xmlHttp.responseText == 'HealthFrame'){
						HealthFrame(f.zipcode.value, ni_var1 + '_x');
					} else if(xmlHttp.responseText == 'HealthFrameSQ'){
						ni_var1 = 'anone-F-nyci-main';
						if(document.getElementById('KWT')){
							if(document.getElementById('KWT').value){
								ni_var1 = document.getElementById('KWT').value;
							}
						}
						HealthFrameSQ(f.zipcode.value, ni_var1);
					}
					return false;
				}
			}
		}
		xmlUrl = '/toggle.php?toggle=health';
		xmlHttp.open('GET', xmlUrl, true);
		xmlHttp.send(null);*/
		
		
		if(window.location.host == 'nyci'){
			tgUrl = 'http://nyci/Instant-Health-Insurance-Quotes/';
		}
		else {
			tgUrl = 'http://69.93.179.26/Instant-Health-Insurance-Quotes/';
		}
		_url = tgUrl + '?zip=' + f.zipcode.value + '&a=38402&c=' + ni_var1 + '&t=401';
		
		document.location = _url;
		return false;
		
	}

	return false;
}
