 var RecaptchaOptions = {
    theme : 'clean'
 };



//start
					 var maxtime = 5 //一个小时，按秒计算，自己调整!   
function CountDown(){   
if(maxtime>=0){   
minutes = Math.floor(maxtime/60);   
seconds = Math.floor(maxtime%60);   
msg = seconds+" seconds!";   
document.getElementById("timer").innerHTML=msg;   
if(maxtime == 5*60) alert('注意，还有5分钟!');   
--maxtime;   
}   
else{   
clearInterval(timer);   
window.location.reload(); 
  
}   
}  
//end

//提交退出
function submit(){
	
	document.exitform.submit();
	
	
	}
//



(function ($) {
    $(document).ready(function () {
								
								
			$('#register_link').click(function () {
								 
						$('#register_form').fadeIn('fast');	
						
						$('#fly-container').width($(window).width());
						var maxH = $(document).height() > window.screen.height ? $(document).height() : window.screen.height;
						$('#fly-container').height(maxH);
						$('#fly-container').css({background:'#2c5a6f',left:0, top:0});
						$('#fly-container').show();
						$('#fly-container').animate({'opacity':0.5});
									 });
													
								
			$('#register_close').click(function () {
								
						$('#register_form').hide();	
						$('#fly-container').animate({'opacity':1});
						$('#fly-container').hide();
									 });
			
			$('#member_head').mouseover(function () {
												 
							$('#log_menu').show();					 
												 });
			$('#member_head').mouseout(function () {
												 
							$('#log_menu').hide();					 
												 });
			$('#log_menu').mouseover(function () {
												 
							$('#log_menu').show();					 
												 });
			$('#log_menu').mouseout(function () {
												 
							$('#log_menu').hide();					 
												 });
													
								
						$('#username').keyup(function () {
				    var op = $(this).val();
					
					if(!op.match(/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/)||op==""){
						 
						$('#ecuo').show(); 
						$('#edui').hide(); 
						
						$('#eflag').val('no');
						}	
						
						else{
							
							$('#edui').show();
							$('#ecuo').hide();
							$('#eflag').val('yes');
							}				
					});							
					$('#name').keyup(function () {
				    var op = $(this).val();
					
					if(op.length<6||op==""){
						 
						$('#namecuo').show(); 
						$('#namedui').hide(); 
						$('#nameflag').val('no');
						}	
						
						else{
							
							$('#namedui').show();
							$('#namecuo').hide();
							$('#nameflag').val('yes');
							}				
					});	
					
					$('#password').keyup(function () {
				    var op = $(this).val();
					
					if(op.length<6||op==""){
						 
						$('#pcuo').show(); 
						$('#pdui').hide();
						$('#pflag').val('no');
						}	
						
						else{
							
							$('#pdui').show();
							$('#pcuo').hide();
							$('#pflag').val('yes');
							}				
					});	
					
					
					$('#subregisterform').click(function () {
		   var username=$('#username').val();
		   var name=$('#name').val();
		   var password=$('#password').val();
		   var eflag=$('#eflag').val();
		   var nameflag=$('#nameflag').val();
		   var pflag=$('#pflag').val();
		   var code =$('#recaptcha_challenge_field').val();
		   var recode =$('#recaptcha_response_field').val();
		    var ratio=$('#fen').val();
			 var timeZone=$('#timeZone').val();
		   
		  if(eflag=="yes"&&nameflag=="yes"&&pflag=="yes"){ 
		$.ajax({
				type : 'POST', 
				url : '/configs/ajax/register.php', 
				data : {'username':username,'name':name,'password':password,'code':code,'recode':recode,'ratio':ratio,'timeZone':timeZone}, 
				error : function (a, b) {
					
				}, 
				beforeSend : function () {
			     $('#register_content').hide();
				 $('#reload').show();
				 
				}, 
				success : function (data) {
			 if(data==1){
					 $('#reload').hide(); 
					
					$('#register_success').show();

                    timer = setInterval("CountDown()",1000); 

					 }
			else if(data==2){
			
			    $('#register_content').show();
				 $('#reload').hide(); 
				$('#ecuo').show(); 
						$('#edui').hide(); 
						
						$('#eflag').val('no');
						$('#errorinfo').html('That email is already in use.');
			
			
			}
			else{
				
				 $('#register_content').show();
				 $('#reload').hide(); 
				 $('#yanzma').addClass("authcodecuo"); 
				 $('#errorinfo').html('The text you entered does not match the security image text.');
				}		 
					 
				
				}
		
		
		});
		  }
		  else{
			  
			 
			  alert("The information you filled is invalid.");
			  
			  }
		
		
		});
					
		$('#yanzma').keyup(function () {
									 
					 $('#yanzma').removeClass("authcodecuo"); 				 
									 
									 });
								
								
											
});
})(jQuery);							
