
	$(document).ready(function(){		
	$("#validate_msg").hide();	
	$("#validate_thank").hide();
	$("#invite").hide();
		$("#newsletter").click(function(){	
		newsletteremail=$("#newsletter-email").val();
	   			$.post("ajax.asp",{newsletteremail1:newsletteremail,action:'bevnews_email_add'},function(msg){						
				
				if (msg=="Thankyou")
				{
				
					$("#validate_thank").toggle();
					$("#validate_thank").show("slow");
					$("#invite").show("slow");				
				}
				else
				{
				
					$("#validate_msg").toggle();
					$("#validate_msg").html(msg);
					$("#validate_msg").animate({ opacity: 'hide' }, 3000);									
				}
				
			});			
		});
		
		$("#button1").click(function(){
			
		invemail=$("#invmail").val();		
			$.post("ajax.asp",{newsletteremail2:invemail,action:'invite_email_add'},function(msg){
				if (msg=="Please Enter a Valid Email Address.")
				{
					$("#validate_thank").hide("slow");	
					$("#validate_msg").hide("slow");								
					$("#invite_msg").html(msg);	
					$("#invmail").val("");
					$("#invmail").focus();
					
				}
				else
				{
					$("#validate_thank").hide("slow");	
					$("#validate_msg").hide("slow");			
					$("#invite").hide("slow");				
					$("#invite_msg").html(msg);	
					$("#invite_msg").animate({ opacity: 'hide' }, 3000);
				}
			
			});			
		});
	
	});

