var zips = new Array (49829, 49801,53014, 53020, 53042, 53049,53061,53062,53088,54110,54123,54129,54160,54169,54915,54952,54110,54115,54126,54130,54155,54162,54173,54180,54208,54217,54229,54301,54302,54303,54304,543,54306,54307,54308,54311,54313,54324,54344,53014,53015,53020,53042,53063,54110,54126,54207,54208,54214,54215,54220,54221,54227,54228,54230,54232,54240,54241,54245,54247,54106,54107,54113,54115,54130,54131,54136,54140,54152,54155,54165,54170,54180,54911,54912,54913,54914,54915,54919,54922,54931,54940,54942,54944,54961,54107,54111,54124,54127,54128,54137,54154,54162,54165,54166,54170,54182,54408,54414,54416,54427,54450,54486,54499,54928,54929,54948,54950,54978,54486,54922,54926,54929,54933,54940,54945,54946,54949,54950,54961,54962,54965,54969,54977,54981,54983,54990,54901,54902,54903,54904,54906,54914,54915,54923,54927,54934,54940,54947,54952,54956,54957,54963,54964,54971,54979,54980,54985,54986,53006,53010,53011,53019,53040,53048,53049,53057,53061,53065,53079,53919,53931,53946,53963,54932,54935,54936,54937,54964,54971,54974,54979,53923,53926,53939,53946,53947,53956,54923,54941,54960,54968,54971,54909,54923,54930,54940,54943,54960,54965,54966,54967,54970,54976,54981,54982,54984,54406,54407,54423,54443,54454,54455,54458,54467,54473,54475,54481,54482,54492,54494,54909,54921,54945,54966,54977,54981,54101,54111,54112,54114,54124,54137,54138,54139,54141,54149,54153,54154,54161,54162,54171,54174,54175,54491,54201,54202,54204,54205,54209,54210,54211,54212,54213,54217,54226,54234,54235,54246);

var zipCities = new Array("Oshkosh");
var numZips = zips.length;
var selectedCity = "";

function checkZip(zip,mesCode) {
	for (i=0; i<numZips; i++) {
		if (zip == zips[i]) {
			if (mesCode == 1) {
				alert("YES, ("+zip+") you are within our No Down Payment area!  Please complete the online application for your 33 Minute Guarantee To Your Next Ride or call us toll-free at 866-579-6121 for an appointment.");
			}
			selectedCity = zipCities[i];
			return false;
		}
	}
	alert("We’re sorry, but ("+zip+") is not within our No Down Payment area. Please complete the online application for special consideration.")
	zip = "";
	return false;
}

function submitIt() {
	          
var zipCode = document.getElementById("zipCode").value;

	if (zipCode == "") {
		alert("You must either enter a Zip code.")
		return false
	}
	
	if (!validZip(zipCode)) {
		alert("That is an invalid Zip code")
		return false
	}
			
	checkZip(zipCode,1);
}

function isNum(passedVal) {					// Is this a number?
	if (passedVal == "") {
		return false
	}
	for (i=0; i<passedVal.length; i++) {
		if (passedVal.charAt(i) < "0") {
			return false
		}
		if (passedVal.charAt(i) > "9") {
			return false
		}
	}
	return true
}

function validZip(inZip) {					// Is this a valid Zip code?
	if (inZip == "") {
		return true
	}
	if (isNum(inZip)) {						// Check if Zip is numeric
		return true
	}
	return false
}
