
var ImageLoader={img:new Image(1,1),loadImage:function(_1){
this.img.src=_1;
},loadImageArray:function(_2){
_2.walk(this.loadImage,this);
}};


var Link={name:"Link",dRegEx:/-\d/,imgURL:function(_1,_2){
var sb=[];
sb.append(_2||IMAGE_ROOT);
if(_1.charAt(0)!="/"){
sb.append(_1);
}else{
sb.append(_1.substring(1,_1.length));
}
return sb.join("");
},boxshotURL:function(_4,_5){
if(window.BS_MOD&&window.BS_MOD>1){
return this.imgURL(_4,IMAGE_ROOT.replace(this.dRegEx,"-"+_5%window.BS_MOD));
}else{
return this.imgURL(_4);
}
},pageURL:function(_6,_7){
var sb=[];
var _8=false;
sb.append(PAGE_ROOT);
if(_6.charAt(0)!="/"){
sb.append(_6);
}else{
sb.append(_6.substring(1,_6.length));
}
var _9=this.mediaFilter||(this.mediaFilter=location.href.getUrlAttribute("mfilt"));
if(_9=="ED"){
if(!_7){
_7={};
}
_7.mfilt=_9;
}else{
if(_7&&_7.mfilt!="ED"){
delete _7.mfilt;
}
}
if(_7){
var _10=false;
for(var _11 in _7){
sb.append(_10?"&":"?");
sb.append(_11);
sb.append("=");
sb.append(_7[_11]);
_10=true;
}
}
return sb.join("");
},mediaFilter:null,LIST_PARAMETER_DELIMITER:"|",encodeListParameter:function(_12){
if(typeof _12=="string"){
_12=[_12];
}
var _13=false;
var _14=[];
for(var ii=0;ii<_12.length;ii++){
if(_13){
_14.append(this.LIST_PARAMETER_DELIMITER);
}else{
_13=true;
}
_14.append(_12[ii]);
}
return _14.join("");
},VALUE_RESTRICTION_NONE:0,VALUE_RESTRICTION_NUMERIC:1,VALUE_RESTRICTION_ALPHANUMERIC:2,VALUE_RESTRICTION_ALPHANUMERIC_WITH_UNDERSCORE:3,getValueFromUrl:function(url,_17,_18){
try{
var _19=url.split("?")[1]+"&";
var _20=_19.split(_17+"=")[1];
if(!_18){
_18=Link.VALUE_RESTRICTION_NONE;
}
var _21="";
switch(_18){
case Link.VALUE_RESTRICTION_NUMERIC:
_21="\\d*(?=[&|$|\\?|\\=])";
break;
case Link.VALUE_RESTRICTION_ALPHANUMERIC:
_21="[a-zA-Z\\d]*(?=[&|$|\\?|\\=])";
break;
case Link.VALUE_RESTRICTION_ALPHANUMERIC_WITH_UNDERSCORE:
_21="\\w*(?=[&|$|\\?|\\=])";
break;
case Link.VALUE_RESTRICTION_NONE:
default:
_21="[^&|$|\\?|\\=]*(?=[&|$|\\?|\\=])";
break;
}
var _22=new RegExp(_21);
var _23=_22.exec(_20);
if(_23==null||_23==undefined){
_23="";
}
return _23;
}
catch(e){
return "";
}
}};


var dom={isReady:false};
var EventDispatcher={elements:[],eventCounter:1,MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",CLICK:"click",KEYUP:"keyup",EVENT_TYPE_PREFIX:"on",stopPropagation:function(_1){
if(window.event){
window.event.cancelBubble=true;
}else{
if(_1.stopPropagation){
_1.stopPropagation();
}
}
},addEvent:function(_2,_3,_4){
EventDispatcher.callCounter++;
if(!_4.__eid){
_4.__eid=this.eventCounter++;
}
if(!_2.__events){
_2.__events={};
this.elements[this.elements.length]=_2;
}
var _5=_2.__events[_3];
var _6=this.EVENT_TYPE_PREFIX+_3;
if(!_5){
_5=_2.__events[_3]={};
if(_2[_6]){
_5[0]=_2[_6];
}
}
_2[_6]=EventDispatcher.handleEvent;
_5[_4.__eid]=_4;
_2.notifyEventListenerAdded&&_2.notifyEventListenerAdded(_3);
return _4.__eid;
},removeEvent:function(_7,_8,_9){
var eid=(typeof _9==="function")?_9.__eid:_9;
if(_7.__events&&_7.__events[_8]&&eid){
delete _7.__events[_8][eid];
this.clearEventHandlerSafely(_7,_8);
return true;
}else{
return false;
}
},clearEventHandlerSafely:function(_11,_12){
var _13=false;
var _14=_11.__events[_12];
for(var ii in _14){
if(_14[ii]){
return false;
}
}
_11[this.EVENT_TYPE_PREFIX+_12]=null;
return true;
},handleEvent:function(_16){
_16=_16||window.event;
var _17=true;
var _18=this.__events[_16.type];
for(var ii in _18){
_17=_18[ii].apply(this,[_16])!==false&&_17;
}
if(this===window&&_16.types==="unload"){
EventDispatcher.cleanupAll();
}
return _17;
},dispatchEvent:function(_19,_20,_21){
var _22={type:_20,target:_19};
if(typeof _21==="object"&&!(_21 instanceof Array)){
for(var key in _21){
_22[key]=_21[key];
}
}
var _24=this.EVENT_TYPE_PREFIX+_20;
_19[_24]&&_19[_24].apply(_19,[_22]);
},cleanupAll:function(){
for(var ii=0;ii<this.elements.length;ii++){
this.cleanupElement(this.elements[ii]);
delete this.elements[ii];
}
},cleanupElement:function(_25){
if(_25.__events){
var _26=this.EVENT_TYPE_PREFIX;
for(type in _25.__events){
for(eid in _25.__events[type]){
delete _25.__events[type][eid];
}
_25[_26+type]=null;
}
}
},getMouseButton:function(_27){
if(_27.which==null){
return (_27.button<2)?"LEFT":((_27.button==4)?"MIDDLE":"RIGHT");
}else{
return (_27.which<2)?"LEFT":((_27.which==2)?"MIDDLE":"RIGHT");
}
},getModifierKey:function(_28){
if(_28){
return _28.shiftKey?"SHIFT":_28.ctrlKey?"CTRL":_28.altKey?"ALT":_28.metaKey?"COMMAND":"";
}
return "";
},getTarget:function(_29){
var _30=null;
if(_29.target){
_30=_29.target;
}else{
if(_29.srcElement){
_30=_29.srcElement;
}
}
if(_30&&_30.nodeType===3){
_30=_30.parentNode;
}
return _30;
},getRelatedTarget:function(_31){
if(_31.relatedTarget){
return _31.relatedTarget;
}
return (_31.type===this.MOUSEOUT)?_31.toElement:_31.fromElement;
}};
EventDispatcher.addEvent(window,"unload",function(){
});
function domReady(){
if(arguments.callee.done){
return;
}
arguments.callee.done=dom.isReady=true;
dom.onready&&dom.onready({type:"ready"});
dom.onafterready&&dom.onafterready({type:"afterready"});
}
if(document.addEventListener){
document.addEventListener("DOMContentLoaded",domReady,null);
}
function forceDomReady(){
if(!document.addEventListener&&!UserAgent.matches.iewin){
domReady();
}
return true;
}
EventDispatcher.addEvent(window,"load",domReady);


if(!window.IMAGE_ROOT){
IMAGE_ROOT="http://cdn.nflximg.com/us/";
}
function callOnWindowLoad(_1){
EventDispatcher.addEvent(window,"load",_1);
}
function CPValue(s){
return (typeof (CP$value)!="undefined"&&CP$value[s])?CP$value[s]:0;
}
function PopUpMessage(){
window.status="";
}
var doRatingsPopup="false";
var popupMovieId=null;
var inRatingRedirectTest="true";
var b_popup=(CPValue("*popup*")!=0);
var b_member=(CPValue("*member*")!=0);
var b_show800=true;
var s_titlecount="30,000";
var s_librange="2-8";
var s_maxlib="8";
var s_maxout=(CPValue("*maxout*")==0)?"3":(""+CPValue("*maxout*"));
var s_shippingtime="1-3";
var ratedMovies="";
var ratedRatings="";
function stripUnits(_3){
return parseInt(_3);
}
function getCopyOfObject(_4){
var _5={};
for(var _6 in _4){
_5[_6]=_6.value;
}
return _5;
}
function ratingsPop(_7,_8){
if(doRatingsPopup=="true"){
showRatingsPop(_8);
}else{
window.location.href=_7;
}
}
function trackRating(_9,_10){
if(_10>=3){
ratedMovies=ratedMovies+_9+",";
ratedRatings=ratedRatings+_10+",";
}
}
function xferRating(_11){
_11.movies.value=ratedMovies;
_11.ratings.value=ratedRatings;
}
function openAWindow(){
window.open(PAGE_ROOT+"FirstRatingPopup?lnkctr=popRate&movieid="+popupMovieId,"ratepop","toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0,resizable=0,width=605,height=295");
}
function showRatingsPop(_12){
popupMovieId=_12;
if(window.location.pathname.indexOf("/RateMovies")==-1){
setTimeout("openAWindow()",500);
}
}
var queuePopUpTargetName="nfQPop";
function privPop(_13){
window.open(_13,"nf_static_popup","toolbars=0,scrollbars=1,location=0,statusbars=0,menubars=0,resizable=1,width=500,height=450,left=1,top=1");
}
function addressPop(_14){
window.open(_14,"address_popup2","toolbars=0,scrollbars=0,location=0,statusbars=0,menubars=0,resizable=1,width=350,height=410,left=1,top=1");
}
function cobrandPrivPop(_15){
window.open(_15,"poppage_cobrand_link","toolbars=0,scrollbars=1,location=0,statusbars=0,menubars=0,resizable=1,width=600,height=450,left=400,top=1");
}
function stateAddress(_16){
window.open(_16,"memberaddressedit","toolbars=0,scrollbars=1,location=0,statusbars=0,menubars=0,resizable=0,width=425,height=490");
}
function popupTermsandConditions(_17){
window.open(_17,"NF_Marquee_Terms_And_Conditions","height=470,width=400,menubar=no,location=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no");
}
function safePop(_18){
window.open(_18,"poppop","toolbars=0,scrollbars=1,location=0,statusbars=0,menubars=0,resizable=0,width=367,height=450,left=1,top=1");
}
var dontFocus="";
function focusAddressFormField(){
if(document.login_form&&(dontFocus=="")){
document.login_form.email.focus();
}else{
if(document.register_form&&(dontFocus=="")){
document.register_form.email.focus();
}else{
if(document.addressEntry&&(dontFocus=="")){
document.addressEntry.fname.focus();
}
}
}
}
function focusNClearInput(_19){
var _20=_19.getAttribute("hasBeenFocused");
var _21=(_20==""||_20==null);
if(_21){
_19.setAttribute("hasBeenFocused","true");
_19.style.color="#000000";
_19.value="";
var _22=_19.form;
for(ii=0;ii<_22.elements.length;ii++){
if(_22.elements[ii].type=="submit"){
_22.elements[ii].disabled=false;
}
}
}
}
button1=new Image();
button1.src=IMAGE_ROOT+"buttons/one_moment_please.gif";
button2=new Image();
button2.src=IMAGE_ROOT+"buttons/one_moment_please_small.gif";
var requestSubmitted=false;
function disableButton(btn,_24,_25){
if(!requestSubmitted){
if(_25!=null){
btn.src=_25.src;
}else{
btn.value="  Please Wait...  ";
}
btn.disabled=true;
requestSubmitted=true;
_24.submit();
return true;
}else{
return false;
}
}
function checkandsubmit(_26){
if(requestSubmitted){
return false;
}else{
requestSubmitted=true;
_26.submit();
return false;
}
}
function goToOnce(url){
if(requestSubmitted==true){
return false;
}else{
requestSubmitted=true;
window.location.href=url;
return false;
}
}
function popupTimer(){
setTimeout("self.close()",120000);
}
var answers=new Array();
var seeMoreLinks=new Array();
var shownAnswer=-1;
function showAnswer(_28,_29,_30,_31){
showInlineAnswer(_28,_29,_30,_31,"ShowHelpAnswer");
}
function showSelfHelpAnswer(_32,_33,_34,_35){
showInlineAnswer(_32,_33,_34,_35,"ShowSelfHelpAnswer");
}
function showInlineAnswer(_36,_37,_38,_39,url){
if(window.isPVDVD){
var _40="#c0d9f2";
var _41="#E6F0FA";
}else{
if(window.isQueue){
var _40="#F8F7DE";
var _41="#fff";
}else{
if(window.isWN){
var _40="#fff";
var _41="#fff";
}else{
if(window.isHelpCenterSearchResults){
var _40="#e8de96";
var _41="#fff";
}else{
var _40="#E3E3E3";
var _41="#F0F0F0";
}
}
}
}
if(shownAnswer!=-1){
var _42=document.getElementById("faq"+shownAnswer+"q");
var _43=document.getElementById("faq"+shownAnswer+"a");
$$(_42).setStyles({backgroundColor:_41,fontWeight:"normal"});
_43.style.backgroundColor=_41;
_43.innerHTML=seeMoreLinks[shownAnswer];
}
var _44=document.getElementById("faq"+_36+"q");
var _45=document.getElementById("faq"+_36+"a");
$$(_44).setStyles({backgroundColor:_40,fontWeight:"bold"});
_45.style.backgroundColor=_40;
_45.innerHTML=answers[_36];
if(_40!=_41){
var _46=document.getElementById("dynhelpsbbase");
if(_46){
_46.style.backgroundColor=_36+1==_37?_40:_41;
}
}
shownAnswer=_36;
if(!UserAgent.matches.khtml){
window.location.href="http://"+window.location.hostname+"/"+url+"?dpid="+_38+"&qid="+_39+"&faqPos="+(_36+1)+"&faqTotal="+_37+"&ncok=y";
}
}
function textAreaLimiter(_47,_48){
if(_47.value.length>_48){
_47.value=_47.value.substring(0,_48);
}
}


var ServerConnectionFactory={getConnection:function(){
return new ServerConnection();
},isSupported:function(){
var s=new ServerConnection();
var ok=s.hasTransport;
s=null;
return (this.isSupported=function(){
return ok;
})();
},tell:function(_3,_4){
if(typeof _4!="undefined"){
_3=_3.setUrlAttributes(_4);
}
var _5=new Image();
_5.src=_3;
}};
function ServerConnection(){
this.hasTransport=false;
this.method=ServerConnection.METHOD_GET;
if(!this.returnType){
this.returnType=ServerConnection.RETURN_XML;
}
this.setTransport();
}
ServerConnection.METHOD_GET="GET";
ServerConnection.METHOD_POST="POST";
ServerConnection.METHOD_HEAD="HEAD";
ServerConnection.RETURN_XML="XML";
ServerConnection.RETURN_TEXT="TEXT";
ServerConnection.prototype={getNewAXO:function(_6){
return eval(["(ne","w Ac","tive","XObj","ect('",_6,"'))"].join(""));
},parameters:{},transportStates:["Uninitialized","Loading","Loaded","Interactive","Complete"],setTransport:function(){
this.transport=false;
var _7=this;
var _8=[function(){
return _7.getNewAXO("Msxml2.XMLHTTP");
},function(){
return _7.getNewAXO("Microsoft.XMLHTTP");
},function(){
return new XMLHttpRequest();
}];
for(var i=0;i<_8.length;i++){
try{
this.transport=_8[i]();
this.hasTransport=true;
break;
}
catch(e){
}
}
},bindStateChangeHandler:function(){
var _10=this;
this.transport.onreadystatechange=function(){
_10.handleReadyStateChange();
};
},handleReadyStateChange:function(){
var _11=this.transportStates[this.transport.readyState];
if(_11=="Loaded"||(UserAgent.matches.opera&&_11=="Interactive")){
this.beginReceiveDataCallback();
}else{
if(_11=="Complete"){
if(this.transport.status=="200"){
this.successCallback(this.returnType==ServerConnection.RETURN_XML?this.transport.responseXML:this.transport.responseText);
}else{
this.failureCallback(this.transport.status,this.url);
}
}
}
},fixMozillaContentLength:function(){
if(this.transport&&this.transport.overrideMimeType){
this.transport.setRequestHeader("Connection","close");
}
},execute:function(){
if(this.transport){
var _12=null;
if(window.location.protocol.indexOf("https")>-1){
this.url=this.url.replace("http:","https:");
}
if(this.method==ServerConnection.METHOD_GET){
this.url=this.url.setUrlAttributes(this.parameters);
}
this.transport.open(this.method,this.url,true);
this.bindStateChangeHandler();
if(this.method==ServerConnection.METHOD_POST){
_12="".setUrlAttributes(this.parameters).substring(1);
this.transport.setRequestHeader("Content-type","application/x-www-form-urlencoded");
this.fixMozillaContentLength();
}
this.transport.send(_12);
}
},setParameters:function(_13){
this.parameters=_13;
},successCallback:function(){
},failureCallback:function(_14,url){
},beginReceiveDataCallback:function(){
}};


if(!window.encodeURIComponent){
encodeURIComponent=function(_1){
return escape(_1);
};
decodeURIComponent=function(_2){
return unescape(_2);
};
}
if(typeof Function.apply!=="function"){
Function.prototype.apply=function(_3,_4){
var r,x="____apply";
if(typeof _3!=="object"&&typeof _3!=="function"){
_3={};
}
_3[x]=this;
r=_3[x](_4[0],_4[1],_4[2],_4[3],_4[4],_4[5]);
return r;
};
}
Function.prototype.bindEventListener=function(_6){
var _7=this,args=Array.prototype.slice.call(arguments,1);
return function(_8){
return _7.apply(_6,[_8||window.event].concat(args));
};
};
Function.prototype.bind=function(_9){
var _10=this,args=Array.prototype.slice.call(arguments,1);
return function(){
return _10.apply(_9,args);
};
};
Array.prototype.walk=function(_11,_12){
var _13=true,doBind=typeof _12!=="undefined";
for(var ii=0,len=this.length;ii<len;ii++){
if((doBind?_11.call(_12,this[ii]):_11(this[ii]))===false){
_13=false;
}
}
return _13;
};
Array.prototype.contains=function(_15){
for(var ii=0,len=this.length;ii<len;ii++){
if(this[ii]===_15){
return true;
}
}
return false;
};
if(!Array.prototype.push){
Array.prototype.push=function(_16){
this[this.length]=_16;
};
}
Array.prototype.append=Array.prototype.push;
if(!Array.prototype.unshift){
Array.prototype.unshift=function(_17){
this.reverse();
var len=this.push(_17);
this.reverse();
return len;
};
}
String.prototype.trim=function(){
return this.replace(/^\s+|\s+$/g,"");
};
String.prototype.containsClass=function(_19){
return this.getClassIndex(_19)!==-1;
};
String.prototype.getClassIndex=function(_20){
return (" "+this+" ").indexOf(" "+_20+" ");
};
String.prototype.getClassFromPrefix=function(_21){
var _22=" "+this+" ";
var _23=_22.indexOf(" "+_21);
if(_23!==-1){
var end=_22.indexOf(" ",_23);
return _22.substring(_23,(end!==-1)?end:_22.length);
}
return "";
};
String.prototype.addClass=function(_25){
if(_25&&!this.containsClass(_25)){
return (this.length>0)?this+" "+_25:_25;
}
return this;
};
String.prototype.swapClass=function(_26,_27){
return this.removeClass(_26).addClass(_27);
};
String.prototype.removeClass=function(_28){
if(typeof _28!=="string"){
if(typeof _28==="object"&&_28 instanceof Array){
var s=this;
for(var ii=0,l=_28.length;ii<l;ii++){
s=s.removeClass(_28[ii]);
}
}
return s;
}
var _30=this.getClassIndex(_28);
if(_30!==-1){
var _31=_28.length;
if(this.charAt(_30-1)===" "){
_30-=1;
_31+=1;
}
return this.substring(0,_30)+this.substring(_30+_31);
}
return this;
};
String.prototype.getClasses=function(){
return this.split(" ");
};
String.prototype.getUrlAttribute=function(_32){
var _33=URLLib.qsCache[this];
if(_33&&typeof _33[_32]!=="undefined"){
return _33[_32];
}
var _34=this.indexOf(URLLib.QUERY_START);
if(_34===-1){
return null;
}
var ls=this.substring(_34);
var len=ls.length;
if(len>0){
var _36=URLLib.QUERY_DELIM;
var _37=ls.indexOf(_32+URLLib.NVPAIR_DELIM);
if(_37>-1&&(_37===1||ls.charAt(_37-1)===_36)){
_37+=_32.length+1;
var _38=ls.indexOf(_36,_37);
return URLLib.addToCache(this,_32,decodeURIComponent(ls.substring(_37,(_38!==-1)?_38:len)));
}
}
return URLLib.addToCache(this,_32,null);
};
String.prototype.setUrlAttribute=function(_39,_40){
var _41=this;
if(_40===false){
_40="false";
}else{
if(_40===0){
_40="0";
}
}
var _42=_41.getUrlAttribute(_39);
if(_42){
return _41.replace(_39+URLLib.NVPAIR_DELIM+encodeURIComponent(_42),_39+URLLib.NVPAIR_DELIM+encodeURIComponent(_40||""));
}
return _41+=((_41.indexOf(URLLib.QUERY_START)==-1)?URLLib.QUERY_START:URLLib.QUERY_DELIM)+_39+URLLib.NVPAIR_DELIM+encodeURIComponent(_40||"");
};
String.prototype.setUrlAttributes=function(_43){
var _44=this;
for(var _45 in _43){
_44=_44.setUrlAttribute(_45,_43[_45]);
}
return _44;
};
String.prototype.getUrlAttributes=function(){
var _46=this.indexOf(URLLib.QUERY_START);
var _47={};
if(_46>-1){
var _48=this.substring(_46+1).split(URLLib.QUERY_DELIM);
for(var i=0,l=_48.length,pair;i<l;i++){
pair=_48[i].split(URLLib.NVPAIR_DELIM);
_47[pair[0]]=(pair.length>1)?pair[1]:"";
}
}
return _47;
};
var URLLib={QUERY_START:"?",QUERY_DELIM:"&",NVPAIR_DELIM:"=",qsCache:{},addToCache:function(url,_51,_52){
if(!this.qsCache[url]){
this.qsCache[url]={};
}
return this.qsCache[url][_51]=_52;
}};
if(window.HTMLElement&&!HTMLElement.prototype.contains){
HTMLElement.prototype.contains=function(el){
while(el&&el!==this){
el=el.parentNode;
}
return el!==null;
};
}
var $=function(id){
return document.getElementById(id);
};
var ObjectExtender={extend:function(_55,_56){
for(var _57 in _56){
_55[_57]=_56[_57];
}
return _55;
},createMap:function(){
var _58={},argsLength=arguments.length;
for(var i=0;i<argsLength;i++){
_58[arguments[i]]=(argsLength>i+1)?arguments[i+1]:null;
}
return _58;
},createKeyMap:function(){
var _59={};
for(var i=0,l=arguments.length;i<l;i++){
_59[arguments[i]]=1;
}
return _59;
},reverseMap:function(_60){
var _61={};
for(var k in _60){
_61[_60[k]]=k;
}
return _61;
},createEnum:function(){
var _63={};
for(var i=0,l=arguments.length,k;i<l;i++){
k=arguments[i];
if(k instanceof Array){
this.extend(_63,this.createEnum.apply(this,k));
}else{
if(!(k instanceof Object)){
_63[k]=k;
}
}
}
return _63;
}};


var UserAgent={matches:{},supports:{},uaDefs:{mac:/(\bmac.os\b|\bmac_)/i,windows:/\b(win95|win98|win 9x|winnt|windows)\b/i,x11:/\bx11\b/i,nix:/\b(unix|linux|x11|bsd)\b/i,vista:/NT\s*6.0/,xp:/NT\s*5\.1/,xpsp2:/NT\s*5\.1\s?;\s*SV1/,iewin:/msie(.*)?windows/i,iewinlt7:/msie [1-6](.*)?windows/i,iewin7:/msie 7(.*)?windows/i,iewin6:/msie 6(.*)?windows/i,iewin55:/msie 5\.5(.*)?windows/i,iewin5:/msie 5\.0(.*)?windows/i,iewinold:/msie [1-4](.*)?windows/i,iemac:/msie 5(.*)?mac/i,ns4:/netscape 4/i,safari:/(safari|applewebkit)/i,khtml:/(konqueror|khtml|safari)/i,opera:/opera/i,opera9:/opera\/9/i,firefox:/firefox/i,firefox1dot0:/firefox\/1\.0/i,firefox1dot5:/firefox\/1\.5/i,firefox2dot0:/firefox\/2/i},featureDefs:{pngAlpha:function(){
var m=UserAgent.matches;
return m.khtml||m.opera||m.gecko||m.iewin&&!(m.iewin5||m.iewinold);
},pngAlphaIEWin:function(){
var m=UserAgent.matches;
return m.iewin&&!(m.iewin5||m.iewinold);
},elementAlpha:function(){
var m=UserAgent.matches;
return m.khtml||m.opera9||m.gecko||(m.iewin&&!m.iewinold);
},elementAlphaIEWin:function(){
return UserAgent.supports.elementAlpha&&UserAgent.matches.iewin;
},fixedPosition:function(){
var m=UserAgent.matches;
return !m.iewin&&(m.gecko||m.khtml||m.opera);
},activeX:function(){
if(!window.ActiveXObject){
return false;
}
try{
new ActiveXObject("Msxml2.XMLHTTP");
return true;
}
catch(ex){
return false;
}
}},init:function(){
var m=this.matches;
var _2=function(_3,_4){
m[_3]=_4;
};
for(var _5 in this.uaDefs){
_2(_5,this.uaDefs[_5].test(navigator.userAgent));
}
_2("gecko",!m.khtml&&!m.opera&&/(firefox|camino|gecko)/i.test(navigator.userAgent));
for(var _6 in this.featureDefs){
this.supports[_6]=this.featureDefs[_6]();
}
Browser={MSIE:function(){
return UserAgent.matches.iewin;
}};
isMacIE=this.matches.iemac;
isSafari=this.matches.safari;
isOpera=this.matches.opera;
if(document.body){
UserAgent.onBodyReady();
}else{
EventDispatcher.addEvent(dom,"ready",UserAgent.onBodyReady);
}
},addSupportedFeature:function(_7,_8){
this.supports[_7]=_8;
},onBodyReady:function(){
var m=UserAgent.matches;
for(var _9 in m){
if(m[_9]){
$$(document.body).addClass("ua-"+_9);
}
}
}};
var appVers=navigator.appVersion;
UserAgent.init();


var $$=function(_1){
return new ElementWrapper(_1);
};
var ElementWrapper=function(_2){
if(_2&&_2.nodeType===1){
this.id=_2.id||(_2.id=ElementWrappers.getNewId());
}else{
this.id=_2;
}
};
ElementWrapper.prototype={NODETYPE_TEXT:3,_getElement:function(_3){
return (_3)?_3:$(this.id);
},getElement:function(id){
return $(id||this.id);
},getId:function(){
return this.id;
},getDimensions:function(_5){
_5=this._getElement(_5);
return {width:this.getWidth(_5),height:this.getHeight(_5)};
},getWidth:function(_6){
_6=this._getElement(_6);
return _6.offsetWidth||0;
},getHeight:function(_7){
_7=this._getElement(_7);
return _7.offsetHeight||0;
},getStyleOffset:function(_8,_9){
_9=this._getElement(_9);
var _10=0;
if(!(_8 instanceof Array)){
_8=[_8];
}
for(var i=0,l=_8.length,side;i<l;i++){
side=_8[i];
_10+=(parseInt(this.getComputedStyle("padding-"+side,_9))||0+parseInt(this.getComputedStyle("border-"+side,_9))||0);
}
return _10;
},getWidthStyleOffset:function(_12){
return this.getStyleOffset(["left","right"],_12);
},getHeightStyleOffset:function(_13){
return this.getStyleOffset(["top","bottom"],_13);
},getCoordinates:function(_14){
_14=this._getElement(_14);
var x=0,y=0;
var _16=document.documentElement;
if(_14.offsetParent&&_14.offsetParent!==_16){
do{
x+=_14.offsetLeft;
y+=_14.offsetTop;
}while((_14=_14.offsetParent)&&_14!==_16);
}else{
if(_14.x){
x=_14.x||0;
y=_14.y||0;
}
}
return {x:x,y:y};
},getRelativeCoordinates:function(_17,_18){
_18=this._getElement(_18);
var x=0,y=0;
if(_18!==_17){
var _19=document.documentElement;
if(_18.offsetParent&&_18.offsetParent!==_19){
do{
x+=_18.offsetLeft;
y+=_18.offsetTop;
}while((_18=_18.offsetParent)&&_18!==_17&&_18!==_19);
}else{
if(_18.x){
x=(_18.x||0)-(_17.x||0);
y=(_18.y||0)-(_17.y||0);
}
}
}
return {x:x,y:y};
},getPosition:function(_20){
_20=this._getElement(_20);
var _21=this.getCoordinates(_20);
var _22=this.getDimensions(_20);
return {left:_21.x,right:_21.x+_22.width,top:_21.y,bottom:_21.y+_22.height};
},getLeft:function(_23){
return this.getCoordinates(_23).x;
},getRight:function(_24){
_24=this._getElement(_24);
return this.getLeft(_24)+this.getWidth(_24);
},getTop:function(_25){
return this.getCoordinates(_25).y;
},getBottom:function(_26){
_26=this._getElement(_26);
return this.getTop(_26)+this.getHeight(_26);
},getComputedStyle:function(_27,_28){
_28=this._getElement(_28);
if(_28.currentStyle){
return _28.currentStyle[this._transformStylePropName(_27)];
}else{
if(document.defaultView&&document.defaultView.getComputedStyle){
return document.defaultView.getComputedStyle(_28,null).getPropertyValue(_27);
}
}
return null;
},setStyle:function(_29,_30,_31){
this._getElement(_31).style[this._transformStylePropName(_29)]=_30;
},setStyles:function(_32,_33){
var _34=this._getElement(_33).style;
var _35=this._transformStylePropName;
for(property in _32){
var _36=_32[property];
if(_36!==null){
_34[_35(property)]=_36;
}
}
},setOpacity:function(_37,_38){
_38=this._getElement(_38);
var s=UserAgent.supports;
if(s.elementAlphaIEWin){
this.setStyle("filter",(_37==100)?"none":"alpha(opacity="+_37+")",_38);
}else{
if(s.elementAlpha){
this.setStyle("opacity",_37/100,_38);
}
}
},containsClass:function(_40,_41){
return this._getElement(_41).className.containsClass(_40);
},addClass:function(_42,_43){
_43=this._getElement(_43);
return _43.className=_43.className.addClass(_42);
},removeClass:function(_44,_45){
_45=this._getElement(_45);
return _45.className=_45.className.removeClass(_44);
},swapClass:function(_46,_47,_48){
_48=this._getElement(_48);
return _48.className=_48.className.swapClass(_46,_47);
},getClassFromPrefix:function(_49,_50){
return this._getElement(_50).className.getClassFromPrefix(_49);
},getClassMap:function(_51){
return ObjectExtender.createKeyMap.apply(ObjectExtender,this._getElement(_51).className.getClasses());
},getText:function(_52){
_52=this._getElement(_52);
var fc=_52.firstChild;
return _52.textContent||_52.innerText||(fc&&fc.nodeType===this.NODETYPE_TEXT?fc.nodeValue:null);
},clearChildren:function(_54){
_54=this._getElement(_54);
while(_54.firstChild){
this.remove(_54.firstChild);
}
return _54;
},remove:function(_55){
_55=this._getElement(_55);
if(UserAgent.matches.iewin){
var _56=_55.getElementsByTagName("*");
for(var i=0,l=_56.length;i<l;i++){
EventDispatcher.cleanupElement(_56[i]);
}
EventDispatcher.cleanupElement(_55);
}
_55.parentNode.removeChild(_55);
return _55;
},getAncestorWithClass:function(_57,_58){
_58=this._getElement(_58);
while(_58&&_58.parentNode&&_58.parentNode.nodeType===1){
_58=_58.parentNode;
if(_58&&this.containsClass(_57,_58)){
return el;
}
}
return null;
},isMouseOver:function(_59,_60,_61){
if(!_60){
var _60=0;
}
var x=Position.mouseX(_59);
var y=Position.mouseY(_59);
var _63=this.getPosition(_61);
return (x<_63.right+_60&&x>_63.left-_60&&y<_63.bottom+_60&&y>_63.top-_60);
},_transformStylePropName:function(_64){
var _65=_64.indexOf("-");
return (_65!=-1)?_64.substr(0,_65)+_64.substr(_65+1,1).toUpperCase()+_64.substr(_65+2):_64;
}};
var ElementInterface=new ElementWrapper();
var ElementWrappers={idPrefix:"autoId",idCounter:0,getNewId:function(){
return this.idPrefix+this.getUniqueIdSuffix();
},getUniqueIdSuffix:function(){
return this.idCounter++;
}};


function Movie(_1){
if(_1){
this.importFrom(_1);
}
}
Movie.getURL=function(id,_3){
if(!_3){
return Link.pageURL("MovieDisplay",{movieid:id});
}else{
return Link.pageURL("Movie"+"/"+window.encodeURIComponent(_3).replace(Movie.qExp,"").replace(Movie.sExp,"_")+"/"+id);
}
};
Movie.getIdFromURL=function(_4){
var _5=_4.match(Movie.idExp);
return _5?_5[3]:false;
};
Movie.idExp=/(Movie|DVDPurchaseItem)?.*(\/|movieid=)(\d+)/;
Movie.qExp=/%3F/g;
Movie.sExp=/(%20|%2F|%3A|\')+/g;
Movie.DeliveryType=ObjectExtender.createEnum("DUAL","DISC","ELECTRONIC");
Movie.MediaType=ObjectExtender.createEnum("DD","HD","BR","ED");
Movie.MediaTypeDisc=ObjectExtender.createEnum(Movie.MediaType.DD,Movie.MediaType.HD,Movie.MediaType.BR);
Movie.MediaTypeElectronic=ObjectExtender.createEnum(Movie.MediaType.ED);
Movie.DOM_ID_PREFIX_BUTTON="m";
if(!window.Movie.domMovieIds){
Movie.domMovieIds={};
}
Movie.getDomSafeMovieId=function(_6,_7){
if(_6 instanceof Movie){
_6=_6.getId();
}
if(!(_7 in this.domMovieIds)){
this.domMovieIds[_7]={};
}
var _8=this.domMovieIds[_7];
var _9=0;
if(_6 in _8){
_9=_8[_6]+1;
}else{
while($(_7+_6+"_"+_9)){
_9++;
}
}
_8[_6]=_9;
return _7+_6+"_"+_9;
};
Movie.updateDomIdsInButtonHtml=function(_10,_11){
return this.updateDomIdsInButtonHtmlWithFirstId(_10,_11)[0];
};
Movie.updateDomIdsInButtonHtmlWithFirstId=function(_12,_13){
var _14=document.createElement("div");
_14.innerHTML=_12;
var _15=this.DOM_ID_PREFIX_BUTTON;
var _16=_14.getElementsByTagName("*");
var _17;
for(var i=0,l=_16.length,childNode;i<l;i++){
childNode=_16[i];
if(childNode.nodeType===1&&(childNode.id||"").indexOf(_15+_13)!==-1){
childNode.id=Movie.getDomSafeMovieId(_13,_15);
if(!_17){
_17=childNode.id;
}
}
}
return [_14.innerHTML,_17];
};
Movie.prototype={styleClassRegExp:new RegExp("btn|btnWrap|mltBtn|addWrap"),id:false,parentID:false,parentid:false,title:false,synopsis:false,rating:false,mediaType:false,year:false,genreID:false,genre:false,CMFRate:false,CMURate:false,CMPred:false,CMWgtR:false,rateVal:false,starType:false,starring:[],director:false,friendRate:false,recommended:false,personalMovieData:false,starClarityData:{},hasBonusDisc:false,has2Discs:false,trkid:false,availability:false,rentStates:{},buttonHtml:null,hasPcStreams:false,trailerId:false,sid:false,streams:false,movieLength:false,startPos:false,price:0,salesItemId:0,isWatchNow:function(){
return this.hasPcStreams;
},getId:function(){
return this.id;
},getTitle:function(){
return this.title;
},getTrkid:function(){
return this.trkid||null;
},getTrailerId:function(){
return this.trailerId;
},getSid:function(){
return this.sid;
},getSeriesParentId:function(){
return this.parentid;
},getMediaType:function(){
return this.mediaType;
},getMpaaRating:function(){
return this.rating;
},getURL:function(){
return Movie.getURL(this.id,this.title);
},getStarType:function(){
if(typeof (this.starType)!="number"&&!this.starType){
var _19=RatingWidget.starTypes;
if(this.CMFRate){
return this.starType=_19.COMMUNITY||0;
}
if(this.CMURate){
return this.starType=_19.RATED||0;
}
return this.starType=_19.PREDICTED||0;
}
return this.starType;
},setStarType:function(_20){
this.starType=_20;
},getStartPos:function(){
return this.startPos||0;
},getBitrateToStreamsMap:function(){
return this.streams;
},getStreams:function(){
return this.streams?this.streams.getStreamsArray():null;
},getFriendRating:function(){
return this.CMFRate||this.rateVal/10||0;
},getWidgetRating:function(_21){
if(!_21){
_21=this.getStarType();
}
var _22=RatingWidget.starTypes;
var rv=(this.rateVal||0)/10;
switch(_21){
case _22.COMMUNITY:
return this.getFriendRating();
case _22.RATED:
return this.CMURate||rv;
case _22.PREDICTED:
return this.CMPred||rv;
default:
return this.CMWgtR=this.CMWgtR||this.CMFRate||this.CMURate||this.CMPred||rv;
}
},setRating:function(_24){
var _25=this;
var set=function(key){
_25[key]=_25.rateVal=_24;
};
var _28=RatingWidget.starTypes;
switch(this.getStarType()){
case _28.COMMUNITY:
set("CMFRate");
break;
case _28.RATED:
set("CMURate");
break;
case _28.PREDICTED:
default:
set("CMPred");
break;
}
},getButtonHtml:function(){
if(!this._firstDomId){
var _29=Movie.updateDomIdsInButtonHtmlWithFirstId(this.buttonHtml,this.getId());
this._firstDomId=_29[1];
return this.buttonHtml=_29[0];
}
return this.buttonHtml;
},updateButtonHtmlFromDom:function(){
var _30=(this._firstDomId)?$(this._firstDomId):$(Movie.DOM_ID_PREFIX_BUTTON+this.getId()+"_0");
if(_30){
var _31=parentBtn=_30.parentNode.parentNode;
var _32=parentBtn.className;
var _33=this.styleClassRegExp;
while(parentBtn&&_33.test(parentBtn.className||"")){
_31=parentBtn;
parentBtn=parentBtn.parentNode;
}
if(_31){
var el=document.createElement("div");
el.appendChild(_31.cloneNode(true));
this.buttonHtml=el.innerHTML;
}
}
},isRecommended:function(){
return this.recommended;
},isFriendRated:function(){
return this.friendRated;
},_cleanDeliveryType:function(_35){
if(_35 in Movie.DeliveryType){
return _35;
}
if(_35 in Movie.MediaType){
return (_35 in Movie.MediaTypeDisc)?Movie.DeliveryType.DISC:Movie.DeliveryType.ELECTRONIC;
}
return Movie.DeliveryType.DUAL;
},getRentState:function(_36,_37){
if(!_37){
_37=this.id;
}
_36=this._cleanDeliveryType(_36);
var _38=this.rentStates;
if(_38){
if(_37==this.id){
_38=_38.movie;
}else{
if(_37==this.parentid){
_38=_38.parent;
}else{
if(_38.children&&_37 in _38.children){
_38=_38.children[_37];
}
}
}
}
return (_38&&_38[_36])?_38[_36]:null;
},setRentState:function(_39,_40){
_40=this._cleanDeliveryType(_40);
if(!this.rentStates){
this.rentStates={};
}
if(!this.rentStates.movie){
this.rentStates.movie={};
}
this.rentStates.movie[_40]!==_39;
},getParentRentState:function(_41){
return this.getRentState(_41,this.parentid);
},getChildRentState:function(_42,_43){
return this.getRentState(_43,_42);
},importFrom:function(_44){
var _45=/&#38;/g;
for(var _46 in this){
if(_44[_46]){
this[_46]=_44[_46]();
}
if(typeof this[_46]=="string"){
this[_46]=this[_46].replace(_45,"&");
}
if(this[_46]=="false"){
this[_46]=false;
}
}
return this;
}};
function Person(_47,id){
this.name=_47;
this.id=id;
}
function PersonalMovieData(){
}
PersonalMovieData.prototype={friendReviews:[],ratedPredictors:[],hasFriendReviews:function(_48){
return this.friendReviewCount(_48)>0;
},friendReviewCount:function(_49){
return this.friendReviews.length;
},hasRatedPredictors:function(){
return this.ratedPredictors.length>0;
},ratedPredictorCount:function(){
return this.ratedPredictors.length;
},importFrom:function(_50){
for(var _51 in this){
_50[_51]&&(this[_51]=_50[_51]());
}
}};
function PersonalMovieDataJSONImporter(_52){
this.json=_52;
}
PersonalMovieDataJSONImporter.prototype={friendReviews:function(){
return this.json.friendsCount?new Array(this.json.friendsCount):[];
},ratedPredictors:function(){
return this.json.ratedPredictCount?new Array(this.json.ratedPredictCount):[];
}};
function SummaryPMDManager(){
}
SummaryPMDManager.prototype={dataDisplayed:false,movieData:null,recNode:null,friendNode:null,recText:null,friendText:null,setPersonalMovieData:function(pmd){
this.movieData=pmd;
this.dataDisplayed=false;
},hasNext:function(){
return (!this.dataDisplayed)?this.movieData.hasFriendReviews(true)||this.movieData.hasRatedPredictors():false;
},createContentElements:function(_54){
$$(_54).clearChildren();
this.recNode=document.createElement("div");
var _55=this.recNode.appendChild(document.createElement("img"));
_55.src=window.recImgOverride?window.recImgOverride:IMAGE_ROOT+"layout/recs/icon_rec.gif";
_55.style.marginRight="3px";
_55.className="qg";
this.recNode.appendChild(_55);
this.recText=document.createTextNode("");
this.recNode.appendChild(this.recText);
_54.appendChild(this.recNode);
this.friendNode=document.createElement("div");
var _56=this.friendNode.appendChild(document.createElement("img"));
_56.src=IMAGE_ROOT+"pages/community/friends-glyph-tiny.gif";
_56.style.marginLeft="9px";
_56.style.marginRight="6px";
_56.style.marginTop="2px";
this.friendNode.appendChild(_56);
this.friendText=document.createTextNode("");
this.friendNode.appendChild(this.friendText);
_54.appendChild(this.friendNode);
},displayNext:function(_57){
if(!this.recNode){
this.createContentElements(_57);
}
if(this.movieData.hasRatedPredictors()){
this.recNode.style.display="block";
var n=this.movieData.ratedPredictorCount();
this.recText.nodeValue="Recommended based on "+n+(n==1?" rating":" ratings");
}else{
this.recNode.style.display="none";
}
if(this.movieData.hasFriendReviews(true)){
this.friendNode.style.display="block";
var n=this.movieData.friendReviewCount(true);
this.friendText.nodeValue="Seen by "+n+" Netflix "+(n==1?"Friend":"Friends");
}else{
this.friendNode.style.display="none";
}
this.dataDisplayed=true;
}};
function RatedPredictor(_59,_60){
this.title=_59;
this.stars=_60;
}
function MovieJSONImporter(_61){
this.movie=(_61.movie)?_61.movie:_61;
this.init();
}
MovieJSONImporter.prototype={init:function(){
var _62=["id","title","hasBonusDisc","has2Discs","parentID","parentid","synopsis","year","genre","mediaType","trkid","starType","CMURate","CMFRate","CMPred","CMWgtR","rateVal","sid","trailerId","price","salesItemId","startPos","availability","hasPcStreams","rentStates","buttonHtml"];
for(var i=0,l=_62.length;i<l;i++){
var _63=_62[i];
MovieJSONImporter.prototype[_63]=this.makeImporter(_63);
}
MovieJSONImporter.prototype.init=function(){
};
},makeImporter:function(_64){
return function(){
return this.movie[_64];
};
},streams:function(){
var s=this.movie.streams;
if(window.BitrateToStreamsMap&&s&&s.length>0){
var _66=new BitrateToStreamsMap();
s.walk(function(_67){
_66.addNewStream(_67.bitrate,_67.requiredBandwidth,_67.url,_67.dlid);
});
return _66;
}
return null;
},rating:function(){
return this.movie.mpaa;
},starring:function(){
var _68=[];
if(this.movie.starring){
for(var ii=0;ii<this.movie.starring.length;ii++){
var p=this.movie.starring[ii];
_68.push(new Person(p.name,p.id));
}
}
return _68;
},director:function(){
if(this.movie.directors){
var p=this.movie.directors[0];
return new Person(p.name,p.id);
}
return false;
},friendRate:function(){
return this.movie.friendsCount||this.movie.friendRate;
},recommended:function(){
return this.movie.ratedPredictCount||this.movie.recommended;
},personalMovieData:function(){
var pmd=new PersonalMovieData;
pmd.importFrom(new PersonalMovieDataJSONImporter(this.movie));
return pmd;
},starClarityData:function(){
return this.movie.starClarityData;
},movieLength:function(){
return this.movie.len;
}};


var Position={viewportW:function(){
return this.getVPVal("clientWidth")||this.getVPVal("offsetWidth");
},viewportH:function(){
return self.innerHeight||this.getVPVal("clientHeight")||this.getVPVal("offsetHeight");
},scrollLeft:function(){
return self.pageXOffset||this.getVPVal("scrollLeft");
},scrollTop:function(){
return self.pageYOffset||this.getVPVal("scrollTop");
},pageH:function(){
return document.body.scrollHeight;
},pageW:function(){
return document.body.scrollWidth;
},mouseX:function(e){
e=e||window.event;
return e.pageX||e.clientX+Position.scrollLeft();
},mouseY:function(e){
e=e||window.event;
return e.pageY||e.clientY+Position.scrollTop();
},getVPVal:function(_2){
var de=document.documentElement;
var db=document.body;
if(de&&de[_2]){
return de[_2];
}else{
if(db&&db[_2]){
return db[_2];
}
}
return 0;
}};
var getElementLeft=function(id){
return $$(id).getLeft();
};
var getElementRight=function(id){
return $$(id).getRight();
};
var getElementBottom=function(id){
return $$(id).getBottom();
};
var getElementTop=function(id){
return $$(id).getTop();
};
var getElementWidth=function(id){
return $$(id).getWidth();
};
var getElementHeight=function(id){
return $$(id).getHeight();
};
var getNode=function(_6){
return $(_6);
};
var killNode=function(id){
$$(id).remove();
};
var swapTextNode=function(_7,_8){
_7.replaceChild(document.createTextNode(_8),_7.firstChild);
};
var grabComputedStyle=function(el,_10){
return $$(el).getComputedStyle(_10);
};
var grabComputedHeight=function(el){
return $$(el).getHeight();
};
var grabComputedWidth=function(el){
return $$(el).getWidth();
};
var getEventTarget=function(evt){
return evt.srcElement||evt.target;
};
var getWindowHeight=function(){
return Position.viewportH();
};
var getWindowDimensions=function(){
return {width:Position.viewportW(),height:Position.viewportH()};
};
var getDocumentScrollAmount=function(){
return Position.scrollTop();
};
var getElementOffsetY=function(_12){
return $$(_12).getTop();
};
var clearRanges=function(_13){
if(UserAgent.matches.iemac){
}else{
if(UserAgent.matches.khtml){
_13.stopPropagation();
}else{
if(document.selection){
document.selection.empty();
}else{
if(window.getSelection()){
window.getSelection().removeAllRanges();
}else{
_13.stopPropagation();
}
}
}
}
};
var getElementMouseCoordinate=function(_14,_15){
var _16=-1;
if(!_14){
var _14=window.event;
}
if(_14.offsetX){
_16=_14.offsetX;
}else{
if(_14.layerX){
return Position.mouseX(_14)-$$(_15).getLeft();
}
}
return _16;
};
var getElementOffsetX=function(_17){
return handleElementOffsetX(_17,true);
};
var getPageElementOffsetX=function(_18){
return handleElementOffsetX(_18,false);
};
var handleElementOffsetX=function(_19,_20){
var _21=0;
if(_19.offsetLeft!=null){
_21+=_19.offsetLeft;
var _22=0;
while(_19.offsetParent){
if(_20&&(grabComputedStyle(_19.offsetParent,"position")!="static"||grabComputedStyle(_19.offsetParent,"position")=="absolute")){
return _21;
}else{
_21+=_19.offsetParent.offsetLeft;
_19=_19.offsetParent;
}
}
}
return _21;
};
var getMouseCoordinates=function(e){
return {x:Position.mouseX(e),y:Position.mouseY(e)};
};


var BoxShots={sizes:{TINY:"tiny",SMALL:"small",BIG3:"big3",LARGE:"large"},getUrl:function(_1,_2){
return Link.boxshotURL(["boxshots/",_2,"/",_1,".jpg"].join(""),_1);
}};


var JSONMovieFetcher={cache:{},getMovie:function(id,_2,_3){
if(this.cache[id]){
_2(this.cache[id]);
}else{
var sc=ServerConnectionFactory.getConnection();
sc.url=Link.pageURL("JSON/BobData");
_3.movieid=id;
sc.setParameters(_3);
sc.returnType=ServerConnection.RETURN_TEXT;
var _5=this;
sc.successCallback=function(_6){
_5.handleJSONReturn(_6,_2);
};
sc.execute();
}
},handleJSONReturn:function(_7,_8){
var _9=false;
try{
var _10=eval("("+_7+")");
if(!_10.error){
var _11=new MovieJSONImporter(_10);
var _12=new Movie();
_12.importFrom(_11);
this.cache[_12.id]=_12;
_9=true;
}
}
catch(e){
}
if(_9){
_8(_12);
}
}};
function BobTextHandler(id){
this.element=this.addTextNodeTo(id);
}
BobTextHandler.prototype={addTextNodeTo:function(id){
var _13=document.createTextNode("");
$(id).appendChild(_13);
return _13;
},handle:function(s){
this.setText(s);
},setText:function(s){
this.element.nodeValue=s;
}};
function BobCapHandler(id){
this.element=$(id).firstChild;
}
BobCapHandler.prototype=BobTextHandler.prototype;
function BobSynopsisHandler(id){
this.element=$(id);
}
BobSynopsisHandler.prototype.handle=function(s){
var _15=s.split("%%~p;");
var s=[];
_15.walk(function(_16){
var _17=s.length==0?"span":"p";
s=s.concat(["<",_17,">",_16,"</",_17,">"]);
});
this.element.innerHTML=s.join("");
};
function BobVisibilityHandler(id){
this.element=$(id);
}
BobVisibilityHandler.prototype={handle:function(s){
this.setVisible(s);
},setVisible:function(_18){
this.element.style.visibility=(_18)?"visible":"hidden";
}};
function BobPMDHandler(id){
this.element=$(id);
this.initialize();
}
BobPMDHandler.prototype={pmdDisplayer:new SummaryPMDManager(),hasContent:false,initialize:function(){
this.visibilityHandler.parent=this;
},handle:function(pmd){
this.pmdDisplayer.setPersonalMovieData(pmd);
if(this.pmdDisplayer.hasNext()){
this.pmdDisplayer.displayNext(this.element);
this.hasContent=true;
}else{
this.hasContent=false;
}
},visibilityHandler:{handle:function(){
this.setVisible(this.parent.hasContent);
},setVisible:function(_20){
this.parent.element.style.display=(_20)?"block":"none";
}}};
function StarClarityManager(){
}
StarClarityManager.prototype={dataDisplayed:false,movieData:null,avgNode:null,ratingNode:null,avgText:null,ratingText:null,hideStarDelta:false,setPersonalMovieData:function(_21){
this.movieData=_21;
this.dataDisplayed=false;
this.hideStarDelta=window.hideStarDelta;
},hasNext:function(){
if(!this.dataDisplayed){
return this.movieData;
}else{
return false;
}
},createContentElements:function(_22){
$$(_22).clearChildren();
this.ratingNode=document.createElement("div");
_22.appendChild(this.ratingNode);
this.avgNode=document.createElement("div");
_22.appendChild(this.avgNode);
},displayNext:function(_23){
if(!this.avgNode){
this.createContentElements(_23);
}
if(this.movieData.average&&!isNaN(this.movieData.average)){
this.avgNode.innerHTML=["<table><tr><td class=\"starbar\"><img src=\"",Link.imgURL("pages/widget/stars_6_"+parseFloat(this.movieData.average)*10+".gif\">"),"</td><td class=\"average\">",this.movieData.average,"</td><td class=\"starText\">Customer Average</td></tr></table>"].join("");
this.avgNode.style.display="block";
}else{
this.avgNode.innerHTML="";
this.avgNode.style.display="none";
}
var _24;
if(this.movieData.rating&&!isNaN(this.movieData.rating)){
if(this.movieData.custName){
_24=this.movieData.custName+"'s rating";
}else{
_24="Your rating";
}
this.ratingNode.innerHTML=["<table><tr><td class=\"starbar\"><img src=\"",Link.imgURL("pages/widget/stars_8_"+parseFloat(this.movieData.rating)*10+".gif\">"),"</td><td class=\"prediction\">",this.movieData.rating,"</td><td class=\"starText\">",_24,"</td></tr></table>"].join("");
this.ratingNode.style.display="block";
}else{
if(this.movieData.prediction&&!isNaN(this.movieData.prediction)){
if(this.movieData.custName){
_24="Our best guess for "+this.movieData.custName;
}else{
_24="Our best guess for you";
}
this.ratingNode.innerHTML=["<table><tr><td class=\"starbar\"><img src=\"",Link.imgURL("pages/widget/stars_7_"+parseFloat(this.movieData.prediction)*10+".gif\">"),"</td><td class=\"prediction\">",this.movieData.prediction,"</td><td class=\"starText\">",_24,"</td></tr></table>"].join("");
this.ratingNode.style.display="block";
}else{
this.ratingNode.innerHTML="";
this.ratingNode.style.display="none";
}
}
this.dataDisplayed=true;
}};
function BobStarHandler(id){
this.element=$(id);
this.initialize();
}
BobStarHandler.prototype={ratingDisplayer:new StarClarityManager(),hasContent:false,initialize:function(){
this.visibilityHandler.parent=this;
},handle:function(pmd){
this.ratingDisplayer.setPersonalMovieData(pmd);
if(this.ratingDisplayer.hasNext()&&!this.ratingDisplayer.hideStarDelta){
this.ratingDisplayer.displayNext(this.element);
this.hasContent=true;
}else{
this.hasContent=false;
}
},visibilityHandler:{handle:function(){
this.setVisible(this.parent.hasContent);
},setVisible:function(_25){
this.parent.element.style.display=(_25)?"block":"none";
}}};
var BobContentHandler={initialized:false,shownFlag:false,initialize:function(){
this.PARENTAL_RATING_ROOT=Link.imgURL("pages/parental_ratings/rating_"),this.canvas=$("bob");
this.boxImg=$("bobimg");
this.detailElements.initialize($("bobstarring").parentNode);
this.textHandlers={title:new BobCapHandler("bobtitle"),synopsis:new BobSynopsisHandler("bobsynopsis"),year:new BobCapHandler("bobyear"),starring:new BobTextHandler("bobactors"),director:new BobTextHandler("bobdirector"),genre:new BobTextHandler("bobgenre"),rating:new BobTextHandler("bobrating"),movieLength:new BobTextHandler("boblength"),starClarityData:new BobStarHandler("bobstarclarity"),personalMovieData:new BobPMDHandler("bobpersonal")};
this.visibilityHandlers={starring:new BobVisibilityHandler("bobstarring"),director:new BobVisibilityHandler("bobdirecting"),genre:new BobVisibilityHandler("bobgenretbl"),rating:new BobVisibilityHandler("bobratingtbl"),movieLength:new BobVisibilityHandler("boblengthtbl"),starClarityData:this.textHandlers.starClarityData.visibilityHandler,personalMovieData:this.textHandlers.personalMovieData.visibilityHandler};
this.textHandlers.rating.ratingTypeHandler=new BobTextHandler("bobratingtype");
$("bobratingtype").style.fontWeight="bold";
this.textHandlers.rating.handle=function(s,_26){
if(s.indexOf("TV")!=-1||_26.genre.indexOf("Television")!=-1){
this.ratingTypeHandler.setText("Rating:");
}else{
this.ratingTypeHandler.setText("MPAA:");
}
this.setText(s);
};
this.textHandlers.starring.handle=function(a){
if(a.length>0){
var _28="";
for(var i=0;i<a.length-1;i++){
_28+=a[i].name+", ";
}
_28+=a[i].name;
this.setText(_28);
}
};
this.textHandlers.director.handle=function(p){
p&&this.setText(p.name);
};
this.textHandlers.year.handle=function(s){
this.setText(" ("+s+")");
};
this.textHandlers.movieLength.handle=function(s){
s&&this.setText(s+" minutes");
};
this.visibilityHandlers.starring.handle=function(a){
this.setVisible(a.length>0);
};
this.visibilityHandlers.starring.setVisible=function(_31){
if(_31){
if(this.rowRemoved){
BobContentHandler.detailElements.elements[this.element.id]=this.element;
this.rowRemoved=false;
}
}else{
if(!this.tBody){
this.tBody=this.element.parentNode;
}
if(!this.rowRemoved){
this.tBody.removeChild(this.element);
BobContentHandler.detailElements.elements[this.element.id]=null;
this.rowRemoved=true;
}
}
};
this.visibilityHandlers.director.setVisible=this.visibilityHandlers.starring.setVisible;
this.visibilityHandlers.genre.setVisible=this.visibilityHandlers.starring.setVisible;
this.visibilityHandlers.rating.setVisible=this.visibilityHandlers.starring.setVisible;
this.visibilityHandlers.movieLength.setVisible=this.visibilityHandlers.starring.setVisible;
this.visibilityHandlers.director.handle=function(_32){
this.setVisible(_32&&_32.name.length>0);
};
this.initialized=true;
},display:function(_33,_34){
if(!this.initialized){
return false;
}
this.movieID=_33.id;
this.parentID=_33.parentID;
this.handleBoxshot(_34);
for(var _35 in _33){
if(this.textHandlers[_35]){
this.textHandlers[_35].handle(_33[_35],_33);
}
if(this.visibilityHandlers[_35]){
this.visibilityHandlers[_35].handle(_33[_35]);
}
}
this.detailElements.display();
if(!this.shownFlag&&(UserAgent.matches.khtml||UserAgent.matches.opera)){
this.hideContent(_33,_34);
}
},handleBoxshot:function(_36){
if(!_36){
this.boxImg.style.display="none";
}else{
this.boxImg.style.display="inline";
this.boxImg.src=BoxShots.getUrl((this.parentID?this.parentID:this.movieID),BoxShots.sizes.SMALL);
}
},preloadBoxshot:function(_37){
if(!this.preloadBoxshot){
this.preloadBoxshot=new Image();
}
this.preloadBoxshot.src=BoxShots.getUrl(_37,BoxShots.sizes.SMALL);
},hideContent:function(_38,_39){
this.handleBoxshot(false);
for(var k in this.visibilityHandlers){
this.visibilityHandlers[k].setVisible(false);
}
this.detailElements.clear();
if(!this.shownFlag&&(UserAgent.matches.khtml||UserAgent.matches.opera)){
var _41=this;
var _42=function(){
_41.shownFlag=true;
_41.display(_38,_39);
};
window.setTimeout(_42,2);
}
}};
BobContentHandler.detailElements={initialize:function(_43){
this.tBody=_43;
},elements:[],elementIDs:new Array("bobstarring","bobdirecting","bobgenretbl","bobratingtbl","boblengthtbl"),clear:function(){
for(var _44 in this.elements){
this.elements[_44]=null;
}
},display:function(){
for(var i=0;i<this.elementIDs.length;i++){
if(this.elements[this.elementIDs[i]]){
this.tBody.appendChild(this.elements[this.elementIDs[i]]);
}
}
}};
var BobManager={STYLE_POSITION:1,COUNT_DELIM:"_",BOXSHOT_STATE_DEFAULT:0,BOXSHOT_STATE_NONE:1,BOXSHOT_STATE_DISPLAY:2,STATE_AWAKE:0,STATE_ASLEEP:1,LINKCTR_TEXT:"TXT",LINKCTR_BOXSHOT:"BOX",LINKCTR_TEXT_NEAR_BOXSHOT:"BTX",LINKCTR_MINIQ:"MQI",displayFlag:false,doArrowClick:true,autoBobifyLinks:true,initialize:function(){
if(!ServerConnectionFactory.isSupported()){
return;
}
this.readyState=BobManager.STATE_AWAKE;
var _45=this;
var _46=function(){
if(_45.hideBobTimer){
clearTimeout(_45.hideBobTimer);
_45.hideBobTimer=null;
}
};
var _47=function(evt){
evt=evt||window.event;
if(evt.keycode){
if(evt.keyCode==33||evt.keyCode==34){
_45.currentScroll=document.body.scrollTop;
}
}
};
var _49=function(evt){
evt=evt||window.event;
if(evt.keycode){
if(evt.keyCode==33||evt.keyCode==34){
if(document.body.scrollTop!=_45.currentScroll){
_45.hideBob();
}
}
}
};
with(EventDispatcher){
addEvent($("bobarrow"),"click",function(){
if(_45.doArrowClick){
window.location.href=_45.href;
}
});
addEvent($("bobarrow"),"mouseout",this.hideBob.bindEventListener(this));
addEvent($("bobarrow"),"mouseover",_46);
addEvent(document,"keydown",_47);
addEvent(document,"keyup",_49);
}
BobContentHandler.initialize();
this.autoBobifyLinks&&this.bobifyLinks();
},setReadyState:function(_50){
this.readyState=_50;
if(this.readyState==BobManager.STATE_ASLEEP){
this.hideBob();
this.detach();
}
},bobifyLinks:function(_51){
if(this.readyState!=BobManager.STATE_AWAKE){
return;
}
_51=_51&&_51.nodeType==1?_51:$("page-content");
var _52=_51.getElementsByTagName("img");
var _53={};
var _54=/dB\(/;
for(var i=0;i<_52.length;i++){
var img=_52[i];
if(!img.mouseover){
continue;
}
if(_54.test(img.onmouseover.toString())){
_53[img.id.substring(2,img.id.indexOf(BobManager.COUNT_DELIM))]=true;
}
}
if(_53.length==0){
return;
}
var _56=/Read\s?More/;
var _57=/^Why\s?is\s?this\s?movie/i;
var _58=/(DVD|Blu\s?ray)/;
var _59=_51.getElementsByTagName("a");
var _60=Movie.getIdFromURL;
for(var i=0;i<_59.length;i++){
var _61=_59[i];
if(_61.onmouseover){
continue;
}
if(_61.className.containsClass("notebtn")){
continue;
}
if(_61.parentNode.className.containsClass("price")){
continue;
}
if(_61.parentNode.parentNode.id=="mdpNavigation"){
continue;
}
if(_61.getElementsByTagName("img").length>0||_61.getElementsByTagName("table").length>0){
continue;
}
var _62=$$(_61).getText();
if(_62&&(_56.test(_62)||_57.test(_62)||_58.test(_62))){
continue;
}
var id=_60(_61.href);
if(id&&_53[id]){
_61.movieid=id;
EventDispatcher.addEvent(_61,"mouseover",this.dB.bindEventListener(this,_61,BobManager.BOXSHOT_STATE_NONE));
continue;
}
}
},bobify:function(_63){
var _64={boxshotState:BobManager.BOXSHOT_STATE_DEFAULT,linkURL:Movie.getURL(_63.movieId,_63.movieTitle),doArrowClick:true};
for(var key in _63){
_64[key]=_63[key];
}
var c=_64.container;
c.movieid=_64.movieId;
if(c.db_eid){
EventDispatcher.removeEvent(c,"mouseover",c.db_eid);
}
if(this.readyState==BobManager.STATE_AWAKE){
var eid=EventDispatcher.addEvent(c,"mouseover",this.dB.bindEventListener(this,c,_64.boxshotState,_64.linkURL,_64.doArrowClick));
c.db_eid=eid;
}
},getURLParams:function(){
var _68=this.triggerElement.tagName.toLowerCase();
if(this.triggerElement.movieid){
var _69={pos:0,ds:"b"};
_69.linkCtr=_68=="a"?BobManager.LINKCTR_TEXT_NEAR_BOXSHOT:BobManager.LINKCTR_MINIQ;
}else{
var _69={pos:this.triggerElement.id.substring(this.triggerElement.id.indexOf(BobManager.COUNT_DELIM)+1),ds:this.triggerElement.id.charAt(BobManager.STYLE_POSITION)};
_69.linkCtr=_68=="a"?BobManager.LINKCTR_TEXT:BobManager.LINKCTR_BOXSHOT;
}
return _69;
},isShowBoxshot:function(){
if(this.boxshotState==BobManager.BOXSHOT_STATE_DEFAULT){
var _70=this.triggerElement.tagName.toLowerCase();
return _70=="a"||_70=="div";
}else{
return this.boxshotState==BobManager.BOXSHOT_STATE_DISPLAY;
}
},display:function(_71){
if(_71!=this.getMovieID()){
return;
}
this.displayFlag=true;
var _72=this;
var _73=this.isShowBoxshot();
var _74=this.getURLParams();
if(window.isQueue){
_74.linkCtr+="QUEUE";
}
if(this.triggerElement.alt){
this.triggerElement.altbackup=this.triggerElement.alt;
this.triggerElement.alt="";
}
var _75=function(_76){
_72.showBobTimer=null;
if(!BobManager.displayFlag){
return;
}
BobContentHandler.display(_76,_73);
BobPositioner.setPosition(_72.triggerElement,_72.mouseCoord);
if((UserAgent.matches.khtml||UserAgent.matches.opera)&&!_72.shownFlag){
window.setTimeout(function(){
BobPositioner.setPosition(_72.triggerElement,_72.mouseCoord);
_72.shownFlag=true;
},5);
}
$("bob").style.visibility="visible";
};
if(_73){
BobContentHandler.preloadBoxshot(_71);
}
JSONMovieFetcher.getMovie(_71,_75,_74);
},detach:function(){
if(this.triggerElement){
if(this.triggerElement.bob_eid){
EventDispatcher.removeEvent(this.triggerElement,"mouseout",this.triggerElement.bob_eid);
this.triggerElement.bob_eid=null;
}
if(this.triggerElement.bob_eid2){
EventDispatcher.removeEvent(this.triggerElement,"click",this.triggerElement.bob_eid2);
this.triggerElement.bob_eid2=null;
}
this.triggerElement=null;
}
},attach:function(){
if(!this.triggerElement.bob_eid){
this.triggerElement.bob_eid=EventDispatcher.addEvent(this.triggerElement,"mouseout",this.hideBob.bindEventListener(this));
}
if(!this.triggerElement.bob_eid2){
this.triggerElement.bob_eid2=EventDispatcher.addEvent(this.triggerElement,"click",this.hideBob.bindEventListener(this));
}
},dB:function(evt,_77,_78,_79,_80){
if(!window.d_bobMS||d_bobMS==-1||this.readyState!=BobManager.STATE_AWAKE){
return;
}
if(this.hideBobTimer&&this.triggerElement&&this.triggerElement==_77){
clearTimeout(this.hideBobTimer);
this.hideBobTimer=null;
return;
}
this.mouseCoord=getMouseCoordinates(evt);
this.detach();
this.triggerElement=_77;
if(typeof _79=="undefined"){
this.href=_77.tagName.toLowerCase()=="a"?_77.href:_77.parentNode.href;
}else{
this.href=_79;
}
this.boxshotState=typeof _78=="undefined"?BobManager.BOXSHOT_STATE_DEFAULT:_78;
this.doArrowClick=typeof _80=="undefined"?this.href?true:false:_80;
this.attach();
var _81=this.getMovieID();
var _82=this;
var _83=function(){
_82.display(_81);
};
this.showBobTimer=setTimeout(_83,d_bobMS);
},getMovieID:function(){
if(this.triggerElement.movieid){
return this.triggerElement.movieid;
}else{
var id=this.triggerElement.id;
var _84=id.indexOf(BobManager.COUNT_DELIM);
return id.substring(2,_84);
}
},hideBob:function(){
if(this.readyState!=BobManager.STATE_AWAKE){
return;
}
this.displayFlag=false;
if(this.showBobTimer){
clearTimeout(this.showBobTimer);
this.showBobTimer=null;
return;
}
var _85=this;
var _86=function(){
_85.hideBobTimer=null;
$("bob").style.visibility="hidden";
if(_85.triggerElement&&_85.triggerElement.altbackup){
_85.triggerElement.alt=_85.triggerElement.altbackup;
}
BobContentHandler.hideContent();
};
this.hideBobTimer=setTimeout(_86,3);
},destroy:function(){
this.triggerElement&&(this.triggerElement=null);
}};
var BobPositioner={TOP_SHADOW_OFFSET:-10,BOB_BOX_WIDTH:290,MOVIE_TO_ARROW_SPACER:25,DISPLAY_STYLE_DEFAULT:0,DISPLAY_STYLE_LARGE_BOXSHOT:1,DISPLAY_STYLE_TINY_BOXSHOT:2,ARROW_HEIGHT:101,ARROW_HEIGHT_NO_SHADOW:70,LARGE_BOXSHOT_WIDTH:110,MED_BOXSHOT_WIDTH:65,TINY_BOXSHOT_WIDTH:50,TEXT_LINK_BUFFER_WIDTH:50,POSITION_LEFT:0,POSITION_RIGHT:1,MAX_PAGE_LEFT_OFFSET:490,bobId:"bob",arrowId:"bobarrow",arrowImageIds:{UL:"bobarrowulimg",UR:"bobarrowurimg",LL:"bobarrowllimg",LR:"bobarrowlrimg"},setPosition:function(_87,_88){
this.bobPosition=BobPositioner.POSITION_RIGHT;
this.triggerElement=_87;
this.mouseCoordX=_88.x;
this.mouseCoordY=_88.y;
this.setTop();
this.setLeft();
this.positionArrow();
},setTop:function(){
var _89=$$(this.triggerElement).getTop()+BobPositioner.TOP_SHADOW_OFFSET-($$(this.bobId).getHeight()/4);
$(this.bobId).style.top=_89+"px";
this.correctForYOverrun(_89);
},correctForYOverrun:function(_90){
var _91=0;
var b=$(this.bobId);
var _93=$$(b);
var _94=_93.getTop()-BobPositioner.TOP_SHADOW_OFFSET-Position.scrollTop();
var _95=Position.viewportH();
var _96=_94+_93.getHeight();
if(_96>_95){
_91=_96-_95-30;
}
if(_94-_91<1){
_91=_94;
}
b.style.top=(_90-_91)+"px";
},getTriggerTop:function(){
return $$(this.triggerElement).getTop();
},setLeft:function(){
var _97=0;
var _98=this.triggerElement.tagName.toLowerCase();
if(_98=="a"||_98=="div"){
_97=Math.max(this.mouseCoordX,0)+BobPositioner.TEXT_LINK_BUFFER_WIDTH;
if(_97>this.maxLeftPosition()){
_97-=(BobPositioner.BOB_BOX_WIDTH+BobPositioner.MOVIE_TO_ARROW_SPACER+(1.5*BobPositioner.TEXT_LINK_BUFFER_WIDTH));
this.bobPosition=BobPositioner.POSITION_LEFT;
}
}else{
var _99=0;
var _100=this.getBoxshotStyle();
if(_100==BobPositioner.DISPLAY_STYLE_LARGE_BOXSHOT){
_99=BobPositioner.LARGE_BOXSHOT_WIDTH;
}else{
if(_100==BobPositioner.DISPLAY_STYLE_TINY_BOXSHOT){
_99=BobPositioner.TINY_BOXSHOT_WIDTH;
}else{
_99=BobPositioner.MED_BOXSHOT_WIDTH;
}
}
var _101=$$(this.triggerElement).getLeft();
_97=_101+BobPositioner.MOVIE_TO_ARROW_SPACER+_99;
if(_97>this.maxLeftPosition()){
_97-=(BobPositioner.BOB_BOX_WIDTH+BobPositioner.MOVIE_TO_ARROW_SPACER+_99);
this.bobPosition=BobPositioner.POSITION_LEFT;
}
}
$(this.bobId).style.left=_97+"px";
},maxLeftPosition:function(){
return getPageElementOffsetX($("page-content"))+BobPositioner.MAX_PAGE_LEFT_OFFSET;
},positionArrow:function(){
var _102=false;
var _103=$$(this.bobId);
var _104=this.getTriggerTop()-_103.getTop();
var _105=_103.getHeight();
if(_104<(_105/2)){
_102=true;
}else{
_104-=BobPositioner.ARROW_HEIGHT_NO_SHADOW;
}
if(_104+BobPositioner.ARROW_HEIGHT+10>_105){
_104-=10;
}
if(_104<10){
_104=10;
}
$$(this.arrowId).setStyles({top:_104+"px",left:(this.bobPosition==BobPositioner.POSITION_LEFT)?"268px":"-42px"});
var _106=_102?"U":"L";
_106+=(this.bobPosition==BobPositioner.POSITION_LEFT)?"R":"L";
for(var key in this.arrowImageIds){
$(this.arrowImageIds[key]).style.display=(key==_106)?"block":"none";
}
},getBoxshotStyle:function(){
return this.triggerElement.id.substring(1,2);
}};
function primeBOB(){
EventDispatcher.addEvent(dom,"ready",BobManager.initialize.bindEventListener(BobManager));
EventDispatcher.addEvent(window,"unload",BobManager.destroy.bindEventListener(BobManager));
}
function dB(evt,link,_108){
BobManager.dB(evt,link,_108);
}


var DOMWalker={subs:{},subscribe:function(_1,_2){
_1=_1.toUpperCase();
if(this.subs[_1]){
this.subs[_1].push(_2);
}else{
this.subs[_1]=[_2];
}
},run:function(){
for(var _3 in this.subs){
var _4=document.getElementsByTagName(_3);
var _5=this.subs[_3];
var le=_4.length;
var lc=_5.length;
for(var ii=0;ii<le;ii++){
for(var jj=0;jj<lc;jj++){
_5[jj](_4[ii],_3);
}
}
}
this.clearSubs();
},clearSubs:function(){
for(var tag in this.subs){
delete this.subs[tag];
}
}};
EventDispatcher.addEvent(dom,"afterready",DOMWalker.run.bindEventListener(DOMWalker));


var RolloverUtils={STATE_UNKNOWN:-1,STATE_DEFAULT:0,STATE_CLICKED:1,STATE_MOUSEOVER:2,STATE_DELIMITER:"_s",statePositionFromSrc:function(_1){
return _1.indexOf(this.STATE_DELIMITER)+this.STATE_DELIMITER.length;
},getSrcState:function(_2){
var _3=this.statePositionFromSrc(_2);
if(-1<_3<_2.length){
return _2.charAt(_3);
}else{
return this.STATE_UNKNOWN;
}
},changeSrcState:function(_4,_5){
if(_5!=this.STATE_UNKNOWN){
var _6=this.getSrcState(_4);
return _4.replace(this.STATE_DELIMITER+_6,this.STATE_DELIMITER+_5);
}else{
return _4;
}
},getSrcForEvent:function(_7,_8){
var _9=this.getSrcState(_8);
if(_7.type&&_9>this.STATE_UNKNOWN){
if(_7.type=="mouseover"){
_8=this.changeSrcState(_8,this.STATE_MOUSEOVER);
}else{
if(_7.type=="mouseout"){
_8=this.changeSrcState(_8,this.STATE_DEFAULT);
}
}
}
return _8;
},flipThisImage:function(_10,_11){
if(_10&&_11.src){
_11.src=this.getSrcForEvent(_10,_11.src);
}
},flipFirstChildImage:function(_12){
var _13=getEventTarget(_12);
if(_12&&_13&&_13.hasChildNodes()){
var _14=(_13.getElementsByTagName("IMG"))[0];
if(_14){
this.flipThisImage(_12,_14);
}
}
},basicRollover:function(_15){
var _16=getEventTarget(_15);
if(_16&&_16.src){
RolloverUtils.flipThisImage(_15,_16);
}else{
if(_16.hasChildNodes()){
RolloverUtils.flipFirstChildImage(_15);
}
}
return _15.type=="mouseout";
}};
function Rollover(_17,_18,_19){
this.targetIsClass=RolloverManager.targetIsClass(_17);
if(this.targetIsClass){
this.target=_17;
}else{
if(_17.id){
this.target=_17.id;
}
}
this.handler=_18;
this.handlerArgs=_19;
return this;
}
var RolloverManager={rollingClasses:[],rollingElements:[],isBrowserSupported:function(){
return this.rollingClasses.push;
},targetIsClass:function(_20){
return !_20.id&&(typeof _20=="string");
},applyToMatchingElements:function(_21){
for(var ii=0;ii<_21.length;ii++){
this.applyToElementIfMatch(_21[ii]);
}
},applyToElementIfMatch:function(_23){
if(this.rollingClasses[_23.className]){
var _24=RolloverManager.rollingClasses[_23.className];
this.applyRollover(_23,_24);
}
},applyAll:function(){
var _25=["IMG","A","DIV","TR","INPUT"];
var _26=this;
var cb=function(_28){
_26.applyToElementIfMatch(_28);
};
for(var ii=0;ii<_25.length;ii++){
DOMWalker.subscribe(_25[ii],cb);
}
for(var ii=0;ii<this.rollingElements.length;ii++){
var _29=this.rollingElements[ii];
this.applyRollover($(_29.target),_29);
}
},applyRollover:function(_30,_31){
if(!this.isBrowserSupported()){
return;
}
var _32=[];
_32.push(_31.handler);
if(_31.handler!=RolloverUtils.basicRollover){
_32.push(_30);
}
for(var ii=0;ii<_31.handlerArgs.length;ii++){
_32.push(_31.handlerArgs[ii]);
}
EventDispatcher.addEvent(_30,"mouseover",_31.handler.bindEventListener.apply(_31.handler,_32));
EventDispatcher.addEvent(_30,"mouseout",_31.handler.bindEventListener.apply(_31.handler,_32));
EventDispatcher.addEvent(_30,"mouseup",_31.handler.bindEventListener.apply(_31.handler,_32));
},addRollover:function(_33,_34){
if(!_33||!this.isBrowserSupported()){
return;
}
var _35=[];
for(var ii=2;ii<arguments.length;ii++){
_35.push(arguments[ii]);
}
if(!_34||typeof _34=="undefined"){
_34=RolloverUtils.basicRollover;
}
var _36=new Rollover(_33,_34,_35);
if(_36.targetIsClass){
this.rollingClasses[_36.target]=_36;
}else{
this.rollingElements.push(_36);
}
}};
function sidebarTrElementHover(_37,_38,_39,_40){
if(_37.type=="mouseover"){
_38.style.background=_39;
_38.style.backgroundImage="none";
var _41=_38.getElementsByTagName("TR");
for(var i=0;i<_41.length;i++){
if(_41[i].className=="sidebarRow"){
_41[i].style.backgroundImage="none";
}
}
_38.style.cursor="hand";
_38.style.cursor="pointer";
}else{
if(_37.type=="mouseout"){
_38.style.backgroundImage=_40;
_38.style.backgroundRepeat="no-repeat";
_38.style.backgroundPosition="center bottom";
_38.style.background="#ffffff";
var _43=_38.getElementsByTagName("TR")[0];
var id=_43.getAttribute("ID");
if(id&&id.indexOf("active")!=-1){
return;
}else{
_43.style.backgroundImage=_40;
_43.style.backgroundRepeat="no-repeat";
_43.style.backgroundPosition="center bottom";
}
}else{
if(_37.type=="mouseup"){
var _45=_38.getElementsByTagName("A")[0].href;
document.location.href=_45;
}
}
}
}
function sidebarElementHover(_46,_47,_48,_49){
if(_46.type=="mouseover"){
_47.style.background=_48;
_47.style.backgroundImage="none";
_47.style.cursor="hand";
_47.style.cursor="pointer";
}else{
if(_46.type=="mouseout"){
_47.style.backgroundImage=_49;
}else{
if(_46.type=="mouseup"){
var _50=_47.getElementsByTagName("A")[0].href;
document.location.href=_50;
}
}
}
}
function handleFormButtonRollover(_51,_52,_53){
var tr=_52.parentNode;
while(tr.tagName!="TR"&&tr.tagName!="BODY"){
tr=tr.parentNode;
}
if(tr.tagName!="TR"){
return;
}
if(_51.type=="mouseover"){
if(tr.className.indexOf("_on")==-1){
tr.className="form_button_on";
}
}else{
if(_51.type=="mouseout"){
if(_53=="secondary"){
tr.className="form_button_secondary";
}else{
tr.className="form_button_primary";
}
}
}
}
RolloverManager.addRollover("notebtn");
RolloverManager.addRollover("buybtn");
RolloverManager.addRollover("qcladdbtn");
RolloverManager.addRollover("bsub_primary",handleFormButtonRollover,"primary");
RolloverManager.addRollover("bsub_secondary",handleFormButtonRollover,"secondary");


var CSAuthCode=function(_1,_2){
this.clickId=_1;
this.dispId=_2;
this.ANON_CODE="888-000";
this.init();
};
CSAuthCode.prototype={init:function(){
EventDispatcher.addEvent($(this.clickId),"click",this.getAuthCode.bindEventListener(this));
},getAuthCode:function(){
this.sendRequest();
return false;
},sendRequest:function(){
var sc=ServerConnectionFactory.getConnection();
sc.url=Link.pageURL("JSON/CSAuthCodeJSON");
sc.returnType=ServerConnection.RETURN_TEXT;
var _4=this;
sc.successCallback=function(_5){
_4.handleJSONReturn(_5);
};
sc.failureCallback=function(){
_4.handleJSONFailure();
};
sc.execute();
},handleJSONReturn:function(_6){
var _7=eval("("+_6+")");
if(_7.success){
this.display(_7.auth);
}else{
this.handleJSONFailure();
}
},handleJSONFailure:function(){
this.display(this.ANON_CODE);
},display:function(_8){
$(this.dispId).innerHTML=_8;
}};


var Effects={DUR_DEFAULT:250,FPS_DEFAULT:30,trackers:{},types:{FADE:1,SIZE_X:2,SIZE_Y:3,MOVE_X:4,MOVE_Y:5},doEffect:function(id,_2,_3){
switch(_2){
case Effects.types.FADE:
return UserAgent.supports.elementAlpha?this.addEffect(new FadeEffect(id,_3)):null;
case Effects.types.SIZE_X:
var _4="x";
case Effects.types.SIZE_Y:
_3.direction=_4||"y";
if(!_3.rate){
_3.rate=0.4;
}
return this.addEffect(new SizeEffect(id,_3));
case Effects.types.MOVE_X:
case Effects.types.MOVE_Y:
return this.addEffect(new MoveEffect(id,_3));
default:
throw "Unknown effect type specified: "+_2;
}
},getEffect:function(id,_5){
if(this.trackers[id]){
return this.trackers[id].getEffect(_5);
}
return null;
},addEffect:function(_6){
var id=_6.getId();
(this.trackers[id]||(this.trackers[id]=new EffectTracker())).addEffect(_6);
return _6;
},clear:function(id){
var _7=this.trackers[id];
if(_7){
for(type in _7.effects){
_7.removeEffect(type);
}
delete this.trackers[id];
}
},cancelEffect:function(id,_8){
var _9=this.trackers[id];
if(!_9){
return;
}
var _10=_9.getEffect(_8);
if(!_10){
return;
}
this.removeEffect(_10);
_10.onabort&&_10.onabort({type:"abort"});
_10.onend&&_10.onend({type:"end"});
},removeEffect:function(_11){
var id=_11.getId();
var _12=this.trackers[id];
if(_12){
_12.removeEffect(_11.getType());
if(_12.length==0){
delete this.trackers[id];
}
}
}};
function EffectTracker(){
this.length=0;
this.effects={};
}
EffectTracker.prototype={getEffect:function(_13){
return this.effects[_13];
},addEffect:function(_14){
this.length++;
Effects.cancelEffect(_14.getId(),_14.getType());
this.effects[_14.getType()]=_14;
_14.doStep();
},removeEffect:function(_15){
this.effects[_15].clearTimeout();
delete this.effects[_15];
this.length--;
}};
function Effect(){
}
Effect.prototype={getId:function(){
return this.id;
},getEl:function(){
return $(this.id);
},getType:function(){
return this.type;
},stdInit:function(_16){
this.addCallback(_16.onFinishFn,_16.onFinishParams,"finish");
this.addCallback(_16.onAbortFn,_16.onAbortParams,"abort");
this.addCallback(_16.onStepFn,_16.onStepParams,"step");
this.value=this.startValue;
this.dur=_16.duration||Effects.DUR_DEFAULT;
this.interval=1000/(_16.fps||Effects.FPS_DEFAULT);
this.increment=(this.finalValue-this.startValue)/(this.dur/this.interval);
},addCallback:function(_17,_18,_19){
if(_17){
EventDispatcher.addEvent(this,_19,function(){
_17(_18);
});
}
},clearTimeout:function(){
window.clearTimeout(this.timeoutId);
},getStartValue:function(){
return this.startValue;
},getFinalValue:function(){
return this.finalValue;
},getValue:function(){
return this.value;
},setValue:null,getIncrement:function(){
return this.increment;
},isDone:function(){
return Effects.getEffect(this.getId(),this.getType())!=this;
},doStep:function(){
if(!this.getEl()){
Effects.clear(this.getId());
return;
}
var _20=this.getValue()+this.getIncrement();
this.onstep&&this.onstep({type:"step",value:_20});
if(this.setValue(_20)){
this.finish(false);
}else{
this.timeoutId=window.setTimeout(function(){
if(!this.isDone()){
this.doStep();
}
}.bind(this),this.interval);
}
},finish:function(_21){
var _22=_21===false?null:this.getFinalValue();
this.endAt(_22);
this.onfinish&&this.onfinish({type:"finish",value:_22});
this.onend&&this.onend({type:"end"});
},undo:function(){
var _23=this.getStartValue();
this.endAt(_23);
this.onundo&&this.onundo({type:"undo",value:_23});
this.onend&&this.onend({type:"end"});
},endAt:function(val){
this.clearTimeout();
if(val||val===0){
this.setValue(val);
}
Effects.removeEffect(this);
}};
function FadeEffect(id,_25){
this.id=id;
this.type=Effects.types.FADE;
this.startValue=Math.max(Math.min(_25.startOpacity,100),0);
this.finalValue=Math.max(Math.min(_25.endOpacity,100),0);
this.stdInit(_25);
}
FadeEffect.prototype=new Effect();
FadeEffect.prototype.setValue=function(n){
var _27=Math.min(this.startValue,this.finalValue);
var _28=Math.max(this.startValue,this.finalValue);
n=Math.max(Math.min(n,_28),_27);
$$(this.getEl()).setOpacity(this.value=Math.round(n));
return n==this.finalValue;
};
var SizeEffect=function(id,_29){
this.id=id;
var _30=_29.direction=="x";
this.type=Effects.types[_30?"SIZE_X":"SIZE_Y"];
this.direction=_29.direction;
this.finalSize=_29.finalSize;
var el=this.getEl();
this.origOverflow=$$(el).getComputedStyle("overflow")||"visible";
el.style.overflow="hidden";
this.minSize=_29.minSize?parseInt(_29.minSize):0;
var _32=_29.fullSize||$$(el)[_30?"getWidth":"getHeight"]();
this.fullSize=parseInt(_32);
this.startValue=_29.grow?this.minSize:this.fullSize;
this.finalValue=_29.grow?this.fullSize:this.minSize;
this.grow=_29.grow;
this.stdInit(_29);
this.increment=_29.rate;
EventDispatcher.addEvent(this,"end",function(){
this.getEl().style.overflow=this.origOverflow;
}.bind(this));
};
SizeEffect.prototype=new Effect();
SizeEffect.prototype.getIncrement=function(){
if(this.increment<1){
var val=(this.getFinalValue()-this.getValue())*this.increment;
return val>0?Math.max(val,1):Math.min(val,-1);
}else{
return this.increment*(this.positive?1:-1);
}
};
SizeEffect.prototype.setValue=function(n){
this.value=Math.max(Math.min(n,this.fullSize),this.minSize);
n=Math.round(this.value);
var _33=this.grow?n>=this.finalValue:n<=this.finalValue;
n=(_33&&(this.finalSize||this.finalSize===0))?this.finalSize:n+"px";
this.getEl().style[this.direction=="x"?"width":"height"]=n;
return _33;
};
var MoveEffect=function(id,_34){
this.id=id;
this.startValue=_34.startPosition;
this.finalValue=_34.endPosition;
this.side=_34.side;
this.type=(_34.side=="top"||_34.side=="bottom")?Effects.types.MOVE_Y:Effects.types.MOVE_X;
this.stdInit(_34);
this.increment=_34.rate;
this.minIncrement=_34.minRate||1;
this.positive=this.finalValue>this.startValue;
};
MoveEffect.prototype=new Effect();
MoveEffect.prototype.getIncrement=function(){
if(Math.abs(this.increment)<1){
var val=(this.getFinalValue()-this.getValue())*this.increment;
return this.positive?Math.max(val,this.minIncrement):Math.min(val,-this.minIncrement);
}else{
return this.increment*(this.positive?1:-1);
}
};
MoveEffect.prototype.setValue=function(n){
var _35=this.positive?this.finalValue:this.startValue;
var _36=this.positive?this.startValue:this.finalValue;
this.value=Math.max(Math.min(n,_35),_36);
n=Math.ceil(n);
this.getEl().style[this.side]=n;
if(this.positive){
return n>=this.finalValue;
}else{
return n<=this.finalValue;
}
};

