//Add to Cart Form Validator
function AddToCart_Validator(theForm)
{

  if (theForm.esQuantity.value == "")
  {
    alert("Please enter a value for the \"Quantity\" field.");
    theForm.esQuantity.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.esQuantity.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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Quantity\" field.");
    theForm.esQuantity.focus();
    return (false);
  }

  var chkVal = allNum;
  var prsVal = parseInt(allNum);
  
  if (chkVal != "" && !(prsVal > "0" || prsVal < "9999"))
  {
    alert("Please enter a value between \"0 and 9999\" in the \"Quantity\" field.");
    theForm.esQuantity.focus();
    return (false);
  }
  
  return (true);
}

//Open Popup Window
function OpenWindow(name, url, lWidth, lHeight)
{
	var str="status=0,scrollbars=1,resizable=0,address=0,toolbar=0,menubar=0,location=0,width=" + lWidth + ",Height=" + lHeight;
	window.open(url, name, str);
}


//Open Popup Window
function OpenWindowVideo(url, lWidth, lHeight)
{
	var str="status=0,scrollbars=1,resizable=0,address=0,toolbar=0,menubar=0,location=0,width=" + lWidth + ",Height=" + lHeight;
	window.open(url, str);
}


//submit form
function submitForm(valName)
{
    if(document.all)
        {
            var oFrm = document.all(valName);
        }
    if(document.getElementById)
        { 
            var oFrm = document.getElementById(valName);
        }
    oFrm.submit();
}