function InitRequest(){var C_req = null;try{C_req = new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{C_req = new ActiveXObject("Microsoft.XMLHTTP");}catch(oc){C_req = null;}}if (!C_req && typeof XMLHttpRequest != "undefined"){try{C_req = new XMLHttpRequest();}catch(fa){alert("对不起!您的浏览器不支持该功能,请使用Internet Explorer 6.0或FireFox浏览器!");C_req = null;}}return C_req;}
function PostRequest(url, data){var AjaxRequestObj = InitRequest();if (AjaxRequestObj != null){AjaxRequestObj.onreadystatechange = function (){if (AjaxRequestObj.readyState == 4 && AjaxRequestObj.responseText){ProcessAjaxData(AjaxRequestObj.responseText);}};AjaxRequestObj.open("POST", url, true);AjaxRequestObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");AjaxRequestObj.send(data);}}
function ProcessAjaxData(data){eval(data);}
function gid(id){return document.getElementById?document.getElementById(id):null;}
function gname(name){return document.getElementsByTagName?document.getElementsByTagName(name):new Array()}
function StrCode(str){if(encodeURIComponent) return encodeURIComponent(str);if(escape) return escape(str);}
function Browser(){var ua, s, i;this.isIE = false;this.isNS = false;this.isOP = false;this.isSF = false;ua = navigator.userAgent.toLowerCase();s = "opera";if ((i = ua.indexOf(s)) >= 0){this.isOP = true;return;}s = "msie";if ((i = ua.indexOf(s)) >= 0) {this.isIE = true;return;}s = "netscape6/";if ((i = ua.indexOf(s)) >= 0) {this.isNS = true;return;}s = "gecko";if ((i = ua.indexOf(s)) >= 0) {this.isNS = true;return;}s = "safari";if ((i = ua.indexOf(s)) >= 0) {this.isSF = true;return;}}
function mcl(show, div, btn, over, padd){var objdiv = gid(div);var objbtn = gid(btn);if (objdiv && objbtn){var browser = new Browser();if (show){objdiv.style.display = "block";if (browser.isIE && over){var allselect = gname("select");for (var i=0; i<allselect.length; i++){allselect[i].style.visibility = "hidden";}}objdiv.style.top = (objbtn.offsetTop + objbtn.offsetHeight - 2) + "px";objdiv.style.left = (objbtn.offsetLeft - (padd?0:50)) + "px";}else{objdiv.style.display = "none";if (browser.isIE && over){var allselect = gname("select");for (var i=0; i<allselect.length; i++){allselect[i].style.visibility = "visible";}}}}}

function DialogHide(){ScreenClean();var objDialog = document.getElementById("DialogMove");if (objDialog) objDialog.style.display = "none";}
function NeedLogin(){ScreenConvert();var AJAX_LoginBody="<div id=\"DialogTitle\"><div id=\"DialogTitleText\">登录</div><div id=\"DialogTitleBtn\" onclick=\"return DialogHide();\" onmouseover=\"var objShut = document.getElementById('DialogTitleBtn');objShut.style.border='solid 1px #000000';\" onmouseout=\"var objShut = document.getElementById('DialogTitleBtn');objShut.style.border='solid 1px #EEE';\"></div></div><div id=\"DialogContent\">以下操作需验证注册，请先登录或注册！</div><div id=\"DialogValidator\"></div><div id=\"DialogButtons\"><button id=\"AjaxMainReg\" onclick=\"location.replace('/reg.asp?action=yes');\">免费注册</button>&nbsp;&nbsp;<button id=\"AjaxMainLogin\" onclick=\"return ToLogin();\">立即登录</button>&nbsp;&nbsp;<button id=\"AjaxMainCancle\" onclick=\"return DialogHide();\">取消</button></div>";DialogShow(AJAX_LoginBody,250,120,300,150);}
function check(){if(navigator.userAgent.indexOf("IE")>0){return "IE";}if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){return "Firefox";}if(isSafari=navigator.userAgent.indexOf("Safari")>0){return "Safari";}if(isCamino=navigator.userAgent.indexOf("Camino")>0){return "Camino";}if(isMozilla=navigator.userAgent.indexOf("Gecko")>0){return "Gecko";}}
function GetFormPage(pID,pData,ow,oh,w,h){if(check()!="IE"){location.href='/login.asp?go_url='+window.location.href;}else{ScreenConvert();if (pID){DialogShow("<div id=\"DialogLoading\">正在读取,请稍候...</div>",110,24,124,24);try{var url = "/ajax/ajaxComm.asp?pID=" + pID + "&" + pData;xmlHttp= new ActiveXObject("Microsoft.XMLHTTP");xmlHttp.open("GET", url, true);xmlHttp.onreadyStatechange = function(){if (xmlHttp.readyState == 4){DialogShow(xmlHttp.responseText,250,120,300,150);}};xmlHttp.send(null);}catch(exception){}}else{DialogShow("<div id=\"DialogLoading\">读取失败,请<a href=\"javascript:DialogHide();\" class=\"BL\">稍候再试</a>...</div>",130,10,134,20);}}}
function ShowMess(str){return "<div id=\"DialogTitle\"><div id=\"DialogTitleText\">提示</div><div id=\"DialogTitleBtn\" onclick=\"return DialogHide();\" onmouseover=\"var objShut = document.getElementById('DialogTitleBtn');objShut.style.border='solid 1px #000000';\" onmouseout=\"var objShut = document.getElementById('DialogTitleBtn');objShut.style.border='solid 1px #EEE';\"></div></div><div id=\"DialogContent\"><center>"+ str +"</center></div><div id=\"DialogButtons\"><button id=\"AjaxMainCancle\" onclick=\"return DialogHide();\">关闭</button></div>"}

function ScreenConvert(){var browser = new Browser();var objScreen = gid("ScreenOver");if(!objScreen) var objScreen = document.createElement("div");var oS = objScreen.style;objScreen.id = "ScreenOver";oS.display = "block";oS.top = oS.left = oS.margin = oS.padding = "0px";if (document.body.clientHeight)	{var wh = document.body.scrollWidth + "px";}else if (window.innerHeight){var wh = window.innerHeight + "px";}else{var wh = "100%";}oS.width = "100%";oS.height = wh;oS.position = "absolute";oS.zIndex = "3";if ((!browser.isSF) && (!browser.isOP)){oS.background = "#cccccc";}else{oS.background = "#cccccc";}oS.filter = "alpha(opacity=90)";oS.opacity = 90/100;oS.MozOpacity = 90/100;document.body.appendChild(objScreen);var allselect = gname("select");for (var i=0; i<allselect.length; i++) allselect[i].style.visibility = "hidden";}

function ScreenClean(){var objScreen = gid("ScreenOver");if (objScreen) objScreen.style.display = "none";var allselect = gname("select");for (var i=0; i<allselect.length; i++) allselect[i].style.visibility = "visible";}

function DialogLoc(){var dde = document.body;if (window.innerWidth){var ww = window.innerWidth;var wh = window.innerHeight;var bgX = window.pageXOffset;var bgY = window.pageYOffset;}else{var ww = dde.offsetWidth;var wh = dde.offsetHeight;var bgX = dde.scrollLeft;var bgY = dde.scrollTop;}t_DiglogX = (bgX + ((ww - t_DiglogW)/2));t_DiglogY = (bgY + ((wh - t_DiglogH)/2));}

function DialogShow(showdata,ow,oh,w,h){var objDialog = gid("DialogMove");if (!objDialog) objDialog = document.createElement("div");t_DiglogW = ow;t_DiglogH = oh;DialogLoc();objDialog.id = "DialogMove";var oS = objDialog.style;oS.display = "block";oS.top = t_DiglogY + "px";oS.left = t_DiglogX + "px";oS.margin = "0px";oS.padding = "0px";oS.width = w + "px";oS.height = h + "px";oS.position = "absolute";oS.zIndex = "5";oS.background = "#FFF";oS.border = "solid #333333 3px";objDialog.innerHTML = showdata;document.body.appendChild(objDialog);}
