function validateEmail(email)
{
// a very simple email validation checking. 
// you can add more complex email checking if it helps 
    if(email.length <= 0)
	{
	  return true;
	}
    var splitted = email.match("^(.+)@(.+)$");
    if(splitted == null) return false;
    if(splitted[1] != null )
    {
      var regexp_user=/^\"?[\w-_\.]*\"?$/;
      if(splitted[1].match(regexp_user) == null) return false;
    }
    if(splitted[2] != null)
    {
      var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
      if(splitted[2].match(regexp_domain) == null) 
      {
	    var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
	    if(splitted[2].match(regexp_ip) == null) return false;
      }// if
      return true;
    }
return false;
}
// header all condition menu
/////////////////////////////////////////////////////////////////
// 	the following code block is for All condition right side menu
$(document).ready(function(){
	
	var timer;
	var lis = document.getElementsByTagName('a');
	var j=0;
	var cur=0;
	for(i = 0; i < lis.length; i++)
	{
	var li = lis[i];
	
	if (li.id == 'cat_menu'+j)
	{
	
	$("#the_menu"+j).mouseleave(function(){
	arr=this.id.split('the_menu');
	 cur=arr[1];									   
	timer=	setTimeout ( "$('#the_menu"+cur+"').css({display:'none'});", 1);
	}); 
	$("#cat_menu"+j).mouseleave(function(){
	 arr=this.id.split('cat_menu');
	 cur=arr[1];										 
	 timer =	setTimeout ( "$('#the_menu"+cur+"').css({display:'none'});", 1);
	 $("#the_menu"+cur).stop(true,true);
	});
	$("#the_menu"+j).mouseenter(function(){
		arr=this.id.split('the_menu');
	 	cur=arr[1];									   
		clearTimeout(timer);
	});
	$("#cat_menu"+j).mouseenter(function(){
		  arr=this.id.split('cat_menu');
		  cur=arr[1];				
		  
		  var pLeft = $("#cat_menu"+cur).position().left; 
		  var pWidth = $(this).outerWidth()+10;

		
		  $("#the_menu"+cur).css('z-index','9999');	
		  $("#the_menu"+cur).css({
			  left : pLeft,
			  display:''
		  });
		  

	});
	j++;
	}
	}
});
// 	End of code block 
//////////////////////
