

jQuery(document).ready(function($)

 {

 function make_request(data) {
   if(data != '') { 
         $("#signup_prompt").html(data);
    } else {
         $('#signup_prompt').html('');
         $("#signup_area").html('Thank you for your request. Once your request is reviewed, you will receive an email containing your Invite Code and a link used to create an account.'); 
				  
				 $('.signup').dialog('option', 'buttons', { "Close": function() { $(this).dialog("close"); } });
    }

 }

$('.signup').dialog({
            autoOpen: false,
			bgiframe: true,
			close: function(event, ui) { $('.video_player').show(); },
			modal: true,
            width: 350,
            height: 300,
            buttons: {
			'Continue': function() {
         $.post("/"+version+"/account_request.php", $("#signup_form").serialize(),function(data) { 
                make_request(data); },'html');
                           
                         },
                        Cancel: function() {
					$(this).dialog('close');
			}
               }
	    });

$('.open_signup').click(function() {
  $('.video_player').hide();
	$('#signup_prompt').html('');
	$('.signup').dialog('open');
 });
 
 });
 
