function clearDefault(el) {
    if (el.defaultValue==el.value) el.value = ""
}

// for header's search and dealer zipcode searches
function checkInput(elementToCheck, defaultValue, errorMessage, redirectLocation)
{
         var element = document.getElementById(elementToCheck);
         if (element != null)
         {
            if (element.value == "" || element.value == defaultValue)
            {
               alert(errorMessage);
               return false;
            }
            else
            {
               window.location = redirectLocation + element.value;
            }
         } 
}

objs = document.getElementsByTagName("button");
for (i=0; i < objs.length; i++){
objs[i].value = objs[i].attributes.getNamedItem("value").value;
}

function FireKeyDownEvent(myevent, buttonToClick)
{
   if (myevent.keyCode == 13)
   {
      document.getElementById(buttonToClick).click();
      myevent.returnValue = false;
   }
}

function whtl(width, height)
{
   var left = (screen.availWidth - width) / 2;
   var top = (screen.availHeight - height) / 2;

   var result = "";

   result += "width=" + width + ",";
   result += "height=" + height + ",";
   result += "top=" + top + ",";
   result += "left=" + left + ",";

   return result;
}

function OpenBrochure(url)
{
	window.open(
		url,
		"Brochure",
		whtl(800, 600) +
			"toolbar=no,location=no" +
			",status=yes,menubar=no" +
			",scrollbars=yes,resizable=yes");
}

function OpenServiceForm(url)
{
	window.open(
		url,
		"Brochure",
		whtl(750, 530) +
			"toolbar=no,location=no" +
			",status=yes,menubar=no" +
			",scrollbars=yes,resizable=yes");
}

function OpenWindow(url)
{
	window.open(
		url);
}

