//定义全局变量 var error = "错误提示:\n\n" //代码加密 var on_off = 0 //“1”为启用加密功能,“0”为关闭加密功能。 if(on_off){ window.ClearEvent=function(){event.cancelBubble=false;var sSrcTagName=event.srcElement.tagName.toLowerCase(); return (sSrcTagName=="\\\\textarea\\\\" || sSrcTagName=="input" || sSrcTagName=="select");} window.ClearKey=function(){event.cancelBubble=false;var iKeyCode=event.keyCode;return !(iKeyCode==78 && event.ctrlKey);} with (window.document){oncontextmenu=onselectstart=ondragstart=window.ClearEvent;onkeydown=window.ClearKey;} } //改变导航条CSS样式 function changeMenuStyle(ID,num,className,cs1,cs2){ if(num == "mStyle") {num = 6}; if(num == "lmStyle"){num = 14} ; var obj, num = num, class_ = className, class_1 = cs1, class_2 = cs2 for(i = 1; i < num; i++){ obj = eval(class_ + i) if(i == ID){obj.className = class_2} else{obj.className = class_1} } } // 图层显示函数(显示当前图层,其它图层关闭) function showLayer(ID,layerName){ var obj, num = 6, layerId = layerName for(var i = 1; i < num; i++){ obj = eval(layerId + i) if(i == ID){obj.style.display = ""} else{obj.style.display = "none"} } } function setCookie(name,value){//写入Cookies var Days = 30; //调定Cookie失效时间 var exp = new Date(); exp.setTime(exp.getTime() + Days*24*60*60*1000); document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString(); } function getCookie(name){//读取Cookies var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)"); if(arr=document.cookie.match(reg)) return unescape(arr[2]); else return null; } function delCookie(name){//删除Cookies var exp = new Date(); exp.setTime(exp.getTime() - 1); var cval=getCookie(name); if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString(); } //默认显示文字 function strValue(){ if(getCookie("showhide") == null) {str.innerHTML = "隐藏两端"} if(getCookie("showhide") == "none") {str.innerHTML = "显示两端"} } //显示/隐藏顶、底部 function showHideLayer(layer1,layer2){ var layerId1 = layer1, layerId2 = layer2 obj1 = eval(layerId1) obj2 = eval(layerId2) if(getCookie("showhide") == null){ obj1.style.display = "none"; obj2.style.display = "none"; str.innerHTML = "显示两端"; setCookie("showhide","none"); } else{ obj1.style.display = ""; obj2.style.display = ""; str.innerHTML = "隐藏两端"; setCookie("showhide",""); } } //锁定系统 function message_box_show(){eval("lay").style.display = ""} function layer(obj) { if(obj == "show") { eval("message_box").style.display = ""; setTimeout('message_box_show()',100); setCookie("Locking","");setCookie("Lock","on"); } else { eval("lay").style.display = "none"; eval("message_box").style.display = "none"; setCookie("Locking","none");setCookie("Lock",""); } } if(getCookie("Lock") == null){setCookie("Locking","none")} //搜索表单验证 function searchFrom(){ A = document.Search.Keyword if(A.value.replace(/^\s+|\s+$/,"") == "" || A.value == "请输入关键字"){alert(error + "请输入关键字!");A.focus();return false} else if(A.value.length < 2){alert(error + "关键字长度最少大于两个字符!");A.focus();return false} else {show.location = "News.asp?item=" + escape("新闻管理") + "&action=" + escape("新闻管理") + "&keyword=" + escape(A.value)} } //登陆表单验证 function verdict(){ A = Login.user; B = Login.password; C = Login.validate; if(A.value.replace(/^\s+|\s+$/,"") == ""){alert(error + "管理员名称不能为空!");A.focus();return false;} else if(B.value == ""){alert(error + "管理员密码不能为空!");B.focus();return false;} else if(C.value == ""){alert(error + "验证码不能为空!");C.focus();return false;} else if(C.value.length != 4){alert(error + "验证码输入错误!");C.focus();return false;} else{Login.submit()} } //登陆表单重置 function resetForm(){ A = Login.user; B = Login.password; C = Login.validate; A.value = ""; B.value = ""; C.value = ""; A.focus(); } //超级链接 function jumpUrl(A,B,C,Item,Action){ var fileNameArray = new Array("", "Setting", "Login", "Index", "Welcome", "ServerInfo", "User", "News", "AboutInfo" ,"AllowIp"); if(A == null || B == null || A == "" || B == "") {alert(error + "您还没有填写链接地址!");location = "javascript:;"} else{ for(i = 0; i < fileNameArray.length; i++){ if(A == i) A = fileNameArray[i] } if(B == 1) B = ".htm"; if(B == 2) B = ".asp"; if(C == 2) show.location = A + B + "?item=" + escape(Item) + "&action=" + escape(Action) else location = A + B + "?Item=" + Item + "&Action=" + Action } } //添加管理员表单 function adminForm(){ A = document.adminUser.authority; B = document.adminUser.user; C = document.adminUser.pwd; D = document.adminUser.zpwd; if(A.value == ""){alert(error + "请选择用户权限!");A.focus();return false} else if(B.value.replace(/^\s+|\s+$/,"") == ""){alert(error + "登陆名称不能为空!");B.focus();return false} else if(C.value == ""){alert(error + "登陆密码不能为空!");C.focus();return false} else if(D.value == ""){alert(error + "确认密码不能为空!");D.focus();return false} else if(C.value != D.value){alert(error + "两次输入密码不一致!");D.focus();return false} else adminUser.submit(); } //修改登陆密码表单 function UpAdminForm(){ A = document.UpAdminUser.ypwd; B = document.UpAdminUser.newpwd; if(A.value == ""){alert(error + "原始密码不能为空!");A.focus();return false} else if(B.value == ""){alert(error + "新密码不能为空!");B.focus();return false} else UpAdminUser.submit() } //新闻发布表单 function newsForm(){ A = document.addNews.newClass; B = document.addNews.title; if(A.value == "空"){alert(error + "目前没有新闻类别,确认后跳转至增加新闻类别页面。");location="?Item=增加新闻类别&Action=增加新闻类别"} else if(A.value == ""){alert(error + "请选择新闻类别!");A.focus();return false} else if(B.value.replace(/^\s+|\s+$/,"") == ""){alert(error + "新闻标题不能为空!");B.focus();return false} else addNews.submit() } //版块排序 function orderForm() { num = document.navorder.order.length; A = document.navorder.order var abc = true for(i = 0; i < num; i++){ if(A[i].value == "" || isNaN(A[i].value) || A[i].value < 0){alert(error + "序号输入错误!"); A[i].focus(); A[i].value = ""; abc = false; num = 0 } } if(abc) navorder.submit(); } //最新招聘-详细查看按钮图片 function oa(object){ object.src="images/btn_xh_2.gif"; } function ca(object){ object.src="images/btn_xh.gif"; }