//createMenu
function mainmenu(){
$(" #nav ul ").css({display: "none"}); // Opera Fix
$(" #nav li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show();
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}

 $(document).ready(function(){					
	mainmenu();
});

//validateContact
function validateContact() {

	fv =  new formValidator();
	
	if (fv.isEmpty("firstname"))
		fv.raiseError("Please specify your first name.");
		
	if (fv.isEmpty("lastname"))
		fv.raiseError("Please specify your surname.");
		
	if (fv.isEmpty("email_address"))
		fv.raiseError("Please specify your email address.");
		
	if (!fv.isEmailAddress("email_address"))
		fv.raiseError("Please specify a valid email address.");
		
	if (fv.isEmpty("company"))
		fv.raiseError("Please specify your company name.");
		
	if (fv.isEmpty("contact"))
		fv.raiseError("Please specify your contact number.");
		
	if (fv.isEmpty("message"))
		fv.raiseError("Please enter your message.");

	if (fv.isEmpty("code"))
		fv.raiseError("Please specify the security code.");
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
	  return true;			

}

//validateSearch
function validateSearch() {

	fv =  new formValidator();
	
	if (fv.isEmpty("search_term"))
		fv.raiseError("Please enter a search term.");
		
	if (fv.findObj("search_term").value == "Enter search")
		fv.raiseError("Please enter a search term.");
		
	if (fv.numErrors() > 0)
	{
		fv.displayErrors();
		return false;
	}
	else
	  return true;			
}