



function OpenDetail(id)
{

day = new Date();
dayId = day.getTime();


	window.open("/detail.asp?id="+id,dayId,"toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=522,height=700,left=5,top=5");
}

function ItemRedirect(item) {
  var val =item.options[item.selectedIndex].value;
  if (val!="") {
    window.location = "/Products.asp?id="+val;
  }
}



function SearchRedir()
{
    return ValidateSerialSearch();
//    searchTerm  = document.getElementById("searchbox").value;
}    

function ItemModelRedirect(item) {
  var val =item.options[item.selectedIndex].value;
  if (val!="") {
    window.location = "/Products.asp?ModelId="+val;
  }
}

function ValidateSerialSearch()
{
    searchTerm  = document.getElementById("searchbox").value;

	if (searchTerm == '' || searchTerm.substring(0,5) == 'Enter')
	{
		alert('Please enter a serial number');
		return false;
	}
	else
		return true;	
}

function setfocus()
{

  itemObj = document.getElementById('searchbox')
  if (itemObj)
  {
	itemObj.focus();
  }
}


function ValidateForm (theForm)
{
  if (theForm.username.value == '')
  {
    alert('Please enter your name');
    theForm.username.focus();
    return false;
  }
  if (theForm.useremail.value == '')
  {
    alert('Please enter your email');
    theForm.useremail.focus();
    return false;
  }
}

function checkSNLetterInput(theForm)
{
  if (theForm.sn.value == '')
  {
    alert('Please enter your 8-digit Caterpillar serial number');
    theForm.sn.focus();
    return false;
  }


}


