function setZero() {
	// initialise plugins
	jQuery(function(){
		jQuery('ul.sf-menu').superfish();
	});
	var currentYear = (new Date).getFullYear();
	$(".greyVL").height($("#stuffInnContainer").height() - 30).css({margin:"30px 0 0 0", backgroundColor:"#587386"});
    $("#fgYear").text(currentYear);
}; //setZero()
// JScript File

function checkForm(frm)
{
var lblError = document.getElementById("lblError");
//array that holds the form elements
var e = frm.elements;
var NamePat = new RegExp("^[a-zA-Z\\d\\s\\'\\.\\-\\,\\?\\!\\+]{3,40}$"); // regex for name, organization, title,
var LnamePat = new RegExp("^[a-zA-Z\\d\\s\\'\\.\\-\\,\\?\\!\\+]{3,40}$"); // regex for lname, organization, title,
var CountryPat = new RegExp("^[a-zA-Z\\d\\s\\'\\.\\-\\,\\?\\!\\+]{2,40}$"); // regex for country, organization, title,
var mailpat = new RegExp("^([a-zA-Z0-9_\\-\\.-]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");//regex for email
var notesPat = new RegExp("^[a-zA-Z\\s\\d\\?\\!\\,\\.\\+\\@\\'\\#\\*\\(\\)\\-\\=]{0,300}$");

//checking if the required fields are filled and comparing them to the regular expressions
for (var i=0; i<e.length;i++)
{

if (emptyField(e[i]))
{

}
switch (e[i].id)
{
case "Name":
if (!NamePat.test(e[i].value))
  { 
  lblError.style.visibility = "visible";
  lblError.innerHTML = "Name should contain 3-40 alphanumeric characters only";
  e[i].focus();
  return false;
  }
break;

case "Lname":
if (!LnamePat.test(e[i].value))
  { 
  lblError.style.visibility = "visible";
  lblError.innerHTML = "Last Name should contain 3-40 alphanumeric characters only";
  e[i].focus();
  return false;
  }
break;

case "Comp":
if (!NamePat.test(e[i].value))
  { 
  lblError.style.visibility = "visible";
  lblError.innerHTML = "Company should contain 3-40 alphanumeric characters only";
  e[i].focus();
  return false;
  }
break;




case "Mail":
if (!mailpat.test(e[i].value))
  { 
  lblError.style.visibility = "visible";
  lblError.innerHTML = "Invalid EMail address";
  e[i].focus();
  return false;
  }
break;



}

}

}
function emptyField(textObj)
{
	if (textObj.value.length == 0) return true;
	for (var i=0; i<textObj.value.length; i++) 
	{
		var ch = textObj.value.charAt(i);
		if (ch != ' ' && ch != '\t') return false;	
	}
	
}
