Code:
<html>
<head>
<style type="text/css">
.demo {
color:#000033;
layer-background-color:#cccccc;
position:absolute;
top:90px;
left:40px;
width:350;
height:150;
z-index:80;
visibility:visible;
background-color: #FFCC99;
font-size: 13px; line-height: 17px; text-decoration: none; color: #003399;
font-family: Arial, Helvetica, sans-serif; font-weight: bold; padding-left:20; padding-top:20
}
.demo2 {color:#000033; background-color:#eeeeee; layer-background-color:#cccccc;
position:absolute; top:210; left:1px; width:832px; height:280px;
z-index:81; visibility:hidden;}
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function checkZip()
{
var north = new String("92617,90620,90621,90623,90630,90631,90638,90680,90 720,90740,90742,90743,92602,92603,92604,92606,9261 0,92612,92614,92618,92620,92624,92625,92626,92629, 92630,92637,92646,92647,92648,92649,92651,92653,92 655,92656,92657,92660,92661,92662,92663,92672,9267 3,92675,92676,92677,92679,92683,92688,92691,92692, 92694,92701,92703,92704,92705,92706,92707,92708,92 627,92780,92782,92801,92802,92804,92805,92806,9280 7,92808,92821,92821,92823,92831,92832,92833,92835, 92840,92841,92842,92843,92844,92845,92861,92865,92 866,92867,92868,92869,92870,92886,92887");
var south = new String("90603,90604,90703,90803,91709,91765,92879,92880,92 881,92882,92883,90815,91709,91710,92505");
var central = new String("90701,90705,90712,90713,90716,90755,90802,90804,90 805,90806,90807,90808,90813,90814,90815,90840,9171 0,91761,91766,91789,92503,92505,92860");
var coastal = new String("80701,80705");
var zipcode = document.zipform.zip.value;
var resultshere = document.getElementById("resultshere");
if(zipcode == "")
{
alert("You must enter a zip code.");
return false;
}
if(north.search(zipcode) != -1)
{
//alert("You searched for " + "" + zipcode +", "+"HEY NORTH RESULTS!");
//document.write ("You searched for " + "" + zipcode +", "+"HEY NORTH RESULTS!");
document.getElementById("resultshere").innerHTML = "You searched for " + "" + zipcode +", "+"HEY NORTH RESULTS!";
return true;
}
if(south.search(zipcode) != -1)
{
//alert("You searched for " + "" + zipcode +", "+"HEY SOUTH RESULTS!");
//document.write ("You searched for " + "" + zipcode +", "+"HEY SOUTH RESULTS!");
document.getElementById("resultshere").innerHTML = "You searched for " + "" + zipcode +", "+"HEY SOUTH RESULTS!";[/COLOR]
return true;
}
if(central.search(zipcode) != -1)
{
//alert("You searched for " + "" + zipcode +", "+"HEY CENTRAL RESULTS!");
//document.write ("You searched for " + "" + zipcode +", "+"HEY CENTRAL RESULTS!");
document.getElementById("resultshere").innerHTML = "You searched for " + "" + zipcode +", "+"HEY CENTRAL RESULTS!";
return true;
}
if(coastal.search(zipcode) != -1)
{
//alert("You searched for " + "" + zipcode +", "+"HEY COASTAL RESULTS!");
//document.write ("You searched for " + "" + zipcode +", "+"HEY COASTAL RESULTS!");
document.getElementById("resultshere").innerHTML = "You searched for " + "" + zipcode +", "+"HEY COASTAL RESULTS!";
return true;
}
var Output = "No phone numbers are located for the zip code ";
Output += zipcode;
document.getElementById("resultshere").innerHTML = Output;
}
//-->
<!--this function below is to test that the idea is workable some what-->
function GetLucky()
{
var TheDate = new Date();
var LuckyNumber = Math.floor((99999 - 11111 + 1) * Math.random() + 11111);
var Output2 = "Your lucky number for ";
Output2 += TheDate.toLocaleDateString();
Output2 += " is <b>" + LuckyNumber + "</b>.";
document.getElementById("resultshere").innerHTML = Output2;
}
</script>
</head>
<body>
<input type="button" value="Lucky Number" onclick="GetLucky()"/>
<form method="get" name="zipform" >
<input name="zip" type="text" size="10" maxlength="5">
<input type="button" name="Submit" value="Submit" onclick="checkZip()">
</form>
<div id="resultshere" class="demo">Here go the results</div>
</body>
</html>
Bookmarks