<form id="auditSiteForm" action="index.php?r=Uuadv.audit_site" method="post">
	<input type="hidden" name="action" value="do"/>
	<input type="hidden" name="adId" value="<!--{$adId}-->"/>
	<table class="tbl_edit" width="100%">
		<tr>
			<td class="td_name">网站域名</td>
			<td class="td_content"><!--{$domain}--></td>
		</tr>
		<tr>
			<td class="td_name">网站备案号</td>
			<td class="td_content">
				<input id="icpNo" type="text" name="icpNo"/>
				<span id="span_icpNo"></span>
			</td>
		</tr>
		<tr>
			<td class="noborder"></td>
			<td class="noborder"><button type="submit" class="butsubmit">提交</button></td>
		</tr>																														
	</table>
</form>
<script>
$(document).ready(function(){
	$("#auditSiteForm").validate({
		rules: {
			"icpNo" : "required"
		},
		messages: {
			"icpNo" : "请输入网站备案号"
		},
		errorPlacement: function(error, element){
			$("#span_" + element.attr("id")).html(error).attr("class", "error");
		},
		submitHandler: function(form){
			setDisabled(":submit",window.document);
			$.ajax({
				type: "get",
				url: "index.php?r=Uuadv.audit_site&action=do&adId=<!--{$adId}-->&icpNo="+$("#icpNo").val(),
				beforeSend: function(){
					var str = '<table width="100%"><tr><td height=50 align="center">正在处理中...<img src="images/ajax.gif"></td></tr></table>';
					$.popbox.setcontent({title:"申请广告", content:str});
				},
				cache: false,
				dataType: "json",
				timeout:30000,
				error : function() {
					var str = "<div style=\"margin:10px 0px;\">";
						str += '<div style="height:90px; padding-left:120px; padding-top:50px;">';
						str += "<span style=\"color:red;font-size:12px;font-weight:800;\">网络通讯异常，请稍后再试！</span>";
						str += '</div></div>';		
					$.popbox.setcontent({title:"申请广告", content:str,height:320});
		  		},
				success: function(data){
					var str = "";
					str = '<div style="margin:10px 0px;"><div style="height: 90px;padding-top: 10px;">';
					if(data.flag==1){
						str += '<fieldset style="border: 1px solid #0092ff; padding: 10px 10px; -moz-border-radius: 8px 8px 8px 8px;margin-bottom:10px;"><legend style="color:#0092ff; font-size:14px;"><strong>赚钱第一步: 申请广告</strong></legend><div style="line-height:24px; margin-top:10px;">你已成功提交申请，广告正在审核中。请耐心等待1-2个工作日！<br/>温馨提示：审核通过后你只需完成以下两个步骤即可开始赚钱之旅啦！</div></fieldset><div style="line-height:26px; color:#333333">→赚钱第二步：导入广告<br/>→赚钱第三步：投放广告</div>';
					}else{
						str += '<fieldset style="border: 1px solid #0092ff; padding: 10px 10px; -moz-border-radius: 8px 8px 8px 8px;margin-bottom:10px;"><legend style="color:#0092ff; font-size:14px;"><strong>赚钱第一步: 申请广告</strong></legend><div style="line-height:24px; margin-top:10px;">广告申请失败！</div></fieldset>';
					}
					str += '</div></div>';
					$.popbox.setcontent({title:"申请广告", content:str,height:320});
					$("#firesbox_close").bind("click",function(){
						window.location.reload();
					});
				}
			});
		},
		errorClass: "invalid",
		success: function(label){
			label.parent().html("&nbsp;").attr("class", "valid");
		},
		onkeyup:false
	});
});
</script>