 <!-- Start : Show and Hide Box -->
 
 function showsubscribebox()
	 {
	   $('#newsletter_box').toggle();	 
	 }
  
  <!-- End : Show and Hide Box -->
  
  
  <!-- Start :Send Mail to Amin Person-->
  
  function subscribeMail()
    {
		var subscriber = $.trim($("#subscriber").val());	    
   if( (subscriber == '') || (subscriber == 'Enter your email id') ) {
	      alert("Please enter your email id");	
		  $('#subscriber').focus();
		  return false;
	}else if(!isValidEmailAddress(subscriber)) {
	       alert("Please enter  your correct email id.");	
		   $('#subscriber').select();
		  return false;

	}else{
	    $("#offer_error").html('<img src="images/loader.gif" />');
		

		 $.ajaxSetup ({
					cache: true
				});

				   $.ajax({
					url: "subscribe-mail.php",
					type: "POST",
					data: ({subscriber: subscriber}),
					cache: false,
					async: true,
						success: function(data){							
							 if(data == 1)
							  {
								$("#newsletter_box").html('<div style="margin-top:15px; font-weight:bold;">Thank you for requesting subscription.</div>');
							  }else{
								alert("Sorry for inconvenience, please try after some time.");
							  }
							//  $("#newsletter_box").html('<div style="margin-top:15px; font-weight:bold;">Thank you for requesting subscription to the newsletter.</div>');
							  //alert("Thank you for registering your Id.");
							}
					});


	return false;
	}

}


<!-- End :Send Mail to Amin Person-->
	
	function isValidEmailAddress(emailAddress) {
var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
return pattern.test(emailAddress);
};


