/* CJ 2013-12-17 17:06:59 */ "undefined"!=typeof dojo?dojo.provide("org.cometd"):(this.org=this.org||{},org.cometd={}),org.cometd.JSON={},org.cometd.JSON.toJSON=org.cometd.JSON.fromJSON=function(){throw"Abstract"},org.cometd.Utils={},org.cometd.Utils.isString=function(e){return void 0===e||null===e?!1:"string"==typeof e||e instanceof String},org.cometd.Utils.isArray=function(e){return void 0===e||null===e?!1:e instanceof Array},org.cometd.Utils.inArray=function(e,t){for(var n=0;n0;){var t=d[0],n=t[0],i=t[1];{if(n.url!==e.url||n.sync!==e.sync)break;d.shift(),e.messages=e.messages.concat(n.messages),this._debug("Coalesced",n.messages.length,"messages from request",i.id)}}}function t(e,t){if(this.transportSend(e,t),t.expired=!1,!e.sync){var n=this.getConfiguration().maxNetworkDelay,i=n;t.metaConnect===!0&&(i+=this.getAdvice().timeout),this._debug("Transport",this.getType(),"waiting at most",i,"ms for the response, maxNetworkDelay",n);var o=this;t.timeout=this.setTimeout(function(){t.expired=!0,t.xhr&&t.xhr.abort();var n="Request "+t.id+" of transport "+o.getType()+" exceeded "+i+" ms max network delay";o._debug(n),o.complete(t,!1,t.metaConnect),e.onFailure(t.xhr,e.messages,"timeout",n)},i)}}function n(e){var n=++c,i={id:n,metaConnect:!1};u.length=0&&u.splice(o,1),d.length>0){var s=d.shift(),r=s[0],a=s[1];if(this._debug("Transport dequeued request",a.id),i)this.getConfiguration().autoBatch&&e.call(this,r),n.call(this,r),this._debug("Transport completed request",t.id,r);else{var c=this;this.setTimeout(function(){c.complete(a,!1,a.metaConnect),r.onFailure(a.xhr,r.messages,"error","Previous request failed")},0)}}}function s(e){if(null!==l)throw"Concurrent metaConnect requests not allowed, request id="+l.id+" not yet completed";var n=++c;this._debug("Transport",this.getType(),"metaConnect send, request",n,"envelope",e);var i={id:n,metaConnect:!0};t.call(this,e,i),l=i}var r=new org.cometd.Transport,a=org.cometd.Transport.derive(r),c=0,l=null,u=[],d=[];return a.complete=function(e,t,n){n?i.call(this,e):o.call(this,e,t)},a.transportSend=function(){throw"Abstract"},a.transportSuccess=function(e,t,n){t.expired||(this.clearTimeout(t.timeout),this.complete(t,!0,t.metaConnect),n&&n.length>0?e.onSuccess(n):e.onFailure(t.xhr,e.messages,"Empty HTTP response"))},a.transportFailure=function(e,t,n,i){t.expired||(this.clearTimeout(t.timeout),this.complete(t,!1,t.metaConnect),e.onFailure(t.xhr,e.messages,n,i))},a.send=function(e,t){t?s.call(this,e):n.call(this,e)},a.abort=function(){r.abort();for(var e=0;e0;){var a=org.cometd.JSON.toJSON(e.messages.slice(o,o+s)),c=e.url.length+encodeURI(a).length;if(c>n){if(1===s){var l="Bayeux message too big ("+c+" bytes, max is "+n+") for transport "+this.getType();return this.setTimeout(function(){i.transportFailure(e,t,"error",l)},0),void 0}--s}else r.push(s),o+=s,s=e.messages.length-o}var u=e;if(r.length>1){var d=0,h=r[0];this._debug("Transport",this.getType(),"split",e.messages.length,"messages into",r.join(" + ")),u=this._mixin(!1,{},e),u.messages=e.messages.slice(d,h),u.onSuccess=e.onSuccess,u.onFailure=e.onFailure;for(var f=1;f=0){c=!0,m.splice(v,1);var b=l[g][0],_=l[g][1];delete l[g],m.length>0&&(l[m.join(",")]=[b,_]);break}}}c&&this._debug("Transport",this.getType(),"removed envelope, envelopes",l),o.call(this,n),t&&d.close(1e3,"Disconnect")},r.onClose=function(e,t){this._debug("Transport",this.getType(),"closed",e,t,d),a=c;for(var n in u)this.clearTimeout(u[n]);u={};for(var i in l){var o=l[i][0],s=l[i][1];s&&(f=!1),o.onFailure(d,o.messages,"closed "+e+"/"+t)}l={},null!==d&&h&&d.close(1e3,"Close"),h=!1,d=null},r.registered=function(e,t){s.registered(e,t),i=t},r.accept=function(){return a&&!!org.cometd.WebSocket&&i.websocketEnabled===!0},r.send=function(e,t){this._debug("Transport",this.getType(),"sending",e,"metaConnect =",t);for(var i=[],o=0;o0)et._info("Appending message type to URI "+o+s+" is not supported, disabling 'appendMessageTypeToURL' configuration"),vt.appendMessageTypeToURL=!1;else{var r=o.split("/"),a=r.length-1;o.match(/\/$/)&&(a-=1),r[a].indexOf(".")>=0&&(et._info("Appending message type to URI "+o+" is not supported, disabling 'appendMessageTypeToURL' configuration"),vt.appendMessageTypeToURL=!1)}}function s(){for(var e in ut)for(var t=ut[e],n=0;n",e),ot=e)}function a(){return"disconnecting"===ot||"disconnected"===ot}function c(){return++st}function l(e,t,i,o,s){try{return t.call(e,o)}catch(r){et._debug("Exception during execution of extension",i,r);var a=et.onExtensionException;if(n(a)){et._debug("Invoking extension exception callback",i,r);try{a.call(et,r,i,s,o)}catch(c){et._info("Exception during execution of exception callback in extension",i,c)}}return o}}function u(e){for(var t=0;t0)for(var o=0;o0;--o){var s=n.slice(0,o).join("/")+"/*";o===i&&h(s,t),s+="*",h(s,t)}}function p(){null!==ht&&org.cometd.Utils.clearTimeout(ht),ht=null}function g(e){p();var t=pt.interval+dt;et._debug("Function scheduled in",t,"ms, interval =",pt.interval,"backoff =",dt,e),ht=org.cometd.Utils.setTimeout(et,e,t)}function m(e,t,n,i){for(var o=0;o0||lt===!0?ct.push(e):m(!1,[e],!1)}function b(){dt=0}function _(){dt0&&m(!1,e,!1)}function x(){if(--at,0>at)throw"Calls to startBatch() and endBatch() are not paired";0===at&&!a()&&!lt&&y()}function w(){if(!a()){var e={channel:"/meta/connect",connectionType:Z.getType()};mt||(e.advice={timeout:0}),r("connecting"),et._debug("Connect sent",e),m(!1,[e],!0,"connect"),r("connected")}}function T(){r("connecting"),g(function(){w()})}function S(e){e&&(pt=et._mixin(!1,{},vt.advice,e),et._debug("New advice",pt))}function C(e){p(),e&&Z.abort(),rt=null,r("disconnected"),at=0,b(),ct.length>0&&(_t.call(et,void 0,ct,"error","Disconnected"),ct=[])}function N(e){rt=null,s(),a()?(it.reset(),S(vt.advice)):S(et._mixin(!1,pt,{reconnect:"retry"})),at=0,lt=!0,X=e;var t="1.0",n=it.findTransportTypes(t,nt,vt.url),i={version:t,minimumVersion:"0.9",channel:"/meta/handshake",supportedConnectionTypes:n,advice:{timeout:pt.timeout,interval:pt.interval}},o=et._mixin(!1,{},X,i);Z=it.negotiateTransport(n,t,nt,vt.url),et._debug("Initial transport is",Z.getType()),r("handshaking"),et._debug("Handshake sent",o),m(!1,[o],!1,"handshake")}function j(){r("handshaking"),lt=!0,g(function(){N(X)})}function B(e){f("/meta/handshake",e),f("/meta/unsuccessful",e);var t=!a()&&"none"!==pt.reconnect;t?(_(),j()):C(!1)}function I(e){if(e.successful){rt=e.clientId;var t=it.negotiateTransport(e.supportedConnectionTypes,e.version,nt,vt.url);if(null===t)throw"Could not negotiate transport with server; client "+it.findTransportTypes(e.version,nt,vt.url)+", server "+e.supportedConnectionTypes;Z!==t&&(et._debug("Transport",Z,"->",t),Z=t),lt=!1,y(),e.reestablish=gt,gt=!0,f("/meta/handshake",e);var n=a()?"none":pt.reconnect;switch(n){case"retry":b(),T();break;case"none":C(!1);break;default:throw"Unrecognized advice action "+n}}else B(e)}function O(e,t){B({successful:!1,failure:!0,channel:"/meta/handshake",request:t,xhr:e,advice:{reconnect:"retry",interval:dt}})}function P(e){f("/meta/connect",e),f("/meta/unsuccessful",e);var t=a()?"none":pt.reconnect;switch(t){case"retry":T(),_();break;case"handshake":it.reset(),b(),j();break;case"none":C(!1);break;default:throw"Unrecognized advice action"+t}}function A(e){if(mt=e.successful){f("/meta/connect",e);var t=a()?"none":pt.reconnect;switch(t){case"retry":b(),T();break;case"none":C(!1);break;default:throw"Unrecognized advice action "+t}}else P(e)}function U(e,t){mt=!1,P({successful:!1,failure:!0,channel:"/meta/connect",request:t,xhr:e,advice:{reconnect:"retry",interval:dt}})}function L(e){C(!0),f("/meta/disconnect",e),f("/meta/unsuccessful",e)}function R(e){e.successful?(C(!1),f("/meta/disconnect",e)):L(e)}function E(e,t){L({successful:!1,failure:!0,channel:"/meta/disconnect",request:t,xhr:e,advice:{reconnect:"none",interval:0}})}function F(e){f("/meta/subscribe",e),f("/meta/unsuccessful",e)}function J(e){e.successful?f("/meta/subscribe",e):F(e)}function q(e,t){F({successful:!1,failure:!0,channel:"/meta/subscribe",request:t,xhr:e,advice:{reconnect:"none",interval:0}})}function D(e){f("/meta/unsubscribe",e),f("/meta/unsuccessful",e)}function H(e){e.successful?f("/meta/unsubscribe",e):D(e)}function M(e,t){D({successful:!1,failure:!0,channel:"/meta/unsubscribe",request:t,xhr:e,advice:{reconnect:"none",interval:0}})}function W(e){f("/meta/publish",e),f("/meta/unsuccessful",e)}function V(e){void 0===e.successful?e.data?f(e.channel,e):et._debug("Unknown message",e):e.successful?f("/meta/publish",e):W(e)}function K(e,t){W({successful:!1,failure:!0,channel:t.channel,request:t,xhr:e,advice:{reconnect:"none",interval:0}})}function Q(e){if(e=u(e),void 0!==e&&null!==e){S(e.advice);var t=e.channel;switch(t){case"/meta/handshake":I(e);break;case"/meta/connect":A(e);break;case"/meta/disconnect":R(e);break;case"/meta/subscribe":J(e);break;case"/meta/unsubscribe":H(e);break;default:V(e)}}}function z(e){var t=ut[e];if(t)for(var n=0;ne?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,i,o,s,r,a=gap,c=t[e];switch(c&&"object"==typeof c&&"function"==typeof c.toJSON&&(c=c.toJSON(e)),"function"==typeof rep&&(c=rep.call(t,e,c)),typeof c){case"string":return quote(c);case"number":return isFinite(c)?String(c):"null";case"boolean":case"null":return String(c);case"object":if(!c)return"null";if(gap+=indent,r=[],"[object Array]"===Object.prototype.toString.apply(c)){for(s=c.length,n=0;s>n;n+=1)r[n]=str(n,c)||"null";return o=0===r.length?"[]":gap?"[\n"+gap+r.join(",\n"+gap)+"\n"+a+"]":"["+r.join(",")+"]",gap=a,o}if(rep&&"object"==typeof rep)for(s=rep.length,n=0;s>n;n+=1)i=rep[n],"string"==typeof i&&(o=str(i,c),o&&r.push(quote(i)+(gap?": ":":")+o));else for(i in c)Object.hasOwnProperty.call(c,i)&&(o=str(i,c),o&&r.push(quote(i)+(gap?": ":":")+o));return o=0===r.length?"{}":gap?"{\n"+gap+r.join(",\n"+gap)+"\n"+a+"}":"{"+r.join(",")+"}",gap=a,o}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(e,t,n){var i;if(gap="",indent="","number"==typeof n)for(i=0;n>i;i+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,!t||"function"==typeof t||"object"==typeof t&&"number"==typeof t.length)return str("",{"":e});throw new Error("JSON.stringify")}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(e,t){var n,i,o=e[t];if(o&&"object"==typeof o)for(n in o)Object.hasOwnProperty.call(o,n)&&(i=walk(o,n),void 0!==i?o[n]=i:delete o[n]);return reviver.call(e,t,o)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\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,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),function(e){function t(e,t){if(t)for(var n in t)"content-type"!==n.toLowerCase()&&e.setRequestHeader(n,t[n])}function n(){var n=new org.cometd.LongPollingTransport,i=org.cometd.Transport.derive(n);return i.xhrSend=function(n){return e.ajax({url:n.url,async:n.sync!==!0,type:"POST",contentType:"application/json;charset=UTF-8",data:n.body,xhrFields:{withCredentials:!0},beforeSend:function(e){return t(e,n.headers),!0},success:n.onSuccess,error:function(e,t,i){n.onError(t,i)}})},i}function i(){var n=new org.cometd.CallbackPollingTransport,i=org.cometd.Transport.derive(n);return i.jsonpSend=function(n){e.ajax({url:n.url,async:n.sync!==!0,type:"GET",dataType:"jsonp",jsonp:"jsonp",data:{message:n.body},beforeSend:function(e){return t(e,n.headers),!0},success:n.onSuccess,error:function(e,t,i){n.onError(t,i)}})},i}org.cometd.JSON.toJSON=JSON.stringify,org.cometd.JSON.fromJSON=JSON.parse,e.Cometd=function(e){var t=new org.cometd.Cometd(e);return org.cometd.WebSocket&&(t.registerTransport("websocket",new org.cometd.WebSocketTransport),t.websocketEnabled=!0),t.registerTransport("long-polling",new n),t.registerTransport("callback-polling",new i),t},e.cometd=new e.Cometd}(jQuery),function(e){e.cookie&&(org.cometd.COOKIE.set=e.cookie,org.cometd.COOKIE.get=e.cookie),e.cometd.registerExtension("reload",new org.cometd.ReloadExtension)}(jQuery),function(e,t){function n(e,t){if(e&&t&&"object"==typeof t)for(var n in t)"undefined"==typeof e[n]&&(e[n]=t[n]) }function i(e,t,n,i,o){this.body=t,this.list=n,this.nextBtn=i,this.preBtn=o,this.initialConifg=e,this.iwidth=e.iwidth,this.pagewidth=e.pagewidth,this.count=e.count,this.initListLenght=this.count*this.iwidth,this.pretopic=e.pretopic,this.animDone=!0}t.fn.gNavSlider=function(e){var o={iwidth:137,cols:6};return e=e||{},n(e,o),e.pagewidth=e.cols*e.iwidth,this.each(function(){var n=t(this),o=n.find(".nav_list");"undefined"==typeof e.count&&(e.count=o.find("li").length);var s=new i(e,n,o,e.nextBtn,e.preBtn);s.init()})},n(i.prototype,{init:function(){this.body.css({position:"relative",overflow:"hidden",width:this.pagewidth}),this.list.css({position:"relative",left:0,width:this.count*this.iwidth}),this.setPreAndNextBtnStatus(),this._enabalePreBtn(),this._enableNextBtn(),this._attachItemEvent()},canScrollPre:function(){if(!this.list)return!1;{var e=this.list,t=parseInt(e.css("left"),10);parseInt(e.css("width"),10)}return 0>t},canScrollNext:function(){if(!this.list)return!1;var e=this.list,t=parseInt(e.css("left"),10),n=parseInt(e.css("width"),10);return n+t>this.pagewidth},setPreAndNextBtnStatus:function(){this.canScrollPre()?this.preBtn.removeClass("ico_pre_none"):this.preBtn.addClass("ico_pre_none"),this.canScrollNext()?this.nextBtn.removeClass("ico_next_none"):this.nextBtn.addClass("ico_next_none")},setPage:function(){var e=this.list,t=parseInt(e.css("left")),n=parseInt(e.css("width"));t+n==0&&(this.animDone=!1,e.animate({left:t+this.pagewidth},function(){this.animDone=!0}))},setHeadBtnStatus:function(){var e=this.list;e&&0==e.find("li").length&&(this.preBtn.addClass("ico_pre_none"),this.nextBtn.addClass("ico_next_none"),messagebus.publish(this.pretopic+".itemnone"))},_enabalePreBtn:function(){var e=this,t=this.list;this.preBtn.bind("click",function(){if(!t||!e.canScrollPre()||!e.animDone)return!1;e.animDone=!1;var n=parseInt(t.css("left"),10);return t.animate({left:n+e.pagewidth},function(){e.animDone=!0,e.setPreAndNextBtnStatus()}),!1})},_enableNextBtn:function(){var e=this,t=this.list;this.nextBtn.bind("click",function(){if(!t||!e.canScrollNext()||!e.animDone)return!1;e.animDone=!1;var n=parseInt(t.css("left"),10);return t.animate({left:n-e.pagewidth},function(){e.animDone=!0,e.setPreAndNextBtnStatus()}),!1})},_attachItemEvent:function(){var e=this,n=this.list;n.find("li.item").hover(function(){var e=t(this);e.addClass("on")},function(){t(this).removeClass("on")}).bind("click",function(i){if(i=i.target,type=i.getAttribute("rel")){var o=i.getAttribute("rev"),s=t(this);return"delbtn"==type?e.animDone?(e.animDone=!1,s.fadeOut(function(){s.remove(),messagebus.publish(e.pretopic+".del",{el:s,rev:o});var t=parseInt(n.css("width"),10);n.css({width:t-e.iwidth}),e.setPreAndNextBtnStatus(),e.setPage(),e.setHeadBtnStatus(),e.animDone=!0}),!1):!1:(messagebus.publish(e.pretopic+"."+type,{el:s,rev:o}),void 0)}})}})}(window,jQuery),function(e,t){var n,i="http://my.tv.sohu.com/user/a/subscribe/list_pl.do?cat=0&read=0&plat=100&isWeb=1",o="http://my.tv.sohu.com/user/a/subscribe/delete.do",s=!1,r=0,a=0;org.cometd.WebSocket=!1;var c,l,u,d=function(n){function i(){}function o(e){e.successful===!0&&s.batch(function(){s.subscribe("/"+c,function(e){r=e.data.count||0,_(a,r)}),s.subscribe("/"+n.id,function(e){a=e.data.msg||0,t("#infoNum").show().find(".msg_mid").html(a),_(a,r)})})}var s=t.cometd,c="undefined"!=typeof PassportSC?PassportSC.cookieHandle():"",l=n.cometUrl||"";s.configure({url:l}),s.addListener("/meta/handshake",o),s.addListener("/meta/connect",i),s.handshake(),t(e).unload(function(){s.disconnect(!0)}),messagebus.subscribe("com.sohu.logout",function(){r=0,a=0,s.disconnect(!0)},this,null,{cache:!0})},h=function(e,i){n&&i&&i.rev&&(t.getJSON(o+"?callback=?&passport="+n+"&playlistid="+i.rev),y(e,i))},f=!1,p=function(){f||(f=!0,l=t("#hisArea > .record_hd"),t('').prependTo(l.find("> ul:first")),l.find("> ul:first li").each(function(e){this.setAttribute("taborder",e),t(this).addClass("nav_tab")}),c=t('').appendTo("#hisArea"),u=t('').appendTo(l))},g=function(e){if(e=e||{data:{}},e=e.data,e&&e.subscribe){var n,i,o,s,r,a,l=e.subscribe||[],d=0,h=l.length,f=[],p=0;for(f.push('"),c.html(f.join("")),u.html(['\u8ba2\u9605\u8bbe\u7f6e','Previous','Next'].join("")),c.gNavSlider({preBtn:t("#subPreBtn"),nextBtn:t("#subNextBtn"),pretopic:"nav.sub"}),p&&k(0),l.length||v(),messagebus.publish("nav.sub.count",p)}},m=function(){c.html('

\u6b63\u5728\u52aa\u529b\u52a0\u8f7d\u6570\u636e...

'),t.getJSON(i+"&callback=?&passport="+n,function(e){g(e)})},v=function(){var e="http://my.tv.sohu.com/user/subscribe/list.do",n=['
    ','
  • ','','\u6dfb\u52a0\u8ba2\u9605','

    \u6dfb\u52a0\u8ba2\u9605

    '];t("#hisArea > div.record_bd.subscribe").html(n.join(""))},b=function(){p(),n="undefined"!=typeof PassportSC?PassportSC.cookieHandle():"",n&&(v(),m())},_=function(e,n){var i=e+n;i?(t("#sub_msg_count").show(),t("#sub_msg_count .msg_mid").text(i)):t("#sub_msg_count").hide()},k=function(e){"undefined"==typeof e&&(e=1),e/=1;var n=t("#hisArea");n.find(".hd_link").hide(),n.find(".record_bd").hide(),n.find(".record_hd li.nav_tab").removeClass("on"),n.find(".record_hd li.nav_tab[taborder="+e+"]").addClass("on"),1==e?(n.find(".hd_link").show(),n.find(".record_bd").show(),n.find(".hd_link.subscribe").hide(),n.find(".record_bd.subscribe").hide()):0==e&&(n.find(".hd_link.subscribe").show(),n.find(".record_bd.subscribe").show())},y=function(e,i){var i=i||{};if(i.el&&i.rev){{var o=i.el,s=i.rev,r=t("#sub_msg_count .msg_mid"),a=o.find(".take_tips .msg_mid"),c=a.text()/1;r.text()/1-c}a&&a.length&&c&&(a.text(0),o.find(".take_tips ").hide(),o.find(".update_tips").hide(),t.getJSON("http://my.tv.sohu.com/user/a//subscribe/push/delete.do?playlistid="+s+"&passport="+n+"&plat=100&callback=?"))}};messagebus.subscribe("nav.sub.itemnone",v,this),messagebus.subscribe("nav.sub.del",h,this),messagebus.subscribe("nav.sub.link",y,this),messagebus.subscribe("com.sohu.login.userinfo",function(e,t){d(t||{})},sohuHD,null,{cache:!0}),messagebus.subscribe("com.sohu.login",function(){b(),k(1),s||(t("#hisArea .record_hd >ul li").live("click",function(e){e=t(this);var n=e.attr("taborder")||0;k(n)}),s=!0)},this),messagebus.wait(["nav.sub.count","com.sohu.login.userinfo"],function(e,t){r=t["nav.sub.count"]||0,a=t["com.sohu.login.userinfo"].message||0,_(r,a)},this,null,{cache:!0})}(window,jQuery),function(e,t,n,i){var o=document.charset||"GBK",s="http://his.tv.sohu.com/his/del.do",r="http://his.tv.sohu.com/his/delAll.do?plat=12",a="http://his.tv.sohu.com/his/pingbatch.do",c="http://his.tv.sohu.com/his/get.do",l="http:/upload/static/play/skin/images/temp/8.jpg",u="http:/upload/static/play/skin/images/temp/9.jpg",d=[],h=!1,f=null,p="\u6b63\u5728\u64ad\u653e",g=18,m=function(e){t.cookie("hisImported",e,{expires:100,path:"/"})},v=function(){var e=arguments;if(0==e.length)return t.cookie("savehistory",null,{path:"/",domain:"tv.sohu.com"}),void 0;var n,i,o,s,r,a,c=t.cookie("savehistory"),l=c.split("%2C");for(n=0,i=e.length;i>n;n++)for(o=e[n],r=0,a=l.length;a>r;r++)s=l[r],new RegExp("\\w*\\^"+o+"\\^\\w*").test(s)&&(r!=a-1&&(s+="%2C"),c=c.replace(s,""));t.cookie("savehistory",c,{path:"/",domain:"tv.sohu.com"})},b=function(){var e=t.cookie("savehistory");if(!e)return[];e=e.split("%2C");var n,i,o=[];n=e?e.length:0;for(var s=0;n>s;++s)i=e[s].split("^"),o.push({sid:i[0],vid:i[1],order:i[2],t:i[3],timeSpace:i[7],url:i[5],nextUrl:i[8],playTime:parseInt(i[7]),title:unescape(i[6])});return o.reverse()},_=function(e){e/=1;var t=Math.floor(e/60),n=e%60;return 10>t&&(t="0"+t),10>n&&(n="0"+n),{m:t,s:n}},k=function(){if(h)try{0==t("#hiddenPostFrame").length&&t("body").append(''),0==t("#hiddenPostForm").length&&t("body").append(['
    '].join("")),t("#hiddenPostForm")[0].submit()}catch(e){}else v()},y=function(e){if(e){var n=e.split("|")[0];h?t.getJSON(s+"?callback=?&passport="+f+"&vs="+e+"&c=1"):v(n)}},x=function(e,n){var s,r,c=b()||[],l=i.cookieHandle()||"",u=c.length,d=[];if(!u)return e.hide(),n.hide(),void 0;for(r=0;u>r;r++)s=c[r],d.push(s.vid+"|"+s.t+"|"+s.playTime);n.html('

    \u6b63\u5728\u4e0a\u4f20\u5230\u4e91\u8ff9...

    ');try{t.get(a+"?encode="+o+"&passport="+l+"&callback=?&c=1&vts="+d.reverse().join(";"),function(t){e.hide(),n.hide(),t&&t.status/1==1&&(m(1),C())},"jsonp")}catch(h){e.hide(),n.hide()}},w=function(e,t){e&&(t=t||"emptyTip",e.html(['

    \u60a8\u8fd8\u6ca1\u6709\u89c2\u770b\u8fc7\u89c6\u9891\u8282\u76ee',"

    "].join("")))},T=function(){var i=t("#gHistory");if(i&&i.length){var o,s,r,a,c,l,u,d=[],h=b();if(!h||!h.length)return w(i),void 0;for(o=0,a=h.length;a>o;o++)u=[],s=h[o],r=_(s.t),s.vid==e.vid?(c=p,l="unshift"):(c="\u5df2\u770b\uff1a"+r.m+":"+r.s,l="push"),u.push("
  • ",'',n.strSub(s.title,22),"","",c,"",'\u64ad\u653e'),s.nextUrl&&u.push('\u4e0b\u4e00\u96c6'),u.push('\u5220\u9664
  • '),d[l](u.join(""));d.unshift("
      "),d.push("
    "),i.html(d.join("")),i.find("li").hover(function(){t(this).addClass("on")},function(){t(this).removeClass("on")}),i.find("li").live("click",function(e){if(e=e.target,"A"==e.tagName&&"delBtn"==e.getAttribute("rel")){var n=e.getAttribute("rev"),o=t(this);return o.fadeOut(function(){o.remove(),y(n);var e=i.find("li");e.length||w(i)}),!1}})}},S=function(){var i,o,s,r,a,c,h,f,m,v=t("#hisArea"),T=v.find("> div.record_bd:first"),S=v.find("> div.record_hd"),C=S.find("> div.hd_link:first"),N=t("#historyTimeBar div.filter_box"),j=t("#historyTimeBar div.filter_pop"),B=d||[],I=b(),O=1==t.cookie("hisImported"),P=[],A=g,U=[],L=137,R=6*L,E=0;for(!O&&I&&I.length&&(U.push('
  • ','
  • "),E++,A=17),o=0,s=B.length;s>o&&A>o;o++)f=[],i=B[o],a=i.url,-1==a.indexOf("#")&&(a=a+"#"+i.t),r=_(i.t),i.vid==e.vid?(c=p,h="unshift"):(c="\u5df2\u770b\uff1a"+r.m+":"+r.s,h="push"),m=i.tvBigPic||i.tvSmallPic||i.tvHorSmallPic||l,f.push('
  • ','','',i.title,'','

    ',n.strSub(i.title,14,!0),"",'',c,"",'','play'),i.nextUrl&&f.push('next'),f.push('del',"

  • "),P[h](f.join("")),E++;U&&U.length&&P.unshift(U.join("")),P.unshift('"),T.css({position:"relative",overflow:"hidden",width:R}),T.html(P.join("")),C.html(['\u6e05\u7a7a\u8bb0\u5f55','Previous','Next'].join(""));var F=t("#hisList"),J=t("#hisPreBtn"),q=t("#hisNextBtn"),D=t("#hisClear");F.css({position:"relative",left:0,width:E*L}),0==o&&(0==E&&w(T),D.addClass("disable"));var H=function(){if(!F)return!1;{var e=parseInt(F.css("left"),10);parseInt(F.css("width"),10)}return 0>e},M=function(){if(!F)return!1;var e=parseInt(F.css("left"),10),t=parseInt(F.css("width"),10);return t+e>R},W=function(){H()?J.removeClass("ico_pre_none"):J.addClass("ico_pre_none"),M()?q.removeClass("ico_next_none"):q.addClass("ico_next_none")},V=function(){var e=parseInt(F.css("left")),t=parseInt(F.css("width"));e+t==0&&(Q=!1,F.animate({left:e+R},function(){Q=!0}))},K=function(){F&&(0==F.find("li.item").length&&(D.addClass("disable"),J.addClass("ico_pre_none"),q.addClass("ico_next_none")),0==F.find("li").length&&(w(T),F=null))};W();var Q=!0;q.bind("click",function(){if(!F||!M()||!Q)return!1;Q=!1;var e=parseInt(F.css("left"),10);return F.animate({left:e-R},function(){Q=!0,W()}),!1}),J.bind("click",function(){if(!F||!H()||!Q)return!1;Q=!1;var e=parseInt(F.css("left"),10);return F.animate({left:e+R},function(){Q=!0,W()}),!1}),F.find("li").hover(function(){var e=t(this);!e.hasClass("import")&&e.addClass("on")},function(){t(this).removeClass("on")}).bind("click",function(e){if(e=e.target,type=e.getAttribute("rel"),"A"==e.tagName&&type){var n=e.getAttribute("rev"),i=t(this);return"delbtn"==type&&Q&&(Q=!1,i.fadeOut(function(){i.remove(),y(n),o--,E--;var e=parseInt(F.css("width"),10);F.css({width:e-L}),W(),V(),K(),Q=!0})),!1}}),F.find("li.import").find("a[rel=import]").click(function(){return N.show(),j.show().html(["

    \u5171\u6709",I.length,"\u6761\u672c\u5730\u8bb0\u5f55,\u662f\u5426\u4e0a\u4f20\u5230\u4e91\u8ff9\uff1f

    ",'

    \u786e \u5b9a','\u53d6 \u6d88

    '].join("")),!1}),D.click(function(){return D.hasClass("disable")||(N.show(),j.show().html(["

    \u60a8\u786e\u5b9a\u8981\u6e05\u7a7a\u5386\u53f2\u8bb0\u5f55\u5417\uff1f

    ",'

    \u786e \u5b9a','\u53d6 \u6d88

    '].join(""))),!1}),j.bind("click",function(e){e=e.target;var t=e.getAttribute("rel");if("A"==e.tagName&&t)switch(t){case"importComfirm":return x(N,j),!1;case"cancel":return N.hide(),j.hide(),!1;case"clearComfirm":return N.hide(),j.hide(),k(),F.find("li.item").remove(),F.css({left:0,width:L}),K(),!1;default:return}})},C=function(){f="undefined"!=typeof i?i.cookieHandle():"";var e=!!f;if(h=e,e){var n=t("#historyTimeBar #hisArea > div.record_bd:first");n.html('

    \u6b63\u5728\u52aa\u529b\u52a0\u8f7d\u6570\u636e...

    '),t.getJSON(c+"?encode="+o+"&c=1&pagesize="+g+"&callback=?&passport="+f,function(e){e&&1==e.status&&(d=e.videos,S())})}else T()};"undefined"==typeof n&&(n={}),n.initHistory=C,n.waitAjaxCall.logout&&n.waitAjaxCall.logout.push(function(){m(0)}),n.initNavLogin=function(){i.parsePassportCookie();var e=i.cookieHandle();n.initHistory();var o=[],s=[],r=!1;if(e){r=/\bfee_status\b=(.*?)(?:$|;)/.test(document.cookie);var a=decodeURIComponent(i.cookie.uniqname);s.push('"),o.push(" "),i.parsePassportCookie(),n.getScript("http://my.tv.sohu.com/user/a/profile/currinfo.do?end=0&appid="+i.cookie.appid+"&varname=gUserParams",function(){if("undefined"!=typeof gUserParams&&"1"==gUserParams.status){data=gUserParams.data,data.nickName=unescape(data.nickName);var e=n.waitAjaxCall.userParms;if(e instanceof Array)for(var i=0;i0&&t("#infoNum").show().find(".msg_mid").html(data.message),data.smallPhoto&&t("#gNavLoginAvatar").attr("src",data.smallPhoto)}})}else s.push('');t("#gNavUserInfo").html(o.join("")).find("li").hover(function(){t(this).addClass("on")},function(){t(this).removeClass("on")}),t("#gNewNavLoginBox").html(s.join("")),t("#gNewNavLoginBox #login_box").append(['