/* YUI 3.8.1 (build 5795) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */ YUI.add("intl-base",function(e,t){var n=/[, ]/;e.mix(e.namespace("Intl"),{lookupBestLang:function(t,r){function a(e){var t;for(t=0;t0){o=a(s);if(o)return o;u=s.lastIndexOf("-");if(!(u>=0))break;s=s.substring(0,u),u>=2&&s.charAt(u-2)==="-"&&(s=s.substring(0,u-2))}}return""}})},"3.8.1",{requires:["yui-base"]}); /* YUI 3.8.1 (build 5795) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */ YUI.add("intl",function(e,t){var n={},r="yuiRootLang",i="yuiActiveLang",s=[];e.mix(e.namespace("Intl"),{_mod:function(e){return n[e]||(n[e]={}),n[e]},setLang:function(e,t){var n=this._mod(e),s=n[i],o=!!n[t];return o&&t!==s&&(n[i]=t,this.fire("intl:langChange",{module:e,prevVal:s,newVal:t===r?"":t})),o},getLang:function(e){var t=this._mod(e)[i];return t===r?"":t},add:function(e,t,n){t=t||r,this._mod(e)[t]=n,this.setLang(e,t)},get:function(t,n,r){var s=this._mod(t),o;return r=r||s[i],o=s[r]||{},n?o[n]:e.merge(o)},getAvailableLangs:function(t){var n=e.Env._loader,r=n&&n.moduleInfo[t],i=r&&r.lang;return i?i.concat():s}}),e.augment(e.Intl,e.EventTarget),e.Intl.publish("intl:langChange",{emitFacade:!0})},"3.8.1",{requires:["intl-base","event-custom"]}); /* YUI 3.8.1 (build 5795) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */ YUI.add("widget-stdmod",function(e,t){function H(t){this._stdModNode=this.get(w),e.before(this._renderUIStdMod,this,O),e.before(this._bindUIStdMod,this,M),e.before(this._syncUIStdMod,this,_)}var n=e.Lang,r=e.Node,i=e.UA,s=e.Widget,o="",u="hd",a="bd",f="ft",l="header",c="body",h="footer",p="fillHeight",d="stdmod",v="Node",m="Content",g="firstChild",y="childNodes",b="ownerDocument",w="contentBox",E="height",S="offsetHeight",x="auto",T="headerContentChange",N="bodyContentChange",C="footerContentChange",k="fillHeightChange",L="heightChange",A="contentUpdate",O="renderUI",M="bindUI",_="syncUI",D="_applyParsedConfig",P=e.Widget.UI_SRC;H.HEADER=l,H.BODY=c,H.FOOTER=h,H.AFTER="after",H.BEFORE="before",H.REPLACE="replace";var B=H.HEADER,j=H.BODY,F=H.FOOTER,I=B+m,q=F+m,R=j+m;H.ATTRS={headerContent:{value:null},footerContent:{value:null},bodyContent:{value:null},fillHeight:{value:H.BODY,validator:function(e){return this._validateFillHeight(e)}}},H.HTML_PARSER={headerContent:function(e){return this._parseStdModHTML(B)},bodyContent:function(e){return this._parseStdModHTML(j)},footerContent:function(e){return this._parseStdModHTML(F)}},H.SECTION_CLASS_NAMES={header:s.getClassName(u),body:s.getClassName(a),footer:s.getClassName(f)},H.TEMPLATES={header:'
',body:'
',footer:'
'},H.prototype={_syncUIStdMod:function(){var e=this._stdModParsed;(!e||!e[I])&&this._uiSetStdMod(B,this.get(I)),(!e||!e[R])&&this._uiSetStdMod(j,this.get(R)),(!e||!e[q])&&this._uiSetStdMod(F,this.get(q)),this._uiSetFillHeight(this.get(p))},_renderUIStdMod:function(){this._stdModNode.addClass(s.getClassName(d)),this._renderStdModSections(),this.after(T,this._afterHeaderChange),this.after(N,this._afterBodyChange),this.after(C,this._afterFooterChange)},_renderStdModSections:function(){n.isValue(this.get(I))&&this._renderStdMod(B),n.isValue(this.get(R))&&this._renderStdMod(j),n.isValue(this.get(q))&&this._renderStdMod(F)},_bindUIStdMod:function(){this.after(k,this._afterFillHeightChange),this.after(L,this._fillHeight),this.after(A,this._fillHeight)},_afterHeaderChange:function(e){e.src!==P&&this._uiSetStdMod(B,e.newVal,e.stdModPosition)},_afterBodyChange:function(e){e.src!==P&&this._uiSetStdMod(j,e.newVal,e.stdModPosition)},_afterFooterChange:function(e){e.src!==P&&this._uiSetStdMod(F,e.newVal,e.stdModPosition)},_afterFillHeightChange:function(e){this._uiSetFillHeight(e.newVal)},_validateFillHeight:function(e){return!e||e==H.BODY||e==H.HEADER||e==H.FOOTER},_uiSetFillHeight:function(e){var t=this.getStdModNode(e),n=this._currFillNode;n&&t!==n&&n.setStyle(E,o),t&&(this._currFillNode=t),this._fillHeight()},_fillHeight:function(){if(this.get(p)){var e=this.get(E);e!=o&&e!=x&&this.fillHeight(this._currFillNode)}},_uiSetStdMod:function(e,t,r){if(n.isValue(t)){var i=this.getStdModNode(e,!0);this._addStdModContent(i,t,r),this.set(e+m,this._getStdModContent(e),{src:P})}else this._eraseStdMod(e);this.fire(A)},_renderStdMod:function(e){var t=this.get(w),n=this._findStdModSection(e);return n||(n=this._getStdModTemplate(e)),this._insertStdModSection(t,e,n),this[e+v]=n,this[e+v]},_eraseStdMod:function(e){var t=this.getStdModNode(e);t&&(t.remove(!0),delete this[e+v])},_insertStdModSection:function(e,t,n){var r=e.get(g);if(t===F||!r)e.appendChild(n);else if(t===B)e.insertBefore(n,r);else{var i=this[F+v];i?e.insertBefore(n,i):e.appendChild(n)}},_getStdModTemplate:function(e){return r.create(H.TEMPLATES[e],this._stdModNode.get(b))},_addStdModContent:function(e,t,n){switch(n){case H.BEFORE:n=0;break;case H.AFTER:n=undefined;break;default:n=H.REPLACE}e.insert(t,n)},_getPreciseHeight:function(e){var t=e?e.get(S):0,n="getBoundingClientRect";if(e&&e.hasMethod(n)){var r=e.invoke(n);r&&(t=r.bottom-r.top)}return t},_findStdModSection:function(e){return this.get(w).one("> ."+H.SECTION_CLASS_NAMES[e])},_parseStdModHTML:function(t){var n=this._findStdModSection(t);return n?(this._stdModParsed||(this._stdModParsed={},e.before(this._applyStdModParsedConfig,this,D)),this._stdModParsed[t+m]=1,n.get("innerHTML")):null},_applyStdModParsedConfig:function(e,t,n){var r=this._stdModParsed;r&&(r[I]=!(I in t)&&I in r,r[R]=!(R in t)&&R in r,r[q]=!(q in t)&&q in r)},_getStdModContent:function(e){return this[e+v]?this[e+v].get(y):null},setStdModContent:function(e,t,n){this.set(e+m,t,{stdModPosition:n})},getStdModNode:function(e,t){var n=this[e+v]||null;return!n&&t&&(n=this._renderStdMod(e)),n},fillHeight:function(e){if(e){var t=this.get(w),r=[this.headerNode,this.bodyNode,this.footerNode],s,o,u=0,a=0,f=!1;for(var l=0,c=r.length;l=0&&e.set(S,a)))}}},e.WidgetStdMod=H},"3.8.1",{requires:["base-build","widget"]}); /* YUI 3.8.1 (build 5795) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */ YUI.add("widget-position",function(e,t){function d(t){this._posNode=this.get(u),e.after(this._renderUIPosition,this,f),e.after(this._syncUIPosition,this,c),e.after(this._bindUIPosition,this,l)}var n=e.Lang,r=e.Widget,i="xy",s="position",o="positioned",u="boundingBox",a="relative",f="renderUI",l="bindUI",c="syncUI",h=r.UI_SRC,p="xyChange";d.ATTRS={x:{setter:function(e){this._setX(e)},getter:function(){return this._getX()},lazyAdd:!1},y:{setter:function(e){this._setY(e)},getter:function(){return this._getY()},lazyAdd:!1},xy:{value:[0,0],validator:function(e){return this._validateXY(e)}}},d.POSITIONED_CLASS_NAME=r.getClassName(o),d.prototype={_renderUIPosition:function(){this._posNode.addClass(d.POSITIONED_CLASS_NAME)},_syncUIPosition:function(){var e=this._posNode;e.getStyle(s)===a&&this.syncXY(),this._uiSetXY(this.get(i))},_bindUIPosition:function(){this.after(p,this._afterXYChange)},move:function(){var e=arguments,t=n.isArray(e[0])?e[0]:[e[0],e[1]];this.set(i,t)},syncXY:function(){this.set(i,this._posNode.getXY(),{src:h})},_validateXY:function(e){return n.isArray(e)&&n.isNumber(e[0])&&n.isNumber(e[1])},_setX:function(e){this.set(i,[e,this.get(i)[1]])},_setY:function(e){this.set(i,[this.get(i)[0],e])},_getX:function(){return this.get(i)[0]},_getY:function(){return this.get(i)[1]},_afterXYChange:function(e){e.src!=h&&this._uiSetXY(e.newVal)},_uiSetXY:function(e){this._posNode.setXY(e)}},e.WidgetPosition=d},"3.8.1",{requires:["base-build","node-screen","widget"]}); /* YUI 3.8.1 (build 5795) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */ YUI.add("widget-position-align",function(e,t){function c(t){this._posNode||e.error("WidgetPosition needs to be added to the Widget, before WidgetPositionAlign is added"),e.after(this._bindUIPosAlign,this,"bindUI"),e.after(this._syncUIPosAlign,this,"syncUI")}var n=e.Lang,r="align",i="alignOn",s="visible",o="boundingBox",u="offsetWidth",a="offsetHeight",f="region",l="viewportRegion";c.ATTRS={align:{value:null},centered:{setter:"_setAlignCenter",lazyAdd:!1,value:!1},alignOn:{value:[],validator:e.Lang.isArray}},c.TL="tl",c.TR="tr",c.BL="bl",c.BR="br",c.TC="tc",c.RC="rc",c.BC="bc",c.LC="lc",c.CC="cc",c.prototype={_posAlignUIHandles:null,destructor:function(){this._detachPosAlignUIHandles()},_bindUIPosAlign:function(){this.after("alignChange",this._afterAlignChange),this.after("alignOnChange",this._afterAlignOnChange),this.after("visibleChange",this._syncUIPosAlign)},_syncUIPosAlign:function(){var e=this.get(r);this._uiSetVisiblePosAlign(this.get(s)),e&&this._uiSetAlign(e.node,e.points)},align:function(e,t){return arguments.length?this.set(r,{node:e,points:t}):this._syncUIPosAlign(),this},centered:function(e){return this.align(e,[c.CC,c.CC])},_setAlignCenter:function(e){return e&&this.set(r,{node:e===!0?null:e,points:[c.CC,c.CC]}),e},_uiSetAlign:function(t,r){if(!n.isArray(r)||r.length!==2){e.error("align: Invalid Points Arguments");return}var i=this._getRegion(t),s,o,u;if(!i)return;s=r[0],o=r[1];switch(o){case c.TL:u=[i.left,i.top];break;case c.TR:u=[i.right,i.top];break;case c.BL:u=[i.left,i.bottom];break;case c.BR:u=[i.right,i.bottom];break;case c.TC:u=[i.left+Math.floor(i.width/2),i.top];break;case c.BC:u=[i.left+Math.floor(i.width/2),i.bottom];break;case c.LC:u=[i.left,i.top+Math.floor(i.height/2)];break;case c.RC:u=[i.right,i.top+Math.floor(i.height/2)];break;case c.CC:u=[i.left+Math.floor(i.width/2),i.top+Math.floor(i.height/2)];break;default:}u&&this._doAlign(s,u[0],u[1])},_uiSetVisiblePosAlign:function(e){e?this._attachPosAlignUIHandles():this._detachPosAlignUIHandles()},_attachPosAlignUIHandles:function(){if(this._posAlignUIHandles)return;var t=this.get(o),n=e.bind(this._syncUIPosAlign,this),r=[];e.Array.each(this.get(i),function(i){var s=i.eventName,o=e.one(i.node)||t;s&&r.push(o.on(s,n))}),this._posAlignUIHandles=r},_detachPosAlignUIHandles:function(){var t=this._posAlignUIHandles;t&&((new e.EventHandle(t)).detach(),this._posAlignUIHandles=null)},_doAlign:function(e,t,n){var r=this._posNode,i;switch(e){case c.TL:i=[t,n];break;case c.TR:i=[t-r.get(u),n];break;case c.BL:i=[t,n-r.get(a)];break;case c.BR:i=[t-r.get(u),n-r.get(a)];break;case c.TC:i=[t-r.get(u)/2,n];break;case c.BC:i=[t-r.get(u)/2,n-r.get(a)];break;case c.LC:i=[t,n-r.get(a)/2];break;case c.RC:i=[t-r.get(u),n-r.get(a)/2];break;case c.CC:i=[t-r.get(u)/2,n-r.get(a)/2];break;default:}i&&this.move(i)},_getRegion:function(t){var n;return t?(t=e.Node.one(t),t&&(n=t.get(f))):n=this._posNode.get(l),n},_afterAlignChange:function(e){var t=e.newVal;t&&this._uiSetAlign(t.node,t.points)},_afterAlignOnChange:function(e){this._detachPosAlignUIHandles(),this.get(s)&&this._attachPosAlignUIHandles()}},e.WidgetPositionAlign=c},"3.8.1",{requires:["widget-position"]}); /* YUI 3.8.1 (build 5795) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */ YUI.add("widget-stack",function(e,t){function O(t){this._stackNode=this.get(f),this._stackHandles={},e.after(this._renderUIStack,this,l),e.after(this._syncUIStack,this,h),e.after(this._bindUIStack,this,c)}var n=e.Lang,r=e.UA,i=e.Node,s=e.Widget,o="zIndex",u="shim",a="visible",f="boundingBox",l="renderUI",c="bindUI",h="syncUI",p="offsetWidth",d="offsetHeight",v="parentNode",m="firstChild",g="ownerDocument",y="width",b="height",w="px",E="shimdeferred",S="shimresize",x="visibleChange",T="widthChange",N="heightChange",C="shimChange",k="zIndexChange",L="contentUpdate",A="stacked";O.ATTRS={shim:{value:r.ie==6},zIndex:{value:0,setter:"_setZIndex"}},O.HTML_PARSER={zIndex:function(e){return this._parseZIndex(e)}},O.SHIM_CLASS_NAME=s.getClassName(u),O.STACKED_CLASS_NAME=s.getClassName(A),O.SHIM_TEMPLATE='',O.prototype={_syncUIStack:function(){this._uiSetShim(this.get(u)),this._uiSetZIndex(this.get(o))},_bindUIStack:function(){this.after(C,this._afterShimChange),this.after(k,this._afterZIndexChange)},_renderUIStack:function(){this._stackNode.addClass(O.STACKED_CLASS_NAME)},_parseZIndex:function(e){var t;return!e.inDoc()||e.getStyle("position")==="static"?t="auto":t=e.getComputedStyle("zIndex"),t==="auto"?null:t},_setZIndex:function(e){return n.isString(e)&&(e=parseInt(e,10)),n.isNumber(e)||(e=0),e},_afterShimChange:function(e){this._uiSetShim(e.newVal)},_afterZIndexChange:function(e){this._uiSetZIndex(e.newVal)},_uiSetZIndex:function(e){this._stackNode.setStyle(o,e)},_uiSetShim:function(e){e?(this.get(a)?this._renderShim():this._renderShimDeferred(),r.ie==6&&this._addShimResizeHandlers()):this._destroyShim()},_renderShimDeferred:function(){this._stackHandles[E]=this._stackHandles[E]||[];var e=this._stackHandles[E],t=function(e){e.newVal&&this._renderShim()};e.push(this.on(x,t))},_addShimResizeHandlers:function(){this._stackHandles[S]=this._stackHandles[S]||[];var e=this.sizeShim,t=this._stackHandles[S];t.push(this.after(x,e)),t.push(this.after(T,e)),t.push(this.after(N,e)),t.push(this.after(L,e))},_detachStackHandles:function(e){var t=this._stackHandles[e],n;if(t&&t.length>0)while(n=t.pop())n.detach()},_renderShim:function(){var e=this._shimNode,t=this._stackNode;e||(e=this._shimNode=this._getShimTemplate(),t.insertBefore(e,t.get(m)),this._detachStackHandles(E),this.sizeShim())},_destroyShim:function(){this._shimNode&&(this._shimNode.get(v).removeChild(this._shimNode),this._shimNode=null,this._detachStackHandles(E),this._detachStackHandles(S))},sizeShim:function(){var e=this._shimNode,t=this._stackNode;e&&r.ie===6&&this.get(a)&&(e.setStyle(y,t.get(p)+w),e.setStyle(b,t.get(d)+w))},_getShimTemplate:function(){return i.create(O.SHIM_TEMPLATE,this._stackNode.get(g))}},e.WidgetStack=O},"3.8.1",{requires:["base-build","widget"],skinnable:!0}); /* YUI 3.8.1 (build 5795) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */ YUI.add("widget-position-constrain",function(e,t){function m(t){this._posNode||e.error("WidgetPosition needs to be added to the Widget, before WidgetPositionConstrain is added"),e.after(this._bindUIPosConstrained,this,a)}var n="constrain",r="constrain|xyChange",i="constrainChange",s="preventOverlap",o="align",u="",a="bindUI",f="xy",l="x",c="y",h=e.Node,p="viewportRegion",d="region",v;m.ATTRS={constrain:{value:null,setter:"_setConstrain"},preventOverlap:{value:!1}},v=m._PREVENT_OVERLAP={x:{tltr:1,blbr:1,brbl:1,trtl:1},y:{trbr:1,tlbl:1,bltl:1,brtr:1}},m.prototype={getConstrainedXY:function(e,t){t=t||this.get(n);var r=this._getRegion(t===!0?null:t),i=this._posNode.get(d);return[this._constrain(e[0],l,i,r),this._constrain(e[1],c,i,r)]},constrain:function(e,t){var r,i,s=t||this.get(n);s&&(r=e||this.get(f),i=this.getConstrainedXY(r,s),(i[0]!==r[0]||i[1]!==r[1])&&this.set(f,i,{constrained:!0}))},_setConstrain:function(e){return e===!0?e:h.one(e)},_constrain:function(e,t,n,r){if(r){this.get(s)&&(e=this._preventOverlap(e,t,n,r));var i=t==l,o=i?r.width:r.height,u=i?n.width:n.height,a=i?r.left:r.top,f=i?r.right-u:r.bottom-u;if(ef)uf&&(e=f):e=a}return e},_preventOverlap:function(e,t,n,r){var i=this.get(o),s=t===l,a,f,c,h,p,d;return i&&i.points&&v[t][i.points.join(u)]&&(f=this._getRegion(i.node),f&&(a=s?n.width:n.height,c=s?f.left:f.top,h=s?f.right:f.bottom,p=s?f.left-r.left:f.top-r.top,d=s?r.right-f.right:r.bottom-f.bottom),e>c?da&&(e=c-a):pa&&(e=h)),e},_bindUIPosConstrained:function(){this.after(i,this._afterConstrainChange),this._enableConstraints(this.get(n))},_afterConstrainChange:function(e){this._enableConstraints(e.newVal)},_enableConstraints:function(e){e?(this.constrain(),this._cxyHandle=this._cxyHandle||this.on(r,this._constrainOnXYChange)):this._cxyHandle&&(this._cxyHandle.detach(),this._cxyHandle=null)},_constrainOnXYChange:function(e){e.constrained||(e.newVal=this.getConstrainedXY(e.newVal))},_getRegion:function(e){var t;return e?(e=h.one(e),e&&(t=e.get(d))):t=this._posNode.get(p),t}},e.WidgetPositionConstrain=m},"3.8.1",{requires:["widget-position"]}); /* YUI 3.8.1 (build 5795) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */ YUI.add("overlay",function(e,t){e.Overlay=e.Base.create("overlay",e.Widget,[e.WidgetStdMod,e.WidgetPosition,e.WidgetStack,e.WidgetPositionAlign,e.WidgetPositionConstrain])},"3.8.1",{requires:["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],skinnable:!0}); /* YUI 3.8.1 (build 5795) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */ YUI.add("datasource-local",function(e,t){var n=e.Lang,r=function(){r.superclass.constructor.apply(this,arguments)};e.mix(r,{NAME:"dataSourceLocal",ATTRS:{source:{value:null}},_tId:0,transactions:{},issueCallback:function(e,t){var n=e.on||e.callback,r=n&&n.success,i=e.details[0];i.error=e.error||e.response.error,i.error&&(t.fire("error",i),r=n&&n.failure),r&&r(i)}}),e.extend(r,e.Base,{initializer:function(e){this._initEvents()},_initEvents:function(){this.publish("request",{defaultFn:e.bind("_defRequestFn",this),queuable:!0}),this.publish("data",{defaultFn:e.bind("_defDataFn",this),queuable:!0}),this.publish("response",{defaultFn:e.bind("_defResponseFn",this),queuable:!0})},_defRequestFn:function(e){var t=this.get("source"),r=e.details[0];n.isUndefined(t)&&(r.error=new Error("Local source undefined")),r.data=t,this.fire("data",r)},_defDataFn:function(e){var t=e.data,r=e.meta,i={results:n.isArray(t)?t:[t],meta:r?r:{}},s=e.details[0];s.response=i,this.fire("response",s)},_defResponseFn:function(e){r.issueCallback(e,this)},sendRequest:function(e){var t=r._tId++,n;return e=e||{},n=e.on||e.callback,this.fire("request",{tId:t,request:e.request,on:n,callback:n,cfg:e.cfg||{}}),t}}),e.namespace("DataSource").Local=r},"3.8.1",{requires:["base"]}); /* YUI 3.8.1 (build 5795) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */ YUI.add("datasource-get",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.DataSource.Get=e.extend(n,e.DataSource.Local,{_defRequestFn:function(t){var n=this.get("source"),r=this.get("get"),i=e.guid().replace(/\-/g,"_"),s=this.get("generateRequestCallback"),o=t.details[0],u=this;return this._last=i,YUI.Env.DataSource.callbacks[i]=function(n){delete YUI.Env.DataSource.callbacks[i],delete e.DataSource.Local.transactions[t.tId];var r=u.get("asyncMode")!=="ignoreStaleResponses"||u._last===i;r&&(o.data=n,u.fire("data",o))},n+=t.request+s.call(this,i),e.DataSource.Local.transactions[t.tId]=r.script(n,{autopurge:!0,onFailure:function(n){delete YUI.Env.DataSource.callbacks[i],delete e.DataSource.Local.transactions[t.tId],o.error=new Error(n.msg||"Script node data failure"),u.fire("data",o)},onTimeout:function(n){delete YUI.Env.DataSource.callbacks[i],delete e.DataSource.Local.transactions[t.tId],o.error=new Error(n.msg||"Script node data timeout"),u.fire("data",o)}}),t.tId},_generateRequest:function(e){return"&"+this.get("scriptCallbackParam")+"=YUI.Env.DataSource.callbacks."+e}},{NAME:"dataSourceGet",ATTRS:{get:{value:e.Get,cloneDefaultValue:!1},asyncMode:{value:"allowAll"},scriptCallbackParam:{value:"callback"},generateRequestCallback:{value:function(){return this._generateRequest.apply(this,arguments)}}}}),YUI.namespace("Env.DataSource.callbacks")},"3.8.1",{requires:["datasource-local","get"]}); /* YUI 3.8.1 (build 5795) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */ YUI.add("dataschema-base",function(e,t){var n=e.Lang,r={apply:function(e,t){return t},parse:function(t,r){if(r.parser){var i=n.isFunction(r.parser)?r.parser:e.Parsers[r.parser+""];i&&(t=i.call(this,t))}return t}};e.namespace("DataSchema").Base=r,e.namespace("Parsers")},"3.8.1",{requires:["base"]}); /* YUI 3.8.1 (build 5795) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */ YUI.add("dataschema-json",function(e,t){var n=e.Lang,r=n.isFunction,i=n.isObject,s=n.isArray,o=e.DataSchema.Base,u;u={getPath:function(e){var t=null,n=[],r=0;if(e){e=e.replace(/\[\s*(['"])(.*?)\1\s*\]/g,function(e,t,i){return n[r]=i,".@"+r++}).replace(/\[(\d+)\]/g,function(e,t){return n[r]=parseInt(t,10)|0,".@"+r++}).replace(/^\./,""),t=e.split(".");for(r=t.length-1;r>=0;--r)t[r].charAt(0)==="@"&&(t[r]=n[parseInt(t[r].substr(1),10)])}return t},getLocationValue:function(e,t){var n=0,r=e.length;for(;n=0;--f){E={},w=n[f];if(w){for(l=y.length-1;l>=0;--l){d=y[l],m=u.getLocationValue(d.path,w);if(m===undefined){m=u.getLocationValue([d.locator],w);if(m!==undefined){g.push({key:d.key,path:d.locator}),y.splice(f,1);continue}}E[d.key]=o.parse.call(this,u.getLocationValue(d.path,w),d)}for(l=g.length-1;l>=0;--l)d=g[l],E[d.key]=o.parse.call(this,w[d.path]===undefined?w[l]:w[d.path],d);for(l=b.length-1;l>=0;--l)h=b[l].key,E[h]=b[l].parser.call(this,E[h]),E[h]===undefined&&(E[h]=null);s[f]=E}}return i.results=s,i},_parseMeta:function(e,t,n){if(i(e)){var r,s;for(r in e)e.hasOwnProperty(r)&&(s=u.getPath(e[r]),s&&t&&(n.meta[r]=u.getLocationValue(s,t)))}else n.error=new Error("JSON meta data retrieval failure");return n}},e.DataSchema.JSON=e.mix(u,o)},"3.8.1",{requires:["dataschema-base","json"]}); /* YUI 3.8.1 (build 5795) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */ YUI.add("datasource-jsonschema",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.mix(n,{NS:"schema",NAME:"dataSourceJSONSchema",ATTRS:{schema:{}}}),e.extend(n,e.Plugin.Base,{initializer:function(e){this.doBefore("_defDataFn",this._beforeDefDataFn)},_beforeDefDataFn:function(t){var n=t.data&&(t.data.responseText||t.data),r=this.get("schema"),i=t.details[0];return i.response=e.DataSchema.JSON.apply.call(this,r,n)||{meta:{},results:n},this.get("host").fire("response",i),new e.Do.Halt("DataSourceJSONSchema plugin halted _defDataFn")}}),e.namespace("Plugin").DataSourceJSONSchema=n},"3.8.1",{requires:["datasource-local","plugin","dataschema-json"]}); YUI.add("shortcut-multimedia-datasource",function(c){var b=c.Lang;function a(d){a.superclass.constructor.apply(this,arguments)}a.ATTRS={source:{value:null},offset:{value:30,validator:b.isNumber},shouldDedup:{value:true,validator:b.isBoolean},maxResults:{value:999,validator:b.isNumber},buffer:{value:25,validator:b.isNumber}};a.NAME="multimediaDatasource";a.NS="io";c.extend(a,c.Plugin.Base,{initializer:function(d){this.results=[];this.start=0;this.total=0;this.datasource=new c.DataSource.Get({source:this.get("source")})},setupJSONSchema:function(d){this.datasource.plug(c.Plugin.DataSourceJSONSchema,d)},initData:function(d){this.results=d;this.beac=null},_shouldRequest:function(){if(this.total&&this.start>this.total){return false}return true},_hasBuffer:function(d){if(d>-1&&this._shouldRequest()&&this.start-d>=this.get("buffer")){return true}this._fetchMoreResults();return false},_fetchMoreResults:function(){if(!this._shouldRequest()){return}this.sendRequest();this.start+=this.get("offset")},_onSuccess:function(d){this._parseResults(d)},_parseResults:function(k){var i=k.response;if(this.beac==null&&typeof k.data.beac!="undefined"){this.beac=k.data.beac}if(i.meta){if(i.meta.first<20&&this.get("shouldDedup")){var j={},d={},h=[],g=c.Lang.isValue(this.results[0].oid)?"oid":"vid",m=this.results.length,f=0,l=null;c.each(this.results,function(e,n){j[e[g].toUpperCase()]=n;if(g=="vid"&&e.host=="bing.com"){d[c.Escape.html(e.tit).toUpperCase()]=n}});c.each(i.results,function(e){l=j[e[g].toUpperCase()];if(!c.Lang.isValue(l)&&c.Lang.isValue(e.muid)){l=j[e.muid.toUpperCase()]}curTit=d[e.tit.toUpperCase()];if(f>=m||(!c.Lang.isValue(l)&&!c.Lang.isValue(curTit))){h.push(e)}else{if(c.Lang.isValue(l)){this.results[l]=c.merge(this.results[l],e);if(this.results[l].fpurl){this.results[l].fpurl=this.results[l].fpurl.replace("&tt=b","&tt=s")}}else{if(c.Lang.isValue(curTit)){this.results[curTit]=c.merge(this.results[curTit],e)}}++f}},this);i.results=h}this.results=this.results.concat(i.results);this.total=Math.min(this.get("maxResults"),i.meta.total)}this.fire("data",{data:i,count:this.results.length,beac:this.beac})},getResults:function(e,d){return this.results.slice(e,(d|5+e))},getResult:function(d){if(d>-1){this._hasBuffer(d);if(this.results[d]){return this.results[d]}}return null},sendRequest:function(){this.datasource.sendRequest({request:"&b="+this.start,callback:{success:c.bind(this._onSuccess,this),failure:function(d){}}})}});c.namespace("Search.Shortcut").MultimediaDatasource=a},"1.0.0",{requires:["base","plugin","datasource-get","datasource-jsonschema","dataschema-json","escape"]});YUI.add("mi5-multimedia-overlay-violet",function(b){var d="info",i="pod",a="playpod",g="info-attr",h="btnn",e="next",j="prev",l="icn",k="close";var n,m,f=(b.UA.webkit?true:false);width=height=twidth=0,playTimer={timer:false,delay:5000,startDelay:300},time=0,touchmoving=0,docn=b.one("#doc")||b.one("#outer-wrapper"),body=b.one("body"),htm=b.one("html");function c(o){c.superclass.constructor.apply(this,arguments)}c.ATTRS={parentNode:{value:"body",getter:function(o){return b.one(o)}},containerNode:{setter:b.one},data:{writeOnce:true,value:[]},selector:{value:"li"},pvUrl:{writeOnce:true},strings:{writeOnce:true,value:[]},easing:{value:"ease-out"},duration:{value:300},data:{value:[]},prefetch:{value:10},transitionLimit:{value:400}};c.NAME="multimediaOverlay";b.extend(c,b.Base,{initializer:function(o){this._moving=false;this.high=0;this.low=0;this.prefetched=[];this._bindUI();this.plug(b.Search.Shortcut.MultimediaDatasource,o.ds);this.io.initData(this.get("data"));this._bindIO();this.beac=null;this.synced=this.autoPlayFail=false;this._easing=this.get("easing");this._duration=this.get("duration");time=this._getTime();this.tetimer=false;this.yoff=0;this.current=0;this.last=false;this.first=false;this.disableTransition=false;this.pstcat=false},_bindUI:function(){this.get("containerNode").all(this.get("selector")+" a").each(function(o){});this.get("containerNode").delegate("click",this._open,this.get("selector"),this)},resizeHack:function(){this._cancelResizeTimer();this.timer7=b.later(200,this,function(o){if(this._isPageScaled()){return}var p=b.UA.iphone?b.config.win.innerHeight:this._viewport.height;if((b.DOM.viewportRegion().top!=this._viewport.top)||(o!=p)){this._onResize()}},height,true)},_bindIO:function(){this.high=this.get("data").length-1;this.io.on("data",b.bind(this._onData,this))},_open:function(q){q.preventDefault();if(!q.target.ancestor("a",true)){return}this.current=parseInt(q.currentTarget.one("img").getAttribute("data-pos"));if(isNaN(this.current)){this.current=0}var o=q.currentTarget.one("a").getAttribute("href")||q.currentTarget.one("a").getAttribute("data-href");var p=this._data(this.current);if(p&&p.bURL){this.beacon(p.bURL)}this._logPV(p);this.yoff=docn.get("docScrollY");touchmoving=0;htm.addClass("ohid");this.renderUI();this._bindScroller();this._syncScroller();this._bindCustom()},_data:function(o){return this.io.getResult(o)},_logPV:function(p){if(this.get("pvUrl")){var o=this.get("pvUrl")+"&theater=1&callback={callback}";if(p.host){o+="&host="+p.host}if(p.ct){o+="&ct="+p.ct}if(p.plr&&p.plr.plr&&p.plr.plr!=2){o+="&ilk=hq"}if(this.pstcat){o+="&pstcat="+encodeURIComponent(this.pstcat)}b.jsonp(o,this._handleJSONP)}},_handleJSONP:function(){},_onData:function(r){var q=r.data;this.synced=true;this.high=this.io.total-1;if(!this.beac&&b.Lang.isValue(r.beac)){this.beac=r.beac}if(q.meta&&q.meta.first<6){if(b.Lang.isValue(q.meta.pstcat)){this.pstcat=q.meta.pstcat}var p=this.io.getResult(this.current);if(b.Lang.isValue(p.plr)){if(this.autoPlayFail&&this.clickedpos==this.current){var o=this._cb.one(".current s");if(p.plr.plays){o.replaceClass("sico","pico");this._playVideo(false)}else{o.show()}}}this._setInfo(p)}if(!this._moving){if(this.current ',zIndex:15};this.overlay=new b.Overlay(o);this.overlay.render(this.get("parentNode"));this.overlay.get("boundingBox").addClass("ltbx").removeClass("yui3-overlay").addClass("yui3-multimedia-overlay");this.content_box=this.overlay.get("contentBox").removeClass("yui3-overlay-content").addClass("ltbx-content").addClass("yui3-multimedia-overlay");this._setCustomStyles();docn.setStyle("display","block")},_destroyOverlay:function(o){if(this.overlay){this.mask=null;this.overlay.get("boundingBox").purge(true);this.overlay.destroy();this._detachEvents()}if(o=="h"){docn.setStyle("height","100%");docn.setStyle("visibility","visible");docn.removeClass("ohid");b.config.win.scrollTo(0,this.yoff)}},_renderBody:function(){var o=b.one(document.createDocumentFragment());b.Node.create('
    ').appendTo(o);this.info=o.one("."+d);this.infoatt=o.one("."+g);this.playpod=o.one("."+a);this._cb=this.playpod.one("ul");this._prvNode=b.Node.create('').appendTo(o);this._nxtNode=b.Node.create('').appendTo(o);this.overlay.setStdModContent(b.WidgetStdMod.BODY,o);this.playpod.setStyle("width",width);this.playpod.setStyle("height",height);this.close=this.content_box.one("."+k);this.close.set("title",this.get("strings")["close"])},_detachEvents:function(o){b.Array.each(this._events||[],function(p){p.detach()},this);this._events=[]},_hide:function(){htm.removeClass("ohid");this._destroyOverlay("h");this._detachCustom();this._sendBeac("close");this._cancelPlayTimer();this._cancelResizeTimer();this._isPlaying=false},_sendBeac:function(o){if(!this.beac||typeof this.beac[o]=="undefined"){return}this.beacon(this.beac[o])},beacon:function(p){if(!p){return}var o=new Image();o.src=p+(p.indexOf("?")===-1?"?":"&")+(new Date()).getTime()},_isMultiTouch:function(o){return b.Lang.isArray(o.touches)&&o.touches.length>1},_isPageScaled:function(){return(Math.abs(b.config.win.innerWidth-b.config.win.width)>10)},_onTouchStart:function(o){o=o.touches[0];n=o.pageX;m=o.pageY},_onTouchMove:function(p){if(this._moving||this._isMultiTouch(p)||this._isPageScaled()){return}p=p.touches[0];if(n0;if(o){this.fire("forward")}if(q){this.fire("backward")}},_onResize:function(o){b.config.win.scrollTo(0,1);this._viewport=b.DOM.viewportRegion();width=this._viewport.width;height=b.UA.iphone?b.config.win.innerHeight:this._viewport.height;twidth=width;this.overlay.set("width",width+"px");this.overlay.set("height",height+"px");this.overlay.set("xy",[this._viewport.left,this._viewport.top]);this.playpod.setStyle("width",width);this.playpod.setStyle("height",height);this.fire("repaint",{init:false,backward:false,forward:false,resize:true,sync:false});this.resizeHack();this._resizeWrapper()},_bindScroller:function(){var o=this;o._events=[];o._events.push(this.close.on("click",b.bind(this._hide,this)));o._events.push(b.on("touchmove",function(p){if(this._isPageScaled()||this._isMultiTouch(p)){return}p.halt()},window,o));o._events.push(o._cb.on("touchstart",o._onTouchStart,o));o._events.push(o._cb.on("touchmove",o._onTouchMove,o));o._events.push(o._cb.on("flick",b.bind(o._onFlick,o)));o._events.push(o.info.on("flick",b.bind(o._onFlick,o)));!b.UA.iphone&&o._events.push(o._cb.on("touchend",b.bind(o._onTouchEnd,o)));o._events.push(b.on("windowresize",b.bind(o._onResize,o)));o._events.push(o.on("forward",o.forward,o));o._events.push(o.on("backward",o.backward,o));o._events.push(o.on("repaint",o.repaint,o));o._events.push(o._nxtNode.on("click",o._next,o));o._events.push(o._prvNode.on("click",o._prev,o));o._events.push(b.on("key",o._prev,b.config.doc.body,"down:37",o));o._events.push(b.on("key",o._next,b.config.doc.body,"down:39",o))},_transform:function(o,p){return(f)?"translate3d("+o+", "+p+", 0)":"translate("+o+","+p+")"},_next:function(o){o.preventDefault();this._cancelPlayTimer();this._sendBeac("next");this.next()},next:function(){this.fire("forward")},_prev:function(o){o.preventDefault();this._cancelPlayTimer();this._sendBeac("prev");this.prev()},prev:function(){this.fire("backward")},_togglePlay:function(){var o=this._playpauseNode;o.toggleClass("active");if(o.hasClass("active")){this._startPlay();this.fire("play");this._sendBeac("play")}else{this._pause();this.fire("pause");this._sendBeac("pause")}},_play:function(){this._cancelPlayTimer();if(!this._isPlaying){return}this.next();this._zoomOut()},_startPlay:function(){this._cancelPlayTimer();this._isPlaying=true;this._play();playTimer.timer=b.later(playTimer.startDelay,this,this._zoomOut)},_pause:function(){this._cancelPlayTimer();this._zoomIn();this._isPlaying=false},_cancelPlayTimer:function(){if(playTimer.timer){playTimer.timer.cancel()}},_cancelResizeTimer:function(){this.timer7&&this.timer7.cancel()},_zoomOut:function(){this._zoomOutEnd()},_zoomOutEnd:function(){this._cancelPlayTimer();if(this._isPlaying){playTimer.timer=b.later(playTimer.delay,this,this._play)}},_zoomIn:function(){this._zoomInEnd()},_zoomInEnd:function(o){},forward:function(){if(this._moving){return}var t=this;var q=t._cb.one(".current");var o=q.get("nextSibling");if(!o&&t.currentr.low){o=r._cb.all("li").item(2)}if(!o||r.current==r.low){r._initCB();return}r._moving=true;if(o){this._restoreCurrent();o.addClass("current");q.removeClass("current")}r._cb.transition({easing:r._easing,duration:r._getDuration(),transform:r._transform(twidth+"px",0)},function(){r.fire("repaint",{init:false,backward:true,forward:false,resize:false,sync:false})});var p=r._data(r.current-2);if(!p){r.first=true;r.last=false}else{r.last=false;r.first=false}var t=r._data(r.current-1);this._logPV(t);this._setInfo(t)},_syncScroller:function(){var u=this;u._resizeWrapper();var p=prevNode=b.Node.create("
  • ");var o=u._data(u.current),t=u._data(u.current+1),w=u._data(u.current-1);this._setInfo(o);var q=u._getItem(o,u.current);q.addClass("current");u._cb.append(q);u.prefetched[u.current]=1;if(t){p=u._getItem(t,u.current+1);u.prefetched[u.current+1]=1;u.last=false}else{u.last=true}u._cb.append(p);p.setStyle("transform",this._transform(twidth+"px",0));if(w){prevNode=u._getItem(w,u.current-1);u._cb.append(prevNode);prevNode.setStyle("transform",this._transform(-1*twidth+"px",0));u.prefetched[u.current-1]=1;u.first=false}else{u.first=true;var r=u._data(u.current+2);if(r){var v=u._getItem(r,u.current+2);u._cb.append(v);u.prefetched[u.current+2]=1}else{u._cb.append(prevNode)}}u.fire("repaint",{init:true,forward:false,backward:false,resize:false,sync:false});this.resizeHack()},_toggleNextPrev:function(){var o=this.current;if(!this.io.getResult(o-1)){this._prvNode.hide()}else{this._prvNode.show()}if(o==(this.io.total-1)||(o==this.high)){this._nxtNode.hide()}else{this._nxtNode.show()}},_getItem:function(o,p){return b.Node.create('
  • ')},_getTime:function(){var o=new Date();return o.getTime()},repaint:function(C){var E=this;var r=E._cb.one(".current");var v=r.get("nextSibling");if(!v){v=E._cb.all("li").item(0)}var p=r.get("previousSibling");if(!p){p=E._cb.all("li").item(2)}E._cb.setStyle("transform",this._transform(0,0));if(r){var q=parseInt(r.getAttribute("data-id"));r.setStyles({display:"block",visibility:"visible",transform:this._transform(0,0)});E.current=parseInt(q);var F=E._data(E.current);if(C.sync&&E.current<7&&b.Lang.isValue(F.plr)){if(F.plr.plays){var B=r.one("s");B.replaceClass("sico","pico")}F.trurl&&r.one(".matt a").set("href",F.trurl);F.iturl&&r.one(".vholder a").set("href",F.iturl)}C.resize&&E._setItem(F,r);var z=E._data(E.current+1),u=E._data(E.current-1),t=E.current-1,y=E.current+1;if(p){var D=p;if((C.backward||C.sync)&&u){D=E._getItem(u,E.current-1);p.replace(D);E.prefetched[t]=1}else{if(C.resize&&u){E._setItem(u,p)}}D.setStyles({display:"block",visibility:"visible",transform:this._transform(-1*twidth+"px",0)});if(this.first){D.setStyle("visibility","hidden")}}if(v){var o=v;if((C.forward||C.sync)&&z){o=E._getItem(z,E.current+1);v.replace(o);E.prefetched[y]=1}else{if(C.resize&&z){E._setItem(z,v)}}o.setStyles({transform:this._transform(twidth+"px",0),display:"block",visibility:"visible"});if(this.last){o.setStyle("visibility","hidden")}}}this._moving=false;this.fire("repainted");this._toggleNextPrev();for(var x=0;x80){i=this.shortenDesc(i,80)+"..."}var g=k.tit||"";if(g.length>40){g=this.shortenDesc(g,40)+"..."}var h=d.Node.create('
  • '+g+"

    "+(i?"

    "+i+"

    ":"")+'
    '+k.host+""+(k.l?""+k.l+"":"")+(k.age?""+k.age+"":"")+"
  • ");return h},shortenDesc:function(i,g){var h=i;if(i.length>g){h=i.substr(0,g);var f=h.lastIndexOf(" ");h=h.substring(0,f)}return h},_bindCustom:function(){var f=this._data(this.current);this.autoPlayFail=!f.plr.plays;this.clickedpos=this.current;if(f.plr.plays){}else{if(!this.synced){this._cb.one(".current s").hide()}}this._cb.delegate("click",this._playVideo,".vholder a",this)},_detachCustom:function(){if(this.spotlight&&this.spotlight.plr){this.spotlight.plr.destroy();this.spotlight.setStyle("display","none");this.spotlight=null}}});d.namespace("Mobile").VideoOverlay=b},"1.0.0",{requires:["base","node","mi5-multimedia-overlay-violet","shortcut-videodd-player","json","stylesheet","mi5-multimedia-scroller"]});YUI.add("shortcut-videodd-player",function(b){function a(c){a.superclass.constructor.apply(this,arguments)}a.NAME="video-dd-player";a.NS="plr";a.ATTRS={plrcode:{value:2},htag:{value:"embed"},eurl:{value:""},fv:{value:""},domain:{value:""},pid:{value:""},eid:{value:""},yepUrl:{value:null},hulUrl:{value:null}};b.extend(a,b.Plugin.Base,{initializer:function(c){this.height=this.width="100%"},destructor:function(){this.player&&this.player.destroy();this.playerNode&&this.playerNode.remove(true)},renderPlayer:function(){this.playerNode=null;switch(this.get("plrcode")){case 1:this.renderYEPPlayer();break;case 2:case 4:case 5:this.renderThirdPartyPlayer();break;case 3:this.renderHuluPlayer();break}},renderYEPPlayer:function(){this.plid=b.guid();var d=this.get("yepUrl")+"&pid="+this.get("pid");var c=(b.UA.ie&&b.UA.ie==6);this.playerNode=b.Node.create('
    ');if(!c){this.playerNode.one("iframe").on("load",function(f){this.playerNode.setAttribute("style","");this.playerNode.removeAttribute("style")},this)}this.get("host").setContent(this.playerNode)},renderHuluPlayer:function(){this.player=new b.Search.Shortcut.PlayerHulu({contentNode:this.get("host"),pid:this.get("eid"),proxy:this.get("hulUrl")})},renderThirdPartyPlayer:function(){switch(this.get("htag")){case"iframe":this._renderIframe();break;case"object":this._renderObjectTag();break;default:this._renderEmbedTag();break}this.get("host").setContent(this.playerNode)},_renderIframe:function(){this.plid=b.guid();this.playerNode=b.Node.create('
    ')},_renderEmbedTag:function(){this.plid=b.guid();var d="";if(this.get("domain")=="ehow.com"){d=' allowScriptAccess="always"'}var c=this.get("fv")?'flashvars="'+this.get("fv")+'"':"";this.playerNode=b.Node.create('
    ")},_renderObjectTag:function(){this.playerNode=b.Node.create('
    '+this.obj.eurl+"
    ");this.playerNode.setStyle("width",this.width);this.playerNode.setStyle("height",this.height)}});b.namespace("Plugin").VideoDDPlayer=a},"1.0.0",{requires:["plugin","base","player-hulu"]});(function(s){s.parseJSON=function(filter){var j;function walk(k,v){var i,n;if(v&&typeof v==="object"){for(i in v){if(Object.prototype.hasOwnProperty.apply(v,[i])){n=walk(i,v[i]);if(n!==undefined){v[i]=n}}}}return filter(k,v)}if(/^[\],:{}\s]*$/.test(this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+this+")");return typeof filter==="function"?walk("",j):j}throw new SyntaxError("parseJSON")}})(String.prototype);var NewSiteApplication=function(){return function(){this.initialize.apply(this,arguments)}}();NewSiteApplication.prototype={initialize:function(){this.comps=[];this.obs={};this.addedElements={};this._readyEventFired=false;this._playerContainerName=null;this._responseJSON=null;this.componentJSON=null;this.configJSON=null;this.queryString=null;this.onLoadCallbacks=[];this._partnerGuid=null;this._defaultClipId=null;this._prefix="NS_";this._flashEmbedPrefix="NS_FLASH_";this._PIDLength=32;this._scriptTagId="NS_GUID_JS";this._guidURLParam="guid";this._jsonServiceTimeoutID=null;this._jsonServiceTimeoutLength=10000;this.DEBUG=false;this.LOGGER=null;this.VERSION="$Id: hulu_global.js,v 1.2 2007/10/24 00:23:06 jqyao Exp $";this._proxyUrlJSON="/hulu_proxy/";if(!window.opera&&document.all){this.unloadSet=false;if(!this.unloadSet){window.attachEvent("onbeforeunload",this._prepUnload);this.unloadSet=true}}},_prepUnload:function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};var b=function(){var f=document.getElementsByTagName("OBJECT");for(var e=f.length-1;e>=0;e--){f[e].style.display="none";for(var a in f[e]){if(typeof f[e][a]=="function"){f[e][a]=function(){}}}}};window.attachEvent("onunload",b)},run:function(c){var b=this;this._jsonServiceTimeoutID=window.setTimeout(function(){b.fireJSONError(b)},b._jsonServiceTimeoutLength);b.proxyUrl=c;this.loadComponentJson()},loadComponentJson:function(){var a=this;Y.use("jsonp",function(b){b.jsonp(a.proxyUrl,c)});function c(b){if(b.components){NewSite.loadComponents(b)}}},ping:function(){return true},fireJSONError:function(d){var c={code:"NS_JS_001",type:"JSON",displayMessage:"Page components failed to load.",description:"Page component JSON service timed out."};d.updateObservers("newsiteError",c)},registerReady:function(e){this.traceMsg("registerReady: "+e);if(this.addedElements[e]){this.addedElements[e].isReady=true}if(e=="videoPlayerComponent"||this.isComponentReady("videoPlayerComponent")){for(var f in this.addedElements){var d=this.addedElements[f];if(d.isReady&&!d.isTracked){this.videoPlayerComponent.trackComponent([d.trackingInfo]);d.isTracked=true}}}this.fireReady(e)},getComponents:function(){return this.componentJSON},isComponentReady:function(d){try{return this.addedElements[d].isReady}catch(c){}return false},loadComponents:function(k){clearTimeout(this._jsonServiceTimeoutID);var m=this;try{if(k.error){window.setTimeout(function(){m.fireJSONError(m);m.reportError("Service error: "+k.error.errorMessage)},500)}this._responseJSON=k;var o=this.componentJSON=this._responseJSON.components;var p=this.configJSON=this._responseJSON.config;for(var j in o){var l=o[j];var e=this.initializeComponent(j,l);if(this.EL(j)){e=this.addComponentToDom(e)}this.extendComponent(e);this.comps.push(j)}}catch(n){this.reportError(n,"loadComponents")}},initializeComponent:function(d,c){return this[d]={instance:null,compName:d,parent:this,options:c}},addComponentToDom:function(h){var f=h.compName;this.traceMsg("addComponentToDom: "+f);var e=h.options;if(this.EL(f)){var g=this._flashEmbedPrefix+f;if(!this.EL(g)){this.EL(f).innerHTML=this.getFlashTag(g,e);this.addedElements[f]={};this.addedElements[f].trackingInfo=this.getTrackingInfo(f,e);this.addedElements[f].isReady=false;this.addedElements[f].isTracked=false;h.instance=this.registerFlashObject(g)}}return h},extendComponent:function(c){var d=c.compName;this.extend(c,this["commonComponentMethods"]);if(this[d+"Methods"]){this.extend(c,this[d+"Methods"])}},registerFlashObject:function(c){var d=null;if(navigator.appName.indexOf("Microsoft")!=-1){d=window[c]}else{d=document[c]}return d?d:false},addListener:function(m,n,p){this.traceMsg("addListener: "+m+"\n
    callbackObj "+n+"\n
    callbackFunc "+p);n=this._stringToObject(n);if(!p){p=m}if(!this.obs[m]){this.obs[m]=[]}var k=this.obs[m];var e=k.length;for(var o=0;ocallbackObj "+i+"\n
    callbackFunc "+p);this.obs[m].push({obj:n,func:p});return m},addFlashListener:function(f,d,e){d=this.registerFlashObject(d);this.addListener(f,d,e)},removeListener:function(l,m,e){m=this._stringToObject(m);if(!e){e=l}this.traceMsg("removeListener:\ncallbackObj "+m+"\ncallbackFunc "+e);if(!this.obs[l]){return false}var j=this.obs[l];var i=j.length;for(var n=0;n0){var h=g.shift();if(!c++){j=window[h]}else{j=j[h]}}if(j){return j}}return i},setPlayerContainer:function(b){this.traceMsg("setPlayerContainer : "+b);if(this.EL(b)){this._playerContainerName=b;return b}return null},getPlayerContainerName:function(){return this._playerContainerName},setDefaultClipId:function(b){this._defaultClipId=b},getDefaultClipId:function(){return this._defaultClipId},_parseVideoId:function(c){try{c=c+"";c=c.replace(/.*pid=([^&]+).*/i,"$1");if(c.length!=this._PIDLength){throw"Invalid Video PID: "+c}}catch(d){this.reportError(d,"")}return c},getNPMLObject:function(){return this._responseJSON},EL:function(b){if(typeof b=="string"){b=document.getElementById(b)}return b},extend:function(d,f){for(var e in f){d[e]=f[e]}return d},readyEventFired:function(){return this._readyEventFired},fireReady:function(b){this.traceMsg("fireReady: "+b);if(!this.readyEventFired()){if(this.allComponentsReady()){this.updateObservers("newsiteReady",{});this._readyEventFired=true;this.onComponentsLoaded();YUI().use("event-custom",function(a){a.Global.fire("huluplayer:ready")})}}},allComponentsReady:function(){this.traceMsg("allComponentsReady?");for(var b in this.addedElements){if(this.addedElements[b].isReady==false){return false}}return true},onComponentsLoaded:function(){while(this.onLoadCallbacks.length>0){var c=this.onLoadCallbacks.pop();try{if(c){c()}}catch(d){this.reportError(d)}}},onLoad:function(b){this.onLoadCallbacks.push(b)},getEnvironment:function(){var i=this.getQueryString();var m=document.referrer;var e=document.URL;var o=navigator.userAgent;var n={queryString:i,referrer:m,url:e,userAgent:o};var k=["availHeight","availWidth","colorDepth","height","width"];for(var p=0;p';for(var j in e){var i=this.getAttribute(j);if(this.isRequired(j)&&!this.getAttribute(j)){throw"Missing required attribute: "+j}if(j.toLowerCase()!="width"&&j.toLowerCase()!="height"){if(j.toLowerCase()=="url"){j="movie"}if(j.toLowerCase()=="wmode"){i="transparent"}a+=''}}a+=""}catch(h){this.handleError(h);return""}return a},handleError:function(a){if(this.errorHandler!=null){this.errorHandler(a)}},cleanup:function(){this.errorHandler=null;for(var a in this){this[a]=null}}};b.setErrorHandler(this.reportError);return b},hideAllComponents:function(){try{var e=this.comps.length;for(var d=0;d"+l+"
    "+k+"
    "+h)}}};NewSiteApplication.prototype.videoPlayerComponentMethods={properties:{},playVideo:function(c,d){c=this.parent._parseVideoId(c);this.toComponent("playVideo",c)},pauseVideo:function(){this.toComponent("pauseVideo")},stopVideo:function(){this.toComponent("stopVideo")},resumeVideo:function(){this.toComponent("resumeVideo")},next:function(){this.toComponent("nextVideo")},previous:function(){this.toComponent("previousVideo")},seek:function(b){this.toComponent("seekVideo",b)},getProperty:function(b){return this.properties[b]},getProperties:function(){return this.properties},setProperties:function(c){for(var d in c){this.properties[d]=c[d]}},mute:function(){this.toComponent("muteVideo")},setVolume:function(b){this.toComponent("setPlayerVolume",b)},trackComponent:function(b){this.toComponent("trackComponent",b)},submitToUrl:function(b){this.toComponent("submitToUrl",b)},closeConnection:function(){this.toComponent("closeConnection")},getInstance:function(){if(!this.instance){this.instance=this.parent.registerFlashObject(this.parent.getPlayerContainerName())}return this.instance}};NewSiteApplication.prototype.linkComponentMethods={newLink:function(b){this.setInfo(b);this.toComponent("newLink",b)}};NewSiteApplication.prototype.logoComponentMethods={};NewSiteApplication.prototype.adComponentMethods={videoAdBegin:function(b){this.setInfo(b);this.toComponent("videoAdBegin",b)}};NewSiteApplication.prototype.metadataComponentMethods={videoMetadata:function(b){this.setInfo(b);this.toComponent("videoMetadata",b)}};NewSiteApplication.prototype.relatedVideosComponentMethods={relatedVideos:function(b){this.setInfo(b);this.toComponent("relatedVideos",b)}};YUI.add("player-hulu",function(b){var c="contentNode";function a(d){a.superclass.constructor.apply(this,arguments)}a.NAME="playerHulu";a.ATTRS={contentNode:{setter:b.one},pid:{value:""},proxy:{value:""}};b.extend(a,b.Base,{initializer:function(){this.playerNode=b.Node.create('
    ');this.get(c).setContent(this.playerNode);b.Global.on("huluplayer:ready",b.bind(this._play,this));delete NewSite;NewSite=new NewSiteApplication;this.embedPlayer=NewSite;this.embedPlayer.run(this.get("proxy"))},_play:function(){this._resizePlayer();this.embedPlayer.videoPlayerComponent.playVideo(this.get("pid"))},_resizePlayer:function(){this._computeSize();var d=this.embedPlayer.videoPlayerComponent.instance;d.width=this.width;d.height=this.height},_computeSize:function(){var d=this.get(c),e=d.get("region");this.height=e.height;this.width=e.width},handleResize:function(d){this._resizePlayer()},destructor:function(){if(this.embedPlayer&&this.embedPlayer.videoPlayerComponent){this.embedPlayer.videoPlayerComponent.stopVideo()}delete NewSite}});b.namespace("Search.Shortcut").PlayerHulu=a},"1.0.0",{requires:["event","base","node","event-custom"]});YUI.add("shortcut-images-dd-violet",function(b){function a(c){a.superclass.constructor.apply(this,arguments)}a.NAME="ImageDD";a.ATTRS={cntr:{value:".sc.images_dd",writeOnce:true,setter:b.one},listNode:{value:".sc.images_dd .content",writeOnce:true,setter:b.one},listItems:{value:".sc.images_dd .content li",writeOnce:true,setter:b.all},imgWrapCls:{value:".ithm",writeOnce:true,},data:{writeOnce:true,value:[]},margins:{writeOnce:true},explicit:{value:false,writeOnce:true},minThmWidth:{value:73,writeOnce:true}};b.extend(a,b.Base,{initializer:function(c){var e=this.get("listItems").item(0),d=e.getStyle("margin");if(d==""){d=e.getStyle("marginTop")+" "+e.getStyle("marginRight")+" "+e.getStyle("marginBottom")+" "+e.getStyle("marginLeft")}this.set("margins",b.Array.map(d.replace(/px/g,"").split(" "),Number));this.sheet=new b.StyleSheet();this._bindUI();this._syncUI()},_repaint:function(){this.get("listNode").setStyle("visibility","hidden");var q=this.get("cntr"),o=this.get("listItems"),l=this.get("listNode"),w=b.clone(this.get("data")),k=this.get("explicit"),f=this.get("imgWrapCls"),v=q.get("region").width-parseInt(l.getStyle("paddingRight"))-parseInt(l.getStyle("paddingLeft"))-parseInt(q.getStyle("paddingRight"))-parseInt(q.getStyle("paddingLeft")),c=this.get("margins"),j=Math.floor(v/(this.get("minThmWidth")+c[1]+c[3])),m=Math.ceil(((v%(this.get("minThmWidth")+c[1]+c[3]))/j+this.get("minThmWidth"))*100)/100,h=Math.max(1,Math.floor(w.length/j)),g=[m,m],t=0,e=[],r=0,p=0,n=l.one(f+" img").hasAttribute("data-src")?"data-src":"src",u="",d=l.one(f).get("tagName");if(!k&&h>2){h=2}t=h*j;this.sheet.unset(d+f,["width","height"]);this.sheet.set(d+f,{width:m+"px",height:m+"px"});for(var s in w){e=this._rescaleImage(g,[w[s]["width"],w[s]["height"]],parseInt(w[s]["crop"]),true);r=e[0][0];p=e[0][1];u=this._getMargins(g,[r,p,e[1]]);o.item(s).one(f+" img").setAttrs({width:r,height:p,style:u}).setAttribute(n,w[s]["turl"]+"&w="+r+"&h="+p);o.item(s)[(s>=t)?"hide":"show"]()}l.setStyle("visibility","visible")},_rescaleImage:function(i,c,g,f){var e=1;var h=[];var d=c;var j=g||0;if(f){if((d[0]>=d[1])&&(d[1]>=i[1])){h=[1,0]}else{if(d[1]>=d[0]&&d[0]>=i[0]){h=[0,1]}}if(h.length){e=(i[h[0]]/c[h[0]]);d[h[0]]=i[h[0]];d[h[1]]=c[h[1]]*e}}else{if(d[0]>i[0]&&d[1]>i[1]){if(d[0]>d[1]){h=[0,1]}else{h=[1,0]}}else{if(d[1]>i[1]){h=[1,0]}else{if(d[0]>i[0]){h=[0,1]}}}if(h.length){e=(i[h[0]]/c[h[0]]);d[h[0]]=i[h[0]];d[h[1]]=c[h[1]]*e;h=[]}if(d[1]>i[1]){h=[1,0]}else{if(d[0]>i[0]){h=[0,1]}}if(h.length){e=(i[h[0]]/c[h[0]]);d[h[0]]=i[h[0]];d[h[1]]=c[h[1]]*e;h=[]}}return[[Math.ceil(d[0]),Math.ceil(d[1])],j]},_getMargins:function(d,c){margins="";index=c[0]d[0])){if((c[0]-c[2])>d[0]){margins+="margin-left:-"+c[2]+"px"}else{margins+="margin-left:"+(d[0]-c[0])+"px;"}}else{if(c[1]>d[1]){if((c[1]-c[2])>d[1]){margins+="margin-top:-"+c[2]+"px"}else{margins+="margin-top:"+(d[1]-c[1])+"px;"}}}return margins},_bindUI:function(){this._events=[];this._events.push(b.on("windowresize",b.bind(this._syncUI,this)))},_syncUI:function(){this._repaint()}});b.namespace("Search.Shortcut").ImageDD=a},"1.0.0",{requires:["node","stylesheet","event"]});YUI.add("mi5-image-overlay-violet",function(b){function a(c){a.superclass.constructor.apply(this,arguments)}a.NAME="imageOverlay";b.extend(a,b.Mobile.MultimediaOverlay,{initializer:function(c){this._setupDataSchema()},_bindUI:function(){a.superclass._bindUI.apply(this,arguments);this.on("repainted",this._lazyLoadImage)},_setCustomStyles:function(){this.overlay.get("boundingBox").addClass("imgbox")},_setupDataSchema:function(){var c={schema:{metaFields:{first:"meta.first",last:"meta.last",count:"meta.count",total:"meta.total"},resultListLocator:"results"}};this.io.setupJSONSchema(c)},_getItem:function(c,e){var d=b.Node.create('
  • ');this._setItem(c,d);return d},_lazyLoadImage:function(){if(!b.UA.ipad){return}var d=this._cb.one(".current"),c=this._data(this.current);this._imgLazyTimer&&this._imgLazyTimer.cancel();this._imgLazyTimer=b.later(250,this,function(i){var e=i.result,h=i.node,f=h.one("img");if(!b.Lang.isValue(e.loaded)&&!b.Lang.isValue(e.error)){var g=b.one(new Image());g.on("load",function(k,j){f.set("src",j.iurl);j.loaded=true},this,e);g.on("error",function(k,j){j.error=true},this,e);g.set("src",e.iurl)}else{f.set("src",e.iurl)}},{result:c,node:d})},_setItem:function(c,e){var f=this._rescaleImage([width,height],[c.imgW,c.imgH],0,false);var d=e.one("img");d.setStyle("width",f[0][0]);d.setStyle("height",f[0][1])},_setInfo:function(c){var f=c.tit?c.tit:"";var d=c.imgW+" x "+c.imgH;var e=b.Node.create(''+f+''+c.rhost+"");this.infoatt.setContent(e)},_bindCustom:function(){this._cb.on("click",function(c){b.one("body").toggleClass("touchable")})},_rescaleImage:function(d,f,j,h){var l=1;var g=[];var k=f;var c=j||0;if(h){if((k[0]>=k[1])&&(k[1]>=d[1])){g=[1,0]}else{if(k[1]>=k[0]&&k[0]>=d[0]){g=[0,1]}}if(g.length){l=(d[g[0]]/f[g[0]]);k[g[0]]=d[g[0]];k[g[1]]=f[g[1]]*l;if(b.Lang.isArray(c)){for(var e=0;e<2;e++){c[e]=Math.ceil(c[e]*l)}}else{c=Math.ceil(c*l)}}}else{if(k[0]>d[0]&&k[1]>d[1]){if(k[0]>k[1]){g=[0,1]}else{g=[1,0]}}else{if(k[1]>d[1]){g=[1,0]}else{if(k[0]>d[0]){g=[0,1]}}}if(g.length){l=(d[g[0]]/f[g[0]]);k[g[0]]=d[g[0]];k[g[1]]=f[g[1]]*l;g=[]}if(k[1]>d[1]){g=[1,0]}else{if(k[0]>d[0]){g=[0,1]}}if(g.length){l=(d[g[0]]/f[g[0]]);k[g[0]]=d[g[0]];k[g[1]]=f[g[1]]*l;g=[]}}return[[Math.ceil(k[0]),Math.ceil(k[1])],c]}});b.namespace("Mobile").ImageOverlay=a},"1.0.0",{requires:["base","node","mi5-multimedia-overlay-violet"]});