// validation.js


function valGuest(theForm)
{
var bvalid = validName(theForm.fname.value)
  {
  if (!bvalid)  
    {
      theForm.fname.focus()
      return false
    }
var bvalid = validName(theForm.lname.value)
  if (!bvalid)  
    {
      theForm.lname.focus()
      return false
    }
var bvalid = validEMail(theForm.email.value)
  if (!bvalid)  
    {
      theForm.email.focus()
      return false
    }
var bvalid = validComment(theForm.comment.value)
  if (!bvalid)  
    {
      theForm.comment.focus()
      return false
    }
    return true
  }
}



// ELEMENT or DETAIL FUNCTIONS HERE!!!

function validCBO(passedVal)
{
if (passedVal =="")  
  {
    alert("Please select from the option list.")
    return false
  }
  return true
}


function validSeq(passedVal)
{
if (passedVal =="")  
  {
    alert("Please specify a Sequence Number.")
    return false
  }
if (! isNaN(passedVal))  
  {
    if (parseInt(passedVal) != parseFloat(passedVal))
    {
      alert("Please specify WHOLE NUMBERS ONLY.")
      return false
     }
  }
if (isNaN(passedVal))  
  {
    alert("Please specify a numeric value.")
    return false
  }
  return true
}


function validName(passedVal)
{
if (passedVal == "")  
  {
    alert("Please enter your NAME in the text area.")
    return false
  }
// Note:  should check for PIPE
  return true
}


function validEMail(passedVal)
{
if (passedVal == "")  
  {
    alert("Please enter your E-Mail in the text area.")
    return false
  }
// Note:  should check for PIPE
  return true
}


function validComment(passedVal)
{
if (passedVal == "")  
  {
    alert("Please specify a COMMENT in the text area.")
    return false
  }
// Note:  should check for PIPE
  return true
}


function validSpec(passedVal)
{
if (passedVal =="")
  {
    alert("Please specify a Specification Value.")
    return false
  }
if (isNan(passedVal))  
  {
    alert("Please specify a NUMERIC Specification Value.")
    return false
  }
  return true
}

function gotoMenu()
{  		
	document.frmUpdate.hScope.value="0";
	document.frmUpdate.hModeFlag.value="S";

	document.frmUpdate.method="post";
	document.frmUpdate.target = "_parent";
	document.frmUpdate.action="/metrix/Controler";
	document.frmUpdate.submit();
}
