// Form validation scripts


//Login form validation
function LoginForm_Validator(theForm)
{  
  if (theForm.UserName.value == "")
  {
    alert("Please enter your user name.");
    theForm.UserName.focus();
    return (false);
  }
  
  if (theForm.Password.value == "")
  {
    alert("Please enter your password.");
    theForm.Password.focus();
    return (false);
  }
  
  return (true);
}


//Function(s) to validate add new job ad Form
function addJobad_Validator(theForm)
	{
		  
	  if (theForm.PositionTitle.value == "")
	  {
		alert("Please enter the position title.");
		theForm.PositionTitle.focus();
		return (false);
	  }
	  
	  return (true);
	}

function addJobad_ChkNumeric(field, event, content, name){
	var checkOK = "0123456789";
	var checkStr = content;
	var allValid = true;
	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 += ch;
	}
	if (!allValid)
	{
		if (name == "MinExp"){
			alert("Enter only digits in the \"Min. Yrs. Exp.\" field.");
			document.form1.MinExp.value="";
			document.form1.MinExp.focus();
		}
		if (name == "MaxExp"){
			alert("Enter only digits in the \"Max. Yrs. Exp.\" field.");
			document.form1.MaxExp.value="";
			document.form1.MaxExp.focus();
		}
	return (false);
	}
}
// End Of Function(s) to validate add new job ad Form
