<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<div style="text-align:center"><img src="images/Noviceguide_4.gif" alt="第三步" align="middle"/></div>
		<div style="padding:5px; background:#fff9e8; border:1px #faecc6 solid; margin:10px 60px;">温馨提示：完成建站向导，免费获得积分，作为以后兑换礼品时使用！更多惊喜等着你哦</div>
<form id="superForm" method="post" action="./index.php?r=Init.addcustomer">
<div style="padding:0px 60px 10px 60px;">
	<fieldset style=" border:1px solid #cccccc; padding:0px 10px;-moz-border-radius:8px;">
		<legend style="color:#333333;">站长信息设置 (*为必填项)</legend>
		<div style="background:#e2f0fd; margin:10px 0px; border:#aedcfe 1px solid; padding:10px">
			<div style="">
				*真实姓名&nbsp;&nbsp;<span style="color:#999999;">[请填写您的真实姓名哦，该项将用于活动奖品的发放]</span>
			</div>
			<div>
				<input type="text" id="username" maxlength="50" name="data[WebsiteAttribute][WEBMASTER_NAME]" value="<!--{$WEBMASTER_NAME}-->" class="text" style="width:310px"/> <span id="span_username"></span>
			</div>
			<div style=" margin-top:10px;">
				<table width="140">
				<tr>
					<td width="70">性&nbsp;&nbsp;&nbsp;&nbsp;别:</td>
					<td width="70">年&nbsp;&nbsp;&nbsp;&nbsp;龄:</td>
				</tr>
				<tr>
					<td width="70">
						<select id="gender"  name="data[WebsiteAttribute][WEBMASTER_GENDER]">
							<option value="男" <!--{if $WEBMASTER_GENDER =='男'}-->selected="selected"<!--{/if}-->>男</option>
							<option value="女" <!--{if $WEBMASTER_GENDER =='女'}-->selected="selected"<!--{/if}-->>女</option>
						</select>
					</td>
					<td width="70">
						<select id="age" name="data[WebsiteAttribute][WEBMASTER_AGE]">
						</select>
					</td>
				</tr>
			</table>
			</div>
			<div style=" margin-top:10px;">
				站长学历&nbsp;&nbsp;<span style="color:#999999;">[请填写您的学历]</span>
			</div>
			<div>
				<input type="text" id="education" maxlength="20" name="data[WebsiteAttribute][WEBMASTER_EDUCATION]" value="<!--{$WEBMASTER_EDUCATION}-->" class="text" style="width:310px"/> 
			</div>
			<div style=" margin-top:10px;">
				*站长Q Q&nbsp;&nbsp;<span style="color:#999999;">[用于客服支持联系您时使用!不要写错呦!]</span>
			</div>
			<div>
				<input id="qq" maxlength="20"  type="text" name="data[WebsiteAttribute][WEBMASTER_QQ]" value="<!--{$WEBMASTER_QQ}-->" class="text" style="width:310px"/> <span id="span_qq"></span>
			</div>
			<div style=" margin-top:10px;">
				*手机号码&nbsp;&nbsp;<span style="color:red;">[请填写正确的手机号码，以便优拓有新版本升级和忘记账号密码时使用]</span>
			</div>
			<div style="">
				<input id="phone" maxlength="11" type="text" name="data[WebsiteAttribute][WEBMASTER_PHONE]" value="<!--{$WEBMASTER_PHONE}-->" class="text" style="width:310px"/> <span id="span_phone"></span>
			</div>
		</div>
	</fieldset>
</div>
		
<div class="NoviceguideFooter">
	<input type="button" name="Submit" value="上一步" class="next goback" />
	<input  type="submit" name="Submit" value="下一步" class="next gonext" />
	<div style="clear:both; height:1px; overflow:hidden"></div>
</div>
</form>				
<script src="js/jquery/jquery.form.js"></script>		
<script src="js/jquery/jquery.validate.js"></script>
	
<script>
	$(document).ready(function(){
		var html = '';
		
		for(var i = 18;i<80;i++)
		{
			if(i== '<!--{$WEBMASTER_AGE}-->')
			{
				html+='<option value="'+i+'" selected="selected">'+i+'</option>';
			}else{
				html+='<option value="'+i+'" >'+i+'</option>';
			}
		}
		
		$("#age").html(html);
		
		$("input[type='text']").blur(function(){
			if($(this).attr("id") == "phone"){
				var p = /^1\d{10}$/;
				if(!p.test($(this).val())){
					alert("你输入的手机号码不正确！");
					return false;
				}
			}else if($(this).attr("id") == "qq"){
				var p = /\d/;
				if(!p.test($(this).val()) || $(this).val().length<5){
					alert("你输入的QQ号码不正确！");
					return false;
				}
			}
			
		});
		
		 /*
         * jquery验证
         */
        var validate = $("#superForm").validate({
            rules: {
                'data[WebsiteAttribute][WEBMASTER_NAME]': {
					required:true
				},
				'data[WebsiteAttribute][WEBMASTER_QQ]':{
					required:true
				},
				'data[WebsiteAttribute][WEBMASTER_PHONE]':{
					required:true
				}
            },
            messages: {
                'data[WebsiteAttribute][WEBMASTER_NAME]': '真实姓名不能为空！',
				'data[WebsiteAttribute][WEBMASTER_QQ]': 'QQ号码不能为空！',
				'data[WebsiteAttribute][WEBMASTER_PHONE]': '手机号码不能为空！'
            },
            errorPlacement: function(error, element){
                $("#span_" + element.attr("id")).html(error).attr("class", "error");
            },
            errorClass: "invalid",
            success: function(label){
                label.html("&nbsp;&nbsp;&nbsp;").attr("class", "valid");
            }
        });
        $("#superForm").submit(function(){
            if (validate.numberOfInvalids() <= 0) {
				$(".goback").attr("disabled",'disabled').addClass("dis");
				$(".gonext").attr("disabled",'disabled').addClass("dis");
                $(this).ajaxSubmit({
                    success: function(ResponseHtml){
                        var data = eval('(' + ResponseHtml + ')');
						if(data.status==1)
						{
							init_next(7);
						}else{
							$(".gonext").attr("disabled",'').removeClass("dis");
						}
                    }
                });
            }
            return false;
        });
		
		$(".goback").click(function(){
			$(this).attr("disabled",'disabled').addClass("dis");
			$(".gonext").attr("disabled",'disabled').addClass("dis");
			
			init_next(5);
		});
		
	});
	
</script>