<!--

var agt=navigator.userAgent.toLowerCase(); 
var is_major = parseInt(navigator.appVersion); 
var is_minor = parseFloat(navigator.appVersion); 
    // Note: Opera and WebTV spoof Navigator.  We do strict client detection. 
    // If you want to allow spoofing, take out the tests for opera and webtv. 
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) 
              && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) 
                && (agt.indexOf('webtv')==-1)); 
var is_nav2 = (is_nav && (is_major == 2)); 
var is_nav3 = (is_nav && (is_major == 3)); 
var is_nav4 = (is_nav && (is_major == 4)); 
var is_nav4up = (is_nav && (is_major >= 4)); 
var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) || 
                          (agt.indexOf("; nav") != -1)) ); 
var is_nav5 = (is_nav && (is_major == 5)); 
var is_nav5up = (is_nav && (is_major >= 5)); 

var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3    = (is_ie && (is_major < 4));
var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
var is_ie4up  = (is_ie && (is_major >= 4));
var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.")!=-1) );
var is_ie5_0    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);

var is_mac    = (agt.indexOf("mac")!=-1);
var is_pc    = (agt.indexOf("mac")==-1);

var fontspecs = null;
if (is_pc)
fontspecs = "<font size=2 face=Verdana>";
if ((is_ie5up) || (is_nav5up))
fontspecs = "<font size=2 face=Verdana>";
else
fontspecs = "<font size=3 face=Verdana>";

var fontspecssm = null;
if (is_pc)
fontspecssm = "<font size=1 face=Verdana>";
if ((is_ie5up) || (is_nav5up))
fontspecssm = "<font size=1 face=Verdana>";
else
fontspecssm = "<font size=2 face=Verdana>";

var endfont = "</font>";

if ((is_ie5up) || (is_nav5up))
document.write('<LINK REL=stylesheet HREF="formstyles.css">');

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function makeArray0() {
      for (i = 0; i<makeArray0.arguments.length; i++)
           this[i] = makeArray0.arguments[i];
 }

 var days = new makeArray0("Sun","Mon","Tues","Wed",
     "Thurs","Fri","Sat");

 var months = new makeArray0('January','February','March',
     'April','May','June','July','August','September',
     'October','November','December');

 function nths(day) {
      if (day == 1 || day == 21 || day == 31) return 'st';
      if (day == 2 || day == 22) return 'nd';
      if (day == 3 || day == 23) return 'rd';
      return 'th';
 }

 function getCorrectedYear(year) {
     year = year - 0;
     if (year < 70) return (2000 + year);
     if (year < 1900) return (1900 + year);
     return year;
 }

 function y2k(number) { return (number < 1000) ? number + 1900 : number; }

 var last = document.lastModified;
 var date = new Date(last);
 var dateY2K = new Date(getCorrectedYear(date.getYear()),date.getMonth(),date.getDate());
 
function emailAlert()
{
	var error_string = "";
    // check the email field
    if (window.document.email.email.value == "")
    {
        error_string += "You must type in your email address\n";
		error_string = error_string;
        alert(error_string);
		return false;
    }
	
	// check for email accuracy
    if (window.document.email.email.value != window.document.email.email2.value)
    {
        error_string += "Please double check your email address.\n";
		error_string = error_string;
        alert(error_string);
		window.document.email.email2.value="";
		return false;
    }
	
		// check for month accuracy
    if (window.document.email.month.options[document.email.month.selectedIndex].value == "")
    {
        error_string += "You must select a month.\n";
		error_string = error_string;
        alert(error_string);
		return false;
    }

		// check for date accuracy
    if (window.document.email.day.options[document.email.day.selectedIndex].value == "")
    {
        error_string += "You must select a day.\n";
		error_string = error_string;
        alert(error_string);
		return false;
    }

		// check for year accuracy
    if (window.document.email.year.options[document.email.year.selectedIndex].value == "")
    {
        error_string += "You must select a year.\n";
		error_string = error_string;
        alert(error_string);
		return false;
    }
			
	return true;
		
		
    //if (error_string == "")
    //{
	//	window.location.href="email_alert.html";
	//   return true;
	   
    //} 
}

function addressAlert()
{
	if (window.document.address.city.value == ""  && window.document.address.zip.value == "")
	{
        alert("You must type in at least a city or zipcode to search for stations\n");
		return false;
    }
}

function validateString(field, msg, min, max)
{
	if (!min) {min = 1}
	if (!max) {max = 65535}
	
	if (!field.value || field.value.length < min || field.value.max > max) 
	{
		alert(msg);
		field.focus();
		field.select();
		return false;
	}
	
	return true;
}

function validateVIN(field, msg, min, max)
{
	if (!min) {min = 1}
	if (!max) {max = 65535}
	
	var re_VIN = /^([a-zA-Z0-9])+$/;

	if (!field.value || field.value.length < min || field.value.max > max || !re_VIN.test(field.value)) 
	{
		alert(msg);
		field.focus();
		field.select();
		return false;
	}
	
	return true;
}

//-->