var poststate=false;
var rndno;
var locationhref;
function doActionPost(){
	if($("name").value==""||$("name").value==null){
		alert("您的姓名必须填写,便于对方联系您!");
		$("name").focus();
		return false;
	}
	if($("tel").value==""||$("tel").value==null){
		alert("联系电话必须填写,便于对方联系您!");
		$("tel").focus();
		return false;
	}
	if ($("tel").value.indexOf("027")>-1&&$("tel").value.indexOf("83227016")>-1)
	{
		alert("请填写您自己的联系方式!");
		$("tel").focus();
		return false;
	}
	
	rndno=getRandCode();

	UrlPost("ActionRequestViewContact.asp?srnd="+rndno,"hidden_frame");
	$('msg_cont').style.display='block';
	$('rnd').innerHTML=rndno;
	$("rcode").value="";
	$("rcode").focus();
	window.location.href="#";

	
}


function doCancel(){
	$('msg_cont').style.display='none';
}
function doPost(){
		if (poststate)
		{
			alert("正在提交，请稍等！");
			return false;
		}

		if ($("rcode").value.toUpperCase()!=rndno)
		{
			alert("安全码输入有误，请重新输入！");
			rndno=getRandCode();
			$('rnd').innerHTML=rndno;
			$("rcode").value="";
			$("rcode").focus();
			UrlPost("ActionRequestViewContact.asp?srnd="+rndno,"hidden_frame");
			return false;
		}
		$("showre").style.display="block";
		poststate=true;
		$("subPost").value="正在提交，请稍等..";	

		$("subPost").disabled=true;
		$("btnCancel").disabled=true;
		$("requestform").action="ActionRequestViewContact.asp?rnd="+$("rcode").value.toUpperCase();
		$("requestform").target="hidden_frame";//hidden_frame
		$("requestform").submit();

		$("btnsubmitPic").src="/passport/images/postting.gif";
		//$("rcode").disabled=true;
	}

function callbackPost(nType,Msg){
	//alert(nType);
	if (nType!="50100")
	{
		poststate=false;		
		$("subPost").disabled=false;
		$("btnCancel").disabled=false;
		$("subPost").value="立即提交";	
		$("btnsubmitPic").src="/passport/images/btnViewContact.gif";
		alert(Msg);
		return false;
	}else if(nType=="10001")
	{
		$("msg_cont").style.display="none";
		$("msg_info").style.display="none";

	}else
	{
		$("msg_cont").style.display="none";
		$("msg_info").style.display="block";
		UrlPost(Msg,"_top");
	}
}

function actionView(){
	window.location.href=locationhref;
}

document.writeln("<div id=\"msg_cont\" style=\"position:absolute; top:100px;z-index:1000;width:90%;display:none\">");
document.writeln("	<table width=\"550\" height=\"200\" border=\"0\" align=\"center\" cellpadding=\"40\" cellspacing=\"0\" class=\"tx_box\" style=\"background:#ffffff;border:10px solid #CCE0F5 \">");
document.writeln("		<tr><td>");
document.writeln("		<span style=\"font-size:28px;font-weight:bold;color:#CC0000\">");
document.writeln("			企发通行证信息发布安全验证:<\/span><br \/><br \/>");
document.writeln("		<span style=\"font-size:14px;color:#333;line-height:25px;\" id=\"msg_hint_info\">请填写信息发布安全码：<INPUT TYPE=\"text\" NAME=\"rcode\" id=\"rcode\" onkeypress=\"keypress();\"><\/span>&nbsp;安全码：<span id=\"rnd\" style=\"cursor: hand;\" title=\"用鼠标点击这里，即可自动完成填写！\" onclick=\"javascript:doCopyRnd();\"> <\/span><br \/>");
document.writeln("		<span style=\"font-size:12px;color:red;\"><b>提示：<\/b>用鼠标点击安全码，即可自动完成填写！<\/span>");
document.writeln("		<br\/>");
document.writeln("		<hr\/>");
document.writeln("		");
document.writeln("		<div align=\"center\">");
document.writeln("		  <input type=\"button\" name=\"Submit2\" id=\"subPost\" value=\" 立即提交 \" class=\"m\" style=\"height:30px;font-size:16px\" onclick=\"doPost()\"\/> ");
document.writeln("		  <input type=\"button\" name=\"submitSwitch\" id=\"btnCancel\" value=\" 取 消 \" class=\"m\" style=\"height:30px;font-size:16px\" onclick=\"javascript:doCancel();\"\/>		  ");
document.writeln("		<\/div><span style=\"font-size:12px;color:red;display:none\" id=\"showre\"><b>注意：<\/b>提交后，如果长时间无响应，刷新页面即可！<\/span>");
document.writeln("		<\/td>");
document.writeln("		  <\/tr>");
document.writeln("    <\/table>");
document.writeln("<\/div>");


document.writeln("<div id=\"msg_info\" style=\"position:absolute; top:100px;z-index:1000;width:90%;display:none\">");
document.writeln("	<table width=\"550\" height=\"200\" border=\"0\" align=\"center\" cellpadding=\"40\" cellspacing=\"0\" class=\"tx_box\" style=\"background:#ffffff;border:10px solid #CCE0F5 \">");
document.writeln("		<tr><td>");
document.writeln("		<span style=\"font-size:28px;font-weight:bold;color:#CC0000\">");
document.writeln("			企发助手问温馨提示:<\/span><br \/><br \/>");
document.writeln("		<span style=\"font-size:14px;color:#333;line-height:25px;\">谢谢您填写的资料，企发网络的客服人员会根据您填写的资料，尽快通知对方主动与您联系！<\/span>");
document.writeln("		<br\/>");
document.writeln("		<hr\/>");
document.writeln("		");
document.writeln("		<div align=\"center\">");
document.writeln("		  <input type=\"button\" name=\"viewcontact\" id=\"subPost\" value=\" 您要查看的联系方式请点击这里！ \" class=\"m\" style=\"height:30px;font-size:16px\" onclick=\"actionView()\"\/> ");
document.writeln("		<\/div><\/td>");
document.writeln("		  <\/tr>");
document.writeln("    <\/table>");
document.writeln("<\/div>");

