// JavaScript Document

$(document).ready(function () {

	$(".applyHover").bind("mouseover",function() {
		$(this).removeClass("partitionTopNav");
		$(this).addClass("bgNavActive");
		$(this).css("backgroundColor","#7e9b29");
	});	

	$(".applyHover").bind("mouseout",function() {
		$(this).removeClass("bgNavActive");
		$(this).addClass("partitionTopNav");
		$(this).css("backgroundColor","");
	})	

	$("#topNav1,#topNav2,#topNav3,#topNav4,#topNav5,#topNav6,#topNav7,#topNav8").bind("click",function(){location.href = $(this).attr("rel")});

	//$("#topNav2").bind("click",function(){window.open($(this).attr("rel"))});	

});

	function Validate(eml)
	{
		if(!IsValidEmail(eml))
		{
			alert('Please enter valid email address.');
			document.getElementById('textEmail').focus();
		}
		else
		{
			var PostData;
			PostData = "EmailID="+eml;		
			$.ajax({
			   type: "POST",
			   url: "save_email.php",
			   data: PostData,
			   success: function(msg){
			   alert('Your email address has been subscribed successfully.');
 			   }
			 });	
		}
	}
	
	function IsValidEmail(strValue)
	{
		//var objRegExp  =/(^[a-z0-9]([a-z0-9_\.]*)@([a-z0-9_\-\.]*)([.][a-z]{3})$)|(^[a-z0-9]([a-z0-9_\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3})(\.[a-z]{2})*$)/i;
		var objRegExp  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		return objRegExp.test(strValue);
	}