<!--
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.01
  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 && d.getElementById) x=d.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 MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function myZoom(myurl){
var screenwidth = window.screen.availWidth-30;
var screenheight = window.screen.availHeight-30;
var myparams = "left=" + (window.screen.width - 660)/2;
myparams += ",top=" + (window.screen.height - 598)/2;
myparams += ",width=10,height=10";
myparams += ",toolbar=no,menubar=no,location=no";
myparams += ",status=no,scrollbars=no,resizable=yes"
var mywindow=open(myurl,"", myparams);

var resizesteps = 50;
var myx = 10
var myy = 10;
var widthspeed = (screenwidth-100)/resizesteps;
var heightspeed = (screenheight-100)/resizesteps;
for (size=0; size<resizesteps; size++){
mywindow.resizeTo(myx, myy);
myx += widthspeed;
myy += heightspeed;}
mywindow.resizeTo(660, 598);


}


function framePrint(whichFrame){
parent[whichFrame].focus();
parent[whichFrame].print();
return;
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_openBrWindow2(theURL,winName,features) { //v2.0
opw4=(screen.availWidth-640)/2;
oph4=(screen.availHeight-480)/2; 
  window.open(theURL,winName,features + ",left="+opw4+",top="+oph4);
}

function MM_openBrWindow3(theURL,winName,features) { //v2.0
opw4=(screen.availWidth-510)/2;
oph4=(screen.availHeight-325)/2; 
  window.open(theURL,winName,features + ",left="+opw4+",top="+oph4);
}




function validate_request(form)
	{
		if(form.name.value=="")
		{
		alert('Please Enter Your Name');
		form.name.focus();
		return false;
		 }
		
		 if(form.email.value=="")
		{
		alert('Please Enter A Valid Email Address');
		form.email.focus();
		return false;
		 }
	else
	{
		//if(form.email.value.indexOf('@')<1 || form.email.value.indexOf('.')<form.email.value.indexOf('@'))
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(form.email.value)== false)
		{
			alert('Please Enter A Valid Email Address');
			form.email.focus();
		   return false;
		}

}
return true;
}


function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


    var map = null;
    var geocoder = null;

    function load() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"));
        //map.setCenter(new GLatLng(37.4419, -122.1419), 13);
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
        geocoder = new GClientGeocoder();
      }
    }

    function showAddress(address) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert(address + " not found");
            } else {
              map.setCenter(point, 12);
              var marker = new GMarker(point);
              map.addOverlay(marker);
              marker.openInfoWindowHtml(address);
            }
          }
        );
      }
    }


function trim(s){
return s.replace(/^\s*(.*?)\s*$/,"$1")
}

function isValidEmail(str) {
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}


function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
} 
 

 
 
function validate_quickquote_form(){
	
	
if(trim(document.quick_quote.First_Name.value) == ""){
alert("Please Enter Your First Name.");
document.quick_quote.First_Name.focus();
return false;
}


if(trim(document.quick_quote.Last_Name.value) == ""){
alert("Please Enter Your Last Name.");
document.quick_quote.Last_Name.focus();
return false;
}



if(!isValidEmail(trim(document.quick_quote.email.value))){
alert("Please Enter A Valid Email Address.");
document.quick_quote.email.focus();
return false;
}


if(!IsNumeric(trim(document.quick_quote.Zip_Code.value))){
alert("Please Enter A Valid Zip Code.");
document.quick_quote.Zip_Code.focus();
return false;
}



if(trim(document.quick_quote.phone1.value) == "" || document.quick_quote.phone1.value.length < 3 || !IsNumeric(trim(document.quick_quote.phone1.value))){
alert("Please Enter A Valid Telphone Area Code.");
document.quick_quote.phone1.focus();
return false;
}


if(trim(document.quick_quote.phone2.value) == "" || document.quick_quote.phone2.value.length < 3 || !IsNumeric(trim(document.quick_quote.phone2.value))){
alert("Please Enter A Valid Telphone Number.");
document.quick_quote.phone2.focus();
return false;
}

if(trim(document.quick_quote.phone3.value) == "" || document.quick_quote.phone3.value.length < 4 || !IsNumeric(trim(document.quick_quote.phone3.value))){
alert("Please Enter A Valid Telphone Number.");
document.quick_quote.phone3.focus();
return false;
}

if(trim(document.quick_quote.Zip_Code.value) =="")
	{
		alert('Can you please enter your zip?');
		document.quick_quote.Zip_Code.focus();
		return false;
	 }


if(trim(document.quick_quote.year.value) == "" || !IsNumeric(trim(document.quick_quote.year.value))){
alert("Please Select the Year.");
document.quick_quote.year.focus();
return false;
}

if(trim(document.quick_quote.make.value) == ""){
alert("Please Select the Make.");
document.quick_quote.make.focus();
return false;
}

if(trim(document.quick_quote.model.value) == ""){
alert("Please Select the Model.");
document.quick_quote.model.focus();
return false;
}

	
		
		//MM_showHideLayers('processingimage','','show');

return true;

}
 
 function GetDirection()
 {
	var address=document.getElementById('txtaddress').value;
	var city=document.getElementById('txtcity').value;
	var state=document.getElementById('txtstate').value;
	var Zip=document.getElementById('txtzip').value;
	
	if (trim(address)=="")
	{
	alert("Please Enter the Address.");
	document.getElementById('txtaddress').focus();
	return false;
	}
	if (trim(city)=="")
	{
	alert("Please Enter the City.");
	document.getElementById('txtcity').focus();
	return false;
	}
	if (trim(state)=="")
	{
	alert("Please Enter the state.");
	document.getElementById('txtstate').focus();
	return false;
	}
	if (trim(Zip)=="")
	{
	alert("Please Enter the Zip.");
	document.getElementById('txtzip').focus();
	return false;
	}
	var url='mapdirection.asp?S='+ address + '&E=' + city +'&Es='+ state +'&Ez=' + Zip;
	window.open(url);
 }
 
  function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

 
 function calculator_validate()
 {
	 var lease_depo = document.getElementById('lease_deposit').value;
	
	 if(lease_depo == "" || lease_depo == 0)
	 {
		alert("Please Enter A Valid Security Deposit.");
		document.getElementById('lease_deposit').value = "";
		document.getElementById('lease_deposit').focus();
		return false;
	 }
	 else
	  {
		  if(isInteger(lease_depo) == false)
		    {
			  alert("Please Enter A Valid Security Deposit.");
			  document.getElementById('lease_deposit').value = "";
			  document.getElementById('lease_deposit').focus();
			  return false;
			}
		  
	  }
	 
 }
 

//-->
