chk=1;
function formSubmit(theForm)
{
	chk=0;
	var problem=false;
	var errMsg = "";
	
	if(theForm.zip.value.length <= 0)
	{
		errMsg += "Zip code is required.\n";
		var problem = true;
	}
	else
	{
		var myzip = theForm.zip.value;
		var myzip_re = /\s+/gi;
		var myzip1_re = /\D/gi;
		var myzip_result = myzip.match(myzip_re);
		var myzip1_result = myzip.match(myzip1_re);

		if (theForm.zip.value.length != 5) 
		{
			errMsg += "Zipcode is invalid.\n";
			var problem = true;
		}
		else
		{
				
			if (myzip_result != null)
			{
				errMsg += "Zipcode cannot have spaces.\n";
				var problem = true;
			}
			
			if (myzip1_result != null)
			{
				errMsg += "Zipcode contains invalid characters.\n";
				var problem = true;
			}			
		}
	}
	if(problem)
	{
		alert(errMsg);
		errMsg= "";
		return false;
	}
	else
	{
		theForm.submit();
		return true;
	}
	
	
}
	
function exit_pop(type, gender)  
{
		if(chk == 1)
		{
		  var url = "http://www.theallinsured.com/car_index.html";
		  win2 = window.open(url, "win2"); 
		}
}

function exit_pop_rrc(type, gender)  
{
		if(chk == 1)
		{
		  var url = "http://www.theallinsured.com/car_index.html";
		  win2 = window.open(url, "win2");
		}
}