function GetCookie(sName)
{
  // cookies are separated by semicolons
  var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++)
  {
    // a name/value pair (a crumb) is separated by an equal sign
    var aCrumb = aCookie[i].split("=");
    if (sName == aCrumb[0]) 
      return unescape(aCrumb[1]);
  }

  // a cookie with the requested name does not exist
  return '';
}

function trim(stringToTrim) {
    return stringToTrim.replace(/^\s+|\s+$/g,"");
}

function VerifyInputs(form) 
{
    if (form.Email.value == '') {
        alert('Please enter your Email');
        form.Email.focus();
        return false;    
    } 
    if (emailCheck(form.Email.value) == false) {
        form.Email.focus();
        return false;
    }    

	if (trim(form.Subject.value) == '') {
		alert('Please enter Subject');
		form.Subject.focus();
		return false;	
	} 
	if (trim(form.Subject.value) == '') {
		alert('Please enter Subject');
		form.Password.focus();
		return false;	
	} 
/*
JT, 4/30/2010, was not working in Chrome. commented out.
	if (trim(form.Message.innerHTML) == '') {
		alert('Please enter Message');
		form.Message.focus();
		return false;	
	}
*/	
    if (GetCookie('ClassiRandNum') != form.Code.value) {
        alert('Please enter the characters correctly');
        form.Code.focus();
        return false;
    }
    return true;
}
