[JavaScript] js常用代码整合 →→→→→进入此内容的聊天室

来自 , 2020-03-08, 写在 JavaScript, 查看 132 次.
URL http://www.code666.cn/view/f7e6c855
  1. /*
  2.         My Javascript zongliang
  3.         Update Time 2012-12-31 10:41
  4. */
  5. (function(window,undefined){
  6.        
  7.         var document = window.document;
  8.         var navigator = window.navigator;
  9.         var location = window.location;
  10.         var undefined = undefined;
  11.        
  12.         var zl = function(id,dom,win){return zl.$(id,dom,win);};
  13.  
  14.         zl.version = '1.0.0.5';
  15.         /*     
  16.                 zl.$ get Dom Object     id:name,dom:parentNode Dom,win:window.
  17.         */
  18.         zl.$ = function(obj,dom,win){
  19.                 try{
  20.                         document = (win == undefined) ? window.document : win.document;
  21.                         if(typeof obj == 'string'){
  22.                                 if(obj == '*'){
  23.                                         return (dom == undefined) ? document.getElementsByTagName('*') : zl.$(dom,undefined,win).getElementsByTagName('*');
  24.                                 }
  25.                                 var _obj = obj.split(' ');
  26.                                 if(_obj.length > 1){
  27.                                         var pdom = zl.$(_obj[0], dom);
  28.                                         if(pdom != null){
  29.                                                 if(zl.isset(pdom.length)){
  30.                                                         var reary = [];
  31.                                                         for(var i = 0; i < pdom.length; i++){
  32.                                                                 var _tmp = zl.$(obj.substr(_obj[0].length+1), pdom[i], win);
  33.                                                                 if(_tmp != null){
  34.                                                                         if(zl.isset(_tmp.length)){
  35.                                                                                 for(var _i = 0; _i < _tmp.length; _i++){
  36.                                                                                         if(_tmp[_i] != null) reary[reary.length] = _tmp[_i];
  37.                                                                                 }
  38.                                                                         }else{
  39.                                                                                 reary[reary.length] = _tmp;
  40.                                                                         }
  41.                                                                 }
  42.                                                                 //reary[reary.length] = zl.$(obj.substr(_obj[0].length+1), pdom[i], win);
  43.                                                         }
  44.                                                         return (reary.length != 0) ? reary : null;
  45.                                                 }else{
  46.                                                         return zl.$(obj.substr(_obj[0].length+1), pdom, win);
  47.                                                 }
  48.                                         }else{
  49.                                                 return null;   
  50.                                         }
  51.                                 } else if(obj.charAt(0) == '<' && obj.charAt(obj.length-1) == '>' && obj.length >= 3){
  52.                                         obj = obj.substr(1, obj.length-2);
  53.                                         return (dom == undefined) ? document.getElementsByTagName(obj) : zl.$(dom,undefined,win).getElementsByTagName(obj);
  54.                                 } else if(obj.charAt(0) == '.' && obj.length >= 2){
  55.                                         obj = obj.substr(1, obj.length-1);
  56.                                         if(zl.isset(document.getElementsByClassName)){
  57.                                                 return (dom == undefined) ? document.getElementsByClassName(obj) : zl.$(dom,undefined,win).getElementsByClassName(obj);
  58.                                         }else{
  59.                                                 var oElm = (dom == undefined) ? document : zl.$(dom,undefined,win);
  60.                                                 var arrElements = (oElm.all)? oElm.all : oElm.getElementsByTagName('*');
  61.                                                 var arrReturnElements = new Array();
  62.                                                 obj = obj.replace(/\-/g, "\\-");
  63.                                                 var oRegExp = new RegExp('(^|\\s)' + obj + '(\\s|$)');
  64.                                                 var oElement;
  65.                                                 for(var i=0; i < arrElements.length; i++){
  66.                                                         oElement = arrElements[i];
  67.                                                         if(oRegExp.test(oElement.className)){
  68.                                                                 arrReturnElements.push(oElement);
  69.                                                         }
  70.                                                 }
  71.                                                 return (arrReturnElements);
  72.                                         }
  73.                                 } else if(obj.charAt(0) == '#' && obj.length >= 2){
  74.                                         obj = obj.substr(1, obj.length-1);
  75.                                         if(zl.isset(document.getElementsByName)){
  76.                                                 return (dom == undefined) ? document.getElementsByName(obj) : zl.$(dom,undefined,win).getElementsByName(obj);
  77.                                         }else{
  78.                                                 var oElm = (dom == undefined) ? document : zl.$(dom,undefined,win);
  79.                                                 var arrElements = (oElm.all)? oElm.all : oElm.getElementsByTagName('*');
  80.                                                 var arrReturnElements = new Array();
  81.                                                 var oElement;
  82.                                                 for(var i=0; i < arrElements.length; i++){
  83.                                                         oElement = arrElements[i];
  84.                                                         if(oElement.getAttribute('name') == obj){
  85.                                                                 arrReturnElements.push(oElement);
  86.                                                         }
  87.                                                 }
  88.                                                 return (arrReturnElements);
  89.                                         }
  90.                                 } else if(obj.charAt(0) == '[' && obj.charAt(obj.length-1) == ']' && obj.length >= 3){
  91.                                         _tmp = obj.substr(1, obj.length-2);
  92.                                         var _att = _tmp.split('=');
  93.                                         if(dom == undefined){
  94.                                                 return zl.$('* '+obj,undefined,win);
  95.                                         }else{
  96.                                                 return (zl.att(dom,_att[0]) == _att[1]) ? dom : null;
  97.                                         }
  98.                                 } else {
  99.                                         return (dom == undefined) ? document.getElementById(obj) : zl.$(dom,undefined,win).getElementById(obj);
  100.                                 }
  101.                         } else if(typeof obj == 'function'){
  102.                                 zl.readyCallBacks[zl.readyCallBacks.length] = obj;
  103.                                 zl.ready();
  104.                                 //window.onload = function(){zl.ready();}
  105.                         } else {
  106.                                 return obj;    
  107.                         }
  108.                 }catch(e){
  109.                         zl.log('[Function][$] Get $ '+obj+' Error! '+e.message);
  110.                         return null;
  111.                 }
  112.         };
  113.         /*
  114.                 is Internet Explorer
  115.         */
  116.         zl.isIE = !!window.ActiveXObject;
  117.         // close page
  118.         zl.close = function(){window.opener = null; window.close();};
  119.         // get rand int
  120.         zl.r = zl.rand = function(rmin,rmax){
  121.                 if(!zl.isset(rmin))
  122.                         rmin = 0;
  123.                 if(!zl.isset(rmax))
  124.                         rmax = 100;
  125.                 return Math.round(rmin+(Math.random()*(rmax-rmin)));
  126.         };
  127.         // new error
  128.         zl.e = zl.error = function(msg){throw new Error(msg);};
  129.         //      Check Obj Is defined
  130.         zl.isset = zl.isdefined = function(obj){ return (typeof obj != 'undefined'); };
  131.         // log con:content ,e:error
  132.         zl.log = function(con,e){
  133.                 if(window.console && window.console.log){
  134.                         if(e != undefined && e.message != undefined){
  135.                                 console.log(con + '\r\n\t [Error: ' + e.message + ' ]\r\n');
  136.                         } else {
  137.                                 console.log(con);
  138.                         }
  139.                 }
  140.         };
  141.         /*
  142.                 Show Error Msg
  143.                 msg     Error Content
  144.         */
  145.         zl.showError = function(msg){
  146.                 var showEr = zl.create({id:'show_Error_Msg',cssText:'border: 1px solid #CCC;background: #FFF;width:200px;min-height:50px;z-index:9999; filter:alpha(opacity=70);opacity:0.7;position:fixed;_position:absolute;right:5px;bottom:0px;_bottom:0px;'});
  147.                 zl.create({cssText:'width:100%;height:24px;background:#ccc;color:red;font-size:14px;',pdom:showEr,content:'\u9519\u8bef\u63d0\u793a<a href="javascript:zl.remove(\'show_Error_Msg\',3);" style="float:right;">Close</a>'});
  148.                 zl.create({cssText:'width:100%;background:#FFF;color:red;font-size:13px;padding:10px;overflow:hidden;display:block;',pdom:showEr,content:'<span>' + msg + '</span>'});
  149.                
  150.                 setTimeout(function(){zl._fade(showEr,0,3,function(){zl.remove(this);});},3000);
  151.                
  152.         };
  153.         /*     
  154.                 remove object dom      
  155.         */
  156.         zl.remove = zl.del = function(name,time){
  157.                 var obj = zl.$(name);
  158.                 if(time){
  159.                         zl._fade(obj,0,time,function(){zl.remove(this);});
  160.                 } else {
  161.                         if(obj != null){
  162.                                 try{
  163.                                         obj.parentNode.removeChild(obj);
  164.                                         zl.log('Remove Object ' + obj + ' Success');
  165.                                 }catch(e){
  166.                                         zl.log('Remove Object ' + obj + ' Failure! ', e);
  167.                                         return e.message;
  168.                                 }
  169.                         }else{
  170.                                 zl.log('[Function][remove]Remove Object ' + obj + ' Failure! [Error: Is Null! ]');
  171.                         }
  172.                 }
  173.         };
  174.         /*
  175.                 Verify CSS Style Att
  176.                
  177.         */
  178.         zl.isCss = function(elem,css,val){
  179.                 try{
  180.                         elem = zl.$(elem);
  181.                         if(css in elem.style){
  182.                                 if(zl.isset(val)){
  183.                                         elem.style[css] = val;
  184.                                         return elem.style[css] === val;
  185.                                 }
  186.                                 return true;
  187.                         }
  188.                         return false;
  189.                 }catch(e){
  190.                         zl.log('[Function][isCss] Get Elem ['+elem+'] CSS ['+css+'] Style Failure! ', e);
  191.                         return false;
  192.                 }
  193.         };
  194.         /*
  195.                 Set Dom CSS Style
  196.                
  197.         */
  198.         zl.css = function(elem,css){
  199.                 try{
  200.                         elem = zl.$(elem);
  201.                         if(css.charAt(0) == '.'){
  202.                                 zl.att(elem, 'class', css.substr(1, css.length-1));    
  203.                         }else{
  204.                                 zl.att(elem, 'style', css);
  205.                         }
  206.                 }catch(e){
  207.                         zl.log('[Function][css] Set Elem ['+elem+'] CSS ['+css+'] Style Failure! ', e);
  208.                         return false;
  209.                 }
  210.         };
  211.         /*
  212.                 Load JavaScript
  213.         */
  214.         zl.loadjs = zl.loadScript = function(src,charset,callback,kill){
  215.                 try{
  216.                         var h = zl.$('<head>')[0];
  217.                         var ss = zl.$('<script>', h);
  218.                         if (ss && ss.length > 0) {
  219.                                 for(var i = 0; i < ss.length; i ++) {
  220.                                         if (zl.att(ss[i],'src') == src && !zl.isset(kill)) {
  221.                                                 zl.log('Load JavaScript '+src+' Error.!  JS Already exists');
  222.                                                 zl.run(callback);
  223.                                                 return;
  224.                                         }
  225.                                 }
  226.                         }
  227.                         var js = zl.create({tagName:'script',type:'text/javascript',_src:src,src:src,append:false});
  228.                         if(charset){js.charset = charset;}
  229.                         if (callback){
  230.                                 if(zl.isIE){
  231.                                         js.onreadystatechange = function(){
  232.                                                 if ('complete' == s.readyState || s.readyState == 'loaded'){
  233.                                                         zl.run(callback);
  234.                                                 }
  235.                                         };
  236.                                 }else{
  237.                                         js.onload = function(){
  238.                                                 zl.run(callback);
  239.                                         };
  240.                                 }
  241.                         }
  242.                         zl.insert.child(h,js);
  243.                         return js;
  244.                 }catch(e){
  245.                         zl.log('[Function][loadjs] Load JavaScript '+src+' Failure! ', e);
  246.                 }
  247.         };
  248.         /*
  249.                 Run Function
  250.         */
  251.         zl.run = function(callback){
  252.                 try{
  253.                         if(typeof callback == 'string'){
  254.                                 eval(callback);
  255.                         }else{
  256.                                 callback.call(document);
  257.                         }
  258.                 }catch(e){
  259.                         zl.log('[Function][run] Run JavaScript Function '+callback+' Failure! ', e);
  260.                 }
  261.         };
  262.         /*     
  263.                 Get js parameter       
  264.         */
  265.         zl.p = zl.parameter = function(name,def,url){
  266.                 try{
  267.                         if(!zl.isset(url)){
  268.                                 var scripts = zl.$('<script>');
  269.                                 var js = scripts[scripts.length-1];
  270.                                 if(name == undefined) return js;
  271.                                 url = js.src;
  272.                         }
  273.                         var qs = url.split('?');
  274.                         if (name == null || name == ''){return (qs.length > 1) ? qs[qs.length-1] : ''; }
  275.                         var str = qs[qs.length-1].split("&");
  276.                         var i = 0;
  277.                         while(str[i] != null) {
  278.                                 var keys = str[i].split("=");
  279.                                 var j = 0,value = "";
  280.                                 while(keys[j] != null) {
  281.                                         if(j != 0) value = value + keys[j];
  282.                                         j++;
  283.                                 }
  284.                                 if(keys[0] == name) return value;
  285.                                 i++;
  286.                         }
  287.                         return (!zl.isset(def)) ? '' : def;
  288.                 }catch(e){
  289.                         zl.log('[Function][p] Get Parameter Failure! ', e);
  290.                         return '';
  291.                 }
  292.         };
  293.         /*
  294.                 Get All Child Nodes
  295.         */
  296.         zl.childNodes = function(elem,tag){
  297.                 try{
  298.                         var childs = new Array();
  299.                         var nodes = elem.childNodes;
  300.                         for(var i = 0; i < nodes.length; i++){
  301.                                 if(zl.isset(nodes[i].tagName)){
  302.                                         if(typeof tag != 'string' || nodes[i].tagName.toLowerCase() == tag.toLowerCase()){
  303.                                                 childs[childs.length] = nodes[i];
  304.                                         }
  305.                                 }
  306.                         }
  307.                         return childs;
  308.                 }catch(e){
  309.                         zl.log('[Function][childNodes] Get Object Dom ' + elem + ' All ChildNodes Tag ' + tag + ' Failure! ', e);
  310.                         return zl.$('<' + tab + '>', elem);
  311.                 }
  312.         };
  313.         /*
  314.                 Get Or Set Attrib
  315.         */
  316.         zl.att = zl.attribute = function(elem,key,val){
  317.                 try{
  318.                         if(zl.isset(val)){
  319.                                 if(typeof val == 'function'){
  320.                                         try{eval('elem.'+key+' = '+val+';');}catch(e){elem.setAttribute(key, val);}
  321.                                 }else if(val == null){
  322.                                         elem.removeAttribute(key);
  323.                                 }else{
  324.                                         try{elem.setAttribute(key, val);}catch(e){eval('elem.'+key+' = '+val+';');}
  325.                                 }
  326.                         } else {
  327.                                 return elem.getAttribute(key);
  328.                         }
  329.                 }catch(e){
  330.                         zl.log('[Function][att] Get Or Set Attribute In '+elem+' Failure! ', e);
  331.                         return null;
  332.                 }
  333.         };
  334.         /*
  335.                 Get Dom Location x,y,h,w
  336.                 return obj
  337.         */
  338.         zl.loc = zl.dom_location = function(elem){
  339.                 try{
  340.                         if(arguments.length != 1 || elem == null ){
  341.                                 return null;
  342.                         }
  343.                         var offsetTop = elem.offsetTop;
  344.                         var offsetLeft = elem.offsetLeft;
  345.                         var offsetWidth = elem.offsetWidth;
  346.                         var offsetHeight = elem.offsetHeight;
  347.                         while( elem = elem.offsetParent){
  348.                                 if(elem.style.position == 'absolute' || elem.style.position == 'relative' || ( elem.style.overflow != 'visible' && elem.style.overflow != '' )){
  349.                                         break;
  350.                                 }
  351.                                 offsetTop += elem.offsetTop;
  352.                                 offsetLeft += elem.offsetLeft;
  353.                         }
  354.                         return {top:offsetTop,left:offsetLeft,width:offsetWidth,height:offsetHeight};
  355.                 }catch(e){
  356.                         zl.log('[Function][loc] Get Location '+elem+' Failure! ', e);
  357.                         return null;
  358.                 }
  359.         };
  360.         /*
  361.                 load dom time
  362.         */
  363.         zl.loadTime = 0;
  364.         /*
  365.                 rand callbacks
  366.         */
  367.         zl.readyCallBacks = [];
  368.         /*
  369.                 ready window.onload ,,,
  370.         */
  371.         zl.ready = function(obj){
  372.                 try{
  373.                         if(zl.isset(obj) ){
  374.                                 zl.readyCallBacks[zl.readyCallBacks.length] = obj;
  375.                         }
  376.                         zl.loadTime = zl.loadTime + 1;
  377.                         if(document.readyState == 'complete' && zl.readyCallBacks != []){
  378.                                 for(var i = 0,ic = zl.readyCallBacks.length; i < ic; i++ ){
  379.                                         try{
  380.                                                 zl.run(zl.readyCallBacks[i]);
  381.                                                 /*
  382.                                                 if(typeof zl.readyCallBacks[i] == 'string'){
  383.                                                         eval(zl.readyCallBacks[i]);
  384.                                                 }else{
  385.                                                         zl.readyCallBacks[i].call(document);
  386.                                                 }
  387.                                                 */
  388.                                                 //delete zl.readyCallBacks[i];
  389.                                         }catch(e){
  390.                                                 zl.log('[Function][ready] Ready CallBack Failure! ', e);
  391.                                         }
  392.                                 }
  393.                                 zl.readyCallBacks = [];
  394.                         }else{
  395.                                 setTimeout(function(){zl.ready();},1);
  396.                         }
  397.                 }catch(e){
  398.                         zl.log('[Function][ready] Ready Function Failure!',e);
  399.                 }
  400.         };
  401.         /*
  402.                 Check Default Option
  403.         */
  404.         zl.cd = zl.checkDefaultOpt = function(def_opt,opt){
  405.                 try{
  406.                         if(!opt) {
  407.                                 opt = def_opt;
  408.                         }else{
  409.                                 for(var dfo in def_opt){
  410.                                         if(opt[dfo] == undefined)
  411.                                                 opt[dfo] = def_opt[dfo];
  412.                                 }
  413.                         }
  414.                         return opt;
  415.                 }catch(e){
  416.                         zl.log('[Function][checkDefaultOpt] Check Default Option Failure! ', e);
  417.                         return null;   
  418.                 }
  419.         };
  420.         /*
  421.                 Get XmlHttp Object Ajax
  422.                 return Object or null;
  423.         */
  424.         zl.getXmlHttpObject = function(){
  425.                 try{
  426.                         var xmlHttp = null;
  427.                         try{
  428.                                 xmlHttp = new XMLHttpRequest();
  429.                         }catch(e){
  430.                                 try{
  431.                                         xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
  432.                                 }catch(e){
  433.                                         xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  434.                                 }
  435.                         }
  436.                         return xmlHttp;
  437.                 }catch(e){
  438.                         zl.log('[Function][getXmlHttpObject] get XML In Ajax Object Demo Failure!',e);  
  439.                 }
  440.         };
  441.         /*
  442.                 My Ajax obj
  443.                 opt option
  444.         */
  445.         zl.ajax = function(opt){
  446.                 var df_opt = {type:'post', url:'', query:'', dataType:'', async:true, success:function(o){}};
  447.                 opt = zl.cd(df_opt,opt);
  448.                 var xmlAjax = zl.getXmlHttpObject();
  449.                 if(xmlAjax == null){
  450.                         alert('\u60a8\u7684\u6d4f\u89c8\u5668\u53ef\u80fd\u4e0d\u652f\u6301Ajax.\u8bf7\u68c0\u67e5!');
  451.                 }else{
  452.                         try{
  453.                                 if(opt.type == 'get') opt.url = opt.url + '?' + opt.query;
  454.                                 xmlAjax.onreadystatechange = function(){
  455.                                         if(xmlAjax.readyState == 4 || xmlAjax.readyState == "complete"){
  456.                                                 try{
  457.                                                         if(opt.success){
  458.                                                                 var reData = xmlAjax.responseText;
  459.                                                                 if(opt.dataType == 'json'){
  460.                                                                         try{reData = zl.json(reData);}catch(e){zl.log('Content ReData Type Failure! ', e);}
  461.                                                                 } else if (opt.dataType == 'xml'){
  462.                                                                         try{reData = zl.xml(reData);}catch(e){zl.log('Content ReData Type Failure! ', e);}
  463.                                                                 }
  464.                                                                 if(typeof opt.success != 'string'){
  465.                                                                         opt.success.call(this,reData);
  466.                                                                 }else{
  467.                                                                         eval(opt.success + '(reData);');
  468.                                                                 }
  469.                                                         }
  470.                                                 }catch(e){
  471.                                                         zl.log('Get Ajax Data Failure! ', e);
  472.                                                         alert(e.message);
  473.                                                 }
  474.                                         }
  475.                                 }
  476.                                 xmlAjax.open(opt.type, opt.url, opt.async);
  477.                                 xmlAjax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  478.                                 xmlAjax.send(opt.query);
  479.                         }catch(e){
  480.                                 zl.log('[Function][ajax] Send Ajax Failure! ', e);
  481.                                 alert(e.message);
  482.                         }
  483.                 }      
  484.         };
  485.         /*
  486.                 open new window run code
  487.                 code Code
  488.         */
  489.         zl.runCode = function(code){
  490.                 try{
  491.                         if(code != ''){
  492.                                 var newwin = window.open('','','');
  493.                                 newwin.opener = null;
  494.                                 newwin.document.write(code);
  495.                                 newwin.document.close();
  496.                                 return newwin;
  497.                         }
  498.                 }catch(e){
  499.                         zl.log('[Function][runCode] Run Code Failure!',e);
  500.                 }
  501.         };
  502.         /*
  503.                 Copy Elem Style
  504.                 New Elem In Elem
  505.         */
  506.         zl.cpem = zl.copyElem = function(elem,opt){
  507.                 try{
  508.                         elem = zl.$(elem);
  509.                         if(elem == null) return null;
  510.                         if(typeof opt == 'undefined') opt = {append:false};
  511.                         //var cssText = (typeof opt['cssText'] == 'undefined') ? '' : opt['cssText'];
  512.                         var cssText = '';
  513.                         var locElem = zl.loc(elem);
  514.                         cssText = cssText + 'width:' + locElem.width + 'px;';   //elem.offsetWidth
  515.                         cssText = cssText + 'height:' + locElem.height + 'px;'; //elem.offsetHeight
  516.                         cssText = cssText + 'left:' + locElem.left + 'px;';             //elem.offsetLeft
  517.                         cssText = cssText + 'top:' + locElem.top + 'px;';               //elem.offsetTop
  518.                         cssText = cssText + 'position:absolute;z-index:99999;';
  519.  
  520.                         opt['cssText'] = (typeof opt['cssText'] == 'undefined') ? cssText : cssText + opt['cssText'];
  521.                        
  522.                         return zl.create(opt);
  523.                 }catch(e){
  524.                         zl.log('[Function][copyElem] Copy Element Failure!',e);
  525.                         return null;
  526.                 }
  527.         };
  528.         /*     
  529.                 Create Object Dom
  530.                 opt option
  531.         */
  532.         zl.create = zl.newDom = function(opt){
  533.                 try{
  534.                         if(typeof opt == 'string'){
  535.                                  var obj = document.createElement('div');
  536.                                  obj.innerHTML = opt;
  537.                                  return obj.childNodes;
  538.                         }else{
  539.                                 var df_opt = {tagName:'div',id:'c_obj',name:'c_obj',css:'',cssText:'',content:'',append:true,pdom:'',bdom:'',adom:''};
  540.                                 opt = zl.cd(df_opt,opt);
  541.                                 var obj = document.createElement(opt.tagName);
  542.                                 try{
  543.                                         obj.id = opt.id;
  544.                                         obj.name = opt.name;
  545.                                         obj.className = opt.css;
  546.                                         obj.style.cssText = opt.cssText;
  547.                                         try{obj.innerHTML = opt.content;}catch(ex){}
  548.                                         for(var i in opt){
  549.                                                 if(i != 'tagName' && i != 'id' && i != 'name' && i != 'css' && i != 'cssText' && i != 'content' && i != 'append' && i != 'pdom' && i != 'bdom' && i != 'adom'){
  550.                                                         zl.att(obj,i,opt[i]);
  551.                                                         //try{
  552.                                                         //      if(opt[i] != undefined) obj.setAttribute(i, opt[i]);
  553.                                                         //}catch(e){
  554.                                                         //      eval('obj.'+i+' = opt.'+i+';');
  555.                                                         //}
  556.                                                 }
  557.                                         }
  558.                                 }catch(exs){}
  559.                                 if(opt.append){
  560.                                         if(opt.pdom != ''){
  561.                                                 zl.insert.child(opt.pdom, obj);
  562.                                         }else if(opt.bdom != ''){
  563.                                                 zl.insert.before(opt.bdom, obj);
  564.                                         }else if(opt.adom != ''){
  565.                                                 zl.insert.after(opt.adom, obj);
  566.                                         }else{
  567.                                                 zl.insert.child(document.body, obj);
  568.                                         }
  569.                                 }
  570.                                 return obj;
  571.                         }
  572.                 }catch(e){
  573.                         zl.log('[Function][create] CreateElement Object Failure! ', e);
  574.                         //alert(e.message);
  575.                         return null;
  576.                 }
  577.         };
  578.         /*
  579.                 Insert Dom
  580.         */
  581.         zl.insert = {
  582.                 before : function(elem,newElem){
  583.                         try{
  584.                                 return zl.$(elem).parentNode.insertBefore(newElem, zl.$(elem));
  585.                         }catch(e){
  586.                                 zl.log('[Function][insert.before] Insert Object Dom '+newElem+' In '+elem+' Before Failure! ', e);
  587.                                 return false;
  588.                         }
  589.                 },
  590.                 after : function(elem,newElem){
  591.                         try{
  592.                                 if(elem.parentNode.lastChild == elem){
  593.                                         return elem.parentNode.appendChild(newElem);
  594.                                 }else{
  595.                                         return elem.parentNode.insertBefore(newElem,elem.nextSibling);
  596.                                 }
  597.                         }catch(e){
  598.                                 zl.log('[Function][insert.after] Insert Object Dom '+newElem+' In '+elem+' After Failure! ', e);
  599.                                 return false;
  600.                         }
  601.                 },
  602.                 child : function(elem,newElem){
  603.                         try{
  604.                                 return zl.$(elem).appendChild(newElem);
  605.                         }catch(e){
  606.                                 zl.log('[Function][insert.child] Insert Object Dom '+newElem+' In '+elem+' Failure! ', e);
  607.                                 return false;
  608.                         }              
  609.                 }
  610.         };
  611.         /*
  612.                 My Form Option
  613.                 Form
  614.         */
  615.         zl.fm = zl.Form = {
  616.                 Init : function(){
  617.                         /*      Unfinished...   */
  618.                 }
  619.         };
  620.         /*
  621.                 ImageErr check images onerror
  622.                 img             image object
  623.                 url             default image url
  624.         */
  625.         zl.imageErr = function(img,url){
  626.                 try{
  627.                         img = zl.$(img);
  628.                         //img.onerror = function(){img.src = url;}
  629.                         var _img = new Image();
  630.                         _img.src = img.src;
  631.                         _img.onerror = function(){
  632.                                 zl.att(img,'source-src',img.src);
  633.                                 img.src = url;
  634.                         }
  635.                         /*
  636.                         if(!img.complete){
  637.                                 var itp = obj.src.substr(-3);
  638.                                 if(itp == 'jpg' || itp == 'peg' || itp == 'png' || itp == 'gif' || itp == 'bmp'){
  639.                                         obj.setAttribute('source-src', obj.src);
  640.                                         obj.src = url;
  641.                                 }
  642.                         }
  643.                         */
  644.                 }catch(e){
  645.                         zl.log('[Function][imageErr] Load Image Error Failure! ', e);
  646.                         return '';
  647.                 }
  648.         };
  649.         /*
  650.                 Default Image
  651.         */
  652.         zl.imageDefault = function(url){
  653.                 try{
  654.                         var _img = new Image();
  655.                         _img.src = url;
  656.                         _img.onload = function(){
  657.                                 var imgs = zl.$('<img>');
  658.                                 for(var i in imgs){
  659.                                         zl.imageErr(imgs[i],url);
  660.                                 }      
  661.                         }
  662.                 }catch(e){
  663.                         zl.log('[function][imageDefault] Setting Images Default Url Failure! ', e);
  664.                         return '';     
  665.                 }
  666.         };
  667.         /*
  668.                 Get  Path
  669.                 src             path
  670.                 return (error)?'':the Path;
  671.         */
  672.         zl.getPath = function(src){
  673.                 try{
  674.                         if(!zl.isset(src)) src = zl.parameter().src;
  675.                         var path = src.substring(0,(src.length - zl.parameter('').length));
  676.                         return path.substring(0,path.lastIndexOf('/')+1);
  677.                 }catch(e){
  678.                         zl.log('[Function][getPath] Get Path Failure! ', e);
  679.                         return '';
  680.                 }
  681.         };
  682.         /*
  683.                 Get User Browser Info  
  684.                 r       retype
  685.                 return (r != null)?Browser Version:Object info;
  686.         */
  687.         zl.bs = zl.browser = function(r){
  688.                 try{
  689.                         var bsary = new Array();
  690.                         bsary[0] = new Array('MSIE ', 'Internet Explorer', 'Microsoft', '');
  691.                         bsary[1] = new Array('Chrome\\/', 'Chrome', 'Google', '');
  692.                         bsary[2] = new Array('Firefox\\/', 'Firefox', 'Mozilla', '');
  693.                         bsary[3] = new Array('Opera\\/', 'Opera', 'Opera Software', 'Version\\/[\\d+.\\d+]+');
  694.                         bsary[4] = new Array('Safari\\/', 'Safari', 'Apple', 'Version\\/[\\d+.\\d+]+');
  695.                         for(var i = 0; i < bsary.length; i++){
  696.                                 var ocode = '_reg = /'+bsary[i][0]+'[\\d+.\\d+]+/;';
  697.                                 ocode = ocode + 'var _bv = _reg.exec(navigator.userAgent);';
  698.                                 eval(ocode);
  699.                                 if(_bv){
  700.                                         if(bsary[i][3] != ''){
  701.                                                 var ocode = '_reg = /'+bsary[i][3]+'/;';
  702.                                                 ocode = ocode + 'var _bv = _reg.exec(navigator.userAgent);';
  703.                                                 eval(ocode);
  704.                                         }
  705.                                         _reg = /[\d+.\d+]+/;
  706.                                         var _v = _reg.exec(_bv)[0];
  707.                                         var _obj = bsary[i][2]+' '+bsary[i][1]+' '+_v;
  708.                                         return (r != undefined) ? _obj : {obj:_obj,company:bsary[i][2],name:bsary[i][1],version:_v};
  709.                                 }
  710.                         }
  711.                         return 'Unknown';
  712.                 }catch(e){
  713.                         zl.log('[Function][browser] Get Browser Info Failure! ', e);
  714.                         return e.message;
  715.                 }
  716.         };
  717.         /*
  718.                 Get User System Info   
  719.                 r       retype
  720.                 return (r != null)?System Version:Object info;
  721.         */
  722.         zl.os = zl.system = function(r){
  723.                 try{
  724.                         var osary = new Array();
  725.                         osary[0] = new Array('/windows nt 95/', 'Windows 95', 'Microsoft');
  726.                         osary[1] = new Array('/windows nt 4.90/', 'Windows ME', 'Microsoft');
  727.                         osary[2] = new Array('/windows nt 98/', 'Windows 98', 'Microsoft');
  728.                         osary[3] = new Array('/windows nt 5.0/', 'Windows 2000', 'Microsoft');
  729.                         osary[4] = new Array('/windows nt 5.1/', 'Windows XP', 'Microsoft');
  730.                         osary[5] = new Array('/windows nt 6.0/', 'Windows Vista', 'Microsoft');
  731.                         osary[6] = new Array('/windows nt 6.1/', 'Windows 7', 'Microsoft');
  732.                         osary[7] = new Array('/windows nt 6.2/', 'Windows 8', 'Microsoft');
  733.                         osary[8] = new Array('/windows nt 32/', 'Windows 32', 'Microsoft');
  734.                         osary[9] = new Array('/windows nt nt/', 'Windows NT', 'Microsoft');
  735.                         osary[10] = new Array('/mac os/', 'Mac OS', 'Apple');
  736.                         osary[11] = new Array('/linux/', 'Linux', 'Unknown');
  737.                         osary[12] = new Array('/unix/', 'Unix', 'Unknown');
  738.                         osary[13] = new Array('/sun os/', 'SunOS', 'SUN');
  739.                         osary[14] = new Array('/ibm os/', 'IBM OS/2', 'IBM');
  740.                         osary[15] = new Array('/mac pc/', 'Macintosh', 'Unknown');
  741.                         osary[16] = new Array('/powerpc/', 'PowerPC', 'Unknown');
  742.                         osary[17] = new Array('/aix/', 'AIX', 'Unknown');
  743.                         osary[18] = new Array('/hpux/', 'HPUX', 'Unknown');
  744.                         osary[19] = new Array('/netbsd/', 'NetBSD', 'Unknown');
  745.                         osary[20] = new Array('/bsd/', 'BSD', 'Unknown');
  746.                         osary[21] = new Array('/osfl/', 'OSF1', 'Unknown');
  747.                         osary[22] = new Array('/irix/', 'IRIX', 'Unknown');
  748.                         osary[23] = new Array('/freebsd/', 'FreeBSD', 'Unknown');
  749.                        
  750.                         for(var i = 0; i < osary.length; i++){
  751.                                 var ocode = '_reg = '+osary[i][0]+';';
  752.                                 ocode = ocode + 'var _bv = _reg.exec(navigator.userAgent.toLowerCase());';
  753.                                 eval(ocode);
  754.                                 if(_bv){
  755.                                         var _obj = osary[i][2]+' '+osary[i][1];
  756.                                         return (r != undefined) ? _obj : {obj:_obj,company:osary[i][2],name:osary[i][1]};
  757.                                 }
  758.                         }
  759.                         return 'Unknown';
  760.                 }catch(e){
  761.                         zl.log('[Function][system] Get System Info Failure! ', e);
  762.                         return e.message;
  763.                 }
  764.         };
  765.         /*
  766.                 Change object Transparency
  767.                 element                 Object Dom
  768.                 Transparency    Transparency value
  769.                 speed                   Change Speed
  770.                 callback                CallBack
  771.         */
  772.         zl._fade = zl.fade = zl.transparency = function(element, transparency, speed, callback){
  773.                 try{
  774.                         element = zl.$(element);
  775.                         if(!element.effect){
  776.                                 element.effect = {};
  777.                                 element.effect._fade=0;
  778.                         }
  779.                         clearInterval(element.effect._fade);
  780.                         var speed=speed||1;
  781.                         var start=(function(elem){
  782.                                 var alpha;
  783.                                 if(navigator.userAgent.toLowerCase().indexOf('msie') != -1){
  784.                                                 alpha=elem.currentStyle.filter.indexOf("opacity=") >= 0?(parseFloat( elem.currentStyle.filter.match(/opacity=([^)]*)/)[1] )) + '':
  785.                                                 '100';
  786.                                 }else{
  787.                                                 alpha=100*elem.ownerDocument.defaultView.getComputedStyle(elem,null)['opacity'];
  788.                                 }
  789.                                 return alpha;
  790.                         })(element);
  791.                         //zl.log('start: '+start+" end: "+transparency);
  792.                         element.effect._fade = setInterval(function(){
  793.                                 start = start < transparency ? Math.min(start + speed, transparency) : Math.max(start - speed, transparency);
  794.                                 element.style.opacity =  start / 100;
  795.                                 element.style.filter = 'alpha(opacity=' + start + ')';
  796.                                 if(Math.round(start) == transparency){
  797.                                         element.style.opacity =  transparency / 100;
  798.                                         element.style.filter = 'alpha(opacity=' + transparency + ')';
  799.                                         clearInterval(element.effect._fade);
  800.                                         if(callback)callback.call(element);
  801.                                 }
  802.                         }, 20);
  803.                 }catch(e){
  804.                         zl.log('[Function][_fade] Change object Transparency Failure![ ' + element + '] ', e);
  805.                         return e.message;
  806.                 }
  807.         };
  808.         /*
  809.                 Change object Location
  810.                 element                 Object Dom
  811.                 position                Change Option
  812.                 speed                   Change Speed
  813.                 callback                CallBack
  814.         */
  815.         zl._move = zl.move = function(element, position, speed, callback){
  816.                 try{
  817.                         element = zl.$(element);
  818.                         if(!element.effect){
  819.                                 element.effect = {};
  820.                                 element.effect._move=0;
  821.                         }
  822.                         clearInterval(element.effect._move);
  823.                         var speed=speed||10;
  824.                         var start=(function(elem){
  825.                                 var     posi = {left:elem.offsetLeft, top:elem.offsetTop};
  826.                                 while(elem = elem.offsetParent){
  827.                                         posi.left += elem.offsetLeft;
  828.                                         posi.top += elem.offsetTop;
  829.                                 };
  830.                                 return posi;
  831.                         })(element);
  832.                         element.style.position = 'absolute';
  833.                         var     style = element.style;
  834.                         var styleArr=[];
  835.                         if(typeof(position.left)=='number')styleArr.push('left');
  836.                         if(typeof(position.top)=='number')styleArr.push('top');
  837.                         element.effect._move = setInterval(function(){
  838.                                 for(var i=0;i<styleArr.length;i++){
  839.                                         start[styleArr[i]] += (position[styleArr[i]] - start[styleArr[i]]) * speed/100;
  840.                                         style[styleArr[i]] = start[styleArr[i]] + 'px';
  841.                                 }
  842.                                 for(var i=0;i<styleArr.length;i++){
  843.                                         if(Math.round(start[styleArr[i]]) == position[styleArr[i]]){
  844.                                                 if(i!=styleArr.length-1)continue;
  845.                                         }else{
  846.                                                 break;
  847.                                         }
  848.                                         for(var i=0;i<styleArr.length;i++)style[styleArr[i]] = position[styleArr[i]] + 'px';
  849.                                         clearInterval(element.effect._move);
  850.                                         if(callback)callback.call(element);
  851.                                 }
  852.                         }, 20);
  853.                 }catch(e){
  854.                         zl.log('[Function][_move] Change object Location Failure! [' + element + '] ', e);
  855.                         return e.message;
  856.                 }
  857.         };
  858.         /*
  859.                 Change object Size
  860.                 element                 Object Dom
  861.                 size                    Object New Size Option
  862.                 speed                   Change Speed
  863.                 callback                CallBack
  864.         */
  865.         zl._reSize = zl.reSize = zl.size = function(element, size, speed, callback){
  866.                 try{
  867.                         element = zl.$(element);
  868.                         if(!element.effect){
  869.                                 element.effect = {};
  870.                                 element.effect._resize=0;
  871.                         }
  872.                         clearInterval(element.effect._resize);
  873.                         var speed=speed||10;
  874.                         var     start = {width:element.offsetWidth, height:element.offsetHeight};
  875.                         var styleArr=[];
  876.                         if(!(navigator.userAgent.toLowerCase().indexOf('msie') != -1&&document.compatMode == 'BackCompat')){
  877.                                 var CStyle=document.defaultView?document.defaultView.getComputedStyle(element,null):element.currentStyle;
  878.                                 if(typeof(size.width)=='number'){
  879.                                         styleArr.push('width');
  880.                                         size.width=size.width-CStyle.paddingLeft.replace(/\D/g,'')-CStyle.paddingRight.replace(/\D/g,'');
  881.                                 }
  882.                                 if(typeof(size.height)=='number'){
  883.                                         styleArr.push('height');
  884.                                         size.height=size.height-CStyle.paddingTop.replace(/\D/g,'')-CStyle.paddingBottom.replace(/\D/g,'');
  885.                                 }
  886.                         }
  887.                         element.style.overflow = 'hidden';
  888.                         var     style = element.style;
  889.                         element.effect._resize = setInterval(function(){
  890.                                 for(var i=0;i<styleArr.length;i++){
  891.                                         start[styleArr[i]] += (size[styleArr[i]] - start[styleArr[i]]) * speed/100;
  892.                                         style[styleArr[i]] = start[styleArr[i]] + 'px';
  893.                                 }
  894.                                 for(var i=0;i<styleArr.length;i++){
  895.                                         if(Math.round(start[styleArr[i]]) == size[styleArr[i]]){
  896.                                                 if(i!=styleArr.length-1)continue;
  897.                                         }else{
  898.                                                 break;
  899.                                         }
  900.                                         for(var i=0;i<styleArr.length;i++)style[styleArr[i]] = size[styleArr[i]] + 'px';
  901.                                         clearInterval(element.effect._resize);
  902.                                         if(callback)callback.call(element);
  903.                                 }
  904.                         }, 20);
  905.                 }catch(e){
  906.                         zl.log('[Function][_reSize] Change object Size Failure! [' + element + '] ', e);
  907.                         return e.message;
  908.                 }
  909.         };
  910.         /*
  911.                 Hide Elem Dom
  912.                 time: hide time
  913.                 val: transparency
  914.         */
  915.         zl.hide = function(elem,time,val){
  916.                 try{
  917.                         if(!zl.isset(val)) val = 0;
  918.                         if(!zl.isset(time)) time = 1;
  919.                         zl.fade(elem,val,time);
  920.                 }catch(e){
  921.                         zl.log('[Function][hide] hide object Elem Failure![ ' + elem + '] ', e);
  922.                         return e.message;
  923.                 }
  924.         };
  925.         /*
  926.                 Show Elem Dom
  927.                 time: show time
  928.                 val: transparency
  929.         */
  930.         zl.show = function(elem,time,val){
  931.                 try{
  932.                         if(!zl.isset(val)) val = 100;
  933.                         if(!zl.isset(time)) time = 1;
  934.                         zl.fade(elem,val,time);
  935.                 }catch(e){
  936.                         zl.log('[Function][show] show object Elem Failure![ ' + elem + '] ', e);
  937.                         return e.message;
  938.                 }
  939.         };
  940.         /*
  941.                 Drag Object Dom
  942.         */
  943.         zl.drag = {
  944.                 /*      Unfinished...   */
  945.         };
  946.         /*
  947.                 Dom Keys Reg or Remove
  948.                 add Registration Key in Dom . shortcut:Key,callback:Trigger The Key CallBack,opt:Key Option
  949.                 remove() Remove Key In Dom. shortcut:key.
  950.                 weburl: http://www.openjs.com/scripts/events/keyboard_shortcuts/shortcut.js
  951.         */
  952.         zl.key = zl._key = zl.shortcuts = {
  953.                 all_shortcuts : [],
  954.                 add : function(shortcut_combination,callback,opt){
  955.                         try{
  956.                                 var default_options = {'type':'keydown','propagate':false,'disable_in_input':false,'target':document,'keycode':false}
  957.                                 opt = zl.cd(default_options, opt);
  958.                                 var ele = zl.$(opt.target);
  959.                                 var ths = this;
  960.                                 shortcut_combination = shortcut_combination.toLowerCase();
  961.                                 var func = function(e){
  962.                                         e = e || window.event;
  963.                                         if(opt['disable_in_input']){
  964.                                                 var element;
  965.                                                 if(e.target) element=e.target;
  966.                                                 else if(e.srcElement) element=e.srcElement;
  967.                                                 if(element.nodeType==3) element=element.parentNode;
  968.                                                 if(element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') return;
  969.                                         }
  970.                                         if (e.keyCode) code = e.keyCode;
  971.                                         else if (e.which) code = e.which;
  972.                                         var character = String.fromCharCode(code).toLowerCase();
  973.                                         if(code == 188) character=",";
  974.                                         if(code == 190) character=".";
  975.                                         var keys = shortcut_combination.split("+");
  976.                                         var kp = 0;
  977.                                         var shift_nums = {"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":":","'":"\"",",":"<",".":">","/":"?","\\":"|"};
  978.                                         var special_keys = {'esc':27,'escape':27,'tab':9,'space':32,'return':13,'enter':13,'backspace':8,'scrolllock':145,'scroll_lock':145,'scroll':145,'capslock':20,'caps_lock':20,'caps':20,'numlock':144,'num_lock':144,'num':144,'pause':19,'break':19,'insert':45,'home':36,'delete':46,'end':35,'pageup':33,'page_up':33,'pu':33,'pagedown':34,'page_down':34,'pd':34,'left':37,'up':38,'right':39,'down':40,'f1':112,'f2':113,'f3':114,'f4':115,'f5':116,'f6':117,'f7':118,'f8':119,'f9':120,'f10':121,'f11':122,'f12':123};
  979.                                         var modifiers = {
  980.                                                 shift: { wanted:false, pressed:false},
  981.                                                 ctrl : { wanted:false, pressed:false},
  982.                                                 alt  : { wanted:false, pressed:false},
  983.                                                 meta : { wanted:false, pressed:false}
  984.                                         };
  985.                                         if(e.ctrlKey)   modifiers.ctrl.pressed = true;
  986.                                         if(e.shiftKey)  modifiers.shift.pressed = true;
  987.                                         if(e.altKey)    modifiers.alt.pressed = true;
  988.                                         if(e.metaKey)   modifiers.meta.pressed = true;
  989.                                         for(var i=0; k=keys[i],i<keys.length; i++){
  990.                                                 if(k == 'ctrl' || k == 'control') {
  991.                                                         kp++;
  992.                                                         modifiers.ctrl.wanted = true;
  993.                                                 } else if(k == 'shift') {
  994.                                                         kp++;
  995.                                                         modifiers.shift.wanted = true;
  996.                                                 } else if(k == 'alt') {
  997.                                                         kp++;
  998.                                                         modifiers.alt.wanted = true;
  999.                                                 } else if(k == 'meta') {
  1000.                                                         kp++;
  1001.                                                         modifiers.meta.wanted = true;
  1002.                                                 } else if(k.length > 1) {
  1003.                                                         if(special_keys[k] == code) kp++;
  1004.                                                 } else if(opt['keycode']) {
  1005.                                                         if(opt['keycode'] == code) kp++;
  1006.                                                 } else {
  1007.                                                         if(character == k) kp++;
  1008.                                                         else {
  1009.                                                                 if(shift_nums[character] && e.shiftKey) {
  1010.                                                                         character = shift_nums[character];
  1011.                                                                         if(character == k) kp++;
  1012.                                                                 }
  1013.                                                         }
  1014.                                                 }
  1015.                                         }
  1016.                                         if(kp == keys.length && modifiers.ctrl.pressed == modifiers.ctrl.wanted && modifiers.shift.pressed == modifiers.shift.wanted && modifiers.alt.pressed == modifiers.alt.wanted && modifiers.meta.pressed == modifiers.meta.wanted){
  1017.                                                 var re = callback(e);
  1018.                                                 if((re != undefined && !re) || (re == undefined && !opt['propagate'])){
  1019.                                                         e.cancelBubble = true;
  1020.                                                         e.returnValue = false;
  1021.                                                         if (e.stopPropagation) {
  1022.                                                                 e.stopPropagation();
  1023.                                                                 e.preventDefault();
  1024.                                                         }
  1025.                                                         return false;
  1026.                                                 }else{
  1027.                                                         e.cancelBubble = false;
  1028.                                                         e.returnValue = true;
  1029.                                                         return true;   
  1030.                                                 }
  1031.                                         }
  1032.                                 }
  1033.                                 this.all_shortcuts[shortcut_combination] = {
  1034.                                         'callback':func,
  1035.                                         'target':ele,
  1036.                                         'event': opt['type']
  1037.                                 };
  1038.                                 if(ele.addEventListener) ele.addEventListener(opt['type'], func, false);
  1039.                                 else if(ele.attachEvent) ele.attachEvent('on'+opt['type'], func);
  1040.                                 else ele['on'+opt['type']] = func;
  1041.                                 zl.log('Registration Key '+shortcut_combination+' In '+opt['target']+' on'+opt['type']+' Success!');
  1042.                         }catch(e){
  1043.                                 zl.log('[Function][key.add] Registration Key '+shortcut_combination+' Failure! ', e);
  1044.                                 return e.message;
  1045.                         }
  1046.                 },
  1047.                 remove : function(shortcut_combination) {
  1048.                         try{
  1049.                                 shortcut_combination = shortcut_combination.toLowerCase();
  1050.                                 var binding = this.all_shortcuts[shortcut_combination];
  1051.                                 delete(this.all_shortcuts[shortcut_combination])
  1052.                                 if(!binding) return;
  1053.                                 var type = binding['event'];
  1054.                                 var ele = binding['target'];
  1055.                                 var callback = binding['callback'];
  1056.                                 if(ele.detachEvent) ele.detachEvent('on'+type, callback);
  1057.                                 else if(ele.removeEventListener) ele.removeEventListener(type, callback, false);
  1058.                                 else ele['on'+type] = false;
  1059.                                 zl.log('Remove Key '+shortcut_combination+' In '+ele+' on'+type+' Success!');
  1060.                         }catch(e){
  1061.                                 zl.log('[Function][key.remove] Remove Key '+shortcut_combination+' Failure! ',e);
  1062.                                 return e.message;
  1063.                         }
  1064.                 },
  1065.                 source : 'http://www.openjs.com/scripts/events/keyboard_shortcuts/shortcut.js'
  1066.         };
  1067.         /*
  1068.                 Cookie Class
  1069.                 add     Add New Cookie Afferent NewCookie Option
  1070.                 get     Get Cookie Value Afferent Cookie Name
  1071.                 del     Delete Cookie Afferent Cookie Name
  1072.         */
  1073.         zl.cookie = zl._cookie = {
  1074.                 add : function(opt){
  1075.                         try{
  1076.                                 if(!opt.name || !opt.value){throw new Error("Error: Cookie [name] And [value] Cant Null.");}
  1077.                                 var str = opt.name + "=" + escape(opt.value);
  1078.                                 if(opt.hours){
  1079.                                         var exdate = new Date();
  1080.                                         if(opt.hourstype=='d'){
  1081.                                                 exdate.setDate(exdate.getDay()+opt.hours);
  1082.                                         }else if(opt.hourstype=='m'){
  1083.                                                 exdate.setDate(exdate.getMinutes()+opt.hours);
  1084.                                         }else{
  1085.                                                 exdate.setDate(exdate.getHours()+opt.hours);
  1086.                                         }
  1087.                                         str += ";expires=" + exdate.toGMTString();
  1088.                                 }
  1089.                                 str += (opt.path) ? ";path=" + opt.path : "";
  1090.                                 str += (opt.domain) ? ";domain=" + opt.domain : "";
  1091.                                 str += (opt.secure) ? ";secure=" + opt.secure : "";
  1092.                                 document.cookie = str;
  1093.                                 zl.log('Add Cookie [' + opt.name + ']:[' + opt.value + '] Success.');
  1094.                         }catch(e){
  1095.                                 zl.log('[Function][cookie.add] Add Cookie [' + opt.name + ']:[' + opt.value + '] Failure! ', e);
  1096.                         }
  1097.                 },
  1098.                 get : function(ckName){
  1099.                         try{
  1100.                                 if(document.cookie.length>0){
  1101.                                         if(typeof ckName == 'undefined' || ckName == '') return document.cookie.toString();
  1102.                                         var c_start = document.cookie.indexOf(ckName + "=");
  1103.                                         if(c_start != -1){
  1104.                                                 c_start = c_start+ckName.length+1;
  1105.                                                 var c_end = document.cookie.indexOf(";",c_start)
  1106.                                                 if(c_end == -1) c_end = document.cookie.length;
  1107.                                                 return unescape(document.cookie.substring(c_start,c_end));
  1108.                                         }
  1109.                                 }
  1110.                                 return null;
  1111.                         }catch(e){
  1112.                                 zl.log('[Function][cookie.get] Get Cookie [' + ckName + '] Failure! ', e);
  1113.                                 return null;   
  1114.                         }
  1115.                 },
  1116.                 del : function(ckName){
  1117.                         try{
  1118.                                 var date = new Date();
  1119.                                 date.setTime(date.getTime() - 10000);
  1120.                                 document.cookie = ckName + "=; expires=" + date.toGMTString();
  1121.                                 zl.log('Delete Cookie [' + ckName + '] Success.');
  1122.                         }catch(e){
  1123.                                 zl.log('[Function][cookie.del] Delete Cookie [' + ckName + '] Failure.');
  1124.                         }
  1125.                 }
  1126.         };
  1127.         /*
  1128.                 My Check Class
  1129.                 checkIsNull Check Afferent Object Dom Value Is Null or ''.o:object dom; return (is Null)?true:false;
  1130.                 checkIsSame Check Afferent Object Dom Value Is Same .o:object dom,r:object dom; return true or false
  1131.                 checkValLength Check Afferent Object Dom Value Length Is ok.o:object dom,n:min length,x:max length. return true or false
  1132.                 checkObject Check Afferent Object Dom RegExp Verify.o:object dom,r:RegExp;return true or false;
  1133.         */
  1134.         zl.check = zl.myCheck = {
  1135.                 checkIsNull : function(o){
  1136.                         try{
  1137.                                 if(zl.$(o) == null){
  1138.                                         if(typeof o == 'string') return (o == '' || o.replace(/(^\s+)|(\s+$i)/g,'') == '');
  1139.                                         else return false;
  1140.                                 }else{
  1141.                                         return (zl.$(o).value == '' || zl.$(o).value.replace(/(^\s+)|(\s+$i)/g,'') == '');
  1142.                                 }
  1143.                         }catch(e){
  1144.                                 return false;
  1145.                         }
  1146.                 },
  1147.                 checkIsSame : function(o,r){
  1148.                         try{
  1149.                                 if(zl.$(o) == null || zl.$(r) == null){
  1150.                                         if(typeof o == 'string' && typeof r == 'string') return (o == r);
  1151.                                         else return false;
  1152.                                 }else{
  1153.                                         return (zl.$(o).value == zl.$(r).value);
  1154.                                 }
  1155.                         }catch(e){
  1156.                                 return false;
  1157.                         }
  1158.                 },
  1159.                 checkIsInt : function(o){
  1160.                         try{
  1161.                                 if(zl.$(o) == null){
  1162.                                         if(typeof o == 'string' || typeof o == 'number') return !isNaN(o);
  1163.                                         else return false;
  1164.                                 }else{
  1165.                                         return !isNaN(zl.$(o).value);
  1166.                                 }
  1167.                         }catch(e){
  1168.                                 return false;
  1169.                         }
  1170.                 },
  1171.                 checkValLength : function(o,n,x){
  1172.                         try{
  1173.                                 if(zl.$(o) == null){
  1174.                                         if(typeof o == 'string') return (n <= o.length && o.length <= x);
  1175.                                         else return false;
  1176.                                 }else{
  1177.                                         return (n <= zl.$(o).value.length && zl.$(o).value.length <= x);
  1178.                                 }
  1179.                         }catch(e){
  1180.                                 return false;  
  1181.                         }
  1182.                 },
  1183.                 checkObject : function(o,r){
  1184.                         try{
  1185.                                 if(zl.$(o) == null){
  1186.                                         if(typeof o == 'string' && r != undefined) return (o.replace(new RegExp(r,'g'),'') == '');
  1187.                                         else return false;
  1188.                                 }else{
  1189.                                         return (zl.$(o).value.replace(new RegExp(r,'g'),'') == '');
  1190.                                 }
  1191.                         }catch(e){
  1192.                                 return false;  
  1193.                         }
  1194.                 }
  1195.         };
  1196.         /*
  1197.                 Check Object All ChildNodes Images size
  1198.                 obj             Object
  1199.                 w               Max Width
  1200.                 h               Max Height
  1201.         */
  1202.         zl.checkImage = function(obj,w,h){
  1203.                 try{
  1204.                         var ImgCell = zl.$('<img>', zl.$(obj));
  1205.                         for(var i=0; i<ImgCell.length; i++){
  1206.                                 var ImgWidth = ImgCell(i).width;
  1207.                                 var ImgHeight = ImgCell(i).height;
  1208.                                 if(ImgWidth > w){
  1209.                                         var newHeight = w*ImgHeight/ImgWidth;
  1210.                                         if(newHeight <= h){
  1211.                                                 ImgCell(i).width = w;
  1212.                                                 ImgCell(i).height = newHeight;
  1213.                                         }else{
  1214.                                                 ImgCell(i).height = h;
  1215.                                                 ImgCell(i).width = h*ImgWidth/ImgHeight;
  1216.                                         }
  1217.                                 }else{
  1218.                                         if(ImgHeight > h){
  1219.                                                 ImgCell(i).height = h;
  1220.                                                 ImgCell(i).width = h*ImgWidth/ImgHeight;
  1221.                                         }else{
  1222.                                                 ImgCell(i).width = ImgWidth;
  1223.                                                 ImgCell(i).height = ImgHeight;
  1224.                                         }
  1225.                                 }
  1226.                         }
  1227.                 }catch(e){
  1228.                         zl.log('[Function][runCode] Check Images Size Max or Min Failure!',e); 
  1229.                 }
  1230.         };
  1231.         /*
  1232.                 Check Object Html Dom is Pobj childNodes
  1233.                 obj             Object
  1234.                 parent  The ParentNode Object
  1235.                 return (obj is Pobj ChildNodes)?true:false;
  1236.         */
  1237.         zl.checkHtml = function(obj,parent){
  1238.                 try{
  1239.                         parent = zl.$(parent);
  1240.                         for(obj = zl.$(obj); obj != document.body; obj = obj.parentNode){
  1241.                                 if(!zl.isset(obj) || obj == null)
  1242.                                         return false;
  1243.                                 if(obj == parent)
  1244.                                         return true;
  1245.                         }
  1246.                         return false;
  1247.                 }catch(e){
  1248.                         zl.log('[Function][checkHtml] Check Object Dom Failure! ', e);
  1249.                         return false;
  1250.                 }
  1251.         };
  1252.         /*
  1253.                 Get Object Parent Dom
  1254.                 elem    object
  1255.                 parent  parent type
  1256.         */
  1257.         zl.getParent = function(elem,parent){
  1258.                 try{
  1259.                         elem = zl.$(elem);
  1260.                         for(; elem != document.body; elem = elem.parentNode){
  1261.                                 if(elem == undefined || elem == null) return null;
  1262.                                 if(elem.tagName.toLowerCase() == parent.toLowerCase()) return elem;
  1263.                         }
  1264.                         return null;
  1265.                 }catch(e){
  1266.                         zl.log('[Function][getParent] Get Object Parent Dom Failure! ', e);
  1267.                         return null;
  1268.                 }
  1269.         };
  1270.         /*     
  1271.                 Show Object show or hide
  1272.                 o       object
  1273.                 t       Change Time
  1274.                 opt     opt obj
  1275.                 cb      callback
  1276.         */
  1277.         zl._stips = zl.flash = function(obj,time,opt,callback){
  1278.                 try{
  1279.                         var obj = zl.$(obj);
  1280.                         opt = zl.cd({i:0,x:100,v:5},opt);
  1281.                         zl._fade(obj, opt.i, opt.v, function(){
  1282.                                 if(callback) callback.call(obj);
  1283.                                 zl._fade(obj, opt.x, opt.v, function(){
  1284.                                         setTimeout(function(){zl._stips(obj, time, opt, callback); }, time);
  1285.                                 });
  1286.                         });
  1287.                 }catch(e){
  1288.                         zl.log('[Function][flash] Show Object Dom Failure! ', e);
  1289.                 }
  1290.         };
  1291.         /*     
  1292.                 change Class Name
  1293.                 obj             object
  1294.                 newclass        New ClassName
  1295.                 oldclass        Old ClassName
  1296.                 other           OtherObject
  1297.         */
  1298.         zl.cc = zl.changDomClass = function(obj,newclass,oldclass,other){
  1299.                 try{
  1300.                         obj = zl.$(obj);
  1301.                         var op = zl.childNodes(obj.parentNode,obj.tagName);
  1302.                         for(var i=0; i<op.length; i++){
  1303.                                 if(op[i] != obj && op[i] != other && typeof oldclass != 'undefined'){
  1304.                                         op[i].className = oldclass;
  1305.                                 }else if(op[i] != other && typeof newclass != 'undefined'){
  1306.                                         op[i].className = newclass;
  1307.                                 }
  1308.                         }
  1309.                 }catch(e){
  1310.                         zl.log('[Function][changeDomClass] Change Dom Class Failure! ', e);
  1311.                 }
  1312.         };
  1313.         /*
  1314.                 Tab    
  1315.                 Tab Object Show or Hide
  1316.         */
  1317.         zl.tab = zl._tab = function(elem,obj,nclass,oclass){
  1318.                 try{
  1319.                         zl.changDomClass(elem,nclass,oclass);
  1320.                         obj = zl.$(obj);
  1321.                         var op = zl.childNodes(obj.parentNode,obj.TagName);
  1322.                         for(var i=0,c=op.length; i<c; i++){
  1323.                                 if(op[i].tagName != 'undefined' && op[i].tagName == obj.tagName){
  1324.                                         if(op[i] != obj){
  1325.                                                 op[i].style.display = 'none';
  1326.                                         }else{
  1327.                                                 op[i].style.display = '';
  1328.                                         }
  1329.                                 }
  1330.                         }
  1331.                 }catch(e){
  1332.                         zl.log('[Function][tag] Tab Object Dom Failure!',e);
  1333.                 }
  1334.         };
  1335.         /*     
  1336.                 conver Html Label
  1337.                 con             HTMl Conetnt
  1338.         */
  1339.         zl.cv = zl.converHtmlLabel = function(con){
  1340.                 //return document.createElement('div').appendChild(document.createTextNode(con)).parentNode.innerHTML;
  1341.                 return con.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
  1342.         };
  1343.         /*
  1344.                 Native Convert Ascii
  1345.         */
  1346.         zl.ascii = zl.nativeConvertAscii = function(str){
  1347.                 try{
  1348.                         var nativecode = str.split('');
  1349.                         var ascii = '';
  1350.                         for(var i = 0; i < nativecode.length; i++) {
  1351.                                 var code = Number(nativecode[i].charCodeAt(0));
  1352.                                 if (code > 127){
  1353.                                         var charAscii = code.toString(16);
  1354.                                         charAscii = new String('0000').substring(charAscii.length, 4) + charAscii;
  1355.                                         ascii += '\\u' + charAscii;
  1356.                                 } else {
  1357.                                         ascii += nativecode[i];
  1358.                                 }
  1359.                         }
  1360.                         return ascii;
  1361.                 }catch(e){
  1362.                         zl.log('[Function][ascii] Native Convert Ascii Failure!', e);
  1363.                         return '';
  1364.                 }
  1365.         };
  1366.         /*
  1367.                 Ascii Convert Natvie
  1368.         */
  1369.         zl.natvie = zl.asciiConvertNative = function(str){
  1370.                 try{
  1371.                         var asciicode = str.split('\\u');
  1372.                         var nativeValue = asciicode[0];
  1373.                         for (var i = 1; i < asciicode.length; i++) {
  1374.                                 var code = asciicode[i];
  1375.                                 nativeValue += String.fromCharCode(parseInt('0x' + code.substring(0, 4)));
  1376.                                 if(code.length > 4) {
  1377.                                         nativeValue += code.substring(4, code.length);
  1378.                                 }
  1379.                         }
  1380.                         return nativeValue;
  1381.                 }catch(e){
  1382.                         zl.log('[Function][natvie] Ascii Convert Native Failure!', e);
  1383.                         return '';
  1384.                 }
  1385.         }
  1386.         /*     
  1387.                 conver Data JSON
  1388.                 data    Conetnt
  1389.                 source  JQuery http://code.jquery.com/jquery-1.7.2.js
  1390.         */
  1391.         zl.json = zl.parseJSON = function(data){
  1392.                 try{
  1393.                         if(typeof data !== 'string' || !data){
  1394.                                 return null;
  1395.                         }
  1396.                         if(window.JSON && window.JSON.parse){
  1397.                                 return window.JSON.parse(data);
  1398.                         }
  1399.                         rvalidchars = /^[\],:{}\s]*$/,
  1400.                         rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
  1401.                         rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
  1402.                         rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g;
  1403.                         if(rvalidchars.test(data.replace(rvalidescape,'@').replace(rvalidtokens,']').replace(rvalidbraces,''))){
  1404.                                 return (new Function('return ' + data))();
  1405.                         }
  1406.                         zl.log('Invalid JSON Failure!  ' + data );
  1407.                 }catch(e){
  1408.                         zl.log('[Function][json] Invalid Json Data Failure!',e);
  1409.                         return null;
  1410.                 }
  1411.         };
  1412.         /*     
  1413.                 conver Data XML
  1414.                 data    Conetnt
  1415.                 source  JQuery http://code.jquery.com/jquery-1.7.2.js
  1416.         */
  1417.         zl.xml = zl.parseXML = function(data){
  1418.                 try{
  1419.                         if(typeof data !== 'string' || !data){
  1420.                                 return null;
  1421.                         }
  1422.                         var xml,tmp;
  1423.                         try{
  1424.                                 if(window.DOMParser){
  1425.                                         tmp = new DOMParser();
  1426.                                         xml = tmp.parseFromString(data,'text/xml');
  1427.                                 }else{
  1428.                                         xml = new ActiveXObject('Microsoft.XMLDOM');
  1429.                                         xml.async = 'false';
  1430.                                         xml.loadXML(data);
  1431.                                 }
  1432.                         }catch(e){
  1433.                                 xml = undefined;
  1434.                         }
  1435.                         if(!xml || !xml.documentElement || xml.getElementsByTagName('parsererror').length){
  1436.                                 zl.log('Invalid XML Failure:' + data);
  1437.                         }
  1438.                         return xml;
  1439.                 }catch(e){
  1440.                         zl.log('[Function][tag] Invalid XML Data Failure!',e);
  1441.                         return null;   
  1442.                 }
  1443.         };
  1444.         /*
  1445.                 MD5
  1446.                 source: http://pajhome.org.uk/crypt/md5/2.2/md5-min.js
  1447.         */
  1448.         zl.md5 = {
  1449.                 hexcase : 0,
  1450.                 init : function(s){
  1451.                         return zl.md5.hex_md5(s);
  1452.                 },
  1453.                 hex_md5 : function(a){
  1454.                         return zl.md5.rstr2hex(zl.md5.rstr_md5(zl.md5.str2rstr_utf8(a)));
  1455.                 },
  1456.                 hex_hmac_md5 : function(a,b){
  1457.                         return zl.md5.rstr2hex(zl.md5.rstr_hmac_md5(zl.md5.str2rstr_utf8(a),zl.md5.str2rstr_utf8(b)));
  1458.                 },
  1459.                 md5_vm_test : function(){
  1460.                         return zl.md5.hex_md5("abc").toLowerCase()=="900150983cd24fb0d6963f7d28e17f72";
  1461.                 },
  1462.                 rstr_md5 : function(a){
  1463.                         return zl.md5.binl2rstr(zl.md5.binl_md5(zl.md5.rstr2binl(a),a.length*8));
  1464.                 },
  1465.                 rstr_hmac_md5 : function(c,f){
  1466.                         var e=zl.md5.rstr2binl(c);
  1467.                         if(e.length>16){
  1468.                                 e=zl.md5.binl_md5(e,c.length*8)
  1469.                         }
  1470.                         var a=Array(16),d=Array(16);
  1471.                         for(var b=0;b<16;b++){
  1472.                                 a[b]=e[b]^909522486;
  1473.                                 d[b]=e[b]^1549556828
  1474.                         }
  1475.                         var g=zl.md5.binl_md5(a.concat(zl.md5.rstr2binl(f)),512+f.length*8);
  1476.                         return zl.md5.binl2rstr(zl.md5.binl_md5(d.concat(g),512+128));
  1477.                 },
  1478.                 rstr2hex : function(c){
  1479.                         try{
  1480.                                 zl.md5.hexcase
  1481.                         }
  1482.                         catch(g){
  1483.                                 zl.md5.hexcase = 0;
  1484.                         }
  1485.                         var f=zl.md5.hexcase?"0123456789ABCDEF":"0123456789abcdef";
  1486.                         var b="";
  1487.                         var a;
  1488.                         for(var d=0;d<c.length;d++){
  1489.                                 a=c.charCodeAt(d);
  1490.                                 b+=f.charAt((a>>>4)&15)+f.charAt(a&15)
  1491.                         }
  1492.                         return b;
  1493.                 },
  1494.                 str2rstr_utf8 : function(c){
  1495.                         var b="";
  1496.                         var d=-1;
  1497.                         var a,e;
  1498.                         while(++d<c.length){
  1499.                                 a=c.charCodeAt(d);
  1500.                                 e=d+1<c.length?c.charCodeAt(d+1):0;
  1501.                                 if(55296<=a&&a<=56319&&56320<=e&&e<=57343){
  1502.                                         a=65536+((a&1023)<<10)+(e&1023);
  1503.                                         d++
  1504.                                 }
  1505.                                 if(a<=127){
  1506.                                         b+=String.fromCharCode(a)
  1507.                                 }else{
  1508.                                         if(a<=2047){
  1509.                                                 b+=String.fromCharCode(192|((a>>>6)&31),128|(a&63))
  1510.                                         }else{
  1511.                                                 if(a<=65535){
  1512.                                                         b+=String.fromCharCode(224|((a>>>12)&15),128|((a>>>6)&63),128|(a&63))
  1513.                                                 }else{
  1514.                                                         if(a<=2097151){
  1515.                                                                 b+=String.fromCharCode(240|((a>>>18)&7),128|((a>>>12)&63),128|((a>>>6)&63),128|(a&63))
  1516.                                                         }
  1517.                                                 }
  1518.                                         }
  1519.                                 }
  1520.                         }
  1521.                         return b
  1522.                 },
  1523.                 rstr2binl : function(b){
  1524.                         var a=Array(b.length>>2);
  1525.                         for(var c=0;c<a.length;c++){
  1526.                                 a[c]=0
  1527.                         }
  1528.                         for(var c=0;c<b.length*8;c+=8){
  1529.                                 a[c>>5]|=(b.charCodeAt(c/8)&255)<<(c%32)
  1530.                         }
  1531.                         return a
  1532.                 },
  1533.                 binl2rstr : function(b){
  1534.                         var a="";
  1535.                         for(var c=0;c<b.length*32;c+=8){
  1536.                                 a+=String.fromCharCode((b[c>>5]>>>(c%32))&255)
  1537.                         }
  1538.                         return a
  1539.                 },
  1540.                 binl_md5 : function(p,k){
  1541.                         p[k>>5]|=128<<((k)%32);
  1542.                         p[(((k+64)>>>9)<<4)+14]=k;
  1543.                         var o=1732584193;
  1544.                         var n=-271733879;
  1545.                         var m=-1732584194;
  1546.                         var l=271733878;
  1547.                         for(var g=0;g<p.length;g+=16){
  1548.                                 var j=o;
  1549.                                 var h=n;
  1550.                                 var f=m;
  1551.                                 var e=l;
  1552.                                 o=zl.md5.md5_ff(o,n,m,l,p[g+0],7,-680876936);
  1553.                                 l=zl.md5.md5_ff(l,o,n,m,p[g+1],12,-389564586);
  1554.                                 m=zl.md5.md5_ff(m,l,o,n,p[g+2],17,606105819);
  1555.                                 n=zl.md5.md5_ff(n,m,l,o,p[g+3],22,-1044525330);
  1556.                                 o=zl.md5.md5_ff(o,n,m,l,p[g+4],7,-176418897);
  1557.                                 l=zl.md5.md5_ff(l,o,n,m,p[g+5],12,1200080426);
  1558.                                 m=zl.md5.md5_ff(m,l,o,n,p[g+6],17,-1473231341);
  1559.                                 n=zl.md5.md5_ff(n,m,l,o,p[g+7],22,-45705983);
  1560.                                 o=zl.md5.md5_ff(o,n,m,l,p[g+8],7,1770035416);
  1561.                                 l=zl.md5.md5_ff(l,o,n,m,p[g+9],12,-1958414417);
  1562.                                 m=zl.md5.md5_ff(m,l,o,n,p[g+10],17,-42063);
  1563.                                 n=zl.md5.md5_ff(n,m,l,o,p[g+11],22,-1990404162);
  1564.                                 o=zl.md5.md5_ff(o,n,m,l,p[g+12],7,1804603682);
  1565.                                 l=zl.md5.md5_ff(l,o,n,m,p[g+13],12,-40341101);
  1566.                                 m=zl.md5.md5_ff(m,l,o,n,p[g+14],17,-1502002290);
  1567.                                 n=zl.md5.md5_ff(n,m,l,o,p[g+15],22,1236535329);
  1568.                                 o=zl.md5.md5_gg(o,n,m,l,p[g+1],5,-165796510);
  1569.                                 l=zl.md5.md5_gg(l,o,n,m,p[g+6],9,-1069501632);
  1570.                                 m=zl.md5.md5_gg(m,l,o,n,p[g+11],14,643717713);
  1571.                                 n=zl.md5.md5_gg(n,m,l,o,p[g+0],20,-373897302);
  1572.                                 o=zl.md5.md5_gg(o,n,m,l,p[g+5],5,-701558691);
  1573.                                 l=zl.md5.md5_gg(l,o,n,m,p[g+10],9,38016083);
  1574.                                 m=zl.md5.md5_gg(m,l,o,n,p[g+15],14,-660478335);
  1575.                                 n=zl.md5.md5_gg(n,m,l,o,p[g+4],20,-405537848);
  1576.                                 o=zl.md5.md5_gg(o,n,m,l,p[g+9],5,568446438);
  1577.                                 l=zl.md5.md5_gg(l,o,n,m,p[g+14],9,-1019803690);
  1578.                                 m=zl.md5.md5_gg(m,l,o,n,p[g+3],14,-187363961);
  1579.                                 n=zl.md5.md5_gg(n,m,l,o,p[g+8],20,1163531501);
  1580.                                 o=zl.md5.md5_gg(o,n,m,l,p[g+13],5,-1444681467);
  1581.                                 l=zl.md5.md5_gg(l,o,n,m,p[g+2],9,-51403784);
  1582.                                 m=zl.md5.md5_gg(m,l,o,n,p[g+7],14,1735328473);
  1583.                                 n=zl.md5.md5_gg(n,m,l,o,p[g+12],20,-1926607734);
  1584.                                 o=zl.md5.md5_hh(o,n,m,l,p[g+5],4,-378558);
  1585.                                 l=zl.md5.md5_hh(l,o,n,m,p[g+8],11,-2022574463);
  1586.                                 m=zl.md5.md5_hh(m,l,o,n,p[g+11],16,1839030562);
  1587.                                 n=zl.md5.md5_hh(n,m,l,o,p[g+14],23,-35309556);
  1588.                                 o=zl.md5.md5_hh(o,n,m,l,p[g+1],4,-1530992060);
  1589.                                 l=zl.md5.md5_hh(l,o,n,m,p[g+4],11,1272893353);
  1590.                                 m=zl.md5.md5_hh(m,l,o,n,p[g+7],16,-155497632);
  1591.                                 n=zl.md5.md5_hh(n,m,l,o,p[g+10],23,-1094730640);
  1592.                                 o=zl.md5.md5_hh(o,n,m,l,p[g+13],4,681279174);
  1593.                                 l=zl.md5.md5_hh(l,o,n,m,p[g+0],11,-358537222);
  1594.                                 m=zl.md5.md5_hh(m,l,o,n,p[g+3],16,-722521979);
  1595.                                 n=zl.md5.md5_hh(n,m,l,o,p[g+6],23,76029189);
  1596.                                 o=zl.md5.md5_hh(o,n,m,l,p[g+9],4,-640364487);
  1597.                                 l=zl.md5.md5_hh(l,o,n,m,p[g+12],11,-421815835);
  1598.                                 m=zl.md5.md5_hh(m,l,o,n,p[g+15],16,530742520);
  1599.                                 n=zl.md5.md5_hh(n,m,l,o,p[g+2],23,-995338651);
  1600.                                 o=zl.md5.md5_ii(o,n,m,l,p[g+0],6,-198630844);
  1601.                                 l=zl.md5.md5_ii(l,o,n,m,p[g+7],10,1126891415);
  1602.                                 m=zl.md5.md5_ii(m,l,o,n,p[g+14],15,-1416354905);
  1603.                                 n=zl.md5.md5_ii(n,m,l,o,p[g+5],21,-57434055);
  1604.                                 o=zl.md5.md5_ii(o,n,m,l,p[g+12],6,1700485571);
  1605.                                 l=zl.md5.md5_ii(l,o,n,m,p[g+3],10,-1894986606);
  1606.                                 m=zl.md5.md5_ii(m,l,o,n,p[g+10],15,-1051523);
  1607.                                 n=zl.md5.md5_ii(n,m,l,o,p[g+1],21,-2054922799);
  1608.                                 o=zl.md5.md5_ii(o,n,m,l,p[g+8],6,1873313359);
  1609.                                 l=zl.md5.md5_ii(l,o,n,m,p[g+15],10,-30611744);
  1610.                                 m=zl.md5.md5_ii(m,l,o,n,p[g+6],15,-1560198380);
  1611.                                 n=zl.md5.md5_ii(n,m,l,o,p[g+13],21,1309151649);
  1612.                                 o=zl.md5.md5_ii(o,n,m,l,p[g+4],6,-145523070);
  1613.                                 l=zl.md5.md5_ii(l,o,n,m,p[g+11],10,-1120210379);
  1614.                                 m=zl.md5.md5_ii(m,l,o,n,p[g+2],15,718787259);
  1615.                                 n=zl.md5.md5_ii(n,m,l,o,p[g+9],21,-343485551);
  1616.                                 o=zl.md5.safe_add(o,j);
  1617.                                 n=zl.md5.safe_add(n,h);
  1618.                                 m=zl.md5.safe_add(m,f);
  1619.                                 l=zl.md5.safe_add(l,e)
  1620.                         }
  1621.                         return Array(o,n,m,l)
  1622.                 },
  1623.                 md5_cmn : function(h,e,d,c,g,f){
  1624.                         return zl.md5.safe_add(zl.md5.bit_rol(zl.md5.safe_add(zl.md5.safe_add(e,h),zl.md5.safe_add(c,f)),g),d)
  1625.                 },
  1626.                 md5_ff : function(g,f,k,j,e,i,h){
  1627.                         return zl.md5.md5_cmn((f&k)|((~f)&j),g,f,e,i,h)
  1628.                 },
  1629.                 md5_gg : function(g,f,k,j,e,i,h){
  1630.                         return zl.md5.md5_cmn((f&j)|(k&(~j)),g,f,e,i,h)
  1631.                 },
  1632.                 md5_hh : function(g,f,k,j,e,i,h){
  1633.                         return zl.md5.md5_cmn(f^k^j,g,f,e,i,h)
  1634.                 },
  1635.                 md5_ii : function(g,f,k,j,e,i,h){
  1636.                         return zl.md5.md5_cmn(k^(f|(~j)),g,f,e,i,h)
  1637.                 },
  1638.                 safe_add : function(a,d){
  1639.                         var c=(a&65535)+(d&65535);
  1640.                         var b=(a>>16)+(d>>16)+(c>>16);
  1641.                         return(b<<16)|(c&65535)
  1642.                 },
  1643.                 bit_rol : function(a,b){
  1644.                         return(a<<b)|(a>>>(32-b))
  1645.                 },
  1646.                 source : 'http://pajhome.org.uk/crypt/md5/2.2/md5-min.js'
  1647.         };
  1648.         /*
  1649.                 SHA1
  1650.                 source: http://pajhome.org.uk/crypt/md5/2.2/sha1-min.js
  1651.         */
  1652.         zl.sha1 = {
  1653.                 hexcase : 0,
  1654.                 b64pad : "",
  1655.                 init : function(s){
  1656.                         return zl.sha1.hex_sha1(s);
  1657.                 },
  1658.                 hex_sha1 : function(a){
  1659.                         return zl.sha1.rstr2hex(zl.sha1.rstr_sha1(zl.sha1.str2rstr_utf8(a)))
  1660.                 },
  1661.                 hex_hmac_sha1 : function(a,b){
  1662.                         return zl.sha1.rstr2hex(zl.sha1.rstr_hmac_sha1(zl.sha1.str2rstr_utf8(a),zl.sha1.str2rstr_utf8(b)))
  1663.                 },
  1664.                 sha1_vm_test : function(){
  1665.                         return zl.sha1.hex_sha1("abc").toLowerCase()=="a9993e364706816aba3e25717850c26c9cd0d89d"
  1666.                 },
  1667.                 rstr_sha1 : function(a){
  1668.                         return zl.sha1.binb2rstr(zl.sha1.binb_sha1(zl.sha1.rstr2binb(a),a.length*8))
  1669.                 },
  1670.                 rstr_hmac_sha1 : function(c,f){
  1671.                         var e=zl.sha1.rstr2binb(c);
  1672.                         if(e.length>16){
  1673.                                 e=zl.sha1.binb_sha1(e,c.length*8)
  1674.                         }
  1675.                         var a=Array(16),d=Array(16);
  1676.                         for(var b=0;b<16;b++){
  1677.                                 a[b]=e[b]^909522486;
  1678.                                 d[b]=e[b]^1549556828
  1679.                         }
  1680.                         var g=zl.sha1.binb_sha1(a.concat(zl.sha1.rstr2binb(f)),512+f.length*8);
  1681.                         return zl.sha1.binb2rstr(zl.sha1.binb_sha1(d.concat(g),512+160))
  1682.                 },
  1683.                 rstr2hex : function(c){
  1684.                         try{
  1685.                                 zl.sha1.hexcase
  1686.                         }catch(g){
  1687.                                 zl.sha1.hexcase=0
  1688.                         }
  1689.                         var f=zl.sha1.hexcase?"0123456789ABCDEF":"0123456789abcdef";
  1690.                         var b="";
  1691.                         var a;
  1692.                         for(var d=0;d<c.length;d++){
  1693.                                 a=c.charCodeAt(d);
  1694.                                 b+=f.charAt((a>>>4)&15)+f.charAt(a&15)
  1695.                         }
  1696.                         return b
  1697.                 },
  1698.                 str2rstr_utf8 : function(c){
  1699.                         var b="";
  1700.                         var d=-1;
  1701.                         var a,e;
  1702.                         while(++d<c.length){
  1703.                                 a=c.charCodeAt(d);
  1704.                                 e=d+1<c.length?c.charCodeAt(d+1):0;
  1705.                                 if(55296<=a&&a<=56319&&56320<=e&&e<=57343){
  1706.                                         a=65536+((a&1023)<<10)+(e&1023);
  1707.                                         d++
  1708.                                 }
  1709.                                 if(a<=127){
  1710.                                         b+=String.fromCharCode(a)
  1711.                                 }else{
  1712.                                         if(a<=2047){
  1713.                                                 b+=String.fromCharCode(192|((a>>>6)&31),128|(a&63))
  1714.                                         }else{
  1715.                                                 if(a<=65535){
  1716.                                                         b+=String.fromCharCode(224|((a>>>12)&15),128|((a>>>6)&63),128|(a&63))
  1717.                                                 }else{
  1718.                                                         if(a<=2097151){
  1719.                                                                 b+=String.fromCharCode(240|((a>>>18)&7),128|((a>>>12)&63),128|((a>>>6)&63),128|(a&63))
  1720.                                                         }
  1721.                                                 }
  1722.                                         }
  1723.                                 }
  1724.                         }
  1725.                         return b
  1726.                 },
  1727.                 rstr2binb : function(b){
  1728.                         var a=Array(b.length>>2);
  1729.                         for(var c=0;c<a.length;c++){
  1730.                                 a[c]=0
  1731.                         }
  1732.                         for(var c=0;c<b.length*8;c+=8){
  1733.                                 a[c>>5]|=(b.charCodeAt(c/8)&255)<<(24-c%32)
  1734.                         }
  1735.                         return a
  1736.                 },
  1737.                 binb2rstr : function(b){
  1738.                         var a="";
  1739.                         for(var c=0;c<b.length*32;c+=8){
  1740.                                 a+=String.fromCharCode((b[c>>5]>>>(24-c%32))&255)
  1741.                         }
  1742.                         return a
  1743.                 },
  1744.                 binb_sha1 : function(v,o){
  1745.                         v[o>>5]|=128<<(24-o%32);
  1746.                         v[((o+64>>9)<<4)+15]=o;
  1747.                         var y=Array(80);
  1748.                         var u=1732584193;
  1749.                         var s=-271733879;
  1750.                         var r=-1732584194;
  1751.                         var q=271733878;
  1752.                         var p=-1009589776;
  1753.                         for(var l=0;l<v.length;l+=16){
  1754.                                 var n=u;
  1755.                                 var m=s;
  1756.                                 var k=r;
  1757.                                 var h=q;
  1758.                                 var f=p;
  1759.                                 for(var g=0;g<80;g++){
  1760.                                         if(g<16){
  1761.                                                 y[g]=v[l+g]
  1762.                                         }
  1763.                                         else{
  1764.                                                 y[g]=zl.sha1.bit_rol(y[g-3]^y[g-8]^y[g-14]^y[g-16],1)
  1765.                                         }
  1766.                                         var z=zl.sha1.safe_add(zl.sha1.safe_add(zl.sha1.bit_rol(u,5),zl.sha1.sha1_ft(g,s,r,q)),zl.sha1.safe_add(zl.sha1.safe_add(p,y[g]),zl.sha1.sha1_kt(g)));
  1767.                                         p=q;
  1768.                                         q=r;
  1769.                                         r=zl.sha1.bit_rol(s,30);
  1770.                                         s=u;
  1771.                                         u=z
  1772.                                 }
  1773.                                 u=zl.sha1.safe_add(u,n);
  1774.                                 s=zl.sha1.safe_add(s,m);
  1775.                                 r=zl.sha1.safe_add(r,k);
  1776.                                 q=zl.sha1.safe_add(q,h);
  1777.                                 p=zl.sha1.safe_add(p,f)
  1778.                         }
  1779.                         return Array(u,s,r,q,p)
  1780.                 },
  1781.                 sha1_ft : function(e,a,g,f){
  1782.                         if(e<20){
  1783.                                 return(a&g)|((~a)&f)
  1784.                         }
  1785.                         if(e<40){
  1786.                                 return a^g^f
  1787.                         }
  1788.                         if(e<60){
  1789.                                 return(a&g)|(a&f)|(g&f)
  1790.                         }
  1791.                         return a^g^f
  1792.                 },
  1793.                 sha1_kt : function(a){
  1794.                         return(a<20)?1518500249:(a<40)?1859775393:(a<60)?-1894007588:-899497514
  1795.                 },
  1796.                 safe_add : function(a,d){
  1797.                         var c=(a&65535)+(d&65535);
  1798.                         var b=(a>>16)+(d>>16)+(c>>16);
  1799.                         return(b<<16)|(c&65535)
  1800.                 },
  1801.                 bit_rol : function(a,b){
  1802.                         return(a<<b)|(a>>>(32-b))
  1803.                 },
  1804.                 source : 'http://pajhome.org.uk/crypt/md5/2.2/sha1-min.js'
  1805.         };
  1806.         /*
  1807.                 Search In Ajax Tips In BaiDu
  1808.         */
  1809.         zl.search_ajax = {
  1810.                 /*      input   */
  1811.                 search_input : null,
  1812.                 /*      list    */
  1813.                 search_list : null,
  1814.                 /*      Show Stop Time  */
  1815.                 search_showtime : 8000,
  1816.                 /*      Show Time Func  */
  1817.                 search_timeout : null,
  1818.                 /*      Init    */
  1819.                 init : function(elem){
  1820.                         try{
  1821.                                 elem = zl.$(elem);
  1822.                                 if(elem.tagName.toUpperCase() == "INPUT"){
  1823.                                         zl.att(zl.$(elem),'onkeyup',function(){zl.search_ajax.keySearch(this,event)});
  1824.                                         return 'Success';
  1825.                                 }else{
  1826.                                         elem = zl.$('<input>',elem);
  1827.                                         for(var i in elem){
  1828.                                                 if(zl.att(elem[i],'type').toUpperCase() == 'TEXT'){
  1829.                                                         zl.att(elem[i],'onkeyup',function(){zl.search_ajax.keySearch(this,event)});
  1830.                                                         return 'Success';
  1831.                                                 }
  1832.                                         }
  1833.                                         return 'Failure';
  1834.                                 }
  1835.                         }catch(e){
  1836.                                 return e;
  1837.                         }
  1838.                 },
  1839.                 /*      Key Search      */
  1840.                 keySearch : function(elem,e){
  1841.                         e = e || window.event;
  1842.                         var keynum = 0;
  1843.                         if(window.event) keynum = e.keyCode;
  1844.                         else if(e.which) keynum = e.which;
  1845.                         if (keynum == 38 || keynum == 40) return;
  1846.                         alert(keynum);
  1847.                         zl.remove(elem,3000);
  1848.                         return;
  1849.                         elem = zl.$(elem);
  1850.                         var s_key = '';
  1851.                         if(elem.tagName.toUpperCase() == "INPUT"){
  1852.                                 s_key = elem.value;
  1853.                                 search_input = elem;
  1854.                         }else{
  1855.                                 s_key = zl.$('<input>',elem)[0].value;
  1856.                                 search_input = zl.$('<input>',elem)[0];
  1857.                         }
  1858.                         if(s_key == ''){
  1859.                                 this.clear_search();
  1860.                                 return;
  1861.                         }
  1862.                         var scripts = zl.$('<script>', zl.$('<head>')[0]);
  1863.                         for(var ijs in scripts){
  1864.                                 if(zl.att(scripts[ijs],'id') == 'BaiDuJS'){
  1865.                                         zl.remove(scripts[ijs]);
  1866.                                 }
  1867.                         }
  1868.                         var src = 'http://suggestion.baidu.com/su?wd='+encodeURIComponent(s_key)+'&p=3&cb=window.bdsug.sug&t='+(new Date()).getTime();
  1869.                         //zl.create({tagName:'script',id:'BaiDuJS',charset:'utf-8',src:src,pdom:zl.$('<head>')[0]});
  1870.                         var ajs = zl.loadjs(src,'utf-8',null,true);
  1871.                         zl.att(ajs,'id','BaiDuJS');
  1872.                         window.bdsug = {};
  1873.                         window.bdsug.sug = function(data){zl.search_ajax.search_data(data);};           //load over
  1874.                         var loc = zl.loc(elem);
  1875.                         var w = t = l = 0;
  1876.                         if(loc != null){
  1877.                                 w = loc.width;
  1878.                                 t = loc.top+loc.height+2;
  1879.                                 l = loc.left;
  1880.                         }else{
  1881.                                 w = obj.offsetWidth;
  1882.                                 t = (obj.offsetTop+obj.offsetHeight+2);
  1883.                                 l = obj.offsetLeft;
  1884.                         }
  1885.                         var css = 'position:absolute;background:#fff;width:'+w+'px;top:'+t+'px;left:'+l+'px;border:1px solid #817F82;display:none;z-index:9999;';
  1886.                         var div_search_list = zl.create({cssText:css/*,pdom:obj.parentNode*/});
  1887.                         this.clear_search();
  1888.                         this.search_list = div_search_list;
  1889.                 },
  1890.                 /*      Clear Search List       */
  1891.                 clear_search : function(){
  1892.                         if(this.search_list != null){ zl.remove(this.search_list); this.search_list = null;document.body.onclick = null;}      
  1893.                 },
  1894.                 /*      List In Click   */
  1895.                 search_click : function(elem){
  1896.                         if(this.search_input != null){
  1897.                                 this.search_input.value = elem.innerText;
  1898.                         }
  1899.                         this.clear_search();
  1900.                 },
  1901.                 /*      List In onmouseover     */
  1902.                 search_mouver : function(elem){
  1903.                         if (this.search_timeout != null) clearTimeout(this.search_timeout);
  1904.                         for(var i = 0; i < elem.parentNode.parentNode.getElementsByTagName('tr').length; i++){
  1905.                                 elem.parentNode.parentNode.getElementsByTagName('tr').item(i).className = 'soretr';
  1906.                         }
  1907.                         elem.parentNode.className = 'soretrs';
  1908.                 },
  1909.                 /*      List In onmouseout      */
  1910.                 search_mouout : function(elem){
  1911.                         if (this.search_timeout != null) clearTimeout(this.search_timeout);
  1912.                         this.search_timeout = setTimeout(this.clear_search(),this.search_showtime);
  1913.                         for(var i = 0; i < elem.parentNode.parentNode.getElementsByTagName('tr').length; i++){
  1914.                                 elem.parentNode.parentNode.getElementsByTagName('tr').item(i).className = 'soretr';
  1915.                         }
  1916.                 },
  1917.                 /*      Load Ajax List  */
  1918.                 search_data : function(data){
  1919.                         if(this.search_list != null && data.s != ''){
  1920.                                 var reary = data.s;
  1921.                                 var list_code = '<style>.soretr{cursor: default;}.soretrs{cursor: default;background-color:#EBEBEB;}.soretd{color: black;font: 14px arial;height: 25px;line-height: 25px;padding: 0 8px; text-align: left;}</style>';//.soretr:hover{background-color:#EBEBEB;}
  1922.                                 list_code += '<table id="st_list" cellspacing="0" cellpadding="2" width="100%"><tbody>';
  1923.                                 for (i = 1; i < reary.length; i++) {
  1924.                                         list_code += '<tr class="soretr"><td class="soretd">';
  1925.                                         if(reary[i].toUpperCase().indexOf(data.q.toUpperCase()) != -1)
  1926.                                                 list_code += '<span>'+data.q+'</span><b style="color: black;">'+reary[i].slice(data.q.length)+'</b></td></tr>';
  1927.                                         else
  1928.                                                 list_code += '<b style="color: black;">'+reary[i]+'</b></td></tr>';
  1929.                                 }
  1930.                                 list_code += '</tbody></table>';
  1931.                                 this.search_list.innerHTML = list_code;
  1932.                                 this.search_list.style.display = 'block';
  1933.                                 document.body.onclick = function(e){
  1934.                                         if(e.srcElement !=      this.search_input){
  1935.                                                 this.clear_search();
  1936.                                         }
  1937.                                 }
  1938.                                 /*
  1939.                                 var tds = zl.$('<td>',zl.$('st_list'));
  1940.                                 for(var td in tds){
  1941.                                         zl.att(tds[td],'onclick',this.search_click(this));
  1942.                                         zl.att(tds[td],'onmouseover',this.search_mouver(this));
  1943.                                         zl.att(tds[td],'onmouseout',this.search_mouout(this));
  1944.                                 }
  1945.                                 */
  1946.                                 /*     
  1947.                                         onclick="soclick(this);" onmouseover="mouver(this);" onmouseout="mouout(this);"
  1948.                                 */
  1949.                                 if (this.search_timeout != null) clearTimeout(this.search_timeout);
  1950.                                 this.search_timeout = setTimeout(this.clear_search(),this.search_showtime);
  1951.                                 if(this.search_input != null){ 
  1952.                                         /*      input  onkeydown        */
  1953.                                         this.search_input.onkeydown = function(e){
  1954.                                                 e = e || window.event;
  1955.                                                 var keynum = 0;
  1956.                                                 if(window.event) keynum = e.keyCode;
  1957.                                                 else if(e.which) keynum = e.which;
  1958.                                                 if (keynum == 38){
  1959.                                                         if (search_timeout != null) clearTimeout(search_timeout);
  1960.                                                         search_timeout = setTimeout(this.clear_search(),this.search_showtime);
  1961.                                                         if(this.search_list != null){
  1962.                                                                 var altr = this.search_list.getElementsByTagName('tr');
  1963.                                                                 var _i = 0;
  1964.                                                                 for(var i = 0; i < altr.length; i++){
  1965.                                                                         if (altr.item(i).className == 'soretrs') _i = i;
  1966.                                                                         altr.item(i).className = 'soretr';
  1967.                                                                 }
  1968.                                                                 if(_i > 0){
  1969.                                                                         altr.item((_i-1)).className = 'soretrs';
  1970.                                                                         this.search_input.value = altr.item((_i-1)).innerText;
  1971.                                                                 }else{
  1972.                                                                         altr.item((altr.length-1)).className = 'soretrs';
  1973.                                                                         this.search_input.value = altr.item((altr.length-1)).innerText;
  1974.                                                                 }
  1975.                                                         }
  1976.                                                         return false;
  1977.                                                 } else if (keynum == 40){
  1978.                                                         if (search_timeout != null) clearTimeout(search_timeout);
  1979.                                                         search_timeout = setTimeout(this.clear_search(),this.search_showtime);
  1980.                                                         if(this.search_list != null){
  1981.                                                                 var altr = this.search_list.getElementsByTagName('tr');
  1982.                                                                 var _i = -1;
  1983.                                                                 for(var i = 0; i < altr.length; i++){
  1984.                                                                         if (altr.item(i).className == 'soretrs') _i = i;
  1985.                                                                         altr.item(i).className = 'soretr';
  1986.                                                                 }
  1987.                                                                 if(_i+1 >= altr.length){
  1988.                                                                         altr.item(0).className = 'soretrs';
  1989.                                                                         this.search_input.value = altr.item(0).innerText;
  1990.                                                                 }else{
  1991.                                                                         altr.item((_i+1)).className = 'soretrs';
  1992.                                                                         this.search_input.value = altr.item((_i+1)).innerText;
  1993.                                                                 }
  1994.                                                         }
  1995.                                                         return false;
  1996.                                                 }
  1997.                                                 return true;
  1998.                                         }
  1999.                                         /*      input onblur    */
  2000.                                         this.search_input.onblur = function(){
  2001.                                                 setTimeout(this.clear_search(),500);
  2002.                                         }
  2003.                                 }
  2004.                         }
  2005.                 },
  2006.                 source : 'BaiDu'
  2007.         };
  2008.         /*
  2009.                 Disable Select Content
  2010.         */
  2011.         zl.noselect = zl.DisableSelect = function(elem,isdis){
  2012.                 try{
  2013.                         elem = zl.$(elem);
  2014.                         if(typeof elem == 'undefined') elem = document;
  2015.                         if(typeof isdis == 'undefined') isdis = false;
  2016.                         elem.onselectstart = function(){return isdis;} 
  2017.                 }catch(e){
  2018.                         zl.log('[function][noselect] Failure! ',e);    
  2019.                 }
  2020.         };
  2021.         /*
  2022.                 Disable Menu
  2023.         */
  2024.         zl.nomenu = zl.DisableMenu = function(elem,isdis){
  2025.                 try{
  2026.                         elem = zl.$(elem);
  2027.                         if(typeof elem == 'undefined') elem = document;
  2028.                         if(typeof isdis == 'undefined') isdis = false;
  2029.                         elem.oncontextmenu = function(){return isdis;} 
  2030.                 }catch(e){
  2031.                         zl.log('[function][nomenu] Failure! ',e);      
  2032.                 }
  2033.         };
  2034.         /*
  2035.                 Select Elem Callback
  2036.         */
  2037.         zl.selcall = zl.SelectCallback = function(elem,callback){
  2038.                 try{
  2039.                         if(typeof elem == 'undefined') elem = document;
  2040.                         elem = zl.$(elem);
  2041.                         elem.onmouseup = function(){
  2042.                                 var selDom = window.getSelection().focusNode;
  2043.                                 if(typeof selDom.tagName != 'undefined') selDom = selDom.innerText;
  2044.                                 else selDom = selDom.nodeValue;
  2045.                                 if(selDom.length > 0){
  2046.                                         if(typeof callback == 'undefined'){
  2047.                                                 //var selcon = (zl.isIE) ? this.ownerDocument.selection.createRange().text : this.ownerDocument.getSelection();
  2048.                                                 //var selcon = (zl.isIE) ? this.ownerDocument.selection.createRange().text : window.getSelection().toString();
  2049.                                                 alert(selDom);
  2050.                                         }else{
  2051.                                                 zl.run(callback);
  2052.                                         }
  2053.                                 }
  2054.                         };
  2055.                 }catch(e){
  2056.                         zl.log('[function][nomenu] Failure! ',e);      
  2057.                 }
  2058.         };
  2059.        
  2060.        
  2061.         zl.ready();
  2062.        
  2063.         window.zl = window.z = window._zl = window._z = zl;
  2064.  
  2065. })(window);
  2066.  

回复 "js常用代码整合"

这儿你可以回复上面这条便签

captcha