(function(){var STK=(function(){var that={};var errorList=[];that.inc=function(ns,undepended){return true};that.register=function(ns,maker){var NSList=ns.split(".");var step=that;var k=null;while(k=NSList.shift()){if(NSList.length){if(step[k]===undefined){step[k]={}}step=step[k]}else{if(step[k]===undefined){try{step[k]=maker(that)}catch(exp){}}}}};that.regShort=function(sname,sfun){if(that[sname]!==undefined){throw"["+sname+"] : short : has been register"}that[sname]=sfun};that.IE=/msie/i.test(navigator.userAgent);that.E=function(id){if(typeof id==="string"){return document.getElementById(id)}else{return id}};that.C=function(tagName){var dom;tagName=tagName.toUpperCase();if(tagName=="TEXT"){dom=document.createTextNode("")}else{if(tagName=="BUFFER"){dom=document.createDocumentFragment()}else{dom=document.createElement(tagName)}}return dom};that.log=function(str){errorList.push("["+((new Date()).getTime()%100000)+"]: "+str)};that.getErrorLogInformationList=function(n){return errorList.splice(0,n||errorList.length)};return that})();$Import=STK.inc;STK.register("core.str.trim",function($){return function(str){if(typeof str!=="string"){throw"trim need a string as parameter"}var len=str.length;var s=0;var reg=/(\u3000|\s|\t|\u00A0)/;while(ss){if(!reg.test(str.charAt(len-1))){break}len-=1}return str.slice(s,len)}});STK.register("core.evt.addEvent",function($){return function(sNode,sEventType,oFunc){var oElement=$.E(sNode);if(oElement==null){return false}sEventType=sEventType||"click";if((typeof oFunc).toLowerCase()!="function"){return}if(oElement.attachEvent){oElement.attachEvent("on"+sEventType,oFunc)}else{if(oElement.addEventListener){oElement.addEventListener(sEventType,oFunc,false)}else{oElement["on"+sEventType]=oFunc}}return true}});STK.register("core.obj.parseParam",function($){return function(oSource,oParams,isown){var key,obj={};oParams=oParams||{};for(key in oSource){obj[key]=oSource[key];if(oParams[key]!=null){if(isown){if(oSource.hasOwnProperty[key]){obj[key]=oParams[key]}}else{obj[key]=oParams[key]}}}return obj}});STK.register("core.arr.isArray",function($){return function(o){return Object.prototype.toString.call(o)==="[object Array]"}});STK.register("core.json.queryToJson",function($){return function(QS,isDecode){var _Qlist=$.core.str.trim(QS).split("&");var _json={};var _fData=function(data){if(isDecode){return decodeURIComponent(data)}else{return data}};for(var i=0,len=_Qlist.length;i=0;i--){var oAttrib=attrArr[i];if(oAttrib.specified){oAttr[attrArr[i].name]=attrArr[i].value}}oAttr.dom=oCustomDom;oAttr.tagName=tagName;return oAttr};var initCustomTag=function(){var widgetList=[];for(var i=0,len=tagInfo.length;iLoading...';widgetList.push({tag:tagName,widget:widget,params:getDomAttribute(cDomList[j],tagName)})}}var len=widgetList.length;if(len>0){if(/weibo|ucbrowser/i.test(navigator.userAgent)){for(var i=0,len=widgetList.length;i1)?(RegExp.$1.length>2?"/u661f/u671f":"/u5468"):"")+week[date.getDay()+""])}for(var k in o){if(new RegExp("("+k+")").test(fmt)){fmt=fmt.replace(RegExp.$1,(RegExp.$1.length==1)?(o[k]):(("00"+o[k]).substr((""+o[k]).length)))}}return fmt};return function(date,pattern){date=date||new Date();pattern=pattern||"yyyy-MM-dd hh:mm:ss";return format(date,pattern)}});STK.register("conf.api.log",function($){var isConsoleEnable=typeof window.console=="object"&&(typeof window.console.log=="function"||typeof window.console.log=="object");var panelId="weibo_jssdk_console_panel";var minHeight=30,maxHeight=90;var Icon={info:"#0088CC",warn:"#D2D128",error:"#F50A0A"};var cPanel={init:function(){var pos="position:fixed;";if($.core.util.browser.IE6){pos="position:absolute;"}var title=$.C("h5");title.innerHTML='Sina Weibo JSSDK Console PanelHelp?';title.style.cssText="margin: 8px;font-size:13px;border-bottom:1px solid #ccc;";var logDiv=$.C("div");logDiv.id=panelId+"_logdiv";logDiv.style.cssText="background:#000; color:#FFF; margin:5px; border:1px solid #ccc; height:150px; max-height:150px; overflow-x:hidden; overflow-y: auto; word-break:nowrap; padding:5px 5px;border-radius:5px;";var textArea=$.C("textarea");textArea.value='WB2.console.log("test");';textArea.style.cssText="line-height:20px;font-size:12px;width:380px;height:30px;overflow-y:auto;margin:3px;padding:5px; border-radius:5px;border:1px solid #ccc;";textArea.onfocus=function(){textArea.select()};textArea.ondblclick=function(){if(parseInt(textArea.style.height)'+obj;if(cPanel.output.innerHTML!=""){html=html+"\r\n"+cPanel.output.innerHTML}cPanel.output.innerHTML=html+"

";cPanel.output.scrollTop=0}},log:function(info,level){cPanel.show();var output="";if(typeof info=="object"||Object.prototype.toString.call(info)==="[object Array]"){if(typeof info.parent==="object"){output=info.toString()}else{output=$.core.json.jsonToStr(info,null,"\t")}}else{if(typeof info=="undefined"){output="undefined"}else{output=info.toString()}}cPanel.setLog(output,level)}};var debugLevel=["log","info","warn","error","dir"];return function(){window.WB2=window.WB2||{};window.WB2.console=window.WB2.console||{};window.WB2.console.init=function(){WB2._config.debug=true;isConsoleEnable=false};function init(){for(var i=0,len=debugLevel.length;i0){for(var i=0,len=metas.length;i0&&opts.onTimeout!=null){requestTimeout=setTimeout(function(){opts.onTimeout()},opts.timeout)}return js};var Queue=function(){this.started=1;this.taskList=[];this.setStatue=function(statue){this.started=statue};this.start=function(){this.setStatue(0);var i,method,args,pointer;var fun=this.taskList.shift();var method=fun[0],args=fun[1],pointer=fun[2];method.apply(pointer,args)};this.next=function(){this.setStatue(1);if(this.taskList.length>0){this.start()}};this.add=function(oFunc,oOpts){var opts={args:[],pointer:window,top:false};opts=parseParam(opts,oOpts);if(opts.top){this.taskList.unshift([oFunc,opts.args,opts.pointer])}else{this.taskList.push([oFunc,opts.args,opts.pointer])}if(this.started){this.start()}}};var queue=new Queue();function initCommunicate(options){var ver=WB2._config.version,instances=WB2.anyWhere._instances,blankIframe=instances[ver];if(blankIframe){if(blankIframe.contentWindow._ready){blankIframe.contentWindow.request(options)}else{WB2.addToCallbacks(blankIframe.contentWindow,options)}}else{WB2.delayCall(options)}}function anyWhere(callback){var oRequest={requestType:"anywhere",callback:callback};regIframeRequest(oRequest)}function regIframeRequest(options){var oRequest=options||{};var myCallBack=function(){initCommunicate(oRequest);queue.next()};var init=function(oCallback){if(JS_CACHE.bundle){oCallback&&oCallback()}else{loadJs({url:WB2._config.host+"/open/api/js/api/bundle.js?version="+WB2._config.cdn_version,onComplete:function(){JS_CACHE.bundle=1;oCallback&&oCallback()}})}};queue.add(init,{args:[myCallBack]})}function clientInfo(){var scripts=document.getElementsByTagName("script");var len=scripts.length,index=0,weiboJs,url,appkey,secret,version;if(len>0){weiboJs=scripts[index++];while(weiboJs){if(weiboJs.src.indexOf("api/js/wb.js")!=-1){url=weiboJs.src.split("?").pop();break}weiboJs=scripts[index++]}}url=url.toLowerCase();var oPara=queryToJson(url);appkey=oPara.appkey||"";secret=oPara.secret||"";debug=oPara.debug||false;version=oPara.version||1;return{appkey:appkey,secret:secret,debug:debug,version:version}}function loginReady(oFunc,bStart){var i,len;if(oFunc!=null){if(bStart==true){LOGIN_FUNC_LIST.unshift(oFunc)}else{LOGIN_FUNC_LIST.push(oFunc)}}if(WB2.checkLogin()){for(i=0,len=LOGIN_FUNC_LIST.length;i