if(!window.console){var console={init:function(){console.s=""},draw:function(){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(){console.d.style.display="none"},show:function(){console.d.style.display="block"},log:function(a){console.s+="<br />"+a;if(typeof(console.d)!="undefined"){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()}}}};console.addLoadEvent(console.draw);console.init()}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;
console.log(b+" : "+a+" : "+c)}}logJsProgress("[ init ]");
/*
 * FlashObject v1.3c: Flash detection and embed - http://blog.deconcept.com/flashobject/
 *
 * FlashObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof com=="undefined"){var com=new Object()}if(typeof com.deconcept=="undefined"){com.deconcept=new Object()}if(typeof com.deconcept.util=="undefined"){com.deconcept.util=new Object()}if(typeof com.deconcept.FlashObjectUtil=="undefined"){com.deconcept.FlashObjectUtil=new Object()
}com.deconcept.FlashObject=function(p,b,r,e,l,n,g,f,d,o,m){if(!document.createElement||!document.getElementById){return}this.DETECT_KEY=m?m:"detectflash";this.skipDetect=com.deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();this.useExpressInstall=g;if(p){this.setAttribute("swf",p)}if(b){this.setAttribute("id",b)}if(r){this.setAttribute("width",r)}if(e){this.setAttribute("height",e)}if(l){this.setAttribute("version",new com.deconcept.PlayerVersion(l.toString().split(".")))
}this.installedVer=com.deconcept.FlashObjectUtil.getPlayerVersion(this.getAttribute("version"),g);if(n){this.addParam("bgcolor",n)}var a=f?f:"high";this.addParam("quality",a);var k=(d)?d:window.location;this.setAttribute("xiRedirectUrl",k);this.setAttribute("redirectUrl","");if(o){this.setAttribute("redirectUrl",o)}};com.deconcept.FlashObject.prototype={setAttribute:function(a,b){this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addParam:function(b,a){this.params[b]=a},getParams:function(){return this.params
},addVariable:function(b,a){this.variables[b]=a},getVariable:function(a){return this.variables[a]},getVariables:function(){return this.variables},createParamTag:function(c,a){var b=document.createElement("param");b.setAttribute("name",c);b.setAttribute("value",a);return b},getVariablePairs:function(){var a=new Array();var c;var b=this.getVariables();for(c in b){a.push(c+"="+b[c])}return a},getFlashHTML:function(){var d="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn")
}d='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'"';d+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var c=this.getParams();for(var e in c){d+=[e]+'="'+c[e]+'" '}var a=this.getVariablePairs().join("&");if(a.length>0){d+='flashvars="'+a+'"'}d+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX")}d='<object id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'">';
d+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var b=this.getParams();for(var e in b){d+='<param name="'+e+'" value="'+b[e]+'" />'}var f=this.getVariablePairs().join("&");if(f.length>0){d+='<param name="flashvars" value="'+f+'" />'}d+="</object>"}return d},write:function(b){if(this.useExpressInstall){var a=new com.deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(a)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}else{this.setAttribute("doExpressInstall",false)}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var c=(typeof b=="string")?document.getElementById(b):b;c.innerHTML=this.getFlashHTML()}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))
}}}};com.deconcept.FlashObjectUtil.getPlayerVersion=function(g,f){var d=new com.deconcept.PlayerVersion(0,0,0);if(navigator.plugins&&navigator.mimeTypes.length){var a=navigator.plugins["Shockwave Flash"];if(a&&a.description){d=new com.deconcept.PlayerVersion(a.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{try{var c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");for(var b=3;c!=null;b++){c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+b);d=new com.deconcept.PlayerVersion([b,0,0])
}}catch(h){}if(g&&d.major>g.major){return d}if(!g||((g.minor!=0||g.rev!=0)&&d.major==g.major)||d.major!=6||f){try{d=new com.deconcept.PlayerVersion(c.GetVariable("$version").split(" ")[1].split(","))}catch(h){}}}return d};com.deconcept.PlayerVersion=function(a){this.major=parseInt(a[0])||0;this.minor=parseInt(a[1])||0;this.rev=parseInt(a[2])||0};com.deconcept.PlayerVersion.prototype.versionIsValid=function(a){if(this.major<a.major){return false}if(this.major>a.major){return true}if(this.minor<a.minor){return false
}if(this.minor>a.minor){return true}if(this.rev<a.rev){return false}return true};com.deconcept.util={getRequestParameter:function(c){var d=document.location.search||document.location.href.hash;if(d){var b=d.indexOf(c+"=");var a=(d.indexOf("&",b)>-1)?d.indexOf("&",b):d.length;if(d.length>1&&b>-1){return d.substring(d.indexOf("=",b)+1,a)}}return""},removeChildren:function(a){while(a.hasChildNodes()){a.removeChild(a.firstChild)}}};if(Array.prototype.push==null){Array.prototype.push=function(a){this[this.length]=a;
return this.length}}var getQueryParamValue=com.deconcept.util.getRequestParameter;var FlashObject=com.deconcept.FlashObject;var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;
if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"
}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);
/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/
return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}
}();var L=function(){if(!h.w3cdom){return}f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return
}if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return}}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;
j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;
if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"
}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)
}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))
}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";
i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);
u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)
}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false
}function V(v,r){if(h.ie&&h.mac){return}var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)
}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return}var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;
N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return}AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]
}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)
}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);
if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=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;function $ready(a){document.observe("dom:loaded",a)}function $loaded(a){Event.observe(window,"load",a)}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 $exec(a){if(!a){return false}if(Object.isFunction(a)){a()}else{(window.execScript)?window.execScript(a):setTimeout(a,0)}return true}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(Function.prototype,{trace:function(){var a=[];var c=this;
var b=0;while(c&&b++<20){var d=c.signature();if(a.indexOf(d)>-1){break}a.push(d);c=c.caller}if(b>=20){Dtv.debug("stack trace was truncated to 20 items.")}return a},signature:function(){if(!this._signature){this._signature={method:this,code:this.toString(),name:this.getName(),params:[],toString:function(){var c=this.params.length>0?"'"+this.params.join("', '")+"'":"";return this.name+"("+c+")"}};if(this.arguments){for(var a=0;a<this.arguments.length;a++){try{this._signature.params.push(this.arguments[a])
}catch(b){this._signature.params.push("[Failed to retrieve argument information]")}}}}return this._signature},getName:function(){if(this.name){return this.name}var a=this.toString().split("\n")[0];var b=/^function ([^\s(]+).+/;if(b.test(a)){return a.split("\n")[0].replace(b,"$1")||"anonymous"}return"anonymous"}});$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(e){a(e.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},selectByAttr:function(a,e){var d=[];for(var c=0,b=this.length;c<b;c++){if(this[c][a]===e){d.push(this[c])}}return d},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},contains:Array.prototype.member,every:Array.prototype.all,filter:Array.prototype.findAll,some:Array.prototype.any});$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,e){Event.observe(c,d,e)})},stopObservingEvents:function(b,a){$(b);$H(a).parseSubKeys(null,function(c,d){Event.stopObserving(b,c,d)
})}});$extend(Event,{mouseWheelDelta:function(a){return(a.wheelDelta<0||a.detail>0)?1:(a.wheelDelta>0||a.detail<0)?-1:0}});Element.addMethods({observeEvents:function(c,b,a){Event.observeEvents(c,b,a);return c},stopObservingEvents:function(b,a){Event.stopObservingEvents(b,a);return b},getSiblingIndex:function(a){return $(a).up(0).childElements().indexOf(a)},disable:function(a){if(!a.disabled){$(a).addClassName("disabled");a.disabled=true}},enable:function(a){if(a.disabled){$(a).removeClassName("disabled");
a.disabled=false}},disableSelection:function(a){a.unselectable="on";$(a).setStyle({MozUserSelect:"none"})},getStyleAsInt:function(b,a){var c=$(b).getStyle(a);if(!c){return 0}return parseInt(c.replace("px","").replace("em","").replace("pt",""))},getStylesAsInt:function(b){var a=$A(arguments);var c=0;for(i=1;i<a.length;i++){c+=Element.getStyleAsInt(b,a[i])}return c},getRealWidth:function(a){return $(a).getWidth()+a.getStylesAsInt("marginLeft","marginRight")},getRealHeight:function(a){return $(a).getHeight()+a.getStylesAsInt("marginTop","marginBottom")
},getRealDimensions:function(a){return{width:this.getRealWidth(a),height:this.getRealHeight(a)}},childElementsByTagName:function(c,a){var b=a.toLowerCase().split(",");return $(c).childElements().select(function(d){return b.contains(d.tagName.toLowerCase())})},childElementAt:function(c,a){var b=$(c).childElements();if(b.length>a){return b[a]}return null},selectChildElements:function(b,c){var a=[];$(b).childElements().each(function(d){if(d.match(c)){a.push(d)}});return a},append:Element.Methods.insert,appendTo:function(b,a){$(a).append(b);
return b},prepend:function(a,b){return a.insert({before:b})},prependTo:function(b,a,c){a.prepend(c);return b},toHtml:function(b){var a=new Element("div");a.append(b.clone(true));return a.innerHTML},first:function(e,d,b){var c=$(e).select(d);if(c.length>0){return b?c[0][b]:c[0]}return null},getVar:function(c,b){var a=c.first("var[title='"+b+"']");return a?a.innerHTML:null},setVar:function(c,b,d){var a=c.first("var[title='"+b+"']");if(a){a.innerHTML=d;return true}return false},addCssEvents:function(b,c,a){$H(c).parseSubKeys(null,function(d,e){Event.observe(b,d,function(f){if(a&&(b.disabled||b.hasClassName("disabled"))){return
}if(!Object.isString(e)){b.setStyle(e);return}e.split("|").each(function(h,g){h=h.strip();switch(h.charAt(0)){case"{":b.setStyle(h.evalJSON());break;case"~":b.morph({style:h.substring(1)});case"!":b.removeClassName(h.substring(1));break;default:b.addClassName(h);break}})})});return b},applyBehavior:function(d,e,a,c){var b=Dtv.behaviors.getBehaviorName(e);Dtv.behaviors.applyBehavior(d,b,a,c);return this},behavior:function(c,d,b){var a=Dtv.behaviors.getBehaviorName(d);Dtv.behaviors.applyBehavior(c,a,null,b);
return c.behaviors[a]},hasBehavior:function(a,b){return(a.behaviors&&a.behaviors[Dtv.behaviors.getBehaviorName(b)])}});(function(){var c;window.$el=function(d){if(typeof d=="string"){if(!c){c=new Element("div")}c.innerHTML=d;return c.down(0)}return $(d)};$extend($el,Element.Methods);var b;window.location.getParam=function(d){if(!b){b=window.location.search.toQueryParams()}return b[d]};dtvStatus="initializing";window.Dtv={data:new Hash(),debugEnabled:window.location.getParam("fulljs")=="true"||window.location.getParam("firebug")=="true"||window.location.getParam("debugjs")=="true",debug:function(g,d){if(!Dtv.debugEnabled){return null
}var h=(d&&typeof d=="string"?(d+"\n"):"")+"Message: ";if(typeof g=="object"&&g.lineNumber){h+=g.message+"\nFile Name: "+g.fileName+"\nLine Number: "+g.lineNumber+"\nError Type:"+g.name+"\nStack Trace:\n     "+arguments.callee.trace().join("\n  -> ")}else{h+=g}if(window.debugObj){window.debugObj.trace(h)}else{if(console){if(console.debug){console.debug(h)}else{if(console.log){console.log(h)}}}}var f={time:new Date(),details:d};f.trace=arguments.callee.trace();if(typeof g=="object"&&g.lineNumber){f.error=g;
if(!Dtv.debugInfo.errors){Dtv.debugInfo.errors=[]}Dtv.debugInfo.errors.push(f)}else{f.msg=g;if(!Dtv.debugInfo.log){Dtv.debugInfo.log=[]}Dtv.debugInfo.log.push(f)}return f},debugInfo:{},extend:function(d){Object.extend(this,d)},getStatus:function(){return dtvStatus}};Dtv.extend((function(){return{utils:{addStylesheet:function(d){d=d.toLowerCase();var e=false;$$("head link").forEach(function(f){if(f.href.toLowerCase().indexOf(d)>-1){return(e=true)}});if(!e){$el('<link rel="stylesheet" type="text/css" href="'+d+'"></link>').appendTo($$("head")[0])
}}}}})());Dtv.extend((function(){var d=$H();var e=Class.create({items:[],push:function(f){if(!f||!Object.isFunction(f)){throw new Error("Invalid argument")}this.items.push(f)},pull:function(g,k){if(g){while(this.pull(false,k)){}return false}if(this.items.length>0){var h=this.items.shift(),f=this.pull.bind(this);k?h.defer(f):h(f);return this.items.length>0}return false},pop:function(g,k){if(g){while(this.pop(false,k)){}return false}if(this.items.length>0){var h=this.items.pop(),f=this.pop.bind(this);
k?h.defer(f):h(f);return this.items.length>0}return false}});Dtv.debugInfo.stacks=d;return{STATUS_CODE:{completed:"completed",initializing:"initializing"},stack:function(f){return d.insist(f,e)},defer:function(f){dtvStatus==this.STATUS_CODE.completed?f.defer():this.stack("defer").push(f)},deferScriptSrc:function(f){},expedite:function(f){dtvStatus==this.STATUS_CODE.completed?f():this.stack("expedite").push(f)}}})());function a(h,e){$log("applying event selectors: "+h);var d=[];for(var f=0;f<document.styleSheets.length;
f++){var l=document.styleSheets[f].rules?document.styleSheets[f].rules:document.styleSheets[f].cssRules;for(var g=0;g<l.length;g++){var k=l[g].selectorText;if(k){k.split(",").each(function(m){m=m.strip();var n=m.indexOf(h);if(n>0){m=m.substring(0,n);if(m.length>0&&(m.charAt(m.length-1)==":"||m.charAt(m.length-1)==".")){m=m.substring(0,m.length-1)}if(!d.contains(m)){(function(){$$(m).invoke("addCssEvents",{mouseenter:h,mouseleave:"!"+h},e)}).defer();d.push(m)}}})}}}if(!Dtv.debugInfo.appliedEventSelectors){Dtv.debugInfo.appliedEventSelectors={}
}Dtv.debugInfo.appliedEventSelectors[h]=d;$log("event selectors applied")}$ready(function(){$log("expedite stack executing...");Dtv.stack("expedite").pull(true);$log("expedite stack completed\napplying behavior mappings...");Dtv.behaviors.applyMappings();$log("behavior mappings applied")});$loaded(function(){if(Prototype.Browser.IE6){Dtv.defer(a.curry("hover",true))}Dtv.defer($log.curry("defer stack completed"));$log("defer stack executing...");setTimeout('Dtv.stack("defer").pull(true, true)',500);
dtvStatus=Dtv.STATUS_CODE.completed})})();Dtv.behaviors=(function(){var d=new Hash(),c=false,b=new Hash();window.$consts=function(e){return b.get(Dtv.behaviors.getBehaviorName(e)).consts};var a=Class.create({isInitialized:false,initialize:function(g,f){try{if(this.constructor.definition.options){f=$extend($clone(this.constructor.definition.options),f||{})}else{f=f||{}}this.el=$el(g||f.el);this.options=f;if(!this.el.behaviors){this.el.behaviors=[]}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}if(!this._init){throw new Error('Behavior "'+this.behaviorName+'" does not implement required _init method')}$log(this.behaviorName+"._init() start");this._init();if(this._initLayout){this._initLayout()}if(this.options&&this._onOptionSet){$H(this.options).each(function(e){this._onOptionSet(e.key,e.value)}.bind(this))
}if(this._initEvents){this._initEvents()}if(this._initDefaultState){this._initDefaultState()}this.isInitialized=true;this.fireEvent("initialized");$log(this.behaviorName+"._init() end")}catch(h){this.debug(h);throw h}},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},bindEvent:function(e,f){this.el.observe(this.behaviorName.toLowerCase()+":"+e,f||Prototype.emptyFunction);
return this},bindEvents:function(g,f){var e=this;$H(g).parseSubKeys(f||this,function(h,k){e.bindEvent(h,k)})},fireEvent:function(f,e){this.el.fire(this.behaviorName.toLowerCase()+":"+f,$extend(e||{},{behavior:this}));return this},disableTextSelection:function(){if(Prototype.Browser.IE){this.el.descendants().invoke("disableSelection")}else{this.el.disableSelection()}},getOption:function(e){return this.options?this.options[e]:undefined},setOption:function(e,f){if(!this.options){this.options={}}if(this.options[e]!==f){if(this._onOptionSet){this._onOptionSet(e,f,this.options[e])
}this.options[e]=f}},setOptions:function(f){if(!f){return false}var e=this;$H(f).each(function(g){e.setOption(g.key,g.value)})}});a.name="AbstractBehavior";Dtv.expedite(function(){b.each(function(f){var e=f.value;if(e.forceCompile){Dtv.behaviors.compile(e.name)}})});return{instances:[],debugInfo:{definitions:b},define:function(f){var e=function(g){return new Error("Could not define behavior with definition: "+Object.toJSON(f)+g?(" - reason: "+g):"")};if(!f){throw e()}if(!f.name){throw e("no name defined")
}if(b.get(f.name)){throw e("definition already defined")}if(!f.methods){throw e("no methods defined")}if(f.inherits&&!Object.isString(f.inherits)){throw e("inherits property must be a string")}if(f.selectors){if(!Object.isArray(f.selectors)){f.selectors=[f.selectors]}}else{f.selectors=[]}b.set(f.name,f);this[f.name]=f.name},compile:function(e){if(this[e]&&!Object.isString(this[e])){throw'Behavior "'+e+'" has already been compiled.'}var f=b.get(e);if(!f){throw'Behavior "'+e+'" has not been defined.'
}if(f.inherits){f.inherits=this.getBehaviorType(f.inherits);if(f.inherits.definition.options){f.options=$extend($clone(f.inherits.definition.options),f.options||{})}if(f.inherits.definition.consts){f.consts=$extend($clone(f.inherits.definition.consts),f.consts||{})}}f.methods.behaviorName=e;this[e]=Class.create(f.inherits||a,f.methods,f.consts?f.consts:{});this[e].instances=[];this[e].name=e;this[e].definition=f;if(f.consts){$extend(this[e],f.consts)}if(f.statics){$extend(this[e],f.statics)}if(f.stylesheet){Dtv.defer(Dtv.utils.addStylesheet.curry(f.stylesheet))
}return this[e]},applyBehavior:function(f,e,n,o,k){var l=[];var h=this.getBehaviorName(e);var m=this.getBehaviorType(h);if(m){if(n){var g=(n=="body")?[$(document.body)]:$(f||document.body).select(n);g.each(function(p){if(!(p.behaviors&&p.behaviors[h])){l.push(new m(p,o))}else{if(k&&o){p.behaviors[h].setOptions(o)}}})}else{if(!(f.behaviors&&f.behaviors[h])){l.push(new m(f,o))}}}return l},applyMappings:function(f){var e=[];b.each(function(h){var g=h.value;g.selectors.each(function(k){var l=null;options=null;
if(Object.isString(k)){l=k}else{if(!k.test||k.test()){l=k.expr;options=k.options}}if(l){if(k.defer&&!c){Dtv.defer(function(){Dtv.behaviors.applyBehavior(f,g.name,l,options)})}else{e=e.concat(Dtv.behaviors.applyBehavior(f,g.name,l,options))}}})});c=true;return e},mapSelector:function(h,e,g){var f=this.getBehaviorName(h);b.get(f).selectors.push(!g?e:{expr:e,options:g});if(c){this.applyBehavior(null,f,e,g)}},mapEvent:function(k,g,h){var f=this.getBehaviorName(k);d.insist(f,Hash).insist(g,Array).push(h);
if(this[f]){(function e(l){this[l].instances.invoke("observe",g,h);this[l].subclasses.each(function(m){e(m.name)})})(f)}},mapEvents:function(e,g,f){var e=this.getBehaviorName(behavior);$H(g).parseSubKeys(f,function(h,k){this.mapEvent(e,h,k)})},getBehaviorName:function(e){return e&&e.definition?e.definition.name:e},isCompiled:function(g){var e=this.getBehaviorName(g);var f=this[e];if(!f){throw"Behavior "+e+" is not defined"}else{if(Object.isString(f)){return false}}return true},getBehaviorType:function(f){var e=this.getBehaviorName(f);
return this.isCompiled(e)?this[e]:this.compile(e)},utils:{isContentPage:function(){var e=document.location.href.toLowerCase();return(e.indexOf("/content/")!=-1)}}}})();var SUPPRESS_SURVEY_LIGHTBOX=false;function fireDtvDomLoadedEvents(){logJsProgress("fireDtvDomLoadedEvents start");try{document.execCommand("BackgroundImageCache",false,true)}catch(a){console.log("BackgroundImageCache failed: "+a)}try{initializeHeaderStyles($$("body")[0])}catch(a){console.log("initializeHeaderStyles failed: "+a)}try{DtvProcessingWatcher.initializeProcessingWatcher()
}catch(a){if(console){console.error("DtvProcessingWatcher.initializeProcessingWatcher failed: "+a)}}try{initializePromo()}catch(a){console.log("initializePromo failed: "+a)}try{initializeAjaxResponders()}catch(a){console.log("initializeAjaxResponders failed: "+a)}logJsProgress("fireDtvDomLoadedEvents end")}document.observe("dom:loaded",fireDtvDomLoadedEvents);document.observe("dom:loaded",function(){logJsProgress("[ dom:loaded ]")});Event.observe(window,"load",function(){logJsProgress("[ window.load ]")
});function initializeAjaxResponders(){Ajax.Responders.register({onCreate:function(a){var b="tealeafid="+dtvUniqueId();if(a.options.method=="get"){a.url+=(a.url.include("?")?"&":"?")+b}else{if(a.options.postBody){a.options.postBody+=(a.options.postBody.include("&")?"&":"")+b}else{if(a.options.parameters){a.options.parameters=Object.extend(a.options.parameters,b.toQueryParams());a.options.postBody=$H(a.options.parameters).toQueryString()}}}}})}function dtvUniqueId(){return new Date().getTime()+"."+Math.random()+"."+Math.random()
}function preloadImages(a){a.each(function(c){var b=new Image();b.src=c})}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,f){d=$(d);if(!d){console.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 e=b+d.getHeight();if(parseInt(f)==NaN){f=0}b-=f;return(b>=a&&e<=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_ACCORDION_OPENED="dtv:accordionOpened";var EVENT_AJAX_SUBMIT_CLICKED="dtv:ajaxSubmit";var EVENT_CAROUSEL_ITEM_SELECTED="itemselected";var EVENT_CAROUSEL_ITEM_UNSELECTED="itemunselected";var EVENT_COLLAPSIBLE_TAB_ACTIVATE="dtv:collapsibleTabActivate";var EVENT_COLLAPSIBLE_TAB_CLOSED="dtv:collapsibleTabClosed";var EVENT_COLLAPSIBLE_TAB_OPENED="dtv:collapsibleTabOpened";var EVENT_COMMON_SENSE_IFRAME_LOADED="dtv:commonSenseIframeLoaded";var EVENT_EXPANDABLE_ROW_ACTIVATE="dtv:expandableRowActivate";
var EVENT_EXPANDABLE_ROW_DEACTIVATE="dtv:expandableRowDeactivate";var EVENT_LIGHTBOX_OPENED="dtv:lightboxOpened";var EVENT_LIGHTBOX_CLOSED="dtv:lightboxClosed";var EVENT_LISTING_CONTRACTED="dtv:listingContracted";var EVENT_LISTING_EXPANDED="dtv:listingExpanded";var EVENT_EXPANDABLE_ROW_CONTRACTED="dtv:expandableRowContracted";var EVENT_EXPANDABLE_ROW_EXPANDED="dtv:expandableRowExpanded";var EVENT_ROLLOVER_RESET="dtv:resetRollovers";function initializeHeaderStyles(a){logJsProgress("initializeHeaderStyles start");
a=$(a);if(!a){console.log("Unable to find element with ID: "+a)}a.select("h1.tab-header span","h1.solid-header span","h1.lb-header span").each(function(b){b.innerHTML=b.innerHTML+"<span>"+b.innerHTML+"<span>"+b.innerHTML+"</span></span>";b.addClassName("shadow")});a.select("a.cep-btn-action").each(function(b){if(b.select("span").length==1){b.select("span")[0].innerHTML=b.select("span")[0].innerHTML+"<span>"+b.select("span")[0].innerHTML+"</span>"}if(b.select("span").length>1){b.select("span")[0].addClassName("shadow")
}});logJsProgress("initializeHeaderStyles end")}function cursorHelper(a){_cursorHelperMover(a,"areaCode","num3",3);_cursorHelperMover(a,"num3","num4",3);_cursorHelperMover(a,"sin1","sin2",3);_cursorHelperMover(a,"sin2","sin3",2)}function _cursorHelperMover(d,e,b,a){d=$(d);if(!(d.hasClassName(e))||d.value.length<a){return}var c=d.up().select("."+b);if(c.length>0){c[0].focus()}}function _deactivateOnclick(a){if(a==null){return}a.inactive=new Function();a.inactive.onclick=a.onclick;a.onclick=function(){return false
}}function _deactivateOnsubmit(a){if(a==null){return}a.inactive=new Function();a.inactive.onsubmit=a.onsubmit;a.onsubmit=function(){return false}}function _reactivateOnclick(a){if(a==null||a.inactive==null){return}a.onclick=a.inactive.onclick}function _reactivateOnsubmit(a){if(a==null||a.inactive==null){return}a.onsubmit=a.inactive.onsubmit}function enterKeySubmit(a){if(window.event&&window.event.keyCode==13){$(a).click();return false}}var winReference=null;function openPositionedWindow(a,b,d,n,l,k,f,g,m,c){var h="width="+d+",height="+n+",screenX="+l+",screenY="+k+",left="+l+",top="+k+((f)?",status":"")+",scrollbars"+((g)?"=yes":"=no")+((m)?","+m:"");
var e=openWindow(a,b,h,c);return e}function openCenteredWindow(a,b,c,m,f,g,l,d){var k,h=0;if(screen){k=(screen.availWidth-c)/2;h=(screen.availHeight-m)/2}if(!f){f=""}if(!d){d=""}var e=openPositionedWindow(a,b,c,m,k,h,f,g,l,d);return e}function openWindow(c,b,d,a){winReference=window.open(c,b,d);setTimeout("if (winReference && !winReference.closed) winReference.focus()",200);if(a){top.name=a}return winReference}function largePopup(a){openCenteredWindow(a.href,"largePopup",382,444,true,false,"","opener");
return false}function formPopup(a){openCenteredWindow(a.href,"formPopup",395,358,true,true,"","opener");return false}function MoreInfoPopup(a){openCenteredWindow(a.href,"moreInfo",382,232,true,false,"","opener");return false}function openWindowFromSelect(b){b=$(b);if(!b||!b.match("select")){console.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=="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)}}}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"});DtvProcessingWatcher.removeProcessing()}else{$("error").hide();$("validation").show();$("validation").setStyle({color:"red"});DtvProcessingWatcher.removeProcessing()}}}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 e=$("email_signup_email_input");if(b&&a&&e){b.innerHTML=e.value;a.innerHTML=e.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){console.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/icons/dtv_processing_animated.gif" alt="Processing" width="126" height="44" 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,e,b,c){d=$(d);if(!d){console.log("Unable to find target element in appearContent");
return}var f=d.down("div");if(!f){console.log(d.identify()+" does not contain a div element");return}var a=new Element("div").addClassName(b).setStyle({display:"none"});f.insert(a);a.update(e);a.setOpacity(0);d.show();a.show();c=c||{};a.appear(c);Dtv.behaviors.applyBehavior(a,"GenericTooltip","a.js_tooltip")}var SubmitWatcher=Class.create();SubmitWatcher.prototype={initialize:function(c,a,b){this.formObj=$(a);c=$(c);if(!c){console.log("submitObj with id '"+c+"' does not exist in SubmitWatcher.initialize()");
return}if(!this.formObj){console.log("formObj with id '"+a+"' does not exist in SubmitWatcher.initialize()");return}this.setOptions(b);if(this.options.eventType=="change"){c.onchange=this.hijackNode.bindAsEventListener(this)}else{c.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(f){console.log("SubmitWatcher.hijackNode");var c;try{c=Event.element(f);c.visible();if(!c.id&&f.currentTarget){c=$(f.currentTarget)}}catch(b){c=$(f)}if(this.options.createHandler!=null){var k=this.options.createHandler(this.formObj,c);if(!k){return this.options.returnValue}}var h=this;var a={hash:false};if(c&&(c.match('input[type="image"]')||c.match('input[type="submit"]'))){a=Object.extend({submit:c.name},a)}var d=Form.serialize($(this.formObj),a);
var g={requestHeaders:{Accept:"application/json"},method:"post",postBody:d,mimetype:"application/json",onSuccess:function(e){console.log("SubmitWatcher: onSuccess");h._applyJsonErrorHandler(e.responseText);h._applyHandler(h.options.successHandler,e.responseText.evalJSON())},onFailure:function(e){console.log("SubmitWatcher: onFailure");h._applyJsonErrorHandler(e.responseText);h._applyHandler(h.options.failureHandler,e.responseText.evalJSON())}};new Ajax.Request($(this.formObj).action,g);$(this.formObj).fire(EVENT_AJAX_SUBMIT_CLICKED);
return this.options.returnValue},_applyHandler:function(b,a){if(b==null){return}console.log("SubmitWatcher._applyHandler");b(this.formObj,a)},_applyJsonErrorHandler:function(a){if(this.options.jsonErrorHandler==null){return}console.log("SubmitWatcher._applyJsonErrorHandler");processJSONErrors(this.options.jsonErrorHandler.containerDiv,this.options.jsonErrorHandler.errorClass,a.evalJSON())}};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)}console.log("GenericWatcherHandler.success");DtvProcessingWatcher.removeProcessing();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){console.log("GenericWatcherHandler.failure");processJSONErrors(this.handlerOptions.subContentDiv,"ajaxError",b);DtvProcessingWatcher.removeProcessing();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(e,h,g,d,c,b){var a=$(e).up("form");if(!a){console.log("No parent form found for "+$(e).identify());return}var f=Form.serialize(a);ajaxRequestAndPopulate(h,g,f,d,c,b)}function ajaxRequestAndPopulate(b,e,a,f,h,d,g){if(d<0){d=0}scrollWithOffset(b,d);var k=displayOverlay(b);var c={method:"post",evalScripts:true,postBody:a,onComplete:_ajaxRequestAndPopulateComplete.curry(b,f,k,h,g)};
new Ajax.Request(e,c)}function _ajaxRequestAndPopulateComplete(g,f,e,c,a,b,d){if(e.state!="finished"){setTimeout(_ajaxRequestAndPopulateComplete.curry(g,f,e,c,a,b,d),100);return}if(b.status<200||b.status>300){$(g).update(f)}else{$(g).update(b.responseText)}if(!a){DtvProcessingWatcher.initializeProcessingWatcherForContainer(g)}Dtv.behaviors.applyBehavior(g,"GenericTooltip","a.js_tooltip");removeOverlay(g,e.element);if(c instanceof Function){c()}}function _prototypeResponseToString(b){var a="";a+="status: "+b.status+"\n";
a+="statusText: "+b.statusText+"\n";a+="readyState: "+b.readyState+"\n";a+="responseText: "+b.responseText+"\n";return a}function _jsonToString(a){return $H(a).inspect().escapeHTML()}var _currentLightboxWindow=new Array();var _currentLightboxContentDiv=new Array();var _currentLightboxSubContentDiv=new Array();var DtvLightbox=Class.create({initialize:function(b,a){this._setContentOptions(b);closeTooltipsByDiv();if(!this.contentOptions.suppressSessionRefresh){refreshSession()}var c=null;if(this.contentOptions.contentDiv){c=this.contentOptions.contentDiv+"Lightbox";
if($(c)){return}if(_currentLightboxContentDiv.length>0){$(_currentLightboxContentDiv[0]).hide()}_currentLightboxContentDiv.unshift(this.contentOptions.contentDiv);_currentLightboxSubContentDiv.unshift(this.contentOptions.subContentDiv)}else{console.log("contentOptions.contentDiv must be specified in openLightbox()");return}this._setLightboxOptions(a,c);this._renderLightbox();if(!this.contentOptions.suppressHitbox){hitboxCustomEvent(this.contentOptions.hitboxPageName,this.contentOptions.hitboxPageCategory)
}},_handleClose:function(a){if(this.contentOptions.subContentDiv){$(this.contentOptions.subContentDiv).hide()}},_handleCloseCallback:function(a){if(this.contentOptions.subContentDiv){$(this.contentOptions.contentDiv).fire(EVENT_LIGHTBOX_CLOSED)}else{$(a).fire(EVENT_LIGHTBOX_CLOSED)}},_handleShow:function(a){this._updateLightboxHeight(a)},_handleShowCallback:function(a){if(this.contentOptions.callback){if(this.contentOptions.contentDiv){$(this.contentOptions.contentDiv).fire(this.contentOptions.callback)
}else{$(a).fire(this.contentOptions.callback)}}if(this.contentOptions.contentDiv){$(this.contentOptions.contentDiv).fire(EVENT_LIGHTBOX_OPENED)}else{$(a).fire(EVENT_LIGHTBOX_OPENED)}},_renderLightbox:function(){if($(this.contentOptions.subContentDiv)){hideChildDivs(this.contentOptions.contentDiv);$(this.contentOptions.subContentDiv).show()}_currentLightboxWindow.unshift(new Window(this.lightboxOptions));_currentLightboxWindow[0].setContent(this.contentOptions.contentDiv);_currentLightboxWindow[0].showCenter(true,this.lightboxOptions.top,this.lightboxOptions.left);
_currentLightboxWindow[0].setDestroyOnClose();_currentLightboxWindow[0].setZIndex(999)},_setContentOptions:function(a){this.contentOptions={contentDiv:null,subContentDiv:null,hitboxPageName:null,hitboxPageCategory:null,suppressHitbox:false,suppressSessionRefresh:false};Object.extend(this.contentOptions,a||{})},_setLightboxOptions:function(a,c){var b=this;this.lightboxOptions={showEffect:Effect.Appear,showEffectOptions:{afterFinish:b._handleShowCallback.bind(b,c),duration:0},hideEffect:Effect.Fade,hideEffectOptions:{afterFinish:b._handleCloseCallback.bind(b,c),duration:0},id:c,className:"directv-alert",onShow:b._handleShow.bind(b,c),onClose:b._handleClose.bind(b,c)};
Object.extend(this.lightboxOptions,a||{})},_updateLightboxHeight:function(a){$(a).setStyle({height:"auto",width:"auto"});$(a+"_content").setStyle({height:"auto"})}});function displayLightbox(b,a){if(document.loaded){var c=new DtvLightbox(b,a)}else{document.observe("dom:loaded",displayLightbox.curry(b,a))}}function _closeLightboxMinimal(){if(_currentLightboxWindow.length==0){console.log("closeLightbox() called when no lightbox is open");return}$(_currentLightboxContentDiv[0]).hide();if(_currentLightboxSubContentDiv[0]!=null){hideChildDivs(_currentLightboxContentDiv[0])
}_currentLightboxSubContentDiv.shift();_currentLightboxContentDiv.shift();_currentLightboxWindow[0].close();_currentLightboxWindow.shift();if(_currentLightboxContentDiv.length>0){$(_currentLightboxContentDiv[0]).show()}}function closeLightbox(){if(_currentLightboxWindow.length==0){console.log("closeLightbox() called when no lightbox is open");return}closeTooltipsByDiv(_currentLightboxContentDiv[0]);DtvProcessingWatcher.removeProcessing();_closeLightboxMinimal()}function openDtvLightbox(h,e,g,f,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){console.log("_openDtvLightbox called without title and lightboxContent arguments");return}var l=(a.length>=2)?a[2]:true;var h=(a.length>=3)?a[3]:false;var b=(a.length>=4)?a[4]:false;var f=(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>");initializeHeaderStyles($(c).id);var e=$(c).down(".js_ajax_content");if(l){e.setStyle({overflow:"auto",height:"200px",border:"1px #bbb solid",padding:"0 5px"})}function g(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(h){g(h==true?"OK":h,"cep-btn-action",closeLightbox)
}if(f){g(f==true?"Print":f,"cep-btn",printLightboxContent.curry($(e).identify()))}if(b){g(b==true?"Cancel":b,"cep-btn",closeLightbox)}if($(d)){$(e).update($(d).innerHTML);displayLightbox(contentOptions,DEFAULT_CEP_LIGHTBOX_OPTIONS)}else{new Ajax.Updater(e,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 hideChildDivs(a){if($(a)==null){return}$(a).immediateDescendants().invoke("hide")}function hitboxCustomEvent(d,c){var e="Lightbox+with+no+page+name+set";if(d!=null&&d!=""){e=d.replace(/\s/g,"+")}else{if(hbx.pn!=null&&hbx.pn!=""){e=hbx.pn+"+Lightbox"}}try{var a=_mlc;if(c){_hbPageView(e,c.replace(/\s/g,"+"))}else{if(hbx.mlc!=null&&hbx.mlc!=""){_hbPageView(e,hbx.mlc)}else{_hbPageView(e,_mlc)
}}_mlc=a}catch(b){}}function hitboxCommerceReport(g,b,e,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="+g.replace(/\s/g,"+");a+="&hitboxSubsystem="+b.replace(/\s/g,"+");a+="&hitboxPageName="+e.replace(/\s/g,"+");a+="&hitboxCategory="+c.replace(/\s/g,"+");var f=new Element("iframe");f.src=a;$(d).update();$(d).insert(f)
}function transitionToAjaxContent(){if(!($("lb_thinking"))){setTimeout(transitionToAjaxContent,200);return}setTimeout(transition.curry("lb_thinking","lb_ajax"),300);$(document.body).fire(EVENT_ROLLOVER_RESET);Dtv.behaviors.applyBehavior("lb_ajax","GenericTooltip","a.js_tooltip");Dtv.behaviors.applyBehavior("lb_ajax","CollapsibleTab",".js-collapsible-tabs");DtvProcessingWatcher.initializeProcessingWatcherForContainer("lb_ajax");initializeHeaderStyles("lb_ajax");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)}}}}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)
}var _loginCallback="";function displayLoginLightbox(a){contentOptions={callback:"dtv:loginLightboxLoginOpened",contentDiv:"lightboxDiv",subContentDiv:"lb_login",hitboxPageName:"Login+Lightbox"};_loginCallback=a;clearErrors("lb_login","ajaxError");displayLightbox(contentOptions,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS);$("lightboxDiv").observe("dtv:loginLightboxLoginOpened",function(){$("lightboxLoginField").focus()})}var loginLightboxHandlers={success:function(a,b){if(!b.success){loginLightboxHandlers.failure(a,b);
return}if(b.redirectUrl!=null){window.location.href=b.redirectUrl;return}processJSONErrors("lb_login","ajaxError",b);closeLightbox();if(_loginCallback!=null&&_loginCallback!=""){_loginCallback()}},failure:function(a,b){processJSONErrors("lb_login","ajaxError",b);DtvProcessingWatcher.removeProcessing()}};function initializeLoginLightbox(){new SubmitWatcher("lb_btn_login","lb_loginForm",{successHandler:loginLightboxHandlers.success,failureHandler:loginLightboxHandlers.failure});$("lb_btn_login").disabled=false;
$("loginLightboxPassword").observe("keypress",loginKeyListener);$("login_password_option_no").observe("click",function(){$("loginLightboxPassword").value=""});$("login_password_option_yes").observe("click",function(){$("loginLightboxPassword").focus()});if($("login_password_option_no").checked==true){toggleButtonText("lb_btn_login_submit","Register")}else{toggleButtonText("lb_btn_login_submit","Log In")}}function loginKeyListener(b){var b=(b)?b:event;var a=(b.charCode)?b.charCode:((b.which)?b.which:b.keyCode);
if(a==13){}else{$("login_password_option_yes").checked="checked";toggleButtonText("lb_btn_login_submit","Log In");return true}}function toggleButtonText(b,a){$(b).innerHTML="<span class='shadow'>"+a+"<span>"+a+"</span></span>"}function displayTermsAndConditionsLightbox(a,b){if(!document.loaded){document.observe("dom:loaded",displayTermsAndConditionsLightbox.curry(a,b));return}contentOptions={callback:"dtv:termsLightboxLoginOpened",contentDiv:"lightboxDiv",subContentDiv:"lb_terms_and_conditions",hitboxPageName:"Terms and Conditions Lightbox"};
$("toc_inner").update($(a).innerHTML);if(b==undefined||b==""){b="Terms &amp; Conditions"}$("lb_terms_and_conditions").down(".lb-header").update("<span>"+b+"</span>");initializeHeaderStyles("lb_terms_and_conditions");displayLightbox(contentOptions,DEFAULT_CEP_LIGHTBOX_OPTIONS)}function displayInterstitial(f,d){var a='<div class="thinking"><img src="/images/global/icons/dtv_logo_animated_blue.gif" alt="Thinking" width="105" height="108" /></div>';a+=f;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 e={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(e,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 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)})}function applyFieldError(b,a){Element.addClassName(a,b);Element.addClassName(a+"Label",b);Element.addClassName(a+"Icon",b)}function clearErrors(b,a){$(b).select("."+a).invoke("removeClassName",a);$(b).select(".js_message_wrapper").invoke("hide")
}function displayMessages(k,d,e,o){if(o==undefined){o=false}if(!$(k)){console.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 h=$(k).select("."+c)[0];if(!$(h)){console.log("wrapperDiv with id '"+h+"' does not exist in displayMessages()");return}$(h).hide();if(d==null||d.length<=0){continue}var n=$(h).select(".js_message_content")[0];if(!$(n)){console.log("messageDiv with id '"+n+"' does not exist in displayMessages()");
return}var a="";if(o){var g=$(n).select("li");for(var f=0;f<g.length;f++){var l=g[f].innerHTML;if(l.length>0){a+="<li>"+l+"</li>"}}}if(b==e){for(var f=0;f<d.length;f++){a+="<li>"+d[f]+"</li>"}}$(n).update(a);if(b==e||(o&&a!="")){$(h).show()}}}function preloadProcessingImage(){var a=["/images/cep/symbol_processing_small.gif","/images/global/icons/dtv_processing_animated_white.gif"];preloadImages(a)}var _PROCESSING_ACTIVE_CLASS_NAME="js_processing";var _PROCESSING_ACTIVE_TIMEOUT_CLASS_NAME="js_processing_timeout";
var _PROCESSING_HIDDEN_CLASS_NAME="js_processing_hidden";var _PROCESSING_STATUS_CLASS_NAME="processing_status";var _DISABLED_BUTTON_CLASS_NAME="cep-btn-gray";var _PROCESSING_TIMEOUT_ID="";var _CURRENTLY_PROCESSING=false;var _PROCESSING_TIMEOUT_INTERVAL=60*1000;DtvProcessingWatcher={initializeProcessingWatcher:function(){preloadProcessingImage();DtvProcessingWatcher.initializeProcessingWatcherForContainer($$("body")[0])},initializeProcessingWatcherForContainer:function(a){DtvProcessingWatcher._initializeProcessingWatcher($(a).select("a."+_PROCESSING_ACTIVE_CLASS_NAME,"input."+_PROCESSING_ACTIVE_CLASS_NAME,"a."+_PROCESSING_ACTIVE_TIMEOUT_CLASS_NAME,"input."+_PROCESSING_ACTIVE_TIMEOUT_CLASS_NAME))
},_initializeProcessingWatcher:function(a){a.each(function(b){b.observe("click",DtvProcessingWatcher._showProcessing)})},_showProcessing:function(c){_CURRENTLY_PROCESSING=true;submitObj=$(Event.element(c));if(!submitObj.hasClassName(_PROCESSING_ACTIVE_CLASS_NAME)&&!submitObj.hasClassName(_PROCESSING_ACTIVE_TIMEOUT_CLASS_NAME)){var b=submitObj.up("."+_PROCESSING_ACTIVE_CLASS_NAME);if(!b){b=submitObj.up("."+_PROCESSING_ACTIVE_TIMEOUT_CLASS_NAME)}submitObj=b}processingObj=new Element("span",{"class":_PROCESSING_STATUS_CLASS_NAME}).update("Processing...");
var a={};if(submitObj.getStyle("float")){Object.extend(a,{"float":submitObj.getStyle("float")})}if(submitObj.getStyle("text-align")){Object.extend(a,{textAlign:$(submitObj).getStyle("textAlign")})}if(submitObj.getStyle("margin")){Object.extend(a,{margin:$(submitObj).getStyle("margin")})}processingObj.setStyle(a);submitObj.up("div").select("a").each(function(d){d.hide().addClassName(_PROCESSING_HIDDEN_CLASS_NAME)});submitObj.up("div").select('input[type="image"]','input[type="submit"]').each(function(d){if(d.visible()){d.hide().addClassName(_PROCESSING_HIDDEN_CLASS_NAME)
}});submitObj.insert({after:processingObj});DtvProcessingWatcher._disableProcessing($$("body")[0].select("a."+_PROCESSING_ACTIVE_CLASS_NAME,"input."+_PROCESSING_ACTIVE_CLASS_NAME));DtvProcessingWatcher._disableProcessing($$("body")[0].select("a."+_PROCESSING_ACTIVE_TIMEOUT_CLASS_NAME,"input."+_PROCESSING_ACTIVE_TIMEOUT_CLASS_NAME));if(submitObj.hasClassName(_PROCESSING_ACTIVE_TIMEOUT_CLASS_NAME)){_initProcessingTimeout()}},_disableProcessing:function(a){a.each(function(c){if(!c.visible()){return}c.addClassName(_DISABLED_BUTTON_CLASS_NAME);
_deactivateOnclick(c);c.stopObserving("click",DtvProcessingWatcher._showProcessing);var b=c.up("form");_deactivateOnsubmit(b)})},removeProcessing:function(){if(!_CURRENTLY_PROCESSING){return}_CURRENTLY_PROCESSING=false;$$("body")[0].select("span."+_PROCESSING_STATUS_CLASS_NAME).each(function(a){a.remove()});DtvProcessingWatcher._reenableProcessing($$("body")[0].select("a."+_PROCESSING_ACTIVE_CLASS_NAME,"input."+_PROCESSING_ACTIVE_CLASS_NAME));DtvProcessingWatcher._reenableProcessing($$("body")[0].select("a."+_PROCESSING_ACTIVE_TIMEOUT_CLASS_NAME,"input."+_PROCESSING_ACTIVE_TIMEOUT_CLASS_NAME));
$$("body")[0].select("a."+_PROCESSING_HIDDEN_CLASS_NAME,"input."+_PROCESSING_HIDDEN_CLASS_NAME).each(function(a){a.show();a.removeClassName(_PROCESSING_HIDDEN_CLASS_NAME)});_clearProcessingTimeout()},_reenableProcessing:function(a){a.each(function(c){if(!c.visible()){return}c.removeClassName(_DISABLED_BUTTON_CLASS_NAME);_reactivateOnclick(c);c.observe("click",DtvProcessingWatcher._showProcessing);var b=c.up("form");_reactivateOnsubmit(b)})}};function openCancelProcessingLightbox(){var a={callback:"dtv:lightboxProcessingTimeoutOpened",contentDiv:"processingTimeoutLightboxDiv",subContentDiv:"lb_processing_timeout",hitboxPageName:"Processing Timeout Lightbox"};
displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS);return false}function _initProcessingTimeout(){_PROCESSING_TIMEOUT_ID=setTimeout(openCancelProcessingLightbox,_PROCESSING_TIMEOUT_INTERVAL)}function _clearProcessingTimeout(){if(_PROCESSING_TIMEOUT_ID!=null&&_PROCESSING_TIMEOUT_ID!=""){clearTimeout(_PROCESSING_TIMEOUT_ID);_PROCESSING_TIMEOUT_ID=""}}function processingTimeoutWait(){if(_PROCESSING_TIMEOUT_ID!=null&&_PROCESSING_TIMEOUT_ID!=""){_initProcessingTimeout()}_closeLightboxMinimal()}function processingTimeoutCancel(){closeLightbox()
}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 closeTooltipsByDiv(b){var a;b=$(b);if(b){a=b.select("a.js_tooltip")}else{a=$$("a.js_tooltip")}Tips.tips.each(function(c){if(!a||a.indexOf(c.element)!=-1){c.hide()}})}function initializePromo(){var f="customer";var a=""+document.cookie;var b=a.indexOf(f);if(b==-1||f==""){var d=$("prospect-promo");if(d!=null){d.toggle()}}else{var e=$("customer-promo");if(e!=null){e.toggle()}}}var DtvExpandableRow=Class.create({initialize:function(b,a){this.openers=new Array();
this.targetObj=$(b);this.activeOpenerId=null;this.setOptions(a);this.expandObserver=this.expand.bind(this);this.collapseObserver=this.collapse.bind(this);this.ajaxRequestCount=0},addOpener:function(a,b){a=$(a);this.openers[a.identify()]=b;this.options.openEvents.each(function(c){a.observe(c,this.expandObserver)},this)},setOptions:function(a){this.options={closeClassName:"",closeDuration:0.2,closeEvents:["click"],openDuration:0.7,openEvents:["click"],processingMessage:_PROCESSING_NOTIFICATION_DIV};
Object.extend(this.options,a||{})},expand:function(a){openerObj=Event.element(a);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){console.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 b=new Element("div");if(this.targetObj.tagName=="TR"){this.targetObj.down("td").insert(b)}else{this.targetObj.insert(b)}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 a=this.targetObj.down("div");if(!($(a))){return}closeTooltipsByDiv(this.targetObj);$(a).fade({duration:this.options.closeDuration,afterFinish:this._collapseCleanup.bind(this)})},_collapseCleanup:function(){var a=this.targetObj.down("div");if(a){a.remove()}this.targetObj.hide();this.targetObj.fire(EVENT_EXPANDABLE_ROW_CONTRACTED);this.activeOpenerId=null},_loadAjaxUrlExpandContent:function(b,a){var c={method:"post",parameters:b,onComplete:this._loadAjaxUrlContentComplete.bind(this)};
new Ajax.Request(a,c);this.ajaxRequestCount++},_loadAjaxUrlContentComplete:function(a,b){this.ajaxRequestCount--;if(this.ajaxRequestCount!=0){return}var c=this.targetObj.down("div");if(!c){return}if(a.status<200||a.status>300){c.update(_LISTING_FAILURE_MESSAGE);return}this._loadExpandContent(a.responseText)},_loadExpandContent:function(c){var a=this.targetObj.down("div.js_listing_processing");if(a){a.remove()}var b={duration:this.options.openDuration,afterFinish:Event.fire.curry(this.targetObj,EVENT_EXPANDABLE_ROW_EXPANDED)};
appearContent(this.targetObj,c,"js_listing_content",b);if(this.options.closeClassName){this.targetObj.select("."+this.options.closeClassName).each(function(d){this.options.closeEvents.each(function(e){d.observe(e,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(a){this.options.closeEvents.each(function(b){a.stopObserving(b,this.collapseObserver)
},this)},this)}},_toggleOpened:function(){this._toggleState(this.expandObserver,this.collapseObserver,this.options.openHandler,this.options.openEvents,this.options.closeEvents)},_toggleState:function(e,c,b,f,d){var a=$(this.activeOpenerId);if(!a){return}f.each(function(g){a.stopObserving(g,e)});d.each(function(g){a.observe(g,c)});if(b){b(a)}}});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();function initializeScheduleInstallCalendar(l){if($("scheduleInstallationSubmit")){new SubmitWatcher("scheduleInstallationSubmit","scheduleInstallationForm",{successHandler:scheduleInstallationHandlers.success.bind(scheduleInstallationHandlers),failureHandler:scheduleInstallationHandlers.failure.bind(scheduleInstallationHandlers)})}_availableScheduleInstallTimes=new Array();
var e=new Date();e.setDate(1);if(l!=null&&l.length>0){var g=l.split(",");for(var d=0;d<g.length;d++){var k=g[d].split(":");var n=k[0].split("/");var f=new Number(n[0]).valueOf();var m=new Number(n[1]).valueOf();var h=new Number(n[2]).valueOf();if(_availableScheduleInstallTimes[f]==null){_availableScheduleInstallTimes[f]=new Array()}_availableScheduleInstallTimes[f][m]=k[1];if(d==0){e.setDate(m);e.setMonth(f-1);e.setYear(h)}}}if($("installCalendarCurrent")&&$("installCalendarNext")){var c={embedded:true,onchange:scheduleInstallClick.curry("installCalendarCurrentInput"),month_year:"label",buttons:false,valid_date_check:isValidScheduleInstallDate,date:e.toString()};
new CalendarDateSelect($("installCalendarCurrentInput"),c);var a=new Date();a.setDate(1);if(e.getMonth()<11){a.setMonth(e.getMonth()+1);a.setYear(e.getFullYear())}else{a.setMonth(0);a.setYear(e.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(d,b){var a=_availableScheduleInstallTimes[d][b];if(a==null){return}for(var c=0;c<4;c++){$("installWindow_"+"EAPL".charAt(c)).disabled=true;$("installWindow_"+"EAPL".charAt(c)).checked=false;$("installWindow_"+"EAPL".charAt(c)+"_label").addClassName("disabled")}for(var c=0;c<a.length;c++){$("installWindow_"+a.charAt(c)).disabled=false;$("installWindow_"+a.charAt(c)+"_label").removeClassName("disabled")}}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 createCookie(c,d,e){if(e){var b=new Date();b.setTime(b.getTime()+(e*24*60*60*1000));var a="; expires="+b.toGMTString()}else{var a=""}document.cookie=c+"="+d+a+"; path=/"}function readCookie(b){var e=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var f=a[d];while(f.charAt(0)==" "){f=f.substring(1,f.length)}if(f.indexOf(e)==0){return f.substring(e.length,f.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 orderModuleLink(b,d){var a=$(d);var c=a.down('input[name="selectedSku"]');if(c){window.location.href=b+c.value;return false}c=a.down('select[name="selectedSku"]');if(c){window.location.href=b+c.options[c.selectedIndex].value;return false}a.getInputs("radio","selectedSkuRadio").each(function(e){if(e.checked){window.location.href=b+e.value;return false}})}function pngFix(a){if(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"}}}(function(){var a={classNames:{toggle:"accordion-toggle",toggleActive:"active",content:"accordion-content"},direction:"vertical"};Dtv.behaviors.define({name:"Accordion",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("/register/")!=-1)
}},methods:{_init:function(){this.accordion=new accordion(this.el,a)},_initDefaultState:function(){var b=this.el.select("."+a.classNames.toggleActive);if(b.length>0){this.accordion.activate(b[0])}}}})})();(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(h,k){var g=this._tabs.contents[k],d=g.select("li"),e=0;if(d.length==0){h.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)}}e=Math.ceil(d.length/this._settings.pageSize);for(var f=this._settings.pageSize-1,b=d.length;
f<b;f+=this._settings.pageSize){d[f].addClassName("last")}d[d.length-1].addClassName("last");g.down(0).setStyle({width:(e+1)+"00%"})}this._tabs.push({labelEl:h,contentEl:g,index:k,pagerEl:e>1?a(e).appendTo(g):null,pageCount:e})}.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 e=window.location.getParam("carousel");if(c&&e){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(EVENT_EXPANDABLE_ROW_EXPANDED,function(){$(b+"_tab_"+c).fire(EVENT_COLLAPSIBLE_TAB_ACTIVATE);$("listing_carousel_details_tup").stopObserving(EVENT_EXPANDABLE_ROW_EXPANDED)})}return}}this.selectTab(0)},_initEvents:function($super){$super();this.bindEvents({itemselected:function(b){$(b.memo.item).fire(EVENT_EXPANDABLE_ROW_ACTIVATE)},itemunselected:function(b){$(b.memo.item).fire(EVENT_EXPANDABLE_ROW_DEACTIVATE)}})}}})})();(function(){var e="js-collapsible-tab-title";
var c="collapsible-tab-title-active";var d="js-collapsible-tab-content";var a="js-collapsible-tab-close";var b="js-tab-always-open";var f=0.5;Dtv.behaviors.define({name:"CollapsibleTab",selectors:{expr:".js-collapsible-tabs",test:function(){var g=document.location.href.toLowerCase();return(g.indexOf("/content/")!=-1||g.indexOf("/wizard/")!=-1||g.indexOf("/cep/")!=-1||g.indexOf("/listing/")!=-1)}},methods:{_init:function(){this._activeTab=null;this._tabOpeners=this.el.select("."+e);this._tabContents=this.el.select("."+d);
this._closeLinks=this.el.select("."+a);console.log("Collapsible tab initialized")},_initEvents:function(){var g=this;this._tabOpeners.invoke("observeEvents",{click:function(h){g.activate(this)},"dtv:collapsibleTabActivate":function(h){g.activate(this)}});this._closeLinks.invoke("observeEvents",{click:function(h){g._close(this)}})},_initDefaultState:function(){var g=this.el.select("."+c);if(g.length>0){this.activate(g[0])}},activate:function(g){if(this._activeTab==g){if(!this.el.hasClassName(b)){this._deactivate(true);
this._activeTab=null}return}this._deactivate(false);g.addClassName(c);var h=this._tabContents[this._tabIndex(g)];if(!this._activeTab){h.appear({duration:f})}else{h.show()}this._activeTab=g;this._activeTab.fire(EVENT_COLLAPSIBLE_TAB_OPENED)},_deactivate:function(g){if(!this._activeTab){return}var h=this._tabContents[this._tabIndex(this._activeTab)];if(h.visible()){closeTooltipsByDiv(h);if(g){h.fade({duration:f})}else{h.hide()}}this._activeTab.removeClassName(c);this._activeTab.fire(EVENT_COLLAPSIBLE_TAB_CLOSED)
},_close:function(g){this._deactivate(true)},_tabIndex:function(h){var g=0;this._tabOpeners.each(function(l,k){if(l==h){g=k}});return g}}})})();(function(){var a={ORIENTATION:{VERTICAL:"vertical",HORIZONTAL:"horizontal",AUTO:"auto"},EFFECT:{FADE:"fade",SLIDE:"slide",NONE:"none"},EVENTS:{ACTIVE_INDEX_CHANGED:"activeGroupIndexChanged",ACTIVE_ITEM_INDEX_CHANGED:"activeItemIndexChanged",UPDATED:"updated"}};Dtv.behaviors.define({name:"GroupedList",selectors:[{options:{effect:a.EFFECT.SLIDE,allowMouseWheel:true},expr:".js-GroupedList"}],consts:a,options:{endless:true,effect:a.EFFECT.NONE,effectDuration:0.8,transition:Effect.Transitions.easeFromTo,startGroupIndex:0,autoUpdate:false,mouseWheelEnabled:true,orientation:a.ORIENTATION.AUTO,prevBtn:null,nextBtn:null},methods:{_init:function(){this._container=this.el.up(0)
},_initLayout:function(){this.update();if(this.options.effect!=a.EFFECT.SLIDE){this.showGroup(this.activeGroupIndex)}},_initEvents:function(){this.el.observeEvents({"DOMMouseScroll,mousewheel":function(b){Dtv.e=b;if(this.options.mouseWheelEnabled){switch(Event.mouseWheelDelta(b)){case 1:this.moveToNext();b.stop();return false;case -1:this.moveToPrevious();b.stop();return false}}}.bind(this)});if(this.options.prevBtn){this.options.prevBtn.observe("click",this.moveToPrevious.bind(this))}if(this.options.nextBtn){this.options.nextBtn.observe("click",this.moveToNext.bind(this))
}},update:function(){var c=this._items;var d=this._groups;this._items=this.el.childElements();if(this._items.length==0){return}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}this._calcGroupSize();this._updateOverflow();this._groups=this._items.inGroupsOf(this.groupSize);if(!$chk(this.activeGroupIndex)){this.activeGroupIndex=this.options.startGroupIndex||0
}else{}var b=this._groups.length>1?"enable":"disable";if(this.options.prevBtn){$el[b](this.options.prevBtn)}if(this.options.nextBtn){$el[b](this.options.nextBtn)}this.fireEvent(a.EVENTS.UPDATED)},_calcGroupSize:function(){var f=0,b,e,d=1;switch(this.orientation){case a.ORIENTATION.HORIZONTAL:b=$el.getRealWidth(this._container);if(this.options.overflowHack){b+=$el.getStylesAsInt(this._container,"right")}this._items.forEach(function(h,g){f+=h.getRealWidth();if(f>b){e=g;return true}});break;case a.ORIENTATION.VERTICAL:maxH=this._container.getRealHeight();
maxW=this._container.getRealWidth();var c=this._items;c.forEach(function(h,g){f+=h.getRealHeight();if(f>maxH){e=g;f=0;c.forEach(function(l,k){f+=l.getRealWidth();if(f>maxW){d=k;e*=k;return true}});return true}});break}this.groupSize=e||this._items.length;this.groupCols=d},_updateOverflow:function(){var c=0;switch(this.orientation){case a.ORIENTATION.HORIZONTAL:this._items.each(function(d){c+=d.getRealWidth()});c+=(this._items[0].getRealWidth()*2);this.el.setStyle({width:Math.max(c,this._container.getWidth())+"px"});
break;case a.ORIENTATION.VERTICAL:this.orientation=a.ORIENTATION.VERTICAL;for(var b=0;b<this._items.length;b+=this.groupCols){c+=this._items[b].getRealHeight()}c+=(this._items[0].getRealHeight()*2);this.el.setStyle({height:Math.max(c,this._container.getHeight())+"px"});break}},isAtEnd:function(){return this.activeGroupIndex>=this._groups.length-1},slideToGroup:function(b){this.slideToItem(b*this.groupSize)},slideToItem:function(c){var b=this.orientation==a.ORIENTATION.HORIZONTAL?0:1;var d=this._items[c].positionedOffset()[b]-this._items[0].positionedOffset()[b];
if(this._currentFx){this._currentFx.cancel()}this._currentFx=new Effect.Morph(this.el,{style:(this.orientation==a.ORIENTATION.HORIZONTAL?"left":"top")+":"+(d*-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))},getGroupIndex:function(b){return Math.floor(b/this.groupSize)},getGroupItemIndex:function(b){return b%this.groupSize
},moveToIndex:function(b){if(b>=this._groups.length){throw"Index is out of range"}if(b==this.activeGroupIndex){return}if(this.options.autoUpdate){this.update()}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}this.activeGroupIndex=b;this.activeItemIndex=b*this.groupSize;this.fireEvent(a.EVENTS.ACTIVE_INDEX_CHANGED)},moveToFirst:function(){this.moveToIndex(0)},moveToLast:function(){this.moveToIndex(this._groups.length-1)
},moveToNext:function(){if(!this.isAtEnd()){this.moveToIndex(this.activeGroupIndex+1)}else{if(this.options.endless){this.moveToIndex(0)}else{return false}}return true},moveToPrevious:function(){if(this.activeGroupIndex>0){this.moveToIndex(this.activeGroupIndex-1)}else{if(this.options.endless){this.moveToIndex(this._groups.length-1)}else{return false}}return true}}});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.ACTIVE_INDEX_CHANGED,this.update.bind(this));this._prevSpan.observe("click",this.options.list.moveToPrevious.bind(this.options.list));
this._nextSpan.observe("click",this.options.list.moveToNext.bind(this.options.list))},getPageCount:function(){return this.options.list._groups.length},getActiveIndex:function(){return this.options.list.activeGroupIndex},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.moveToIndex(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.getRealWidth()});this._containerDiv.setStyle({width:b+"px"})}}})})();(function(){var a={AUTO:"auto",POSITIONING:{AROUND:"around",CENTERED:"centered",RELATIVE:"relative",ABSOLUTE:"absolute"},EVENTS:{HEADER_CONTENT_UPDATED:"headercontentupdated",CAPTION_CONTENT_UPDATED:"captioncontentupdated",BODY_CONTENT_UPDATED:"bodycontentupdated",SHOW:"show",HIDE:"hide"}};
function d(f,g){if(!f){return false}if(Object.isElement(g)){f.update().append(g)}else{f.update(g)}return true}function c(f){if(!f){return 0}return Object.isString(f)?f:(f+"px")}function b(f){return $extend(f?$el.getRealDimensions(f):document.viewport.getDimensions(),f?$el.cumulativeOffset(f):document.viewport.getScrollOffsets())}function e(){var f=0;if(window.innerHeight&&window.scrollMaxY){f=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){f=document.body.scrollHeight
}else{f=document.body.offsetHeight}}return f}Dtv.behaviors.define({name:"Lightbox",consts:a,statics:{currentWin:null,previousWin:null},options:{width:a.AUTO,height:a.AUTO,top:0,left:0,positioning:a.POSITIONING.CENTERED,effectDuration:0,modal:true,hideOnBlur:false,hideOnClick:false,opener:null,winEl:null,relElement:null,bodyContent:null,headerContent:null,buttons:null,headerExpr:".ipop-header",contentExpr:".ipop-content",closeExpr:".js-lb-close",list:null,showArrows:false},methods:{_init:function(){if(this.options.winEl){if(this.options.opener){throw"Cannot specify both a winEl and opener option"
}this.options.opener=this.el;this.el=$el(this.options.winEl)}this.headerEl=this.el.first(this.options.headerExpr);this.captionEl=this.el.first(this.options.captionExpr);this.contentEl=this.el.first(this.options.contentExpr);this._closeElements=this.el.select(this.options.closeExpr)},_initLayout:function(){this.el.setStyle({position:"absolute",display:"none",zIndex:1001,top:0,left:0});this.el.appendTo(document.body)},_initEvents:function(){this._closeElements.each(function(f){f.observe("click",function(g){this.hide();
g.stop();return false}.bind(this))},this);document.observe("click",function(g){var f=g.element();if(this.el.visible()&&this.options.hideOnBlur&&f.ancestors().indexOf(this.el)==-1){if(this.ignoreNextBlur){this.ignoreNextBlur=false}else{this.hide()}}}.bind(this));this.el.observe("click",function(f){if(this.options.hideOnClick&&f.element().tagName!="A"){this.hide()}}.bind(this))},_onOptionSet:function(g,h,f){switch(g){case"headerContent":if(d(this.headerEl,h)&&arguments.length==3){this.fireEvent(a.EVENTS.HEADER_CONTENT_UPDATED)
}break;case"captionContent":if(d(this.captionEl,h)&&arguments.length==3){this.fireEvent(a.EVENTS.CAPTION_CONTENT_UPDATED)}break;case"bodyContent":if(d(this.contentEl,h)&&arguments.length==3){this.fireEvent(a.EVENTS.BODY_CONTENT_UPDATED)}break;case"width":var k={width:c(h)};this.el.setStyle(k);break;case"height":var k={height:c(h)};this.el.setStyle(k);break}},show:function(g,f){this.setOptions(g);this.refreshLayout();if(this.options.modal){this._dimScreen()}this.el.appear({duration:this.options.effectDuration,queue:"end"});
this._cb=f;if(Dtv.behaviors.Lightbox.currentWin&&Dtv.behaviors.Lightbox.currentWin!=this){Dtv.behaviors.Lightbox.previousWin=Dtv.behaviors.Lightbox.currentWin}else{this.fireEvent(a.EVENTS.SHOW)}Dtv.behaviors.Lightbox.currentWin=this;return true},hide:function(){if(!this.visible()){return false}this.options.effectDuration>0?this.el.fade({duration:this.options.effectDuration,queue:"start"}):this.el.hide();if(this.options.modal){Dtv.behaviors.Lightbox.dimmerEl.fade({queue:"start"})}if(Dtv.behaviors.Lightbox.currentWin==this){Dtv.behaviors.Lightbox.currentWin=null;
Dtv.behaviors.Lightbox.previousWin=this}if(this._cb){this._cb();this._cb=null}this.fireEvent(a.EVENTS.HIDE);return true},visible:function(){return this.el.visible()},_dimScreen:function(){if(!Dtv.behaviors.Lightbox.dimmerEl){Dtv.behaviors.Lightbox.dimmerEl=$el("<div id='lb-dimmer'></div>").appendTo(document.body);Dtv.behaviors.Lightbox.dimmerEl.setStyle({backgroundColor:"#000",left:0,top:0,position:"absolute",zIndex:1000,width:"100%"})}var f=Dtv.behaviors.Lightbox.dimmerEl;f.show();f.setStyle({height:e()+"px",opacity:0.8})
},_adjustLayoutStyle:null,_getLayoutStyle:function(){var n=this.visible();this.el.setStyle({display:"block",visibility:"hidden"});var h={display:n?"block":"none",visibility:"visible"};switch(this.options.positioning){case a.POSITIONING.AROUND:var m=b(),k=b(this.options.relElement),l=$el.getRealDimensions(this.el);l.width=l.width||this.el.down().getWidth();l.height=l.height||this.el.down().getHeight();l.left=k.left+this.options.left+((k.width-l.width)/2);l.top=k.top+this.options.top-l.height;l.right=l.left+l.width;
m.right=m.left+m.width;if(l.right>m.right){l.left-=(l.right-m.right)}if(m.left>l.left){l.left=m.left}if(m.top>l.top){l.top+=(k.height+l.height)-(this.options.top*2)}h.left=l.left;h.top=l.top;break;case a.POSITIONING.CENTERED:var m=b(this.options.relElement),g=$el.getRealDimensions(this.el);var f=(m.width-g.width)/2;var o=(m.height-g.height)/2;h.left=Math.max(0,m.left+f+this.options.left);h.top=Math.max(0,m.top+o+this.options.top);break;case a.POSITIONING.RELATIVE:var m=b(this.options.relElement);
h.left=m.left+this.options.left;h.top=m.top+this.options.top;break;case a.POSITIONING.ABSOLUTE:h.left=this.options.left;h.top=this.options.top;break}if(this._adjustLayoutStyle){this._adjustLayoutStyle(h)}h.left+="px";h.top+="px";return h},refreshLayout:function(){this.el.setStyle(this._getLayoutStyle())}}});Dtv.behaviors.define({name:"BusinessInfopop",inherits:Dtv.behaviors.Lightbox,options:{modal:false,positioning:a.POSITIONING.AROUND,hideOnBlur:true,hideOnClick:false,effectDuration:0.2,contentExpr:"div.js-infopop-content"},selectors:{expr:"#content_business_infopop",test:Dtv.behaviors.utils.isContentPage},methods:{_initEvents:function($super){$super();
var f=this;$$("div.js-business-infopop-click","div.js-business-infopop-hover").each(function(h){var g=h.previous("a.js-opener")||h.up("li");g.observe(h.match(".js-business-infopop-click")?"click":"mouseenter",function(k){f._onItemSelected(k,g)})})},_onItemSelected:function(k,h){if(k.type=="click"){var g=k.element();if((g.match("a")||(g=g.up("a")))&&g!=h){return}}if(this.options.relElement!=h&&this.visible()){this.ignoreNextBlur=true}this.options.relElement=h;this.options.opener=h;var f=h[h.match("a")?"next":"down"]("div.js-business-infopop-hover, div.js-business-infopop-click");
if(f){this.show({bodyContent:f.innerHTML})}else{this.debug("skipped openening infopop: could not determine details element")}k.stop();return false}}});Dtv.behaviors.define({name:"MediaLightbox",selectors:{expr:"#magnifying_media_lightbox",test:Dtv.behaviors.utils.isContentPage},options:{openers:"a.js-media-lightbox-opener",openEventName:"click",headerExpr:".lb-header",captionExpr:".js-lb-caption",width:725,height:330,top:-50},inherits:Dtv.behaviors.Lightbox,methods:{_init:function($super){$super();
this._mediaPlayer=this.el.first(".js-mediaplayer").behavior(Dtv.behaviors.MediaPlayer,{autoCreateSwf:false});this._openers=[];this.applyOpeners()},_initEvents:function($super){$super();this.bindEvent(a.EVENTS.HIDE,this._onHide.bind(this))},applyOpeners:function(){var f=$$(this.options.openers);f.each(function(g){if(g.href.toLowerCase().indexOf(".flv")>-1){g.down("b").addClassName("video")}if(this._openers.indexOf(g)==-1){g.observe(this.options.openEventName,function(h){h.stop();return this._onOpen(g)&&false
}.bind(this));this._openers.push(g)}}.bind(this))},_onOpen:function(h){var k={};var f=h.href.toLowerCase().indexOf(".flv")>-1?"videoUrl":"imageUrl";k[f]=h.href;var l=h.down('var[title="lightboxTitle"]');var g=h.down('var[title="lightboxCaption"]');if(f=="videoUrl"){k.title=(l)?l.innerHTML:"";k.blurb=(g)?g.innerHTML:""}this.show({opener:h,headerContent:(l)?l.innerHTML:"",captionContent:(g&&f=="imageUrl")?g.innerHTML:""});this._mediaPlayer.setPlaylistData(k);this._mediaPlayer.playTrack()},_onHide:function(){this._mediaPlayer.destroySwfObj()
}}})})();(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></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+($$("link[href='/resources/css/content/dark-theme.css']").length>0?"&theme=dark":""),wmode:"transparent",allowscriptaccess:"always"},c.identify())}else{this.debug("Flash Object could not be created");return false}}this.swfObj.bindEvent=function(e,f){if(!Dtv.flashMethods){Dtv.flashMethods=[]
}Dtv.flashMethods.push(f);this.addEventListener(e,"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(a,this.getOption(this.OPTIONS.AUTOPLAY))}},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,overflowHack:true});
this._groupedList.moveToIndex(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.activeGroupIndex){this._groupedList.moveToIndex(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(e,f){c.push({videoUrl:e.getVar("videoUrl"),imageUrl:e.getVar("imageUrl"),title:e.first("h4","innerHTML"),blurb:e.getVar("description"),linkText:e.getVar("linkText")||null,linkUrl:e.getVar("linkUrl")||null,bgImageUrl:e.getVar(this.OPTIONS.BG_IMG_URL)||d,delayInterval:b})}.bind(this));return c}}})})();(function(){Dtv.behaviors.define({name:"GenericScroller",options:{SCROLLER_CONTENT_CLASS:"js-scroller-content",SCROLLER_TRACK_CLASS:"js-scroller-track",SCROLLER_TRACK_HANDLE_CLASS:"js-scroller-track-handle",SCROLLER_BUTTON_PREV_CLASS:"js-scroller-button-prev",SCROLLER_BUTTON_NEXT_CLASS:"js-scroller-button-next"},methods:{_init:function(){this._initVariables();
this._initSlider()},_initEvents:function(){var b=this.slider;var c=this.el.down("."+this.options.SCROLLER_BUTTON_NEXT_CLASS);if(c){c.observeEvents({click:function(){if(b.value>=b.maximum){b.setValue(0)}else{b.setValueBy(1)}}})}var a=this.el.down("."+this.options.SCROLLER_BUTTON_PREV_CLASS);if(a){a.observeEvents({click:function(){if(b.value<=b.minimum){b.setValue(b.maximum)}else{b.setValueBy(-1)}}})}this.scrollerContent.observeEvents({DOMMouseScroll:this._wheelPackageScroll.bindAsEventListener(this),mousewheel:this._wheelPackageScroll.bindAsEventListener(this)});
this.scrollerTrack.observeEvents({DOMMouseScroll:this._wheelPackageScroll.bindAsEventListener(this),mousewheel:this._wheelPackageScroll.bindAsEventListener(this)})},_initSlider:function(){this.slider=new Control.Slider(this.scrollerTrackHandle,this.scrollerTrack,{axis:this.axis,range:$R(0,this.maxRange),onSlide:this.scrollHandler,onChange:this.scrollHandler})},_initVariables:function(){this.scrollInterval;this.scrollerContent=this.el.down("."+this.options.SCROLLER_CONTENT_CLASS);this.scrollerTrack=this.el.down("."+this.options.SCROLLER_TRACK_CLASS);
this.scrollerTrackHandle=this.scrollerTrack.down("."+this.options.SCROLLER_TRACK_HANDLE_CLASS)},_wheelPackageScroll:function(a){var b=0;if(!a){a=window.event}if(a.wheelDelta){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){b=a.wheelDelta/360}else{if(navigator.userAgent.toLowerCase().indexOf("opera")>-1){b=-a.wheelDelta/120}else{b=a.wheelDelta/120}}}else{if(a.detail){b=-a.detail/3}}if(b){this.slider.setValueBy(-b)}if(a.preventDefault){a.preventDefault()}a.returnValue=false}}});Dtv.behaviors.define({name:"HorizontalScroller",inherits:Dtv.behaviors.GenericScroller,options:{SCROLLER_ELEMENTS_PER_SCROLL:6,SCROLLER_ITEM_WIDTH:111},methods:{_init:function($super){$super()
},_initEvents:function($super){$super()},_initVariables:function($super){$super();this.axis="horizontal";this.scrollHandler=this._scrollHorizontalHandler.bind(this);var a=this.scrollerContent.down("ul");this.sliderWidth=(a.select("li").length*this.options.SCROLLER_ITEM_WIDTH);a.style.width=this.sliderWidth+"px";this.maxRange=Math.ceil((this.scrollerContent.scrollWidth-this.scrollerContent.offsetWidth)/(this.options.SCROLLER_ELEMENTS_PER_SCROLL*this.options.SCROLLER_ITEM_WIDTH))},_scrollHorizontalWithAnimation:function(c,a,d){var b=a.scrollLeft;
a.scrollLeft-=Math.floor((b-d)/4);if(b==d){clearInterval(this.scrollInterval)}},_scrollHorizontal:function(b,a){clearInterval(this.scrollInterval);var c=Math.round(b*(this.options.SCROLLER_ELEMENTS_PER_SCROLL*this.options.SCROLLER_ITEM_WIDTH));if(this.slider.dragging){a.scrollLeft=c;return}this.scrollInterval=setInterval(this._scrollHorizontalWithAnimation.curry(b,a,c),33)},_scrollHorizontalHandler:function(a){this._scrollHorizontal(a,this.scrollerContent)}}});Dtv.behaviors.define({name:"BrowseChannelsScroller",inherits:Dtv.behaviors.HorizontalScroller,selectors:{expr:".js-browse-channels-scroller",test:function(){var a=document.location.href.toLowerCase();
return(a.indexOf("/compare/")!=-1)}},options:{SCROLLER_DIVIDER_WIDTH:22},methods:{_init:function($super){$super();this._initExpandableRow()},_initDefaultState:function(){var a=$("browse_channels_scroller_anchors").down("a.selected");if(a){a.onclick()}},_initExpandableRow:function(){var a={openHandler:function(b){$(b).addClassName("active")},closeHandler:function(b){$(b).removeClassName("active")},closeClassName:"js_collapse"};browseChannelExpandableRow=new DtvExpandableRow("browse_scroller_expand_area",a);
this.scrollerContent.select("li").each(function(b){var c="channel_details_"+$(b).identify().substring("browse_grid_".length);browseChannelExpandableRow.addOpener(b,{openerDiv:c})})},_initVariables:function($super){$super();this.headerPositionArray=new Array;this.headerFixedArray=new Array;var a=this.scrollerContent.down("ul");var b=a.select("li");this.headerArray=a.select("h3");this.sliderWidth=(b.length*this.options.SCROLLER_ITEM_WIDTH)+(this.headerArray.length*this.options.SCROLLER_DIVIDER_WIDTH);
a.style.width=this.sliderWidth+"px";b.each(function(c){c.select("h3").each(function(d){var e=d.className.substring(d.className.indexOf("-")+1);if(!isNaN(parseInt(e))){while(this.headerPositionArray.length<parseInt(e)){this.headerPositionArray.push("empty")}this.headerPositionArray.push(Element.positionedOffset(c).left)}},this)},this);if(this.sliderWidth-this.headerPositionArray[this.headerPositionArray.length-1]<650){this.sliderWidth+=(650-(this.sliderWidth-this.headerPositionArray[this.headerPositionArray.length-1]))+10;
this.scrollerContent.down("ul").style.width=this.sliderWidth+"px"}this.maxRange=Math.ceil((this.scrollerContent.scrollWidth-this.scrollerContent.offsetWidth)/(this.options.SCROLLER_ELEMENTS_PER_SCROLL*this.options.SCROLLER_ITEM_WIDTH))},_scrollHorizontal:function($super,b,a){$super(b,a);var c=Math.round(b*(this.options.SCROLLER_ELEMENTS_PER_SCROLL*this.options.SCROLLER_ITEM_WIDTH));this._iPhoneHeaders(b,c+8)},scrollHorizontalByElements:function(a,b){var d=0;for(var c=0;c<b;c++){if(!isNaN(this.headerPositionArray[c])){d++
}}var e=(a+(d*this.options.SCROLLER_DIVIDER_WIDTH/this.options.SCROLLER_ITEM_WIDTH))/this.options.SCROLLER_ELEMENTS_PER_SCROLL;this.slider.setValue(e)},_iPhoneHeaders:function(b,a){var c=new Array;for(i=0;i<this.headerPositionArray.length;i++){c[i]=false;if(this.headerPositionArray[i]<=(a+1)){for(j=0;j<i;j++){c[j]=false}c[i]=true}}for(i=0;i<this.headerPositionArray.length;i++){if(c[i]!=this.headerFixedArray[i]){if(c[i]){$("browse_channels_scroller_anchors").select("ul li")[i].addClassName("active")
}else{$("browse_channels_scroller_anchors").select("ul li")[i].removeClassName("active")}}this.headerFixedArray[i]=c[i]}}}});Dtv.behaviors.define({name:"VerticalScroller",inherits:Dtv.behaviors.GenericScroller,options:{SCROLLER_ITEM_HEIGHT:160},methods:{_init:function($super){$super()},_initEvents:function($super){$super()},_initVariables:function($super){$super();this.axis="vertical";this.scrollHandler=this._scrollVerticalHandler.bind(this);this.maxRange=Math.ceil(this.scrollerContent.scrollHeight/this.options.SCROLLER_ITEM_HEIGHT)
},_scrollVerticalWithAnimation:function(d,a,c){var b=a.scrollTop;a.scrollTop-=Math.floor((b-c)*0.5);if(Math.floor(b)==Math.floor(c)){clearInterval(this.scrollInterval)}},_scrollVertical:function(d,a){clearInterval(this.scrollInterval);var c=Math.round(d/this.slider.maximum*(a.scrollHeight-a.offsetHeight));if(this.slider.dragging){a.scrollTop=c;return}var b=33;if(navigator.userAgent.toLowerCase().indexOf("microsoft")){var b=15}this.scrollInterval=setInterval(this._scrollVerticalWithAnimation.curry(d,a,c),b)
},_scrollVerticalHandler:function(a){this._scrollVertical(a,this.scrollerContent)}}});Dtv.behaviors.define({name:"CompareChannelsScroller",inherits:Dtv.behaviors.VerticalScroller,selectors:{expr:".js-compare-channels-scroller",test:function(){var a=document.location.href.toLowerCase();return(a.indexOf("/compare/")!=-1)}},methods:{_init:function($super){$super()},_initDefaultState:function(){for(var a=0;a<this.headerArray.length;a++){if(this.headerArray[a].hasClassName("selected")){this.scrollVerticalToTarget(a)
}}},_initVariables:function($super){$super();this.headerPositionArray=new Array;this.headerFixedArray=new Array;this.headerArray=this.scrollerContent.select("h3");this.headerArray.each(function(a){this.headerPositionArray.push(Element.positionedOffset(a).top);this.headerFixedArray.push(false)},this)},_scrollVertical:function($super,c,a){$super(c,a);var b=Math.round(c/this.slider.maximum*(a.scrollHeight-a.offsetHeight));this._iPhoneHeaders(c,b)},scrollVerticalToTarget:function(a){var b=((this.headerPositionArray[a]+1)/(this.scrollerContent.scrollHeight-this.scrollerContent.offsetHeight))*this.slider.maximum;
this.slider.setValue(b)},_iPhoneHeaders:function(b,a){var c=new Array;for(i=0;i<this.headerPositionArray.length;i++){c[i]=false;if(this.headerPositionArray[i]<=(a+1)){for(j=0;j<i;j++){c[j]=false}c[i]=true}}for(i=0;i<this.headerPositionArray.length;i++){if(c[i]!=this.headerFixedArray[i]){if(c[i]){this.headerArray[i].addClassName("fixed");this.headerArray[i].style.position="absolute"}else{this.headerArray[i].removeClassName("fixed");this.headerArray[i].style.position="static"}}this.headerFixedArray[i]=c[i]
}}}})})();(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"},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.addCssEvents({mouseenter:"hover",mouseleave:"!hover"});
this._track=this.el.firstDescendant();this._handle=this._track.next();this.setSteps()},_initSlider:function(){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})},_initEvents:function(){},_onSliderChange:function(){if(this._slider.value!=this.value){this.value=this._slider.value;
if(this._onChange){this._onChange()}this.fireEvent(this.EVENTS.CHANGE)}},getSteps:function(){return this.options.steps},setSteps:function(c){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();var b=(this.options.orientation==a.ORIENTATION.HORIZONTAL?this.el.getWidth():this.el.getHeight())/this.options.steps;var d={};d[this.options.orientation==a.ORIENTATION.HORIZONTAL?"width":"height"]=Math.max(b,20)+"px";
this._handle.setStyle(d);this._initSlider()}else{this.el.hide()}return true},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:"GroupedListScrollBar",inherits:Dtv.behaviors.ScrollBar,options:{list:null},methods:{_init:function($super){if(!this.options.list){throw"GroupedListScrollBar must be initialized with a valid list option value."}$super();this.update()},_initEvents:function($super){$super();this.options.list.bindEvent(Dtv.behaviors.GroupedList.EVENTS.ACTIVE_INDEX_CHANGED,this.update.bind(this));this.options.list.bindEvent(Dtv.behaviors.GroupedList.EVENTS.UPDATED,this.update.bind(this))
},_onChange:function(){if(this.options.list.activeGroupIndex!=this.value){this.options.list.moveToIndex(this.value)}},update:function(){if(this.value!=this.options.list.activeGroupIndex){this.setSteps(this.options.list._groups.length);this.scrollToValue(this.options.list.activeGroupIndex)}}}})})();(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"},methods:{_init:function(){this._groupedList=this.el.first("ul").behavior(Dtv.behaviors.GroupedList,{effect:Dtv.behaviors.GroupedList.EFFECT.SLIDE,endless:this.options.endless,orientation:this.options.orientation,nextBtn:this._getBySelector(this.options.nextBtn),prevBtn:this._getBySelector(this.options.prevBtn)});
this._selectionList=this._groupedList.el.behavior(Dtv.behaviors.SelectionList,{endless:this.options.endless});var b=this._getBySelector(this.options.scrollbar);if(b){this._scrollbar=b.behavior(Dtv.behaviors.GroupedListScrollBar,{list:this._groupedList,orientation:this.options.orientation,animate:true})}},_getBySelector:function(b){return b?this.el.first(b):null}}});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($el.first(this.el,".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}if(!this._infoPop){this._initInfoPop()}if(this._infoPop.visible()){this._infoPop.ignoreNextBlur=true}this._infoPop.show({bodyContent:b.clone(true)})
},_onInfoPopHide:function(){this._selectionList.clearSelection()}}})})();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,_init:function(){var a=this.getItems();this.selectItems(a.length>0?this.options.initialSelections||(this.options.selectionRequired?[0]:[]):[])
},_initEvents:function(){var a=this;this.getItems().invoke("observe","click",function(b){b.srcEl=this;a._onItemClick(b)})},_onItemClick:function(a){this.selectItem(a.srcEl)},getItems:function(){if(this.options.cacheItems){if(!this._items){this._items=this.el.childElements()}return this._items}return 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(g,f){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(g);if(!b&&this.options.selectionRequired){b=0}var e=b==null?null:this._getItem(b,c);if(f){return this._selectItem(e)}else{var a=true,d=false;this.getSelectedItems().each(function(h){if(h==e){a=false
}else{if(this.unselectItem(h)){d=true}}}.bind(this));return a&&e!=null?this._selectItem(e)||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}console.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}}});
/*
 * 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)}},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.observeEvents({mouseenter:this._show.bindAsEventListener(this,a),mouseleave:this._hide.bindAsEventListener(this,a)})
},this);this.el.observe(EVENT_ROLLOVER_RESET,this._reset.bind(this))},_reset:function(){this._init();this._initEvents()},_show:function(b,a){if(this.visibleRollover==a){return}this.visibleRollover=a;this._buildTooltip(a);this._setPosition(a,{xCord:Event.pointerX(b)});this._setPosition(a,{yCord:Event.pointerY(b)});this._appear(a)},_buildTooltip:function(f){if(this._getRollover(f)){return}var k=f.title?$(f.title):f.first(".dtv-rollover-tup");f.title="";if(k){f.select("img").each(function(l){l.alt=""
});k=k.remove();document.body.insertBefore(k,document.body.childNodes[0]);var a=k.getDimensions();var c=a.width+10;var h=a.height;this._setPosition(f,{width:c});this._setPosition(f,{height:h});k.style.width=c+"px"}var b=this._getOpenerIndex(f);this.rollovers[b]=k;var e=this.openerPositions[b].openerWidth;var g=this.openerPositions[b].openerHeight;if(!e||!g){var d=f.getDimensions();this._setPosition(f,{openerWidth:d.width});this._setPosition(f,{openerHeight:d.height})}},_hide:function(b,a){if(this.visibleRollover!=a){return
}this.visibleRollover="";if(this.appearingFX){this.appearingFX.cancel()}a.stopObservingEvents({mousemove:this.updateEvent});this._getRollover(a).hide()},_appear:function(a){this._setup(a);a.observeEvents({mousemove:this.updateEvent});this._getRollover(a).show()},_setup:function(e){var d=this._getOpenerIndex(e);var b=this.openerPositions[d].xCord;var f=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(e,{xCord:b})}this._getRollover(e).setStyle({left:(b-7)+"px",top:(f-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",selectors:"a.js_tooltip",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.opener=this.el;
this.tooltip=$(this.opener.title);if(this.tooltip){this._initializeTooltip()}this.opener.title=""},_initializeTooltip:function(a){var b=this.tooltip.innerHTML;new Tip(this.opener,b,this.options.TOOLTIP_OPTIONS)}}});Dtv.behaviors.define({name:"BusinessTooltip",inherits:Dtv.behaviors.GenericTooltip,selectors:{expr:"a.js_tooltip_link",test:function(){var a=document.location.href.toLowerCase();return(a.indexOf("/theguide.jsp")==-1)}},methods:{_init:function(){this.opener=this.el;if(this.opener.title){this.opener.href="#";
this.opener.onclick=function(){return false};var a="<div class='dtv_tooltip_top'></div><div class='dtv_tooltip_content_wrapper'><div class='dtv_tooltip_content'><div class='dtv_tooltip_close close'></div>"+this.opener.title+"</div></div><div class='dtv_tooltip_bottom'></div>";new Tip(this.opener,a,this.options.TOOLTIP_OPTIONS);this.opener.title=""}}}})})();function initializeModifyProfileWindow(){var a=new DtvLightbox("lightboxDiv",DEFAULT_CEP_LIGHTBOX_OPTIONS)}var modifyEmailHandlerOptions={subContentDiv:"lb_modify_email",hitboxEvent:"Update Email Lightbox",forcePageReload:true,forceLightboxClose:true};
var modifyEmailHandlers=new GenericWatcherHandlers(modifyEmailHandlerOptions);function openModifyEmailLightbox(){var a={contentDiv:"lightboxDiv",subContentDiv:"lb_modify_email",callback:"dtv:lightboxModifyEmailOpened",hitboxPageName:"Modify Email Lightbox"};displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS)}var resetPasswordHandlerOptions={subContentDiv:"securityResetDiv",hitboxEvent:"Reset Password From Email Lightbox",forceLightboxClose:true,successCallback:resetPasswordHandlerSuccess};var resetPasswordHandlers=new GenericWatcherHandlers(resetPasswordHandlerOptions);
function resetPasswordHandlerSuccess(a){if($("myAccountMessageDiv")!=null){displayMessages("myAccountMessageDiv",a.messages,a.messageLevel)}else{if($("checkout-error")!=null){if(a.email!=null){$("userNameField").value=a.email}displayMessages("checkout-error",a.messages,a.messageLevel)}else{if(a.email!=null){$("loginField").value=a.email}displayMessages("loginMessageDiv",a.messages,a.messageLevel)}}}function openResetPasswordLightbox(){var a={contentDiv:"lightboxDiv",subContentDiv:"securityResetDiv",callback:"dtv:lightboxResetPasswordOpened",hitboxPageName:"Reset Password From Email Lightbox"};
displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS)}function initializeLogin(){initializeForgotEmailLightbox();initializeForgotPasswordLightbox()}function initializeLoginWindow(){var b={width:568,top:100};var a=new DtvLightbox("lightboxDiv",b);a.observe("shown",activateForgotEmailLightbox)}var forgotEmailHandlers={success:function(a,b){if(!b.success){forgotEmailHandlers.failure(a,b);return}$("loginField").value=b.email;closeLightbox()},failure:function(a,b){DtvProcessingWatcher.removeProcessing()
}};function initializeForgotEmailLightbox(){var a={containerDiv:"op1Form",errorClass:"ajaxError"};var d=new SubmitWatcher("forgotEmail1Submit","forgotEmail1Form",{successHandler:forgotEmailHandlers.success.bind(forgotEmailHandlers),jsonErrorHandler:a});$("forgotEmail1Submit").disabled=false;var f={containerDiv:"op2Form",errorClass:"ajaxError"};var c=new SubmitWatcher("forgotEmail2Submit","forgotEmail2Form",{successHandler:forgotEmailHandlers.success.bind(forgotEmailHandlers),jsonErrorHandler:f});
$("forgotEmail2Submit").disabled=false;var e={containerDiv:"op3Form",errorClass:"ajaxError"};var b=new SubmitWatcher("forgotEmail3Submit","forgotEmail3Form",{successHandler:forgotEmailHandlers.success.bind(forgotEmailHandlers),jsonErrorHandler:e});$("forgotEmail3Submit").disabled=false;Event.observe("lightboxDiv","dtv:lightboxEmailOpened",activateForgotEmailLightbox,false)}function activateForgotEmailLightbox(){var b=$("accordion-container");if(!b){return}var a=b.behaviors.Accordion.accordion;if(!a.showAccordion&&$("forgotEmailDiv").visible()){a.activate(b.select(".accordion-toggle")[0])
}}function transitionForgotEmail(){transition("securityEmailDiv","forgotEmailDiv");setTimeout(activateForgotEmailLightbox,1000);hitboxCustomEvent("Forgot Email Lightbox",null)}function displayForgotEmailLightbox(){var a={contentDiv:"lightboxDiv",subContentDiv:"forgotEmailDiv",callback:"dtv:lightboxEmailOpened",hitboxPageName:"Forgot+Email+Lightbox"};displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS);clearErrors("lightboxDiv","ajaxError")}var securityEmailHandlers={success:function(a,b){if(!b.hasSecurity){DtvProcessingWatcher.removeProcessing();
processJSONErrors("securitySendEmailDiv","ajaxError",b);if($("securityThinking").visible()){transition("securityThinking","securitySendEmailDiv")}else{transition("securityEmailDiv","securitySendEmailDiv")}$("securitySendEmail").innerHTML=b.email;hitboxCustomEvent("Forgot Password Send Email Lightbox",null);return}if(!b.success){securityEmailHandlers.failure(a,b);return}DtvProcessingWatcher.removeProcessing();processJSONErrors("securityEmailDiv","ajaxError",b);if($("securityThinking").visible()){transition("securityThinking","securityAnswerDiv")
}else{transition("securityEmailDiv","securityAnswerDiv")}$("securityQuestion").innerHTML=b.question;$("securityQuestionId").value=b.questionId;$("securityAnswerForm").forgotAnswer.value="";hitboxCustomEvent("Forgot Password Answer Security Question Lightbox",null)},failure:function(a,b){DtvProcessingWatcher.removeProcessing();if($("securityThinking").visible()){transition("securityThinking","securityEmailDiv")}processJSONErrors("securityEmailDiv","ajaxError",b);hitboxCustomEvent("Forgot Password Enter Email Lightbox",null)
}};var securitySendEmailHandlers={success:function(a,b){if($("myAccountMessageDiv")!=null){displayMessages("myAccountMessageDiv",b.messages,b.messageLevel)}else{if($("checkout-error")!=null){displayMessages("checkout-error",b.messages,b.messageLevel)}else{displayMessages("loginMessageDiv",b.messages,b.messageLevel)}}closeLightbox()},failure:function(a,b){closeLightbox()}};var securityAnswerHandlerOptions={subContentDiv:"securityAnswerDiv",hitboxEvent:"Forgot Password Answer Security Question Lightbox",successCallback:securityAnswerHandlerSuccess};
var securityAnswerHandlers=new GenericWatcherHandlers(securityAnswerHandlerOptions);function securityAnswerHandlerSuccess(a){if(a.email){$("securitySendEmail").innerHTML=a.email;hitboxCustomEvent("Forgot Password Send Email Lightbox",null);transition("securityAnswerDiv","securitySendEmailDiv");return}$("resetPasswordToken").value="";hitboxCustomEvent("Forgot Password Reset Password Lightbox",null);transition("securityAnswerDiv","securityResetDiv")}function forgotAnswerSendEmail(){$("securityAnswerForm").forgotAnswer.value="true";
$("securityAnswerForm").onsubmit()}var watcherEmail=null;function initializeForgotPasswordLightbox(){watcherEmail=new SubmitWatcher("securityEmailSubmit","securityEmailForm",{createHandler:securityEmailHandlers.create,successHandler:securityEmailHandlers.success,failureHandler:securityEmailHandlers.failure});$("securityEmailSubmit").disabled=false;var a=new SubmitWatcher("securityAnswerSubmit","securityAnswerForm",{successHandler:securityAnswerHandlers.success.bind(securityAnswerHandlers),failureHandler:securityAnswerHandlers.failure.bind(securityAnswerHandlers)});
$("securityAnswerSubmit").disabled=false;var c=new SubmitWatcher("securityResetSubmit","securityResetForm",{successHandler:resetPasswordHandlers.success.bind(resetPasswordHandlers),failureHandler:resetPasswordHandlers.failure.bind(resetPasswordHandlers)});$("securityResetSubmit").disabled=false;var b=new SubmitWatcher("securitySendEmailSubmit","securitySendEmailForm",{successHandler:securitySendEmailHandlers.success,failureHandler:securitySendEmailHandlers.failure});$("securitySendEmailSubmit").disabled=false
}function displayForgotPasswordLightbox(){var a={contentDiv:"lightboxDiv",subContentDiv:"securityThinking",callback:"dtv:lightboxPasswordOpened",suppressHitbox:true};if($("userNameField")!=null){$("forgotEmailLink").hide()}if($("loginField")!=null&&$("loginField").value!=""){displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS);$("securityEmail").value=$("loginField").value;watcherEmail.hijackNode($("securityEmailSubmit"))}else{if($("userNameField")!=null&&$("userNameField").value!=""){displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS);
$("securityEmail").value=$("userNameField").value;watcherEmail.hijackNode($("securityEmailSubmit"))}else{a.subContentDiv="securityEmailDiv";displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS)}}clearErrors("lightboxDiv","ajaxError")}var challengeResponseHandlerOptions={subContentDiv:"lb_modify_security_question",hitboxEvent:"Create Security Question Lightbox",forceLightboxClose:true,successCallback:challengeResponseHandlerSuccess};var challengeResponseHandlers=new GenericWatcherHandlers(challengeResponseHandlerOptions);
function challengeResponseHandlerSuccess(a){if(a.nextUrl!=null){window.location.href=a.nextUrl}else{displayMessages("myAccountMessageDiv",a.messages,a.messageLevel)}}function initializeChallengeResponseLightbox(){openChallengeResponseLightbox();var b={containerDiv:"lb_modify_security_question",errorClass:"ajaxError"};var a=new SubmitWatcher("challengeResponseSubmit","challengeResponseForm",{successHandler:challengeResponseHandlers.success.bind(challengeResponseHandlers),jsonErrorHandler:b});$("challengeResponseSubmit").disabled=false
}function openChallengeResponseLightbox(){var a={contentDiv:"lightboxDiv",subContentDiv:"lb_modify_security_question",callback:"dtv:lightboxChallengeResponseOpened",hitboxPageName:"Create Security Question Lightbox"};displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS)}function openPrivacyLightbox(){var a={contentDiv:"lightboxDiv",subContentDiv:"lb_update_privacy",callback:"dtv:lightboxPrivacyOpened",hitboxPageName:"Update Privacy Options Lightbox"};displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS)
}var privacyHandlerOptions={subContentDiv:"lb_update_privacy",hitboxEvent:"Update Privacy Options Lightbox",forcePageReload:true,forceLightboxClose:true};var privacyHandlers=new GenericWatcherHandlers(privacyHandlerOptions);function openChangeAddressLightbox(){contentOptions={callback:"dtv:lightboxChangeAddressOpened",contentDiv:"lightboxDiv",subContentDiv:"lb_change_address",hitboxPageName:"Change Address Lightbox"};displayLightbox(contentOptions,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS)}var changeAddressHandlerOptions={subContentDiv:"lb_change_address",hitboxEvent:"Change Address Lightbox",forcePageReload:true,forceLightboxClose:true};
var changeAddressHandlers=new GenericWatcherHandlers(changeAddressHandlerOptions);function openCreditCardLightbox(){contentOptions={callback:"dtv:lightboxCreditCardOpened",contentDiv:"lightboxDiv",subContentDiv:"lb_change_credit_card",hitboxPageName:"Change Credit Card Lightbox"};displayLightbox(contentOptions,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS)}var changeCreditCardHandlerOptions={subContentDiv:"lb_change_credit_card",hitboxEvent:"Change Credit Card Lightbox",forcePageReload:true,forceLightboxClose:true};
var changeCreditCardHandlers=new GenericWatcherHandlers(changeCreditCardHandlerOptions);function confirmSubscriptionRemovalRequired(a){var b=a.select('[type="checkbox"].js_email_preference')[0];if(b!=undefined&&!b.checked&&$("confirmSubscriptionRemovalHidden").value==""){openConfirmSubscriptionRemovalLightbox();b.checked=true;$("confirmSubscriptionRemovalHidden").value=b.id;return true}return false}function confirmSubscriptionRemoval(){closeLightbox();checkbox=$($("confirmSubscriptionRemovalHidden").value);
checkbox.click();$("confirmSubscriptionRemovalHidden").value=""}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(){contentOptions={callback:"dtv:lightboxConfirmSubscriptionRemovalOpened",contentDiv:"lightboxDiv",subContentDiv:"lb_confirm_subscription_removal",hitboxPageName:"Confirm Subscription Removal"};displayLightbox(contentOptions,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS)}function initializeMyAccountPage(){if($("billing-accordion-content")){Event.observe("billing-accordion-content",EVENT_ACCORDION_OPENED,retrieveBilling,false)
}if($("pending-orders-accordion-content")){Event.observe("pending-orders-accordion-content",EVENT_ACCORDION_OPENED,retrievePendingOrders,false)}if($("completed-orders-accordion-content")){Event.observe("completed-orders-accordion-content",EVENT_ACCORDION_OPENED,retrieveCompletedOrders,false)}if($("subscription-accordion")){var b=$$("form.ajaxForm").each(function(g){var e=g.select('[type="checkbox"]')[0];var f=g.select("select")[0];if(f!=null){new SubmitWatcher(f,g,{createHandler:subscriptionHandlers.create,successHandler:subscriptionHandlers.success,failureHandler:subscriptionHandlers.failure,returnValue:true,eventType:"change"})
}if(e!=null){new SubmitWatcher(e,g,{createHandler:subscriptionHandlers.createCheckbox,successHandler:subscriptionHandlers.success,failureHandler:subscriptionHandlers.failure,returnValue:true});e.disabled=false}})}watcherUpdateEmail=new SubmitWatcher("lbModifyEmailSubmit","lbModifyEmailForm",{successHandler:modifyEmailHandlers.success.bind(modifyEmailHandlers),failureHandler:modifyEmailHandlers.failure.bind(modifyEmailHandlers)});$("lbModifyEmailSubmit").disabled=false;var d=new SubmitWatcher("securityResetSubmit","securityResetForm",{successHandler:resetPasswordHandlers.success.bind(resetPasswordHandlers),failureHandler:resetPasswordHandlers.failure.bind(resetPasswordHandlers)});
$("securityResetSubmit").disabled=false;var c={containerDiv:"lb_modify_security_question",errorClass:"ajaxError"};var a=new SubmitWatcher("challengeResponseSubmit","challengeResponseForm",{successHandler:challengeResponseHandlers.success.bind(challengeResponseHandlers),jsonErrorHandler:c});$("challengeResponseSubmit").disabled=false;new SubmitWatcher("privacyOptionsSubmit","privacyOptionsForm",{successHandler:privacyHandlers.success.bind(privacyHandlers),failureHandler:privacyHandlers.failure.bind(privacyHandlers)});
$("privacyOptionsSubmit").disabled=false;new SubmitWatcher("changeAddressSubmit","changeAddressForm",{successHandler:changeAddressHandlers.success.bind(changeAddressHandlers),failureHandler:changeAddressHandlers.failure.bind(changeAddressHandlers)});$("changeAddressSubmit").disabled=false;new SubmitWatcher("changeCreditCardSubmit","changeCreditCardForm",{successHandler:changeCreditCardHandlers.success.bind(changeCreditCardHandlers),failureHandler:changeCreditCardHandlers.failure.bind(changeCreditCardHandlers)});
$("changeCreditCardSubmit").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 initializeGoGreen(){watcherUpdateEmail=new SubmitWatcher("lbModifyEmailSubmit","lbModifyEmailForm",{successHandler:modifyEmailHandlers.success.bind(modifyEmailHandlers),failureHandler:modifyEmailHandlers.failure.bind(modifyEmailHandlers)});$("lbModifyEmailSubmit").disabled=false}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){if(!b.success&&b.nextUrl==null){genericMyProgrammingHandlers.failure(a,b);return}if(b.redirectUrl!=null){window.location.href=b.redirectUrl;return}if(b.reload){window.location.reload(true);return}if(b.nextUrl==null){b.errors.push("nextUrl not specified");genericMyProgrammingHandlers.failure(a,b);return}DtvProcessingWatcher.removeProcessing();contentOptions={callback:"dtv:lightboxCEPOpened",contentDiv:"lightboxDiv",subContentDiv:"lb_thinking",suppressHitbox:true};
displayLightbox(contentOptions,DEFAULT_CEP_LIGHTBOX_OPTIONS);jsonTopMessages="";if(b.topMessages!=null){jsonTopMessages=b.topMessages.toString()}ajaxOptions={topMessages:jsonTopMessages,rightMessage:b.rightMessage,bottomMessage:b.bottomMessage};myAjax=new Ajax.Updater("lb_ajax",b.nextUrl,{method:"get",onComplete:transitionToAjaxContent,parameters:ajaxOptions})},failure:function(a,b){displayGenericErrorLightbox(b)}};function initializeProductListingPage(){var d=$$("form.ajaxForm");for(var c=0;c<d.length;
c++){var e=d[c].select(".ajaxSubmit");if(e.length==0){continue}var b=e[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)}}function initializeCepLightboxWindow(){var a=new DtvLightbox("lightboxDiv",DEFAULT_CEP_LIGHTBOX_OPTIONS)}var promoCodeHandlers={create:function(a,b){hitboxCustomEvent("Enter Promo Code Lightbox",null);return true},success:function(a,b){DtvProcessingWatcher.removeProcessing();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){DtvProcessingWatcher.removeProcessing();
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 e=$$("form.ajaxForm");for(var d=0;d<e.length;d++){var c=e[d].select(".ajaxSubmit")[0];new SubmitWatcher(c,e[d],{successHandler:genericMyProgrammingHandlers.success,failureHandler:genericMyProgrammingHandlers.failure});c.disabled=false}var a=$$(".changeReceiverLocationForm");for(var d=0;d<a.length;d++){var f=a[d].select("select.js_receiverLocation")[0];var b=a[d].select(".js_changeReceiverLocationSubmit")[0];
new SubmitWatcher(f,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"};
DtvProcessingWatcher.removeProcessing();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){DtvProcessingWatcher.removeProcessing();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)}}function displayWizardRailMessage(a){railMessage=a.successCallbackArgument;
$("wiz_rail_message").update(railMessage);$("wiz_rail_message").show()}var wizardOfferForm=null;function requireZipCode(b){wizardOfferForm=b;var a=wizardOfferForm.id.substring("form-".length);var c=$("zip-"+a).value;if(c==null||c==""){openEnterZipCodeLightbox();return false}return true}function openEnterZipCodeLightbox(){var a={contentDiv:"lightboxDiv",subContentDiv:"lb_enter_zip",callback:"dtv:lightboxEnterZipCodeOpened",hitboxPageName:"Enter+Zip+Code+Lightbox"};DtvProcessingWatcher.removeProcessing();
displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS);$("lightboxDiv").observe("dtv:lightboxEnterZipCodeOpened",function(){$("zipCode").focus()})}function openWizardSessionWarningLightbox(){var a={contentDiv:"sessionWarninglightboxDiv",subContentDiv:"lb_wizard_session_warning",callback:"dtv:dontKnowWhatThisIs",hitboxPageName:"Wizard+Session+Warning+Lightbox"};DtvProcessingWatcher.removeProcessing();displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS)}function initializeWizardOffersPage(){var a=$$(".js-collapsible-tabs");
for(var b=0;b<a.length;b++){var c=0;var d=a[b];$(d.select(".js-collapsible-tab-title")).each(function(e){if(c==1||c==2){e.iTabIndex=c;e.observe("click",function(){loadRawOfferModuleData(this.id)})}c++})}}function openOfferTab(b,a){var b=b-1;if(a==undefined){var a=0}else{var a=a-1}if(document.loaded){$$(".js-collapsible-tabs")[b].select("div span")[a].fire(EVENT_COLLAPSIBLE_TAB_ACTIVATE)}else{Event.observe(window,"load",function(){var c=setInterval(function(){clearInterval(c);$$(".js-collapsible-tabs")[b].select("div span")[a].fire(EVENT_COLLAPSIBLE_TAB_ACTIVATE)
},50)})}}function loadRawOfferModuleData(c){var a=c.split("_");var b="offer_content_"+a[2]+"_"+a[3];if($(b).className.indexOf("content-loaded")==-1){new Ajax.Updater(b,"/DTVAPP/wizard/component/ajaxMoreInfoModule.jsp?offerId="+a[2]+"&tabIndex="+a[3],{method:"get"});$(b).addClassName("content-loaded")}}var enterZipCodeHandlers={success:function(a,d){if(!d.success){enterZipCodeHandlers.failure(a,d);return}$("zipCode").readOnly=false;displayMessages("lb_enter_zip_message_container",d.messages,d.messageLevel);
if(d.countyCodes!=null){DtvProcessingWatcher.removeProcessing();$("zipCode").readOnly=true;$("countyDiv").show();$("countySelect").options.length=0;$("countySelect").options[0]=new Option("","");for(var c=0;c<d.countyCodes.length;c++){$("countySelect").options[c+1]=new Option(d.countyNames[c],d.countyCodes[c])}}else{if(wizardOfferForm!=null){var b=wizardOfferForm.id.substring("form-".length);$("zip-"+b).value=d.zipCode;$("county-"+b).value=d.countyCode;$("submit-"+b).click()}else{document.location.href="/DTVAPP/wizard/buildYourSystem1.jsp"
}}},failure:function(a,b){$("zipCode").readOnly=false;DtvProcessingWatcher.removeProcessing();processJSONErrors("lb_enter_zip","ajaxError",b)}};function hideCounty(){Effect.Fade("countyDiv");$("countySelect").selectedIndex=0}function initializeEnterZipCodeLightbox(){var a=new SubmitWatcher("enterZipCodeSubmit","enterZipCodeForm",{successHandler:enterZipCodeHandlers.success,failureHandler:enterZipCodeHandlers.failure});$("enterZipCodeSubmit").disabled=false}function formatOfferPrice(b){aPrice=b.split(".");
var a='<span class="offer-pricing-formatted"><sup class="dollarPrice">$</sup>'+aPrice[0]+'<sup class="ninetyNine">'+aPrice[1]+'</sup><span class="abbrevMonth">&nbsp;mo</span></span>';document.write(a)}var readCreditCheckMessageSubmitHandlerOptions={subContentDiv:"lb_credit_check",hitboxEvent:"Credit Check Message Lightbox",forcePageReload:false,forceLightboxClose:true};var readCreditCheckMessageSubmitHandlers=new GenericWatcherHandlers(readCreditCheckMessageSubmitHandlerOptions);function initializeCreditCheckLightbox(){var a=new SubmitWatcher("readCreditCheckMessageSubmit","readCreditCheckMessageForm",{successHandler:readCreditCheckMessageSubmitHandlers.success.bind(readCreditCheckMessageSubmitHandlers),failureHandler:enterZipCodeHandlers.failure.bind(readCreditCheckMessageSubmitHandlers)});
$("readCreditCheckMessageSubmit").disabled=false}_creditCheckAlreadyDisplayed=false;function displayCreditCheckLightbox(){if(_creditCheckAlreadyDisplayed){return}var a={contentDiv:"lightboxDiv",subContentDiv:"lb_credit_check",callback:"dtv:lightboxCreditCheckOpened",hitboxPageName:"Credit+Check+Lightbox"};displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS);_creditCheckAlreadyDisplayed=true}function displayAffiliateNumberRequiredLightbox(){var a={contentDiv:"lightboxDiv",subContentDiv:"lb_affiliate_number_required",callback:"dtv:lightboxAffiliateNumberRequiredOpened",hitboxPageName:"Affiliate+Number+Required+Lightbox"};
displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS)}function openRedemptionOfferChangeWarningLightbox(){if($("allUserEmailInterests").checked){return}var a={contentDiv:"lightboxDiv",subContentDiv:"lb_redemption_offer_change",callback:"dtv:lightboxRedemptionOfferChangeOpened",hitboxPageName:"Redemption+Offer+Change+Lightbox"};displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS)}function displayCheckoutUpdateEmailLightbox(){var a={contentDiv:"lightboxDiv",subContentDiv:"lb_modify_email",callback:"dtv:lightboxUpdateEmailOpened",hitboxPageName:"Update Email Lightbox"};
displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS)}var checkoutUpdateEmailHandlerOptions={subContentDiv:"lb_modify_email",hitboxEvent:"Update Email Lightbox",forceLightboxClose:true,successCallback:checkoutEmailUpdateSuccess};var checkoutUpdateEmailHandlers=new GenericWatcherHandlers(checkoutUpdateEmailHandlerOptions);function initializeCheckoutRegAnonPage(){var a=new SubmitWatcher("lbModifyEmailSubmit","lbModifyEmailForm",{successHandler:checkoutUpdateEmailHandlers.success.bind(checkoutUpdateEmailHandlers),failureHandler:checkoutUpdateEmailHandlers.failure.bind(checkoutUpdateEmailHandlers)});
$("lbModifyEmailSubmit").disabled=false;var b=new SubmitWatcher("changeInstallAddressSubmit","changeInstallAddressForm",{successHandler:checkoutUpdateInstallationAddressHandlers.success.bind(checkoutUpdateInstallationAddressHandlers),failureHandler:checkoutUpdateInstallationAddressHandlers.failure.bind(checkoutUpdateInstallationAddressHandlers)});$("changeInstallAddressSubmit").disabled=false}function checkoutEmailUpdateSuccess(){$("checkoutUserEmail").value=$("updateEmail").value;$("checkoutConfirmUserEmail").value=$("updateEmail").value;
$("checkoutUserEmailText").update($("updateEmail").value);$("lightbox_email_text").update($("updateEmail").value);$("updateEmail").value="";$("updateEmailConfirm").value=""}var CREDIT_CHECK_YES=1;var CREDIT_CHECK_NO=2;var CREDIT_CHECK_NEW=3;function changeCreditCheckStatus(a){var b="credit_check_yes";if(a==CREDIT_CHECK_NO){b="credit_check_no"}if(!($(b))){throw"div with id '"+b+"' does not exist in changeCreditCheckStatus()"}if($(b).visible()||(a==CREDIT_CHECK_YES&&$("credit_check_complete").visible())){return
}$("credit_check_complete").hide();$("credit_check_yes").hide();$("credit_check_no").hide();$("ssn1Field").value="";$("ssn2Field").value="";$("ssn3Field").value="";if(a==CREDIT_CHECK_NO){$("checkout_creditcheck").addClassName("credit-check-no")}else{$("checkout_creditcheck").removeClassName("credit-check-no")}Effect.Appear(b)}function initializeCheckoutProspectPage(){initializeForgotPasswordLightbox()}var emailShoppingCartHandlerOptions={subContentDiv:"lb_email_shopping_cart",hitboxEvent:"Email Shopping Cart Lightbox",forceLightboxClose:true,successCallback:displayWizardRailMessage};
var emailShoppingCartHandlers=new GenericWatcherHandlers(emailShoppingCartHandlerOptions);function displayEmailShoppingCartLightbox(){var a={contentDiv:"lightboxWizardDiv",subContentDiv:"lb_email_shopping_cart",callback:"dtv:lightboxEmailShoppingCartOpened",hitboxPageName:"Email Shopping Cart Lightbox"};displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS)}function initializeEmailShoppingCartLightbox(){var a=new SubmitWatcher("emailShoppingCartSubmit","emailShoppingCartForm",{successHandler:emailShoppingCartHandlers.success.bind(emailShoppingCartHandlers),failureHandler:emailShoppingCartHandlers.failure.bind(emailShoppingCartHandlers)});
$("emailShoppingCartSubmit").disabled=false}var saveShoppingCartHandlerOptions={subContentDiv:"lb_save_shopping_cart",hitboxEvent:"Save Shopping Cart Lightbox",forceLightboxClose:true,successCallback:displayWizardRailMessage};var saveShoppingCartHandlers=new GenericWatcherHandlers(saveShoppingCartHandlerOptions);function displaySaveShoppingCartLightbox(){var a={contentDiv:"lightboxWizardDiv",subContentDiv:"lb_save_shopping_cart",callback:"dtv:lightboxSaveShoppingCartOpened",hitboxPageName:"Save+Shopping+Cart+Lightbox"};
displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS)}function initializeSaveShoppingCartLightbox(){var a=new SubmitWatcher("saveShoppingCartSubmit","saveShoppingCartForm",{successHandler:saveShoppingCartHandlers.success.bind(saveShoppingCartHandlers),failureHandler:saveShoppingCartHandlers.failure.bind(saveShoppingCartHandlers)});$("saveShoppingCartSubmit").disabled=false}function openChangeInstallAddressLightbox(){contentOptions={callback:"dtv:lightboxChangeInstallAddressOpened",contentDiv:"lightboxDiv",subContentDiv:"lb_change_install_address",hitboxPageName:"Change Install Address Lightbox"};
displayLightbox(contentOptions,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS);clearErrors("lb_change_install_address","ajaxError");$("firstName").value=$("checkoutUserFirstName").value;$("middleInitial").value=$("checkoutUserMiddleInitial").value;$("lastName").value=$("checkoutUserLastName").value;$("address1").value=$("checkoutUserAddress1").value;if($("checkoutUserAddress2").value!=undefined&&$("checkoutUserAddress2").value!=null){$("address2").value=$("checkoutUserAddress2").value}if($("checkoutUserAddress3").value!=undefined&&$("checkoutUserAddress3").value!=null){$("address3").value=$("checkoutUserAddress3").value
}$("city").value=$("checkoutUserCity").value;$("areaCode").value=$("checkoutUserPhoneAreaCode").value;$("phonePrefix").value=$("checkoutUserPhonePrefix").value;$("phoneSuffix").value=$("checkoutUserPhoneSuffix").value;if($("ssn1Field").value!=null&&$("ssn1Field").value!=undefined){$("lbSsn1").value=$("ssn1Field").value}if($("ssn2Field").value!=null&&$("ssn2Field").value!=undefined){$("lbSsn2").value=$("ssn2Field").value}if($("ssn3Field").value!=null&&$("ssn3Field").value!=undefined){$("lbSsn3").value=$("ssn3Field").value
}if($("creditCheck_yes").checked){$("lbConsentToCreditCheck").value=$("creditCheck_yes").value}else{$("lbConsentToCreditCheck").value=$("creditCheck_no").value}}var changeInstallAddressHandlerOptions={subContentDiv:"lb_change_install_address",hitboxEvent:"Change Install Address Lightbox",forceLightboxClose:true};var checkoutUpdateInstallationAddressHandlers={success:function(a,b){if(!b.success){return this.failure(a,b)}processJSONErrors("lb_change_install_address","ajaxError",b);closeLightbox();if(b.checkoutUserFirstName!=undefined){$("checkoutUserFirstName").value=b.checkoutUserFirstName;
$("checkoutUserFirstNameText").update(b.checkoutUserFirstName)}if(b.checkoutUserMiddleInitial!=undefined){$("checkoutUserMiddleInitial").value=b.checkoutUserMiddleInitial;$("checkoutUserMiddleInitialText").update(b.checkoutUserMiddleInitial)}if(b.checkoutUserLastName!=undefined){$("checkoutUserLastName").value=b.checkoutUserLastName;$("checkoutUserLastNameText").update(b.checkoutUserLastName)}if(b.checkoutUserAddress1!=undefined){$("checkoutUserAddress1").value=b.checkoutUserAddress1;$("checkoutUserAddress1Text").update(b.checkoutUserAddress1)
}if(b.checkoutUserAddress2!=undefined){$("checkoutUserAddress2").value=b.checkoutUserAddress2;$("checkoutUserAddress2Text").update(b.checkoutUserAddress2);if($("checkoutUserAddress2").value.length>0){$("checkoutUserAddress2Text").show()}else{$("checkoutUserAddress2Text").hide()}}if(b.checkoutUserAddress3!=undefined){$("checkoutUserAddress3").value=b.checkoutUserAddress3;$("checkoutUserAddress3Text").update("#"+b.checkoutUserAddress3);if($("checkoutUserAddress3").value.length>0){$("checkoutUserAddress3Text").show()
}else{$("checkoutUserAddress3Text").hide()}}if(b.checkoutUserCity!=undefined){$("checkoutUserCity").value=b.checkoutUserCity;$("checkoutUserCityText").update(b.checkoutUserCity)}if(b.checkoutUserPhoneAreaCode!=undefined){$("checkoutUserPhoneAreaCode").value=b.checkoutUserPhoneAreaCode}if(b.checkoutUserPhonePrefix!=undefined){$("checkoutUserPhonePrefix").value=b.checkoutUserPhonePrefix}if(b.checkoutUserPhoneSuffix!=undefined){$("checkoutUserPhoneSuffix").value=b.checkoutUserPhoneSuffix}if((b.checkoutUserPhoneAreaCode)!=undefined&&(b.checkoutUserPhonePrefix!=undefined)&&(b.checkoutUserPhoneSuffix!=undefined)){$("checkoutUserPhoneText").update("("+b.checkoutUserPhoneAreaCode+") "+b.checkoutUserPhonePrefix+"-"+b.checkoutUserPhoneSuffix)
}return true},failure:function(a,b){processJSONErrors("lb_change_install_address","ajaxError",b);DtvProcessingWatcher.removeProcessing();hitboxCustomEvent("Change Install Address Lightbox",null);return false}};function openZipCodeWarningLightbox(){var a={contentDiv:"lightboxDiv",subContentDiv:"lb_change_zip_code_warning",callback:"dtv:lightboxChangeZipCodeWarningOpened",hitboxPageName:"Change+Zip+Code+Warning+Lightbox"};displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS)}function initializeWizardCheckoutPaymentPage(){var a=new SubmitWatcher("changeBillingAddressSubmit","changeBillingAddressForm",{successHandler:checkoutUpdateBillingAddressHandlers.success.bind(checkoutUpdateBillingAddressHandlers),failureHandler:checkoutUpdateBillingAddressHandlers.failure.bind(checkoutUpdateBillingAddressHandlers)});
$("changeBillingAddressSubmit").disabled=false}function openChangeWizardBillingAddressLightbox(){contentOptions={callback:"dtv:openChangeWizardBillingAddressLightbox",contentDiv:"lightboxDiv",subContentDiv:"lb_change_wizard_billing_address",hitboxPageName:"Change Wizard Billing Address Lightbox"};displayLightbox(contentOptions,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS);clearErrors("lb_change_wizard_billing_address","ajaxError");$("billFirstName").value=$("wizard_billing_firstName").value;$("billLastName").value=$("wizard_billing_lastName").value;
$("billAddress1").value=$("wizard_billing_address1").value;if($("wizard_billing_address2").value!=null&&$("wizard_billing_address2").value!=undefined){$("billAddress2").value=$("wizard_billing_address2").value}if($("wizard_billing_aptNum").value!=null&&$("wizard_billing_aptNum").value!=undefined){$("billAddress3").value=$("wizard_billing_aptNum").value}$("billCity").value=$("wizard_billing_city").value;$("billPostalCode").value=$("wizard_billing_zip").value;$("billState").value=$("wizard_billing_state").value;
$("billPhoneAreaCode").value=$("wizard_billing_phoneArea").value;$("billPhonePrefix").value=$("wizard_billing_phone3").value;$("billPhoneSuffix").value=$("wizard_billing_phone4").value}var changeCheckoutWizardBillingAddressHandlerOptions={subContentDiv:"lb_change_wizard_billing_address",hitboxEvent:"Change Wizard Billing Address Lightbox",forceLightboxClose:true};var checkoutUpdateBillingAddressHandlers={success:function(a,b){if(!b.success){return this.failure(a,b)}processJSONErrors("lb_change_wizard_billing_address","ajaxError",b);
closeLightbox();if(b.wizard_billing_firstName!=undefined){$("wizard_billing_firstName").value=b.wizard_billing_firstName;$("wizard_billing_firstNameText").update(b.wizard_billing_firstName)}if(b.wizard_billing_lastName!=undefined){$("wizard_billing_lastName").value=b.wizard_billing_lastName;$("wizard_billing_lastNameText").update(b.wizard_billing_lastName)}if(b.wizard_billing_address1!=undefined){$("wizard_billing_address1").value=b.wizard_billing_address1;$("wizard_billing_address1Text").update(b.wizard_billing_address1)
}if(b.wizard_billing_address2!=undefined){$("wizard_billing_address2").value=b.wizard_billing_address2;$("wizard_billing_address2Text").update(b.wizard_billing_address2);if($("wizard_billing_address2").value.length>0){$("wizard_billing_address2Text").show()}else{$("wizard_billing_address2Text").hide()}}if(b.wizard_billing_aptNum!=undefined){$("wizard_billing_aptNum").value=b.wizard_billing_aptNum;$("wizard_billing_aptNumText").update("#"+b.wizard_billing_aptNum);if($("wizard_billing_aptNum").value.length>0){$("wizard_billing_aptNumText").show()
}else{$("wizard_billing_aptNumText").hide()}}if(b.wizard_billing_city!=undefined){$("wizard_billing_city").value=b.wizard_billing_city;$("wizard_billing_cityText").update(b.wizard_billing_city)}if(b.wizard_billing_state!=undefined){$("wizard_billing_state").value=b.wizard_billing_state;$("wizard_billing_stateText").update(b.wizard_billing_state)}if(b.wizard_billing_zip!=undefined){$("wizard_billing_zip").value=b.wizard_billing_zip;$("wizard_billing_zipText").update(b.wizard_billing_zip)}if(b.wizard_billing_phoneArea!=undefined){$("wizard_billing_phoneArea").value=b.wizard_billing_phoneArea;
$("wizard_billing_phoneAreaText").update("("+b.wizard_billing_phoneArea+")")}if(b.wizard_billing_phone3!=undefined){$("wizard_billing_phone3").value=b.wizard_billing_phone3;$("wizard_billing_phone3Text").update(b.wizard_billing_phone3)}if(b.wizard_billing_phone4!=undefined){$("wizard_billing_phone4").value=b.wizard_billing_phone4;$("wizard_billing_phone4Text").update(b.wizard_billing_phone4)}if(b.wizard_billingAddressStatus!=undefined){$("billingAddressStatus").value=b.wizard_billingAddressStatus
}return true},failure:function(a,b){processJSONErrors("lb_change_wizard_billing_address","ajaxError",b);DtvProcessingWatcher.removeProcessing();hitboxCustomEvent("Change Wizrad Billing Address Lightbox",null);return false}};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 openEpgZipCodeLightbox(){var a={contentDiv:"lightboxDivEpgZipCode",subContentDiv:"lb_epg_zip",callback:"dtv:lightboxEpgZipCodeOpened",hitboxPageName:"Epg+Zip+Code+Lightbox"};DtvProcessingWatcher.removeProcessing();clearErrors("lb_epg_zip","ajaxError");$("zipCode").readOnly=false;$("countyDiv").hide();displayLightbox(a,DEFAULT_MY_ACCOUNT_LIGHTBOX_OPTIONS);
$("lightboxDivEpgZipCode").observe("dtv:lightboxEpgZipCodeOpened",function(){$("zipCode").focus()})}function initializeEpgZipCodeLightbox(){var b=new SubmitWatcher("enterZipCodeSubmit","enterZipCodeForm",{successHandler:enterEpgZipCodeHandlers.success,failureHandler:enterEpgZipCodeHandlers.failure});$("enterZipCodeSubmit").disabled=false;var a=new SubmitWatcher("enterZipCodeCancelSubmit","enterZipCodeForm",{successHandler:enterEpgZipCodeCancelHandlers.success,failureHandler:enterEpgZipCodeCancelHandlers.failure});
$("enterZipCodeCancelSubmit").disabled=false}var enterEpgZipCodeHandlers={success:function(a,d){if(!d.success){enterEpgZipCodeHandlers.failure(a,d);return}var b=$("zipCode");b.readOnly=false;if(d.messages!=null){displayMessages("lb_epg_zip_message_container",d.messages,d.messageLevel)}if(d.countyCodes!=null){DtvProcessingWatcher.removeProcessing();b.readOnly=true;$("countyDiv").show();var e=$("countySelect");e.options.length=0;e.options[0]=new Option("","");for(var c=0;c<d.countyCodes.length;c++){e.options[c+1]=new Option(d.countyNames[c],d.countyCodes[c])
}}else{$("submitCookieZipSetting").click()}},failure:function(a,b){$("zipCode").readOnly=false;DtvProcessingWatcher.removeProcessing();processJSONErrors("lb_epg_zip","ajaxError",b)}};var enterEpgZipCodeCancelHandlers={success:function(a,b){if(!b.success){enterEpgZipCodeCancelHandlers.failure(a,b);return}closeLightbox()},failure:function(a,b){$("zipCode").readOnly=false;DtvProcessingWatcher.removeProcessing();processJSONErrors("lb_epg_zip","ajaxError",b)}};function processSeriesResponse(a,e){e=$(e);
if(e.select(".js_series_span").length!=1){return}var d=e.select(".js_series_span")[0];var c=e.select(".js_series_radio_false")[0];var b=e.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){DtvProcessingWatcher.removeProcessing();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");
DtvProcessingWatcher.removeProcessing()},failure:function(a,b){processJSONErrors(a,"ajaxError",b);DtvProcessingWatcher.removeProcessing();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);DtvProcessingWatcher.removeProcessing()}};var listingStmsPasswordHandlers={success:function(a,c){if(!c.success){listingStmsPasswordHandlers.failure(a,c);
return}processJSONErrors(a,"ajaxError",c);DtvProcessingWatcher.removeProcessing();var f=$("btnContinueStms");var e=f.up(".epg-detail-tup");f.disabled=true;var g=e.down(".js_order_listing_id").value;var d="order_"+g;var b="order_tab_"+g;ajaxFormSubmitAndPopulate("btnContinueStms",e,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);DtvProcessingWatcher.removeProcessing()}};
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(EVENT_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);DtvProcessingWatcher.removeProcessing()},failure:function(a,b){processJSONErrors(a,"ajaxError",b);DtvProcessingWatcher.removeProcessing();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(EVENT_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(e){if(e.tagName=="SELECT"){e.observe("change",ajaxFormSubmitAndPopulate.curry(e,b,d,_LISTING_FAILURE_MESSAGE,_initializeListingOrderTab.curry(b,a,d),_LISTING_AJAX_FORM_SUBMIT_OFFSET))
}})}function initializePlayboyOrderBlock(a){DtvProcessingWatcher.initializeProcessingWatcherForContainer(a);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 f="epg_detail_"+c;var e="order_"+c;var b="order_tab_"+c;var d=LISTING_GAME_LOUNGE_ORDER_AJAX_URL;_initializeListingTab(f,"","",e,b,d,a)}function initializeListingDetailTab(h,a){var g="epg_detail_"+h;var c="record_"+h;var f="record_tab_"+h;var e="order_"+h;var b="order_tab_"+h;var d=LISTING_PPV_ORDER_AJAX_URL;_initializeListingTab(g,c,f,e,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,g,f,c,e,a){Dtv.behaviors.applyBehavior(b,"CollapsibleTab",".js-collapsible-tabs");DtvProcessingWatcher.initializeProcessingWatcherForContainer(b);g=$(g);if(g){_initializeListingDodTab(d,g)}c=$(c);if(c){_initializeListingOrderTab(f,c,e)}a=$(a);
if(a){a.fire(EVENT_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,e,h){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 g;for(var c=0;c<d.length;c+=2){var g=$(b.split("|")[c]);if(!g){throw"Invalid rel attribute "+b+" - field "+b.split("|")[c]+" does not exist"
}var f=b.split("|")[c+1];g.value=f}ajaxFormSubmitAndPopulate(g,e,h,_LISTING_FAILURE_MESSAGE,_ajaxListingSubmitComplete.curry(e,h),0)}function _ajaxListingSubmitComplete(a,b){_addListingObservers(a,b)}function expandListing(f,a,b,g){a=$(a);if(!a){return false}var c=$("js_carousel_container");if(c&&c.behaviors){c.behaviors.ListingCarousel.unselectItem()}var e=_contractCurrentListing(a,f);if(e||_LISTING_PROGRAM_DETAIL_DISPLAYED_ROW_ID!=a.identify()){_contractListing()}$$("."+_LISTING_ROW_ACTIVE_CLASS).invoke("removeClassName",_LISTING_ROW_ACTIVE_CLASS);
if(e){_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){g.hitboxPpvCategory=_LISTING_HITBOX_PPV_CATEGORY}g=Object.extend(g,{detailsListingType:_LISTING_DETAILS_LISTING_TYPE});_LISTING_PROGRAM_DETAIL_DISPLAYED_ROW_ID=a.identify();_LISTING_PROGRAM_DETAIL_DISPLAYED_COLUMN_ID=f;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,g,b,f);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){var d={closeClassName:"js_collapse",closeEvents:[EVENT_EXPANDABLE_ROW_DEACTIVATE,"click"],closeHandler:function(){var f=$("js_carousel_container");
if(f&&f.behaviors){f.behaviors.ListingCarousel.unselectItem()}},openEvents:[EVENT_EXPANDABLE_ROW_ACTIVATE],openHandler:function(){contractListing()}};var c=new DtvExpandableRow(_LISTING_CAROUSEL_EXPANSION_ROW_ID,d);for(var b=0;b<a.length;b++){openerAjaxUrl=LISTING_PROGRAM_DETAIL_AJAX_URL;var e=_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:e})
}}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,f,b,c){var e={method:"post",parameters:f,onComplete:_expandListingComplete.curry(d,a,c)};
new Ajax.Request(b,e)}function _expandListingComplete(g,c,f,a,e){if(a.status<200||a.status>300){$(g).update(_LISTING_FAILURE_MESSAGE);return}var b=$(g).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($(f)){$(f).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,g,b,e,d){var a="/DTVAPP/epg/commonSense.jsp";a+="?type="+c.replace(/\s/g,"+");a+="&title="+g.replace(/\s/g,"+");
for(i=0;i<b.length;i++){a+="&cast[]="+b[i].replace(/\s/g,"+")}var f={requestHeaders:{Accept:"application/json"},method:"get",mimetype:"application/json",onComplete:function(n){try{var l=n.responseText.evalJSON();if(l.error){return}var h=function(){var o=l.media.url;if(document.location.href.indexOf("https")!=-1){o=o.replace(/http\:/,"https:")}$(d).src=o;$(e).fire(EVENT_COMMON_SENSE_IFRAME_LOADED)};var m=function(){$(e).stopObserving(EVENT_COLLAPSIBLE_TAB_OPENED,h)};$(e).observe(EVENT_COLLAPSIBLE_TAB_OPENED,h);
$(e).observe(EVENT_COMMON_SENSE_IFRAME_LOADED,m);Effect.Appear(e)}catch(k){console.log("Unable to parse JSON Common Sense result for URL: "+a+" | "+k);return}},onFailure:function(h){console.log("Failure retrieving JSON Common Sense result")}};new Ajax.Request(a,f)}var _PACKAGE_FAILURE_MESSAGE='<div class="listing-program-tup clear-after"><strong><br /><br />&#160;&#160;Unable to retrieve package information.<br /><br /></strong></div>';function initializeCompareChannelPage(a){logJsProgress("initializeCompareChannelPage() start");
$(a.ajaxContainer).select(".js_ajax_submit").each(function(d){if(d.match("a")){var c=d.rel;if(c==null||c.indexOf("|")==-1){throw"Ajax submit links must have a rel attribute of the form selectedFilter|allChannelsFilter|filterValue"}var b=c.split("|");d.observe("click",_selectCompareFilter.curry(b[0],b[1],b[2],d,a))}else{d.observe("click",ajaxFormSubmitAndPopulate.curry(d,a.ajaxContainer,a.ajaxGridUrl,_PACKAGE_FAILURE_MESSAGE,_initializeCompareChannelPageAjax.curry(a),0))}});initHoverMenu("print_channel_lineup_tup","print_channel_lineup_list");
initHoverMenu("compare_filters_arrow","compare_filters_list");logJsProgress("initializeCompareChannelPage() end")}function _initializeCompareChannelPageAjax(a){Dtv.behaviors.applyBehavior("compare_channels","CompareChannelsScroller",".js-compare-channels-scroller");$(document.body).fire(EVENT_ROLLOVER_RESET);initializeCompareChannelPage(a)}function _selectCompareFilter(c,b,e,d,a){c=$(c);b=$(b);if(c.identify()!=b.identify()){b.checked=false}c.checked=!(c.checked);ajaxFormSubmitAndPopulate(d,a.ajaxContainer,a.ajaxGridUrl,_PACKAGE_FAILURE_MESSAGE,_initializeCompareChannelPageAjax.curry(a),0)
}function resetComparePackageFilters(b,a){b.split("|").each(function(c){if($(c)){$(c).checked=true}});a.split("|").each(function(c){if($(c)){$(c).checked=false}})}function initializeBrowseChannelPage(a){logJsProgress("initializeBrowseChannelPage() start");$(a.ajaxContainer).select(".js_ajax_submit").each(function(b){if($(b).match('input[type="checkbox"]')){$(b).observe("click",ajaxFormSubmitAndPopulate.curry(b,a.ajaxContainer,a.ajaxGridUrl,_PACKAGE_FAILURE_MESSAGE,_initializeBrowseChannelPageAjax.curry(a),0))
}else{$(b).observe("click",_browseChannelSubmit.curry(b,a))}});initHoverMenu("print_channel_lineup_tup","print_channel_lineup_list");logJsProgress("initializeBrowseChannelPage() end")}function _initializeBrowseChannelPageAjax(a){Dtv.behaviors.applyBehavior("browse_channels","BrowseChannelsScroller",".js-browse-channels-scroller");$(document.body).fire(EVENT_ROLLOVER_RESET);initializeBrowseChannelPage(a)}function _browseChannelSubmit(c,a){var b=$(c).down("span.js_hidden").innerHTML;$("selected_package_id").value=b;
ajaxFormSubmitAndPopulate(c,a.ajaxContainer,a.ajaxGridUrl,_PACKAGE_FAILURE_MESSAGE,_initializeBrowseChannelPageAjax.curry(a),0)}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 scrollerZipCodeLightbox(b){var a=$("zipCodeSuccessUrl").value;var c={};if(a.indexOf("?")!=-1){c=a.toQueryParams();a=a.substring(0,a.indexOf("?"))+"?"}else{a+="?"
}c=Object.extend(c,{section:b});a+=$H(c).toQueryString();$("zipCodeSuccessUrl").value=a;openEpgZipCodeLightbox();return false}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 e=window.location.hash.substr(window.location.hash.indexOf("#h:")+3);var d=readCookie("iframeheight");if(b){if(e!=d){createCookie("iframeheight",e);
$("dtv_thirdparty_iframe").style.height=(parseInt(e))+"px";$("dtv_thirdparty_iframe").style.overflow="hidden"}else{iframeSafeMode()}}else{if(e!=d){$("dtv_thirdparty_iframe").style.height=(parseInt(e))+"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(){};
