//容错脚本 ResumeError=function () { return true; } window.onerror = ResumeError; //检查是否中文字符 is_zw=function(str){ exp=/[0-9a-zA-Z_.,#@!$%^&*()-+=|\?/<>]/g; if(str.search(exp) != -1){return false;} return true; } //验证是否包含逗号 CheckBadChar=function (Obj,AlertStr) { exp=/[,,]/g; if(Obj.value.search(exp) != -1) { alert(AlertStr+"不能包含逗号"); Obj.value=""; Obj.focus(); return false; } return true; } // 检查是否有效的扩展名 IsExt=function(FileName, AllowExt){ var sTemp; var s=AllowExt.toUpperCase().split("|"); for (var i=0;i=255||CharAscii<=31) { ErrorStr=ErrorStr+TempStr.charAt(i); } else { if (!CheckErrorStr(CharAscii)) { ErrorStr=ErrorStr+TempStr.charAt(i); } } } if (ErrorStr!='') { alert("出错信息:\n\n"+DescriptionStr+'发现非法字符:'+ErrorStr); Obj.focus(); return false; } if (!(((TempStr.charCodeAt(0)>=48)&&(TempStr.charCodeAt(0)<=57))||((TempStr.charCodeAt(0)>=65)&&(TempStr.charCodeAt(0)<=90))||((TempStr.charCodeAt(0)>=97)&&(TempStr.charCodeAt(0)<=122)))) { alert(DescriptionStr+'首字符只能够为数字或者字母'); Obj.focus(); return false; } } return true; } function CheckErrorStr(CharAsciiCode) { var TempArray=new Array(34,47,92,42,58,60,62,63,124); for (var i=0;i", "[fred]"); OpStr = OpStr.replace("", "[/fred]"); window.parent.parent.frames['BottomFrame'].location.href='KS.Split.asp?ChannelID='+escape(ChannelID)+'&OpStr='+OpStr+'&ButtonSymbol='+escape(ButtonSymbol); } if(MainUrl!='') {window.parent.parent.frames['MainFrame'].location.href=MainUrl; } } function FolderClick(Obj,el) { var i=0; for (var i=0;i
'); }else{ var str="
[UploadFiles]"+maxId+","+fileSize+","+fileext+","+title+"[/UploadFiles]


"; insertHTMLToEditor(str); } } //选择附件 function PopInsertAnnex(){ new KesionPopup().PopupCenterIframe('选择附件插入','../plus/selectAnnex.asp',690,300,'no') } function Getcolor(img_val,Url,input_val){ var arr = showModalDialog(Url, "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0; help:0"); if (arr != null){ document.getElementById(input_val).value = arr; img_val.style.backgroundColor = arr; } } function OpenImgCutWindow(deloriginphoto,installdir,photourl) { OpenImgCutWindows(deloriginphoto,installdir,photourl,$('#PhotoUrl')[0]); } function OpenImgCutWindows(deloriginphoto,installdir,photourl,obj) { OpenThenSetValue(installdir+'plus/ImgCut.asp?del='+deloriginphoto+'&photourl='+photourl,680,380,window,obj); } //网站验证码,调用 writeVerifyCode(安装目录,显示tips,cssname); if (typeof codenum == 'undefined'){ var codenum = 1;}else{codenum++;} function writeVerifyCode(dir,tips,cssname){ codenum++; if (dir==undefined) dir='/';if (tips==undefined) tips=0;if (cssname==undefined) cssname='textbox'; document.write(''); if (tips==1) document.write(' 请输入上图中字符 '); } var seccodefocus = 0; function showverifycode(id) { var obj=document.getElementById("codebox"+id); obj.style.top = (-parseInt(obj.style.height) - 4) + 'px'; obj.style.left = '0px'; obj.style.display = ''; var pos=getElementPos("codebox"+id); if (pos.y<0) obj.style.top=parseInt(obj.style.height)-20+"px"; document.getElementById('vcodeimg'+id).src =document.getElementById('vcodeimg'+id).src.split('?')[0]+'?time=' + Math.random(); try{$("#codebox"+id).fadeOut('fast').fadeIn('fast');}catch(e){} } function getElementPos(elementId) { var ua = navigator.userAgent.toLowerCase(); var isOpera = (ua.indexOf('opera') != -1); var isIE = (ua.indexOf('msie') != -1 && !isOpera); // not opera spoof var el = document.getElementById(elementId); if(el.parentNode === null || el.style.display == 'none') { return false; } var parent = null;var pos = []; var box; if(el.getBoundingClientRect) //IE { box = el.getBoundingClientRect();var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop); var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);return {x:box.left + scrollLeft, y:box.top + scrollTop};}else if(document.getBoxObjectFor) // gecko {box = document.getBoxObjectFor(el); var borderLeft = (el.style.borderLeftWidth)?parseInt(el.style.borderLeftWidth):0; var borderTop = (el.style.borderTopWidth)?parseInt(el.style.borderTopWidth):0; pos = [box.x - borderLeft, box.y - borderTop];} else // safari & opera {pos = [el.offsetLeft, el.offsetTop]; parent = el.offsetParent; if (parent != el) {while (parent) {pos[0] += parent.offsetLeft; pos[1] += parent.offsetTop; parent = parent.offsetParent;}} if (ua.indexOf('opera') != -1 || ( ua.indexOf('safari') != -1 && el.style.position == 'absolute' )) { pos[0] -= document.body.offsetLeft;pos[1] -= document.body.offsetTop;}} if (el.parentNode) {parent = el.parentNode;} else {parent = null;} while (parent && parent.tagName != 'BODY' && parent.tagName != 'HTML') { // account for any scrolled ancestors pos[0] -= parent.scrollLeft;pos[1] -= parent.scrollTop;if (parent.parentNode) {parent = parent.parentNode;} else { parent = null;}} return {x:pos[0], y:pos[1]}; } function scrollDoor(){ } scrollDoor.prototype = { sd : function(menus,divs,openClass,closeClass){ var _this = this; if(menus.length != divs.length) { alert("菜单层数量和内容层数量不一样!"); return false; } for(var i = 0 ; i < menus.length ; i++) { _this.$(menus[i]).value = i; _this.$(menus[i]).onmouseover = function(){ for(var j = 0 ; j < menus.length ; j++) { _this.$(menus[j]).className = closeClass; _this.$(divs[j]).style.display = "none"; } _this.$(menus[this.value]).className = openClass; _this.$(divs[this.value]).style.display = "block"; } } }, $ : function(oid){ if(typeof(oid) == "string") return document.getElementById(oid); return oid; } } // 传说的菜单处理机制 function menu_showbg(obj){ obj.style.backgroundImage = "url('../images/tbarr.png')"; obj.getElementsByTagName("ul")[0].style.display = "block"; } function menu_disbg(obj){ obj.style.backgroundImage = "none"; obj.getElementsByTagName("ul")[0].style.display = "none"; } function submenu_showbg(obj){ obj.style.backgroundImage = "url('../images/submenu_show.png')"; } function submenu_disbg(obj){ obj.style.backgroundImage = "none"; } function mysteriousman_showTime(num){ var myDateTime, strLine, myYear, myMonth, myDate, myDay; var myDayStr = new Array("日", "一", "二", "三", "四", "五", "六"); myDateTime = new Date(); myYear = myDateTime.getFullYear(); myMonth = myDateTime.getMonth() + 1; myDate = myDateTime.getDate(); myDay = myDateTime.getDay(); if(num == 1){ strLine = myYear + "年" + myMonth + "月" + myDate + "日 星期" + myDayStr[myDay]; return strLine; } return ""; } function golistpage(){ var getPage = document.getElementById("getPage"); var listfilename = document.getElementById("listfilename"); location.href= listfilename.value + "&page=" + getPage.value; } function MysteriousMan_updownarr(outframe, frames, dateline){ var totheight = 0; var totalnum = 0; var nowarea = 0; var stop_height = 0; var frame = null; var datelist = 0; var totalnum = 0; var td_height = 0; var init = function(){ stop_height = document.getElementById(outframe).style.height.replace("px", ""); frame = document.getElementById(frames); datelist = document.getElementsByName(dateline); totalnum = datelist.length; td_height = parseInt(datelist[0].style.height.replace("px", "")); totheight = totalnum * td_height; } init(); this.upline = function(){ nowarea += td_height; if((totheight - nowarea) >= stop_height){ frame.style.marginTop = "-" + nowarea + "px"; } else{ nowarea -= td_height; } } this.downline = function(){ nowarea -= td_height; if(nowarea >= 0){ frame.style.marginTop = "-" + nowarea + "px"; } else{ nowarea = 0; } } }