
  function validInfo(nm)
  {
	if (nm == "")
	{
		return false;
	}
	atPos = nm.indexOf(" ")
	if (atPos == 0)
	{
		return false;
	}
	atPos = nm.indexOf("-")
	if (atPos == 0)
	{
		return false;
	}
	atPos = nm.indexOf("'")
	if (atPos == 0)
	{
		return false;
	}
	return true;
  }

function validEmail(email)
{
	invalidChars = " /:,;"
	
  if (email == "")
  {
  	return false;
  }
  for (i=0; i<invalidChars.length; i++)
  {
  	badChar = invalidChars.charAt(i)
  	if (email.indexOf(badChar,0) > -1)
  	{
  		return false;
  	}
  }
  atPos = email.indexOf("@",1)
  if (atPos == -1)
  {
  	return false;
  }
  if (email.indexOf("@",atPos+1) > -1)
  {
  	return false;
  }
  periodPos = email.indexOf(".",atPos)
  if (periodPos == -1)
  {
  	return false;
  }
  if (periodPos+3 > email.length)
  {
  	return false;
  }
  return true;
}

function removeSpaces(string)
{
 	return string.split(' ').join('');
}
  
	function showTheDay(dayName)
	{
		dayName = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday",
			"Friday","Saturday");
		return (dayName[now.getDay()]);
	}

	function showTheMonth(monName)
	{
		monName = new Array("January","February","March","April","May","June",
			"July","August","September","October","November","December");
		return (monName[now.getMonth()]);
	}

	function showTheDateTime()
	{
		now = new Date;
		
		document.write("" + showTheDay() + ", " + showTheMonth() + 
			" " + now.getDate() + ", " + now.getFullYear() + "");
	}

startList = function() {
	if (document.all && document.getElementById) {
		sbcdropdownRoot = document.getElementById("sbcdropdown");
		for (x=0; x<sbcdropdownRoot.childNodes.length; x++) {
			node = sbcdropdownRoot.childNodes[x];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
				this.className+=" over";
				}
				node.onmouseout=function() {
				this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

if (window.attachEvent)
	window.attachEvent("onload", startList)
else
	window.onload=startList;

function validator(frmEmp)
{
    //***Validate Email Address.***
	if (document.forms['frmEmp'].elements['emailAddr'].value == "")
	{
		alert("You must enter a valid E-mail address.");
		document.forms['frmEmp'].elements['emailAddr'].focus();
		document.forms['frmEmp'].elements['emailAddr'].select();
		return false;
	}
    
	if (!validEmail(document.forms['frmEmp'].elements['emailAddr'].value))
	{
		alert("You must enter a valid E-mail address.");
		document.forms['frmEmp'].elements['emailAddr'].focus();
		document.forms['frmEmp'].elements['emailAddr'].select();
		return false;
	}
    
    //***Validate Description.***
	if (document.forms['frmEmp'].elements['descTxt'].value == "Enter your comment here...")
	{
		alert("Description is needed.");
		document.forms['frmEmp'].elements['descTxt'].focus();
		document.forms['frmEmp'].elements['descTxt'].select();
		return false;
	}

    //***Captcha must be completed by human.***
	if((document.forms['frmEmp'].elements['frmCaptcha'].value == "") || (document.forms['frmEmp'].elements['frmCaptcha'].value == 0))
	{
		alert("You must enter the code shown above");
	  	document.forms['frmEmp'].elements['frmCaptcha'].focus();
		return false;
	}

	if ((document.forms['frmEmp'].elements['descTxt'].value.length < 1) || (trim(document.forms['frmEmp'].elements['descTxt'].value) == "") || (document.forms['frmEmp'].elements['descTxt'].value.indexOf(" ") == -1))
	{
		alert("Description is needed.");
		document.forms['frmEmp'].elements['descTxt'].focus();
		document.forms['frmEmp'].elements['descTxt'].select();
		return false;
	}
	return true;
}

