
function ImgOver(elem, bfilename)
{elem.background = "images/"+bfilename;
elem.children.tags('A')[0].style.color = "#000000";}

function ImgOut(elem, bfilename)
{elem.background = "images/"+bfilename;
elem.children.tags('A')[0].style.color = "#FFFFFF";}

function ImgDown(elem, bfilename)
{elem.background = "images/"+bfilename;
elem.children.tags('A')[0].style.color = "#000000";}

function ImgUp(path)
{location.href = path;}

cellswitch = new Image();
cellswitch.src = "images/navcellon.gif"

function confirmdelete(item)
{
	message = "Delete Record for " + item + "?";
	return confirm(message);
}

function ValidateContact(theForm)
{

  if (theForm.name.value == "")
  {
    alert("Please enter your name.");
    theForm.name.focus();
    return (false);
  }

  if (theForm.email.value == "")
  {
    alert("Please enter your email address.");
    theForm.email.focus();
    return (false);
  }

  if (theForm.subject.value == "")
  {
    alert("Please enter a subject.");
    theForm.subject.focus();
    return (false);
  }

  if (theForm.comments.value == "")
  {
    alert("Please enter your comments or questions.");
    theForm.comments.focus();
    return (false);
  }
  return (true);
}

function ValidateCatalog(theForm)
{

  if (theForm.firstname.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.firstname.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ- \t\r\n\f";
  var checkStr = theForm.firstname.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, whitespace and \"-\" characters in the \"First Name\" field.");
    theForm.firstname.focus();
    return (false);
  }

  if (theForm.lastname.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.lastname.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ- \t\r\n\f";
  var checkStr = theForm.lastname.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, whitespace and \"-\" characters in the \"Last Name\" field.");
    theForm.lastname.focus();
    return (false);
  }

  if (theForm.address1.value == "")
  {
    alert("Please enter a value for the \"Address\" field.");
    theForm.address1.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-.,' \t\r\n\f";
  var checkStr = theForm.address1.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit, whitespace and \".,'\" characters in the \"Address\" field.");
    theForm.address1.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-.,' \t\r\n\f";
  var checkStr = theForm.address2.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit, whitespace and \".,'\" characters in the \"address2\" field.");
    theForm.address2.focus();
    return (false);
  }

  if (theForm.city.value == "")
  {
    alert("Please enter a value for the \"city\" field.");
    theForm.city.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ. \t\r\n\f";
  var checkStr = theForm.city.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, whitespace and \".\" characters in the \"city\" field.");
    theForm.city.focus();
    return (false);
  }

  if (theForm.state.value == "")
  {
    alert("Please enter a value for the \"State\" field.");
    theForm.state.focus();
    return (false);
  }

  if (theForm.zipcode.value == "")
  {
    alert("Please enter a value for the \"Zip\" field.");
    theForm.zipcode.focus();
    return (false);
  }

  if (theForm.zipcode.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Zip\" field.");
    theForm.zipcode.focus();
    return (false);
  }

  var checkOK = "0123456789-- \t\r\n\f";
  var checkStr = theForm.zipcode.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only digit, whitespace and \"-\" characters in the \"Zip\" field.");
    theForm.zipcode.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ. \t\r\n\f";
  var checkStr = theForm.country.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, whitespace and \".\" characters in the \"country\" field.");
    theForm.country.focus();
    return (false);
  }

  if (theForm.phone.value == "")
  {
    alert("Please enter a value for the \"Phone\" field.");
    theForm.phone.focus();
    return (false);
  }

  var checkOK = "0123456789-().";
  var checkStr = theForm.phone.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"phone\" field.");
    theForm.phone.focus();
    return (false);
  }

  var checkOK = "0123456789-().";
  var checkStr = theForm.fax.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Fax\" field.");
    theForm.fax.focus();
    return (false);
  }
}
