diff --git a/admin/appmarket/cp.php b/admin/appmarket/cp.php index 6029352..b32d6cf 100644 --- a/admin/appmarket/cp.php +++ b/admin/appmarket/cp.php @@ -213,7 +213,7 @@ elseif ($do == 'install') {//安装应用 if(empty($apparray['app']['app_path'])) $apparray['app']['app_path']=$dir; $filename = $apparray['app']['extra']['installfile']; - $request_uri = MOD_NAME; + $request_uri = MOD_URL; if (!empty($filename) && preg_match('/^[\w\.]+$/', $filename)) { $filename = DZZ_ROOT . './'.$dir.'/' . $appname . '/' . $filename; if (file_exists($filename)) { diff --git a/admin/appmarket/list.php b/admin/appmarket/list.php index bf58d40..4e5bf40 100644 --- a/admin/appmarket/list.php +++ b/admin/appmarket/list.php @@ -12,7 +12,7 @@ if (!defined('IN_DZZ') || !defined('IN_ADMIN')) { include libfile('function/admin'); include libfile('function/organization'); $do = empty($_GET['do']) ? 'available' : trim($_GET['do']); -$refer = urlencode(MOD_URL. '&op=list&do=' . $do); +$refer = urlencode(MOD_URL . '&op=list&do=' . $do); $grouptitle = array('0' => lang('all'), '-1' => lang('visitors_visible'), '1' => lang('members_available'), '2' => lang('section_administrators_available'), '3' => lang('system_administrators_available')); $list = array(); $op=$_GET['op']; diff --git a/core/function/function_core.php b/core/function/function_core.php index dfe6b33..c56c875 100644 --- a/core/function/function_core.php +++ b/core/function/function_core.php @@ -381,7 +381,7 @@ function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0, $ckey_ } if ($operation == 'DECODE') { - if ((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26) . $keyb), 0, 16)) { + if ((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) === substr(md5(substr($result, 26) . $keyb), 0, 16)) { return substr($result, 26); } else { return ''; diff --git a/dzz/system/template/filelist.htm b/dzz/system/template/filelist.htm index ad0555b..650294a 100644 --- a/dzz/system/template/filelist.htm +++ b/dzz/system/template/filelist.htm @@ -296,10 +296,10 @@ function submitdata(){ }else{ $.post(MOD_URL+'&op=positionlist&do=geffolderinfo',{'fid':fid},function(data){ try{if(typeof parent.showWindow_callback == 'function') parent.showWindow_callback(fid,data);}catch(e){} - if(parent.$callback){ - try{ parent.$callback (fid,data);}catch(e){} + if(parent.{$callback}){ + try{ parent.{$callback}(fid,data);}catch(e){} }else{ - try{ opened.$callback (fid,data);}catch(e){} + try{ opened.{$callback}(fid,data);}catch(e){} } hide_window(); diff --git a/dzz/system/template/fileselection/index.htm b/dzz/system/template/fileselection/index.htm index 7125c58..2dd8981 100644 --- a/dzz/system/template/fileselection/index.htm +++ b/dzz/system/template/fileselection/index.htm @@ -164,13 +164,13 @@ html, body{ parent.showWindow_callback(data,'$token'); } }catch(e){} - if (parent.$callback) { + if (parent.{$callback}) { try{ - parent.$callback (data, '$token'); + parent.{$callback}(data, '$token'); }catch(e){} } else { try{ - opened.$callback (data, '$token'); + opened.{$callback}(data, '$token'); }catch(e){} } hide_window(); diff --git a/dzz/system/template/positionlist.htm b/dzz/system/template/positionlist.htm index 7501527..ffb95d2 100644 --- a/dzz/system/template/positionlist.htm +++ b/dzz/system/template/positionlist.htm @@ -373,10 +373,10 @@ return false; } else { $.post(MOD_URL + '&op=positionlist&do=geffolderinfo', {'fid': fid}, function (data) { - if (parent.$callback) { - parent.$callback (fid, data); + if (parent.{$callback}) { + parent.{$callback}(fid, data); } else { - opened.$callback (fid, data); + opened.{$callback}(fid, data); } hide_window(); }, 'json') diff --git a/dzz/system/template/selorguser.htm b/dzz/system/template/selorguser.htm index c200551..0403238 100644 --- a/dzz/system/template/selorguser.htm +++ b/dzz/system/template/selorguser.htm @@ -208,7 +208,7 @@ } }); try{ - $callback (ids,data,'$token');//ids:选中的id列表如:[g_1,125,g_32...],g_开头的标识是机构部门或群组 + {$callback}(ids,data,'$token');//ids:选中的id列表如:[g_1,125,g_32...],g_开头的标识是机构部门或群组 }catch(e){}; hideWindow("$_GET['handlekey']"); return false; diff --git a/static/js/common.js b/static/js/common.js index 4d22fef..3d4bad9 100644 --- a/static/js/common.js +++ b/static/js/common.js @@ -6,4 +6,2889 @@ * @link http://www.dzzoffice.com * @author zyx(zyx@dzz.cc) */ -var _header={init:function(e){_header.formhash=e},loging_close:function(){var e='您确定要注销登录?';showDialog(e,"confirm","",function(){jQuery.get("user.php?mod=login&op=logging&action=logout&formhash="+_header.formhash+"&t="+(new Date).getTime(),function(e){window.location.reload()})})},leftTopmenu:function(e,t){var n=document.documentElement.clientWidth;if(t||(t=jQuery(".bs-left-container").is(":visible")?"hide":"show"),"hide"===t)jQuery(".bs-left-container").hide(),jQuery(".left-drager").hide(),jQuery(".bs-main-container").css("marginLeft",0),jQuery(e).removeClass("leftTopmenu");else if("show"===t){jQuery(".bs-left-container").show();var i=jQuery(".bs-left-container").outerWidth(!0);i<20&&(i=20,jQuery(".bs-left-container").width(i),jQuery(".left-drager").css({left:i,cursor:"w-resize"})),jQuery(".left-drager").show(),jQuery(".bs-main-container").css("marginLeft",n<768?0:i),jQuery(e).addClass("leftTopmenu")}}},BROWSER={},USERAGENT=navigator.userAgent.toLowerCase();browserVersion({ie:"msie",edge:"edge",rv:"rv",firefox:"",chrome:"",opera:"",safari:"",mozilla:"",webkit:"",maxthon:"",qq:"qqbrowser",ie11:"trident"}),BROWSER.ie11?(BROWSER.ie=11,BROWSER.rv=11):BROWSER.rv=0,BROWSER.safari&&(BROWSER.firefox=!0),BROWSER.opera=BROWSER.opera?opera.version():0,HTMLNODE=document.getElementsByTagName("head")[0].parentNode,BROWSER.ie&&(BROWSER.iemode=parseInt(void 0!==document.documentMode?document.documentMode:BROWSER.ie),HTMLNODE.className="ie_all ie"+BROWSER.iemode);var CSSLOADED=[],JSLOADED=[],JSMENU=[];JSMENU.active=[],JSMENU.timer=[],JSMENU.drag=[],JSMENU.layer=0,JSMENU.zIndex={win:11200,menu:11300,dialog:11400,prompt:11500},JSMENU.float="";var CURRENTSTYPE=null,creditnotice=isUndefined(creditnotice)?"":creditnotice,cookiedomain=isUndefined(cookiedomain)?"":cookiedomain,cookiepath=isUndefined(cookiepath)?"":cookiepath,EXTRAFUNC=[],EXTRASTR="";EXTRAFUNC.showmenu=[];var USERABOUT_BOX=!0,USERCARDST=null,CLIPBOARDSWFDATA="",NOTICETITLE=[],NOTICECURTITLE=document.title,CurrentActive;function $C(e,t,n){var i=[];if(n=n||"*",(t=t||document).getElementsByClassName){var o=t.getElementsByClassName(e);if("*"!=n)for(var a=0,r=o.length;a99);return Math.max(e,0).toFixed(1)+["kB","MB","GB","TB","PB","EB"][t]}function trim(e){return(e+"").replace(/(\s+)$/g,"").replace(/^\s+/g,"")}function strlen(e){return BROWSER.ie&&-1!=e.indexOf("\n")?e.replace(/\r?\n/g,"_").length:e.length}function mb_strlen(e){for(var t=0,n=0;n255?"utf-8"==charset?3:2:1;return t}function mb_cutstr(e,t,n){var i=0,o="";t-=(n=""==n||n?n:"...").length;for(var a=0;a255?"utf-8"==charset?3:2:1)>t){o+=n;break}o+=e.substr(a,1)}return o}function strip_tags(e,t){t=(((t||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");return e.replace(/|<\?(?:php)?[\s\S]*?\?>/gi,"").replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,function(e,n){return t.indexOf("<"+n.toLowerCase()+">")>-1?e:""})}function preg_replace(e,t,n,i){i=i||"ig";for(var o=e.length,a=0;a",'"'],["&","<",">",'"'],e)}function display(e){var t=document.getElementById(e);t.style.visibility?t.style.visibility="visible"==t.style.visibility?"hidden":"visible":t.style.display=""==t.style.display?"none":""}function checkall(e,t,n){n=n||"chkall";count=0;for(var i=0;in?i:document.cookie.length);return t?o:unescape(o)}function Ajax(e,t){var n=new Object;return n.loading=__lang.please_wait,n.recvType=e||"XML",n.waitId=t?document.getElementById(t):null,n.resultHandle=null,n.sendString="",n.targetUrl="",n.setLoading=function(e){null!=e&&(n.loading=e)},n.setRecvType=function(e){n.recvType=e},n.setWaitId=function(e){n.waitId="object"==typeof e?e:document.getElementById(e)},n.createXMLHttpRequest=function(){var e=!1;if(window.XMLHttpRequest)(e=new XMLHttpRequest).overrideMimeType&&e.overrideMimeType("text/xml");else if(window.ActiveXObject)for(var t=["Microsoft.XMLHTTP","MSXML.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.7.0","Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],n=0;n '+n.loading+"")},n.processHandle=function(){if(4==n.XMLHttpRequest.readyState&&200==n.XMLHttpRequest.status)if(n.waitId&&(n.waitId.style.display="none"),"HTML"==n.recvType)n.resultHandle(n.XMLHttpRequest.responseText,n);else if("XML"==n.recvType)n.XMLHttpRequest.responseXML&&n.XMLHttpRequest.responseXML.lastChild&&"parsererror"!=n.XMLHttpRequest.responseXML.lastChild.localName?n.resultHandle(n.XMLHttpRequest.responseXML.lastChild.firstChild.nodeValue,n):n.resultHandle(''+__lang.internal_error_unable_display_content+"",n);else if("JSON"==n.recvType){var e=null;try{e=new Function("return ("+n.XMLHttpRequest.responseText+")")()}catch(t){e=null}n.resultHandle(e,n)}},n.get=function(e,t){e=hostconvert(e),setTimeout(function(){n.showLoading()},250),n.targetUrl=e,n.XMLHttpRequest.onreadystatechange=n.processHandle,n.resultHandle=t;var i=isUndefined(i)?0:i;window.XMLHttpRequest?(n.XMLHttpRequest.open("GET",n.targetUrl),n.XMLHttpRequest.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.XMLHttpRequest.send(null)):(n.XMLHttpRequest.open("GET",e,!0),n.XMLHttpRequest.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.XMLHttpRequest.send())},n.post=function(e,t,i){e=hostconvert(e),setTimeout(function(){n.showLoading()},250),n.targetUrl=e,n.sendString=t,n.XMLHttpRequest.onreadystatechange=n.processHandle,n.resultHandle=i,n.XMLHttpRequest.open("POST",e),n.XMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.XMLHttpRequest.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.XMLHttpRequest.send(n.sendString)},n.getJSON=function(e,t){n.setRecvType("JSON"),n.get(e+"&ajaxdata=json",t)},n.getHTML=function(e,t){n.setRecvType("HTML"),n.get(e+"&ajaxdata=html",t)},n}function getHost(e){var t="null";void 0!==e&&null!=e||(e=window.location.href);var n=e.match(/^\w+\:\/\/([^\/]*).*/);return void 0!==n&&null!=n&&(t=n[1]),t}function hostconvert(e){e.match(/^https?:\/\//)||(e=SITEURL+e);var t=getHost(e),n=getHost().toLowerCase();return t&&n!=t&&(e=e.replace(t,n)),e}function newfunction(e){for(var t=[],n=1;n]*?>([^\x00]*?)<\/script>/gi,n=[];n=t.exec(e);){var i=/]*?src=\"([^\>]*?)\"[^\>]*?(reload=\"1\")?(?:charset=\"([\w\-]+?)\")?><\/script>/i,o=[];(o=i.exec(n[0]))?appendscript(o[1],"",o[2],o[3]):(o=(i=/([^\x00]+?)<\/script>/i).exec(n[0]))&&appendscript("",o[2],-1!=o[1].indexOf("reload="))}return e}BROWSER.firefox&&window.HTMLElement&&(HTMLElement.prototype.__defineGetter__("innerText",function(){for(var e="",t=this.childNodes,n=0;n"+this.innerHTML+"":n+">"}),HTMLElement.prototype.__defineGetter__("canHaveChildren",function(){switch(this.tagName.toLowerCase()){case"area":case"base":case"basefont":case"col":case"frame":case"hr":case"img":case"br":case"input":case"isindex":case"link":case"meta":case"param":return!1}return!0})),jQuery(".js-popbox").each(function(){jQuery(this).hasClass("disabled")||(jQuery(this).popbox(),jQuery("[data-bs-toggle='tooltip']").tooltip())}),"onfocusin"in document?(document.onfocusin=function(){CurrentActive=!0},document.onfocusout=function(){CurrentActive=!1}):(window.onfocus=function(){CurrentActive=!0},window.onblur=function(){CurrentActive=!1});var safescripts={},evalscripts=[];function safescript(id,call,seconds,times,timeoutcall,endcall,index){seconds=seconds||1e3,times=times||0;var checked=!0;try{"function"==typeof call?call():eval(call)}catch(e){checked=!1}if(checked)try{index=(index||1)-1,safescripts[id][index].si&&clearInterval(safescripts[id][index].si),"function"==typeof endcall?endcall():eval(endcall)}catch(e){}else safescripts[id]&&index?(index=(index||1)-1,safescripts[id][index].times++,safescripts[id][index].times>=times&&(clearInterval(safescripts[id][index].si),"function"==typeof timeoutcall?timeoutcall():eval(timeoutcall))):(safescripts[id]=safescripts[id]||[],safescripts[id].push({times:0,si:setInterval(function(){safescript(id,call,seconds,times,timeoutcall,endcall,safescripts[id].length)},seconds)}))}function appendscript(e,t,n,i){var o=dhash(e+t);if(n||!in_array(o,evalscripts)){n&&document.getElementById(o)&&document.getElementById(o).parentNode.removeChild(document.getElementById(o)),evalscripts.push(o);var a=document.createElement("script");a.type="text/javascript",a.setAttribute("ajaxappend","1"),a.id=o,a.charset=i||(BROWSER.firefox?document.characterSet:document.charset);try{e?(a.src=e,a.onloadDone=!1,a.onload=function(){a.onloadDone=!0,JSLOADED[e]=1},a.onreadystatechange=function(){"loaded"!=a.readyState&&"complete"!=a.readyState||a.onloadDone||(a.onloadDone=!0,JSLOADED[e]=1)}):t&&(a.text=t),document.getElementsByTagName("head")[0].appendChild(a)}catch(e){}}}function stripscript(e){return e.replace(/.*?<\/script>/gi,"")}function ajaxupdateevents(e,t){t=t||"A";var n=e.getElementsByTagName(t);for(k in n){ajaxupdateevent(n[k])}}function ajaxupdateevent(e){if("object"==typeof e&&e.getAttribute&&e.getAttribute("ajaxtarget")){e.id||(e.id=Math.random());var t=e.getAttribute("ajaxevent")?e.getAttribute("ajaxevent"):"click";_attachEvent(e,t,newfunction("ajaxget",e.getAttribute("ajaxurl")?e.getAttribute("ajaxurl"):e.href,e.getAttribute("ajaxtarget"),e.getAttribute("ajaxwaitid"),e.getAttribute("ajaxloading"),e.getAttribute("ajaxdisplay"))),e.getAttribute("ajaxfunc")&&(e.getAttribute("ajaxfunc").match(/(\w+)\((.+?)\)/),_attachEvent(e,t,newfunction(RegExp.$1,RegExp.$2)))}}function ajaxget(url,showid,waitid,loading,display,recall){waitid=null==waitid?showid:waitid;var x=new Ajax;x.setLoading(loading),x.setWaitId(waitid),x.display=void 0===display||null==display?"":display,x.showId=document.getElementById(showid),"#"==url.substr(strlen(url)-1)&&(url=url.substr(0,strlen(url)-1),x.autogoto=1);var url=url+"&inajax=1&ajaxtarget="+showid;url&&-1==url.indexOf("?")&&(url=url.replace(/&/i,"?")),x.get(url,function(s,x){var evaled=!1;-1!=s.indexOf("ajaxerror")&&(evalscript(s),evaled=!0),evaled||"undefined"!=typeof ajaxerror&&ajaxerror||x.showId&&(x.showId.style.display=x.display,ajaxinnerhtml(x.showId,s),ajaxupdateevents(x.showId),x.autogoto&&scroll(0,x.showId.offsetTop)),ajaxerror=null,recall&&"function"==typeof recall?recall():recall&&eval(recall),evaled||evalscript(s)})}function ajaxpost(formid,showid,waitid,showidclass,submitbtn,recall){var waitid=null==waitid?showid:""!==waitid?waitid:"",showidclass=showidclass||"",ajaxframeid="ajaxframe",ajaxframe=document.getElementById(ajaxframeid),curform=document.getElementById(formid),formtarget=curform.target,handleResult=function(){var s="",evaled=!1;showloading("none");try{s=document.getElementById(ajaxframeid).contentWindow.document.XMLDocument.text}catch(e){try{s=document.getElementById(ajaxframeid).contentWindow.document.documentElement.firstChild.wholeText}catch(e){try{s=document.getElementById(ajaxframeid).contentWindow.document.documentElement.firstChild.nodeValue}catch(e){s=__lang.internal_error_unable_display_content}}}""!=s&&-1!=s.indexOf("ajaxerror")&&(evalscript(s),evaled=!0),showidclass&&("onerror"!=showidclass?document.getElementById(showid).className=showidclass:(showError(s),ajaxerror=!0)),submitbtn&&(submitbtn.disabled=!1),evaled||"undefined"!=typeof ajaxerror&&ajaxerror||ajaxinnerhtml(document.getElementById(showid),s),ajaxerror=null,curform&&(curform.target=formtarget),"function"==typeof recall?recall():eval(recall),evaled||evalscript(s),ajaxframe.loading=0,!BROWSER.firefox||BROWSER.safari?document.getElementById("append_parent").removeChild(ajaxframe.parentNode):setTimeout(function(){document.getElementById("append_parent").removeChild(ajaxframe.parentNode)},100)};if(ajaxframe){if(ajaxframe.loading)return!1}else{var div=document.createElement("div");div.style.display="none",div.innerHTML='',document.getElementById("append_parent").appendChild(div),ajaxframe=document.getElementById(ajaxframeid)}_attachEvent(ajaxframe,"load",handleResult),showloading(),curform.target=ajaxframeid;var action=curform.getAttribute("action");action=hostconvert(action).replace(/(&|&|\?)inajax\=1/g,"");var s=-1!=action.indexOf("?")?"&":"?";return curform.action=action+s+"inajax=1",curform.submit(),submitbtn&&(submitbtn.disabled=!0),doane(),!1}function ajaxmenu(ctrlObj,timeout,cache,duration,pos,recall,idclass,contentclass){if(ctrlObj.getAttribute("mid")){var ctrlid=ctrlObj.getAttribute("mid");ctrlObj.id||(ctrlObj.id="ajaxid_"+Math.random())}else{var ctrlid=ctrlObj.id;ctrlid||(ctrlObj.id="ajaxid_"+Math.random())}var menuid=ctrlid+"_menu",menu=document.getElementById(menuid);isUndefined(timeout)&&(timeout=3e3),isUndefined(cache)&&(cache=1),isUndefined(pos)&&(pos="43"),isUndefined(duration)&&(duration=timeout>0?0:3),isUndefined(idclass)&&(idclass="p_pop"),isUndefined(contentclass)&&(contentclass="p_opt");var func=function(){showMenu({ctrlid:ctrlObj.id,menuid:menuid,duration:duration,timeout:timeout,pos:pos,cache:cache,layer:2}),"function"==typeof recall?recall():eval(recall)};if(menu)""==menu.style.display?hideMenu(menuid):func();else{menu=document.createElement("div"),menu.id=menuid,menu.style.display="none",menu.className=idclass,menu.innerHTML='
',document.getElementById("append_parent").appendChild(menu);var url=isUndefined(ctrlObj.attributes.shref)?isUndefined(ctrlObj.href)?ctrlObj.attributes.href.value:ctrlObj.href:ctrlObj.attributes.shref.value;url+=(-1!=url.indexOf("?")?"&":"?")+"ajaxmenu=1",ajaxget(url,menuid+"_content","ajaxwaitid","","",func)}doane()}function dhash(e,t){t=t||32;var n=0,i=0,o="";for(filllen=t-e.length%t,i=0;i'+t+"",document.getElementById("append_parent").appendChild(n);for(var i=n.getElementsByTagName("TR"),o=i.length,a=0;a1&&(menuObj.onmouseover=function(){clearTimeout(JSMENU.timer[menuid]),JSMENU.timer[menuid]=null}),1!=duration&&(menuObj.onmouseout=function(){JSMENU.timer[menuid]=setTimeout(function(){hideMenu(menuid,mtype)},timeout)})),cover)){var coverObj=document.createElement("div");coverObj.id=menuid+"_cover",coverObj.style.position="absolute",coverObj.style.zIndex=menuObj.style.zIndex-1,coverObj.style.left=coverObj.style.top="0px",coverObj.style.width="100%",coverObj.style.height=Math.max(document.documentElement.clientHeight,document.body.offsetHeight)+"px",coverObj.style.backgroundColor="#000",coverObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=50)",coverObj.style.opacity=.5,coverObj.onclick=function(){hideMenu()},document.getElementById("append_parent").appendChild(coverObj),_attachEvent(window,"load",function(){coverObj.style.height=Math.max(document.documentElement.clientHeight,document.body.offsetHeight)+"px"},document)}if(drag&&(dragobj.style.cursor="move",dragobj.onmousedown=function(e){try{dragMenu(menuObj,e,1)}catch(e){}}),cover&&(document.getElementById(menuid+"_cover").style.display=""),fade){var O=0,fadeIn=function(e){if(e>100)clearTimeout(t);else{menuObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+e+")",menuObj.style.opacity=e/100,e+=20;var t=setTimeout(function(){fadeIn(e)},40)}};fadeIn(O),menuObj.fade=!0}else menuObj.fade=!1;menuObj.style.display="",ctrlObj&&ctrlclass&&(ctrlObj.className+=" "+ctrlclass,menuObj.setAttribute("ctrlid",ctrlid),menuObj.setAttribute("ctrlclass",ctrlclass)),"*"!=pos&&setMenuPosition(showid,menuid,pos),BROWSER.ie&&BROWSER.ie<7&&winhandlekey&&document.getElementById("fwin_"+winhandlekey)&&(document.getElementById(menuid).style.left=parseInt(document.getElementById(menuid).style.left)-parseInt(document.getElementById("fwin_"+winhandlekey).style.left)+"px",document.getElementById(menuid).style.top=parseInt(document.getElementById(menuid).style.top)-parseInt(document.getElementById("fwin_"+winhandlekey).style.top)+"px"),maxh&&menuObj.scrollHeight>maxh&&(menuObj.style.height=maxh+"px",BROWSER.opera?menuObj.style.overflow="auto":menuObj.style.overflowY="auto"),duration||setTimeout("hideMenu('"+menuid+"', '"+mtype+"')",timeout),in_array(menuid,JSMENU.active[layer])||JSMENU.active[layer].push(menuid),menuObj.cache=cache,layer>JSMENU.layer&&(JSMENU.layer=layer);var hasshow=function(e){for(;e.parentNode&&"none"!==(void 0===e.currentStyle?window.getComputedStyle(e,null):e.currentStyle).display;)e=e.parentNode;return e===document};if(!menuObj.getAttribute("disautofocus"))try{for(var focused=!1,tags=["input","select","textarea","button","a"],i=0;i0&&!i)){switch(i&&(u=(d=jQuery(i).offset()).left,m=d.top,f=jQuery(i).outerWidth(!0),p=jQuery(i).outerHeight(!0)),a=o.offsetWidth,o.clientWidth,r=o.offsetHeight,o.clientHeight,c){case 1:v=u,y=m;break;case 2:v=u+f,y=m;break;case 3:v=u+f,y=m+p;break;case 4:v=u,y=m+p}switch(s){case 0:o.style.left=(document.body.clientWidth-o.clientWidth)/2+"px",h=(document.documentElement.clientHeight-o.clientHeight)/2;break;case 1:g=v-a,h=y-r;break;case 2:g=v,h=y-r;break;case 3:g=v,h=y;break;case 4:g=v-a,h=y}l||(in_array(s,[1,4])&&g<0?(g=v,in_array(c,[1,4])&&(g+=f)):g+a>0+document.body.clientWidth&&u>=a&&(g=v-a,in_array(c,[2,3])?g-=f:4==c&&(g+=f)),in_array(s,[1,2])&&h<0?(h=y,in_array(c,[1,2])&&(h+=p)):h+r>0+document.documentElement.clientHeight&&m>=r&&(h=y-r,in_array(c,[3,4])&&(h-=p))),"210"==n.substr(0,3)&&(g+=69-f/2,h-=5,"TEXTAREA"==i.tagName&&(g-=f/2,h+=p/2)),(0==s||o.scrolly)&&(BROWSER.ie&&BROWSER.ie<7?0==s&&(h+=0):(o.scrolly&&(h-=0),o.style.position="fixed")),document.body.clientWidth>0&&g>0&&g+a>document.body.clientWidth&&(g=document.body.clientWidth-a-10>0?document.body.clientWidth-a-10:0),g&&(o.style.left=g+"px"),h&&(o.style.top=h+"px"),0==s&&BROWSER.ie&&!document.documentElement.clientHeight&&(o.style.position="absolute",o.style.top=(document.body.clientHeight-o.clientHeight)/2+"px"),o.style.clip&&!BROWSER.opera&&(o.style.clip="rect(auto, auto, auto, auto)")}}function hideMenu(e,t){if(e=isUndefined(e)?"":e,t=isUndefined(t)?"menu":t,""!=e)if("number"!=typeof e){if("string"==typeof e){var n=document.getElementById(e);if(!n||t&&n.mtype!=t)return;var i="",o="";if((i=document.getElementById(n.getAttribute("ctrlid")))&&(o=n.getAttribute("ctrlclass"))){var a=new RegExp(" "+o);i.className=i.className.replace(a,"")}clearTimeout(JSMENU.timer[e]);var r=function(){n.cache?"hidden"!=n.style.visibility&&(n.style.display="none",n.cover&&(document.getElementById(e+"_cover").style.display="none")):(n.parentNode.removeChild(n),n.cover&&document.getElementById(e+"_cover").parentNode.removeChild(document.getElementById(e+"_cover")));var t=[];for(var i in JSMENU.active[n.layer])e!=JSMENU.active[n.layer][i]&&t.push(JSMENU.active[n.layer][i]);JSMENU.active[n.layer]=t};if(n.fade){var c=function(e){if(0==e)return clearTimeout(t),void r();n.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+e+")",n.style.opacity=e/100,e-=20;var t=setTimeout(function(){c(e)},40)};c(100)}else r()}}else for(var s in JSMENU.active[e])hideMenu(JSMENU.active[e][s],t);else for(var l=1;l<=JSMENU.layer;l++)hideMenu(l,t)}function getCurrentStyle(e,t,n){if(e.style[t])return e.style[t];if(e.currentStyle)return e.currentStyle[t];if(document.defaultView.getComputedStyle(e,null)){var i=(o=document.defaultView.getComputedStyle(e,null)).getPropertyValue(n);return i||(i=o[t]),i}var o;return window.getComputedStyle?(o=window.getComputedStyle(e,"")).getPropertyValue(n):void 0}function fetchOffset(e,t){var n=0,i=0;t=t||0;if(e.getBoundingClientRect&&!t){var o=e.getBoundingClientRect(),a=Math.max(document.documentElement.scrollTop,document.body.scrollTop),r=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);"rtl"==document.documentElement.dir&&(r=r+document.documentElement.clientWidth-document.documentElement.scrollWidth),n=o.left+r-document.documentElement.clientLeft,i=o.top+a-document.documentElement.clientTop}if(n<=0||i<=0)for(n=e.offsetLeft,i=e.offsetTop;null!=(e=e.offsetParent);)position=getCurrentStyle(e,"position","position"),"relative"!=position&&(n+=e.offsetLeft,i+=e.offsetTop);return{left:n,top:i}}function showError(e){""!==(e=e.replace(/]*?>([^\x00]*?)<\/script>/gi,""))&&showDialog(e,"alert",__lang.db_error_message,null,!0,null,"","","",3)}function hideWindow(e,t,n){t=isUndefined(t)?1:t,n=isUndefined(n)?1:n,jQuery("#fwin_"+e).modal("hide").remove(),t&&jQuery(".modal.fwinmask").modal("hide").remove()}function AC_FL_RunContent(){var e="",t=AC_GetArgs(arguments,"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");if(BROWSER.ie&&!BROWSER.opera){for(var n in e+=" ';e+=""}else{for(var n in e+="'+defaultopt+"",menuObj.id=selectId+"_ctrl_menu",menuObj.className="sltm",menuObj.style.display="none",menuObj.style.width=selectwidth,menuObj.appendChild(ul),document.getElementById("append_parent").appendChild(menuObj),document.getElementById(selectId+"_ctrl").onclick=function(e){document.getElementById(selectId+"_ctrl_menu").style.width=selectwidth,showMenu({ctrlid:"loginfield"==selectId?"account":selectId+"_ctrl",menuid:selectId+"_ctrl_menu",evt:"click",pos:"43"}),doane(e)},document.getElementById(selectId+"_ctrl").onfocus=menuObj.onfocus=function(){_attachEvent(document.body,"keydown",handleKeyDown)},document.getElementById(selectId+"_ctrl").onblur=menuObj.onblur=function(){_detachEvent(document.body,"keydown",handleKeyDown)},document.getElementById(selectId+"_ctrl").onkeyup=function(e){if(e=e||window.event,value=e.keyCode,40==value||38==value)"none"==menuObj.style.display?document.getElementById(selectId+"_ctrl").onclick():(t=menuObj.getElementsByTagName("li"),selecti=selectObj.getAttribute("selecti"),t[selecti].className="",40==value?selecti=parseInt(selecti)+1:38==value&&(selecti=parseInt(selecti)-1),selecti<0?selecti=t.length-1:selecti>t.length-1&&(selecti=0),t[selecti].className="current",selectObj.setAttribute("selecti",selecti),t[selecti].parentNode.scrollTop=t[selecti].offsetTop);else if(13==value){var t=menuObj.getElementsByTagName("li");t[selectObj.getAttribute("selecti")].onclick()}else 27==value&&hideMenu(menuObj.id)}}}function ctrlEnter(e,t,n){return isUndefined(n)&&(n=0),!e.ctrlKey&&!n||13!=e.keyCode||(document.getElementById(t).click(),!1)}function updatestring(e,t,n){return t="_"+t+"_",n?e.replace(t,""):-1==e.indexOf(t)?e+t:e}function getClipboardData(){window.document.clipboardswf.SetVariable("str",CLIPBOARDSWFDATA)}function setCopy(e,t){BROWSER.ie?clipboardData.setData("Text",e)?t&&showPrompt(null,null,""+t+"",1500):showDialog('
'+__lang.copy_unsuccess_allow_access+"
","alert"):(showDialog(t='
'+__lang.click_here_copy_clipboard+"
"+AC_FL_RunContent("id","clipboardswf","name","clipboardswf","devicefont","false","width","200","height","40","src",STATICURL+"image/common/clipboard.swf","menu","false","allowScriptAccess","sameDomain","swLiveConnect","true","wmode","transparent","style","margin-top:-20px"),"message"),e=e.replace(/[\xA0]/g," "),CLIPBOARDSWFDATA=e)}var secST=new Array;function strLenCalc(e,t,n){for(var i=e.value,o=n=n||200,a=strlen(i),r=0;r255)&&(o-="utf-8"==charset?2:1);o>=a?document.getElementById(t).innerHTML=o-a:e.value=mb_cutstr(i,n,0)}if(BROWSER.ie&&BROWSER.ie<11)try{document.documentElement.addBehavior("#default#userdata")}catch(e){}function updateseccode(idhash,play){isUndefined(play)?document.getElementById("seccode_"+idhash)&&(document.getElementById("seccodeverify_"+idhash).value="",secST["code_"+idhash]&&clearTimeout(secST["code_"+idhash]),document.getElementById("checkseccodeverify_"+idhash).innerHTML="",ajaxget("misc.php?mod=seccode&action=update&idhash="+idhash,"seccode_"+idhash,null,"","",function(){secST["code_"+idhash]=setTimeout(function(){document.getElementById("seccode_"+idhash).innerHTML='"+__lang.refresh_verification_code+""},18e4)})):eval("window.document.seccodeplayer_"+idhash+'.SetVariable("isPlay", "1")')}function checksec(e,t,n,i){n=n||0;var o=document.getElementById("sec"+e+"verify_"+t).value;if(o){var a=new Ajax("XML","checksec"+e+"verify_"+t);a.loading="",document.getElementById("checksec"+e+"verify_"+t).innerHTML='',a.get("misc.php?mod=sec"+e+"&action=check&inajax=1&&idhash="+t+"&secverify="+(BROWSER.ie&&"utf-8"==document.charset?encodeURIComponent(o):o),function(o){var a=document.getElementById("checksec"+e+"verify_"+t);a&&(a.style.display="","succeed"==o.substr(0,7)?(a.innerHTML='',jQuery(a).closest(".seccode-wrapper").find(".help-msg").addClass("chk_right"),n&&i(1)):(jQuery(a).closest(".seccode-wrapper").find(".help-msg").removeClass("chk_right"),a.innerHTML='',n&&("code"==e&&showError(__lang.verification_error_reset),i(0))))})}}function showdistrict(e,t,n,i,o){var a=function(e){var t=e.options[e.selectedIndex];return t.did||t.getAttribute("did")||"0"},r=i>=1&&t[0]&&document.getElementById(t[0])?a(document.getElementById(t[0])):0,c=i>=2&&t[1]&&document.getElementById(t[1])?a(document.getElementById(t[1])):0,s=i>=3&&t[2]&&document.getElementById(t[2])?a(document.getElementById(t[2])):0,l=i>=4&&t[3]&&document.getElementById(t[3])?a(document.getElementById(t[3])):0;ajaxget("user.php?mod=ajax&action=district&container="+e+"&containertype="+o+"&province="+t[0]+"&city="+t[1]+"&district="+t[2]+"&community="+t[3]+"&pid="+r+"&cid="+c+"&did="+s+"&coid="+l+"&level="+n+"&handlekey="+e+"&inajax=1"+(i?"":"&showdefault=1"),e,"")}function showbirthday(){var e=document.getElementById("birthday"),t=e.value;e.length=0,e.options.add(new Option(__lang.day,""));for(var n=0;n<28;n++)e.options.add(new Option(n+1,n+1));if("2"!=document.getElementById("birthmonth").value)switch(e.options.add(new Option(29,29)),e.options.add(new Option(30,30)),document.getElementById("birthmonth").value){case"1":case"3":case"5":case"7":case"8":case"10":case"12":e.options.add(new Option(31,31))}else if(""!=document.getElementById("birthyear").value){var i=document.getElementById("birthyear").value;(i%400==0||i%4==0&&i%100!=0)&&e.options.add(new Option(29,29))}e.value=t}var tipTimer=[];function showTip(e,t,n){e.id||(e.id="tip_"+Math.random());var i="";switch(t){case"12":i="tip_4";break;case"21":i="tip_3";break;case"43":i="tip_1";break;case"34":i="tip_2";break;default:t="12",i="tip_4"}if(menuid=e.id+"_menu",!document.getElementById(menuid)){var o=document.createElement("div");o.id=e.id+"_menu",o.className="tip da "+i,o.style.display="none",o.innerHTML='
'+(n||e.getAttribute("tip"))+"
",document.getElementById("append_parent").appendChild(o),o.onmouseover=function(){tipTimer[this.id]&&window.clearTimeout(tipTimer[this.id])},o.onmouseout=function(){var e=this;tipTimer[this.id]=window.setTimeout(function(){hideMenu(e.id,"prompt")},200)}}document.getElementById(e.id).onmouseout=function(){var e=this;tipTimer[this.id+"_menu"]=window.setTimeout(function(){hideMenu(e.id+"_menu","prompt")},200)},showMenu({mtype:"prompt",ctrlid:e.id,pos:t+"!",duration:3,zindex:JSMENU.zIndex.prompt})}function showPrompt(e,t,n,i,o){var a=e?e+"_pmenu":"ntcwin",r=i?0:3;document.getElementById(a)&&document.getElementById(a).parentNode.removeChild(document.getElementById(a));var c=document.createElement("div");if(c.id=a,c.className=o||(e?"tip tip_js":"ntcwin"),c.style.display="none",document.getElementById("append_parent").appendChild(c),n=e?'
'+n+"
":'
 
'+n+'
 
',c.innerHTML=n,e){if(i||(t="click"),document.getElementById(e)){if(!1!==document.getElementById(e).evt){var s=function(){showMenu({mtype:"prompt",ctrlid:e,evt:t,menuid:a,pos:"210"})};"click"==t?document.getElementById(e).onclick=s:document.getElementById(e).onmouseover=s}showMenu({mtype:"prompt",ctrlid:e,evt:t,menuid:a,pos:"210",duration:r,timeout:i,zindex:JSMENU.zIndex.prompt}),document.getElementById(e).unselectable=!1}}else showMenu({mtype:"prompt",pos:"00",menuid:a,duration:r,timeout:i,zindex:JSMENU.zIndex.prompt}),document.getElementById(a).style.top=parseInt(document.getElementById(a).style.top)-100+"px"}function cardInit(){for(var e={},t=document.body.getElementsByTagName("a"),n=0;n-1,i=t.indexOf("Android")>-1;return!(!n&&!i)}jQuery(document).ready(function(e){jQuery(".js-popbox").each(function(){jQuery(this).popbox()}),jQuery(document).on("click","a",function(){var e=this.href,t="",n=jQuery(this).attr("title")?jQuery(this).attr("title"):strip_tags(this.innerHTML);if(-1!==e.indexOf("user.php?uid=")){t="profile";try{top.OpenWindow(t,e,__lang.subscriber_data)}catch(t){return window.open(e,n),!1}return!1}if("_dzz"==this.target){if(jQuery(this).attr("icon"))var i={img:jQuery(this).attr("icon"),name:n};else i={};try{return top._config?(top.OpenWindow("url",e,n,"",i),!1):(window.open(e,n),!1)}catch(e){}}})});var showDialogST=null;function showDialog(msg,mode,t,func,cover,funccancel,leftmsg,confirmtxt,canceltxt,closetime,locationtime){clearTimeout(showDialogST),cover=isUndefined(cover)?"info"==mode||"icon"==mode?0:1:cover,leftmsg=isUndefined(leftmsg)?"":leftmsg,mode||(mode="alert");var menuid="fwin_dialog",menuObj=document.getElementById(menuid),showconfirm=1;confirmtxtdefault="确定",closetime=isUndefined(closetime)?"":closetime,closefunc=function(){"function"==typeof func?func():eval(func),hideMenu(menuid,"dialog")},closetime&&(leftmsg=closetime+__lang.message_closetime,showDialogST=setTimeout(closefunc,1e3*closetime)),locationtime=isUndefined(locationtime)?"":locationtime,locationtime&&(leftmsg=locationtime+__lang.message_locationtime,showDialogST=setTimeout(closefunc,1e3*locationtime)),confirmtxt=confirmtxt||confirmtxtdefault,canceltxt=canceltxt||"取消",menuObj&&hideMenu("fwin_dialog","dialog"),menuObj=document.createElement("div"),menuObj.style.display="none",menuObj.className="fwinmask",menuObj.id=menuid,document.getElementById("append_parent").appendChild(menuObj);var hidedom="";BROWSER.ie||(hidedom='');var shadow="",s="";if(t?(s=hidedom+shadow+''):(s=hidedom+shadow+''),-1!==mode.indexOf("alert_icon_")){var icon=decodeURIComponent(mode.replace("alert_icon_",""));s+=icon?'":'",s+='"}else"message"==mode?(s+=leftmsg?'":'",s+='"):(s+='",s+='");s+="",menuObj.innerHTML=s,document.getElementById("fwin_dialog_submit")&&(document.getElementById("fwin_dialog_submit").onclick=function(){"function"==typeof func?func():eval(func),hideMenu(menuid,"dialog")}),document.getElementById("fwin_dialog_cancel")&&(document.getElementById("fwin_dialog_cancel").onclick=function(){"function"==typeof funccancel?funccancel():eval(funccancel),hideMenu(menuid,"dialog")}),showMenu({mtype:"dialog",menuid:menuid,duration:3,pos:"00",zindex:JSMENU.zIndex.dialog,drag:"drag_"+menuid,cache:0,cover:cover})}function Alert(e,t,n,i,o){o||(o="alert"),showDialog(e,o,__lang.board_message,n,1,n,"",i||__lang.i_see,"",t)}function Confirm(e,t){showDialog(e,"confirm",__lang.confirm_message,t,1)}function showWindow(e,t,n,i,o,a){n=isUndefined(n)?"get":n,i=isUndefined(i)?1:i;var r="fwin_"+e,c=document.getElementById(r),s=null;if(disallowfloat&&-1!=disallowfloat.indexOf(e))return BROWSER.ie&&(t+=(-1!=t.indexOf("?")?"&":"?")+"referer="+escape(location.href)),location.href=t,void doane();var l=function(){"get"==n?(c.url=t,t+=(t.search(/\?/)>0?"&":"?")+"infloat=yes&handlekey="+e,t+=-1==i?"&t="+ +new Date:"",BROWSER.ie&&t.indexOf("referer=")<0&&(t=t+"&referer="+encodeURIComponent(location)),ajaxget(t,"fwin_content_"+e,null,"","",function(){d(),u()})):"post"==n&&(c.act=document.getElementById(t).action,ajaxpost(t,"fwin_content_"+e,"","","",function(){d(),u()})),6!=parseInt(BROWSER.ie)&&(s=setTimeout(function(){showDialog("","info",' '+__lang.please_wait)},500)),"html"==n&&(document.getElementById("fwin_content_"+e).innerHTML=t,d(),u())},d=function(){clearTimeout(s)},u=function(){hideMenu("fwin_dialog","dialog"),jQuery(c).modal("show")};if(c)"get"==n&&(t!=c.url||1!=i)||"post"==n&&document.getElementById(t).action!=c.act||"html"==n&&1!=i?l():u();else{var m='';(c=document.createElement("div")).id=r,c.className=" modal ",a&&(c.setAttribute("data-bs-backdrop","static"),c.setAttribute("data-bs-keyboard","false")),c.style.display="none",document.body.appendChild(c),c.innerHTML=m,"html"==n?(document.getElementById("fwin_content_"+e).innerHTML=t,d(),u()):l()}"function"==typeof o&&(window.showWindow_callback=o),doane()}var messageTimer=null;function showmessage(e,t,n,i,o,a,r,c,s){var l;if(c||(c=300),r||(r=300),s||(s=300),document.getElementById("message_tip_box"))l=jQuery("#message_tip_box");else{l=jQuery('
').appendTo(document.body)}var d=jQuery("#message_tip_alert");l.attr("sytle","").attr("class","toast fade show message_tip_box"),l.css({height:"auto","max-height":c,width:r,margin:"0,auto",overflow:"hidden"}),"error"==t&&(t="danger");if(jQuery.inArray(t,["danger","info","success","warning"])<0&&(t="info"),t){if(jQuery("#message_tip_alert").attr("class","alert alert-"+t),"info"==t)var u='';else if("success"==t)u='';else if("danger"==t)u='';else if("warning"==t)u=''}else jQuery("#message_tip_alert").attr("class","alert alert-warning");if("success"==t)var m="成功";else if("danger"==t)m="错误";else if("warning"==t)m="警告";else m="信息";e=i?'
'+u+''+m+'
'+e+"
":'
'+u+''+m+'
'+e+"
",jQuery("#message_tip_alert").html(e);var f=l.outerWidth(!0),p=l.outerHeight(!0);switch(messageTimer&&window.clearTimeout(messageTimer),o){case"left-top":l.css({right:"auto",top:0,left:-f,bottom:"auto"}).animate({left:0},s),n&&(messageTimer=window.setTimeout(function(){l.animate({left:-f},s,function(){l.remove()}),"function"==typeof a&&a()},n)),d.find("button.close").off("click").on("click",function(){l.animate({left:-f},s,function(){l.remove()}),"function"==typeof a&&a()});break;case"right-top":l.css({right:-f,top:0,left:"auto",bottom:"auto"}).animate({right:0},s),n&&(messageTimer=window.setTimeout(function(){l.animate({right:-f},s,function(){l.remove()}),"function"==typeof a&&a()},n)),d.find("button.close").off("click").on("click",function(){l.animate({right:-f},s,function(){l.remove()}),"function"==typeof a&&a()});break;case"right-bottom":l.css({right:-f,top:"auto",left:"auto",bottom:0}).animate({right:0},s),n&&(messageTimer=window.setTimeout(function(){l.animate({right:-f},s,function(){l.remove()}),"function"==typeof a&&a()},n)),d.find("button.close").off("click").on("click",function(){l.animate({left:-f},s,function(){l.remove()}),"function"==typeof a&&a()});break;case"left-bottom":l.css({right:"auto",top:"auto",left:-f,bottom:0}).animate({left:0},s),n&&(messageTimer=window.setTimeout(function(){l.animate({left:-f},s,function(){l.remove()}),"function"==typeof a&&a()},n)),d.find("button.close").off("click").on("click",function(){l.animate({left:-f},s,function(){l.remove()}),"function"==typeof a&&a()});break;case"center":var g=f/2,h=p/2;l.css({left:"50%",top:"50%",right:"auto",bottom:"auto","margin-left":-g,"margin-top":-h,opacity:0}).animate({opacity:1},s),n&&(messageTimer=window.setTimeout(function(){l.animate({opacity:0},s,function(){l.remove()}),"function"==typeof a&&a()},n)),d.find("button.close").off("click").on("click",function(){l.animate({opacity:0},s,function(){l.remove()}),"function"==typeof a&&a()});break;default:l.css({left:"50%",marginLeft:-f/2,top:-p,right:"auto",bottom:"auto"}).animate({top:0},s),n&&(messageTimer=window.setTimeout(function(){l.animate({top:-p},s,function(){l.remove()}),"function"==typeof a&&a()},n)),d.find("button.close").off("click").on("click",function(){l.animate({top:-p},s,function(){l.remove()}),"function"==typeof a&&a()})}n||"function"!=typeof a||a()}var jcLoader=function(){var e=document;return{load:function(t,n){var i="",o="",a="",r=n;switch(t.type&&(i=t.type),t.url&&(o=t.url),t.ids&&(a=t.ids),i){case"js":case"javascript":!function(t,n,i){for(var o=t.replace(/[,]\s*$/gi,"").split(","),a=n.replace(/[,]\s*$/gi,"").split(","),r=[],c=0,s=0;s=o.length&&"function"==typeof i&&i():(r[s]=e.createElement("script"),r[s].type="text/javascript",r[s].src=o[s],a[s]&&(r[s].id=a[s]),e.getElementsByTagName("head")[0].appendChild(r[s]),"function"==typeof i&&(r[s].readyState?r[s].onreadystatechange=function(){"loaded"!=this.readyState&&"complete"!=this.readyState||(this.onreadystatechange=null,++c>=o.length&&"function"==typeof i&&i())}:r[s].onload=function(){++c>=o.length&&"function"==typeof i&&i()}))}(o,a,r);break;case"css":!function(t,n,i){for(var o=t.replace(/[,]\s*$/gi,"").split(","),a=n.replace(/[,]\s*$/gi,"").split(","),r=[],c=0,s=0;s=o.length&&"function"==typeof i&&i():(r[s]=e.createElement("link"),a[s]&&(r[s].id=a[s]),r[s].rel="stylesheet",r[s].href=o[s],e.getElementsByTagName("head")[0].appendChild(r[s]),"function"==typeof i&&(r[s].readyState?r[s].onreadystatechange=function(){"loaded"!=this.readyState&&"complete"!=this.readyState||(this.onreadystatechange=null,++c>=o.length&&"function"==typeof i&&i())}:r[s].onload=function(){++c>=o.length&&"function"==typeof i&&i()}))}(o,a,r)}return this}}};function checkeURL(e){var t=e;if("about:blank"==t)return!0;return 1==new RegExp(/[a-zA-z]+:\/\/[^\s]*/).test(t)}function parseURL(e){var t=document.createElement("a");return t.href=e,{source:e,protocol:t.protocol.replace(":",""),host:t.hostname,port:t.port,query:t.search,params:function(){for(var e,n={},i=t.search.replace(/^\?/,"").split("&"),o=i.length,a=0;a12&&r<24?r="下午 "+l(r-=12):24==r&&(r="下午 00")),e.innerHTML=n+__lang.year+i+__lang.month+o+__lang.day+" "+a+" "+r+":"+c+":"+s,setTimeout(arguments.callee,1e3)}()}function serialize(e){var t,n=function(e){var t,n,i=typeof e;if("object"===i&&!e)return"null";if("object"===i){if(!e.constructor)return"object";var o=e.constructor.toString();(t=o.match(/(\w+)\(/))&&(o=t[1].toLowerCase());var a=["boolean","number","string","array"];for(n in a)if(o==a[n]){i=a[n];break}}return i},i=n(e);switch(i){case"function":t="";break;case"boolean":t="b:"+(e?"1":"0");break;case"number":t=(Math.round(e)==e?"i":"d")+":"+e;break;case"string":t="s:"+function(e){var t=0,n=0,i=e.length,o="";for(n=0;n/g,">");var a={ENT_NOQUOTES:0,ENT_HTML_QUOTE_SINGLE:1,ENT_HTML_QUOTE_DOUBLE:2,ENT_COMPAT:2,ENT_QUOTES:3,ENT_IGNORE:4};if(0===t&&(o=!0),"number"!=typeof t){for(t=[].concat(t),i=0;i'; + } + return str + '>' + this.innerHTML + ''; + }); + + HTMLElement.prototype.__defineGetter__('canHaveChildren', function() { + switch(this.tagName.toLowerCase()) { + case 'area':case 'base':case 'basefont':case 'col':case 'frame':case 'hr':case 'img':case 'br':case 'input':case 'isindex':case 'link':case 'meta':case 'param': + return false; + } + return true; + }); +} +jQuery('.js-popbox').each(function(){ + if(jQuery(this).hasClass('disabled')) return; + jQuery(this).popbox(); + jQuery("[data-bs-toggle='tooltip']").tooltip(); +}); +//判断当前窗口是否激活,当窗口激活时不使用桌面通知 +var CurrentActive; +if ("onfocusin" in document){//for IE + document.onfocusin = function() { + CurrentActive = true; + + }; + document.onfocusout = function() { + CurrentActive = false; + }; +} else { + window.onfocus = function() { + CurrentActive = true; + } + window.onblur = function() { + CurrentActive = false; + } +} +function $C(classname, ele, tag) { + var returns = []; + ele = ele || document; + tag = tag || '*'; + if(ele.getElementsByClassName) { + var eles = ele.getElementsByClassName(classname); + if(tag != '*') { + for (var i = 0, L = eles.length; i < L; i++) { + if (eles[i].tagName.toLowerCase() == tag.toLowerCase()) { + returns.push(eles[i]); + } + } + } else { + returns = eles; + } + }else { + eles = ele.getElementsByTagName(tag); + var pattern = new RegExp("(^|\\s)"+classname+"(\\s|$)"); + for (i = 0, L = eles.length; i < L; i++) { + if (pattern.test(eles[i].className)) { + returns.push(eles[i]); + } + } + } + return returns; +} + +function _attachEvent(obj, evt, func, eventobj) { + eventobj = !eventobj ? obj : eventobj; + if(obj.addEventListener) { + obj.addEventListener(evt, func, false); + } else if(eventobj.attachEvent) { + obj.attachEvent('on' + evt, func); + } +} + +function _detachEvent(obj, evt, func, eventobj) { + eventobj = !eventobj ? obj : eventobj; + if(obj.removeEventListener) { + obj.removeEventListener(evt, func, false); + } else if(eventobj.detachEvent) { + obj.detachEvent('on' + evt, func); + } +} + +function browserVersion(types) { + var other = 1; + for(i in types) { + var v = types[i] ? types[i] : i; + if(USERAGENT.indexOf(v) != -1) { + var re = new RegExp(v + '(\\/|\\s|:)([\\d\\.]+)', 'ig'); + var matches = re.exec(USERAGENT); + var ver = matches != null ? matches[2] : 0; + other = ver !== 0 && v != 'mozilla' ? 0 : other; + }else { + var ver = 0; + } + eval('BROWSER.' + i + '= ver'); + } + BROWSER.other = other; +} + +function getEvent() { + if(document.all) return window.event; + func = getEvent.caller; + while(func != null) { + var arg0 = func.arguments[0]; + if (arg0) { + if((arg0.constructor == Event || arg0.constructor == MouseEvent) || (typeof(arg0) == "object" && arg0.preventDefault && arg0.stopPropagation)) { + return arg0; + } + } + func=func.caller; + } + return null; +} + +function isUndefined(variable) { + return typeof variable == 'undefined' ? true : false; +} + +function in_array(needle, haystack) { + if(typeof needle == 'string' || typeof needle == 'number') { + for(var i in haystack) { + if(haystack[i] == needle) { + return true; + } + } + } + return false; +} +function formatSize(bytes){ + var i = -1; + do { + bytes = bytes / 1024; + i++; + } while (bytes > 99); + + return Math.max(bytes, 0).toFixed(1) + ['kB', 'MB', 'GB', 'TB', 'PB', 'EB'][i]; +}; + +function trim(str) { + return (str + '').replace(/(\s+)$/g, '').replace(/^\s+/g, ''); +} + +function strlen(str) { + return (BROWSER.ie && str.indexOf('\n') != -1) ? str.replace(/\r?\n/g, '_').length : str.length; +} + +function mb_strlen(str) { + var len = 0; + for(var i = 0; i < str.length; i++) { + len += str.charCodeAt(i) < 0 || str.charCodeAt(i) > 255 ? (charset == 'utf-8' ? 3 : 2) : 1; + } + return len; +} + +function mb_cutstr(str, maxlen, dot) { + var len = 0; + var ret = ''; + var dot = (dot != '' && !dot) ? '...' : dot; + + maxlen = maxlen - dot.length; + for(var i = 0; i < str.length; i++) { + len += str.charCodeAt(i) < 0 || str.charCodeAt(i) > 255 ? (charset == 'utf-8' ? 3 : 2) : 1; + if(len > maxlen) { + ret += dot; + break; + } + ret += str.substr(i, 1); + } + return ret; +} +function strip_tags (input, allowed) { + // http://kevin.vanzonneveld.net + // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + improved by: Luke Godfrey + // + input by: Pul + // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + bugfixed by: Onno Marsman + // + input by: Alex + // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + input by: Marc Palau + // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + input by: Brett Zamir (http://brett-zamir.me) + // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + bugfixed by: Eric Nagel + // + input by: Bobby Drake + // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + bugfixed by: Tomasz Wesolowski + // + input by: Evertjan Garretsen + // + revised by: Rafa? Kukawski (http://blog.kukawski.pl/) + // * example 1: strip_tags('

Kevin


van Zonneveld', ''); + // * returns 1: 'Kevin van Zonneveld' + // * example 2: strip_tags('

Kevin van Zonneveld

', '

'); + // * returns 2: '

Kevin van Zonneveld

' + // * example 3: strip_tags("Kevin van Zonneveld", ""); + // * returns 3: 'Kevin van Zonneveld' + // * example 4: strip_tags('1 < 5 5 > 1'); + // * returns 4: '1 < 5 5 > 1' + // * example 5: strip_tags('1
1'); + // * returns 5: '1 1' + // * example 6: strip_tags('1
1', '
'); + // * returns 6: '1 1' + // * example 7: strip_tags('1
1', '

'); + // * returns 7: '1
1' + allowed = (((allowed || "") + "").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join(''); // making sure the allowed arg is a string containing only tags in lowercase () + var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi, + commentsAndPhpTags = /|<\?(?:php)?[\s\S]*?\?>/gi; + return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) { + return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : ''; + }); +} + + +function preg_replace(search, replace, str, regswitch) { + var regswitch = !regswitch ? 'ig' : regswitch; + var len = search.length; + for(var i = 0; i < len; i++) { + re = new RegExp(search[i], regswitch); + str = str.replace(re, typeof replace == 'string' ? replace : (replace[i] ? replace[i] : replace[0])); + } + return str; +} + +function htmlspecialchars(str) { + return preg_replace(['&', '<', '>', '"'], ['&', '<', '>', '"'], str); +} + +function display(id) { + var obj = document.getElementById(id); + if(obj.style.visibility) { + obj.style.visibility = obj.style.visibility == 'visible' ? 'hidden' : 'visible'; + } else { + obj.style.display = obj.style.display == '' ? 'none' : ''; + } +} + +function checkall(form, prefix, checkall) { + var checkall = checkall ? checkall : 'chkall'; + count = 0; + for(var i = 0; i < form.elements.length; i++) { + var e = form.elements[i]; + if(e.name && e.name != checkall && !e.disabled && (!prefix || (prefix && e.name.match(prefix)))) { + e.checked = form.elements[checkall].checked; + if(e.checked) { + count++; + } + } + } + return count; +} + +function setcookie(cookieName, cookieValue, seconds, path, domain, secure) { + if(cookieValue == '' || seconds < 0) { + cookieValue = ''; + seconds = -2592000; + } + if(seconds) { + var expires = new Date(); + expires.setTime(expires.getTime() + seconds * 1000); + } + domain = !domain ? cookiedomain : domain; + path = !path ? cookiepath : path; + document.cookie = escape(cookiepre + cookieName) + '=' + escape(cookieValue) + + (expires ? '; expires=' + expires.toGMTString() : '') + + (path ? '; path=' + path : '/') + + (domain ? '; domain=' + domain : '') + + (secure ? '; secure' : ''); +} + +function getcookie(name, nounescape) { + name = cookiepre + name; + var cookie_start = document.cookie.indexOf(name); + var cookie_end = document.cookie.indexOf(";", cookie_start); + if(cookie_start == -1) { + return ''; + } else { + var v = document.cookie.substring(cookie_start + name.length + 1, (cookie_end > cookie_start ? cookie_end : document.cookie.length)); + return !nounescape ? unescape(v) : v; + } +} + +function Ajax(recvType, waitId) { + + var aj = new Object(); + + aj.loading = __lang.please_wait; + aj.recvType = recvType ? recvType : 'XML'; + aj.waitId = waitId ? document.getElementById(waitId) : null; + + aj.resultHandle = null; + aj.sendString = ''; + aj.targetUrl = ''; + + aj.setLoading = function(loading) { + if(typeof loading !== 'undefined' && loading !== null) aj.loading = loading; + }; + + aj.setRecvType = function(recvtype) { + aj.recvType = recvtype; + }; + + aj.setWaitId = function(waitid) { + aj.waitId = typeof waitid == 'object' ? waitid : document.getElementById(waitid); + }; + + aj.createXMLHttpRequest = function() { + var request = false; + if(window.XMLHttpRequest) { + request = new XMLHttpRequest(); + if(request.overrideMimeType) { + request.overrideMimeType('text/xml'); + } + } else if(window.ActiveXObject) { + var versions = ['Microsoft.XMLHTTP', 'MSXML.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.7.0', 'Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP']; + for(var i=0; i ' + aj.loading + ''; + } + }; + + aj.processHandle = function() { + if(aj.XMLHttpRequest.readyState == 4 && aj.XMLHttpRequest.status == 200) { + if(aj.waitId) { + aj.waitId.style.display = 'none'; + } + if(aj.recvType == 'HTML') { + aj.resultHandle(aj.XMLHttpRequest.responseText, aj); + } else if(aj.recvType == 'XML') { + if(!aj.XMLHttpRequest.responseXML || !aj.XMLHttpRequest.responseXML.lastChild || aj.XMLHttpRequest.responseXML.lastChild.localName == 'parsererror') { + aj.resultHandle(''+__lang.internal_error_unable_display_content+'' , aj); + } else { + aj.resultHandle(aj.XMLHttpRequest.responseXML.lastChild.firstChild.nodeValue, aj); + } + } else if(aj.recvType == 'JSON') { + var s = null; + try { + s = (new Function("return ("+aj.XMLHttpRequest.responseText+")"))(); + } catch (e) { + s = null; + } + aj.resultHandle(s, aj); + } + } + }; + + aj.get = function(targetUrl, resultHandle) { + targetUrl = hostconvert(targetUrl); + setTimeout(function(){aj.showLoading()}, 250); + aj.targetUrl = targetUrl; + aj.XMLHttpRequest.onreadystatechange = aj.processHandle; + aj.resultHandle = resultHandle; + var attackevasive = isUndefined(attackevasive) ? 0 : attackevasive; + if(window.XMLHttpRequest) { + aj.XMLHttpRequest.open('GET', aj.targetUrl); + aj.XMLHttpRequest.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + aj.XMLHttpRequest.send(null); + } else { + aj.XMLHttpRequest.open("GET", targetUrl, true); + aj.XMLHttpRequest.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + aj.XMLHttpRequest.send(); + } + }; + aj.post = function(targetUrl, sendString, resultHandle) { + targetUrl = hostconvert(targetUrl); + setTimeout(function(){aj.showLoading()}, 250); + aj.targetUrl = targetUrl; + aj.sendString = sendString; + aj.XMLHttpRequest.onreadystatechange = aj.processHandle; + aj.resultHandle = resultHandle; + aj.XMLHttpRequest.open('POST', targetUrl); + aj.XMLHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + aj.XMLHttpRequest.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + aj.XMLHttpRequest.send(aj.sendString); + }; + aj.getJSON = function(targetUrl, resultHandle) { + aj.setRecvType('JSON'); + aj.get(targetUrl+'&ajaxdata=json', resultHandle); + }; + aj.getHTML = function(targetUrl, resultHandle) { + aj.setRecvType('HTML'); + aj.get(targetUrl+'&ajaxdata=html', resultHandle); + }; + return aj; +} + +function getHost(url) { + var host = "null"; + if(typeof url == "undefined"|| null == url) { + url = window.location.href; + } + var regex = /^\w+\:\/\/([^\/]*).*/; + var match = url.match(regex); + if(typeof match != "undefined" && null != match) { + host = match[1]; + } + return host; +} + +function hostconvert(url) { + if(!url.match(/^https?:\/\//)) url = SITEURL + url; + var url_host = getHost(url); + var cur_host = getHost().toLowerCase(); + if(url_host && cur_host != url_host) { + url = url.replace(url_host, cur_host); + } + return url; +} + +function newfunction(func) { + var args = []; + for(var i=1; i]*?>([^\x00]*?)<\/script>/ig; + var arr = []; + while(arr = p.exec(s)) { + var p1 = /]*?src=\"([^\>]*?)\"[^\>]*?(reload=\"1\")?(?:charset=\"([\w\-]+?)\")?><\/script>/i; + var arr1 = []; + arr1 = p1.exec(arr[0]); + if(arr1) { + appendscript(arr1[1], '', arr1[2], arr1[3]); + } else { + p1 = /([^\x00]+?)<\/script>/i; + arr1 = p1.exec(arr[0]); + if(arr1) appendscript('', arr1[2], arr1[1].indexOf('reload=') != -1); + } + } + return s; +} + +var safescripts = {}, evalscripts = []; +function safescript(id, call, seconds, times, timeoutcall, endcall, index) { + seconds = seconds || 1000; + times = times || 0; + var checked = true; + try { + if(typeof call == 'function') { + call(); + } else { + eval(call); + } + } catch(e) { + checked = false; + } + if(!checked) { + if(!safescripts[id] || !index) { + safescripts[id] = safescripts[id] || []; + safescripts[id].push({ + 'times':0, + 'si':setInterval(function () { + safescript(id, call, seconds, times, timeoutcall, endcall, safescripts[id].length); + }, seconds) + }); + } else { + index = (index || 1) - 1; + safescripts[id][index]['times']++; + if(safescripts[id][index]['times'] >= times) { + clearInterval(safescripts[id][index]['si']); + if(typeof timeoutcall == 'function') { + timeoutcall(); + } else { + eval(timeoutcall); + } + } + } + } else { + try { + index = (index || 1) - 1; + if(safescripts[id][index]['si']) { + clearInterval(safescripts[id][index]['si']); + } + if(typeof endcall == 'function') { + endcall(); + } else { + eval(endcall); + } + } catch(e) {} + } +} + + +function appendscript(src, text, reload, charset) { + var id = dhash(src + text); + if(!reload && in_array(id, evalscripts)) return; + if(reload && document.getElementById(id)) { + document.getElementById(id).parentNode.removeChild(document.getElementById(id)); + } + + evalscripts.push(id); + var scriptNode = document.createElement("script"); + scriptNode.type = "text/javascript"; + scriptNode.setAttribute('ajaxappend','1'); + scriptNode.id = id; + scriptNode.charset = charset ? charset : (BROWSER.firefox ? document.characterSet : document.charset); + try { + if(src) { + scriptNode.src = src; + scriptNode.onloadDone = false; + scriptNode.onload = function () { + scriptNode.onloadDone = true; + JSLOADED[src] = 1; + }; + scriptNode.onreadystatechange = function () { + if((scriptNode.readyState == 'loaded' || scriptNode.readyState == 'complete') && !scriptNode.onloadDone) { + scriptNode.onloadDone = true; + JSLOADED[src] = 1; + } + }; + } else if(text){ + scriptNode.text = text; + } + document.getElementsByTagName('head')[0].appendChild(scriptNode); + } catch(e) {} +} + +function stripscript(s) { + return s.replace(/.*?<\/script>/ig, ''); +} + +function ajaxupdateevents(obj, tagName) { + tagName = tagName ? tagName : 'A'; + var objs = obj.getElementsByTagName(tagName); + for(k in objs) { + var o = objs[k]; + ajaxupdateevent(o); + } +} + +function ajaxupdateevent(o) { + if(typeof o == 'object' && o.getAttribute) { + if(o.getAttribute('ajaxtarget')) { + if(!o.id) o.id = Math.random(); + var ajaxevent = o.getAttribute('ajaxevent') ? o.getAttribute('ajaxevent') : 'click'; + var ajaxurl = o.getAttribute('ajaxurl') ? o.getAttribute('ajaxurl') : o.href; + _attachEvent(o, ajaxevent, newfunction('ajaxget', ajaxurl, o.getAttribute('ajaxtarget'), o.getAttribute('ajaxwaitid'), o.getAttribute('ajaxloading'), o.getAttribute('ajaxdisplay'))); + if(o.getAttribute('ajaxfunc')) { + o.getAttribute('ajaxfunc').match(/(\w+)\((.+?)\)/); + _attachEvent(o, ajaxevent, newfunction(RegExp.$1, RegExp.$2)); + } + } + } +} + +function ajaxget(url, showid, waitid, loading, display, recall) { + waitid = typeof waitid == 'undefined' || waitid === null ? showid : waitid; + var x = new Ajax(); + x.setLoading(loading); + x.setWaitId(waitid); + x.display = typeof display == 'undefined' || display == null ? '' : display; + x.showId = document.getElementById(showid); + + if(url.substr(strlen(url) - 1) == '#') { + url = url.substr(0, strlen(url) - 1); + x.autogoto = 1; + } + var url = url + '&inajax=1&ajaxtarget=' + showid; + if(url && url.indexOf('?')==-1){ + url=url.replace(/&/i,'?'); + } + x.get(url, function(s, x) { + var evaled = false; + if(s.indexOf('ajaxerror') != -1) { + evalscript(s); + evaled = true; + } + if(!evaled && (typeof ajaxerror == 'undefined' || !ajaxerror)) { + if(x.showId) { + x.showId.style.display = x.display; + ajaxinnerhtml(x.showId, s); + ajaxupdateevents(x.showId); + if(x.autogoto) scroll(0, x.showId.offsetTop); + } + } + + ajaxerror = null; + if(recall && typeof recall == 'function') { + recall(); + } else if(recall) { + eval(recall); + } + if(!evaled) evalscript(s); + }); +} + +function ajaxpost(formid, showid, waitid, showidclass, submitbtn, recall) { + var waitid = typeof waitid == 'undefined' || waitid === null ? showid : (waitid !== '' ? waitid : ''); + var showidclass = !showidclass ? '' : showidclass; + var ajaxframeid = 'ajaxframe'; + var ajaxframe = document.getElementById(ajaxframeid); + var curform = document.getElementById(formid); + var formtarget = curform.target; + var handleResult = function() { + var s = ''; + var evaled = false; + + showloading('none'); + try { + s = document.getElementById(ajaxframeid).contentWindow.document.XMLDocument.text; + } catch(e) { + try { + s = document.getElementById(ajaxframeid).contentWindow.document.documentElement.firstChild.wholeText; + } catch(e) { + try { + s = document.getElementById(ajaxframeid).contentWindow.document.documentElement.firstChild.nodeValue; + } catch(e) { + s = __lang.internal_error_unable_display_content; + } + } + } + + if(s != '' && s.indexOf('ajaxerror') != -1) { + evalscript(s); + evaled = true; + } + if(showidclass) { + if(showidclass != 'onerror') { + document.getElementById(showid).className = showidclass; + } else { + showError(s); + ajaxerror = true; + } + } + if(submitbtn) { + submitbtn.disabled = false; + } + if(!evaled && (typeof ajaxerror == 'undefined' || !ajaxerror)) { + ajaxinnerhtml(document.getElementById(showid), s); + } + ajaxerror = null; + if(curform) curform.target = formtarget; + if(typeof recall == 'function') { + recall(); + } else { + eval(recall); + } + if(!evaled) evalscript(s); + ajaxframe.loading = 0; + if(!BROWSER.firefox || BROWSER.safari) { + document.getElementById('append_parent').removeChild(ajaxframe.parentNode); + } else { + setTimeout( + function(){ + document.getElementById('append_parent').removeChild(ajaxframe.parentNode); + }, + 100 + ); + } + }; + if(!ajaxframe) { + var div = document.createElement('div'); + div.style.display = 'none'; + div.innerHTML = ''; + document.getElementById('append_parent').appendChild(div); + ajaxframe = document.getElementById(ajaxframeid); + } else if(ajaxframe.loading) { + return false; + } + + _attachEvent(ajaxframe, 'load', handleResult); + + showloading(); + curform.target = ajaxframeid; + var action = curform.getAttribute('action'); + action = hostconvert(action).replace(/(&|&|\?)inajax\=1/g, ''); + var s=(action.indexOf('?') != -1) ? '&' :'?'; + curform.action = action+s+'inajax=1'; + curform.submit(); + if(submitbtn) { + submitbtn.disabled = true; + } + doane(); + return false; +} + +function ajaxmenu(ctrlObj, timeout, cache, duration, pos, recall, idclass, contentclass) { + if(!ctrlObj.getAttribute('mid')) { + var ctrlid = ctrlObj.id; + if(!ctrlid) { + ctrlObj.id = 'ajaxid_' + Math.random(); + } + } else { + var ctrlid = ctrlObj.getAttribute('mid'); + if(!ctrlObj.id) { + ctrlObj.id = 'ajaxid_' + Math.random(); + } + } + var menuid = ctrlid + '_menu'; + var menu = document.getElementById(menuid); + if(isUndefined(timeout)) timeout = 3000; + if(isUndefined(cache)) cache = 1; + if(isUndefined(pos)) pos = '43'; + if(isUndefined(duration)) duration = timeout > 0 ? 0 : 3; + if(isUndefined(idclass)) idclass = 'p_pop'; + if(isUndefined(contentclass)) contentclass = 'p_opt'; + var func = function() { + showMenu({'ctrlid':ctrlObj.id,'menuid':menuid,'duration':duration,'timeout':timeout,'pos':pos,'cache':cache,'layer':2}); + if(typeof recall == 'function') { + recall(); + } else { + eval(recall); + } + }; + + if(menu) { + if(menu.style.display == '') { + hideMenu(menuid); + } else { + func(); + } + } else { + menu = document.createElement('div'); + menu.id = menuid; + menu.style.display = 'none'; + menu.className = idclass; + menu.innerHTML = ''; + document.getElementById('append_parent').appendChild(menu); + var url = (!isUndefined(ctrlObj.attributes['shref']) ? ctrlObj.attributes['shref'].value : (!isUndefined(ctrlObj.href) ? ctrlObj.href : ctrlObj.attributes['href'].value)); + url += (url.indexOf('?') != -1 ? '&' :'?') + 'ajaxmenu=1'; + ajaxget(url, menuid + '_content', 'ajaxwaitid', '', '', func); + } + doane(); +} + +function dhash(string, length) { + var length = length ? length : 32; + var start = 0; + var i = 0; + var result = ''; + filllen = length - string.length % length; + for(i = 0; i < filllen; i++){ + string += "0"; + } + while(start < string.length) { + result = stringxor(result, string.substr(start, length)); + start += length; + } + return result; +} + +function stringxor(s1, s2) { + var s = ''; + var hash = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + var max = Math.max(s1.length, s2.length); + for(var i=0; i'+s+''; + document.getElementById('append_parent').appendChild(div1); + var trs = div1.getElementsByTagName('TR'); + var l = trs.length; + for(var i=0; i 1) { + menuObj.onmouseover = function() { + clearTimeout(JSMENU['timer'][menuid]); + JSMENU['timer'][menuid] = null; + }; + } + if(duration != 1) { + menuObj.onmouseout = function() { + JSMENU['timer'][menuid] = setTimeout(function () { + hideMenu(menuid, mtype); + }, timeout); + }; + } + } + if(cover) { + var coverObj = document.createElement('div'); + coverObj.id = menuid + '_cover'; + coverObj.style.position = 'absolute'; + coverObj.style.zIndex = menuObj.style.zIndex - 1; + coverObj.style.left = coverObj.style.top = '0px'; + coverObj.style.width = '100%'; + coverObj.style.height = Math.max(document.documentElement.clientHeight, document.body.offsetHeight) + 'px'; + coverObj.style.backgroundColor = '#000'; + coverObj.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=50)'; + coverObj.style.opacity = 0.5; + coverObj.onclick = function () {hideMenu();}; + document.getElementById('append_parent').appendChild(coverObj); + _attachEvent(window, 'load', function () { + coverObj.style.height = Math.max(document.documentElement.clientHeight, document.body.offsetHeight) + 'px'; + }, document); + } + } + if(drag) { + dragobj.style.cursor = 'move'; + dragobj.onmousedown = function(event) {try{dragMenu(menuObj, event, 1);}catch(e){}}; + } + + if(cover) document.getElementById(menuid + '_cover').style.display = ''; + if(fade) { + var O = 0; + var fadeIn = function(O) { + if(O > 100) { + clearTimeout(fadeInTimer); + return; + } + menuObj.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + O + ')'; + menuObj.style.opacity = O / 100; + O += 20; + var fadeInTimer = setTimeout(function () { + fadeIn(O); + }, 40); + }; + fadeIn(O); + menuObj.fade = true; + } else { + menuObj.fade = false; + } + menuObj.style.display = ''; + if(ctrlObj && ctrlclass) { + ctrlObj.className += ' ' + ctrlclass; + menuObj.setAttribute('ctrlid', ctrlid); + menuObj.setAttribute('ctrlclass', ctrlclass); + } + if(pos != '*') { + setMenuPosition(showid, menuid, pos); + } + if(BROWSER.ie && BROWSER.ie < 7 && winhandlekey && document.getElementById('fwin_' + winhandlekey)) { + document.getElementById(menuid).style.left = (parseInt(document.getElementById(menuid).style.left) - parseInt(document.getElementById('fwin_' + winhandlekey).style.left)) + 'px'; + document.getElementById(menuid).style.top = (parseInt(document.getElementById(menuid).style.top) - parseInt(document.getElementById('fwin_' + winhandlekey).style.top)) + 'px'; + } + if(maxh && menuObj.scrollHeight > maxh) { + menuObj.style.height = maxh + 'px'; + if(BROWSER.opera) { + menuObj.style.overflow = 'auto'; + } else { + menuObj.style.overflowY = 'auto'; + } + } + + if(!duration) { + setTimeout('hideMenu(\'' + menuid + '\', \'' + mtype + '\')', timeout); + } + + if(!in_array(menuid, JSMENU['active'][layer])) JSMENU['active'][layer].push(menuid); + menuObj.cache = cache; + if(layer > JSMENU['layer']) { + JSMENU['layer'] = layer; + } + var hasshow = function(ele) { + while(ele.parentNode && ((typeof(ele['currentStyle']) === 'undefined') ? window.getComputedStyle(ele,null) : ele['currentStyle'])['display'] !== 'none') { + ele = ele.parentNode; + } + if(ele === document) { + return true; + } else { + return false; + } + }; + if(!menuObj.getAttribute('disautofocus')) { + try{ + var focused = false; + var tags = ['input', 'select', 'textarea', 'button', 'a']; + for(var i = 0; i < tags.length; i++) { + var _all = menuObj.getElementsByTagName(tags[i]); + if(_all.length) { + for(j = 0; j < _all.length; j++) { + if((!_all[j]['type'] || _all[j]['type'] != 'hidden') && hasshow(_all[j])) { + if(_all[j].className.indexOf('hidefocus') == -1) { + _all[j].className += ' hidefocus'; + } + _all[j].focus(); + focused = true; + var cobj = _all[j]; + _attachEvent(_all[j], 'blur', function (){cobj.className = trim(cobj.className.replace(' hidefocus', ''));}); + break; + } + } + } + if(focused) { + break; + } + } + } catch (e) { + } + } +} +var delayShowST = null; +function delayShow(ctrlObj, call, time) { + if(typeof ctrlObj == 'object') { + var ctrlid = ctrlObj.id; + call = call || function () {showMenu(ctrlid);}; + } + var time = isUndefined(time) ? 500 : time; + delayShowST = setTimeout(function () { + if(typeof call == 'function') { + call(); + } else { + eval(call); + } + }, time); + if(!ctrlObj.delayinit) { + _attachEvent(ctrlObj, 'mouseout', function() {clearTimeout(delayShowST);}); + ctrlObj.delayinit = 1; + } +} + +var dragMenuDisabled = false; +function dragMenu(menuObj, e, op) { + e = e ? e : window.event; + if(op == 1) { + if(dragMenuDisabled || in_array(e.target ? e.target.tagName : e.srcElement.tagName, ['TEXTAREA', 'INPUT', 'BUTTON', 'SELECT'])) { + return; + } + JSMENU['drag'] = [e.clientX, e.clientY]; + JSMENU['drag'][2] = parseInt(menuObj.style.left); + JSMENU['drag'][3] = parseInt(menuObj.style.top); + document.onmousemove = function(e) {try{dragMenu(menuObj, e, 2);}catch(err){}}; + document.onmouseup = function(e) {try{dragMenu(menuObj, e, 3);}catch(err){}}; + doane(e); + }else if(op == 2 && JSMENU['drag'][0]) { + var menudragnow = [e.clientX, e.clientY]; + menuObj.style.left = (JSMENU['drag'][2] + menudragnow[0] - JSMENU['drag'][0]) + 'px'; + menuObj.style.top = (JSMENU['drag'][3] + menudragnow[1] - JSMENU['drag'][1]) + 'px'; + menuObj.removeAttribute('top_');menuObj.removeAttribute('left_'); + doane(e); + }else if(op == 3) { + JSMENU['drag'] = []; + document.onmousemove = null; + document.onmouseup = null; + } +} +function setMenuPosition(showid, menuid, pos) { + var showObj = document.getElementById(showid); + var menuObj = menuid ? document.getElementById(menuid) : document.getElementById(showid + '_menu'); + if(isUndefined(pos) || !pos) pos = '43'; + var basePoint = parseInt(pos.substr(0, 1)); + var direction = parseInt(pos.substr(1, 1)); + var important = pos.indexOf('!') != -1 ? 1 : 0; + var sxy = 0, sx = 0, sy = 0, sw = 0, sh = 0, ml = 0, mt = 0, mw = 0, mcw = 0, mh = 0, mch = 0, bpl = 0, bpt = 0; + + if(!menuObj || (basePoint > 0 && !showObj)) return; + if(showObj) { + sxy = jQuery(showObj).offset(); + sx = sxy['left']; + sy = sxy['top']; + sw = jQuery(showObj).outerWidth(true); + sh =jQuery(showObj).outerHeight(true); + } + mw = menuObj.offsetWidth; + mcw = menuObj.clientWidth; + mh = menuObj.offsetHeight; + mch = menuObj.clientHeight; + + switch(basePoint) { + case 1: + bpl = sx; + bpt = sy; + break; + case 2: + bpl = sx + sw; + bpt = sy; + break; + case 3: + bpl = sx + sw; + bpt = sy + sh; + break; + case 4: + bpl = sx; + bpt = sy + sh; + break; + } + switch(direction) { + case 0: + menuObj.style.left = (document.body.clientWidth - menuObj.clientWidth) / 2 + 'px'; + mt = (document.documentElement.clientHeight - menuObj.clientHeight) / 2; + break; + case 1: + ml = bpl - mw; + mt = bpt - mh; + break; + case 2: + ml = bpl; + mt = bpt - mh; + break; + case 3: + ml = bpl; + mt = bpt; + break; + case 4: + ml = bpl - mw; + mt = bpt; + break; + } + var scrollTop =0;// Math.max(document.documentElement.scrollTop, document.body.scrollTop); + var scrollLeft =0;// Math.max(document.documentElement.scrollLeft, document.body.scrollLeft); + if(!important) { + if(in_array(direction, [1, 4]) && ml < 0) { + ml = bpl; + if(in_array(basePoint, [1, 4])) ml += sw; + } else if(ml + mw > scrollLeft + document.body.clientWidth && sx >= mw) { + ml = bpl - mw; + if(in_array(basePoint, [2, 3])) { + ml -= sw; + } else if(basePoint == 4) { + ml += sw; + } + } + if(in_array(direction, [1, 2]) && mt < 0) { + mt = bpt; + if(in_array(basePoint, [1, 2])) mt += sh; + } else if(mt + mh > scrollTop + document.documentElement.clientHeight && sy >= mh) { + mt = bpt - mh; + if(in_array(basePoint, [3, 4])) mt -= sh; + } + } + if(pos.substr(0, 3) == '210') { + ml += 69 - sw / 2; + mt -= 5; + if(showObj.tagName == 'TEXTAREA') { + ml -= sw / 2; + mt += sh / 2; + } + } + if(direction == 0 || menuObj.scrolly) { + if(BROWSER.ie && BROWSER.ie < 7) { + if(direction == 0) mt += scrollTop; + } else { + if(menuObj.scrolly) mt -= scrollTop; + menuObj.style.position = 'fixed'; + } + } + + if(document.body.clientWidth>0 && ml>0 && (ml+mw>document.body.clientWidth)){ + ml=(document.body.clientWidth-mw-10)>0?(document.body.clientWidth-mw-10):0; + } + if(ml) menuObj.style.left = ml + 'px'; + if(mt) menuObj.style.top = mt + 'px'; + if(direction == 0 && BROWSER.ie && !document.documentElement.clientHeight) { + menuObj.style.position = 'absolute'; + menuObj.style.top = (document.body.clientHeight - menuObj.clientHeight) / 2 + 'px'; + } + if(menuObj.style.clip && !BROWSER.opera) { + menuObj.style.clip = 'rect(auto, auto, auto, auto)'; + } +} + +function hideMenu(attr, mtype) { + attr = isUndefined(attr) ? '' : attr; + mtype = isUndefined(mtype) ? 'menu' : mtype; + + + if(attr == '') { + for(var i = 1; i <= JSMENU['layer']; i++) { + hideMenu(i, mtype); + } + return; + } else if(typeof attr == 'number') { + for(var j in JSMENU['active'][attr]) { + hideMenu(JSMENU['active'][attr][j], mtype); + } + return; + }else if(typeof attr == 'string') { + var menuObj = document.getElementById(attr); + if(!menuObj || (mtype && menuObj.mtype != mtype)) return; + + var ctrlObj = '', ctrlclass = ''; + if((ctrlObj = document.getElementById(menuObj.getAttribute('ctrlid'))) && (ctrlclass = menuObj.getAttribute('ctrlclass'))) { + var reg = new RegExp(' ' + ctrlclass); + ctrlObj.className = ctrlObj.className.replace(reg, ''); + } + clearTimeout(JSMENU['timer'][attr]); + var hide = function() { + if(menuObj.cache) { + if(menuObj.style.visibility != 'hidden') { + menuObj.style.display = 'none'; + if(menuObj.cover) document.getElementById(attr + '_cover').style.display = 'none'; + } + }else { + menuObj.parentNode.removeChild(menuObj); + if(menuObj.cover) document.getElementById(attr + '_cover').parentNode.removeChild(document.getElementById(attr + '_cover')); + } + var tmp = []; + for(var k in JSMENU['active'][menuObj.layer]) { + if(attr != JSMENU['active'][menuObj.layer][k]) tmp.push(JSMENU['active'][menuObj.layer][k]); + } + JSMENU['active'][menuObj.layer] = tmp; + }; + if(menuObj.fade) { + var O = 100; + var fadeOut = function(O) { + if(O == 0) { + clearTimeout(fadeOutTimer); + hide(); + return; + } + menuObj.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + O + ')'; + menuObj.style.opacity = O / 100; + O -= 20; + var fadeOutTimer = setTimeout(function () { + fadeOut(O); + }, 40); + }; + fadeOut(O); + } else { + hide(); + } + } + +} + +function getCurrentStyle(obj, cssproperty, csspropertyNS) { + if(obj.style[cssproperty]){ + return obj.style[cssproperty]; + } + if (obj.currentStyle) { + return obj.currentStyle[cssproperty]; + } else if (document.defaultView.getComputedStyle(obj, null)) { + var currentStyle = document.defaultView.getComputedStyle(obj, null); + var value = currentStyle.getPropertyValue(csspropertyNS); + if(!value){ + value = currentStyle[cssproperty]; + } + return value; + } else if (window.getComputedStyle) { + var currentStyle = window.getComputedStyle(obj, ""); + return currentStyle.getPropertyValue(csspropertyNS); + } +} + +function fetchOffset(obj, mode) { + var left_offset = 0, top_offset = 0, mode = !mode ? 0 : mode; + + if(obj.getBoundingClientRect && !mode) { + var rect = obj.getBoundingClientRect(); + var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop); + var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft); + if(document.documentElement.dir == 'rtl') { + scrollLeft = scrollLeft + document.documentElement.clientWidth - document.documentElement.scrollWidth; + } + left_offset = rect.left + scrollLeft - document.documentElement.clientLeft; + top_offset = rect.top + scrollTop - document.documentElement.clientTop; + } + if(left_offset <= 0 || top_offset <= 0) { + left_offset = obj.offsetLeft; + top_offset = obj.offsetTop; + while((obj = obj.offsetParent) != null) { + position = getCurrentStyle(obj, 'position', 'position'); + if(position == 'relative') { + continue; + } + left_offset += obj.offsetLeft; + top_offset += obj.offsetTop; + } + } + return {'left' : left_offset, 'top' : top_offset}; +} + +function showError(msg) { + var p = /]*?>([^\x00]*?)<\/script>/ig; + msg = msg.replace(p, ''); + if(msg !== '') { + showDialog(msg, 'alert', __lang.db_error_message, null, true, null, '', '', '', 3); + } +} + +function hideWindow(k, all, clear) { + all = isUndefined(all) ? 1 : all; + clear = isUndefined(clear) ? 1 : clear; + jQuery('#fwin_' + k).modal('hide').remove(); + /*hideMenu('fwin_' + k, 'win'); + if(clear && document.getElementById('fwin_' + k)) { + document.getElementById('append_parent').removeChild(document.getElementById('fwin_' + k)); + }*/ + if(all) { + jQuery('.modal.fwinmask').modal('hide').remove(); + } +} + +function AC_FL_RunContent() { + var str = ''; + var ret = AC_GetArgs(arguments, "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000", "application/x-shockwave-flash"); + if(BROWSER.ie && !BROWSER.opera) { + str += ' '; + } + str += ''; + } else { + str += '' + defaultopt + ''; + + menuObj.id = selectId + '_ctrl_menu'; + menuObj.className = 'sltm'; + menuObj.style.display = 'none'; + menuObj.style.width = selectwidth; + menuObj.appendChild(ul); + document.getElementById('append_parent').appendChild(menuObj); + + document.getElementById(selectId + '_ctrl').onclick = function(e) { + document.getElementById(selectId + '_ctrl_menu').style.width = selectwidth; + showMenu({'ctrlid':(selectId == 'loginfield' ? 'account' : selectId + '_ctrl'),'menuid':selectId + '_ctrl_menu','evt':'click','pos':'43'}); + doane(e); + }; + document.getElementById(selectId + '_ctrl').onfocus = menuObj.onfocus = function() { + _attachEvent(document.body, 'keydown', handleKeyDown); + }; + document.getElementById(selectId + '_ctrl').onblur = menuObj.onblur = function() { + _detachEvent(document.body, 'keydown', handleKeyDown); + }; + document.getElementById(selectId + '_ctrl').onkeyup = function(e) { + e = e ? e : window.event; + value = e.keyCode; + if(value == 40 || value == 38) { + if(menuObj.style.display == 'none') { + document.getElementById(selectId + '_ctrl').onclick(); + } else { + lis = menuObj.getElementsByTagName('li'); + selecti = selectObj.getAttribute('selecti'); + lis[selecti].className = ''; + if(value == 40) { + selecti = parseInt(selecti) + 1; + } else if(value == 38) { + selecti = parseInt(selecti) - 1; + } + if(selecti < 0) { + selecti = lis.length - 1 + } else if(selecti > lis.length - 1) { + selecti = 0; + } + lis[selecti].className = 'current'; + selectObj.setAttribute('selecti', selecti); + lis[selecti].parentNode.scrollTop = lis[selecti].offsetTop; + } + } else if(value == 13) { + var lis = menuObj.getElementsByTagName('li'); + lis[selectObj.getAttribute('selecti')].onclick(); + } else if(value == 27) { + hideMenu(menuObj.id); + } + }; +} + +function ctrlEnter(event, btnId, onlyEnter) { + if(isUndefined(onlyEnter)) onlyEnter = 0; + if((event.ctrlKey || onlyEnter) && event.keyCode == 13) { + document.getElementById(btnId).click(); + return false; + } + return true; +} + +function updatestring(str1, str2, clear) { + str2 = '_' + str2 + '_'; + return clear ? str1.replace(str2, '') : (str1.indexOf(str2) == -1 ? str1 + str2 : str1); +} + +function getClipboardData() { + window.document.clipboardswf.SetVariable('str', CLIPBOARDSWFDATA); +} +function setCopy(text, msg){ + if(BROWSER.ie) { + var r = clipboardData.setData('Text', text); + if(r) { + if(msg) { + showPrompt(null, null, '' + msg + '', 1500); + } + } else { + showDialog('
'+__lang.copy_unsuccess_allow_access+'
', 'alert'); + } + } else { + var msg = '
'+__lang.click_here_copy_clipboard+'
' + + AC_FL_RunContent('id', 'clipboardswf', 'name', 'clipboardswf', 'devicefont', 'false', 'width', '200', 'height', '40', 'src', STATICURL + 'image/common/clipboard.swf', 'menu', 'false', 'allowScriptAccess', 'sameDomain', 'swLiveConnect', 'true', 'wmode', 'transparent', 'style' , 'margin-top:-20px'); + showDialog(msg, 'message'); + text = text.replace(/[\xA0]/g, ' '); + CLIPBOARDSWFDATA = text; + } +} + +var secST = new Array(); + +function strLenCalc(obj, checklen, maxlen) { + var v = obj.value, charlen = 0, maxlen = !maxlen ? 200 : maxlen, curlen = maxlen, len = strlen(v); + for(var i = 0; i < v.length; i++) { + if(v.charCodeAt(i) < 0 || v.charCodeAt(i) > 255) { + curlen -= charset == 'utf-8' ? 2 : 1; + } + } + if(curlen >= len) { + document.getElementById(checklen).innerHTML = curlen - len; + } else { + obj.value = mb_cutstr(v, maxlen, 0); + } +} + +if(BROWSER.ie && BROWSER.ie<11) { + try{document.documentElement.addBehavior("#default#userdata");}catch(e){} +} + +function updateseccode(idhash, play) { + if(isUndefined(play)) { + if(document.getElementById('seccode_' + idhash)) { + document.getElementById('seccodeverify_' + idhash).value = ''; + if(secST['code_' + idhash]) { + clearTimeout(secST['code_' + idhash]); + } + document.getElementById('checkseccodeverify_' + idhash).innerHTML = ''; + ajaxget('misc.php?mod=seccode&action=update&idhash=' + idhash, 'seccode_' + idhash, null, '', '', function() { + secST['code_' + idhash] = setTimeout(function() {document.getElementById('seccode_' + idhash).innerHTML = ''+__lang.refresh_verification_code+'';}, 180000); + }); + } + } else { + eval('window.document.seccodeplayer_' + idhash + '.SetVariable("isPlay", "1")'); + } +} + +function checksec(type, idhash, showmsg, recall) { + var showmsg = !showmsg ? 0 : showmsg; + var secverify = document.getElementById('sec' + type + 'verify_' + idhash).value; + if(!secverify) { + return; + } + var x = new Ajax('XML', 'checksec' + type + 'verify_' + idhash); + x.loading = ''; + document.getElementById('checksec' + type + 'verify_' + idhash).innerHTML = ''; + x.get('misc.php?mod=sec' + type + '&action=check&inajax=1&&idhash=' + idhash + '&secverify=' + (BROWSER.ie && document.charset == 'utf-8' ? encodeURIComponent(secverify) : secverify), function(s){ + var obj = document.getElementById('checksec' + type + 'verify_' + idhash); + if(obj){ + obj.style.display = ''; + if(s.substr(0, 7) == 'succeed') { + obj.innerHTML = ''; + jQuery(obj).closest('.seccode-wrapper').find('.help-msg').addClass('chk_right'); + if(showmsg) { + recall(1); + } + } else { + jQuery(obj).closest('.seccode-wrapper').find('.help-msg').removeClass('chk_right'); + obj.innerHTML = ''; + if(showmsg) { + if(type == 'code') { + showError(__lang.verification_error_reset); + } + recall(0); + } + } + } + }); +} + + +function showdistrict(container, elems, totallevel, changelevel, containertype) { + var getdid = function(elem) { + var op = elem.options[elem.selectedIndex]; + return op['did'] || op.getAttribute('did') || '0'; + }; + var pid = changelevel >= 1 && elems[0] && document.getElementById(elems[0]) ? getdid(document.getElementById(elems[0])) : 0; + var cid = changelevel >= 2 && elems[1] && document.getElementById(elems[1]) ? getdid(document.getElementById(elems[1])) : 0; + var did = changelevel >= 3 && elems[2] && document.getElementById(elems[2]) ? getdid(document.getElementById(elems[2])) : 0; + var coid = changelevel >= 4 && elems[3] && document.getElementById(elems[3]) ? getdid(document.getElementById(elems[3])) : 0; + var url = "user.php?mod=ajax&action=district&container="+container+"&containertype="+containertype + +"&province="+elems[0]+"&city="+elems[1]+"&district="+elems[2]+"&community="+elems[3] + +"&pid="+pid + "&cid="+cid+"&did="+did+"&coid="+coid+'&level='+totallevel+'&handlekey='+container+'&inajax=1'+(!changelevel ? '&showdefault=1' : ''); + ajaxget(url, container, ''); +} + +function showbirthday(){ + var el = document.getElementById('birthday'); + var birthday = el.value; + el.length=0; + el.options.add(new Option(__lang.day, '')); + for(var i=0;i<28;i++){ + el.options.add(new Option(i+1, i+1)); + } + if(document.getElementById('birthmonth').value!="2"){ + el.options.add(new Option(29, 29)); + el.options.add(new Option(30, 30)); + switch(document.getElementById('birthmonth').value){ + case "1": + case "3": + case "5": + case "7": + case "8": + case "10": + case "12":{ + el.options.add(new Option(31, 31)); + } + } + } else if(document.getElementById('birthyear').value!="") { + var nbirthyear=document.getElementById('birthyear').value; + if(nbirthyear%400==0 || (nbirthyear%4==0 && nbirthyear%100!=0)) el.options.add(new Option(29, 29)); + } + el.value = birthday; +} + +var tipTimer=[]; +function showTip(ctrlobj,pos,msg) { + if(!ctrlobj.id) { + ctrlobj.id = 'tip_' + Math.random(); + } + var tip_classname=''; + switch(pos){ + case '12': + tip_classname='tip_4'; + break; + case '21': + tip_classname='tip_3'; + break; + case '43': + tip_classname='tip_1'; + break; + case '34': + tip_classname='tip_2'; + break; + default: + pos='12'; + tip_classname='tip_4'; + } + menuid = ctrlobj.id + '_menu'; + if(!document.getElementById(menuid)) { + var div = document.createElement('div'); + div.id = ctrlobj.id + '_menu'; + div.className = 'tip da '+tip_classname; + div.style.display = 'none'; + div.innerHTML = '
' + (msg?msg:ctrlobj.getAttribute('tip')) + '
'; + document.getElementById('append_parent').appendChild(div); + div.onmouseover=function(){ + if(tipTimer[this.id]) window.clearTimeout(tipTimer[this.id]); + }; + div.onmouseout=function(){ + var self=this; + tipTimer[this.id]=window.setTimeout(function(){hideMenu(self.id, 'prompt');},200); + }; + } + document.getElementById(ctrlobj.id).onmouseout = function () {var self=this; tipTimer[this.id+'_menu']=window.setTimeout(function(){hideMenu(self.id+'_menu', 'prompt');},200)}; + + showMenu({'mtype':'prompt','ctrlid':ctrlobj.id,'pos':pos+'!','duration':3,'zindex':JSMENU['zIndex']['prompt']}); + +} + +function showPrompt(ctrlid, evt, msg, timeout, classname) { + var menuid = ctrlid ? ctrlid + '_pmenu' : 'ntcwin'; + var duration = timeout ? 0 : 3; + if(document.getElementById(menuid)) { + document.getElementById(menuid).parentNode.removeChild(document.getElementById(menuid)); + } + var div = document.createElement('div'); + div.id = menuid; + div.className = !classname ? (ctrlid ? 'tip tip_js' : 'ntcwin') : classname; + div.style.display = 'none'; + document.getElementById('append_parent').appendChild(div); + if(ctrlid) { + msg = '
' + msg + '
'; + } else { + msg = '
 
' + msg + + '
 
'; + } + div.innerHTML = msg; + if(ctrlid) { + if(!timeout) { + evt = 'click'; + } + if(document.getElementById(ctrlid)) { + if(document.getElementById(ctrlid).evt !== false) { + var prompting = function() { + showMenu({'mtype':'prompt','ctrlid':ctrlid,'evt':evt,'menuid':menuid,'pos':'210'}); + }; + if(evt == 'click') { + document.getElementById(ctrlid).onclick = prompting; + } else { + document.getElementById(ctrlid).onmouseover = prompting; + } + } + showMenu({'mtype':'prompt','ctrlid':ctrlid,'evt':evt,'menuid':menuid,'pos':'210','duration':duration,'timeout':timeout,'zindex':JSMENU['zIndex']['prompt']}); + document.getElementById(ctrlid).unselectable = false; + } + } else { + showMenu({'mtype':'prompt','pos':'00','menuid':menuid,'duration':duration,'timeout':timeout,'zindex':JSMENU['zIndex']['prompt']}); + document.getElementById(menuid).style.top = (parseInt(document.getElementById(menuid).style.top) - 100) + 'px'; + } +} +function cardInit() { + var cardShow = function (obj) { + if(BROWSER.ie && BROWSER.ie < 7 && obj.href.indexOf('username') != -1) { + return; + } + pos = obj.getAttribute('c') == '1' ? '43' : obj.getAttribute('c'); + USERCARDST = setTimeout(function() {ajaxmenu(obj, 500, 1, 2, pos, null, 'p_pop card');}, 250); + }; + + var cardids = {}; + var a = document.body.getElementsByTagName('a'); + for(var i = 0;i < a.length;i++){ + if(a[i].getAttribute('c')) { + var href = a[i].getAttribute('href', 1); + if(typeof cardids[href] == 'undefined') { + cardids[href] = Math.round(Math.random()*10000); + } + a[i].setAttribute('mid', 'card_' + cardids[href]); + a[i].onmouseover = function() {cardShow(this)}; + a[i].onmouseout = function() {clearTimeout(USERCARDST);}; + } + } + +} +function mobileplayer() +{ + var platform = navigator.platform; + var ua = navigator.userAgent; + var ios = /iPhone|iPad|iPod/.test(platform) && ua.indexOf( "AppleWebKit" ) > -1; + var andriod = ua.indexOf( "Android" ) > -1; + if(ios || andriod) { + return true; + } else { + return false; + } +} + +//target='dzz'时在桌面打开 +jQuery(document).ready(function(e) { + jQuery('.js-popbox').each(function(){ + jQuery(this).popbox(); + }); + jQuery(document).on('click','a',function(){ + var href=this.href,id='',name=jQuery(this).attr('title')?jQuery(this).attr('title'):strip_tags(this.innerHTML); + + if(href.indexOf('user.php?uid=')!==-1){ + id='profile'; + try{top.OpenWindow(id, href, __lang.subscriber_data);}catch(e){ + window.open(href,name); + return false; + } + return false; + }else if(this.target=='_dzz'){ + if(jQuery(this).attr('icon')){ + var taskdata={img:jQuery(this).attr('icon'),name:name}; + }else{ + var taskdata={}; + } + try{ + if(top._config){ + top.OpenWindow('url', href, name,'',taskdata); + return false; + }else{ + window.open(href,name); + return false; + } + }catch(e){} + } + }); +}); + +var showDialogST = null; +function showDialog(msg, mode, t, func, cover, funccancel, leftmsg, confirmtxt, canceltxt, closetime, locationtime) { + clearTimeout(showDialogST); + cover = isUndefined(cover) ? (mode == 'info' || mode == 'icon' ? 0 : 1) : cover; + leftmsg = isUndefined(leftmsg) ? '' : leftmsg; + //mode = in_array(mode, ['confirm', 'notice', 'info', 'right']) ? mode : 'alert'; + if(!mode) mode='alert'; + var menuid = 'fwin_dialog'; + var menuObj = document.getElementById(menuid); + var showconfirm = 1; + confirmtxtdefault ='确定'; + closetime = isUndefined(closetime) ? '' : closetime; + closefunc = function () { + if(typeof func == 'function') func(); + else eval(func); + hideMenu(menuid, 'dialog'); + }; + if(closetime) { + leftmsg = closetime + __lang.message_closetime; + showDialogST = setTimeout(closefunc, closetime * 1000); + //showconfirm = 0; + } + locationtime = isUndefined(locationtime) ? '' : locationtime; + if(locationtime) { + leftmsg = locationtime + __lang.message_locationtime; + showDialogST = setTimeout(closefunc, locationtime * 1000); + //showconfirm = 0; + } + confirmtxt = confirmtxt ? confirmtxt : confirmtxtdefault; + canceltxt = canceltxt ? canceltxt : '取消'; + + if(menuObj) hideMenu('fwin_dialog', 'dialog'); + menuObj = document.createElement('div'); + menuObj.style.display = 'none'; + menuObj.className = 'fwinmask'; + menuObj.id = menuid; + document.getElementById('append_parent').appendChild(menuObj); + var hidedom = ''; + if(!BROWSER.ie) { + hidedom = ''; + } + var shadow=''; + var s=''; + if(t) { + s=hidedom + shadow+ ''; + }else { + s=hidedom + shadow+ ''; + } + if(mode.indexOf('alert_icon_' )!== -1){ + var icon=decodeURIComponent(mode.replace('alert_icon_' ,'')); + if(icon){ + s += ''; + }else{ + s += ''; + } + s += ''; + }else if(mode=='message'){ + if(leftmsg){ + s += ''; + }else{ + s += ''; + } + s += ''; + } else { + s += ''; + s += ''; + } + s += ''; + menuObj.innerHTML = s; + if(document.getElementById('fwin_dialog_submit')) document.getElementById('fwin_dialog_submit').onclick = function() { + if(typeof func == 'function') func(); + else eval(func); + hideMenu(menuid, 'dialog'); + }; + if(document.getElementById('fwin_dialog_cancel')) { + document.getElementById('fwin_dialog_cancel').onclick = function() { + if(typeof funccancel == 'function') funccancel(); + else eval(funccancel); + hideMenu(menuid, 'dialog'); + }; + //document.getElementById('fwin_dialog_close').onclick = document.getElementById('fwin_dialog_cancel').onclick; + } + showMenu({'mtype':'dialog','menuid':menuid,'duration':3,'pos':'00','zindex':JSMENU['zIndex']['dialog'],'drag':'drag_'+menuid,'cache':0,'cover':cover}); + // try { + // if(document.getElementById('fwin_dialog_submit')) document.getElementById('fwin_dialog_submit').focus(); + // } catch(e) {} +} +function Alert(msg,timeout,callback,oktext,type) +{ + if(!type) type='alert' + showDialog(msg, type, __lang.board_message, callback, 1,callback, '', oktext?oktext:__lang.i_see, '', timeout); +}; +function Confirm(msg,callback) +{ + showDialog(msg, 'confirm', __lang.confirm_message, callback, 1); +}; + +function showWindow(k, url, mode, cache, showWindow_callback,disablebacktohide) { + + mode = isUndefined(mode) ? 'get' : mode; + cache = isUndefined(cache) ? 1 : cache; + var menuid = 'fwin_' + k; + var menuObj = document.getElementById(menuid); + var drag = null; + var loadingst = null; + var hidedom = ''; + + if(disallowfloat && disallowfloat.indexOf(k) != -1) { + if(BROWSER.ie) url += (url.indexOf('?') != -1 ? '&' : '?') + 'referer=' + escape(location.href); + location.href = url; + doane(); + return; + } + + var fetchContent = function() { + if(mode == 'get') { + menuObj.url = url; + url += (url.search(/\?/) > 0 ? '&' : '?') + 'infloat=yes&handlekey=' + k; + url += cache == -1 ? '&t='+(+ new Date()) : ''; + if(BROWSER.ie && url.indexOf('referer=') < 0) { + url = url + '&referer=' + encodeURIComponent(location); + } + ajaxget(url, 'fwin_content_' + k, null, '', '', function() {initMenu();show();}); + } else if(mode == 'post') { + menuObj.act = document.getElementById(url).action; + ajaxpost(url, 'fwin_content_' + k, '', '', '', function() {initMenu();show();}); + } + if(parseInt(BROWSER.ie) != 6) { + loadingst = setTimeout(function() {showDialog('', 'info', ' '+__lang.please_wait)}, 500); + } + if(mode == 'html'){ + document.getElementById('fwin_content_' + k).innerHTML = url; + initMenu(); + show(); + } + }; + var initMenu = function() { + clearTimeout(loadingst); + /*var objs = menuObj.getElementsByTagName('*'); + var fctrlidinit = false; + for(var i = 0; i < objs.length; i++) { + if(objs[i].id) { + objs[i].setAttribute('fwin', k); + } + if(objs[i].className == 'flb' && !fctrlidinit) { + if(!objs[i].id) objs[i].id = 'fctrl_' + k; + drag = objs[i].id; + fctrlidinit = true; + } + }*/ + }; + var show = function() { + hideMenu('fwin_dialog', 'dialog'); + jQuery(menuObj).modal('show'); + }; + if(!menuObj) { + var html=''; + + menuObj = document.createElement('div'); + menuObj.id = menuid; + menuObj.className = ' modal '; + if(disablebacktohide){ + menuObj.setAttribute('data-bs-backdrop','static'); + menuObj.setAttribute('data-bs-keyboard','false'); + + } + menuObj.style.display = 'none'; + document.body.appendChild(menuObj); + + menuObj.innerHTML = html; + if(mode == 'html') { + document.getElementById('fwin_content_' + k).innerHTML = url; + initMenu(); + show(); + } else { + fetchContent(); + } + } else if((mode == 'get' && (url != menuObj.url || cache != 1)) || (mode == 'post' && document.getElementById(url).action != menuObj.act) || (mode == 'html' && cache != 1)) { + fetchContent(); + } else { + show(); + } + + if(typeof showWindow_callback == 'function') window.showWindow_callback=showWindow_callback; + doane(); +} + +var messageTimer=null; +function showmessage(msg,type,timeout,haveclose,position,callback,maxwidth,maxheight,delay){ +/* 提示消息框 + * @string msg 消息 + * @string type 消息类型,'danger','info','success','warning' + * @number timeout 定时关闭,单位毫秒 + * @boolean haveclose 是否显示关闭按钮 + * @string position 消息框位置,'left-top'、'right-top'、'right-bottom'、'left-bottom','top-center','center',默认'top-center' + * @function callback 回调函数,timeout用尽时才会触发; + */ + if(!maxheight) maxheight=300; //最大高度 + if(!maxwidth) maxwidth=300; //最大宽度 + if(!delay) delay=300; //动画时间 + + var el; + if(!document.getElementById('message_tip_box')){ + el=jQuery('
').appendTo(document.body); + var isnew=true; + }else{ + el=jQuery('#message_tip_box'); + } + var el1=jQuery('#message_tip_alert'); + el.attr('sytle','').attr('class','toast fade show message_tip_box'); + el.css({'height':'auto','max-height':maxheight,width:maxwidth,margin:'0,auto','overflow':'hidden'}); + //设置消息框的类型(不同类型背景颜色不同); + if(type=='error') type='danger'; + var types=['danger','info','success','warning']; + if(jQuery.inArray(type,types)<0) type='info'; + if(type) { + jQuery('#message_tip_alert').attr('class','alert alert-'+type); + if(type == 'info'){ + var spantype ='' ; + }else if(type == 'success'){ + var spantype =''; + }else if(type == 'danger'){ + var spantype =''; + }else if(type == 'warning'){ + var spantype =''; + } + }else { + jQuery('#message_tip_alert').attr('class','alert alert-warning'); + } + + if(type == 'success'){ + var spantypes ='成功'; + }else if(type == 'danger'){ + var spantypes ='错误'; + }else if(type == 'warning'){ + var spantypes ='警告'; + }else{ + var spantypes ='信息'; + } + + //处理关闭按钮 + //处理关闭按钮 + if(haveclose){ + msg='
'+spantype+''+spantypes+'
'+msg+'
'; + }else { + msg='
'+spantype+''+spantypes+'
'+msg+'
'; + } + jQuery('#message_tip_alert').html(msg); + //处理位置 + var width=el.outerWidth(true); + var height=el.outerHeight(true); + if(messageTimer){ + window.clearTimeout(messageTimer); + } + switch(position){ + case 'left-top': + el.css({right:'auto',top:0,left:-width,bottom:'auto'}).animate({left:0},delay); + if(timeout){ + messageTimer=window.setTimeout(function(){ + el.animate({left:-width},delay,function(){ + el.remove(); + }); + if(typeof(callback)=='function') callback(); + },timeout); + } + //增加关闭事件 + el1.find('button.close').off('click').on('click',function(){ + el.animate({left:-width},delay,function(){ + + el.remove(); + }); + if(typeof(callback)=='function') callback();//关闭时触发回调函数; + }); + break; + case 'right-top': + el.css({right:-width,top:0,left:'auto',bottom:'auto'}).animate({right:0},delay); + if(timeout){ + messageTimer=window.setTimeout(function(){ + el.animate({right:-width},delay,function(){ + el.remove(); + }); + if(typeof(callback)=='function') callback(); + },timeout); + } + //增加关闭事件 + el1.find('button.close').off('click').on('click',function(){ + el.animate({right:-width},delay,function(){ + el.remove(); + }); + if(typeof(callback)=='function') callback();//关闭时触发回调函数; + }); + break; + case 'right-bottom': + el.css({right:-width,top:'auto',left:'auto',bottom:0}).animate({right:0},delay); + if(timeout){ + messageTimer=window.setTimeout(function(){ + el.animate({right:-width},delay,function(){ + el.remove(); + }); + if(typeof(callback)=='function') callback(); + },timeout); + } + //增加关闭事件 + el1.find('button.close').off('click').on('click',function(){ + el.animate({left:-width},delay,function(){ + el.remove(); + }); + if(typeof(callback)=='function') callback();//关闭时触发回调函数; + }); + break; + case 'left-bottom': + el.css({right:'auto',top:'auto',left:-width,bottom:0}).animate({left:0},delay); + if(timeout){ + messageTimer=window.setTimeout(function(){ + el.animate({left:-width},delay,function(){ + el.remove(); + }); + if(typeof(callback)=='function') callback(); + },timeout); + } + //增加关闭事件 + el1.find('button.close').off('click').on('click',function(){ + el.animate({left:-width},delay,function(){ + el.remove(); + }); + if(typeof(callback)=='function') callback();//关闭时触发回调函数; + }); + break; + case 'center': + var w2=width/2; + var h2=height/2 + el.css({left:'50%',top:'50%',right:'auto',bottom:'auto','margin-left':-w2,'margin-top':-h2,'opacity':0}).animate({'opacity':1},delay); + + if(timeout){ + messageTimer=window.setTimeout(function(){ + el.animate({'opacity':0},delay,function(){ + el.remove(); + }); + if(typeof(callback)=='function') callback(); + },timeout); + } + //增加关闭事件 + el1.find('button.close').off('click').on('click',function(){ + el.animate({'opacity':0},delay,function(){ + el.remove(); + }); + if(typeof(callback)=='function') callback();//关闭时触发回调函数; + }); + break; + default://top-center + el.css({left:'50%','marginLeft':-width/2,top:-height,right:'auto',bottom:'auto'}).animate({'top':0},delay);; + if(timeout){ + messageTimer=window.setTimeout(function(){ + el.animate({top:-height},delay,function(){ + el.remove(); + }); + if(typeof(callback)=='function') callback(); + },timeout); + } + //增加关闭事件 + el1.find('button.close').off('click').on('click',function(){ + el.animate({top:-height},delay,function(){ + el.remove(); + }); + if(typeof(callback)=='function') callback();//关闭时触发回调函数; + }); + break; + } + if(!timeout && typeof(callback)=='function'){//没有设置时间时立即触发 + callback(); + } +} + + +/*js和css加载器*/ + var jcLoader = function(){ + + var dc = document; + + function createScript(url,ids,callback){ + var urls = url.replace(/[,]\s*$/ig,"").split(","); + var lids = ids.replace(/[,]\s*$/ig,"").split(","); + var scripts = []; + var completeNum = 0; + for( var i = 0; i < urls.length; i++ ){ + if(lids[i] && document.getElementById(lids[i])){ + completeNum++; + completeNum >= urls.length?(typeof callback =='function'?callback():''):""; + continue; + } + scripts[i] = dc.createElement("script"); + scripts[i].type = "text/javascript"; + scripts[i].src = urls[i]; + if(lids[i]) scripts[i].id = lids[i]; + dc.getElementsByTagName("head")[0].appendChild(scripts[i]); + if(typeof callback!='function') continue; + if(scripts[i].readyState){ + scripts[i].onreadystatechange = function(){ + + if( this.readyState == "loaded" || this.readyState == "complete" ){ + this.onreadystatechange = null; + completeNum++; + completeNum >= urls.length?(typeof callback =='function'?callback():''):""; + } + } + } + else{ + scripts[i].onload = function(){ + completeNum++; + completeNum >= urls.length?(typeof callback =='function'?callback():''):""; + } + } + + } + + } + + function createLink(url,ids,callback){ + var urls = url.replace(/[,]\s*$/ig,"").split(","); + var lids = ids.replace(/[,]\s*$/ig,"").split(","); + var links = []; + var completeNum = 0; + for( var i = 0; i < urls.length; i++ ){ + if(lids[i] && document.getElementById(lids[i])){ + completeNum++; + completeNum >= urls.length?(typeof callback =='function'?callback():''):""; + continue; + } + //try{if(lids[i] && dc.getElementById(lids[i])) dc.getElementsByTagName("head")[0].removeChild(dc.getElementById(lids[i]));}catch(e){}; + links[i] = dc.createElement("link"); + if(lids[i]) links[i].id=lids[i]; + links[i].rel = "stylesheet"; + links[i].href = urls[i]; + dc.getElementsByTagName("head")[0].appendChild(links[i]); + if(typeof callback!='function') continue; + if(links[i].readyState){ + links[i].onreadystatechange = function(){ + + if( this.readyState == "loaded" || this.readyState == "complete" ){ + this.onreadystatechange = null; + completeNum++; + completeNum >= urls.length?(typeof callback =='function'?callback():''):""; + } + } + } + else{ + links[i].onload = function(){ + completeNum++; + completeNum >= urls.length?(typeof callback =='function'?callback():''):""; + } + } + } + } + return{ + load:function(option,callback){ + var _type = "",_url = "",_ids=""; + var _callback = callback + option.type? _type = option.type:""; + option.url? _url = option.url:""; + option.ids? _ids = option.ids:""; + + switch(_type){ + case "js": + case "javascript": createScript(_url,_ids,_callback); break; + case "css": createLink(_url,_ids,_callback); break; + } + + return this; + } + } + } + + function checkeURL(URL){ + var str=URL; + if(str=='about:blank') return true; + var Expression=/[a-zA-z]+:\/\/[^\s]*/; + var objExp=new RegExp(Expression); + if(objExp.test(str)==true){ + return true; + }else{ + return false; + } +} ; +function parseURL(url) { + var a = document.createElement('a'); + a.href = url; + return { + source: url, + protocol: a.protocol.replace(':',''), + host: a.hostname, + port: a.port, + query: a.search, + params: (function(){ + var ret = {}, + seg = a.search.replace(/^\?/,'').split('&'), + len = seg.length, i = 0, s; + for (;i12 && H<24){ + H-=12; + H='下午 '+fillZero(H); + }else if(H==24){ + H='下午 00'; + } + } + ev.innerHTML=Y+__lang.year+M+__lang.month+D+__lang.day + ' '+W+' '+H+':'+I+':'+S; + //每秒更新时间 + setTimeout(arguments.callee,1000); + })(); +} +function serialize (mixed_value) { + // Returns a string representation of variable (which can later be unserialized) + // + // version: 1109.2015 + // discuss at: http://phpjs.org/functions/serialize // + original by: Arpad Ray (mailto:arpad@php.net) + // + improved by: Dino + // + bugfixed by: Andrej Pavlovic + // + bugfixed by: Garagoth + // + input by: DtTvB (http://dt.in.th/2008-09-16.string-length-in-bytes.html) // + bugfixed by: Russell Walker (http://www.nbill.co.uk/) + // + bugfixed by: Jamie Beck (http://www.terabit.ca/) + // + input by: Martin (http://www.erlenwiese.de/) + // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net/) + // + improved by: Le Torbi (http://www.letorbi.de/) // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net/) + // + bugfixed by: Ben (http://benblume.co.uk/) + // - depends on: utf8_encode + // % note: We feel the main purpose of this function should be to ease the transport of data between php & js + // % note: Aiming for PHP-compatibility, we have to translate objects to arrays // * example 1: serialize(['Kevin', 'van', 'Zonneveld']); + // * returns 1: 'a:3:{i:0;s:5:"Kevin";i:1;s:3:"van";i:2;s:9:"Zonneveld";}' + // * example 2: serialize({firstName: 'Kevin', midName: 'van', surName: 'Zonneveld'}); + // * returns 2: 'a:3:{s:9:"firstName";s:5:"Kevin";s:7:"midName";s:3:"van";s:7:"surName";s:9:"Zonneveld";}' + var _utf8Size = function (str) { var size = 0, + i = 0, + l = str.length, + code = ''; + for (i = 0; i < l; i++) { code = str.charCodeAt(i); + if (code < 0x0080) { + size += 1; + } else if (code < 0x0800) { + size += 2; } else { + size += 3; + } + } + return size; }; + var _getType = function (inp) { + var type = typeof inp, + match; + var key; + if (type === 'object' && !inp) { + return 'null'; + } + if (type === "object") { if (!inp.constructor) { + return 'object'; + } + var cons = inp.constructor.toString(); + match = cons.match(/(\w+)\(/); if (match) { + cons = match[1].toLowerCase(); + } + var types = ["boolean", "number", "string", "array"]; + for (key in types) { if (cons == types[key]) { + type = types[key]; + break; + } + } } + return type; + }; + var type = _getType(mixed_value); + var val, ktype = ''; + switch (type) { + case "function": + val = ""; + break; case "boolean": + val = "b:" + (mixed_value ? "1" : "0"); + break; + case "number": + val = (Math.round(mixed_value) == mixed_value ? "i" : "d") + ":" + mixed_value; break; + case "string": + val = "s:" + _utf8Size(mixed_value) + ":\"" + mixed_value + "\""; + break; + case "array": case "object": + val = "a"; +/* + if (type == "object") { + var objname = mixed_value.constructor.toString().match(/(\w+)\(\)/); if (objname == undefined) { + return; + } + objname[1] = this.serialize(objname[1]); + val = "O" + objname[1].substring(1, objname[1].length - 1); } + */ + var count = 0; + var vals = ""; + var okey; var key; + for (key in mixed_value) { + if (mixed_value.hasOwnProperty(key)) { + ktype = _getType(mixed_value[key]); + if (ktype === "function") { continue; + } + + okey = (key.match(/^[0-9]+$/) ? parseInt(key, 10) : key); + vals += this.serialize(okey) + this.serialize(mixed_value[key]); count++; + } + } + val += ":" + count + ":{" + vals + "}"; + break; case "undefined": + // Fall-through + default: + // if the JS object has a property which contains a null value, the string cannot be unserialized by PHP + val = "N"; break; + } + if (type !== "object" && type !== "array") { + val += ";"; + } return val; +}; + +function array_merge () { + // Merges elements from passed arrays into one array + // + // version: 1109.2015 + // discuss at: http://phpjs.org/functions/array_merge // + original by: Brett Zamir (http://brett-zamir.me) + // + bugfixed by: Nate + // + input by: josh + // + bugfixed by: Brett Zamir (http://brett-zamir.me) + // * example 1: arr1 = {"color": "red", 0: 2, 1: 4} // * example 1: arr2 = {0: "a", 1: "b", "color": "green", "shape": "trapezoid", 2: 4} + // * example 1: array_merge(arr1, arr2) + // * returns 1: {"color": "green", 0: 2, 1: 4, 2: "a", 3: "b", "shape": "trapezoid", 4: 4} + // * example 2: arr1 = [] + // * example 2: arr2 = {1: "data"} // * example 2: array_merge(arr1, arr2) + // * returns 2: {0: "data"} + var args = Array.prototype.slice.call(arguments), + argl = args.length, + arg, retObj = {}, + k = '', + argil = 0, + j = 0, + i = 0, ct = 0, + toStr = Object.prototype.toString, + retArr = true; + + for (i = 0; i < argl; i++) { if (toStr.call(args[i]) !== '[object Array]') { + retArr = false; + break; + } + } + if (retArr) { + retArr = []; + for (i = 0; i < argl; i++) { + retArr = retArr.concat(args[i]); } + return retArr; + } + + for (i = 0, ct = 0; i < argl; i++) { arg = args[i]; + if (toStr.call(arg) === '[object Array]') { + for (j = 0, argil = arg.length; j < argil; j++) { + retObj[ct++] = arg[j]; + } } + else { + for (k in arg) { + if (arg.hasOwnProperty(k)) { + if (parseInt(k, 10) + '' === k) { retObj[ct++] = arg[k]; + } + else { + retObj[k] = arg[k]; + } } + } + } + } + return retObj; +}; + +function htmlspecialchars_decode (string, quote_style) { + // http://kevin.vanzonneveld.net + // + original by: Mirek Slugen + // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + bugfixed by: Mateusz "loonquawl" Zalega + // + input by: ReverseSyntax + // + input by: Slawomir Kaniecki + // + input by: Scott Cariss + // + input by: Francois + // + bugfixed by: Onno Marsman + // + revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + bugfixed by: Brett Zamir (http://brett-zamir.me) + // + input by: Ratheous + // + input by: Mailfaker (http://www.weedem.fr/) + // + reimplemented by: Brett Zamir (http://brett-zamir.me) + // + bugfixed by: Brett Zamir (http://brett-zamir.me) + // * example 1: htmlspecialchars_decode("

this -> "

", 'ENT_NOQUOTES'); + // * returns 1: '

this -> "

' + // * example 2: htmlspecialchars_decode("""); + // * returns 2: '"' + var optTemp = 0, + i = 0, + noquotes = false; + if (typeof quote_style === 'undefined') { + quote_style = 2; + } + string = string.toString().replace(//g, '>'); + var OPTS = { + 'ENT_NOQUOTES': 0, + 'ENT_HTML_QUOTE_SINGLE': 1, + 'ENT_HTML_QUOTE_DOUBLE': 2, + 'ENT_COMPAT': 2, + 'ENT_QUOTES': 3, + 'ENT_IGNORE': 4 + }; + if (quote_style === 0) { + noquotes = true; + } + if (typeof quote_style !== 'number') { // Allow for a single string or an array of string flags + quote_style = [].concat(quote_style); + for (i = 0; i < quote_style.length; i++) { + // Resolve string input to bitwise e.g. 'PATHINFO_EXTENSION' becomes 4 + if (OPTS[quote_style[i]] === 0) { + noquotes = true; + } else if (OPTS[quote_style[i]]) { + optTemp = optTemp | OPTS[quote_style[i]]; + } + } + quote_style = optTemp; + } + if (quote_style & OPTS.ENT_HTML_QUOTE_SINGLE) { + string = string.replace(/�*39;/g, "'"); // PHP doesn't currently escape if more than one 0, but it should + // string = string.replace(/'|�*27;/g, "'"); // This would also be useful here, but not a part of PHP + } + if (!noquotes) { + string = string.replace(/"/g, '"'); + } + // Put this in last place to avoid escape being double-decoded + string = string.replace(/&/g, '&'); + + return string; +}; +function dzzNotification() { + var h5n = new Object(); + + h5n.issupport = function() { + return 'Notification' in window; + }; + + h5n.shownotification = function(replaceid, url, imgurl, subject, message) { + if (Notification.permission === 'granted') { + sendit(); + } else if (Notification.permission !== 'denied') { + Notification.requestPermission().then(function (perm) { + if (perm === 'granted') { + sendit(); + } + }); + } + function sendit() { + var n = new Notification(subject, { + tag: replaceid, + icon: imgurl, + body: message + }); + n.onclick = function (e) { + e.preventDefault(); + window.open(url, '_blank'); + }; + } + }; + return h5n; +} \ No newline at end of file