$(document).ready(function() {
        

        $("a.extLink").click(function() {
               window.open(this.href);
               return false;
        });  
		
	//	$("#popup").show("slow", function(){
	//		$("#popclose").click(function() {
	//				$("#popup").hide("slow");					  
       //       return false;
       // 	});  
	//	});
        
        $("#email_form").submit( function () { 
           
             $("#submitbutton").hide();  
             $("#loader").show();
             
             fn77TAction('Email Signup'); 
             pageTracker._trackPageview('/Email_Signup/');
             
             var email = $("#email").val(); 
             if (email == '') {
                 $("#signUp").hide();
                 $("#signUpThanks").hide();
                 $("#signUpSorry").html("<strong>Please enter your email address in the box on the left.</strong>");                        
                 $("#signUpSorry").show();
                            
                 $("#loader").hide();
                 $("#submitbutton").show();  
                
             }else{
                 $.ajaxSetup({cache: false});
                 $.getJSON("/cgi-bin/show_request.cgi", {email_address: email},
                    function(data){
                        if (data.success == 1){
                            $("#signUp").hide();
                            $("#signUpSorry").hide();
                            $("#signUpThanks").html("<strong>Thank You for signing up</strong>.");
                            $("#signUpThanks").show();
                            
                            $("#loader").hide();
                            $("#submitbutton").show();  
                        }else{
                            $("#signUp").hide();
                            $("#signUpThanks").hide();
                            $("#signUpSorry").html("<strong>Sorry, there was a problem</strong>. Please check your email address and try again.");                        
                            $("#signUpSorry").show();
                            
                            $("#loader").hide();
                            $("#submitbutton").show();  
                        }
                  });
            }
             
            return false;
        
        });
});
