function FormsInsuranceAgents(zipcode, ni_var1){
	tgUrl = 'https://forms.insuranceagents.com/auto';
	doc_loc = tgUrl + '?zip=' + zipcode + '&a=38402&c=' + ni_var1 + '&t=397';

	xmlHttp = httpGetObject();
	xmlHttp.onreadystatechange = function(){
		if(xmlHttp.readyState == 4){
			if(xmlHttp.status == 200){
				document.location = doc_loc;
				return false;
			}
		}
	}
	xmlUrl = '/savestat.php?tgUrl=' + escape(tgUrl) + '&Zip=' + zipcode + '&AffID=38402&Nivar=' + ni_var1 + '&Theme=397';
	xmlHttp.open('GET', xmlUrl, true);
	xmlHttp.send(null);
}


function AutoFrame(zipcode, currently, ni_var1){
	var hostPrefix = window.location.host == 'autoinsurancenet' ? 'http://autoinsurancenet/' : 'http://' + window.location.host + '/';
	tgUrl = hostPrefix + 'autoform/';

	doc_loc = tgUrl + '?zip=' + zipcode + '&currently='+ currently + '&a=38402&c=' + ni_var1 + '&t=397';

	xmlHttp = httpGetObject();

	xmlUrl = '/savestat.php?tgUrl=' + escape(tgUrl) + '&Zip=' + zipcode + '&AffID=38402&Nivar=' + ni_var1 + '&Theme=397';

	xmlHttp.open('GET', xmlUrl, true);

	xmlHttp.onreadystatechange = function(){
		if(xmlHttp.readyState == 4){
			if(xmlHttp.status == 200){
				document.location = doc_loc;
				return false;
			}
		}
	}
	xmlHttp.send(null);
}

function AutoFrameMOSS(zipcode, ni_var1, newWin){
	var hostPrefix = window.location.host == 'autoinsurancenet' ? 'http://autoinsurancenet/' : 'http://' + window.location.host + '/';
	tgUrl = hostPrefix + 'autoinsurance_v1/index.php';

	doc_loc = tgUrl + '?zip=' + zipcode + '&a=38402&campid=' + ni_var1 + '&t=397';

	if(newWin){ //return doc_loc;
		window.open(doc_loc, '_blank');
		return false;
	}

	var xmlHttp2 = httpGetObject();

	xmlUrl = '/savestat.php?tgUrl=' + escape(tgUrl) + '&Zip=' + zipcode + '&AffID=38402&Nivar=' + ni_var1 + '&Theme=397';
	xmlHttp2.open('GET', xmlUrl, true);

	xmlHttp2.onreadystatechange = function(){
		if(xmlHttp2.readyState == 4){
			if(xmlHttp2.status == 200){
				document.location = doc_loc;
				return false;
			}
		}
	}
	xmlHttp2.send(null);
}
