/*
#Wed Nov 18 08:11:29 PST 2009
build.num.last=41760
*/
if(!window.console){var console={isVisible:false,init:function(){console.s=""},draw:function(){if(!console.d){console.d=document.createElement("div");console.d.setAttribute("id","jsconsole");console.d.setAttribute("style","display:none");document.body.appendChild(console.d);console.hide()}},hide:function(){this.isVisible=false;console.d.style.display="none"},show:function(){this.isVisible=true;console.d.style.display="block";console.d.innerHTML='<a href="javascript:console.hide()">close</a> <a href="javascript:console.clear()">clear</a><br />'+console.s
},log:function(a){console.s+="<br />"+a;if(this.isVisible){console.d.innerHTML='<a href="javascript:console.hide()">close</a> <a href="javascript:console.clear()">clear</a><br />'+console.s}},clear:function(){console.d.parentNode.removeChild(console.d);console.init();console.draw();console.show()},addLoadEvent:function(a){var b=window.onload;if(typeof window.onload!="function"){window.onload=a}else{window.onload=function(){if(b){b()}a()}}}};if(logjs){console.addLoadEvent(console.draw);console.init()
}}var $logjs={event:{name:[],time:[],delta:[]},log:function(c,a,b){this.event.name.push(c);this.event.time.push(a);this.event.delta.push(b);this.filter(c,a)},filter:function(c,a){if(c=="[ dom:loaded ]"){var b=new Element("li",{id:"dom_load"}).update(a);$("DBUG").appendChild(b)}if(c=="[ window.load ]"){var b=new Element("li",{id:"window_load"}).update(a);$("DBUG").appendChild(b)}}};var aJsLogTimes=new Array();function logJsProgress(c){if(logjs){aJsLogTimes.push(new Date().getTime());var b=(aJsLogTimes[aJsLogTimes.length-1]-aJsLogTimes[aJsLogTimes.length-2])/1000;
var a=(aJsLogTimes[aJsLogTimes.length-1]-aJsLogTimes[0])/1000;while(b.toString().length<5){b=b.toString()+0}while(a.toString().length<5){a=a.toString()+0}console.log(b+" : "+a+" : "+c);$logjs.log(c,a,b)}}logJsProgress("[ init ]");var MIN_FLASH_VER="9.0.115";var EXPRESS_INSTALL_SWF="/resources/flash/swfobject/expressInstall.swf";function swfobjCallback(a){if(!a.success&&$(a.id)){$(a.id).style.visibility="visible";$(a.id).innerHTML='<div class="noflash"><b></b><p>You do not have the latest Adobe Flash Player installed for your browser.</p><a href="http://get.adobe.com/flashplayer/" target="_blank" title="Get Adobe Flash Player">Click to Download</a></div>'
}}
/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var aq="undefined",aD="object",ab="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",aE="application/x-shockwave-flash",ac="SWFObjectExprInst",ax="onreadystatechange",af=window,aL=document,aB=navigator,aa=false,Z=[aN],aG=[],ag=[],al=[],aJ,ad,ap,at,ak=false,aU=false,aH,an,aI=true,ah=function(){var a=typeof aL.getElementById!=aq&&typeof aL.getElementsByTagName!=aq&&typeof aL.createElement!=aq,f=aB.userAgent.toLowerCase(),c=aB.platform.toLowerCase(),j=c?/win/.test(c):/win/.test(f),l=c?/mac/.test(c):/mac/.test(f),h=/webkit/.test(f)?parseFloat(f.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,d=!+"\v1",g=[0,0,0],m=null;
if(typeof aB.plugins!=aq&&typeof aB.plugins[ab]==aD){m=aB.plugins[ab].description;if(m&&!(typeof aB.mimeTypes!=aq&&aB.mimeTypes[aE]&&!aB.mimeTypes[aE].enabledPlugin)){aa=true;d=false;m=m.replace(/^.*\s+(\S+\s+\S+$)/,"$1");g[0]=parseInt(m.replace(/^(.*)\..*$/,"$1"),10);g[1]=parseInt(m.replace(/^.*\.(.*)\s.*$/,"$1"),10);g[2]=/[a-zA-Z]/.test(m)?parseInt(m.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof af.ActiveXObject!=aq){try{var k=new ActiveXObject(X);if(k){m=k.GetVariable("$version");if(m){d=true;
m=m.split(" ")[1].split(",");g=[parseInt(m[0],10),parseInt(m[1],10),parseInt(m[2],10)]}}}catch(b){}}}return{w3:a,pv:g,wk:h,ie:d,win:j,mac:l}}(),aK=function(){if(!ah.w3){return}if((typeof aL.readyState!=aq&&aL.readyState=="complete")||(typeof aL.readyState==aq&&(aL.getElementsByTagName("body")[0]||aL.body))){aP()}if(!ak){if(typeof aL.addEventListener!=aq){aL.addEventListener("DOMContentLoaded",aP,false)}if(ah.ie&&ah.win){aL.attachEvent(ax,function(){if(aL.readyState=="complete"){aL.detachEvent(ax,arguments.callee);
aP()}});if(af==top){(function(){if(ak){return}try{aL.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}aP()})()}}if(ah.wk){(function(){if(ak){return}if(!/loaded|complete/.test(aL.readyState)){setTimeout(arguments.callee,0);return}aP()})()}aC(aP)}}();function aP(){if(ak){return}try{var b=aL.getElementsByTagName("body")[0].appendChild(ar("span"));b.parentNode.removeChild(b)}catch(a){return}ak=true;var d=Z.length;for(var c=0;c<d;c++){Z[c]()}}function aj(a){if(ak){a()}else{Z[Z.length]=a
}}function aC(a){if(typeof af.addEventListener!=aq){af.addEventListener("load",a,false)}else{if(typeof aL.addEventListener!=aq){aL.addEventListener("load",a,false)}else{if(typeof af.attachEvent!=aq){aM(af,"onload",a)}else{if(typeof af.onload=="function"){var b=af.onload;af.onload=function(){b();a()}}else{af.onload=a}}}}}function aN(){if(aa){Y()}else{am()}}function Y(){var d=aL.getElementsByTagName("body")[0];var b=ar(aD);b.setAttribute("type",aE);var a=d.appendChild(b);if(a){var c=0;(function(){if(typeof a.GetVariable!=aq){try{var f=a.GetVariable("$version")
}catch(g){}if(f){f=f.split(" ")[1].split(",");ah.pv=[parseInt(f[0],10),parseInt(f[1],10),parseInt(f[2],10)]}}else{if(c<10){c++;setTimeout(arguments.callee,10);return}}d.removeChild(b);a=null;am()})()}else{am()}}function am(){var h=aG.length;if(h>0){for(var j=0;j<h;j++){var c=aG[j].id;var n=aG[j].callbackFn;var a={success:false,id:c};if(ah.pv[0]>0){var k=aS(c);if(k){if(ao(aG[j].swfVersion)&&!(ah.wk&&ah.wk<312)){ay(c,true);if(n){a.success=true;a.ref=av(c);n(a)}}else{if(aG[j].expressInstall&&au()){var f={};
f.data=aG[j].expressInstall;f.width=k.getAttribute("width")||"0";f.height=k.getAttribute("height")||"0";if(k.getAttribute("class")){f.styleclass=k.getAttribute("class")}if(k.getAttribute("align")){f.align=k.getAttribute("align")}var g={};var d=k.getElementsByTagName("param");var m=d.length;for(var l=0;l<m;l++){if(d[l].getAttribute("name").toLowerCase()!="movie"){g[d[l].getAttribute("name")]=d[l].getAttribute("value")}}ae(f,g,c,n)}else{aF(k);if(n){n(a)}}}}}else{ay(c,true);if(n){var b=av(c);if(b&&typeof b.SetVariable!=aq){a.success=true;
a.ref=b}n(a)}}}}}function av(b){var d=null;var c=aS(b);if(c&&c.nodeName=="OBJECT"){if(typeof c.SetVariable!=aq){d=c}else{var a=c.getElementsByTagName(aD)[0];if(a){d=a}}}return d}function au(){return !aU&&ao("6.0.65")&&(ah.win||ah.mac)&&!(ah.wk&&ah.wk<312)}function ae(g,d,j,f){aU=true;ap=f||null;at={success:false,id:j};var a=aS(j);if(a){if(a.nodeName=="OBJECT"){aJ=aO(a);ad=null}else{aJ=a;ad=j}g.id=ac;if(typeof g.width==aq||(!/%$/.test(g.width)&&parseInt(g.width,10)<310)){g.width="310"}if(typeof g.height==aq||(!/%$/.test(g.height)&&parseInt(g.height,10)<137)){g.height="137"
}aL.title=aL.title.slice(0,47)+" - Flash Player Installation";var b=ah.ie&&ah.win?"ActiveX":"PlugIn",c="MMredirectURL="+af.location.toString().replace(/&/g,"%26")+"&MMplayerType="+b+"&MMdoctitle="+aL.title;if(typeof d.flashvars!=aq){d.flashvars+="&"+c}else{d.flashvars=c}if(ah.ie&&ah.win&&a.readyState!=4){var h=ar("div");j+="SWFObjectNew";h.setAttribute("id",j);a.parentNode.insertBefore(h,a);a.style.display="none";(function(){if(a.readyState==4){a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)
}})()}aA(g,d,j)}}function aF(a){if(ah.ie&&ah.win&&a.readyState!=4){var b=ar("div");a.parentNode.insertBefore(b,a);b.parentNode.replaceChild(aO(a),b);a.style.display="none";(function(){if(a.readyState==4){a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)}})()}else{a.parentNode.replaceChild(aO(a),a)}}function aO(b){var d=ar("div");if(ah.win&&ah.ie){d.innerHTML=b.innerHTML}else{var f=b.getElementsByTagName(aD)[0];if(f){var a=f.childNodes;if(a){var g=a.length;for(var c=0;c<g;c++){if(!(a[c].nodeType==1&&a[c].nodeName=="PARAM")&&!(a[c].nodeType==8)){d.appendChild(a[c].cloneNode(true))
}}}}}return d}function aA(f,h,c){var d,a=aS(c);if(ah.wk&&ah.wk<312){return d}if(a){if(typeof f.id==aq){f.id=c}if(ah.ie&&ah.win){var g="";for(var k in f){if(f[k]!=Object.prototype[k]){if(k.toLowerCase()=="data"){h.movie=f[k]}else{if(k.toLowerCase()=="styleclass"){g+=' class="'+f[k]+'"'}else{if(k.toLowerCase()!="classid"){g+=" "+k+'="'+f[k]+'"'}}}}}var j="";for(var l in h){if(h[l]!=Object.prototype[l]){j+='<param name="'+l+'" value="'+h[l]+'" />'}}a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+g+">"+j+"</object>";
ag[ag.length]=f.id;d=aS(f.id)}else{var b=ar(aD);b.setAttribute("type",aE);for(var m in f){if(f[m]!=Object.prototype[m]){if(m.toLowerCase()=="styleclass"){b.setAttribute("class",f[m])}else{if(m.toLowerCase()!="classid"){b.setAttribute(m,f[m])}}}}for(var n in h){if(h[n]!=Object.prototype[n]&&n.toLowerCase()!="movie"){aQ(b,n,h[n])}}a.parentNode.replaceChild(b,a);d=b}}return d}function aQ(b,d,c){var a=ar("param");a.setAttribute("name",d);a.setAttribute("value",c);b.appendChild(a)}function aw(a){var b=aS(a);
if(b&&b.nodeName=="OBJECT"){if(ah.ie&&ah.win){b.style.display="none";(function(){if(b.readyState==4){aT(a)}else{setTimeout(arguments.callee,10)}})()}else{b.parentNode.removeChild(b)}}}function aT(a){var b=aS(a);if(b){for(var c in b){if(typeof b[c]=="function"){b[c]=null}}b.parentNode.removeChild(b)}}function aS(a){var c=null;try{c=aL.getElementById(a)}catch(b){}return c}function ar(a){return aL.createElement(a)}function aM(a,c,b){a.attachEvent(c,b);al[al.length]=[a,c,b]}function ao(a){var b=ah.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 az(b,g,a,c){if(ah.ie&&ah.mac){return}var f=aL.getElementsByTagName("head")[0];if(!f){return}var h=(a&&typeof a=="string")?a:"screen";if(c){aH=null;an=null}if(!aH||an!=h){var d=ar("style");d.setAttribute("type","text/css");d.setAttribute("media",h);aH=f.appendChild(d);if(ah.ie&&ah.win&&typeof aL.styleSheets!=aq&&aL.styleSheets.length>0){aH=aL.styleSheets[aL.styleSheets.length-1]
}an=h}if(ah.ie&&ah.win){if(aH&&typeof aH.addRule==aD){aH.addRule(b,g)}}else{if(aH&&typeof aL.createTextNode!=aq){aH.appendChild(aL.createTextNode(b+" {"+g+"}"))}}}function ay(a,c){if(!aI){return}var b=c?"visible":"hidden";if(ak&&aS(a)){aS(a).style.visibility=b}else{az("#"+a,"visibility:"+b)}}function ai(b){var a=/[\\\"<>\.;]/;var c=a.exec(b)!=null;return c&&typeof encodeURIComponent!=aq?encodeURIComponent(b):b}var aR=function(){if(ah.ie&&ah.win){window.attachEvent("onunload",function(){var a=al.length;
for(var b=0;b<a;b++){al[b][0].detachEvent(al[b][1],al[b][2])}var d=ag.length;for(var c=0;c<d;c++){aw(ag[c])}for(var f in ah){ah[f]=null}ah=null;for(var g in swfobject){swfobject[g]=null}swfobject=null})}}();return{registerObject:function(a,f,c,b){if(ah.w3&&a&&f){var d={};d.id=a;d.swfVersion=f;d.expressInstall=c;d.callbackFn=b;aG[aG.length]=d;ay(a,false)}else{if(b){b({success:false,id:a})}}},getObjectById:function(a){if(ah.w3){return av(a)}},embedSWF:function(m,f,j,g,c,a,b,k,h,l){var d={success:false,id:f};
if(ah.w3&&!(ah.wk&&ah.wk<312)&&m&&f&&j&&g&&c){ay(f,false);aj(function(){j+="";g+="";var s={};if(h&&typeof h===aD){for(var q in h){s[q]=h[q]}}s.data=m;s.width=j;s.height=g;var p={};if(k&&typeof k===aD){for(var r in k){p[r]=k[r]}}if(b&&typeof b===aD){for(var n in b){if(typeof p.flashvars!=aq){p.flashvars+="&"+n+"="+b[n]}else{p.flashvars=n+"="+b[n]}}}if(ao(c)){var o=aA(s,p,f);if(s.id==f){ay(f,true)}d.success=true;d.ref=o}else{if(a&&au()){s.data=a;ae(s,p,f,l);return}else{ay(f,true)}}if(l){l(d)}})}else{if(l){l(d)
}}},switchOffAutoHideShow:function(){aI=false},ua:ah,getFlashPlayerVersion:function(){return{major:ah.pv[0],minor:ah.pv[1],release:ah.pv[2]}},hasFlashPlayerVersion:ao,createSWF:function(a,b,c){if(ah.w3){return aA(a,b,c)}else{return undefined}},showExpressInstall:function(b,a,d,c){if(ah.w3&&au()){ae(b,a,d,c)}},removeSWF:function(a){if(ah.w3){aw(a)}},createCSS:function(b,a,c,d){if(ah.w3){az(b,a,c,d)}},addDomLoadEvent:aj,addLoadEvent:aC,getQueryParamValue:function(b){var a=aL.location.search||aL.location.hash;
if(a){if(/\?/.test(a)){a=a.split("?")[1]}if(b==null){return ai(a)}var c=a.split("&");for(var d=0;d<c.length;d++){if(c[d].substring(0,c[d].indexOf("="))==b){return ai(c[d].substring((c[d].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(aU){var a=aS(ac);if(a&&aJ){a.parentNode.replaceChild(aJ,a);if(ad){ay(ad,true);if(ah.ie&&ah.win){aJ.style.display="block"}}if(ap){ap(at)}}aU=false}}}}();Prototype.Browser.Chrome=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;Prototype.Browser.IE6=Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==6;
Prototype.Browser.IE7=Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==7;function $extend(a){for(i=1;i<arguments.length;i++){Object.extend(a,arguments[i])}return a}function $clone(c){var a={};for(var b in c){var d=c[b];switch(typeof d){case"object":a[b]=!d?d:d.clone?d.clone():$clone(d);break;default:a[b]=d;break}}return a}function $defined(a){return(a!=undefined)}function $splat(a){return Object.isArray(a)?a:[a]}function $random(b,a){return Math.floor(Math.random()*(a-b+1)+b)
}function $chk(a){return a?true:a==0}var $log=logJsProgress;$extend(Hash.prototype,{insist:function(b,c){var a;if((a=this.get(b))){return a}return this.set(b,new c())},parseSubKeys:function(b,a){var c=this;c.each(function(f){var d=f[1];if(b&&Object.isFunction(d)){d=d.bind(b);c[f[0]]=d}f[0].split(",").each(function(g){a(g.strip(),d)})})}});$extend(Array.prototype,{forEach:function(d,c){for(var b=0,a=this.length;b<a;b++){if(!!d.call(c,this[b],b)){break}}return this},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null
},erase:function(b){for(var a=this.length;a--;a){if(this[a]===b){this.splice(a,1)}}return this},punch:function(a){var b=this.indexOf(a);return b==-1?this.push(a)-1:b},insist:function(b,c){var a;if(!(a=this[b])){a=new c();this[b]=a}return a},insert:function(b,a){this.splice(b,0,a)},contains:Array.prototype.contains||Array.prototype.member,every:Array.prototype.every||Array.prototype.all,filter:Array.prototype.filter||Array.prototype.findAll,some:Array.prototype.some||Array.prototype.any});$extend(String.prototype,{contains:function(){for(var a=0;
a<arguments.length;a++){if(this.include(arguments[a])){return true}}return false},evalScripts:function(){return this.extractScripts().map(function(script){try{return eval(script)}catch(ex){if(Dtv){Dtv.debug(ex,"Error within evalScripts(): script = "+script)}throw e}})}});$extend(Class,{supers:function(b){var a=[b];var c=b.superclass;if(c){do{a.push(c)}while(c=c.superclass)}return a}});$extend(Event,{observeEvents:function(c,b,a){$(c);$H(b).parseSubKeys(a,function(d,f){Event.observe(c,d,f)})},stopObservingEvents:function(b,a){$(b);
$H(a).parseSubKeys(null,function(c,d){Event.stopObserving(b,c,d)})},mouseWheelDelta:function(a){return(a.wheelDelta<0||a.detail>0)?1:(a.wheelDelta>0||a.detail<0)?-1:0}});(function(){function b(d){var g;if(d.className=="string"){g=d.innerHTML}else{try{g=("{v:"+(d.innerHTML||"null")+"}").evalJSON().v}catch(f){Dtv.debug(f,"Error raised trying to parse var value.")}}if(g&&Object.isString(g)){g=g.unescapeHTML()}return g}Element.addMethods({getVars:function(d){var f={};$el.childElementsByTagName(d,"var").each(function(g){f[g.title]=b(g)
});return f},getVar:function(g,f){var d=g.down("var[title='"+f+"']");return d?b(d):null},setVar:function(g,f,h){var d=g.down("var[title='"+f+"']");if(d){d.innerHTML=h;return true}return false},observeEvents:function(g,f,d){Event.observeEvents(g,f,d);return g},stopObservingEvents:function(f,d){Event.stopObservingEvents(f,d);return f},getSiblingIndex:function(d){return $(d).up(0).childElements().indexOf(d)},disable:function(d){if(!d.className){d.className="disabled"}else{$(d).classNames().each(function(f){switch(f){case"btn-sm-act":case"btn-sm-actaltdk":case"btn-sm-actalt":d.addClassName("btn-sm-inact");
break;case"btn-mid-act":case"btn-mid-actalt":case"btn-mid-actaltdk":d.addClassName("btn-mid-inact");break;case"btn-sm-em":case"btn-sm-std":case"btn-sm-stdact":d.addClassName("btn-sm-deact");break;case"btn-mid-em":case"btn-mid-std":case"btn-mid-stdact":d.addClassName("btn-mid-deact");break;default:d.addClassName("disabled");break}})}d.disabled=true},enable:function(d){$(d).classNames().each(function(f){switch(f){case"btn-sm-inact":case"btn-mid-inact":case"btn-sm-deact":case"btn-mid-deact":case"disabled":d.removeClassName(f);
break;case"btn-sm-std":d.removeClassName("cep-btn-gray");break}});d.disabled=false},disableSelection:function(d){d.unselectable="on";$(d).setStyle({MozUserSelect:"none"})},getStyleAsInt:function(f,d){var g=$(f).getStyle(d);if(!g){return 0}return parseInt(g.replace("px","").replace("em","").replace("pt",""))},getStylesAsInt:function(f){var d=$A(arguments);var g=0;for(i=1;i<d.length;i++){g+=Element.getStyleAsInt(f,d[i])}return g},getOuterWidth:function(d){return $(d).getWidth()+d.getStylesAsInt("marginLeft","marginRight")
},getOuterHeight:function(d){return $(d).getHeight()+d.getStylesAsInt("marginTop","marginBottom")},getOuterDimensions:function(d){return{width:this.getOuterWidth(d),height:this.getOuterHeight(d)}},getInnerWidth:function(d){return $(d).getWidth()-d.getStylesAsInt("paddingLeft","paddingRight")},getInnerHeight:function(d){return $(d).getHeight()-d.getStylesAsInt("paddingTop","paddingBottom")},getInnerDimensions:function(d){return{width:this.getInnerWidth(d),height:this.getInnerHeight(d)}},childElementsByTagName:function(g,d){var f=d.toLowerCase().split(",");
return $(g).childElements().select(function(h){return f.contains(h.tagName.toLowerCase())})},childElementAt:function(g,d){var f=$(g).childElements();if(f.length>d){return f[d]}return null},selectChildElements:function(f,g){var d=[];$(f).childElements().each(function(h){if(h.match(g)){d.push(h)}});return d},append:Element.Methods.insert,appendTo:function(f,d){$(d).append(f);return f},before:function(d,f){f.insert({before:d});return d},after:function(d,f){f.insert({after:d});return d},toHtml:function(f){var d=new Element("div");
d.append(f.clone(true));return d.innerHTML},first:function(h,g,d){var f=$(h).down(g);if(f){return d?f[d]:f}return null},addCssEvents:function(f,g,d){f=$(f);$H(g).parseSubKeys(null,function(h,j){Event.observe(f,h,function(k){if(d&&(f.disabled||f.hasClassName("disabled"))){return}if(!Object.isString(j)){f.setStyle(j);return}j.split("|").each(function(m,l){m=m.strip();switch(m.charAt(0)){case"{":f.setStyle(m.evalJSON());break;case"~":f.morph({style:m.substring(1)});case"!":f.removeClassName(m.substring(1));
break;default:f.addClassName(m);break}})})});return f},behavior:function(g,h,f,j){g=$(g);var d=Dtv.behaviors.getBehaviorName(h);Dtv.behaviors.applyBehavior(g,d,null,f,j);return g.behaviors[d]},getBehavior:function(h,j,k){h=$(h);if(h.behaviors){if(!j){return h.behaviors.first()}else{if(Object.isNumber(j)){return h.behaviors[j]}}var f=Dtv.behaviors.getBehaviorName(j);var d=h.behaviors[f];if(!!d||!k){return d}else{if(Dtv.behaviors.isCompiled(f)){var g=Dtv.behaviors.getBehaviorType(j);h.behaviors.forEach(function(l){if(Class.supers(Dtv.behaviors[l.behaviorName]).contains(g)){d=l;
return true}});return d}}}return null},hasBehavior:function(d,f,g){if(!f||Object.isNumber(f)){return null}return !!Element.getBehavior(d,f,g)},parentBehavior:function(f,g,h){var d=f.up(),j=null;while(!(j=Element.getBehavior(d,g,h))&&d.tagName.toLowerCase()!="body"){d=d.up()}return j},findBehavior:function(d,f,g){d=$(d);return Element.getBehavior(d,f,g)||Element.parentBehavior(d,f,g)}});var c;window.$el=function(d){if(typeof d=="string"){if(d.charAt(0)!="<"){return new Element(d)}if(!c){c=new Element("div")
}c.innerHTML=d;return c.down(0)}return $(d)};$extend($el,Element.Methods);var a;$extend(window.location,{getParams:function(){if(!a){a=window.location.search.toQueryParams()}return a},getParam:function(d){return window.location.getParams()[d]},getPathRoot:function(){return window.location.protocol+"//"+window.location.host+"/"}})})();(function(){var c=$profile("DTV namespace","Initialization of DTV namespace");var a="initializing";var d;window.Dtv={STATUS_CODE:{completed:"completed",initializing:"initializing"},data:new Hash(),debugEnabled:false,debug:$log,debugInfo:{},getConsole:function(){if(!d){d=window.console;
if(!d||!d.debug){d=window.firebug?window.firebug.d.console.cmd:null}}return d},getStatus:function(){return a}};function f(g,h){$log("running stack: "+g);Dtv.stack(g).pull(true,h);$log("finished running stack: "+g)}$extend(Dtv,(function(){var h=$H();var j=Class.create({initialize:function(){this.items=[]},push:function(k){if(!k||!Object.isFunction(k)){throw new Error("Invalid argument")}this.items.push(k)},pull:function(l,n){if(l){while(this.pull(false,n)){}return false}if(this.items.length>0){var m=this.items.shift(),k=this.pull.bind(this);
n?m.defer(k):m(k);return this.items.length>0}return false}});Dtv.debugInfo.stacks=h;function g(k,l){a==Dtv.STATUS_CODE.completed?l.defer():Dtv.stack(k).push(l)}return{stack:function(k){return h.insist(k,j)},defer:g.curry("defer"),expedite:g.curry("expedite"),ready:g.curry("ready"),load:g.curry("load")}})());$extend(Dtv,(function(){function g(){var j=0;if(window.innerHeight&&window.scrollMaxY){j=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){j=document.body.scrollHeight
}else{j=document.body.offsetHeight}}return j}return{tealeaf:{invoke:function(h){try{TeaLeaf.Client[h].call(window,$A(arguments).slice(1))}catch(j){Dtv.debug(j,"Failed to call Tealeaf method: "+h)}}},UI:{dimmerDuration:0,disableScreen:function(h){if(this._screenDisabled){return}if(Prototype.Browser.IE6){this.iframeShim=new Element("iframe",{src:'javascript:"";',frameBorder:0}).setStyle({left:0,top:0,position:"absolute",zIndex:1000,width:"100%",opacity:0}).setOpacity(0);this.iframeShim.style.height=g()+"px";
this.iframeShim.appendTo(document.body)}if(this.iframeShim){this.iframeShim.show()}if(!this._dimmerEl){this._dimmerEl=$el("<div id='lb-dimmer'></div>").appendTo(document.body);this._dimmerEl.setStyle({backgroundColor:"#000",left:0,top:0,position:"absolute",zIndex:1000,width:"100%",opacity:0})}if(this._dimmerFx){this._dimmerFx.cancel()}this._dimmerEl.style.height=g()+"px";this._dimmerFx=new Effect.Appear(this._dimmerEl,{from:0,to:0.8,duration:h||this.dimmerDuration});this._screenDisabled=true;$(document.body).fire("DTV:disablescreen")
},enableScreen:function(h){if(this.iframeShim){this.iframeShim.hide()}if(this._dimmerEl){if(this._dimmerFx){this._dimmerFx.cancel()}this._dimmerFx=new Effect.Fade(this._dimmerEl,{duration:h||this.dimmerDuration})}this._screenDisabled=false},showThinking:function(n,k){if(!this._thinkingEl){this._thinkingEl=$el('<div class="ajax-thinking"><img alt="Thinking" src="/images/global/ajax/loading_large.gif"/><h4></h4></div>').appendTo(document.body).hide()}var h=this._thinkingEl.down("h4");if(n&&n!=""){h.update(n).show()
}else{h.hide()}var m=document.viewport.getDimensions();var l=document.viewport.getScrollOffsets();var j=$el.getOuterDimensions(this._thinkingEl);this._thinkingEl.setStyle({left:((m.width-j.width)/2)+"px",top:(((m.height-j.height)/2)+l.top)+"px",opacity:0});this._thinkingEl._fx=new Effect.Appear(this._thinkingEl,{duration:0.2,delay:k||0,to:0.8})},hideThinking:function(){if(this._thinkingEl._fx){this._thinkingEl._fx.cancel()}this._thinkingEl.hide()},waitButton:function(h){h=$(h);h.disable();h.addClassName("btn-spinner");
h.classNames().each(function(j){switch(j){case"btn-sm-act":case"btn-sm-actaltdk":case"btn-sm-actalt":case"btn-sm-em":case"btn-sm-std":case"btn-sm-stdact":h.addClassName("btn-sm-ajax");break;case"btn-mid-act":case"btn-mid-actalt":case"btn-mid-actaltdk":case"btn-mid-em":case"btn-mid-std":case"btn-mid-stdact":h.addClassName("btn-mid-ajax");break}});if(!Dtv.UI._waitingButtons){Dtv.UI._waitingButtons=[]}Dtv.UI._waitingButtons.punch(h)},unwaitButton:function(h){h=$(h);h.enable();h.removeClassName("btn-spinner");
h.removeClassName("btn-sm-ajax").removeClassName("btn-mid-ajax");if(Dtv.UI._waitingButtons){Dtv.UI._waitingButtons.erase(h)}},unwaitButtons:function(h){(h||this._waitingButtons||[]).each(this.unwaitButton)}}}})());function b(m){var k=$profile("applying event selectors: ",m);var h=[];var g="";$log("applyEventSelectors start");for(var j=0;j<document.styleSheets.length;j++){var o=document.styleSheets[j].rules?document.styleSheets[j].rules:document.styleSheets[j].cssRules;for(var l=0;l<o.length;l++){var n=o[l].selectorText;
if(n){n.split(",").each(function(s){s=s.strip();var q=s.indexOf("."+m);if(q>0){var p=s.substring(0,q);var r=p.charAt(p.length-1);if(p.length>0&&(r==":"||r==".")){p=p.substring(0,p.length-1)}if(!h.contains(p)){if(g.length>0){g+=","}g+=p;h.push(p)}}})}}}if(g.length>0){$log("applyEventSelectors add handlers");$$(g).each(function(p){p.observe("mouseenter",p.addClassName.bind(p,m));p.observe("mouseleave",p.removeClassName.bind(p,m))})}if(!Dtv.debugInfo.appliedEventSelectors){Dtv.debugInfo.appliedEventSelectors={}
}Dtv.debugInfo.appliedEventSelectors[m]=h;if(k){k.stop()}$log("applyEventSelectors end")}document.observe("dom:loaded",function(){if($profile.loggers.waitingReady){$profile.loggers.waitingReady.stop()}var h=$profile("DTV ready script");f("expedite");var g=$profile("DTV Behaviors");Dtv.behaviors.applyMappings();if(g){g.stop()}f("ready");if(h){h.stop()}$profile.loggers.readyloaded=$profile("DOM ready, waiting for document to finish loading","The time difference between when the DOM became ready and the time the document was loaded","olive")
});Event.observe(window,"load",function(){if($profile.loggers.readyloaded){$profile.loggers.readyloaded.stop()}f("load");var g=$profile("DTV$loaded","DTV script fired on window load. This script block is defered.");if(Prototype.Browser.IE6){Dtv.defer(b.curry("hover"))}if($profile.showResults){Dtv.defer(function(){if(g){g.stop()}$profile.showResults()});Dtv.perf=$profile}f.defer("defer",true);a=Dtv.STATUS_CODE.completed});if(c){c.stop()}})();(function(){$log("RequestManager setup start");Dtv.RequestManager=(function(){var c={activeRequests:[],defaultTimeout:60,onTimeout:function(g){if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.openCancelProcessingLightbox()
}g._timedOut=true},onComplete:function(g){window.clearTimeout(g._timeoutId);if(g._timedOut){if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.hideCancelProcessingLightbox()}}},setTimeout:function(g){var h=Object.isNumber(g.options.timeout)?g.options.timeout:c.defaultTimeout;g._timeoutId=(g.options.onTimeout||c.onTimeout).delay(h,g)},cancel:function(h){if(h._complete){return}try{h.cancelled=true;h.transport.abort()}catch(g){Dtv.debug(g,"Dtv.RequestManager.cancel")}},cancelAll:function(g){this.activeRequests.each(function(h){if(!g||!!h._timeoutId){Dtv.RequestManager.cancel(h)
}})},resetTimeout:function(){this.activeRequests.each(function(g){if(!!g._timedOut){Dtv.RequestManager.setTimeout(g)}})}};function b(g,h){Dtv.debug(g,"RequestManager responder error: "+h)}function a(g){var h="tealeafid="+dtvUniqueId();if(g.options.method=="get"){g.url+=(g.url.include("?")?"&":"?")+h}else{if(g.options.postBody){g.options.postBody+=(g.options.postBody.include("&")?"&":"")+h}else{if(g.options.parameters){g.options.parameters=Object.extend(g.options.parameters,h.toQueryParams());g.options.postBody=$H(g.options.parameters).toQueryString()
}}}}function d(g){if(typeof pepKeepAliveCount!="undefined"&&g.url.indexOf("/DTVAPP/new_customer/component/keepAlive.jsp")==-1){pepKeepAliveCount=0}}function f(g){g.options.onSuccess=(g.options.onSuccess||Prototype.emptyFunction).wrap(function(k,j,h){if(j.request.cancelled){if(j.request.options.onCancel){j.request.options.onCancel(j,h)}}else{k(j,h)}})}Ajax.Responders.register({onCreate:function(h){try{c.activeRequests.push(h);if(h.options.timeout){c.setTimeout(h)}a(h);d(h);f(h)}catch(g){b(g,"onCreate")
}},onComplete:function(j,g){try{c.onComplete(j);if(g&&g.responseJSON&&g.responseJSON.pepSessionWarning){openPepSessionWarningLightbox()}c.activeRequests.erase(j)}catch(h){b(h,"onComplete")}},onException:function(h,g){try{Dtv.debug(g,"Request exception: "+h.url)}catch(g){b(g,"onException")}}});return c})();$log("RequestManager setup end")})();Dtv.behaviors=(function(){var d=new Hash(),c=false,b=new Hash();window.$consts=function(f){return b.get(Dtv.behaviors.getBehaviorName(f)).consts};var a=Class.create({isInitialized:false,initialize:function(h,f){try{var g=$profile(this.behaviorName,"<b>initialize()</b>","#444444");
if(this.constructor.definition.options){f=$extend($clone(this.constructor.definition.options),f||{})}else{f=f||{}}this.el=$el(h||f.el);this.options=f;if(!this.el.behaviors){this.el.behaviors=[]}else{if(this.el.behaviors[this.behaviorName]){throw new Error("Behavior '"+this.behaviorName+"' has already been applied to element")}}this.el.behaviors[this.behaviorName]=this;this.el.behaviors.push(this);Dtv.behaviors.instances.push(this);Dtv.behaviors[this.behaviorName].instances.push(this);if(this.el.id){this.id=this.el.id
}this._callInitMethods(g);if(g){g.stop()}}catch(j){this.debug(j);throw j}},_callInitMethods:function(g){var f=function(k){try{var h=this[k];if(h){if(g){g.log(h.bind(this),k)}else{h.apply(this)}}}catch(j){this.debug(j,k+"() failed")}}.bind(this);f("_init");f("_initLayout");if(this.options&&this._onOptionSet){$H(this.options).each(function(h){this._onOptionSet(h.key,h.value)}.bind(this))}f("_initEvents");f("_initDefaultState");this.isInitialized=true;this.fireEvent("initialized");$log("Behavior "+this.behaviorName+" initialized")
},debug:function(g,h){var f=Dtv.debug(g,"Behavior Name: "+this.behaviorName+(h?(" - "+h):""));if(f){if(f.msg){f.behavior=this;if(!this._log){this._log=[]}this._log.push(f)}else{if(!this._errors){this._errors=[]}this._errors.push(f)}}return this},dispose:function(){var f=this.behaviorName;try{Dtv.behaviors[f].instances.erase(this);Dtv.behaviors.instances.erase(this);this.el.behaviors.erase(this);delete this.el.behaviors[f];this.stopObservers();$H(this).each(function(h){this[h.key]=null}.bind(this));
this.isDisposed=true}catch(g){Dtv.debug(g,"Failed to dispose behavior "+f);throw g}$log("Behavior "+f+" disposed")},stopObservers:function(){if(!this._observersRegistry){return false}this._observersRegistry.each(function(f){if(f.el===document){if(f.eventName=="scroll"&&Prototype.Browser.IE){window.detachEvent("onscroll",f.eventHandler)}else{document.stopObserving(f.eventName,f.eventHandler)}}else{Element.stopObserving(f.el,f.eventName,f.eventHandler)}delete f.el;delete f.eventName;delete f.eventHandler
});delete this._observersRegistry;return true},observe:function(h,f,g){Event.observe(h,f,g);if(!this._observersRegistry){this._observersRegistry=[]}this._observersRegistry.push({el:h,eventName:f,eventHandler:g})},bindEvent:function(f,g){this.observe(this.el,this.behaviorName+":"+f,g||Prototype.emptyFunction);return this},bindEvents:function(h,g){var f=this;$H(h).parseSubKeys(g||this,function(j,k){f.bindEvent(j,k)})},fireEvent:function(g,f){this.el.fire(this.behaviorName+":"+g,$extend(f||{},{behavior:this}));
return this},disableTextSelection:function(){if(Prototype.Browser.IE){this.el.descendants().invoke("disableSelection")}else{this.el.disableSelection()}},enable:function(){this.disabled=false;this.el.select("a").invoke("enable")},disable:function(){this.disabled=true;this.el.select("a").invoke("disable")},getOption:function(f){return this.options?this.options[f]:undefined},setOption:function(f,g){if(!this.options){this.options={}}if(this.options[f]!==g){if(this._onOptionSet){this._onOptionSet(f,g,this.options[f])
}this.options[f]=g}},setOptions:function(g){if(!g){return false}var f=this;$H(g).each(function(h){f.setOption(h.key,h.value)})},bindAction:function(f,h,g){f=$(f);if(!f.href||f.href==""){f.href="#"}if(h){f.rel=this.behaviorName+":"+h}if(f.actionBindings){if(f.actionBindings.indexOf(this)>-1){return f}}else{f.actionBindings=[]}f.actionBindings.push(this);f.observe(g||"click",function(j){if(!Prototype.Browser.IE&&!Event.isLeftClick(j)){return}if(f.disabled){return false}var k=(f.rel||"").split(":");
if(this.behaviorName==k[0]){j.stop();this.handleAction(k.last(),f,j)}}.bind(this));Dtv.tealeaf.invoke("tlProcessNode",f,true);return f},handleAction:function(h,g,l){Dtv.debug(h,"Action Handled");var m=h.split("."),k=this,f=this,j=false;m.forEach(function(o,n){var p=k;k=k[o];if(n==m.length-1){if(p!=f&&p.behaviorName&&p.handleAction){j=p.handleAction(o,g,l)}else{if(k){k.call(p);j=true}}}});return j}});a.name="AbstractBehavior";Dtv.expedite(function(){b.each(function(g){var f=g.value;if(f.forceCompile){Dtv.behaviors.compile(f.name)
}})});return{instances:[],debugInfo:{definitions:b},define:function(g){var f=function(h){return new Error("Could not define behavior with definition: "+Object.toJSON(g)+(h?(" - reason: "+h):""))};if(!g){throw f()}if(!g.name){throw f("no name defined")}if(b.get(g.name)){throw f("definition already defined")}if(!g.methods&&!g.inherits){throw f("no methods defined")}else{if(!g.methods){g.methods={}}}if(g.inherits&&!Object.isString(g.inherits)){throw f("inherits property must be a string")}if(g.selectors){if(!Object.isArray(g.selectors)){g.selectors=[g.selectors]
}}else{g.selectors=[]}b.set(g.name,g);this[g.name]=g.name},compile:function(f){try{if(this[f]&&!Object.isString(this[f])){throw'Behavior "'+f+'" has already been compiled.'}var g=b.get(f);if(!g){throw'Behavior "'+f+'" has not been defined.'}if(g.inherits){g.inherits=this.getBehaviorType(g.inherits);if(g.inherits.definition.options){g.options=$extend($clone(g.inherits.definition.options),g.options||{})}if(g.inherits.definition.consts){g.consts=$extend($clone(g.inherits.definition.consts),g.consts||{})
}}g.methods.behaviorName=f;this[f]=Class.create(g.inherits||a,g.methods,g.consts?g.consts:{});this[f].instances=$A();this[f].name=f;this[f].definition=g;if(g.consts){$extend(this[f],g.consts)}$extend(this[f],{getDefault:function(){return Dtv.behaviors[f].instances.first()}},g.statics);if(g.stylesheet){Dtv.defer(Dtv.utils.addStylesheet.curry(g.stylesheet))}if(this[f]._init){this[f]._init()}}catch(h){Dtv.debug(h,"Failed to compile behavior: "+f)}return this[f]},purge:function(h,f){try{if(h.isDisposed){return false
}if(h.__supressGC){return false}if(f&&h.el.parentNode){h.el.remove()}h.dispose();return true}catch(g){Dtv.debug(g,"Failed to purge behavior "+h.behaviorName)}},collectOrphans:function(){var f=$A();$A(arguments.length>0?arguments:[Dtv.behaviors]).each(function(h){try{if(Object.isString(h)){h=Dtv.behaviors[h]}if(!h.instances){Dtv.debug("could not purge orphaned behaviors for scope "+h);return}h.instances.each(function(j){if(!j.el.parentNode){f.push(j)}})}catch(g){Dtv.debug(g,"Failed to collect orphan")
}});return f},purgeOrphans:function(){this.collectOrphans.apply(this,arguments).each(Dtv.behaviors.purge)},applyBehavior:function(g,f,n,o,k){var l=[];var j=this.getBehaviorName(f);var m=this.getBehaviorType(j);if(m){if(n){var h=(n=="body")?[$(document.body)]:$(g||document.body).select(n);h.each(function(p){if(!(p.behaviors&&p.behaviors[j])){l.push(new m(p,o))}else{if(k&&o){p.behaviors[j].setOptions(o)}}})}else{if(!(g.behaviors&&g.behaviors[j])){l.push(new m(g,o))}}}else{Dtv.debug("Could not apply behavior '"+j+"' - type could not be found")
}return l},applyMappings:function(g){var f=[];b.each(function(k){try{var h=k.value;h.selectors.each(function(l){var m=null;options=null;if(Object.isString(l)){m=l}else{if(!l.test||l.test()){m=l.expr;options=l.options}}if(m){if(l.defer&&!c){Dtv.defer(Dtv.behaviors.applyBehavior.bind(Dtv.behaviors,g,h.name,m,options))}else{f=f.concat(Dtv.behaviors.applyBehavior(g,h.name,m,options))}}})}catch(j){Dtv.debug(j,"applyMappings failure to "+k.key)}});c=true;return f},getBehaviorName:function(g){var f=g&&g.definition?g.definition.name:g;
if(!Dtv.behaviors[f]){throw"Behavior "+f+" is not defined"}return f},isCompiled:function(h){var f=this.getBehaviorName(h);var g=this[f];if(!g){throw"Behavior "+f+" is not defined"}else{if(Object.isString(g)){return false}}return true},getBehaviorType:function(g){var f=this.getBehaviorName(g);return this.isCompiled(f)?this[f]:this.compile(f)},get:function(f){return this.isCompiled(f)?this[this.getBehaviorName(f)]:this.compile(f)},utils:{isContentPage:function(){var f=document.location.href.toLowerCase();
return(f.indexOf("/content/")!=-1)}}}})();$profile.loggers.globaljs=$profile("global.js");if(logjs){Event.observe(document,"dom:loaded",function(){$log("[ dom:loaded ]")});Event.observe(window,"load",function(){$log("[ window.load ]")})}Event.observe(document,"click",function(h){if(!Prototype.Browser.IE&&!Event.isLeftClick(h)){return}var f=h.findElement("a");if(!f){if(h.element().hasClassName("js-action")){f=h.element()}else{return}}if(f.disabled){h.stop();return false}if(f.hasClassName("js-action")){if(f.rel&&f.rel.indexOf(":")>-1){var j=f.rel.split(":");
var g=f.findBehavior(j[0],true);if(g){g.bindAction(f);g.handleAction(j[1],f,h)}}h.stop();return false}else{if(f.hasClassName("js-submit")){var c;if(f.rel){var a=$(f.rel);if(a){c=a.up("form")}}else{c=f.up("form")}if(c&&c.getController){var d=c.getController();if(d){d.bindTrigger(f);d.handleTrigger(f)}else{Dtv.debug("js-submit element click ignored: found form el but no form controller.")}}else{Dtv.debug("js-submit element click ignored: could not find form el.")}h.stop();return false}else{var b=false;
$A(f.classNames()).forEach(function(k){if(k=="js_processing_timeout"||(k.startsWith("js-")&&(k.endsWith("-opener")||k.endsWith("-link")))){b=true;return true}});if(b||f.href=="#"||f.href==window.location.href+"#"){h.stop();return false}}}});var SUPPRESS_SURVEY_LIGHTBOX=false;Dtv.expedite(function(){$log("fireDtvDomLoadedEvents start");var a=$profile("fireDtvDomLoadedEvents");try{document.execCommand("BackgroundImageCache",false,true)}catch(b){$log("BackgroundImageCache failed: "+b)}try{initializeHeaderStyles()
}catch(b){$log("initializeHeaderStyles failed: "+b)}try{initializePromo()}catch(b){$log("initializePromo failed: "+b)}$log("fireDtvDomLoadedEvents end");if(a){a.stop()}});var DIRECTV=DIRECTV?DIRECTV:new Object();function initializeTypeAheadSearch(){try{if($("seach_autocomplete_items")){var a=$("dtv_topnav_search_input");a.hasFocus=false;Event.observe(a,"blur",function(){$("dtv_topnav_search_input").hasFocus=false});Event.observe(a,"focus",function(){$("dtv_topnav_search_input").hasFocus=true});var d=function(){$("searchForm").submit()
};DIRECTV.Search=DIRECTV.Search?DIRECTV.Search:new Object();var b=new Autocompleter.Local("dtv_topnav_search_input","seach_autocomplete_items",[],{minChars:1,frequency:0.2,indicator:"search_wait_proc",afterUpdateElement:d});b.dictCache={};b.dictRequests={};b.dictShown={};b.newListRendered=false;b.options.cdnUrl=$("typeAheadCdnUrl").innerHTML;b.getUpdatedChoices=function(){this.startIndicator();var f=this.getToken().slice(0,1).toLowerCase();if(/\w|\d/.match(f)){if(!this.dictCache[f]){if(!this.dictRequests[f]){this.dictRequests[f]=f;
this.getDict(f);this.options.array=[]}}else{this.dictShown[f]=true;this.options.array=this.dictCache[f];this.stopIndicator();this.newListRendered=true;this.updateChoices(this.options.selector(this))}}else{this.stopIndicator()}};b.getDict=function(h){var g=document.getElementsByTagName("head").item(0);var f=document.createElement("script");f.setAttribute("type","text/javascript");f.setAttribute("src",this.options.cdnUrl+"/csf/typeahead/"+h+".js");g.appendChild(f)};b.loadDict=function(g,f){this.dictCache[g]=f;
if(!this.dictShown[g]){this.dictShown[g]=true;this.newListRendered=true;this.getUpdatedChoices()}};b.oldRender=b.render;b.render=function(){if(this.newListRendered){this.index=-1;this.newListRendered=false}this.oldRender()};b.selectEntry=function(){this.active=false;this.element.value=this.getCurrentEntry().innerHTML.stripTags();$("searchForm").submit()};b.markPrevious=function(){this.index=(this.index>=0)?this.index:0;if(this.index>0){this.index--}else{this.index=this.entryCount-1}this.getEntry(this.index).scrollIntoView(false);
this.element.value=this.getCurrentEntry().innerHTML.stripTags()};b.oldMarkNext=b.markNext;b.markNext=function(){this.oldMarkNext();this.element.value=this.getCurrentEntry().innerHTML.stripTags()};DIRECTV.Search.typeAhead=b}}catch(c){$log("type ahead search init: "+c)}}document.observe("dom:loaded",initializeTypeAheadSearch);function dtvUniqueId(){return new Date().getTime()+"."+Math.random()+"."+Math.random()}function appendParamsAndReloadPage(d,b){var c=document.location.href;c=c.replace(/#/i,"");
if(c.indexOf("?")!=-1&&c.indexOf("?")<c.length){var a=c.substring(c.indexOf("?")+1).toQueryParams();d=Object.extend(a,d);c=c.substring(0,c.indexOf("?"))}c+="?"+Object.toQueryString(d);if(b!=undefined&&b=="true"){c=c.replace(/http/i,"https")}document.location.href=c;return false}function scrollWithOffset(a,b){a=$(a);if(!a){return}var c=a.cumulativeOffset();c.top-=b;if(c.top<0){c.top=0}window.scrollTo(c.left,c.top)}function isVisible(d,g){d=$(d);if(!d){$log("element with id '"+d+"' does not exist in isVisible()");
return false}var a=document.viewport.getScrollOffsets().top;var c=a+document.viewport.getDimensions().height;var b=d.cumulativeOffset().top;var f=b+d.getHeight();if(parseInt(g)==NaN){g=0}b-=g;return(b>=a&&f<=c)}function initHoverMenu(a,b){showHoverMenu=false;var a=$(a);var b=$(b);a.observe("click",function(){showHoverMenu=false;a.addClassName("active");b.addClassName("active")});a.observe("mouseover",function(){showHoverMenu=true});a.observe("mouseout",function(){showHoverMenu=false;setTimeout(function(){if(!showHoverMenu){a.removeClassName("active");
b.removeClassName("active")}},200)});b.observe("mouseout",function(){showHoverMenu=false;setTimeout(function(){if(!showHoverMenu){a.removeClassName("active");b.removeClassName("active")}},200)});b.select("li").each(function(c){c.observe("mouseover",function(){a.addClassName("active");showHoverMenu=true})})}function addBookmark(){if(window.sidebar){window.sidebar.addPanel(document.title,document.location.href,"")}else{if(window.external){window.external.AddFavorite(document.location.href,document.title)
}}return false}function goToUrl(b){if(!b){return false}if(b.toLowerCase().indexOf("http")!=0){var a="";if(document.location.port&&document.location.port!=80&&document.location.protocol!="https:"){a=":"+document.location.port}b=document.location.protocol+"//"+document.location.hostname+a+b}document.location.href=b;return false}var EVENT_AJAX_SUBMIT_CLICKED="dtv:ajaxSubmit";var EVENT_AJAX_SUCCESS="dtv:ajaxSuccess";var EVENT_AJAX_FAILURE="dtv:ajaxFailure";var EVENT_CAROUSEL_ITEM_SELECTED="itemselected";
var EVENT_CAROUSEL_ITEM_UNSELECTED="itemunselected";var EVENT_COMMON_SENSE_IFRAME_LOADED="dtv:commonSenseIframeLoaded";var EVENT_LIGHTBOX_RENDERED="dtv:lightboxRendered";var EVENT_LISTING_CONTRACTED="dtv:listingContracted";var EVENT_LISTING_EXPANDED="dtv:listingExpanded";function initializeHeaderStyles(){$$("h1.solid-header span").each(function(a){a.innerHTML=a.innerHTML+"<span>"+a.innerHTML+"<span>"+a.innerHTML+"</span></span>";a.addClassName("shadow")})}function cursorHelper(a){function b(g,h,d,c){g=$(g);
if(!(g.hasClassName(h))||g.value.length<c){return}var f=g.up().select("."+d);if(f.length>0){f[0].focus()}}b(a,"areaCode","num3",3);b(a,"num3","num4",3);b(a,"sin1","sin2",3);b(a,"sin2","sin3",2)}function enterKeySubmit(a){if(window.event&&window.event.keyCode==13){$(a).click();return false}}function openPositionedWindow(a,b,d,n,l,k,g,h,m,c){var j="width="+d+",height="+n+",screenX="+l+",screenY="+k+",left="+l+",top="+k+((g)?",status":"")+",scrollbars"+((h)?"=yes":"=no")+((m)?","+m:"");var f=openWindow(a,b,j,c);
return f}function openCenteredWindow(a,b,c,l,f,g,k,d){var j,h=0;if(screen){j=(screen.availWidth-c)/2;h=(screen.availHeight-l)/2}if(!f){f=""}if(!d){d=""}return openPositionedWindow(a,b,c,l,j,h,f,g,k,d)}function openWindow(c,b,d,a){var f=window.open(c,b,d);if(a){top.name=a}return f}function MoreInfoPopup(a){openCenteredWindow(a.href,"moreInfo",382,232,true,false,"","opener");return false}function openWindowFromSelect(b){b=$(b);if(!b||!b.match("select")){$log("Invalid select object");return}var a=b.options[b.selectedIndex].value;
if(a.length>0){openWindow(a)}}function shareLinkPopup(a){var b="";if(a=="buzzup"){b="http://buzz.yahoo.com/buzz?src=addthis&targetUrl="+encodeURIComponent(document.location.href)+"&headline="+encodeURIComponent(document.title)}else{if(a=="delicious"){b="http://del.icio.us/post?url="+encodeURIComponent(document.location.href)+"&title="+encodeURIComponent(document.title)}else{if(a=="digg"){b="http://digg.com/submit?phase=2&url="+encodeURIComponent(document.location.href)}else{if(a=="facebook"){b="http://www.facebook.com/sharer.php?u="+encodeURIComponent(document.location.href)+"&t="+encodeURIComponent(document.title)
}else{if(a=="twitter"){b="http://twitter.com/home?status="+encodeURIComponent(document.location.href)}}}}}if(b){openCenteredWindow(b,"shareWindow",800,600,true,true)}return false}var emailSignupUrl="/DTVAPP/emailsignup/emailSignup.jsp";function saveEmail(){var c=new Array();var a=document.forms.signupForm.emailField.value;c.push("email="+escape(a));var b=new Ajax.Request(emailSignupUrl,{method:"get",parameters:c.join("&"),onComplete:function(d){processResult(d)}})}function processResult(a){$("default").hide();
if(a.responseText.match(/success/)){$("fr").hide();$("success").toggle();$("validation").hide();$("error").hide();emailSignupPopup()}else{if(a.responseText.match(/exception/)){$("validation").hide();$("error").show();$("error").setStyle({color:"red"});if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}}else{$("error").hide();$("validation").show();$("validation").setStyle({color:"red"});if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()
}}}}function emailSignupPopup(a){if(!a){a=document.forms.signupForm.emailField.value}var b="/DTVAPP/emailsignup/interest.jsp?email="+a;openCenteredWindow(b,"details",382,450,true,false,"","opener");return false}function emailSignupSuccessCallback(c){var b=$("email_signup_email_address1");var a=$("email_signup_email_address2");var f=$("email_signup_email_input");if(b&&a&&f){b.innerHTML=f.value;a.innerHTML=f.value}if(c.preferencesUpdated){$("email_signup_form_container").hide();$("email_signup_confirmation").show();
return}var d=$("email_signup_not_signed_up");if(d){d.remove()}$("email_signup_signed_up").show()}function initializeEmailSignup(){var a=$("email_signup_submit");if(a){var d={subContentDiv:"content_page_email_content",hitboxEvent:"Email Signup Viewed",successCallback:emailSignupSuccessCallback};var b=new GenericWatcherHandlers(d);var c={successHandler:b.success.bind(b),failureHandler:b.failure.bind(b)};new SubmitWatcher(a,"email_signup_form",c)}}var _transitionEffect=null;function transition(a,b){b=$(b);
if(!b){$log("div with id '"+b+"' does not exist in transition()");return}if(_transitionEffect!=null){_transitionEffect.cancel()}_transitionEffect=Effect.Appear(b,{afterFinish:_transitionComplete});a=$(a);a.hide();closeTooltipsByDiv(a)}function _transitionComplete(a){_transitionEffect=null}_PROCESSING_NOTIFICATION_DIV='<div class="overlay-div-content"><div class="overlay-div-bg"></div><img src="/images/global/ajax/loading_40px.gif" alt="Processing" width="40" height="40" class="processing" /></div>';
function displayOverlay(b){b=$(b);$("dtv_tup").addClassName("hide-dropdowns");b.setOpacity(0.5);var a=new Element("div").setOpacity(0).setStyle({position:"absolute"}).addClassName("overlay-div");a.clonePosition(b);$(document.body).insert(a);a.update(_PROCESSING_NOTIFICATION_DIV);return new Effect.Opacity(a,{from:0,to:0.9,duration:0.2})}function removeOverlay(b,a){b=$(b);a=$(a);a.setStyle({width:b.getWidth()+"px",height:b.getHeight()+"px"});new Effect.Opacity(a,{from:a.getStyle("opacity"),to:0,duration:0.3,afterFinish:function(){a.remove()
}});b.setOpacity(1);$("dtv_tup").removeClassName("hide-dropdowns")}function appearContent(d,f,b,c){d=$(d);if(!d){$log("Unable to find target element in appearContent");return}var g=d.down("div");if(!g){$log(d.identify()+" does not contain a div element");return}var a=new Element("div").addClassName(b).setStyle({display:"none"});g.insert(a);a.update(f);a.setOpacity(0);d.show();a.show();c=c||{};a.appear(c);if(Dtv.behaviors.BusinessInfoPop.updateConnectors){Dtv.behaviors.BusinessInfoPop.updateConnectors(d)
}}var SubmitWatcher=Class.create();SubmitWatcher.prototype={initialize:function(c,a,b){this.formObj=$(a);this.submitObj=$(c);if(!this.submitObj){$log("submitObj with id '"+this.submitObj+"' does not exist in SubmitWatcher.initialize()");return}if(!this.formObj){$log("formObj with id '"+this.formObj+"' does not exist in SubmitWatcher.initialize()");return}this.setOptions(b);if(this.options.eventType=="change"){this.submitObj.onchange=this.hijackNode.bindAsEventListener(this)}else{this.submitObj.onclick=this.hijackNode.bindAsEventListener(this)
}this.formObj.onsubmit=this.hijackNode.bindAsEventListener(this)},setOptions:function(a){this.options={successHandler:null,failureHandler:null,createHandler:null,jsonErrorHandler:null,returnValue:false,eventType:"click"};Object.extend(this.options,a||{})},hijackNode:function(){$log("SubmitWatcher.hijackNode");if(this.options.createHandler!=null){var h=this.options.createHandler(this.formObj,this.submitObj);if(!h){return this.options.returnValue}}this.active=true;var g=this;var a=$(this.formObj);var b={hash:false};
if(this.submitObj&&(this.submitObj.type=="submit"||this.submitObj.type=="image")){b.submit=this.submitObj.name}var d=Form.serialize(a,b);this.onAfterFormSerialize();var c=null;var f={requestHeaders:{Accept:"application/json"},method:"post",postBody:d,mimetype:"application/json",timeout:this.options.timeout,onTimeout:this.options.timeoutHandler,onSuccess:function(k){try{$log("SubmitWatcher: onSuccess");g._applyJsonErrorHandler(k.responseText);c=k.responseJSON;g.onRequestComplete(c);a.fire(EVENT_AJAX_SUCCESS,c);
g._applyHandler(g.options.successHandler,c);g.active=false}catch(j){Dtv.debugInfo.transport=k;Dtv.debug(j,"SubmitWatcher: onSuccess")}},onCancel:function(j){$log("SubmitWatcher: onCancel");c={success:false,errors:[],errorFields:[]};g.onRequestComplete(c);a.fire(EVENT_AJAX_SUCCESS,c);g._applyHandler(g.options.cancelHandler||g.options.successHandler,c);g.active=false},onFailure:function(k){try{$log("SubmitWatcher: onFailure");g.onRequestComplete(c);a.fire(EVENT_AJAX_FAILURE,c);g._applyJsonErrorHandler(k.responseText);
g._applyHandler(g.options.failureHandler,k.responseText.evalJSON());g.active=false}catch(j){Dtv.debugInfo.transport=k;Dtv.debug(j,"SubmitWatcher: onFailure")}}};new Ajax.Request(a.action,f);a.fire(EVENT_AJAX_SUBMIT_CLICKED);return this.options.returnValue},_applyHandler:function(b,a){if(b==null){return}$log("SubmitWatcher._applyHandler");b(this.formObj,a)},_applyJsonErrorHandler:function(a){if(this.options.jsonErrorHandler==null){return}$log("SubmitWatcher._applyJsonErrorHandler");processJSONErrors(this.options.jsonErrorHandler.containerDiv,this.options.jsonErrorHandler.errorClass,a.evalJSON())
},onAfterFormSerialize:Prototype.emptyFunction,onRequestComplete:Prototype.emptyFunction};var GenericWatcherHandlers=Class.create({initialize:function(a){this._setHandlerOptions(a)},_setHandlerOptions:function(a){this.handlerOptions=Object.extend({subContentDiv:null,hitboxEvent:null,forcePageReload:false,forceLightboxClose:false,forceRedirect:false,successCallback:null,failureCallback:null},a||{})},success:function(a,b){if(!b.success){return this.failure(a,b)}$log("GenericWatcherHandler.success");
if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}if(this.handlerOptions.successCallback!=null&&this.handlerOptions.successCallback!=""){this.handlerOptions.successCallback(b)}if(this.handlerOptions.forceRedirect){if(b.redirectUrl!=null){window.location.href=b.redirectUrl;return true}b.errors.push("nextUrl not specified");return this.failure(a,b)}processJSONErrors(this.handlerOptions.subContentDiv,"ajaxError",b);if(b.messages){displayMessages(this.handlerOptions.subContentDiv,b.messages,b.messageLevel)
}if(this.handlerOptions.forceLightboxClose){closeLightbox()}if(this.handlerOptions.forcePageReload){window.location.reload(true)}return true},failure:function(a,b){$log("GenericWatcherHandler.failure");processJSONErrors(this.handlerOptions.subContentDiv,"ajaxError",b);if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}if(this.handlerOptions.failureCallback!=null&&this.handlerOptions.failureCallback!=""){this.handlerOptions.failureCallback(b)}if(this.handlerOptions.hitboxEvent!=null){hitboxCustomEvent(this.handlerOptions.hitboxEvent,null)
}return false}});function ajaxFormSubmitAndPopulate(g,b,f,h,k,c,j){var d=$(g).up("form");if(!d){$log("No parent form found for "+$(g).identify());return}var a=Form.serialize(d);ajaxRequestAndPopulate(b,f,a,h,k,c)}function ajaxRequestAndPopulate(b,f,a,g,j,d,h){if(d>=0){scrollWithOffset(b,d)}var k=displayOverlay(b);var c={method:"post",evalScripts:true,postBody:a,onComplete:_ajaxRequestAndPopulateComplete.curry(b,g,k,j,h)};new Ajax.Request(f,c)}function _ajaxRequestAndPopulateComplete(h,g,f,c,a,b,d){if(f.state!="finished"){setTimeout(_ajaxRequestAndPopulateComplete.curry(h,g,f,c,a,b,d),100);
return}if(b.status<200||b.status>300){$(h).update(g)}else{$(h).update(b.responseText)}if(!a&&Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.reset()}if(Dtv.behaviors.BusinessInfoPop.updateConnectors){Dtv.behaviors.BusinessInfoPop.updateConnectors()}removeOverlay(h,f.element);if(c instanceof Function){c()}}function displayLightbox(c,b){var a=$(document.body);if(!a.hasBehavior(Dtv.behaviors.LegacyLightbox)){setTimeout(displayLightbox.curry(c,b),300)}else{var d=a.behavior(Dtv.behaviors.LegacyLightbox);
d.create(c,b)}}function closeLightbox(){var a=$(document.body);var b=a.behavior(Dtv.behaviors.LegacyLightbox);if(b._currentLightboxWindow.length==0){$log("closeLightbox() called when no lightbox is open");return}closeTooltipsByDiv(b._currentLightboxContentDiv[0]);if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}b.closeLightboxMinimal()}function openDtvLightbox(j,f,h,g,d,a){if(!document.loaded){document.observe("dom:loaded",openDtvLightbox.curry(arguments));
return}var b=new Element("div");b.setStyle({display:"none"});$(document.body).insert(b);var c=$(b).identify();new Ajax.Updater(c,"/DTVAPP/global/lightbox/lightboxAjaxContent.jsp",{onComplete:_openDtvLightbox.curry(c,arguments)})}function _openDtvLightbox(c,a){if(a.length<2){$log("_openDtvLightbox called without title and lightboxContent arguments");return}var l=(a.length>=2)?a[2]:true;var j=(a.length>=3)?a[3]:false;var b=(a.length>=4)?a[4]:false;var g=(a.length>=5)?a[5]:false;var k=a[0];var d=a[1];
contentOptions={contentDiv:c,suppressHitbox:true};$(c).down(".lb-header").update("<span>"+k+"</span>");var f=$(c).down(".js-ajax-content");if(l){f.addClassName("dtv-lightbox-overflow")}function h(p,n,o){var m=new Element("a",{href:"javascript:void(0)","class":n}).update("<span>"+p+"</span>");m.observe("click",o);lightboxButtonDiv.insert(m)}lightboxButtonDiv=$(c).down(".js_ajax_buttons");if(g){h(g==true?"Print":g,"btn-sm-std",printLightboxContent.curry($(f).identify()))}if(j){h(j==true?"OK":j,"btn-sm-stdact",closeLightbox)
}if(b){h(b==true?"Cancel":b,"btn-sm-std",closeLightbox)}if($(d)){$(f).update($(d).innerHTML);displayLightbox(contentOptions,DEFAULT_CEP_LIGHTBOX_OPTIONS)}else{new Ajax.Updater(f,d,{onComplete:displayLightbox.curry(contentOptions,DEFAULT_CEP_LIGHTBOX_OPTIONS),method:"get"})}hitboxCustomEvent(k+" Lightbox","global")}function printLightboxContent(a){printWindow=openCenteredWindow("","printWindow",600,600,false,true,"","");printWindow.document.open();printWindow.document.write($(a).innerHTML);printWindow.document.close();
printWindow.print()}function hitboxCustomEvent(d,c){var f="Lightbox+with+no+page+name+set";if(d!=null&&d!=""){f=d.replace(/\s/g,"+")}else{if(hbx.pn!=null&&hbx.pn!=""){f=hbx.pn+"+Lightbox"}}try{var a=_mlc;if(c){_hbPageView(f,c.replace(/\s/g,"+"))}else{if(hbx.mlc!=null&&hbx.mlc!=""){_hbPageView(f,hbx.mlc)}else{_hbPageView(f,_mlc)}}_mlc=a}catch(b){}}function hitboxCommerceReport(h,b,f,c){var d=$("dtv_custom_hitbox");if(!($(d))){d=new Element("div",{id:"dtv_custom_hitbox"});$(d).setStyle({width:"1px",height:"1px",overflow:"hidden"});
$(document.body).insert(d)}var a="/DTVAPP/includes/hitboxIFrame.jsp";a+="?hitboxPageType="+h.replace(/\s/g,"+");a+="&hitboxSubsystem="+b.replace(/\s/g,"+");a+="&hitboxPageName="+f.replace(/\s/g,"+");a+="&hitboxCategory="+c.replace(/\s/g,"+");var g=new Element("iframe");g.src=a;$(d).update();$(d).insert(g)}function transitionToAjaxContent(){var b=$("lb_thinking");if(!b||!b.visible()){setTimeout(transitionToAjaxContent,200);return}setTimeout(transition.curry("lb_thinking","lb_ajax"),300);if(Dtv.behaviors.isCompiled("GenericRollover")&&Dtv.behaviors.GenericRollover.resetRollovers){Dtv.behaviors.GenericRollover.resetRollovers()
}if(Dtv.behaviors.BusinessInfoPop.updateConnectors){Dtv.behaviors.BusinessInfoPop.updateConnectors()}Dtv.behaviors.applyBehavior("lb_ajax","CollapsibleTab",".js-collapsible-tabs");if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.reset()}var a=$("lb_ajax").select("div");if(a!=null&&a.length>0){childId=a[0].id;if(childId!=null){hitboxDiv=$(childId+"_hitbox");if(hitboxDiv!=null&&hitboxDiv.title!=null){hitboxCustomEvent(hitboxDiv.title)}}}$("lb_ajax").fire(EVENT_LIGHTBOX_RENDERED)
}function displayGenericErrorLightbox(a){contentOptions={callback:"dtv:lightboxErrorOpened",contentDiv:"lightboxDiv",subContentDiv:"lb_generic_error",hitboxPageName:"Generic+Error+Lightbox"};displayLightbox(contentOptions,DEFAULT_CEP_LIGHTBOX_OPTIONS);if(a.errors==null||a.errors.length==0){a.addError("An unknown error has occurred.")}processJSONErrors("lb_generic_error","ajaxError",a)}function displayLoginLightbox(b){var a=Dtv.behaviors.AjaxLightbox.show("/DTVAPP/global/lightbox/lightboxLogin.jsp",{hitboxEvent:"Login Lightbox",forceLightboxClose:false,onAjaxSuccess:function(c){if(c.redirectUrl!=null){window.location.href=c.redirectUrl;
return}if(b){b()}else{a.hide()}}})}function displayTermsAndConditionsLightbox(a,b){Dtv.behaviors.AjaxLightbox.show("/DTVAPP/global/lightbox/lightboxTermsAndConditions.jsp",{hitboxEvent:"Terms and Conditions Lightbox",forceLightboxClose:false,onInit:function(){$("toc_inner").update($(a).innerHTML);if(!b){b="Terms &amp; Conditions"}Dtv.behaviors.AjaxLightbox.instances[0].el.down(".lb-header").update("<span>"+b+"</span>")}})}function displayInterstitial(g,d){var a='<div class="thinking"><img src="/images/global/icons/dtv_logo_animated_blue.gif" alt="Thinking" width="105" height="108" /></div>';
a+=g;var b=new Element("div",{id:"dtv_interstitial",style:"display:none"}).update(a);$(document.body).insert(b);var c={className:"dtv_interstitial",width:500,height:250,top:100};var f={callback:"dtv:interstitialLightboxLoginOpened",contentDiv:"dtv_interstitial",suppressHitbox:true};if($("overlay_modal")&&$("overlay_modal").hasClassName("overlay_directv-alert")){$("overlay_modal").removeClassName("overlay_directv-alert");$("overlay_modal").addClassName("overlay_dtv_interstitial")}displayLightbox(f,c);
if(d!=undefined){_interstitialCallback(d)}}function _interstitialCallback(a){if(!($("overlay_modal"))||$("overlay_modal").getStyle("opacity")<0.99){setTimeout(_interstitialCallback.curry(a),300);return}setTimeout(a,500)}function suppressExternalLightboxes(){SUPPRESS_SURVEY_LIGHTBOX=true}function allowExternalLightboxes(){SUPPRESS_SURVEY_LIGHTBOX=false}function processJSONErrors(c,b,a){clearErrors(c,b);if(a==null){return}displayMessages(c,a.errors,a.errorLevel);a.errorFields.each(function(d){applyFieldError(b,d,c)
})}function applyFieldError(b,a,c){elementObj=$(a);if(!elementObj){elementObj=$(c||document.body).first('input[name="'+a+'"]')}if(!elementObj){$log("No field with element ID: "+a);return}Element.addClassName(elementObj,b);Element.addClassName(elementObj.identify()+"Label",b);Element.addClassName(elementObj.identify()+"Icon",b)}function clearErrors(b,a){$(b).select("."+a).invoke("removeClassName",a);$(b).select(".js_message_wrapper").invoke("hide")}function displayMessages(k,d,f,o){if(o==undefined){o=false
}if(!$(k)){$log("messageContainerDiv with id '"+k+"' does not exist in displayMessages()");return}var m={ERROR:"error-message",WARN:"warning-message",INFO:"info-message"};for(var b in m){var c=m[b];var j=$(k).select("."+c)[0];if(!$(j)){$log("wrapperDiv with id '"+j+"' does not exist in displayMessages()");return}$(j).hide();if(d==null||d.length<=0){continue}var n=$(j).select(".js_message_content")[0];if(!$(n)){$log("messageDiv with id '"+n+"' does not exist in displayMessages()");return}var a="";
if(o){var h=$(n).select("li");for(var g=0;g<h.length;g++){var l=h[g].innerHTML;if(l.length>0){a+="<li>"+l+"</li>"}}}if(b==f){for(var g=0;g<d.length;g++){a+="<li>"+d[g]+"</li>"}}$(n).update(a);if(b==f||(o&&a!="")){$(j).show()}}}function timeoutWarning(){var b={contentDiv:"lightboxTimeoutDiv",callback:"dtv:lightboxTimeoutOpened",hitboxPageName:"Session Timeout Warning Lightbox",hitboxPageCategory:"/global",suppressSessionRefresh:true};var a={width:598,height:330,top:100};displayLightbox(b,a);return false
}function executeDtvTimeout(a){self.location=self.location.protocol+"//"+self.location.host+a+"?reason=timeout&lastVisited="+self.location.pathname+self.location.search}function refreshSession(){var a="/DTVAPP/global/touch.jsp";new Ajax.Request(a,{method:"get"})}function openPepSessionWarningLightbox(){try{if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}Dtv.behaviors.AjaxLightbox.show("lightboxPepSessionWarning.jsp",{hitboxEvent:"PEPOD Session Warning Lightbox",forcePageReload:true})
}catch(a){Dtv.debug(a,"Failed to open pep session warning lightbox");throw a}}function closeTooltipsByDiv(a){if(Dtv.behaviors.BusinessInfoPop&&Dtv.behaviors.BusinessInfoPop.instances){Dtv.behaviors.BusinessInfoPop.instances.invoke("hide")}}function initializePromo(){var g="customer";var a=""+document.cookie;var b=a.indexOf(g);if(b==-1||g==""){var d=$("prospect-promo");if(d!=null){d.toggle()}}else{var f=$("customer-promo");if(f!=null){f.toggle()}}}function killFlash(){if(document.getElementById("flashcontent")!=null){document.getElementById("flashcontent").innerHTML=""
}fo=null}var DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS={width:598,height:330,top:50};var DEFAULT_CEP_LIGHTBOX_OPTIONS={width:794,height:330,top:50};function toggleFaqAnswer(b){var a=$(b).next(".faq_toggle_content");if($(b).hasClassName("faq_toggle_heading_active")){new Effect.BlindUp(a,{duration:0.5})}else{new Effect.BlindDown(a,{duration:0.5})}$(b).toggleClassName("faq_toggle_heading_active")}function displayFaqCategory(a){$("faq_page").select(".js_faq_entry").each(function(b){$(b).hide()});$(a).show()
}function initializeFaqPage(b,a){if(!($(b))){b="faq_1"}displayFaqCategory(b);if($(a)){$(a).scrollTo()}else{a=$(b).down("h4")}toggleFaqAnswer(a)}var scheduleInstallationHandlerOptions={subContentDiv:"lb_schedule_installation",hitboxEvent:"Select Installation Appointment Lightbox",forceRedirect:true};var scheduleInstallationHandlers=new GenericWatcherHandlers(scheduleInstallationHandlerOptions);function initializeScheduleInstallLightbox(){transitionToAjaxContent()}function displayScheduleInstallLightbox(){contentOptions={callback:"dtv:lightboxScheduleInstallOpened",contentDiv:"lightboxDiv",subContentDiv:"lb_schedule_installation",hitboxPageName:"Schedule Installation Lightbox"};
displayLightbox(contentOptions,DEFAULT_CEP_LIGHTBOX_OPTIONS)}var _availableScheduleInstallTimes=new Array();var _availableScheduleInstallDates=new Array();var _scheduleInstallTimes={E:"6-8 AM",A:"8 AM-Noon",P:"Noon-4 PM",L:"4-8 PM"};function initializeScheduleInstallCalendar(l){if($("scheduleInstallationSubmit")){new SubmitWatcher("scheduleInstallationSubmit","scheduleInstallationForm",{successHandler:scheduleInstallationHandlers.success.bind(scheduleInstallationHandlers),failureHandler:scheduleInstallationHandlers.failure.bind(scheduleInstallationHandlers)})
}_availableScheduleInstallTimes=new Array();var f=new Date();f.setDate(1);if(l!=null&&l.length>0){var h=l.split(",");for(var d=0;d<h.length;d++){var k=h[d].split(":");var n=k[0].split("/");var g=new Number(n[0]).valueOf();var m=new Number(n[1]).valueOf();var j=new Number(n[2]).valueOf();if(_availableScheduleInstallTimes[g]==null){_availableScheduleInstallTimes[g]=new Array()}_availableScheduleInstallTimes[g][m]=k[1];if(d==0){f.setDate(m);f.setMonth(g-1);f.setYear(j)}}}if($("installCalendarCurrent")&&$("installCalendarNext")){var c={embedded:true,onchange:scheduleInstallClick.curry("installCalendarCurrentInput"),month_year:"label",buttons:false,valid_date_check:isValidScheduleInstallDate,date:f.toString()};
new CalendarDateSelect($("installCalendarCurrentInput"),c);var a=new Date();a.setDate(1);if(f.getMonth()<11){a.setMonth(f.getMonth()+1);a.setYear(f.getFullYear())}else{a.setMonth(0);a.setYear(f.getFullYear()+1)}var b={embedded:true,onchange:scheduleInstallClick.curry("installCalendarNextInput"),month_year:"label",buttons:false,valid_date_check:isValidScheduleInstallDate,date:a.toString()};new CalendarDateSelect($("installCalendarNextInput"),b)}}function isValidScheduleInstallDate(b){var c=b.getMonth()+1;
var a=b.getDate();return(_availableScheduleInstallTimes[c]!=null&&_availableScheduleInstallTimes[c][a]!=null)}function scheduleInstallClick(b){var a=new Date($(b).value);$("installYear").value=a.getFullYear();$("installMonth").value=a.getMonth()+1;$("installDay").value=a.getDate();updateScheduleInstallTimes(a.getMonth()+1,a.getDate());$("scheduleInstallDateLabel").update($(b).value);if($(b).id=="installCalendarNextInput"){$("installCalendarCurrent").select(".cds_footer span")[0].update("&#160;")}else{$("installCalendarNext").select(".cds_footer span")[0].update("&#160;")
}}function updateScheduleInstallTimes(f,b){var a=_availableScheduleInstallTimes[f][b];if(a==null){return}var g=$("installWindow");g.options.length=0;g.options[0]=new Option("Select a time","");for(var c=0;c<a.length;c++){var d=a.charAt(c);g.options[c+1]=new Option(_scheduleInstallTimes[d],d)}}function lightboxScheduleLater(b){closeLightbox();if(!($("checkout-error"))){return}if($("checkout-error").innerHTML.indexOf(b)!=-1){return}var a=new Array();a[0]=b;displayMessages("checkout-error",a,"WARN",true)
}function viewPrintablePackagePage(a){if(a==""){return}openCenteredWindow(a,"printPackage",700,600,true,true)}function fixMissingChannelLogo(a){a.src="/images/channel_call_sign/GENERIC.gif";a.onerror="";return true}function createCookie(c,d,f){if(f){var b=new Date();b.setTime(b.getTime()+(f*24*60*60*1000));var a="; expires="+b.toGMTString()}else{var a=""}document.cookie=c+"="+d+a+"; path=/"}function readCookie(b){var f=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var g=a[d];
while(g.charAt(0)==" "){g=g.substring(1,g.length)}if(g.indexOf(f)==0){return g.substring(f.length,g.length)}}return null}function eraseCookie(a){createCookie(a,"",-1)}
/*
 transitions.js
 Based on Easing Equations v2.0
 (c) 2003 Robert Penner, all rights reserved.
 This work is subject to the terms in http://www.robertpenner.com/easing_terms_of_use.html
 Adapted for Scriptaculous by Ken Snyder (kendsnyder ~at~ gmail ~dot~ com) June 2006
 */
Effect.Transitions.easeFromTo=function(a){if((a/=0.5)<1){return 0.5*Math.pow(a,4)
}return -0.5*((a-=2)*Math.pow(a,3)-2)};Effect.Transitions.easeFrom=function(a){return Math.pow(a,4)};Effect.Transitions.easeTo=function(a){return Math.pow(a,0.25)};function pngFix(a){if(a&&Prototype.Browser.IE6){if(a.src.toLowerCase().indexOf(".png")>-1){a.style.width=a.getWidth()+"px";a.style.height=a.getHeight()+"px";a.style.background="none";a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a.src+"',sizingMethod='scale')";a.src="/images/spacer.gif"}}}Dtv.util={};Dtv.util.getStyleValue=function(a){if(!a){return 0
}return Object.isString(a)?a:(a+"px")};if($profile.loggers.globaljs){$profile.loggers.globaljs.stop()}function printContingencyWarningMessage(){var j=document.getElementsByTagName("body")[0];if(!document.cookie||document.cookie.indexOf("JSESSIONID")==-1){document.write('<div id="contingency_warn">You must enable cookies in order to use the directv.com web site.</div>')}else{if(!window.XMLHttpRequest&&document.cookie.indexOf("oldbrowser")==-1){var g=document.createElement("div");var h=document.createTextNode("Your browser is not optimized for DIRECTV.com. We have a few recommendations for improving your experience online. ");
var b=document.createElement("a");var f=document.createTextNode("Learn More");var a=document.createElement("span");a.setAttribute("class","btn-close-warning");a.className="btn-close-warning";a.setAttribute("title","Close");a.onclick=function(){var l=document.getElementById("contingency_warn");l.parentNode.removeChild(l);j.style.backgroundPosition="0 0";j.style.paddingTop="0";createCookie("oldbrowser","1")};g.setAttribute("id","contingency_warn");b.setAttribute("href","/DTVAPP/content/site_requirements");
b.setAttribute("title","System requirements for DIRECTV.com");b.appendChild(f);g.appendChild(h);g.appendChild(b);g.appendChild(a);j.insertBefore(g,j.firstChild)}else{return}}var d=$("contingency_warn");var c=13;var k=c+d.offsetHeight+parseInt(d.getStyle("margin-bottom"));j.style.backgroundPosition="0 "+k+"px";j.style.paddingTop=c+"px"}Dtv.behaviors.define({name:"CartNotification",selectors:"#global_header_notification",methods:{_init:function(){this.el.observeEvents({mouseenter:this.clearCloseTimeout.bind(this),mouseleave:this.setCloseTimeout.bind(this)}).appear();
this.setCloseTimeout()},clearCloseTimeout:function(){if(this._timeout){window.clearTimeout(this._timeout)}},setCloseTimeout:function(){this._timeout=window.setTimeout(this.close.bind(this),15000)},close:function(){this.el.fade()}}});Dtv.behaviors.define({name:"AjaxPanel",options:{timeout:true,url:null,overlay:null,formEl:null},methods:{refresh:function(b,a,d){b=b||this.url||this.options.url;this.url=b;a=a||{};a.onSuccess=c(this,a.onSuccess,this.onAjaxSuccess);a.onCancel=c(this,a.onCancel,this.onAjaxCancel);
a.onException=c(this,a.onException,this.onAjaxException);a.onComplete=c(this,a.onComplete,this.onAjaxComplete);if(!$defined(a.timeout)){a.timeout=this.options.timeout}if(this.options.overlay){this.showOverlay()}return new Ajax.Request(b,a);function c(f,h,g){if(d&&h){return h}return(h||Prototype.emptyFunction).wrap(function(l,k,j){g.call(f,k,j);l(k,j)})}},onAjaxSuccess:function(a){this.update(a.responseText)},onAjaxCancel:function(a){this.debug("Update request cancelled")},onAjaxException:function(a){this.debug(new Error("Update request exception: "+a.responseText))
},onAjaxComplete:function(a){if(this.options.overlay){this.hideOverlay()}},showOverlay:function(){if(Prototype.Browser.IE){try{$$("html").invoke("viewportOffset")}catch(a){}}this._overlayEl=new Element("div").appendTo(document.body).addClassName("ajax-panel-loading").setOpacity(0.8).clonePosition(this.el)},hideOverlay:function(){if(this._overlayEl){this._overlayEl.hide();this._overlayEl.remove();delete this._overlayEl}},update:function(b){try{var d=$el("div");d.update(b);var a=this.el.id?d.down("#"+this.el.id)||d:d;
this.el.update(a.innerHTML);Dtv.tealeaf.invoke("tlProcessNode",this.el);Dtv.behaviors.applyMappings(this.el);this._callInitMethods();if(Dtv.behaviors.BusinessInfoPop.updateConnectors){Dtv.behaviors.BusinessInfoPop.updateConnectors(this.el)}if(Dtv.behaviors.isCompiled("GenericRollover")&&Dtv.behaviors.GenericRollover.addRollovers){Dtv.behaviors.GenericRollover.addRollovers(this.el)}}catch(c){this.debug(c);throw c}},handleAction:function($super,b,a,c){switch(b){case"refresh":this.refresh(a.href);return true;
default:return $super(b,a,c)}}}});(function(){var a={ORIENTATION:{VERTICAL:"vertical",HORIZONTAL:"horizontal",AUTO:"auto"},EVENTS:{NAV_INDEX_CHANGED:"navIndexChanged",UPDATED:"updated"}};Dtv.behaviors.define({name:"NavigableList",consts:a,options:{endless:true,mouseWheelEnabled:true,orientation:a.ORIENTATION.AUTO,prevBtn:null,nextBtn:null,startNavIndex:0},methods:{_init:function(){this._container=this.el.up(0)},_initLayout:function(){this.update();this.el.style.position="relative";this.rootPositionedOffset=this._items[0].positionedOffset()
},_initEvents:function(){this.el.observeEvents({"DOMMouseScroll,mousewheel":function(b){Dtv.e=b;if(this.options.mouseWheelEnabled){switch(Event.mouseWheelDelta(b)){case 1:this.navigateToNext();b.stop();return false;case -1:this.navigateToPrevious();b.stop();return false}}}.bind(this)});if(this.options.prevBtn){this.options.prevBtn.observe("click",this.navigateToPrevious.bind(this))}if(this.options.nextBtn){this.options.nextBtn.observe("click",this.navigateToNext.bind(this))}},_initDefaultState:function(){if(this._items.length>0){if(!$chk(this.startNavIndex)){this.navigateToIndex(this.options.startNavIndex)
}}},update:function(){this._items=(this.el.tagName=="TABLE")?this.el.select("tr"):this.el.childElements();if(this._items.length==0){return}this._updateOrientation();this._updateCalculations();this._updateOverflow();this._updateButtons();this.fireEvent(a.EVENTS.UPDATED)},_updateOrientation:function(){if(this.options.orientation==a.ORIENTATION.AUTO){this.orientation=this._items[0].getStyle("float")=="none"||this._items[0].getStyle("clear")=="both"?a.ORIENTATION.VERTICAL:a.ORIENTATION.HORIZONTAL}else{this.orientation=this.options.orientation
}},_updateButtons:function(){var b=this.getIndexCount()>1?"enable":"disable";if(this.options.prevBtn){$el[b](this.options.prevBtn)}if(this.options.nextBtn){$el[b](this.options.nextBtn)}},_updateCalculations:function(){var h=0,d,b,g,j=1,f;switch(this.orientation){case a.ORIENTATION.HORIZONTAL:b=$el.getInnerWidth(this._container);g=this._items.length;this._items.forEach(function(l,k){d=h;h+=l.getOuterWidth();if(h>b){g=k;f=b-d-$el.getStyleAsInt(l,"marginLeft");return true}});break;case a.ORIENTATION.VERTICAL:maxH=this._container.getInnerHeight();
maxW=this._container.getInnerWidth();var c=this._items;c.forEach(function(l,k){d=h;h+=l.getOuterHeight();if(h>maxH){g=(k==0)?1:k;f=maxH-d+$el.getStyleAsInt(l,"marginBottom");var m=0;c.forEach(function(o,n){m+=o.getOuterWidth();if(m>maxW){j=(n==0)?1:n;g*=n;return true}});return true}});break}this._visibleCount=this.options.visibleCount||g;this._visibleCols=j;this._visibleBleed=f},_updateOverflow:function(){var c=0;switch(this.orientation){case a.ORIENTATION.HORIZONTAL:this._items.each(function(d){c+=d.getOuterWidth()
});c+=(this._items[0].getOuterWidth()*2);var b=Math.max(c,this._container.getWidth());if(b>0){this.el.setStyle({width:b+"px"})}break;case a.ORIENTATION.VERTICAL:this.orientation=a.ORIENTATION.VERTICAL;break}},getNavItem:function(b){var b=$chk(b)?b:this.getNavIndex();if(b>=0){return this._items[b]}return null},getItemOffset:function(c){var b=(this.orientation==this.ORIENTATION.HORIZONTAL)?0:1;if(c>=this._items.length){c=(this._items.length-1)}if(this.options.cacheOffsets){if(!this._offsetCache){this._offsetCache=[this._items.length]
}else{if(this._offsetCache[c]){return this._offsetCache[c]}}}var d=this._items[c].positionedOffset()[b]-this.rootPositionedOffset[b];if(this.options.cacheOffsets){this._offsetCache[c]=d}return d},isAtEnd:function(){return this.getNavIndex()>=this.getIndexCount()-1},getIndexCount:function(){throw"abstract method 'getIndexCount' is not implemented"},getNavIndex:function(){return this._navIndex},_setNavIndex:function(b){this._navIndex=b},navigateToIndex:function(b){if(b>=this._items.length){b=this._items.length-1
}var c=this.getNavIndex();if(c==b){return false}this._setNavIndex(b);this.fireEvent(a.EVENTS.NAV_INDEX_CHANGED,{itemIndex:b,prevIndex:c});return true},navigateToFirst:function(){return this.navigateToIndex(0)},navigateToLast:function(){return this.navigateToIndex(this.getIndexCount()-1)},navigateToNext:function(){if(!this.isAtEnd()){this.navigateToIndex(this.getNavIndex()+1)}else{if(this.options.endless){this.navigateToIndex(0)}else{return false}}return true},navigateToPrevious:function(){var b=this.getNavIndex();
if(b>0){this.navigateToIndex(b-1)}else{if(this.options.endless){this.navigateToIndex(this.getIndexCount()-1)}else{return false}}return true}}});Dtv.behaviors.define({name:"ScrollableList",inherits:Dtv.behaviors.NavigableList,options:{endless:false,maxEffectDuration:0.8,transition:Effect.Transitions.sinoidal,alignToEnd:true},methods:{getIndexCount:function(){this._indexCount=Math.ceil((this._items.length/this._visibleCols)-(this._visibleCount/this._visibleCols)+1);return this._indexCount},getNavOffset:function(b){var c=this.getItemOffset(b*this._visibleCols);
if(b>0&&this.options.alignToEnd){c-=this._visibleBleed}return c},navigateToIndex:function($super,c,f,h,g){var d=this.getNavIndex();var b=$super(c);if(!$chk(f)){f=this.getNavOffset(c)}this._slideToOffset(f,c,d,h,g);return b},_slideToOffset:function(f,b,d,h,g){var c=(this.orientation==this.ORIENTATION.HORIZONTAL?"left":"top")+":"+(f*-1)+"px;";if(!g&&(this.options.effectDuration>0||this.options.maxEffectDuration>0)){if(this._currentFx){this._currentFx.cancel()}this._currentFx=new Effect.Morph(this.el,{style:c,transition:this.options.transition,duration:this._calculateEffectDuration(b,d,this._items.length),afterFinish:h})
}else{this.el.setStyle(c);if(h){h()}}},_calculateEffectDuration:function(d,c,b){if(this.options.effectDuration){return this.options.effectDuration}return this.options.maxEffectDuration*(Math.abs((c||0)-d)/b)}}})})();(function(){var a={EFFECT:{FADE:"fade",SLIDE:"slide",NONE:"none"}};Dtv.behaviors.define({name:"GroupedList",inherits:Dtv.behaviors.NavigableList,selectors:".js-GroupedList",consts:a,options:{endless:true,effect:a.EFFECT.SLIDE,effectDuration:0.8,transition:Effect.Transitions.easeFromTo,mouseWheelEnabled:false},methods:{navigateToIndex:function($super,b){if($super(b)){switch(this.options.effect){case a.EFFECT.SLIDE:this.slideToGroup(b);
break;case a.EFFECT.FADE:this.fadeToGroup(b);break;default:this.showGroup(b);break}}},update:function($super){this._groups=null;$super()},getIndexCount:function(){if(!this._groups){this._groups=this._items.inGroupsOf(this._visibleCount)}return this._groups.length},getGroupIndex:function(b){return Math.floor(b/(this._visibleCount*this._visibleCols))},slideToGroup:function(b){this.slideToItem(b*this._visibleCount)},slideToItem:function(b){var c=this.getItemOffset(b);if(this._currentFx){this._currentFx.cancel()
}this._currentFx=new Effect.Morph(this.el,{style:(this.orientation==this.ORIENTATION.HORIZONTAL?"left":"top")+":"+(c*-1)+"px;",transition:this.options.transition,duration:this.options.effectDuration})},fadeToGroup:function(b){throw"_fadeToGroup() not implemented yet."},showGroup:function(b){this._items.each(function(d,c){this.getGroupIndex(c)==b?d.show():d.hide()}.bind(this))}}});Dtv.behaviors.define({name:"GroupedListPager",options:{list:null},methods:{_init:function(){if(!this.options.list){throw"GroupedListPager must be initialized with a valid list option value."
}},_initLayout:function(){this._containerDiv=$el("<div></div>").appendTo(this.el);this._prevSpan=$el("<span class='prev-page'></span>").appendTo(this._containerDiv);this._pagesList=$el("<ul></ul>").appendTo(this._containerDiv);this._nextSpan=$el("<span class='next-page'></span>").appendTo(this._containerDiv);this.update()},_initEvents:function(){this.options.list.bindEvent(Dtv.behaviors.GroupedList.EVENTS.NAV_INDEX_CHANGED,this.update.bind(this));this._prevSpan.observe("click",this.options.list.navigateToPrevious.bind(this.options.list));
this._nextSpan.observe("click",this.options.list.navigateToNext.bind(this.options.list))},getPageCount:function(){return this.options.list.getIndexCount()},getActiveIndex:function(){return this.options.list.getNavIndex()},update:function(){var b=this.getPageCount();if(b<2){this.el.hide();return}this.el.show();if(!this._items||this._items.length!=this.getPageCount()){if(this._items){this._pagesList.update()}this._items=[];var d=this.options.list;for(var c=0;c<b;c++){this._items.push($el("<li></li>"));
this._items[c].observe("click",function(){d.navigateToIndex(this.getSiblingIndex())}).appendTo(this._pagesList)}}else{this._items.invoke("removeClassName","active")}this._items[this.getActiveIndex()].addClassName("active");this._updateContainerWidth()},_updateContainerWidth:function(){var b=0;this._containerDiv.childElements().each(function(c){b+=c.getOuterWidth()});this._containerDiv.setStyle({width:b+"px"})}}})})();
/*
// accordion.js v2.0
//
// Copyright (c) 2007 stickmanlabs
// Author: Kevin P Miller | http://www.stickmanlabs.com
//
// Accordion is freely distributable under the terms of an MIT-style license.
//
// I don't care what you think about the file size...
//   Be a pro:
//      http://www.thinkvitamin.com/features/webapps/serving-javascript-fast
//      http://rakaz.nl/item/make_your_pages_load_faster_by_combining_and_compressing_javascript_and_css_files
//
*/
if(typeof Effect=="undefined"){throw ("accordion.js requires including script.aculo.us' effects.js library!")
}var accordion=Class.create();accordion.prototype={showAccordion:null,currentAccordion:null,duration:null,effects:[],animating:false,initialize:function(b,c){b=$(b);if(!b){throw (b.identify()+" doesn't exist!");return false}this.options=Object.extend({resizeSpeed:8,classNames:{toggle:"accordion_toggle",toggleActive:"accordion_toggle_active",content:"accordion_content"},defaultSize:{height:null,width:null},direction:"vertical",onEvent:"click"},c||{});this.duration=((11-this.options.resizeSpeed)*0.15);
var a=$(b).select("."+this.options.classNames.toggle);a.each(function(d){Event.observe(d,this.options.onEvent,this.activate.bind(this,d),false);if(this.options.onEvent=="click"){d.onclick=function(){return false}}if(this.options.direction=="horizontal"){var f={width:"0px"}}else{var f={height:"0px"}}Object.extend(f,{display:"none"});this.currentAccordion=$(d.next(0)).setStyle(f)}.bind(this))},activate:function(a){if(this.animating){return false}this.effects=[];this.currentAccordion=$(a.next(0));this.currentAccordion.setStyle({display:"block",overflow:"hidden"});
this.currentAccordion.previous(0).addClassName(this.options.classNames.toggleActive);if(this.options.direction=="horizontal"){this.scaling={scaleX:true,scaleY:false}}else{this.scaling={scaleX:false,scaleY:true}}if(this.currentAccordion==this.showAccordion){this.deactivate()}else{this._handleAccordion()}},deactivate:function(){var a={duration:this.duration,scaleContent:false,transition:Effect.Transitions.sinoidal,queue:{position:"end",scope:"accordionAnimation"},scaleMode:{originalHeight:this.options.defaultSize.height?this.options.defaultSize.height:this.currentAccordion.scrollHeight,originalWidth:this.options.defaultSize.width?this.options.defaultSize.width:this.currentAccordion.scrollWidth},afterFinish:function(){if(this.showAccordion){this.showAccordion.setStyle({height:"0px",display:"none"})
}this.showAccordion=null;this.animating=false}.bind(this)};Object.extend(a,this.scaling||{});this.showAccordion.previous(0).removeClassName(this.options.classNames.toggleActive);new Effect.Scale(this.showAccordion,0,a);closeTooltipsByDiv(this.showAccordion)},_handleAccordion:function(){var a={sync:true,scaleFrom:0,scaleContent:false,transition:Effect.Transitions.sinoidal,scaleMode:{originalHeight:this.options.defaultSize.height?this.options.defaultSize.height:this.currentAccordion.scrollHeight,originalWidth:this.options.defaultSize.width?this.options.defaultSize.width:this.currentAccordion.scrollWidth}};
Object.extend(a,this.scaling||{});this.effects.push(new Effect.Scale(this.currentAccordion,100,a));if(this.showAccordion){this.showAccordion.previous(0).removeClassName(this.options.classNames.toggleActive);a={sync:true,scaleContent:false,transition:Effect.Transitions.sinoidal};Object.extend(a,this.scaling||{});this.effects.push(new Effect.Scale(this.showAccordion,0,a))}new Effect.Parallel(this.effects,{duration:this.duration,queue:{position:"end",scope:"accordionAnimation"},beforeStart:function(){this.animating=true;
if(this.showAccordion){closeTooltipsByDiv(this.showAccordion);$(this.showAccordion).setStyle({overflow:"hidden"})}}.bind(this),afterFinish:function(){if(this.showAccordion){this.showAccordion.setStyle({display:"none"})}$(this.currentAccordion).setStyle({height:"100%",overflow:"visible"});this.showAccordion=this.currentAccordion;this.animating=false;$(this.currentAccordion).fire($consts(Dtv.behaviors.Accordion).EVENTS.ACCORDION_OPENED)}.bind(this)})}};(function(){var a={EVENTS:{ACCORDION_OPENED:"dtv:accordionOpened"}};
Dtv.behaviors.define({name:"Accordion",consts:a,options:{classNames:{toggle:"js-accordion-toggle",toggleActive:"active",content:"js-accordion-content"},direction:"vertical"},selectors:{expr:".js-accordion",test:function(){var b=document.location.href.toLowerCase();return(b.indexOf("/content/")!=-1||b.indexOf("/gogreen/")!=-1||b.indexOf("/login/")!=-1||b.indexOf("/mydirectv/account/")!=-1||b.indexOf("/mydirectv/checkout/")!=-1||b.indexOf("/new_customer/")!=-1||b.indexOf("/register/")!=-1||b.indexOf(":7001")!=-1)
}},methods:{_init:function(){this.accordion=new accordion(this.el,this.options)},_initDefaultState:function(){var b=this.el.select("."+this.options.classNames.toggle).each(function(c){if(c.match("."+this.options.classNames.toggleActive)){this.accordion.activate(c)}},this)}}})})();(function(){function a(b){if(b<2){return new Element("div")}var d=new Element("ul");for(var c=0;c<b;c++){d.insert("<li>&nbsp;</li>")}return new Element("div").addClassName("pagination").setStyle({width:(b*18)+"px"}).insert(d)
}Dtv.behaviors.define({name:"Carousel",options:{expandOnSelect:false,transition:Effect.Transitions.easeFromTo},methods:{_init:function(){this._vertScroller=this.el.first(".content");this._tabs=Object.extend([],{labels:this.el.select(".tabs li"),contents:this.el.select(".items .content>div")});this._tabs.labels.each(function(j,k){var h=this._tabs.contents[k],d=h.select("li"),f=0;if(d.length==0){j.hide()}else{if(!this._settings){var c=d[0].getWidth();this._settings={itemWidth:c,itemInnerWidth:d[0].getStyle("width"),pageSize:Math.round(this._vertScroller.getWidth()/c),textLength:Math.floor(c/8)}
}f=Math.ceil(d.length/this._settings.pageSize);for(var g=this._settings.pageSize-1,b=d.length;g<b;g+=this._settings.pageSize){d[g].addClassName("last")}d[d.length-1].addClassName("last");h.down(0).setStyle({width:(f+1)+"00%"})}this._tabs.push({labelEl:j,contentEl:h,index:k,pagerEl:f>1?a(f).appendTo(h):null,pageCount:f})}.bind(this))},_initLayout:function(){this.el.select(".left, .right").invoke("insert","<a>&nbsp;</a>");this.el.select(".content>div>ul>li").each(function(b,d){var c=b.select("h4")[0];
if(c.innerHTML.length>this._settings.textLength){b.insert(new Element("h5").update(c.innerHTML));c.innerHTML=c.innerHTML.truncate(this._settings.textLength)}}.bind(this));this.disableTextSelection()},_initEvents:function(){var b=this;this._tabs.labels.invoke("observeEvents",{click:function(c){b.selectTab(this.getSiblingIndex());c.stop()}});this.el.select(".pagination li").invoke("observeEvents",{mouseover:function(){if(!this.hasClassName("selected")){this.addClassName("hover")}},mouseout:function(){this.removeClassName("hover")
},click:function(){b.selectPage(this.getSiblingIndex())}});this.el.select(".content>div>ul>li").invoke("observeEvents",{mouseover:function(f){var c=this.select("h5");if(c.length==1){this.select("h4")[0].hide();c[0].setStyle({display:"block"})}var d=this.first("p");if(d){d.setStyle({visibility:"visible",top:"-"+d.getHeight()+"px"})}},mouseout:function(d){var c=this.select("h5");if(c.length==1){this.select("h4")[0].show();c[0].setStyle({display:"none"})}this.select("p").invoke("setStyle",{visibility:"hidden"})
},click:function(){b.selectItem(this.getSiblingIndex())}});this.el.select(".left, .right").invoke("observeEvents",{mouseover:function(){this.first("a").addClassName("hover")},mouseout:function(){this.first("a").removeClassName("hover")},mousedown:function(){this.first("a").addClassName("down")},mouseup:function(){this.first("a").removeClassName("down")},click:function(){var c,d=b.currentTab;if(this.hasClassName("left")){c=d.currentPage==0?d.pageCount-1:d.currentPage-1}else{c=d.currentPage==d.pageCount-1?0:d.currentPage+1
}b.selectPage(c)}})},_initDefaultState:function(){this.selectTab(0)},selectTab:function(b){if(this._tabs.length==0){return null}if(this.currentTab){this.unselectItem();if(this.currentTab.index==b){return this}else{this.currentTab.labelEl.removeClassName("selected")}}this.currentTab=this._tabs[b];this.currentTab.labelEl.addClassName("selected");var c=this._tabs.contents[b].positionedOffset()[1]-this._tabs.contents[0].positionedOffset()[1];this._vertScroller.morph("",{style:{left:"0px",top:(c*-1)+"px"},transition:this.options.transition});
this.selectPage(this.currentTab.currentPage||0);if(this.currentTab.pageCount<2){this.el.select(".left a, .right a").invoke("fade",{duration:0.4})}else{this.el.select(".left a, .right a").invoke("appear",{duration:0.4})}this.fireEvent("tabactivated");return this},selectPage:function(b,c){if(!c){this.unselectItem()}if(this.currentTab.pagerEl){var d=this.currentTab.pagerEl.select("li");if(this.currentTab.currentPage>-1&&this.currentTab.currentPage!=b){d[this.currentTab.currentPage].removeClassName("selected")
}d[b].addClassName("selected").removeClassName("hover")}this.currentTab.contentEl.down(0).morph("",{style:{left:((this._settings.itemWidth*this._settings.pageSize)*b)*-1+"px"},transition:this.options.transition});if(this.currentTab.currentPage!=b){this.currentTab.currentPage=b;this.fireEvent("pageactivated")}return this},selectItem:function(b){var c;if(Object.isElement(b)){c=b;b=c.getSiblingIndex();this.selectTab(c.up(1).getSiblingIndex())}else{c=this.currentTab.contentEl.down(0).childElements()[b]
}this.selectPage(Math.floor(b/this._settings.pageSize),true);if(this.unselectItem(c)!=c){c.addClassName("selected");if(this.options.expandOnSelect){this.currentTab.contentEl.down(0).morph("",{style:{left:(this._settings.itemWidth*b)*-1+"px"},transition:this.options.transition});c.morph("",{style:{width:"620px"},transition:this.transition});if(this.currentTab.pagerEl){this.currentTab.pagerEl.fade({duration:0.4})}}this.fireEvent(EVENT_CAROUSEL_ITEM_SELECTED,{item:c});this.currentItem=c}return this},unselectItem:function(b){var c=this.currentItem;
if(c){c.removeClassName("selected");if(!b||b==c){this.fireEvent(EVENT_CAROUSEL_ITEM_UNSELECTED,{item:c});if(this.currentTab.pagerEl&&this.expandOnSelect){this.currentTab.pagerEl.appear({duration:0.4})}}if(this.options.expandOnSelect){c.morph("",{style:{width:this._settings.itemInnerWidth},transition:this.options.transition});this.selectPage(this.currentTab.currentPage,true)}this.currentItem=null}return c}}});Dtv.behaviors.define({name:"ListingCarousel",inherits:"Carousel",selectors:{expr:".js-carousel",test:function(){var b=document.location.href.toLowerCase();
return(b.indexOf("/listing/")!=-1)}},methods:{_initDefaultState:function(){var c=window.location.getParam("expandId");var f=window.location.getParam("carousel");if(c&&f){var d=this.el.first(".content li[id$='"+c+"']");if(d){this.selectItem(d);var b=window.location.getParam("tab");if(b){$("listing_carousel_details_tup").observe($consts(Dtv.behaviors.ExpandableRow).EVENTS.EXPANDABLE_ROW_EXPANDED,function(){$(b+"_tab_"+c).fire($consts(Dtv.behaviors.CollapsibleTab).EVENTS.COLLAPSIBLE_TAB_ACTIVATE);$("listing_carousel_details_tup").stopObserving($consts(Dtv.behaviors.ExpandableRow).EVENTS.EXPANDABLE_ROW_EXPANDED)
})}return}}this.selectTab(0)},_initEvents:function($super){$super();this.bindEvents({itemselected:function(b){$(b.memo.item).fire($consts(Dtv.behaviors.ExpandableRow).EVENTS.EXPANDABLE_ROW_ACTIVATE)},itemunselected:function(b){$(b.memo.item).fire($consts(Dtv.behaviors.ExpandableRow).EVENTS.EXPANDABLE_ROW_DEACTIVATE)}})}}})})();(function(){var d={EVENTS:{COLLAPSIBLE_TAB_ACTIVATE:"dtv:collapsibleTabActivate",COLLAPSIBLE_TAB_CLOSED:"dtv:collapsibleTabClosed",COLLAPSIBLE_TAB_OPENED:"dtv:collapsibleTabOpened"}};
var g="js-collapsible-tab-title";var c="collapsible-tab-title-active";var f="js-collapsible-tab-content";var a="js-collapsible-tab-close";var b="js-tab-always-open";var h=0.5;Dtv.behaviors.define({name:"CollapsibleTab",consts:d,selectors:{expr:".js-collapsible-tabs",test:function(){var j=document.location.href.toLowerCase();return(j.indexOf("/content/")!=-1||j.indexOf("/wizard/")!=-1||j.indexOf("/cep/")!=-1||j.indexOf("/listing/")!=-1)}},methods:{_init:function(){this._activeTab=null;this._tabOpeners=this.el.select("."+g);
this._tabContents=this.el.select("."+f);this._closeLinks=this.el.select("."+a);$log("Collapsible tab initialized")},_initEvents:function(){var j=this;this._tabOpeners.invoke("observeEvents",{click:function(k){j.activate(this)},"dtv:collapsibleTabActivate":function(k){j.activate(this)}});this._closeLinks.invoke("observeEvents",{click:function(k){j._close(this)}})},_initDefaultState:function(){var j=this.el.select("."+c);if(j.length>0){this.activate(j[0])}},activate:function(j){if(this._activeTab==j){if(!this.el.hasClassName(b)){this._deactivate(true);
this._activeTab=null}return}this._deactivate(false);j.addClassName(c);var k=this._tabContents[this._tabIndex(j)];if(!this._activeTab){k.appear({duration:h})}else{k.show()}this._activeTab=j;this._activeTab.fire(d.EVENTS.COLLAPSIBLE_TAB_OPENED)},_deactivate:function(j){if(!this._activeTab){return}var k=this._tabContents[this._tabIndex(this._activeTab)];if(k.visible()){closeTooltipsByDiv(k);if(j){k.fade({duration:h})}else{k.hide()}}this._activeTab.removeClassName(c);this._activeTab.fire(d.EVENTS.COLLAPSIBLE_TAB_CLOSED)
},_close:function(j){this._deactivate(true)},_tabIndex:function(k){var j=0;this._tabOpeners.each(function(m,l){if(m==k){j=l}});return j}}})})();(function(){var a={EVENTS:{EXPANDABLE_ROW_CONTRACTED:"dtv:expandableRowContracted",EXPANDABLE_ROW_EXPANDED:"dtv:expandableRowExpanded",EXPANDABLE_ROW_ACTIVATE:"dtv:expandableRowActivate",EXPANDABLE_ROW_DEACTIVATE:"dtv:expandableRowDeactivate"}};Dtv.behaviors.define({name:"ExpandableRow",consts:a,selectors:{expr:".js-expandable-row",test:function(){var b=document.location.href.toLowerCase();
return(b.indexOf("/listing/")!=-1||b.indexOf("/compare/")!=-1)}},options:{closeClassName:"",closeDuration:0.2,closeEvents:["click"],closeHandler:Prototype.emptyFunction,openDuration:0.7,openEvents:["click"],openHandler:Prototype.emptyFunction,processingMessage:_PROCESSING_NOTIFICATION_DIV},methods:{_init:function(){this.openers=new Array();this.targetObj=this.el;this.activeOpenerId=null;this.ajaxRequestCount=0},_initEvents:function(){this.expandObserver=this.expand.bind(this);this.collapseObserver=this.collapse.bind(this)
},setOptions:function(b){Object.extend(this.options,b||{})},addOpener:function(b,c){b=$(b);this.openers[b.identify()]=c;this.options.openEvents.each(function(d){b.observe(d,this.expandObserver)},this)},expand:function(b){openerObj=Event.element(b);while(openerObj){if(openerObj.id&&this.openers[openerObj.id]){if(this.activeOpenerId&&this.activeOpenerId!=openerObj.id){this._toggleClosed()}this.activeOpenerId=openerObj.id;this._toggleOpened();break}openerObj=openerObj.up()}if(!openerObj){$log("DtvExpandableRow.expand could not find a valid opener.");
return}if(this.targetObj.tagName=="TR"){this.targetObj.down("td").update();this.targetObj.down("td").setStyle({height:"auto"})}else{this.targetObj.update();this.targetObj.setStyle({height:"auto"})}var c=new Element("div");if(this.targetObj.tagName=="TR"){this.targetObj.down("td").insert(c)}else{this.targetObj.insert(c)}appearContent(this.targetObj,this.options.processingMessage,"js_listing_processing");openerActions=this.openers[openerObj.id];if(openerActions.openerAjaxUrl){this._loadAjaxUrlExpandContent(openerActions.openerParams,openerActions.openerAjaxUrl)
}else{this._loadExpandContent($(openerActions.openerDiv).innerHTML)}},collapse:function(){this._toggleClosed();var b=this.targetObj.down("div");if(!($(b))){return}closeTooltipsByDiv(this.targetObj);$(b).fade({duration:this.options.closeDuration,afterFinish:this._collapseCleanup.bind(this)})},_collapseCleanup:function(){var b=this.targetObj.down("div");if(b){b.remove()}this.targetObj.hide();this.targetObj.fire(a.EVENTS.EXPANDABLE_ROW_CONTRACTED);this.activeOpenerId=null},_loadAjaxUrlExpandContent:function(c,b){var d={method:"post",parameters:c,onComplete:this._loadAjaxUrlContentComplete.bind(this)};
new Ajax.Request(b,d);this.ajaxRequestCount++},_loadAjaxUrlContentComplete:function(b,c){this.ajaxRequestCount--;if(this.ajaxRequestCount!=0){return}var d=this.targetObj.down("div");if(!d){return}if(b.status<200||b.status>300){d.update(_LISTING_FAILURE_MESSAGE);return}this._loadExpandContent(b.responseText)},_loadExpandContent:function(d){var b=this.targetObj.down("div.js_listing_processing");if(b){b.remove()}var c={duration:this.options.openDuration,afterFinish:Event.fire.curry(this.targetObj,a.EVENTS.EXPANDABLE_ROW_EXPANDED)};
appearContent(this.targetObj,d,"js_listing_content",c);if(this.options.closeClassName){this.targetObj.select("."+this.options.closeClassName).each(function(f){this.options.closeEvents.each(function(g){f.observe(g,this.collapseObserver)},this)},this)}},_toggleClosed:function(){this._toggleState(this.collapseObserver,this.expandObserver,this.options.closeHandler,this.options.closeEvents,this.options.openEvents);if(this.options.closeClassName){this.targetObj.select("."+this.options.closeClassName).each(function(b){this.options.closeEvents.each(function(c){b.stopObserving(c,this.collapseObserver)
},this)},this)}},_toggleOpened:function(){this._toggleState(this.expandObserver,this.collapseObserver,this.options.openHandler,this.options.openEvents,this.options.closeEvents)},_toggleState:function(g,d,c,h,f){var b=$(this.activeOpenerId);if(!b){return}h.each(function(j){b.stopObserving(j,g)});f.each(function(j){b.observe(j,d)});if(c){c(b)}}}})})();(function(){Dtv.behaviors.define({name:"MediaPlayer",selectors:{expr:".js-mediaplayer",test:Dtv.behaviors.utils.isContentPage},options:{initialTrackIndex:0,endless:false,delayInterval:5,autoCreateSwf:true},consts:{OPTIONS:{AUTOPLAY:"autoplay",BG_IMG_URL:"backgroundImageUrl",DELAY_INTERVAL:"delayInterval",INITIAL_TRACK_INDEX:"initialTrackIndex"},URLS:{SWF:"/resources/flash/dtvMediaPlayer.swf"},EVENTS:{FLASH:{PREV_MEDIA:"prevMedia",NEXT_MEDIA:"nextMedia",LEARN_MORE:"learnMore",ERROR:"error",DEBUG:"debug"},JS:{SWF_DOM_READY:"swfdomready",TRACK_CHANGED:"trackchanged",PLAYLIST_DATA_CHANGED:"playlistdatachanged"}},STATUS:{PLAYING:"playingStatus"}},methods:{_init:function(){this._initServerOptions();
if(this.options.autoCreateSwf){this.createSwfObj()}},_initServerOptions:function(){var a=this.el.getVar(this.OPTIONS.AUTOPLAY);if(a){this.setOption(this.OPTIONS.AUTOPLAY,a=="true")}a=this.el.getVar(this.OPTIONS.BG_IMG_URL);if(a){this.setOption(this.OPTIONS.BG_IMG_URL,a)}a=parseInt(this.el.getVar(this.OPTIONS.INITIAL_TRACK_INDEX),10);if(!isNaN(a)){this.setOption(this.OPTIONS.INITIAL_TRACK_INDEX,a)}},createSwfObj:function(){if(!this.getSwfObj()){var d=this.el.first(".js-flash");if(d){var c=$el("div").appendTo(d);
this.swfObj=swfobject.createSWF({data:this.URLS.SWF+(Prototype.Browser.IE?("?rdm="+new Date().getTime()):""),width:d.style.width,height:d.style.height},{flashvars:"devmode=0&width="+d.style.width+"&height="+d.style.height+"&theme="+this.options.theme,wmode:"transparent",allowscriptaccess:"always"},c.identify());this.debug("Flash object created")}else{this.debug("Flash Object could not be created");return false}}this.swfObj.bindEvent=function(f,g){if(!Dtv.flashMethods){Dtv.flashMethods=[]}Dtv.flashMethods.push(g);
this.addEventListener(f,"Dtv.flashMethods["+(Dtv.flashMethods.length-1)+"]");return this};this.isSwfDomReady=false;var a=this;(function b(){if(a.swfObj.loadMedia){a._onSwfDomReady()}else{b.delay(0.5)}})();return true},destroySwfObj:function(){this.swfObj=null;this.el.first(".js-flash").update()},getSwfObj:function(){return this.swfObj},_onSwfDomReady:function(){this.isSwfDomReady=true;this.fireEvent(this.EVENTS.JS.SWF_DOM_READY);this.swfObj.bindEvent(this.EVENTS.FLASH.PREV_MEDIA,this.previousTrack.bind(this)).bindEvent(this.EVENTS.FLASH.NEXT_MEDIA,this.nextTrack.bind(this)).bindEvent(this.EVENTS.FLASH.LEARN_MORE,this.gotoMoreInfo.bind(this));
if(Dtv.debugEnabled){this.swfObj.bindEvent(this.EVENTS.FLASH.DEBUG,this._onFlashDebug.bind(this)).bindEvent(this.EVENTS.FLASH.ERROR,this._onFlashError.bind(this))}var a=this.getOption(this.OPTIONS.INITIAL_TRACK_INDEX);if($chk(a)){this.setPlaylistTrack.bind(this,a,this.getOption(this.OPTIONS.AUTOPLAY)).defer()}},setPlaylistTrack:function(a,f){try{if(!$defined(a)){throw"ndx must be defined"}if(!this.swfObj){this.createSwfObj()}if(!this.isSwfDomReady){this.debug("Waiting for Swf DOM to be ready before setting playlist track");
this.setOption(this.OPTIONS.INITIAL_TRACK_INDEX,a);this.setOption(this.OPTIONS.AUTOPLAY,f);return null}if(this.currentTrack!=a&&this.getPlaylistData().length>0){if(this.playlistData.length<=a||a<0){throw"ndx out of range"}this.currentTrack=a;var c=this.playlistData[a];c.prevEnabled=this.options.endless||a>0;c.nextEnabled=this.options.endless||a<this.playlistData.length-1;var b=this.getOption(this.OPTIONS.DELAY_INTERVAL);this.swfObj[f?"playMedia":"loadMedia"](c);this.options.autoPlay=true;this.fireEvent(this.EVENTS.JS.TRACK_CHANGED);
return true}else{if(f&&!this.swfObj.isPlaying()){this.swfObj.playMedia();return true}}return false}catch(d){this.debug(d);return false}},playTrack:function(a){this.debug("playing track: "+a);return this.setPlaylistTrack($chk(a)?a:this.currentTrack||0,true)},pauseTrack:function(){this.swfObj.pauseMedia()},nextTrack:function(){this.debug("next track called");if(this.getPlaylistData().length>0){ndx=this.currentTrack||0;if(ndx<this.playlistData.length-1){return this.playTrack(ndx+1)}else{if(this.options.endless){return this.playTrack(0)
}}}return false},previousTrack:function(){this.debug("previous track called");if(this.getPlaylistData().length>0){ndx=this.currentTrack||0;if(ndx>0){return this.playTrack(ndx-1)}else{if(this.options.endless){return this.playTrack(this.playlistData.length-1)}}}return false},loadPlaylistData:function(a){a=a||this.el;var b={videoUrl:a.getVar("videoUrl"),imageUrl:a.getVar("imageUrl"),title:a.getVar("title"),blurb:a.getVar("description"),linkText:a.getVar("linkText"),linkUrl:a.getVar("linkUrl"),bgImageUrl:this.getOption(this.OPTIONS.BG_IMG_URL)||""};
return b.videoUrl||b.imageUrl?[b]:[]},getPlaylistData:function(){if(!this.playlistData){this.playlistData=this.loadPlaylistData()}return this.playlistData},setPlaylistData:function(c,b){c=Object.isArray(c)?c:c!=null?[c]:[];var d=-1;if(!b){this.currentTrack=null;this.playlistData=c;if(c.length>0){d=0}}else{this.playlistData=this.playlistData||[];var a=this.playlistData.length;this.playlistData=this.playlistData.concat(c);if(c.length>0){d=a}}this.fireEvent(this.EVENTS.JS.PLAYLIST_DATA_CHANGED);return d
},isPlaying:function(){return this.isSwfDomReady&&this.swfObj.getStatus()==this.STATUS.PLAYING},gotoMoreInfo:function(){window.location.href=this.playlistData[this.currentTrack].linkUrl},_onFlashError:function(a,c,b){this.debug(b,"!!FLASH ERROR")},_onFlashDebug:function(a,c,b){this.debug(b,"FLASH DEBUG")}}});Dtv.behaviors.define({name:"MediaJukebox",selectors:{expr:".js-mediajukebox",test:Dtv.behaviors.utils.isContentPage},options:{},inherits:Dtv.behaviors.MediaPlayer,methods:{_initLayout:function(){this._groupedList=this.el.first(".playlist ul").behavior(Dtv.behaviors.GroupedList,{effect:$consts(Dtv.behaviors.GroupedList).EFFECT.SLIDE});
this._groupedList.navigateToIndex(this._groupedList.getGroupIndex(this.options.initialTrackIndex||0));this._selectionList=this._groupedList.el.behavior(Dtv.behaviors.SelectionList,{initialSelections:this.options.initialTrackIndex||this.options.initialTrackIndex==0?[this.options.initialTrackIndex]:[],selectionRequired:true});this._pager=this.el.first(".pagination").behavior(Dtv.behaviors.GroupedListPager,{list:this._groupedList})},_initEvents:function(){this._selectionList.bindEvent(Dtv.behaviors.SelectionList.EVENTS.ITEM_SELECTED,this._onItemSelected.bind(this));
this.bindEvent(this.EVENTS.JS.TRACK_CHANGED,this._onTrackChanged.bind(this))},_onTrackChanged:function(a){this._selectionList.selectItem(this.currentTrack)},_onItemSelected:function(b){var a=this._groupedList.getGroupIndex(b.memo.itemIndex);if(a!=this._groupedList.getNavIndex()){this._groupedList.navigateToIndex(a)}if(this.currentTrack!=b.memo.itemIndex){this.playTrack(b.memo.itemIndex)}},loadPlaylistData:function(a){a=a||this.el;var c=[];var d=this.getOption(this.OPTIONS.BG_IMG_URL);var b=parseInt(this.el.getVar(this.OPTIONS.DELAY_INTERVAL),10);
if(isNaN(b)){b=this.getOption(this.OPTIONS.DELAY_INTERVAL)}a.select(".playlist ul li").each(function(f,g){c.push({videoUrl:f.getVar("videoUrl"),imageUrl:f.getVar("imageUrl"),title:f.first("h4","innerHTML"),blurb:f.getVar("description"),linkText:f.getVar("linkText")||null,linkUrl:f.getVar("linkUrl")||null,bgImageUrl:f.getVar(this.OPTIONS.BG_IMG_URL)||d,delayInterval:b})}.bind(this));return c}}})})();(function(){var g="js_processing";var n="js_processing_timeout";var m="js_processing_hidden";var k="processing_status";
var j="cep-btn-gray";function d(o){if(o==null){return}o.inactive=new Function();o.inactive.onclick=o.onclick;o.onclick=function(){return false}}function b(o){if(o==null){return}o.inactive=new Function();o.inactive.onsubmit=o.onsubmit;o.onsubmit=function(){return false}}function h(o){if(o==null||o.inactive==null){return}o.onclick=o.inactive.onclick}function f(o){if(o==null||o.inactive==null){return}o.onsubmit=o.inactive.onsubmit}function l(o){o.each(function(q){if(!q.visible()){return}q.addClassName(j);
d(q);q.stopObserving("click",this.showEvent);var p=q.up("form");b(p)})}function a(o){o.each(function(q){var p=new Image();p.src=q})}function c(){var o=["/images/global/icons/dtv_processing_animated_white.gif","/images/assets/ajax/loading_16px.gif"];Dtv.defer(a.curry(o))}Dtv.behaviors.define({name:"ProcessingWatcher",forceCompile:true,selectors:{expr:"body",defer:true},statics:{stop:function(){var o=this.getDefault();if(o){o._removeProcessing()}},reset:function(){var o=this.getDefault();if(o){o._reset()
}},openCancelProcessingLightbox:function(){var o=this.getDefault();if(o){o.lightbox=Dtv.behaviors.AjaxLightbox.instances[0];o.lightbox.show("lightboxProcessingTimeout.jsp",{hitboxEvent:"Processing Timeout Lightbox",forceLightboxClose:false,actions:{processingTimeoutWait:o._processingTimeoutWait.bind(o),processingTimeoutCancel:o._processingTimeoutCancel.bind(o)}})}return false},hideCancelProcessingLightbox:function(){var o=this.getDefault();if(o&&o.lightbox){o.lightbox.hide()}}},methods:{_init:function(){c();
this.processingElements=this.el.select("a."+g,"input."+g);this.processingTimeoutElements=this.el.select("a."+n,"input."+n);this.processingHiddenElements=[];this.processingCurrent=""},_initEvents:function(){this.showEvent=this._showProcessing.bindAsEventListener(this);this.processingElements.each(function(o){o.observe("click",this.showEvent)},this);this.processingTimeoutElements.each(function(o){o.observe("click",this.showEvent)},this)},_reset:function(){this.processingElements.each(function(o){o.stopObserving("click",this.showEvent)
},this);this.processingTimeoutElements.each(function(o){o.stopObserving("click",this.showEvent)},this);this._init();this._initEvents()},_removeProcessing:function(){if(!this.processingCurrent){return}this.processingCurrent.remove();this.processingCurrent="";this._reenableProcessing(this.processingElements);this._reenableProcessing(this.processingTimeoutElements);this.processingHiddenElements.each(function(o){o.show();o.removeClassName(m)});this.processingHiddenElements=[]},_showProcessing:function(q){submitObj=$(Event.element(q));
if(!submitObj.hasClassName(g)&&!submitObj.hasClassName(n)){var p=submitObj.up("."+g);if(!p){p=submitObj.up("."+n)}submitObj=p}if(!submitObj){Dtv.debug($(Event.element(q)).toHtml(),"Processing watcher could not succesfully call _showProcessing() because the submitObj could not be found");return}if(submitObj.disabled){q.stop();return false}this.processingCurrent=new Element("span",{"class":k}).update("&nbsp;");var o={};if(submitObj.getStyle("float")){Object.extend(o,{"float":submitObj.getStyle("float")})
}if(submitObj.getStyle("text-align")){Object.extend(o,{textAlign:$(submitObj).getStyle("textAlign")})}if(submitObj.getStyle("margin")){Object.extend(o,{margin:$(submitObj).getStyle("margin")})}this.processingCurrent.setStyle(o);submitObj.up(".js_processing_container, div").select("a").each(function(r){r.hide().addClassName(m);this.processingHiddenElements.push(r)},this);submitObj.up("div,span").select('input[type="image"]','input[type="submit"]').each(function(r){if(r.visible()){r.hide().addClassName(m);
this.processingHiddenElements.push(r)}},this);submitObj.insert({after:this.processingCurrent});l(this.processingElements);l(this.processingTimeoutElements)},_reenableProcessing:function(o){o.each(function(q){if(!q.visible()){return}q.removeClassName(j);h(q);q.observe("click",this.showEvent);var p=q.up("form");f(p)},this)},_processingTimeoutWait:function(){Dtv.RequestManager.resetTimeout();this.lightbox.hide()},_processingTimeoutCancel:function(){closeTooltipsByDiv(this.lightbox.el);this._removeProcessing();
Dtv.RequestManager.cancelAll(true);this.lightbox.hide()}}})})();Dtv.behaviors.define({name:"SelectionList",consts:{EVENTS:{ITEM_SELECTED:"itemSelected",ITEM_UNSELECTED:"itemUnselected"}},options:{maxSelections:1,selectionRequired:false,autoUnselect:true,cacheItems:true,initialSelections:null,className:"selected",endless:true,selectOnClick:true},methods:{enabled:true,_initEvents:function(){this.el.observe("click",this._handleClick.bind(this))},_initDefaultState:function(){if(this.options.initialSelections||this.options.selectionRequired){var a=this.getItems();
this.selectItems(a.length>0?this.options.initialSelections||(this.options.selectionRequired?[0]:[]):[])}},_handleClick:function(b){var a=this._findSrcEl(b);if(a){this.selectItem(a)}},_findSrcEl:function(c){if(!c){return null}if(this.el.tagName=="TABLE"){return c.findElement("tr")}else{var b=c.element();if(b==this.el){return null}var a;while(b!=null&&(a=b.up())!=this.el){b=a}return b}},getItems:function(){if(this.options.cacheItems&&!!this._items){return this._items}return this._items=(this.el.tagName=="TABLE")?this.el.select("tr"):this.el.childElements()
},getSelectedItems:function(){var b=this.getItems();var a=[],c=this.options.className;b.each(function(d){if(d.hasClassName(c)){a.push(d)}});return a},updateCache:function(){if(this.options.cacheItems){this._items=this.el.childElements()}},isItemSelected:function(a){return this._getItem(a).hasClassName(this.options.className)},toggleItem:function(a){if(!this._selectItem(a)){this.unselectItem(a)}},selectItem:function(h,g){if(!this.enabled){return false}var c=this.getItems();if(c.length==0){throw"Cannot select item when items list is empty"
}var b=this._getIndex(h);if(!b&&this.options.selectionRequired){b=0}var f=b==null?null:this._getItem(b,c);if(g){return this._selectItem(f)}else{var a=true,d=false;this.getSelectedItems().each(function(j){if(j==f){a=false}else{if(this.unselectItem(j)){d=true}}}.bind(this));return a&&f!=null?this._selectItem(f)||d:d}},_selectItem:function(d){var a=this._getIndex(d);var c=this._getItem(d);if(!c){return false}if(!this.isItemSelected(c)){var b=this.getSelectedItems();if(b.length==this.options.maxSelections){if(this.options.autoUnselect){this.unselectItem(b[0])
}else{return false}}c.addClassName(this.options.className);this.fireEvent(this.EVENTS.ITEM_SELECTED,{item:c,itemIndex:a});this.lastSelectedIndex=a;return true}return false},selectItems:function(a,b){if(!this.enabled){return false}if(!b){this.clearSelection()}a.each(function(c){this.selectItem(c,true)}.bind(this))},selectRange:function(c,a,b){if(!this.enabled){return false}this.debug("Not Yet Implemented")},selectPrevious:function(){if(!this.enabled){return false}var a=this.getSelectedItems();if(a.length==1){var b=a[0].getSiblingIndex();
if(b>0){return this.selectItem(b-1)}else{if(this.options.endless){return this.selectItem(this.getItems().length-1)}}}return false},selectNext:function(){if(!this.enabled){return false}var a=this.getSelectedItems();if(a.length==1){var b=a[0].getSiblingIndex();if(b<this.getItems().length-1){return this.selectItem(b+1)}else{if(this.options.endless){return this.selectItem(0)}}}return false},unselectItem:function(c){if(!this.enabled){return false}var a=this._getIndex(c);var b=this._getItem(c);if(this.isItemSelected(b)){b.removeClassName(this.options.className);
this.fireEvent(this.EVENTS.ITEM_UNSELECTED,{item:b,itemIndex:a});return true}return false},clearSelection:function(a){if(!this.enabled){return false}a=a||this.getSelectedItems();if(a.length==0){return false}a.invoke("removeClassName",this.options.className);return true},getSelectionSiblingIndex:function(a){var b=this.getSelectedItems();if(b.length>a){return b[a].getSiblingIndex()}return null},_getItem:function(b,a){return Object.isElement(b)?b:(a||this.getItems())[b]},_getIndex:function(a){return Object.isNumber(a)?a:Object.isElement(a)?a.getSiblingIndex():null
}}});(function(){var a={ORIENTATION:{VERTICAL:"vertical",HORIZONTAL:"horizontal"}};Dtv.behaviors.define({name:"ListScroller",consts:a,options:{orientation:a.ORIENTATION.HORIZONTAL,endless:false,scrollbar:".js-scrollbar",nextBtn:".js-next-btn",prevBtn:".js-previous-btn",listOptions:{effectDuration:0.3},scrollbarOptions:{}},methods:{_init:function(){var c=this._getScrollContainer();this._scrollableList=c.behavior("ScrollableList",$extend(this.options.listOptions,{endless:this.options.endless,orientation:this.options.orientation,nextBtn:this._getBySelector(this.options.nextBtn),prevBtn:this._getBySelector(this.options.prevBtn)}));
this._selectionList=c.behavior("SelectionList",{endless:this.options.endless});var b=this._getBySelector(this.options.scrollbar);if(b){this._scrollbar=b.behavior("ScrollableListScrollBar",$extend(this.options.scrollbarOptions,{list:this._scrollableList,orientation:this.options.orientation,animate:false}))}},_getBySelector:function(b){return b?this.el.down(b):null},_getScrollContainer:function(){return this.el.down("ul")}}});Dtv.behaviors.define({name:"ChannelScroller",inherits:Dtv.behaviors.ListScroller,selectors:[{expr:".ctm-scroller-module .js-horizontal-scroller",options:{orientation:a.ORIENTATION.HORIZONTAL},test:Dtv.behaviors.utils.isContentPage},{expr:".ctm-scroller-module .js-vertical-scroller",options:{orientation:a.ORIENTATION.VERTICAL},test:Dtv.behaviors.utils.isContentPage}],options:{},methods:{_initEvents:function(){this._selectionList.bindEvent(Dtv.behaviors.SelectionList.EVENTS.ITEM_SELECTED,this._onItemSelected.bind(this))
},_initInfoPop:function(){this._infoPop=$el.behavior(this.el.down(".js-infopop").down(),Dtv.behaviors.Lightbox,{relElement:this.el,modal:false,hideOnBlur:true,hideOnClick:true,width:428});this._infoPop.bindEvent(Dtv.behaviors.Lightbox.EVENTS.HIDE,this._onInfoPopHide.bind(this))},_onItemSelected:function(c){var b=c.memo.item.first(".js-details-content");if(!b){return}this._showInfoPop(b.toHtml())},_showInfoPop:function(b){if(!this._infoPop){this._initInfoPop()}if(this._infoPop.visible()){this._infoPop.ignoreNextBlur=true
}this._infoPop.setContent("body",b);this._infoPop.show()},_onInfoPopHide:function(){this._selectionList.clearSelection()}}})})();
/*
 * Tooltip code based on http://www.wildbit.com/labs/cooltips/ by Andrew Okonetchnikov.  Licensed under the MIT license.
 *
 * Copyright (c) 2006-2007 Andrey Okonetchnikov
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
(function(){Dtv.behaviors.define({name:"GenericRollover",selectors:[{expr:"body",test:function(){var a=document.location.href.toLowerCase();
return(a.indexOf("/content/")!=-1||a.indexOf("/cep/")!=-1||a.indexOf("/compare/")!=-1||a.indexOf("/search/")!=-1||a.indexOf("/new_customer/")!=-1||a.indexOf(":7001")!=-1)},defer:true},{expr:".js-tooltip-container",defer:true}],statics:{resetRollovers:function(){var a=this.getDefault();if(a){a._reset()}},addRollovers:function(b){var a=this.getDefault();if(a){$(b).select(".js_rollover").each(function(c){a.openers.push(c);c.observe("mouseenter",a._show.bindAsEventListener(a,c))})}}},methods:{_init:function(){this.visibleRollover="";
this.openers=this.el.select(".js_rollover");this.rollovers=new Array(this.openers.length);this.openerPositions=new Array(this.openers.length)},_initEvents:function(){this.updateEvent=this._update.bindAsEventListener(this);this.openers.each(function(a){a.observe("mouseenter",this._show.bindAsEventListener(this,a))},this)},_reset:function(){this.openers.each(function(a){a.stopObserving("mouseenter")});this._init();this._initEvents()},_show:function(c,b){try{if(this.visibleRollover==b){return}if(b.disabled){return
}this.observe(b,"mouseleave",this._hide.bindAsEventListener(this,b));this.visibleRollover=b;this._buildTooltip(b);this._setPosition(b,{xCord:Event.pointerX(c)});this._setPosition(b,{yCord:Event.pointerY(c)});this._appear(b)}catch(a){Dtv.debug(a,"Failed to show rollover")}},_buildTooltip:function(h){try{if(this._getRollover(h)){return}var l=h.title?$(h.title):h.first(".dtv-rollover-tup");h.title="";if(l){h.select("img").each(function(m){m.alt=""});l=l.remove();$(document.body).insertBefore(l,$(document.body).childNodes[0]);
var a=l.getDimensions();var c=a.width+10;var k=a.height;this._setPosition(h,{width:c});this._setPosition(h,{height:k});l.style.width=c+"px"}var b=this._getOpenerIndex(h);this.rollovers[b]=l;if(this.openerPositions[b]){var f=this.openerPositions[b].openerWidth;var j=this.openerPositions[b].openerHeight;if(!f||!j){var d=h.getDimensions();this._setPosition(h,{openerWidth:d.width});this._setPosition(h,{openerHeight:d.height})}}}catch(g){Dtv.debug(g,"Failed to build Tooltip - exception will be ignored")
}},_hide:function(c,b){b.stopObserving("mouseleave");b.stopObserving("mousemove",this.updateEvent);if(this.visibleRollover!=b){return}this.visibleRollover="";if(this.appearingFX){this.appearingFX.cancel()}var a=this._getRollover(b);if(a){a.hide()}},_appear:function(b){this._setup(b);b.observe("mousemove",this.updateEvent);var a=this._getRollover(b);if(a){a.show()}},_setup:function(g){var d=this._getOpenerIndex(g);var b=this.openerPositions[d].xCord;var h=this.openerPositions[d].yCord;var c=this.openerPositions[d].width;
var a=this.openerPositions[d].height;if(b+c>=Element.getWidth(document.body)){b=b-c+20;this._setPosition(g,{xCord:b})}var f=this._getRollover(g);if(f){f.setStyle({left:(b-7)+"px",top:(h-a-7)+"px"})}},_update:function(b){var a=this.visibleRollover;if(!a){this.debug("Update called when no tooltip opener is visible")}this._setPosition(a,{xCord:Event.pointerX(b)});this._setPosition(a,{yCord:Event.pointerY(b)});this._setup(this.visibleRollover)},_getRollover:function(b){var a=this._getOpenerIndex(b);return this.rollovers[a]
},_getOpenerIndex:function(b){for(var a=0;a<this.openers.length;a++){if(this.openers[a]==b){return a}}throw"opener not found in _getOpenerIndex"},_setPosition:function(c,d){var b=this._getOpenerIndex(c);var a=this.openerPositions[b]||{};a=Object.extend(a,d);this.openerPositions[b]=a}}});Dtv.behaviors.define({name:"GenericTooltip",options:{TOOLTIP_OPTIONS:{className:"dtv_tooltip",effect:"appear",duration:0.1,hook:{target:"topRight",tip:"bottomLeft"},offset:{x:-25,y:0},showOn:"click",hideOn:{element:".close",event:"click"},closeButton:false,viewport:true}},methods:{_init:function(){this.openers=this.el.select("a.js_tooltip");
this.openers.each(function(a){var b=$(a.title);if(b){this._initializeTooltip(a,b)}a.title=""},this)},_initializeTooltip:function(a,b){var c=b.innerHTML;new Tip(a,c,this.options.TOOLTIP_OPTIONS)}}});Dtv.behaviors.define({name:"BusinessTooltip",inherits:Dtv.behaviors.GenericTooltip,selectors:[{expr:"body",test:function(){var a=document.location.href.toLowerCase();return(a.indexOf("/theguide.jsp")==-1)},defer:true},{expr:".js-tooltip-container",defer:true}],methods:{_init:function(){this.openers=this.el.select("a.js_tooltip_link");
this.openers.each(function(a){if(a.title){a.href="#";a.onclick=function(){return false};var b="<div class='dtv_tooltip_top'></div><div class='dtv_tooltip_content_wrapper'><div class='dtv_tooltip_content'><div class='dtv_tooltip_close close'></div>"+a.title+"</div></div><div class='dtv_tooltip_bottom'></div>";new Tip(a,b,this.options.TOOLTIP_OPTIONS);a.title=""}},this)}}})})();(function(){var a={LAYOUT_HTML:'<div class="track"><div class="start"></div><div class="end"></div></div><div class="handle"><div class="start"></div><div class="end"></div></div>',EVENTS:{CHANGE:"change",UPDATE:"update"},ORIENTATION:{VERTICAL:"vertical",HORIZONTAL:"horizontal"}};
Dtv.behaviors.define({name:"ScrollBar",consts:a,options:{orientation:a.ORIENTATION.HORIZONTAL,steps:0,animate:false},methods:{_init:function(){this.el.update(this.LAYOUT_HTML);this.el.addClassName(this.options.orientation==a.ORIENTATION.HORIZONTAL?"scrollbar-h":"scrollbar-v");this.el.addCssEvents({mouseenter:"hover",mouseleave:"!hover"});this._track=this.el.firstDescendant();this._handle=this._track.next();this.setSteps()},_initSlider:function(){try{this._slider=new Control.Slider(this._handle,this._track,{axis:this.options.orientation,range:$R(0,this.options.steps-1),values:$R(0,this.options.steps-1).toArray(),onSlide:this._onSliderChange.bind(this),onChange:this._onSliderChange.bind(this),animate:this.options.animate})
}catch(b){this.debug(b,"_initSlider() failed")}},_onSliderChange:function(){if(this._slider.value!=this.value){this.value=this._slider.value;if(this._onChange){this._onChange()}this.fireEvent(this.EVENTS.CHANGE)}},_updateHandleSize:function(c){var b=(this.options.orientation==a.ORIENTATION.HORIZONTAL?this.el.getWidth():this.el.getHeight())/c;var d={};d[this.options.orientation==a.ORIENTATION.HORIZONTAL?"width":"height"]=Math.max(b,20)+"px";this._handle.setStyle(d)},getSteps:function(){return this.options.steps
},setSteps:function(c,b){try{if($chk(c)&&this.getSteps()==c){return false}if(this._slider){this._slider.dispose();this._slider=null}this.setOption("steps",$chk(c)?c:this.options.steps);if(this.options.steps>1){this.el.show();this._updateHandleSize(b||c);this._initSlider()}else{this.el.hide()}return true}catch(d){this.debug(d,"setSteps() failed")}},getValue:function(){return this._slider?this._slider.value:null},scrollToValue:function(b){if(!this._slider){return}this._slider.setValue(b)},scrollToStart:function(){if(!this._slider){return
}this.scrollToValue(0)},scrollToEnd:function(){if(!this._slider){return}this.scrollToValue(this.getSteps()-1)},scrollToOffset:function(d){if(!this._slider){return}var c=this.getValue()+d;var b=this.getSteps()-1;this.scrollToValue(c<0?0:c>b?b:c)}}});Dtv.behaviors.define({name:"ScrollableListScrollBar",inherits:Dtv.behaviors.ScrollBar,options:{indexMultiplier:4,list:null},methods:{_init:function($super){if(!this.options.list){throw"ScrollableListScrollBar must be initialized with a valid list option value."
}$super();this.update()},_initEvents:function(){this.options.list.bindEvent(Dtv.behaviors.NavigableList.EVENTS.NAV_INDEX_CHANGED,this.update.bind(this));this.options.list.bindEvent(Dtv.behaviors.NavigableList.EVENTS.UPDATED,this.update.bind(this))},_onChange:function(){if(this._ignoreUpdate){return}this._ignoreUpdate=true;this.options.list.navigateToIndex(this._valueToNavIndex(),this._getOffset(),null,true);this._ignoreUpdate=false},update:function(){try{if(this._ignoreUpdate){return}this._ignoreUpdate=true;
var b=this.options.list.getIndexCount();this.setSteps(((b-1)*this.options.indexMultiplier)+1,b);this.scrollToValue(this._navIndexToValue());this._ignoreUpdate=false;this.fireEvent(a.EVENTS.UPDATE)}catch(c){this.debug(c,"update() failed")}},_valueToNavIndex:function(b){return Math.floor((b||this.value)/this.options.indexMultiplier)},_navIndexToValue:function(b){return(b||this.options.list.getNavIndex())*this.options.indexMultiplier},_getOffset:function(){var d=this._valueToNavIndex();var f=this.options.list.getNavOffset(d);
var c=(this.value/this.options.indexMultiplier)-d;if(c>0){var b=this.options.list.getNavOffset(d+1);f+=(b-f)*c}return f}}})})();(function(){Dtv.FormController=Class.create({EVENTS:{ENABLED:"form:enabled",DISABLED:"form:disabled",RESET:"form:reset",CHANGE:"form:change",CLEAR:"form:clear",JSON_RESPONSE:"form:jsonresponse"},MESSAGE_TYPES:{INFO:"info",WARN:"warning",ERROR:"error"},errorClassName:"has-error",disableOnSubmit:true,timeout:true,initialize:function(b,a){this.el=$(b);if(!this.el.hasClassName("js-no-reset")){this.el.reset()
}this.el.getController=function(){return this}.bind(this);this.el.observe("keypress",this._onKeyPress.bind(this));this._initFields();this._initSubmitObjs();if(a){this.setWatcherOptions(a)}Dtv.FormController.instances.push(this)},_onKeyPress:function(a){if(a.keyCode==13&&Prototype.Browser.IE){this.submit()}},_initFields:function(){this.fields=[];this.el.getElements().each(this.addField.bind(this))},_initSubmitObjs:function(){this.submitInputs=this.el.select("input[type='submit']");this.submitEls=[];
var a=this;this.el.select("a.js_processing_timeout").each(function(c,b){a.bindTrigger(c)})},bindTrigger:function(b,a){if(this.submitEls.contains(b)){return false}b.addClassName("js-submit");if(!b.href||b.href==""){b.href="#"}if(b.hasClassName("btn-sm-inact")||b.hasClassName("cep-btn-gray")||b.hasClassName("btn-mid-inact")){b.disable()}b.observe("click",this.handleTrigger.bind(this,b,a));Dtv.tealeaf.invoke("tlProcessNode",b,true);this.submitEls.push(b);return true},handleTrigger:function(c,a,b){if(!c.disabled){this._currentSubmitEl=c;
Dtv.UI.waitButton(c);this.submit(c.rel||a||0)}if(b){b.stop()}return false},selectTriggerEls:function(){return this.el.select("a.js-submit, a.js_processing_timeout")},getDefaultTrigger:function(){if(this.submitEls.length==0){var a=this.selectTriggerEls();if(a.length>0){this.bindTrigger(a[0])}}return this.submitEls.length>0?this.submitEls[0]:null},bindEvent:function(a,b){this.el.observe((a.startsWith("form:")?"":"form:")+a,b)},fireEvent:function(b,a){this.el.fire((b.startsWith("form:")?"":"form:")+b,a)
},addField:function(b){var a;switch(b.type){case"text":a=$el.behavior(b,"TextField");break;case"password":a=$el.behavior(b,"PasswordField");break;case"checkbox":a=$el.behavior(b,"CheckboxField");break;case"radio":a=$el.behavior(b,"RadioField");break;case"hidden":break;default:if(b.tagName=="SELECT"){a=$el.behavior(b,"SelectField")}break}if(!a){return}this.fields.push(a);a.bindEvent("change",function(c){this.el.fire(this.EVENTS.CHANGE,c.memo)}.bind(this))},getField:function(a){return this.fields.find(function(b){return b.el.id==a||b.el.name==a
})},findFields:function(a){return this.fields.findAll(function(b){return b.behaviorName==a})},getDirtyFields:function(){return this.fields.findAll(function(a){return a.isDirty()})},isDirty:function(){return this.getDirtyFields().length>0},getElement:function(a){return Object.isString(a)?this.el.first('[name="'+a+'"], #'+a):$(a)},getSubmitInput:function(a){return Object.isString(a)?this.getElement(a):this.submitInputs[a||0]},getSubmitWatcher:function(b){var a=this.getSubmitInput(b);return a?a.submitWatcher:null
},setWatcherOptions:function(d,c){d.timeout=this.timeout;d.timeoutHandler=this.onTimeout;var f=this.el;c?a(this.getSubmitInput(c)):this.submitInputs.each(a);var b=this;function a(h){h.submitWatcher=new SubmitWatcher(h,f,d);var g;$extend(h.submitWatcher,{onAfterFormSerialize:function(){if(b.disableOnSubmit){g=b.disable()}},onRequestComplete:function(j){if(!j){Dtv.debug("Form ajax request returned without any JSON","FormController")}if(b.disableOnSubmit){b.enable(g)}if(b._currentSubmitEl){Dtv.UI.unwaitButton(b._currentSubmitEl);
b._currentSubmitEl=null}b.handleJsonResponse(j);if(b._onRequestCompleteCb){b._onRequestCompleteCb(j,b)}}})}},submit:function(b,d){if(this.disabled){return false}this.clearFieldErrors();this._onRequestCompleteCb=d;var a=this.getSubmitInput(b);var c=this.getSubmitWatcher(b);if(c){c.options.timeout=this.timeout}if(a&&(!c||!c.active)){a.click();return true}return false},reset:function(){this.fields.invoke("reset");this.fireEvent(this.EVENTS.RESET)},clear:function(){this.fields.invoke("clear");this.fireEvent(this.EVENTS.CLEAR)
},enable:function(a){this.disabled=false;(a||this.fields).invoke("enable")},disable:function(){this.disabled=true;var a=this.fields.findAll(function(b){return !b.el.disabled});a.invoke("disable");return a},handleJsonResponse:function(a){if(!a){Dtv.debug("handleJsonResponse called with empty json argument","FormController");return false}try{this.clearMessages();if(!this._jsonResponses){this._jsonResponses=[]}this._jsonResponses.push(a);if(!a.success){this.setFieldErrors(a);this.setMessages(a.errorLevel,a.errors)
}if(a.messages){this.setMessages(a.messageLevel,a.messages)}this.fireEvent(this.EVENTS.JSON_RESPONSE,{json:a})}catch(b){Dtv.debug(b)}return true},findMessageContainer:function(c,a){this._messagesEl=null;var b=this.el.up();do{this._messagesEl=b.first(a||".js-message-container")}while(!this._messagesEl&&(b=b.up())!=c);return this._messagesEl},setMessages:function(b,c,a){var d=this._getMessageContainer(b);if(d){if(c&&c.length>0){var f=d.down("ul");if(!a){f.update()}c.each(function(g){$el("<li>"+g+"</li>").appendTo(f)
});d.up().show();d.show()}else{d.hide()}}else{if(c&&c.length>0){Dtv.debug("cant find container el for "+b,"FormController")}}return false},clearMessages:function(a){if(!a){a=$H(this.MESSAGE_TYPES).keys()}$A(a).each(function(c){var b=this._getMessageContainer(c);if(b){b.hide()}}.bind(this))},_getMessageContainer:function(a){return(this._messagesEl||this.el.up()).down("."+(this.MESSAGE_TYPES[a]||a)+"-message")},setFieldErrors:function(a){this.clearFieldErrors();if(!a){return false}a.errorFields.each(function(c,b){var d=a.errors[b];
if(d){d=d.substring(0,d.indexOf("<!"))}this.applyFieldError(c,d)}.bind(this));return true},applyFieldError:function(f,b){try{var d=this.getField(f);if(d){d.showError(b);return true}else{var a=this.el.first("label[for='"+f+"']");if(a){a.addClassName(this.errorClassName)}}}catch(c){Dtv.debug(c)}return false},clearFieldErrors:function(){this.el.select("."+this.errorClassName).each(function(a){a.removeClassName(this.errorClassName);a.title=""}.bind(this))}});$extend(Dtv.FormController,{instances:[],wrap:function(b,a){if(b.getController){var c=b.getController();
if(c){if(a){c.setWatcherOptions(a)}return c}}return new Dtv.FormController(b,a)}});Dtv.behaviors.define({name:"AbstractField",options:{hasErrorClassName:"has-error",hasFocusClassName:"has-focus",hasValueClassName:"has-value",disabledClassName:"disabled",changeEventName:"change"},methods:{_init:function(){this.el.fieldBehavior=this;this.el._getValue=this.el.getValue;this.el.getValue=this.getValue.bind(this);this.initialValue=this.getValue()},_initEvents:function(){this.el.observe("blur",this._onBlur.bind(this));
this.el.observe("focus",this._onFocus.bind(this));this.options.changeEventName.split(",").each(function(a){this.el.observe(a,this._onChange.bind(this))}.bind(this))},_initDefaultState:function(){this._updateHasValueClass()},_onBlur:function(a){this.el.removeClassName(this.options.hasFocusClassName)},_onFocus:function(a){this.el.addClassName(this.options.hasFocusClassName)},_onChange:function(c){this._updateHasValueClass();var b=this.getValue();if(!$defined(this._currentValue)||this._currentValue!=b){var a=this._currentValue;
this._currentValue=b;this.fireEvent("change",{field:this,oldValue:a,newValue:b})}},_updateHasValueClass:function(){if(!this.hasValue()){this.el.removeClassName(this.options.hasValueClassName)}else{this.el.addClassName(this.options.hasValueClassName)}},isDirty:function(){return this.initialValue!=this.getValue()&&!this.el.disabled},getValue:function(){return this.el._getValue()},setValue:function(a){this.el.value=a;this._onChange()},hasValue:function(){var a=this.getValue();return a!=null&&a!=""},getController:function(){if(!this._controller){this._controller=this.el.up("form").getController()
}return this._controller},enable:function(){this.el.disabled=false;this.el.removeClassName(this.options.disabledClassName)},disable:function(){this.el.disabled=true;this.el.addClassName(this.options.disabledClassName)},clear:function(){this.setValue("")},reset:function(){this.setValue(this.initialValue)},showError:function(b){this.el.addClassName(this.options.hasErrorClassName);this.el.title=b;var a=this.getLabelEl();if(a){a.addClassName(this.options.hasErrorClassName);a.title=b}},getLabelEl:function(){var b=this.el.up("form");
var a;if(this.el.id){a=b.first("label[for='"+this.el.id+"']")}if(!a&&this.el.name){a=b.first("label[for='"+this.el.name+"']")}return a}}});Dtv.behaviors.define({name:"SelectField",inherits:"AbstractField"});Dtv.behaviors.define({name:"TextField",inherits:"AbstractField",options:{displayText:null},methods:{_initDefaultState:function($super){this._onBlur();$super()},_onBlur:function($super,a){$super();this.showDisplayText()},_onFocus:function($super,a){$super();this.hideDisplayText()},getDisplayText:function(){return this.options.displayText||this.el.alt
},setDisplayText:function(a){this.options.displayText=a;this.showDisplayText()},hasFocus:function(){return this.el.hasClassName(this.options.hasFocusClassName)},getValue:function(){if(this.el.value==this.getDisplayText()){return""}return this.el.value},showDisplayText:function(){var a=this.getDisplayText();if(a&&((this.el.value==""&&!this.hasFocus())||this.el.value==a)){this.el.value=a;return true}return false},hideDisplayText:function(){if(this.el.value==this.getDisplayText()){this.el.value="";return true
}return false}}});Dtv.behaviors.define({name:"PasswordField",inherits:"TextField",methods:{_init:function($super){$super();this.fakeEl=$el("<input type='text' class='"+this.el.className+"' value='"+this.getDisplayText()+"'></input>").hide().observe("focus",this._onFakeFocus.bind(this)).after(this.el)},showDisplayText:function($super){if($super()){this.fakeEl.show();this.el.hide();return true}return false},hideDisplayText:function($super){this.fakeEl.hide();this.el.show();return $super()},showError:function($super,a){$super(a);
this.fakeEl.addClassName(this.options.hasErrorClassName);this.fakeEl.title=this.el.title},_onFakeFocus:function(){this.hideDisplayText();this.el.activate()}}});Dtv.behaviors.define({name:"CheckboxField",inherits:"AbstractField",options:{changeEventName:"click",hasFocusClassName:""},methods:{_init:function($super){$super();this.initialChecked=this.getChecked()},getChecked:function(){return this.el.checked},setChecked:function(a){if(this.el.checked!=a){this.el.checked=a;this._onChange()}},isDirty:function(){return this.initialChecked!=this.getChecked()&&!this.el.disabled
},clear:function(){this.setChecked(false)},reset:function(){this.setChecked(this.initialChecked)}}});Dtv.behaviors.define({name:"RadioField",inherits:"CheckboxField",options:{changeEventName:"change,click"},methods:{_onChange:function($super,a){delete this._currentValue;$super()},getGroup:function(){var c=this.el.name;var a=this.getController();if(!a){return null}var b=a.fields.select(function(d){return d.el.name==c});return{name:c,fields:b,initialCheckedField:b.find(function(d){return d.initialChecked
}),checkedField:b.find(function(d){return d.getChecked()})}}}})})();Dtv.ready(function(){if(document.location.href.toLowerCase().indexOf("/referral/")!=-1){var a=$("dtv_tup").down("form.js-referrer-form");if(a){new Dtv.FormController(a,{successHandler:function(c,b){if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}if(b.lightboxUrl){Dtv.behaviors.AjaxLightbox.show(b.lightboxUrl)}else{if(b.redirectUrl){document.location.href=b.redirectUrl}}},failureHandler:function(c,b){Dtv.behaviors.AjaxLightbox.instances.invoke("hide");
if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}}})}}});(function(){var a={SELECTORS:{AJAX_LINK:".js-order-module-ajax",LIST:".js-order-module-list",LINK:".js-order-module-link",ACTION:".js-order-module-action",LOGIN_LIST:".js-order-module-login-list",FORM_ERROR_LIST:".js-order-module-form-error-list",LOGIN_RADIO:".js-order-login-radio",REGISTER_RADIO:".js-order-register-radio",DIRTY_AWARE:".js-dirty-aware"}};function b(c,d){c.select("a, input").each(function(f){f.disabled=d
})}Dtv.behaviors.define({name:"OrderModule",selectors:{expr:".js-order-module",defer:true},options:{},methods:{_init:function(){var c=this;this._list=this.el.down(a.SELECTORS.LIST).behavior("GroupedList",{mouseWheelEnabled:false});this.lightbox=$el("<div class='js-lightbox'></div>").behavior("CartFlyout");this._loginForm=new Dtv.FormController(this.el.down("form[name='loginForm']"),{successHandler:this._handleSubmitLoginSuccess.bind(this),failureHandler:this._handleSubmitLoginFailure.bind(this)});
this._loginForm.errorList=this.el.down(a.SELECTORS.FORM_ERROR_LIST);this.el.select(a.SELECTORS.AJAX_LINK).each(function(d){ajaxCartForm=d.up("form");var f=new Dtv.FormController(ajaxCartForm,{successHandler:this._handleSubmitCartSuccess.bind(this),failureHandler:this._handleSubmitCartFailure.bind(this)});if(ajaxCartForm.match(a.SELECTORS.DIRTY_AWARE)){f.bindEvent("change",function(g){f.getDefaultTrigger()[(f.isDirty()?"en":"dis")+"able"]()})}},this);this._loginForm.list=this.el.down(a.SELECTORS.LOGIN_LIST).behavior("GroupedList",{mouseWheelEnabled:false});
this._loginForm.loginRadio=this.el.down(a.SELECTORS.LOGIN_RADIO);this._loginForm.registerRadio=this.el.down(a.SELECTORS.REGISTER_RADIO);this._loginForm.passwordInput=this.el.down('input[type="password"]');this._loginForm.closeBtn=this.el.down('a[rel="login-cancel"]');b(this._list._items[1],true)},_initEvents:function(){var c=this;this.el.select(a.SELECTORS.LINK).each(function(d){d.observe("click",function(f){c._handleLink(c.el,d,f);return false})});this.el.select(a.SELECTORS.ACTION).each(function(d){d.observe("click",function(f){c._handleAction(d,f);
return false})});this.el.select(a.SELECTORS.ACTION).each(function(d){d.observe("click",function(f){c._handleAction(d,f);return false})});this._loginForm.loginRadio.observe("click",function(d){if(c._loginForm.loginRadio.checked){c._loginForm.getDefaultTrigger().down("span").innerHTML="Login"}return false});this._loginForm.registerRadio.observe("click",function(d){if(c._loginForm.registerRadio.checked){c._loginForm.getDefaultTrigger().down("span").innerHTML="Register";c._loginForm.passwordInput.value=""
}return false});this._loginForm.passwordInput.observe("keydown",function(d){if(!c._loginForm.loginRadio.checked){c._loginForm.loginRadio.click()}})},_handleSubmitLoginSuccess:function(d,c){if(!c.success){this._handleSubmitLoginFailure(d,c)}else{if(c.redirectUrl){window.location.href=c.redirectUrl}else{if(this.href){window.location.href=this.href}}}},_handleSubmitLoginFailure:function(d,c){this._loginForm.list.navigateToLast();this._loginForm.closeBtn.fade();this._loginForm.errorList.update();c.errors.each(function(f){if(f&&f!=""){$el("<li>"+f+"</li>").appendTo(this._loginForm.errorList)
}}.bind(this))},_handleSubmitCartSuccess:function(d,c){if(!c.success){this._handleSubmitCartFailure(d,c);return}if(c.lightboxUrl){Dtv.behaviors.CartFlyout.showAsLightbox(c)}else{if(c.redirectUrl){window.location.href=c.redirectUrl}}},_handleSubmitCartFailure:function(d,c){},_handleLink:function(h,f,g){g.stop();var c=f.href;if(c.length==0){return}if(c.charAt(c.length-1)=="/"){c=document.location.href}if(c.charAt(c.length-1)!="="){c+=((c.indexOf("?")==-1)?"?":"&")}var d=h.down('input[name="selectedSku"]');
if(d){c+=d.value}else{d=h.down('select[name="selectedSku"]');if(d){c+=d.options[d.selectedIndex].value}else{h.select('input[type="radio"]').forEach(function(j){if(j.checked&&j.match('input[name="selectedSkuRadio"]')){c+=j.value;return true}})}}if(f.hasClassName("js-login-required")){this.href=c;this._list.navigateToLast();b(this._list._items[1],false)}else{window.location.href=c}},_handleAction:function(c,d){d.stop();switch(c.rel){case"error-ok":this._loginForm.list.navigateToFirst();this._loginForm.closeBtn.appear();
break;case"login-cancel":this._list.navigateToFirst();b(this._list._items[1],true);break}}}})})();(function(){var b={AUTO:"auto",POSITIONING:{AROUND:"around",CENTERED:"centered",RELATIVE:"relative",ABSOLUTE:"absolute"},EVENTS:{CONTENT_UPDATED:"contentupdated",SHOW:"show",HIDE:"hide"}};var a=Class.create({initialize:function(g,f){this.openEventName="click";this.lightbox=g;if(f){$extend(this,f)}this._openers=[]},addOpeners:function(f){if(!f){throw"Cannot add openers: openers argument cannot be null"
}(Object.isString(f)?$$(f):f).each(this.addOpener.bind(this))},addOpener:function(f){if(this._openers.contains(f)){return false}f.observe(this.openEventName,function(g){g.stop();return this.open(f,g)&&false}.bind(this));this._openers.push(f);return true},open:function(f,g){if(f.disabled){return false}var h={connector:this,opener:f,cancel:false,data:null};if(this.onBeforeOpen){this.onBeforeOpen(g,h);if(h.cancel){return false}}this.opener=f;this.lightbox.opener=f;this.onOpen(g,{connector:this,data:h.data});
return true},onOpen:function(g,f){this.lightbox.show()}});Dtv.behaviors.define({name:"Lightbox",forceCompile:true,consts:b,options:{width:b.AUTO,height:b.AUTO,top:0,left:0,zIndex:1002,positioning:b.POSITIONING.CENTERED,effectDuration:0.1,effectQueue:"end",relElement:null,buttons:null,contentSelectors:{header:".ipop-header",body:".ipop-content"},closeSelector:".js-lb-close",modal:true,hideOnBlur:false,hideOnClick:false},statics:{allInstances:[],visibleInstances:[],modalInstances:[],_notifyEvent:function(f,h,g){switch(h){case b.EVENTS.SHOW:this.visibleInstances.push(f);
if(f.options.modal){this.modalInstances.push(f);if(this.modalInstances.length==1){Dtv.UI.disableScreen()}}break;case b.EVENTS.HIDE:this.visibleInstances.erase(f);if(this.modalInstances.length>0){this.modalInstances.erase(f);if(this.modalInstances.length==0){Dtv.UI.enableScreen()}}break}}},methods:{_init:function(){Dtv.behaviors.Lightbox.allInstances.push(this);if(this._initConnectors){this._initConnectors()}},_initLayout:function(){if(Prototype.Browser.IE6){this.iframeShim=new Element("iframe",{src:'javascript:"";',frameBorder:0}).setStyle({position:"absolute",display:"none",zIndex:this.options.zIndex,top:0,left:0}).setOpacity(0);
this.iframeShim.appendTo(document.body)}this.el.setStyle({position:"absolute",display:"none",zIndex:this.options.zIndex,top:0,left:0});this.el.appendTo(document.body)},_initEvents:function(){var f=this;f.el.select(f.options.closeSelector).each(function(g){f.observe(g,"click",function(h){f.hide();h.stop();return false})});f.observe(document,"click",function(j){try{var h=j.element();if(f.el.visible()&&f.options.hideOnBlur&&h.ancestors().indexOf(f.el)==-1){if(f.ignoreNextBlur){f.ignoreNextBlur=false
}else{f.hide()}}}catch(g){f.debug(g,"Failed to handle document click event")}});f.observe(f.el,"click",function(g){if(f.options.hideOnClick&&g.element().tagName!="A"){f.hide()}})},createConnector:function(f){return new a(this,f)},show:function(){this.refreshLayout();if(this.visible()){return false}this.el.appear({duration:this.options.effectDuration,queue:this.options.effectQueue,afterFinish:this._afterShow.bind(this)});this.fireEvent(b.EVENTS.SHOW,{lightbox:this});$$(".dtv-rollover-tup").invoke("hide");
return true},hide:function(){if(!this.visible()){return false}this.el.fade({duration:this.options.effectDuration,queue:"start",afterFinish:this._afterHide.bind(this)});this.fireEvent(b.EVENTS.HIDE,{lightbox:this});this._showSelectBoxes.bind(this).defer();$$(".dtv-rollover-tup").invoke("hide");return true},_afterShow:function(){this._hideSelectBoxes.bind(this).defer()},_afterHide:Prototype.emptyFunction,visible:function(){return this.el.visible()},fireEvent:function($super,g,f){$super(g,f);Dtv.behaviors.Lightbox._notifyEvent(this,g,f)
},getBounds:function(){var f=$el.getDimensions(this.el);f.left=$el.getStylesAsInt(this.el,"left");f.top=$el.getStylesAsInt(this.el,"top");return f},setContent:function(h,g){if(Object.isString(h)){if(c(this.getContentEl(h),g)){if(this.isInitialized){this.fireEvent(b.EVENTS.CONTENT_UPDATED,{contentType:h,content:g})}return true}return false}else{var f=false;$H(h).each(function(j){if(this.setContent(j.key,j.value)){f=true}}.bind(this));return f}},getContentEl:function(f){return this.el.first(this.options.contentSelectors[f])
},_hideSelectBoxes:function(){if(this.iframeShim){var f=this.el;var g=$el.getOuterDimensions(f);while(g.width==0||g.height==0){f=f.down("div");if(!f){break}g=$el.getOuterDimensions(f)}this.iframeShim.setStyle({width:g.width+"px",height:g.height+"px",top:this.el.style.top,left:this.el.style.left});this.iframeShim.show()}},_showSelectBoxes:function(){if(this.iframeShim){this.iframeShim.hide()}},_getBaseStyle:function(){return{width:Dtv.util.getStyleValue(this.options.width),height:Dtv.util.getStyleValue(this.options.height)}
},_adjustLayoutStyle:null,_getLayoutStyle:function(){var g=this.visible();this.el.setStyle({display:"block",visibility:"hidden"});this.el.setStyle(this._getBaseStyle());var f={display:g?"block":"none",visibility:"visible"};switch(this.options.positioning){case b.POSITIONING.AROUND:var j=d(),n=d(this._getRelatedEl()),k=$el.getOuterDimensions(this.el);n.top=this._getRelatedEl().viewportOffset()[1]-$(document.body).viewportOffset()[1];k.width=k.width||this.el.offsetWidth||this.el.down().getWidth();k.height=k.height||this.el.offsetHeight||this.el.down().getHeight();
k.left=n.left+this.options.left+((n.width-k.width)/2);k.top=n.top+this.options.top-k.height;k.right=k.left+k.width;j.right=j.left+j.width;if(k.right>j.right){k.left-=(k.right-j.right)}if(j.left>k.left){k.left=j.left}if(j.top>k.top){k.top+=(n.height+k.height)-(this.options.top*2)}f.left=k.left;f.top=k.top;break;case b.POSITIONING.CENTERED:var j=d(this._getRelatedEl()),m=$el.getOuterDimensions(this.el);var o=this._getRelatedEl();if(o){j.top=o.viewportOffset()[1]-$(document.body).viewportOffset()[1]
}var l=(j.width-m.width)/2;var h=(j.height-m.height)/2;f.left=Math.max(0,j.left+l+this.options.left);f.top=Math.max(0,j.top+h+this.options.top);break;case b.POSITIONING.RELATIVE:var j=d(this._getRelatedEl());f.left=j.left+this.options.left;f.top=j.top+this.options.top;break;case b.POSITIONING.ABSOLUTE:f.left=this.options.left;f.top=this.options.top;break}if(this._adjustLayoutStyle){this._adjustLayoutStyle(f)}f.left+="px";f.top+="px";return f},_getRelatedEl:function(){return this.relElement||this.options.relElement
},refreshLayout:function(){this.el.setStyle(this._getLayoutStyle())}}});function d(f){return $extend(f?$el.getOuterDimensions(f):document.viewport.getDimensions(),f?$el.cumulativeOffset(f):document.viewport.getScrollOffsets())}function c(f,g){if(!f){return false}if(Object.isElement(g)){f.update().append(g)}else{f.update(g)}return true}})();(function(){var b={EVENTS:{CONTENT_READY:"contentready"}};var a=Class.create({forceLightboxClose:true,forcePageReload:false,hitboxEvent:null,initialize:function(f,g,d){this.lightbox=f;
this.formController=g;$extend(this,d);var c=this;$H(c).each(function(h){if(Object.isFunction(h.value)){c[h.key]=h.value.bind(c)}}.bind(this))},failureHandler:function(d,c){if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}this.lightbox.refreshLayout();if(this.onAjaxFailure){this.onAjaxFailure(c)}},successHandler:function(d,c){try{if(c.success){Dtv.behaviors.ProcessingWatcher.stop();if(this.hitboxEvent){hitboxCustomEvent(this.hitboxEvent)}if(this.forceRedirect){if(c.redirectUrl!=null){window.location.href=c.redirectUrl;
return true}c.errors.push("redirectUrl not specified");return this.failure(formObj,c)}if(!this.forceLightboxClose){this.formController.handleJsonResponse(c)}this.lightbox.refreshLayout();if(this.onAjaxSuccess){this.onAjaxSuccess(c)}if(this.forceLightboxClose){this.lightbox.hide()}if(this.forcePageReload){window.location.reload(true)}}else{this.failureHandler(d,c)}}catch(f){this.lightbox.debug(f,"Failed to process json success handler")}},createHandler:function(){return this.onAjaxCreate?this.onAjaxCreate():true
}});Dtv.behaviors.define({name:"AjaxLightbox",inherits:Dtv.behaviors.Lightbox,selectors:"#ajaxLightboxDiv",consts:b,options:{baseUrl:"/DTVAPP/global/lightbox/",effectQueue:"",defaultConfig:{autoFocusField:true}},statics:{_contentCache:{},show:function(d,c,f){this.instances[0].show(d,c,f)},showZipCodeLightbox:function(g,c,d){var h=this.getDefault();var f=false;if(!c){c=function(j){h.hide();document.location.reload()}}this.show("/DTVAPP/global/lightbox/lightboxZipCode.jsp?pepodMode="+g,{hitboxEvent:"Epg Zip Code Lightbox",forceLightboxClose:false,actions:{hide:function(){h.hide();
if(g&&f){document.location.reload()}}},onAjaxSuccess:function(l){var j=$("zipCode");j.readOnly=false;f=false;if(l.countyCodes!=null){f=true;if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}j.readOnly=true;$("countyDiv").show();var m=$("countySelect");m.options.length=0;m.options[0]=new Option("County","");for(var k=0;k<l.countyCodes.length;k++){m.options[k+1]=new Option(l.countyNames[k],l.countyCodes[k])}}else{if(c){c(l)}}},onAjaxFailure:function(j){$("zipCode").readOnly=false
},onHide:d})},showModifyEmailLightbox:function(){this.show("lightboxModifyEmail.jsp",{hitboxEvent:"Modify Email Lightbox",forcePageReload:true})}},methods:{_initConnectors:function(){this.connector=this.createConnector({onOpen:this._onOpen.bind(this)});var c=this;$$(".js-ajax-opener").each(function(d){if(d.rel){d.href=d.rel}c.connector.addOpener(d)},this)},showWaiting:function(){Dtv.UI.disableScreen();Dtv.UI.showThinking()},hideWaiting:function(){Dtv.UI.hideThinking()},show:function($super,j,d,k){suppressExternalLightboxes();
if(!j){$super();return}var c=this;this.showWaiting();this.config=$extend(this.options.defaultConfig,d||{});if(j.charAt(0)!="/"&&!j.include("://")){j=this.options.baseUrl+j}this.url=j;var g="";if(this.config.enableCaching){g=Dtv.behaviors.AjaxLightbox._contentCache[j]}if(!g){new Ajax.Request(j,{onSuccess:function(l){g=l.responseText;f()},onCancel:function(l){c.debug("ajax request cancelled");h()},onFailure:function(l){c.debug(new Error("Ajax update failed: "+l.responseText));h()}})}else{this.el.update(g);
f()}function h(){c.hideWaiting();if(Dtv.behaviors.Lightbox.modalInstances.length==0){Dtv.UI.enableScreen()}}function f(){if(c.config.enableCaching){Dtv.behaviors.AjaxLightbox._contentCache[j]=g}c.hideWaiting();c.el.update(g);try{c._initContent();c.refreshLayout.bind(c).defer()}catch(l){c.debug(l,"Failed to init ajax lightbox content")}$super();if(k){k()}}},hide:function($super){allowExternalLightboxes();if(Dtv.behaviors.BusinessInfoPop&&Dtv.behaviors.BusinessInfoPop.instances){Dtv.behaviors.BusinessInfoPop.instances.invoke("hide")
}if($super()){if(this.config.onHide){this.config.onHide.call(this)}return true}return false},_afterShow:function($super){$super();if(this.config.autoFocusField){var d=this.el.down(Object.isString(this.config.autoFocusField)?"#"+this.config.autoFocusField:"input[type='text'], input[type='password']");if(d){try{d.focus()}catch(c){}}}if(this.config.onAfterShow){this.config.onAfterShow.call(this)}},_afterHide:function($super){$super();if(this.config.onAfterHide){this.config.onAfterHide.call(this)}},_onOpen:function(c,d){this.show(this.opener.href,this.opener.rel)
},_initContent:function(){this._resetFormControllers();this.contentBehaviors=Dtv.behaviors.applyMappings(this.el);if(Dtv.behaviors.BusinessInfoPop.updateConnectors){Dtv.behaviors.BusinessInfoPop.updateConnectors(this.el)}if(Dtv.behaviors.isCompiled("GenericRollover")&&Dtv.behaviors.GenericRollover.addRollovers){Dtv.behaviors.GenericRollover.addRollovers(this.el)}Dtv.tealeaf.invoke("tlProcessNode",this.el);if(this.config.onInit){this.config.onInit.call(this)}this.fireEvent(b.EVENTS.CONTENT_READY,{lightbox:this})
},_resetFormControllers:function(){if(this.formControllers){this.formControllers.each(function(c){Dtv.FormController.instances.erase(c)})}this.formControllers=[];this.el.select("form").each(this._initFormController.bind(this))},_initFormController:function(c){var f=c.getController?c.getController():null;if(!f){f=new Dtv.FormController(c);f.findMessageContainer(this.el);if(f.submitEls){var d=Dtv.behaviors.ProcessingWatcher.instances[0];f.submitEls.each(function(g){if(g.hasClassName("js_processing")||g.hasClassName("js_processing_timeout")){g.observe("click",d.showEvent.bind(d))
}})}f.setWatcherOptions(new a(this,f,this._getWatcherOptions(f)))}this.formControllers.push(f);return f},_getWatcherOptions:function(c){return $clone(this.config.watchersConfig?this.config.watchersConfig[c.el.id]:this.config)},handleAction:function($super,d,c,f){if(this.config.actions&&this.config.actions[d]){f.returnValue=false;return this.config.actions[d].call(this)&&true}switch(d){case"submit":f.element().up("form").getController().submit();return true;default:return $super(d,c,f)}},_getBaseStyle:function($super){var c=this.el.down();
if(!c){return $super()}return{width:c.getStyle("width"),height:c.getStyle("height")}}}})})();(function(){function a(b){return b.toLowerCase().contains("rtmp://")}Dtv.behaviors.define({name:"MediaLightbox",inherits:Dtv.behaviors.Lightbox,selectors:{expr:"#magnifying_media_lightbox",test:function(){var b=document.location.href.toLowerCase();return(Dtv.behaviors.utils.isContentPage()||b.indexOf("/search/")!=-1)},defer:true},options:{contentSelectors:{header:".lb-header",caption:".js-lb-caption"},width:725,height:330,top:-50},methods:{_init:function($super){$super();
this._mediaPlayer=this.el.first(".js-mediaplayer").behavior(Dtv.behaviors.MediaPlayer);this._mediaPlayer.setOption("theme","default")},_initConnectors:function(){this.connector=this.createConnector({onBeforeOpen:this._onBeforeOpen.bind(this),onOpen:this._onOpen.bind(this)});$$("a.js-media-lightbox-opener").each(function(d){if(a(d.href)){var c=d.down("b.magnify");if(c){c.addClassName("video")}}this.connector.addOpener(d,this)}.bind(this))},_initEvents:function($super){$super();this.bindEvent("hide",this._onHide.bind(this))
},_onBeforeOpen:function(f,h){if(!this.el.id){this.el=$("magnifying_media_lightbox");this._init($super);this._initEvents($super)}h.data={};var b=a(h.opener.href)?"videoUrl":"imageUrl";h.data[b]=h.opener.href;var g=$el.getVar(h.opener,"lightboxTitle");var c=$el.getVar(h.opener,"lightboxCaption");var d=this.getContentEl("caption");if(b=="videoUrl"){h.data.blurb=c;d.hide()}else{d[c?"show":"hide"]()}this.setContent({header:g,caption:b=="imageUrl"?c:""})},_onOpen:function(b,c){this.show();this._mediaPlayer.setPlaylistData(c.data);
this._mediaPlayer.playTrack()},_onHide:function(){this._mediaPlayer.destroySwfObj()}}})})();(function(){var a={CONTENT_TYPE:{BODY:"body",HEADER:"header",CAPTION:"caption"},EVENTS:{CONTENT_UPDATED:"contentupdated",SHOW:"show",HIDE:"hide",OPENER_OPTIONS_SET:"openeroptionsset",LIGHTBOX_OPENED:"dtv:lightboxOpened",LIGHTBOX_CLOSED:"dtv:lightboxClosed"}};Dtv.behaviors.define({name:"LegacyLightbox",consts:a,selectors:{expr:"body",defer:true},options:{},methods:{_init:function($super){this._currentLightboxWindow=new Array();
this._currentLightboxContentDiv=new Array();this._currentLightboxSubContentDiv=new Array()},_initLayout:function(){},_initEvents:function(){},create:function(c,b){this._setContentOptions(c);closeTooltipsByDiv();if(!this.contentOptions.suppressSessionRefresh){refreshSession()}var d=null;if(this.contentOptions.contentDiv){d=this.contentOptions.contentDiv+"Lightbox";if($(d)){return}if(this._currentLightboxContentDiv.length>0){$(this._currentLightboxContentDiv[0]).hide()}this._currentLightboxContentDiv.unshift(this.contentOptions.contentDiv);
this._currentLightboxSubContentDiv.unshift(this.contentOptions.subContentDiv)}else{$log("contentOptions.contentDiv must be specified in openLightbox()");return}this._setLightboxOptions(b,d);this._renderLightbox();if(!this.contentOptions.suppressHitbox){hitboxCustomEvent(this.contentOptions.hitboxPageName,this.contentOptions.hitboxPageCategory)}},_handleClose:function(b){allowExternalLightboxes();if(this.contentOptions.subContentDiv){$(this.contentOptions.subContentDiv).hide()}},_handleCloseCallback:function(b){if(this.contentOptions.subContentDiv){$(this.contentOptions.contentDiv).fire(a.EVENTS.LIGHTBOX_CLOSED)
}else{$(b).fire(a.EVENTS.LIGHTBOX_CLOSED)}},_handleShow:function(b){suppressExternalLightboxes();this._updateLightboxHeight(b)},_handleShowCallback:function(b){if(this.contentOptions.callback){if(this.contentOptions.contentDiv){$(this.contentOptions.contentDiv).fire(this.contentOptions.callback)}else{$(b).fire(this.contentOptions.callback)}}if(this.contentOptions.contentDiv){$(this.contentOptions.contentDiv).fire(a.EVENTS.LIGHTBOX_OPENED)}else{$(b).fire(a.EVENTS.LIGHTBOX_OPENED)}},_renderLightbox:function(){if($(this.contentOptions.subContentDiv)){this.hideChildDivs(this.contentOptions.contentDiv);
$(this.contentOptions.subContentDiv).show()}this._currentLightboxWindow.unshift(new Window(this.lightboxOptions));this._currentLightboxWindow[0].setContent(this.contentOptions.contentDiv);this._currentLightboxWindow[0].showCenter(true,this.lightboxOptions.top,this.lightboxOptions.left);this._currentLightboxWindow[0].setDestroyOnClose();this._currentLightboxWindow[0].setZIndex(1002);this.fireEvent(a.EVENTS.SHOW);if(this._currentLightboxSubContentDiv[0]){$(this._currentLightboxSubContentDiv[0]).fire(EVENT_LIGHTBOX_RENDERED)
}},_setContentOptions:function(b){this.contentOptions={contentDiv:null,subContentDiv:null,hitboxPageName:null,hitboxPageCategory:null,suppressHitbox:false,suppressSessionRefresh:false};Object.extend(this.contentOptions,b||{})},_setLightboxOptions:function(b,d){var c=this;this.lightboxOptions={showEffect:Effect.Appear,showEffectOptions:{afterFinish:c._handleShowCallback.bind(c,d),duration:0},hideEffect:Effect.Fade,hideEffectOptions:{afterFinish:c._handleCloseCallback.bind(c,d),duration:0},id:d,className:"directv-alert",onShow:c._handleShow.bind(c,d),onClose:c._handleClose.bind(c,d)};
Object.extend(this.lightboxOptions,b||{})},_updateLightboxHeight:function(b){$(b).setStyle({height:"auto",width:"auto"});$(b+"_content").setStyle({height:"auto"})},hideChildDivs:function(b){if($(b)==null){return}$(b).immediateDescendants().invoke("hide")},closeLightboxMinimal:function(){if(this._currentLightboxWindow.length==0){$log("closeLightbox() called when no lightbox is open");return}$(this._currentLightboxContentDiv[0]).hide();if(this._currentLightboxSubContentDiv[0]!=null){this.hideChildDivs(this._currentLightboxContentDiv[0])
}this._currentLightboxSubContentDiv.shift();this._currentLightboxContentDiv.shift();this._currentLightboxWindow[0].close();this._currentLightboxWindow.shift();if(this._currentLightboxContentDiv.length>0){$(this._currentLightboxContentDiv[0]).show()}}}})})();(function(){Dtv.behaviors.define({name:"BusinessInfoPop",inherits:"Lightbox",options:{modal:false,positioning:$consts("Lightbox").POSITIONING.AROUND,hideOnBlur:true,hideOnClick:false,effectDuration:0.2,contentSelectors:{body:"div.js-infopop-content"}},selectors:{expr:"#content_business_infopop",defer:true},statics:{updateConnectors:function(b){var a=this.getDefault();
if(a){a.updateConnectors(b)}}},methods:{_initEvents:function($super){$super();$(document.body).observe("DTV:disablescreen",this.hide.bind(this))},_initConnectors:function(){this.clickConnector=this.createConnector({onBeforeOpen:this._onBeforeOpen.bind(this)});this.hoverConnector=this.createConnector({onBeforeOpen:this._onBeforeOpen.bind(this),openEventName:"mouseenter"});this.updateConnectors()},_onBeforeOpen:function(d,f){var c=f.opener;var a=f.connector.opener;if(d.type=="click"){var b=d.findElement("a");
if(b&&b!=c){f.cancel=true;return}}if(a!=c&&this.visible()){this.ignoreNextBlur=true}this.setContent("body",c.infoEl.innerHTML);this.relElement=c;d.stop()},updateConnectors:function(a){(a||$(document.body)).select("div.js-business-infopop-click, div.js-business-infopop-hover, span.js-business-infopop-click, span.js-business-infopop-hover").each(function(f){var d=((f.title)?$(f.title):null);if(d){f.title=""}else{var c=f.previousSibling;if(c&&c.className&&(c.className.indexOf("js-opener")!=-1||c.className.indexOf("js-infopop-opener")!=-1)){d=$(c)
}else{var b=f.parentNode;if(b&&((b.className&&b.className.indexOf("js-infopop-opener")!=-1)||b.nodeName=="LI")){d=$(b)}}}if(!d){d=f.previous(".js-opener, .js-infopop-opener")||f.up(".js-infopop-opener, li")}if(d){d.infoEl=f;if(f.hasClassName("js-business-infopop-click")){this.clickConnector.addOpener(d,this)}else{this.hoverConnector.addOpener(d,this)}}else{this.debug("Could not find opener for "+f.toHtml())}}.bind(this));$log("BusinessInfoPop connectors updated")}}})})();var confirmSubscriptionRemovalCheckbox=null;
function confirmSubscriptionRemovalRequired(a){var b=a.select('[type="checkbox"].js_email_preference')[0];if(b!=undefined&&!b.checked&&!confirmSubscriptionRemovalCheckbox){openConfirmSubscriptionRemovalLightbox();b.checked=true;confirmSubscriptionRemovalCheckbox=b;return true}return false}function confirmSubscriptionRemoval(){confirmSubscriptionRemovalCheckbox.click();confirmSubscriptionRemovalCheckbox=null}var subscriptionHandlers={createCheckbox:function(a){if(confirmSubscriptionRemovalRequired(a)){return false
}var b=toggleSubscriptionSelect(a);if(b){return false}return subscriptionHandlers.create(a)},create:function(a,b){messageDiv=$(a).select(".subscription_messageArea")[0];messageSpan=$(messageDiv).select("span")[0];Effect.Appear(messageDiv);subscriptionMessage="Updating preference...";$(messageSpan).innerHTML=subscriptionMessage;return true},success:function(a,b){if(!b.success){subscriptionHandlers.failure(a,b);return}messageDiv=$(a).select(".subscription_messageArea")[0];messageSpan=$(messageDiv).select("span")[0];
messageSpan.innerHTML=b.successMessage;Effect.Fade(messageDiv,{delay:5});hitboxCustomEvent("User Preference Updated")},failure:function(b,c){messageDiv=$(b).select(".subscription_messageArea")[0];messageSpan=$(messageDiv).select("span")[0];messageSpan.innerHTML=c.errors[0];var d=$(b).select('[type="checkbox"]')[0];var a=$(b).select("select");if(a!=null&&a.length>0){a[0].selectedIndex=0}else{d.checked=!d.checked}Effect.Fade(messageDiv,{delay:5})}};function openConfirmSubscriptionRemovalLightbox(){Dtv.behaviors.AjaxLightbox.show("lightboxConfirmSubscriptionRemoval.jsp",{hitboxEvent:"Confirm Subscription Removal",enableCaching:true})
}function initializeMyAccountPage(){if($("billing-accordion-content")){Event.observe("billing-accordion-content",$consts(Dtv.behaviors.Accordion).EVENTS.ACCORDION_OPENED,retrieveBilling,false)}if($("pending-orders-accordion-content")){Event.observe("pending-orders-accordion-content",$consts(Dtv.behaviors.Accordion).EVENTS.ACCORDION_OPENED,retrievePendingOrders,false)}if($("completed-orders-accordion-content")){Event.observe("completed-orders-accordion-content",$consts(Dtv.behaviors.Accordion).EVENTS.ACCORDION_OPENED,retrieveCompletedOrders,false)
}if($("subscription-accordion")){var a=$$("form.ajaxForm").each(function(d){var b=d.select('[type="checkbox"]')[0];var c=d.select("select")[0];if(c!=null){new SubmitWatcher(c,d,{createHandler:subscriptionHandlers.create,successHandler:subscriptionHandlers.success,failureHandler:subscriptionHandlers.failure,returnValue:true,eventType:"change"})}if(b!=null){new SubmitWatcher(b,d,{createHandler:subscriptionHandlers.createCheckbox,successHandler:subscriptionHandlers.success,failureHandler:subscriptionHandlers.failure,returnValue:true});
b.disabled=false}})}}var billingRetrieved=false;function retrieveBilling(){if(billingRetrieved){return}var a=new Ajax.Updater("billing-accordion-content","/DTVAPP/mydirectv/account/component/myAccountBillingAjax.jsp",{method:"get"});billingRetrieved=true}var pendingOrdersRetrieved=false;function retrievePendingOrders(){if(pendingOrdersRetrieved){return}var a=new Ajax.Updater("pending-orders-accordion-content","/DTVAPP/mydirectv/account/component/myAccountPendingOrdersAjax.jsp",{method:"get"});pendingOrdersRetrieved=true
}var completedOrdersRetrieved=false;function retrieveCompletedOrders(){if(completedOrdersRetrieved){return}var a=new Ajax.Updater("completed-orders-accordion-content","/DTVAPP/mydirectv/account/component/myAccountCompletedOrdersAjax.jsp",{method:"get"});completedOrdersRetrieved=true}function toggleSubscriptionSelect(b){var a=b.select("div.subscription_selections");if(a.length==0){return false}var d=b.select('[type="checkbox"]')[0];var c=b.select("select")[0];if($(d).checked){Effect.Appear($(a[0]));
return true}else{c.selectedIndex=0;Effect.Fade($(a[0]));return false}}function setPaymentType(a){if($("ggHiddenPaymentType")){$("ggHiddenPaymentType").value=a}}function toggleOrderAccordion(b){var c=$(b);if(!c){return}var a=c.behaviors.Accordion.accordion;var d=$(c).select("h2")[0];a.activate(d);c.select(".orderDetailsNumberDefault")[0].toggleClassName("orderDetailsNumberSelected")}function openScheduleInstallLightbox(a,d){contentOptions={callback:"dtv:lightboxScheduleInstallOpened",contentDiv:"lightboxDiv",subContentDiv:"lb_thinking",hitboxPageName:"Schedule Installation Lightbox"};
displayLightbox(contentOptions,DEFAULT_CEP_LIGHTBOX_OPTIONS);var b="/DTVAPP/global/lightbox/lightboxScheduleInstallation.jsp";var c={method:"get",onComplete:initializeScheduleInstallLightbox,parameters:{orderId:a,subsystem:d},evalScripts:true};myAjax=new Ajax.Updater("lb_ajax",b,c)}function initializePaymentPage(a){if($("existing-card-radio")){$("existing-card-radio").observe("click",toggleSavedCreditCard.curry(true))}if($("new-card-radio")){$("new-card-radio").observe("click",toggleSavedCreditCard.curry(false))
}}function toggleSavedCreditCard(a){if(a){if($("payment-saved-credit")){$("payment-saved-credit").style.display="block"}if($("payment-update-credit")){$("payment-update-credit").style.display="none"}if($("payment-new-credit")){$("payment-new-credit").style.display="none"}if($("existing-card-toggle")){$("existing-card-toggle").select("label")[0].style.color="#000"}if($("new-card-toggle")){$("new-card-toggle").select("label")[0].style.color="#666"}}else{if($("payment-saved-credit")){$("payment-saved-credit").style.display="none"
}if($("payment-update-credit")){$("payment-update-credit").style.display="none"}if($("payment-new-credit")){$("payment-new-credit").style.display="block"}if($("existing-card-toggle")){$("existing-card-toggle").select("label")[0].style.color="#666"}if($("new-card-toggle")){$("new-card-toggle").select("label")[0].style.color="#000"}if($("saved-cc-update")){$("saved-cc-update").value=false}}}function updateSavedCreditCard(){if($("existing-card-radio")){$("existing-card-radio").click()}if($("payment-saved-credit")){$("payment-saved-credit").style.display="none"
}if($("payment-update-credit")){$("payment-update-credit").style.display="block"}if($("saved-cc-update")){$("saved-cc-update").value=true}if($("cc-use-stored")){$("cc-use-stored").value=false}if($("btn_autopay_submit_link")){$("btn_autopay_submit_link").style.display="block"}if($("btn_autopay_submit_link")){$("btn_autopay_cancel_link").style.display="block"}}function cancelUpdateCreditCard(a){if($("existing-card-radio")){toggleSavedCreditCard(false)}if($("payment-saved-credit")){$("payment-saved-credit").style.display="block"
}if($("payment-update-credit")){$("payment-update-credit").style.display="none"}if($("btn_autopay_submit_link")){if(a){$("btn_autopay_submit_link").innerHTML=a}else{$("btn_autopay_submit_link").style.display="none"}}if($("btn_autopay_cancel_link")){$("btn_autopay_cancel_link").style.display="none"}}var genericMyProgrammingHandlers={success:function(a,b){$log("genericMyProgrammingHandlers.success");if(!b.success&&b.nextUrl==null){genericMyProgrammingHandlers.failure(a,b);return}if(b.redirectUrl!=null){$log("genericMyProgrammingHandlers redirecting to: "+b.redirectUrl);
window.location.href=b.redirectUrl;return}if(b.reload){$log("genericMyProgrammingHandlers reloading");window.location.reload(true);return}if(b.nextUrl==null){b.errors.push("nextUrl not specified");genericMyProgrammingHandlers.failure(a,b);return}if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}contentOptions={callback:"dtv:lightboxCEPOpened",contentDiv:"lightboxDiv",subContentDiv:"lb_thinking",suppressHitbox:true};displayLightbox(contentOptions,DEFAULT_CEP_LIGHTBOX_OPTIONS);
ajaxOptions={topMessages:b.topMessages,rightMessage:b.rightMessage,bottomMessage:b.bottomMessage};$log("genericMyProgrammingHandlers next URL: "+b.nextUrl);myAjax=new Ajax.Updater("lb_ajax",b.nextUrl,{method:"get",onComplete:transitionToAjaxContent,parameters:ajaxOptions})},failure:function(a,b){$log("genericMyProgrammingHandlers.failure");displayGenericErrorLightbox(b)}};function initializeProductListingPage(){var d=$$("form.ajaxForm");for(var c=0;c<d.length;c++){var f=d[c].select(".ajaxSubmit");
if(f.length==0){continue}var b=f[0];new SubmitWatcher(b,d[c],{successHandler:genericMyProgrammingHandlers.success,failureHandler:genericMyProgrammingHandlers.failure});b.disabled=false}initializePromoCodeWatcher();oneClickForm=$("oneClickHiddenForm");oneClickSubmit=$("oneClickHiddenSubmit");if(oneClickForm!=null&&oneClickSubmit!=null){var a=new SubmitWatcher(oneClickSubmit,oneClickForm,{successHandler:genericMyProgrammingHandlers.success,failureHandler:genericMyProgrammingHandlers.failure});a.hijackNode(oneClickSubmit)
}}var promoCodeHandlers={create:function(a,b){hitboxCustomEvent("Enter Promo Code Lightbox",null);return true},success:function(a,b){if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}if(!b.success){promoCodeHandlers.failure(a,b);return}if(b.nextUrl!=null){window.location.href=b.nextUrl;return}b.errors.push("nextUrl not specified");promoCodeHandlers.failure(a,b)},failure:function(a,b){if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()
}processJSONErrors("lb_enter_promo_code","ajaxError",b);hitboxCustomEvent("Enter Promo Code Lightbox",null)}};function enterPromoCodeLightbox(){contentOptions={callback:"dtv:lightboxCEPOpened",contentDiv:"lightboxDiv",subContentDiv:"lb_enter_promo_code",hitboxPageName:"Promo+Code+Lightbox"};var a=DEFAULT_CEP_LIGHTBOX_OPTIONS;a.top=100;displayLightbox(contentOptions,a)}function initializePromoCodeWatcher(){if($("ajaxPromoForm")!=null){new SubmitWatcher($("ajaxPromoSubmit"),$("ajaxPromoForm"),{createHandler:promoCodeHandlers.create,successHandler:promoCodeHandlers.success,failureHandler:promoCodeHandlers.failure});
$("ajaxPromoSubmit").disabled=false}}var changeReceiverLocationHandlers={create:function(a,b){if($(b).hasClassName("js_receiverLocation")){selectObj=a.select(".js_receiverLocation")[0];if(selectObj.options[selectObj.selectedIndex].value==""){return false}otherObj=a.select(".js_receiver_location_change_other")[0];if(selectObj.options[selectObj.selectedIndex].value=="Other"){Effect.Appear(otherObj);return false}if($(otherObj).visible()){Effect.Fade(otherObj)}}a.select(".js_receiver_location_change")[0].hide();
displayReceiverChangeProcessing(a.select(".js_statusMessage")[0]);return true},success:function(a,b){if(!b.success){changeReceiverLocationHandlers.failure(a,b);return}locationTextObj=a.select(".js_receiver_location")[0];locationTextObj.innerHTML=b.location;changeReceiverLocationHandlers.reset(a);hitboxCustomEvent("Receiver+Location+Changed")},failure:function(a,b){changeReceiverLocationHandlers.reset(a);displayGenericErrorLightbox(b)},reset:function(a){optionsObj=a.select(".js_receiver_location_change")[0];
optionsObj.hide();otherObj=a.select(".js_receiver_location_change_other")[0];otherObj.hide();selectObj=a.select("select.js_receiverLocation")[0];selectObj.selectedIndex=0;hideReceiverChangeProcessing(a.select(".js_statusMessage")[0]);changeObj=a.select(".js_receiver_location_label")[0];Effect.Appear(changeObj)}};function displayReceiverChangeProcessing(a,b){$(a).update('<div class="processing_status">Processing...</div>');if($(b)!=null){$(b).hide()}$(a).show()}function hideReceiverChangeProcessing(a,b){if($(b)!=null){$(a).hide();
Effect.Appear(b)}else{Effect.Fade(a)}$(a).update("")}function changeReceiverLocation(a){formObj=$(a).up("form");locationChangeObj=formObj.select(".js_receiver_location_label")[0];Element.hide(locationChangeObj);selectObj=formObj.select(".js_receiver_location_change")[0];Effect.Appear(selectObj)}function initializeTargetedMessageBars(){var a=$$(".js_cep_target_message");a.each(function(c){var b=c.select("a")[0];if(b==null){return}c.observe("mouseover",function(){c.addClassName("hover")});c.observe("mouseout",function(){c.removeClassName("hover")
});c.observe("click",function(){location.href=b.href})})}function initializeMyProgrammingPage(){var f=$$("form.ajaxForm");for(var d=0;d<f.length;d++){var c=f[d].select(".ajaxSubmit")[0];new SubmitWatcher(c,f[d],{successHandler:genericMyProgrammingHandlers.success,failureHandler:genericMyProgrammingHandlers.failure});c.disabled=false}var a=$$(".changeReceiverLocationForm");for(var d=0;d<a.length;d++){var g=a[d].select("select.js_receiverLocation")[0];var b=a[d].select(".js_changeReceiverLocationSubmit")[0];
new SubmitWatcher(g,a[d],{createHandler:changeReceiverLocationHandlers.create,successHandler:changeReceiverLocationHandlers.success,failureHandler:changeReceiverLocationHandlers.failure,returnValue:true,eventType:"change"});new SubmitWatcher(b,a[d],{createHandler:changeReceiverLocationHandlers.create,successHandler:changeReceiverLocationHandlers.success,failureHandler:changeReceiverLocationHandlers.failure});b.disabled=false}initializePromoCodeWatcher();initializeTargetedMessageBars()}function openConfirmEmptyCartLightbox(){contentOptions={contentDiv:"lightboxDiv",subContentDiv:"lb_confirm_empty",callback:"dtv:confirmEmptyLightbox",hitboxPageName:"Confirm Empty Cart Lightbox"};
if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}displayLightbox(contentOptions,DEFAULT_CEP_LIGHTBOX_OPTIONS)}var replaceReceiverHandlers={create:function(a,b){return true},success:function(a,b){},failure:function(a,b){}};function cancelShippingChange(){selectObj=$("changeShippingSelect");if(selectObj!=null){if(selectObj.selectedIndex==0){selectObj.selectedIndex=1}else{selectObj.selectedIndex=0}}closeLightbox()}function initializeShoppingCartPage(){var c=$$("form.ajaxForm");
for(var b=0;b<c.length;b++){var a=c[b].select(".ajaxSubmit")[0];new SubmitWatcher(a,c[b],{successHandler:genericMyProgrammingHandlers.success,failureHandler:genericMyProgrammingHandlers.failure});a.disabled=false}changeShippingFormObj=$("changeShippingForm");changeShippingSelectObj=$("changeShippingSelect");if(changeShippingFormObj&&changeShippingSelectObj){new SubmitWatcher(changeShippingSelectObj,changeShippingFormObj,{successHandler:genericMyProgrammingHandlers.success,failureHandler:genericMyProgrammingHandlers.failure,returnValue:true,eventType:"change"})
}replaceReceiverFormObj=$("replaceReceiverForm");if(replaceReceiverFormObj){replaceReceiverRadios=replaceReceiverFormObj.select(".ajaxReplaceReceiver");if(replaceReceiverRadios&&replaceReceiverRadios.length==2){new SubmitWatcher(replaceReceiverRadios[0],replaceReceiverFormObj,{createHandler:replaceReceiverHandlers.create,successHandler:replaceReceiverHandlers.success,failureHandler:replaceReceiverHandlers.failure,returnValue:true,eventType:"change"});new SubmitWatcher(replaceReceiverRadios[1],replaceReceiverFormObj,{createHandler:replaceReceiverHandlers.create,successHandler:replaceReceiverHandlers.success,failureHandler:replaceReceiverHandlers.failure,returnValue:true,eventType:"change"})
}}}function initializeQuickShopLandingPage(){quickShopForm=$("quickShop");if(quickShopForm){new SubmitWatcher(null,quickShopForm,{successHandler:genericMyProgrammingHandlers.success,failureHandler:genericMyProgrammingHandlers.failure})}}function initializeCheckoutConfirmationPage(){}function changeAddressLightbox(a){subContentDiv="lb_change_shipping_address";if(a=="BILLING"){subContentDiv="lb_change_billing_address"}contentOptions={callback:"dtv:lightboxChangeAddressOpened",contentDiv:"lightboxDiv",subContentDiv:subContentDiv,hitboxPageName:"Change Address Lightbox"};
displayLightbox(contentOptions,DEFAULT_CEP_LIGHTBOX_OPTIONS)}var checkoutAddressHandlers={success:function(a,b){if(!b.success){checkoutAddressHandlers.failure(a,b);return}closeLightbox();window.location.reload(true)},failure:function(a,b){if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}checkoutAddressHandlers._handleErrors(a,b);hitboxCustomEvent("Change Address Lightbox",null)},_handleErrors:function(a,c){var d=$("lb_change_billing_address");addressType="BILLING";
if(!a.descendantOf("lb_change_billing_address")){d=$("lb_change_shipping_address");addressType="SHIPPING"}if(c.errorFields!=null&&c.errorFields.length>0){for(var b=0;b<c.errorFields.length;b++){c.errorFields[b]=addressType+c.errorFields[b]}}processJSONErrors(d,"ajaxError",c)}};function togglePaymentMethod(b,c){var b=$(b);if(!b){return}var a=b.behaviors.Accordion.accordion;var c=$(c);if(c.hasClassName("active")){return}a.activate(c)}function initializeCheckoutPaymentPage(){var b=$("lb_change_billing_address").select("form.ajaxForm")[0];
var a=b.select(".ajaxSubmit")[0];new SubmitWatcher(a,b,{successHandler:checkoutAddressHandlers.success,failureHandler:checkoutAddressHandlers.failure});a.disabled=false;var b=$("lb_change_shipping_address").select("form.ajaxForm")[0];var a=b.select(".ajaxSubmit")[0];new SubmitWatcher(a,b,{successHandler:checkoutAddressHandlers.success,failureHandler:checkoutAddressHandlers.failure});a.disabled=false}function setPowerstrip(a){var b=document.dodForm.receivers;if(a==b.options[b.selectedIndex].value){document.dodForm.additionalKits[0].checked=true
}else{document.dodForm.additionalKits[1].checked=true}refreshPowerstripOptions()}function setAdditionalKits(){refreshPowerstripOptions()}function refreshPowerstripOptions(){var d=document.dodForm.receivers;var c=d.options[d.selectedIndex].value-1;if(document.dodForm.additionalKits[0].checked){c=d.options[d.selectedIndex].value;$("extraKitAdded").show();$("extraSpace").hide()}else{$("extraKitAdded").hide();$("extraSpace").show()}$("powerstrips").options.length=0;for(var b=-1;b<=c;b++){var a=document.createElement("OPTION");
a.value=b+1;a.text=b+1;$("powerstrips").options.add(a)}}var _LISTING_OPEN_BLIND_DURATION=0.7;var _LISTING_CLOSE_BLIND_DURATION=0.2;var _LISTING_FAILURE_MESSAGE='<div class="listing-program-tup clear-after"><strong><br /><br />&#160;&#160;Unable to retrieve program information.<br /><br /></strong></div>';var LISTING_PROGRAM_DETAIL_AJAX_URL="/DTVAPP/listing/component/programDetailAjax.jsp";var LISTING_GAME_LOUNGE_DETAIL_AJAX_URL="/DTVAPP/listing/component/gameLoungeDetailAjax.jsp";var LISTING_LAND_AND_EXPAND_AJAX_URL="/DTVAPP/listing/component/landAndExpandAjax.jsp";
var LISTING_GAME_LOUNGE_ORDER_AJAX_URL="/DTVAPP/listing/component/tabOrderGamepass.jsp";var LISTING_PPV_ORDER_AJAX_URL="/DTVAPP/listing/component/tabOrderPpv.jsp";var _LISTING_PROGRAM_DETAIL_DISPLAYED_ROW_ID="";var _LISTING_PROGRAM_DETAIL_DISPLAYED_COLUMN_ID="";var _LISTING_ROW_ACTIVE_CLASS="title-active";var _LISTING_CAROUSEL_EXPANSION_ROW_ID="listing_carousel_details";var _LISTING_AJAX_FORM_SUBMIT_OFFSET=180;var _LISTING_SCROLL_OFFSET=40;var _LISTING_HITBOX_SUBSYSTEM="";var _LISTING_HITBOX_CART_ADD_PAGE_NAME="";
var _LISTING_HITBOX_CART_ADD_CATEGORY="";var _LISTING_HITBOX_ORDER_CONFIRM_PAGE_NAME="";var _LISTING_HITBOX_ORDER_CONFIRM_CATEGORY="";var _LISTING_HITBOX_PPV_CATEGORY="";var _LISTING_DETAILS_LISTING_TYPE="";var DETAILS_TYPE_DOD_LISTING="DOD_LISTING";var DETAILS_TYPE_EPG_LISTING="EPG_LISTING";var DETAILS_TYPE_GAME_LISTING="GAME_LISTING";var DETAILS_TYPE_PPV_ADULT="PPV_ADULT";var DETAILS_TYPE_PPV_MOVIE="PPV_MOVIE";var DETAILS_TYPE_PPV_EVENT="PPV_EVENT";function initializeEpg(){_LISTING_HITBOX_SUBSYSTEM="HITBOX_SUBSYSTEM_PPV";
_LISTING_HITBOX_CART_ADD_PAGE_NAME="orderPayPerView4";_LISTING_HITBOX_CART_ADD_CATEGORY="/HOME/PPV_ORDERIN";_LISTING_HITBOX_ORDER_CONFIRM_PAGE_NAME="orderPayPerView5";_LISTING_HITBOX_ORDER_CONFIRM_CATEGORY="/HOME/PPV_ORDERIN";_LISTING_HITBOX_PPV_CATEGORY="PPV_MOVIES";_LISTING_DETAILS_LISTING_TYPE=DETAILS_TYPE_EPG_LISTING;document.observe(EVENT_LISTING_EXPANDED,function(a){scrollListing(a.target.id)})}function showMoreChannels(){var a=parent.location.href;if(a.indexOf("?")==-1){a+="?sm=1"}else{a+="&sm=1"
}a+="#more";parent.location.href=a;return false}function processSeriesResponse(a,f){f=$(f);if(f.select(".js_series_span").length!=1){return}var d=f.select(".js_series_span")[0];var c=f.select(".js_series_radio_false")[0];var b=f.select(".js_series_radio_true")[0];if(a){d.style.opacity=1;d.style.filter="alpha(opacity=100)";c.disabled=false;b.disabled=false}else{d.style.opacity=0.5;d.style.filter="alpha(opacity=50)";c.checked=true;c.disabled=true;b.disabled=true}}function allowDefRecord(b,d){d=$(d);
var a=d.select(".epg-record-options-ip")[0];var c=d.select(".epg-record-options-def")[0];if(b){c.disabled=false}else{a.checked=true;c.disabled=true}}var recordToReceiverHandlers={success:function(a,b){if(!b.success){recordToReceiverHandlers.failure(a,b);return}if(b.internetRequired){if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}displayDodInternetLightbox();return}var a=$(a);processJSONErrors(a,"ajaxError",b);b.messages.each(function(c){a.up("div").next(".js_record_message").down("ul").insert("<li>"+c+"</li>")
});a.up("div").hide();a.up("div").next(".js_record_message").show();hitboxCustomEvent("Record to Receiver Confirmation","global");if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}},failure:function(a,b){processJSONErrors(a,"ajaxError",b);if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}hitboxCustomEvent("Record to Receiver Failure",null)}};var dodInternetHandlers={success:function(a,b){if(!b.success){dodInternetHandlers.failure(a,b);
return}processJSONErrors("lb_dod_internet","ajaxError",b);closeLightbox()},failure:function(a,b){processJSONErrors(a,"ajaxError",b);if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}}};var listingStmsPasswordHandlers={success:function(a,c){if(!c.success){listingStmsPasswordHandlers.failure(a,c);return}processJSONErrors(a,"ajaxError",c);if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}var g=$("btnContinueStms");var f=g.up(".epg-detail-tup");
g.disabled=true;var h=f.down(".js_order_listing_id").value;var d="order_"+h;var b="order_tab_"+h;ajaxFormSubmitAndPopulate("btnContinueStms",f,LISTING_PPV_ORDER_AJAX_URL,_LISTING_FAILURE_MESSAGE,_initializeListingOrderTab.curry(d,b,LISTING_PPV_ORDER_AJAX_URL),0)},failure:function(a,b){processJSONErrors(a,"ajaxError",b);if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}}};function _initializeListingDodTab(b,c){b=$(b);if(!b){return}var d=b.down("form.ajaxForm");
if(d){var a=d.down('input[type="submit"]');if(a){new SubmitWatcher(a,d,{successHandler:recordToReceiverHandlers.success,failureHandler:recordToReceiverHandlers.failure});a.disabled=false}}$(c).observe($consts(Dtv.behaviors.CollapsibleTab).EVENTS.COLLAPSIBLE_TAB_OPENED,hitboxCustomEvent.curry("Record to Receiver Select",null))}var orderListingHandlers={success:function(a,b){if(!b.success){orderListingHandlers.failure(a,b);return}a=$(a);processJSONErrors(a,"ajaxError",b);b.messages.each(function(c){a.up("div").next(".js_success_message").down("ul").insert("<li>"+c+"</li>")
});a.up("div").hide();a.up("div").next(".js_success_message").show();hitboxCommerceReport("HITBOX_ORDER_CONFIRM",_LISTING_HITBOX_SUBSYSTEM,_LISTING_HITBOX_ORDER_CONFIRM_PAGE_NAME,_LISTING_HITBOX_ORDER_CONFIRM_CATEGORY);if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}},failure:function(a,b){processJSONErrors(a,"ajaxError",b);if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.stop()}hitboxCustomEvent("Order PPV Failure",null)}};
function _initializeListingOrderTab(b,a,d){b=$(b);if(!b){return}var c=b.down("form");if(!_initializeOrderTabSubmit(c)){return}$(a).observe($consts(Dtv.behaviors.CollapsibleTab).EVENTS.COLLAPSIBLE_TAB_OPENED,hitboxCommerceReport.curry("HITBOX_CART_ADD",_LISTING_HITBOX_SUBSYSTEM,_LISTING_HITBOX_CART_ADD_PAGE_NAME,_LISTING_HITBOX_CART_ADD_CATEGORY));b.select(".js_ajax_order_submit").each(function(f){if(f.tagName=="SELECT"){f.observe("change",ajaxFormSubmitAndPopulate.curry(f,b,d,_LISTING_FAILURE_MESSAGE,_initializeListingOrderTab.curry(b,a,d),_LISTING_AJAX_FORM_SUBMIT_OFFSET))
}})}function initializePlayboyOrderBlock(a){if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.reset()}var b=$(a).down("form");if(!_initializeOrderTabSubmit(b)){return}_initializeStmsPasswordHandlers();hitboxCommerceReport("HITBOX_CART_ADD",_LISTING_HITBOX_SUBSYSTEM,_LISTING_HITBOX_CART_ADD_PAGE_NAME,_LISTING_HITBOX_CART_ADD_CATEGORY)}function _initializeOrderTabSubmit(b){b=$(b);if(!b){return false}var a=b.down('input[type="submit"]');if(!a){return false}new SubmitWatcher(a,b,{successHandler:orderListingHandlers.success,failureHandler:orderListingHandlers.failure});
a.disabled=false;return true}function initializeGameDetailTab(c,a){var g="epg_detail_"+c;var f="order_"+c;var b="order_tab_"+c;var d=LISTING_GAME_LOUNGE_ORDER_AJAX_URL;_initializeListingTab(g,"","",f,b,d,a)}function initializeListingDetailTab(j,a){var h="epg_detail_"+j;var c="record_"+j;var g="record_tab_"+j;var f="order_"+j;var b="order_tab_"+j;var d=LISTING_PPV_ORDER_AJAX_URL;_initializeListingTab(h,c,g,f,b,d,a);_initializeStmsPasswordHandlers()}function _initializeStmsPasswordHandlers(){stmsSubmitButton=$("btnContinueStms");
if(stmsSubmitButton){var a=stmsSubmitButton.up("form");new SubmitWatcher(stmsSubmitButton,a,{successHandler:listingStmsPasswordHandlers.success,failureHandler:listingStmsPasswordHandlers.failure});stmsSubmitButton.disabled=false}}function _initializeListingTab(b,d,h,g,c,f,a){Dtv.behaviors.applyBehavior(b,"CollapsibleTab",".js-collapsible-tabs");if(Dtv.behaviors.isCompiled("ProcessingWatcher")){Dtv.behaviors.ProcessingWatcher.reset()}h=$(h);if(h){_initializeListingDodTab(d,h)}c=$(c);if(c){_initializeListingOrderTab(g,c,f)
}a=$(a);if(a){a.fire($consts(Dtv.behaviors.CollapsibleTab).EVENTS.COLLAPSIBLE_TAB_ACTIVATE)}}function initializeDodProgramming(){dodInternetForm=$("dod_internet_form");if(dodInternetForm){submitButton=dodInternetForm.select(".ajaxSubmit")[0];if(submitButton){new SubmitWatcher(submitButton,dodInternetForm,{successHandler:dodInternetHandlers.success,failureHandler:dodInternetHandlers.failure});submitButton.disabled=false}}}function resetDodFilters(a){if(a=="selectChannel"){$("selectRating").selectedIndex=0;
a="selectRating"}if(a=="selectRating"){$("selectFormat").selectedIndex=0}$("pagination_alphabet").value=""}function postMarketingLoginRequired(){window.location.reload(true)}function displayDodInternetLightbox(){contentOptions={callback:"dtv:dodInternetLightboxLoginOpened",contentDiv:"lightboxDiv",subContentDiv:"lb_dod_internet",hitboxPageName:"DOD+Internet+Lightbox"};displayLightbox(contentOptions,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS)}function initializeListingPage(a){_LISTING_HITBOX_SUBSYSTEM=a.hitboxSubsystem;
_LISTING_HITBOX_CART_ADD_PAGE_NAME=a.hitboxCartAddPageName;_LISTING_HITBOX_CART_ADD_CATEGORY=a.hitboxCartAddCategory;_LISTING_HITBOX_ORDER_CONFIRM_PAGE_NAME=a.hitboxOrderConfirmPageName;_LISTING_HITBOX_ORDER_CONFIRM_CATEGORY=a.hitboxOrderConfirmCategory;_LISTING_HITBOX_PPV_CATEGORY=a.hitboxPpvCategory;_LISTING_DETAILS_LISTING_TYPE=a.detailsListingType;document.observe("dom:loaded",_addListingObservers.curry(a.ajaxContainer,a.ajaxGridUrl));document.stopObserving(EVENT_LISTING_EXPANDED,function(b){scrollListing(b.target.id)
});document.observe(EVENT_LISTING_EXPANDED,function(b){scrollListing(b.target.id)})}function _addListingObservers(a,b){a=$(a);a.select(".js_ajax_submit").each(function(c){if(c.tagName=="A"){c.onclick=function(){return false};c.observe("click",_ajaxListingAnchorSubmit.curry(c,a,b))}else{if(c.tagName=="SELECT"){c.observe("change",ajaxFormSubmitAndPopulate.curry(c,a,b,_LISTING_FAILURE_MESSAGE,_ajaxListingSubmitComplete.curry(a,b),0))}else{if(c.match('input[type="checkbox"]')){c.observe("click",ajaxFormSubmitAndPopulate.curry(c,a,b,_LISTING_FAILURE_MESSAGE,_ajaxListingSubmitComplete.curry(a,b),0))
}else{if(c.match('input[type="submit"]')){c.observe("click",ajaxFormSubmitAndPopulate.curry(c,a,b,_LISTING_FAILURE_MESSAGE,_ajaxListingSubmitComplete.curry(a,b),0))}}}}});a.select(".js_ajax_link").each(function(c){c.onclick=function(){return false};c.observe("click",ajaxRequestAndPopulate.curry(a,b,c.rel,_LISTING_FAILURE_MESSAGE,_ajaxListingSubmitComplete.curry(a,b),0))});a.select(".js_playboy_time_zone").each(function(c){c.observe("change",_playboyTimeZoneChange.curry(c,a,b))})}function _playboyTimeZoneChange(b,a,c){$("playboy_listing_flag").value="";
a=$(a);a.down(".js_listing_date_select").selectedIndex=0;a.down(".js_listing_time_select").selectedIndex=0;ajaxFormSubmitAndPopulate(b,a,c,_LISTING_FAILURE_MESSAGE,_ajaxListingSubmitComplete.curry(a,c),0)}function _ajaxListingAnchorSubmit(a,f,j){var b=$(a).rel;if(b==null||b.indexOf("|")==-1){throw"Ajax submit links must have a rel attribute of the form field|value"}var d=b.split("|");var h;for(var c=0;c<d.length;c+=2){var h=$(b.split("|")[c]);if(!h){throw"Invalid rel attribute "+b+" - field "+b.split("|")[c]+" does not exist"
}var g=b.split("|")[c+1];h.value=g}ajaxFormSubmitAndPopulate(h,f,j,_LISTING_FAILURE_MESSAGE,_ajaxListingSubmitComplete.curry(f,j),0)}function _ajaxListingSubmitComplete(a,b){_addListingObservers(a,b)}function expandListing(g,a,b,h){a=$(a);if(!a){return false}var c=$("js_carousel_container");if(c&&c.behaviors){c.behaviors.ListingCarousel.unselectItem()}var f=_contractCurrentListing(a,g);if(f||_LISTING_PROGRAM_DETAIL_DISPLAYED_ROW_ID!=a.identify()){_contractListing()}$$("."+_LISTING_ROW_ACTIVE_CLASS).invoke("removeClassName",_LISTING_ROW_ACTIVE_CLASS);
if(f){_LISTING_PROGRAM_DETAIL_DISPLAYED_ROW_ID="";_LISTING_PROGRAM_DETAIL_DISPLAYED_COLUMN_ID="";return false}if(document.location.href.indexOf("landandexpand=true")!=-1){b=LISTING_LAND_AND_EXPAND_AJAX_URL}if(_LISTING_HITBOX_PPV_CATEGORY){h.hitboxPpvCategory=_LISTING_HITBOX_PPV_CATEGORY}h=Object.extend(h,{detailsListingType:_LISTING_DETAILS_LISTING_TYPE});_LISTING_PROGRAM_DETAIL_DISPLAYED_ROW_ID=a.identify();_LISTING_PROGRAM_DETAIL_DISPLAYED_COLUMN_ID=g;if(a.tagName=="TR"){a.down("td").update();a.down("td").setStyle({height:"auto"})
}else{a.update();a.setStyle({height:"auto"})}var d=new Element("div");if(a.tagName=="TR"){a.down("td").insert(d)}else{a.insert(d)}appearContent(a,_PROCESSING_NOTIFICATION_DIV,"js_listing_processing");_loadAjaxFormContent(d,a,h,b,g);return false}function contractListing(){if(_LISTING_PROGRAM_DETAIL_DISPLAYED_ROW_ID==""){return}expandListing(null,_LISTING_PROGRAM_DETAIL_DISPLAYED_ROW_ID)}function scrollListing(a){var b=_LISTING_SCROLL_OFFSET;if(a==_LISTING_CAROUSEL_EXPANSION_ROW_ID){b=270}if(!isVisible(a,b)){scrollWithOffset(a,b)
}}function _contractListing(){if(!($(_LISTING_PROGRAM_DETAIL_DISPLAYED_ROW_ID))){_LISTING_PROGRAM_DETAIL_DISPLAYED_ROW_ID=""}if(_LISTING_PROGRAM_DETAIL_DISPLAYED_ROW_ID==""){return}closeTooltipsByDiv(_LISTING_PROGRAM_DETAIL_DISPLAYED_ROW_ID);var a=$(_LISTING_PROGRAM_DETAIL_DISPLAYED_ROW_ID);var b=$(a).down("div");if(!b){return}b.fade({duration:_LISTING_CLOSE_BLIND_DURATION,afterFinish:_contractListingCleanup.curry(a,b)})}function addCarouselOpeners(a){carouselExpansionObj=$(_LISTING_CAROUSEL_EXPANSION_ROW_ID);
if(!carouselExpansionObj){setTimeout(addCarouselOpeners.curry(a),300);return}var d={closeClassName:"js_collapse",closeEvents:[$consts(Dtv.behaviors.ExpandableRow).EVENTS.EXPANDABLE_ROW_DEACTIVATE],closeHandler:function(){var g=$("js_carousel_container");if(g&&g.behaviors){g.behaviors.ListingCarousel.unselectItem()}},openEvents:[$consts(Dtv.behaviors.ExpandableRow).EVENTS.EXPANDABLE_ROW_ACTIVATE],openHandler:function(){contractListing()}};var c=carouselExpansionObj.behavior(Dtv.behaviors.ExpandableRow);
c.setOptions(d);for(var b=0;b<a.length;b++){openerAjaxUrl=LISTING_PROGRAM_DETAIL_AJAX_URL;var f=_buildCarouselOpenerParams(a[b]);if(document.location.href.indexOf("landandexpand=true")!=-1){openerAjaxUrl=LISTING_LAND_AND_EXPAND_AJAX_URL}c.addOpener(a[b].openerId,{openerAjaxUrl:openerAjaxUrl,openerParams:f})}}function _buildCarouselOpenerParams(b){var a={carousel:true,carouselTitle:b.title,carouselPremierStart:b.premierStart,carouselDescription:b.description};if(!b.defaultCarouselId){openerAjaxUrl=LISTING_PROGRAM_DETAIL_AJAX_URL
}else{if(_LISTING_DETAILS_LISTING_TYPE==DETAILS_TYPE_GAME_LISTING){a=Object.extend(a,{game_id:b.defaultCarouselId});openerAjaxUrl=LISTING_GAME_LOUNGE_DETAIL_AJAX_URL}else{if(_LISTING_DETAILS_LISTING_TYPE==DETAILS_TYPE_DOD_LISTING){a=Object.extend(a,{materialId:b.defaultCarouselId})}else{a=Object.extend(a,{listingId:b.defaultCarouselId});if(b.carouselId){a=Object.extend(a,{sdCarouselId:b.carouselId})}if(b.altCarouselId){a=Object.extend(a,{hdCarouselId:b.altCarouselId})}}}}return a}function _contractCurrentListing(a,b){if(_LISTING_PROGRAM_DETAIL_DISPLAYED_ROW_ID!=$(a).identify()){return false
}return(b==undefined||b==_LISTING_PROGRAM_DETAIL_DISPLAYED_COLUMN_ID)}function _loadAjaxFormContent(d,a,g,b,c){var f={method:"post",parameters:g,onComplete:_expandListingComplete.curry(d,a,c)};new Ajax.Request(b,f)}function _expandListingComplete(h,c,g,a,f){if(a.status<200||a.status>300){$(h).update(_LISTING_FAILURE_MESSAGE);return}var b=$(h).down("div.js_listing_processing");$(b).remove();var d={duration:_LISTING_OPEN_BLIND_DURATION,afterFinish:Event.fire.curry($(_LISTING_PROGRAM_DETAIL_DISPLAYED_ROW_ID),EVENT_LISTING_EXPANDED)};
appearContent(c,a.responseText,"js_listing_content",d);if($(g)){$(g).addClassName(_LISTING_ROW_ACTIVE_CLASS)}}function _contractListingCleanup(a,b){$(b).remove();$(a).hide();$(a).fire(EVENT_LISTING_CONTRACTED)}function listingLandAndExpand(c,a,b,d){document.observe("dom:loaded",expandListing.curry(c,a,b,d));document.observe("dom:loaded",scrollWithOffset.curry(a,_LISTING_SCROLL_OFFSET))}function togglePpvOrder(b,a){$(b).childElements().each(function(c){if($(c).identify()!=$(a).identify()){$(c).hide()
}});$(a).show();closeTooltipsByDiv(b)}function commonSenseURLRetrieval(c,h,b,f,d){var a="/DTVAPP/epg/commonSense.jsp";a+="?type="+c.replace(/\s/g,"+");a+="&title="+h.replace(/\s/g,"+");for(i=0;i<b.length;i++){a+="&cast[]="+b[i].replace(/\s/g,"+")}var g={requestHeaders:{Accept:"application/json"},method:"get",mimetype:"application/json",onComplete:function(n){try{var l=n.responseText.evalJSON();if(l.error){return}var j=function(){var o=l.media.url;if(document.location.href.indexOf("https")!=-1){o=o.replace(/http\:/,"https:")
}$(d).src=o;$(f).fire(EVENT_COMMON_SENSE_IFRAME_LOADED)};var m=function(){$(f).stopObserving($consts(Dtv.behaviors.CollapsibleTab).EVENTS.COLLAPSIBLE_TAB_OPENED,j)};$(f).observe($consts(Dtv.behaviors.CollapsibleTab).EVENTS.COLLAPSIBLE_TAB_OPENED,j);$(f).observe(EVENT_COMMON_SENSE_IFRAME_LOADED,m);Effect.Appear(f)}catch(k){$log("Unable to parse JSON Common Sense result for URL: "+a+" | "+k);return}},onFailure:function(j){$log("Failure retrieving JSON Common Sense result")}};new Ajax.Request(a,g)}createCookie("iframeheight","0");
document.observe("dom:loaded",function(){if($("dtv_thirdparty_iframe")){$("dtv_thirdparty_iframe").observe("load",function(){var b=true;var c=0;var a=setInterval(function(){if(window.location.hash.indexOf("#h:")!=-1){var f=window.location.hash.substr(window.location.hash.indexOf("#h:")+3);var d=readCookie("iframeheight");if(b){if(f!=d){createCookie("iframeheight",f);$("dtv_thirdparty_iframe").style.height=(parseInt(f))+"px";$("dtv_thirdparty_iframe").style.overflow="hidden"}else{iframeSafeMode()}}else{if(f!=d){$("dtv_thirdparty_iframe").style.height=(parseInt(f))+"px";
$("dtv_thirdparty_iframe").style.overflow="hidden"}}}else{iframeSafeMode()}if(c>20){clearInterval(a)}else{c++}b=false},250)})}});function iframeSafeMode(){$("dtv_thirdparty_iframe").style.height="1000px";$("dtv_thirdparty_iframe").style.overflow="auto"}function resizeMe(){};