function validateForm(form)
{
  var i;
  var obj;
  var disable = false;
  var sHTML;
  
  for(i=0;i<form.length;i++)
  {
    obj = form[i];
    if(obj.type == "text" && obj.value=="")
    {
      disable = true;
      break;
    }
  }
  sHTML =  "";
  if(disable)
  {
  	sHTML += "<img src='images/text_submit_no.gif' width='200' height='20'><br>";
  }
  else
  {
  	sHTML += "<img src='images/text_submit.gif' alt='Submit Your Vehicle Request' width='200' height='20' ";
	sHTML += "border='0' name='submitGraphic' ";
	sHTML += "onMouseOut='MM_swapImgRestore()' ";
	sHTML += "onMouseOver='MM_swapImage(&quot;submitGraphic&quot;,&quot;&quot;,&quot;images/text_submit_over.gif&quot;,1)'";
	sHTML += ">";
  }
  submitButton.innerHTML = sHTML;
}
function changeText(id)
{
	var sText="";
	switch(id)
	{
		case 1: 
			sText = "<strong>The amazing CycloneFuelSaver!</strong><br>This simple device can save you hundreds of dollars in fuel over the life of your car.<br>It's easy to install - just a few mintues.<br>There's no maintenance required.<br>";
			break;
		case 2:
			sText = "<strong>Check	your tire pressure at a glance!</strong><br>Just replace your tire's valve cap with the<br>TireMinder<sup>&reg;</sup> and you're done!<br>The color-coded tip tells you when your tire needs air or is dangerously low.<br>";
			break;
		case 3:
			sText = "<strong>The premiere Emergency Notification Service!</strong><br>In an emergency, this card and decal are the link to the health and safety of you and your family!<br>Safe-Guard Alert also covers your children and costs pennies per month!<br>";
			break;
		case 4:
			sText = "<strong>This is by far not just another car care kit!</strong><br>This is the most complete car care system <strong>made</strong> that cleans and protects your car inside and out.<br>Your kit arrives complete with <strong>6</strong> cleaning and polishing products plus <strong>3</strong> FREE applicators.<br>";
			break;
		case 5:
			sText = "<strong>The only TALKING back up alert system</strong><br>that warns drivers of potential obstacles while backing up their vehicle!<br>Two miniature acoustic sensors, on the rear of your	vehicle, &quot;see&quot; behind you.<br>The speaker inside your vehicle tells you the distance to the nearest object, from 8 feet to 12 inches.<br>";
			break;
		case 6:
			sText = "<strong>Special Promotion</strong> for a limited time!  Get $180 worth of gas<br>for only <strong>$59.95</strong></a> - courtesy of <strong>NASCAR Touring, Travel Club International, Exxon, 76, Chevron, Texaco, Shell, </strong>and<strong> Mobil</strong>";
			break;
	}
	// added 11/24/2003 Paul F. De La Cruz
	var divtext = new get_obj('divText'); // compatibly retrieve divText <div>
	divtext.obj.innerHTML = sText;
}
function restoreText()
{
	// added 11/24/2003 Paul F. De La Cruz
	var divtext = new get_obj('divText'); // compatibly retrieve divText <div>
	divtext.obj.innerHTML = "<strong>The amazing CycloneFuelSaver!</strong><br>This simple device can save you hundreds of dollars in fuel over the life of your car.<br>It's easy to install - just a few mintues.<br>There's no maintenance required.<br>";
	//document.all.divText.innerHTML = "<strong><font size='+1'>Special Promotion</strong> for a limited time!</font>Get $180 worth of gas<br><a href='cash4gas_order.php'>for only <strong>$59.95</strong></a> - courtesy of <strong>NASCAR Touring, Travel Club International, Exxon, 76, Chevron, Texaco, Shell, </strong>and<strong> Mobil</strong>";
}
var bookmarkurl=window.location.href;
var bookmarktitle="Auto.272.com :-: THE automotive aftermarket place on the Net!"
function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

var bookmarkurl="http://auto.272.com/?referral=4000";
var bookmarktitle="Auto.272.com :-: THE automotive aftermarket place on the Net!"
function addbookmark4000(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

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_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_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];}
}
// added get_obj/get_obj_NN4 to properly handle disappearing content under
// all browsers. 11/24/2003 Paul F. De La Cruz aka polito
function get_obj(obj_name) {
    if (document.getElementById) {
        this.obj    = document.getElementById(obj_name);
        this.style  = document.getElementById(obj_name).style;
    } else if (document.all) {
        this.obj    = document.all[obj_name];
        this.style  = document.all[obj_name].style;
    } else if (document.layers) {
        this.obj    = get_obj_NN4(document,obj_name);
        this.style  = this.obj;
    }
}
function get_obj_NN4(obj,name) {
    var x = obj.layers; var thereturn;
    for (var i = 0; i < x.length; i++) {
        if (x[i].id == name) {
            thereturn = x[i];
        } else if (x[i].layers.length) {
            var tmp = get_obj_NN4(x[i],name);
        }
        if (tmp) thereturn = tmp;
    }
    return thereturn;
}
function showCreditCardInfo(show)
{
  // added 11/24/2003 Paul F. De La Cruz
  var td_cc;
  var td_ec;
  var td_dcc;
  var td_dec;
  // added 11/24/2003 Paul F. De La Cruz , just retrieves various <div>'s
  td_cc   = new get_obj('tdCreditCard');
  td_dcc  = new get_obj('tdDiscCreditCard');
  td_ec   = new get_obj('tdCheck');
  td_dec  = new get_obj('tdDiscCheck');
  if(show)
  {
    // show credit card sections, hide check sections
    td_cc.style.display = td_dcc.style.display = 'block';
    td_ec.style.display = td_dec.style.display = 'none';
  }
  else
  {
    // show check sections, hide credit card sections
    td_cc.style.display = td_dcc.style.display = 'none';
    td_ec.style.display = td_dec.style.display = 'block';
  }
}
function validateForm(form)
{
  var i;
  var obj;
  var disable = false;
  var validation_string;
  for(i=0;i<form.length;i++)
  {
    if(form[i].id == "validate")
      validation_string = form[i].value;
  }
  for(i=0;i<form.length;i++)
  {
    obj = form[i];
    if(form[i].id)  //element has a ID
    {
      var index = validation_string.indexOf(obj.id);
      if( index != -1)  //ID needs validation
      {
          var validation_type_index = validation_string.indexOf("=", index);  //find = sign
          validation_type_index += 1;  //get validation type code
          var validation_type = validation_string.substring(validation_type_index,validation_type_index + 1);
          switch(validation_type)
          {
            case "r":  //required field
              if(obj.value=="")
              {
                disable = true;
              }
	alert("req");
              break;
            case "e":  //email
	alert("email");
              break;
        }
      }
    }
  }
  for(i=0;i<form.length;i++)
  {
    obj = form[i];
    if(obj.type == "submit")
    {
      obj.disabled = disable;
      break;
    }
  }
}
