function popup_window(url,w,h) {
	var width=w;
	var height=h;
	var from_top=150;
	var from_left=400;
	var toolbar='no';
	var location='no';
	var directories='no';
	var status='no';
	var menubar='no';
	var scrollbars='yes';
	var resizable='no';
	var atts='width='+width+'show,height='+height+',top='+from_top+',screenY=';
		atts+= from_top+',left='+from_left+',screenX='+from_left+',toolbar='+toolbar;
		atts+=',location='+location+',directories='+directories+',status='+status;
		atts+=',menubar='+menubar+',scrollbars='+scrollbars+',resizable='+resizable;
	window.open(url,'win_name',atts);
}

function validateZip() {
	if (document.zipcodeform.zipcode.value.length < 5) {
		alert ("You did not enter at least a 5 digit zipcode.");
		document.zipcodeform.zipcode.focus();
		return false;
	} else return true;
}

function unloadMe() {
	if (document.app.firstname.value == "" || document.app.lastname.value == ""  || document.app.address.value == "") {
		geo = "WAIT, we have dealers in your area that will approve you!"
		return geo;
	}
}

function validateMe() {
	
		
	if (document.app.firstname.value == "") {
		alert ("You did not enter your first name.");
		document.app.firstname.focus();
		return false;
		
	} else if (document.app.lastname.value == "") {
		alert ("You did not enter your last name.");
		document.app.lastname.focus();
		return false;
	
	} else if (document.app.address.value == "") {
		alert ("You did not enter your address.");
		document.app.address.focus();
		return false;
	
	} else if (document.app.city.value == "") {
		alert ("You did not enter your city.");
		document.app.city.focus();
		return false;
		
	} else if (document.app.state.value == "") {
		alert ("You did not enter your state.");
		document.app.state.focus();
		return false;
		
	} else if (document.app.email.value == "") {
		alert ("You did not enter your email.");
		document.app.email.focus();
		return false;
		
	} else if (document.app.birth_month.value == "") {
		alert ("Please enter a month.");
		document.app.birth_month.focus();
		return false;
		
	} else if (document.app.birth_day.value == "") {
		alert ("Please enter a day.");
		document.app.birth_day.focus();
		return false;
	
	} else if (document.app.birth_year.value == "") {
		alert ("Please enter a year.");
		document.app.birth_year.focus();
		return false;
		
	} else if (document.app.hphone1.value.length < 3) {
		alert ("You did not enter your area code.");
		document.app.hphone1.focus();
		return false;
	
	} else if (document.app.hphone2.value.length < 3) {
		alert ("You did not enter part of your phone number.");
		document.app.hphone2.focus();
		return false;
		
	} else if (document.app.hphone3.value.length < 4) {
		alert ("You did not enter part of your phone number.");
		document.app.hphone3.focus();
		return false;
		
	} else if (document.app.ownrent.value == "") {
		alert ("You did not tell us if you own or rent your home.");
		document.app.ownrent.focus();
		return false;
		
	} else if (document.app.homeyr.value == "" && document.app.homemo.value == "") {
		alert ("You did not enter how long you have lived at your address.");
		document.app.homeyr.focus();
		return false;
		
	} else if (document.app.employer.value == "") {
		alert ("You did not tell us the name of your employer.");
		document.app.employer.focus();
		return false;
		
	} else if (document.app.employ_years.value == "" && document.app.employ_months.value == "") {
		alert ("You did not enter how long you have been with your current employer.");
		document.app.employ_years.focus();
		return false;
	
	} else if (document.app.ssn.value == "") {
		alert ("You did not enter your social security number.");
		document.app.ssn.focus();
		return false;
	
	
	} else return true;
		
}
