function validateEmail(email)
{
// a very simple email validation checking. 
// you can add more complex email checking if it helps 
    if(email.length <= 0)
	{
	  return false;
	}
    var splitted = email.match("^[^0-9_-](.+)@[A-Za-z0-9](.+)$");
    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;
}

function bscrib(url,target,formType)
{
	if(formType == 1)
	{
		if ($('input[name=bclub]').is(':checked'))
		{
			isChecked = 'Yes';
		}
		else
		{
			isChecked = 'No';
		}
		var param = '&email='+$('#email').val() +
					'&fname='+$('#fname').val()+
					'&lname='+$('#lname').val()+
					'&cell='+$('#cell').val()+
					'&month='+$('#month').val()+
					'&day='+$('#day').val()+
					'&year='+$('#year').val()+
					'&smsme='+isChecked;
	}
	if(formType == 2)
	{
		if ($('input[name=smsme]').is(':checked'))
		{
			isChecked = 'Yes';
		}
		else
		{
			isChecked = 'No';
		}
		if ($('input[name=smsme]').is(':checked'))
		{
			bclub = 'Yes';
		}
		else
		{
			bclub = 'No';
		}
		var param = '&email=' + $('#email').val() +
					'&fname=' + $('#fname').val()+
					'&lname=' + $('#lname').val()+
					'&cell=' + $('#cell').val()+
					'&month='+ $('#month').val()+
					'&day=' + $('#day').val()+
					'&year='+ $('#year').val()+
					'&smsme=' + isChecked +
					'&bclub=' + bclub;
	}
	
	if(formType == 3)
	{
		/*if ($('input[name=smsme]').is(':checked'))
		{
			isChecked = 'Yes';
		}
		else
		{
			isChecked = 'No';
		}
		if ($('input[name=smsme]').is(':checked'))
		{
			bclub = 'Yes';
		}
		else
		{
			bclub = 'No';
		}*/
		var param = '&email=' + $('#email').val() +
					'&fname=' + $('#fname').val()+
					'&people=' + $('#people').val()+
					
					'&cell=' + $('#cell').val()+
					'&month='+ $('#month').val()+
					'&day=' + $('#day').val()+
					'&year='+ $('#year').val()+					
					'&comments=' + $('#comments').val();
	}
	
	$.ajax({
		   type: "POST",
		   url: url+'?type='+formType + param,
	//	   data: param,
		   success: function(html){	   	
//		    html = parseInt(html);
		 
			 if(html)
			 {
			 	$('#'+target).html(html);
			 }
			 else
			 {
			 	alert('Some technical problem Occurs.\nPlease contact to system Administrator.');
			 }
		   }
		 });	
}
function delimg(url)
	{
		if(confirm('Are you sure you want to delete ?' ))
			{
				$.ajax({
				   type: "POST",
				   url: url,
			//	   data: param,
				   success: function(html){	   	
		//		    html = parseInt(html);
				 
					 if(html)
					 {
					 	$('#imgLoader').html(html);
					 }
					 else
					 {
					 	alert('Some technical problem Occurs.\nPlease contact to system Administrator.');
					 }
				   }
				 });	
				
				 
			}
	}
