
$(document).ready(function(){
	init_invite();
});

function init_invite(){
	$('#signup_closed_send').click(function(){
		var email = $('#email_beta').val();
		if ((email!="")&&(email!="Email Address")){
		        var pageTracker = _gat._getTracker("UA-24479400-1");
			pageTracker._trackPageview("requestOK.html");
			$.get("ajax.php", { "func" : "sendBetaInvitation" , "email": email },
					   function(data) {
						$('#email_beta').attr('disabled', true);
						$('#signup_closed_send').val("REQUEST SENT!");
						$('#signup_closed_send').attr('disabled', true);						
					   });	
		}
		else{
			/* What should I do if the user didnt enter anything. currently do nothing*/
		}
	});
	$('#email_beta').keypress(function(event) {
		  if (event.which == '13') {
				$('#signup_closed_send').click();
		   }
	});
}

