$WBIM.shortOption({tween:"core.ani.tween",tweenArche:"core.ani.tweenArche",arrCopy:"core.arr.copy",arrClear:"core.arr.clear",hasby:"core.arr.hasby",unique:"core.arr.unique",foreach:"core.arr.foreach",isArray:"core.arr.isArray",inArray:"core.arr.inArray",arrIndexOf:"core.arr.indexOf",findout:"core.arr.findout",domNext:"core.dom.next",domPrev:"core.dom.prev",isNode:"core.dom.isNode",addHTML:"core.dom.addHTML",insertHTML:"core.dom.insertHTML",setXY:"core.dom.setXY",contains:"core.dom.contains",position:"core.dom.position",trimNode:"core.dom.trimNode",insertAfter:"core.dom.insertAfter",insertBefore:"core.dom.insertBefore",removeNode:"core.dom.removeNode",replaceNode:"core.dom.replaceNode",Ready:"core.dom.ready",setStyle:"core.dom.setStyle",setStyles:"core.dom.setStyles",getStyle:"core.dom.getStyle",addClassName:"core.dom.addClassName",hasClassName:"core.dom.hasClassName",removeClassName:"core.dom.removeClassName",builder:"core.dom.builder",cascadeNode:"core.dom.cascadeNode",selector:"core.dom.selector",sizzle:"core.dom.sizzle",addEvent:"core.evt.addEvent",custEvent:"core.evt.custEvent",removeEvent:"core.evt.removeEvent",fireEvent:"core.evt.fireEvent",fixEvent:"core.evt.fixEvent",getEvent:"core.evt.getEvent",stopEvent:"core.evt.stopEvent",delegatedEvent:"core.evt.delegatedEvent",preventDefault:"core.evt.preventDefault",hotKey:"core.evt.hotKey",memorize:"core.func.memorize",bind:"core.func.bind",getType:"core.func.getType",methodBefore:"core.func.methodBefore",timedChunk:"core.func.timedChunk",funcEmpty:"core.func.empty",ajax:"core.io.ajax",jsonp:"core.io.jsonp",ijax:"core.io.ijax",scriptLoader:"core.io.scriptLoader",require:"core.io.require",jsonInclude:"core.json.include",jsonCompare:"core.json.compare",jsonClone:"core.json.clone",jsonToQuery:"core.json.jsonToQuery",queryToJson:"core.json.queryToJson",jsonToStr:"core.json.jsonToStr",strToJson:"core.json.strToJson",objIsEmpty:"core.obj.isEmpty",beget:"core.obj.beget",cascade:"core.obj.cascade",objSup:"core.obj.sup",parseParam:"core.obj.parseParam",bLength:"core.str.bLength",dbcToSbc:"core.str.dbcToSbc",leftB:"core.str.leftB",trim:"core.str.trim",encodeHTML:"core.str.encodeHTML",decodeHTML:"core.str.decodeHTML",parseURL:"core.str.parseURL",parseHTML:"core.str.parseHTML",queryString:"core.str.queryString",htmlToJson:"core.util.htmlToJson",cookie:"core.util.cookie",drag:"core.util.drag",timer:"core.util.timer",jobsM:"core.util.jobsM",listener:"core.util.listener",winSize:"core.util.winSize",pageSize:"core.util.pageSize",templet:"core.util.templet",queue:"core.util.queue",stack:"core.util.stack",swf:"core.util.swf",URL:"core.util.URL",scrollPos:"core.util.scrollPos",scrollTo:"core.util.scrollTo",getUniqueKey:"core.util.getUniqueKey",storage:"core.util.storage",pageletM:"core.util.pageletM"});
$WBIM.register("core.arr.isArray",function(a){return function(a){return Object.prototype.toString.call(a)==="[object Array]"}});
$WBIM.register("core.arr.findout",function(a){return function(b,c){if(!a.core.arr.isArray(b)){throw"the findout function needs an array as first parameter"}var d=[];for(var e=0,f=b.length;e<f;e+=1){if(b[e]===c){d.push(e)}}return d}});
$WBIM.register("core.arr.clear",function(a){return function(b){if(!a.core.arr.isArray(b)){throw"the clear function needs an array as first parameter"}var c=[];for(var d=0,e=b.length;d<e;d+=1){if(!a.core.arr.findout([undefined,null,""],b[d]).length){c.push(b[d])}}return c}});
$WBIM.register("core.arr.copy",function(a){return function(b){if(!a.core.arr.isArray(b)){throw"the copy function needs an array as first parameter"}return b.slice(0)}});
$WBIM.register("core.arr.foreach",function(a){var b=function(a,b){var c=[];for(var d=0,e=a.length;d<e;d+=1){var f=b(a[d],d);if(f===false){break}else if(f!==null){c[d]=f}}return c};var c=function(a,b){var c={};for(var d in a){var e=b(a[d],d);if(e===false){break}else if(e!==null){c[d]=e}}return c};return function(d,e){if(a.core.arr.isArray(d)||d.length&&d[0]!==undefined){return b(d,e)}else if(typeof d==="object"){return c(d,e)}return null}});
$WBIM.register("core.arr.hasby",function(a){return function(b,c){if(!a.core.arr.isArray(b)){throw"the hasBy function needs an array as first parameter"}var d=[];for(var e=0,f=b.length;e<f;e+=1){if(c(b[e],e)){d.push(e)}}return d}});
$WBIM.register("core.arr.indexOf",function(a){return function(a,b){if(b.indexOf){return b.indexOf(a)}for(var c=0,d=b.length;c<d;c++){if(b[c]===a){return c}}return-1}});
$WBIM.register("core.arr.inArray",function(a){return function(b,c){return a.core.arr.indexOf(b,c)>-1}});
$WBIM.register("core.arr.unique",function(a){return function(b){if(!a.core.arr.isArray(b)){throw"the unique function needs an array as first parameter"}var c=[];for(var d=0,e=b.length;d<e;d+=1){if(a.core.arr.indexOf(b[d],c)===-1){c.push(b[d])}}return c}});
$WBIM.register("core.dom.hasClassName",function(a){return function(a,b){return(new RegExp("(^|\\s)"+b+"($|\\s)")).test(a.className)}});
$WBIM.register("core.str.trim",function(a){return function(a){if(typeof a!=="string"){throw"trim need a string as parameter"}var b=a.length;var c=0;var d=/(\u3000|\s|\t|\u00A0)/;while(c<b){if(!d.test(a.charAt(c))){break}c+=1}while(b>c){if(!d.test(a.charAt(b-1))){break}b-=1}return a.slice(c,b)}});
$WBIM.register("core.dom.addClassName",function(a){return function(b,c){if(b.nodeType===1){if(!a.core.dom.hasClassName(b,c)){b.className=a.core.str.trim(b.className)+" "+c}}}});
$WBIM.register("core.dom.addHTML",function(a){return function(a,b){if(a.insertAdjacentHTML){a.insertAdjacentHTML("BeforeEnd",b)}else{var c=a.ownerDocument.createRange();c.setStartBefore(a);var d=c.createContextualFragment(b);a.appendChild(d)}}});
$WBIM.register("core.dom.sizzle",function(a){function p(a,b,c,d,e,f){for(var h=0,i=d.length;h<i;h++){var j=d[h];if(j){j=j[a];var k=false;while(j){if(j.sizcache===c){k=d[j.sizset];break}if(j.nodeType===1){if(!f){j.sizcache=c;j.sizset=h}if(typeof b!=="string"){if(j===b){k=true;break}}else if(g.filter(b,[j]).length>0){k=j;break}}j=j[a]}d[h]=k}}}function o(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){i=i[a];var j=false;while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1&&!f){i.sizcache=c;i.sizset=g}if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var b=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,c=0,d=Object.prototype.toString,e=false,f=true;[0,0].sort(function(){f=false;return 0});var g=function(a,c,e,f){e=e||[];c=c||document;var j=c;if(c.nodeType!==1&&c.nodeType!==9){return[]}if(!a||typeof a!=="string"){return e}var k=[],m,n,o,p,r=true,s=g.isXML(c),t=a,u,v,w,x;do{b.exec("");m=b.exec(t);if(m){t=m[3];k.push(m[1]);if(m[2]){p=m[3];break}}}while(m);if(k.length>1&&i.exec(a)){if(k.length===2&&h.relative[k[0]]){n=q(k[0]+k[1],c)}else{n=h.relative[k[0]]?[c]:g(k.shift(),c);while(k.length){a=k.shift();if(h.relative[a]){a+=k.shift()}n=q(a,n)}}}else{if(!f&&k.length>1&&c.nodeType===9&&!s&&h.match.ID.test(k[0])&&!h.match.ID.test(k[k.length-1])){u=g.find(k.shift(),c,s);c=u.expr?g.filter(u.expr,u.set)[0]:u.set[0]}if(c){u=f?{expr:k.pop(),set:l(f)}:g.find(k.pop(),k.length===1&&(k[0]==="~"||k[0]==="+")&&c.parentNode?c.parentNode:c,s);n=u.expr?g.filter(u.expr,u.set):u.set;if(k.length>0){o=l(n)}else{r=false}while(k.length){v=k.pop();w=v;if(!h.relative[v]){v=""}else{w=k.pop()}if(w==null){w=c}h.relative[v](o,w,s)}}else{o=k=[]}}if(!o){o=n}if(!o){g.error(v||a)}if(d.call(o)==="[object Array]"){if(!r){e.push.apply(e,o)}else if(c&&c.nodeType===1){for(x=0;o[x]!=null;x++){if(o[x]&&(o[x]===true||o[x].nodeType===1&&g.contains(c,o[x]))){e.push(n[x])}}}else{for(x=0;o[x]!=null;x++){if(o[x]&&o[x].nodeType===1){e.push(n[x])}}}}else{l(o,e)}if(p){g(p,j,e,f);g.uniqueSort(e)}return e};g.uniqueSort=function(a){if(n){e=f;a.sort(n);if(e){for(var b=1;b<a.length;b++){if(a[b]===a[b-1]){a.splice(b--,1)}}}}return a};g.matches=function(a,b){return g(a,null,null,b)};g.find=function(a,b,c){var d;if(!a){return[]}for(var e=0,f=h.order.length;e<f;e++){var g=h.order[e],i;if(i=h.leftMatch[g].exec(a)){var j=i[1];i.splice(1,1);if(j.substr(j.length-1)!=="\\"){i[1]=(i[1]||"").replace(/\\/g,"");d=h.find[g](i,b,c);if(d!=null){a=a.replace(h.match[g],"");break}}}}if(!d){d=b.getElementsByTagName("*")}return{set:d,expr:a}};g.filter=function(a,b,c,d){var e=a,f=[],i=b,j,k,l=b&&b[0]&&g.isXML(b[0]);while(a&&b.length){for(var m in h.filter){if((j=h.leftMatch[m].exec(a))!=null&&j[2]){var n=h.filter[m],o,p,q=j[1];k=false;j.splice(1,1);if(q.substr(q.length-1)==="\\"){continue}if(i===f){f=[]}if(h.preFilter[m]){j=h.preFilter[m](j,i,c,f,d,l);if(!j){k=o=true}else if(j===true){continue}}if(j){for(var r=0;(p=i[r])!=null;r++){if(p){o=n(p,j,r,i);var s=d^!!o;if(c&&o!=null){if(s){k=true}else{i[r]=false}}else if(s){f.push(p);k=true}}}}if(o!==undefined){if(!c){i=f}a=a.replace(h.match[m],"");if(!k){return[]}break}}}if(a===e){if(k==null){g.error(a)}else{break}}e=a}return i};g.error=function(a){throw"Syntax error, unrecognized expression: "+a};var h={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")}},relative:{"+":function(a,b){var c=typeof b==="string",d=c&&!/\W/.test(b),e=c&&!d;if(d){b=b.toLowerCase()}for(var f=0,h=a.length,i;f<h;f++){if(i=a[f]){while((i=i.previousSibling)&&i.nodeType!==1){}a[f]=e||i&&i.nodeName.toLowerCase()===b?i||false:i===b}}if(e){g.filter(b,a,true)}},">":function(a,b){var c=typeof b==="string",d,e=0,f=a.length;if(c&&!/\W/.test(b)){b=b.toLowerCase();for(;e<f;e++){d=a[e];if(d){var h=d.parentNode;a[e]=h.nodeName.toLowerCase()===b?h:false}}}else{for(;e<f;e++){d=a[e];if(d){a[e]=c?d.parentNode:d.parentNode===b}}if(c){g.filter(b,a,true)}}},"":function(a,b,d){var e=c++,f=p,g;if(typeof b==="string"&&!/\W/.test(b)){b=b.toLowerCase();g=b;f=o}f("parentNode",b,e,a,g,d)},"~":function(a,b,d){var e=c++,f=p,g;if(typeof b==="string"&&!/\W/.test(b)){b=b.toLowerCase();g=b;f=o}f("previousSibling",b,e,a,g,d)}},find:{ID:function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c){var d=b.getElementById(a[1]);return d?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!=="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++){if(d[e].getAttribute("name")===a[1]){c.push(d[e])}}return c.length===0?null:c}},TAG:function(a,b){return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(/\\/g,"")+" ";if(f){return a}for(var g=0,h;(h=b[g])!=null;g++){if(h){if(e^(h.className&&(" "+h.className+" ").replace(/[\t\n]/g," ").indexOf(a)>=0)){if(!c){d.push(h)}}else if(c){b[g]=false}}}return false},ID:function(a){return a[1].replace(/\\/g,"")},TAG:function(a,b){return a[1].toLowerCase()},CHILD:function(a){if(a[1]==="nth"){var b=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0;a[3]=b[3]-0}a[0]=c++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1].replace(/\\/g,"");if(!f&&h.attrMap[g]){a[1]=h.attrMap[g]}if(a[2]==="~="){a[4]=" "+a[4]+" "}return a},PSEUDO:function(a,c,d,e,f){if(a[1]==="not"){if((b.exec(a[3])||"").length>1||/^\w/.test(a[3])){a[3]=g(a[3],null,null,c)}else{var i=g.filter(a[3],c,d,true^f);if(!d){e.push.apply(e,i)}return false}}else if(h.match.POS.test(a[0])||h.match.CHILD.test(a[0])){return true}return a},POS:function(a){a.unshift(true);return a}},filters:{enabled:function(a){return a.disabled===false&&a.type!=="hidden"},disabled:function(a){return a.disabled===true},checked:function(a){return a.checked===true},selected:function(a){a.parentNode.selectedIndex;return a.selected===true},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!g(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.type},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=h.filters[e];if(f){return f(a,c,b,d)}else if(e==="contains"){return(a.textContent||a.innerText||g.getText([a])||"").indexOf(b[3])>=0}else if(e==="not"){var i=b[3];for(var j=0,k=i.length;j<k;j++){if(i[j]===a){return false}}return true}else{g.error("Syntax error, unrecognized expression: "+e)}},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling){if(d.nodeType===1){return false}}if(c==="first"){return true}d=a;case"last":while(d=d.nextSibling){if(d.nodeType===1){return false}}return true;case"nth":var e=b[2],f=b[3];if(e===1&&f===0){return true}var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling){if(d.nodeType===1){d.nodeIndex=++i}}h.sizcache=g}var j=a.nodeIndex-f;if(e===0){return j===0}else{return j%e===0&&j/e>=0}}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=h.attrHandle[c]?h.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:!g?e&&d!==false:f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":false},POS:function(a,b,c,d){var e=b[2],f=h.setFilters[e];if(f){return f(a,c,b,d)}}}};g.selectors=h;var i=h.match.POS,j=function(a,b){return"\\"+(b-0+1)};for(var k in h.match){h.match[k]=new RegExp(h.match[k].source+/(?![^\[]*\])(?![^\(]*\))/.source);h.leftMatch[k]=new RegExp(/(^(?:.|\r|\n)*?)/.source+h.match[k].source.replace(/\\(\d+)/g,j))}var l=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(m){l=function(a,b){var c=b||[],e=0;if(d.call(a)==="[object Array]"){Array.prototype.push.apply(c,a)}else{if(typeof a.length==="number"){for(var f=a.length;e<f;e++){c.push(a[e])}}else{for(;a[e];e++){c.push(a[e])}}}return c}}var n;if(document.documentElement.compareDocumentPosition){n=function(a,b){if(!a.compareDocumentPosition||!b.compareDocumentPosition){if(a==b){e=true}return a.compareDocumentPosition?-1:1}var c=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(c===0){e=true}return c}}else if("sourceIndex"in document.documentElement){n=function(a,b){if(!a.sourceIndex||!b.sourceIndex){if(a==b){e=true}return a.sourceIndex?-1:1}var c=a.sourceIndex-b.sourceIndex;if(c===0){e=true}return c}}else if(document.createRange){n=function(a,b){if(!a.ownerDocument||!b.ownerDocument){if(a==b){e=true}return a.ownerDocument?-1:1}var c=a.ownerDocument.createRange(),d=b.ownerDocument.createRange();c.setStart(a,0);c.setEnd(a,0);d.setStart(b,0);d.setEnd(b,0);var f=c.compareBoundaryPoints(Range.START_TO_END,d);if(f===0){e=true}return f}}g.getText=function(a){var b="",c;for(var d=0;a[d];d++){c=a[d];if(c.nodeType===3||c.nodeType===4){b+=c.nodeValue}else if(c.nodeType!==8){b+=g.getText(c.childNodes)}}return b};(function(){var a=document.createElement("div"),b="script"+(new Date).getTime();a.innerHTML="<a name='"+b+"'/>";var c=document.documentElement;c.insertBefore(a,c.firstChild);if(document.getElementById(b)){h.find.ID=function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c){var d=b.getElementById(a[1]);return d?d.id===a[1]||typeof d.getAttributeNode!=="undefined"&&d.getAttributeNode("id").nodeValue===a[1]?[d]:undefined:[]}};h.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}}c.removeChild(a);c=a=null})();(function(){var a=document.createElement("div");a.appendChild(document.createComment(""));if(a.getElementsByTagName("*").length>0){h.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++){if(c[e].nodeType===1){d.push(c[e])}}c=d}return c}}a.innerHTML="<a href='#'></a>";if(a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#"){h.attrHandle.href=function(a){return a.getAttribute("href",2)}}a=null})();if(document.querySelectorAll){(function(){var a=g,b=document.createElement("div");b.innerHTML="<p class='TEST'></p>";if(b.querySelectorAll&&b.querySelectorAll(".TEST").length===0){return}g=function(b,c,d,e){c=c||document;if(!e&&c.nodeType===9&&!g.isXML(c)){try{return l(c.querySelectorAll(b),d)}catch(f){}}return a(b,c,d,e)};for(var c in a){g[c]=a[c]}b=null})()}(function(){var a=document.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!a.getElementsByClassName||a.getElementsByClassName("e").length===0){return}a.lastChild.className="e";if(a.getElementsByClassName("e").length===1){return}h.order.splice(1,0,"CLASS");h.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c){return b.getElementsByClassName(a[1])}};a=null})();g.contains=document.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:function(a,b){return a!==b&&(a.contains?a.contains(b):true)};g.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":false};var q=function(a,b){var c=[],d="",e,f=b.nodeType?[b]:b;while(e=h.match.PSEUDO.exec(a)){d+=e[0];a=a.replace(h.match.PSEUDO,"")}a=h.relative[a]?a+"*":a;for(var i=0,j=f.length;i<j;i++){g(a,f[i],c)}return g.filter(d,c)};return g});
$WBIM.register("core.dom.builder",function(a){return function(b,c){var d=typeof b==="string";var e=b;if(d){e=a.C("div");e.innerHTML=b}var f,g;f={};if(c){for(j in selectorList){f[j]=a.core.dom.sizzle(c[j].toString(),e)}}else{g=a.core.dom.sizzle("[node-type]",e);for(var h=0,i=g.length;h<i;h+=1){var j=g[h].getAttribute("node-type");if(!f[j]){f[j]=[]}f[j].push(g[h])}}var k=b;if(d){k=a.C("buffer");while(e.childNodes[0]){k.appendChild(e.childNodes[0])}}return{box:k,list:f}}});
$WBIM.register("core.dom.setStyle",function(a){function b(){if("y"in b){return b.y}return b.y="filters"in a.C("div")}return function(a,c,d){if(b()){switch(c){case"opacity":a.style.filter="alpha(opacity="+d*100+")";if(!a.currentStyle||!a.currentStyle.hasLayout){a.style.zoom=1}break;case"float":c="styleFloat";default:a.style[c]=d}}else{if(c=="float"){c="cssFloat"}a.style[c]=d}}});
$WBIM.register("core.dom.insertAfter",function(a){return function(a,b){var c=b.parentNode;if(c.lastChild==b){c.appendChild(a)}else{c.insertBefore(a,b.nextSibling)}}});
$WBIM.register("core.dom.insertBefore",function(a){return function(a,b){var c=b.parentNode;c.insertBefore(a,b)}});
$WBIM.register("core.dom.removeClassName",function(a){return function(b,c){if(b.nodeType===1){if(a.core.dom.hasClassName(b,c)){b.className=b.className.replace(new RegExp("(^|\\s)"+c+"($|\\s)")," ")}}}});
$WBIM.register("core.dom.trimNode",function(a){return function(a){var b=a.childNodes;for(var c=b.length-1;c>=0;c-=1){if(b[c]&&(b[c].nodeType==3||b[c].nodeType==8)){a.removeChild(b[c])}}}});
$WBIM.register("core.dom.removeNode",function(a){return function(b){b=a.E(b)||b;try{b.parentNode.removeChild(b)}catch(c){}}});
$WBIM.register("core.evt.addEvent",function(a){return function(b,c,d){b=a.E(b);if(b==null){return false}if(typeof d!=="function"){return false}if(b.addEventListener){b.addEventListener(c,d,false)}else if(b.attachEvent){b.attachEvent("on"+c,d)}else{b["on"+c]=d}return true}});
$WBIM.register("core.evt.removeEvent",function(a){return function(b,c,d){b=a.E(b);if(b==null){return false}if(typeof d!=="function"){return false}if(b.removeEventListener){b.removeEventListener(c,d,false)}else if(b.detachEvent){b.detachEvent("on"+c,d)}b["on"+c]=null;return true}});
$WBIM.register("core.evt.fireEvent",function(a){return function(b,c){var d=a.E(b);if(d.addEventListener){var e=document.createEvent("HTMLEvents");e.initEvent(c,true,true);d.dispatchEvent(e)}else{d.fireEvent("on"+c)}}});
$WBIM.register("core.dom.getStyle",function(a){function b(){if("y"in b){return b.y}return b.y="filters"in a.C("div")}return function(a,c){if(b()){switch(c){case"opacity":var d=100;try{d=a.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(e){try{d=a.filters("alpha").opacity}catch(e){}}return d/100;case"float":c="styleFloat";default:var f=a.currentStyle?a.currentStyle[c]:null;return a.style[c]||f}}else{if(c=="float"){c="cssFloat"}try{var g=document.defaultView.getComputedStyle(a,"")}catch(e){}return a.style[c]||g?g[c]:null}}});
$WBIM.register("core.util.scrollPos",function(a){return function(a){a=a||document;var b=a.documentElement;var c=a.body;return{top:Math.max(window.pageYOffset||0,b.scrollTop,c.scrollTop),left:Math.max(window.pageXOffset||0,b.scrollLeft,c.scrollLeft)}}});
$WBIM.register("core.util.browser",function(a){var b=navigator.userAgent.toLowerCase();var c=window.external||"";var d,e,f,g,h;var i=function(a){var b=0;return parseFloat(a.replace(/\./g,function(){return b++==1?"":"."}))};try{if(/windows|win32/i.test(b)){h="windows"}else if(/macintosh/i.test(b)){h="macintosh"}else if(/rhino/i.test(b)){h="rhino"}if((e=b.match(/applewebkit\/([^\s]*)/))&&e[1]){d="webkit";g=i(e[1])}else if((e=b.match(/presto\/([\d.]*)/))&&e[1]){d="presto";g=i(e[1])}else if(e=b.match(/msie\s([^;]*)/)){d="trident";g=1;if((e=b.match(/trident\/([\d.]*)/))&&e[1]){g=i(e[1])}}else if(/gecko/.test(b)){d="gecko";g=1;if((e=b.match(/rv:([\d.]*)/))&&e[1]){g=i(e[1])}}if(/world/.test(b)){f="world"}else if(/360se/.test(b)){f="360"}else if(/maxthon/.test(b)||typeof c.max_version=="number"){f="maxthon"}else if(/tencenttraveler\s([\d.]*)/.test(b)){f="tt"}else if(/se\s([\d.]*)/.test(b)){f="sogou"}}catch(j){}var k={OS:h,CORE:d,Version:g,EXTRA:f?f:false,IE:/msie/.test(b),OPERA:/opera/.test(b),MOZ:/gecko/.test(b)&&!/(compatible|webkit)/.test(b),IE5:/msie 5 /.test(b),IE55:/msie 5.5/.test(b),IE6:/msie 6/.test(b),IE7:/msie 7/.test(b),IE8:/msie 8/.test(b),IE9:/msie 9/.test(b),IE10:/msie 10/.test(b),SAFARI:!/chrome\/([\d.]*)/.test(b)&&/\/([\da-f.]*) safari/.test(b),CHROME:/chrome\/([\d.]*)/.test(b),IPAD:/\(ipad/i.test(b),IPHONE:/\(iphone/i.test(b),ITOUCH:/\(itouch/i.test(b),MOBILE:/mobile/i.test(b)};return k});
$WBIM.register("core.obj.parseParam",function(a){return function(a,b,c){var d,e={};b=b||{};for(d in a){e[d]=a[d];if(b[d]!=null){if(c){if(a.hasOwnProperty(d)){e[d]=b[d]}}else{e[d]=b[d]}}}return e}});
$WBIM.register("core.dom.position",function(a){var b=function(b){var c,d,e,f,g,h;c=b.getBoundingClientRect();d=a.core.util.scrollPos();e=b.ownerDocument.body;f=b.ownerDocument.documentElement;g=f.clientTop||e.clientTop||0;h=f.clientLeft||e.clientLeft||0;return{l:parseInt(c.left+d["left"]-h,10)||0,t:parseInt(c.top+d["top"]-g,10)||0}};var c=function(b,c){var d,e;d=[b.offsetLeft,b.offsetTop];e=b.offsetParent;if(e!==b&&e!==c){while(e){d[0]+=e.offsetLeft;d[1]+=e.offsetTop;e=e.offsetParent}}if(a.core.util.browser.OPERA!=-1||a.core.util.browser.SAFARI!=-1&&b.style.position=="absolute"){d[0]-=document.body.offsetLeft;d[1]-=document.body.offsetTop}if(b.parentNode){e=b.parentNode}else{e=null}while(e&&!/^body|html$/i.test(e.tagName)&&e!==c){if(e.style.display.search(/^inline|table-row.*$/i)){d[0]-=e.scrollLeft;d[1]-=e.scrollTop}e=e.parentNode}return{l:parseInt(d[0],10),t:parseInt(d[1],10)}};return function(d,e){if(d==document.body){return false}if(d.parentNode==null){return false}if(d.style.display=="none"){return false}var f=a.core.obj.parseParam({parent:null},e);if(d.getBoundingClientRect){if(f.parent){var g=b(d);var h=b(f.parent);return{l:g.l-h.l,t:g.t-h.t}}else{return b(d)}}else{return c(d,f.parent||document.body)}}});
$WBIM.register("core.dom.setXY",function(a){return function(b,c){var d=a.core.dom.getStyle(b,"position");if(d=="static"){a.core.dom.setStyle(b,"position","relative");d="relative"}var e=a.core.dom.position(b);if(e==false){return}var f={l:parseInt(a.core.dom.getStyle(b,"left"),10),t:parseInt(a.core.dom.getStyle(b,"top"),10)};if(isNaN(f["l"])){f["l"]=d=="relative"?0:b.offsetLeft}if(isNaN(f["t"])){f["t"]=d=="relative"?0:b.offsetTop}if(c["l"]!=null){b.style.left=c["l"]-e["l"]+f["l"]+"px"}if(c["t"]!=null){b.style.top=c["t"]-e["t"]+f["t"]+"px"}}});
$WBIM.register("core.str.encodeHTML",function(a){return function(a){if(typeof a!=="string"){throw"encodeHTML need a string as parameter"}return a.replace(/\&/g,"&amp;").replace(/"/g,"&quot;").replace(/\</g,"&lt;").replace(/\>/g,"&gt;").replace(/\'/g,"&#39;").replace(/\u00A0/g,"&nbsp;").replace(/(\u0020|\u000B|\u2028|\u2029|\f)/g,"&#32;")}});
$WBIM.register("core.str.decodeHTML",function(a){return function(a){if(typeof a!=="string"){throw"decodeHTML need a string as parameter"}return a.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#39;/g,"'").replace(/&nbsp;/g," ").replace(/&#32;/g," ").replace(/&amp;/g,"&")}});
$WBIM.register("core.dom.cascadeNode",function(a){return function(b){var c={};var d=b.style.display||"";d=d==="none"?"":d;var e=[];c.setStyle=function(e,f){a.core.dom.setStyle(b,e,f);if(e==="display"){d=f==="none"?"":f}return c};c.insertAfter=function(d){a.core.dom.insertAfter(d,b);return c};c.insertBefore=function(d){a.core.dom.insertBefore(d,b);return c};c.addClassName=function(d){a.core.dom.addClassName(b,d);return c};c.removeClassName=function(d){a.core.dom.removeClassName(b,d);return c};c.trimNode=function(){a.core.dom.trimNode(b);return c};c.removeNode=function(){a.core.dom.removeNode(b);return c};c.on=function(d,f){for(var g=0,h=e.length;g<h;g+=1){if(e[g]["fn"]===f&&e[g]["type"]===d){return c}}e.push({fn:f,type:d});a.core.evt.addEvent(b,d,f);return c};c.unon=function(d,f){for(var g=0,h=e.length;g<h;g+=1){if(e[g]["fn"]===f&&e[g]["type"]===d){a.core.evt.removeEvent(b,f,d);e.splice(g,1);break}}return c};c.fire=function(d){a.core.evt.fireEvent(d,b);return c};c.appendChild=function(a){b.appendChild(a);return c};c.removeChild=function(a){b.removeChild(a);return c};c.toggle=function(){if(b.style.display==="none"){b.style.display=d}else{b.style.display="none"}return c};c.show=function(){if(b.style.display==="none"){if(d==="none"){b.style.display=""}else{b.style.display=d}}return c};c.hidd=function(){if(b.style.display!=="none"){b.style.display="none"}return c};c.hide=c.hidd;c.scrollTo=function(a,d){if(a==="left"){b.scrollLeft=d}if(a==="top"){b.scrollTop=d}return c};c.replaceChild=function(a,d){b.replaceChild(a,d);return c};c.position=function(c){if(c!==undefined){a.core.dom.setXY(b,c)}return a.core.dom.position(b)};c.setPosition=function(d){if(d!==undefined){a.core.dom.setXY(b,d)}return c};c.getPosition=function(c){return a.core.dom.position(b)};c.html=function(a){if(a!==undefined){b.innerHTML=a}return b.innerHTML};c.setHTML=function(a){if(a!==undefined){b.innerHTML=a}return c};c.getHTML=function(){return b.innerHTML};c.text=function(c){if(c!==undefined){b.innerHTML=a.core.str.encodeHTML(c)}return a.core.str.decodeHTML(b.innerHTML)};c.ttext=c.text;c.setText=function(d){if(d!==undefined){b.innerHTML=a.core.str.encodeHTML(d)}return c};c.getText=function(){return a.core.str.decodeHTML(b.innerHTML)};c.get=function(c){if(c==="node"){return b}return a.core.dom.getStyle(b,c)};c.getStyle=function(c){return a.core.dom.getStyle(b,c)};c.getOriginNode=function(){return b};c.destroy=function(){for(var c=0,f=e;c<f;c+=1){a.core.evt.removeEvent(b,e[c]["fn"],e[c]["type"])}d=null;e=null;b=null};return c}});
$WBIM.register("core.dom.contains",function(a){return function(a,b){if(a===b){return false}else if(a.compareDocumentPosition){return(a.compareDocumentPosition(b)&16)===16}else if(a.contains&&b.nodeType===1){return a.contains(b)}else{while(b=b.parentNode){if(a===b){return true}}}return false}});
$WBIM.register("core.dom.cssText",function(a){var b=function(a){var b=0;var c=[];var d="close";var e=false;var f=null;var g=function(d){c.push({type:"info",content:a.slice(0,b)});c.push({type:"sign",content:a.slice(b,b+1)});a=a.slice(b+1);b=0};while(a){var h=a.charAt(b);switch(h){case":":if(!e){if(d==="close"){c.push({type:"attr",content:a.slice(0,b)});c.push({type:"sign",content:a.slice(b,b+1)});a=a.slice(b+1);b=0;d="open";break}}b+=1;break;case";":if(!e){if(d==="open"){c.push({type:"info",content:a.slice(0,b)});c.push({type:"sign",content:a.slice(b,b+1)})}a=a.slice(b+1);b=0;d="close";break}b+=1;break;case'"':case"'":if(e){if(h===f){e=!e;f=null}}else{e=!e;f=h}b+=1;break;case" ":case"!":case",":case"(":case")":g(h);break;case"":c.push({type:"info",content:a.slice(0,b)});a="";b=0;break;default:b+=1}}return c};var c=function(a){var b={};var c;for(var d=0,e=a.length;d<e;d+=1){if(a[d].type==="attr"){c=a[d]["content"];b[c]=""}else if(a[d].type==="sign"&&a[d]["content"]===";"){c=null;continue}else if(a[d].type==="sign"&&a[d]["content"]===":"){continue}else{if(c!==null){b[c]+=a[d]["content"]}}}return b};var d={webkit:"-webkit-",presto:"-o-",trident:"-ms-",gecko:"-moz-"}[a.core.util.browser.CORE];var e=["transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","animation","animation-delay","animation-direction","animation-duration","animation-iteration-count","animation-name","animation-play-state","animation-timing-function"];var f=function(a){for(var b=0,c=e.length;b<c;b+=1){if(a===e[b]){return true}}return false};return function(a){var e=c(b(a||""));var g=function(a,b){a=a.toLowerCase();e[a]=b;if(f(a)){e[d+a]=b}return h};var h={push:g,remove:function(a){a=a.toLowerCase();e[a]&&delete e[a];if(f(a)){if(e[d+a]){delete e[d+a]}}return h},merge:function(a){var d=c(b(a||""));for(var e in d){g(e,d[e])}},getCss:function(){var a=[];for(var b in e){a.push(b+":"+e[b])}return a.join(";")}};return h}});
$WBIM.register("core.dom.dir",function(a){var b={parent:"parentNode",next:"nextSibling",prev:"previousSibling"};var c=function(c,d){d=a.core.obj.parseParam({dir:"parent",expr:undefined,endpoint:document,matchAll:false},d);var e=b[d.dir],f=d.expr,g=d.endpoint,h=!!d.matchAll;if(!c){throw"core.dom.dir: el is undefined."}if(!e){throw"core.dom.dir: spec.dir is undefined."}var i=[],j=c[e];while(j){if(j.nodeType==1){if(!f||a.core.dom.sizzle.matches(f,[j]).length>0){i.push(j);if(!h){break}}}if(j==g){break}j=j[e]}return i};c.parent=function(a,b){b=b||{};b.dir="parent";return c(a,b)};c.prev=function(a,b){b=b||{};b.dir="prev";return c(a,b)};c.next=function(a,b){b=b||{};b.dir="next";return c(a,b)};return c});
$WBIM.register("core.dom.firstChild",function(a){var b=a.core.dom.dir;return function(a){if(a.firstElementChild){return a.firstElementChild}var c=a.firstChild;if(c&&c.nodeType!=1){c=b.next(c)[0]}return c}});
$WBIM.register("core.dom.isNode",function(a){return function(a){return a!=undefined&&Boolean(a.nodeName)&&Boolean(a.nodeType)}});
$WBIM.register("core.util.hideContainer",function(a){var b;var c=function(){if(b)return;b=a.C("div");b.style.cssText="position:absolute;top:-9999px;left:-9999px;";document.getElementsByTagName("head")[0].appendChild(b)};var d={appendChild:function(d){if(a.core.dom.isNode(d)){c();b.appendChild(d)}},removeChild:function(c){if(a.core.dom.isNode(c)){b&&b.removeChild(c)}}};return d});
$WBIM.register("core.dom.getSize",function(a){var b=function(b){if(!a.core.dom.isNode(b)){throw"core.dom.getSize need Element as first parameter"}return{width:b.offsetWidth,height:b.offsetHeight}};var c=function(a){var c=null;if(a.style.display==="none"){a.style.visibility="hidden";a.style.display="";c=b(a);a.style.display="none";a.style.visibility="visible"}else{c=b(a)}return c};return function(b){var d={};if(!b.parentNode){a.core.util.hideContainer.appendChild(b);d=c(b);a.core.util.hideContainer.removeChild(b)}else{d=c(b)}return d}});
$WBIM.register("core.dom.insertHTML",function(a){return function(b,c,d){b=a.E(b)||document.body;d=d?d.toLowerCase():"beforeend";if(b.insertAdjacentHTML){switch(d){case"beforebegin":b.insertAdjacentHTML("BeforeBegin",c);return b.previousSibling;case"afterbegin":b.insertAdjacentHTML("AfterBegin",c);return b.firstChild;case"beforeend":b.insertAdjacentHTML("BeforeEnd",c);return b.lastChild;case"afterend":b.insertAdjacentHTML("AfterEnd",c);return b.nextSibling}throw'Illegal insertion point -> "'+d+'"'}else{var e=b.ownerDocument.createRange();var f;switch(d){case"beforebegin":e.setStartBefore(b);f=e.createContextualFragment(c);b.parentNode.insertBefore(f,b);return b.previousSibling;case"afterbegin":if(b.firstChild){e.setStartBefore(b.firstChild);f=e.createContextualFragment(c);b.insertBefore(f,b.firstChild);return b.firstChild}else{b.innerHTML=c;return b.firstChild}break;case"beforeend":if(b.lastChild){e.setStartAfter(b.lastChild);f=e.createContextualFragment(c);b.appendChild(f);return b.lastChild}else{b.innerHTML=c;return b.lastChild}break;case"afterend":e.setStartAfter(b);f=e.createContextualFragment(c);b.parentNode.insertBefore(f,b.nextSibling);return b.nextSibling}throw'Illegal insertion point -> "'+d+'"'}}});
$WBIM.register("core.dom.insertElement",function(a){return function(b,c,d){b=a.E(b)||document.body;d=d?d.toLowerCase():"beforeend";switch(d){case"beforebegin":b.parentNode.insertBefore(c,b);break;case"afterbegin":b.insertBefore(c,b.firstChild);break;case"beforeend":b.appendChild(c);break;case"afterend":if(b.nextSibling){b.parentNode.insertBefore(c,b.nextSibling)}else{b.parentNode.appendChild(c)}break}}});
$WBIM.register("core.func.getType",function(a){return function(a){var b;return((b=typeof a)=="object"?a==null&&"null"||Object.prototype.toString.call(a).slice(8,-1):b).toLowerCase()}});
$WBIM.register("core.dom.ready",function(a){var b=[];var c=false;var d=a.core.func.getType;var e=a.core.util.browser;var f=a.core.evt.addEvent;var g=function(){if(!c){if(document.readyState==="complete"){return true}}return c};var h=function(){if(c==true){return}c=true;for(var a=0,e=b.length;a<e;a++){if(d(b[a])==="function"){try{b[a].call()}catch(f){}}}b=[]};var i=function(){if(g()){h();return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,25);return}h()};var j=function(){if(g()){h();return}setTimeout(arguments.callee,25)};var k=function(){f(document,"DOMContentLoaded",h)};var l=function(){f(window,"load",h)};if(!g()){if(a.IE&&window===window.top){i()}k();j();l()}return function(a){if(g()){if(d(a)==="function"){a.call()}}else{b.push(a)}}});
$WBIM.register("core.dom.isDomReady",function(a){var b=false;a.core.dom.ready(function(){b=true});return function(){return b}});
$WBIM.register("core.dom.lastChild",function(a){var b=a.core.dom.dir;return function(a){if(a.lastElementChild){return a.lastElementChild}var c=a.lastChild;if(c&&c.nodeType!=1){c=b.prev(c)[0]}return c}});
$WBIM.register("core.dom.neighbor",function(a){function c(b,c){a.log("warning",b,c)}var b=function(b,c,d){return b&&a.core.dom.dir(b,{dir:c,expr:d})[0]};var d=function(d){var e=d;var f={getCurrent:function(){return e},setCurrent:function(a){if(a){e=a}return f},finish:function(){var a=e;e=null;return a},parent:function(a){var d=b(e,"parent",a);if(d){e=d}else{c("parent",a)}return f},child:function(b){var d=b?a.core.dom.sizzle(b,e)[0]:a.core.dom.firstChild(e);if(d){e=d}else{c("child",b)}return f},firstChild:function(){var b=a.core.dom.firstChild(e);if(b){e=b}else{c("firstChild")}return f},lastChild:function(){var b=a.core.dom.lastChild(e);if(b){e=b}else{c("lastChild")}return f},prev:function(a){var d=b(e,"prev",a);if(d){e=d}else{c("prev",a)}return f},next:function(a){var d=b(e,"next",a);if(d){e=d}else{c("next",a)}return f},destroy:function(){e=null}};return f};return d});
$WBIM.register("core.dom.next",function(a){return function(a){var b=a.nextSibling;while(b&&b.nodeType!==1){b=b.nextSibling}return b}});
$WBIM.register("core.dom.prev",function(a){return function(a){var b=a.previousSibling;while(b&&b.nodeType!==1){b=b.previousSibling}return b}});
$WBIM.register("core.dom.replaceNode",function(a){return function(a,b){if(a==null||b==null){throw"replaceNode need node as paramster"}b.parentNode.replaceChild(a,b)}});
$WBIM.register("core.dom.selector",function(a){var b=function(b,c,d,e){var f=[];if(typeof b==="string"){var g=a.core.dom.sizzle(b,c,d,e);for(var h=0,i=g.length;h<i;h+=1){f[h]=g[h]}}else if(a.core.dom.isNode(b)){if(c){if(a.core.dom.contains(c,b)){f=[b]}}else{f=[b]}}else if(a.core.arr.isArray(b)){if(c){for(var h=0,i=b.length;h<i;h+=1){if(a.core.dom.contains(c,b[h])){f.push(b[h])}}}else{f=b}}return f};return function(c,d,e,f){var g=b.apply(window,arguments);g.on=function(b,c){for(var d=0,e=g.length;d<e;d+=1){a.core.evt.addEvent(g[d],b,c)}return g};g.css=function(b,c){for(var d=0,e=g.length;d<e;d+=1){a.core.dom.setStyle(g[d],b,c)}return g};g.show=function(){for(var a=0,b=g.length;a<b;a+=1){g[a].style.display=""}return g};g.hidd=function(){for(var a=0,b=g.length;a<b;a+=1){g[a].style.display="none"}return g};g.hide=g.hidd;return g}});
$WBIM.register("core.dom.selectText",function(a){return function(a,b){var c=b.start;var d=b.len||0;a.focus();if(a.setSelectionRange){a.setSelectionRange(c,c+d)}else if(a.createTextRange){var e=a.createTextRange();e.collapse(1);e.moveStart("character",c);e.moveEnd("character",d);e.select()}}});
$WBIM.register("core.dom.setStyles",function(a){return function(b,c,d){if(!a.core.arr.isArray(b))var b=[b];for(var e=0,f=b.length;e<f;e++){a.core.dom.setStyle(b[e],c,d)}return b}});
$WBIM.register("core.dom.textSelectArea",function(a){return function(a){var b={start:0,len:0};if(typeof a.selectionStart==="number"){b.start=a.selectionStart;b.len=a.selectionEnd-a.selectionStart}else if(typeof document.selection!=="undefined"){var c=document.selection.createRange();if(a.tagName==="INPUT"){var d=a.createTextRange()}else if(a.tagName==="TEXTAREA"){var d=c.duplicate();d.moveToElementText(a)}d.setEndPoint("EndToStart",c);b.start=d.text.length;b.len=c.text.length;var e=0;d.moveEnd("character",a.value.length-b.start);d.moveStart("character",b.start);for(var f=b.start;f<a.value.length;f+=1){if(d.compareEndPoints("StartToStart",c)<0){d.moveStart("character",1);e+=2}else{break}}b.start+=e;c=null;d=null}return b}});
$WBIM.register("core.dom.toggleClassName",function(a){return function(b,c){if(a.core.dom.hasClassName(b,c)){a.core.dom.removeClassName(b,c)}else{a.core.dom.addClassName(b,c)}}});
$WBIM.register("core.util.getUniqueKey",function(a){var b=(new Date).getTime().toString(),c=1;return function(){return b+c++}});
$WBIM.register("core.dom.uniqueID",function(a){return function(b){return b&&(b.uniqueID||(b.uniqueID=a.core.util.getUniqueKey()))}});
$WBIM.register("core.evt.custEvent",function(a){var b="__custEventKey__",c=1,d={},e=function(a,c){var e=typeof a=="number"?a:a[b];return e&&d[e]&&{obj:typeof c=="string"?d[e][c]:d[e],key:e}};var f={};var g=function(a,b,c,d,f){if(a&&typeof b=="string"&&c){var g=e(a,b);if(!g||!g.obj){throw"custEvent ("+b+") is undefined !"}g.obj.push({fn:c,data:d,once:f});return g.key}};var h=function(b,c,d,f){var g=true;var h=function(){g=false};if(b&&typeof c=="string"){var i=e(b,c),j;if(i&&(j=i.obj)){d=typeof d!="undefined"&&[].concat(d)||[];for(var k=j.length-1;k>-1&&j[k];k--){var l=j[k].fn;var m=j[k].once;if(l&&l.apply){try{l.apply(b,[{obj:b,type:c,data:j[k].data,preventDefault:h}].concat(d));if(m){j.splice(k,1)}}catch(n){a.log("[error][custEvent]"+n.message,n,n.stack)}}}if(g&&a.core.func.getType(f)==="function"){f()}return i.key}}};var i={define:function(a,e){if(a&&e){var f=typeof a=="number"?a:a[b]||(a[b]=c++),g=d[f]||(d[f]={});e=[].concat(e);for(var h=0;h<e.length;h++){g[e[h]]||(g[e[h]]=[])}return f}},undefine:function(a,c){if(a){var e=typeof a=="number"?a:a[b];if(e&&d[e]){if(c){c=[].concat(c);for(var f=0;f<c.length;f++){if(c[f]in d[e])delete d[e][c[f]]}}else{delete d[e]}}}},add:function(a,b,c,d){return g(a,b,c,d,false)},once:function(a,b,c,d){return g(a,b,c,d,true)},remove:function(b,c,d){if(b){var f=e(b,c),g,h;if(f&&(g=f.obj)){if(a.core.arr.isArray(g)){if(d){var i=0;while(g[i]){if(g[i].fn===d){break}i++}g.splice(i,1)}else{g.splice(0,g.length)}}else{for(var i in g){g[i]=[]}}return f.key}}},fire:function(a,b,c,d){return h(a,b,c,d)},hook:function(a,e,g){if(!a||!e||!g){return}var j=[],k=a[b],l=k&&d[k],m,n=e[b]||(e[b]=c++),o;if(l){o=f[k+"_"+n]||(f[k+"_"+n]={});var p=function(a){var b=true;h(e,o[a.type].type,Array.prototype.slice.apply(arguments,[1,arguments.length]),function(){b=false});b&&a.preventDefault()};for(var q in g){var r=g[q];if(!o[q]){if(m=l[q]){m.push({fn:p,data:undefined});o[q]={fn:p,type:r};j.push(r)}}}i.define(e,j)}},unhook:function(a,c,d){if(!a||!c||!d){return}var e=a[b],g=c[b],h=f[e+"_"+g];if(h){for(var j in d){var k=d[j];if(h[j]){i.remove(a,j,h[j].fn)}}}},destroy:function(){d={};c=1;f={}}};return i});
$WBIM.register("core.json.queryToJson",function(a){return function(b,c){var d=a.core.str.trim(b).split("&");var e={};var f=function(a){if(c){return decodeURIComponent(a)}else{return a}};for(var g=0,h=d.length;g<h;g++){if(d[g]){var i=d[g].split("=");var j=i[0];var k=i[1];if(i.length<2){k=j;j="$nullName"}if(!e[j]){e[j]=f(k)}else{if(a.core.arr.isArray(e[j])!=true){e[j]=[e[j]]}e[j].push(f(k))}}}return e}});
$WBIM.register("core.evt.getEvent",function(a){return function(){if(document.addEventListener){return function(){var a=arguments.callee;var b;do{b=a.arguments[0];if(b&&/Event/.test(Object.prototype.toString.call(b))){return b}}while(a=a.caller);return b}}else{return function(){return window.event}}}()});
$WBIM.register("core.evt.fixEvent",function(a){var b="clientX clientY pageX pageY screenX screenY".split(" ");return function(b){b=b||a.core.evt.getEvent();if(!b.target){b.target=b.srcElement||document}if(b.pageX==null&&b.clientX!=null){var c=document.documentElement;var d=document.body;b.pageX=b.clientX+(c.scrollLeft||d&&d.scrollLeft||0)-(c.clientLeft||d&&d.clientLeft||0);b.pageY=b.clientY+(c.scrollTop||d&&d.scrollTop||0)-(c.clientTop||d&&d.clientTop||0)}if(!b.which&&b.button){if(b.button&1){b.which=1}else if(b.button&4){b.which=2}else if(b.button&2){b.which=3}}if(b.relatedTarget===undefined){b.relatedTarget=b.fromElement||b.toElement}if(b.layerX==null&&b.offsetX!=null){b.layerX=b.offsetX;b.layerY=b.offsetY}return b}});
$WBIM.register("core.obj.isEmpty",function(a){return function(a,b){for(var c in a){if(b||a.hasOwnProperty(c)){return false}}return true}});
$WBIM.register("core.func.empty",function(){return function(){}});
$WBIM.register("core.evt.delegatedEvent",function(a){var b=function(b,c){for(var d=0,e=b.length;d<e;d+=1){if(a.core.dom.contains(b[d],c)){return true}}return false};return function(c,d){if(!a.core.dom.isNode(c)){throw"core.evt.delegatedEvent need an Element as first Parameter"}if(!d){d=[]}if(!a.core.arr.isArray(d)){d=[d]}var e={};var f=function(b){var c=a.core.evt.fixEvent(b);var d=c.target;var e=b.type;g(d,e,c)};var g=function(f,g,h){var i=null;var j=function(){var b,d,e;b=f.getAttribute("action-target");if(b){d=a.core.dom.sizzle(b,c);if(d.length){e=h.target=d[0]}}j=a.core.func.empty;return e};var k=function(){var b=j()||f;if(e[g]&&e[g][i]){return e[g][i]({evt:h,el:b,box:c,data:a.core.json.queryToJson(b.getAttribute("action-data")||"")})}else{return true}};if(b(d,f)){return false}else if(!a.core.dom.contains(c,f)){return false}else{while(f&&f!==c){if(f.nodeType===1){i=f.getAttribute("action-type");if(i&&k()===false){break}}f=f.parentNode}}};var h={};h.add=function(b,d,g){if(!e[d]){e[d]={};a.core.evt.addEvent(c,d,f)}var h=e[d];h[b]=g};h.remove=function(b,d){if(e[d]){delete e[d][b];if(a.core.obj.isEmpty(e[d])){delete e[d];a.core.evt.removeEvent(c,d,f)}}};h.pushExcept=function(a){d.push(a)};h.removeExcept=function(a){if(!a){d=[]}else{for(var b=0,c=d.length;b<c;b+=1){if(d[b]===a){d.splice(b,1)}}}};h.clearExcept=function(a){d=[]};h.fireAction=function(b,d,f,g){var h="";if(g&&g["actionData"]){h=g["actionData"]}if(e[d]&&e[d][b]){e[d][b]({evt:f,el:null,box:c,data:a.core.json.queryToJson(h),fireFrom:"fireAction"})}};h.fireInject=function(b,d,f){var g=b.getAttribute("action-type");var h=b.getAttribute("action-data");if(g&&e[d]&&e[d][g]){e[d][g]({evt:f,el:b,box:c,data:a.core.json.queryToJson(h||""),fireFrom:"fireInject"})}};h.fireDom=function(a,b,c){g(a,b,c||{})};h.destroy=function(){for(var b in e){for(var d in e[b]){delete e[b][d]}delete e[b];a.core.evt.removeEvent(c,b,f)}};return h}});
$WBIM.register("core.evt.getActiveElement",function(a){return function(){try{var b=a.core.evt.getEvent();return document.activeElement?document.activeElement:b.explicitOriginalTarget}catch(c){return document.body}}});
$WBIM.register("core.evt.hasEvent",function(a){var b={};return function(c,d){if(typeof d!=="string"){throw new Error("[STK.core.evt.hasEvent] tagName is not a String!")}d=d.toLowerCase();c="on"+c;if(b[d]&&b[d][c]!==undefined){return b[d][c]}var e=a.C(d),f=c in e;if(!f){e.setAttribute(c,"return;");f=typeof e[c]==="function"}b[d]||(b[d]={});b[d][c]=f;e=null;return f}});
$WBIM.register("core.evt.hitTest",function(a){function b(b){var c=STK.E(b);var d=a.core.dom.position(c);var e={left:d.l,top:d.t,right:d.l+c.offsetWidth,bottom:d.t+c.offsetHeight};return e}return function(c,d){var e=b(c);if(d==null){d=a.core.evt.getEvent()}else if(d.nodeType==1){var f=b(d);if(e.right>f.left&&e.left<f.right&&e.bottom>f.top&&e.top<f.bottom){return true}return false}else if(d.clientX==null){throw"core.evt.hitTest: ["+d+":oEvent] is not a valid value"}var g=a.core.util.scrollPos();var h=d.clientX+g.left;var i=d.clientY+g.top;return h>=e.left&&h<=e.right&&i>=e.top&&i<=e.bottom}});
$WBIM.register("core.evt.stopEvent",function(a){return function(b){b=b||a.core.evt.getEvent();if(b.preventDefault){b.preventDefault();b.stopPropagation()}else{b.cancelBubble=true;b.returnValue=false}return false}});
$WBIM.register("core.evt.preventDefault",function(a){return function(b){b=b||a.core.evt.getEvent();if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}}});
$WBIM.register("core.evt.hotKey",function(a){var b=a.core.dom.uniqueID;var c={reg1:/^keypress|keydown|keyup$/,keyMap:{27:"esc",9:"tab",32:"space",10:"enter",13:"enter",8:"backspace",145:"scrollclock",20:"capslock",144:"numlock",19:"pause",45:"insert",36:"home",46:"delete",35:"end",33:"pageup",34:"pagedown",37:"left",38:"up",39:"right",40:"down",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",191:"/",17:"ctrl",16:"shift",109:"-",107:"=",219:"[",221:"]",220:"\\",222:"'",187:"=",188:",",189:"-",190:".",191:"/",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",110:".",111:"/"},keyEvents:{}};c.preventDefault=function(){this.returnValue=false};c.handler=function(a){a=a||window.event;if(!a.target){a.target=a.srcElement||document}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode)){a.which=a.charCode||a.keyCode}if(!a.preventDefault)a.preventDefault=c.preventDefault;var d=b(this),e,f;if(d&&(e=c.keyEvents[d])&&(f=e[a.type])){var g;switch(a.type){case"keypress":if(a.ctrlKey||a.altKey)return;if(a.which==13)g=c.keyMap[13];if(a.which==32)g=c.keyMap[32];if(a.which>=33&&a.which<=126)g=String.fromCharCode(a.which);break;case"keyup":case"keydown":if(c.keyMap[a.which]){g=c.keyMap[a.which]}if(!g){if(a.which>=48&&a.which<=57){g=String.fromCharCode(a.which)}else if(a.which>=65&&a.which<=90){g=String.fromCharCode(a.which+32)}}if(g&&a.type=="keydown"){e.linkedKey+=e.linkedKey?">"+g:g;if(a.altKey)g="alt+"+g;if(a.shiftKey)g="shift+"+g;if(a.ctrlKey)g="ctrl+"+g}break}var h=/^select|textarea|input$/.test(a.target.nodeName.toLowerCase());if(g){var i=[],j=false;if(e.linkedKey&&e.linkKeyStr){if(e.linkKeyStr.indexOf(" "+e.linkedKey)!=-1){if(e.linkKeyStr.indexOf(" "+e.linkedKey+" ")!=-1){i=i.concat(f[e.linkedKey]);e.linkedKey=""}j=true}else{e.linkedKey=""}}if(!j)i=i.concat(f[g]);for(var k=0;k<i.length;k++){if(i[k]&&(!i[k].disableInInput||!h))i[k].fn.apply(this,[a,i[k].key])}}}};var d=function(b,d,e,f){var g={};if(!a.core.dom.isNode(b)||a.core.func.getType(e)!=="function"){return g}if(typeof d!=="string"||!(d=d.replace(/\s*/g,""))){return g}if(!f)f={};if(!f.disableInInput)f.disableInInput=false;if(!f.type)f.type="keypress";f.type=f.type.replace(/\s*/g,"");if(!c.reg1.test(f.type)||f.disableInInput&&/^select|textarea|input$/.test(b.nodeName.toLowerCase())){return g}if(d.length>1||f.type!="keypress")d=d.toLowerCase();if(!/(^(\+|>)$)|(^([^\+>]+)$)/.test(d)){var h="";if(/((ctrl)|(shift)|(alt))\+(\+|([^\+]+))$/.test(d)){if(d.indexOf("ctrl+")!=-1)h+="ctr+";if(d.indexOf("shift+")!=-1)h+="shift+";if(d.indexOf("alt+")!=-1)h+="alt+";h+=d.match(/\+(([^\+]+)|(\+))$/)[1]}else if(!/(^>)|(>$)|>>/.test(d)&&d.length>2){g.linkFlag=true}else{return g}f.type="keydown"}g.keys=d;g.fn=e;g.opt=f;return g};var e={add:function(f,g,h,i){if(a.core.arr.isArray(g)){for(var j=0;j<g.length;j++){e.add(f,g[j],h,i)}return}var k=d(f,g,h,i);if(!k.keys)return;g=k.keys;h=k.fn;i=k.opt;var l=k.linkFlag;var m=b(f);if(!c.keyEvents[m])c.keyEvents[m]={linkKeyStr:"",linkedKey:""};if(!c.keyEvents[m].handler){c.keyEvents[m].handler=function(){c.handler.apply(f,arguments)}}if(l&&c.keyEvents[m].linkKeyStr.indexOf(" "+g+" ")==-1){c.keyEvents[m].linkKeyStr+=" "+g+" "}var n=i.type;if(!c.keyEvents[m][n]){c.keyEvents[m][n]={};a.core.evt.addEvent(f,n,c.keyEvents[m].handler)}if(!c.keyEvents[m][n][g])c.keyEvents[m][n][g]=[];c.keyEvents[m][n][g].push({fn:h,disableInInput:i.disableInInput,key:g})},remove:function(f,g,h,i){if(a.core.arr.isArray(g)){for(var j=0;j<g.length;j++){e.remove(f,g[j],h,i)}return}var k=d(f,g,h,i);if(!k.keys)return;g=k.keys;h=k.fn;i=k.opt;var l=k.linkFlag;var m=b(f),n,o,p;var q=i.type;if(m&&(n=c.keyEvents[m])&&(o=n[q])&&n.handler&&(p=o[g])){for(var j=0;j<p.length;){if(p[j].fn===h){p.splice(j,1)}else{j++}}if(p.length<1){delete o[g]}var r=false;for(var s in o){r=true;break}if(!r){a.core.evt.removeEvent(f,q,n.handler);delete n[q]}if(l&&n.linkKeyStr){n.linkKeyStr=n.linkKeyStr.replace(" "+g+" ","")}}}};return e});
$WBIM.register("core.evt.eventName",function(a){var b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"};return function(c){if(c==="mousewheel"){if("onmousewheel"in document){return"mousewheel"}else{return"DOMMouseScroll"}}if(c==="transitionend"){var d=a.C("div");for(var e in b){if(e in d.style){return b[e]}}}return c}});
$WBIM.register("core.func.bind",function(a){return function(b,c,d){d=a.core.arr.isArray(d)?d:[d];return function(){return c.apply(b,d)}}});
$WBIM.register("core.func.memorize",function(a){return function(a,b){if(typeof a!=="function"){throw"core.func.memorize need a function as first parameter"}b=b||{};var c={};if(b.timeout){setInterval(function(){c={}},b.timeout)}return function(){var d=Array.prototype.join.call(arguments,"_");if(!(d in c)){c[d]=a.apply(b.context||{},arguments)}return c[d]}}});
$WBIM.register("core.func.methodBefore",function(a){return function(){var b=false;var c=[];var d={};d.add=function(d,e){var f=a.core.obj.parseParam({args:[],pointer:window,top:false},e);if(f.top==true){c.unshift([d,f.args,f.pointer])}else{c.push([d,f.args,f.pointer])}return!b};d.start=function(){var a,d,e,f,g;if(b==true){return}b=true;for(a=0,d=c.length;a<d;a++){e=c[a][0];f=c[a][1];g=c[a][2];e.apply(g,f)}};d.reset=function(){c=[];b=false};d.getList=function(){return c};return d}});
$WBIM.register("core.func.timedChunk",function(a){var b={process:function(a){if(typeof a==="function"){a()}},context:{},callback:null,delay:25,execTime:50};return function(c,d){if(!a.core.arr.isArray(c)){throw"core.func.timedChunk need an array as first parameter"}var e=c.concat();var f=a.core.obj.parseParam(b,d);var g=null;var h=function(){var a=+(new Date);do{f.process.call(f.context,e.shift())}while(e.length>0&&+(new Date)-a<f.execTime);if(e.length<=0){if(f.callback){f.callback(c)}}else{setTimeout(arguments.callee,f.delay)}};g=setTimeout(h,f.delay)}});
$WBIM.register("core.io.getXHR",function(a){return function(){var a=false;try{a=new XMLHttpRequest}catch(b){try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(d){a=false}}}return a}});
$WBIM.register("core.str.parseURL",function(a){return function(a){var b=/^(?:([A-Za-z]+):(\/{0,3}))?([0-9.\-A-Za-z]+\.[0-9A-Za-z]+)?(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/;var c=["url","scheme","slash","host","port","path","query","hash"];var d=b.exec(a);var e={};for(var f=0,g=c.length;f<g;f+=1){e[c[f]]=d[f]||""}return e}});
$WBIM.register("core.json.jsonToQuery",function(a){var b=function(b,c){b=b==null?"":b;b=a.core.str.trim(b.toString());if(c){return encodeURIComponent(b)}return b};return function(a,c){var d=[];if(typeof a=="object"){for(var e in a){if(e==="$nullName"){d=d.concat(a[e]);continue}if(a[e]instanceof Array){for(var f=0,g=a[e].length;f<g;f++){d.push(e+"="+b(a[e][f],c))}}else{if(typeof a[e]!="function"){d.push(e+"="+b(a[e],c))}}}}if(d.length){return d.join("&")}return""}});
$WBIM.register("core.util.URL",function(a){return function(b,c){var d=a.core.obj.parseParam({isEncodeQuery:false,isEncodeHash:false},c||{});var e={};var f=a.core.str.parseURL(b);var g=a.core.json.queryToJson(f.query);var h=a.core.json.queryToJson(f.hash);e.setParam=function(a,b){g[a]=b;return this};e.getParam=function(a){return g[a]};e.setParams=function(a){for(var b in a){e.setParam(b,a[b])}return this};e.setHash=function(a,b){h[a]=b;return this};e.getHash=function(a){return h[a]};e.valueOf=e.toString=function(){var b=[];var c=a.core.json.jsonToQuery(g,d.isEncodeQuery);var e=a.core.json.jsonToQuery(h,d.isEncodeQuery);if(f.scheme!=""){b.push(f.scheme+":");b.push(f.slash)}if(f.host!=""){b.push(f.host);if(f.port!=""){b.push(":");b.push(f.port)}}b.push("/");b.push(f.path);if(c!=""){b.push("?"+c)}if(e!=""){b.push("#"+e)}return b.join("")};return e}});
$WBIM.register("core.json.strToJson",function($){var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;return function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&typeof e==="object"){for(c in e){if(Object.prototype.hasOwnProperty.call(e,c)){d=walk(e,c);if(d!==undefined){e[c]=d}else{delete e[c]}}}}return reviver.call(a,b,e)}if(window.JSON&&window.JSON.parse){return window.JSON.parse(text,reviver)}var j;text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}});
$WBIM.register("core.io.ajax",function($){return function(oOpts){var opts=$.core.obj.parseParam({url:"",charset:"UTF-8",timeout:30*1e3,args:{},onComplete:null,onTimeout:$.core.func.empty,uniqueID:null,onFail:$.core.func.empty,method:"get",asynchronous:true,header:{},isEncode:false,responseType:"json"},oOpts);if(opts.url==""){throw"ajax need url in parameters object"}var tm;var trans=$.core.io.getXHR();var cback=function(){if(trans.readyState==4){clearTimeout(tm);var data="";if(opts["responseType"]==="xml"){data=trans.responseXML}else if(opts["responseType"]==="text"){data=trans.responseText}else{try{if(trans.responseText&&typeof trans.responseText==="string"){data=eval("("+trans.responseText+")")}else{data={}}}catch(exp){data=opts["url"]+"return error : data error"}}if(trans.status==200){if(opts["onComplete"]!=null){opts["onComplete"](data)}}else if(trans.status==0){}else{if(opts["onFail"]!=null){opts["onFail"](data,trans)}}}else{if(opts["onTraning"]!=null){opts["onTraning"](trans)}}};trans.onreadystatechange=cback;if(!opts["header"]["Content-Type"]){opts["header"]["Content-Type"]="application/x-www-form-urlencoded"}if(!opts["header"]["X-Requested-With"]){opts["header"]["X-Requested-With"]="XMLHttpRequest"}if(opts["method"].toLocaleLowerCase()=="get"){var url=$.core.util.URL(opts["url"],{isEncodeQuery:opts["isEncode"]});url.setParams(opts["args"]);url.setParam("__rnd",(new Date).valueOf());trans.open(opts["method"],url.toString(),opts["asynchronous"]);try{for(var k in opts["header"]){trans.setRequestHeader(k,opts["header"][k])}}catch(exp){}trans.send("")}else{trans.open(opts["method"],opts["url"],opts["asynchronous"]);try{for(var k in opts["header"]){trans.setRequestHeader(k,opts["header"][k])}}catch(exp){}trans.send($.core.json.jsonToQuery(opts["args"],opts["isEncode"]))}if(opts["timeout"]){tm=setTimeout(function(){try{trans.abort();opts["onTimeout"]({},trans);opts["onFail"]({},trans)}catch(a){}},opts["timeout"])}return trans}});
$WBIM.register("core.io.scriptLoader",function(a){var b={};var c={url:"",charset:"UTF-8",timeout:30*1e3,args:{},onComplete:a.core.func.empty,onTimeout:a.core.func.empty,isEncode:false,uniqueID:null};return function(d){var e,f;var g=a.core.obj.parseParam(c,d);if(g.url==""){throw"scriptLoader: url is null"}var h=g.uniqueID||a.core.util.getUniqueKey();e=b[h];if(e!=null&&a.IE!=true){a.core.dom.removeNode(e);e=null}if(e==null){e=b[h]=a.C("script")}e.charset=g.charset;e.id="scriptRequest_script_"+h;e.type="text/javascript";if(g.onComplete!=null){if(a.IE){e["onreadystatechange"]=function(){if(e.readyState.toLowerCase()=="loaded"||e.readyState.toLowerCase()=="complete"){try{clearTimeout(f);document.getElementsByTagName("head")[0].removeChild(e);e["onreadystatechange"]=null}catch(a){}g.onComplete()}}}else{e["onload"]=function(){try{clearTimeout(f);a.core.dom.removeNode(e)}catch(b){}g.onComplete()}}}e.src=a.core.util.URL(g.url,{isEncodeQuery:g["isEncode"]}).setParams(g.args).toString();document.getElementsByTagName("head")[0].appendChild(e);if(g.timeout>0){f=setTimeout(function(){try{document.getElementsByTagName("head")[0].removeChild(e)}catch(a){}g.onTimeout()},g.timeout)}return e}});
$WBIM.register("core.io.jsonp",function(a){return function(b){var c=a.core.obj.parseParam({url:"",charset:"UTF-8",timeout:30*1e3,args:{},onComplete:null,onTimeout:null,responseName:null,isEncode:false,varkey:"callback"},b);var d=-1;var e=c.responseName||"STK_"+a.core.util.getUniqueKey();c.args[c.varkey]=e;var f=c.onComplete;var g=c.onTimeout;window[e]=function(a){if(d!=2&&f!=null){d=1;f(a)}};c.onComplete=null;c.onTimeout=function(){if(d!=1&&g!=null){d=2;g()}};return a.core.io.scriptLoader(c)}});
$WBIM.register("core.util.templet",function(a){return function(a,b){return a.replace(/#\{(.+?)\}/ig,function(){var a=arguments[1].replace(/\s/ig,"");var c=arguments[0];var d=a.split("||");for(var e=0,f=d.length;e<f;e+=1){if(/^default:.*$/.test(d[e])){c=d[e].replace(/^default:/,"");break}else if(b[d[e]]!==undefined){c=b[d[e]];break}}return c})}});
$WBIM.register("core.io.getIframeTrans",function(a){var b='<iframe id="#{id}" name="#{id}" height="0" width="0" frameborder="no"></iframe>';return function(c){var d,e,f;e=a.core.obj.parseParam({id:"STK_iframe_"+a.core.util.getUniqueKey()},c);f={};d=a.C("DIV");d.innerHTML=a.core.util.templet(b,e);a.core.util.hideContainer.appendChild(d);f.getId=function(){return e["id"]};f.destroy=function(){d.innerHTML="";try{d.getElementsByTagName("iframe")[0].src="about:blank"}catch(b){}a.core.util.hideContainer.removeChild(d);d=null};return f}});
$WBIM.register("core.io.require",function(a){var b="http://js.t.sinajs.cn/STK/js/";var c=function(a,b){var c=b.split(".");var d=a;var e=null;while(e=c.shift()){d=d[e];if(d===undefined){return false}}return true};var d=[];var e=function(b){if(a.core.arr.indexOf(b,d)!==-1){return false}d.push(b);a.core.io.scriptLoader({url:b,callback:function(){a.core.arr.foreach(d,function(a,c){if(a===b){d.splice(c,1);return false}})}});return false};var f=function(d,f,g){var h=null;for(var i=0,j=d.length;i<j;i+=1){var k=d[i];if(typeof k==="string"){if(!c(a,k)){e(b+k.replace(/\./ig,"/")+".js")}}else{if(!c(window,k["NS"])){e(k["url"])}}}var l=function(){for(var b=0,e=d.length;b<e;b+=1){var i=d[b];if(typeof i==="string"){if(!c(a,i)){h=setTimeout(l,25);return false}}else{if(!c(window,i["NS"])){h=setTimeout(l,25);return false}}}clearTimeout(h);f.apply({},[].concat(g))};h=setTimeout(l,25)};f.setBaseURL=function(a){if(typeof a!=="string"){throw"[STK.kit.extra.require.setBaseURL] need string as frist parameter"}b=a};return f});
$WBIM.register("core.io.ijax",function(a){return function(b){var c,d,e,f,g,h,i;c=a.core.obj.parseParam({url:"",form:null,args:{},uniqueID:null,timeout:30*1e3,onComplete:a.core.func.empty,onTimeout:a.core.func.empty,onFail:a.core.func.empty,asynchronous:true,isEncode:true,abaurl:null,responseName:null,varkey:"callback",abakey:"callback"},b);i={};if(c.url==""){throw"ijax need url in parameters object"}if(!c.form){throw"ijax need form in parameters object"}d=a.core.io.getIframeTrans();e=c.responseName||"STK_ijax_"+a.core.util.getUniqueKey();h={};h[c["varkey"]]=e;if(c.abaurl){c.abaurl=a.core.util.URL(c.abaurl).setParams(h);h={};h[c["abakey"]]=c.abaurl.toString()}c.url=a.core.util.URL(c.url,{isEncodeQuery:c["isEncode"]}).setParams(h).setParams(c.args);g=function(){window[e]=null;d.destroy();d=null;clearTimeout(f)};f=setTimeout(function(){try{c.onTimeout();c.onFail()}catch(a){}finally{g()}},c.timeout);window[e]=function(a,b){try{c.onComplete(a,b)}catch(d){}finally{g()}};c.form.action=c.url.toString();c.form.target=d.getId();c.form.submit();i.abort=g;return i}});
$WBIM.register("core.json.clone",function(a){function b(a){var c;if(a instanceof Array){c=[];var d=a.length;while(d--){c[d]=b(a[d])}return c}else if(a instanceof Object){c={};for(var e in a){c[e]=b(a[e])}return c}else{return a}}return b});
$WBIM.register("core.json.include",function(a){return function(a,b){for(var c in b){if(typeof b[c]==="object"){if(b[c]instanceof Array){if(a[c]instanceof Array){if(b[c].length===a[c].length){for(var d=0,e=b[c].length;d<e;d+=1){if(!arguments.callee(b[c][d],a[c][d])){return false}}}else{return false}}else{return false}}else{if(typeof a[c]==="object"){if(!arguments.callee(b[c],a[c])){return false}}else{return false}}}else if(typeof b[c]==="number"||typeof b[c]==="string"){if(b[c]!==a[c]){return false}}else if(b[c]!==undefined&&b[c]!==null){if(a[c]!==undefined&&a[c]!==null){if(!b[c].toString||!a[c].toString){throw"json1[k] or json2[k] do not have toString method"}if(b[c].toString()!==a[c].toString()){return false}}else{return false}}}return true}});
$WBIM.register("core.json.compare",function(a){return function(b,c){if(a.core.json.include(b,c)&&a.core.json.include(c,b)){return true}else{return false}}});
$WBIM.register("core.json.jsonToStr",function(a){function j(a,b){var c,d,g,k,l=e,m,n=b[a];if(n&&typeof n==="object"&&typeof n.toJSON==="function"){n=n.toJSON(a)}if(typeof h==="function"){n=h.call(b,a,n)}switch(typeof n){case"string":return i(n);case"number":return isFinite(n)?String(n):"null";case"boolean":case"null":return String(n);case"object":if(!n){return"null"}e+=f;m=[];if(Object.prototype.toString.apply(n)==="[object Array]"){k=n.length;for(c=0;c<k;c+=1){m[c]=j(c,n)||"null"}g=m.length===0?"[]":e?"[\n"+e+m.join(",\n"+e)+"\n"+l+"]":"["+m.join(",")+"]";e=l;return g}if(h&&typeof h==="object"){k=h.length;for(c=0;c<k;c+=1){d=h[c];if(typeof d==="string"){g=j(d,n);if(g){m.push(i(d)+(e?": ":":")+g)}}}}else{for(d in n){if(Object.hasOwnProperty.call(n,d)){g=j(d,n);if(g){m.push(i(d)+(e?": ":":")+g)}}}}g=m.length===0?"{}":e?"{\n"+e+m.join(",\n"+e)+"\n"+l+"}":"{"+m.join(",")+"}";e=l;return g}}function i(a){d.lastIndex=0;return d.test(a)?'"'+a.replace(d,function(a){var b=g[a];return typeof b==="string"?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function b(a){return a<10?"0"+a:a}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(a){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+b(this.getUTCMonth()+1)+"-"+b(this.getUTCDate())+"T"+b(this.getUTCHours())+":"+b(this.getUTCMinutes())+":"+b(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(a){return this.valueOf()}}var c=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,d=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e,f,g={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},h;return function(a,b,c){if(window.JSON&&window.JSON.stringify){return window.JSON.stringify(a,b,c)}var d;e="";f="";if(typeof c==="number"){for(d=0;d<c;d+=1){f+=" "}}else if(typeof c==="string"){f=c}h=b;if(b&&typeof b!=="function"&&(typeof b!=="object"||typeof b.length!=="number")){throw new Error("JSON.stringify")}return j("",{"":a})}});
$WBIM.register("core.json.merge",function(a){var b=function(b){if(b===undefined){return true}if(b===null){return true}if(a.core.arr.inArray(typeof b,["number","string","function","boolean"])){return true}if(a.core.dom.isNode(b)){return true}return false};var c=function(d,e,f){if(b(f)){d[e]=f;return}if(a.core.arr.isArray(f)){if(!a.core.arr.isArray(d[e])){d[e]=[]}for(var g=0,h=f.length;g<h;g+=1){c(d[e],g,f[g])}return}if(typeof f==="object"){if(b(d[e])||a.core.arr.isArray(d[e])){d[e]={}}for(var i in f){c(d[e],i,f[i])}return}};var d=function(a,b,d){var e={};if(d){for(var f in a){c(e,f,a[f])}for(var f in b){c(e,f,b[f])}}else{for(var f in a){e[f]=a[f]}for(var f in b){e[f]=b[f]}}return e};return function(b,c,e){var f=a.core.obj.parseParam({isDeep:false},e);return d(b,c,f.isDeep)}});
$WBIM.register("core.obj.beget",function(a){var b=function(){};return function(a){b.prototype=a;return new b}});
$WBIM.register("core.obj.cascade",function(a){return function(a,b){for(var c=0,d=b.length;c<d;c+=1){if(typeof a[b[c]]!=="function"){throw"cascade need function list as the second paramsters"}a[b[c]]=function(b){return function(){b.apply(a,arguments);return a}}(a[b[c]])}}});
$WBIM.register("core.obj.clear",function(a){return function(a){var b,c={};for(b in a){if(a[b]!=null){c[b]=a[b]}}return c}});
$WBIM.register("core.obj.cut",function(a){return function(b,c){var d={};if(!a.core.arr.isArray(c)){throw"core.obj.cut need array as second parameter"}for(var e in b){if(!a.core.arr.inArray(e,c)){d[e]=b[e]}}return d}});
$WBIM.register("core.obj.sup",function(a){return function(a,b){var c={};for(var d=0,e=b.length;d<e;d+=1){if(typeof a[b[d]]!=="function"){throw"super need function list as the second paramsters"}c[b[d]]=function(b){return function(){return b.apply(a,arguments)}}(a[b[d]])}return c}});
$WBIM.register("core.str.bLength",function(a){return function(a){if(!a){return 0}var b=a.match(/[^\x00-\xff]/g);return a.length+(!b?0:b.length)}});
$WBIM.register("core.str.dbcToSbc",function(a){return function(a){return a.replace(/[\uff01-\uff5e]/g,function(a){return String.fromCharCode(a.charCodeAt(0)-65248)}).replace(/\u3000/g," ")}});
$WBIM.register("core.str.parseHTML",function(a){return function(a){var b=/[^<>]+|<(\/?)([A-Za-z0-9]+)([^<>]*)>/g;var c,d;var e=[];while(c=b.exec(a)){var f=[];for(d=0;d<c.length;d+=1){f.push(c[d])}e.push(f)}return e}});
$WBIM.register("core.str.leftB",function(a){return function(b,c){var d=b.replace(/\*/g," ").replace(/[^\x00-\xff]/g,"**");b=b.slice(0,d.slice(0,c).replace(/\*\*/g," ").replace(/\*/g,"").length);if(a.core.str.bLength(b)>c&&c>0){b=b.slice(0,b.length-1)}return b}});
$WBIM.register("core.str.queryString",function(a){return function(b,c){var d=a.core.obj.parseParam({source:window.location.search.substr(1),split:"&"},c);var e=(new RegExp("(^|"+d.split+")"+b+"=([^\\"+d.split+"]*)(\\"+d.split+"|$)","gi")).exec(d.source),f;if(f=e){return f[2]}return null}});
$WBIM.register("core.util.color",function(a){var b=/^#([a-fA-F0-9]{3,8})$/;var c=/^rgb[a]?\s*\((\s*([0-9]{1,3})\s*,){2,3}(\s*([0-9]{1,3})\s*)\)$/;var d=/([0-9]{1,3})/ig;var e=/([a-fA-F0-9]{2})/ig;var f=a.core.arr.foreach;var g=function(a){var g=[];var h=[];if(b.test(a)){h=a.match(b);if(h[1].length<=4){g=f(h[1].split(""),function(a,b){return parseInt(a+a,16)})}else if(h[1].length<=8){g=f(h[1].match(e),function(a,b){return parseInt(a,16)})}return g}if(c.test(a)){h=a.match(d);g=f(h,function(a,b){return parseInt(a,10)});return g}return false};return function(a,b){var c=g(a);if(!c){return false}var d={};d.getR=function(){return c[0]};d.getG=function(){return c[1]};d.getB=function(){return c[2]};d.getA=function(){return c[3]};return d}});
$WBIM.register("core.util.cookie",function(a){var b={set:function(b,c,d){var e=[];var f,g;var h=a.core.obj.parseParam({expire:null,path:"/",domain:null,secure:null,encode:true},d);if(h.encode==true){c=escape(c)}e.push(b+"="+c);if(h.path!=null){e.push("path="+h.path)}if(h.domain!=null){e.push("domain="+h.domain)}if(h.secure!=null){e.push(h.secure)}if(h.expire!=null){f=new Date;g=f.getTime()+h.expire*36e5;f.setTime(g);e.push("expires="+f.toGMTString())}document.cookie=e.join(";")},get:function(a){a=a.replace(/([\.\[\]\$])/g,"\\$1");var b=new RegExp("(^| )"+a+"=([^;]*)?;","i");var c=document.cookie+";";var d=c.match(b);if(d){return d[2]||""}else{return""}},remove:function(a,c){c=c||{};c.expire=-10;b.set(a,"",c)}};return b});
$WBIM.register("core.util.connect",function(a){var b={};var c={};var d=0;var e=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var f=function(){return++d+""+(new Date).getTime()};var g=function(b,d,f,g){if(!e(c,b)){return false}var h=c[b];if(!e(h.callback,d)){return false}var i=h.callback[d].onSuccess;var j=h.callback[d].onError;var k=a.core.json.jsonToStr(g||{});setTimeout(function(){var b=a.core.json.strToJson(k);if(f){b.type="error";j(b,d)}else{i(b,d)}},0);delete h.callback[d];return true};b.request=function(b){var d=b.sid;if(!d||typeof d!="string"){return-1}if(!e(c,d)){return-1}var h=c[d];var i=f();var j=a.core.json.jsonToStr(b.data||{});h.callback[i]={onSuccess:b.onSuccess||a.core.func.empty,onError:b.onError||a.core.func.empty};var k=function(a){g(d,i,a.error,a.data)};setTimeout(function(){h.handle(k,a.core.json.strToJson(j),i)},0);return i};b.create=function(b){if(!b){return false}var d=b.sid;if(!d||typeof d!="string"){return false}if(e(c,d)){return false}var f=b.handle;if(typeof f!="function"){return false}c[d]={handle:f,onAbort:b.onAbort||a.core.func.empty,callback:{}};return true};b.abort=function(a){if(!a){return false}for(var b in c){var d=c[b];if(e(d.callback,a)){setTimeout(function(){d.onAbort(a)},0);delete d.callback[a];return true}}return false};b.destory=function(a){if(!a||typeof a!="string"){return false}if(!e(c,a)){return false}for(var b in c[a].callback){try{c[a].callback[b].onError({type:"destroy"},b)}catch(d){}}delete c[a];return true};return b});
$WBIM.register("core.util.drag",function(a){var b=function(a){a.cancelBubble=true;return false};var c=function(b,c){b["clientX"]=c.clientX;b["clientY"]=c.clientY;b["pageX"]=c.clientX+a.core.util.scrollPos()["left"];b["pageY"]=c.clientY+a.core.util.scrollPos()["top"];return b};return function(d,e){if(!a.core.dom.isNode(d)){throw"core.util.drag need Element as first parameter"}var f=a.core.obj.parseParam({actRect:[],actObj:{}},e);var g={};var h=a.core.evt.custEvent.define(f.actObj,"dragStart");var i=a.core.evt.custEvent.define(f.actObj,"dragEnd");var j=a.core.evt.custEvent.define(f.actObj,"draging");var k=function(d){var e=c({},d);document.body.onselectstart=function(){return false};a.core.evt.addEvent(document,"mousemove",l);a.core.evt.addEvent(document,"mouseup",m);a.core.evt.addEvent(document,"click",b,true);if(d.preventDefault){d.preventDefault();d.stopPropagation()}a.core.evt.custEvent.fire(h,"dragStart",e);return false};var l=function(b){var d=c({},b);b.cancelBubble=true;a.core.evt.custEvent.fire(h,"draging",d)};var m=function(d){var e=c({},d);document.body.onselectstart=function(){return true};a.core.evt.removeEvent(document,"mousemove",l);a.core.evt.removeEvent(document,"mouseup",m);a.core.evt.removeEvent(document,"click",b,true);a.core.evt.custEvent.fire(h,"dragEnd",e)};a.core.evt.addEvent(d,"mousedown",k);g.destroy=function(){a.core.evt.removeEvent(d,"mousedown",k);f=null};g.getActObj=function(){return f.actObj};return g}});
$WBIM.register("core.util.easyTemplate",function(a){var b=function(a,c){if(!a){return""}if(a!==b.template){b.template=a;b.aStatement=b.parsing(b.separate(a))}var d=b.aStatement;var e=function(a){if(a){c=a}return arguments.callee};e.toString=function(){return(new Function(d[0],d[1]))(c)};return e};b.separate=function(a){var b=/\\'/g;var c=a.replace(/(<(\/?)#(.*?(?:\(.*?\))*)>)|(')|([\r\n\t])|(\$\{([^\}]*?)\})/g,function(a,c,d,e,f,g,h,i){if(c){return"{|}"+(d?"-":"+")+e+"{|}"}if(f){return"\\'"}if(g){return""}if(h){return"'+("+i.replace(b,"'")+")+'"}});return c};b.parsing=function(a){var b,c,d,e,f,g,h,i=["var aRet = [];"];h=a.split(/\{\|\}/);var j=/\s/;while(h.length){d=h.shift();if(!d){continue}f=d.charAt(0);if(f!=="+"&&f!=="-"){d="'"+d+"'";i.push("aRet.push("+d+");");continue}e=d.split(j);switch(e[0]){case"+et":b=e[1];c=e[2];i.push('aRet.push("<!--'+b+' start-->");');break;case"-et":i.push('aRet.push("<!--'+b+' end-->");');break;case"+if":e.splice(0,1);i.push("if"+e.join(" ")+"{");break;case"+elseif":e.splice(0,1);i.push("}else if"+e.join(" ")+"{");break;case"-if":i.push("}");break;case"+else":i.push("}else{");break;case"+list":i.push("if("+e[1]+".constructor === Array){with({i:0,l:"+e[1]+".length,"+e[3]+"_index:0,"+e[3]+":null}){for(i=l;i--;){"+e[3]+"_index=(l-i-1);"+e[3]+"="+e[1]+"["+e[3]+"_index];");break;case"-list":i.push("}}}");break;default:break}}i.push('return aRet.join("");');return[c,i.join("")]};return b});
$WBIM.register("core.util.htmlParser",function(a){var b=function(a){var b={},c=a.split(",");for(var d=0;d<c.length;d++)b[c[d]]=true;return b};var c=/^<(\w+)((?:\s+[\w-\:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,d=/^<\/(\w+)[^>]*>/,e=/([\w|\-]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;var f=b("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed");var g=b("address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul");var h=b("a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");var i=b("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");var j=b("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");var k=b("script,style");var l=function(a,b){var l,m,n,o=[],p=a;var q=function(c,d,k,l){if(g[d]){while(o.last()&&h[o.last()]){r("",o.last())}}if(i[d]&&o.last()==d){r("",d)}l=f[d]||!!l;if(!l){o.push(d)}var m=[];if(c==="textarea"){var n=a.match(/^(.*)<\/textarea[^>]*>/);m.push({name:"text",value:a.slice(0,n[0].length)});a=a.substring(n[0].length)}if(b.start&&typeof b.start==="function"){k.replace(e,function(a,b){var c=arguments[2]?arguments[2]:arguments[3]?arguments[3]:arguments[4]?arguments[4]:j[b]?b:"";m.push({name:b,value:c,escaped:c.replace(/(^|[^\\])"/g,'$1\\"')})});b.start(d,m,l)}};var r=function(a,c){if(!c){var d=0}else{for(var d=o.length-1;d>=0;d--){if(o[d]==c){break}}}if(d>=0){for(var e=o.length-1;e>=d;e--){if(b.end&&typeof b.end==="function"){b.end(o[e])}}o.length=d}};o.last=function(){return this[this.length-1]};while(a){m=true;if(!o.last()||!k[o.last()]){if(a.indexOf("<!--")===0){l=a.indexOf("-->");if(l>=0){if(b.comment&&typeof b.comment==="function"){b.comment(a.substring(4,l))}a=a.substring(l+3);m=false}}else if(a.indexOf("</")===0){n=a.match(d);if(n){a=a.substring(n[0].length);n[0].replace(d,r);m=false}}else if(a.indexOf("<")===0){n=a.match(c);if(n){a=a.substring(n[0].length);n[0].replace(c,q);m=false}}if(m){l=a.indexOf("<");var s=l<0?a:a.substring(0,l);a=l<0?"":a.substring(l);if(b.chars&&typeof b.chars==="function"){b.chars(s)}}}else{a=a.replace(new RegExp("(.*)</"+o.last()+"[^>]*>"),function(a,c){c=c.replace(/<!--(.*?)-->/g,"$1").replace(/<!\[CDATA\[(.*?)]]>/g,"$1");if(b.chars&&typeof b.chars==="function"){b.chars(c)}return""});r("",o.last())}if(a==p){throw"Parse Error: "+a}p=a}r()};return l});
$WBIM.register("core.util.nameValue",function(a){return function(b){var c=b.getAttribute("name");var d=b.getAttribute("type");var e=b.tagName;var f={name:c,value:""};var g=function(b){if(b===false){f=false}else if(!f["value"]){f["value"]=a.core.str.trim(b||"")}else{f["value"]=[a.core.str.trim(b||"")].concat(f["value"])}};if(!b.disabled&&c){switch(e){case"INPUT":if(d=="radio"||d=="checkbox"){if(b.checked){g(b.value)}else{g(false)}}else if(d=="reset"||d=="submit"||d=="image"){g(false)}else{g(b.value)}break;case"SELECT":if(b.multiple){var h=b.options;for(var i=0,j=h.length;i<j;i++){if(h[i].selected){g(h[i].value)}}}else{g(b.value)}break;case"TEXTAREA":g(b.value||b.getAttribute("value")||false);break;case"BUTTON":default:g(b.value||b.getAttribute("value")||b.innerHTML||false)}}else{return false}return f}});
$WBIM.register("core.util.htmlToJson",function(a){return function(b,c,d){var e={};c=c||["INPUT","TEXTAREA","BUTTON","SELECT"];if(!b||!c){return false}var f=a.core.util.nameValue;for(var g=0,h=c.length;g<h;g++){var i=b.getElementsByTagName(c[g]);for(var j=0,k=i.length;j<k;j++){var l=f(i[j]);if(!l||d&&l.value===""){continue}if(e[l.name]){if(e[l.name]instanceof Array){e[l.name]=e[l.name].concat(l.value)}else{e[l.name]=[e[l.name]].concat(l.value)}}else{e[l.name]=l.value}}}return e}});
$WBIM.register("core.util.jobsM",function(a){return function(){var b=[];var c={};var d=false;var e={};var f=function(b){var d=b["name"];var e=b["func"];var f=+(new Date);if(!c[d]){try{e(a);e[d]=true}catch(g){a.log("[error][jobs]"+d)}}};var g=function(b){if(b.length){a.core.func.timedChunk(b,{process:f,callback:arguments.callee});b.splice(0,b.length)}else{d=false}};e.register=function(a,c){b.push({name:a,func:c})};e.start=function(){if(d){return true}else{d=true}g(b)};e.load=function(){};a.core.dom.ready(e.start);return e}()});
$WBIM.register("core.util.language",function(a){return function(a,b){var c=[];for(var d=2,e=arguments.length;d<e;d+=1){c.push(arguments[d])}return a.replace(/#L\{((.*?)(?:[^\\]))\}/ig,function(){var a=arguments[1];var d;if(b&&b[a]!==undefined){d=b[a]}else{d=a}if(c.length){d=d.replace(/(\%s)/ig,function(){var a=c.shift();if(a!==undefined){return a}else{return arguments[0]}})}return d})}});
$WBIM.register("core.util.listener",function(a){return function(){var a={};var b=[];var c;var d=function(){if(b.length==0){return}clearTimeout(c);var a=b.splice(0,1)[0];try{a["func"].apply(a["func"],[].concat(a["data"]))}catch(e){}c=setTimeout(d,25)};return{register:function(b,c,d){a[b]=a[b]||{};a[b][c]=a[b][c]||[];a[b][c].push(d)},fire:function(c,e,f){var g;var h,i;if(a[c]&&a[c][e]&&a[c][e].length>0){g=a[c][e];g.data_cache=f;for(h=0,i=g.length;h<i;h++){b.push({channel:c,evt:e,func:g[h],data:f})}d()}},remove:function(b,c,d){if(a[b]){if(a[b][c]){for(var e=0,f=a[b][c].length;e<f;e++){if(a[b][c][e]===d){a[b][c].splice(e,1);break}}}}},list:function(){return a},cache:function(b,c){if(a[b]&&a[b][c]){return a[b][c].data_cache}}}}()});
$WBIM.register("core.util.pageletM",function(a){var b="";var c="";if(typeof $CONFIG!="undefined"){b=$CONFIG.jsPath||b;c=$CONFIG.cssPath||c}var d=a.core.arr.indexOf;var e={},f,g={},h={},i={},j={};var k,l;if(a.IE){k={};l=function(){var b,c,d;for(b in k){if(k[b].length<31){d=a.E(b);break}}if(!d){b="style_"+a.core.util.getUniqueKey(),d=document.createElement("style");d.setAttribute("type","text/css");d.setAttribute("id",b);document.getElementsByTagName("head")[0].appendChild(d);k[b]=[]}return{styleID:b,styleSheet:d.styleSheet||d.sheet}}}var m=function(b,c){i[b]={cssURL:c};if(a.IE){var d=l();d.styleSheet.addImport(c);k[d.styleID].push(b);i[b].styleID=d.styleID}else{var e=a.C("link");e.setAttribute("rel","Stylesheet");e.setAttribute("type","text/css");e.setAttribute("charset","utf-8");e.setAttribute("href",c);e.setAttribute("id",b);document.getElementsByTagName("head")[0].appendChild(e)}};var n={};var o=function(b,c){var d=a.E(b);if(d){c(d);n[b]&&delete n[b];for(var e in n){o(e,n[e])}}else{n[b]=c}};var p=function(b){if(a.IE){var c=i[b].styleID;var f=k[c];var g=a.E(c);var h;if((h=d(b,f))>-1){(g.styleSheet||g.sheet).removeImport(h);f.splice(h,1)}}else{a.core.dom.removeNode(a.E(b))}delete e[i[b].cssURL];delete i[b]};var q=function(b,d,e){for(var f in j){if(!a.E(f)){delete j[f]}}j[b]={js:{},css:{}};if(e){for(var f=0,g=e.length;f<g;++f){j[b].css[c+e[f]]=1}}};var r=function(){for(var a in i){var b=false,c=i[a].cssURL;for(var d in j){if(j[d].css[c]){b=true;break}}if(!b){p(a)}}};var s=function(a,b){var c=e[a]||(e[a]={loaded:false,list:[]});if(c.loaded){b(a);return false}c.list.push(b);if(c.list.length>1){return false}return true};var t=function(a){var b=e[a].list;if(b){for(var c=0;c<b.length;c++){b[c](a)}e[a].loaded=true;delete e[a].list}};var u=function(b){var d=b.url,e=b.load_ID,f=b.complete,g=b.pid,h=c+d,i="css_"+a.core.util.getUniqueKey();if(!s(h,f)){return}m(i,h);var j=a.C("div");j.id=e;a.core.util.hideContainer.appendChild(j);var k=3e3;var l=function(){if(parseInt(a.core.dom.getStyle(j,"height"))==42){a.core.util.hideContainer.removeChild(j);t(h);return}if(--k>0){setTimeout(l,10)}else{a.log(h+"timeout!");a.core.util.hideContainer.removeChild(j);t(h);p(i);m(i,h)}};setTimeout(l,50)};var v=function(c,d){var f=b+c;if(!s(f,d)){return}a.core.io.scriptLoader({url:f,onComplete:function(){t(f)},onTimeout:function(){a.log(f+"timeout!");delete e[f]}})};var w=function(a,b){if(!g[a]){g[a]=b}};var x=function(b){if(b){if(g[b]){try{h[b]||(h[b]=g[b](a))}catch(c){a.log(b,c,c.stack)}}else{a.log("start:ns="+b+" ,have not been registed")}return}var d=[];for(b in g){d.push(b)}a.core.func.timedChunk(d,{process:function(b){try{h[b]||(h[b]=g[b](a))}catch(c){a.log(b,c,c.stack)}}})};var y=function(b){var c=1,d,e,f,g,h,i,j;b=b||{};e=b.pid;f=b.html;h=b.js?[].concat(b.js):[];g=b.css?[].concat(b.css):[];if(e==undefined){a.log("node pid["+e+"] is undefined");return}q(e,h,g);i=function(){if(--c>0)return;o(e,function(a){f!=undefined&&(a.innerHTML=f);if(h.length>0){j()}r()})};j=function(a){if(h.length>0){v(h.shift(),j)}if(a&&a.indexOf("/pl/")!=-1){var b=a.replace(/^.*?\/(pl\/.*)\.js\??.*$/,"$1").replace(/\//g,".");z(b);x(b)}};if(g.length>0){c+=g.length;for(var k=0,l;l=g[k];k++){u({url:l,load_ID:"js_"+l.replace(/^\/?(.*)\.css\??.*$/i,"$1").replace(/\//g,"_"),complete:i,pid:e})}}i()};var z=function(b){if(b){if(h[b]){a.log("destroy:"+b);try{h[b].destroy()}catch(c){a.log(c,c.stack)}delete h[b]}return}for(b in h){a.log("destroy:"+b);try{h[b]&&h[b].destroy&&h[b].destroy()}catch(c){a.log(b,c,c.stack)}}h={}};var A={register:w,start:x,view:y,clear:z,destroy:function(){A.clear();e={};h={};g={};f=undefined}};a.core.dom.ready(function(){a.core.evt.addEvent(window,"unload",function(){a.core.evt.removeEvent(window,"unload",arguments.callee);A.destroy()})});return A});
$WBIM.register("core.util.winSize",function(a){return function(a){var b,c;var d;if(a){d=a.document}else{d=document}if(d.compatMode==="CSS1Compat"){b=d.documentElement["clientWidth"];c=d.documentElement["clientHeight"]}else if(self.innerHeight){if(a){d=a.self}else{d=self}b=d.innerWidth;c=d.innerHeight}else if(d.documentElement&&d.documentElement.clientHeight){b=d.documentElement.clientWidth;c=d.documentElement.clientHeight}else if(d.body){b=d.body.clientWidth;c=d.body.clientHeight}return{width:b,height:c}}});
$WBIM.register("core.util.pageSize",function(a){return function(b){var c;if(b){c=b.document}else{c=document}var d=c.compatMode=="CSS1Compat"?c.documentElement:c.body;var e,f;var g,h;if(window.innerHeight&&window.scrollMaxY){e=d.scrollWidth;f=window.innerHeight+window.scrollMaxY}else if(d.scrollHeight>d.offsetHeight){e=d.scrollWidth;f=d.scrollHeight}else{e=d.offsetWidth;f=d.offsetHeight}var i=a.core.util.winSize(b);if(f<i.height){g=i.height}else{g=f}if(e<i.width){h=i.width}else{h=e}return{page:{width:h,height:g},win:{width:i.width,height:i.height}}}});
$WBIM.register("core.util.queue",function(a){return function(){var a={};var b=[];a.add=function(c){b.push(c);return a};a.get=function(){if(b.length>0){return b.shift()}else{return false}};return a}});
$WBIM.register("core.util.timer",function(a){return function(){var a={};var b={};var c=0;var d=null;var e=false;var f=25;var g=function(){for(var c in b){if(!b[c]["pause"]){b[c]["fun"]()}}return a};a.add=function(d){if(typeof d!="function"){throw"The timer needs add a function as a parameters"}var e=""+(new Date).getTime()+Math.random()*Math.pow(10,17);b[e]={fun:d,pause:false};if(c<=0){a.start()}c++;return e};a.remove=function(d){if(b[d]){delete b[d];c--}if(c<=0){a.stop()}return a};a.pause=function(c){if(b[c]){b[c]["pause"]=true}return a};a.play=function(c){if(b[c]){b[c]["pause"]=false}return a};a.stop=function(){clearInterval(d);d=null;return a};a.start=function(){d=setInterval(g,f);return a};a.loop=g;a.get=function(a){if(a==="delay"){return f}if(a==="functionList"){return b}};a.set=function(a,b){if(a==="delay"){if(typeof b==="number"){f=Math.max(25,Math.min(b,200))}}};return a}()});
$WBIM.register("core.util.scrollTo",function(a){return function(b,c){if(!a.core.dom.isNode(b)){throw"core.dom.isNode need element as the first parameter"}var d=a.core.obj.parseParam({box:document.documentElement,top:0,step:3,onMoveStop:null},c);d.step=Math.max(3,Math.min(10,d.step));var e=[];var f=a.core.dom.position(b);var g;if(d["box"]==document.documentElement){g={t:0}}else{g=a.core.dom.position(d["box"])}var h=Math.max(0,(f?f["t"]:0)-(g?g["t"]:0)-d.top);var i=d.box===document.documentElement?d.box.scrollTop||document.body.scrollTop||window.pageYOffset:d.box.scrollTop;while(Math.abs(i-h)>d.step&&i>=0){e.push(Math.round(i+(h-i)*d.step/10));i=e[e.length-1]}if(!e.length){e.push(h)}var j=a.core.util.timer.add(function(){if(e.length){if(d.box===document.documentElement){window.scrollTo(0,e.shift())}else{d.box.scrollTop=e.shift()}}else{if(d.box===document.documentElement){window.scrollTo(0,h)}else{d.box.scrollTop=h}a.core.util.timer.remove(j);if(typeof d.onMoveStop==="function"){d.onMoveStop()}}})}});
$WBIM.register("core.util.stack",function(a){return function(){var a={};var b=[];a.add=function(c){b.push(c);return a};a.get=function(){if(b.length>0){return b.pop()}else{return false}};return a}});
$WBIM.register("core.util.swf",function(a){function b(b,c){var d=a.core.obj.parseParam({id:"swf_"+parseInt(Math.random()*1e4,10),width:1,height:1,attrs:{},paras:{},flashvars:{},html:""},c);if(b==null){throw"swf: [sURL] 未定义";return}var e;var f=[];var g=[];for(e in d.attrs){g.push(e+'="'+d.attrs[e]+'" ')}var h=[];for(e in d.flashvars){h.push(e+"="+d.flashvars[e])}d.paras["flashvars"]=h.join("&");if(a.IE){f.push('<object width="'+d.width+'" height="'+d.height+'" id="'+d.id+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');f.push(g.join(""));f.push('><param name="movie" value="'+b+'" />');for(e in d.paras){f.push('<param name="'+e+'" value="'+d.paras[e]+'" />')}f.push("</object>")}else{f.push('<embed width="'+d.width+'" height="'+d.height+'" id="'+d.id+'" src="'+b+'" type="application/x-shockwave-flash" ');f.push(g.join(""));for(e in d.paras){f.push(e+'="'+d.paras[e]+'" ')}f.push(" />")}d.html=f.join("");return d}var c={};c.create=function(c,d,e){var f=a.E(c);if(f==null){throw"swf: ["+c+"] 未找到";return}var g=b(d,e);f.innerHTML=g.html;return a.E(g.id)};c.html=function(a,c){var d=b(a,c);return d.html};c.check=function(){var b=-1;if(a.IE){try{var c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");b=c.GetVariable("$version")}catch(d){}}else{if(navigator.plugins["Shockwave Flash"]){b=navigator.plugins["Shockwave Flash"]["description"]}}return b};return c});
$WBIM.register("core.util.storage",function(a){var b=window.localStorage;if(b){return{get:function(a){return unescape(b.getItem(a))},set:function(a,c,d){b.setItem(a,escape(c))},del:function(a){b.removeItem(a)},clear:function(){b.clear()},getAll:function(){var a=b.length,c=null,d=[];for(var e=0;e<a;e++){c=b.key(e);d.push(c+"="+b.getItem(c))}return d.join("; ")}}}else if(window.ActiveXObject){var c=document.documentElement;var d="localstorage";try{c.addBehavior("#default#userdata");c.save("localstorage")}catch(e){}return{set:function(a,b){c.setAttribute(a,b);c.save(d)},get:function(a){c.load(d);return c.getAttribute(a)},del:function(a){c.removeAttribute(a);c.save(d)}}}else{return{get:function(a){var b=document.cookie.split("; "),c=b.length,d=[];for(var e=0;e<c;e++){d=b[e].split("=");if(a===d[0]){return unescape(d[1])}}return null},set:function(a,b,c){if(!(c&&c instanceof Date)){c=new Date;c.setDate(c.getDate()+1)}document.cookie=a+"="+escape(b)+"; expires="+c.toGMTString()},del:function(a){document.cookie=a+"=''; expires=Fri, 31 Dec 1999 23:59:59 GMT;"},clear:function(){var a=document.cookie.split("; "),b=a.length,c=[];for(var d=0;d<b;d++){c=a[d].split("=");this.deleteKey(c[0])}},getAll:function(){return unescape(document.cookie.toString())}}}});
$WBIM.register("webim.base.boot",function(a){$WBIM.language=function(b){return a.core.util.language(b,window.$LANG)}});
$WBIM.register("webim.base.Class",function(a){var b=function(){function j(a){var b=[];for(var c in a)b.push(a[c]);return b}function i(a){if(typeof a!=="object"){throw new Error("Type error:")}var b=[];for(var c in a){if(a.hasOwnProperty(c)){b.push(c)}}return b}function h(a){return Object.prototype.toString.call(a)==="[object Function]"}function g(a){var b=a.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return b.length==1&&!b[0]?[]:b}function f(a,b){for(var c in b)a[c]=b[c];return a}function e(b){var c=this.superclass&&this.superclass.prototype,d=i(b);if(a){if(b.toString!=Object.prototype.toString)d.push("toString");if(b.valueOf!=Object.prototype.valueOf)d.push("valueOf")}for(var e=0,f=d.length;e<f;e++){var g=d[e],j=b[g];if(h(this.prototype[g])){this.basemethods[g]=this.prototype[g]}this.prototype[g]=j}return this}function d(){function e(){function c(b){a.base[b]=function(){var c=a.base.curtor;try{if(c.baseclass){a.base.curtor=c.baseclass;if(c.basemethods[b]){return c.basemethods[b].apply(a,arguments)}else{return a.base[b].apply(a,arguments)}}else{return c.prototype[b].apply(a,arguments)}}finally{a.base.curtor=c}}}function b(a){if(a){var b=i(a.prototype);for(var d in a.prototype){if(h(a.prototype[d]))c(d)}}}var a=this;this.base={curtor:this.constructor};b(this.constructor);if(this.initialize)this.initialize.apply(this,arguments)}var a=null;var d=[].slice.apply(arguments);if(h(d[0]))a=d.shift();f(e,b.Methods);e.baseclass=a;e.basemethods={};e.subclasses=[];if(a){c.prototype=a.prototype;e.prototype=new c;a.subclasses.push(e)}for(var g=0,j=d.length;g<j;g++)e.addMethods(d[g]);if(!e.prototype.initialize)e.prototype.initialize=function(){};e.prototype.constructor=e;return e}function c(){}var a=function(){for(var a in{toString:1}){if(a==="toString")return false}return true}();return{create:d,Methods:{addMethods:e}}}();return b});
$WBIM.register("webim.utils.Core",function(a){window.SUDA=window.SUDA||{uaTrack:function(){}};var b={zip:"rar",docx:"word",doc:"word",xls:"excel",xlsx:"excel",wma:"music",mp3:"music",amr:"music",exe:"exe",pdf:"pdf",rar:"rar",txt:"txt",pptx:"ppt",ppt:"ppt",flv:"video",mkv:"video",mp4:"video",mpeg:"video",mpg2:"video",rmvb:"video",avi:"video",jpg:"image",gif:"image",jpeg:"image",png:"image"},c=a.core.evt.addEvent,d=/\.([a-zA-Z0-9]+$)/;return{bindEvents:function(a,b,d){for(var e=0,f=d.length;e<f;e++){c(a,d[e],b)}},fixBottomForIE6:function(a,b){function i(){f.top=h()}function h(){h=g?function(){var c=d.documentElement;return c.scrollTop+(c.clientHeight-a.clientHeight)-b+"px"}:function(){var c=d.body;return c.scrollTop+(c.clientHeight-a.clientHeight)-b+"px"};return h()}var d=document,e,f=a.style,g=d.compatMode&&d.compatMode==="CSS1Compat";f.position="absolute";i();c(window,"scroll",function(){if(e){clearTimeout(e)}f.display="none";e=setTimeout(function(){i();f.display="";e=null},300)});c(window,"resize",i)},cutString:function(b,c){var d=a.core.str.bLength;b=b||"";var e=a.core.str.leftB(b,c);if(d(e)<d(b)){e+=".."}return e},singleton:function(a){var b;return function(){return b||(b=a.apply(this,arguments))}},flashFlg:function(){var b=false;if(a.IE){try{var c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");b=c&&c.GetVariable("$version")?true:false}catch(d){b=false}}else{b=navigator.plugins["Shockwave Flash"]&&navigator.plugins["Shockwave Flash"]["description"]?true:false}return b}(),checkFlashVersion:function(b){if(!this.flashFlg){return false}var c=a.core.util.swf.check();if(a.IE){c=parseInt(c.split(" ")[1].split(",")[0])}else{c=parseInt(c.match(/Shockwave Flash (\d+)/)[1])}return b<=c},stopBubble:function(b){var c=b?b:a.core.evt.getEvent();if(a.IE){c.cancelBubble=true}else{c.stopPropagation()}},getFileImg:function(a){var c=d.exec(a.toLowerCase()),e=c?b[c[1]]:"";return e?e:"default"},getFileImgByExtension:function(a){return b[a]||"default"},getCurrentUIDByCookie:function(){var b=unescape(a.core.util.cookie.get("SUP")),c=b.match(/uid=([0-9]+)&/);if(b&&c&&c[1]){a.webim.$currentUID=c[1];return a.webim.$currentUID}else{return false}}}});
$WBIM.register("webim.utils.streamEvent",function(a){return function(a){var b=this;var c={},d={},e={};var f=function(a,b){if(b.indexOf){return b.indexOf(a)}for(var c=0,d=b.length;c<d;c++){if(b[c]===a){return c}}return-1};var g=function(a){return function(b,d,e){if(b&&d){b=[].concat(b);for(var f=0,g=b.length;f<g;f++){c[b[f]][a].push({fn:d,data:e})}}}};var h=function(a){return function(b,d){if(b){if(d){var e=c[b][a],g=f(b,e);g!=-1&&e.splice(g,1)}else{c[b][a]=[]}}}};var i=function(a){var b=d[a].valid,c=true;for(var e=0,f=b.length;e<f;e++){var g=b[e].fn;c&&g&&(c=g())}return c};var j=function(a){if(d[a].condition==undefined){d[a].condition=i(a);if(!d[a].condition&&d[a].auto){e[a]=setInterval(function(){if(i(a)){clearInterval(e[a]);b.release(a)}},100)}}return d[a].condition};var k=function(a,b){for(var c in d){if(c!=a&&d[c].condition==false){if(d[c].cache[b]){return false}}}return true};var l=function(a,b,d,e){var f=c[b][a],g=true;for(var h=0,i=f.length;h<i;h++){var j=f[h].fn;j&&(g=g&&j({type:b,data:f[h].data,config:e},d)!=false)}return g};this.define=function(b){b=[].concat(b);for(var d=0,e=b.length;d<e;d++){c[b[d]]={};c[b[d]].rely=[];for(var f=0,g=a.length;f<g;f++){c[b[d]][a[f]]=[]}}};this.defineRely=function(a,b){if(d[a]){return false}else{d[a]={condition:undefined,cache:{},valid:[],auto:b};return true}};this.unDefine=function(a){a?c[a]&&delete c[a]:c={}};this.unDefineRely=function(a){for(var b in c){var e=c[b].rely,g=f(a,e);if(g!=-1){e.splice(g,1)}}a?delete d[a]:d={}};this.valid=function(a,b){if(a&&b){d[a].valid.push({fn:b})}};this.rely=function(a,b){if(a&&b){a=[].concat(a);for(var d=0,e=a.length;d<e;d++){c[a[d]].rely.push(b)}}};this.fire=function(b,e,g,h){g=g||{};e=e||{};if(typeof b=="string"&&c[b]){var i=h?f("main",a):0;for(var k=i,m=a.length;k<m;k++){var n=a[k];if(n!="main"){if(!g["un"+n]){if(!l(n,b,e,g)){return false}}}else{var o=c[b].rely,p=true;if(!g["unvalid"]&&!h){for(var q=0,r=o.length;q<r;q++){if(!j(o[q])){var s=d[o[q]].cache[b];s||(s=d[o[q]].cache[b]=[]);s.push({args:e,config:g});p=false}}}if(p){if(!l(n,b,e,g)){return false}}else{return false}}}return true}};this.release=function(a,c,e){var f=d[a];if(f&&!(c==false)){f.condition=true;for(var g in f.cache){if(k(a,g)){var h=f.cache[g];for(var i=0,j=h.length;i<j;i++){e&&(h[i].args.expand=e);b.fire(g,h[i].args,h[i].config,true)}}}f.cache={}}};this.destory=function(){c={};d={}};this.log=function(b,d){if(b){if(c[b]){var e=c[b];console.log("StreamEvent "+b+" Log : ");console.log("    Rely: ",e.rely);for(var f=0,g=a.length;f<g;f++){var h=c[b][a[f]].length;console.log("    Aspect "+a[f]+" : "+h+" functions.");if(d&&d==a[f]){for(var i=0;i<h;i++){console.log("        Function "+i+" : \n\t"+c[b][a[f]][i].fn)}}}}}else{for(var b in c){var e=c[b];console.log("StreamEvent "+b+" Log : ");console.log("    Rely: ",e.rely);var h=0;for(var f=0,g=a.length;f<g;f++){h+=c[b][a[f]].length}console.log("    Bind: "+h+" functions.")}}};(function(){for(var c=0,d=a.length;c<d;c++){var e=a[c];b[e]=g(e);b[e+"Remove"]=h(e)}})()}});
$WBIM.register("webim.utils.dataGateWay",function(a){var b="__dataGateKey__",c=1,d={};var e=function(a){return typeof a=="number"?a:a[b]};return{define:function(a){var e=typeof a=="number"?a:a[b]||(a[b]=c++);d[e]||(d[e]={})},calc:function(a,b,c){if(a&&typeof b=="string"&&c){var f=e(a);if(!d[f][b]){d[f][b]=[{fn:c}]}else{d[f][b].push({fn:c})}}},value:function(b,c,f,g){var h={},i=[],j={};if(b&&typeof c=="string"){var k=e(b);var l=d[k][c];var m=l?l.length:0;for(var n=m-1;n>-1&&l[n];n--){var o=l[n].fn;if(o&&o.apply){try{var p=o.apply(b,[{type:c}].concat(f));for(var k in p){if(k!="error"){if(g){if(h[k]){if(!j[k]){h[k]=[h[k]];j[k]=true}h[k].push(p[k])}else{h[k]=p[k]}}else{h[k]=p[k]}}else{i.push(p[k])}}}catch(q){a.log("[error][dataGeteWay]"+q.message)}}}if(i.length>0){h["errors"]=i}}return h}}});
$WBIM.register("webim.utils.debug",function(a){var b=a.E("wbim_test"),c=[],d=null,e=null,f=15;a.webim.loglevel={shaohui:false,geyan:false,zhongwen:false,system:false,zzm:false};var g=0;window._webim_log=function(){if(!a.webim.loglevel[arguments[0]]||arguments.length<1){return}arguments[0]=arguments[0]+": ";b=b||document.body.appendChild(a.C("div"));try{if(window.console&&window.console.log){e=window.console.log}if(e&&!a.core.util.browser.IE){e.apply(console,arguments)}else{if(a.core.util.browser.IE&&!a.core.util.browser.IE9){e=function(){}}var f=Array.prototype.slice.call(arguments);for(var g=0,h=f.length;g<h;g++){if(typeof f[g]!="string"){f[g]=a.core.json.jsonToStr(f[g]);f[g]='<div title="双击可切换" class="code">'+f[g]+"</div>"}e(f[g])}c.push(f.join(" "));e("\n");if(!d){d=setInterval(function(){var a=c.slice(0);if(a.length>0){b.innerHTML=[b.innerHTML,a.join("<br/><br/>")].join("<br/><br/>")}c.length=0},500)}}}catch(i){}}});
$WBIM.register("webim.utils.Array",function(a){var b=a.core.arr.indexOf;return{include:function(a,c){var d=b(c,a);if(d==-1){a.push(c)}return a},erase:function(a,c){var d=b(c,a);if(d!==-1){a.splice(d,1)}},associate:function(a,b){var c={};for(var d=a.length;d--;){c[a[d]]=b[d]}return c},backeach:function(a,b){var c=[];for(var d=a.length,e=d-1;e>-1;e-=1){var f=b(a[e],e);if(f===false){break}else if(f!==null){c[e]=f}}return c}}});
$WBIM.register("webim.utils.date",function(a){var b=(new Date).getTime(),c,d;var e={Jan:"0",Feb:"1",Mar:"2",Apr:"3",May:"4",Jun:"5",Jul:"6",Aug:"7",Sep:"8",Oct:"9",Nov:"10",Dec:"11"};return{format:function(a,c){var c=c||$WBIM.getTime();var d=(new Date).getTime(),e=new Date(parseInt(a)),f,g,h,i,j,k,l=[(l=e.getHours())<10?"0":"",l].join(""),m=[(m=e.getMinutes())<10?"0":"",m].join(""),n,o;c=c+((o=d-b)<0?0:o);b=d;d=new Date(c);f=d.getFullYear();g=d.getMonth();n=d.getDate();h=e.getFullYear();i=e.getMonth()+1;k=e.getDate();if(a-(new Date(f,0,1)).getTime()>-1){if(a-(new Date(f,g,n)).getTime()>0){return[l,m].join(":")}return[[i,k].join("-"),[l,m].join(":")].join(" ")}return[[h,i,k].join("-"),[l,m].join(":")].join(" ")},getFormatedCurrentTime:function(){return this.format($WBIM.getTime(),$WBIM.getTime())},getCurrentTime:function(){return $WBIM.getTime()},getWeiboTime:function(a){var b;var c=a.split(" ");var d=c[3].split(":");c[2]=parseInt(c[2],10);var f=parseInt(c[5],10);var g=e[c[1]];var h=parseInt(c[2],10);var i=parseInt(d[0],10);var j=parseInt(d[1],10);var k=parseInt(d[2],10);var l=new Date;var m=new Date(f,g,h,i,j,k);var n=m.getTime()-8*3600*1e3-l.getTimezoneOffset()*60*1e3;var o=(l.getTime()-n)/1e3;if(o<=0)o=1;var p=m.getDate()==l.getDate();h=h<10?"0"+h:h;i=i<10?"0"+i:i;j=j<10?"0"+j:j;switch(true){case o<=50:b=parseInt(o/10+1)+"0秒前";break;case o>50&&o<3600:b=parseInt(o/60+1)+"分钟前";break;case o>=3600&&o<3600*24:b=(p?"今天 ":"昨天 ")+i+":"+j;break;case o>=3600*24:b=g- -1+"月"+h+"日"+i+":"+j;break}return b},getMsgTimeLine:function(a){var b;var c,d,e,f;var g=a+"";if(g.length<13){a=a*Math.pow(10,13-g.length)}var h=new Date;var i=new Date(a);c=i.getDate();d=i.getHours();e=i.getMinutes();f=i.getMonth();var j=(h.getTime()-a)/1e3;if(j<=0)j=1;var k=i.getDate()==h.getDate();c=c<10?"0"+c:c;d=d<10?"0"+d:d;e=e<10?"0"+e:e;switch(true){case j<=50:b=parseInt(j/10+1)+"0秒前";break;case j>50&&j<3600:b=parseInt(j/60+1)+"分钟前";break;case j>=3600&&j<3600*24:b=(k?"今天 ":"昨天 ")+d+":"+e;break;case j>=3600*24:b=f- -1+"月"+c+"日"+d+":"+e;break}return b}}});
$WBIM.register("webim.utils.LazyLoader",function(a){function e(b){var c={prop:"imgsrc",container:null,sltImg:"",queue:true,delay:50,area:true,initCheck:false,checkLimited:null};this.options=a.webim.utils.extend(c,b);this._bindEvents();if(this.options.initCheck)this.check.apply(this,arguments)}var b=a.core.dom,c=a.core.dom.sizzle,d=a.core.arr.foreach;$indexOf=a.core.arr.indexOf;e.prototype={_bindEvents:function(){var b=this;if(this.options.area){a.core.evt.addEvent(this.options.container,"scroll",function(){b.check()})}},_initHeight:function(a){var c=this.options;if(!c.cHeight){c.cHeight=b.getSize(c.container).height}if(!c.iHeight){c.iHeight=b.getSize(a[0]).height}this._initHeight=null},_showByQueue:function(a){var c=this;var e=this.options.prop;var f=b.position(this.options.container).t;var g=f+this.options.cHeight;d(a,function(a,d){var e=a;if(!e.getAttribute(c.options.prop))return;var h=b.position(e).t;if(h<=g&&h+c.options.iHeight>=f){c.options.queList=c.options.queList||[];if($indexOf(e,c.options.queList)==-1){c.options.queList.push(e)}}});if(this.options.queList&&this.options.queList[0]&&!this.options.queing){this.options.queing=true;(function(){var a=arguments.callee;var d=c.options.queList.shift();b.ready(function(){if(c.options.queList[0]){setTimeout(a,c.options.delay)}});d.setAttribute("src",d.getAttribute(c.options.prop));d.removeAttribute(c.options.prop);if(!c.options.queList.length){c.options.queing=false}})()}if(!this.options.queList.length){this.options.queing=false}},_show:function(a){var c=b.position(this.options.container).t;var e=c+this.options.cHeight;var f=this;d(a,function(a,d){if(!a.getAttribute(f.options.prop))return;var g=b.position(a).t;if(g<=e&&g+f.options.iHeight>=c){a.setAttribute("src",a.getAttribute(f.options.prop));a.removeAttribute(f.options.prop)}})},_show2:function(a){var b=this;d(a,function(a,c){if(!a||!a.getAttribute(b.options.prop))return;var d=a.parentNode&&a.parentNode.parentNode,e;if(d&&(e=d.offsetParent)){var f=e.scrollTop,g=f+e.clientHeight,h=d.offsetTop,i=h+d.clientHeight;if(i<=g+30){a.setAttribute("src",a.getAttribute(b.options.prop));a.removeAttribute(b.options.prop)}}})},check:function(a){var b=this,e=this.options,f=[];if(e.checkLimited&&e.checkLimited()){return}d(c(e.sltImg,a||e.container),function(a,b){a.getAttribute(e.prop)&&f.push(a)});if(f.length===0)return;var g=c("li",a||e.container);this._initHeight&&this._initHeight(g);if(e.queue){this._showByQueue(f);setTimeout(function(){b._showByQueue(f)},50)}else{setTimeout(function(){b._show2(f)},100)}}};return e});
$WBIM.register("webim.utils.extend",function(a){return function(a,b){for(var c in b){a[c]=b[c]}return a}});
var swfobject=function(){function V(b){var c=/[\\\"<>\.;]/;var d=c.exec(b)!=null;return d&&typeof encodeURIComponent!=a?encodeURIComponent(b):b}function U(a,b){if(!x){return}var c=b?"visible":"hidden";if(t&&P(a)){P(a).style.visibility=c}else{T("#"+a,"visibility:"+c)}}function T(c,d,e,f){if(y.ie&&y.mac){return}var g=i.getElementsByTagName("head")[0];if(!g){return}var h=e&&typeof e=="string"?e:"screen";if(f){v=null;w=null}if(!v||w!=h){var j=Q("style");j.setAttribute("type","text/css");j.setAttribute("media",h);v=g.appendChild(j);if(y.ie&&y.win&&typeof i.styleSheets!=a&&i.styleSheets.length>0){v=i.styleSheets[i.styleSheets.length-1]}w=h}if(y.ie&&y.win){if(v&&typeof v.addRule==b){v.addRule(c,d)}}else{if(v&&typeof i.createTextNode!=a){v.appendChild(i.createTextNode(c+" {"+d+"}"))}}}function S(a){var b=y.pv,c=a.split(".");c[0]=parseInt(c[0],10);c[1]=parseInt(c[1],10)||0;c[2]=parseInt(c[2],10)||0;return b[0]>c[0]||b[0]==c[0]&&b[1]>c[1]||b[0]==c[0]&&b[1]==c[1]&&b[2]>=c[2]?true:false}function R(a,b,c){a.attachEvent(b,c);o[o.length]=[a,b,c]}function Q(a){return i.createElement(a)}function P(a){var b=null;try{b=i.getElementById(a)}catch(c){}return b}function O(a){var b=P(a);if(b){for(var c in b){if(typeof b[c]=="function"){b[c]=null}}b.parentNode.removeChild(b)}}function N(a){var b=P(a);if(b&&b.nodeName=="OBJECT"){if(y.ie&&y.win){b.style.display="none";(function(){if(b.readyState==4){O(a)}else{setTimeout(arguments.callee,10)}})()}else{b.parentNode.removeChild(b)}}}function M(a,b,c){var d=Q("param");d.setAttribute("name",b);d.setAttribute("value",c);a.appendChild(d)}function L(c,d,f){var g,h=P(f);if(y.wk&&y.wk<312){return g}if(h){if(typeof c.id==a){c.id=f}if(y.ie&&y.win){var i="";for(var j in c){if(c[j]!=Object.prototype[j]){if(j.toLowerCase()=="data"){d.movie=c[j]}else{if(j.toLowerCase()=="styleclass"){i+=' class="'+c[j]+'"'}else{if(j.toLowerCase()!="classid"){i+=" "+j+'="'+c[j]+'"'}}}}}var k="";for(var l in d){if(d[l]!=Object.prototype[l]){k+='<param name="'+l+'" value="'+d[l]+'" />'}}h.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+i+">"+k+"</object>";n[n.length]=c.id;g=P(c.id)}else{var m=Q(b);m.setAttribute("type",e);for(var o in c){if(c[o]!=Object.prototype[o]){if(o.toLowerCase()=="styleclass"){m.setAttribute("class",c[o])}else{if(o.toLowerCase()!="classid"){m.setAttribute(o,c[o])}}}}for(var p in d){if(d[p]!=Object.prototype[p]&&p.toLowerCase()!="movie"){M(m,p,d[p])}}h.parentNode.replaceChild(m,h);g=m}}return g}function K(a){var c=Q("div");if(y.win&&y.ie){c.innerHTML=a.innerHTML}else{var d=a.getElementsByTagName(b)[0];if(d){var e=d.childNodes;if(e){var f=e.length;for(var g=0;g<f;g++){if(!(e[g].nodeType==1&&e[g].nodeName=="PARAM")&&!(e[g].nodeType==8)){c.appendChild(e[g].cloneNode(true))}}}}}return c}function J(a){if(y.ie&&y.win&&a.readyState!=4){var b=Q("div");a.parentNode.insertBefore(b,a);b.parentNode.replaceChild(K(a),b);a.style.display="none";(function(){if(a.readyState==4){a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)}})()}else{a.parentNode.replaceChild(K(a),a)}}function I(b,c,d,e){u=true;r=e||null;s={success:false,id:d};var g=P(d);if(g){if(g.nodeName=="OBJECT"){p=K(g);q=null}else{p=g;q=d}b.id=f;if(typeof b.width==a||!/%$/.test(b.width)&&parseInt(b.width,10)<310){b.width="310"}if(typeof b.height==a||!/%$/.test(b.height)&&parseInt(b.height,10)<137){b.height="137"}i.title=i.title.slice(0,47)+" - Flash Player Installation";var j=y.ie&&y.win?"ActiveX":"PlugIn",k="MMredirectURL="+h.location.toString().replace(/&/g,"%26")+"&MMplayerType="+j+"&MMdoctitle="+i.title;if(typeof c.flashvars!=a){c.flashvars+="&"+k}else{c.flashvars=k}if(y.ie&&y.win&&g.readyState!=4){var l=Q("div");d+="SWFObjectNew";l.setAttribute("id",d);g.parentNode.insertBefore(l,g);g.style.display="none";(function(){if(g.readyState==4){g.parentNode.removeChild(g)}else{setTimeout(arguments.callee,10)}})()}L(b,c,d)}}function H(){return!u&&S("6.0.65")&&(y.win||y.mac)&&!(y.wk&&y.wk<312)}function G(c){var d=null;var e=P(c);if(e&&e.nodeName=="OBJECT"){if(typeof e.SetVariable!=a){d=e}else{var f=e.getElementsByTagName(b)[0];if(f){d=f}}}return d}function F(){var b=m.length;if(b>0){for(var c=0;c<b;c++){var d=m[c].id;var e=m[c].callbackFn;var f={success:false,id:d};if(y.pv[0]>0){var g=P(d);if(g){if(S(m[c].swfVersion)&&!(y.wk&&y.wk<312)){U(d,true);if(e){f.success=true;f.ref=G(d);e(f)}}else{if(m[c].expressInstall&&H()){var h={};h.data=m[c].expressInstall;h.width=g.getAttribute("width")||"0";h.height=g.getAttribute("height")||"0";if(g.getAttribute("class")){h.styleclass=g.getAttribute("class")}if(g.getAttribute("align")){h.align=g.getAttribute("align")}var i={};var j=g.getElementsByTagName("param");var k=j.length;for(var l=0;l<k;l++){if(j[l].getAttribute("name").toLowerCase()!="movie"){i[j[l].getAttribute("name")]=j[l].getAttribute("value")}}I(h,i,d,e)}else{J(g);if(e){e(f)}}}}}else{U(d,true);if(e){var n=G(d);if(n&&typeof n.SetVariable!=a){f.success=true;f.ref=n}e(f)}}}}}function E(){var c=i.getElementsByTagName("body")[0];var d=Q(b);d.setAttribute("type",e);var f=c.appendChild(d);if(f){var g=0;(function(){if(typeof f.GetVariable!=a){var b=f.GetVariable("$version");if(b){b=b.split(" ")[1].split(",");y.pv=[parseInt(b[0],10),parseInt(b[1],10),parseInt(b[2],10)]}}else{if(g<10){g++;setTimeout(arguments.callee,10);return}}c.removeChild(d);f=null;F()})()}else{F()}}function D(){if(k){E()}else{F()}}function C(b){if(typeof h.addEventListener!=a){h.addEventListener("load",b,false)}else{if(typeof i.addEventListener!=a){i.addEventListener("load",b,false)}else{if(typeof h.attachEvent!=a){R(h,"onload",b)}else{if(typeof h.onload=="function"){var c=h.onload;h.onload=function(){c();b()}}else{h.onload=b}}}}}function B(a){if(t){a()}else{l[l.length]=a}}function A(){if(t){return}try{var a=i.getElementsByTagName("body")[0].appendChild(Q("span"));a.parentNode.removeChild(a)}catch(b){return}t=true;var c=l.length;for(var d=0;d<c;d++){l[d]()}}var a="undefined",b="object",c="Shockwave Flash",d="ShockwaveFlash.ShockwaveFlash",e="application/x-shockwave-flash",f="SWFObjectExprInst",g="onreadystatechange",h=window,i=document,j=navigator,k=false,l=[D],m=[],n=[],o=[],p,q,r,s,t=false,u=false,v,w,x=true,y=function(){var f=typeof i.getElementById!=a&&typeof i.getElementsByTagName!=a&&typeof i.createElement!=a,g=j.userAgent.toLowerCase(),l=j.platform.toLowerCase(),m=l?/win/.test(l):/win/.test(g),n=l?/mac/.test(l):/mac/.test(g),o=/webkit/.test(g)?parseFloat(g.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,p=!+"1",q=[0,0,0],r=null;if(typeof j.plugins!=a&&typeof j.plugins[c]==b){r=j.plugins[c].description;if(r&&!(typeof j.mimeTypes!=a&&j.mimeTypes[e]&&!j.mimeTypes[e].enabledPlugin)){k=true;p=false;r=r.replace(/^.*\s+(\S+\s+\S+$)/,"$1");q[0]=parseInt(r.replace(/^(.*)\..*$/,"$1"),10);q[1]=parseInt(r.replace(/^.*\.(.*)\s.*$/,"$1"),10);q[2]=/[a-zA-Z]/.test(r)?parseInt(r.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof h.ActiveXObject!=a){try{var s=new ActiveXObject(d);if(s){r=s.GetVariable("$version");if(r){p=true;r=r.split(" ")[1].split(",");q=[parseInt(r[0],10),parseInt(r[1],10),parseInt(r[2],10)]}}}catch(t){}}}return{w3:f,pv:q,wk:o,ie:p,win:m,mac:n}}(),z=function(){if(!y.w3){return}if(typeof i.readyState!=a&&i.readyState=="complete"||typeof i.readyState==a&&(i.getElementsByTagName("body")[0]||i.body)){A()}if(!t){if(typeof i.addEventListener!=a){i.addEventListener("DOMContentLoaded",A,false)}if(y.ie&&y.win){i.attachEvent(g,function(){if(i.readyState=="complete"){i.detachEvent(g,arguments.callee);A()}});if(h==top){(function(){if(t){return}try{i.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}A()})()}}if(y.wk){(function(){if(t){return}if(!/loaded|complete/.test(i.readyState)){setTimeout(arguments.callee,0);return}A()})()}C(A)}}();var W=function(){if(y.ie&&y.win){window.attachEvent("onunload",function(){var a=o.length;for(var b=0;b<a;b++){o[b][0].detachEvent(o[b][1],o[b][2])}var c=n.length;for(var d=0;d<c;d++){N(n[d])}for(var e in y){y[e]=null}y=null;for(var f in swfobject){swfobject[f]=null}swfobject=null})}}();return{registerObject:function(a,b,c,d){if(y.w3&&a&&b){var e={};e.id=a;e.swfVersion=b;e.expressInstall=c;e.callbackFn=d;m[m.length]=e;U(a,false)}else{if(d){d({success:false,id:a})}}},getObjectById:function(a){if(y.w3){return G(a)}},embedSWF:function(c,d,e,f,g,h,i,j,k,l){var m={success:false,id:d};if(y.w3&&!(y.wk&&y.wk<312)&&c&&d&&e&&f&&g){U(d,false);B(function(){e+="";f+="";var n={};if(k&&typeof k===b){for(var o in k){n[o]=k[o]}}n.data=c;n.width=e;n.height=f;var p={};if(j&&typeof j===b){for(var q in j){p[q]=j[q]}}if(i&&typeof i===b){for(var r in i){if(typeof p.flashvars!=a){p.flashvars+="&"+r+"="+i[r]}else{p.flashvars=r+"="+i[r]}}}if(S(g)){var s=L(n,p,d);if(n.id==d){U(d,true)}m.success=true;m.ref=s}else{if(h&&H()){n.data=h;I(n,p,d,l);return}else{U(d,true)}}if(l){l(m)}})}else{if(l){l(m)}}},switchOffAutoHideShow:function(){x=false},ua:y,getFlashPlayerVersion:function(){return{major:y.pv[0],minor:y.pv[1],release:y.pv[2]}},hasFlashPlayerVersion:S,createSWF:function(a,b,c){if(y.w3){return L(a,b,c)}else{return undefined}},showExpressInstall:function(a,b,c,d){if(y.w3&&H()){I(a,b,c,d)}},removeSWF:function(a){if(y.w3){N(a)}},createCSS:function(a,b,c,d){if(y.w3){T(a,b,c,d)}},addDomLoadEvent:B,addLoadEvent:C,getQueryParamValue:function(a){var b=i.location.search||i.location.hash;if(b){if(/\?/.test(b)){b=b.split("?")[1]}if(a==null){return V(b)}var c=b.split("&");for(var d=0;d<c.length;d++){if(c[d].substring(0,c[d].indexOf("="))==a){return V(c[d].substring(c[d].indexOf("=")+1))}}}return""},expressInstallCallback:function(){if(u){var a=P(f);if(a&&p){a.parentNode.replaceChild(p,a);if(q){U(q,true);if(y.ie&&y.win){p.style.display="block"}}if(r){r(s)}}u=false}}}}();
$WBIM.register("webim.utils.holiday",function(a){var b=[{m:4,d:1},{m:8,d:9}];return{isHoliday:function(){var c=new Date;a.core.arr.foreach(b,function(a){if(a.m==c.getMonth()+1&&a.d==c.getDate()){return true}});return false}}});
$WBIM.register("webim.utils.string",function(a){var b=function(a){a=a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\\u003c/g,"&lt;").replace(/\\u003e/g,"&gt;");return a};return{escapeHTML:b}});
$WBIM.register("webim.utils.charPosition",function(a){var b=["fontFamily","fontSize","fontWeight","fontVariant","fontStyle","paddingLeft","paddingTop","paddingBottom","paddingRight","marginLeft","marginTop","marginBottom","marginRight","borderLeftColor","borderTopColor","borderBottomColor","borderRightColor","borderLeftStyle","borderTopStyle","borderBottomStyle","borderRightStyle","borderLeftWidth","borderTopWidth","borderBottomWidth","borderRightWidth","lineHeight","outline"];var c=a.core.dom;var d=function(a,d){for(var e=0,f=b.length;e<f;e++){try{var g=c.getStyle(a,b[e]);if(!!g){c.setStyle(d,b[e],g)}}catch(h){}}};var e=function(a){return a.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br>").split(" ").join('<span style="white-space:prev-wrap">&nbsp;</span>')};var f=null;var g=false;var h=function(){var b=a.E("WB_webim");if(!f||!g){g=true;f=a.C("div");c.insertElement(b,f);if(a.core.util.browser.IE6){setTimeout(function(){var b=document,d=b.compatMode&&b.compatMode==="CSS1Compat",e=a.E("WB_webim");var f=d?function(){var a=b.documentElement;return a.scrollTop+(a.clientHeight-e.clientHeight)+"px"}():function(){var a=b.body;return a.scrollTop+(a.clientHeight-e.clientHeight)+"px"}();(function(b){setTimeout(function(){c.setStyle(a.E("WB_webim"),"top",b)},0)})(f)},0)}}};var i=function(a){h();d(a,f);c.setStyle(f,"wordWrap","break-word");c.setStyle(f,"overflowX","hidden");c.setStyle(f,"overflowY","auto");c.setStyle(f,"visibility","hidden");c.setStyle(f,"width",c.getStyle(a,"width"));c.setStyle(f,"height",c.getStyle(a,"height"));f.innerHTML=""};var j=function(a,b){var d=a.value,g=b;var h=d.substring(0,g),i=d.substring(g);var j='<span class="before">'+e(h)+"&nbsp;</span>"+'<span class="focus">|</span>'+'<span class="after">'+e(i)+"</span>";f.innerHTML=j;var k=f.childNodes[1];return{top:k.offsetTop-f.offsetTop-a.scrollTop+parseInt(c.getStyle(a,"fontSize")),left:k.offsetLeft-f.offsetLeft-a.scrollLeft}};return{init:i,compute:j}});
$WBIM.register("webim.utils.pluginstallState",function(a){return function(b,c,d,e){var f={};var g=a.core.util.browser,h=window.navigator;var i=a.IE,j=g.MOZ,k=g.OPERA,l=g.SAFARI,m=g.CHROME,n=g.Version;var o=b.pluginName;f.instance=e;var p=function(){var a;for(a=0;a<d.length;a++){if(!(d[a]in f.instance)){break}}if(a<d.length-1){return false}else{return true}};f.getInstallState=function(){if(i){var a;if(f.instance){if(p()){return true}}}else{var b=h.plugins;if(b&&b.length){for(var c=0,d=b.length;c<d;c++){var e=b[c];if(e&&e.name&&e.name===o){return true}}}}return false};return f}});
$WBIM.register("webim.utils.weiboDesktop",function(a){var b=window.$CONFIG&&window.$CONFIG["uid"]||a.webim.utils.Core.getCurrentUIDByCookie()||"";var c=a.core.util.browser.IE;var d=a.core.dom.builder;var e=a.webim.utils.pluginstallState;var f={pluginName:"npScreenGrab Plugin",activeXName:"ScreenGrab.ScreenGrabCom.1"};var g={embedId:"weibo_screen_grab_embed",embedType:"application/x-screengrab-sina"};var h=["OnGrapContent","CloseScreenGrabCtrlWnd","onmsgfireevent"];var i=c?'<OBJECT style="position:absolute;right:0;top:0;" node-type="webim_desktop_plugin" ID="WeiboDesktopAssistCom" WIDTH="1" HEIGHT="1" type="application/x-oleobject" CLASSID="CLSID:EA6E924C-93A9-46ea-8975-D57FB9B9D1D8"></OBJECT>':'<embed node-type="webim_desktop_plugin" style="position:absolute;right:0;top:0;" ID="WeiboDesktopAssistCom" type="application/x-weibodesktopassist-sina" width="1" height="1" />';var j=d(i);var k=j.list["webim_desktop_plugin"][0];var l;var m={};m.getInstallState=function(){return;if(!l){document.body.appendChild(k);l=e(f,g,h,k)}return l.getInstallState()};m.CallClient=function(){return;if(!m.getInstallState())return;var a=document.getElementById("WeiboDesktopAssistCom");if(c){if(a&&a.ClientHelper){a.ClientHelper.CallClient(b,"weibo")}}else{a&&a.CallClient&&a.CallClient(b,"weibo")}};return m});
$WBIM.register("lib.kit.extra.merge",function(a){return function(a,b){var c={};for(var d in a){c[d]=a[d]}for(var d in b){c[d]=b[d]}return c}});$WBIM.register("lib.kit.extra.language",function(a){window.$LANG||(window.$LANG={});return function(b){var c=[].splice.call(arguments,1,arguments.length);var d=[b,$LANG].concat(c);var e=a.core.util.language.apply(this,d);return e}});$WBIM.register("lib.kit.io.ajax",function(a){var b=function(b,c,d){c=c|0||1;d=d||"fail";var e=b["args"];if(e["__rnd"]){delete e["__rnd"]}(new Image).src="http://weibolog.sinaapp.com/?t="+c+"&u="+encodeURIComponent(b["url"])+"&p="+encodeURIComponent(a.core.json.jsonToQuery(e))+"&m="+d;(new Image).src="http://s1.sinaedge.com/whb.gif?t="+c+"&u="+encodeURIComponent(b["url"])+"&p="+encodeURIComponent(a.core.json.jsonToQuery(e))+"&m="+d};return function(c){var d={};var e=[];var f=null;var g=false;var h=a.parseParam({url:"",method:"get",responseType:"json",timeout:30*1e3,onTraning:a.funcEmpty,isEncode:true},c);h.onComplete=function(a){g=false;c.onComplete(a,h.args);setTimeout(i,0)};h.onFail=function(a){g=false;if(typeof c.onFail==="function"){try{c.onFail(a,h.args)}catch(d){}}setTimeout(i,0);try{b(h)}catch(d){}};h.onTimeout=function(a){try{b(h);c.onTimeout(a)}catch(d){}};var i=function(){if(!e.length){return}if(g===true){return}g=true;h.args=e.shift();if(h.method.toLowerCase()=="post"){var b=a.core.util.URL(h.url);b.setParam("__rnd",+(new Date));h.url=b.toString()}f=a.ajax(h)};var j=function(a){while(e.length){e.shift()}g=false;if(f){try{f.abort()}catch(b){}}f=null};d.request=function(a){if(!a){a={}}if(c.noQueue){j()}if(!c.uniqueRequest||!f){e.push(a);a["_t"]=0;i()}};d.abort=j;return d}});$WBIM.register("lib.kit.io.jsonp",function(a){return function(b){var c=a.parseParam({url:"",method:"get",responseType:"json",varkey:"_v",timeout:30*1e3,onComplete:a.funcEmpty,onTraning:a.funcEmpty,onFail:a.funcEmpty,isEncode:true},b);var d=[];var e={};var f=false;var g=function(){if(!d.length){return}if(f===true){return}f=true;e.args=d.shift();e.onComplete=function(a){f=false;c.onComplete(a,e["args"]);setTimeout(g,0)};e.onFail=function(a){f=false;c.onFail(a);setTimeout(g,0)};a.jsonp(a.core.json.merge(c,{args:e.args,onComplete:function(a){e.onComplete(a)},onFail:function(a){try{e.onFail(a)}catch(b){}}}))};var h={};h.request=function(a){if(!a){a={}}d.push(a);a["_t"]=1;g()};h.abort=function(a){while(d.length){d.shift()}f=false;e=null};return h}});$WBIM.register("lib.kit.io.ijax",function(a){return function(b){var c=a.parseParam({url:"",timeout:30*1e3,isEncode:true,abaurl:null,responseName:null,varkey:"callback",abakey:"callback"},b);var d=[];var e=null;var f=false;c.onComplete=function(a,d){f=false;b.onComplete(a,c.form,d);c.form=null;c.args=null;setTimeout(g,0)};c.onFail=function(a,d){f=false;b.onFail(a,c.form,d);c.form=null;c.args=null;setTimeout(g,0)};var g=function(){var b;if(!d.length){return}if(f===true){return}f=true;b=d.shift();c.args=b["args"];c.form=b["form"];e=a.ijax(c)};var h=function(a){while(d.length){d.shift()}f=false;if(e){try{e.abort()}catch(b){}}e=null};var i={};i.request=function(c,e){if(!a.isNode(c)){throw"[lib.kit.io.ijax.request] need a form as first parameter"}if(!e){e={}}if(b["noQueue"]){h()}d.push({form:c,args:e});g()};i.abort=h;return i}});$WBIM.register("lib.kit.io.inter",function(a){var b=a.core.json.merge;return function(){var c={};var d={};var e={};var f=function(a,b){return function(c,d){try{b.onComplete(c,d)}catch(f){}try{if(c.code==="100000"){b.onSuccess(c,d)}else{b.onError(c,d)}}catch(f){}for(var g in e[a]){try{e[a][g](c,d)}catch(f){}}}};var g=function(a,b,c){return function(d){try{b.onComplete(d,c)}catch(f){}try{if(d.code==="100000"){b.onSuccess(d,c)}else{b.onError(d,c)}}catch(f){}for(var g in e[a]){try{e[a][g](d,c)}catch(f){}}}};c.register=function(a,b){if(typeof d[a]!=="undefined"){throw a+" registered"}d[a]=b;e[a]={}};c.addHook=function(b,c){var d=a.core.util.getUniqueKey();e[b][d]=c;return d};c.rmHook=function(a,b){if(e[a]&&e[a][b]){delete e[a][b]}};c.getTrans=function(c,e){var g=b(d[c],e);g.onComplete=f(c,e);g.url+=(g.url.indexOf("?")>=0?"&":"?")+"ajwvr=6";if(g.withDomain){g.url+="&domain="+$CONFIG.domain}var h=d[c].requestMode;var i="ajax";if(h==="jsonp"||h==="ijax"){i=h}return a.lib.kit.io[i](g)};c.request=function(c,e,f){var h=b(d[c],e);h.onComplete=g(c,e,f);h.url+=(h.url.indexOf("?")>=0?"&":"?")+"ajwvr=6";if(h.withDomain){h.url+="&domain="+$CONFIG.domain}h=a.core.obj.cut(h,["noqueue"]);h.args=f;var i=d[c].requestMode;if(i==="jsonp"){return a.jsonp(h)}else if(i==="ijax"){return a.ijax(h)}else{return a.ajax(h)}};return c}});$WBIM.register("conf.trans.validateCode",function(a){var b=a.lib.kit.io.inter();var c=b.register;c("checkValidate",{url:"/aj/pincode/verified",method:"post"});return b});$WBIM.register("lib.kit.io.cssLoader",function(a){var b="";var c="http://img.t.sinajs.cn/t4/";var d="http://timg.sjs.sinajs.cn/t4/";if(typeof $CONFIG!="undefined"){c=$CONFIG.cssPath||c;b=$CONFIG["version"]||""}var e={};return function(f,g,h,i,j){i=i||b;h=h||function(){};var k=function(a,b){var c=e[a]||(e[a]={loaded:false,list:[]});if(c.loaded){b(a);return false}c.list.push(b);if(c.list.length>1){return false}return true};var l=function(a){var b=e[a].list;for(var c=0;c<b.length;c++){b[c](a)}e[a].loaded=true;delete e[a].list};if(!k(f,h))return;var m;if(j){m=d+f}else{m=c+f+"?version="+i}var n=a.C("link");n.setAttribute("rel","Stylesheet");n.setAttribute("type","text/css");n.setAttribute("charset","utf-8");n.setAttribute("href",m);document.getElementsByTagName("head")[0].appendChild(n);var o=a.C("div");o.id=g;a.core.util.hideContainer.appendChild(o);var p=3e3;var q=function(){if(parseInt(a.core.dom.getStyle(o,"height"))==42){a.core.util.hideContainer.removeChild(o);l(f);return}if(--p>0){setTimeout(q,10)}else{a.log(f+"timeout!");a.core.util.hideContainer.removeChild(o);delete e[f]}};setTimeout(q,50)}});$WBIM.register("lib.dialog.loginLayer",function(a){var b;var c="http://tjs.sjs.sinajs.cn/t5/register/js/page/remote/loginLayer.js";return function(d){d=a.core.obj.parseParam({lang:"zh-cn",loginSuccessUrl:encodeURIComponent(window.location.href),currentTab:""},d||{});if(window.WBtopGlobal_loginLayer){WBtopGlobal_loginLayer(d)}else{if(b){return}else{b=true;a.core.io.scriptLoader({url:c,onComplete:function(){b=false;window.WBtopGlobal_loginLayer(d)},timeout:1e4,onTimeout:function(){b=false}})}}}});$WBIM.register("lib.dialog.authentication",function(a){return function(b){var c=a.lib.kit.extra.language,d=a.core.util.browser;b=a.parseParam({src:"http://weibo.com/a/verify/realname?stage=home_verification",icon:"warn",isHold:true,width:"380px",height:"240px",title:c("#L{帐号验证}")},b||{});var e={},f,g,h=false;var i="tblog_checkfailed_reform";var j={init:function(){f=STK.ui.dialog(b);var c=[];c.push('<iframe id="account_authentication" name="account_authentication" node-type="frame" width="'+b.width+'" height="'+b.height+'" allowtransparency="true" scrolling="no" frameborder="0" src=""></iframe>');var d=a.builder(c.join(""));f.setTitle(b.title);f.setContent(d.box);var e=f.getDomList()},show:function(){try{window.SUDA&&SUDA.uaTrack&&SUDA.uaTrack(i,"checkfailed_box")}catch(c){}if(!h){a.lib.kit.io.cssLoader("style/css/module/layer/layer_check_identity.css","js_style_css_module_layer_check_identity",function(){h=true})}f.show().setMiddle();g=a.E("account_authentication");var d=decodeURIComponent(b.src)+"&rnd=";if(g.attachEvent){g.attachEvent("onload",function(){g.height=b.height;f.setMiddle()})}else{g.onload=function(){g.height=b.height;f.setMiddle()}}g.src=d+a.core.util.getUniqueKey()},destroy:function(){},hook:function(a,b){try{if(a=="100000"){j.verifySucc()}else{j.verifyFail()}}catch(c){}},verifySucc:function(){window.SUDA&&SUDA.uaTrack&&SUDA.uaTrack(i,"checkfailed_success");f.hide();var b={title:c("#L{提示}"),icon:"success",OK:function(){window.SUDA&&SUDA.uaTrack&&SUDA.uaTrack(i,"checkfailed_play");history.go(0)},OKText:c("#L{进入首页}"),msg:c("#L{恭喜，您的身份已验证成功，马上进入微博。}")};var d=STK.ui.alert(b.msg,b);a.custEvent.add(d,"hide",function(){history.go(0)})},verifyFail:function(){window.SUDA&&SUDA.uaTrack&&SUDA.uaTrack(i,"checkfailed_twotimes");f.hide();var b={title:c("#L{提示}"),icon:"warn",OK:function(){SUDA.uaTrack&&SUDA.uaTrack(i,"checkfailed_triple");j.show()},OKText:c("#L{再次验证}"),msg:c("#L{抱歉，您的身份信息不准确，请再次验证。<br/>}")+'<a class="S_spetxt" suda-data="key=tblog_checkfailed_reform&value=checkfailed_havealook" href="http://weibo.com">'+c("#L{您也可以先体验微博，随后再验证身份信息>>}")+"</a>"};var d=STK.ui.alert(b.msg,b);a.custEvent.add(d,"hide",function(){history.go(0)})}};j.init();e.destroy=j.destory;e.show=j.show;window["App"]=window["App"]||{};window["App"]["checkRealName"]=j.hook;return e}});$WBIM.register("lib.dialog.memberDialog",function(a){var b=""+'<div node-type="outer" class="layer_point">'+'<dl class="point clearfix">'+'<dt><span class="" node-type="icon"></span></dt>'+'<dd node-type="inner">'+'<p class="S_txt1" node-type="textLarge"></p>'+'<p class="S_txt1" node-type="textComplex"></p>'+'<p class="S_txt2" node-type="textSmall"></p>'+"</dd>"+"</dl>"+"</div>"+'<div class="W_layer_btn S_bg1">'+'<a href="javascript:void(0);" class="W_btn_b" node-type="OK"></a>'+'<a href="javascript:void(0);" class="W_btn_a" node-type="cancel"></a>'+'<a href="http://vip.weibo.com/paycenter?pageid=byebank" class="W_btn_a" node-type="member"><span><em class="W_icon icon_member"></em>#L{立即开通会员}</span></a>'+"</div>";var c={success:"icon_succM",error:"icon_errorM",warn:"icon_warnM","delete":"icon_delM",question:"icon_questionM"};var d=a.lib.kit.extra.language;var e=function(e,f){var g,h,i,j,k,l;g=a.parseParam({title:"&nbsp;",icon:"warn",textLarge:e,textComplex:"",textSmall:"",OK:a.funcEmpty,OKText:d("#L{确定}"),cancel:a.funcEmpty,cancelText:d("#L{确认}")},f);g["icon"]=c[g["icon"]];h={};i=STK.ui.dialog();i.setContent(d(b));l=i.getDomList(true);l["icon"].className=g["icon"];l["textLarge"].innerHTML=g["textLarge"];l["textComplex"].innerHTML=g["textComplex"];l["textSmall"].innerHTML=g["textSmall"];l["OK"].innerHTML="<span>"+g["OKText"]+"</span>";l["cancel"].innerHTML="<span>"+g["cancelText"]+"</span>";i.setTitle(g["title"]);i.getDomList().title.style.borderBottomStyle="none";var m=function(){j=true;k=a.htmlToJson(l["textComplex"]);i.hide()};a.addEvent(l["OK"],"click",m);a.addEvent(l["cancel"],"click",i.hide);a.custEvent.add(i,"hide",function(){a.custEvent.remove(i,"hide",arguments.callee);a.removeEvent(l["OK"],"click",m);a.removeEvent(l["cancel"],"click",i.hide);if(j){g["OK"](k)}else{g["cancel"](k)}});i.show().setMiddle();h.dia=i;return h};return function(b){b=a.parseParam({type:"follow",errortype:"1"},b);var c,f;var g={textLarge:d("#L{您已达到悄悄关注上限！}"),textComplex:d('#L{开通}<a href="http://vip.weibo.com/privilege">#L{微博会员}</a>，#L{悄悄关注上限立即提高}'),textSmall:d('#L{可}<a href="http://vip.weibo.com/paycenter?pageid=byebank" class="S_link2">#L{开通会员}</a>#L{或先将悄悄关注减少至10人以下，再添加}'),OKText:d("#L{管理我的悄悄关注}"),OK:function(){a.preventDefault();window.location.href="/"+$CONFIG["uid"]+"/whisper"}};var h={textLarge:d("#L{您已达到关注上限！}"),textComplex:d('#L{开通}<a href="http://vip.weibo.com/privilege">#L{微博会员}</a>，#L{关注上限立即提高}'),textSmall:d('#L{可}<a href="http://vip.weibo.com/paycenter?pageid=byebank" class="S_link2">#L{开通会员}</a>#L{或先将关注减少至2000人以下，再添加}'),OKText:d("#L{管理我的关注}"),OK:function(){a.preventDefault();window.location.href="/"+$CONFIG["uid"]+"/follow"}};if(b.type=="quiet"){switch(parseInt(b.errortype,10)){case 2:g.textLarge=d("#L{您当前已达会员等级悄悄关注上限啦！}");g.textSmall="";g.textComplex=d('<a href="http://vip.weibo.com/privilege" class="S_link2">#L{了解更多会员特权信息»}</a>');break;case 1:g.textLarge=d("#L{您已达到悄悄关注上限！}");g.textSmall="";g.textComplex=d('#L{开通}<a href="http://vip.weibo.com/privilege">#L{微博会员}</a>，#L{悄悄关注上限立即提高}');break;case 3:g.textLarge=d("#L{您已达到悄悄关注上限！}");g.textComplex=d('#L{开通}<a href="http://vip.weibo.com/privilege">#L{微博会员}</a>，#L{悄悄关注上限立即提高}');g.textSmall=d('#L{可}<a href="http://vip.weibo.com/paycenter">#L{开通会员}</a>#L{或将悄悄关注减少至10人以下，再添加}');break}c=g}else{switch(parseInt(b.errortype,10)){case 2:h.textLarge=d("#L{您当前已达会员等级关注上限啦！}");h.textSmall="";h.textComplex=d('<a href="http://vip.weibo.com/privilege" class="S_link2">#L{了解更多会员特权信息»}</a>');break;case 1:h.textLarge=d("#L{您已达到关注上限！}");h.textSmall="";h.textComplex=d('#L{开通}<a href="http://vip.weibo.com/privilege">#L{微博会员}</a>，#L{关注上限立即提高}');break;case 3:h.textLarge=d("#L{您已达到关注上限！}");h.textComplex=d('#L{开通}<a href="http://vip.weibo.com/privilege">#L{微博会员}</a>，#L{关注上限立即提高}');h.textSmall=d('#L{可}<a href="http://vip.weibo.com/paycenter">#L{开通会员}</a>#L{或将关注减少至2000人以下，再添加}');break}c=h}f=e("",c);if(parseInt(b.errortype,10)==2){f.dia.getDomList()["member"].style.display="none"}else{f.dia.getDomList()["cancel"].style.display="none"}}});$WBIM.register("lib.dialog.ioError",function(a){var b=a.lib.kit.extra.language;var c;var d;return function(d,e,f){var g={},h,i,j=function(){};var k={init:function(){k.data()},data:function(){i=a.parseParam({auto:true,call:j,ok:j,cancel:j,beside:null},f);h=a.parseParam({location:"",OKText:b("#L{确 定}"),cancelText:b("#L{取 消}"),suda:""},e.data);h.msg=e.msg||b("#L{系统繁忙}");h["OK"]=function(){a.preventDefault();var b=a.queryToJson(h.suda||"");b=b["ok"]||{};window.SUDA&&SUDA.uaTrack&&b.key&&SUDA.uaTrack(b.key,b.value);i["ok"]();h.location&&(window.location.href=h.location)};h["cancel"]=function(){a.preventDefault();var b=a.queryToJson(h.suda||"");b=b["cancel"]||{};window.SUDA&&SUDA.uaTrack&&b.key&&SUDA.uaTrack(b.key,b.value);i["cancel"]()}},run:function(){var a=l[e.code]||l["100001"];return a()||i.call(h,e)},destroy:function(){c&&c.destroy()}};var l={100001:function(){if(i.beside){STK.ui.tipAlert(h.msg,a.core.json.merge(h,{autoHide:false,icon:"warnS"})).beside(i.beside)}else{STK.ui.alert(h.msg.split("\\n"),a.core.json.merge(h,{icon:"warnB"}))}},100002:function(){a.lib.dialog.loginLayer({lang:window.$CONFIG&&window.$CONFIG["lang"]||"zh-cn"})},100003:function(){if(i.beside){STK.ui.tipConfirm(h.msg,h).beside(i.beside)}else{STK.ui.confirm(h.msg.split("\n"),h)}},100004:function(){if(!c){c=a.lib.dialog.authentication()}c.show()},100005:function(){h.type=e.data&&(e.data.type?e.data.type:"follow");h.errortype=e.data&&(e.data.errortype||"1");return a.lib.dialog.memberDialog(h||{})},100008:function(){a.lib.dialog.loginLayer({lang:window.$CONFIG&&window.$CONFIG["lang"]||"zh-cn"})}};k.init();g.getdata=function(){return h};g.getAction=function(a){return a?l[a]:l};g.getCode=function(){return e.code||""};g.run=k.run;i.auto&&k.run();return g}});$WBIM.register("lib.dialog.validateCode",function(a){var b=window.$LANG,c=a.lib.kit.extra.language;var d="/aj/pincode/pin?_wv=5&type=rule&lang="+$CONFIG.lang+"&ts=";var e={dialog_html:""+'<div class="layer_point layer_verification">'+'<div class="clearfix">'+'<div class="v_img W_fl"><img height="25" width="250" class="yzm_img"/></div>'+'<div class="v_change W_fl"><a href="javascript:void(0);" class="yzm_change" action-type="yzm_change"><span class="W_ficon ficon_rotate S_ficon">e</span><span class="font S_txt1">#L{换一组}</span></a></div>'+"</div>"+'<div class="v_text yzm_wng">'+'<span class="v_text">#L{请输入上面问题的答案}：</span>'+'<input type="text" class="yzm_input ontext W_input" action-type="yzm_input"/>'+"</div>"+'<div class="W_layer W_layer_pop yzm_error" style="display:none;top:70px;left:200px;">'+'<div class="content layer_mini_info">'+'<p class="main_txt"><i class="W_icon icon_rederrorS"></i><span class="txt S_txt1"></span><a class="W_ficon ficon_close S_ficon yzm_hideError">X</a></p>'+'<div class="W_layer_arrow"><span class="W_arrow_bor W_arrow_bor_b"><i class="S_line3"></i><em class="S_bg2_br"></em></span></div>'+"</div>"+"</div>"+"</div>"+'<div class="W_layer_btn S_bg1">'+'<a class="W_btn_a btn_34px yzm_submit" href="javascript:void(0);" action-type="yzm_submit">#L{确定}</a><a class="W_btn_b btn_34px yzm_cancel" href="javascript:void(0);" action-type="yzm_cancel" action-data="value=frombtn">#L{取消}</a>'+"</div>"};var f;return function(){if(f){return f}var b={};var g={};var h;var i;var j;var k;var l=function(){g.yzm_error.innerHTML="";g.yzm_error_layer.style.display="none";a.removeClassName(g.yzm_wng,"v_wrong")};var m=function(b){g.yzm_error.innerHTML=b;g.yzm_error_layer.style.display="";a.addClassName(g.yzm_wng,"v_wrong")};var n=function(b){a.lib.kit.io.cssLoader("style/css/module/layer/layer_verifycode.css","js_style_css_module_layer_layer_verifycode",function(){if(!h){o()}l();h.setTop();h.show().on("hide",function(){b&&b()});t.changesrc();h.setMiddle();g.input_text.value="";a.hotKey.add(document.documentElement,["esc"],t.closeDialog,{type:"keyup",disableInInput:true})})};var o=function(){h=STK.ui.dialog({isHold:true});h.setTitle(c("#L{请输入验证码}"));h.setContent(c(e.dialog_html));var a=h.getBox();s(a);u()};var p=function(b){a.conf.trans.validateCode.request("checkValidate",{onError:function(){m(c("#L{验证码错误}"));t.changesrc();j=false;g.input_text.value=""},onFail:function(){m(c("#L{验证码错误}"));t.changesrc();g.input_text.value="";j=false},onSuccess:function(a,b){j=false;var c=a.data.retcode;l();g.input_text.value="";h.hide();i(c)}},b)};var q=function(){};var r=function(){};var s=function(b){g.vImg=a.core.dom.sizzle("img.yzm_img",b)[0];g.yzm_change=a.core.dom.sizzle("a.yzm_change",b)[0];g.yzm_submit=a.core.dom.sizzle("a.yzm_submit",b)[0];g.yzm_cancel=a.core.dom.sizzle("a.yzm_cancel",b)[0];g.input_text=a.core.dom.sizzle("input.yzm_input",b)[0];g.yzm_wng=a.core.dom.sizzle("div.yzm_wng",b)[0];g.yzm_error=a.core.dom.sizzle("div.yzm_error span.txt",b)[0];g.yzm_error_layer=a.core.dom.sizzle("div.yzm_error",b)[0];g.yzm_hideError=a.core.dom.sizzle(".yzm_hideError",b)[0]};var t={enter:function(){a.fireEvent(g.yzm_submit,"click")},changesrc:function(){var b=d+a.getUniqueKey();g.vImg.setAttribute("src",b);try{g.yzm_change.blur()}catch(c){}},checkValidateCode:function(){l();var b=a.core.str.trim(g.input_text.value);if(!b){m(c("#L{请输入验证码}"))}else{if(!j){p({secode:b,type:"rule"})}}try{g.yzm_submit.blur()}catch(d){}},closeDialog:function(b){if(typeof b=="object"&&b.el){h.hide()}if(typeof i=="object"&&i.onRelease&&typeof i.onRelease=="function"){i.onRelease()}a.hotKey.remove(document.documentElement,["esc"],t.closeDialog,{type:"keyup"});try{a.preventDefault()}catch(c){}},onFocus:function(b){b=a.getEvent();var c=b.target||b.srcElement;var d=c.value;if(!d){l()}}};var u=function(){var b=h.getBox();k=a.delegatedEvent(b);k.add("yzm_change","click",function(){t.changesrc();a.preventDefault()});k.add("yzm_submit","click",function(){t.checkValidateCode();a.preventDefault()});k.add("yzm_cancel","click",t.closeDialog);a.addEvent(g.yzm_hideError,"click",l);a.addEvent(g.input_text,"focus",t.onFocus);a.addEvent(g.input_text,"blur",t.onFocus);a.hotKey.add(g.input_text,["enter"],t.enter,{type:"keyup"})};var v=function(){if(h){k.destroy();a.removeEvent(g.yzm_hideError,"click",l);a.removeEvent(g.input_text,"focus",t.onFocus);a.removeEvent(g.input_text,"blur",t.onFocus);h&&h.destroy&&h.destroy()}j=h=f=null};var w=function(a,b,c){if(a.ret=="406"&&a.errCode=="20031"){i=b;n(c)}};r();r=null;b.destroy=v;b.validateIntercept=w;b.addUnloadEvent=function(){if(h){a.addEvent(window,"unload",v)}};f=b;return b}});
$WBIM.register("webim.utils.data",function(a){var b={};return{set:function(a,c){b[a]=c},get:function(a){return b[a]},clear:function(){b={}}}});
$WBIM.register("webim.ui.uiEvent",function(a){function e(a,b,d){return c.value(this,a,b,d)}function d(a,b){c.calc(this,a,b)}var b=new a.webim.utils.streamEvent(["first","front","before","main","after","behind","last"]),c=a.webim.utils.dataGateWay;var f=["manager.minDataReady","manager.presence","manager.myPresence","manager.updateRecents","manager.removeRoster","manager.updateRelation","manager.setSelfStatus","manager.blockscreate","manager.chat","manager.mass","manager.sendFail","manager.groupDataReady","manager.setGroupMbrCount","manager.otherJoin","manager.groupBlock","manager.meJoin","manager.meQuit","manager.kickMe","manager.otherQuit","manager.changeGroup","manager.changeRole","manager.userNewMsg","manager.groupNewMsg","manager.groupNewNotice","manager.groupNewMsg.before","manager.userNewMsg.notify","manager.groupNewMsg.notify","manager.comment","manager.notify.cancel","manager.setting.success","manager.setting.fail","manager.forward","manager.removeRecent","contactsPanel.userClicked"];var g=["request.user.vcard","request.user.display","request.user.open","request.user.search","request.user.block","request.user.chat","request.group.display","request.group.open","request.group.count","request.group.check","request.group.block","request.setting.bottom","request.setting.side","request.setting.autoHideChatWin","request.setting.helloWindow","request.setting.onlineTips","request.setting.newMsgSound","request.setting.showcntip","request.weibo.comment","request.weibo.publish","request.self.status","request.file.info","request.pubWhiteList","request.invite.response","request.like","request.restrict","request.setting.notice","request.user.by.nick","request.attention.users","request.attention.recent","save.editor.text","save.desktop","save.news.msgId","save.tip.status","request.event.create"];var h=["msg.user.send","msg.forward.send","msg.group.send","msg.mass.send","msg.user.clean","msg.group.clean","msg.group.msgoverline","sync.user.send","sync.group.send"];var i=["ui.scrolling","ui.maxPanel.show","ui.maxPanel.hide","ui.minPanel.show","ui.minPanel.hide","ui.bar.show","ui.previewBox.show","ui.bar.hide","ui.chatmini.newMsg","ui.chatmini.show","ui.chatmini.hide","ui.weibo.show","ui.weibo.hide","ui.unfold.side","ui.unfold.bottom","ui.phiz.select","ui.phiz.show","ui.phiz.hide","ui.massWindow.show","ui.massWindow.hide","ui.chatWindow.show","ui.chatWindow.init","ui.chatWindow.initGroup","ui.closeChatWindow","ui.miniChatWindow","ui.preventminiChatWindow","ui.unpreventminiChatWindow","ui.activeChatUser","ui.closeChatUser","ui.closeChatGroup","ui.chatUserGroup.addUser","ui.chatUserGroup.removeUser","ui.realCloseChatWindow","ui.showEnvolopeTip","ui.clearEnvolopeTip","ui.clickEnvolopeTip","ui.beforeHideChatWindow","ui.chatTab.added","ui.chatUser.active","ui.chatUser.remove","ui.chatWindow.hide","ui.chatWindow.close","ui.addChartInputing","ui.stopInputing","ui.updateGroupMbrCount","ui.updateGroupOpt","ui.updateUserStatus","ui.blockGroupMsg","ui.user.click","ui.activeChatUser","ui.addChartInputing","ui.stopInputing","ui.updateGroupMbrCount","ui.updateGroupOpt","ui.beforeHideChatWindow","ui.cancelUpload","ui.deleteUpload","ui.sendMsg","ui.helloWindow.msg","ui.hideUploadTips","ui.historySendMsg","ui.sendButtonChange","ui.showSysTips","ui.requestInTextarea","ui.swf.upload.start","ui.swf.upload.complete","ui.swf.upload.showMsg","ui.swf.upload.setTitle","ui.receiveFileInfo","ui.historyMsg","ui.uploadFile.rollback","ui.chatUserGroup.addUser","ui.otherQuitGroup","ui.otherJoinGroup","ui.afterUpdateUnreadMsgCount","ui.changeChatUser","ui.sendedMsgFail","ui.userBlocksCreate","ui.selfQuitGroup","ui.groupList.addGroup","ui.groupUser.notChat","ui.confirmWin.confirms","ui.previewBox.changeUrl","ui.contactsPanel.userClicked","beforeHideChatWindow","activeChatUser","reconnect.notify","ui.changeSendMethod","ui.wrapNode.click","ui.chatwinow.init.ready","ui.maxContactsTab.show","ui.maxGroupsTab.show","ui.maxRecentsTab.show","ui.other.click","ui.default.bottom","ui.default.side","ui.init.online","ui.init.hide","ui.weibo.imgLarge","ui.maxSettingMenu.show","ui.maxSettingMenu.hide","ui.weibo.realShow","ui.lowModel","ui.onlineTips.show","ui.helloUser.msg","ui.loadPhizData","ui.getPhizData","ui.screenCaptureData","ui.screenCaptureStart","ui.drawWall.show","ui.group.changeRemindType","ui.tips.show","ui.tips.close","ui.tips.setting","ui.publicMsg.open","ui.minPanel.opacity","ui.emailValid.show","ui.createNewContent","ui.loadAttachFile","ui.resizeContent","ui.receiveXiaoweiMsg","ui.reSendMsg","ui.user.blockUser","ui.content.scrollToBottom","ui.chatLists.addTab","ui.showBlockUserTips","ui.showBlackUserTips","ui.tip.removeUserBlock","ui.tip.removeUserBlack","ui.hideTips","ui.content.addMsg","ui.content.addPureMsg","ui.forwardWindow.show","ui.atList.show","ui.atList.next","ui.atList.prev","ui.atList.chose","ui.atList.hide","ui.subButton.click","ui.blueTD.click","ui.tip.addUserBlock","request.user.history","ui.longMsg.show","ui.content.getMoreHistory","ui.content.addMoreHistoryMsg","ui.content.getMoreGroupHistory","ui.content.addMoreMsgBtn","ui.removeHistory.moreButton","ui.content.init","ui.minSearch.showOrHide","ui.maxSearch.hide","ui.settingDataReady","ui.chatWindow.render","ui.refreshSetting","ui.content.updateMsg","ui.unread.change","ui.initChatTabs","ui.setting","ui.upload.openPreview","ui.content.empty","ui.msgEditor.showCount","ui.editor.changeHeight","ui.contactList.empty","ui.group.changeTitle","ui.showNewMsgNotice","ui.hideNewMsgNotice","ui.content.cleanNew"];var j=["connected","reconnect","reconnect.time","reconnect.fail","userReconnect","reconnect.request","reconnect.stop"];var k=["sudaUatrack"];var l={first:b.first,front:b.front,before:b.before,add:b.main,after:b.after,behind:b.behind,last:b.last,rely:b.rely,valid:b.valid,release:b.release,fire:b.fire,remove:b.mainRemove,removeBefore:b.beforeRemove,defineRely:b.defineRely,unDefineRely:b.unDefineRely,log:b.log,calc:d,value:e,managerEvents:f,requestEvents:g,msgEvents:h,uiEvents:i,systemEvents:j};b.define(f);b.define(g);b.define(h);b.define(i);b.define(j);b.define(k);b.defineRely("managerReady");b.defineRely("initReady");b.defineRely("groupReady");b.defineRely("maxReady");b.defineRely("webim.ui.max.main");b.defineRely("webim.ui.min.main");b.defineRely("webim.ui.chatWindow.main");b.defineRely("webim.ui.massWindow");b.defineRely("webim.ui.phiz");b.defineRely("webim.ui.lastWeibo");b.defineRely("webim.ui.canvas.drawWall");c.define(l);return l});
$WBIM.register("webim.ui.notice.base",function(a){return function(){var b=a.webim.ui.uiEvent;var c=$WBIM.initData&&$WBIM.initData.setting&&$WBIM.initData.setting.notice&&$WBIM.initData.setting.notice.block;if(c){}else{};}});
$WBIM.register("webim.ui.notice.pullNews",function(a){return function(){var b=a.core.io.jsonp;var c=a.webim.ui.uiEvent;var d="http://wbapp.mobile.sina.cn/interface/f/ttt/v3/pc_win.php?posid=pos51dbbc713bb90&uid=";var e=a.webim.utils.Core.getCurrentUIDByCookie();var f=function(){f=null;b({url:d+e,onComplete:function(a){if(!a){return}var b={bigTitle:a.title,title:a.content,url:a.link,adId:a.id,clickUrl:a.click_url}}})};c.add("ui.settingDataReady",function(){f&&f()})}});
$WBIM.register("webim.ui.notice.noticeBox",function(a){function B(){this.uid=a.webim.utils.Core.getCurrentUIDByCookie();var b=w(y).list;for(var c in b){var d=b[c];this[c]=d.length>1?d:d[0]}this.broadCastUrl="";this.settingShowFlg=null;this.pos={};this.initPosition();this.bindDomEvent();this.bindDataEvent();b=null}var b=2e8;var c="44px";var d="200px";var e="68px";var f="5px";var g="0";var h="快讯";var i=99999;var j=6;var k={bottomFloat:{bottom:c,right:g},broadsideFloat:{bottom:f,right:e},maxPanelLeft:{right:d},chatMiniShow:{bottom:c},chatMiniHide:{bottom:f},BOTTOM:{bottom:f},ONBAR:{bottom:c},DEFAULT:{bottom:c,right:g}};var l=a.tool;var m="http://nas.im.api.weibo.com/im/broadcast/report.json";var n=$WBIM.language,o=a.core.dom.contains,p=a.core.arr.inArray,q=a.core.evt.stopEvent,r=a.core.evt.addEvent,s=a.core.dom,t=a.core.str.leftB,u=a.core.io.jsonp,v=s.setStyle,w=s.builder;var x=a.webim.ui.uiEvent;var y=n(['<div class="webim_news" style="bottom:50px;" node-type="root">','    <div class="webim_news_bd clearfix" node-type="normalNews">','        <h3 class="news_title W_fl W_fb W_f14" node-type="big_title">快讯</h3>','        <div class="news_mod W_fl">','            <div class="news_bg"></div>','            <div class="news_cont clearfix">','                <p class="news_font W_fl W_f14"><a href="javascript:void(0);" onclick="return false;" node-type="newsmain_info">新闻快讯</a></p>','                <div class="news_btns W_fl">','                    <a href="javascript:void(0);" onclick="return false;" class="W_ficon ficon_setup S_ficon" node-type="settingNode">J</a>','                    <a href="javascript:void(0);" onclick="return false;" class="W_ficon ficon_close S_ficon" node-type="closeNode">X</a>',"                </div>","            </div>","        </div>","    </div>","    <!-- 设置 -->",'    <div class="layer_menu_list" style="top:-22px; right:28px; display:none;" node-type="settingPanel">','        <ul><li node-type="blockNode"><a href="javascript:void(0);" onclick="return false;">关闭新闻提醒</a></li></ul>',"    </div>","    <!-- 设置 -->","</div>"].join(""));var z=window.SUDA.uaTrack;var A=function(a,b){z("tblog_news_pop",a+":"+b)};B.prototype={render:function(a){a.appendChild(this.root);this.setPosition(this.pos);this.render=null},bindDomEvent:function(){var b=this;r(this.root,"click",function(a){var c=a.target||a.srcElement;switch(true){case c==b.closeNode||o(b.closeNode,c):b.hide();A("close",b.newsId);if(b.clickCloseUrl){b.sendCloseAction(b.clickCloseUrl)}q();break;case c==b.settingNode||o(b.settingNode,c):b.settingClick();q();break;case c==b.blockNode||o(b.blockNode,c):b.hideNode(b.settingPanel);b.settingShowFlg=false;b.closeNoticeSetting();q();break;default:A("click",b.newsId);if(b.clickCloseUrl){b.sendClickAction(b.clickCloseUrl)}b.hide();window.open(b.broadCastUrl,"_blank");q();break}});r(document.body||document.documentElement,"click",function(a){if(b.settingShowFlg){var c=a.srcElement||a.target;!o(b.root,c)&&b.hideNode(b.settingPanel);b.settingShowFlg=false}});if(a.core.util.browser.IE6){r(b.blockNode,"mouseover",function(a){v(b.blockNode,"background","#E6E6E6")});r(b.blockNode,"mouseout",function(a){v(b.blockNode,"background","#FFFFFF")})}},bindDataEvent:function(){var a=this;$WBIM.onNews(function(b){if(a.isNeedShowNotice()){var c=l.storage.getItem("v6_news");var d=c&&c.count&&c.count.split("@");var e=(new Date).toLocaleDateString()+"";if(d&&d.length==2&&d[1]==e){var f=parseInt(d[0]);if(f>=j){return}var g=d[1];f=e==g?f+1:1;var h={count:f+"@"+e,id:b.adId};l.storage.setItem("v6_news",h)}else{var h={count:1+"@"+e,id:b.adId};l.storage.setItem("v6_news",h)}a.execNotice(b)}else{return}});x.add("ui.maxPanel.show",function(){a.setPosition(k.maxPanelLeft);if(a.chatMiniShow){}else{a.setPosition(k.BOTTOM)}a.barShow=false});x.add("ui.minPanel.show",function(){a.setPosition(k.broadsideFloat);if(a.chatMiniShow){a.setPosition(k.ONBAR)}else{};});x.add("ui.bar.show",function(){a.setPosition(k.bottomFloat);a.barShow=true});x.add("ui.miniChatWindow",function(){a.setPosition(k.chatMiniShow);a.chatMiniShow=true});x.add("ui.realCloseChatWindow",function(){if(a.barShow){a.setPosition(k.bottomFloat)}else{a.setPosition(k.BOTTOM)}a.chatMiniShow=false})},checkParam:function(a){if(a&&a.adId){if(a.adId<b){return true}else{return false}}else{return false}},isNeedShowNotice:function(){var a=$WBIM.initData.setting&&$WBIM.initData.setting.notice&&$WBIM.initData.setting.notice.block;return!a},execNotice:function(b){this.newsId=b.id||b.adId;A("pop_out",this.newsId);this.render&&this.render(a.E("WB_webim"));this.broadCastUrl=b.url;this.clickCloseUrl=b.clickUrl;this.showNotice(b)},showNotice:function(a){var b=a.id||a.adId;this.show();if(a.t==i){this.showWccNews()}else{this.showNomalNews()}this.newsmain_info.innerHTML=t(a.title,52)},settingClick:function(){if(this.settingShowFlg){this.hideNode(this.settingPanel)}else{this.showNode(this.settingPanel)}this.settingShowFlg=!this.settingShowFlg},sendBroadCastRcvd:function(a){u({url:m+"?id="+a+"&uid="+this.uid,onComplete:function(a){}})},sendCloseAction:function(a){u({url:a+"close",onComplete:function(a){}})},sendClickAction:function(a){u({url:a,onComplete:function(a){}})},initPosition:function(){for(var a in k["DEFAULT"]){this.pos[a]=k["DEFAULT"][a]}},setPosition:function(a){var a=a||this.pos;for(var b in a){v(this.root,b,a[b]);this.pos[b]=a[b]}},closeNoticeSetting:function(){x.fire("request.setting.notice",{data:{flag:0}});this.hideNode(this.settingPanel);this.hide()},show:function(){s.setStyle(this.root,"display","");s.setStyle(this.root,"visibility","visible")},hide:function(){s.setStyle(this.root,"display","none");s.setStyle(this.root,"visibility","hidden")},hideNode:function(a){s.setStyle(a,"display","none");s.setStyle(a,"visibility","hidden")},showNode:function(a){s.setStyle(a,"display","");s.setStyle(a,"visibility","visible")},showNomalNews:function(){this.showNode(this.normalNews)},showWccNews:function(){this.hideNode(this.normalNews)}};return B});
$WBIM.register("webim.ui.notice.main",function(a){return function(){new a.webim.ui.notice.noticeBox;new a.webim.ui.notice.base}});
$WBIM.register("webim.uix.util.console",function(){if(!window.console){window.console={}}if(!console.log){console.log=function(){}}if(!console.error){console.error=function(a){alert(a)}}});
$WBIM.register("webim.uix.util.stateManager",function(a){return function(a){var b={};var c;var d={};for(var e=0;a[e];e++){d[a[e]]=[]}b.changeState=function(a,b){if(!d[a]){return}if(a!==c||b){var e=d[a];for(var f=0;e[f];f++){e[f](c,a)}c=a}};b.getStateListener=function(){return d};b.getCurrentState=function(){return c};b.addStateListener=function(a){for(var b in a){d[b].push(a[b])}};return b}});
$WBIM.register("webim.uix.globalDelegate",function(a){var b=a.webim.ui.uiEvent;var c=a.core.evt.delegatedEvent(a.E("WB_webim"));c.add("userItem","click",function(c){var d=c.evt.target.className;if(!d||d.indexOf("wbim_ico_member")==-1){b.fire("ui.user.click",c.data);a.stopEvent(c.evt)}if(c.data.from=="minSearch"){b.fire("ui.minSearch.showOrHide",{flg:false})}if(c.data.from=="max"){b.fire("ui.maxSearch.hide")}});c.add("userItem","mouseover",function(a){if(a.data.from=="helloWindow"){return}if(a&&a.data&&a.data.uid){b.fire("ui.weibo.show",{spec:a})}});c.add("userItem","mouseout",function(a){b.fire("ui.weibo.hide",{form:"delegate"})});c.add("chatmini","click",function(c){var d=c.data;if(d.from==="chatmini"){d=undefined}b.fire("ui.user.click",d);a.stopEvent()});c.add("getenvolope","click",function(c){b.fire("ui.clickEnvolopeTip");a.stopEvent();return false});c.add("foldButton","click",function(c){if(c.data.from=="min"){b.fire("ui.maxPanel.show");if(c.data.type=="bottom"){b.fire("sudaUatrack",{value:"bottom_expand_button"})}else{b.fire("sudaUatrack",{value:"fold_to_unfold"})}b.fire("ui.subButton.click",{from:"foldButton"})}else if(c.data.from=="max"){b.fire("ui.minPanel.show");b.fire("ui.maxSearch.hide");b.fire("sudaUatrack",{value:"unfold_to_fold"})}a.stopEvent()});c.add("downFoldButton","click",function(){b.fire("ui.bar.show");b.fire("ui.maxSearch.hide");b.fire("sudaUatrack",{value:"unfold_to_minimize"});a.stopEvent()});c.add("onlineBar","click",function(){b.fire("ui.maxPanel.show");b.fire("sudaUatrack",{value:"minimize_to_unfold"});a.stopEvent()})});
$WBIM.register("webim.uix.bodyClickManager",function(a){function h(a,b){e[c+d++]={targets:a,callback:b}}function g(b,c){return b===c||a.contains(b,c)}var b=a.webim.ui.uiEvent;var c="id_";var d=0;var e={};var f=false;a.core.evt.addEvent(document.body||document.documentElement,"click",function(b){b=a.fixEvent(b);var c=b.target;for(var d in e){var f=e[d];var h=f.targets;for(var i=0;h[i];i++){if(!g(h[i],c)){f.callback(b)}}}});b.add("ui.preventminiChatWindow",function(){f=true});b.add("ui.unpreventminiChatWindow",function(){f=false});h([a.E("WB_webim")],function(){var c=$WBIM.initData.setting&&$WBIM.initData.setting.autoHideChatWin&&$WBIM.initData.setting.autoHideChatWin.autoHide;var d=$WBIM.initData&&$WBIM.initData.chat;var e=a.initData&&a.initData.chat&&a.initData.chat.status==="open";if(e){!f&&b.fire("ui.miniChatWindow")}if(c&&e){b.fire("ui.other.click")}});return{clickOthers:h}});
$WBIM.register("webim.uix.screenRatioManager",function(a){function d(){return(document.body||document.documentElement).offsetWidth<1200}var b=a.webim.ui.uiEvent;var c=a.webim.uix.util.stateManager(["low","high"]);a.core.evt.addEvent(window,"resize",function(){var a=d()?"low":"high";c.changeState(a)});c.addStateListener({low:function(){var c=a.webim.uix.panelManager.getCurrentPanel();if(c==="min"){b.fire("ui.minPanel.hide");b.fire("ui.bar.show")}},high:function(){var c=a.webim.uix.panelManager.getCurrentPanel();var d=$WBIM.initData;var e=d.setting&&d.setting.contactsPanel&&d.setting.contactsPanel.status;if(c==="bar"&&e==="broadsideFloat"){b.fire("ui.minPanel.show");b.fire("ui.bar.hide")}}});return{addStateListener:c.addStateListener,getCurrentState:c.getCurrentState,isLowMode:d}});
$WBIM.register("webim.uix.positionManager",function(a){function o(){for(var a in i){n(h.TIPS,i[a])}for(var a in j){n(h.CHAT,j[a])}}function n(a,b){b.style.right=m(a,true).right}function m(a,b){var i=g.LEFT;if(a===h.CHAT){if(f===e||f===d){i=g.LEFT}else{i=g.CENTER}}else if(a===h.TIPS){if(f===e){i=g.RIGHT}else if(f===c){i=g.CENTER}else if(f===d){i=g.LEFT}}else{throw"invalid type: "+a}return{right:b?i+"px":i}}function l(a,b,c){switch(b){case h.TIPS:delete i[a];break;case h.CHAT:delete j[a];break}}function k(a,b,c){switch(b){case h.TIPS:i[a]=c;break;case h.CHAT:j[a]=c;break}n(b,c)}var b=a.webim.ui.uiEvent;var c=1;var d=2;var e=3;var f=c;var g={RIGHT:0,CENTER:68,LEFT:200};var h={TIPS:1,CHAT:2};var i={};var j={};b.after("ui.maxPanel.show",function(){f=d;o()});b.after("ui.minPanel.show",function(){f=c;o()});b.after("ui.bar.show",function(){f=e;o()});return{TYPE:h,registerNode:k,unregisterNode:l,getPlacePosByType:m}});
$WBIM.register("webim.uix.panelManager",function(a){var b=a.webim.ui.uiEvent;var c;var d={};b.after("ui.maxPanel.show",function(){if(c==="bar"){b.fire("ui.bar.hide")}else if(c==="min"){b.fire("ui.minPanel.hide")}c="max"});b.after("ui.minPanel.show",function(){if(c==="bar"){b.fire("ui.bar.hide")}else if(c==="max"){b.fire("ui.maxPanel.hide")}c="min"});b.after("ui.bar.show",function(){if(c==="min"){b.fire("ui.minPanel.hide")}else if(c==="max"){b.fire("ui.maxPanel.hide")}c="bar"});return{getCurrentPanel:function(){return c},setComponent:function(a,b){d[a]=b},getComponent:function(a){return d[a]}}});
$WBIM.register("webim.uix.desktopPopManager",function(a){var b=a.webim.ui.uiEvent;var c=a.tool;var d=a.core.json.jsonToStr;var e=a.core.json.strToJson;var f="repop5";var g=[3,7];var h={isNeedShow:function(){var a=c.storage.getItem("v6_desktop");return!(a&&a.flag==f)},isWindow:function(){return a.core.util.browser.OS=="windows"},isInDate:function(){var a=new Date;a.setFullYear(2014);a.setMonth(5);a.setDate(18);a.setHours(10,0,0);var b=new Date;b.setFullYear(2014);b.setMonth(5);b.setDate(30);b.setHours(23,59,59);return(new Date).getTime()>a.getTime()&&(new Date).getTime()<b.getTime()},isTimeUp:function(){var a=c.storage.getItem("v6_desktop");if(a&&a.date&&a.times){var b=a.date;var d=a.times;if(d<3&&(new Date).getTime()-b>=g[d-1]*24*60*60*1e3){return true}else{return false}}return true},hasDesktop:function(){var b=a.webim.utils.weiboDesktop.getInstallState();return b}};return{startPop:function(){if(h.isInDate()&&h.isNeedShow()&&h.isTimeUp()&&h.isWindow()){var b=new a.webim.ui.desktopPop;b.render(a.E("WB_webim"))}}}});
$WBIM.register("webim.uix.greetingManager",function(a){window.$CONFIG=window.$CONFIG||{};var b=/^(page_)(100505|100406|100306|103505|100205|100605|100606|100206|100106|101806)(_home)$/;var c=window.SUDA.uaTrack;var d={isMyprofile:$CONFIG["oid"]===$CONFIG["uid"],isProfile:$CONFIG["location"]&&$CONFIG["location"].match(b)!=null,isEnterprice:$CONFIG["enterprise"],isChatable:function(){var b=a.sizzle('span[action-type="webim.conversation"]');return b&&b.length>0},isOnline:function(){var b=a.sizzle("span[action-type='webim.conversation'] .W_chat_stat_offline");return!(b&&b.length>0)},getFansNum:function(){if(!this.isProfile){return-1}var b=a.sizzle('.follower strong[node-type="fans"]');if(b&&b.length===1){var c=a.trim(b[0].innerHTML);var d=parseInt(c);if(d!=c){throw"搜索粉丝数节点出错: "+c+" 不是数字"}return d}else{throw"搜索粉丝数节点出错：找不到或节点数目大于1"}},isMutualFollow:function(){var b=a.sizzle(".icon_addtwo");if(!b||b.length===0){return false}else if(b.length===1){return true}else{throw"搜索互相关注节点出错：节点数目大于1"}}};return{doGreeting:function(){var b=$CONFIG["uid"];var e=$CONFIG["oid"];if(d.isProfile&&!d.isMyprofile&&!d.isEnterprice&&d.isChatable()){var f=$WBIM.initData&&$WBIM.initData.setting&&$WBIM.initData.setting.helloWindow&&$WBIM.initData.setting.helloWindow.tips;if(!f){c("tblog_webim_behavior5","cancel_greet");return}if(d.getFansNum()<10001){var g=new a.webim.ui.helloWindow({oid:$CONFIG["oid"],onick:$CONFIG["onick"],followNum:d.getFansNum(),mutualFollowFlg:d.isMutualFollow(),online:d.isOnline()});g.render(a.E("WB_webim"));c("webim_bubble_remind","pop_up")}}}}});
$WBIM.register("webim.ui.base.wrapNode",function(a){var b=a.core.dom;var c=a.core.evt;return function(d,e){e=e||d;d.show=function(){d.style.display="";d.style.visibility="visible"};d.hide=function(){d.style.display="none";d.style.visibility="hidden"};d.getXY=function(){return b.position(d)};d.getSize=function(){return b.getSize(d)};d.showOrHide=function(){if(d.style.display.indexOf("none")!=-1){d.show()}else{d.hide()}};d.clickButNotMe=function(b,f){c.addEvent(a.E("WB_webim"),"click",function(a){a=a||window.event;var c=a.target||a.srcElement;if(d.containsNode(c))return;for(var g in b){if(b[g].containsNode(c)){return}}f.apply(e,[a,d])})};d.addEvent=function(a,b){c.addEvent(d,a,function(a){a=a||window.event;a.target=a.target||a.srcElement;b.apply(e,[a,d])})};d.containsNode=function(a){if(a===d)return true;return b.contains(d,a)};d.sizzle=function(a){var c=b.sizzle(a,d);if(c.length===1){return c[0]}return c};d.insertElement=function(a,c){b.insertElement(d,a,c)};d.removeElement=function(a,b){d.removeChild(a)};d.delegated=function(b,c,f){var g=a.delegatedEvent(d);g.add(b,c,function(a){f.apply(e,[a,d])})};d.addClass=function(a){b.addClassName(d,a)};d.removeClass=function(a){b.removeClassName(d,a)};d.setVisible=function(a){if(a)d.style.display="";else d.style.display="none"};d.setHeight=function(a){d.style.height=a+"px"};d.setStyle=function(a,c){b.setStyle(d,a,c)};return d}});
$WBIM.register("webim.ui.base.component",function(a){var b=a.webim.base.Class;var c=a.core.dom;var d=a.core.evt;var e={};var f=b.create({initialize:function(b){b=b||{};if(b.HTML)this._buildDom(b.HTML,b.root);this.uiEvent=a.webim.ui.uiEvent;this.changeEventListeners=[]},_buildDom:function(b,c){var d=a.core.dom.builder(b).list;for(var e in d){var f=d[e];this[e]=f.length>1?f:this._wrapNode(f[0])}if(c){this.root=this._wrapNode(d[c][0])}},_wrapNode:function(b){return a.webim.ui.base.wrapNode(b,this)},_pushInArray:function(b){if(!a.core.arr.isArray(b)){b=[b]}return b},createNode:function(a){var b=document.createElement(a);return this._wrapNode(b)},render:function(b){if(this.rendered)return;if(b){c.insertElement(b,this.root)}else{c.insertElement(a.E("WB_webim"),this.root)}this.rendered=true},addChangeListener:function(a){this.changeEventListeners.push(a)},fireChangeEvent:function(){for(var a in this.changeEventListeners){var b=this.changeEventListeners[a];b.onChanged({source:this})}},setVisible:function(a){a?this.show():this.hide()},show:function(){this.root.show()},hide:function(){this.root.hide()},add:function(b,c){var d=this;var e=this._pushInArray(b);a.core.arr.foreach(e,function(a){d.uiEvent.add(a,function(){c.apply(d,arguments)})})},after:function(a,b){var c=this;this.uiEvent.after(a,function(){b.apply(c,arguments)})},fire:function(a,b){this.uiEvent.fire(a,b)},onWindowResize:function(a){var b=this;d.addEvent(window,"resize",function(){a.apply(b,arguments)})},deferred:function(a,b,c){var d=this;!e[a]&&(e[a]=setTimeout(function(){c.apply(d);e[a]=undefined},b))},onImageLoaded:function(a,b){var c=new Image;c.onload=b;c.src=a},clearDeferred:function(a){e[a]&&clearTimeout(e[a]);e[a]=undefined},destroy:function(){this.root.parentNode.removeChild(this.root)}});return f});
$WBIM.register("webim.ui.base.cache",function(a){var b={};return{set:function(a,c){b[a]=c},get:function(a){return b[a]}}});
$WBIM.register("webim.ui.base.formatContent",function(a){var b=a.webim.ui.uiEvent;var c=/(\@)([A-Za-z0-9\u4e00-\u9fa5_-]+)/g,d=/[a-zA-Z]+:\/\/((&amp;)|([^\s（）；;<>()，。,："＂['＇:\u4e00-\u9fa5]))*/g,e=/#(\S+)?#/g,f=/(\#)([A-Za-z0-9\u4e00-\u9fa5_-]+)(\#)/gi,g=/([\.a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{1,}){1,})/gi,h=/(\[([^\[\]]+)\])/g;var i=/\[(\/ee([^\[\]]+))\]/g;var j="http://weibo.com/n";var k=a.webim.utils.date;var l=new Date;l.setFullYear(2014);l.setMonth(0);l.setDate(24);l.setHours(4,0,0);var m='<img width="22" height="22" src="FACE" />';var n="http://img.t.sinajs.cn/t4/appstyle/expression/emimage";var o=function(){if(k.getCurrentTime()>l){p=function(a){return a}}};var p=function(a){return a};var q={EMAIL:{cache:[],Tag:"_tmpEmail_"}};var r={parseEmail:function(a){var b=a.msg;if(b&&b.match(g)){var c=q["EMAIL"];b=b.replace(g,function(a){var b=c.cache.length;c.cache[b]=a;return c.Tag+b})}return b},parseUrl:function(a){var b=a.msg;if(b&&b.match(d)){b=b.replace(d,function(a){return'<a href="link2" target="_blank" suda-uatrack="key=tblog_webim_behavior5&value=content_link" >link2</a>'.replace(/link2/g,a)})}return b},parseAt:function(a){var b=a.msg;try{if(b.match(c)){b=b.replace(c,function(a,b){return'<a href ="__tmplink__/link2" target="_blank">link2</a>'.replace(/link2/g,a).replace("@","")})}return b}catch(d){console.log(d)}},parseTopic:function(a){var b=a.msg;if(b.match(f)){b=b.replace(f,function(a){return'<a href="http://huati.weibo.com/k/link" target="_blank">link</a>'.replace(/link/g,a).replace("#","").replace("#","")})}return b},parsePhiz:function(a){var b=a.msg;if(b&&b.match(i)){b=b.replace(i,function(a,b){return m.replace("FACE",n+b)})}if(a.face){b=b.replace(h,function(b,c){return a.face[c]?m.replace("FACE",a.face[c]):c})}return b}};var s=function(a){a.msg=p(a.msg);for(var b in r){a.msg=r[b](a)}var c=a.msg;c=c.replace(/__tmplink__/g,j);if(q["EMAIL"].cache.length){var d=q["EMAIL"].cache;var e=q["EMAIL"].Tag;for(var f=0,g=d.length;f<g;f++){c=c.replace(e+f,"<a href='mailto:"+d[f]+"'>"+d[f]+"</a>")}q["EMAIL"].cache=[]}return c};var t=function(a){a.msg=p(a.msg);for(var b in r){if(b!="parsePhiz")a.msg=r[b](a)}var c=a.msg;c=c.replace(/__tmplink__/g,j);if(q["EMAIL"].cache.length){var d=q["EMAIL"].cache;var e=q["EMAIL"].Tag;for(var f=0,g=d.length;f<g;f++){c=c.replace(e+f,"<a href='mailto:"+d[f]+"'>"+d[f]+"</a>")}q["EMAIL"].cache=[]}return c};return{parseUrl:r.parseUrl,parseAt:r.parseAt,parseTopic:r.parseTopic,parsePhiz:r.parsePhiz,parseHt:r.parseHt,parseAll:s,parseCard:t,change:o}});
$WBIM.register("webim.ui.onlineTips",function(a){var b=$WBIM.language;var c=b(['<div class="wbim_hello" node-type="onlineTipsRoot" style="cursor: pointer; bottom: 30px; position: absolute; z-index: 3000;">','<div class="bg">','<div class="content">','<a node-type="settingNode" href="javascript:void(0);" onclick="return false;" class="WBIM_icon_settingS"></a>','<a node-type="closeNode" href="javascript:void(0);" onclick="return false;" class="WBIM_icon_tipsclose" suda-uatrack="key=tblog_webim_behavior5&value=online_reminder_close"></a>','<div node-type="settingContainer" class="layer_menu_list" style="position: absolute; display: none; z-index: 4000;top: -20px;right: 10px;">','<div class="menu_setting">','<ul class="hello_cltip">','<li><a node-type="setSettingNode" href="javascript:void(0);" onclick="return false;">#L{不再显示该提醒}</a></li>',"</ul>","</div></div>",'<div class="online_tip clearfix">','<div class="head_pic">','<a node-type="headPicNode" href="javascript:void(0);" onclick="return false;" class="pic_box"><img node-type="picNode" src="http://img.t.sinajs.cn/t4/style/images/face/male_small.png" /></a></div>','<div class="add_cont">','<p>#L{特别关注好友}<br /><a node-type="nickNode" href="javascript:void(0);" ></a> #L{上线了}</p>',"</div>","</div>","</div>","</div>",'<div node-type="confirmContainer" class="W_layer" style="display: none; top: -5px; left: 10px;">','<div class="bg">','<table border="0" cellspacing="0" cellpadding="0">',"<tbody><tr><td>",'<div class="content layer_mini_info">','<div class="WB_info_con">','<p class="clearfix"><span class="info_icon icon_askS"></span><span class="info_txt">#L{提醒可从设置中恢复，确定不再出现该提醒？}</span></p>',"</div>",'<p class="btn"><a node-type="confirmBtn" href="javascript:void(0);" class="WBIM_btn_a"><span>#L{确定}</span></a><a node-type="cancelBtn" href="javascript:void(0);" class="WBIM_btn_b"><span>#L{取消}</span></a></p>',"</div></td></tr>","</tbody></table>","</div>","</div>","</div>"].join(""));var d="30px";var e="-80px";var f="http://tp#{imgserv}.sinaimg.cn/#{uid}/30/#{avatar}/#{sex}";var g=a.webim.ui.base.component;var h=a.webim.base.Class.create(g,{initialize:function(b){var d=this;this.canHide=true;this.needTips=true;this.base.initialize({HTML:c,root:"onlineTipsRoot"});this.after("request.setting.onlineTips",function(a,b){this.needTips=b.data&&b.data.tips;if(!this.needTips){this.hide()}});this.root.addEvent("click",function(a){if(a.target===this.settingNode||a.target===this.closeNode){return}if(a.target===this.settingContainer||this.settingContainer.containsNode(a.target)){return}if(a.target===this.confirmContainer||this.confirmContainer.containsNode(a.target)){return}d.doChat();d.hide()});this.root.addEvent("mouseover",function(){d.clearDeferred("onlineTipsShowKey")});this.root.addEvent("mouseout",function(a){if(!d.canHide){return}d.deferred("onlineTipsShowKey",1e3,function(){d.hide()})});this.settingNode.addEvent("click",function(){d.settingContainer.showOrHide()});this.setSettingNode.addEvent("click",function(){d.confirmContainer.show();d.clearDeferred("onlineTipsShowKey");d.canHide=false;d.settingContainer.hide()});this.settingContainer.clickButNotMe([this.settingNode],function(a){d.settingContainer.hide()});this.closeNode.addEvent("click",function(a){this.hide()});this.confirmBtn.addEvent("click",function(){d.setTipsSetting(false);d.hide()});this.cancelBtn.addEvent("click",function(){d.confirmContainer.hide();d.canHide=true;d.deferred("onlineTipsShowKey",5e3,function(){this.hide()})});this.hide();this.render(a.E("WB_webim"));var e=a.webim.uix.positionManager;e.registerNode("onlineTips",e.TYPE.TIPS,this.root)},doChat:function(){this.fire("ui.user.click",{uid:this.currentUID,from:"onlineTips"});this.hide()},doTips:function(b,c){if(!this.needTips){return}var d=this;if(c.online&&a.inArray("特别关注",c.group)){a.api.getUser(c.uid).done(function(b){if(!b||!b.nick)return;d.fire("ui.onlineTips.show");b.imgserv=b.uid%4+1;var c=a.core.util.templet(f,b);d.onImageLoaded(c,function(){d.picNode.src=c});d.nickNode.innerHTML=b.nick;d.currentUID=b.uid;if(d.tipsing){return}d.tipsing=true;d.show(false);d.deferred("onlineTipsShowKey",5e3,function(){d.hide()})})}},setTipsSetting:function(a){this.needTips=a;this.fire("request.setting.onlineTips",{data:{tips:a}})},hide:function(){this.tipsing=false;this.settingContainer.hide();this.confirmContainer.hide();this.base.hide()}});return h});
$WBIM.register("webim.sound.newMsgSound",function(a){function d(b){this.tips=true;if(window.HTMLAudioElement&&!a.core.util.browser.IE9){this.audio=document.createElement("audio")}else{var d='<embed node-type="audio" width=0 height=0 loop="false" autostart="false" MASTERSOUND></embed>';this.audio=a.builder(d).list["audio"][0]}this.audio.src=c;a.E("WB_webim").appendChild(this.audio);var e=this;b.add("manager.userNewMsg",function(){var b=a.getUnread();if(b&&b.dmIsRemind==0){e.play()}});b.add("manager.groupNewMsg.notify",function(){var b=a.getUnread();if(b&&b.dmIsRemind==0){e.play()}});b.after("request.setting.newMsgSound",function(a,b){e.tips=b.data&&b.data.status})}var b="http://js.t.sinajs.cn/";var c=b+function(){var b={mp3:"t5/webim/sound/msg.mp3",ogg:"t5/webim/sound/msg.OGG",wav:"t5/webim/sound/msg.WAV"};var c=a.core.util.browser;if(c.CHROME||c.MOZ||c.OPERA){return b.ogg}else if(c.IE9){return b.wav}else{return b.wav}}();d.getInstance=function(){return d.instance||(d.instance=new d(a.webim.ui.uiEvent))};d.prototype={play:function(){if(!this.tips)return;try{this.audio.play()}catch(a){}},setTips:function(a){this.tips=a}};return d});
$WBIM.register("webim.ui.msgSoundTips",function(a){var b=$WBIM.language;var c=b(['<div node-type="msgSoundTipsRoot" class="layer_tips layer_tips_version wbim_nmsg" style="z-index: 4001; position:absolute;bottom:30px;" >','<div class="layer_tips_bg">','<a node-type="closeNode" class="wbim_close_color" href="javascript:void(0);"></a>',"<ul>","<li>#L{新私信有声音提醒啦！}&nbsp;&nbsp;&nbsp;",'<a href="http://e.weibo.com/webim" target="_blank">#L{详情}<a/></li>',"</ul>","</div>","</div>"].join(""));var d=a.webim.ui.base.component;var e=a.webim.base.Class.create(d,{initialize:function(b){var d=this;this.base.initialize({HTML:c,root:"msgSoundTipsRoot"});this.closeNode.addEvent("click",function(a){this.fire("save.tip.status",{sound:false});this.hide()});this.hide();this.render(a.E("WB_webim"));var e=a.webim.uix.positionManager;e.registerNode("msgSoundTips",e.TYPE.TIPS,this.root)}});return e});
$WBIM.register("webim.ui.panelManager",function(a){function k(){function e(d,g){if(f("onlineTips")&&g&&g.online&&g.group&&a.inArray("特别关注",g.group)){c();c=function(){};b.removeBefore("manager.presence",e)}}function c(){!d&&new a.webim.ui.onlineTips;d=true}b.before("manager.presence",e)}function j(){var b=$WBIM.initData&&$WBIM.initData.setting&&$WBIM.initData.setting.showTip;if(b&&b.sound){if(c.msgSoundTips){c.msgSoundTips.show()}else{(new a.webim.ui.msgSoundTips).show()}}else{window.SUDA.uaTrack("tblog_webim_behavior5","close_sound_alert")}}function i(){function d(g,h){if(f("sound")&&!e){var i=a.core.util.browser;var j=i.CHROME||i.MOZ;if(j){c()}c=function(){};b.removeBefore("manager.userNewMsg",d);b.removeBefore("manager.groupNewMsg",d);e=true}}function c(){a.webim.sound.newMsgSound.getInstance()}b.before("manager.userNewMsg",d);b.before("manager.groupNewMsg",d)}function h(){if(f("onlineTips")){k()}i()}function g(){b.add("request.setting.onlineTips",function(b,e){if(e.data&&e.data.tips&&!c.onlineTips){!d&&new a.webim.ui.onlineTips;d=true}})}function f(a){var b=$WBIM.initData.setting&&$WBIM.initData.setting[a];return b&&(b.tips||b.status||b.block)}var b=a.webim.ui.uiEvent;var c={};var d=false;var e=false;return{init:function(){g();h()},setPanel:function(a,b){c[a]=b},getPanel:function(a){return c[a]},setPhiz:function(a){phizCmp=a},needTips:f}});
$WBIM.register("webim.ui.confirmWindow",function(a){var b=$WBIM.language;var c=b(['<div class="W_layer"  node-type="wbim_confirm_box" style="z-index:1002;">','    <div class="content">','        <div class="W_layer_title">#L{提示}</div>','        <div class="W_layer_close"><a href="javascript:void(0);" onclick="return false;" class="W_ficon ficon_close S_ficon" node-type="closeNode">X</a></div>','        <div class="layer_point">','            <dl class="point clearfix">','                <dt><span node-type="wbim_confirm_icon" class="W_icon icon_questionB"></span></dt>',"                <dd>",'                    <p class="S_txt1" node-type="wbim_confirm_txt">确定要解除对xxx的屏蔽吗？</p>',"                </dd>","            </dl>","        </div>",'        <div class="W_layer_btn S_bg1">','\t\t\t<a href="javascript:void(0);" onclick="return false;" class="W_btn_a btn_34px" node-type="wbim_confirm_confirm">#L{确认}</a>','\t\t\t<a href="javascript:void(0);" onclick="return false;" class="W_btn_b btn_34px" node-type="wbim_confirm_cancel">#L{取消}</a>',"\t\t</div>","    </div>","</div>"].join(""));DOM=a.core.dom,$addEvent=a.core.evt.addEvent,ICON_CLS="webim_cfmicon_stat icon_ICONCLSS";var d=a.webim.ui.uiEvent;var e=function(){var a=DOM.builder(c);this._box=a.list["wbim_confirm_box"][0];this._icon=a.list["wbim_confirm_icon"][0];this._txt=a.list["wbim_confirm_txt"][0];this._confirm=a.list["wbim_confirm_confirm"][0];this._cancel=a.list["wbim_confirm_cancel"][0];this._closeNode=a.list["closeNode"][0];this._mask=document.createElement("div");this._mask.className="_mask";this._mask.style.cssText="position:absolute;right:0;top:0;background:#000;opacity:0.3;filter:alpha(opacity=30);z-index:1001;height:100%;width:100%;";this.options;this.size={};this.bindDataEvents();this.bindDomEvent();this.hide();this.showFlg=false;a=null;c=null};e.prototype={render:function(a){this.parentNode=a;DOM.insertElement(a,this._mask);DOM.insertElement(a,this._box)},confirm:function(a){if(!this.size.width){this.size.width=this.parentNode.offsetWidth;this.size.height=this.parentNode.offsetHeight;this._mask.style.width=this.size.width+"px";this._mask.style.height=this.size.height+"px"}this.options=a;this._txt.innerHTML=a.txt;this._cancel.style.display=a.cancel?"":"none";this.show();this.setPosition()},bindDataEvents:function(){var a=this;d.add("ui.confirmWin.confirms",function(b,c){a.confirm(c)});d.add("ui.user.click",function(){a.showFlg&&a.hide()});d.after("ui.miniChatWindow",function(){a.showFlg&&a.hide()})},bindDomEvent:function(){var a=this;$addEvent(this._confirm,"click",function(){a.options.confirmFunc&&a.options.confirmFunc.apply(a.options.obj,arguments);a.hide()});$addEvent(this._cancel,"click",function(){a.options.calcelFunc&&a.options.calcelFunc.apply(a.options.obj,arguments);a.hide()});$addEvent(this._closeNode,"click",function(){a.hide()})},show:function(){this.showFlg=true;this._mask.style.display="";this._box.style.display="";this._mask.style.visibility="visible";this._box.style.visibility="visible"},hide:function(){this.showFlg=false;this._mask.style.display="none";this._box.style.display="none";this._mask.style.visibility="hidden";this._box.style.visibility="hidden"},setPosition:function(){var a=this._box.clientWidth;this._box.style.top=(this.size.height-this._box.offsetHeight)/2+"px";this._box.style.right=(this.size.width-a)/2+"px"}};return e});
$WBIM.register("webim.ui.validFrameWindow",function(a){var b=$WBIM.language;var c=b(['<div class="wbim_confirm_box" node-type="wbim_confirm_box" style="z-index:1002;width:380px">','<div class="wbim_confirm_con">','<a href="javascript:void(0);" onclick="return false;" class="rt_icon WBIM_icon_closeY" hidefocus="true" title="#L{关闭}" node-type="web_frame_close" style="position: absolute; top:10px; right:10px"></a>','<div class="wbim_confirm_info" style="padding: 0">','<p style=" background-color: #f2f2f2; padding: 10px 20px; font-size: 14px; ">',"#L{账号激活}","</p>",'<p class="wbim_confirm_p" style="margin:0">','<iframe node-type="web_frame" width="380" height="240" frameborder="0" src="http://weibo.com/a/verify/email?stage=home_verification&from=webim"></iframe>',"</p>","</div>","</div>","</div>"].join(""));var d=a.core.dom,e=a.core.evt.addEvent;var f=a.webim.ui.uiEvent;var g=function(a){this.parentNode=a;var b=d.builder(c);this._box=b.list["wbim_confirm_box"][0];this._frame=b.list["web_frame"][0];this._closeBtn=b.list["web_frame_close"][0];this._mask=document.createElement("div");this._mask.style.cssText="position:absolute;left:0;top:0;background:#777;opacity:0.6;filter:alpha(opacity=60);z-index:1001;";this.size={};this.hide();this.bindUIEvent();this.bindDomEvent();b=null;c=null;this._renderFlag=false};g.prototype={render:function(){d.insertElement(this.parentNode,this._mask);d.insertElement(this.parentNode,this._box)},bindUIEvent:function(){var a=this;f.add("ui.emailValid.show",function(){a.valid()})},bindDomEvent:function(){var a=this;e(this._closeBtn,"click",function(){a.hide()});f.add("ui.closeChatWindow",function(){a.hide()});f.add("ui.miniChatWindow",function(){a.hide()})},valid:function(a){if(!this.size.width){this.size.width=this.parentNode.offsetWidth;this.size.height=this.parentNode.offsetHeight;this._mask.style.width=this.size.width+"px";this._mask.style.height=this.size.height+"px"}this.show();this.setPosition()},show:function(){if(!this._renderFlag){this._renderFlag=true;this.render()}this._frame.src=this._frame.src;this.showFlg=true;this._mask.style.display="";this._box.style.display="";this._mask.style.visibility="visible";this._box.style.visibility="visible"},hide:function(){this.showFlg=false;this._mask.style.display="none";this._box.style.display="none";this._mask.style.visibility="hidden";this._box.style.visibility="hidden"},setPosition:function(){this._box.style.top=(this.size.height-this._box.offsetHeight)/2+"px";this._box.style.left=(this.size.width-220)/2-130+"px"}};return g});
$WBIM.register("webim.ui.helloWindow",function(a){var b=$WBIM.language;var c=b(['<div class="wbim_hello" node-type="helloWindowRoot" style="bottom: 30px; position: absolute; z-index: 2000;">','<div class="bg">','<div class="content">','<a node-type="settingNode" href="javascript:void(0);" onclick="return false;" class="WBIM_icon_settingS">',"</a>",'<a node-type="closeNode" href="javascript:void(0);" onclick="return false;" class="WBIM_icon_tipsclose" suda-uatrack="key=webim_bubble_remind&value=button_close"></a>','<div node-type="settingContainer" class="layer_menu_list" style="position: absolute; display: none; z-index: 4000;top: -20px;right: 10px;">','<div class="menu_setting">','<ul class="hello_cltip">','<li><a node-type="setSettingNode" href="javascript:void(0);" onclick="return false;">#L{不再显示该提醒}</a></li>',"</ul>","</div></div>",'<p node-type="helloMsgNode" class="title">#{beforeOnick} <a node-type="onickNode" action-type="userItem" action-data="uid=#{oid}&from=helloWindow" href="javascript:void(0);" >#{onick}</a> #{afterOnick}</p>','<div node-type="faceNode" class="list_hello" style="height: 30px;">','<div node-type="sendStateNode" class="hello_send_ok" style="top: 55px; display: none;"></div>','<ul node-type="helloIconsNode" class="list clearfix">','<li suda-uatrack="key=webim_bubble_remind&value=expression_1"><img action-type="helloIcon" action-data="type=hi" src="http://img.t.sinajs.cn/t4/appstyle/V5_webim/images/hi.jpg" title="hi"></li>','<li suda-uatrack="key=webim_bubble_remind&value=expression_2"><img action-type="helloIcon" action-data="type=hehe" src="http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/ac/smilea_org.gif" title="呵呵" alt="呵呵"></li>','<li suda-uatrack="key=webim_bubble_remind&value=expression_3"><img action-type="helloIcon" action-data="type=loveu" src="http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/6d/lovea_org.gif" title="爱你" alt="爱你"></li>','<li suda-uatrack="key=webim_bubble_remind&value=expression_4"><img action-type="helloIcon" action-data="type=qiuguanzhu" src="http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/1a/sunny_org.gif" title="阳光" alt="阳光"></li>','<li suda-uatrack="key=webim_bubble_remind&value=expression_5"><img action-type="helloIcon" action-data="type=haxiu" src="http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/6e/shamea_org.gif" title="害羞" alt="害羞"></li>',"</ul>","</div>",'<div node-type="pubMsgNode" class="list_hello" style="display:none;height: 20px; border-top: none;">','<a node-type="sendLink" action-type="userItem" action-data="uid=#{oid}&from=helloWindow" href="javascript:void(0);" style="float:right;">#L{立即发送}&gt;&gt;</a>',"</div>","</div>","</div>",'<div node-type="tipsContainer" style="z-index: 2001; display: none; bottom: 46px; right: -4px;" class="layer_tips layer_tips_version wbim_hello_tip">','<a node-type="tipsCloseNode" href="javascript:void(0);" onclick="return false;" class="wbim_close_color"></a>','<div class="layer_tips_bg">',"<ul>",'<li node-type="tipsMsgNode"></li>',"</ul>",'<li class="link_btn"><a href="javascript:void(0);" onclick="return false;" node-type="sendButton" class="W_btn_tip"><em>#L{发送}</em></a></li>','<span node-type="arrowNode" class="arrow_down"></span>',"</div>","</div>",'<div node-type="confirmContainer" class="W_layer" style="display: none; top: -4px; left: 10px;">','<div class="bg">','<table border="0" cellspacing="0" cellpadding="0">',"<tbody><tr><td>",'<div class="content layer_mini_info">','<div class="WB_info_con">','<p class="clearfix"><span class="info_icon icon_askS"></span><span class="info_txt">#L{提醒可从设置中恢复，确定不再出现该提醒？}</span></p>',"</div>",'<p class="btn"><a node-type="confirmBtn" href="javascript:void(0);" class="WBIM_btn_a"><span>#L{确定}</span></a><a node-type="cancelBtn" href="javascript:void(0);" class="WBIM_btn_b"><span>#L{取消}</span></a></p>',"</div></td></tr>","</tbody></table>","</div>","</div>","</div>"].join(""));var d;var e=!a.core.util.browser.IE6?{hi:"21px",hehe:"56px",loveu:"91px",qiuguanzhu:"126px",haxiu:"160px"}:{hi:"21px",hehe:"56px",loveu:"87px",qiuguanzhu:"119px",haxiu:"153px"};var f={ing:b('<span class="icon_loading" style="vertical-align:middle"></span> #L{发送中...}'),ok:b('<span class="send_state_icon icon_succS"></span> #L{发送成功}'),fail:b('<span class="icon_errorS"></span> #L{发送失败}')};var g=a.webim.ui.base.component;var h=a.webim.base.Class.create(g,{initialize:function(e){this.helloParam=e;this.helloParam.onick=!e.pubMsg?a.webim.utils.Core.cutString(this.helloParam.onick,10):this.helloParam.onick;var f=e.online;if(e.pubMsg){this.helloParam.afterOnick="发私信了";this.helloParam.beforeOnick="你可以给"}else{this.helloParam.afterOnick=f?b("#L{在线哦, 赶快打个招呼吧!}"):b("#L{打个招呼吧!}");this.helloParam.beforeOnick=f?"":b("#L{和}")}var g=a.core.util.templet(c,this.helloParam);this.base.initialize({HTML:g,root:"helloWindowRoot"});if(e.pubMsg){this.pubMsgNode.show();this.faceNode.hide()}d=e.mutualFollowFlg?{hi:"Hi，头像不错！",hehe:"好久没联系！ [呵呵]",loveu:"专门来你的页面看你了，记得也来看我哦，哇咔咔！ [爱你]",qiuguanzhu:"微博好玩么？[阳光]",haxiu:"海罗(HELLO) ，你还记得大明湖畔的Wo么? [害羞] "}:{hi:"Hi，能有机会认识一下吗？",hehe:"你的微博很有趣哦！ [呵呵]",loveu:"在微博与你的邂逅，是春天的小雨，朦胧、舒爽，点点滴滴都在我心上，是爱在召唤我吗？ [爱你]",qiuguanzhu:"想有惊喜吗？给我回信，我就是你最大的惊喜！ [阳光]",haxiu:"海罗(HELLO) ，你还记得大明湖畔的Wo么? [害羞]"};if(parseInt(this.helloParam.followNum)>=1e4){this.faceNode.hide();this.helloMsgNode.style.borderBottom="none";this.confirmContainer.style.top="-40px"}this.bindDomEvent();this.after("request.setting.helloWindow",function(a,b){if(!(b.data&&b.data.tips)){this.hide()}});var h=a.webim.uix.positionManager;h.registerNode("helloWindow",h.TYPE.TIPS,this.root);this.show()},bindDomEvent:function(){var b=this;this.root.delegated("helloIcon","mouseover",function(a){var c=d[a.data.type];c=c.replace("["+a.el.title+"]",a.el.parentNode.innerHTML.replace('action-type="helloIcon"','style="vertical-align:middle;"'));b.arrowNode.style.left=e[a.data.type];b.showTips(c,a.data.type)});this.sendButton.addEvent("click",function(){b.hideTips();b.sendMsg()});this.tipsCloseNode.addEvent("click",function(){b.hideTips()});this.tipsContainer.clickButNotMe([],function(){b.hideTips()});this.closeNode.addEvent("click",function(){b.hide()});this.settingNode.addEvent("click",function(){b.settingContainer.showOrHide()});this.setSettingNode.addEvent("click",function(){b.confirmContainer.show();b.settingContainer.hide()});this.settingContainer.clickButNotMe([this.settingNode],function(){b.settingContainer.hide()});this.onickNode.addEvent("click",function(){b.hide()});this.confirmBtn.addEvent("click",function(){b.fire("request.setting.helloWindow",{data:{tips:false},callback:function(){b.hide()}})});this.cancelBtn.addEvent("click",function(){b.confirmContainer.hide()});this.sendLink.addEvent("click",function(){b.hide()});a.webim.uix.bodyClickManager.clickOthers([this.root],function(){b.hideSetting();b.hideTips()})},hide:function(){this.settingContainer.hide();this.hideTips();this.root.hide()},hideSetting:function(a){this.settingContainer.hide()},hideTips:function(){this.tipsContainer.hide()},showTips:function(a,b){this.tipsKey=b;this.tipsMsgNode.innerHTML=a;this.tipsContainer.show();this.settingContainer.hide()},sendMsg:function(a){a=a||d[this.tipsKey];this.helloIconsNode.hide();this.sendStateNode.show();this.showSendState("ing");this.deferred("helloWindowSendKey",1e3,function(){this.showSendState("ok");this.hide();this.fire("ui.helloUser.msg",{uid:this.helloParam.oid,msg:a})})},showSendState:function(a){this.sendStateNode.innerHTML=f[a]||f["fail"]}});return h});
$WBIM.register("webim.ui.desktopPop",function(a){function h(){var a=e(d).list;this.root=a["desktopRoot"][0];this.closeNode=a["desktopCloseNode"][0];this.clickNode=a["desktopClickNode"][0];this.linkNode=a["desktopLinkNode"][0]}var b=a.core.evt.addEvent,c=$WBIM.language,d=c(['<div class="WBIM_news" node-type="desktopRoot" style="bottom: 30px; position: absolute; z-index: 1999;">','<div class="WBIM_news_bg">','<div class="WBIM_news_con WBIM_whiteBg">','<a href="javascript:void(0);" onclick="return false;" class="WBIM_icon_newsclose" node-type="desktopCloseNode" suda-uatrack="key=tblog_webim_bubble&value=close_button"></a>','<div class="WBIM_news_info WBIM_news_weibodesk">','<div class="WBIM_news_tit clearfix">','<span class="WBIM_icon_weibodesk"></span>','<p class="WBIM_newstit_txt">微博桌面2014</p>',"</div>",'<div class="WBIM_news_main clearfix">','<p class="WBIM_newsmain_info"><a href="http://desktop.weibo.com/webim_download.php" target="_blank" node-type="desktopLinkNode" suda-uatrack="key=tblog_webim_bubble&value=text_link">宽屏浏览，让你大开眼界！</a></p>','<p class="btn"><a class="WBIM_btn_a" href="http://t.cn/RvywICO"  node-type="desktopClickNode" suda-uatrack="key=tblog_webim_bubble&value=download"><span>立即试用</span></a></p>',"</div>","</div>","</div>","</div>","</div>"].join(""));var e=a.core.dom.builder;var f=window.SUDA.uaTrack;var g="repop5";h.prototype={render:function(b){if(!b){b=a.E("WB_webim")}f("tblog_webim_bubble","bubble_show");b&&b.appendChild(this.root);this.bindDomEvents()},bindDomEvents:function(){var a=this;b(this.closeNode,"click",function(){a.repop()});b(this.clickNode,"click",function(){a.clear()});b(this.linkNode,"click",function(){a.clear()})},clear:function(){var b=(new Date).getTime();var c={flag:g,times:0,date:b};a.tool.storage.setItem("v6_desktop",c);this.root.style.display="none";this.root.parentNode.removeChild(this.root);a.webim.ui.desktopPop=null},repop:function(){var b=a.tool.storage.getItem("v6_desktop");var c=(b&&b.times||0)+1;var d=(new Date).getTime();var e={};if(c==3){e={flag:g,date:d,times:0}}else{e={date:d,times:c}}a.tool.storage.setItem("v6_desktop",e);this.hide()},hide:function(){this.root.style.display="none"}};return h});
$WBIM.register("webim.ui.notifyManager",function(a){var b=window.webkitNotifications,c=!!(b&&b.createNotification);var d=a.core.evt.addEvent;var e=$WBIM.language,f=a.core.util.templet,g="微博聊天",h="http://tp#{imgserv}.sinaimg.cn/#{uid}/30/#{avatar}",i="#{nick}"+e("#L{给您发了}")+"#{num}"+e("#L{条新私信}"),j="新私信",k="【tips】 ",l="　　　";var m=a.webim.ui.uiEvent;var n=window.__PubSub__;return function(){function t(){var a=window.$CONFIG||{};return a.title_value||j}var e,j=document.title,o,p,q,r=true,s=true;var u=function(){var b=a.getUnread().total||0;n&&n.publish("webim.showMessage",b)};var v=function(a){a=a||function(){};b.requestPermission(a)};var w=function(a){var c;var d;if(b.createHTMLNotification){d=b.createHTMLNotification("http://js.t.sinajs.cn/t6/webim/html/notify.html?"+a.uid+"/"+escape(a.nick)+"/"+a.num+"/"+a.avatar)}else{d=b.createNotification(a.icon,a.title,a.msg)}d.replaceId="weibo_webim_"+a.uid;d.show&&d.show();d.onclick=function(){window.focus();setTimeout(function(){clearTimeout(c);a.callback&&a.callback();d.cancel&&d.cancel()},1e3)};c=setTimeout(function(){d.cancel&&d.cancel()},7e3)};var x=function(b,c){a.anyWhere(function(a){a.getUser(b).done(function(a){var d={uid:b,avatar:a.avatar,nick:a.nick,num:c,icon:f(h,{avatar:a.avatar,uid:a.uid,imgserv:parseInt(a.uid)%4+1}),title:g,msg:f(i,{nick:a.nick||a.uid,num:(c>0?c:1)+""}),callback:function(){m.fire("ui.user.click",{uid:b})}};w(d)})})};var y=function(a){if(a!=0){if(b){a=b.checkPermission()}else{a=2}}if(a==0){c=true;s=true}else{c=false}};var z=function(b){var c=a.getUnread();if(c&&c.total){A("新私信",true)}else{B()}if(b){B()}};var A=function(a,b){document.title=k.replace("tips",a)+t();o&&clearTimeout(o);o=setTimeout(function(){o=false},200);clearInterval(p);if(b){var c=0;p=setInterval(function(){document.title=k.replace("tips",c++%2==0?l:a)+t()},1e3)}};var B=function(){if(o){q&&clearTimeout(q);q=setTimeout(function(){q=false;B()},5e3)}else{document.title=t();clearInterval(p)}};m.after("ui.user.click",function(a,b){e=b&&(b.uid||b.gid)||false});m.after("manager.userNewMsg.notify",function(a,b){u()});m.after("manager.groupNewMsg.notify",function(a,b){u()});a.onUnreadChange(function(a){if(a&&a.total==0){u()}});m.after("msg.user.clean",function(a,b){u()});m.after(["ui.closeChatWindow","ui.miniChatWindow"],function(){e=false});m.add("manager.notify.cancel",function(a,b){s=false});if(a.core.util.browser.CHROME){d(window,"focus",function(){r=true;c&&y()});d(window,"blur",function(){r=false})}n&&n.subscribe("webim.messageTipClicked",function(){});if(c){var C=b.checkPermission();if(C==1){c=false;v(y)}else if(C==0){y(0)}else{c=false}}}});
$WBIM.register("webim.ui.manager.suda",function(a){return function(){var b=a.webim.ui.uiEvent;var c=window.SUDA.uaTrack;var d=function(a){c("tblog_webim_behavior5",a)};b.add("sudaUatrack",function(a,b){if(b&&b.value){d(b.value)}});b.first(["ui.bar.show","ui.minPanel.show"],function(a,b){if(b&&b.status){switch(b.status){case"b":d("default_fold");break;case"l":d("default_minimize");break;case"m":d("site_minimize");break}}});b.first("ui.other.click",function(){d("blankarea_fold")});b.first("ui.weibo.imgLarge",function(){d("image_larger")});b.first("ui.maxSettingMenu.show",function(){d("site_button")});b.first("request.setting.bottom",function(){d("minimize_bottom")});b.first("request.setting.side",function(){d("minimize_right")});b.first("ui.default.bottom",function(){d("default_minimize")});b.first("ui.default.side",function(){d("default_fold")});b.first("ui.init.online",function(){d("online_login")});b.first("ui.init.hide",function(){d("hide_login")});b.first("request.self.status",function(a,b){if(b&&b.status==1){d("switch_online")}else{d("switch_hide")}});b.first("ui.weibo.realShow",function(){d("float_layer_display")});b.first("ui.onlineTips.show",function(){d("online_reminder_popup")});b.first("ui.user.click",function(a,b){if(b.from){if(b.from=="min"){d("fold_contact")}else if(b.from=="max"){d("unfold_contact")}else if(b.from=="onlineTips"){d("online_reminder_click")}}});b.first("request.setting.helloWindow",function(a,b){d("greet_unprompt")});b.first("request.setting.onlineTips",function(a,b){d("online_reminder_unprompt")});b.first("request.setting.newMsgSound",function(a,b){if(b.status==false){d("close_sound_alerts")}});b.first("ui.minSearch.showOrHide",function(){d("click_search")})}});
$WBIM.register("webim.ui.manager.setting",function(a){return function(){function d(a){b(a.data).done(function(b){if(b.success){a.callback&&a.callback();c.fire("manager.setting.success")}})}var b=a.api.setSetting;var c=a.webim.ui.uiEvent;c.add(["request.setting.newMsgSound","request.setting.helloWindow","request.setting.onlineTips","request.setting.bottom","request.setting.side","request.setting.notice","request.setting.autoHideChatWin","request.setting.showcntip"],function(a,b){d(b)})}});
$WBIM.register("webim.ui.scroll",function(a){var b=a.core.dom,c=navigator.userAgent.toLowerCase().match(/firefox\/([\d.]+)/);var d=20;var e=['<div class="UI_scrollBar W_scroll_y S_bg1" style="overflow: initial;right:0;display:none;"  node-type="wbim_scroll_root">','  <div class="bar S_txt2_bg" node-type="wbim_scroll_slider"></div>'," </div>"].join("");var f=function(a,c){this.container=a;this.container.style.position="relative";this.container.style.overflow="hidden";var d=b.builder(c||e);this._root=d.list["wbim_scroll_root"][0];this._slider=d.list["wbim_scroll_slider"][0];this.container.appendChild(this._root);this._root.style.zIndex=1e3;this.scrollAble;this.startPercent=0;this.currentPercent;this.scrollDis;this.sliderDis;this.startY;this.draging=false;this.bottomEvents=[];this.bindDomEvent();this.hideTimer};f.prototype={init:function(){this._root.style.display="none";this.containerClientHeight=this.container.clientHeight;if(a.core.util.browser.IE6&&this.containerClientHeight==0){this.containerClientHeight=this.container.offsetHeight}this.containerScrollHeight=this.container.scrollHeight;this.scrollAble=this.containerClientHeight<this.containerScrollHeight;if(!this.scrollAble)return;var b=this.containerClientHeight/this.containerScrollHeight;var c=parseInt(this.containerClientHeight*b>d?this.containerClientHeight*b:d);this._slider.style.height=c-7+"px";this._root.style.height=this.containerScrollHeight+"px";this._root.style.display="";this.sliderDis=this.containerClientHeight-c;this.scrollDis=this.containerScrollHeight-this.containerClientHeight;var e=this.container.scrollTop/this.scrollDis||this.startPercent;if(e>1)e=1;if(e<0)e=0;this.setPos(e)},injectBottomEvent:function(a){this.bottomEvents.push(a)},scrollToBottom:function(){this.init();this.setPos(1)},reSize:function(){this._root.style.display="none";this.containerClientHeight=this.container.clientHeight;if(a.core.util.browser.IE6&&this.containerClientHeight==0){this.containerClientHeight=this.container.offsetHeight}this.containerScrollHeight=this.container.scrollHeight;this.scrollAble=this.containerClientHeight<this.containerScrollHeight;if(!this.scrollAble)return},hide:function(){this._root.style.display="none"},show:function(){this._root.style.display=""},start:function(b){if(this.draging)return;this.draging=true;b=b||widow.event;this.startY=b.clientY;a.preventDefault()},move:function(b){if(!this.draging)return;b=b||window.event;var c=b.clientY;this.currentPercent=(c-this.startY)/this.sliderDis+this.startPercent;if(this.currentPercent>1)this.currentPercent=1;if(this.currentPercent<0)this.currentPercent=0;this.setPos(this.currentPercent);a.preventDefault();if(this.currentPercent>=.95){for(var d=0,e=this.bottomEvents.length;d<e;d++){this.bottomEvents[d]&&this.bottomEvents[d]()}}},end:function(a){if(!this.draging)return;this.draging=false;this.startPercent=this.currentPercent},over:function(a){var b=this;var a=a||window.event;var c=a.srcElement||a.target;this.hideTimer&&clearTimeout(this.hideTimer);if(!this.scrollAble)return;this.hideTimer=setTimeout(function(){b.show()},500)},out:function(a){var b=this;this.hideTimer&&clearTimeout(this.hideTimer);this.hideTimer=setTimeout(function(){b.hide()},500)},scrollFun:function(b){if(!this.scrollAble)return;var d=c?b.detail:-b.wheelDelta/40;this.startPercent=(this.container.scrollTop+d*16)/this.scrollDis;if(this.startPercent>1){this.startPercent=1}if(this.startPercent<0)this.startPercent=0;this.setPos(this.startPercent);a.preventDefault();if(this.startPercent==1){for(var e=0,f=this.bottomEvents.length;e<f;e++){this.bottomEvents[e]&&this.bottomEvents[e]()}}},setPos:function(a){this.container.scrollTop=a*this.scrollDis;try{this._slider&&this._slider.style&&(this._slider.style.top=a*this.sliderDis+this.container.scrollTop+"px")}catch(b){}this.currentPercent=a},scrollToTop:function(){this.startPercent=0;this.scrollToByPercent(this.startPercent,1e3)},scrollPercent:function(a,b){this.scrollToByPercent(this.currentPercent+a,b)},scrollToByPercent:function(a,b){this.setPos(a)},bindDomEvent:function(){var b=this;a.core.evt.addEvent(this.container,c?"DOMMouseScroll":"mousewheel",function(a){b.scrollFun(a)});a.core.evt.addEvent(this._slider,"mousedown",function(a){b.start(a)});a.core.evt.addEvent(document,"mousemove",function(a){b.move(a)});a.core.evt.addEvent(document,"mouseup",function(a){b.end(a)});a.core.evt.addEvent(b.container,"mouseover",function(a){b.over(a)});a.core.evt.addEvent(b.container,"mouseout",function(a){b.out(a)})}};return f});
$WBIM.register("webim.ui.bottom.bar",function(a){var b=$WBIM.language;var c=a.webim.base.Class;var d=a.webim.ui.base.component;var e=c.create(d,{initialize:function(a){this.base.initialize({HTML:f,root:"onlineBarFriend"});this.bindDomEvents()},bindDomEvents:function(){this.add("ui.bar.show",this.show);this.add("ui.bar.hide",this.hide)},show:function(){this.render();this.base.show()}});var f=b(['<div node-type="onlineBarFriend" action-type="onlineBar" class="webim_win_minD wbim_min_friend" style="cursor: pointer; position: absolute; right: 0; bottom: 0;">',"#L{私信聊天}","</div>"].join(""));return e});
$WBIM.register("webim.ui.bottom.chatmini",function(a){var b=$WBIM.language;var c=a.webim.utils.Core.cutString;var d=a.webim.base.Class;var e=a.webim.ui.base.component;var f=a.webim.ui.uiEvent;var g="webim_fold_remind";var h=b("#L{你有N条新私信}");var i=b("#L{私信聊天}");var j="nick";var k=[];var l=true;var m=function(){var a="(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)";if(window.devicePixelRatio>1){return true}if(window.matchMedia&&window.matchMedia(a).matches){return true}return false};var n=d.create(e,{initialize:function(a){this.base.initialize({HTML:o,root:"chatMiniRoot"});this.bindDomEvents();this.bindDataEvents();this.chatTipsText;this.doTips()},bindDomEvents:function(){var a=this;this.add("ui.chatmini.show",this.show);this.add("ui.chatmini.hide",this.hide);this.after("ui.user.click",this.hide);this.after("ui.realCloseChatWindow",this.hideTips);this.after("ui.miniChatWindow",function(b,c){l=true;var d=this.doTips();if(!d){if(!c){return}a.show()}});this.add("ui.user.click",function(){l=false;this.fire("ui.clearEnvolopeTip")})},bindDataEvents:function(){this.after("ui.unread.change",this.doTips);a.onUnreadChange(function(a){});this.after("manager.userNewMsg",this.doTips);this.after("msg.user.clean",this.doTips);this.add("ui.showEnvolopeTip",function(a,b){if(!l){return}k.push(b);this.showEnvolopeTip()});this.add("ui.clearEnvolopeTip",function(){k=[];this.hideEnvolopeTip()});this.add("ui.clickEnvolopeTip",function(a,b){if(b.sync){k[0]&&k.pop()}else{k[0]&&f.fire("ui.user.click",k.pop())}!k[0]&&this.hideEnvolopeTip()})},doTips:function(b,c){var d;var e,f;var g=a.getUnread();if(g){d=g.total;if(d<=0){this.resetTips();return false}e=h;f=true}else{if(c&&(c.hasMsgClose||c.force)){this.setTipsText(i)}return false}var j=e.replace("N",d);this.setTipsText(j);this.show();if(f&&d>0){this.flashTips()}else{this.resetTips()}return true},flashTips:function(){return;var a=0;var b=this;(function(){if(a>3){return}a++%2?b.disHighLight():b.highLight();setTimeout(arguments.callee,500)})()},setTipsText:function(a){this.disHighLight();this.miniContent.innerHTML=a},highLight:function(){this.root.addClass(g)},disHighLight:function(){this.root.removeClass(g)},show:function(){this.render();this.base.show()},resetTips:function(){if(this.chatTipsText){this.setTipsText(this.chatTipsText)}else{this.setTipsText(i)}this.disHighLight()},hideTips:function(a,b){this.hide();this.chatTipsText=""},showEnvolopeTip:function(){this.envolopeTip.style.display=""},hideEnvolopeTip:function(){this.envolopeTip.style.display="none"},newEnvolope:function(){},clickEnvolope:function(){}});var o=['<div class="webim_fold clearfix" style="top:-40px; right:0;" node-type="chatMiniRoot" action-type="chatmini" action-data="from=chatmini" >','    <div class="fold_bg"></div>','    <p class="fold_cont clearfix">','        <span class="fold_icon W_fl"></span>','        <em class="fold_font W_fl W_f14" node-type="miniContent">私信聊天</em>',"    </p>",'<div class="webim_hb" node-type="envolopeTip" action-type="getenvolope" style="top:-19px;left:214px;display:none;"></div>',"<div>"].join("");return n});
$WBIM.register("webim.ui.bottom.main",function(a){return function(){new a.webim.ui.bottom.bar}});
$WBIM.register("webim.ui.activity",function(a){var b=$WBIM.language;var c=function(a){a=a.split("-");var b=new Date;b.setUTCFullYear(a[0],a[1]-1,a[2]);b.setHours(0);b.setMinutes(0);return b};return function(){var d=a.webim.ui.uiEvent;var e=c("2012-11-26").getTime();var f=c("2012-12-31").getTime();var g=(new Date).getTime();var h=b('<div node-type="root" class="webim_chat_tips webim_tips02" '+'style="text-align:center; width:164px;position:absolute;bottom:25px;right:0;" suda-uatrack="key=tblog_webim_midautumn&value=floating_layer">'+'<span><a href="http://event.weibo.com/663865" target="_blank">#L{私信常联系，赢微博会员!}</a></span></div>');d.after("ui.maxPanel.show",function(){if(f>g&&g>e&&h){var b=a.webim.ui.panelManager.getPanel("max");if(b){var c=a.core.dom.builder(h).list["root"][0];if(a.core.util.browser.IE6){c.style.bottom="24px"}b.listWrap.appendChild(c);h=false}}})}});
$WBIM.register("webim.ui.min.userItem",function(a){var b=['<li class="clearfix" node-type="root" action-type="userItem" action-data="uid=#{uid}&from=min">','<div class="webim_list_head webim_head_30">','<span class="head_pic"><img class="webim_user_item_img" src="http://img.t.sinajs.cn/t4/style/images/face/male_small.png" width=30 height=30 node-type="headPicImg" alt="" imgsrc="http://tp#{imgserv}.sinaimg.cn/#{uid}/30/#{avatar}/#{sex}"></span>','<span node-type="newMsgIcon" class="WBIM_icon_new" ></span>',"</div>","</li>"].join("");var c=a.webim.base.Class;var d=a.webim.ui.base.component;var e=c.create(d,{initialize:function(c){var d=c.user;d.imgserv=d.uid%4+1;var e=a.core.util.templet(b,d);this.base.initialize({HTML:e,root:"root"});this.uid=d.uid;this.headPicSrc=this.headPicImg.getAttribute("imgsrc");this.member=d.member;if(c.nolazy){this.headPicImg.setAttribute("src",this.headPicSrc);this.headPicImg.removeAttribute("imgsrc")}},setHeadImg:function(){this.headPicImg.src=this.headPicSrc},setNewMsgState:function(a){a?this.newMsgIcon.addClass("W_new"):this.newMsgIcon.removeClass("W_new")}});return e});
$WBIM.register("webim.ui.min.searchItem",function(a){var b=$WBIM.language;var c=b(['<li class="clearfix" action-type="userItem" action-data="uid=#{uid}&from=minSearch" node-type="userItemRoot">','<div class="list_head W_fl">','<span class="head_pic"><img node-type="headPicNode" src="http://img.t.sinajs.cn/t4/style/images/face/male_small.png" imgsrc="http://tp#{imgserv}.sinaimg.cn/#{uid}/30/#{avatar}/#{sex}"  alt=""></span>',"</div>",'<div class="list_name W_fl">','<span class="user_name">#{nick}</span>&nbsp;','<a  node-type="maxMemberIcon" title="会员用户" style="display: none;" href="http://vip.weibo.com/personal?from=webim" title="#L{会员用户}" target="_blank"><span class="wbim_ico_member"></span></a>',"</div>","</li>"].join(""));var d=a.webim.base.Class;var e=a.webim.ui.base.component;var f=d.create(e,{initialize:function(b){var d=b.user;d.imgserv=d.uid%4+1;d.nick=a.webim.utils.Core.cutString(d.nick,16);var e=a.core.util.templet(c,d);this.base.initialize({HTML:e,root:"userItemRoot"});this.uid=d.uid;if(b.unlazy){this.headPicNode.src=this.headPicNode.getAttribute("imgsrc")}if(d.member===1){this.maxMemberIcon.show()}this.member=d.member},setNewMsgState:function(a){a?this.maxNewMsgIcon.addClass("W_new"):this.maxNewMsgIcon.removeClass("W_new")},setFocus:function(a){var b=a?"li_hover":"";this.root.className="clearfix "+b}});return f});
$WBIM.register("webim.ui.min.search",function(a){function m(b){k=b;this.root=k.resultBoxIn;this.scrollContainer=k.resultBox;this.scroll=new a.webim.ui.scroll(this.scrollContainer);this.scroll=k.scroll;this.searchBox=k.root;this.searchInput=k.searchInput;this.clearInputNode=k.clearInputNode;this.clearInputNode.hide();this.resultList;this.bindEvents()}var b=42;var c=$WBIM.language;var d=a.webim.ui.uiEvent;var e=[9,19,33,34,35,36,37,38,39,40,46,122,144,145];var f=c('<div class="webim_chat_tips"><span class="tips_icon icon_warnS"></span><span class="tips_txt">#L{正在搜索...}</span></div>');var g=c('<div class="webim_chat_tips"><span class="tips_icon icon_warnS"></span><span class="tips_txt">#L{没有符合条件的搜索结果}</span></div>');var h=c('<div style="width: 100%; text-align: center; margin-top: 13px;"><span class="icon_warnS"></span>#L{请输入要搜索的关键字}</div>');var i=a.webim.base.Class;var j=a.webim.ui.min.searchItem;var k;var l=a.core.evt.stopEvent;m.prototype={bindEvents:function(){var c=this;this.clearInputNode.addEvent("click",function(){c.searchInput.value="";c.clearSearchResult();d.fire("ui.minSearch.showOrHide")});this.searchInput.addEvent("blur",function(b,d){var e=d.value;if(a.trim(e)===""){c.clearSearchResult()}});this.searchInput.addEvent("focus",function(a,b){this.clearInputNode.show()});this.searchInput.addEvent("keydown",function(d,e){var f=d.keyCode;if(f==38){a.stopEvent();if(c.resultList){c.resultList.focusPrevious();var g=c.scrollContainer.getSize().height;var h=c.root.getSize().height;var i=c.resultList.getFocusItem();var j=c.scrollContainer.getXY();var k=i.root.getXY();if(k.t<j.t){var l=(k.t-j.t)/(h-g);c.scroll.scrollPercent(l,.04)}}return false}else if(f==40){a.stopEvent();if(c.resultList){c.resultList.focusNext();var g=c.scrollContainer.getSize().height;var h=c.root.getSize().height;var i=c.resultList.getFocusItem();var k=i.root.getXY();var j=c.scrollContainer.getXY();if(k.t+b>j.t+g){var l=(k.t+b-j.t-g)/(h-g);c.scroll.scrollPercent(l,.04)}}return false}});this.searchInput.addEvent("keyup",function(a,b){if(b.value===""){c.clearSearchResult();setTimeout(function(){c.showSearchBox()},0);return false}else{c.clearInputNode.show()}var d=a.keyCode;for(var f in e){if(d==e[f]){return}}if(d==13){if(c.resultList){var g=c.resultList.getFocusItem();if(!g)return;var h=g.uid;c.searchInput.value="";c.clearSearchResult();k.fire("ui.user.click",{uid:h});k.hide()}return}l(a);c.deferredSearch(600)})},showSearchBox:function(){this.searchInput.value="";this.searchBox.show();this.searchInput.focus()},doSearch:function(){var b=this;var c=this.searchInput.value;if(c===""){this.clearSearchResult();this.showSearchBox();return}k.showPanel(this);this.clearSearchResult();k.setHeight();a.api.search(c,20,"min").done(function(a){b.showSearchResult(a);k.setHeight()})},showSearchResult:function(b){if(!b||a.objIsEmpty(b)){this.clearSearchResult();this.root.innerHTML=g;this.scroll.init();return}this.clearSearchResult();var c=new o({results:b,parent:this});this.resultList=c;this.root.insertElement(c.root);this.scroll.init();var d=parseInt(this.scrollContainer.style.height.replace("px","")-34);this.scroll.setPos(0)},deferredSearch:function(a){var b=this;clearTimeout(this.searchDeferredKey);this.searchDeferredKey=undefined;!this.searchDeferredKey&&(this.searchDeferredKey=setTimeout(function(){b.doSearch();this.searchDeferredKey=undefined},a))},clearSearchResult:function(){this.root.innerHTML="";this.resultList=undefined;k.setHeight()},cancelShowSearchPanel:function(){},onChanged:function(){this.scroll.init()},setVisible:function(a){if(!a){this.clearSearchResult();this.searchInput.value=""}this.scrollContainer.setVisible(a);this.onChanged()}};var n=['<ul class="list_content_li" node-type="maxListRoot">',"</ul>"].join("");var o=i.create(a.webim.ui.base.component,{initialize:function(a){this.base.initialize({HTML:n,root:"maxListRoot"});this.results=a.results;this.parent=a.parent;this.items={};this.initListData();this.bindDataEvents()},insertItem:function(a,b){this.root.insertElement(a,b)},removeItem:function(a){this.root.removeElement(a)},initListData:function(){if(this.initialized)return;var a=0;for(var b in this.results){var c=this.createUserItem({user:this.results[b]});this.items[this.results[b].uid]=c;a++}for(var d in this.items){this.insertItem(this.items[d].root)}this.size=a;this.setFocusItem(0);this.initialized=true},bindDataEvents:function(){var a=["manager.presence","manager.userNewMsg","msg.user.clean"];this.add(a,function(a,b){var c=this.items[b.uid];if(c){switch(a.type){case"manager.userNewMsg":c.setNewMsgState(true);break;case"ui.user.clean":c.setNewMsgState(false);break;default:break}}})},createUserItem:function(a){return new j({uid:a.uid,user:a.user,unlazy:true})},getFocusItem:function(){var a=0;for(var b in this.items){if(a==this.focusIdx){return this.items[b]}a++}},focusNext:function(){this.setFocusItem(this.focusIdx+1)},focusPrevious:function(){this.setFocusItem(this.focusIdx-1)},setFocusItem:function(a){a=a<0?0:a;var b=0;var c=null;for(var d in this.items){if(b==a){this.items[d].setFocus(true)}else{this.items[d].setFocus(false)}c=this.items[d];b++}if(a>=b){a=b-1;c.setFocus(true)}this.focusIdx=a}});return m});
$WBIM.register("webim.ui.min.minSearch",function(a){var b=$WBIM.language;var c=a.core.dom;var d=a.webim.base.Class;var e=a.webim.ui.base.component;var f=['<div class="W_layer layer_searchList" node-type="root" style="position: absolute;bottom: 126px;right: 55px;display: none;">','<div class="bg">','<div class="content">','<div class="searchList_head" node-type="searchHead">','<div class="input_wrap clearfix" node-type="searcherBox">','<input class="input W_fl" type="text" node-type="searchInput" placeholder="查找联系人">','<a href="javascript:void(0)" class="WBIM_icon_closeY W_fl" node-type="clearInputNode"></a>',"</div>","</div>",'<div class="search_return" node-type="resultBox">','<div node-type="resultBoxIn"></div>',"</div>","</div>","</div>","</div>"].join("");var g=39;var h=26;var i=50;var j=d.create(e,{initialize:function(){this.base.initialize({HTML:f,root:"root"});this.searchContainer=this.resultBox;this.scrollContainer=this.searchScroll;this.scroll=new a.webim.ui.scroll(this.resultBox);this.resultBox=this.resultBox;this.resultBoxIn=this.resultBoxIn;this.searchInput=this.searchInput;this.from="min";this.search=new a.webim.ui.min.search(this);this.bindDomEvents();this.bindDataEvents();this.showFlg=false},render:function(a){c.insertElement(a,this.root);this.setHeight();this.scroll.init()},bindDomEvents:function(){var a=this;this.onWindowResize(function(){this.deferred("minPanel.resize",500,function(){a.setHeight()})})},bindDataEvents:function(){var a=this;this.add("ui.minSearch.showOrHide",function(b,c){this.showFlg=!this.showFlg;if(this.showFlg){a.show();setTimeout(function(){a.searchInput&&a.searchInput.focus()},10)}else{a.hide()}});this.add("ui.maxPanel.show",function(a,b){this.hide()})},setHeight:function(){var a=this;var b=document.documentElement.clientHeight-i;b=b>200?b:200;b=b-47;setTimeout(function(){var c=a.root.clientHeight;var d=a.resultBoxIn.offsetHeight;var e=a.resultBoxIn.clientHeight;if(c==0){a.root.style.bottom=b+"px"}else{if(d>=b-h-g){setTimeout(function(){a.resultBox.style.height=b-h+"px";a.root.style.bottom=h+"px";a.scroll.init()},0)}else{a.resultBox.style.height=d+"px";a.root.style.bottom=b-d+"px";a.scroll.init()}}},0);this.scroll.init()},showPanel:function(){this.base.show();this.showFlg=true},show:function(){this.base.show();this.showFlg=true},hide:function(){this.resetPanel();this.base.hide();this.clearInputNode.hide();this.showFlg=false},resetPanel:function(){this.resultBoxIn.innerHTML="";var a=document.documentElement.clientHeight-i;a=a>200?a:200;a=a-47;this.resultBox.style.height=0;this.root.style.bottom=a+"px";this.searchInput.value=""}});return j});
$WBIM.register("webim.ui.min.minPanel",function(a){var b=$WBIM.language;var c=a.webim.base.Class;var d=a.webim.ui.base.component;var e=a.webim.ui.min.userItem;var f=a.webim.ui.uiEvent;var g=a.core.evt.addEvent;var h;var i=20;var j=40;var k=50;var l=26;var m=3;var n=j+k+l+m;var o=a.core.dom.insertElement;var p=c.create(d,{initialize:function(){this.itemHeight=58;this.items={};this.unreadItems;this.recents={};this.base.initialize({HTML:r,root:"minRoot"});this.scroll=new a.webim.ui.scroll(this.minMain);this.minSearch=new a.webim.ui.min.minSearch;this.minSearch.render(a.E("WB_webim"));var b=this;this.initData();this.bindDomEvents();this.bindDataEvents();this.bindReconnectEvents();this.recentList;this.openCheck;setTimeout(function(){b._imgLazyLoder=new a.webim.utils.LazyLoader({prop:"imgsrc",container:b.minMain,sltImg:"img",queue:true,delay:50});b._imgLazyLoder.check()},i);this.openFlag},initData:function(b){var c=this;this.openCheck=false;var d=b||a.initData.recent;var e;if(a.initData.recent&&a.initData.recent.length&&!b){e&&clearTimeout(e);this.show()}else if(!b){setTimeout(function(){c.hide()},0);e=setTimeout(function(){c.show()},3e3)}if(!d||d.length===0){this.recentsContainer.innerHTML=q}else{this.initUserList(d,b)}this.setHeight();this.recentList=d},initUserList:function(a,b){var c=this;if(a.length<=0)return;var d=0;var e=[];for(var f=0;f<a.length;f++){var g=a[f].uid;if(c.items[g]){return}var h=c.createUserItem({user:a[f],nolazy:b});e.push({uid:g,obj:h});c.addUserItem(h);d++}this.initUnreadTips();this.openCheck=true;this.checkLazyLoad()},clearData:function(){this.items={};this.recentsContainer.innerHTML=""},bindDomEvents:function(){var b=this;this.onWindowResize(function(){this.deferred("min.onresize",500,function(){b.setHeight();b.fixFoldBtn()})});this.add("ui.minPanel.show",this.show);this.add("ui.minPanel.hide",this.hide);this.add("ui.minPanel.hide",this.hide);g(document.body,"click",function(c){var c=c||window.event;var d=c.srcElement||c.target;if(d!=b.minSearch.root&&!a.core.dom.contains(b.minSearch.root,d)&&!d!=b.searchBtn&&!a.core.dom.contains(b.minHead,d)){b.minSearch.hide()}});g(this.searchBtn,"click",function(b){f.fire("ui.minSearch.showOrHide");a.stopEvent(b)});var c=a.core.dom.sizzle(".webim_list_wrap",b.minRoot)[0],d,e;g(this.minRoot,"mouseover",function(a){var a=a||window.event;var c=a.target||a.srcElement;b.openFlag=true;b.getOpacityFlag()&&b.closeOpacity()});g(this.minRoot,"mouseout",function(a){var a=a||window.event;b.openFlag=false;!b.getOpacityFlag()&&b.setOpacity()})},bindReconnectEvents:function(){var b=this;a.onStatusChange(function(a,c){switch(a){case"connecting":if(b.reconnectInterval){return}var d=0;b.reconnectInterval=setInterval(function(){d++},1e3);for(var e in b.items){b.items[e]&&b.items[e].setOnline(false)}break;case"disconnected":b.reconnectInterval&&clearInterval(b.reconnectInterval);break}});a.core.evt.addEvent(b.minMain,"scroll",function(a,c){b.checkLazyLoad();})},bindDataEvents:function(){var b=this;a.onNotice(function(a,c){switch(a){case"recent":if(c.act=="refresh"){b.clearData();b.initData(c.list)}break;case"unread":b.unreadItems=c.items;break}});a.onUnreadChange(function(a){var c=b.unreadItems;var d=a.items;for(var e in c){if(!(d&&d[e]&&d[e]>0)){if(b.items&&b.items[e]){b.items[e].setNewMsgState(false)}}}b.unreadItems=d});f.add("ui.minPanel.opacity",function(){if(!b.getOpacityFlag()){b.setOpacity()}else{b.closeOpacity()}});a.onMessage(function(c,d){switch(c){case"rev":var e=b.items[d.uid];if(!e){a.api.getUser(d.uid).done(function(a){e=b.createUserItem({user:a});b.addRecentsUserItem(e,true);e.setNewMsgState(true)})}else{b.addRecentsUserItem(e,true);e.setNewMsgState(true)}break}});this.add("msg.user.clean",function(a,b){var c=this.items[b.uid];c&&c.setNewMsgState(false)});this.add("manager.updateRecents",function(c,d){a.api.getUser(d.uid).done(function(a){var c=b.items[d.uid];if(!c){c=b.createUserItem({uid:d.uid,user:a});b.items[d.uid]=c}o(b.recentsContainer,c.root,"afterbegin")})});this.add("manager.removeRoster",function(a,b){var c=this.items[b.uid];if(c&&!c.isRecents){this.removeUserItem(c)}});this.add("manager.removeRecent",function(a,b){var c=this.items[b.uid];if(c){this.removeUserItem(c)}});f.calc("ui.minPanel.opacityValue",function(){return{minPanel:b.openFlag}})},getOpacityFlag:function(){var a=f.value("ui.minPanel.opacityValue");for(var b in a){if(a[b]){return true}}return false},setOpacity:function(){var a=this;h&&clearTimeout(h);h=setTimeout(function(){a.minRoot.style.opacity=.65},300)},closeOpacity:function(){var a=this;h&&clearTimeout(h);h=setTimeout(function(){a.minRoot.style.opacity=1},300)},initUnreadTips:function(){var b=a.getUnread();var c=b&&b.items;if(c){for(var d in c){this.items[d]&&this.items[d].setNewMsgState(true)}}},setHeight:function(){var b=document.documentElement.clientHeight-n;b=b>200?b:200;if(a.core.util.browser.IE6){b=b-100}this.minMain.style.height=b+"px";this.scroll.init();this.checkLazyLoad()},fixFoldBtn:function(){if(a.core.util.browser.IE6||a.core.util.browser.IE7){this.foldBtn.style.top="10%";this.foldBtn.style._top="10%";this.foldBtn.style.top="50%";this.foldBtn.style._top="50%"}},createUserItem:function(a){return new e(a)},removeUserItem:function(a){a.root.parentNode.removeChild(a.root);this.items[a.uid]=undefined},addUserItem:function(a,b){this.addRecentsUserItem(a,b)},addRecentsUserItem:function(a,b){a.isRecents=true;this.items[a.uid]=a;this.recentsContainer.insertElement(a.root,this.parsePosition(b));this.scroll.init();this.checkLazyLoad()},parsePosition:function(a){return a?"afterbegin":"beforeend"},checkLazyLoad:function(){this.openCheck&&this._imgLazyLoder&&this._imgLazyLoder.check()},show:function(){this.render();this.base.show();this.scroll.init();this.checkLazyLoad();f.fire("ui.minPanel.opacity")},hide:function(){h&&clearTimeout(h);this.base.hide();f.fire("ui.minPanel.opacity")}});var q=b(['<div class="webim_list_con">','<div class="nofriend_add">','<div class="add_list"><a href="http://weibo.com/find/i" alt="#L{添加联系人}" title="#L{添加联系人}" class="add_list_box"><span class="WBIM_icon_addlist"></span></a></div>',"</div>","</div>"].join(""));var r=b(['<div class="webim_list WBIM_fold" node-type="minRoot" style="right: 0; z-index: 9000; bottom: 0;opacity:0.65;">','<div class="webim_list_wrap ">','<div class="webim_list_header clearfix" node-type="minHead">','<div node-type="stateSetting" class="layer_setting" style="display: none; right:55px; bottom:26px;  z-index: 1500;">','<ul class="setting_list">','<li title="#L{切换为在线状态}" action-type="stateLi" action-data="status=online"><a href="javascript:void(0);" class="setting_cho"><em class="W_chat_stat W_chat_stat_online"></em><span class="setting_txt">#L{在线}</span></a></li>','<li title="#L{切换为隐身状态}" action-type="stateLi" action-data="status=hide"><a href="javascript:void(0);" class="setting_cho"><em class="W_chat_stat W_chat_stat_offline"></em><span class="setting_txt">#L{隐身}</span></a></li>',"</ul>","</div>",'<div class="state_search_btn" node-type="searchBtn"><a href="#" class="WBIM_icon_search_b"></a></div>',"</div>",'<div class="webim_list_main clearfix" node-type="minMain" style="overflow:hidden; ">','<div class="list_box clearfix">','<div class="list_content" >','<ul class="list_content_li" node-type="recentsContainer" >',"</ul>",'<ul class="list_content_li" node-type="onlinesContainer" >',"</ul>",'<ul class="list_content_li" node-type="offlinesContainer" >',"</ul>","</div>","</div>","</div>",'<div node-type="fixForPubMsg" style="height: 51px; display:none;"></div>','<div node-type="fixForAssist" style="height: 51px; display:none;"></div>','<div node-type="settingNode" class="webim_list_setting">','<div title="#L{展开私信聊天}" class="state_setting_btn" action-type="foldButton" action-data="from=min&type=bottom">','<a href="javascript:void(0);" class="unfold_btn"><span class="WBIM_icon_leftfold"></span></a>',"</div>","</div>","</div>",'<a node-type="foldBtn" action-type="foldButton" action-data="from=min" class="webim_fold_btn" href="javascript:void(0);" style="cursor:pointer;"><span class="btn_click" ><em class="WB_webim_arrow"></em></span></a>',"</div>"].join(""));return p});
$WBIM.register("webim.ui.min.constellationAssist",function(a){var b=$WBIM.language;var c=a.webim.ui.uiEvent;var d=b(['<div class="speacc_user clearfix" node-type="root" title="#L{女巫小微}" style="display:none;z-index: 7000; cursor:pointer;">','<div class="webim_list_head webim_head_30" suda-uatrack="key=tblog_webim_behavior5&value=witch_iconver">','<span class="head_pic"><img width=30 height=30 src="#{headPic}" ></span>',"</div>",'<a node-type="closeNode" title="#L{永久从联系人中移除}" href="javascript:void(0);" class="WBIM_icon_wbclose" style="display: none;"></a>',"</div>"].join(""));var e=b(['<div node-type="tips" class="W_layer" style="display: none; right: 63px; bottom: 28px; width: 144px;">','<div class="bg">','<table border="0" cellspacing="0" cellpadding="0">',"<tbody><tr>",'<td><div class="content layer_mini_info">','<p class="clearfix">#L{实时了解星座运势}</p>',"</div></td>","</tr>","</tbody></table>",'<div class="arrow arrow_r"></div>',"</div>","</div>"].join(""));var f=b(['<div node-type="tips" class="W_layer" style="cursor:pointer;right: 63px; bottom: 28px; width: 144px;">','<div class="bg">','<table border="0" cellspacing="0" cellpadding="0">',"<tbody><tr>",'<td><div class="content layer_mini_info">','<a node-type="tipCloseNode" href="javascript:void(0);" style="left: 118px; top: 3px; position:absolute;" class="WBIM_icon_wbclose" suda-uatrack="key=tblog_webim_behavior5&value=constellation_bubble_close"></a>','<p class="clearfix">#L{实时了解星座运势}</p>',"</div></td>","</tr>","</tbody></table>",'<div class="arrow arrow_r"></div>',"</div>","</div>"].join(""));var g=a.webim.base.Class;var h=a.webim.ui.base.component;var i=g.create(h,{initialize:function(b,g){var h=this;this.min=g;var i="http://tp4.sinaimg.cn/2681105267/50/5648002063/0";h.base.initialize({HTML:d.replace("#{headPic}",i)});var j=a.core.dom.builder(e).list;this.tips=this._wrapNode(j.tips[0]);var k=$WBIM.initData&&$WBIM.initData.setting&&$WBIM.initData.setting.showTip;var l=a.webim.utils.Core.getCurrentUIDByCookie();if(k&&k.assist&&l%10===7){j=a.core.dom.builder(f).list;this.tipsOnce=this._wrapNode(j.tips[0]);this.tipOnceCloseNode=this._wrapNode(j.tipCloseNode[0]);if(a.core.util.browser.IE6){this.tipOnceCloseNode.style.left="102px"}this.tipsOnce.addEvent("click",function(){h.fire("save.tip.status",{assist:false});h.fire("ui.user.click",{uid:"2681105267"});h.tipsOnce.hide();h.tipsOnce=null});this.tipOnceCloseNode.addEvent("click",function(){a.stopEvent();h.fire("save.tip.status",{assist:false});h.tipsOnce.hide();h.tipsOnce=null;c.fire("sudaUatrack",{value:"constellation_bubble_close"})});a.E("WB_webim").appendChild(this.tipsOnce)}h.bindEvents();b.insertElement(h.root,"afterbegin");a.E("WB_webim").appendChild(this.tips)},bindEvents:function(){var b=this;if(a.core.util.browser.IE6){this.onWindowResize(function(){this.deferred("witchAssist.onresize",500,function(){b.hide();setTimeout(function(){b.show()},0)})})}this.root.addEvent("click",function(){b.fire("ui.user.click",{uid:"2681105267"});b.tips.hide()});this.closeNode.addEvent("click",function(){a.stopEvent();b.close();c.fire("save.tip.status",{witch:0});c.fire("sudaUatrack",{value:"witch_iconver_close"})});this.root.addEvent("mouseover",function(a){b.tips.show();b.closeNode.show()});this.root.addEvent("mouseout",function(a){if(a.target!=b.root)return;if(b.root.containsNode(a.relatedTarget||a.toElement)){return}b.tips.hide();b.closeNode.hide()})},show:function(){this.base.show();this.tipsOnce&&this.tipsOnce.show()},hide:function(){this.base.hide();this.tips.hide();this.tipsOnce&&this.tipsOnce.hide()},close:function(){this.base.hide();this.tips.hide();this.tipsOnce&&this.tipsOnce.hide();this.fireChangeEvent(this)}});return i});
$WBIM.register("webim.ui.min.main",function(a){return function(){a.webim.ui.panelManager.setPanel("min",new a.webim.ui.min.minPanel)}});
$WBIM.register("webim.ui.max.base.userItem",function(a){var b=$WBIM.language;var c=b(['<li class="clearfix" node-type="maxUserItemRoot" action-type="userItem" action-data="uid=#{uid}&from=max">','<div class="webim_list_head webim_head_30">','<span class="head_pic"><img class="webim_user_item_img" node-type="headPicNode" width="30" height="30" src="http://img.t.sinajs.cn/t4/style/images/face/male_small.png" imgsrc="http://tp#{imgserv}.sinaimg.cn/#{uid}/30/#{avatar}/#{sex}" /></span>','<span node-type="maxNewMsgIcon" class="WBIM_icon_new"></span></div>','<div class="webim_list_name">','<span class="user_name">#{nick}</span>&nbsp;','<a node-type="maxMemberIcon" action-type="maxMemberIcon" style="display: none;" href="http://vip.weibo.com/personal?from=webim" title="#L{会员用户}" target="_blank"><span class="wbim_ico_member"></span></a>',"</div>","</li>"].join(""));var d=a.webim.base.Class;var e=a.webim.ui.base.component;var f=d.create(e,{initialize:function(b){var d=b.user;d.imgserv=d.uid%4+1;d.nick=a.webim.utils.Core.cutString(d.nick,15);var e=a.core.util.templet(c,d);this.base.initialize({HTML:e,root:"maxUserItemRoot"});this.uid=d.uid;if(b.unlazy){this.headPicNode.src=this.headPicNode.getAttribute("imgsrc")}if(d.member>=1){this.maxMemberIcon.show()}this.member=d.member},setNewMsgState:function(a){a?this.maxNewMsgIcon.addClass("W_new"):this.maxNewMsgIcon.removeClass("W_new")},setFocus:function(a){var b=a?"li_hover":"";this.root.className="clearfix "+b}});return f});
$WBIM.register("webim.ui.max.base.list",function(a){var b=a.webim.base.Class;var c=a.webim.ui.base.component;var d=b.create(c,{initialize:function(a){this.base.initialize({HTML:e,root:"maxListRoot"})},insertItem:function(a,b){this.maxListContainer.insertElement(a,b)},removeItem:function(a){a.parentNode.removeChild(a)}});var e=['<div class="list_box list_box_fold clearfix" node-type="maxListRoot">','<div class="list_content" >','<ul class="list_content_li" node-type="maxListContainer">',"</ul></div></div>"].join("");return d});
$WBIM.register("webim.ui.max.contacts.titleList",function(a){var b=a.webim.base.Class;var c=a.webim.ui.base.component;var d=b.create(c,{initialize:function(a){this.base.initialize({HTML:e,root:"maxListRoot"});this.collapsed=true;this.total=a.total;this.users=a.users;if(a.title){this.maxListTitleNode.innerHTML=a.title;if(a.total!=-1){this.maxListCount.innerHTML="("+a.total+")"}this.maxUserListTitle.title=a.title;this.maxUserListTitle.addEvent("click",function(){this.collapsed?this.fold():this.collapse();this.fireChangeEvent()})}},collapse:function(){this.root.className="list_box list_box_fold clearfix";this.collapsed=true;this.fireChangeEvent()},fold:function(){this.initListData&&this.initListData();this.root.className="list_box clearfix";this.collapsed=false;this.fireChangeEvent()},insertItem:function(a,b){this.maxListContainer.insertElement(a,b)},removeItem:function(a){a.parentNode.removeChild(a)}});var e=['<div class="list_box list_box_fold clearfix" node-type="maxListRoot">','<div class="list_title" node-type="maxListTitleContainer">','<p class="title_cate">','<a title="" node-type="maxUserListTitle" href="javascript:void(0);" onclick="return false;" class="list_title_a"><span class="WB_webim_arrow">','<em class="down">◆</em></span> <span node-type="maxListTitleNode"></span><span node-type="maxListCount"></span></a></p>',"</div>",'<div class="list_content" >','<ul class="list_content_li" node-type="maxListContainer">',"</ul></div></div>"].join("");return d});
$WBIM.register("webim.ui.max.contacts.userList",function(a){var b=a.webim.ui.max.contacts.titleList;var c=a.webim.ui.max.base.userItem;var d=a.webim.base.Class;var e=d.create(b,{initialize:function(a){this.base.initialize(a);this.contactsPanel=a.contactsPanel;this.openCheck=false;this.vipSplit=this.createNode("li");this.vipSplit.style.display="none";this.insertItem(this.vipSplit);this.items={};this.itemHeight=42;this.owner=a.owner;this.scroll=a.scroll;this.bindDataEvents()},sortOrder:function(a,b){return a.member>b.member},initListData:function(){var b=this;this.openCheck=false;var c=true;var d=true;if(this.initialized)return;this.users.done(function(e){e.sort(b.sortOrder);b.users=e;if(d){var f=e.length;if(f<=0)return;a.core.func.timedChunk(a.core.arr.copy(e),{process:function(a){b.addOrUpdateUser(a,false)},callback:function(a){b.initUnreadTips();b.initialized=true;b.openCheck=true;b.fireChangeEvent()}})}else{var g=b.owner.getPanelHeight();b.initLoadCount=g/b.itemHeight+5;e.reverse();var f=e.length;var h=0;for(var i=f-1;i>=0;i--){var j=e[i];b.addOrUpdateUser(j);h++;b.next=i-1;if(h>b.initLoadCount&&c)break}b.openCheck=true;b.fireChangeEvent()}b.initUnreadTips();b.initialized=true;if(c){b.maxListContainer.style.height=b.next>=0?b.itemHeight*f+"px":"auto";b.owner.maxContactsScroll.addEvent("scroll",function(){if(!b.collapsed){b.checkPosition();b.contactsPanel.scroll.init()}});b.owner.onWindowResize(function(){if(b.loaded||b.next<0)return;var a=b.owner.getPanelHeight();var c=a/b.itemHeight+2;for(var d=b.next;d>=0;d--){var e=b.users[b.next];while(b.items[e]){b.next--;if(b.next>=0){e=b.users[b.next]}else{b.maxListContainer.style.height="auto";b.loaded=true;return}}if(e&&!b.items[e]){b.addOrUpdateUser({uid:e})}}b.contactsPanel.scroll.init()})}})},initUnreadTips:function(){var b=a.getUnread();var c=b.items;if(c){for(var d in c){var e=this.items[d];e&&e.setNewMsgState(true)}}},checkPosition:function(b){var c=this;if(this.loaded){this.maxListContainer.style.height="auto";return}var d=3;var e=this.maxListContainer.childNodes;var f=e.length;if(f>=this.initLoadCount){for(var g=f-1;g>=f-d-1;g--){var h=e[g];var i=a.position(h,{parent:c.scroll.container});var j=c.scroll.container.clientHeight;if(i.t<=j){var k=this.users[this.next];var l=k.uid;while(this.items[l]){this.next--;if(this.next>=0){k=this.users[this.next];l=k.uid}else{this.maxListContainer.style.height="auto";this.loaded=true;return}}if(l&&!this.items[l]){this.addOrUpdateUser(k)}}}}else{this.maxListContainer.style.height="auto";this.loaded=true}},bindDataEvents:function(){this.add("reconnect",function(){for(var a in this.items){};});var a=["manager.userNewMsg","msg.user.clean"];this.add(a,function(a,b){var c=this.items[b.uid];if(c){if(a.type=="manager.userNewMsg"){c.setNewMsgState(true)}else{c.setNewMsgState(false)}}})},addOrUpdateUser:function(a,b){var c=this.items[a.uid];if(!c){c=this.createUserItem({user:a})}if(c.member>=1){this.addVipUserItem(c)}else{this.addCommonUserItem(c)}this.items[c.uid]=c},addVipUserItem:function(a,b){this.insertItem(a.root,"afterbegin");this.fireChangeEvent()},addOnlineUserItem:function(a,b){this.vipSplit.insertElement(a.root,"afterend");this.fireChangeEvent()},addOfflineUserItem:function(a,b){this.insertItem(a.root,"beforeend");this.fireChangeEvent()},createUserItem:function(a){return new c({uid:a.uid,user:a.user})},addCommonUserItem:function(a,b){if(!b){this.vipSplit.insertElement(a.root,"beforebegin")}else{this.vipSplit.insertElement(a.root,"afterend")}this.fireChangeEvent()}});return e});
$WBIM.register("webim.ui.max.contacts.contactsPanel",function(a){function q(b){m=b;var c=this;this.scrollContainer=m.maxContactsScroll;this.root=m.maxContactsContainer;this.floatNode=m.floatNode;this.parentNode=m.maxTabContainer;this.scroll=new a.webim.ui.scroll(this.scrollContainer);p=this.scroll;this.onlineFriendList;this.listHash={};this._listQue=[];this._nameQue=[];this.currentIndex=0;setTimeout(function(){c._imgLazyLoder=new a.webim.utils.LazyLoader({prop:"imgsrc",container:m.maxMain,sltImg:"img",queue:true,delay:50});c._imgLazyLoder.check()},50);this.root.innerHTML=f;this.initData={};this.init();this.ready=true;this.bindDataEvents();this.bindReconnectEvents()}var b=$WBIM.language;var c='<div class ="float_inner">#{content}</div>';var d=b(['<div class="webim_list_con" style="overflow:hidden;">','<div class="nofriend_add">','<div class="webim_chat_tips"><span class="tips_icon icon_warnS"></span><span class="tips_txt">#L{你暂时没有可以进行聊天的好友，点击添加联系人看看}</span></div>','<div class="add_list"><a href="http://weibo.com/find/i" class="add_list_box"><span class="WBIM_icon_addlist"></span><span class="add_list_txt">#L{添加联系人}</span></a></div>',"</div>"].join(""));var e=b('<div class="webim_chat_tips webim_tips01">#L{私信聊天}<a href="http://e.weibo.com/webim" target="_blank">#L{意见反馈请点击这}</a></div>');var f=b('<div style="width: 100%; text-align: center; margin-top: 23px;"><span class="icon_loading"></span>#L{正在加载...}</div>');var g=a.core.dom.position;var h=a.core.dom.getSize;var i=a.webim.base.Class;var j=a.webim.ui.max.contacts.titleList;var k=a.webim.ui.max.contacts.userList;var l=a.webim.ui.max.base.userItem;var m;var n=a.core.evt.stopEvent;var o=a.core.util.templet;var p;q.prototype={init:function(b){var c=this;a.api.process.getGroups().done(function(a){var b=!a||a.length===0;if(b){c.root.innerHTML=d;c.nogroup=true}else{c.root.innerHTML=e;c.initOtherFriendList(a);c.scroll.init();c._listQue=[];c._nameQue=[];for(var f in c.listHash){c._listQue.push(c.listHash[f].root);c._nameQue.push(c.listHash[f].groupName)}}c.initialized=true})},initOtherFriendList:function(a){for(var b=0;b<a.length;b++){var c=this.createGroupFriendList(a[b]);c.addChangeListener(this);this.root.insertElement(c.root);this.listHash[a[b].name]=c}},bindDataEvents:function(){var b=this;this.scrollContainer.addEvent("scroll",function(){b.checkScroll()});a.core.evt.addEvent(b.floatNode,"click",function(a,c){b.floatNode.style.display="none";b.listHash[b._nameQue[b.currentIndex]].collapse();n(a);b.checkLazyLoad();b.scroll.init();b.currentIndex=0;b.checkScroll()});a.core.evt.addEvent(b.scrollContainer,"scroll",function(a,c){b.checkLazyLoad()})},bindReconnectEvents:function(){},createGroupFriendList:function(a){return new t({groupName:a.name,title:a.name,total:a.count||0,users:a.users,contactsPanel:this,owner:m,scroll:p})},onChanged:function(a){a&&a.source&&a.source.openCheck&&this.checkLazyLoad();this.scroll.init()},setVisible:function(a){this.scrollContainer.setVisible(a);this.onChanged()},checkLazyLoad:function(){this._imgLazyLoder&&this._imgLazyLoder.check()},checkScroll:function(){if(!this.initialized||this.nogroup){return}var b=this._listQue,d=this.floatNode,e,f;var i,j,k;var l=this.parentNode;var m=g(this.scrollContainer,{parent:l}).t;var n=29;var p=h(this.floatNode).height;var q=m;var r=0;if(a.core.util.browser.IE6){q=m;r=10}f=this.currentIndex;if(f==0){e=b[f];j=g(e,{parent:l}).t;if(b[f+1]===undefined){return}k=g(b[f+1],{parent:l}).t;if(j>=q){d.style.display="none"}else if(j<=q){this.floatNode.innerHTML=o(c,{content:e.childNodes[0].innerHTML});this.floatNode.style.display="";if(k<=q+p&&k>=q){d.style.top=k-n+r+"px";d.style.display=k-j>p?"":"none"}else if(k<q){d.innerHTML=o(c,{content:e.childNodes[0].innerHTML});d.style.top=m+"px";d.style.display=k-j>p?"":"none"}}if(k<q){this.currentIndex+=1;this.checkScroll()}}else{f=this.currentIndex;e=b[f];i=g(b[f-1],{parent:l}).t;j=g(e,{parent:l}).t;k=!b[f+1]?100:g(b[f+1],{parent:l}).t;if(j<q){d.innerHTML=o(c,{content:e.childNodes[0].innerHTML});d.style.display=k-j>p?"":"none";if(k<=q+p&&k>=q){d.style.top=k-n+r+"px";d.style.display=k-j>p?"":"none"}else if(k<q){d.innerHTML=o(c,{content:e.childNodes[0].innerHTML});d.style.top=m+"px";d.style.display=k-j>p?"":"none";this.currentIndex+=1;this.checkScroll()}}else{d.innerHTML=o(c,{content:e.childNodes[0].innerHTML});if(j<q+p&&j>=q){d.innerHTML=o(c,{content:b[f-1].childNodes[0].innerHTML});d.style.top=j+"px";d.style.display=k-j>p?"":"none"}else if(j>=q+p){d.style.top=m+"px";d.style.display=j-i>p?"":"none";this.currentIndex-=1;this.checkScroll()}}}}};var r=i.create(j,{initialize:function(a){this.base.initialize(a);this.contactsPanel=a.contactsPanel;this.openCheck=false;this.vipSplit=this.createNode("li");this.vipSplit.style.display="none";this.insertItem(this.vipSplit);this.onlineSplit=this.createNode("li");this.onlineSplit.style.display="none";this.insertItem(this.onlineSplit);this.items={};this.itemHeight=58;this.bindDataEvents()},sortOrder:function(a,b){return a.member>b.member},initListData:function(){var b=this;this.openCheck=false;var c=true;var d=false;if(this.initialized)return;this.users.done(function(e){e.sort(b.sortOrder);b.users=e;if(d){var f=e.length;if(f<=0)return;a.core.func.timedChunk(a.core.arr.copy(e),{process:function(a){b.addOrUpdateUser(a,false)},callback:function(a){b.initUnreadTips();b.initialized=true;b.openCheck=true;b.fireChangeEvent()}})}else{var g=m.getPanelHeight();b.initLoadCount=g/b.itemHeight+5;e.reverse();var f=e.length;var h=0;for(var i=f-1;i>=0;i--){var j=e[i];b.addOrUpdateUser(j);h++;b.next=i-1;if(h>b.initLoadCount&&c)break}b.openCheck=true;b.fireChangeEvent()}b.initUnreadTips();b.initialized=true;if(c){b.maxListContainer.style.height=b.next>=0?b.itemHeight*f+"px":"auto";m.maxContactsScroll.addEvent("scroll",function(){if(!b.collapsed){b.checkPosition();b.contactsPanel.scroll.init()}});m.onWindowResize(function(){if(b.loaded||b.next<0)return;var a=m.getPanelHeight();var c=a/b.itemHeight+2;for(var d=b.next;d>=0;d--){var e=b.users[b.next];while(b.items[e]){b.next--;if(b.next>=0){e=b.users[b.next]}else{b.maxListContainer.style.height="auto";b.loaded=true;return}}if(e&&!b.items[e]){b.addOrUpdateUser({uid:e})}}b.contactsPanel.scroll.init()})}})},initUnreadTips:function(){var b=a.getUnread();var c=b.items;if(c.length>0){for(var d in c){var e=this.items[c[d]];e&&e.setNewMsgState(true)}}},checkPosition:function(b){if(this.loaded){this.maxListContainer.style.height="auto";return}var c=3;var d=this.maxListContainer.childNodes;var e=d.length;if(e>=this.initLoadCount){for(var f=e-1;f>=e-c-1;f--){var g=d[f];var h=a.position(g,{parent:p.container});var i=p.container.clientHeight;if(h.t<=i){var j=this.users[this.next];var k=j.uid;while(this.items[k]){this.next--;if(this.next>=0){j=this.users[this.next];k=j.uid}else{this.maxListContainer.style.height="auto";this.loaded=true;return}}if(k&&!this.items[k]){this.addOrUpdateUser(j)}}}}else{this.maxListContainer.style.height="auto";this.loaded=true}},bindDataEvents:function(){this.add("reconnect",function(){for(var a in this.items){};});var a=["manager.userNewMsg","msg.user.clean"];this.add(a,function(a,b){var c=this.items[b.uid];if(c){if(a.type=="manager.userNewMsg"){c.setNewMsgState(true)}else{c.setNewMsgState(false)}}})},addOrUpdateUser:function(a,b){var c=this.items[a.uid];if(!c){c=this.createUserItem({user:a})}if(c.online){if(c.member){this.addVipUserItem(c,b)}else{this.addOnlineUserItem(c,b)}}else{this.addOfflineUserItem(c,b||c.member)}this.items[c.uid]=c},addVipUserItem:function(a,b){if(!b)this.vipSplit.insertElement(a.root,"beforebegin");else this.insertItem(a.root,"afterbegin");this.fireChangeEvent()},addOnlineUserItem:function(a,b){if(!b){this.onlineSplit.insertElement(a.root,"beforebegin")}else{this.vipSplit.insertElement(a.root,"afterend")}this.fireChangeEvent()},addOfflineUserItem:function(a,b){if(!b){this.insertItem(a.root,"beforeend")}else{this.onlineSplit.insertElement(a.root,"afterend")}this.fireChangeEvent()},createUserItem:function(a){return new l({uid:a.uid,user:a.user})}});var s=i.create(r,{initialize:function(a){this.groupName=a.groupName;this.title=a.title;this.base.initialize(a);this.root.setAttribute("suda-uatrack","key=tblog_webim_behavior5&value=online_group");this.add("manager.removeRoster",function(a,b){var c=this.items[b.uid];c&&this.removeItem(c.root);this.items[b.uid]=undefined})},getInitUIDList:function(){return this.initData.vips.concat(this.initData.onlines)}});var t=i.create(k,{initialize:function(a){this.groupName=this.title=a.groupName;this.title=a.title;this.base.initialize(a);if(this.groupName=="特别关注"){this.root.setAttribute("suda-uatrack","key=tblog_webim_behavior5&value=special_attention_group")}this.add("manager.removeRoster",function(a,b){var c=this.items[b.uid];c&&this.removeItem(c.root)})},getInitUIDList:function(){var a=this.initData.readyGroups[this.groupName];return a.onlines.vips.concat(a.onlines.normal).concat(a.offlines.vips).concat(a.offlines.normal)}});return q});
$WBIM.register("webim.ui.max.recents.recentsPanel",function(a){function i(b){h=b;this.scrollContainer=h.maxRecentsScroll;this.root=h.maxRecentsContainer;this.scroll=new a.webim.ui.scroll(this.scrollContainer);this.lazyInitData=true;if(!this.lazyInitData){this.init()}this.bindReconnectEvents()}var b=$WBIM.language;var c=b(['<div class="webim_list_con" style="overflow:hidden;">','<div class="nofriend_add">','<div class="webim_chat_tips"><span class="tips_icon icon_warnS"></span><span class="tips_txt">#L{你暂时没有可以进行聊天的好友，点击添加联系人看看}</span></div>','<div class="add_list"><a href="http://weibo.com/find/i" class="add_list_box"><span class="WBIM_icon_addlist"></span><span class="add_list_txt">#L{添加联系人}</span></a></div>',"</div>"].join(""));var d=b('<div class="webim_chat_tips webim_tips01">#L{删除}<a target="_blank" href="http://weibo.com/messages">#L{私信}</a>#L{后可移除最近联系人}</div>');var e=a.webim.base.Class;var f=a.webim.ui.max.base.list;var g=a.webim.ui.max.base.userItem;var h;i.prototype={init:function(){if(this.initialized)return;this.recentsList=new j;if(a.objIsEmpty(this.recentsList.items)){this.root.innerHTML=c}else{this.root.innerHTML="";this.root.insertElement(this.recentsList.root)}this.recentsList.addChangeListener(this);this.initialized=true},bindReconnectEvents:function(){},onChanged:function(){this.scroll.init()},setVisible:function(a){if(this.lazyInitData===true){this.init();this.lazyInitData=undefined}this.scrollContainer.setVisible(a);this.onChanged()}};var j=e.create(f,{initialize:function(a){this.base.initialize(a);this.root.removeClass("list_box_fold");this.items={};this.initListData();this.bindDataEvents();this.initUnreadTips()},initListData:function(){if(this.initialized)return;var a=$WBIM.initData.recent;for(var b in a){var c=a[b];if(!c.uid){continue}var d=this.createUserItem({user:c});this.insertItem(d.root);this.items[d.uid]=d}this.initialized=true},updateListData:function(a){this.items={};this.maxListContainer.innerHTML="";for(var b in a){var c=a[b];if(!c.uid){continue}var d=this.createUserItem({user:c});this.insertItem(d.root);this.items[d.uid]=d}},initUnreadTips:function(){var b=a.getUnread();var c=b.items;if(c){for(var d in c){if(c[d]>0){this.items[d]&&this.items[d].setNewMsgState(true)}}}},bindDataEvents:function(){var b=this;var c=["manager.userNewMsg","msg.user.clean"];this.add(c,function(c,d){var e=this.items[d.uid];if(e){if(c.type=="manager.userNewMsg"){e.setNewMsgState(true);this.insertItem(e.root,"afterbegin")}else if(c.type=="msg.user.clean"){e.setNewMsgState(false)}}else{if(c.type=="manager.userNewMsg"){a.api.getUser(d.uid).done(function(a){var c=b.createUserItem({user:a});b.items[d.uid]=c;b.insertItem(c.root,"afterbegin")})}}});this.add("manager.updateRecents",function(b,c){var d=this.items[c.uid];var e=this;a.api.getUser(c.uid).done(function(a){if(!d)d=e.createUserItem({user:a});e.items[c.uid]=d;e.insertItem(d.root,"afterbegin")})});this.add("manager.removeRecent",function(b,c){var d=this.items[c.uid];if(d){a.core.dom.removeNode(d.root);this.items[c.uid]=undefined}});this.add("reconnect",function(){for(var a in this.items){};});$WBIM.onNotice(function(a,c){switch(a){case"recent":if(c.act=="refresh"){c.list&&b.updateListData(c.list)}}})},createUserItem:function(a){return new g({user:a.user,unlazy:true})}});return i});
$WBIM.register("webim.ui.max.search",function(a){function o(b){m=b;this.root=m.maxSearchContainer;this.scrollContainer=m.maxSearchScroll;this.scroll=new a.webim.ui.scroll(this.scrollContainer);window.searchScroll=this.scroll;this.searchBox=m.searcherBox;this.searchInput=m.maxSearchInput;this.clearInputNode=m.clearInputNode;this.clearInputNode.hide();this.resultList;this.styleFlg=false;this.webim_max_tab_root=m.webim_max_tab_root;this.maxMain=m.maxMain;this.maxSearchScroll=m.maxSearchScroll;this.maxRecentsScroll=m.maxRecentsScroll;this.bindEvents()}var b=function(){};var c=42;var d=$WBIM.language;var e=a.webim.ui.uiEvent;var f=[9,19,33,34,35,36,37,38,39,40,46,122,144,145];var g=d('<div style="width: 100%; text-align: center; margin-top: 13px;"><span class="icon_loading"></span>#L{正在搜索...}</div>');var h=d('<div style="width: 100%; text-align: center; margin-top: 13px;"><span class="icon_warnS"></span>#L{没有符合条件的结果}</div>');var i=d('<div style="width: 100%; text-align: center; margin-top: 13px;"><span class="icon_warnS"></span>#L{请输入要搜索的关键字}</div>');var j=a.webim.base.Class;var k=a.webim.ui.max.base.list;var l=a.webim.ui.max.base.userItem;var m;var n=a.core.evt.stopEvent;o.prototype={bindEvents:function(){var b=this;this.clearInputNode.addEvent("click",function(){b.searchInput.value="";b.cancelShowSearchPanel()});a.webim.uix.bodyClickManager.clickOthers([this.searchInput],function(a){var c=b.searchInput.value;b.clearInputNode.hide();b.searchInput.value="";b.changeSearchStyle(false)});this.searchInput.addEvent("focus",function(a,c){b.changeSearchStyle(true);b.clearInputNode.show();m.showRecents()});this.searchInput.addEvent("keydown",function(d,e){var f=d.keyCode;if(f==38){a.stopEvent();if(b.resultList){b.resultList.focusPrevious();var g=b.scrollContainer.getSize().height;var h=b.root.getSize().height;var i=b.resultList.getFocusItem();var j=b.scrollContainer.getXY();var k=i.root.getXY();if(k.t<j.t){var l=(k.t-j.t)/(h-g);b.scroll.scrollPercent(l,.04)}}return false}else if(f==40){a.stopEvent();if(b.resultList){b.resultList.focusNext();var g=b.scrollContainer.getSize().height;var h=b.root.getSize().height;var i=b.resultList.getFocusItem();var k=i.root.getXY();var j=b.scrollContainer.getXY();if(k.t+c>j.t+g){var l=(k.t+c-j.t-g)/(h-g);b.scroll.scrollPercent(l,.04)}}return false}});this.searchInput.addEvent("keyup",function(a,c){if(c.value===""){b.cancelShowSearchPanel();b.changeSearchStyle(false);m.resetRecents();b.clearInputNode.hide();b.searchInput.blur();return false}else{b.changeSearchStyle(true);b.clearInputNode.show()}var d=a.keyCode;for(var e in f){if(d==f[e]){return}}if(d==13){if(b.resultList){focusItem=b.resultList.getFocusItem();if(!focusItem)return;var g=focusItem.uid;b.searchInput.value="";b.clearSearchResult();m.fire("ui.user.click",{uid:g});b.searchInput.value="";b.clearInputNode.hide();b.cancelShowSearchPanel();b.changeSearchStyle(false)}return}n(a);b.deferredSearch(200)});e.add("ui.maxSearch.hide",function(){b.searchInput.value="";b.clearInputNode.hide();b.cancelShowSearchPanel();b.changeSearchStyle(false)})},showSearchBox:function(){this.searchInput.value="";this.searchBox.show();this.searchInput.focus()},doSearch:function(){var b=this;var c=this.searchInput.value;if(c===""){this.cancelShowSearchPanel();this.showSearchBox();return}m.showPanel(this);this.clearSearchResult();a.api.search(c,20,"max").done(function(a){b.showSearchResult(a)})},showSearchResult:function(b){if(!b||a.objIsEmpty(b)){this.clearSearchResult();this.root.innerHTML=h;this.scroll.init();return}this.clearSearchResult();var c=new q({results:b,parent:this});this.resultList=c;this.root.insertElement(c.root);this.scroll.init();var d=parseInt(this.scrollContainer.style.height.replace("px","")-34);this.scroll.setPos(0)},deferredSearch:function(a){var b=this;clearTimeout(this.searchDeferredKey);this.searchDeferredKey=undefined;!this.searchDeferredKey&&(this.searchDeferredKey=setTimeout(function(){b.doSearch();this.searchDeferredKey=undefined},a))},clearSearchResult:function(){this.root.innerHTML="";this.resultList=undefined},cancelShowSearchPanel:function(){if(m.currentPanel==this)m.showPanel(m.previousShowedPanel)},onChanged:function(){this.scroll.init()},setVisible:function(a){if(!a){this.clearSearchResult();this.searchInput.value=""}this.scrollContainer.setVisible(a);this.onChanged()},changeSearchStyle:function(a){if(a&&!this.styleFlg){this.webim_max_tab_root.style.display="none";this.maxMain.style.height=parseInt(this.maxMain.style.height)+31+"px";this.maxSearchScroll.style.height=parseInt(this.maxSearchScroll.style.height)+31+"px";this.maxRecentsScroll.style.height=parseInt(this.maxRecentsScroll.style.height)+31+"px";this.styleFlg=true}else if(!a&&this.styleFlg){this.webim_max_tab_root.style.display="";this.maxMain.style.height=parseInt(this.maxMain.style.height)-31+"px";this.maxSearchScroll.style.height=parseInt(this.maxSearchScroll.style.height)-31+"px";this.maxRecentsScroll.style.height=parseInt(this.maxRecentsScroll.style.height)-31+"px";this.styleFlg=false;m.resetRecents()}}};var p=['<div class="list_box list_box_fold clearfix" node-type="maxListRoot" style="z-index:10;">','<div class="list_content" >','<ul class="list_content_li" node-type="maxListContainer">',"</ul></div></div>"].join("");var q=j.create(a.webim.ui.base.component,{initialize:function(a){this.base.initialize({HTML:p,root:"maxListRoot"});this.results=a.results;this.parent=a.parent;this.root.removeClass("list_box_fold");this.items={};this.initListData();this.bindDataEvents()},insertItem:function(a,b){this.maxListContainer.insertElement(a,b)},removeItem:function(a){this.maxListContainer.removeElement(a)},initListData:function(){if(this.initialized)return;var a=0;for(var b in this.results){var c=this.createUserItem({user:this.results[b]});this.items[this.results[b].uid]=c;a++}for(var d in this.items){this.insertItem(this.items[d].root)}this.size=a;this.setFocusItem(0);this.initialized=true},bindDataEvents:function(){var a=["manager.presence","manager.userNewMsg","msg.user.clean"];this.add(a,function(a,b){var c=this.items[b.uid];if(c){switch(a.type){case"manager.userNewMsg":c.setNewMsgState(true);break;case"ui.user.clean":c.setNewMsgState(false);break;default:break}}})},createUserItem:function(a){return new l({uid:a.uid,user:a.user,unlazy:true})},getFocusItem:function(){var a=0;for(var b in this.items){if(a==this.focusIdx){return this.items[b]}a++}},focusNext:function(){this.setFocusItem(this.focusIdx+1)},focusPrevious:function(){this.setFocusItem(this.focusIdx-1)},setFocusItem:function(a){a=a<0?0:a;var b=0;var c=null;for(var d in this.items){if(b==a){this.items[d].setFocus(true)}else{this.items[d].setFocus(false)}c=this.items[d];b++}if(a>=b){a=b-1;c.setFocus(true)}this.focusIdx=a}});return o});
$WBIM.register("webim.ui.max.reconnectBar",function(a){function e(){var b=a.core.dom.builder(d);this.root=b.list["wbim_list_relink"][0];this.connectingWaitNode=b.list["connecting_wait"][0];this.connectingNode=b.list["connecting"][0];this.connectingFailNode=b.list["connecting_fail"][0];this.waitSecondsNode=b.list["wait_seconds"][0];this.waitConnectImmNode=b.list["wait_connect_imm"][0];this.cancelConnectNode=b.list["cancel_connect"][0];this.reconnectImmNode=b.list["reconnect_imm"][0];this.bindDomEvent();this.bindDataEvent();b=null}var b=$WBIM.language,c=a.webim.ui.uiEvent,d=b('<div class="webim_chat_tips webim_tips02" style="display:none;width:164px;position:absolute;bottom:0;right:0; z-index: 16000;" node-type="wbim_list_relink">'+'<span style="display:none;" node-type="connecting_wait"><span node-type="wait_seconds">10</span>#L{秒后尝试连接}，<a title="#L{立即连接}" href="javascript:void(0);" onclick="return false;" action-type="click" node-type="wait_connect_imm">#L{立即连接}</a></span>'+'<span style="display:none" node-type="connecting"><span class="wbim_loading" >#L{正在连接}，</span><a title="#L{取消连接}" href="javascript:void(0);" onclick="return false;" node-type="cancel_connect" action-type="click">#L{取消}</a></span>'+'<span style="display:none;" node-type="connecting_fail">#L{登录失败}，<a title="#L{重新连接}" href="javascript:void(0);" onclick="return false;" node-type="reconnect_imm" action-type="click">#L{重新连接}</a></span>');e.prototype={render:function(a){a.appendChild(this.root)},bindDomEvent:function(){var b=this;a.core.evt.delegatedEvent(this.root).add("click","click",function(a){switch(a.el){case b.waitConnectImmNode:c.fire("reconnect.request");break;case b.reconnectImmNode:c.fire("reconnect.request");break;case b.cancelConnectNode:c.fire("reconnect.stop");break}})},bindDataEvent:function(){var a=this;c.add("reconnect",function(){a.connectShow()});c.add("reconnect.time",function(b,c){a.timeShow(c)});c.add("reconnect.fail",function(){a.failShow()})},show:function(){this.root.style.display=""},hide:function(){this.root.style.display="none"},connectShow:function(){this.connectingNode.style.display="";this.connectingWaitNode.style.display="none";this.connectingFailNode.style.display="none"},failShow:function(){this.connectingNode.style.display="none";this.connectingWaitNode.style.display="none";this.connectingFailNode.style.display=""},timeShow:function(a){this.connectingNode.style.display="none";this.connectingWaitNode.style.display="";this.connectingFailNode.style.display="none";this.waitSecondsNode.innerHTML=a}};return e});
$WBIM.register("webim.ui.max.tipsPop",function(a){var b=a.core.dom,c=a.core.util.templet,d=a.core.evt.addEvent,e=a.webim.ui.uiEvent;var f=$WBIM.language;var g={success:"succ","delete":"del",error:"error",warn:"warn"};var h={small:"S",middle:"M",big:"B"};var i='<span class="icon_#{icon_type}#{icon_size}"></span>#{content}';var j=['<div class="W_layer" node-type="resultTip">','<div class="bg">','<table border="0" cellspacing="0" cellpadding="0">',"<tbody><tr><td>",'<div class="content layer_mini_info">','<p class="clearfix" node-type="result_info"></p>',"</div>","</td></tr></tbody>","</table>","   </div>","</div>"].join("");var k=['<div class="layer_tips layer_tips_version wbim_nmsg" node-type="promptTip" style="z-index:2000">','<div class="layer_tips_bg">','<a class="wbim_close_color" node-type="close_btn" href="javascript:void(0);" onclick="return false;"></a>',"<ul>",'<li node-type="content"></li>','<li class="link_btn" node-type="button" style="display:none">','<a class="W_btn_tip" href="javascript:void(0);" onclick="return false;">','<em node-type="btn_content"></em>',"</a>","</li>","</ul>",'<span class="wbim_arrow_down" node-type="arrow"></span>',"</div>","</div>"].join("");var l=f("#L{设置成功}");var m=f("#L{点击这里可以收起私信聊天}");var n=f("#L{设置失败}");var o=f("#L{已切换为}");var p=f("#L{在线状态}");var q=f("#L{隐身状态}");return function(f){var r=b.builder(j),s=r.list["resultTip"][0],t=r.list["result_info"][0];var u=b.builder(k),v=u.list["promptTip"][0],w=u.list["content"][0],x=u.list["close_btn"][0],y=u.list["button"][0],z=u.list["btn_content"][0],A=u.list["arrow"][0];var B,C;var D;var E;var F=function(a){if(!B){f.appendChild(s);B=true}s.style.bottom=a.bottom;s.style.right=a.right;t.innerHTML=c(i,{icon_type:g[a.iType],icon_size:h[a.iSize],content:a.content});s.style.display="";s.style.visibility="visible";I()};var G=function(){s.style.display="none";s.style.visibility="hidden"};var H=function(b){if(!C){a.E("WB_webim").appendChild(v);C=true}v.style.bottom=b.bottom;v.style.right=b.right;w.innerHTML=b.content;if(b.btn){y.style.display="";y.style.visibility="visible";z.innerHTML=b.btn}else{y.style.display="none";y.style.visibility="hidden"}A.style.right=b.rRight;v.style.display="";v.style.visibility="visible"};var I=function(){E&&clearTimeout(E);v.style.display="none";v.style.visibility="hidden"};(function(){d(x,"click",function(){I()});d(z,"click",function(){D&&D();I()});e.add("manager.setting.success",function(a,b){F({bottom:"50px",right:"31px",iType:"success",iSize:"small",content:l});E&&clearTimeout(E);E=setTimeout(function(){G();if(b&&b.contactsPanel&&b.contactsPanel.status=="bottomFloat"){H({bottom:"35px",right:"2px",content:m,rRight:"7px"})}},2e3)});e.add("manager.setting.fail",function(){F({bottom:"50px",right:"31px",iType:"error",iSize:"small",content:n});E&&clearTimeout(E);E=setTimeout(G,2e3)});e.last("manager.myPresence",function(a,b){F({bottom:"50px",right:"10px",iType:"success",iSize:"small",content:o+(b.status=="online"?p:q)});E&&clearTimeout(E);E=setTimeout(G,2e3)});e.add(["ui.maxPanel.hide","ui.bar.show","ui.wrapNode.click"],function(){G();I()})})()}});
$WBIM.register("webim.ui.max.maxPanel",function(a){var b=function(){};var c=$WBIM.language;var d=50;var e=31;var f=25;var g=3;var h=c("#L{取消打招呼提醒}");var i=c("#L{恢复打招呼提醒}");var j=c("#L{关闭声音提醒}");var k=c("#L{开启声音提醒}");var l=c("#L{取消新闻提醒}");var m=c("#L{恢复新闻提醒}");var n=f+d+e+g;var o=a.webim.base.Class;var p=a.webim.ui.base.component;var q=a.webim.ui.uiEvent;var r=o.create(p,{initialize:function(){this.items={};this.base.initialize({HTML:s,root:"maxRoot"});this.fixIE6();this.showSoundSetting();this.contactsPanel=new a.webim.ui.max.contacts.contactsPanel(this);this.recentsPanel=new a.webim.ui.max.recents.recentsPanel(this);this.search=new a.webim.ui.max.search(this);this.reconnect=new a.webim.ui.max.reconnectBar;this.topsPop=new a.webim.ui.max.tipsPop(this.root);this.tabs=[this.maxContactsTab,this.maxRecentsTab];this.panels=[this.contactsPanel,this.recentsPanel,this.search];this.currentPanel=this.contactsPanel;var b="recent";if(b=="user"){this.onTabClick(undefined,this.maxContactsTab)}else if(b=="recent"){this.onTabClick(undefined,this.maxRecentsTab)}this.initSetting();this.setHeight();this.doTipsTab();this.bindDomEvents();this.bindDataEvents();this.bindReconnectEvents()},fixIE6:function(){if(a.core.util.browser.IE6){this.maxSettingBox.style.position="relative"}},render:function(){this.reconnect.render(this.listWrap);this.base.render()},bindDomEvents:function(){var a=this;this.onWindowResize(function(){this.deferred("max.onresize",500,function(){this.setHeight();this.fixFoldBtn();this.initFloatModel()})});this.maxContactsTab.addEvent("click",this.onTabClick);this.maxRecentsTab.addEvent("click",this.onTabClick);this.maxSettingBtn.addEvent("click",function(a){this.fire("ui.wrapNode.click");if(this.maxSettingMenu.style.display=="none"){this.fire("ui.maxSettingMenu.show")}else{this.fire("ui.maxSettingMenu.hide")}this.maxSettingMenu.showOrHide()});this.maxSettingMenu.addEvent("click",function(){this.maxSettingMenu.hide()});this.maxSettingMenu.clickButNotMe([this.maxSettingBtn],function(a){this.maxSettingMenu.hide()});this.bottomFloatRadioLi.addEvent("click",this.changeSetting);this.bottomFloatRadio.addEvent("click",this.changeSetting);this.broadsideFloatRadioLi.addEvent("click",this.changeSetting);this.broadsideFloatRadio.addEvent("click",this.changeSetting);this.root.delegated("massChatLink","click",function(){this.maxSettingMenu.hide()});this.noticeSetting.addEvent("click",function(){var b=this.noticeSetting.innerHTML;var d=b===c(l)?1:0;q.fire("request.setting.notice",{data:{notice:{block:d}},callback:function(){a.setNoticeSetting(d)}})});this.newMsgSoundSetting.addEvent("click",function(){var b=this.newMsgSoundSetting.innerHTML;var d=b.indexOf(c("#L{关闭}"))===-1;q.fire("request.setting.newMsgSound",{data:{sound:{status:d}},callback:function(){a.setNewMsgSoundSetting(d)}})})},bindDataEvents:function(){var a=this;this.add("ui.refreshSetting",function(){this.initSetting();this.initFloatModel()});this.add(["manager.userNewMsg","manager.groupNewMsg","ui.unread.change","msg.user.clean"],this.doTipsTab);this.after("ui.user.click",function(){this.maxSettingMenu.hide()});this.add("ui.maxPanel.show",function(b,c){this.show();if(c&&c.from=="search"){setTimeout(function(){a.maxSearchInput.focus()},10)}});this.add("ui.maxPanel.hide",this.hide);this.add("ui.minPanel.show",this.hide)},bindReconnectEvents:function(){var a=this;this.add("reconnect",function(b,c){a.reconnect.show()});this.add("connected",function(b,c){a.reconnect.hide();this.contactsPanel.onlineFriendList.fold()})},setHeight:function(){var a=this.getPanelHeight()-38;this.maxMain.setHeight(a);this.maxContactsScroll.setHeight(a);this.maxGroupsScroll.setHeight(a);this.maxRecentsScroll.setHeight(a);this.maxSearchScroll.setHeight(a);this.initScroll();this.contactsPanel&&this.contactsPanel.checkLazyLoad()},getPanelHeight:function(){var a=document.documentElement.clientHeight-n;a=a>200?a:200;return a},fixFoldBtn:function(){if(a.core.util.browser.IE6&&a.core.util.browser.IE7){this.leftFoldBtn.style.top="10%";this.leftFoldBtn.style._top="10%";this.leftFoldBtn.style.top="50%";this.leftFoldBtn.style._top="50%"}},showSoundSetting:function(){var b=a.core.util.browser;var c=b.CHROME||b.MOZ;if(c){this.newMsgSoundSettingLi.show()}},doTipsTab:function(){var b=this;var c=a.getUnread();if(c&&c.items){if(c.total>0){b.maxContactsTab.addClass("new")}else{b.maxContactsTab.removeClass("new")}}},initScroll:function(){this.currentPanel.scroll.init()},initFloatModel:function(){var b=$WBIM.initData.setting&&$WBIM.initData.setting.contactsPanel&&$WBIM.initData.setting.contactsPanel.status;var c=a.webim.uix.screenRatioManager.isLowMode();var d=!c;var e=b==="broadsideFloat";var f=!e;if(f||c){this.maxBottomContainer.className="webim_list_setting webim_setting_narrow"}else{this.maxBottomContainer.className="webim_list_setting"}this.maxDownfoldBtn.setVisible(f||c);this.leftFoldBtn.setVisible(e&&d);this.rightFoldBtn.setVisible(e&&d);this.bottomFloatRadio.checked=f;this.broadsideFloatRadio.checked=e;this.maxFloatModelRadioContainer.setVisible(!c)},changeSetting:function(a){var b=this;var c=a.target;if(this.bottomFloatRadioLi.containsNode(c)){q.fire("request.setting.bottom",{data:{contactsPanel:{status:"bottomFloat"}},callback:function(){b.bottomFloatRadio.checked=true;b.broadsideFloatRadio.checked=false;b.initFloatModel()}})}else if(this.broadsideFloatRadioLi.containsNode(c)){q.fire("request.setting.side",{data:{contactsPanel:{status:"broadsideFloat"}},callback:function(){b.bottomFloatRadio.checked=false;b.broadsideFloatRadio.checked=true;b.initFloatModel()}})}},setNewMsgSoundSetting:function(a){var a=a===undefined?$WBIM.initData&&$WBIM.initData.setting&&$WBIM.initData.setting.sound&&$WBIM.initData.setting.sound.status:a;this.newMsgSoundSetting.innerHTML=a?j:k},setNoticeSetting:function(a){var a=a===undefined?$WBIM.initData&&$WBIM.initData.setting&&$WBIM.initData.setting.notice&&$WBIM.initData.setting.notice.block:a;this.noticeSetting.innerHTML=a?m:l},onTabClick:function(b,c){for(var d in this.tabs){this.tabs[d].addClass("clearfix");this.tabs[d].removeClass("cur")}c.removeClass("clearfix");c.addClass("cur");if(c===this.maxContactsTab){this.fire("ui.maxContactsTab.show");try{if(a.core.str.trim(this.contactsPanel.root.innerHTML)==""){this.contactsPanel.init()}}catch(b){}this.showPanel(this.contactsPanel);this.contactsPanel.checkScroll();this.contactsPanel._imgLazyLoder.check()}else if(c===this.maxRecentsTab){this.fire("ui.maxRecentsTab.show");this.showPanel(this.recentsPanel);this.floatNode.style.display="none"}},showPanel:function(a){if(!a)return;if(this.currentPanel===a)return;for(var b in this.panels){if(a===this.panels[b])continue;this.panels[b].setVisible(false)}if(a!==this.currentPanel){this.previousShowedPanel=this.currentPanel}this.floatNode.style.display="none";this.currentPanel=a;a.setVisible(true)},showRecents:function(){this.currentPanel.setVisible(false);this.floatNode.style.display="none";this.recentsPanel.setVisible(true)},resetRecents:function(){if(this.currentPanel==this.recentsPanel){this.showPanel(this.recentsPanel)}else{this.recentsPanel.setVisible(false);this.showPanel(this.currentPanel);this.currentPanel.setVisible(true)}},parsePosition:function(a){return a?"afterbegin":"beforeend"},show:function(){this.render();this.initFloatModel();this.base.show();if(!this.firstShow){this.firstShow=true;this.contactsPanel.onlineFriendList&&this.contactsPanel.onlineFriendList.fold()}this.initScroll();this.contactsPanel.checkLazyLoad()},initSetting:function(){var a=$WBIM.initData;if(a.setting){this.setNewMsgSoundSetting();this.setNoticeSetting()}}});var s=c(['<div class="webim_list WBIM_unfold" node-type="maxRoot" style="right: 0; bottom: 0; z-index: 1000;">','<div class="webim_list_wrap " node-type="listWrap" style ="position:relative;">','<div class="webim_list_header clearfix" node-type="maxTabContainer" style="position:relative;z-index:5;">','<div class="wbim_search" node-type="searcherBox">','<a href="javascript:void(0);" onclick="return false;" class="WBIM_icon_search_lb"></a>','<input type="text" node-type="maxSearchInput" placeholder="查找联系人"><a href="javascript:void(0);" onclick="return false;"  class="WBIM_icon_closeY" node-type="clearInputNode" >',"</a>","</div>",'<div class="webim_tab" node-type="webim_max_tab_root" style="display: block;">','<ul class="tab_list clearfix">','<li class="cur" node-type="maxContactsTab" title="#L{关注列表}" suda-uatrack="key=tblog_webim_behavior5&value=friend_contact_list"><a href="javascript:void(0);" onclick="return false;"><span class=" webim_icon_tab WBIM_icontab_link"></span></a></li>','<li class="clearfix " node-type="maxRecentsTab" title="#L{最近联系人}" suda-uatrack="key=tblog_webim_behavior5&value=recent_contact_list"><a href="javascript:void(0);" onclick="return false;"><span class=" webim_icon_tab WBIM_icontab_last"></span></a></li>',"</ul>","</div>","</div>",'<div node-type="floatNode" style = "position:absolute;top:31px;z-index:3; background:white;box-shadow: 0 0 5px rgba(0,0,75,.2);width:180px;top : 70px;height:29px;line-height:29px;display:none;" class=""></div>','<div class="webim_list_main clearfix" node-type="maxMain" style="overflow:hidden;" >','<div node-type="maxContactsScroll">','<div node-type="maxContactsContainer" style="overflow:hidden;_zoom:1;" class="webim_list_con" ></div>',"</div>",'<div node-type="maxGroupsScroll" style="display: none;">','<div node-type="maxGroupsContainer" style="overflow:hidden;_zoom:1;" class="webim_list_con"></div>',"</div>",'<div node-type="maxRecentsScroll" style="display: none;">','<div node-type="maxRecentsContainer" style="overflow:hidden;_zoom:1;" class="webim_list_con"></div>',"</div>",'<div node-type="maxSearchScroll" style="display: none;">','<div node-type="maxSearchContainer" style="overflow:hidden;_zoom:1;" class="webim_list_con"></div>',"</div>","</div>",'<div class="webim_list_setting" node-type="maxBottomContainer" style="z-index: 9999;">','<div class="list_setting_box" node-type="maxSettingBox">','<div class="setting_r">','<div class="layer_menu_list" node-type="maxSettingMenu" style="position:absolute; display: none; right: 0; bottom: 28px; z-index: 9999;">','<div class="menu_setting">','<ul class="list_oth list_border" >','<li><a node-type="noticeSetting" href="javascript:void(0);" onclick="return false;">#L{取消新闻提醒}</a></li>',"</ul>",'<ul class="list_oth list_border" >','<li node-type="newMsgSoundSettingLi"  style="display: none;"><a node-type="newMsgSoundSetting"  href="javascript:void(0);" onclick="return false;">#L{关闭声音提醒}</a></li>',"</ul>",'<ul class="list_oth list_border" >','<li><a href="http://weibo.com/webim" target="_blank" suda-uatrack="key=tblog_webim_behavior5&value=feedback">#L{意见反馈}</a></li>','<li><a href="http://account.weibo.com/set/prefer?topnav=1&wvr=5" target="_blank" suda-uatrack="key=tblog_webim_behavior5&value=chat_site">#L{聊天设置}</a></li>',"</ul>",'<div class="select_state">','<ul node-type="maxFloatModelRadioContainer" class="state_list">','<li node-type="bottomFloatRadioLi" class="clearfix" style="cursor: pointer">','<input node-type="bottomFloatRadio"  type="radio" name="setting_position" class="WB_radio" style="cursor: pointer"/>','<label style="cursor: pointer">#L{最小化时到底部}</label>',"</li>",'<li node-type="broadsideFloatRadioLi" class="clearfix" style="cursor: pointer">','<input node-type="broadsideFloatRadio" type="radio" name="setting_position" class="WB_radio" style="cursor: pointer"/>','<label style="cursor: pointer">#L{最小化时到右侧}</label>',"</li>","</ul>","</div>","</div>","</div>",'<a title="#L{查看我的私信}" href="http://weibo.com/messages" target="_blank" class="setting_btn setting_btn_first" suda-uatrack="key=tblog_webim_behavior5&value=messages_entrance"><span class="WBIM_icon_msg"></span></a>','<a title="#L{私信聊天设置}" class="setting_btn" href="javascript:void(0);" onclick="return false;" node-type="maxSettingBtn"><span class="WBIM_icon_setting"></span></a>','<a title="#L{收起私信聊天}" class="setting_btn" href="javascript:void(0);" onclick="return false;" node-type="rightFoldBtn" action-type="foldButton" action-data="from=max"><span class="WBIM_icon_rightfold"></span></a>','<a title="#L{收起私信聊天}" class="setting_btn" href="javascript:void(0);" onclick="return false;" node-type="maxDownfoldBtn" action-type="downFoldButton"><span class="WBIM_icon_downfold"></span></a>',"</div>","</div>","</div>","</div>",'<a class="webim_fold_btn" node-type="leftFoldBtn" action-type="foldButton" action-data="from=max" href="javascript: void(0);"><span class="btn_click"><em class="WB_webim_arrow"></em></span></a>',"</div>"].join(""));return r});
$WBIM.register("webim.ui.max.main",function(a){return function(){a.webim.ui.panelManager.setPanel("max",new a.webim.ui.max.maxPanel)}});
$WBIM.register("webim.ui.massWindow",function(a){var b=a.core.util.browser.IE?185:200,c=500,d=$WBIM.language,e=d("#L{选择好友}"),f=d("#L{尚未选择好友}"),g=d("#L{重复选择好友}"),h=d("#L{选择好友数目已达上限}"),i=d(['<div class="wbim_chat_box" style="position:absolute;right:199px;bottom:0px;z-index:1001;" node-type="wbim_chat_box">','<div class="wbim_chat_con">','<div class="wbim_tit" node-type="wbim_tit">','<div class="wbim_titin"><div class="wbim_tit_lf"><p class="tit_lf_con"><span class="input_state">#L{发送私信}</span></p> </div>','<div class="wbim_tit_rt"><a title="#L{最小化}" hidefocus="true" class="WBIM_icon_mini wbim_icon_mini" href="javascript:void(0);" onclick="return false;" node-type="wbim_icon_mini"></a>','<a title="#L{关闭}" hidefocus="true" class="WBIM_icon_close wbim_icon_close" href="javascript:void(0);" onclick="return false;" node-type="wbim_icon_close"></a></div></div></div>','<div class="wbim_chat_wrap"><div class="wbim_msg_grp" style="display:none" node-type="wbim_sending">','<div class="stat_box">','<div class="txts"><span class="WBIM_massend_state icon_loading wbim_icon_ing"></span>#L{正在发送...}</div>',"</div></div>",'<div class="wbim_msg_grp" style="display:none" node-type="wbim_success">','<div class="stat_box">','<div class="txts"><span class="WBIM_massend_state icon_succS wbim_icon_ok"></span>#L{发送成功}</div>',"</div></div>",'<div class="wbim_msg_grp" style="display:none" node-type="wbim_fail">','<div class="stat_box">','<div class="txts">','<span class="wbim_icon_err"></span>#L{以下好友接收失败}','<div class="fd_list" node-type="wbim_fail_list"></div>','</div></div><div class="msg_btn">','<a class="wbim_btn_c" href="javascript:void(0);" onclick="return false;" node-type="wbim_conti_send"><em>#L{继续发送}</em></a>','<a class="wbim_btn_n" href="javascript:void(0);" onclick="return false;" node-type="wbim_fail_cancel"><em>#L{取消}</em></a>',"</div></div>",'<div class="wbim_msg_grp" node-type="wbim_normal">','<p class="sub_tit">'+e+'<span class="spetxt" style="padding-left:20px;" node-type="wbim_tips_spetxt"></span></p>','<p class="num_info">#L{还可以选择}<span node-type="wbim_num_info"></span>#L{位}</p>','<div class="fd_slt">','<ul class="f_list" node-type="wbim_user_list">','<li class="wbim_search_input_li" node-type="wbim_search_input_li"><input node-type="wbim_search_input" type="text" class="f_ipt" style="margin-top:2px;"></li>',"</ul>",'<div class="layer_menu_list" node-type="wbim_result_div" style="position:absolute; z-index:99; display:none">','<ul node-type="wbim_result_list">',"</ul>","</div>","</div>",'<p class="sub_tit">#L{发送内容}</p>','<div class="msg_ta">','<p class="num_info">#L{还可以输入}<span node-type="wbim_input_num">'+b+'</span><span class="spetxt" node-type="spetxt"></span>#L{字}</p>','<div class="main_ta">','<textarea node-type="wbim_textarea"></textarea>',"</div>","</div>",'<div class="msg_more">','<a class="moreslt" href="javascript:void(0);" onclick="return false;" style="display:;" node-type="wbim_more">#L{更多选择}','<span class="WB_webim_arrow" node-type="arrow_up"><em class="down">◆</em></span><span class="WB_webim_arrow" node-type="arrow_down"><em class="up">◆</em></span></a></div>','<div class="wbim_layer wbim_grp_push" style="display:none;" node-type="wbim_layer">','<div class="wbim_layer_bg"><div  class="wbim_layer_con">','<table><tbody><tr><td><div class="wbim_titbar">#L{选择祝福语}<a class="wbim_layerclose" node-type="wbim_layer_close" href="javascript:void(0);" onclick="return false;"></a></div>','<div node-type="moreMsgContainer" class="wbim_msg_push"><ul node-type="wbim_msg_list">','</ul></div></td></tr></tbody></table></div></div><div class="wbim_down_arr"></div></div>','<div node-type="msgBtnContainer" class="msg_btn">','<a class="WBIM_btn_a" href="javascript:void(0);" onclick="return false;" node-type="wbim_ok_btn"><span>#L{确定}</span></a>','<a class="WBIM_btn_b" href="javascript:void(0);" onclick="return false;" node-type="wbim_cancel_btn"><span>#L{取消}</span></a>',"</div>","</div></div>","</div>","</div>"].join("")),j=["“愚”乐圈潜规则：人不愚我，我要愚人。让部分人先愚起来，先愚带动后愚，大家愚才是真的愚。与其自“愚”自乐，不如授人以“愚”。你愚，我快乐！","愚人节不只有愚弄，还有祝福；愚人节不只有欺骗，还有问候；愚人节不只有调侃，还有真诚；愚人节，真心祝你“愚”时俱进，沉“愚”落雁。","亲爱的，我又开始想你了，我对你的爱每天都在巨增，因为有人告诉我:猪肉涨价了，你能卖个好价钱！","一直都想找个节日给你庆祝一番，就是没适合你的节日，六一节你超龄，三八节已经过去，现在好了，属于你的节日终于到来，祝愚人节快乐！","4月1日起，单位所有工作人员工资上浮40%，请于4月31日9:00至17:00至财务领取1-3月的差缺部分。祝你节日快乐！","愚人节又到，鸡飞狗也跳；朋友瞎胡闹，同事爱搞笑；如厕细查看，纸巾要带好；电话有邀约，想想你再到；美女若传情，小心是圈套；下班早回，别被整到！","朋友中我最羡慕你，温和善良好脾气，勤奋肯干能赚钱，身体健康无病疾，领导夸奖同事赞，无烦无恼笑眯眯，还专门设了个愚人节，大伙都给你发信息","今天是愚人节，为了防止大家上当受骗本公司决定放假一天，不扣工资，不扣奖金。特别提醒：这一天请不要出门乱跑。请大家互相转发告知！","小时候，咱俩两小无猜，我唱歌你伴舞；我能唱两百支歌，你就能跳两百支舞。所以人们亲切地称我为二百歌，称你为二百舞。祝你节日快乐！","连续七天比杜甫还忙，几乎忘了今天是什么日子，要不是想到你，我都察觉不到，今天是你的节日，祝你愚人节快乐！"],k=d('<li class="title">#L{可输入好友昵称（支持拼音首字母输入）}</li>'),l=a.core.util.templet,m="<em>NICK</em>",n='<li class="chose_user"><a href="javascript:void(0);" onclick="return false;"><span class="txt">#{nick}</span><em class="WBIM_icon_tipsclose wbim_icon_close_s" action-type="UserChoose.Del" action-data="uid=#{uid}"></em></a></li>',o='<li><a href="javascript:void(0);" onclick="return false;" action-type="SearchUser.Onclick" action-data="uid=#{uid}">#{nick}</a></li>',p='<li action-type="MsgSelect.Onclick">MSG</li>',q=a.core.arr.indexOf,r=a.core.str.trim,s=a.core.dom.sizzle,t=a.core.func.bind,u=a.core.arr.foreach,v=a.core.arr.copy,w=null,x=a.core.evt,y=a.core.evt.stopEvent,z=a.webim.utils.Array,A=a.core.dom,B=["zore","one","two","three","four","five","six","seven","eight","nine","ten"];var C=function(){w=a.webim.ui.uiEvent;var b=A.builder(i);this._root=b.list["wbim_chat_box"][0];this._titleBar=b.list["wbim_tit"][0];this._closeBtn=b.list["wbim_icon_close"][0];this._minBtn=b.list["wbim_icon_mini"][0];this._userNumNode=b.list["wbim_num_info"][0];this._usersField=b.list["wbim_user_list"][0];this._searchInput=b.list["wbim_search_input"][0];this._searchInputLi=b.list["wbim_search_input_li"][0];this._resultDiv=b.list["wbim_result_div"][0];this._resultList=b.list["wbim_result_list"][0];this._inputNumNode=b.list["wbim_input_num"][0];this._errorNode=b.list["spetxt"][0];this._msgArea=b.list["wbim_textarea"][0];this._okBtn=b.list["wbim_ok_btn"][0];this._cancelBtn=b.list["wbim_cancel_btn"][0];this._nobodyTipsNode=b.list["wbim_tips_spetxt"][0];this._normalNode=b.list["wbim_normal"][0];this._sendingNode=b.list["wbim_sending"][0];this._successNode=b.list["wbim_success"][0];this._failNode=b.list["wbim_fail"][0];this._failListNode=b.list["wbim_fail_list"][0];this._contiSendBtn=b.list["wbim_conti_send"][0];this._failCancelBtn=b.list["wbim_fail_cancel"][0];this._moreMsgBtn=b.list["wbim_more"][0];this._moreMsgNode=b.list["wbim_layer"][0];this._closeMoreMsgBtn=b.list["wbim_layer_close"][0];this._msgListNode=b.list["wbim_msg_list"][0];this._arrowUp=b.list["arrow_up"][0];this._arrowDown=b.list["arrow_down"][0];this._msgBtnContainer=b.list["msgBtnContainer"][0];this._moreMsgContainer=b.list["moreMsgContainer"][0];if(a.core.util.browser.IE6){}this._maxUser=3;this._userNum=0;this._lastInput="";this._lastKeyowrd="";this._keyword="";this._searchFocus=false;this._openTipsFlg=false;this._hideTipType="";this._chosenItem;this._searchUids=[];this._searchResults={};this._results=[];this._sendedUids=[];this._addedNicks={};this._list=[];this._failUidsObj={};this._lastStatusNode=this._normalNode;this._tipTop;this._tipLeft;this._openFlg=true;this._userNumNode.innerHTML=this._maxUser;this.keyActions={8:function(){if(this.inputValue==""&&this.inputValue==this.lastInput){this.backUser()}},13:function(){this.enterUser()},38:function(){this._chooseItemTo(true)},40:function(){this._chooseItemTo(false)}};this.bindDataEvent();this.bindDomEvent();this.bindUIEvent();if(a.core.util.browser.IE6){this._moreMsgContainer.style.bottom="100px"}i=null;a.webim.ui.panelManager.setPanel("massWindow",this)};C.prototype={render:function(a){a.appendChild(this._root)},bindUIEvent:function(){},bindDataEvent:function(){var b=this,c=[];w.add("ui.massWindow.show",function(c,d){if(d.uid){b.addUser(d.uid)}else if(d){b.specialInit()}else if(a.webim.utils.holiday.isHoliday()){b._maxUser=10}b.refreshUserNum();b._show()});w.add("ui.massWindow.hide",function(a,c){b.hide()});w.add("manager.mass",function(d,e){if(e.flag){b.changeStatusNode(b._successNode);return}var f=[];a.core.arr.foreach(e.uids,function(a){var b=w.value("data.user",{uid:a}).user;f.push(m.replace("NICK",b.nick))});if(f.length>0){b.sendMsgFail(f.join(""));b._sendedUids=[];c=[]}});w.add("ui.chatWindow.show",function(a){b._openFlg&&b.hide("mini")})},bindDomEvent:function(){var b=this,c=this._msgArea,d=this._searchInput;x.addEvent(this._titleBar,"mouseover",function(){b._titleBar.className="wbim_tit wbim_tit_hover"});x.addEvent(this._titleBar,"mouseout",function(){b._titleBar.className="wbim_tit"});x.addEvent(this._titleBar,"click",function(a){var c=a.target||a.srcElement;if(b._closeBtn===c){b.close()}else{b.hide("mini")}y()});x.addEvent(this._okBtn,"click",function(a){b.hideTip("data");b.send();y()});x.addEvent(this._usersField,"click",function(a){b._searchInput.focus();y()});x.addEvent(this._cancelBtn,"click",function(a){b.close();y()});x.addEvent(this._failCancelBtn,"click",function(a){b.changeStatusNode(b._normalNode);b.close();y()});x.addEvent(this._contiSendBtn,"click",function(a){var c=[];for(var d in b._failUidsObj){c.push(d)}b._failUidsObj={};b.send(c);y()});x.addEvent(this._moreMsgBtn,"click",function(a){b.hideTip("data");b._moreMsgNode.style.display==""?b.hideMoreMsg():b.showMoreMsg();y()});x.addEvent(this._closeMoreMsgBtn,"click",function(a){b.hideMoreMsg();y()});u(["keyup","paste","cut","mousedown","mouseup","keydown","focus"],function(a,e){x.addEvent(c,a,function(){clearTimeout(b._checkTimer);b._checkTimer=setTimeout(function(){b._checkInput()},500)});x.addEvent(d,a,function(){b._lastInput=b._keyword;b._keyword=b._searchInput.value;clearTimeout(b._checkSearchTimer);b._checkSearchTimer=setTimeout(function(){b._searchLater()},500)})});x.addEvent(d,"keyup",function(a){b.lastInput=b.inputValue;b.inputValue=b._searchInput.value;b._doKey(a.keyCode)});x.addEvent(d,"focus",function(){b._searchFocus=true;if(b._hideTipType=="data"){b.showTip()}else{b.showTip("msg")}});x.addEvent(b._root,"click",function(){b._searchFocus=false;if(b._hideTipType=="none"){b._searchInput.value=""}else{b.hideTip("data")}});var e=a.core.evt.delegatedEvent;e(this._usersField).add("UserChoose.Del","click",function(a){if(a.data&&a.data.uid){b.delUser(a.data.uid)}});e(this._resultDiv).add("SearchUser.Onclick","click",function(a){if(a.data&&a.data.uid){b.addUser(a.data.uid)}y()});e(this._msgListNode).add("MsgSelect.Onclick","click",function(a){b.setValue(a.el.innerHTML);b.hideMoreMsg()})},hide:function(a){if(!this._openFlg){return}this._openFlg=false;this.hideMoreMsg();A.setStyle(this._root,"display","none");A.setStyle(this._root,"visibility","hidden");if(!a){this.resetTip()}else{var b=r(this._msgArea.value),c=this._getUserListResult().length;if(b&&b!=""||c!=0){this.hideTip("data")}else{a=null;this.resetTip()}}},_show:function(){if(!this.rendered){this.rendered=true;this.render(a.E("WB_webim"))}this._openFlg=true;A.setStyle(this._root,"display","");A.setStyle(this._root,"visibility","visible")},close:function(){this.setValue("");this.changeStatusNode(this._normalNode);this.hide()},_checkInput:function(){var a=r(this._msgArea.value);if(a.length>c){this._msgArea.value=a.substr(0,c)}this._checkLength();this._checkTimer=null},getCharacterLength:function(){return Math.ceil(r(this._msgArea.value).replace(/[^\x00-\xff]/g,"aa").length/2)},_checkLength:function(){var a=b-this.getCharacterLength();if(a>-1){this._inputNumNode.innerHTML=a;this._errorNode.innerHTML=""}else{this._inputNumNode.innerHTML="";this._errorNode.innerHTML=a}},send:function(a){if(this._checkTimer){clearTimeout(this._checkTimer);this._checkInput()}var c=this.getCharacterLength(),d,e=0,f=this,g=a||this._getUserListResult();if(g.length==0){this.bodyTips("none");return}if(c-b>0||c==0){this.flashContentNode();return}this.changeStatusNode(this._sendingNode);d=r(this._msgArea.value);this._sendedUids=v(g);w.fire("msg.mass.send",{msg:d,uids:g,type:"mass"})},bodyTips:function(a){var b=this,c;if(a=="none"){c=f}else if(a=="twice"){c=g}else if(a=="max"){c=h}this._nobodyTipsNode.innerHTML=c;clearTimeout(this.tipsTimeout);this.tipsTimeout=setTimeout(function(){b._nobodyTipsNode.innerHTML="";b.tipsTimeout=null},3e3);var d=this._usersField,e=this._searchInput,i=1;(function(){if(i>4){return}i++;A.setStyle(d,"background",i%2?"":"#ffdddd");A.setStyle(e,"background",i%2?"":"#ffdddd");setTimeout(arguments.callee,150)})()},flashContentNode:function(){var a=this._msgArea,b=0;if(r(a.value).length==0){a.value=""}(function(){if(b>3){return}A.setStyle(a,"background",b++%2?"":"#ffdddd");setTimeout(arguments.callee,150)})()},_checkTipPosition:function(){var a=A.position(this._searchInput),b=A.position(this._usersField),c=a.t-b.t,d=a.l-b.l,e=23;if(e+c!=this._tipTop){this._tipTop=e+c;A.setStyle(this._resultDiv,"top",this._tipTop+"px")}if(d!=this._tipLeft){this._tipLeft=d;A.setStyle(this._resultDiv,"left",this._tipLeft+"px")}},_searchLater:function(){var a=this,b=a._keyword;if(b){if(b!=a._lastKeyword){a._lastKeyword=b;w.fire("request.user.search",{param:{keyword:b,limit:10,seq:"mass"},callback:function(b){var c=b;a.showResult(c)}})}}else if(b==""&&this._searchFocus){this._hideTipType="none";this.showTip("msg")}this._checkSearchTimer=null},_doKey:function(a){var b=this.keyActions[a];if(b){b.apply(this)}},addUser:function(a){this.hideTip("add");if(this._userNum>=this._maxUser){this.bodyTips("max")}else if(q(a,this._results)>-1){this.bodyTips("twice")}else{this._userNum++;this._results.push(a);var b=this._searchResults[a]||w.value("data.user",{uid:a}).user;var c=A.builder(l(n,{nick:b.nick,uid:b.uid})).box;this._addedNicks[a]=b.nick;A.insertBefore(c,this._searchInputLi);this.refreshUserNum()}this.refreshSearchInput()},addRecents:function(a){var b=w.value("data.user.recents").recents,c=b.length;this._userNum=c;for(var d=0;d<c;d++){var e=b[d];this._results.push(e.uid);var f=A.builder(l(n,{nick:e.nick,uid:e.uid})).box;this._addedNicks[e.uid]=e.nick;A.insertBefore(f,this._searchInputLi)}this.refreshUserNum()},enterUser:function(){if(this._openTipsFlg){if(this._chosenItem){this.addUser(this._chosenItem)}this._chosenItem=null;this._searchInput.value="";this.keyword=""}},delUser:function(a){this.hideTip("data");var b=q(a,this._results);if(b!=-1){this._userNum--;delete this._addedNicks[a];var c=s(".chose_user",this._usersField)[b];A.setStyle(c,"visibility","hidden");A.setStyle(c,"display","none");this._results[b]="";this.refreshUserNum()}this._checkTipPosition()},backUser:function(){var a=this._results;var b=a.length;for(var c=b-1;c>=0;c--){if(a[c]!=""){this.delUser(a[c]);break}}},refreshUserNum:function(){var a=this._maxUser-this._userNum;this._userNumNode.innerHTML=a},refreshSearchInput:function(){this._searchInput.value="";this._searchInput.focus()},chooseUser:function(a){this.addUser(this.results[a])},showResult:function(b){this._searchUids=[];this._searchResults={};var c=false,d=this._lastKeyword;if(a.core.obj.isEmpty(b)){c=true}if(!c){var e=[],f=this,g=f._results;u(b,function(a,b){var c={};if(a&&e.length<10&&q(a.uid,g)==-1){c.nick=a.nick;c.uid=a.uid;e.push(l(o,c));f._searchUids.push(a.uid);f._searchResults[a.uid]=a}});f._resultList.innerHTML=e.join("");f._chooseItem(f._searchUids[0]);f.showTip()}else{this.hideTip("none")}},resetTip:function(){this.hideTip("none");var a=this._results.length;for(var b=0;b<a;b++){if(this._results[b]!=""){this.delUser(this._results[b])}}this._keyword="";this._lastKeyword="";this._lastInput="";this._searchInput.value=""},showTip:function(a){this._hideTipType="data";if(a=="msg"){this._resultList.innerHTML=k}if(!this._openTipsFlg&&this._searchFocus){this._checkTipPosition();this._openTipsFlg=true;A.setStyle(this._resultDiv,"display","");A.setStyle(this._resultDiv,"visibility","visible")}},hideTip:function(a){this._hideTipType=a;if(a=="none"||a=="add"){this._resultList.innerHTML="";this._chosenItem=null;this._lastKeyword="";this._keyword=""}if(this._openTipsFlg){this._openTipsFlg=false;A.setStyle(this._resultDiv,"display","none");A.setStyle(this._resultDiv,"visibility","hidden")}},_chooseItemTo:function(a){var b=this._searchUids,c=b.length,d;if(this._chosenItem&&c>0){var e=q(this._chosenItem,b);if(a){e--;if(e<0){e=0}}else{e++;if(e>=c){e=c-1}}d=b[e];this._chooseItem(d)}else if(!this._chosenItem){e=0;d=b[e];this._chooseItem(d)}},_chooseItem:function(a){var b=this._getElement(this._chosenItem);var c=this._getElement(a);if(b){b&&A.removeClassName(b,"cur")}c&&A.addClassName(c,"cur");this._chosenItem=a},_getElement:function(a){var b=q(a,this._searchUids);return b==-1?null:this._resultList.children[b]},_getUserListResult:function(){return a.core.arr.clear(this._results)},changeStatusNode:function(a){A.setStyle(this._lastStatusNode,"display","none");A.setStyle(a,"display","");this._lastStatusNode=a},showMoreMsg:function(){var a="";if(j){for(var b=j.length;b--;){a+=p.replace("MSG",j[b])}this._msgListNode.innerHTML=a;j=null}A.setStyle(this._moreMsgNode,"display","");this.changeArrow("up")},hideMoreMsg:function(){A.setStyle(this._moreMsgNode,"display","none");this.changeArrow("down")},specialInit:function(){this.setValue(j[j.length-1]);this._maxUser=10;this._userNumNode.innerHTML=this._maxUser;this.addRecents(this._maxUser)},setValue:function(a){this._msgArea.value=a;this._checkInput()},initMoreMsg:function(){this._moreMsgBtn.style.display=""},sendMsgFail:function(a){this.changeStatusNode(this._failNode);this._failListNode.innerHTML=a},changeArrow:function(a){if(a=="down"){A.setStyle(this._arrowDown,"display","none");A.setStyle(this._arrowUp,"display","")}else{A.setStyle(this._arrowDown,"display","");A.setStyle(this._arrowUp,"display","none")}}};return C});
$WBIM.register("webim.ui.lastWeibo",function(a){var b=$WBIM.language,c=a.webim.utils.string.escapeHTML,d=a.webim.ui.uiEvent,e=a.core.evt.addEvent,f=a.core.dom.sizzle,g=a.core.arr.foreach,h=a.core.evt.addEvent,i=a.core.str.trim,j=a.core.dom,k=a.webim.utils.date,l=b("#L{来评论两句...}"),m=a.core.util.templet,n=a.core.dom.position,o=a.core.io.jsonp,p=a.core.obj.isEmpty,q=500,r=/[\r\n]/gi,s=/(\@)([A-Za-z0-9\u4e00-\u9fa5_-]+)/g,t=/[a-zA-z]+:\/\/[^\s]*/g,u=/#(\S+)?#/g,v=/\\?\[([^\[\]]+)\]/g;var w=b("#L{秒前}");var x=b("#L{分钟前}");var y=b("#L{昨天}");var z=b("#L{今天}");var A=b("#L{年}");var B=b("#L{月}");var C=b("#L{日}");var D=b(['<div class="W_layer" node-type="wbim_lastWeibo_root" style="display:none;z-index:8888; ">','<div class="bg">','<table cellspacing="0" cellpadding="0" border="0">',"<tbody>","<tr>",'<td><div class="content">','<div class="WBIM_layer_detail">','<div class="WB_webim WBIM_last_feed" node-type="webim_lastweibo_hasweibo" style="display:none;">','<div class="WBIM_feed_wrap feed_small_show" node-type="wbim_lastWeibo_wrap">','<div node-type="wbim_lastWeibo_feedArea" style="_zoom:1;">','<div class="WBIM_feed_box" style="overflow:hidden;">','<div class="WBIM_feed_list clearfix">','<div class="webim_feed_pic" node-type="wbim_lastWeibo_avatar" suda-uatrack="key=tblog_webim_behavior5&value=float_layer_iconver"></div>','<div class="webim_head_txt">','<p class="webim_feed_name" node-type="wbim_lastWeibo_name" suda-uatrack="key=tblog_webim_behavior5&value=float_layer_name"></p>','<p class="webim_feed_txt" node-type="wbim_lastWeibo_txt"></p>',"</div>","</div>",'<div class="WBIM_feed_main  clearfix">','<div class="feed_expand" node-type="wbim_lastWeibo_imgArea">','<div class="small_pic">','<div class="pic_list"><a class="bigcursor" href="javascript:void(0);" onclick="return false;"><img alt=""></a></div>',"</div>",'<div class="big_pic">','<div class="pic_action" node-type="wbim_lastweibo_picaction"><a href="javascript:void(0);" onclick="return false;" node-type="wbim_lastWeibo_fold"><em class="WBIM_icon_foldpic"></em><span class="ac_txt">#L{收起}</span></a><em class="W_vline">|</em><a href="javascript:;" target="_blank" node-type="wbim_lastWeibo_preview"><em class="WBIM_icon_showbig"></em><span class="ac_txt">#L{查看大图}</span></a></div>','<div class="bigpic_box" style="text-align:center;"><a class="smallcursor" href="javascript:void(0);" onclick="return false;"><img alt="" style="width:auto;" /></a></div></div>',"</div>",'<div class="webim_feed_more" style="overflow:hidden;">','<p class="feed_date"><a href="javascript:;" target="_blank" node-type="wbim_lastWeibo_time" suda-uatrack="key=tblog_webim_behavior5&value=date"></a></p>','<p class="feed_oth" style="white-space:nowrap;"><span class="feed_re" suda-uatrack="key=tblog_webim_behavior5&value=tran"><a node-type="lastweibo_repost_url" target="_blank" class="re_txt" href="javascript:;">#L{转发}<em class="re_num">(<span node-type="lastweibo_repost_count"></span>)</em></a></span><span class="feed_com" suda-uatrack="key=tblog_webim_behavior5&value=comm"><a node-type="lastweibo_comment_url" target="_blank" class="com_txt" href="javascript:;">#L{评论}<em class="com_num">(<span node-type="lastweibo_comment_count"></span>)</em></a></span></p>',"</div>","</div>","</div>",'<div class="WBIM_comment_list" style="display:none;" node-type="wbim_lastWeibo_contentArea">','<ul class="comment_list">',"</ul>","</div>","</div>",'<div class="webim_comment_wrap">','<div class="webim_comment_box">','<div class="comment_state_box">','<div class="comment_input">','<textarea style="overflow-y:auto;" class="comment_area" node-type="wbim_lastWeibo_input">$L{来评论两句...}</textarea>',"</div>",'<div style="display:none;" class="comment_state" node-type="wbim_lastWeibo_errmsg">','<p class="state_tip"><span class="tip_icon icon_delS"></span><span class="state_txt">#L{无法进行指定操作,您可以}<a href="javascript:;">#L{查看规定}</a>#L{或}<a href="javascript:;">#L{联系客服}</a></span></p>',"</div>","</div>",'<div class="comment_btn_box clearfix" style="display:none;" node-type="wbim_lastWeibo_action">','<p class="comment_kind"><a class="WBIM_icon_com icon_sw_face" href="javascript:void(0);" onclick="return false;" node-type="wbim_lastWeibo_phiz">#L{表情}</a></p>','<p class="comment_btn"><a class="WBIM_btn_a" href="javascript:void(0);" onclick="return false;" node-type="wbim_lastWeibo_submit" suda-uatrack="key=tblog_webim_behavior5&value=comm_button"><span>#L{评论}</span></a></p>',"</div>","</div>","</div>","</div>","</div>",'<div class="WB_webim WBIM_last_feed" style="display:;" node-type="webim_lastweibo_noweibo">',"</div>","</div>","</div></td>","</tr>","</tbody>","</table>",'<div node-type="webim_lastweibo_arr" class="arrow arrow_r"></div>',"</div>","</div>"].join("")),E=['<li class="clearfix">','<div class="webim_feed_pic"><a href="#{profileUrl}" target="_blank"><img alt="" src="#{profileImg}" width="30" height="30" /></a></div>','<div class="webim_head_txt">','<p class="webim_feed_txt"><span class="webim_feed_name">#{profileName}</span>#{content}<span class="comment_time">(5秒前)</span></p>',"</div>","</li>"].join(""),F="https://api.weibo.com/2/statuses/user_timeline.json?source=209678993&uid=UID&count=10&feature=1",G="https://api.weibo.com/2/statuses/querymid.json?source=209678993&id=MID&type=1",H=b('<div class="nofeed"><p class="nofeed_txt">NICK #L{还没有原创微博，}<br>#L{你可以去}<a target="_blank" href="http://weibo.com/UID">NICK#L{的微博主页}</a>#L{看看}</p></div>'),I=450;var J=function(a,b){var c=document.body||document.documentElement;var d=document.selection.createRange(),e=c.createTextRange(),f=a.value,g=0,h=f.length,i=-1;e.moveToElementText(a);for(g=0;e.compareEndPoints("StartTo"+b,d)<0;g++){e.moveStart("character",1)}for(var j=0;j<=g;j++){if(f.charAt(j)=="\n"){g++}}return g};var K=/\\?\[([^\[\]]+)\]/g;var L='<img width="22" height="22" src="FACE" />';var M=function(){var b=j.builder(D);this.nodes={root:b.list["wbim_lastWeibo_root"][0],avatar:b.list["wbim_lastWeibo_avatar"][0],name:b.list["wbim_lastWeibo_name"][0],txtp:b.list["wbim_lastWeibo_txt"][0],feedWrap:b.list["wbim_lastWeibo_wrap"][0],imgArea:b.list["wbim_lastWeibo_imgArea"][0],time:b.list["wbim_lastWeibo_time"][0],feedArea:b.list["wbim_lastWeibo_feedArea"][0],input:b.list["wbim_lastWeibo_input"][0],action:b.list["wbim_lastWeibo_action"][0],phiz:b.list["wbim_lastWeibo_phiz"][0],submit:b.list["wbim_lastWeibo_submit"][0],contentArea:b.list["wbim_lastWeibo_contentArea"][0],picPreview:b.list["wbim_lastWeibo_preview"][0],picFold:b.list["wbim_lastWeibo_fold"][0],commentState:b.list["wbim_lastWeibo_errmsg"][0],hasWeibo:b.list["webim_lastweibo_hasweibo"][0],noWeibo:b.list["webim_lastweibo_noweibo"][0],picAction:b.list["wbim_lastweibo_picaction"][0],repostCount:b.list["lastweibo_repost_count"][0],repostUrl:b.list["lastweibo_repost_url"][0],commentCount:b.list["lastweibo_comment_count"][0],commentUrl:b.list["lastweibo_comment_url"][0],arr:b.list["webim_lastweibo_arr"][0]};this.nodes.bigImgArea=f(".big_pic",this.nodes.imgArea)[0];this.nodes.smallImgArea=f(".small_pic",this.nodes.imgArea)[0];this.nodes.bigImg=f("img",this.nodes.bigImgArea)[0];this.nodes.smallImg=f("img",this.nodes.smallImgArea)[0];this.nodes.submitSpan=f("span",this.nodes.submit)[0];this.nodes.contentList=f("ul",this.nodes.contentArea)[0];this.timer;this.spec;this.type;this.commentProfile;this.seq="lastWeibo";this.locked=false;this._bindDataEvents();this._bindDomEvents();this._bindUiEvents();this.commentSwap={};this.scroll=new a.webim.ui.scroll(this.nodes.feedArea)};M.prototype={render:function(a){this.pNode=a;a.appendChild(this.nodes.root)},getRoot:function(){return this.nodes.root},show:function(a,b){this.nodes.root.style.display="";this.setPosition("small",b);this.openFlag=true;d.fire("ui.minPanel.opacity")},hide:function(a){if(a){this.nodes.root.style.display="none";return}var b=this;this.timer&&clearTimeout(this.timer);if(b.locked)return;this.timer=setTimeout(function(){if(b.locked)return;b.nodes.root.style.display="none";b.timer=null;b.openFlag=false;d.fire("ui.minPanel.opacity")},500)},clearTimer:function(){this.timer&&clearTimeout(this.timer)},clearGetWeiboTimer:function(){this.timer&&clearTimeout(this.timer);this.timer=null},getWeibo:function(a){if(this.locked)return;var b=a.data.uid;this.spec=a;if(this.lastShowUid==b){this.switchImg("small");this.show(a);return}var c=this;this.timer&&clearTimeout(this.timer);this.timer=setTimeout(function(){c.spec=a;o({url:F.replace(/UID/,b),onComplete:function(e){c.reset();c.lastShowUid=b;if(e&&e.data&&e.data.statuses&&e.data.statuses[0]&&e.data.statuses[0].id&&e.data.statuses[0].user&&e.data.statuses[0].user.id){c.nodes.hasWeibo.style.display="";c.nodes.noWeibo.style.display="none";c.initContent(e.data.statuses[0]);c.initShorturl(e.data.statuses[0].id,b);c.lastShowUid=b;c.weiboId=e.data.statuses[0].id+""}else{c.nodes.hasWeibo.style.display="none";c.nodes.noWeibo.style.display="";c.nodes.noWeibo.innerHTML=H.replace(/UID/g,b).replace(/NICK/g,d.value("data.user",{uid:b+""}).user.nick||b)}c.timer&&c.show(a,true);c.timer=null}})},200)},initContent:function(b){var d=this;this.nodes.avatar.innerHTML='<a href="http://weibo.com/u/'+b.user.id+'" target="_blank"><img width="30" height="30" alt="" src="'+b.user.profile_image_url+'"></a>';var e=a.webim.utils.Core.cutString(b.user.name,20);this.nodes.name.innerHTML='<a  target="_blank" href="http://weibo.com/u/'+b.user.id+'">'+c(e)+"</a>";var f=this.formatWeibo(c(b.text));a.process.parseFace(f).done(function(a){f=f.replace(K,function(b,c){if(b.charAt(0)=="\\"){return b.slice(1)}return L.replace("FACE",a[b])});d.nodes.txtp.innerHTML=f});if(b.thumbnail_pic){this.nodes.bigImg.src=b.bmiddle_pic;this.nodes.smallImg.src=b.thumbnail_pic;this.nodes.picPreview.href=b.original_pic;this.nodes.imgArea.style.display=""}else{this.nodes.imgArea.style.display="none"}this.nodes.time.innerHTML=k.getWeiboTime(b.created_at).replace("秒前",w).replace("分钟前",x).replace("昨天",y).replace("今天",z).replace("年",A).replace("月",B).replace("日",C);this.nodes.repostCount.innerHTML=b.reposts_count;this.nodes.commentCount.innerHTML=b.comments_count},initShorturl:function(a,b){var c=this;o({url:G.replace(/MID/,a),onComplete:function(a){c.nodes.time.href="http://weibo.com/"+b+"/"+a.data.mid;c.nodes.repostUrl.href="http://weibo.com/"+b+"/"+a.data.mid+"?type=repost";c.nodes.commentUrl.href="http://weibo.com/"+b+"/"+a.data.mid}})},formatWeibo:function(a){var b=a.match(s);var c=a.match(t);var d=a.match(u);var e=a.match(v);if(c){a=a.replace(new RegExp("(http://t.cn/[A-Za-z0-9]{5,8})","gi"),function(a){return'<a href="link2" target="_blank" suda-uatrack="key=tblog_webim_behavior5&value=content_link" >link2</a>'.replace(/link2/g,a)})}if(b){a=a.replace(new RegExp("(@)([A-Za-z0-9一-龥_-]+)","gi"),function(a){return'<a href="http://weibo.com/n/link2" target="_blank" suda-uatrack="key=tblog_webim_behavior5&value=content_link">link2</a>'.replace(/link2/g,a).replace("@","")})}if(d){a=a.replace(u,function(a){return'<a href="http://huati.weibo.com/k/link" target="_blank">link</a>'.replace(/link/g,a).replace("#","").replace("#","")})}return a},switchImg:function(a){this.imageType=a;this.nodes.smallImgArea.style.display=a=="big"?"none":"block";this.nodes.bigImgArea.style.display=a=="big"?"block":"none";this.nodes.feedWrap.className="WBIM_feed_wrap feed_"+a+"_show"},setPosition:function(a,b){this.setFeedHeight(a,b);var a=a||this.type;this.type=a;var c=a=="small"?330:470;var d=this.spec.el;var e=this.nodes.root;e.style.top="";e.style.bottom="";var f=n(d,{parent:this.pNode});e.style.left=f.l-c-10+"px";var g=e.clientHeight;if(f.t+e.clientHeight+32>this.pNode.offsetHeight){e.style.bottom="32px"}else{e.style.top=f.t+"px"}try{var h=n(d).t-n(e).t+14||2;if(h<2)h=2;if(h>e.clientHeight-15)h=e.clientHeight-15;this.nodes.arr.style.top=h+"px"}catch(i){}},setFeedHeight:function(a,b){var c=this.nodes.feedArea;c.style.height="auto";c.style.overflow="visible";this.scroll.hide();if(a=="big"){c.style.height=c.clientHeight+20+"px";if(c.offsetHeight>I){c.style.height=I+"px";c.style.overflow="hidden"}}this.scroll.init()},reset:function(){this.switchImg("small");this.nodes.smallImg.removeAttribute("src");this.nodes.imgArea.style.display="none";this.nodes.action.style.display="none";this.nodes.contentList.innerHTML="";this.nodes.contentArea.style.display="none";this.nodes.commentState.style.display="none";var a=this.nodes.feedArea;a.style.height="";a.style.overflowX="visible";this.nodes.input.value=l;this.nodes.input.blur()},_bindUiEvents:function(){var b=this;d.add("ui.phiz.select",function(a,c){if(c.seq==b.seq){var d=b._cursorPos||{start:0,end:0},e=b.nodes.input.value,f=c?c.txt||"":"";e=e.substr(0,d.start)+f+e.substr(d.end);b._cursorPos=b._cursorPos||{start:0,end:0};b._cursorPos.end=d.start+f.length;b._cursorPos.start=b._cursorPos.end;b.nodes.input.value=e;b._setFocus();b.locked=false}});d.add("ui.phiz.hide",function(a,c){b.locked=false});var c;d.add("ui.weibo.show",function(e,f){var g=f.spec;b.clearTimer();c&&clearTimeout(c);c=setTimeout(function(){d.fire("ui.weibo.realShow");b.render(a.E("WB_webim"));b.getWeibo(g);c=null},500)});d.add("ui.weibo.hide",function(){c&&clearTimeout(c);b.hide()});d.after("ui.user.click",function(){c&&clearTimeout(c);b.clearGetWeiboTimer();b.hide(true)})},_bindDataEvents:function(){var a=this;d.add("manager.comment",function(b,c){a.showComment(c)});d.calc("ui.minPanel.opacityValue",function(){return{laseWeibo:a.openFlag}})},_bindDomEvents:function(){var b=this;var f=b.nodes.input;g(["keyup","paste","keydown","mouseup","cut","mouseup","focus"],function(a,c){h(f,a,function(){clearTimeout(b._checkTimer);b._checkTimer=setTimeout(function(){b._checkInput()},700)})});e(this.nodes.smallImg,"click",function(){d.fire("ui.weibo.imgLarge");b.switchImg("big");b.setPosition("big")});e(this.nodes.picFold,"click",function(){b.switchImg("small");b.setPosition("small")});e(this.nodes.bigImg,"click",function(){b.switchImg("small");b.setPosition("small")});e(this.nodes.input,"focus",function(){if(b.nodes.input.value.replace(/^\s*|\s*$/,"")==l){b.nodes.input.value=""}b.nodes.action.style.display="";if(!b.profileImg){o({url:"https://api.weibo.com/2/users/show.json?source=209678993&uid="+a.webim.$currentUID,onComplete:function(a){b.profileImg=c(a.data.profile_image_url);b.commentProfile={profileImg:c(a.data.profile_image_url),profileName:a.data.name+"：",profileUrl:c(a.data.url)}}})}});e(this.nodes.root,"mouseover",function(){b.timer&&clearTimeout(b.timer)});e(this.nodes.root,"mouseout",function(){b.timer&&clearTimeout(b.timer);b.hide()});e(this.nodes.root,"click",function(a){var c=b.nodes;var a=a||window.event;var d=a.srcElement||a.target;if(d!=c.input&&d!=c.phiz&&d!=c.submit&&d!=c.submitSpan&&c.input.value.replace(/^\s*|\s*$/,"")==""){c.input.value=l;c.action.style.display="none"}});e(this.nodes.bigImg,"load",function(){b.setPosition()});e(this.nodes.smallImg,"load",function(){b.setPosition()});e(this.nodes.submit,"click",function(a){var d=b.nodes.input.value.replace(/^\s*|\s*$/g,"");if(d.length<1||d==l){return}b.sendComment(c(d))});e(this.nodes.phiz,"click",function(){d.fire("ui.phiz.show",{seq:b.seq,dom:b.nodes.phiz});b.nodes.input.focus();b.locked=true});a.webim.uix.bodyClickManager.clickOthers(b.nodes["root"],function(){b.locked=false;b.hide()});a.webim.uix.bodyClickManager.clickOthers([b.getRoot()],function(c){var d=c.target;var e=a.webim.phiz;var f=e&&e.getRoot();if(f&&!a.contains(f,d)&&f!==d){b.clearGetWeiboTimer();b.hide(true)}})},_checkInput:function(){this._cutContentForTooMuch();this._checkTimer=null;this._saveCursorPos()},_cutContentForTooMuch:function(){var a=i(this.nodes.input.value);if(a.length>q){this.nodes.input.value=a.substr(0,q)}},_saveCursorPos:function(){var a=0,b=0,c=this.nodes.input;if(c){if(typeof c.selectionStart=="number"){a=c.selectionStart;b=c.selectionEnd}else if(document.selection){a=J(c,"Start");b=J(c,"End")}}this._cursorPos={start:a,end:b,scrollTop:c.scrollTop}},_setFocus:function(){var a=this.nodes.input;var b=0;var c=0;if(this._cursorPos){b=this._cursorPos.end||0;c=this._cursorPos.scrollTop||0}try{if(typeof a.selectionStart=="number"){this.nodes.input.focus();a.selectionStart=a.selectionEnd=b}else if(document.selection){var d=a.createTextRange();var e=a.value;d.collapse(true);b=e.substr(0,b).replace(/[\n]/gi,"").length;d.moveStart("character",b);d.select()}}catch(f){}a.scrollTop=c},sendComment:function(b){var c=this;var d="a"+(new Date).getTime();this.commentSwap[d]=b;var e=a.webim.utils.Core.getCurrentUIDByCookie();(function(d){a.api.comment(c.weiboId,b).done(function(a){a.commentId=d;c.showComment(a)})})(d)},showComment:function(b){var d=this;if(!b.success){this.nodes.commentState.style.display="";setTimeout(function(){d.nodes.commentState.style.display="none"},2e3);return}this.commentProfile.content=c(this.commentSwap[b.commentId]);a.process.parseFace(this.commentProfile.content).done(function(a){j.insertHTML(d.nodes.contentList,m(E,d.commentProfile).replace(v,function(b,c){if(b.charAt(0)=="\\"){return b.slice(1)}return L.replace("FACE",a[b])}))});this.nodes.contentArea.style.display="";this.nodes.input.value=l;this.nodes.action.style.display="none";delete this.commentSwap[b.commentId];var e=parseInt(this.nodes.commentCount.innerHTML);this.nodes.commentCount.innerHTML=++e;this.setPosition()}};return M});
$WBIM.register("webim.ui.phiz",function(a){var b=$WBIM.language;var c=a.core.dom.builder;var d=["<!-- 表情 -->",'<div class="W_layer W_layer_pop" style=" bottom:72px;left:115px;" node-type="_root">','    <div class="content">','        <div class="W_layer_close" node-type="wbim_icon_close"><a href="javascript:void(0);" onclick="return false;" class="W_ficon ficon_close S_ficon">X</a></div>',"        <!--自定义区域-->",'        <div class="layer_faces" node-type="_phizDisPanel">',"            <!--tab-->",'            <div class="WB_minitab">','                <ul class="minitb_ul S_line1 S_bg1 clearfix" node-type="_phizCategorys">','                    <li class="minitb_item current S_line1"> <a href="#1" class="minitb_lk S_txt1 S_bg2">默认</a><span class="cur_block"></span></li>','                    <li class="minitb_item S_line1"> <a href="javascript:void(0);" onclick="return false;" class="minitb_lk S_txt1">浪小花</a><span class="cur_block"></span></li>','                    <li class="minitb_item S_line1"> <a href="javascript:void(0);" onclick="return false;" class="minitb_lk S_txt1">暴走漫画暴走漫漫</a><span class="cur_block"></span></li>','                    <li class="minitb_item S_line1"> <a href="javascript:void(0);" onclick="return false;" class="minitb_lk S_txt1">小恐龙</a><span class="cur_block"></span></li>','                    <li class="minitb_item S_line1"> <a href="javascript:void(0);" onclick="return false;" class="minitb_lk S_txt1">冷兔</a><span class="cur_block"></span></li>',"                </ul>","                <!--翻页按钮-->",'                <ul class="W_fr minitb_ul S_line1 S_bg1 clearfix" node-type="_categoryRoot">','                    <li class="minitb_more S_line1"> <a href="javascript:void(0);" onclick="return false;" class="minitb_lk S_txt1 W_btn_b_disable" node-type="_btnCatePrev"><i class="W_ficon ficon_arrow_left_lite S_ficon">j</i></a></li>','                    <li class="minitb_more S_line1"> <a href="javascript:void(0);" onclick="return false;" class="minitb_lk S_txt1" node-type="_btnCateNext"><i class="W_ficon ficon_arrow_right_lite S_ficon">i</i></a></li>',"                </ul>",'                <!--<li class="minitb_more S_line1"> <a href="#1" class="minitb_lk S_txt1"><i class="W_ficon ficon_arrow_left_lite S_ficon">j</i></a></li>','                <li class="minitb_more S_line1"> <a href="#1" class="minitb_lk S_txt1 W_btn_b_disable"><i class="W_ficon ficon_arrow_right_lite S_ficon">i</i></a></li>-->',"            </div>","            <!--/tab-->","            <!--list-->",'            <div class="faces_list_box" node-type="_phizDetlPanel">',"                <!--滚动条组件-->",'                <div class="faces_list UI_scrollView " node-type="scrollView" style="overflow:hidden; width: 387px;"><!--模块最外层，需要设置定位和高度值-->','                    <div class="UI_scrollContainer" style="width: 390px;">','                        <div class="UI_scrollContent" node-type="">',"                            <!--这里放需要滚动的模块-->",'                            <ul node-type="_phizListNode">',"                            </ul>","                        </div>","                    </div>","                </div>","                <!--/滚动条组件-->","            </div>","            <!--/list-->","        </div>","        <!--/自定义区域 箭头方向-->",'        <div class="W_layer_arrow"><span class="W_arrow_bor W_arrow_bor_b"  node-type="_arrB" style="left: 378px"><i class="S_line3"></i><em class="S_bg2_br"></em></span></div>',"    </div>","</div>"].join("");var e=a.core.dom,f=a.webim.ui.uiEvent,g=a.core.evt.addEvent,h=a.core.evt.delegatedEvent,i=a.core.util.templet,j=e.removeClassName,k=a.core.evt.stopEvent,l=e.addClassName,m=e.hasClassName,n=e.insertElement,o=a.core.arr.foreach,p=a.core.io.jsonp,q=/[\[\]]/gi,r="http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/",s="http://api.weibo.com/2/emotions.json?source=209678993",t=/\\?\[([^\[\]]+)\]/g,u="wbim_phiz",v="S_txt1 S_bg3",w="minitb_lk S_txt1",x="minitb_lk S_txt1 W_btn_b_disable",y='<li class="minitb_item S_line1"><a href="javascript:void(0);" onclick="return false;" class="minitb_lk S_txt1" action-type="category" action-data="category=#{cate}&index=#{index}">#{category}</a><span class="cur_block"></span></li>',z='<li class="minitb_item current S_line1"><a href="javascript:void(0);" onclick="return false;" class="minitb_lk S_txt1 S_bg2" action-type="category" action-data="category=#{category}&index=#{index}">#{category}</a><span class="cur_block"></span></li>',A='<a href="javascript:void(0);" onclick="return false;" class="page S_bg1" action-type="pageIndex" action-data="index=#{index}&cate=#{cate}">#{index}</a>',B='<li action-type="webim_phiz_face" action-data="text=#{value}" title="#{phrase}"><img src="#{url}"/></li>';var C=a.core.dom.sizzle;var D=function(){a.webim.ui.panelManager.setPhiz(this);var b=c(d).list;for(var e in b){var f=b[e];this[e]=f.length>1?f:f[0]}this._visible=false;this.phizLength=0;this.scroll=new a.webim.ui.scroll(this.scrollView);this.category=[];this.categoryLI=[];this.panelIndex=0;this.currentIndex=0;this.phizData={};this.seq;this.clientH;this.upflag=true;this._phizFlg=false;this.bindDomEvent();this.bindUiEvents();this.getPhizData();d=null};D.prototype={getRoot:function(){return this._root},render:function(a){e.insertElement(a,this._root);this.render=null},getPhizData:function(){var b=this;a.process.getFace().done(function(a){b.phizData=a;b.phizLength=a.length;b.phizData[0]["category"]="默认";b._phizFlg=true})},setPosition:function(a){this.clientH=this._root.clientHeight;this.clientW=this._root.clientWidth;var b=e.position(a,{parent:this.projBox});var c=10-b.t;this._root.style.left=30+b.l-this.clientW+"px";if(-b.t-390>0){c=b.t-0+40;this._arrB.style.display="none";this._root.style.bottom=null;this._root.style.top=c+"px";this.upflag&&n(this._phizDisPanel,this._categoryRoot,"beforebegin");this.upflag=false}else{this._arrB.style.display="";this._root.style.top=null;this._root.style.bottom=c+3+"px";!this.upflag&&n(this._phizDisPanel,this._categoryRoot);this.upflag=true}},bindUiEvents:function(){var a=this;f.add("ui.beforeHideChatWindow",function(b,c){a._visible&&a.hide()});f.add("ui.phiz.show",function(b,c){!a.projBox&&(a.projBox=C("#WB_webim")[0]);if(a._phizFlg){if(a.param&&c.seq==a.param.seq&&a._visible){a.hide()}else{a.render!=null&&a.render(a.projBox);a._initEmotions(a.phizData);a.show();a.param=c;a.setPosition(c.dom)}}else{a.render!=null&&a.render(a.projBox);a.show();a.param=c;a.setPosition(c.dom);a.getPhizData()}})},bindDomEvent:function(){var b=this;g(b.wbim_icon_close,"click",function(a){b.hide();k()});g(b._categoryRoot,"click",function(a){var a=a||window.event;var c=a.target||a.srcElement;if(b._btnCatePrev==c||e.contains(b._btnCatePrev,c)){b.pagePrev();b.changeStyle()}else if(b._btnCateNext==c||e.contains(b._btnCateNext,c)){b.pageNext();b.changeStyle()}k()});h(b._phizDetlPanel).add("webim_phiz_face","click",function(a){f.fire("ui.phiz.select",{seq:b.param.seq,txt:a.el.title});b.hide();k()});h(b._phizCategorys).add("category","click",function(a,c){var d=a.data;var e=d["index"];if(d["index"]==b.currentIndex){return}if(b.categoryLI[b.currentIndex%5]!=undefined){b.categoryLI[b.currentIndex%5].className="minitb_item S_line1";b.categoryLI[b.currentIndex%5].childNodes[0].className="minitb_lk S_txt1"}a.el.parentNode.className="minitb_item current S_line1";a.el.className="minitb_lk S_txt1 S_bg2";b.currentIndex=d["index"];b.rendEmotion(b.currentIndex);b.scroll.init();k(c)});g(document.body||document.documentElement,"click",function(c){if(b._visible){var d=c.srcElement||c.target;!a.core.dom.contains(b._root,d)&&b.param.dom!=d&&b.hide()}})},_initEmotions:function(a){var b=this;var c=[],d=[],e={};var f=this.phizData;for(var g=0;g<5;g++){var h=f[g];if(g==0){d.push(i(z,{category:h["category"],index:g}))}else{d.push(i(y,{category:h["category"],index:g}))}}this._phizCategorys.innerHTML=d.join("");this.categoryLI=this._phizCategorys.childNodes;l(this.categoryLI[0].childNodes[0],v);var j=f["0"];this.panelIndex=5;o(j.items,function(a,b){if(a["hot"]){return}c.push(i(B,a))});this.currentIndex=0;this._phizListNode.innerHTML=c.join("");this._btnCatePrev.className=x},rendEmotion:function(a){var b=this.phizData[a];var c=[];var d=b["items"];o(d,function(a){c.push(i(B,a))});this._phizListNode.innerHTML=c.join("");this.categoryLI=this._phizCategorys.childNodes;this.show()},changeStyle:function(){switch(true){case this.panelIndex==5:this._btnCatePrev.className=x;break;case this.panelIndex>=this.phizLength:this._btnCateNext.className=x;break;default:this._btnCatePrev.className=w;this._btnCateNext.className=w}},rendCategory:function(){var a=this.panelIndex,b=[],c;var d=a>this.phizLength?this.phizLength:a;for(var e=a-5;e<d;e++){var c=this.phizData[e]&&this.phizData[e]["category"];if(!c){return}if(e==this.currentIndex){b.push(i(z,{category:c,index:e}))}else{b.push(i(y,{category:c,index:e}))}}this._phizCategorys.innerHTML=b.join("")},pagePrev:function(){if(this.panelIndex==5){return}this.panelIndex-=5;this.rendCategory()},pageNext:function(){if(this.panelIndex>=this.phizData.length){return}this.panelIndex+=5;this.rendCategory()},show:function(){e.setStyle(this._root,"display","block");this._visible=true},hide:function(){e.setStyle(this._root,"display","none");this._btnCateNext.className=w;f.fire("ui.phiz.hide");this.currentIndex=0;this.panelIndex=0;this._visible=false}};return D});
$WBIM.register("webim.ui.chatWindow.message.base",function(a){function o(a){if(typeof a!=="string"){return a}return a.replace(/\</g,"&lt;").replace(/\>/g,"&gt;").replace(/\n/g,"<br>").replace(/\u00A0/g,"&nbsp;").replace(/(\u0020|\u000B|\u2028|\u2029|\f)/g,"&#32;")}var b=a.webim.base.Class;var c=a.core.util.templet,d=a.core.str.leftB,e=a.core.str.encodeHTML,f=a.core.json.clone,g=a.webim.utils.date,h=a.webim.utils.extend,i=$WBIM.language;var j="dia_info_icon WBIM_icon_groupMin";var k="icon_warnS";var l="bubble_card_box";var m="http://tp#{IMGSERV}.sinaimg.cn/#{uid}/30/#{avatar}/#{sex}";var n="http://weibo.com/u/";var p=["<!-- 单行文字-左 -->",'<div class="msg_bubble_list #{type} " node-type="msgRoot" mid=#{mid} time=#{time} style="display: #{hide}">','    <div class="bubble_mod clearfix">','        <div class="bubble_user">','            <a href="#{headImg}" target="_blank" class="face default_face"><img _src="#{avatarurl}" width="30" height="30" node-type="userHead"></a>',"        </div>",'        <p class="bubble_name W_autocut" node-type="userName" style="height: 15px;display:#{nameDisplay}" href="#{headImg}" target="_blank">#{usernick}</p>','        <p class="bubble_prompt" style="display:#{bubble_dis};"></p>','        <div class="bubble_box SW_fun #{cardCss}">','            <div class="bubble_cont #{affclass}" >','                <div class="bubble_arrow">','                    <div class="W_arrow_bor #{arrowType}"><i></i><em></em></div>',"                </div>",'                <div class="bubble_main clearfix" node-type="conRoot">',"                </div>","            </div>",'            <div class="space"></div>',"        </div>","    </div>","</div>"].join("");var q={USER:'<span class="info_date">#{time}</span>'};var r={ME:" bubble_r",OTHER:"bubble_l"};var s={ME:" W_arrow_bor_r",OTHER:"W_arrow_bor_l"};var t={USER:"USER",GROUP:"GROUP"};var u={ME:"ME",OTHER:"OTHER"};var v={type:t.USER,source:u.ME,uid:"",gid:"",fuid:"",isSend:"",time:"",nick:"",card:"",media_type:"",userinfo_headimg:""};var w=a.webim.utils.Core.getCurrentUIDByCookie();var x=b.create({initialize:function(a){this.hasCard=false;if(a.card||a.page||a.profile||a.weibo){this.hasCard=true}h(this,h(f(v),a));this.formatParam(a);this.buildDom()},formatParam:function(a){this.type=t.USER;this.source=a.isSend?u.ME:a.uid==w||a.fuid==w?u.ME:u.OTHER;this.nameDisplay=this.source==u.ME||!a.gid?"none":"block";this.userinfo_headimg=a.userinfo_headimg},buildDom:function(){var b=this;this.uid=this.isSend?w:this.uid||this.fuid;var f=c(p,{time:this.time||"",mid:this.mid||"",type:r[this.source],arrowType:s[this.source],nameDisplay:this.nameDisplay,cardCss:this.hasCard?l:"",info:q[this.type],headImg:n+(this.fromuserid||this.uid||this.from_uid),hide:this.hide?"none":"block",bubble_dis:this.hide?"block":"none",avatarurl:this.userinfo_headimg,usernick:this.userinfo_name,affclass:a.webim.utils.data.get(b.gid)?a.webim.utils.data.get(b.gid).join(",").indexOf(b.fuid)>-1?"bubble_star_cont":"":""});var h={uid:this.uid,time:g.format(this.time||this.create_at||+(new Date)),role:this.role,nick:this.nick,short_nick:d(e(this.nick||""),12)};var j=c(i(f),h);var k=a.core.dom.builder(j);this.msgRoot=k.list["msgRoot"][0];this.conRoot=k.list["conRoot"][0];this.userHead=k.list["userHead"][0];this.userName=k.list["userName"][0];!this.lazy&&!this.userinfo_headimg&&this.lazyLoadUser(this.uid);b.userinfo_headimg&&b.userHead.setAttribute("src",b.userinfo_headimg)},lazyLoadUser:function(b){var d=this;a.api.getUser(b).done(function(a){a.IMGSERV=a.uid%4+1;var b=c(m,a);d.userHead.setAttribute("src",b);d.userName.innerHTML=o(a.nick||"")})},getContent:function(){return""}});return x});
$WBIM.register("webim.ui.chatWindow.message.text",function(a){function j(a,b){if(typeof a!=="string"){return a}if(b){a=a.replace(/\&/g,"&amp;")}return a.replace(/\</g,"&lt;").replace(/\>/g,"&gt;").replace(/\n/g,"<br>").replace(/\s/g,"&nbsp;")}function i(a,b){function c(a){if(!a){return 0}var b=a.match(/[^\x00-\xff]/g);return a.length+(!b?0:b.length)}var d=a.replace(/\*/g," ").replace(/[^\x00-\xff]/g,"**");a=a.slice(0,d.slice(0,b).replace(/\*\*/g," ").replace(/\*/g,"").length);if(c(a)>b&&b>0){a=a.slice(0,a.length-1)}return a}var b=a.webim.base.Class,c=a.webim.ui.chatWindow.message.base;var d=a.core.dom.builder;var e=a.core.util.templet;var f='<div class="cont"><p class="page">#{text}</p></div>';var g=['<div class="cont">','    <p class="page">#{text}</p>',"</div>",'<div class="more_text">','    <a href="javascript:void(0);" action-type="longMessage.More" action-data="mid=#{mid}&gid=#{gid}" class="S_txt2">更多<em class="W_ficon ficon_arrow_down_lite S_ficon">g</em></a>',"</div>"].join("");var h=a.core.str.trim;var k=a.webim.ui.base.formatContent.parseAll;var l=b.create(c,{initialize:function(a){this.base.initialize(a)},getContent:function(){var a;if(this.gid){if(this.getCharacterLength(this.msg||"")>250||this.is_large){a=g;this.msg=i(this.msg,500)+" ..."}else{a=f}this.msg=j(this.msg)}else if(this.uid){if(this.getCharacterLength(this.msg||"")>250){a=g;this.msg+=" ..."}else{a=f}this.msg=j(this.msg)}var b=e(a,{text:this.parseMsg(this),mid:this.mid,gid:this.gid});var c=d(b).box;this.conRoot.appendChild(c);return this.msgRoot},parseMsg:function(a){return k(a)},getCharacterLength:function(a){return Math.ceil(h(a).replace(/[^\x00-\xff]/g,"aa").length/2)}});return l});
$WBIM.register("webim.ui.chatWindow.message.audio",function(a){var b=a.webim.base.Class;var c=$WBIM.language;var d=a.core.util.templet;var e=a.webim.utils.extend;var f="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif";var g=c(['<div class="private_player_mod">','    <i class="audio_private_player">','        <em id="audio_#{fid}"> ','            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10" width="100%" height="100%">','                <param name="movie" value="http://js.t.sinajs.cn/t4/webim/swf/audioplay.swf">','                <param name="quality" value="high">','                <param name="wmode" value="transparent">','                <param name="flashvars" value="source=http://amraudio.im.weibo.com/amrdata/1586986151">','                <embed quality="high" width="100%" height="100%" flashvars="source=http://amraudio.im.weibo.com/amrdata/1586986151" wmode="transparent" bgcolor="#FFFFFF" allowscriptaccess="always" allowfullscreen="true" scale="noScale" menu="false" type="application/x-shockwave-flash" src="http://js.t.sinajs.cn/t4/webim/swf/audioplay.swf" id="Mp3Player1586986151" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">',"            </object>","        </em>","    </i>",'    <a href="http://upload.api.weibo.com/2/mss/msget?source=209678993&amp;fid=#{fid}" class="download">下载</a>',"</div>"].join(""));var h="http://amraudio.im.weibo.com/amrdata/";var i={menu:"false",scale:"noScale",allowFullscreen:"true",allowScriptAccess:"always",bgcolor:"#FFFFFF",wmode:"transparent"};var j=b.create({initialize:function(a){e(this,a)},getContent:function(){return d(g,this)},embedAudio:function(a){var b=window.swfobject;b&&b.embedSWF("http://js.t.sinajs.cn/t5/webim/swf/audioplay.swf","audio_"+a,"100%","100%","9.0.124","http://js.t.sinajs.cn/t5/webim/swf/audioplayexpressInstall.swf",{source:h+a},i,{id:"Mp3Player"+a})}});return j});
$WBIM.register("webim.ui.chatWindow.message.autoMsg",function(a){var b=a.core.util.templet;var c=a.webim.utils.date;var d=a.core.dom.builder;var e=['<div class="webim_dia_box webim_dia_l" node-type="outer">','<div class="webim_dia_bg">','<p class="dia_txt">亲，我只专门算<a href="javascript:void(0);" onclick="return false;" action-type="xingzuoys">今日星座运势</a>，欢迎每天来问我哦。</p>',"</div>","</div>"].join("");var f=a.webim.ui.uiEvent;var g=a.core.evt.delegatedEvent;var h=a.core.evt.stopEvent;var i="http://platform.sina.com.cn/vip_astro/yunshi?app_key=3430331087&constell=#{starSign}&datetype=day";var j="<li><a href='javascript:void(0);' onclick ='return false;' action-type='starSignSelect' action-data='name=#{starSign}'>#{starSign}</a></li>";var k=['<div class="webim_dia_box webim_dia_l" node-type="outer">','<div class="webim_dia_bg">','<div class="dia_con">','<p class="dia_txt">亲，你想了解哪个星座运程呢？可以在下面选择哦。</p>','<div class="star_con">','<ul class="star_list clearfix" suda-uatrack="key=tblog_webim_behavior5&value=constellation_list">#{content}',"</ul>","</div>","</div>",'<div class="msg_arr"></div>',"</div>","</div>"].join("");var l=['<div class="webim_dia_box webim_dia_l">','<div class="webim_dia_bg"><p class="dia_txt">#{constell} #{day_of_info}<br />',"综合运势：#{zonghesign}<br />","爱情：#{aiqingsign}<br />","幸运色：#{yanse}<br />","速配星座：#{supei}<br />",'#{lotconts}<a target="_blank" href="http://t.cn/hxx8L">http://t.cn/hxx8L</a></p>',"</div>","</div>"].join("");var m="2681105267";var n={"白羊座":"aries","金牛座":"taurus","双子座":"gemini","巨蟹座":"cancer","狮子座":"leo","处女座":"virgo","天秤座":"libra","天蝎座":"scorpio","射手座":"sagittarius","摩羯座":"capricorn","水瓶座":"aquarius","双鱼座":"pisces"};var o={selectStarSign:function(b){var c=b.data.name;f.fire("msg.user.send",{msg:c,uid:m});a.stopEvent()},XingZuoYS:function(b){f.fire("msg.user.send",{msg:"今日星座运势",uid:m});a.stopEvent()}};var p={getContent:function(a,f){switch(a.msg){case"今日星座运势":return p.getSelection();break;case"白羊座":case"金牛座":case"双子座":case"巨蟹座":case"狮子座":case"处女座":case"天秤座":case"天蝎座":case"射手座":case"摩羯座":case"水瓶座":case"双鱼座":p.requestYunshi(a.msg);return null;break;default:var h=d(e).list["outer"][0];g(h).add("xingzuoys","click",o["XingZuoYS"]);return h;break}if(!a){return p.getSelection()}var i={time:c.getFormatedCurrentTime()};var j=b(MSG_TPL,i);return d(j).box},getSelection:function(){var a=[];for(var c in n){a.push(b(j,{starSign:c}))}var e=b(k,{content:a.join("")});var f=d(e).list["outer"][0];g(f).add("starSignSelect","click",o["selectStarSign"]);return f},requestYunshi:function(c){var e=b(i,{starSign:n[c]});a.core.io.jsonp({url:e,onComplete:function(a){var c=a.result.data;c.zonghesign="";c.aiqingsign="";for(var e=0;e<c.aiqing;e++){c.aiqingsign+="★"}for(var g=0;g<c.zonghe;g++){c.zonghesign+="★"}var h=b(l,c);var i={uid:m,content:d(h).box};f.fire("ui.receiveXiaoweiMsg",i)}})}};return{getContent:p.getContent}});
$WBIM.register("webim.ui.chatWindow.message.file",function(a){var b=a.webim.base.Class,c=a.webim.utils.extend;var d=$WBIM.language;var e=a.core.util.templet;var f=d(['<div class = "file_box">','<div class="att_sort" title="#L{文件}"><em class="wbim_icon_b_default" >#{icon}</em></div>','<div class="att_info">','<p class="att_name">#{filename}</p>','<p class="att_sizw">#{size}</p>',"</div>",'<p class="dia_line"></p>','<div class="clearfix">',"#{status}","</div></div>"].join(""));var f=d(['<div class="private_file_mod">',"    #{icon}",'    <span class="name" >#{filename} (#{size})</span>',"    #{status}","</div>"].join(""));var g={fid:"",filename:"",size:"",icon:"",status:"",preview:""};var h=b.create({initialize:function(a){c(this,c(g,a))},getContent:function(){return e(f,this)}});return h});
$WBIM.register("webim.ui.chatWindow.message.image",function(a){var b=a.webim.base.Class;var c=$WBIM.language;var d=a.core.util.templet;var e=a.webim.utils.extend;var f="http://img.t.sinajs.cn/t4/appstyle/webim/images/file.gif";var g=c(['<div class="pic_s_mod">','    <div class="pic_box">','        <img title="#L{图片}" alt="#{name}" class="dialogue_img bigcursor" src="http://img.t.sinajs.cn/t6/style/images/common/loading.gif" imgSrc="#{pic}" onerror="this.src=\'#{default_url}\';" action-type="wbim_img_preview" fid="#{fid}" preview="#{preview}" name="#{name}">',"    </div>","</div>"].join(""));var h="&source=209678993";var i=b.create({initialize:function(a){var b={fid:a.fid,name:a.name||a.filename,text:a.text,pic:a.pic||a.thumbnail_120+h,preview:a.preview||a.thumbnail_600+h,default_url:f};e(this,e(b,a))},getContent:function(){return d(c(g),this)}});return i});
$WBIM.register("webim.ui.chatWindow.message.sysMsg",function(a){var b=a.core.util.templet,c=a.core.dom.builder,d=$WBIM.language;var e=a.webim.utils.date;var f=a.core.evt.delegatedEvent;var g=a.webim.ui.uiEvent;var h=a.webim.ui.base.formatContent.parseAll;var i=d("#L{网络已断开}，#L{私信}“#{content}”#L{无法重新发送。}"),j=d('#L{由于网络原因，私信}“#{content}”#L{发送失败}。<a action-type="reSendMsg" action-data="msg=#{content}&uid=#{uid}" href="javascript:void(0);" onclick="return false;" >#L{重新发送}</a>'),k=d("#L{你开启了群聊消息屏蔽功能}"),l=d('#L{已将 NICK 加入黑名单}，<a href="http://account.weibo.com/set/blacklist" target="_blank">#L{查看黑名单}</a>').replace("NICK","#{NICK}"),m=d("#{name}#L{已被请出该群}"),n=d("#{name}#L{退出了该群}"),o=d("#{name}#L{加入了该群}");var p={WARN:" webim_dia_warn",DELE:"webim_dia_del"};var q={OFFLINE:i,SENDFAIL:j,BLOCKGROUP:k,BLOCKSCREATE:l,QUIT:n,KICK:m,JOIN:o};var r={WARN:"icon_warnS",DELE:"icon_delS"};var s=['<div class="webim_dia_box #{type}" node-type="outer">','<div class="dia_info">','<span class="dia_info_user"><em class="dia_info_icon #{info}"></em></span>','<span class="info_date">#{time}</span>',"</div>",'<div class="webim_dia_bg">','<div class="dia_con">#{content}</div>','<div class="msg_arr"></div>',"</div>","</div>"].join("");var t={resendMsg:function(b){g.fire("ui.reSendMsg",b);a.stopEvent()}};var u={getContent:function(a){var d={};var g;if(a.type==="SENDFAIL"||a.type==="OFFLINE"){g="DELE"}else{g="WARN"}d.type=p[g];d.uid=a.uid;d.info=r[g];d.content=b(q[a.type],a);d.time=e.getFormatedCurrentTime();var h=b(s,d);var i=c(h).list["outer"][0];if(a.type=="SENDFAIL"){f(i).add("reSendMsg","click",t["resendMsg"])}return i}};return{getContent:u.getContent}});
$WBIM.register("webim.ui.chatWindow.message.cardExt",function(a){var b=a.webim.base.Class;var c=a.webim.utils.extend;var d=$WBIM.language;var e=a.core.util.templet;var f=a.core.dom.builder;var g=a.core.str.leftB;var h="http://img.t.sinajs.cn/t4/appstyle/V5_webim/images/card_default.gif";var i={profile:d(['<div class="WB_feed_spec S_bg2 S_line1 clearfix">','    <div class="spec_box clearfix">','        <div class="WB_feed_spec_pic S_bg1">','            <a href="#{short_url}" target="_blank"><img src="#{avatar}" ><!--图片的高除以2，图片的宽除以2--></a>',"        </div>",'        <div class="WB_feed_spec_info SW_fun">','            <div class="WB_feed_spec_cont">','                <h4 class="WB_feed_spec_tit W_autocut"><a  href="#{short_url}" target="_blank" suda-uatrack="key=tblog_automatic_reply&value=link_click:u_#{uid}:webim" class="S_func1 W_autocut">#{display_name}</a></h4>','                <div class="WB_feed_spec_brieftxt">','                    <span class="S_txt2">#{summary}</span>',"                </div>",'               <div class="WB_feed_spec_clearfix clearfix S_txt3">','                   <span class="W_fr">','                       <a href="#{short_url}" target="_blank" class="W_btn_a btn_22px">查看详情</a>',"                   </span>","               </div>","            </div>","        </div>","    </div>","</div>"].join("")),weibo:d(['<div class="WB_feed_spec S_bg2 S_line1 clearfix">','    <div class="spec_box clearfix">','        <div class="WB_feed_spec_pic S_bg1">','            <a href="#{short_url}" target="_blank"><img src="#{img_url}" onerror="this.src=\''+h+"'\"><!--图片的高除以2，图片的宽除以2--></a>","        </div>",'        <div class="WB_feed_spec_info SW_fun">','            <div class="WB_feed_spec_cont">','                <h4 class="WB_feed_spec_tit W_autocut"><a href="#{short_url}" target="_blank" suda-uatrack="key=tblog_automatic_reply&value=link_click:u_#{uid}:webim" class="S_func1 W_autocut">#{display_name}</a></h4>','                <div class="WB_feed_spec_brieftxt">','                    <span class="S_txt2">#{summary}</span>',"                </div>",'               <div class="WB_feed_spec_clearfix clearfix S_txt3">','                   <span class="W_fr">','                       <a href="#{short_url}" target="_blank" class="W_btn_a btn_22px">查看详情</a>',"                   </span>","               </div>","            </div>","        </div>","    </div>","</div>"].join(""))};var j=52;var k=b.create({initialize:function(a){if((a.summary||"").length>j/2){a.summary=g(a.summary||"",j)+"..."}c(this,a)},getContent:function(){return f(e(i[this.type],this)).box}});return k});
$WBIM.register("webim.ui.chatWindow.message.attach",function(a){function F(a,b){if(typeof a!=="string"){return a}if(b){a=a.replace(/\&/g,"&amp;")}return a.replace(/\</g,"&lt;").replace(/\>/g,"&gt;").replace(/\n/g,"<br>").replace(/\s/g,"&nbsp;")}var b=a.webim.base.Class;var c=a.webim.ui.chatWindow.message.base;var d=a.tool.upload;var e=a.webim.ui.chatWindow.message.audio;var f=a.webim.ui.chatWindow.message.file;var g=a.webim.ui.chatWindow.message.image;var h=a.webim.ui.chatWindow.message.cardExt;var i=a.core.util.templet;var j=$WBIM.language;var k=a.core.dom.sizzle;var l=a.core.dom.builder;var m=a.core.dom.setStyle;var n=a.core.arr.foreach;var o=a.core.evt.addEvent;var p=a.core.obj.isEmpty;var q=a.webim.ui.uiEvent;var r=a.webim.ui.base.formatContent.parseAll;var s=["jpg","gif","jpeg","png"];var t="&source=209678993";var u=['<div class="dia_att" node-type="att" node-key="#{fid}">',"#{content}","</div>"].join("");var v='<p class="page">#{text}</p>';var w=['<div class="cont">','    <p class="page">#{text}</p>',"</div>",'<div class="more_text">','    <a href="javascript:void(0);" action-type="longMessage.More" action-data="mid=#{mid}&gid=#{gid}" class="S_txt2">更多<em class="W_ficon ficon_arrow_down_lite S_ficon">g</em></a>',"</div>"].join("");var x=j('<em title="#L{文件}" class="wbim_icon_b_NAME"></em>');var x=j('<span class="mes_acc_icon acc_icon_NAME" title="#L{文件}"></span>');var y='<a target="_blank" class="download" href=" http://upload.api.weibo.com/2/mss/msget?source=209678993&fid=#{fid}">DOW</a>'.replace("DOW",j("#L{下载}"));var z=j("#L{该文件已被删除}");var A='<span><em class="W_btn_icon"><i class="W_ico12 icon_cd_link"></i><i class="W_vline S_line1_c">|</i></em><em class="W_autocut S_link1">TITLE</em></span>';var B='<span><em class="W_btn_icon"><i class="W_ico12 icon_cd_music"></i><i class="W_vline S_line1_c">|</i></em><em class="W_autocut S_link1">TITLE</em></span>';var C='<span><em class="W_btn_icon"><i class="W_ico12 icon_cd_film"></i><i class="W_vline S_line1_c">|</i></em><em class="W_autocut S_link1">TITLE</em></span>';var D={collection:A,article:A,video:C,audio:B,crawler:""};var E=a.webim.utils.Core.getCurrentUIDByCookie();var G=b.create(c,{initialize:function(a){if(a.profile&&a.weibo){a.profile=null}this.base.initialize(a);this.isSend=a.isSend?true:!!(a.uid==E);this.init(a);this.fids},getContent:function(){var b=this;if(this.media_type||this.msg=="null"){this.msg=""}var c;if(this.msg=="分享图片"||this.msg=="分享内容"){this.msg=""}if(!this.gid&&(this.msg||"").length>250){c=w;this.msg+=" ..."}else{c=v}if(this.ext&&this.ext.length){this.msg=""}this.msg=F(this.msg);var d=i(c,{text:r(this),mid:this.mid,gid:this.gid});if(this.msg!=""){this.conRoot.innerHTML=d}if(this.card){this.conRoot.appendChild(l(this.card.html).box);this.card.mid=this.mid;var e=a.core.dom.sizzle(".page a[href="+this.card.short+"]",this.conRoot);for(var f=0,g=e.length;f<g;f++){e[f].className="W_btn_c";e[f].innerHTML=(D[this.card.type]||A).replace("TITLE",this.card.name);e[f].setAttribute("suda-uatrack","key=tblog_automatic_reply&value=link_click"+":u_"+this.uid)}var j;o(a.core.dom.sizzle(".WBIM_messageCard",this.msgRoot)[0],"mouseover",function(c){var d=a.core.dom.sizzle(".WBIM_messageCard .action_r[data-node=block] a",b.msgRoot)[0];var e=a.core.dom.sizzle(".WBIM_messageCard .action_r[data-node=block] em",b.msgRoot)[0];d&&m(d,"display","");e&&m(e,"display","");if(j){clearTimeout(j);j=null}});o(a.core.dom.sizzle(".WBIM_messageCard",this.msgRoot)[0],"mouseout",function(c){var d=a.core.dom.sizzle(".WBIM_messageCard .action_r[data-node=block] a",b.msgRoot)[0];var e=a.core.dom.sizzle(".WBIM_messageCard .action_r[data-node=block] em",b.msgRoot)[0];j=function(a,b){return setTimeout(function(){j=null;a&&m(a,"display","none");b&&m(b,"display","none")},500)}(d,e)})}if(this.profile){this.conRoot.appendChild((new h(this.profile)).getContent())}if(this.weibo){this.conRoot.appendChild((new h(this.weibo)).getContent())}if(this.attachField){var k=this.attachField;var n=l(k).box;this.conRoot.appendChild(n);if(!this.msg){}this.loadFiles(this.fids,this.isSend)}return this.msgRoot},insertFileInfo:function(b){var c=this;var e=k('[node-key="'+b.id+'"]',this.msgRoot),f,g;if(!b.filename){f=z}else{if($indexOf(b.extension,s)>-1){f=this.createImg(b)}else{var h=this.parseFile(b);g=d&&h.isAudio;if(g){var i=this.createAudio(h);f=i.getContent(h)}else{f=this.createFile(h)}}}n(e,function(d,e){d.innerHTML=f;var g=a.core.dom.sizzle("img",d);for(var e=0,h=g.length;e<h;e++){(function(a){var b=a.getAttribute("imgSrc")||"http://img.t.sinajs.cn/t6/style/images/message/webim_img_failure.png";var d=document.createElement("img");d.onload=function(){a.setAttribute("src",b);q.fire("ui.content.init",{gid:c.gid,uid:c.uid});if(!c.more&&!c.isNew){q.fire("ui.resizeContent")}};d.src=b})(g[e])}b.thumbnail_120&&c.checkLoad(b.thumbnail_120)});g&&i&&i.embedAudio(h.fid)},checkLoad:function(a){var b=this;var c=document.createElement("img");c.onload=function(){if(!b.more&&!b.isNew){q.fire("ui.resizeContent")}};c.src=a+t},loadFiles:function(a,b){var c=this;n(a,function(a,b){$WBIM.process.getFile(a).done(function(a){c.insertFileInfo(a)})})},parseFile:function(b){b.fids&&b.fids.fid_120&&(b.previewId=b.fids.fid_120);b.size=this.transFileSize(b.filesize);b.status=i(y,b);b.icon=x.replace("NAME",a.webim.utils.Core.getFileImg(b.name||b.filename));b.look="";if(b.filename.indexOf(".amr")!=-1){b.isAudio=true}return b},init:function(a){var b=a.ext;if(b){if(b.length>0){this.handleNormalAttach(b)}else if(!p(b)){this.handleRealSendAttach(b)}}},dealAttachs:function(a){var b=[],c="";n(a,function(a,d){b.push(a);c+=i(u,{fid:a,content:""})});this.fids=b;this.attachField=c},handleNormalAttach:function(a){if(a instanceof Array||a.length){var b=a.length;if(b>1){var c=this.isSend?a.slice(0,b/2):a.slice(b/2,b);this.dealAttachs(c)}else{var d=a[0].fid?a[0].fid:a[0];this.dealAttachs([d])}}},handleRealSendAttach:function(b){var c=this;var h;if(b.isImg){var j=(new g(b)).getContent();this.attachField=i(u,{fid:b.fid,content:j})}else{b.name&&(b.icon=x.replace("NAME",a.webim.utils.Core.getFileImg(b.name)));b.size=c.transFileSize(b.size);b.status="";b.look="";var k=d&&b.isAudio;if(k){h=(new e(b)).getContent()}else{h=(new f(b)).getContent()}this.attachField=i(u,{fid:b.fid,content:h})}this.fids=[b.fid]},createImg:function(a){return(new g(a)).getContent()},createFile:function(a){return(new f(a)).getContent()},createAudio:function(a){return new e(a)},transFileSize:function(a){return(a+"").indexOf("K")==-1?(Math.ceil(a/1024)+"").substr(0,5)+"K":a}});return G});
$WBIM.register("webim.ui.chatWindow.message.menu",function(a){var b=a.core.dom.builder;var c=a.core.util.templet;var d=a.core.evt.delegatedEvent;var e=a.webim.ui.uiEvent;var f=a.core.evt.stopEvent;var g=['<div class="webim_dia_box webim_dia_l" node-type="outer">','<div class="webim_dia_bg">','<div class="dia_con">','<p class="dia_txt"></p>',"<ul>#{con}</ul>","</div>",'<div class="msg_arr"></div>',"</div>","</div>"].join("");var h='<li action-type="blue.menuItem.click" action-data="sendText=#{sendText}&uid=#{uid}"><a href="#">#{menuItem}</a></li>';var i={getContent:function(a,i){var j="";for(var k=0,l=a.length;k<l;k++){var m={};if(a[k].split("|").length==2){var n=a[k].split("|");m={menuItem:n[0],sendText:n[1],uid:i}}else{m={menuItem:a[k],sendText:a[k],uid:i}}j+=c(h,m)}var o=c(g,{con:j});var p=b(o).list["outer"][0];d(p).add("blue.menuItem.click","click",function(a){var b=a.data.sendText;var c=a.data.uid;e.fire("msg.user.send",{uid:c,msg:b});if(b=="DY"){e.fire("ui.blueTD.click",{uid:c,flag:"DY"})}if(b=="TD"){e.fire("ui.blueTD.click",{uid:c,flag:"TD"})}f()});return p}};return{getContent:i.getContent}});
$WBIM.register("webim.ui.chatWindow.header.frame",function(a){function G(a){}function F(a){setTimeout(function(){m.fire("ui.user.click",{gid:a.id})},1e3)}var b=$WBIM.language;var c=a.core.dom.builder;var d=a.core.evt.stopEvent;var e=a.core.arr.foreach;var f=b(["<!-- 头部 -->",'<div class="chat_head clearfix" node-type="_root">','    <h3 class="chat_title W_fl W_autocut W_f14"><a node-type="_chatUserName" target="_blank"></a></h3>','    <div class="chat_icon W_fr">','        <a href="javascript:void(0);" onclick="return false;"  class="W_ficon ficon_p_invite S_ficon" title="#L{添加群成员}" node-type="_settingBtnUser" style="display: none;">ã</a>','        <a class="W_ficon ficon_fans S_ficon" href="javascript:void(0);" suda-data="key=adm_group&value=webim_group" onclick="return false;" title="#L{群管理}" node-type="_settingBtnGroup" style="display: none;">à</a>','        <a href="javascript:void(0);" onclick="return false;" class="W_ficon ficon_arrow_up S_ficon" title="#L{菜单}" node-type="_menuBtn">c</a>','        <a href="javascript:void(0);" onclick="return false;"  class="W_ficon ficon_close S_ficon" title="#L{关闭}" node-type="_closeBtn">X</a>',"    </div>","    <!-- 下拉列表1 -->",'    <div class="layer_menu_list" style="display:none; top:28px; right:40px;" node-type="groupSetting">',"        <ul>",'            <li node-type="saveGroupItem"><a href="javascript:void(0);" suda-data="key=save_group&value=webim_group"  onclick="return false;" node-type="_saveGroup">保存到群列表</a></li>','            <li><a href="javascript:void(0);" suda-data="key=enter_group&value=webim_group" onclick="return false;" node-type="_logInGroup">进入群主页</a></li>','            <li><a href="javascript:void(0);" suda-data="key=webim_group_restr&value=webim_close_group" onclick="return false;" node-type="_closeWarn">关闭该群提醒</a></li>','            <li><a href="javascript:void(0);" onclick="return false;" node-type="_exitGroup">退出该群</a></li>',"        </ul>","    </div>","    <!-- 下拉列表1 -->","    <!-- 下拉列表2 -->",'    <div class="layer_menu_list" style="display:none;top:28px; right:40px;" node-type="singleSetting">',"        <ul>",'            <li node-type=""><a href="javascript:void(0);" onclick="return false;" node-type="_blockMsg">屏蔽私信</a></li>',"        </ul>","    </div>","    <!-- 下拉列表2 -->","</div>",'<div node-type="_cnpoptip" class="W_layer_tips" style="top:38px; right:0;display:none;">','<div class="W_layer_close"><a node-type="_cnpoptipclose" href="javascript:;" class="W_ficon ficon_close S_ficon">X</a></div>','<div class="content">','<div class="txt">',"<p>关闭该群提醒在这里哦~</p>","</div>","</div>",'<div class="W_layer_arrow"><span class="W_arrow_bor W_arrow_bor_t"><i class="S_line3"></i><em class="S_bg2_br"></em></span></div>',"</div>","<!-- 头部 -->"].join(""));var g=window.SUDA.uaTrack;var h=function(a){g("webim_group",a)};var i="http://weibo.com/p/230491";var j=a.webim.utils.Core.getCurrentUIDByCookie();var k=a.core.dom,l=a.core.evt.addEvent,m=a.webim.ui.uiEvent,n=a.core.dom.setStyle,o=a.core.str.leftB,p=a.core.str.encodeHTML,q=a.core.util.templet;var r=" http://weibo.com/#{domain}?source=webim";var s="http://weibo.com/p/230491#{gid}?source=webim";var t="http://api.weibo.com/2/friendships/show.json";var u="保存到群列表";var v="从群列表删除";var w="开启该群提醒";var x="关闭该群提醒";var y=b("#L{取消屏蔽}");var z=b("#L{屏蔽私信}");var A={};var B;var C=a.webim.utils.Core.getCurrentUIDByCookie();var D={};var E=function(){var a=c(f).list;for(var b in a){var d=a[b];this[b]=d.length>1?d:d[0]}this.activeUid;this.activeGid;a=null;f=null;this.chatingUser={};this.settingFlag=false;this.restricted=false;this.singleUserFlag=true;this.groupNames={};this.userNames={};this.bindDataEvents();this.bindDomEvents()};E.prototype={render:function(a){k.insertElement(a,this._root)},bindDataEvents:function(){var a=this;m.add("ui.changeChatUser",function(b,c){if(c.uid){a.activeUid=c.uid;a.activeGid=null;a.singleUserFlag=true;a.initBlock()}else if(c.gid){a.activeGid=c.gid;a.activeUid=null;a.singleUserFlag=false;a.initGroupSetting(c.gid)}a.updateUserField(c);a.activeSetting(1)});m.add("ui.tip.removeUserBlock",function(b,c){a.requestBlock()});m.add("ui.tip.addUserBlock",function(b,c){a.requestBlock()});m.add("ui.contactList.empty",function(b,c){n(a._settingBtnUser,"display","none");n(a._settingBtnGroup,"display","none");n(a._menuBtn,"display","none");a._chatUserName.innerHTML="";a.activeGid=null;a.activeUid=null});m.add("ui.group.changeTitle",function(b,c){var d=c.group_name;var e=c.gid;if(d&&e&&a.activeGid==e){a._chatUserName.innerHTML=p(o(d,32))}});m.add("msg.user.send",function(){if(a.restricted){a.requestBlock()}});var b=false;m.add("msg.group.msgoverline",function(){if(a.activeUid){return}if(b){return}$WBIM.api.getSetting().done(function(c){var c=c||{};b=c&&c.showcntip&&c.showcntip.showed;if(b){return}a._root.parentNode.appendChild(a._cnpoptip);a._cnpoptip.style.display="";l(a._cnpoptipclose,"click",function(){a._cnpoptip.style.display="none"});l(a._menuBtn,"click",function(){a._cnpoptip.style.display="none"});$WBIM.api.setSetting({showcntip:{showed:1}}).done(function(){});b=true})})},bindDomEvents:function(){var c=this;l(this._root,"click",function(a){var d=window.STK;var a=a||window.event;var e=a.target||a.srcElement;switch(e){case c._settingBtnUser:h("build_group");if(d&&d._groupSelectDialog){B=d._groupSelectDialog({gid:"",addSuccessCallback:F,addUsers:c.activeUid})}break;case c._settingBtnGroup:h("build_group");if(d&&d._groupSelectDialog){B=d._groupSelectDialog({gid:c.activeGid,editSuccessCallback:G})}break;case c._closeBtn:m.fire("ui.miniChatWindow",{});m.fire("ui.chatmini.show");break;case c._blockMsg:if(c.restricted){c.requestBlock()}else{m.fire("ui.confirmWin.confirms",{icon:"ask",txt:b("#L{确认屏蔽NAME吗？}").replace(/NAME/,c.userNames[c.activeUid]),cancel:true,confirmFunc:function(){c.requestBlock()},obj:this})}break;case c._menuBtn:c.activeSetting(c.settingFlag);break;case c._exitGroup:c.exitGroup();break;case c._closeWarn:var f=c._closeWarn.innerHTML==x?1:2;c.closeGroupNotice(c.activeGid,f);break;case c._saveGroup:var g=c._saveGroup.innerHTML==u?1:0;c.saveGroupList(c.activeGid,g);break;case c._logInGroup:c.landInGroup(c.activeGid);break;case c._deleteChatGroup:break}});l(document.body||document.documentElement,"click",function(b){var b=b||window.event;var d=b.target||b.srcElement;if(c.singleSetting===d||c._menuBtn===d||a.contains(c.singleSetting,d))return;if(c.settingFlag){c.activeSetting(true)}})},updateUserField:function(b){var c=this;this._chatUserName.innerHTML="";c._setHref(b);if(b.uid){a.api.getUser(b.uid).done(function(a){if(c.activeUid==b.uid){var d=p(o(a&&a.nick||"",32));c.userNames[b.uid]=d;if(c.activeUid&&c.activeUid==b.uid){c._chatUserName.innerHTML=d;c._chatUserName.title=d}}});n(c._settingBtnUser,"display","none");a.jsonp({url:t,args:{source:"209678993",source_id:C,target_id:b.uid},onComplete:function(a){if(a&&!a.error){var b=a.data&&a.data.source&&a.data.source.followed_by==true;n(c._settingBtnUser,"display",b?"":"none")}}});n(c._menuBtn,"display","");n(c._settingBtnGroup,"display","none")}else if(b.gid){a.group.getGroup(b.gid,1).done(function(d){a.webim.utils.data.set(d.id,d.affiliation);if(b.gid==c.activeGid){if(d&&d.owner==j){D[b.gid]=true;n(c.saveGroupItem,"display","none")}else{D[b.gid]=false;n(c.saveGroupItem,"display","")}var e=b.gid;var f=d.name||d.system_name||c.groupNames[e]||"";if(c.activeGid&&c.activeGid==b.gid){c._chatUserName.innerHTML=p(o(f,32));c._chatUserName.title=f}}});n(c._settingBtnUser,"display","none");n(c._menuBtn,"display","");n(c._settingBtnGroup,"display","")}},_setHref:function(a){if(a.gid){var b=a.gid;this._chatUserName.setAttribute("href",q(s,{gid:b}))}else if(a.uid){var b="u/"+a.uid;this._chatUserName.setAttribute("href",q(r,{domain:b}))}},activeSetting:function(a){var b;if(this.singleUserFlag){b=this.singleSetting}else{b=this.groupSetting;h("adm_group")}if(a){n(this.singleSetting,"display","none");n(this.singleSetting,"visibility","hidden");n(this.groupSetting,"display","none");n(this.groupSetting,"visibility","hidden")}else{n(b,"display","block");n(b,"visibility","visible")}this.settingFlag=!a;if(this.singleUserFlag){this.initBlockContent()}},initBlock:function(){var b=this;var c=this.activeUid;(function(c){a.api.restrict(c,"query").done(function(a){if(a.restricted){if(this.activeUid==c){this.restricted=true}A[c]=true;m.fire("ui.showBlockUserTips",{block:true,uid:c})}else{if(this.activeUid==c){this.restricted=false}A[c]=false}b.setBlock()})})(c)},initBlockContent:function(){var b=this;var c=this.activeUid;(function(c){a.api.restrict(c,"query").done(function(a){if(a.restricted){b._blockMsg.innerHTML=y;b.restricted=true}else{b._blockMsg.innerHTML=z;b.restricted=false}})})(c)},requestBlock:function(){var b=this;a.api.restrict(this.activeUid,this.restricted?"delete":"create").done(function(a){if(a.success){b.restricted=!b.restricted;A[b.activeUid]=b.restricted;if(b.restricted){m.fire("ui.showBlockUserTips",{block:true,uid:b.activeUid})}else{m.fire("ui.showBlockUserTips",{block:false,uid:b.activeUid})}b.setBlock(true)}})},setBlock:function(a){if(this.restricted){this._blockMsg.innerHTML=y}else{this._blockMsg.innerHTML=z}n(this.singleSetting,"display","none");if(a){this.settingFlag=!this.settingFlag}},exitGroup:function(){var c=this;var d=this.activeGid;if(d){m.fire("ui.confirmWin.confirms",{icon:"ask",txt:b("#L{确定退出该群吗？}"),cancel:true,confirmFunc:function(){a.group.exitGroup(d).done(function(a){if(a&&a.result){m.fire("manager.meQuit",{gid:d})}})},obj:c})}},initGroupSetting:function(b){var c=this;a.group.getGroupSetting(b).done(function(a){if(a){c._saveGroup.innerHTML=a.addsession?v:u}});a.group.getNoticeSetting(b).done(function(a){if(a&&a["switch"]){c._closeWarn.innerHTML=a["switch"]==2?x:w}})},saveGroupList:function(b,c){h("save_group");var d=this;a.core.io.ajax({method:"POST",url:"/aj/groupchat/switchaddsession?_wv=5&ajwvr=6",args:{id:b,key:c},onComplete:function(a){if(a&&a.code==1e5){d._saveGroup.innerHTML=c?v:u;m.fire("manager.setting.success")}}})},landInGroup:function(a){window.open(i+a,"_blank")},deleteGroupChat:function(b){a.group.deleteGroupChat(b).done(function(a){if(a.result){m.fire("ui.content.empty",{gid:b})}})},closeGroupNotice:function(b,c){var d=this;a.group.setNoticeSetting(b,c).done(function(a){if(a&&a.result){d._closeWarn.innerHTML=c==2?x:w;m.fire("manager.setting.success");m.fire("ui.group.changeRemindType",{gid:b,remind_type:c})}})}};return E});
$WBIM.register("webim.ui.chatWindow.content.content",function(a){var b=a.webim.base.Class;var c=a.core.dom;var d=a.webim.ui.uiEvent;var e=a.core.util.browser;var f=a.core.dom.replaceNode;var g=a.core.dom.addClassName;var h=a.core.dom.removeClassName;var i=a.webim.utils.Core.getCurrentUIDByCookie();var j=["<!-- 空数据 -->",'<div class="WB_empty">','    <div class="WB_innerwrap">','        <div class="empty_con clearfix">','            <p class="icon_bed"><i class="W_icon icon_warnB"></i></p>','            <p class="text">还没收到私信哦</p>',"        </div>","    </div>","</div>"].join("");return b.create({initialize:function(b,d){var f=this;this._root=a.C("div");this._root.className="private_dialogue_cont";this._root.style.cssText="position:absolute; top:0;";e.IE7&&(this._root.style.zoom="1");this._rendered=false;this._conRoot=a.C("div");c.insertElement(this._root,this._conRoot);this._scroll=new a.webim.ui.scroll(this._root);if(b.uid){this.uid=b.uid}if(b.gid){this.gid=b.gid}this.empty=false;this.bindDataEvents();this.hide()},render:function(a){c.insertElement(a,this._root,"afterbegin");this._rendered=true;var b=this;this._scroll.injectBottomEvent(function(a){return function(){b.bottomEvent(a)}}(this))},bindDataEvents:function(){var a=this;d.add("manager.userNewMsg",function(b,c){if(c.uid==a.uid){a.hasNew=true;a.showNewNotice()}});d.add("manager.groupNewMsg",function(b,c){if(c.gid==a.gid&&c.from_uid!=i){a.hasNew=true;a.showNewNotice()}})},initScroll:function(){var a=this;setTimeout(function(){a._scroll&&a._scroll.init();if(a._scroll.startPercent==1){a.scrollToBottom()}},0)},scrollToBottom:function(a){this._scroll.startPercent=1;var b=a||0;var c=this;if(this._rendered){var e=this._root.parentNode;setTimeout(function(){if(e.scrollHeight>e.clientHeight){e.scrollTop=e.scrollHeight-e.clientHeight}c._scroll&&c._scroll.scrollToBottom();d.fire("ui.hideNewMsgNotice",{uid:c.uid,gid:c.gid});c.hasNew=false},b)}},scrollToTop:function(){var a=this;if(this._rendered){var b=this._root.parentNode;setTimeout(function(){if(b.scrollHeight>b.clientHeight){b.scrollTop=b.scrollHeight-b.clientHeight}a._scroll&&a._scroll.init();a._scroll.scrollToTop()},50)}},_appendPureMsg:function(a,b){b=b||"afterBegin";this.checkEmpty();a&&c.insertHTML(this._conRoot,a,b);this.scrollToBottom()},_appendMsg:function(a){if(!a)return;this.checkEmpty();var b=a.content;b&&this._conRoot.appendChild(b);this.initScroll();if(this._scroll.startPercent==1){this.scrollToBottom()}},_insertMsg:function(b){if(!b)return;this.initScroll();var c=b.content;var d=a.core.dom.sizzle(".webim_chat_tips.inner_tip",this._conRoot)[0];this._conRoot.insertBefore(c,this._conRoot.firstChild);if(d){this._conRoot.insertBefore(d,this._conRoot.firstChild)}},checkEmpty:function(){if(this.empty){this._conRoot.innerHTML=""}this.empty=false},_emptyContent:function(){this._conRoot.innerHTML=j;this.empty=true},_updateMsg:function(b){if(!b)return;this.initScroll();var c=b.content;var d=a.core.dom.sizzle('.msg_bubble_list[mid="'+b.mid+'"]',this._conRoot)[0];if(c&&d){f(c,d)}if(b.more){this.scrollToTop(800)}else{this.scrollToBottom(800)}},_appendMoreBtn:function(a){a&&c.insertHTML(this._conRoot,a,"afterbegin");this.initScroll();if(this._scroll.startPercent>=.94){this.scrollToBottom()}},_resetMoreButton:function(b){var c=a.core.dom.sizzle(".private_dialogue_more",this._root)[0];if(c){if(b=="top"){this._conRoot.insertBefore(c,this._conRoot.firstChild)}else if(b=="remove"){this._conRoot.removeChild(c)}}var d=a.core.dom.sizzle(".icon_loading",c);if(d[0]){d[0].className="WBIM_icon_com WBIM_icon_clock"}},changeLoadingStyle:function(){var b=a.core.dom.sizzle(".webim_more_msg",this._conRoot)[0];if(b){var c=a.core.dom.sizzle(".WBIM_icon_com.WBIM_icon_clock",b);if(c[0]){c[0].className="icon_loading"}}},showNewNotice:function(){var a=this;setTimeout(function(){if(a.hasNew){d.fire("ui.showNewMsgNotice",{uid:a.uid,gid:a.gid})}},500)},bottomEvent:function(a){d.fire("ui.hideNewMsgNotice",{uid:a.uid,gid:a.gid})},hasShowNewNotice:function(){return this.hasNew},hide:function(){c.setStyle(this._root,"display","none");c.setStyle(this._root,"visibility","hidden")},show:function(){c.setStyle(this._root,"display","block");c.setStyle(this._root,"visibility","visible")}})});
$WBIM.register("webim.ui.chatWindow.content.tip",function(a){var b=a.core.dom,c=a.core.evt.addEvent,d=a.webim.ui.uiEvent,e=a.core.evt.delegatedEvent,f=$WBIM.language;var g=a.core.evt.stopEvent;var h=['<div class="private_tips private_tips_top" node-type="_tipsNode">','    <div class="W_tips tips_warn clearfix">','        <p class="icon"><span class="W_icon icon_warnS"></span></p>','        <p class="txt" node-type="_tipsContentNode"></p>','        <p class="close"  node-type="_tipsCloseBtn"><a href="javascript:void(0);" onclick="return false;" class="W_ficon ficon_close S_ficon">X</a></p>',"    </div>","</div>"].join("");var i={notSend2User:f("#L{私信发送失败，根据对方设置，你不能与他聊天。}"),blocksCreate:f('#L{已将 NICK 加入黑名单}，<a href="http://account.weibo.com/set/blacklist" target="_blank">#L{查看黑名单}</a>'),emailValid:f('#L{由于您未验证，因此无发送权限，}<a href="javascript:void(0);" onclick="return false;" action-type="User.Email" action-data="">#L{去验证}</a>'),blockUserTips:f('#L{该用户已屏蔽，发送私信即可解除屏蔽，或者点击此处}<a href="javascript:void(0);" onclick="return false;" action-type="User.Block.Del" action-data="">#L{解除屏蔽}</a>'),blockUserTips2:f("#L{已恢复该用户的私信。}"),blueAdWarn:f('#L{亲，私信发送过多不一定能获得很好的营销效果噢，您可以尝试我们推出的微博广告粉丝通，向目标用户直接展示您}：<a href="http://tui.weibo.com" target="_blank">http://tui.weibo.com</a>')};var j=function(){var a=b.builder(h);this._tipsNode=a.list["_tipsNode"][0];this._tipsContentNode=a.list["_tipsContentNode"][0];this._tipsCloseBtn=a.list["_tipsCloseBtn"][0];this.activeUid="";this.bindDomEvents();this.bindDataEvents()};j.prototype={bindDomEvents:function(){var a=this;var b=e(this._tipsNode);b.add("ui.user.blockUser","click",function(a,b){d.fire("ui.tip.addUserBlock");g(a)});b.add("User.Email","click",function(a,b){setTimeout(function(){d.fire("ui.emailValid.show")},10);g(a)});b.add("User.Block.Del","click",function(a,b){d.fire("ui.tip.removeUserBlock");g(a)});c(this._tipsCloseBtn,"click",function(b){a.hideTips()})},bindDataEvents:function(){var a=this;d.add("ui.changeChatUser",function(b,c){a.activeUid=c.uid;a.hideTips()});d.add("ui.showBlockUserTips",function(b,c){if(a.activeUid==c.uid){a.blockUser(c)}});d.add("ui.showBlackUserTips",function(b,c){if(a.activeUid==c.uid){a.blackUser(c)}});d.add("ui.showSysTips",function(b,c){a.handleTips(c);d.fire("ui.resizeContent")});d.add("ui.hideTips",function(b,c){a.hideTips()})},handleTips:function(a){switch(a.type){case"sendFail":if(a.errorCode=="20047"){a.msg=i["blueAdWarn"]}this.sendFailWarn(a.msg);break;default:if(a.type&&i[a.type]){this.execTips(i[a.type])}break}},showTips:function(a){this._tipsContentNode.innerHTML=a;b.setStyle(this._tipsNode,"display","block");b.setStyle(this._tipsNode,"visibility","visible");setTimeout(function(){d.fire("ui.resizeContent")},10)},hideTips:function(){b.setStyle(this._tipsNode,"display","none");b.setStyle(this._tipsNode,"visibility","hidden");d.fire("ui.resizeContent")},execTips:function(a){var b=this;if(!a||/^\s+$/.test(a)){return}this.showTips(a);this._timeout&&clearTimeout(this._timeout);this._timeout=setTimeout(function(){b.hideTips();b._timeout=""},3e3)},blockUser:function(a){var b=this;if(a.block){this.showTips(i.blockUserTips)}else{this.showTips(i.blockUserTips2);this._timeout&&clearTimeout(this._timeout);this._timeout=setTimeout(function(){b.hideTips();b._timeout=null},3e3)}},blackUser:function(a){var b=this;if(a.block){this.showTips(i.blackUserTips)}else{this.showTips(i.blackUserTips2);this._timeout&&clearTimeout(this._timeout);this._timeout=setTimeout(function(){b.hideTips();b._timeout=null},3e3)}},sendFailWarn:function(a){var b=this;if(a=="error408"){this.showTips(i.notSend2User)}else if(a=="email"){this.showTips(i.emailValid)}else{this.showTips(a)}this._timeout&&clearTimeout(this._timeout);this._timeout=setTimeout(function(){b.hideTips();b._timeout=""},3e3)}};return j});
$WBIM.register("webim.ui.chatWindow.content.msgNotice",function(a){var b=a.core.dom,c=a.core.evt.addEvent,d=a.webim.ui.uiEvent,e=$WBIM.language;var f=a.core.dom.setStyle;var g=a.webim.ui.base.cache;var h=['<div class="webim_tips" style="bottom:4px; right:10px;display:none;" node-type="root" action-type="newMsgNotice">','    <p class="txt">下方有新消息</p>',"</div>"].join("");var i=34;var j=22;var k=22;var l=function(){var a=b.builder(h);this.root=a.list["root"][0];this.hasNewMsgIds={};this.activeUid="";this.bindDomEvents();this.bindDataEvents()};l.prototype={bindDomEvents:function(){var a=this},bindDataEvents:function(){var a=this;d.add("ui.changeChatUser",function(b,c){if(c.uid){a.activeUid=c.uid;a.activeGid=null}else if(c.gid){a.activeGid=c.gid;a.activeUid=null}a.resizePostion();a.showOrHide(c)});d.add("ui.showNewMsgNotice",function(b,c){var d=c.uid||c.gid;a.hasNewMsgIds[d]=true;a.showNotice(c)});d.add("ui.hideNewMsgNotice",function(b,c){var d=c.uid||c.gid;a.hasNewMsgIds[d]=false;a.hideNotice(c)});d.add("ui.editor.changeHeight",function(b,c){var d=c.height;if(d){k=d;a.resizePostion()}})},resizePostion:function(){var a=g.get("menuUids");var b=0;if(this.activeUid&&$indexOf(this.activeUid,a)!=-1){b=i}f(this.root,"bottom",k-j+b+"px")},showNotice:function(a){if(a.uid||a.gid){if(a.uid&&a.uid==this.activeUid||a.gid&&a.gid==this.activeGid){b.setStyle(this.root,"display","block");b.setStyle(this.root,"visibility","visible")}}},hideNotice:function(a){if(a.uid||a.gid){if(a.uid&&a.uid==this.activeUid||a.gid&&a.gid==this.activeGid){b.setStyle(this.root,"display","none");b.setStyle(this.root,"visibility","hidden");var c=this.activeUid||this.activeGid;this.hasNewMsgIds[c]=false}}},showOrHide:function(a){var b=this.activeUid||this.activeGid;if(this.hasNewMsgIds[b]){this.showNotice(a)}else{this.hideNotice(a)}}};return l});
$WBIM.register("webim.ui.chatWindow.content.frame",function(a){var b=a.core.dom;var c=a.webim.ui.uiEvent;var d=a.core.evt.delegatedEvent;var e=a.core.arr.indexOf;var f=a.core.dom.getStyle;var g=a.webim.ui.base.cache;var h=34;var i=319;var j=22;var k=22;var l=["<!-- 空数据 -->",'<div class="WB_empty">','    <div class="WB_innerwrap">','        <div class="empty_con clearfix">','            <p class="icon_bed"><i class="W_icon icon_warnB"></i></p>','            <p class="text">还没收到私信哦</p>',"        </div>","    </div>","</div>"].join("");var m=function(){this._root=a.C("div");this._root.className="private_dialogue_body";this._root.style.cssText="position:relative; height:319px";this.tips=new a.webim.ui.chatWindow.content.tip;this._tipsNode=this.tips._tipsNode;this._newNotice=new a.webim.ui.chatWindow.content.msgNotice;this._conRoot=a.C("div");b.insertElement(this._root,this._tipsNode);b.insertElement(this._root,this._newNotice.root);b.insertElement(this._root,this._conRoot);this._userContents={};this._groupContents={};this._hasWranMsg={};this._hasMoreMsg={};this._activedContent=null;this.bindDataEvents();this.bindDomEvents();this.initContent();this.playing=false};m.prototype={render:function(a){b.insertElement(a,this._root)},bindDomEvents:function(){var b=d(this._root);var e=this;b.add("getMoreMsg","click",function(b){var d=b.data.uid;var e=b.data.gid;if(d){c.fire("ui.content.getMoreHistory",{uid:d})}else if(e){c.fire("ui.content.getMoreGroupHistory",{gid:e})}a.stopEvent()});b.add("newMsgNotice","click",function(a){var b=e._activedContent&&e._activedContent.uid||"";var d=e._activedContent&&e._activedContent.gid||"";c.fire("ui.hideNewMsgNotice",{uid:b,gid:d});e._activedContent.scrollToBottom()})},bindDataEvents:function(){var b=this;c.add("ui.changeChatUser",function(a,c){if(b._blank){b.clearBlank()}if(!c.initChatFlg||c.initChatFlg&&c.active&&!c.hide){b.activeChatContent(c);b.resizeContent()}});c.add(["msg.user.send","msg.group.send"],function(a,c){if(c.gid&&c.gid==b._activedContent.gid||c.uid&&c.uid==b._activedContent.uid){b._activedContent.scrollToBottom()}});c.add("ui.editor.changeHeight",function(a,c){if(c.height&&c.height!=k){b.resizeContent(c);k=c.height}});c.add("ui.resizeContent",function(){b.resizeContent()});c.add("ui.content.empty",function(a,c){if(c.uid&&b._userContents[c.uid]){b._userContents[c.uid]._emptyContent()}else if(c.gid&&b._groupContents[c.gid]){b._groupContents[c.gid]._emptyContent()}});c.add(["ui.miniChatWindow","ui.realCloseChatWindow"],function(){b._activedContent&&b._activedContent.hide()});c.add("ui.content.addMsg",function(c,d){if(d.uid&&b._userContents[d.uid]){b._userContents[d.uid]._appendMsg(d)}else if(d.gid&&b._groupContents[d.gid]){b._groupContents[d.gid]._appendMsg(d)}else{if(a.initData.chat&&a.initData.chat.status&&a.initData.chat.status=="max"&&a.initData.chat.active){b.addUserContent(d)}}});c.add("ui.content.updateMsg",function(a,c){if(c.uid&&b._userContents[c.uid]){b._userContents[c.uid]._updateMsg(c)}else if(c.gid&&b._groupContents[c.gid]){b._groupContents[c.gid]._updateMsg(c)}});c.add("ui.content.addPureMsg",function(a,c){if(c.uid&&!b._hasWranMsg[c.uid]&&b._userContents[c.uid]){b._userContents[c.uid]._appendPureMsg(c.msg);b._hasWranMsg[c.uid]=true}else if(c.gid&&b._groupContents[c.gid]){b._groupContents[c.gid]._appendPureMsg(c.msg,"beforeend")}});c.add("ui.content.addMoreMsgBtn",function(a,c){if(c.uid&&!b._hasMoreMsg[c.uid]&&b._userContents[c.uid]){b._userContents[c.uid]._appendMoreBtn(c.msg);b._hasMoreMsg[c.uid]=true}else if(c.gid&&b._groupContents[c.gid]){b._groupContents[c.gid]._appendMoreBtn(c.msg)}});c.add("ui.content.addMoreHistoryMsg",function(a,c){if(c.uid){b._userContents[c.uid]._insertMsg(c);setTimeout(function(){b.reset(c,"top")},1e3)}else if(c.gid){b._groupContents[c.gid]._insertMsg(c);setTimeout(function(){b.reset(c,"top")},1e3)}});c.add("ui.removeHistory.moreButton",function(a,c){b.reset(c,"remove")});c.add("ui.contactList.empty",function(a,c){b.initContent();b._userContents={};b._groupContents={};b._hasWranMsg={};b._hasMoreMsg={};b._activedContent=null});c.add("ui.content.init",function(a,c){if(c.gid){b._groupContents[c.gid]&&b._groupContents[c.gid].initScroll()}else if(c.uid){b._userContents[c.uid]&&b._userContents[c.uid].initScroll()}})},addUserContent:function(b){if(!this._userContents[b.uid]){var d=new a.webim.ui.chatWindow.content.content(b,this.scroll);d.render(this._conRoot);this._userContents[b.uid]=d;c.fire("ui.createNewContent",b)}},addGroupContent:function(b){if(!this._groupContents[b.gid]){var d=new a.webim.ui.chatWindow.content.content(b,this.scroll);d.render(this._conRoot);this._groupContents[b.gid]=d;c.fire("ui.createNewContent",b)}},reset:function(a,b){if(a.uid){this._userContents[a.uid]._resetMoreButton(b)}else if(a.gid){this._groupContents[a.gid]._resetMoreButton(b)}},activeChatContent:function(a){a.uid&&this.addUserContent(a);a.gid&&this.addGroupContent(a);if(this._activedContent){this.lastUid=this._activedContent.uid;this.lastGid=this._activedContent.gid;this.lastUid&&this._userContents[this.lastUid].hide();this.lastGid&&this._groupContents[this.lastGid].hide()}if(a.uid){this._activedContent=this._userContents[a.uid];this.lastUid&&this._userContents[this.lastUid]&&this._userContents[this.lastUid].hide();this.lastGid&&this._groupContents[this.lastGid]&&this._groupContents[this.lastGid].hide();this._userContents[a.uid].show();this._userContents[a.uid].initScroll()}else if(a.gid){this._activedContent=this._groupContents[a.gid];this.lastUid&&this._userContents[this.lastUid]&&this._userContents[this.lastUid].hide();this.lastGid&&this._groupContents[this.lastGid]&&this._groupContents[this.lastGid].hide();this._groupContents[a.gid].show();this._groupContents[a.gid].initScroll()}},resizeContent:function(a){var b=(a&&a.height?a.height:k)-j;var c=g.get("menuUids");var d=parseInt(f(this._tipsNode,"height"))||0;var l=this._activedContent&&this._activedContent.uid||"";var m=this._activedContent&&this._activedContent.gid||"";if(l&&e(l,c)!=-1){if(this._activedContent){this._activedContent._root.style.height=i-h-d-b+"px";this._activedContent._root.style.top=d+"px"}}else{if(this._activedContent){this._activedContent._root.style.height=i-d-b+"px";this._activedContent._root.style.top=d+"px"}}},scrollFun:function(a){if(this._conRoot.scrollTop==0){var b=this._activedContent.uid;c.fire("ui.content.getMoreHistory",{uid:b})}},show:function(){this._root.style.dispaly="block"},hide:function(){this._root.style.dispaly="none"},initContent:function(){this._conRoot.innerHTML=l;this._blank=true},clearBlank:function(){this._conRoot.innerHTML="";this._blank=false}};return m});
$WBIM.register("webim.ui.chatWindow.msgEditor.richText",function(a){var b=$WBIM.language,c=a.core.dom,d=a.webim.ui.uiEvent,e=a.core.util.templet;var f='<span class="mes_acc_icon #{cls}"></span>'+'<span class="name S_txt2">文件</span>';var g=b('<i class="W_loading"></i>'+'<span class="state S_txt1">正在上传</span>'+'<a href="javascript:void(0);" onclick="return false;" class="W_ficon ficon_close S_ficon" action-type="cancel">X</a>');var h='<span class="#{cls}"></span>#{fileName}',i=b('<a class="links" action-type="delete" href="javascript:void(0);" onclick="return false;">#L{删除}</a>');var j='<span class="icon_errorS"></span>',k=b('<a hidefocus="true" href="javascript:void(0);" onclick="return false;" action-type="close" class="wbim_icon_close_s">#L{关闭}</a>');var l=b('<p class="txt">#L{你当前处于离线状态，无法发送私信}</p>'),m='<a class="wbim_icon_close_s" action-type="hideTip" href="javascript:void(0);" onclick="return false;" hidefocus="true"></a>';var n={"-1":b("#L{单个文件超出规定大小}"),"-2":b("#L{单个文件上传超时}"),"-3":b("#L{总文件数量超出}"),"-4":b("#L{总文件大小超出}"),7:b("#L{对方微盘已满,请提醒Ta申请扩容}")};var o=window.SUDA.uaTrack;var p=['<div class="sendbox_annex S_bg2 S_line3" node-type="_root" style="display: none;">','    <div class="sendbox_file S_line2">','        <div class="files clearfix">','            <div class="private_file_mod W_fl W_autocut" node-type="_leftNode">',"            </div>",'            <div class="state_mod W_fr"  node-type="_rightNode">',"            </div>","        </div>","    </div>","</div>"].join("");var q=function(){var a=c.builder(p);this._root=a.list["_root"][0];this._rightNode=a.list["_rightNode"][0];this._leftNode=a.list["_leftNode"][0];this._uploadCache=null;this.bindDomEvent();this.bindDataEvent();this.attachInfo="";a=null;p=null};q.prototype={render:function(a){c.insertElement(a,this._root,"afterbegin")},bindDomEvent:function(){var b=this;var c=a.core.evt.delegatedEvent(b._root);c.add("cancel","click",function(c){b.hide();d.fire("ui.cancelUpload");a.stopEvent()});c.add("delete","click",function(c){b.hide();d.fire("ui.deleteUpload");a.stopEvent()});c.add("close","click",function(c){b.hide();d.fire("ui.deleteUpload");a.stopEvent()});c.add("hideTip","click",function(c){b.offlineTipHide();a.stopEvent()})},bindDataEvent:function(){var a=this;d.add("ui.swf.upload.start",function(b,c){a.showUploadMsg("start");a.attachInfo=""});d.calc("data.attachInfo",function(){return{attInfo:a.attachInfo}});d.add("ui.swf.upload.complete",function(b,c){a.showUploadMsg("complete",c);a.saveattachInfo(c)});d.add("ui.swf.upload.showMsg",function(b,c){a.showUploadMsg("tips",c);c.err_code!=-3&&(a.attachInfo="")});d.add(["msg.user.send","msg.group.send"],function(b,c){c.uid&&a.hide();c.gid&&a.hide()});d.before(["msg.user.send","msg.group.send"],function(a,b){if(b.ext){o("tblog_webim_behavior5","send_private_annex")}b.isSend=true});d.add("reconnect",function(b,c){!a.offlineFlag&&a.showUploadMsg("offline")})},saveattachInfo:function(a){var b=a.ext;var c=[b.vfid,b.tovfid];this.attachInfo={fids:c,fid:b.fid+"",name:b.name,size:b.size,tfid:b.tfid+""};if(b.type.indexOf("image")!=-1&&b.thumbnail){this.attachInfo.imgUrl=b.thumbnail;this.attachInfo.preview=b.preview;this.attachInfo.pic=b.pic;this.attachInfo.isImg=true}else if((b.type=="music"||b.type.indexOf("octet-stream"))&&b.name.indexOf(".amr")!=-1){this.attachInfo.isAudio=true}},getUploadTips:function(a){a.err_code==7&&d.fire("ui.uploadFile.rollback",{fid:a.ext.fid});return j+n[a.err_code]},showUploadMsg:function(a,b){var j=this;var n,o;switch(a){case"start":n=f;o=g;break;case"complete":n=e(h,{cls:b.ext.thumbnail?"mes_acc_icon acc_icon_photo":"mes_acc_icon acc_icon_"+b.ext.type,fileName:b.fileName});if(b.ext.type=="image"){d.fire("ui.upload.openPreview",{data:b})}o=i.replace("DVALUE",this._vdiskFlg?"":"none");j._disableFlg=true;break;case"tips":o=b.err_code==-3?i:k;n=this.getUploadTips(b);break;case"offline":this.offlineFlag=true;if(c.getStyle(this._root,"display")!="none"){this._uploadCache={left:this._leftNode.innerHTML,right:this._rightNode.innerHTML}}n=l;o=m}if(this._uploadCache&&a!="offline"){this._uploadCache={left:n,right:o};return}this._leftNode.innerHTML=n;this._rightNode.innerHTML=o;this.show()},show:function(){this._showed=true;c.setStyle(this._root,"display","block")},hide:function(){this._showed=false;this.hidePreview();c.setStyle(this._root,"display","none");d.fire("ui.hideUploadTips");this.attachInfo=""},offlineTipHide:function(){if(this._uploadCache){this._leftNode.innerHTML=this._uploadCache.left;this._rightNode.innerHTML=this._uploadCache.right;this._uploadCache=null}else if(this.offlineFlag){this.hide()}this.offlineFlag=false},hidePreview:function(){this._openPreview=false}};return q});
$WBIM.register("webim.ui.chatWindow.toolBar.banButton",function(a){var b=a.webim.ui.uiEvent,c=a.core.dom,d=a.core.evt.addEvent,e=a.core.evt.stopEvent,f=$WBIM.language;var g=a.api;var h="WBIM_icon_shieldover",i="WBIM_icon_shield",j=f("#L{取消屏蔽}"),k=f("#L{屏蔽当前用户}");var l={};var m=function(){this._root=a.C("a");this._root.setAttribute("hidefocus","true");this._root.setAttribute("href","javascript:void(0);");this._root.className=i;this.activeUid;this.restricted=0;this.bindDomEvent();this.bindDataEvent()};m.prototype={render:function(a){c.insertElement(a,this._root)},bindDataEvent:function(){var a=this;b.add("ui.changeChatUser",function(c,d){var e=d.uid;if(e){a.activeUid=e;a.show();if(l[a.uid]){a.restricted=l[a.uid];if(a.restricted){setTimeout(function(){b.fire("ui.showBlockUserTips",{block:true,uid:e})},0)}a.setStyle()}else{(function(c){g.restrict(c,"query").done(function(d){if(d.restricted){if(a.activeUid==c){a.restricted=true}l[c]=true;b.fire("ui.showBlockUserTips",{block:true,uid:c})}else{if(a.activeUid==c){a.restricted=false}l[c]=false}a.setStyle()})})(e)}}else{a.hide()}});b.add("ui.tip.removeUserBlock",function(b,c){a.execBlock()});b.add("ui.tip.addUserBlock",function(b,c){a.execBlock()});b.add("msg.user.send",function(b,c){a.restricted&&a.requestBlock()})},bindDomEvent:function(){var a=this;d(a._root,"click",function(b){a.execBlock();e()})},execBlock:function(){var a=this;if(a.activeUid){g.getUser(a.activeUid).done(function(c){var d=c.nick;b.fire("ui.confirmWin.confirms",{icon:"warn",txt:a.restricted?f("#L{解除屏蔽后将恢复从消息箱中接收私信。}"):f("#L{确认屏蔽 NICK 的私信吗？} ").replace("NICK",d),cancel:true,confirmFunc:function(){a.requestBlock()}})})}},requestBlock:function(){var a=this;g.restrict(a.activeUid,a.restricted?"delete":"create").done(function(c){if(c.success){a.restricted=!a.restricted;l[a.activeUid]=a.restricted;if(a.restricted){b.fire("ui.showBlockUserTips",{block:true,uid:a.activeUid})}else{b.fire("ui.showBlockUserTips",{block:false,uid:a.activeUid})}a.setStyle()}})},setStyle:function(){if(this.restricted){this._root.className=h;this._root.setAttribute("title",j)}else{this._root.className=i;this._root.setAttribute("title",k)}},hide:function(){c.setStyle(this._root,"display","none")},show:function(){c.setStyle(this._root,"display","")}};return m});
$WBIM.register("webim.ui.chatWindow.subBox.frame",function(a){function x(){var a=g(r);this.root=a.list["root"][0];this.subRoot=a.list["subRoot"][0];this.menuNode=a.list["menuNode"][0];this.subMenuIn=a.list["subMenuIn"][0];this.activeSubUid=null;this.bindDataEvent();this.bindDomEvent();this.init()}var b=a.webim.ui.uiEvent;var c=a.core.dom;var d=$WBIM.language;var e=a.core.json.clone;var f=a.core.evt.stopEvent;var g=a.core.dom.builder;var h=a.core.util.templet;var i=a.core.arr.indexOf;var j=a.core.dom.setStyle;var k=a.core.evt.delegatedEvent;var l=a.core.dom.addClassName;var m=a.api;var n=a.webim.ui.base.cache;var o={};var p=[];var q="information_list clearfix ";var r=d(["<!-- 资讯 -->",'<div class="private_information S_bg2 S_line1" node-type="root">','    <ul class="information_list clearfix" node-type="menuNode">',"   <!-- 两列增加class：information_list_two，三列增加class：information_list_three -->","    </ul>",'    <div class="W_layer W_layer_pop" style="display:none; bottom:42px;" node-type="subRoot">','        <div class="content layer_mini_info">','            <p class="main_txt" node-type="subMenuIn">',"            </p>",'            <div class="W_layer_arrow"><span class="W_arrow_bor W_arrow_bor_b"><i class="S_line3"></i><em class="S_bg2_br"></em></span></div>',"        </div>","    </div>","</div>","<!-- 资讯 -->"].join(""));var s=window.SUDA.uaTrack;var t=function(a){s("webim_group_restr",a)};var u={click:'<li class="#{iclass}" action-type="blue.menu.click" action-data="type=#{type}&key=#{key}&uid=#{uid}&url=#{url}" ><a href="javascript:void(0);" onclick="return false;" class="S_txt1">#{name}</a></li>',view:'<li class="#{iclass}" action-type="blue.menu.click" action-data="type=#{type}&key=#{key}&uid=#{uid}&url=#{url}" ><a href="javascript:void(0);" onclick="return false;" class="S_txt1"><em class="W_ficon ficon_link S_ficon">5</em>#{name}</a></li>',sub:'<li class="#{iclass}" action-type="blue.menu.click" action-data="type=#{type}&key=#{key}&uid=#{uid}&url=#{url}&name=#{name}"><a href="javascript:void(0);" onclick="return false;" class="S_txt1"><em class="W_ficon ficon_moremenu S_ficon">§</em>#{name}</a></li>',"default":'<li class="#{iclass}" action-type="blue.menu.click" action-data="type=#{type}&key=#{key}&uid=#{uid}&url=#{url}" ><a href="javascript:void(0);" onclick="return false;" class="S_txt1">#{name}</a></li>'};var v='<a href="javascript:void(0);" onclick="return false;" class="link SW_fun_bg W_autocut S_txt1" action-type="blue.menu.click" action-data="name=#{name}&type=#{type}&uid=#{uid}&key=#{key}&url=#{url}" >#{name}</a>';var w='<span class="S_line2"></span>';var s=window.SUDA.uaTrack;x.prototype={render:function(a){c.insertElement(a,this.root,"afterbegin");this.render=null},init:function(){n.set("menuUids",p)},bindDataEvent:function(){var a=this;b.add("ui.changeChatUser",function(c,d){a.hideSubMenu();a.activeSubUid=d.uid;if(d.uid&&i(d.uid,p)!=-1){a.activeSubUid=d.uid;a.show();a.refresh(d.uid)}else{a.hide();b.fire("ui.resizeContent",{flag:false});a.checkUserMenu(d.uid)}});b.add("ui.contactList.empty",function(){a.hide()})},bindDomEvent:function(){var b=this;k(this.root).add("blue.menu.click","click",function(a){t("restr_intera_tab1");b.hideSubMenu();b.handleDelegate(a)});k(this.subRoot).add("blue.menu.click","click",function(a){b.handleDelegate(a);b.hideSubMenu()});a.core.evt.addEvent(document.body,"click",function(c){var c=c||window.event;var d=c.srcElement||c.target;if(d!=b.subRoot&&!a.core.dom.contains(b.subRoot,d)){b.hideSubMenu()}})},refresh:function(a){var b=o[a];var c=0;var d=e(b["button"]);for(var f in d){c++}if(c==1){this.menuNode.className=q}else if(c==2){this.menuNode.className=q+"information_list_two"}else if(c==3){this.menuNode.className=q+"information_list_three"}var g="";for(var f in d){d[f].uid=a;d[f].url=encodeURIComponent(d[f].url);var i="";if(d[f]["sub_button"]&&d[f]["name"]){var j=d[f]["name"];d[f].type="sub";o[a][j]=d[f]["sub_button"]}if(f!=c-1){d[f].iclass="S_line1"}var k=d[f].type;i=h(u[k],d[f]);g+=i}this.menuNode.innerHTML=g},createSubMenu:function(a,b,c){var d=e(o[b][a]);var f=[];var g=c.offsetLeft;var i=c.clientWidth;for(var j in d){d[j].uid=b;if(d[j]&&d[j].url&&d[j].url.indexOf("=")!=-1){d[j].url=encodeURIComponent(d[j].url)}var k=h(v,d[j]);f.push(k)}this.subMenuIn.innerHTML=f.join(w);this.showSubMenu();var l=this.subRoot.offsetWidth;this.subRoot.style.left=g+(i-l)/2+"px"},checkUserMenu:function(a){var c=this;m.process.getMenu(a).done(function(d){if(d.menu){o[a]=d["menu"];p.push(a);if(c.activeSubUid==a){c.show();c.refresh(a);b.fire("ui.resizeContent",{flag:true})}}else if(d.error||d.error_code){if(c.activeSubUid==a){c.hide();b.fire("ui.resizeContent",{flag:false})}}})},handleDelegate:function(b){var c=b.data;var d=c.type||"";var e=c.key||"";var g=c.url||"";var h=c.menu||"";var i=c.uid||"";var j=c.name||"";if(d=="click"&&e){a.api.process.pushEvent(d,e,i).done(function(a){})}else if(d=="view"&&g){m.process.pushEvent(d,null,i).done(function(a){});window.open(decodeURIComponent(g),"_blank")}else if(d=="sub"&&j){var k=b.el;this.createSubMenu(j,i,k)}s("tblog_automatic_reply","menu_click");f()},hideSubMenu:function(){j(this.subRoot,"display","none")},showSubMenu:function(){j(this.subRoot,"display","")},hide:function(){j(this.root,"display","none")},show:function(){j(this.root,"display","")}};return x});
$WBIM.register("webim.ui.chatWindow.toolBar.screenCapture",function(a){function o(c,d){var e=b.builder(f);this._root=e.list["webim_chatWindow_screenCap"][0];l=a.webim.utils.pluginstallState(g,h,i,this._root);n=l.getInstallState();var k=b.builder(j);this.node_cfmwin=k.list["webim_download_confirm"][0];this.node_cfm=k.list["webim_download_cfm"][0];this.node_cel=k.list["webim_download_cancel"][0];this.bindEvents()}var b=a.core.dom,c=a.core.evt,d=a.webim.ui.uiEvent,e=$WBIM.language;var f=a.core.util.browser.IE?'<OBJECT style="position:absolute;right:0;top:0;" node-type="webim_chatWindow_screenCap" ID="WeiboDesktopAssistCom" WIDTH="1" HEIGHT="1" type="application/x-oleobject" CLASSID="CLSID:EA6E924C-93A9-46ea-8975-D57FB9B9D1D8"></OBJECT>':'<embed node-type="webim_chatWindow_screenCap" style="position:absolute;right:0;top:0;" ID="WeiboDesktopAssistCom" type="application/x-weibodesktopassist-sina" width="1" height="1" />';var g={pluginName:"npScreenGrab Plugin",activeXName:"ScreenGrab.ScreenGrabCom.1"};var h={embedId:"weibo_screen_grab_embed",embedType:"application/x-screengrab-sina"};var i={param1:"OnGrapContent",param2:"CloseScreenGrabCtrlWnd",param3:"onmsgfireevent"};var i=["OnGrapContent","CloseScreenGrabCtrlWnd","onmsgfireevent"];var j=e(['<div class="wbim_confirm_box" node-type="webim_download_confirm" style="z-index:1002;left:48px;top:140px;" style="display:none;">','<div class="wbim_confirm_con">','<div class="wbim_confirm_info">','<p class="wbim_confirm_p"><span class="webim_cfmicon_stat icon_askS"></span><span class="txt">#L{使用截屏功能，需要先安装微博桌面插件。}</span></p>','<p class="wbim_confirm_btn">','<a href="http://desktop.weibo.com/download.php?source=jietu" target="_blank" class="WBIM_btn_a" node-type="webim_download_cfm" suda-uatrack="key=tblog_webim_behavior5&value=sure_download"><span>#L{下载}</span></a>','<a href="javascript:void(0);" onclick="return false;" class="WBIM_btn_b" node-type="webim_download_cancel"><span>#L{取消}</span></a>',"</p>","</div>","</div>","</div>"].join(""));var k=document.createElement("div");k.style.cssText="position:absolute;left:0;top:0;background:#777;opacity:0.6;filter:alpha(opacity=60);z-index:1001;";var l,m,n;o.prototype={render:function(a){if(n){this.pNode=a;a.appendChild(this._root);setTimeout(function(){m=l.instance;m.OnGrapContent=function(a,b,c){if(c!=0){d.fire("ui.screenCaptureData",{base64:c})}}},0)}},bindEvents:function(){var a=this;d.add("ui.screenCaptureStart",function(){a.startCap()})},startCap:function(){if(!n){this.confirmPop()}else{m&&m.ShowControlWnd(-1,-1,-1,-1)}},initConfirm:function(){var b=a.core.dom.sizzle("#WB_webim .wbim_chat_rt")[0];b.appendChild(this.node_cfmwin);b.appendChild(k);k.style.width=b.offsetWidth+"px";k.style.height=b.offsetHeight+"px";this.initConfirm=null},bindConfirmFunc:function(){var a=this;c.addEvent(this.node_cfm,"click",function(){a.node_cfmwin.style.display="none";k.style.display="none"});c.addEvent(this.node_cel,"click",function(){a.node_cfmwin.style.display="none";k.style.display="none"});this.bindConfirmFunc=null},confirmPop:function(){this.initConfirm&&this.initConfirm();this.bindConfirmFunc&&this.bindConfirmFunc();d.fire("sudaUatrack",{value:"not_instal_desktop"});this.node_cfmwin.style.display="";k.style.display=""}};return o});
$WBIM.register("webim.ui.chatWindow.toolBar.frame",function(a){var b=$WBIM.language;var c=b(['<div class="sendbox_bar clearfix" node-type="wbim_chat_toolbar" style="position:relative;z-index:109;">','<div class="sendbox_ac" >','<span class="sendbox_kind" node-type="wbim_chat_toolbarin">',' <a href="javascript:void(0);" onclick="return false;" class="WBIM_icon_com WBIM_iconsend_face" node-type="webim_msgToolBar_face" suda-uatrack="key=tblog_webim_behavior5&value=expression_button">#L{表情}</a>',' <a href="javascript:void(0);" onclick="return false;" class="WBIM_icon_com WBIM_iconsend_img" suda-uatrack="key=tblog_webim_behavior5&value=send_private_picture">#L{图片}</a>',' <a href="javascript:void(0);" onclick="return false;" class="WBIM_icon_com WBIM_iconsend_att" suda-uatrack="key=tblog_webim_behavior5&value=send_private_annex">#L{附件}</a>',' <a node-type="webim_msgToolBar_cap" href="javascript:void(0);" onclick="return false;" class="WBIM_icon_com WBIM_iconsend_copysc" style="display:none" suda-uatrack="key=tblog_webim_behavior5&value=send_screenshot_button">#L{截屏}</a>',"</span>","</div>",'<div class="sendbox_show "><span class="sendbox_oth">','<a href="javascript:;" target="_blank" class="sendbox_his" node-type="historyMsgBtn" title="#L{查看聊天记录}" suda-uatrack="key=tblog_webim_behavior5&value=click_chat">','<em class="WBIM_icon_com WBIM_iconsend_his"></em>#L{聊天记录}</a>',"</span>","</div>",'<div class="layer_title" node-type="webim_tips_title" style="display:none;z-index:109;"></div>',"</div>"].join(""));var d=b(["<!-- 多功能区域 -->",'<div class="sendbox_mod_r W_fl" node-type="wbim_chat_toolbar">','    <div class="sendbox_bar clearfix">','        <div class="sendbox_menu W_fl" node-type="wbim_chat_toolbarin">','            <a href="javascript:void(0);" onclick="return false;" class="icon_send"><em class="W_ficon ficon_face" suda-uatrack="key=tblog_webim_behavior5&value=expression_button">o</em></a>','            <a href="javascript:void(0);" onclick="return false;" class="icon_send"><em class="W_ficon ficon_image" suda-uatrack="key=tblog_webim_behavior5&value=send_private_picture">p</em></a>','            <a href="javascript:void(0);" onclick="return false;" class="icon_send"><em class="W_ficon ficon_file" suda-uatrack="key=tblog_webim_behavior5&value=send_private_annex">x</em></a>',"        </div>","    </div>","</div>"].join(""));var e=a.webim.ui,f=a.core.dom;var g=a.webim.ui.uiEvent;var h=a.core.evt.addEvent;var i=[{content:b("#L{上传图片}"),position:[50,30]},{content:b("#L{上传附件}"),position:[80,30]},{content:b("#L{发送表情}"),position:[20,30]},{content:b("#L{发送截屏}"),position:[110,30]}];var j=[{content:b("#L{替换图片}"),position:[50,30]},{content:b("#L{替换附件}"),position:[80,30]},{content:b("#L{发送表情}"),position:[20,30]},{content:b("#L{发送截屏}"),position:[110,30]}];var k="&source=209678993",l="http://upload.api.weibo.com/2/mss/msget?source=209678993&fid=FID";var m=a.core.util.browser;var n=m.IE,o=m.MOZ,p=m.OPERA,q=m.SAFARI,r=m.CHROME,s=m.Version;var t=function(){if(m.OS==="windows"){if(n){return true}else if(o){if(s>=3.6){return true}else{return false}}else if(p){return false}else if(q){return false}else if(r){if(s>=4){return true}else{return false}}else{return false}}else{return false}}();var u;var v=function(){var b=f.builder(c);this._root=b.list["wbim_chat_toolbar"][0];this._container=b.list["wbim_chat_toolbarin"][0];this._historyMsg=b.list["historyMsgBtn"][0];this._face=b.list["webim_msgToolBar_face"][0];this._cap=b.list["webim_msgToolBar_cap"][0];this._seq="webim_msgToolBar";this._banButton=new e.chatWindow.toolBar.banButton;this._banButton.render(this._container);this._title=b.list["webim_tips_title"][0];b=null;c=null;if(a.tool.upload){}this.currentUID;this._bindEvents();this._bindDataEvents();this._bindOnceEvent()};v.prototype={render:function(a){f.insertElement(a,this._root)},_bindEvents:function(){var a=this;g.add("ui.user.click",function(b,c){a.currentUID=c.uid});g.add("ui.swf.upload.setTitle",function(b,c){var d=u?j:i;if(!c.flg){a._title.style.display="none"}else{a._title.style.display="";a._title.innerHTML="<span>CONTENT</span>".replace(/CONTENT/,d[c.idx].content);a._title.style.left=d[c.idx].position[0]+"px";a._title.style.top=d[c.idx].position[1]+"px"}});h(this._face,"click",function(){g.fire("ui.phiz.show",{seq:a._seq,dom:a._face})});h(this._face,"mouseover",function(){g.fire("ui.swf.upload.setTitle",{flg:true,idx:2})});h(this._face,"mouseout",function(){g.fire("ui.swf.upload.setTitle",{flg:false,idx:2})});h(this._cap,"mouseover",function(){g.fire("ui.swf.upload.setTitle",{flg:true,idx:3})});h(this._cap,"mouseout",function(){g.fire("ui.swf.upload.setTitle",{flg:false,idx:3})});h(this._cap,"click",function(){if(a._disableFlg){g.fire("ui.swf.upload.showMsg",{err_code:"-3"})}else{g.fire("ui.screenCaptureStart")}})},_bindDataEvents:function(){},_bindOnceEvent:function(){var b=this;g.add("ui.chatWindow.render",function(){b._bindOnceEvent=null;if(a.tool.upload){a.tool.upload(b._root).done(function(c){c.setUid(b.currentUID+"");c.onNotice(function(b,c){switch(b){case"show":case"hide":g.fire("ui.swf.upload.setTitle",{flg:b=="show"?true:false,idx:c=="img"?0:1});break;case"start":g.fire("ui.swf.upload.start");g.fire("ui.swf.upload.setTitle",{flg:false});break;case"success":var d=c.data;var e=d.vfid||d.fid,f=this;var h=[d.vfid,d.tovfid];setTimeout(function(){c.code==1&&g.fire("ui.swf.upload.complete",{swfid:c.target,fileName:a.webim.utils.string.escapeHTML(c.fileName),ext:{fid:d.fid,name:a.webim.utils.string.escapeHTML(c.fileName),size:c.fileSize,tfid:d.tovfid,vfid:d.vfid,tovfid:d.tovfid,type:a.webim.utils.Core.getFileImg(c.fileName),thumbnail:d.thumbnail_120?d.thumbnail_120+k:null,preview:l.replace("FID",d.tovfid),pic:d.thumbnail_120?d.thumbnail_120+k:null}})},150);f._disableFlg=u=true;break;case"error":g.fire("ui.swf.upload.showMsg",{err_code:c.code});break;default:break}});var d=b._screenCap?"-107px":"30px";c.setStyles({marginLeft:d,"z-index":1500,position:"relative",top:"3px",overflow:"hidden"});g.add("ui.changeChatUser",function(a,b){setTimeout(function(){c.setUid(b.uid)},100)});g.add("ui.screenCaptureData",function(a,b){c&&c.upload(b.base64)});if(a.core.util.browser.IE6||a.core.util.browser.IE7){c.setStyles({marginTop:"1px"})}g.add("ui.cancelUpload",function(){b._disableFlg=u=false});g.add("ui.deleteUpload",function(){b._disableFlg=u=false});g.add("msg.user.send",function(){b._disableFlg=u=false});h(b._fileA,"mouseover",function(){c.setStyles({left:"48px"})});h(b._imgA,"mouseover",function(){c.setStyles({left:"43px"})})})}})}};return v});
$WBIM.register("webim.ui.chatWindow.previewBox",function(a){var b=$WBIM.language;var c=b(["<!-- 打开大图 -->",'<div class="pic_b_mod" style="display:none; top:0px; right:401px;" node-type="webim_preview_root">','    <div class="mod_bg">',"        <!--多媒体操作区-->",'        <div class="tab_feed_a clearfix" node-type="webim_preview_picbar" style="">','            <div class="tab">','                <ul class="clearfix">','                    <li node-type="webim_preview_down"><span class="line"><a href="javascript:void(0);" onclick="return false;" title="#L{下载}"><i class="W_ficon ficon_download S_ficon" >|</i>下载</a></span></li>','                    <li node-type="webim_preview_turn_left"><span class="line"><a href="javascript:void(0);" onclick="return false;" title="#L{向左转}" ><i class="W_ficon ficon_turnleft S_ficon">m</i>向左转</a></span></li>','                    <li node-type="webim_preview_turn_right"><span class="line"><a href="javascript:void(0);" onclick="return false;" title="#L{向右转}"><i class="W_ficon ficon_turnright S_ficon">n</i>向右转</a></span></li>','                    <li node-type="webim_preview_close"><a href="javascript:void(0);" onclick="return false;" class="W_ficon ficon_close S_ficon" title="#L{关闭}">X</a></li>',"                </ul>","            </div>","        </div>","        <!--多媒体操作区-->",'        <div class="pic_box" node-type="webim_preview_picbox" style="height:358px;width: 402px;">','           <div class="pic_mod" node-type="webim_preview_pic">',"           </div>","        </div>","    </div>","</div>"].join(""));var d=400;var e=355;var f=a.core.dom,g=a.core.evt.addEvent,h=a.webim.ui.uiEvent;var i=a.core.evt.stopEvent;var j="http://upload.api.weibo.com/2/mss/msget?source=209678993&fid=";var k=function(){var b=f.builder(c);this._root=b.list["webim_preview_root"][0];this.closeBT=b.list["webim_preview_close"][0];this.downBT=b.list["webim_preview_down"][0];this.leftBT=b.list["webim_preview_turn_left"][0];this.rightBT=b.list["webim_preview_turn_right"][0];this.wrapNode=b.list["webim_preview_picbox"][0];this.boxNode=b.list["webim_preview_pic"][0];this.picBar=b.list["webim_preview_picbar"][0];this.scroll=new a.webim.ui.scroll(this.wrapNode);this.img;this._lastImgUrl;this._openFlg;this.bindDomEvents();this.bindDataEvents();this.rot=0;this.offset;this.initArea;this.fid};k.prototype={render:function(a){f.insertElement(a,this._root)},bindDomEvents:function(){var b=this;g(this.leftBT,"click",function(a){b.rotationTurn(false)});g(this.img,"load",function(a){if(b.interval){clearInterval(b.interval);b.interval=null;b.checkArea()}});g(this.rightBT,"click",function(a){b.rotationTurn(true)});g(this.downBT,"click",function(a){window.open(j+b.fid,"_blank");i(a)});if(a.core.util.browser.IE6){g(this._root,"mouseover",function(a){b.picBar.style.display="";b.picBar.style.visibility="visible"});g(this._root,"mouseout",function(a){b.picBar.style.display="none";b.picBar.style.visibility="hidden"})}g(document.body||document.documentElement,"click",function(c){c=c||window.event;var d=c.target||c.srcElement;if(b._openFlg){if(d===b.closeBT||a.core.dom.contains(b.closeBT,d)||!a.core.dom.contains(b._root,d)||d===b.downBT){b.hide()}}})},bindDataEvents:function(){var a=this;h.add("ui.previewBox.changeUrl",function(b,c){a.show();var d=j+c.fid;a.fid=c.fid;if(a._lastImgUrl&&a._lastImgUrl==d){a.rotation(0)}else{if(a.img){a.boxNode.removeChild(a.img);a.img=null}a.img=document.createElement("img");a.img.className="dialogue_img smallcursor";a.img.style.cssText="position:relative;";a.boxNode.appendChild(a.img);a.initArea={w:a.img.offsetWidth,h:a.img.offsetHeight};a.resetStyle();a.img.src=a._lastImgUrl=d;a.downBT.href=d;a.checkImgSize()}});h.add("ui.beforeHideChatWindow",function(b){a.hide()});h.add("ui.user.click",function(b,c){a.hide()})},show:function(){this.rot=0;this._openFlg=true;f.setStyle(this._root,"display","block");this.scroll.init()},hide:function(){this._openFlg=false;f.setStyle(this._root,"display","none");if(a.core.util.browser.IE6)this.picBar.style.visibility="hidden"},rotationTurn:function(a){if(a){this.rot=(this.rot+1)%4}else{this.rot=(this.rot+3)%4}this.rotation(this.rot)},rotation:function(a){this.img.className="rotate"+a;this.rot=a;this.checkImgSize();this.scroll.init()},checkArea:function(){var b=this.img,c=this.boxNode;this.resetStyle();b.style.visibility="";if(this.rot%2==0){if(b.offsetWidth>d){b.style.width=d+"px"}else{b.style.left=(d-b.offsetWidth)/2+"px"}if(b.offsetHeight<=e){b.style.top=(e-b.offsetHeight)/2+"px"}else{};}else{if(!a.core.util.browser.IE){if(b.offsetHeight>d){b.style.height=d+"px"}else{b.style.top=(e-b.offsetHeight)/2+"px"}b.style.left=(d-b.offsetWidth)/2+"px"}else{if(b.offsetWidth>e){b.style.height=e+"px"}else{b.style.left=(d-b.offsetWidth)/2+"px"}if(b.offsetHeight<e){b.style.top=(e-b.offsetHeight)/2+"px"}else{};}}this.scroll.init()},resetStyle:function(){var a=this.img,b=this.boxNode;a.style.top="0";a.style.left="0";a.style.width="";a.style.height="";a.style.visibility="hidden"},checkImgSize:function(){if(this.interval)return;var a=this;var b=a.img;if(a.initArea&&b){b.onload=function(){var c=b.offsetWidth;var d=b.offsetHeight;if(c!=a.initArea.w||d!=a.initArea.h){clearInterval(a.interval);a.interval=null;a.checkArea();a.initArea=null}}}else{a.checkArea()}}};return k});
$WBIM.register("webim.ui.chatWindow.longMsg",function(a){function n(a,b){if(typeof a!=="string"){return a}if(b){a=a.replace(/\&/g,"&amp;")}return a.replace(/\</g,"&lt;").replace(/\>/g,"&gt;").replace(/\n/g,"<br>").replace(/\s/g,"&nbsp;")}var b=a.core.dom.builder;var c=a.webim.utils.date;var d=$WBIM.language;var e=d(['<div class="pic_b_mod font_b_mod" style="position:absolute;right:400px;bottom:-1px;z-index:9500;" node-type="root"><!-- js控制上下居中 -->','    <div class="mod_bg">',"        <!--多媒体操作区-->",'        <div class="tab_feed_a clearfix">','            <div class="tab">','                <ul class="clearfix">','                    <li><span class="line"><a href="javascript:void(0);" onclick="return false;" node-type="sourceNode"><em class="W_ficon ficon_arrow_bigimg S_ficon">l</em>原文</a></span></li>','                    <li><a href="javascript:void(0);" onclick="return false;" class="W_ficon ficon_close S_ficon" node-type="closeNode">X</a></li>',"                </ul>","            </div>","        </div>","        <!--多媒体操作区-->","        <!-- 图片区域 -->",'        <div class="pic_box font_box">','            <div class="pic_mod">','                <p class="font_title S_txt2"><span  node-type="msgSender">来自</span><span node-type="msgDate">今天</span></p>','                <div class="font_page" style="position:relative;overflow: hidden;height:333px;" node-type="pageZone">','                    <p node-type="showZone" ></p>',"                </div>","            </div>","            <!-- 滚动条 -->","            <!-- 滚动条 -->","        </div>","        <!-- 图片区域 -->","    </div>","</div>"].join(""));var f="http://weibo.com/p/230491";var g="http://weibo.com/message/history?source=webim&uid=";var h=a.core.dom,i=a.core.evt.addEvent,j=a.webim.ui.uiEvent;var k=a.core.util.templet;var l="#{text}";var m=a.webim.utils.Core.getCurrentUIDByCookie();var o=function(){var c=b(e).list;for(var d in c){var f=c[d];this[d]=f.length>1?f:f[0]}this.scroll=new a.webim.ui.scroll(this.pageZone);this.activeUid;this.sourceUrl;this.bindDomEvents();this.bindDataEvents()};o.prototype={render:function(a){h.insertElement(a,this.root)},bindDomEvents:function(){var b=this;i(this.closeNode,"click",function(){b.hide()});i(this.sourceNode,"click",function(){if(b.activeGid){window.open(f+b.activeGid,"_blank")}else if(b.activeUid){window.open(g+b.activeUid,"_blank")}});i(document.body||document.documentElement,"click",function(c){c=c||window.event;var d=c.target||c.srcElement;if(b._openFlg){if(d===b.closeNode||!a.core.dom.contains(b.root,d)){b.hide()}}})},bindDataEvents:function(){var b=this;j.add("ui.changeChatUser",function(a,c){if(c.uid){b.activeUid=c.uid;b.activeGid=null}else if(c.gid){b.activeGid=c.gid;b.activeUid=null}});j.add("ui.previewBox.changeUrl",function(a,c){b.hide()});$WBIM.watch("IM:object.show",function(a){b.sourceNode.href=a.url;b.showZone.innerHTML=a.html;b.author.href=a.path;b.author.innerHTML=a.nick;b.msgDate.innerHTML=a.date;b.initScroll();b.show()});j.add("ui.longMsg.show",function(d,e){b.show();var f=e.mid;var g=e.gid;if(g&&f){a.group.queryMessage(g,f).done(function(d){var e=d.message;a.group.getGroup(g).done(function(a){b.activeGid=g;var d=a.name||a.system_name||"";var f=c.getMsgTimeLine(e.time*1e3);b.msgSender.innerHTML="来自"+d;b.msgDate.innerHTML=f;var h=n(e.content);b.showZone.innerHTML=k(l,{text:h});b.initScroll()})})}else if(f){a.jsonp({url:"http://api.weibo.com/2/direct_messages/show_batch.json?is_encoded=1&source=209678993&is_complete=1&dmids="+f,onComplete:function(a){var a=a.data[0];var d=a.text;d=d.replace(/\n/g,"<br>");d=d.replace(/ /g,"&nbsp;");b.activeUid=a.recipient_id==m?a.sender_id:a.recipient_id;var e=a.sender_screen_name;var f=c.getWeiboTime(a.created_at);b.msgSender.innerHTML="来自"+e;b.msgDate.innerHTML=f;b.showZone.innerHTML=k(l,{text:d});b.initScroll()}})}});j.add("ui.beforeHideChatWindow",function(a){b.hide()});j.add("ui.user.click",function(a,c){b.hide()})},initScroll:function(){var a=this;setTimeout(function(){a.scroll.init()},50)},show:function(){this._openFlg=true;h.setStyle(this.root,"display","block");h.setStyle(this.root,"visibility","visible")},hide:function(){this._openFlg=false;h.setStyle(this.root,"display","none");h.setStyle(this.root,"visibility","hidden");this.showZone.innerHTML=""}};return o});
$WBIM.register("webim.ui.chatWindow.msgList.headImage",function(a){function e(a){var c;if(a.uid){c=d(b,{imgServer:a.uid%4+1,uid:a.uid,avatar:a.avatar||0,sex:0})}return c}var b="http://tp#{imgServer}.sinaimg.cn/#{uid}/30/#{avatar}/#{sex}";var c='<span class="head_img_#{countType}"><img width="30" height="30" class="S_line2" src="#{headSrc}"/></span>';var d=a.core.util.templet;return{getUserSrc:e,getGroupAvatarHTML:function(a){return d(c,{countType:"one",headSrc:a})},getGroupAvatarHTMLByURLs:function(a){var b=a.length;var e;var f=["one","two","three","four"];var g=[];for(e=0;e<b;e++){g.push(d(c,{countType:f[e],headSrc:a[e]}))}return g.join("")}}});
$WBIM.register("webim.ui.chatWindow.msgList.item",function(a){var b='<li node-type="contact_item_#{uid}" action-type="focusItem" action-data="uid=#{uid}&type=user" class="contacts SW_fun_bg clearfix">'+'<div class="head W_fl">'+'<img width="30" height="30" src="#{headSrc}">'+"</div>"+'<p node-type="nick" class="name W_autocut W_fl S_txt1">#{nick}</p>'+'<div class="number W_fr"><em style="display:none;" node-type="num" data-id="#{uid}" class="W_new_count"></em></div>'+'<div class="close W_fr"><a action-type="close" action-data="uid=#{uid}&type=user" href="javascript:;" class="W_ficon ficon_close S_ficon">X</a></div>'+"</li>";var c='<li node-type="contact_item_#{gid}" action-type="focusItem" action-data="gid=#{gid}&type=group" class="contacts SW_fun_bg clearfix">'+'<div node-type="headList" class="head head_#{countName} W_fl clearfix">#{headListImg}<span class="icon_shield_group" style="display:#{remind_setting};" node-type="shieldmark"></span></div>'+'<p node-type="nick" class="name W_autocut W_fl S_txt1">#{nick}</p>'+'<div class="number W_fr"><em style="display:none;" node-type="num" data-id="#{gid}" class="W_new_count"></em></div>'+'<div class="close W_fr"><a action-type="close" action-data="gid=#{gid}&type=group" href="javascript:;" class="W_ficon ficon_close S_ficon">X</a></div>'+"</li>";var d=a.core.util.templet;var e=a.webim.ui.chatWindow.msgList.headImage;var f=a.core.str.encodeHTML;return function(a,g){function m(){k()}function l(a){var b=a.avatarURLs;var c=a.avatar;var d;if(c){d=e.getGroupAvatarHTML(c)}else if(b){d=e.getGroupAvatarHTMLByURLs(b)}return d}function k(){}function j(a){if(typeof a!=="string"){return a}return a.replace(/\</g,"&lt;").replace(/\>/g,"&gt;").replace(/\u00A0/g,"&nbsp;").replace(/(\u0020|\u000B|\u2028|\u2029|\f)/g,"&#32;")}var h;var i;h={getHTML:function(){var h;var i;var k;var m;var n=["one","two","three","four"];if(!g){h=a[0];i=d(b,{headSrc:h.imgURL||e.getUserSrc(h),nick:j(h.nick||""),uid:h.uid,remind_setting:h["allow_all_act_msg"]==false?"block":"none"})}else{k=g.avatarURLs||[];i=d(c,{gid:g.gid,nick:f(g.name||""),countName:k?n[Math.max(0,k.length-1)]:"one",headListImg:l(g),remind_setting:g["remind_setting"]==1?"block":"none"})}return i},destroy:function(){}};m();return h}});
$WBIM.register("webim.ui.chatWindow.msgList.itemList",function(a){var b=a.webim.ui.chatWindow.msgList.item;var c=a.core.util.templet;var d='<div node-type="contact_slider_root" class="webim_contacts_bd">'+'<div class="webim_tab_bd">'+'<div class="webim_contacts_group">'+'<div node-type="wbEmpty" class="WB_empty" style="display:none">'+'<div class="WB_innerwrap">'+'<div class="empty_con clearfix">'+'<p class="text">搜索你的联系人发条私信吧~</p>'+"</div>"+"</div>"+"</div>"+'<ul node-type="contact_list" class="webim_contacts_list">#{list}</ul>'+"</div>"+"</div>"+"</div>";var e="99+";var f="contacts S_bg1 clearfix";var g="contacts SW_fun_bg clearfix";var h="switch";return function(i){function A(b){var c=v(b);var d=a.sizzle('[node-type="num"]',c)[0];d&&(d.style.display="none")}function z(){o.style.display=k>0?"none":""}function y(b){var c=v(b);var d=a.core.dom.getSize(c).height;var e=m.getElementsByTagName("li");var f;var g=e.length;var h;var i=n.scrollTop;var j;var k=a.core.dom.getSize(m).height;for(f=0;f<g;f++){if(c===e[f]){h=d*f;j=f;break}}if(h<i||h+d-i>k){q.setPos(j/g)}}function x(a){if(l[a.id]){return""}var c;c=b(null,{gid:a.id,avatarURLs:a.group_avatar_urls||[],name:a.name,remind_setting:a["remind_setting"]});l[a.id]=c;return c.getHTML()}function w(a){if(l[a.id]){return""}var c={uid:a.id,nick:a.remark||a.screen_name,imgURL:a.profile_image_url,allow_all_act_msg:a["allow_all_act_msg"]};var d=b([c]);l[a.id]=d;return d.getHTML()}function v(b){if(m){return a.sizzle('[node-type="contact_item_'+b+'"]',m)[0]}}function u(){t()}function t(){a.custEvent.define(j,[h])}var j;var k=0;var l={};var m;var n;var o;var p;var q;var r;var s=a.core.str.encodeHTML;j={render:function(b){var e;var f=b.length;var g=[];var h;var j={1:w,2:x};k=f;for(e=0;e<f;e++){h=j[b[e].type||"1"];h&&g.push(h(b[e]))}i.innerHTML=c(d,{list:g.join("")});n=a.sizzle('[node-type="contact_slider_root"]',i)[0];m=a.sizzle('[node-type="contact_list"]',i)[0];o=a.sizzle('[node-type="wbEmpty"]',i)[0];z();q=new a.webim.ui.scroll(n);q.init()},add:function(c){var d;var e;var f=c.groupInfo||{};e=c.uid||f.gid;if(!m||!e||l[e]){return}if(c.groupInfo){d=b(null,c.groupInfo);m.innerHTML=d.getHTML()+m.innerHTML;l[e]=d;k++;c.callBack&&c.callBack();q.init();z()}else if(c.uid){a.api.getUser(c.uid).done(function(a){d=b([a]);m.innerHTML=d.getHTML()+m.innerHTML;l[e]=d;k++;c.callBack&&c.callBack();q.init();z()})}},append:function(a){var b;var c=a.length;var d=[];var e;var f={1:w,2:x};for(b=0;b<c;b++){e=f[a[b].type||"1"];e&&d.push(e(a[b]))}var g=d.join("");m.innerHTML=m.innerHTML+g;k+=c;q.init();z()},remove:function(a){var b;if(l[a]){b=v(a);b&&b.parentNode&&b.parentNode.removeChild(b);delete l[a];k--;q.init();z();return true}},unread:function(b){var c;var d=a.sizzle('[node-type="num"]',i);var f=d.length;var g;var h={};var j;var k;while(f--){g=d[f].getAttribute("data-id");h[g]=d[f]}for(j in b){if(h[j]){k=Math.max(0,b[j]);c=k>99?e:k;if(k===0||j==p){h[j].style.display="none"}else{h[j].style.display=""}h[j].innerHTML=c}else{};}},protrudeItem:function(a){var b;var c;var d;if(m){c=m.childNodes;d=c.length;if(d){b=v(a);b&&m.insertBefore(b,c[0])}q.scrollToTop()}},highlight:function(b){var c;var d;var e;var i;var k;c=v(b);if(c){e=a.queryToJson(c.getAttribute("action-data"))||{};r=e.type;i=p;if(p){d=v(p);if(d){d.className=g;k=(a.queryToJson(d.getAttribute("action-data"))||{}).type}}c.className=f;p=b;a.custEvent.fire(j,h,{preID:i,preType:k,id:b,type:r});A(b);y(b)}},getTopItemData:function(){var b;var c;if(m){b=a.sizzle("li",m)[0];if(b){c=a.core.json.queryToJson(b.getAttribute("action-data"));return c}}},changeText:function(b,c){var d=v(b);var e;if(d){e=a.sizzle('[node-type="nick"]',d)[0];e&&(e.innerHTML=s(c||""))}},getHighlightID:function(){return p},getHighlightType:function(){return r},initScroll:function(){q&&q.init()},scrollToTop:function(){q&&q.scrollToTop()},count:function(){return k},getItem:function(a){return l[a]},changeRemindType:function(b,c){var d=v(b);var e;if(d){e=a.sizzle('[node-type="shieldmark"]',d)[0];e&&(e.style.display=c?"block":"none")}},destroy:function(){a.custEvent.undefine(j)}};u();return j}});
$WBIM.register("webim.ui.chatWindow.msgList.main",function(a){var b=a.webim.ui.uiEvent;var c=a.webim.ui.chatWindow.msgList.itemList;var d="http://api.weibo.com/groupchat/query.json";var e="http://api.weibo.com/2/direct_messages/friends/delete.json";var f="http://api.weibo.com/2/direct_messages/friends.json";return function(){function w(){p();window.setInterval(o,1e3)}function v(){u(function(a){var b=[];for(var c=20;c<50;c++){a[c]&&b.push(a[c])}j.append(b)},50)}function u(b,c){a.jsonp({url:f,args:{source:"209678993",type:2,count:c||20},onComplete:function(a){if(a&&a.data&&a.data.friends){b(a.data.friends)}else{b([])}}})}function t(c,d,f){var g={};var h;var i={user:"removeUser",group:"removeGroup"};var k;var l;if(!j.remove(c)){return}f&&a.api.chatSync(i[d],c).done(function(a){});if(j.count()>0){if(j.getHighlightID()==c){k=j.getTopItemData()}}else{b.fire("ui.contactList.empty",{})}a.jsonp({url:e,args:{source:"209678993",types:d==="group"?2:"",ids:c},onComplete:function(a){}});return k}function s(b,c,d){if(c){a.group.getNoticeSetting(c.gid).done(function(a){c.remind_setting=a["switch"]||1;j.add({groupInfo:c,callBack:d})})}else if(b){j.add({uid:b,callBack:d})}}function r(a,b){var c={};var d;for(d in a){c[d]=a[d]}for(d in b){c[d]=b[d]}j.unread(c)}function q(b,c){a.jsonp({url:d,args:{source:"209678993",id:b},onComplete:function(a){if(a&&!a.error&&c){c(a)}}})}function p(){b.add(["msg.group.send","msg.user.send"],function(a,b){j.protrudeItem(b.uid||b.gid)});b.add(["sync.group.send","sync.user.send"],function(a,b){j.protrudeItem(b.uid||b.gid)});b.add("ui.closeChatUser",function(a,b){t(b.uid)});b.add("ui.closeChatGroup",function(a,b){t(b.gid)});b.add("manager.userNewMsg",function(a,b){var c=b.uid;var d=j.getItem(c);if(d){j.protrudeItem(c)}else{s(c)}});b.add("manager.groupNewMsg",function(a,b){var c=b.gid;var d=j.getItem(c);if(d){j.protrudeItem(c)}else if(c){q(c,function(a){s(null,{gid:c,avatar:a.avatar_s||a.avatar,name:a.name||a.system_name})})}});b.add("ui.miniChatWindow",function(){l=true});b.add("ui.group.changeTitle",function(a,b){var c=b.group_name;var d=b.gid;j.changeText(d,c)});b.add("ui.group.changeRemindType",function(a,b){var c=b.gid;var d=b["remind_type"]==1?true:false;j.changeRemindType(c,d)});b.add(["manager.meQuit","manager.kickMe"],function(a,c){var d=c.gid;var e;if(!isNaN(d)){e=t(d,"group",true);!l&&e&&b.fire("ui.user.click",e)}});b.before("ui.user.click",function(a,b){var c=b.uid||b.gid;if(!c){if(j.count()){itemData=j.getTopItemData();itemData.uid&&(b.uid=itemData.uid);itemData.gid&&(b.gid=itemData.gid)}}});b.after("ui.user.click",function(a,c){var d=c.uid||c.gid;var e=c.groupName;var f=c.uids;var g=j.getItem(d);var h;if(!d&&!j.count()){b.fire("ui.contactList.empty",{});return}if(g){j.highlight(d);if(c.type==="selGroup"||c.type==="selUser"){j.protrudeItem(d)}}else{if(c.uid){s(c.uid,null,function(){j.highlight(c.uid);j.scrollToTop()})}else if(c.type==="selGroup"){s(null,{gid:c.gid,avatarURLs:c.avatarURLs.split(","),name:c.groupName},function(){j.highlight(c.gid);j.initScroll();j.scrollToTop()})}else if(c.gid){q(c.gid,function(a){s(null,{gid:c.gid,avatar:a.avatar_s||a.avatar,name:a.name||a.system_name},function(){j.highlight(c.gid);j.scrollToTop()})})}}k=d;l=false});a.onUnreadChange(function(a){r(a.items||{},a.groupItems||{});m=a})}function o(){var b=j.getHighlightType();var c;var d=m.groupItems||{};if(l){return}if(b==="group"){c=j.getHighlightID();if(d[c]&&+d[c]>0){a.group.clearUnread(c).done()}}}var g;var h;var i="hide";var j;var k;var l=true;var m={};var n=0;h={render:function(d){j=c(d);g=a.core.evt.delegatedEvent(d);g.add("focusItem","click",function(a){var c=a.data;b.fire("ui.user.click",c)});g.add("focusItem","mouseover",function(b){var c=b.el;var d=a.sizzle('[node-type="num"]',c)[0];var e=a.sizzle('[action-type="close"]',c)[0];if(d&&e){e.style.display=d.style.display==="none"?"":"none"}});g.add("close","mousedown",function(c){var d=c.data.uid||c.data.gid;var e=c.data.type;var f=t(d,e,true);f&&b.fire("ui.user.click",f);a.stopEvent()});a.custEvent.add(j,"switch",function(b,c){c.type==="group"&&c.id&&a.group.clearUnread(c.id).done();c.preType==="group"&&c.preID&&a.group.clearUnread(c.preID).done()});u(function(c){if(!c||!c.length){b.fire("ui.contactList.empty",{})}j.render(c);k&&j.highlight(k);for(var d in c){n+=c[d]["unread_count"]}if(n<a.getUnread().total){v()}})},count:function(){return j.count()},clear:function(){},show:function(){i="show"},hide:function(){i="hide"},getState:function(){return i},initScroll:function(){j.initScroll()},destroy:function(){}};w();return h}});
$WBIM.register("webim.ui.chatWindow.msgEditor.toolBar",function(a){var b=$WBIM.language;var c=a.core.dom.setStyle;var d=b(["<!-- 多功能区域 -->",'<div class="sendbox_mod_r W_fl"  style="height:30px;" node-type="wbim_chat_toolbar">','    <div class="sendbox_bar">','        <div class="sendbox_menu " node-type="_container">','            <a href="javascript:void(0);" onclick="return false;" class="icon_send" node-type="_face" suda-uatrack="key=tblog_webim_behavior5&value=expression_button" title="表情"><em class="W_ficon ficon_face" >o</em></a>','            <a href="javascript:void(0);" onclick="return false;" class="icon_send" suda-uatrack="key=tblog_webim_behavior5&value=send_private_picture" suda-uatrack="key=tblog_webim_behavior5&value=send_private_annex"><em class="W_ficon ficon_image" >p</em></a>','            <a href="javascript:void(0);" onclick="return false;" class="icon_send"><em class="W_ficon ficon_file">x</em></a>',"        </div>",'        <p class="prompt" node-type="prompt" style="display: none;">-1000</p>',"    </div>","</div>","<!-- 图片预览 -->",'<div class="W_layer W_layer_pop" style="display:none; bottom:70px; right:29px;" node-type="previewNode">','    <div class="content layer_mini_info">','       <div class="img_cont">','           <div class="img_cont_two">','               <img node-type="_previewNode" alt="">',"           </div>","        <div>",'        <div class="W_layer_arrow"><span class="W_arrow_bor W_arrow_bor_b"  ><i class="S_line3"></i><em class="S_bg2_br"></em></span></div>',"    </div>","</div>"].join(""));var e=a.webim.ui,f=a.core.dom;var g=a.webim.ui.uiEvent;var h=a.core.evt.addEvent;var i=[{content:b("#L{上传图片}"),position:[50,30]},{content:b("#L{上传附件}"),position:[80,30]},{content:b("#L{发送表情}"),position:[20,30]},{content:b("#L{发送截屏}"),position:[110,30]}];var j=[{content:b("#L{替换图片}"),position:[50,30]},{content:b("#L{替换附件}"),position:[80,30]},{content:b("#L{发送表情}"),position:[20,30]},{content:b("#L{发送截屏}"),position:[110,30]}];var k="&source=209678993",l="http://upload.api.weibo.com/2/mss/msget?source=209678993&fid=FID";var m=a.core.util.browser;var n=70;var o=22;var p;var q=function(){var a=f.builder(d);this._root=a.box;this._container=a.list["_container"][0];this._toolbar=a.list["wbim_chat_toolbar"][0];this._face=a.list["_face"][0];this._previewNode=a.list["_previewNode"][0];this.previewNode=a.list["previewNode"][0];this.prompt=a.list["prompt"][0];this._seq="webim_msgToolBar";a=null;d=null;this.currentUID;this.currentGID;this._bindDomEvents();this._bindDataEvents();this._bindOnceEvent()};q.prototype={render:function(a){f.insertElement(a,this._root)},_bindDomEvents:function(){var b=this;h(this._face,"click",function(c){g.fire("ui.phiz.show",{seq:b._seq,dom:b._face});a.stopEvent(c)});h(this._face,"mouseover",function(){g.fire("ui.swf.upload.setTitle",{flg:true,idx:2})});h(this._face,"mouseout",function(){g.fire("ui.swf.upload.setTitle",{flg:false,idx:2})});h(this._cap,"mouseover",function(){g.fire("ui.swf.upload.setTitle",{flg:true,idx:3})});h(this._cap,"mouseout",function(){g.fire("ui.swf.upload.setTitle",{flg:false,idx:3})});h(this._cap,"click",function(){if(b._disableFlg){g.fire("ui.swf.upload.showMsg",{err_code:"-3"})}else{g.fire("ui.screenCaptureStart")}});g.add("ui.deleteUpload",function(){if(b._openPreview){b.hidePreview()}});h(document.body||document.documentElement,"click",function(c){if(b._openPreview){if(!a.core.dom.contains(b.previewNode,c.srcElement||c.target)){b.hidePreview()}}})},_bindDataEvents:function(){var a=this;g.add("ui.upload.openPreview",function(b,c){a.showPreview(c)});g.add("ui.user.click",function(b,c){if(c.uid){a.currentUID=c.uid;a.currentGID=null}else if(c.gid){a.currentGID=c.gid;a.currentUID=null}});g.add("ui.editor.changeHeight",function(b,d){var e=d.height;if(e){c(a.previewNode,"bottom",e-o+n+"px")}});g.add(["msg.user.send","msg.group.send"],function(b,c){if(a._openPreview){a.hidePreview()}});g.add("ui.msgEditor.showCount",function(b,c){if(c.num>0){a.showPromot(c.num)}else{a.hidePromot()}})},_bindOnceEvent:function(){var b=this;g.add("ui.chatWindow.render",function(){b._bindOnceEvent=null;if(a.tool.upload){a.tool.upload(b._toolbar).done(function(c){if(b.currentUID){c.setUid(b.currentUID)}else if(b.currentGID){c.setGid(b.currentGID)}c.onNotice(function(b,c){switch(b){case"show":case"hide":g.fire("ui.swf.upload.setTitle",{flg:b=="show"?true:false,idx:c=="img"?0:1});break;case"start":g.fire("ui.swf.upload.start");g.fire("ui.swf.upload.setTitle",{flg:false});break;case"success":var d=c.data;var e=d.vfid||d.fid,f=this;var h=[d.vfid,d.tovfid];setTimeout(function(){c.code==1&&g.fire("ui.swf.upload.complete",{swfid:c.target,fileName:a.webim.utils.string.escapeHTML(c.fileName),ext:{fid:d.fid,name:a.webim.utils.string.escapeHTML(c.fileName),size:c.fileSize,tfid:d.tovfid,vfid:d.vfid,tovfid:d.tovfid,type:a.webim.utils.Core.getFileImg(c.fileName),thumbnail:d.thumbnail_120?d.thumbnail_120+k:null,preview:l.replace("FID",d.tovfid),pic:d.thumbnail_120?d.thumbnail_120+k:null}})},150);f._disableFlg=p=true;break;case"error":g.fire("ui.swf.upload.showMsg",{err_code:c.code});break;default:break}});var d=b._screenCap?"-107px":"30px";c.setStyles({marginLeft:d,"z-index":1500,position:"relative",top:"-22px",overflow:"hidden"});g.add("ui.changeChatUser",function(a,b){setTimeout(function(){if(b.uid){c.setUid(b.uid)}else if(b.gid){c.setGid(b.gid)}},100)});g.add("ui.screenCaptureData",function(a,b){c&&c.upload(b.base64)});if(a.core.util.browser.IE6||a.core.util.browser.IE7){c.setStyles({marginTop:"1px"})}g.add("ui.cancelUpload",function(){b._disableFlg=p=false});g.add("ui.deleteUpload",function(){b._disableFlg=p=false});g.add("msg.user.send",function(){b._disableFlg=p=false});h(b._fileA,"mouseover",function(){c.setStyles({left:"48px"})});h(b._imgA,"mouseover",function(){c.setStyles({left:"43px"})})})}})},showPreview:function(a){var b=a.data;var c=b.ext;this._openPreview=true;f.setStyle(this.previewNode,"display","block");this._previewNode.src=c.thumbnail;this._previewNode.setAttribute("fid",c.fid);this._previewNode.setAttribute("name",c.name);this._previewNode.setAttribute("preview",c.pic)},hidePreview:function(){this._openPreview=false;f.setStyle(this.previewNode,"display","none")},showPromot:function(a){c(this.prompt,"display","");this.prompt.innerHTML=-a},hidePromot:function(){c(this.prompt,"display","none")}};return q});
$WBIM.register("webim.utils.autoHeightTextArea",function(a){var b=a.core.util.browser.MOZ;var c=a.core.util.browser.IE6||a.core.util.browser.IE7||a.core.util.browser.IE8;var d=function(d){var e=a.core.dom.getStyle,f;if(!d.defaultHeight){d.defaultHeight=parseInt(e(d,"height"),10)||parseInt(d.offsetHeight,10)||20}if(c){var g=parseInt(e(d,"paddingTop"),10)+parseInt(e(d,"paddingBottom"),10);f=Math.max(d.scrollHeight-g,d.defaultHeight)}else{var g=b?0:parseInt(e(d,"paddingTop"),10)+parseInt(e(d,"paddingBottom"),10);var h=a.E("_____textarea_____");if(!h){h=a.C("textarea");h.id="_____textarea_____";document.body.appendChild(h)}if(h.currentTarget!=d){var i=[];i.push("width:"+e(d,"width"));i.push("font-size:"+e(d,"fontSize"));i.push("font-family:"+e(d,"fontFamily"));i.push("line-height:"+e(d,"lineHeight"));i.push("padding-left:"+e(d,"paddingLeft"));i.push("padding-right:"+e(d,"paddingRight"));i.push("padding-top:"+e(d,"paddingTop"));i.push("padding-bottom:"+e(d,"paddingBottom"));i.push("top:-1000px");i.push("height:0px");i.push("position:absolute");i.push("overflow:hidden");i.push("");i=i.join(";");h.style.cssText=i}h.value=d.value;f=Math.max(h.scrollHeight-g,d.defaultHeight);h.currentTarget=d}return f};return function(b){function i(b){var c=a.core.dom.getStyle,d;var e=[];e.push("width:"+c(b,"width"));e.push("font-size:"+c(b,"fontSize"));e.push("font-family:"+c(b,"fontFamily"));e.push("line-height:"+c(b,"lineHeight"));e.push("padding-left:"+c(b,"paddingLeft"));e.push("padding-right:"+c(b,"paddingRight"));e.push("padding-top:"+c(b,"paddingTop"));e.push("padding-bottom:"+c(b,"paddingBottom"));e.push("top:-1000px");e.push("height:0px");e.push("position:absolute");e.push("overflow:hidden");e.push("");e=e.join(";");return e}var c=b.textArea,e=b.maxHeight,f=b.inputListener,g=c.style,h;(h=function(){setTimeout(function(){var a=d(c),b;e=e||a;var h=a>e;b=h?e:a;g.overflowY=h?"auto":"hidden";g.height=Math.min(e,a)+"px";typeof f==="function"&&f()},0)})();if(!c.binded){a.addEvent(c,"keyup",h);a.addEvent(c,"focus",h);a.addEvent(c,"blur",h);c.binded=true;c.style.overflow="hidden"}}});
$WBIM.register("webim.ui.chatWindow.msgEditor.frame",function(a){var b=a.webim.ui,c=a.core.evt.addEvent,d=a.core.dom,e=d.builder,f=a.core.arr.foreach,g=a.core.str.trim,h=a.webim.utils.Core,i=$WBIM.language,j=a.webim.ui.uiEvent,k=a.core.evt.stopEvent;var l=window.SUDA.uaTrack;var m=a.core.dom.addClassName;var n=a.core.dom.removeClassName;var o=a.webim.utils.string.escapeHTML;var p=a.core.util.browser;var q=a.core.dom.setStyle;var r=a.core.str.bLength;var s=a.core.str.leftB;var t=a.core.str.encodeHTML;var u=a.webim.utils.Core.getCurrentUIDByCookie();var v={};var w=window.location.host=="weibo.com"||window.location.host=="v6.weibo.com"||window.location.host=="www.weibo.com";var x=w?1e4:a.core.util.browser.IE?165:170,y=w?22e3:495,z=50,A=155;var B=a.core.util.browser.IE?165:170;var C=78;var D=["<!-- 发送 -->",'<div class="private_send_box S_bg2" style="position:absolute; bottom:0;" node-type="root" style="display:none;">',"<!-- 触发textarea 时加 sendbox_mod_focus -->",'    <div class="sendbox_mod clearfix S_line1"  node-type="_frameContent">',"        <!-- 私信模块 -->",'        <div class="sendbox_mod_l W_fl" node-type="_tipsNode">','            <div class="sendbox_area S_bg2" node-type="editorNode">','                <textarea class="W_input" style="" node-type="_editorNode" placeholder="按回车发送私信"></textarea>',"            </div>","        </div>","        <!-- 私信模块 -->","    </div>","</div>","<!-- 发送 -->"].join("");var E=i(['        <p class="private_tips_back S_txt2">#L{聊天网络断开}</p>'].join(""));var F=22;var G="sendbox_mod_focus";var H=a.webim.utils.autoHeightTextArea;var I=function(a,b){var c=document.body||document.documentElement;var d=document.selection.createRange(),e=c.createTextRange(),f=a.value,g=0,h=f.length,i=-1;e&&e.moveToElementText&&e.moveToElementText(a);if(e&&e.compareEndPoints){for(g=0;e.compareEndPoints("StartTo"+b,d)<0;g++){e.moveStart("character",1)}}for(var j=0;j<=g;j++){if(f.charAt(j)=="\n"){g++}}return g};var J=function(){var c=e(D).list;for(var d in c){var f=c[d];this[d]=f.length>1?f:f[0]}if(a.tool.upload){this.richText=new b.chatWindow.msgEditor.richText;this.richText.render(this._tipsNode);this.toolBar=new b.chatWindow.msgEditor.toolBar;this.toolBar.render(this._frameContent)}else{b.UploadTips=null}this._attach=false;this._currentUID=null;this._currentGID=null;this.bindDomEvents();this.bindDataEvents();this.textLength=0;this.inputingLock={};this.timeoutID={};this.enterForSend=true;this.selectPanelFlg=true;c=null;D=null;this.showFlag=false;this._seq="webim_msgToolBar"};J.prototype={render:function(a){d.insertElement(a,this.root);this.init()},bindDataEvents:function(){var a=this;$WBIM.onNotice(function(b,c){if(b=="setting"&&c.act=="refresh"){var d=c&&c.data&&c.data.send;a.enterForSend=d&&d!="E"?false:true}});j.add("ui.changeChatUser",function(b,c){if(c.uid){a._currentUID=c.uid;a._currentGID=null}else if(c.gid){a._currentGID=c.gid;a._currentUID=null}setTimeout(function(){a._setFocus()},500);if(!a.showFlag){a.show();a.showFlag=true}a.changeSavedMsg()});j.add("ui.hideUploadTips",function(b){!a._reconnecting&&a.setSendBtn(true);a._attach=false;a._checkLength()});j.add("ui.swf.upload.start",function(b,c){a.setSendBtn();a._attach=false});j.add("ui.swf.upload.complete",function(b,c){!a._reconnecting&&a.setSendBtn(true);var d=c.ext;var e;if(d.type.indexOf("image")!=-1&&d.thumbnail){e=true}else{e=false}a._attach=true;a._checkLength();a._saveCursorPos();a._editorNode.focus()});j.add("ui.swf.upload.showMsg",function(b,c){c.err_code!=-3&&(a._attach=false)});j.add("ui.deleteUpload",function(b){a.getCharacterLength()&&(a._editorNode.value=a._editorNode.value.replace("分享图片","").replace("分享文件",""))});j.add("ui.phiz.select",function(b,c){if(c.seq==a._seq){a.addPhiz(c)}});j.before("msg.user.send",function(a,b){b.isSend=true});j.add("ui.changeChatUser",function(){a.addAutoHeight&&a.addAutoHeight()});j.before(["msg.user.send","msg.group.send"],function(a,b){b.isSend=true});j.add("ui.contactList.empty",function(){a.hide()})},bindDomEvents:function(){var b=this,e=b._editorNode;f(["keyup","paste","cut","mousedown","mouseup","keydown","focus"],function(a,d){c(e,a,function(){clearTimeout(b._checkTimer);b._checkTimer=setTimeout(function(){b._checkInput()},500)})});c(e,"focus",function(a){m(b._frameContent,G)});c(e,"blur",function(a){n(b._frameContent,G)});c(e,"keydown",function(c){if(c.keyCode==13){if(b.enterForSend&&!c.ctrlKey||!b.enterForSend&&c.ctrlKey){a.core.evt.stopEvent(c);b.send()}else if(!b.enterForSend&&!c.ctrlKey||b.enterForSend&&c.ctrlKey){a.core.evt.stopEvent(c);if(document.selection&&document.selection.createRange){e.focus();var d=document.selection.createRange();d.text="\r\n";d.collapse(false);d.select()}else{e.value+="\n"}}}});if(a.core.util.browser.IE6){c(b._sendBtnSelect,"mouseover",function(){d.setStyle(b._sendBtnSelect,"backgroundPositionY","-30px")});c(b._sendBtnSelect,"mouseout",function(){d.setStyle(b._sendBtnSelect,"backgroundPositionY","0px")})}if(typeof FileReader!=undefined&&p.CHROME){c(this._editorNode,"paste",function(a){var b=a.clipboardData.items;for(var c=0;c<b.length;++c){if(b[c].kind=="file"&&b[c].type.indexOf("image/")!==-1){var d=b[c].getAsFile();var e=new FileReader;e.readAsDataURL(d);e.onload=function(){var a=this.result.replace(new RegExp("data:image.+;base64,","ig"),"");j.fire("ui.screenCaptureData",{base64:a})}}}})}},_checkInput:function(){this._cutContentForTooMuch();this._checkLength(true);this._saveCursorPos();this._checkTimer=null},_saveCursorPos:function(){var a=0,b=0,c=this._editorNode;if(c){if(typeof c.selectionStart=="number"){a=c.selectionStart;b=c.selectionEnd}else if(document.selection){a=I(c,"Start");b=I(c,"End")}}this._cursorPos={start:a,end:b,scrollTop:c.scrollTop}},addPhiz:function(a){var b=this._cursorPos||{start:0,end:0},c=this._editorNode.value,d=a?a.txt||"":"",c=c.substr(0,b.start)+d+c.substr(b.end);this._cursorPos=this._cursorPos||{start:0,end:0};this._cursorPos.end=b.start+d.length;this._cursorPos.start=this._cursorPos.end;this._editorNode.value=c;this._setFocus();this._checkLength()},_setFocus:function(){if(this.isHidden()){return}var a=this._editorNode;var b=0;var c=0;if(this._cursorPos){b=this._cursorPos.end||0;c=this._cursorPos.scrollTop||0}try{if(typeof a.selectionStart=="number"){this._editorNode.focus();a.selectionStart=a.selectionEnd=a.value.length}else if(document.selection){var d=a.createTextRange();var e=a.value;d.collapse(true);b=e.substr(0,b).replace(/[\n]/gi,"").length;d.moveStart("character",b);d.select()}}catch(f){}a.scrollTop=c},_checkLength:function(a){var b=this,c=this._currentUID,d=x;var e=this.getCharacterLength();this._attach&&(e+=z);j.fire("ui.msgEditor.showCount",{num:e-d});if(a&&c&&e!=this.textLength){if(e!=0){if(!this.inputingLock[c]){j.fire("request.user.chat",{uid:c,states:"c"});this.inputingLock[c]=true}clearTimeout(this.timeoutID[c]);this.timeoutID[c]=setTimeout(function(){j.fire("request.user.chat",{uid:c,states:"p"});b.timeoutID[c]=null;b.inputingLock[c]=false},5e3)}this.textLength=e}this.saveUnsavedMsg()},_cutContentForTooMuch:function(){var a=g(this._editorNode.value);if(r(a)>y){this._editorNode.value=s(a,y)}},getCharacterLength:function(){return Math.ceil(g(this._editorNode.value).replace(/[^\x00-\xff]/g,"aa").length/2)},overCountHandler:function(a){this._tipNode.innerHTML="";this._errorNode.innerHTML="-"+a},normalCountHandler:function(a){this._tipNode.innerHTML="";this._errorNode.innerHTML=""},send:function(){if(this._checkTimer){clearTimeout(this._checkTimer);this._checkInput()}if(this._currentUID){this.send2User()}else if(this._currentGID){this.send2Group()}this.saveUnsavedMsg()},send2Group:function(){var a=this._currentGID;var b=this;var c=j.value("data.attachInfo").attInfo;if($WBIM.getStatus()==="disconnected"){var d={gid:a,msg:E};j.fire("ui.content.addPureMsg",d);return}var e=this.getCharacterLength();if(e+(c?z:0)>x||e+(c?z:0)==0){this.flashContentNode();return}var f=this._editorNode.value;var g=f;setTimeout(function(){j.fire("msg.group.send",{gid:b._currentGID+"",ext:c,media_type:1,msg:g})},0);this._editorNode.value="";this._checkLength()},send2User:function(){var b,c,d=this._currentUID;var e=j.value("data.attachInfo").attInfo;b=this.getCharacterLength();if(b+(e?z:0)>x||b+(e?z:0)==0){this.flashContentNode();return}c=this._editorNode.value;if(this._attach){var f=(c||"分享内容").substring(0,150);setTimeout(function(){j.fire("msg.user.send",{msg:f,uid:d+"",ext:e,media_type:1})},500)}if(a.trim(c)){var g=this.getCharacterLength();if(g<B){j.fire("msg.user.send",{msg:c,uid:d+"",fromuserid:u})}else if(w){this.sendLongMsg(d,c)}}this._editorNode.value="";this._checkLength();this.inputingLock[d]=false;clearTimeout(this.timeoutID[d]);j.fire("request.user.chat",{uid:d,states:"p"})},helloUser:function(a){j.fire("msg.user.send",a)},flashContentNode:function(){var a=this,b=a._editorNode,c=0;if(g(b.value).length==0){b.value=""}(function(){if(c>3){return}d.setStyle(b,"background",c++%2?"":"#ffdddd");setTimeout(arguments.callee,150)})()},isHidden:function(){var a=this.root.style;return a.display=="none"||a.visibility=="hidden"},encodeLong:function(a){return a.replace(/&/g,encodeURIComponent("&"))},sendLongMsg:function(b,c){var d=this;a.core.io.ajax({method:"POST",url:"/aj/message/add?wvr=6",args:{source:"209678993",text:d.encodeLong(c),uid:b}})},setSendBtn:function(a){},setTipsPanel:function(a){this._editorNode.style.height=a?F+"px":"38px"},saveUnsavedMsg:function(){var a=this;var b=a._editorNode.value;if(a._currentUID){v[a._currentUID]=b}else if(a._currentGID){v[a._currentGID]=b}},init:function(){var b=this;var c=$WBIM.initData&&$WBIM.initData.setting&&$WBIM.initData.setting.chat&&$WBIM.initData.setting.chat.send;this.enterForSend=c&&c!="E"?false:true;var d=a.tool.storage.getItem("editor-text")||"";this._editorNode.value=d;setTimeout(function(){j.fire("ui.editor.changeHeight",{height:parseInt(b._editorNode.style.height)})},100)},changeSavedMsg:function(){if(this._currentUID){this._editorNode.value=v[this._currentUID]||""}else if(this._currentGID){this._editorNode.value=v[this._currentGID]||""}},addAutoHeight:function(){var a=this;H({textArea:this._editorNode,maxHeight:C,inputListener:function(){j.fire("ui.editor.changeHeight",{height:parseInt(a._editorNode.style.height)})}});this.addAutoHeight=null},show:function(){q(this.root,"display","");this.showFlag=true},hide:function(){q(this.root,"display","none");this.showFlag=false}};return J});
$WBIM.register("webim.ui.chatWindow.msgList.searchGroup",function(a){function f(a){var f;var g=a.length;var h=[];var i=["one","two","three","four"];var j;for(f=0;f<g;f++){urls=a[f].group_avatar_urls||[];urls=urls.slice(0,4);h.push(b(d,{headListImg:c.getGroupAvatarHTMLByURLs(urls),countName:i[urls.length-1],nick:e(a[f].groupname),gid:a[f].gid,avatarURLs:urls.join(",")}))}return h.join("")}function e(a){if(typeof a!=="string"){return a}return a.replace(/\</g,"&lt;").replace(/\>/g,"&gt;")}var b=a.core.util.templet;var c=a.webim.ui.chatWindow.msgList.headImage;var d=['<li action-type="selGroup" action-data="gid=#{gid}&groupName=#{nick}&avatarURLs=#{avatarURLs}&type=selGroup" class="contacts SW_fun_bg clearfix">','<div class="head head_#{countName} W_fl clearfix">#{headListImg}</div>','<p class="name W_autocut W_fl S_txt1">#{nick}</p>',"</li>"].join("");return{getHTML:f}});
$WBIM.register("webim.ui.chatWindow.msgList.search",function(a){function m(a){var b=a||"";return b.replace(/^\s+/,"").replace(/\s+$/,"")}var b=a.webim.ui.uiEvent;var c=$WBIM.language;var d=a.webim.ui.chatWindow.msgList.searchGroup;var e=a.core.util.templet;var f=a.core.io.jsonp;var g=['<div class="WB_empty">','<div class="WB_innerwrap">','<div class="empty_con clearfix">','<p class="text">'+c("#L{没有符合条件的结果}")+"</p>","</div>","</div>","</div>"].join("");var h=['<span class="WB_search_s">','<input type="text" maxlength="20" value="#{phText}" suda-data="key=webim_group_restr&value=webim_search_group" node-type="iptSearch" class="W_input">','<span class="pos">','<a href="javascript:;" title="搜索" class="W_ficon ficon_search S_ficon">f</a>',"</span>","</span>"].join("");var i=['<div class="webim_contacts_group">','<div class="webim_group_title #{groupLine} clearfix">','<span class="group_title_cont S_txt1 W_fl"><span class="name">#{typeName}</span></span>',"</div>",'<ul class="webim_contacts_list">#{list}</ul>',"</div>"].join("");var j=['<li action-type="selUser" action-data="uid=#{uid}&type=selUser" class="contacts SW_fun_bg clearfix">','<div class="head W_fl">','<img width="30" height="30" src="#{imgSrc}">',"</div>",'<p class="name W_autocut W_fl S_txt1">#{nick}</p>',"</li>"].join("");var k=c("#L{查找联系人或群}");var l="http://api.weibo.com/2/direct_messages/messageboxsearch.json";return function(n,o){function D(){n.innerHTML=e(h,{phText:k});q=a.sizzle('[node-type="iptSearch"]',n)[0];y(q);z();C()}function C(){r=a.core.evt.delegatedEvent(o.listNode);r.add("selUser","click",function(a){B();b.fire("ui.user.click",a.data)});r.add("selGroup","click",function(a){B();b.fire("ui.user.click",a.data)});a.addEvent(q,"keydown",function(a){if(a.keyCode===27){B()}});a.addEvent(q,"keydown",function(b){b=b||win.event;var c=b.keyCode?b.keyCode:b.which?b.which:b.charCode;if(c==40||c==38){!t&&(t=a.sizzle("li",o.listNode));u===null&&(u=c==40?-1:t.length);t[u]&&a.removeClassName(t[u],"cur");c==40?u++:u--;u<0&&(u=t.length-1);u>t.length-1&&(u=0);t[u]&&a.addClassName(t[u],"cur")}if(c==13){if(t!==null&&u!==null){t[u]&&t[u].click()}}})}function B(){o.listRootNode.style.display="none";o.concactNode.style.display="";o.settingNode.style.display="";q.value=""}function A(){o.listRootNode.style.display="";o.concactNode.style.display="none";o.settingNode.style.display="none"}function z(){var a;var b;window.setInterval(function(){m(a)!=m(q.value)&&(b=true);a=q.value},100);window.setInterval(function(){if(q.value==a&&b){v(q.value);b=false}},300)}function y(b){a.addEvent(b,"focus",function(){b.value===k&&(b.value="")});a.addEvent(b,"blur",function(){b.value===""&&(b.value=k)})}function x(a){var b;var c=a.length;var d=[];for(b=0;b<c;b++){d.push(e(j,{imgSrc:a[b].avatar_thumbnail,nick:a[b].remark||a[b].nickname,uid:a[b].uid}))}return d.join("")}function w(a){var b="";var f="";var h=[];if(a.contacts&&a.contacts.contact_result_list){b=e(i,{groupLine:"",typeName:c("#L{联系人}"),list:x(a.contacts.contact_result_list)})}if(a.groups){a.groups.group_result_list&&(h=a.groups.group_result_list.concat());h=h.slice(0,2);if(a.groups.group_member_result_list&&h.length<2){h=h.concat(a.groups.group_member_result_list);h=h.slice(0,2)}if(h.length){f=e(i,{groupLine:"group_line",typeName:c("#L{群}"),list:d.getHTML(h)})}}if(b||f){o.listNode.innerHTML=b+f}else{o.listNode.innerHTML=g}A();s.init();s.scrollToTop();t=null;u=null}function v(a){if(a&&m(a)!==""&&m(a)!==k){f({url:l,args:{key:encodeURIComponent(a),source:"209678993",types:"contact,group",pagecount:6},onComplete:function(a){a&&w(a.data||{})}})}else if(a===""){B()}}var p;var q;var r;var s=new a.webim.ui.scroll(o.scrollBox);var t=null;var u=null;p={destroy:function(){r.destroy()}};D();return p}});
$WBIM.register("webim.ui.chatWindow.msgList.setting",function(a){var b=$WBIM.language;var c=a.core.util.templet;var d=a.core.evt.delegatedEvent;var e=a.webim.ui.uiEvent;var f='<a suda-uatrack="key=webim_group_restr&value=restr_read_msg" target="blank" href="http://weibo.com/messages">查看全部私信</a>'+'<em style="display:none;" node-type="newMsg" class="W_new"></em>'+'<a href="javascript:;" action-type="menu" class="W_ficon ficon_setup S_ficon">J</a>'+'<div class="layer_menu_list" node-type="menuList" style="bottom:33px; right:24px; display:none">'+"<ul>"+'<li><a node-type="noticeSetting" action-type="setting" action-data="type=notice" href="javascript:;">#{noticeText}</a></li>'+'<li><a node-type="soundSetting" action-type="setting" action-data="type=sound" href="javascript:;">#{soundText}</a></li>'+"</ul>"+"</div>";var g={on:b("#L{开启新闻提醒}"),off:b("#L{关闭新闻提醒}")};var h={on:b("#L{开启声音提醒}"),off:b("#L{关闭声音提醒}")};return function(b){function w(){b.innerHTML=c(f,{noticeText:"",soundText:""});q();s();p();e.add("ui.refreshSetting",function(){s();p()})}function v(b,c,d){if(b==="sound"){l.innerHTML=c?h.off:h.on;j.sound=c?true:false}else if(b==="notice"){k.innerHTML=c?g.on:g.off;j.notice_block=c?1:0}d&&a.api.chatSync("setting",{type:b,value:c}).done(function(a){})}function u(){var a=j.sound?false:true;e.fire("request.setting.newMsgSound",{data:{sound:{status:a}},callback:function(){v("sound",a,true)}})}function t(){var a=j.notice_block?0:1;e.fire("request.setting.notice",{data:{notice:{block:a}},callback:function(){v("notice",a,true)}})}function s(){var a;if(window.$WBIM&&window.$WBIM.initData&&window.$WBIM.initData.setting){a=window.$WBIM.initData.setting;a.sound&&(j.sound=a.sound.status);a.notice&&(j.notice_block=a.notice.block)}}function r(a){var b;for(b in a){if(a[b]>0){return true}}}function q(){var c=d(b);c.add("setting","click",function(a){var b=a.data.type;var c={notice:t,sound:u};c[b]&&c[b]()});c.add("menu","click",function(b){window.SUDA&&window.SUDA.uaTrack&&window.SUDA.uaTrack("webim_group_restr","restr_set");m.style.display="";a.stopEvent()});a.addEvent(document.body,"click",function(){m.style.display="none"});a.onUnreadChange(function(a){var b=r(a.items||{})||r(a.groupItems||{})});e.add("ui.setting",function(a,b){v(b.data.type,b.data.value,!b.sync)})}function p(){b.innerHTML=c(f,{noticeText:j.notice_block?g.on:g.off,soundText:j.sound?h.off:h.on});k=a.sizzle('[node-type="noticeSetting"]',b)[0];l=a.sizzle('[node-type="soundSetting"]',b)[0];m=a.sizzle('[node-type="menuList"]',b)[0];n=a.sizzle('[node-type="newMsg"]',b)[0];o=a.sizzle('[action-type="menu"]',b)[0]}var i;var j={notice_block:0,sound:0};var k;var l;var m;var n;var o;i={destroy:function(){}};w();return i}});
$WBIM.register("webim.ui.chatWindow.tipsPop",function(a){var b=a.core.dom,c=a.core.util.templet,d=a.webim.ui.uiEvent;var e=$WBIM.language;var f={success:"succ","delete":"del",error:"error",warn:"warn"};var g={small:"S",middle:"M",big:"B"};var h='<span class="icon_#{icon_type}#{icon_size}"></span>#{content}';var i=['<div class="W_layer" style="" node-type="resultTip">','    <div class="content">','        <div class="layer_point">','            <dl class="point clearfix">','                <dt><span class="W_icon icon_succB"></span></dt>',"                <dd>",'                    <p class="S_txt1" node-type="result_info">操作成功</p>',"                </dd>","            </dl>","        </div>","    </div>","</div>"].join("");var j=[].join("");var k=e("#L{操作成功}");var l=e("#L{点击这里可以收起私信聊天}");var m=e("#L{设置失败}");var n=e("#L{已切换为}");var o=e("#L{在线状态}");var p=e("#L{隐身状态}");return function(a){var e=document.createElement("div");e.className="_mask_";e.style.cssText="position:absolute;right:0;top:0;background:#000;opacity:0.3;filter:alpha(opacity=30);z-index:1001;height:100%;width:100%;";var j=b.builder(i),l=j.list["resultTip"][0],q=j.list["result_info"][0];var r;var s;var t={};var u=function(b){if(!r){a.appendChild(l);a.appendChild(e);r=true}if(!t.width){t.width=a.offsetWidth;t.height=a.offsetHeight;e.style.width=t.width+"px";e.style.height=t.height+"px"}q.innerHTML=c(h,{icon_type:f[b.iType],icon_size:g[b.iSize],content:b.content});l.style.display="";l.style.visibility="visible";e.style.display="";e.style.visibility="visible";l.style.bottom=b.bottom||(t.height-parseInt(l.offsetWidth))/2+"px";l.style.right=b.right||(t.width-parseInt(l.clientWidth))/2+"px";s&&clearTimeout(s);s=setTimeout(function(){l.style.display="none";l.style.visibility="hidden";e.style.display="none";e.style.visibility="hidden"},2e3)};var v=function(){l.style.display="none";l.style.visibility="hidden"};(function(){d.add("manager.setting.success",function(a,b){u({iType:"success",iSize:"small",content:k})});d.add("manager.setting.fail",function(){u({bottom:(400-parseInt(l.clientHeight))/2+"px",right:(400-parseInt(l.clientWidth))/2+"px",iType:"error",iSize:"small",content:m});s&&clearTimeout(s);s=setTimeout(v,2e3)});d.last("manager.myPresence",function(a,b){u({bottom:"50px",right:"10px",iType:"success",iSize:"small",content:n+(b.status=="online"?o:p)});s&&clearTimeout(s);s=setTimeout(v,2e3)});d.add(["ui.bar.show","ui.wrapNode.click"],function(){v()})})()}});
$WBIM.register("webim.ui.chatWindow.chatWindow",function(a){var b=['<div class="webim_chat_window clearfix" style="width:560px;position:absolute;right:0px;bottom:0px;z-index:950;" node-type="_root">','<div class="WB_webim_page W_fl">','<div node-type="_search" class="webim_serch"></div>','<div style="display:none;" node-type="_searchListRoot" class="webim_contacts_mod webim_serch_mod">','<div node-type="_searchScrollBox" class="webim_contacts_bd">','<div node-type="_searchList" class="webim_tab_bd"></div>',"</div>","</div>",'<div node-type="_concact" class="webim_contacts_mod"></div>','<div node-type="_setting" class="contacts_bottom"></div>',"</div>",'<div class="private_dialogue_box W_fl" node-type="_container"></div>','<div node-type="_connectBar" style="display:none;" class="private_tips private_tips_top">','<div class="W_tips tips_warn clearfix" node-type="_connectBarCon">',"</div>","</div>","</div>"].join("");var c=a.core.dom,d=a.webim.ui,e=a.core.evt.stopEvent,f=$WBIM.language,g=c.insertElement,h=a.webim.ui.uiEvent;var i="wbim_chat_box_s";var j=f("#L{提示：关闭会话窗口后，其中的未读私信将不再重复提醒。}");var k={action:f('<p class="icon"><span class="W_icon icon_warnS"></span></p><p class="txt" >#L{聊天网络断开，请}：<a href="javascript:;" action-type="Connect.reconnect">#L{重新连接}</a></p>'),suc:f('<p class="icon"><span class="W_icon icon_succS"></span></p><p class="txt" >#L{连接成功！}</a></p>')};var l;var m;var n=function(){var e=c.builder(b);this._root=e.list["_root"][0];this._container=e.list["_container"][0];this._concact=e.list["_concact"][0];this._search=e.list["_search"][0];this._setting=e.list["_setting"][0];this._searchListRoot=e.list["_searchListRoot"][0];this._searchList=e.list["_searchList"][0];this._searchScrollBox=e.list["_searchScrollBox"][0];this._connectBar=e.list["_connectBar"][0];this._connectBarCon=e.list["_connectBarCon"][0];this._chatLists=d.chatWindow.msgList.main();this._chatLists.render(this._concact);d.chatWindow.msgList.search(this._search,{listRootNode:this._searchListRoot,listNode:this._searchList,concactNode:this._concact,settingNode:this._setting,scrollBox:this._searchScrollBox});d.chatWindow.msgList.setting(this._setting);var f=new d.chatWindow.header.frame;f.render(this._container);this._chatContentGroup=new d.chatWindow.content.frame;this._chatContentGroup.render(this._container);this._msgEditor=new d.chatWindow.msgEditor.frame;this._subBox=new d.chatWindow.subBox.frame;this._subBox.render(this._msgEditor.root);this._msgEditor.render(this._container);this._confirmWin=new d.confirmWindow;this._confirmWin.render(this._root);this._validEmailWin=new d.validFrameWindow(this._rightNode);this.openFlag=false;this.topsPop=new a.webim.ui.chatWindow.tipsPop(this._root);this.bindDataEvents();this.bindDomEvent();var g=new a.webim.ui.chatWindow.control.msgControl;var h=new a.webim.ui.chatWindow.control.userControl};n.prototype={render:function(a){g(a,this._root);this.render=null;this.openFlag=true;h.fire("ui.minPanel.opacity");h.fire("ui.chatWindow.render")},bindDataEvents:function(){var b=this;h.add("ui.changeChatUser",function(c,d){b.render&&b.render(a.E("WB_webim"));b.activeChatWindow(d)});h.add("ui.closeChatWindow",function(a,c){b.checkBeforeClose()});h.add("ui.miniChatWindow",function(){b.hide2Bar()});h.add("ui.realCloseChatWindow",function(){b.addSmallCls();b.close()});h.add(["ui.chatTab.added","ui.closeChatUser"],function(a,c){if(b._chatLists.count()>1){b.removeSmallCls()}else{b.addSmallCls()}});h.calc("ui.minPanel.opacityValue",function(){return{chatWindow:b.openFlag}})},bindDomEvent:function(){var b=this;var c=a.core.evt.delegatedEvent(this._root);c.add("wbim_img_preview","click",function(c){var d=c.el,f=d.getAttribute("fid"),g=d.getAttribute("preview"),i=d.getAttribute("name");if(!l){l=new a.webim.ui.chatWindow.previewBox;l.render(b._container)}g&&h.fire("ui.previewBox.changeUrl",{src:g,fid:f,name:i});e()});c.add("longMessage.More","click",function(c){var d=c.data.mid;var f=c.data.gid;if(!m){m=new a.webim.ui.chatWindow.longMsg;m.render(b._container)}if(d)h.fire("ui.longMsg.show",{mid:d,gid:f});e()});c.add("Connect.reconnect","click",function(a){$WBIM.reConnectNow()});$WBIM.watch("IM:object.show",function(c){if(!m){m=new a.webim.ui.chatWindow.longMsg;m.render(b._container)}});$WBIM.onStatusChange(function(a){if(a==="disconnected"){b.showConnectBar()}else if(a==="connected"){if(b._connectBar.style.display!="none"){b.showConnectBar("suc");setTimeout(function(){b.hideConnectBar()},2e3)}}})},addSmallCls:function(){if(this._chatLists.getState()!=="hide"){this._chatLists.hide();c.addClassName(this._root,i)}},removeSmallCls:function(){if(this._chatLists.getState()==="hide"){this._chatLists.show();c.removeClassName(this._root,i)}},checkBeforeClose:function(){var b=a.getUnread();if(b.total){this._unreadFlg=true}if(this._chatLists.count()>1&&this._unreadFlg){h.fire("ui.confirmWin.confirms",{txt:j,cancel:true,confirmFunc:function(){h.fire("ui.realCloseChatWindow",{hasMsgClose:true})}})}else{h.fire("ui.realCloseChatWindow")}},activeChatWindow:function(){this.show()},show:function(){this.openFlag=true;c.setStyle(this._root,"display","block");h.fire("ui.chatWindow.show");h.fire("ui.minPanel.opacity");this._chatLists.initScroll()},hide2Bar:function(){var a=this._chatLists;a.count()==1&&this.addSmallCls();this.hide();this.openFlag=false;h.fire("ui.minPanel.opacity")},hide:function(){this.openFlag=false;c.setStyle(this._root,"display","none");h.fire("ui.minPanel.opacity")},close:function(){this._chatLists.clear();this._unreadFlg=false;this.hide()},isOpen:function(){return this.openFlag},showConnectBar:function(a){this._connectBarCon.innerHTML=k[a||"action"];c.setStyle(this._connectBar,"display","")},hideConnectBar:function(){c.setStyle(this._connectBar,"display","none")}};return n});
$WBIM.register("core.arr.foreachRev",function(a){return function(b,c){var d;if(a.core.arr.isArray(b)){d=b.length;while(d--){if(c(b[d],d)===false){return}}}}});
$WBIM.register("webim.ui.chatWindow.control.msgControl",function(a){function o(a,b){return a;if(typeof a!=="string"){return a}if(b){a=a.replace(/\&/g,"&amp;")}return a.replace(/\</g,"&lt;").replace(/\>/g,"&gt;").replace(/\n/g,"<br>").replace(/\s/g,"&nbsp;")}var b=a.webim.ui.uiEvent;var c=a.core.arr.foreach;var d=$WBIM.language;var e=a.core.util.templet;var f=a.core.obj.isEmpty;var g=a.core.dom.sizzle;var h=a.core.dom.builder;var i=a.core.dom.insertHTML;var j=a.core.arr.foreachRev;var k=a.core.dom.setStyle;var l=a.core.arr.inArray;var m=a.api;var n=a.webim.utils.date;var p=["<!-- 对话提示 -->",'<fieldset class="private_dialogue_prompt S_line1">','    <legend class="prompt_font S_txt2 S_bg1">以上是历史记录</legend>',"</fieldset>"].join("");var q=d('<p class="private_dialogue_more"><a href="javascript:void(0)" action-type="getMoreMsg" action-data="uid=#{uid}" class="S_link1">查看更多消息</a></p>');var r=d('<p class="private_dialogue_more"><a href="javascript:void(0)" action-type="getMoreMsg" action-data="gid=#{gid}" class="S_link1">查看更多消息</a></p>');var s=d(["<!-- 退群提示 -->",'<div class="private_tips">','    <div class="W_tips tips_warn clearfix">','        <p class="txt">#L{对话中请勿轻信汇款、中奖信息、陌生电话。}</p>',"    </div>","</div>"].join(""));var t=[];var u=[];var v='<p class="private_tips_back S_txt2">你已退出该群</p>';var w='<span class="W_icon icon_rederrorS"></span>$CONTENT';var x='<p class="private_tips_back S_txt2">$NOTICE</p>';var y=["<!-- 对话提示 -->",'<fieldset class="private_dialogue_prompt S_line1">','    <legend class="prompt_font S_txt2 S_bg1">$TIMELINE</legend>',"</fieldset>"].join("");var z=a.webim.ui.chatWindow.message.autoMsg;var A=a.webim.ui.chatWindow.message.sysMsg;var B=[];var C=[];var D=a.webim.utils.Core.getCurrentUIDByCookie();var E=10;var F=1;var G={};var H={};var I={};var J={20327:"由于对方设置，暂时无法发送私信",20331:"由于对方设置，暂时无法发送私信",20018:"私信包含非法内容，无法发送",20021:"私信包含非法内容，无法发送",20311:"私信包含非法内容，无法发送",20302:"私信包含非法内容，无法发送",20020:"私信包含广告内容，无法发送",20003:"私信包含广告内容，无法发送",20308:"私信发送过多，休息一会吧","-8":'私信发送过多，请尝试<a href="http://tui.weibo.com" target="_blank">微博广告粉丝通服务</a>',20310:"对方帐号异常，无法发送",disconnected:"网络已断开，请稍后再试",Default:"系统繁忙，请稍后再试",21201:"群不存在",21202:"不允许该操作",21203:"认证失败",21204:"消息中含有敏感词，反垃圾接口返回失败",21205:"非群成员",21211:"不支持POST方法",21212:"不支持GET方法",21221:"不是粉丝，不能邀请加入群",21222:"加入群失败，群成员数已达最大人数",21223:"加入群失败，用户已在群中",21224:"版本过低，不支持群聊",21225:"达到群最大隶属上限",21226:"不是群隶属",20031:"发送失败，请输入验证码"};var K=window.location.host=="weibo.com"||window.location.host=="v6.weibo.com"||window.location.host=="www.weibo.com";var L=function(){this._sendedFailMsgList=[];this.bindDataEvents();this.activeUid=null;this.unreadItems={}};L.prototype={bindDataEvents:function(){var c=this;b.add("ui.changeChatUser",function(a,b){if(b.uid){c.activeUid=b.uid;c.activeGid=null}else if(b.gid){c.activeGid=b.gid;c.activeUid=null}});b.add(["ui.chatWindow.show","ui.user.click","ui.changeChatUser"],function(a){c._openFlg=true});b.add(["ui.miniChatWindow","ui.realCloseChatWindow"],function(a){c._openFlg=false});a.onMessage(function(a,c){switch(a){case"rev":if(!l(c.mid,u)){b.fire("manager.userNewMsg.notify",c);b.fire("manager.userNewMsg",c);u.push(c.mid);u.slice(-20)}else{}break;case"send":c.isSend=true;c.noSync=true;b.fire("sync.user.send",c);break}});var d=0,e=null;var f=a.webim.utils.Core.getCurrentUIDByCookie();a.onGroupMessage(function(a,c){c.content=o(c.content||"",true);switch(a){case"rev":if(!l(c.id,t)){t.push(c.id);t.slice(-100);if(f!=c.from_uid&&c.push==1){b.fire("manager.groupNewMsg.notify",c)}b.fire("manager.groupNewMsg",c);if(c.from_uid!=f){d++}!e&&(e=c.time);if(d==5&&c.time-e<20){b.fire("msg.group.msgoverline");d=0;e=null}}break;case"notice":var a=c.type;var g=c.data;switch(a){case"groupInfoChange":break;case"changeTitle":b.fire("ui.group.changeTitle",g);break;case"exitGroup":if(g.from_uid==D){b.fire("manager.meQuit",{gid:g.gid})}break;case"createGroup":break;case"kickGroup":if(l(parseInt(D),g.uids)){b.fire("manager.kickMe",{gid:g.gid})}break;case"adminRoleChange":if(g.from_uid==D){b.fire("manager.meQuit",{gid:g.gid})};default:break}b.fire("manager.groupNewNotice",c);break;case"send":c.isSend=true;c.noSync=true;b.fire("sync.group.send",c);break}});b.add("ui.createNewContent",function(a,b){c.initHistory(b)});b.add(["manager.userNewMsg","manager.groupNewMsg"],function(a,d){if(c._openFlg){d.uid&&d.uid==c.activeUid&&b.fire("msg.user.clean",{uid:d.uid+""})}if(d.gid){d.msg=d.msg||d.content}d.isNew=true;$WBIM.process.analysisMessage(d).done(function(a){var e=d;var f=c.getMsgInfo(e,a);f.uid=e.uid;f.gid=e.gid;b.fire("ui.content.addMsg",f);B[e.uid]=f.uid;C[e.gid]=f.gid;if(a&&a.card&&a.card.display&&a.card.display.a_envelope==1){var g;if(d.gid){g={url:a.card.display.short,gid:d.gid,type:"group"}}else{g={url:a.card.display.short,uid:d.uid,type:"user"}}b.fire("ui.showEnvolopeTip",g)}})});b.add("manager.groupNewNotice",function(c,d){var e=d.data;if(e.content){var f=a.builder(x.replace("$NOTICE",o(e.content))).box;b.fire("ui.content.addMsg",{gid:e.gid,content:f})}});b.add(["sync.user.send","msg.user.send","msg.group.send"],function(d,e){var f="";$WBIM.process.analysisMessage(e).done(function(d){var f={};for(var g in e){f[g]=e[g]}f.msg=o(f.msg,true);var h=c.getMsgInfo(f,d);if(!e.gid){b.fire("ui.content.addMsg",h)}if(!e.noSync){(function(d,e){if(d.uid){function f(g){m.sendMessage(d.uid,d.msg,d.ext&&d.ext.fids,g).done(function(a){}).progress(function(d){c.handleProcess(d,e);if(d.ret=="406"&&d.errCode=="20031"){b.fire("ui.preventminiChatWindow");a.lib.dialog.validateCode().validateIntercept(d,f,function(){b.fire("ui.unpreventminiChatWindow")})}}).fail(function(a){c.showFailMsg(a,e)})}f()}else if(d.gid){if(K){c.sendGroupMsg(d,function(a){if(a.code==1e5){var b=a.data&&a.data.resonse_info&&a.data.resonse_info[0]&&a.data.resonse_info[0].mid}else{c.showFailMsg(a,e)}})}}})(e,h.content)}})});b.add("manager.sendFail",function(a,d){if(d.errType=="reconnect"){c.showFailMsg(d);return}var e=d.errMsg;if(e){b.fire("ui.showSysTips",{type:"sendFail",msg:e,errorCode:d.errorCode})}});b.add("ui.receiveXiaoweiMsg",function(a,c){b.fire("ui.content.addMsg",c)});b.add("ui.reSendMsg",function(a,b){c.handleReSend(b)});b.add("ui.user.blockUser",function(a,b){c.handleBlockUser(b)});b.add("connected",function(){c._reconnecting=false});b.add("ui.content.getMoreHistory",function(a,b){var d=b.uid;var e=++G[d];$WBIM.anyWhere(function(a){a.getHistory(b.uid,E,e).done(function(a){var e=[];for(var f in H[d]){e.push(H[d][f])}H[d]=[];for(var f=0;f<a.length;f++){f<3&&e.push(a[f]);f>=3&&H[d].push(a[f])}c.handleHistoryMoreMsg(e,b)})})});b.add("ui.content.getMoreGroupHistory",function(b,d){var e=d.gid;var f=I[e];a.group.getMessages(e,10,f).done(function(a){var b=a.messages;if(b){if(b[0]&&b[0].id){I[e]=b[0].id}b.reverse();c.handleHistoryMoreMsg(b,d)}})});b.add("manager.meQuit",function(a,c){c.msg=v;b.fire("ui.content.addPureMsg",c)})},initHistory:function(a){if(a&&a.uid){this.initUserHistory(a)}else if(a&&a.gid){this.initGroupHistory(a)}},initUserHistory:function(c){var d=c.uid;var e=this;var f=a.getUnread();var g=f.items&&f.items[d]||0;var h=(new Date).getTime();a.api.getHistory(d,parseInt(10),F).done(function(a){G[d]=1;H[d]=[];var f=[];if(a.length<=3){f=a}else{for(var h=0;h<a.length;h++){h<3&&f.push(a[h]);h>=3&&H[d].push(a[h])}}e.receiveHistoryMsg(f,c,g);if(e.activeUid==d){b.fire("msg.user.clean",{uid:d})}}).fail(function(a){})},initGroupHistory:function(b){var c=b.gid;var d=this;var e=a.getUnread();var f=e.groupItems&&e.groupItems[c]||0;a.group.getMessages(c,3).done(function(a){if(a.messages){var e=a.messages;if(e[0]&&e[0].id){I[c]=e[0].id}e.reverse();d.receiveHistoryMsg(e,b,f)}})},createMsg:function(b,c){if(c){b.lazy=true}b=this.formatMsg(b);if(b.content&&Math.ceil(a.core.str.trim(b.content).replace(/[^\x00-\xff]/g,"aa").length/2)>250){var d=new a.webim.ui.chatWindow.message.text(b);return d.getContent()}if(b.msg&&Math.ceil(a.core.str.trim(b.msg).replace(/[^\x00-\xff]/g,"aa").length/2)>250){var d=new a.webim.ui.chatWindow.message.text(b);return d.getContent()}if((b.ext||b.card||b.profile||b.weibo)&&!c){var e=new a.webim.ui.chatWindow.message.attach(b);return e.getContent()}else{var d=new a.webim.ui.chatWindow.message.text(b);return d.getContent()}},getMsgInfo:function(a,b,c,d){if(a.att_ids&&a.att_ids.length==0){a.att_ids=null}a["card"]=f(b.card)?null:b.card;a["face"]=f(b.face)?null:b.face;a["profile"]=f(b.profile)?null:b.profile;a["weibo"]=f(b.weibo)?null:b.weibo;a["lazy"]=c;a["hide"]=d;return{gid:a.gid,uid:a.uid,content:this.createMsg(a)}},createSysMsg:function(a){return A.getContent(a)},receiveHistoryMsg:function(c,d,f){f=f||0;var g=this;if(c&&c.length===0){b.fire("ui.content.empty",{uid:d.uid,gid:d.gid});return}g.prepreHandleHistory(c,d,f,null,function(c){var h=[];for(var i in c){h[i]=a.core.json.merge({},c[i])}var j=g.preHandleHistory(c,d,f);var k=j.mids;var l=j.funcItems;var m=k.length;a.tool.queue(l,k).progress(function(e,f){m--;var h=g.getMsgInfo(c[m],f);h.mid=e;h.uid=d.uid;h.gid=d.gid;if(c[m].gid&&Math.ceil(a.core.str.trim(c[m].content).replace(/[^\x00-\xff]/g,"aa").length/2)>250){}else{b.fire("ui.content.updateMsg",h)}});if(d.uid){a.api.getUser(d.uid).done(function(a){if(a.isFriend==0){var c={uid:d.uid,msg:s};b.fire("ui.content.addPureMsg",c)}});var n={uid:d.uid,msg:e(q,{uid:d.uid})};if(c.length>=3){b.fire("ui.content.addMoreMsgBtn",n)}}if(d.gid){var n={gid:d.gid,msg:e(r,{gid:d.gid})};if(c.length>=3){b.fire("ui.content.addMoreMsgBtn",n)}}setTimeout(function(){b.fire("ui.resizeContent")},50)})},handleHistoryMoreMsg:function(c,d){var e=this;if(c){e.prepreHandleHistory(c,d,0,true,function(c){var f=[];for(var g in c){f[g]=a.core.json.merge({},c[g])}var h=e.preHandleHistory(c,d,0,true);var i=h.mids;var j=h.funcItems;var k=i.length;a.tool.queue(j,i).progress(function(f,g){k--;c[k]["more"]=true;var h=e.getMsgInfo(c[k],g);h.mid=f;h.uid=d.uid;h.gid=d.gid;h.more=true;if(c[k].gid&&Math.ceil(a.core.str.trim(c[k].content).replace(/[^\x00-\xff]/g,"aa").length/2)>250){}else{b.fire("ui.content.updateMsg",h)}})})}if(c.length<10){b.fire("ui.removeHistory.moreButton",d)}},handleProcess:function(a,c){var d=h(c).box;var e=g(".bubble_prompt",d);if(a&&!a.success&&a.type=="send"&&a.errCode){var f=J[a.errCode]||J["Default"];k(e[0],"display","block");i(e[0],w.replace("$CONTENT",f),"afterbegin");setTimeout(function(){b.fire("ui.resizeContent")},0)}if(a.success&&a.mid){k(e[0],"display","none")}},encodeLong:function(a){return a.replace(/&/g,encodeURIComponent("&"))},sendGroupMsg:function(b,c){var d=this;a.core.io.ajax({method:"POST",url:"/aj/message/groupchatadd?_wv=5",args:{source:"209678993",text:encodeURIComponent(b.msg||""),gid:b.gid,fids:b.ext&&b.ext.fids},onComplete:c})},showFailMsg:function(a,c){this._reconnecting=true;var d=h(c).box;var e=J[a.errCode]||J["Default"];var f=g(".bubble_prompt",d);if(f&&f[0]){k(f[0],"display","block");i(f[0],w.replace("$CONTENT",e),"afterbegin");setTimeout(function(){b.fire("ui.resizeContent")},0)}},handleReSend:function(a){b.fire("msg.user.send",a.data);a.el.className="resend_dis"},handleBlockUser:function(a){var c=a.data.uid+"";b.fire("ui.confirmWin.confirms",{icon:"ask",txt:d("#L{确认将NAME加入到我的黑名单中吗？}").replace(/NAME/,b.value("data.user",{uid:c+""}).user.nick),cancel:true,confirmFunc:function(){b.fire("request.user.block",{cmd:"blockscreate",uid:c,id:c})},obj:this})},formatMsg:function(a){if(a.gid){a.msg=a.msg||a.content;a.mid=a.id;a.fuid=a.from_uid;a.m_type="group"}else{a.msg=a.msg||a.content;a.m_type="user"}a.ext=a.ext||a.att_ids||a.fids;return a},prepreHandleHistory:function(b,c,d,e,f){var g={};var h=[];for(var i in b){var j;if(b[i].uid==D||b[i].from_uid==D){j=D}else{j=b[i].uid||b[i].fuid||b[i].from_uid}g[i]=j;h.push(j)}var k=(new Date).getTime();a.jsonp({url:"http://api.weibo.com/2/users/show_batch.json",args:{source:"209678993",uids:h.join(",")},onComplete:function(a){if(a&&!a.error){for(var c in b){var d=a.data.users[c].avatar_large.replace("/180/","/30/");b[c].userinfo_headimg=d;b[c].userinfo_name=o(a.data.users[c].name||"")}f(b)}}})},preHandleHistory:function(c,d,e,f){var g=this;var h=-1;var i=document.createDocumentFragment();var k=[],l=[];var m=0;j(c,function(b,d){b.msg&&(b.msg=o(b.msg));b.content&&(b.content=o(b.content));b.more=f;h++;var j;if(b.gid&&(b.type!=321||b.sub_type)){j=a.builder(x.replace("$NOTICE",b.content)).box}else{j=g.createMsg(b,true)}var n=b.time;var q=n+"";if(q.length<13){n=n*Math.pow(10,13-q.length)}if(n-m>10*60*1e3){i.appendChild(g.createTimeLine(n));m=n}i.appendChild(j);if(e!=undefined&&h==c.length-e-1&&!f){i.appendChild(a.core.dom.builder(p).box)}if(b.uid==D||b.from_uid==D){b.isSend=true}k.push(a.process.analysisMessage(b));l.push(b.mid)});if(f){b.fire("ui.content.addMoreHistoryMsg",{uid:d.uid,gid:d.gid,content:i})}else{b.fire("ui.content.addMsg",{uid:d.uid,gid:d.gid,content:i})}i=null;return{funcItems:k,mids:l}},createTimeLine:function(a){var b=n.getMsgTimeLine(a);return h(y.replace("$TIMELINE",b)).box},autoResponse:function(a){var b=z.getContent(a);return b}};return L});
$WBIM.register("webim.ui.chatWindow.control.userControl",function(a){var b="https://api.weibo.com/2/friendships/show.json?source=209678993&source_id="+a.webim.utils.Core.getCurrentUIDByCookie()+"&target_id=UID";var c=a.webim.ui.uiEvent;var d=a.core.arr.foreach;var e=a.webim.ui.chatWindow.message.sysMsg;var f=a.core.io.jsonp;var g=a.webim.ui.base.cache;var h=a.api;var i=function(){this.relationDataCache={};this.activeUid=null;this.lastUid=null;this.activeGid=null;this.lastGid=null;this.bindDataEvents()};i.prototype={bindDataEvents:function(){var a=this;$WBIM.watch("IM:conversation",function(a){setTimeout(function(){if(!a.uid){a.uid=null}c.fire("ui.user.click",a)},0)});c.add("ui.user.click",function(b,d){if((d.uid&&d.uid==a.activeUid||d.gid&&d.gid==a.activeGid)&&a._openFlg&&!d.initChatFlg){return}if(d.uid){a.activeUid=a.lastUid=d.uid;a.activeGid=null}else if(d.gid){a.activeGid=a.lastGid=d.gid;a.activeUid=null}a.cleanUnread(d);c.fire("ui.changeChatUser",d);a._openFlg=true});c.add(["ui.miniChatWindow","ui.realCloseChatWindow"],function(){a._openFlg=false;a.activeUid=null;c.fire("ui.hideTips")});c.add("manager.blockscreate",function(b,d){var e=d.data.id;h.getUser(e).done(function(b){var d={type:"BLOCKSCREATE",NICK:b.nick||""};var f={uid:e,content:a.createSysMsg(d)};c.fire("ui.content.addMsg",f)})});c.add("ui.contactList.empty",function(){a.activeUid=null;a.lastUid=null;a.activeGid=null;a.lastGid=null})},createSysMsg:function(a){return e.getContent(a)},cleanUnread:function(a){if(a.uid&&!a.initChatFlg||a.initChatFlg&&a.last){c.fire("msg.user.clean",{uid:a.uid+""})}else if(a.gid&&!a.initChatFlg||a.initChatFlg&&a.last){}}};return i});
$WBIM.register("webim.ui.chatWindow.main",function(a){return function(){var b=a.webim.uix.positionManager;(new a.webim.ui.chatWindow.chatWindow)._root}});
$WBIM.register("webim.ui.startup",function(a){var b=a.webim.ui.uiEvent;var c;if(a.core.dom.sizzle(".WB_global_nav",document).length){a.webim.topHeight=77}else{a.webim.topHeight=70}try{var d=document.createElement("canvas");if(d&&d.getConext&&d.getContext("2d")){a.webim.supportCanvas=true}}catch(e){}return function(){function e(){var a=$WBIM.initData.chat,c=a.status!="max",d=false;if(a){if(a.list){var e=a.list;for(var f=0;f<e.length;f++){if(e[f])b.fire("ui.initChatTabs",{uid:e[f],initChatFlg:true})}}if(a.active){parseInt(a.active)>0&&b.fire("ui.user.click",{uid:a.active,initChatFlg:true,active:true,hide:c,last:true});if(!c){b.fire("msg.user.clean",{uid:a.active})}}if(a.list&&c){b.fire("ui.miniChatWindow",{initChatFlg:true})}}}new a.webim.ui.notice.main;a.webim.ui.currentUID=a.webim.utils.Core.getCurrentUIDByCookie();new a.webim.ui.bottom.main;new a.webim.ui.bottom.chatmini;var d=$WBIM.initData.setting&&$WBIM.initData.setting.contactsPanel&&$WBIM.initData.setting.contactsPanel.status;if(d=="bottomFloat"){b.fire("ui.default.bottom")}else{b.fire("ui.default.side")}if(d=="bottomFloat"||a.webim.uix.screenRatioManager.isLowMode()){}else{}b.fire("ui.chatmini.show");$WBIM.publish("IM:uiReady",true);a.webim.uix.greetingManager.doGreeting();a.webim.uix.desktopPopManager.startPop();a.webim.ui.panelManager.init();b.add("ui.chatwinow.init.ready",function(){a.webim.ui.init=true;b.release("initReady")});var f=setInterval(function(){if(a.getUnread()){e();clearInterval(f)}},1e3);if(c){b.fire("ui.chatwinow.init.ready")}else{a.webim.ui.init=true;b.release("initReady")}new a.webim.ui.phiz;new a.webim.ui.lastWeibo;a.webim.ui.notifyManager();a.webim.utils.weiboDesktop.CallClient()}});
$WBIM.register("webim.ui.syncManager",function(a){var b=a.webim.ui.uiEvent;b.add("ui.chatWindow.show",function(a,b){});b.add("ui.user.click",function(b,c){if(!c.initChatFlg&&!c.sync){a.api.chatSync("add",c).done(function(a){})}});b.add("ui.miniChatWindow",function(b,c){if(!c.initChatFlg&&!c.sync){a.api.chatSync("min",c.uid).done(function(a){})}});b.add("ui.closeChatUser",function(b,c){if(!c.initChatFlg&&!c.sync){a.api.chatSync("removeUser",c.uid).done(function(a){})}});b.add(["ui.closeChatGroup","manager.meQuit"],function(b,c){if(!c.initChatFlg&&!c.sync){a.api.chatSync("removeGroup",c.gid).done(function(a){})}});b.add("ui.realCloseChatWindow",function(b,c){if(!c.initChatFlg&&!c.sync){var d=a.initData&&a.initData.chat&&a.initData.chat.list;var e=a.initData&&a.initData.chat&&a.initData.chat.active;if(e){d.push(e)}a.api.chatSync("close").done(function(a){})}});b.add("ui.contactList.empty",function(b,c){a.api.chatSync("clear").done(function(a){})});b.add("ui.clickEnvolopeTip",function(b,c){if(!c.initChatFlg&&!c.sync)a.api.chatSync("clickEnvolopeTip").done(function(a){})})});
$WBIM.register("webim.ui.uiManager",function(a){function l(b){var c=g(a.E("WB_webim"),"top");var d=g(a.E("WB_webim"),"right");if(b=="hide"){h=false;f(a.E("WB_webim"),"bottom","9999px");f(a.E("WB_webim"),"right","9999px")}else{h=true;f(a.E("WB_webim"),"bottom","0px");f(a.E("WB_webim"),"right","0px")}}var b=a.webim.ui.uiEvent;var c=a.core.arr.foreach;var d=a.api;var e=a.group;var f=a.core.dom.setStyle;var g=a.core.dom.getStyle;var h=true;var i={};var j=window.SUDA.uaTrack;var k=function(a){j("webim_group_restr",a)};$WBIM.onNotice(function(a,b){});$WBIM.onUnreadChange(function(a){if(i.total!=a.total){b.fire("ui.unread.change",a);i=a}});$WBIM.onMessage(function(a,b){});$WBIM.onNotice(function(a,c){if(a!="presence")switch(a){case"setting":if(c.act=="refresh"&&$WBIM.initData.setting){$WBIM.initData.setting=c.data;b.fire("ui.refreshSetting")}break;case"chatSync":switch(c.type){case"add":b.fire("ui.user.click",{uid:c.data.uid,gid:c.data.gid,groupName:c.data.groupName,uids:c.data.uids,sync:true});break;case"setting":b.fire("ui.setting",{data:c.data,sync:true});break;case"removeUser":b.fire("ui.closeChatUser",{uid:c.data,sync:true});break;case"removeGroup":b.fire("ui.closeChatGroup",{gid:c.data,sync:true});break;case"min":b.fire("ui.miniChatWindow",{sync:true});break;case"close":b.fire("ui.realCloseChatWindow",{sync:true});break;case"send":b.fire("ui.changeSendMethod",{data:c,sync:true});break;case"clickEnvolopeTip":b.fire("ui.clickEnvolopeTip",{data:c,sync:true});break;default:break}break;case"recent":if(c.act=="add"){b.fire("manager.updateRecents",c)}else if(c.act=="remove"){b.fire("manager.removeRecent",c);b.fire("msg.user.clean",c)}break;default:break}});a.onMessage(function(a,b){});a.watch("IM:display",function(a){l(a)});b.before("ui.realCloseChatWindow",function(){var b=a.getUnread();if(b&&b.items){c(b.items,function(a,b){d.clearUnread(b).done()})}});b.add("msg.user.clean",function(a,b){if(h){d.clearUnread(b.uid).done()}});b.add("msg.group.clean",function(a,b){});b.front("manager.userNewMsg",function(a,c){var e=c.uid;c.isSend=false;if(e){var f="userData"+e;b.defineRely(f);b.valid(f,function(){return false});b.rely("manager.userNewMsg",f);d.getUser(e).done(function(a){if(a){b.release(f);b.unDefineRely(f)}})}});b.front("ui.user.click",function(b,d){var e=a.getUnread();if(e&&e.items){var f=[];var g=[];c(e.items,function(a,b){if(a>0){f.push(b)}});c(e.groupItems,function(a,b){if(a>0){g.push(b)}})}if(!d.gid&&!d.uid){if(f.length||g.length){k("restr_res_new")}else{k("restr_res_null");var h=a.initData&&a.initData.chat&&a.initData.chat.activeUid;var i=a.initData&&a.initData.chat&&a.initData.chat.activeGid;var j=a.initData&&a.initData.chat&&a.initData.chat.activeType;if(h&&j=="user"){d.uid=h}else if(i&&j=="group"){d.gid=i}}}});b.front("ui.miniChatWindow",function(b,c){c.uid=a.initData&&a.initData.chat&&a.initData.chat.active});new a.webim.ui.chatWindow.main;a.webim.ui.manager.suda();a.webim.ui.manager.setting();a.webim.ui.startup()});
;
