$(document).ready(function() {
  
	
	$('#tournament-signup2').dialog({
			//height: 140,
			  modal: true
			, width:730
			, autoOpen: false 
			, resizable: false
			, title: 'SAS/SEB Tournament Sign Up'
			, buttons: { 
							"Submit": function() {  
								tournament_submit2();
					   		} 
							,"Cancel": function(){
								$(this).dialog("close");
							}
					}
		});
      
});
   
   function tournament_submit2(){
      
	  var params = $('#frm_tournament_signup2').serialize();
	   $.post("tournament_submit2.php", { params:params },
	   		function(data){
				$('#tournament-signup2').dialog('option',{
					
					    buttons: { 
							
							"Close": function(){
								$(this).dialog("close");
							}
						}  
					
					});
		 		$('#tournament-signup2').html("Thank you! Registration Successfull.");
	   });

	  
   }
   
   function tournament_signup2(){
	     $('#tournament-signup2').dialog('option',{
					
					    buttons: { 
							
							"Submit": function() {  
								tournament_submit2();
					   		} 
							,"Cancel": function(){
								$(this).dialog("close");
							}
						}  
					
					});
	     $.post("tournament_signup2.php", function(data){
		      $('#tournament-signup2').html(data).dialog("open");
		 });

	   	
   }
   
   function text_change(elem,text_chk){
	   
	   if($(elem).val() == text_chk){
		  $(elem).css('color','#999');
		  
	   }else{
	      $(elem).css('color','#000');
	   }

	   
   }
