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

<div style="text-align:center;"><img src="images/Noviceguide_3.gif" alt="第二步" align="middle"/></div>

<form id="superForm" method="post" action="./index.php?r=Init.updatesysteminfo">
<div style="padding:20px 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;">
			<div style="height:32px; line-height:32px; padding:0px 10px;">
				<b>*我的网站名称</b>&nbsp;&nbsp;[<span>别犹豫，想到什么写什么，以后还可以在后台基本信息设置中更改哦！</span>]
			</div>
			<div style="height:32px; line-height:32px; padding:0px 10px;">
				<input id="init_sitename" type="text" name="data[WebsiteAttribute][SITE_NAME]" value="<!--{$SITE_NAME}-->" class="text" style="width:310px"/> <span id="span_init_sitename"></span>
			</div>
			<div style="height:32px; line-height:32px; padding:0px 10px;">
				<b>*我的网站域名</b>&nbsp;&nbsp;[<span>这是你的网站域名，完成向导即可直接通过该域名访问你的站点哦！</span>]
			</div>
			<div style="height:32px; line-height:32px; padding:0px 10px;">
				<input id="init_domain" type="text" name="data[WebsiteAttribute][SITE_DOMAIN]" value="<!--{$SITE_DOMAIN}-->" style="width:310px" class="text"/> <span id="span_init_domain"></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(){
		 /*
         * jquery验证
         */
		
        var validate = $("#superForm").validate({
            rules: {
                'data[WebsiteAttribute][SITE_NAME]': {
					required:true
				},
				'data[WebsiteAttribute][SITE_DOMAIN]':{
					required:true,
					remote: {
				        url: "index.php?r=Init.checkDomain",
				        type: "post",
				        data: {
				          domain: function() {
				            return $("#init_domain").val();
				          }
				        }
				   }
				}
            },
            messages: {
                'data[WebsiteAttribute][SITE_NAME]': '网站名称不能为空！',
				'data[WebsiteAttribute][SITE_DOMAIN]':{
					required:'网站域名不能为空！',
					remote:"域名格式错误"
					}
            },
            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(str){
                        var data = eval('(' + str + ')');
						if(data.status==1)
						{
							init_next(6);
						}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(2);
		});
	});
	

</script>