 function matchOriginWithContact()
{
  if (document.Quoteform.chkOriginasContact.checked)
   {
	document.Quoteform.originStreet.value=document.Quoteform.contactStreet.value;
	document.Quoteform.originCity.value=document.Quoteform.contactCity.value;
	document.Quoteform.originCountry.value=document.Quoteform.contactCountry.value;
	document.Quoteform.originZip.value=document.Quoteform.contactZip.value;
	document.Quoteform.originProv.selectedIndex=document.Quoteform.contactProv.selectedIndex;
   }
}



function validateCreateQuote(theForm)
{

  if (theForm.contactName.value == "")
  {
    alert("Please enter a value for the \"Full Name\" field.");
    theForm.contactName.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f";
  var checkStr = theForm.contactName.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 and whitespace characters in the \"Full Name\" field.");
    theForm.contactName.focus();
    return (false);
  }

  if (theForm.contactEmail.value == "")
  {
    alert("Please enter a value for the \"contactEmail\" field.");
    theForm.contactEmail.focus();
    return (false);
  }else {
		var str  = theForm.contactEmail.value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }  
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.contactHomeAreaCode.value;
  var allValid = 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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Home Phone Number\" field.");
    theForm.contactHomeAreaCode.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.contactHomePrefix.value;
  var allValid = 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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Home Phone Number\" field.");
    theForm.contactHomePrefix.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.contactHomeSuffix.value;
  var allValid = 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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Home Phone Number\" field.");
    theForm.contactHomeSuffix.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.contactHomeExtension.value;
  var allValid = 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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Home Phone Number\" field.");
    theForm.contactHomeExtension.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.contactBusAreaCode.value;
  var allValid = 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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Business Phone Number\" field.");
    theForm.contactBusAreaCode.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.contactBusPrefix.value;
  var allValid = 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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Business Phone Number\" field.");
    theForm.contactBusPrefix.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.contactBusSuffix.value;
  var allValid = 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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Business Phone Number\" field.");
    theForm.contactBusSuffix.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.contactBusExtension.value;
  var allValid = 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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Business Phone Number\" field.");
    theForm.contactBusExtension.focus();
    return (false);
  }

  if (theForm.contactStreet.value == "")
  {
    alert("Please enter a value for the \"Contact Address\" field.");
    theForm.contactStreet.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789- \t\r\n\f";
  var checkStr = theForm.contactStreet.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 and digit characters in the \"Contact Address\" field.");
    theForm.contactStreet.focus();
    return (false);
  }

  if (theForm.contactCity.value == "")
  {
    alert("Please enter a value for the \"Contact City\" field.");
    theForm.contactCity.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f";
  var checkStr = theForm.contactCity.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 characters in the \"Contact City\" field.");
    theForm.contactCity.focus();
    return (false);
  }

  if (theForm.contactZip.value == "")
  {
    alert("Please enter a value for the \"Contact Postal Code\" field.");
    theForm.contactZip.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789- \t\r\n\f";
  var checkStr = theForm.contactZip.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 and whitespace characters in the \"Contact Postal Code\" field.");
    theForm.contactZip.focus();
    return (false);
  }

  if (theForm.contactCountry.value == "")
  {
    alert("Please enter a value for the \"Contact Country\" field.");
    theForm.contactCountry.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f";
  var checkStr = theForm.contactCountry.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 and whitespace characters in the \"Contact Country\" field.");
    theForm.contactCountry.focus();
    return (false);
  }

  if (theForm.moveDate.value == "" || !(checkDate(theForm.moveDate)))
  {
    alert("Please enter a value for the \"moveDate\" field.");
    theForm.moveDate.focus();
    return (false);
  }

  if (theForm.originStreet.value == "")
  {
    alert("Please enter a value for the \"Origin Street\" field.");
    theForm.originStreet.focus();
    return (false);
  }

  if (theForm.originCity.value == "")
  {
    alert("Please enter a value for the \"Origin City\" field.");
    theForm.originCity.focus();
    return (false);
  }

  if (theForm.originZip.value == "")
  {
    alert("Please enter a value for the \"Origin Postal Code\" field.");
    theForm.originZip.focus();
    return (false);
  }

  if (theForm.originCountry.value == "")
  {
    alert("Please enter a value for the \"Origin Country\" field.");
    theForm.originCountry.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.originStairs.value;
  var allValid = 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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Flights of Stairs at Origin Location\" field.");
    theForm.originStairs.focus();
    return (false);
  }


  var checkOK = "0123456789-";
  var checkStr = theForm.originRooms.value;
  var allValid = 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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Total Rooms at Origin Location\" field.");
    theForm.originRooms.focus();
    return (false);
  }

  if (theForm.destStreet.value == "")
  {
    alert("Please enter a value for the \"Destination Street\" field.");
    theForm.destStreet.focus();
    return (false);
  }

  if (theForm.destCity.value == "")
  {
    alert("Please enter a value for the \"Destination City\" field.");
    theForm.destCity.focus();
    return (false);
  }

  if (theForm.destZip.value == "")
  {
    alert("Please enter a value for the \"Destination Postal Code\" field.");
    theForm.destZip.focus();
    return (false);
  }

  if (theForm.destCountry.value == "")
  {
    alert("Please enter a value for the \"Destination Country\" field.");
    theForm.destCountry.focus();
    return (false);
  }



  var checkOK = "0123456789-";
  var checkStr = theForm.destStairs.value;
  var allValid = 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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Flights of Stairs at Destination Location\" field.");
    theForm.destStairs.focus();
    return (false);
  }


  var checkOK = "0123456789-";
  var checkStr = theForm.destRooms.value;
  var allValid = 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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Total Number of Rooms at Destination\" field.");
    theForm.destRooms.focus();
    return (false);
  }
  return (true);
}


function validateLogin(theForm)
{

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-";
  var checkStr = theForm.UserID.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 and digit characters in the \"User ID\" field.");
    theForm.UserID.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-";
  var checkStr = theForm.PWD.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 and digit characters in the \"Password\" field.");
    theForm.PWD.focus();
    return (false);
  }
  return (true);
}


function validateItem(theForm)
{

  if (theForm.Description.value == "")
  {
    alert("Please enter a value for the \"Item Description\" field.");
    theForm.Description.focus();
    return (false);
  }

  if (theForm.Description.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Item Description\" field.");
    theForm.Description.focus();
    return (false);
  }

  if (theForm.Description.value.length > 100)
  {
    alert("Please enter at most 100 characters in the \"Item Description\" field.");
    theForm.Description.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789- \t\r\n\f";
  var checkStr = theForm.Description.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 and whitespace characters in the \"Item Description\" field.");
    theForm.Description.focus();
    return (false);
  }

  if (theForm.Weight.value == "")
  {
    alert("Please enter a value for the \"Item Weight\" field.");
    theForm.Weight.focus();
    return (false);
  }

  if (theForm.Weight.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Item Weight\" field.");
    theForm.Weight.focus();
    return (false);
  }

  var checkOK = "0123456789-.";
  var checkStr = theForm.Weight.value;
  var allValid = 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 digit characters in the \"Item Weight\" field.");
    theForm.Weight.focus();
    return (false);
  }

  if (decPoints > 1)
  {
    alert("Please enter a valid number in the \"Weight\" field.");
    theForm.Weight.focus();
    return (false);
  }

  if (theForm.CubicFeet.value == "")
  {
    alert("Please enter a value for the \"Item Volume\" field.");
    theForm.CubicFeet.focus();
    return (false);
  }

  if (theForm.CubicFeet.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Item Volume\" field.");
    theForm.CubicFeet.focus();
    return (false);
  }

  var checkOK = "0123456789-.";
  var checkStr = theForm.CubicFeet.value;
  var allValid = 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 digit characters in the \"Item Volume\" field.");
    theForm.CubicFeet.focus();
    return (false);
  }

  if (decPoints > 1)
  {
    alert("Please enter a valid number in the \"CubicFeet\" field.");
    theForm.CubicFeet.focus();
    return (false);
  }
  return (true);
}

function validateArea(theForm)
{

  if (theForm.areaDesc.value == "")
  {
    alert("Please enter a value for the \"areaDesc\" field.");
    theForm.areaDesc.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789- \t\r\n\f";
  var checkStr = theForm.areaDesc.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 and whitespace characters in the \"areaDesc\" field.");
    theForm.areaDesc.focus();
    return (false);
  }

  if (theForm.AreaCode.value == "")
  {
    alert("Please enter a value for the \"AreaCode\" field.");
    theForm.AreaCode.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-";
  var checkStr = theForm.AreaCode.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 and digit characters in the \"AreaCode\" field.");
    theForm.AreaCode.focus();
    return (false);
  }
  return (true);
}

function validateServices(theForm)
{

  if (theForm.ServiceDescription.value == "")
  {
    alert("Please enter a value for the \"Service Description\" field.");
    theForm.ServiceDescription.focus();
    return (false);
  }

  if (theForm.ServiceDescription.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Service Description\" field.");
    theForm.ServiceDescription.focus();
    return (false);
  }

  if (theForm.ServiceDescription.value.length > 100)
  {
    alert("Please enter at most 100 characters in the \"Service Description\" field.");
    theForm.ServiceDescription.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789- \t\r\n\f";
  var checkStr = theForm.ServiceDescription.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 and whitespace characters in the \"Service Description\" field.");
    theForm.ServiceDescription.focus();
    return (false);
  }
  return (true);
}

function validateUsers(theForm)
{

  if (theForm.userID.value == "")
  {
    alert("Please enter a value for the \"User ID\" field.");
    theForm.userID.focus();
    return (false);
  }

  if (theForm.userID.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"User ID\" field.");
    theForm.userID.focus();
    return (false);
  }

  if (theForm.userID.value.length > 20)
  {
    alert("Please enter at most 20 characters in the \"User ID\" field.");
    theForm.userID.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-";
  var checkStr = theForm.userID.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 and digit characters in the \"User ID\" field.");
    theForm.userID.focus();
    return (false);
  }

  if (theForm.Password.value == "")
  {
    alert("Please enter a value for the \"Password\" field.");
    theForm.Password.focus();
    return (false);
  }

  if (theForm.Password.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Password\" field.");
    theForm.Password.focus();
    return (false);
  }

  if (theForm.Password.value.length > 20)
  {
    alert("Please enter at most 20 characters in the \"Password\" field.");
    theForm.Password.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-";
  var checkStr = theForm.Password.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 and digit characters in the \"Password\" field.");
    theForm.Password.focus();
    return (false);
  }
  return (true);
}
function checkDate(theField){
  var dPart = theField.value.split(/[\-/]/);
  if(dPart.length==3){
    var aDate = new Date(dPart[2],dPart[1]-1,dPart[0]) 
    if(aDate.getDate()==dPart[0]&&aDate.getMonth()==dPart[1]-1){
      return true;
    }
  }
  alert("Enter Date in this format: DD/MM/YYYY");
  theField.select();
  theField.focus();
  return false;
}
function validateEdit(theForm){
  var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateQTY1.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the quantity field");
		return false;
	}
	
var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateQTY2.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the quantity field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateQTY3.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the quantity field");
		return false;
	}	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateQTY4.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the quantity field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateQTY5.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the quantity field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateQTY6.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the quantity field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateQTY7.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the quantity field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateQTY8.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the quantity field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateQTY9.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the quantity field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateQTY10.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the quantity field");
		return false;
	}

//UNITS
  var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateUnit1.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Units field");
		return false;
	}
	
var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateUnit2.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Units field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateUnit3.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Units field");
		return false;
	}	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateUnit4.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Units field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateUnit5.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Units field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateUnit6.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Units field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateUnit7.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Units field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateUnit8.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Units field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateUnit9.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Units field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateUnit10.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Units field");
		return false;
	}


//Amounts
  var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateAmount1.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Amount field");
		return false;
	}
	
var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateAmount2.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Amount field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateAmount3.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Amount field");
		return false;
	}	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateAmount4.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Amount field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateAmount5.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Amount field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateAmount6.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Amount field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateAmount7.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Amount field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateAmount8.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Amount field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateAmount9.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Amount field");
		return false;
	}
	
	var checkOK = "0123456789-.";
  var checkStr = theForm.yourEstimateAmount10.value;
  var allValid = 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 (!allValid){
		alert("Please Enter only numbers for the Amount field");
		return false;
	}	

}