/* Start Rollover Effect */

var iPath = '../images/navigation/';
var iExt = 'gif';
var loaded = false;
var suffix = new Array('off','over');

function preLoad()
	{
	if(document.images)
		{
		var argLen = arguments.length;
		for(var i = 0; i < argLen; i++)
			{
			var arg = arguments[i];
			var sufLen = suffix.length;
			for(j = 0; j < sufLen; j++)
				{
				var suf = suffix[j];
				iNew = arg + '_' + suf + ' = new Image();';  eval(iNew);
				iSrc = arg + '_' + suf + '.src = \'' + iPath + arg + '_' + suf + '.' + iExt + '\';';  eval(iSrc);
				}
			}   
			loaded = true;
		}
	}

function rollOver(iName,iState)
	{
	if(document.images && loaded)
		{
		document.images[iName].src = eval('icon_' + iState + '.src');
		}
	}

function rollOverMenu(iName,iState)
	{
	if(document.images && loaded)
		{
		document.images[iName].src = eval( iName + '_' + iState + '.src');
		}
	}

window.onLoad = preLoad('home','about','account','contact','cart','checkout');

/* End Rollover Effect */




 

function FormValidate(theForm)
{

 
  
  if (theForm.ContactName.value == "")
  {
    alert("Please enter a value for the Contact Name field.");
    theForm.ContactName.focus();
    return (false);
  }

  if (theForm.ContactName.value.length < 3)
  {
    alert("Please enter at least 3 characters in the Contact Name field.");
    theForm.ContactName.focus();
    return (false);
  }

  

if (theForm.ContactPhoneNumber1.value == "")
  {
    alert("Please enter a value for the Area Code field.");
    theForm.ContactPhoneNumber1.focus();
    return (false);
  }
  
  
  if (theForm.ContactPhoneNumber1.value.length < 3)
  {
    alert("Please enter at least 3 characters in the Area Code field.");
    theForm.ContactPhoneNumber1.focus();
    return (false);
  }

  var checkOK = "0123456789-.";
  var checkStr = theForm.ContactPhoneNumber1.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  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 (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only numbers in the Area Code field.");
    theForm.ContactPhoneNumber1.focus();
    return (false);
  }

  if (decPoints > 1 || !validGroups)
  {
    alert("Please enter a valid number in the Area Code field.");
    theForm.ContactPhoneNumber1.focus();
    return (false);
  }
  
     if (theForm.ContactPhoneNumber2.value == "")
  {
    alert("Please enter a value for the 2nd Phone field.");
    theForm.ContactPhoneNumber2.focus();
    return (false);
  }
  
   if (theForm.ContactPhoneNumber2.value.length < 3)
  {
    alert("Please enter at least 3 characters in the 2nd Home Phone field.");
    theForm.ContactPhoneNumber2.focus();
    return (false);
  }
  
  
  if (theForm.ContactPhoneNumber2.value.length > 3)
  {
    alert("Please enter at most 3 characters in the 2nd Home Phone field.");
    theForm.ContactPhoneNumber2.focus();
    return (false);
  }

  var checkOK = "0123456789-.";
  var checkStr = theForm.ContactPhoneNumber2.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  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 (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only numbers in the 2nd Phone field.");
    theForm.ContactPhoneNumber2.focus();
    return (false);
  }

  if (decPoints > 1 || !validGroups)
  {
    alert("Please enter a valid number in the 2nd Phone field.");
    theForm.ContactPhoneNumber2.focus();
    return (false);
  }

 
      if (theForm.ContactPhoneNumber3.value == "")
  {
    alert("Please enter a value for the 3rd Phone field.");
    theForm.ContactPhoneNumber3.focus();
    return (false);
  }
  
   if (theForm.ContactPhoneNumber3.value.length < 4)
  {
    alert("Please enter at least 3 characters in the 3rd Home Phone field.");
    theForm.ContactPhoneNumber3.focus();
    return (false);
  }
  
  
  if (theForm.ContactPhoneNumber3.value.length > 4)
  {
    alert("Please enter at most 3 characters in the 3rd Home Phone field.");
    theForm.ContactPhoneNumber3.focus();
    return (false);
  }

  var checkOK = "0123456789-.";
  var checkStr = theForm.ContactPhoneNumber3.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  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 (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only numbers in the 3rd Phone field.");
    theForm.ContactPhoneNumber3.focus();
    return (false);
  }

  if (decPoints > 1 || !validGroups)
  {
    alert("Please enter a valid number in the 3rd Phone field.");
    theForm.ContactPhoneNumber3.focus();
    return (false);
  }
 
  if (theForm.ContactEmail.value == "")
  {
    alert("Please enter a value for the Contact Email field.");
    theForm.ContactEmail.focus();
    return (false);
  }

  if (theForm.ContactEmail.value.length < 3)
  {
    alert("Please enter at least 3 characters in the Contact Email field.");
    theForm.ContactEmail.focus();
    return (false);
  }
	
}


