function Log(_1,_2,_3){
var _4=Log.WARN;
var _5=Log.writeLogger;
var _6=false;
this.setPrefix=function(_7){
if(_7!="undefined"){
_6=_7;
}else{
_6=false;
}
};
this.setLogger=function(_8){
if(_8!="undefined"){
_5=_8;
}
};
this.setLevel=function(_9){
if(_9!="undefined"&&typeof _9=="number"){
_4=_9;
}else{
if(_9!="undefined"){
if(_9=="debug"){
_4=Log.DEBUG;
}else{
if(_9=="info"){
_4=Log.INFO;
}else{
if(_9=="error"){
_4=Log.ERROR;
}else{
if(_9=="fatal"){
_4=Log.FATAL;
}else{
if(_9=="warn"){
_4=Log.WARN;
}else{
_4=Log.NONE;
}
}
}
}
}
}
}
};
this.getPrefix=function(){
return _6;
};
this.getLogger=function(){
return _5;
};
this.getLevel=function(){
return _4;
};
if(_1!="undefined"){
this.setLevel(_1);
}
if(_2!="undefined"){
this.setLogger(_2);
}
if(_3!="undefined"){
this.setPrefix(_3);
}
}
Log.prototype.debug=function(s){
if(this.getLevel()<=Log.DEBUG){
this._log(s,"DEBUG",this);
}
};
Log.prototype.info=function(s){
if(this.getLevel()<=Log.INFO){
this._log(s,"INFO",this);
}
};
Log.prototype.warn=function(s){
if(this.getLevel()<=Log.WARN){
this._log(s,"WARN",this);
}
};
Log.prototype.error=function(s){
if(this.getLevel()<=Log.ERROR){
this._log(s,"ERROR",this);
}
};
Log.prototype.fatal=function(s){
if(this.getLevel()<=Log.FATAL){
this._log(s,"FATAL",this);
}
};
Log.prototype._log=function(_f,_10,obj){
if(this.getPrefix()){
this.getLogger()(this.getPrefix()+" - "+_f,_10,obj);
}else{
this.getLogger()(_f,_10,obj);
}
};
Log.DEBUG=1;
Log.INFO=2;
Log.WARN=3;
Log.ERROR=4;
Log.FATAL=5;
Log.NONE=6;
Log.alertLogger=function(msg,_13){
alert(_13+" - "+msg);
};
Log.writeLogger=function(msg,_15){
document.writeln(_15+"&nbsp;-&nbsp;"+msg+"<br/>");
};
Log.consoleLogger=function(msg,_17,obj){
if(window.console){
window.console.log(_17+" - "+msg);
}else{
Log.popupLogger(msg,_17,obj);
}
};
Log.popupLogger=function(msg,_1a,obj){
if(obj.popupBlocker){
return;
}
if(!obj._window||!obj._window.document){
obj._window=window.open("","logger_popup_window","width=620,height=320,scrollbars=1,status=0,toolbars=0,resizeable=1");
if(!obj._window){
obj.popupBlocker=true;
alert("You have a popup window manager blocking the log4js log popup display.\n\nThis must be disabled to properly see logged events.");
return;
}
if(!obj._window.document.getElementById("loggerTable")){
obj._window.document.writeln("<table width='100%' id='loggerTable'><tr><th align='left'>Time</th><th width='100%' colspan='2' align='left'>Message</th></tr></table>");
obj._window.document.close();
}
}
var tbl=obj._window.document.getElementById("loggerTable");
var row=tbl.insertRow(-1);
var _1e=row.insertCell(-1);
var _1f=row.insertCell(-1);
var _20=row.insertCell(-1);
var d=new Date();
var h=d.getHours();
if(h<10){
h="0"+h;
}
var m=d.getMinutes();
if(m<10){
m="0"+m;
}
var s=d.getSeconds();
if(s<10){
s="0"+s;
}
var _25=(d.getMonth()+1)+"/"+d.getDate()+"/"+d.getFullYear()+"&nbsp;-&nbsp;"+h+":"+m+":"+s;
_1e.style.fontSize="8pt";
_1e.style.fontWeight="bold";
_1e.style.paddingRight="6px";
_1f.style.fontSize="8pt";
_20.style.fontSize="8pt";
_20.style.whiteSpace="nowrap";
_20.style.width="100%";
if(tbl.rows.length%2==0){
_1e.style.backgroundColor="#eeeeee";
_1f.style.backgroundColor="#eeeeee";
_20.style.backgroundColor="#eeeeee";
}
_1e.innerHTML=_25;
_1f.innerHTML=_1a;
_20.innerHTML=msg;
};
Log.dumpObject=function(obj,_27){
if(!_27){
_27="";
}
if(_27.length>20){
return;
}
var s="{\n";
for(var p in obj){
s+=_27+p+":";
var _2a=typeof (obj[p]);
_2a=_2a.toLowerCase();
if(_2a=="object"){
s+=Log.dumpObject(obj[p],_27+"----");
}else{
s+=obj[p];
}
s+="\n";
}
s+=_27+"}";
return s;
};
window.logger=new Log(Log.NONE,Log.popupLogger);
var Prototype={Version:"1.4.0",ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:</script>)",emptyFunction:function(){
},K:function(x){
return x;
}};
var Class={create:function(){
return function(){
this.initialize.apply(this,arguments);
};
}};
var Abstract=new Object();
Object.extend=function(_2c,_2d){
for(property in _2d){
_2c[property]=_2d[property];
}
return _2c;
};
Object.inspect=function(_2e){
try{
if(_2e==undefined){
return "undefined";
}
if(_2e==null){
return "null";
}
return _2e.inspect?_2e.inspect():_2e.toString();
}
catch(e){
if(e instanceof RangeError){
return "...";
}
throw e;
}
};
Function.prototype.bind=function(){
var _2f=this,args=$A(arguments),object=args.shift();
return function(){
return _2f.apply(object,args.concat($A(arguments)));
};
};
Function.prototype.bindAsEventListener=function(_30){
var _31=this;
return function(_32){
return _31.call(_30,_32||window.event);
};
};
Object.extend(Number.prototype,{toColorPart:function(){
var _33=this.toString(16);
if(this<16){
return "0"+_33;
}
return _33;
},succ:function(){
return this+1;
},times:function(_34){
$R(0,this,true).each(_34);
return this;
}});
var Try={these:function(){
var _35;
for(var i=0;i<arguments.length;i++){
var _37=arguments[i];
try{
_35=_37();
break;
}
catch(e){
}
}
return _35;
}};
var PeriodicalExecuter=Class.create();
PeriodicalExecuter.prototype={initialize:function(_38,_39){
this.callback=_38;
this.frequency=_39;
this.currentlyExecuting=false;
this.registerCallback();
},registerCallback:function(){
setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},onTimerEvent:function(){
if(!this.currentlyExecuting){
try{
this.currentlyExecuting=true;
this.callback();
}
finally{
this.currentlyExecuting=false;
}
}
}};
function $(){
var _3a=new Array();
for(var i=0;i<arguments.length;i++){
var _3c=arguments[i];
if(typeof _3c=="string"){
_3c=document.getElementById(_3c);
}
if(arguments.length==1){
return _3c;
}
_3a.push(_3c);
}
return _3a;
}
Object.extend(String.prototype,{stripTags:function(){
return this.replace(/<\/?[^>]+>/gi,"");
},stripScripts:function(){
return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");
},extractScripts:function(){
var _3d=new RegExp(Prototype.ScriptFragment,"img");
var _3e=new RegExp(Prototype.ScriptFragment,"im");
return (this.match(_3d)||[]).map(function(_3f){
return (_3f.match(_3e)||["",""])[1];
});
},evalScripts:function(){
return this.extractScripts().map(eval);
},escapeHTML:function(){
var div=document.createElement("div");
var _41=document.createTextNode(this);
div.appendChild(_41);
return div.innerHTML;
},unescapeHTML:function(){
var div=document.createElement("div");
div.innerHTML=this.stripTags();
return div.childNodes[0]?div.childNodes[0].nodeValue:"";
},toQueryParams:function(){
var _43=this.match(/^\??(.*)$/)[1].split("&");
return _43.inject({},function(_44,_45){
var _46=_45.split("=");
_44[_46[0]]=_46[1];
return _44;
});
},toArray:function(){
return this.split("");
},camelize:function(){
var _47=this.split("-");
if(_47.length==1){
return _47[0];
}
var _48=this.indexOf("-")==0?_47[0].charAt(0).toUpperCase()+_47[0].substring(1):_47[0];
for(var i=1,len=_47.length;i<len;i++){
var s=_47[i];
_48+=s.charAt(0).toUpperCase()+s.substring(1);
}
return _48;
},inspect:function(){
return "'"+this.replace("\\","\\\\").replace("'","\\'")+"'";
}});
String.prototype.parseQuery=String.prototype.toQueryParams;
var $break=new Object();
var $continue=new Object();
var Enumerable={each:function(_4b){
var _4c=0;
try{
this._each(function(_4d){
try{
_4b(_4d,_4c++);
}
catch(e){
if(e!=$continue){
throw e;
}
}
});
}
catch(e){
if(e!=$break){
throw e;
}
}
},all:function(_4e){
var _4f=true;
this.each(function(_50,_51){
_4f=_4f&&!!(_4e||Prototype.K)(_50,_51);
if(!_4f){
throw $break;
}
});
return _4f;
},any:function(_52){
var _53=true;
this.each(function(_54,_55){
if(_53=!!(_52||Prototype.K)(_54,_55)){
throw $break;
}
});
return _53;
},collect:function(_56){
var _57=[];
this.each(function(_58,_59){
_57.push(_56(_58,_59));
});
return _57;
},detect:function(_5a){
var _5b;
this.each(function(_5c,_5d){
if(_5a(_5c,_5d)){
_5b=_5c;
throw $break;
}
});
return _5b;
},findAll:function(_5e){
var _5f=[];
this.each(function(_60,_61){
if(_5e(_60,_61)){
_5f.push(_60);
}
});
return _5f;
},grep:function(_62,_63){
var _64=[];
this.each(function(_65,_66){
var _67=_65.toString();
if(_67.match(_62)){
_64.push((_63||Prototype.K)(_65,_66));
}
});
return _64;
},include:function(_68){
var _69=false;
this.each(function(_6a){
if(_6a==_68){
_69=true;
throw $break;
}
});
return _69;
},inject:function(_6b,_6c){
this.each(function(_6d,_6e){
_6b=_6c(_6b,_6d,_6e);
});
return _6b;
},invoke:function(_6f){
var _70=$A(arguments).slice(1);
return this.collect(function(_71){
return _71[_6f].apply(_71,_70);
});
},max:function(_72){
var _73;
this.each(function(_74,_75){
_74=(_72||Prototype.K)(_74,_75);
if(_74>=(_73||_74)){
_73=_74;
}
});
return _73;
},min:function(_76){
var _77;
this.each(function(_78,_79){
_78=(_76||Prototype.K)(_78,_79);
if(_78<=(_77||_78)){
_77=_78;
}
});
return _77;
},partition:function(_7a){
var _7b=[],falses=[];
this.each(function(_7c,_7d){
((_7a||Prototype.K)(_7c,_7d)?_7b:falses).push(_7c);
});
return [_7b,falses];
},pluck:function(_7e){
var _7f=[];
this.each(function(_80,_81){
_7f.push(_80[_7e]);
});
return _7f;
},reject:function(_82){
var _83=[];
this.each(function(_84,_85){
if(!_82(_84,_85)){
_83.push(_84);
}
});
return _83;
},sortBy:function(_86){
return this.collect(function(_87,_88){
return {value:_87,criteria:_86(_87,_88)};
}).sort(function(_89,_8a){
var a=_89.criteria,b=_8a.criteria;
return a<b?-1:a>b?1:0;
}).pluck("value");
},toArray:function(){
return this.collect(Prototype.K);
},zip:function(){
var _8c=Prototype.K,args=$A(arguments);
if(typeof args.last()=="function"){
_8c=args.pop();
}
var _8d=[this].concat(args).map($A);
return this.map(function(_8e,_8f){
_8c(_8e=_8d.pluck(_8f));
return _8e;
});
},inspect:function(){
return "#<Enumerable:"+this.toArray().inspect()+">";
}};
Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});
var $A=Array.from=function(_90){
if(!_90){
return [];
}
if(_90.toArray){
return _90.toArray();
}else{
var _91=[];
for(var i=0;i<_90.length;i++){
_91.push(_90[i]);
}
return _91;
}
};
Object.extend(Array.prototype,Enumerable);
Array.prototype._reverse=Array.prototype.reverse;
Object.extend(Array.prototype,{_each:function(_93){
for(var i=0;i<this.length;i++){
_93(this[i]);
}
},clear:function(){
this.length=0;
return this;
},first:function(){
return this[0];
},last:function(){
return this[this.length-1];
},compact:function(){
return this.select(function(_95){
return _95!=undefined||_95!=null;
});
},flatten:function(){
return this.inject([],function(_96,_97){
return _96.concat(_97.constructor==Array?_97.flatten():[_97]);
});
},without:function(){
var _98=$A(arguments);
return this.select(function(_99){
return !_98.include(_99);
});
},indexOf:function(_9a){
for(var i=0;i<this.length;i++){
if(this[i]==_9a){
return i;
}
}
return -1;
},reverse:function(_9c){
return (_9c!==false?this:this.toArray())._reverse();
},shift:function(){
var _9d=this[0];
for(var i=0;i<this.length-1;i++){
this[i]=this[i+1];
}
this.length--;
return _9d;
},inspect:function(){
return "["+this.map(Object.inspect).join(", ")+"]";
}});
var Hash={_each:function(_9f){
for(key in this){
var _a0=this[key];
if(typeof _a0=="function"){
continue;
}
var _a1=[key,_a0];
_a1.key=key;
_a1.value=_a0;
_9f(_a1);
}
},keys:function(){
return this.pluck("key");
},values:function(){
return this.pluck("value");
},merge:function(_a2){
return $H(_a2).inject($H(this),function(_a3,_a4){
_a3[_a4.key]=_a4.value;
return _a3;
});
},toQueryString:function(){
return this.map(function(_a5){
return _a5.map(encodeURIComponent).join("=");
}).join("&");
},inspect:function(){
return "#<Hash:{"+this.map(function(_a6){
return _a6.map(Object.inspect).join(": ");
}).join(", ")+"}>";
}};
function $H(_a7){
var _a8=Object.extend({},_a7||{});
Object.extend(_a8,Enumerable);
Object.extend(_a8,Hash);
return _a8;
}
ObjectRange=Class.create();
Object.extend(ObjectRange.prototype,Enumerable);
Object.extend(ObjectRange.prototype,{initialize:function(_a9,end,_ab){
this.start=_a9;
this.end=end;
this.exclusive=_ab;
},_each:function(_ac){
var _ad=this.start;
do{
_ac(_ad);
_ad=_ad.succ();
}while(this.include(_ad));
},include:function(_ae){
if(_ae<this.start){
return false;
}
if(this.exclusive){
return _ae<this.end;
}
return _ae<=this.end;
}});
var $R=function(_af,end,_b1){
return new ObjectRange(_af,end,_b1);
};
var Ajax={getTransport:function(){
return Try.these(function(){
return new ActiveXObject("Msxml2.XMLHTTP");
},function(){
return new ActiveXObject("Microsoft.XMLHTTP");
},function(){
return new XMLHttpRequest();
})||false;
},activeRequestCount:0};
Ajax.Responders={responders:[],_each:function(_b2){
this.responders._each(_b2);
},register:function(_b3){
if(!this.include(_b3)){
this.responders.push(_b3);
}
},unregister:function(_b4){
this.responders=this.responders.without(_b4);
},dispatch:function(_b5,_b6,_b7,_b8){
this.each(function(_b9){
if(_b9[_b5]&&typeof _b9[_b5]=="function"){
try{
_b9[_b5].apply(_b9,[_b6,_b7,_b8]);
}
catch(e){
}
}
});
}};
Object.extend(Ajax.Responders,Enumerable);
Ajax.Responders.register({onCreate:function(){
Ajax.activeRequestCount++;
},onComplete:function(){
Ajax.activeRequestCount--;
}});
Ajax.Base=function(){
};
Ajax.Base.prototype={setOptions:function(_ba){
this.options={method:"post",asynchronous:true,parameters:""};
Object.extend(this.options,_ba||{});
},responseIsSuccess:function(){
return this.transport.status==undefined||this.transport.status==0||(this.transport.status>=200&&this.transport.status<300);
},responseIsFailure:function(){
return !this.responseIsSuccess();
}};
Ajax.Request=Class.create();
Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Request.prototype=Object.extend(new Ajax.Base(),{initialize:function(url,_bc){
this.transport=Ajax.getTransport();
this.aborted=false;
this.setOptions(_bc);
this.request(url);
},request:function(url){
var _be=this.options.parameters||"";
if(_be.length>0){
_be+="&_=";
}
try{
this.url=url;
if(this.options.method=="get"&&_be.length>0){
this.url+=(this.url.match(/\?/)?"&":"?")+_be;
}
Ajax.Responders.dispatch("onCreate",this,this.transport);
this.transport.open(this.options.method,this.url,this.options.asynchronous);
if(this.options.asynchronous){
this.transport.onreadystatechange=this.onStateChange.bind(this);
setTimeout((function(){
this.respondToReadyState(1);
}).bind(this),10);
}
this.setRequestHeaders();
if(this.options.requestTimeout){
this.requestTimer=setTimeout((function(){
this.abortRequest();
}).bind(this),this.options.requestTimeout*1000);
}
var _bf=this.options.postBody?this.options.postBody:_be;
this.transport.send(this.options.method=="post"?_bf:null);
}
catch(e){
this.dispatchException(e);
}
},abortRequest:function(){
this.aborted=true;
this.transport.abort();
},setRequestHeaders:function(){
var _c0=["X-Requested-With","XMLHttpRequest","X-Prototype-Version",Prototype.Version];
if(this.options.method=="post"){
_c0.push("Content-type","application/x-www-form-urlencoded");
if(this.transport.overrideMimeType){
_c0.push("Connection","close");
}
}
if(this.options.requestHeaders){
_c0.push.apply(_c0,this.options.requestHeaders);
}
for(var i=0;i<_c0.length;i+=2){
this.transport.setRequestHeader(_c0[i],_c0[i+1]);
}
},onStateChange:function(){
var _c2=this.transport.readyState;
if(_c2!=1){
this.respondToReadyState(this.transport.readyState);
}
},header:function(_c3){
try{
return this.transport.getResponseHeader(_c3);
}
catch(e){
}
},evalJSON:function(){
try{
return eval(this.header("X-JSON"));
}
catch(e){
}
},evalResponse:function(){
try{
return eval(this.transport.responseText);
}
catch(e){
this.dispatchException(e);
}
},respondToReadyState:function(_c4){
var _c5=Ajax.Request.Events[_c4];
var _c6=this.transport,json=this.evalJSON();
if(_c5=="Complete"){
if(this.requestTimer){
clearTimeout(this.requestTimer);
}
try{
(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Prototype.emptyFunction)(_c6,json);
if(!this.aborted){
(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Prototype.emptyFunction)(_c6,json);
}else{
(this.options["onTimeout"]||Prototype.emptyFunction)(_c6,json);
}
}
catch(e){
this.dispatchException(e);
}
if((this.header("Content-type")||"").match(/^text\/javascript/i)){
this.evalResponse();
}
}
try{
(this.options["on"+_c5]||Prototype.emptyFunction)(_c6,json);
Ajax.Responders.dispatch("on"+_c5,this,_c6,json);
}
catch(e){
this.dispatchException(e);
}
if(_c5=="Complete"){
this.transport.onreadystatechange=Prototype.emptyFunction;
}
},dispatchException:function(_c7){
(this.options.onException||Prototype.emptyFunction)(this,_c7);
Ajax.Responders.dispatch("onException",this,_c7);
}});
Ajax.Updater=Class.create();
Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(_c8,url,_ca){
this.containers={success:_c8.success?$(_c8.success):$(_c8),failure:_c8.failure?$(_c8.failure):(_c8.success?null:$(_c8))};
this.transport=Ajax.getTransport();
this.setOptions(_ca);
var _cb=this.options.onComplete||Prototype.emptyFunction;
this.options.onComplete=(function(_cc,_cd){
this.updateContent();
_cb(_cc,_cd);
}).bind(this);
this.request(url);
},updateContent:function(){
var _ce=this.responseIsSuccess()?this.containers.success:this.containers.failure;
var _cf=this.transport.responseText;
if(!this.options.evalScripts){
_cf=_cf.stripScripts();
}
if(_ce){
if(this.options.insertion){
new this.options.insertion(_ce,_cf);
}else{
Element.update(_ce,_cf);
}
}
if(this.responseIsSuccess()){
if(this.onComplete){
setTimeout(this.onComplete.bind(this),10);
}
}
}});
Ajax.PeriodicalUpdater=Class.create();
Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(_d0,url,_d2){
this.setOptions(_d2);
this.onComplete=this.options.onComplete;
this.frequency=(this.options.frequency||2);
this.decay=(this.options.decay||1);
this.updater={};
this.container=_d0;
this.url=url;
this.start();
},start:function(){
this.options.onComplete=this.updateComplete.bind(this);
this.onTimerEvent();
},stop:function(){
this.updater.onComplete=undefined;
clearTimeout(this.timer);
(this.onComplete||Prototype.emptyFunction).apply(this,arguments);
},updateComplete:function(_d3){
if(this.options.decay){
this.decay=(_d3.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=_d3.responseText;
}
this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000);
},onTimerEvent:function(){
this.updater=new Ajax.Updater(this.container,this.url,this.options);
}});
document.getElementsByClassName=function(_d4,_d5){
var _d6=($(_d5)||document.body).getElementsByTagName("*");
return $A(_d6).inject([],function(_d7,_d8){
if(_d8.className.match(new RegExp("(^|\\s)"+_d4+"(\\s|$)"))){
_d7.push(_d8);
}
return _d7;
});
};
if(!window.Element){
var Element=new Object();
}
Object.extend(Element,{visible:function(_d9){
return $(_d9).style.display!="none";
},toggle:function(){
for(var i=0;i<arguments.length;i++){
var _db=$(arguments[i]);
Element[Element.visible(_db)?"hide":"show"](_db);
}
},hide:function(){
for(var i=0;i<arguments.length;i++){
var _dd=$(arguments[i]);
_dd.style.display="none";
}
},show:function(){
for(var i=0;i<arguments.length;i++){
var _df=$(arguments[i]);
_df.style.display="";
}
},remove:function(_e0){
_e0=$(_e0);
_e0.parentNode.removeChild(_e0);
},update:function(_e1,_e2){
$(_e1).innerHTML=_e2.stripScripts();
setTimeout(function(){
_e2.evalScripts();
},10);
},getHeight:function(_e3){
_e3=$(_e3);
return _e3.offsetHeight;
},classNames:function(_e4){
return new Element.ClassNames(_e4);
},hasClassName:function(_e5,_e6){
if(!(_e5=$(_e5))){
return;
}
return Element.classNames(_e5).include(_e6);
},addClassName:function(_e7,_e8){
if(!(_e7=$(_e7))){
return;
}
return Element.classNames(_e7).add(_e8);
},removeClassName:function(_e9,_ea){
if(!(_e9=$(_e9))){
return;
}
return Element.classNames(_e9).remove(_ea);
},cleanWhitespace:function(_eb){
_eb=$(_eb);
for(var i=0;i<_eb.childNodes.length;i++){
var _ed=_eb.childNodes[i];
if(_ed.nodeType==3&&!/\S/.test(_ed.nodeValue)){
Element.remove(_ed);
}
}
},empty:function(_ee){
return $(_ee).innerHTML.match(/^\s*$/);
},scrollTo:function(_ef){
_ef=$(_ef);
var x=_ef.x?_ef.x:_ef.offsetLeft,y=_ef.y?_ef.y:_ef.offsetTop;
window.scrollTo(x,y);
},getStyle:function(_f1,_f2){
_f1=$(_f1);
var _f3=_f1.style[_f2.camelize()];
if(!_f3){
if(document.defaultView&&document.defaultView.getComputedStyle){
var css=document.defaultView.getComputedStyle(_f1,null);
_f3=css?css.getPropertyValue(_f2):null;
}else{
if(_f1.currentStyle){
_f3=_f1.currentStyle[_f2.camelize()];
}
}
}
if(window.opera&&["left","top","right","bottom"].include(_f2)){
if(Element.getStyle(_f1,"position")=="static"){
_f3="auto";
}
}
return _f3=="auto"?null:_f3;
},setStyle:function(_f5,_f6){
_f5=$(_f5);
for(name in _f6){
_f5.style[name.camelize()]=_f6[name];
}
},getDimensions:function(_f7){
_f7=$(_f7);
if(Element.getStyle(_f7,"display")!="none"){
return {width:_f7.offsetWidth,height:_f7.offsetHeight};
}
var els=_f7.style;
var _f9=els.visibility;
var _fa=els.position;
els.visibility="hidden";
els.position="absolute";
els.display="";
var _fb=_f7.clientWidth;
var _fc=_f7.clientHeight;
els.display="none";
els.position=_fa;
els.visibility=_f9;
return {width:_fb,height:_fc};
},makePositioned:function(_fd){
_fd=$(_fd);
var pos=Element.getStyle(_fd,"position");
if(pos=="static"||!pos){
_fd._madePositioned=true;
_fd.style.position="relative";
if(window.opera){
_fd.style.top=0;
_fd.style.left=0;
}
}
},undoPositioned:function(_ff){
_ff=$(_ff);
if(_ff._madePositioned){
_ff._madePositioned=undefined;
_ff.style.position=_ff.style.top=_ff.style.left=_ff.style.bottom=_ff.style.right="";
}
},makeClipping:function(_100){
_100=$(_100);
if(_100._overflow){
return;
}
_100._overflow=_100.style.overflow;
if((Element.getStyle(_100,"overflow")||"visible")!="hidden"){
_100.style.overflow="hidden";
}
},undoClipping:function(_101){
_101=$(_101);
if(_101._overflow){
return;
}
_101.style.overflow=_101._overflow;
_101._overflow=undefined;
}});
var Toggle=new Object();
Toggle.display=Element.toggle;
Abstract.Insertion=function(_102){
this.adjacency=_102;
};
Abstract.Insertion.prototype={initialize:function(_103,_104){
this.element=$(_103);
this.content=_104.stripScripts();
if(this.adjacency&&this.element.insertAdjacentHTML){
try{
this.element.insertAdjacentHTML(this.adjacency,this.content);
}
catch(e){
if(this.element.tagName.toLowerCase()=="tbody"){
this.insertContent(this.contentFromAnonymousTable());
}else{
throw e;
}
}
}else{
this.range=this.element.ownerDocument.createRange();
if(this.initializeRange){
this.initializeRange();
}
this.insertContent([this.range.createContextualFragment(this.content)]);
}
setTimeout(function(){
_104.evalScripts();
},10);
},contentFromAnonymousTable:function(){
var div=document.createElement("div");
div.innerHTML="<table><tbody>"+this.content+"</tbody></table>";
return $A(div.childNodes[0].childNodes[0].childNodes);
}};
var Insertion=new Object();
Insertion.Before=Class.create();
Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){
this.range.setStartBefore(this.element);
},insertContent:function(_106){
_106.each((function(_107){
this.element.parentNode.insertBefore(_107,this.element);
}).bind(this));
}});
Insertion.Top=Class.create();
Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){
this.range.selectNodeContents(this.element);
this.range.collapse(true);
},insertContent:function(_108){
_108.reverse(false).each((function(_109){
this.element.insertBefore(_109,this.element.firstChild);
}).bind(this));
}});
Insertion.Bottom=Class.create();
Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){
this.range.selectNodeContents(this.element);
this.range.collapse(this.element);
},insertContent:function(_10a){
_10a.each((function(_10b){
this.element.appendChild(_10b);
}).bind(this));
}});
Insertion.After=Class.create();
Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){
this.range.setStartAfter(this.element);
},insertContent:function(_10c){
_10c.each((function(_10d){
this.element.parentNode.insertBefore(_10d,this.element.nextSibling);
}).bind(this));
}});
Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(_10e){
this.element=$(_10e);
},_each:function(_10f){
this.element.className.split(/\s+/).select(function(name){
return name.length>0;
})._each(_10f);
},set:function(_111){
this.element.className=_111;
},add:function(_112){
if(this.include(_112)){
return;
}
this.set(this.toArray().concat(_112).join(" "));
},remove:function(_113){
if(!this.include(_113)){
return;
}
this.set(this.select(function(_114){
return _114!=_113;
}).join(" "));
},toString:function(){
return this.toArray().join(" ");
}};
Object.extend(Element.ClassNames.prototype,Enumerable);
var Field={clear:function(){
for(var i=0;i<arguments.length;i++){
$(arguments[i]).value="";
}
},focus:function(_116){
$(_116).focus();
},present:function(){
for(var i=0;i<arguments.length;i++){
if($(arguments[i]).value==""){
return false;
}
}
return true;
},select:function(_118){
$(_118).select();
},activate:function(_119){
_119=$(_119);
_119.focus();
if(_119.select){
_119.select();
}
}};
var Form={serialize:function(form){
var _11b=Form.getElements($(form));
var _11c=new Array();
for(var i=0;i<_11b.length;i++){
var _11e=Form.Element.serialize(_11b[i]);
if(_11e){
_11c.push(_11e);
}
}
return _11c.join("&");
},getElements:function(form){
form=$(form);
var _120=new Array();
for(tagName in Form.Element.Serializers){
var _121=form.getElementsByTagName(tagName);
for(var j=0;j<_121.length;j++){
_120.push(_121[j]);
}
}
return _120;
},getInputs:function(form,_124,name){
form=$(form);
var _126=form.getElementsByTagName("input");
if(!_124&&!name){
return _126;
}
var _127=new Array();
for(var i=0;i<_126.length;i++){
var _129=_126[i];
if((_124&&_129.type!=_124)||(name&&_129.name!=name)){
continue;
}
_127.push(_129);
}
return _127;
},disable:function(form){
var _12b=Form.getElements(form);
for(var i=0;i<_12b.length;i++){
var _12d=_12b[i];
_12d.blur();
_12d.disabled="true";
}
},enable:function(form){
var _12f=Form.getElements(form);
for(var i=0;i<_12f.length;i++){
var _131=_12f[i];
_131.disabled="";
}
},findFirstElement:function(form){
return Form.getElements(form).find(function(_133){
return _133.type!="hidden"&&!_133.disabled&&["input","select","textarea"].include(_133.tagName.toLowerCase());
});
},focusFirstElement:function(form){
Field.activate(Form.findFirstElement(form));
},reset:function(form){
$(form).reset();
}};
Form.Element={serialize:function(_136){
_136=$(_136);
var _137=_136.tagName.toLowerCase();
var _138=Form.Element.Serializers[_137](_136);
if(_138){
var key=encodeURIComponent(_138[0]);
if(key.length==0){
return;
}
if(_138[1].constructor!=Array){
_138[1]=[_138[1]];
}
return _138[1].map(function(_13a){
return key+"="+encodeURIComponent(_13a);
}).join("&");
}
},getValue:function(_13b){
_13b=$(_13b);
var _13c=_13b.tagName.toLowerCase();
var _13d=Form.Element.Serializers[_13c](_13b);
if(_13d){
return _13d[1];
}
}};
Form.Element.Serializers={input:function(_13e){
switch(_13e.type.toLowerCase()){
case "submit":
case "hidden":
case "password":
case "text":
return Form.Element.Serializers.textarea(_13e);
case "checkbox":
case "radio":
return Form.Element.Serializers.inputSelector(_13e);
}
return false;
},inputSelector:function(_13f){
if(_13f.checked){
return [_13f.name,_13f.value];
}
},textarea:function(_140){
return [_140.name,_140.value];
},select:function(_141){
return Form.Element.Serializers[_141.type=="select-one"?"selectOne":"selectMany"](_141);
},selectOne:function(_142){
var _143="",opt,index=_142.selectedIndex;
if(index>=0){
opt=_142.options[index];
_143=opt.value;
if(!_143&&!("value" in opt)){
_143=opt.text;
}
}
return [_142.name,_143];
},selectMany:function(_144){
var _145=new Array();
for(var i=0;i<_144.length;i++){
var opt=_144.options[i];
if(opt.selected){
var _148=opt.value;
if(!_148&&!("value" in opt)){
_148=opt.text;
}
_145.push(_148);
}
}
return [_144.name,_145];
}};
var $F=Form.Element.getValue;
Abstract.TimedObserver=function(){
};
Abstract.TimedObserver.prototype={initialize:function(_149,_14a,_14b){
this.frequency=_14a;
this.element=$(_149);
this.callback=_14b;
this.lastValue=this.getValue();
this.registerCallback();
},registerCallback:function(){
setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},onTimerEvent:function(){
var _14c=this.getValue();
if(this.lastValue!=_14c){
this.callback(this.element,_14c);
this.lastValue=_14c;
}
}};
Form.Element.Observer=Class.create();
Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){
return Form.Element.getValue(this.element);
}});
Form.Observer=Class.create();
Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){
return Form.serialize(this.element);
}});
Abstract.EventObserver=function(){
};
Abstract.EventObserver.prototype={initialize:function(_14d,_14e){
this.element=$(_14d);
this.callback=_14e;
this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){
this.registerFormCallbacks();
}else{
this.registerCallback(this.element);
}
},onElementEvent:function(){
var _14f=this.getValue();
if(this.lastValue!=_14f){
this.callback(this.element,_14f);
this.lastValue=_14f;
}
},registerFormCallbacks:function(){
var _150=Form.getElements(this.element);
for(var i=0;i<_150.length;i++){
this.registerCallback(_150[i]);
}
},registerCallback:function(_152){
if(_152.type){
switch(_152.type.toLowerCase()){
case "checkbox":
case "radio":
Event.observe(_152,"click",this.onElementEvent.bind(this));
break;
case "password":
case "text":
case "textarea":
case "select-one":
case "select-multiple":
Event.observe(_152,"change",this.onElementEvent.bind(this));
break;
}
}
}};
Form.Element.EventObserver=Class.create();
Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){
return Form.Element.getValue(this.element);
}});
Form.EventObserver=Class.create();
Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){
return Form.serialize(this.element);
}});
if(!window.Event){
var Event=new Object();
}
Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(_153){
return _153.target||_153.srcElement;
},isLeftClick:function(_154){
return (((_154.which)&&(_154.which==1))||((_154.button)&&(_154.button==1)));
},pointerX:function(_155){
return _155.pageX||(_155.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(_156){
return _156.pageY||(_156.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
},stop:function(_157){
if(_157.preventDefault){
_157.preventDefault();
_157.stopPropagation();
}else{
_157.returnValue=false;
_157.cancelBubble=true;
}
},findElement:function(_158,_159){
var _15a=Event.element(_158);
while(_15a.parentNode&&(!_15a.tagName||(_15a.tagName.toUpperCase()!=_159.toUpperCase()))){
_15a=_15a.parentNode;
}
return _15a;
},observers:false,_observeAndCache:function(_15b,name,_15d,_15e){
if(!this.observers){
this.observers=[];
}
if(_15b.addEventListener){
this.observers.push([_15b,name,_15d,_15e]);
_15b.addEventListener(name,_15d,_15e);
}else{
if(_15b.attachEvent){
this.observers.push([_15b,name,_15d,_15e]);
_15b.attachEvent("on"+name,_15d);
}
}
},unloadCache:function(){
if(!Event.observers){
return;
}
for(var i=0;i<Event.observers.length;i++){
Event.stopObserving.apply(this,Event.observers[i]);
Event.observers[i][0]=null;
}
Event.observers=false;
},observe:function(_160,name,_162,_163){
var _160=$(_160);
_163=_163||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_160.attachEvent)){
name="keydown";
}
this._observeAndCache(_160,name,_162,_163);
},stopObserving:function(_164,name,_166,_167){
var _164=$(_164);
_167=_167||false;
if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_164.detachEvent)){
name="keydown";
}
if(_164.removeEventListener){
_164.removeEventListener(name,_166,_167);
}else{
if(_164.detachEvent){
_164.detachEvent("on"+name,_166);
}
}
}});
Event.observe(window,"unload",Event.unloadCache,false);
var Position={includeScrollOffsets:false,prepare:function(){
this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;
},realOffset:function(_168){
var _169=0,valueL=0;
do{
_169+=_168.scrollTop||0;
valueL+=_168.scrollLeft||0;
_168=_168.parentNode;
}while(_168);
return [valueL,_169];
},cumulativeOffset:function(_16a){
var _16b=0,valueL=0;
do{
_16b+=_16a.offsetTop||0;
valueL+=_16a.offsetLeft||0;
_16a=_16a.offsetParent;
}while(_16a);
return [valueL,_16b];
},positionedOffset:function(_16c){
var _16d=0,valueL=0;
do{
_16d+=_16c.offsetTop||0;
valueL+=_16c.offsetLeft||0;
_16c=_16c.offsetParent;
if(_16c){
p=Element.getStyle(_16c,"position");
if(p=="relative"||p=="absolute"){
break;
}
}
}while(_16c);
return [valueL,_16d];
},offsetParent:function(_16e){
if(_16e.offsetParent){
return _16e.offsetParent;
}
if(_16e==document.body){
return _16e;
}
while((_16e=_16e.parentNode)&&_16e!=document.body){
if(Element.getStyle(_16e,"position")!="static"){
return _16e;
}
}
return document.body;
},within:function(_16f,x,y){
if(this.includeScrollOffsets){
return this.withinIncludingScrolloffsets(_16f,x,y);
}
this.xcomp=x;
this.ycomp=y;
this.offset=this.cumulativeOffset(_16f);
return (y>=this.offset[1]&&y<this.offset[1]+_16f.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_16f.offsetWidth);
},withinIncludingScrolloffsets:function(_172,x,y){
var _175=this.realOffset(_172);
this.xcomp=x+_175[0]-this.deltaX;
this.ycomp=y+_175[1]-this.deltaY;
this.offset=this.cumulativeOffset(_172);
return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_172.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_172.offsetWidth);
},overlap:function(mode,_177){
if(!mode){
return 0;
}
if(mode=="vertical"){
return ((this.offset[1]+_177.offsetHeight)-this.ycomp)/_177.offsetHeight;
}
if(mode=="horizontal"){
return ((this.offset[0]+_177.offsetWidth)-this.xcomp)/_177.offsetWidth;
}
},clone:function(_178,_179){
_178=$(_178);
_179=$(_179);
_179.style.position="absolute";
var _17a=this.cumulativeOffset(_178);
_179.style.top=_17a[1]+"px";
_179.style.left=_17a[0]+"px";
_179.style.width=_178.offsetWidth+"px";
_179.style.height=_178.offsetHeight+"px";
},page:function(_17b){
var _17c=0,valueL=0;
var _17d=_17b;
do{
_17c+=_17d.offsetTop||0;
valueL+=_17d.offsetLeft||0;
if(_17d.offsetParent==document.body){
if(Element.getStyle(_17d,"position")=="absolute"){
break;
}
}
}while(_17d=_17d.offsetParent);
_17d=_17b;
do{
_17c-=_17d.scrollTop||0;
valueL-=_17d.scrollLeft||0;
}while(_17d=_17d.parentNode);
return [valueL,_17c];
},clone:function(_17e,_17f){
var _180=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
_17e=$(_17e);
var p=Position.page(_17e);
_17f=$(_17f);
var _182=[0,0];
var _183=null;
if(Element.getStyle(_17f,"position")=="absolute"){
_183=Position.offsetParent(_17f);
_182=Position.page(_183);
}
if(_183==document.body){
_182[0]-=document.body.offsetLeft;
_182[1]-=document.body.offsetTop;
}
if(_180.setLeft){
_17f.style.left=(p[0]-_182[0]+_180.offsetLeft)+"px";
}
if(_180.setTop){
_17f.style.top=(p[1]-_182[1]+_180.offsetTop)+"px";
}
if(_180.setWidth){
_17f.style.width=_17e.offsetWidth+"px";
}
if(_180.setHeight){
_17f.style.height=_17e.offsetHeight+"px";
}
},absolutize:function(_184){
_184=$(_184);
if(_184.style.position=="absolute"){
return;
}
Position.prepare();
var _185=Position.positionedOffset(_184);
var top=_185[1];
var left=_185[0];
var _188=_184.clientWidth;
var _189=_184.clientHeight;
_184._originalLeft=left-parseFloat(_184.style.left||0);
_184._originalTop=top-parseFloat(_184.style.top||0);
_184._originalWidth=_184.style.width;
_184._originalHeight=_184.style.height;
_184.style.position="absolute";
_184.style.top=top+"px";
_184.style.left=left+"px";
_184.style.width=_188+"px";
_184.style.height=_189+"px";
},relativize:function(_18a){
_18a=$(_18a);
if(_18a.style.position=="relative"){
return;
}
Position.prepare();
_18a.style.position="relative";
var top=parseFloat(_18a.style.top||0)-(_18a._originalTop||0);
var left=parseFloat(_18a.style.left||0)-(_18a._originalLeft||0);
_18a.style.top=top+"px";
_18a.style.left=left+"px";
_18a.style.height=_18a._originalHeight;
_18a.style.width=_18a._originalWidth;
}};
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
Position.cumulativeOffset=function(_18d){
var _18e=0,valueL=0;
do{
_18e+=_18d.offsetTop||0;
valueL+=_18d.offsetLeft||0;
if(_18d.offsetParent==document.body){
if(Element.getStyle(_18d,"position")=="absolute"){
break;
}
}
_18d=_18d.offsetParent;
}while(_18d);
return [valueL,_18e];
};
}
var mboxCopyright="&copy; 1996-2008. Omniture, Inc. All rights reserved.";
mboxUrlBuilder=function(a,b){
this.a=a;
this.b=b;
this.c=new Array();
this.d=function(e){
return e;
};
this.f=null;
};
mboxUrlBuilder.prototype.addParameter=function(g,h){
var i=new RegExp("('|\")");
if(i.exec(g)){
throw "Parameter '"+g+"' contains invalid characters";
}
for(var j=0;j<this.c.length;j++){
var k=this.c[j];
if(k.name==g){
k.value=h;
return this;
}
}
var l=new Object();
l.name=g;
l.value=h;
this.c[this.c.length]=l;
return this;
};
mboxUrlBuilder.prototype.addParameters=function(c){
if(!c){
return this;
}
for(var j=0;j<c.length;j++){
var m=c[j].indexOf("=");
if(m==-1||m==0){
continue;
}
this.addParameter(c[j].substring(0,m),c[j].substring(m+1,c[j].length));
}
return this;
};
mboxUrlBuilder.prototype.setServerType=function(n){
this.o=n;
};
mboxUrlBuilder.prototype.setBasePath=function(f){
this.f=f;
};
mboxUrlBuilder.prototype.setUrlProcessAction=function(p){
this.d=p;
};
mboxUrlBuilder.prototype.buildUrl=function(){
var q=this.f?this.f:"/m2/"+this.b+"/mbox/"+this.o;
var r=document.location.protocol=="file:"?"http:":document.location.protocol;
var e=r+"//"+this.a+q;
var s=e.indexOf("?")!=-1?"&":"?";
for(var j=0;j<this.c.length;j++){
var k=this.c[j];
e+=s+k.name+"="+encodeURIComponent(k.value);
s="&";
}
return this.t(this.d(e));
};
mboxUrlBuilder.prototype.getParameters=function(){
return this.c;
};
mboxUrlBuilder.prototype.setParameters=function(c){
this.c=c;
};
mboxUrlBuilder.prototype.clone=function(){
var u=new mboxUrlBuilder(this.a,this.b);
u.setServerType(this.o);
u.setBasePath(this.f);
u.setUrlProcessAction(this.d);
for(var j=0;j<this.c.length;j++){
u.addParameter(this.c[j].name,this.c[j].value);
}
return u;
};
mboxUrlBuilder.prototype.t=function(v){
return v.replace(/\"/g,"&quot;").replace(/>/g,"&gt;");
};
mboxStandardFetcher=function(){
};
mboxStandardFetcher.prototype.getType=function(){
return "standard";
};
mboxStandardFetcher.prototype.fetch=function(w){
w.setServerType(this.getType());
document.write("<"+"scr"+"ipt src=\""+w.buildUrl()+"\" language=\"JavaScript\"><"+"/scr"+"ipt>");
};
mboxStandardFetcher.prototype.cancel=function(){
};
mboxAjaxFetcher=function(){
};
mboxAjaxFetcher.prototype.getType=function(){
return "ajax";
};
mboxAjaxFetcher.prototype.fetch=function(w){
w.setServerType(this.getType());
var e=w.buildUrl();
this.x=document.createElement("script");
this.x.src=e;
document.body.appendChild(this.x);
};
mboxAjaxFetcher.prototype.cancel=function(){
};
mboxFactory=function(y,b){
this.z=false;
this.A=new mboxList();
this.B=typeof document.createElement("div").replaceChild!="undefined"&&(function(){
return true;
})()&&typeof document.getElementById!="undefined"&&typeof (window.attachEvent||document.addEventListener||window.addEventListener)!="undefined"&&typeof encodeURIComponent!="undefined";
this.C=this.B;
if(mboxGetPageParameter("mboxDisable")!=null){
this.C=false;
}
if(!mboxCookies.isEnabled()){
this.C=false;
}
if(mboxCookies.getCookie("disable")=="true"){
this.C=false;
}
if(this.isAdmin()){
this.enable();
}
this.D=mboxGenerateId();
this.E=new mboxSession(this.D,"mboxSession","session",31*60);
this.F=new mboxPC(this.D,"PC",63072000);
this.w=new mboxUrlBuilder(y,b);
this.G();
this.H=new Date().getTime();
this.I=this.H;
var J=this;
this.addOnLoad(function(){
J.I=new Date().getTime();
});
if(this.B){
this.addOnLoad(function(){
J.z=true;
J.getMboxes().each(function(K){
K.setFetcher(new mboxAjaxFetcher()),K.finalize();
});
});
this.limitTraffic(100,10368000);
if(this.C){
this.L();
this.M=new mboxSignaler(function(N,c){
return J.create(N,c);
});
}
}
};
mboxFactory.prototype.isEnabled=function(){
return this.C;
};
mboxFactory.prototype.isSupported=function(){
return this.B;
};
mboxFactory.prototype.disable=function(O){
if(typeof duration=="undefined"){
O=60*60;
}
if(!this.isAdmin()){
this.C=false;
mboxCookies.setCookie("disable","true",O);
}
};
mboxFactory.prototype.enable=function(){
this.C=true;
mboxCookies.deleteCookie("disable");
};
mboxFactory.prototype.isAdmin=function(){
return document.location.href.indexOf("mboxEnv")!=-1;
};
mboxFactory.prototype.limitTraffic=function(P,O){
};
mboxFactory.prototype.addOnLoad=function(p){
if(window.addEventListener){
window.addEventListener("load",p,false);
}else{
if(document.addEventListener){
document.addEventListener("load",p,false);
}else{
if(document.attachEvent){
window.attachEvent("onload",p);
}
}
}
};
mboxFactory.prototype.getEllapsedTime=function(){
return this.I-this.H;
};
mboxFactory.prototype.getEllapsedTimeUntil=function(Q){
return Q-this.H;
};
mboxFactory.prototype.getMboxes=function(){
return this.A;
};
mboxFactory.prototype.get=function(N,R){
return this.A.get(N).getById(R||0);
};
mboxFactory.prototype.update=function(N,c){
if(!this.isEnabled()){
return;
}
if(this.A.get(N).length()==0){
throw "Mbox "+N+" is not defined";
}
this.A.get(N).each(function(K){
K.getUrlBuilder().addParameter("mboxRandomRequestId",mboxGenerateId());
K.load(c);
});
};
mboxFactory.prototype.create=function(N,c,S){
if(!this.isSupported()){
return null;
}
var e=this.w.clone();
e.addParameter("mboxCount",this.A.length()+1);
e.addParameters(c);
var R=this.A.get(N).length();
var T;
if(S){
T=new mboxLocatorNode(S);
}else{
if(this.z){
throw "The page has already been loaded, can't write marker";
}
T=new mboxLocatorDefault(N+"-"+R);
}
try{
var J=this;
var K=new mbox(N,R,e,T);
if(this.C){
K.setFetcher(this.z?new mboxAjaxFetcher():new mboxStandardFetcher());
}
K.setOnError(function(U,n){
K.setMessage(U);
if(n=="standard"){
K.activate();
if(!K.isActivated()){
J.disable();
window.location.reload(false);
}
}else{
throw U;
}
});
this.A.add(K);
}
catch(V){
this.disable();
throw "Failed creating mbox \""+N+"\", the error was: "+V;
}
return K;
};
mboxFactory.prototype.getPageId=function(){
return this.D;
};
mboxFactory.prototype.getPCId=function(){
return this.F;
};
mboxFactory.prototype.getSessionId=function(){
return this.E;
};
mboxFactory.prototype.getSignaler=function(){
return this.M;
};
mboxFactory.prototype.getUrlBuilder=function(){
return this.w;
};
mboxFactory.prototype.G=function(){
var e=this.w;
e.addParameter("mboxHost",document.location.hostname).addParameter("mboxSession",this.E.getId());
if(this.F.getId()!=null){
e.addParameter("mboxPC",this.F.getId());
}
e.addParameter("mboxPage",this.D);
var W=mboxCookies.getCookie("edge");
if(W!=null){
e.addParameter("edge",W);
}
e.setUrlProcessAction(function(e){
e+="&mboxURL="+escape(document.location);
var X=escape(document.referrer);
if(e.length+X.length<2000){
e+="&mboxReferrer="+X;
}
e+="&mboxVersion="+mboxVersion;
return e;
});
};
mboxFactory.prototype.Y=function(){
return "";
};
mboxFactory.prototype.L=function(){
document.write("<style>."+"mboxDefault"+" { visibility:hidden; }</style>");
};
mboxSignaler=function(Z){
var _=mboxCookies.getCookieNames("signal-");
for(var j=0;j<_.length;j++){
var ab=_[j];
var bb=mboxCookies.getCookie(ab).split("&");
var K=Z(bb[0],bb);
K.load();
mboxCookies.deleteCookie(ab);
}
};
mboxSignaler.prototype.signal=function(cb,N){
mboxCookies.setCookie("signal-"+cb,mboxShiftArray(arguments).join("&"),45*60);
};
mboxList=function(){
this.A=new Array();
};
mboxList.prototype.add=function(K){
if(K!=null){
this.A[this.A.length]=K;
}
};
mboxList.prototype.get=function(N){
var db=new mboxList();
for(var j=0;j<this.A.length;j++){
var K=this.A[j];
if(K.getName()==N){
db.add(K);
}
}
return db;
};
mboxList.prototype.getById=function(eb){
return this.A[eb];
};
mboxList.prototype.length=function(){
return this.A.length;
};
mboxList.prototype.each=function(p){
if(typeof p!="function"){
throw "Action must be a function, was: "+typeof (p);
}
for(var j=0;j<this.A.length;j++){
p(this.A[j]);
}
};
mboxLocatorDefault=function(g){
this.g="mboxMarker-"+g;
document.write("<div id=\""+this.g+"\" style=\"visibility:hidden;display:none\"></div>");
};
mboxLocatorDefault.prototype.locate=function(){
var fb=document.getElementById(this.g);
while(fb!=null){
if(fb.nodeType==1){
if(fb.className=="mboxDefault"){
return fb;
}
}
fb=fb.previousSibling;
}
return null;
};
mboxLocatorDefault.prototype.force=function(){
var gb=document.createElement("div");
gb.className="mboxDefault";
var hb=document.getElementById(this.g);
hb.parentNode.insertBefore(gb,hb);
return gb;
};
mboxLocatorNode=function(ib){
this.fb=ib;
};
mboxLocatorNode.prototype.locate=function(){
return typeof this.fb=="string"?document.getElementById(this.fb):this.fb;
};
mboxLocatorNode.prototype.force=function(){
return null;
};
mboxCreate=function(N){
var K=mboxFactoryDefault.create(N,mboxShiftArray(arguments));
if(K){
K.load();
}
return K;
};
mboxDefine=function(S,N){
var K=mboxFactoryDefault.create(N,mboxShiftArray(mboxShiftArray(arguments)),S);
return K;
};
mboxUpdate=function(N){
mboxFactoryDefault.update(N,mboxShiftArray(arguments));
};
mbox=function(g,jb,w,kb){
this.lb=null;
this.mb=0;
this.nb=null;
this.T=kb;
this.ob=null;
this.pb=new mboxOfferContent();
this.gb=this.getDefaultDiv();
this.w=w;
this.message="";
this.qb=new Object();
this.rb=0;
this.jb=jb;
this.g=g;
this.sb();
w.addParameter("mbox",g).addParameter("mboxId",jb);
this.tb=function(){
};
this.ub=function(){
};
};
mbox.prototype.getId=function(){
return this.jb;
};
mbox.prototype.sb=function(){
if(this.g.length>250){
throw "Mbox Name "+this.g+" exceeds max length of "+"250 characters.";
}else{
if(this.g.match(/^\s+|\s+$/g)){
throw "Mbox Name "+this.g+" has leading/trailing whitespace(s).";
}
}
};
mbox.prototype.getName=function(){
return this.g;
};
mbox.prototype.parameters=function(){
return this.w.getParameters();
};
mbox.prototype.setOnLoad=function(p){
this.ub=p;
return this;
};
mbox.prototype.setMessage=function(U){
this.message=U;
return this;
};
mbox.prototype.setOnError=function(tb){
this.tb=tb;
return this;
};
mbox.prototype.setFetcher=function(vb){
if(this.ob){
this.ob.cancel();
}
this.ob=vb;
return this;
};
mbox.prototype.getFetcher=function(){
return this.ob;
};
mbox.prototype.load=function(c){
if(this.ob==null){
return this;
}
this.setEventTime("load.start");
this.cancelTimeout();
var w=(c&&c.length>0)?this.w.clone().addParameters(c):this.w;
this.ob.fetch(w);
var J=this;
this.wb=setTimeout(function(){
J.tb("Fetch of mbox timed out",J.ob.getType());
},15000);
this.setEventTime("load.end");
return this;
};
mbox.prototype.loaded=function(c){
this.cancelTimeout();
if(!this.activate()){
var J=this;
setTimeout(function(){
J.loaded();
},100);
}
};
mbox.prototype.activate=function(){
if(this.mb){
return this.mb;
}
this.setEventTime("activate"+ ++this.rb+".start");
if(this.show()){
this.cancelTimeout();
this.mb=1;
}
this.setEventTime("activate"+this.rb+".end");
return this.mb;
};
mbox.prototype.isActivated=function(){
return this.mb;
};
mbox.prototype.setOffer=function(pb){
if(pb&&pb.show&&pb.setOnLoad){
this.pb=pb;
}else{
throw "Invalid offer";
}
return this;
};
mbox.prototype.getOffer=function(){
return this.pb;
};
mbox.prototype.show=function(){
this.setEventTime("show.start");
var db=this.pb.show(this);
this.setEventTime(db==1?"show.end.ok":"show.end");
return db;
};
mbox.prototype.showContent=function(xb){
if(xb==null){
return 0;
}
if(this.gb==null){
this.gb=this.getDefaultDiv();
if(this.gb==null){
return 0;
}
}
if(this.gb!=xb){
this.yb(this.gb);
this.gb.parentNode.replaceChild(xb,this.gb);
this.gb=xb;
}
this.zb(xb);
this.ub();
return 1;
};
mbox.prototype.hide=function(){
this.setEventTime("hide.start");
var db=this.showContent(this.getDefaultDiv());
this.setEventTime(db==1?"hide.end.ok":"hide.end.fail");
return db;
};
mbox.prototype.finalize=function(){
this.setEventTime("finalize.start");
this.cancelTimeout();
if(this.getDefaultDiv()==null){
if(this.T==null){
this.setMessage("No locator specified");
}else{
if(this.T.force()!=null){
this.setMessage("No default content, an empty one has been added");
}else{
this.setMessage("Unable to locate mbox");
}
}
}
if(!this.activate()){
this.hide();
this.setEventTime("finalize.end.hide");
}
this.setEventTime("finalize.end.ok");
};
mbox.prototype.cancelTimeout=function(){
if(this.wb){
clearTimeout(this.wb);
}
if(this.ob!=null){
this.ob.cancel();
}
};
mbox.prototype.getDiv=function(){
return this.gb;
};
mbox.prototype.getDefaultDiv=function(){
if(this.nb!=null){
return this.nb;
}
if(this.T==null){
return null;
}
this.nb=this.T.locate();
return this.nb;
};
mbox.prototype.setEventTime=function(Ab){
this.qb[Ab]=(new Date()).getTime();
};
mbox.prototype.getEventTimes=function(){
return this.qb;
};
mbox.prototype.getURL=function(){
return this.w.buildUrl();
};
mbox.prototype.getUrlBuilder=function(){
return this.w;
};
mbox.prototype.Bb=function(gb){
return gb.style.display!="none";
};
mbox.prototype.zb=function(gb){
this.Cb(gb,true);
};
mbox.prototype.yb=function(gb){
this.Cb(gb,false);
};
mbox.prototype.Cb=function(gb,Db){
gb.style.visibility=Db?"visible":"hidden";
gb.style.display=Db?"block":"none";
};
mboxOfferContent=function(){
this.ub=function(){
};
};
mboxOfferContent.prototype.show=function(K){
var db=K.showContent(document.getElementById(this.Eb(K)));
if(db==1){
this.ub();
}
return db;
};
mboxOfferContent.prototype.setOnLoad=function(ub){
this.ub=ub;
};
mboxOfferContent.prototype.Eb=function(K){
return "mboxImported-"+K.getName()+"-"+K.getId();
};
mboxOfferAjax=function(xb){
this.xb=xb;
this.ub=function(){
};
};
mboxOfferAjax.prototype.setOnLoad=function(ub){
this.ub=ub;
};
mboxOfferAjax.prototype.show=function(K){
var Fb=document.createElement("div");
Fb.id="mboxImported-"+K.getName()+"-"+K.getId();
Fb.innerHTML=this.xb;
var db=K.showContent(Fb);
if(db==1){
this.ub();
}
return db;
};
mboxOfferDefault=function(){
this.ub=function(){
};
};
mboxOfferDefault.prototype.setOnLoad=function(ub){
this.ub=ub;
};
mboxOfferDefault.prototype.show=function(K){
var db=K.hide();
if(db==1){
this.ub();
}
return db;
};
mboxCookieManager=function mboxCookieManager(g,Gb){
this.g=g;
this.Gb=Gb==""||Gb.indexOf(".")==-1?"":"; domain="+Gb;
this.loadCookies();
};
mboxCookieManager.prototype.isEnabled=function(){
this.setCookie("check","true",60);
this.loadCookies();
return this.getCookie("check")=="true";
};
mboxCookieManager.prototype.setCookie=function(g,h,O){
if(typeof g!="undefined"&&typeof h!="undefined"&&typeof O!="undefined"){
var eb=this.Hb.length;
for(var j=0;j<this.Hb.length;j++){
if(this.Hb[j].name==g){
eb=j;
break;
}
}
var Ib=new Object();
Ib.name=g;
Ib.value=escape(h);
Ib.expireOn=Math.ceil(O+new Date().getTime()/1000);
this.Hb[eb]=Ib;
this.saveCookies();
}
};
mboxCookieManager.prototype.getCookie=function(g){
for(var j=0;j<this.Hb.length;j++){
var Ib=this.Hb[j];
if(Ib.name==g){
return unescape(Ib.value);
}
}
return null;
};
mboxCookieManager.prototype.deleteCookie=function(g){
var Jb=new Array();
for(var j=0;j<this.Hb.length;j++){
var Ib=this.Hb[j];
if(Ib.name!=g){
Jb[Jb.length]=Ib;
}
}
this.Hb=Jb;
this.saveCookies();
};
mboxCookieManager.prototype.getCookieNames=function(Kb){
var Lb=new Array();
for(var j=0;j<this.Hb.length;j++){
var Ib=this.Hb[j];
if(Ib.name.indexOf(Kb)==0){
Lb[Lb.length]=Ib.name;
}
}
return Lb;
};
mboxCookieManager.prototype.saveCookies=function(){
var Mb=new Array();
var Nb=0;
for(var j=0;j<this.Hb.length;j++){
var Ib=this.Hb[j];
Mb[Mb.length]=Ib.name+"#"+Ib.value+"#"+Ib.expireOn;
if(Nb<Ib.expireOn){
Nb=Ib.expireOn;
}
}
var Ob=new Date(Nb*1000);
document.cookie=this.g+"="+Mb.join("|")+"; expires="+Ob.toGMTString()+"; path=/"+this.Gb;
};
mboxCookieManager.prototype.loadCookies=function(){
this.Hb=new Array();
var Pb=document.cookie.indexOf(this.g+"=");
if(Pb!=-1){
var Qb=document.cookie.indexOf(";",Pb);
if(Qb==-1){
Qb=document.cookie.indexOf(",",Pb);
if(Qb==-1){
Qb=document.cookie.length;
}
}
var Rb=document.cookie.substring(Pb+this.g.length+1,Qb).split("|");
var Sb=Math.ceil(new Date().getTime()/1000);
for(var j=0;j<Rb.length;j++){
var Ib=Rb[j].split("#");
if(Sb<=Ib[2]){
var Tb=new Object();
Tb.name=Ib[0];
Tb.value=Ib[1];
Tb.expireOn=Ib[2];
this.Hb[this.Hb.length]=Tb;
}
}
}
};
mboxSession=function(Ub,Vb,ab,Wb){
this.Vb=Vb;
this.ab=ab;
this.Wb=Wb;
this.Xb=false;
this.jb=typeof mboxForceSessionId!="undefined"?mboxForceSessionId:mboxGetPageParameter(this.Vb);
if(this.jb==null||this.jb.length==0){
this.jb=mboxCookies.getCookie(ab);
if(this.jb==null||this.jb.length==0){
this.jb=Ub;
this.Xb=true;
}
}
mboxCookies.setCookie(ab,this.jb,Wb);
};
mboxSession.prototype.getId=function(){
return this.jb;
};
mboxSession.prototype.forceId=function(Yb){
this.jb=Yb;
mboxCookies.setCookie(this.ab,this.jb,this.Wb);
};
mboxPC=function(Ub,ab,Wb){
this.ab=ab;
this.Wb=Wb;
this.jb=typeof mboxForcePCId!="undefined"?mboxForcePCId:mboxCookies.getCookie(ab);
if(this.jb!=null){
mboxCookies.setCookie(ab,this.jb,Wb);
}
};
mboxPC.prototype.getId=function(){
return this.jb;
};
mboxPC.prototype.forceId=function(Yb){
if(this.jb!=Yb){
this.jb=Yb;
mboxCookies.setCookie(this.ab,this.jb,this.Wb);
return true;
}
return false;
};
mboxGetPageParameter=function(g){
var db=null;
var Zb=new RegExp(g+"=([^&]*)");
var _b=Zb.exec(document.location);
if(_b!=null&&_b.length>=2){
db=_b[1];
}
return db;
};
mboxSetCookie=function(g,h,O){
return mboxCookies.setCookie(g,h,O);
};
mboxGetCookie=function(g){
return mboxCookies.getCookie(g);
};
mboxCookiePageDomain=function(){
var Gb=(/([^:]*)(:[0-9]{0,5})?/).exec(document.location.host)[1];
var ac=/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/;
if(!ac.exec(Gb)){
var bc=(/([^\.]+\.[^\.]{3}|[^\.]+\.[^\.]+\.[^\.]{2})$/).exec(Gb);
if(bc){
Gb=bc[0];
}
}
return Gb?Gb:"";
};
mboxShiftArray=function(cc){
var db=new Array();
for(var j=1;j<cc.length;j++){
db[db.length]=cc[j];
}
return db;
};
mboxGenerateId=function(){
return (new Date()).getTime()+"-"+Math.floor(Math.random()*999999);
};
if(typeof mboxVersion=="undefined"){
var mboxVersion=32;
var mboxCookies=new mboxCookieManager("mbox",(function(){
return mboxCookiePageDomain();
})());
var mboxFactoryDefault=new mboxFactory("mbox5.offermatica.com","blockbuster");
}
mboxDisplayDebugInfo=function(){
mboxDebugger.show();
};
mboxCookieIsEnabled=function(){
mboxCookies.setCookie("check","true",60);
return mboxCookies.getCookie("check")=="true";
};
mboxDebug=function(dc,ec,fc){
this.gc=dc;
this.p=null;
var hc=mboxGetPageParameter(ec);
if(hc==null){
hc=mboxCookies.getCookie(this.gc);
}
if(hc!=null){
if(hc.indexOf("x")==0){
this.p=new mboxDebugActionNone();
document.write("<"+"scr"+"ipt language=\"Javascript1.2\" src="+"\"http://admin5.offermatica.com/admin/mbox/mbox_debug_"+hc+".jsp?mboxServerHost=mbox5.offermatica.com&clientCode=blockbuster&"+"session="+mboxCookies.getCookie("session")+"\"><"+"/scr"+"ipt>");
}else{
if(hc.indexOf("log")==0){
this.p=new mboxDebugActionLog(hc);
}else{
if(hc=="reset"){
hc=null;
}else{
this.p=new mboxDebugActionDefault();
}
}
}
}
if(this.p!=null){
if(fc.isSupported()){
fc.addOnLoad(mboxDisplayDebugInfo);
}else{
alert("mbox functionality is not supported on this browser");
this.disable();
}
}
if(hc!=null){
mboxCookies.setCookie(this.gc,hc,45*60);
}else{
this.disable();
}
};
mboxDebug.prototype.isEnabled=function(){
return this.p!=null;
};
mboxDebug.prototype.disable=function(){
mboxCookies.deleteCookie(this.gc);
};
mboxDebug.prototype.setShowAction=function(p){
this.p=p;
};
mboxDebug.prototype.show=function(){
if(this.p!=null){
this.p.show();
}
};
mboxDebugActionLog=function(hc){
this.hc=hc;
this.ic=(new Date()).getTime();
};
mboxDebugActionLog.prototype.show=function(){
var jc=(new Date()).getTime();
var kc=new mboxDebugWindow("Debug Log");
kc.putPageStart();
kc.put("<img sr"+"c='"+document.location.protocol+"//mbox5.offermatica.com/ima"+"ges/log.gif"+"?mboxDebug="+this.hc+"&mboxClient=blockbuster"+"&mboxPageLoadTime="+(jc-this.ic)+"'/>");
kc.put("<br />");
kc.putCloseButton();
kc.putPageEnd();
};
mboxDebugActionNone=function(){
};
mboxDebugActionNone.prototype.show=function(){
alert("Debug mode not defined"+"\n('x-mode' not supported when debug is remote in mbox.js)");
};
mboxDebugActionDefault=function(){
};
mboxDebugActionDefault.prototype.show=function(){
var _245=new mboxDebugWindow("Debug");
_245.putPageStart();
_245.put("  <b>Mbox Debug Window (version:"+mboxVersion+")</b></br>");
_245.put("<p/>");
_245.put("<b>Page</b>: "+document.location);
_245.put(" <ul>");
if(mboxFactoryDefault.isEnabled()){
_245.put("  <li>Enabled: true</li>");
}else{
_245.put("  <li>Enabled: <span style=\"color:red\"><b>false</b></span></li>");
}
_245.put("  <li>Cookies enabled: "+mboxCookieIsEnabled()+"</li>");
_245.put("  <li>Page URL: '"+document.location+"'</li>");
_245.put("  <li>Cookies: '"+document.cookie+"'</li>");
mboxFactoryDefault.getMboxes().each(function(K){
var R=K.getName();
_245.put("  <li>mbox: '"+R+"'");
_245.put("   <ul>");
if(K.message!=""){
_245.put("   <li><span style=\"color: red\"><b>Error: "+K.message+"</b></span></li>");
}
if(K.getDefaultDiv()==null){
_245.put("    <li><span style=\"color: red\">"+"<b>Error: cannot find mbox in dom</b></span></li>");
}
_245.put("    <li><a href=\""+K.getURL()+"\">"+K.getURL()+"</a></li>");
_245.put("   </ul>");
_245.put("  </li>");
});
_245.put(" </ul>");
_245.putCloseButton();
_245.putPageEnd();
};
mboxDebugWindow=function(g){
this.g=g+" "+document.location.hostname;
var lc=/\W/g;
var mc=this.g.replace(lc,"_");
this.kc=window.open("","mboxDebugWindow"+mc,"width=600,height=300,resizable,scrollbars=yes,toolbar=yes");
if(this.kc==null){
alert("Unable to open Omniture Test&amp;Target's mboxDebugWindow Window.\n"+"Are you blocking popups?\n");
}
};
mboxDebugWindow.prototype.put=function(oc){
if(this.kc==null){
return;
}
try{
this.kc.document.writeln(oc);
this.kc.scrollBy(0,1000);
}
catch(e){
alert("Unable to write to the current mboxDebug window.\n"+"Please close any open debug window");
this.kc=null;
}
};
mboxDebugWindow.prototype.putCloseButton=function(){
this.put("<a href=\"javascript:mboxDebugWindowClose()\">"+"click here to close debug window</a>");
};
mboxDebugWindow.prototype.putPageStart=function(){
this.put("<html><head>"+" <title>"+this.g+"</title>"+"  <"+"scr"+"ipt>"+"   function mboxDebugWindowClose() {"+"     try {"+"       window.opener.mboxDebugger.disable();"+"     } catch(e) {"+"       alert('Could not disable debug mode.\\n'"+"         + 'Browse to a page containing an mbox and\\n'"+"         + 'click on close link.');"+"     }"+"     window.close();"+"   }"+"  <"+"/scr"+"ipt>"+" </head>"+" <body>");
};
mboxDebugWindow.prototype.putPageEnd=function(){
this.put("</body></html>");
if(this.kc!=null){
this.kc.document.close();
}
};
if(typeof mboxDebugger=="undefined"){
mboxDebugger=new mboxDebug("debug","mboxDebug",mboxFactoryDefault);
}
var Rico={Version:"1.1.2",prototypeVersion:parseFloat(Prototype.Version.split(".")[0]+"."+Prototype.Version.split(".")[1])};
if((typeof Prototype=="undefined")||Rico.prototypeVersion<1.3){
throw ("Rico requires the Prototype JavaScript framework >= 1.3");
}
Rico.ArrayExtensions=new Array();
if(Object.prototype.extend){
Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Object.prototype.extend;
}else{
Object.prototype.extend=function(_24c){
return Object.extend.apply(this,[this,_24c]);
};
Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Object.prototype.extend;
}
if(Array.prototype.push){
Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Array.prototype.push;
}
if(!Array.prototype.remove){
Array.prototype.remove=function(dx){
if(isNaN(dx)||dx>this.length){
return false;
}
for(var i=0,n=0;i<this.length;i++){
if(i!=dx){
this[n++]=this[i];
}
}
this.length-=1;
};
Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Array.prototype.remove;
}
if(!Array.prototype.removeItem){
Array.prototype.removeItem=function(item){
for(var i=0;i<this.length;i++){
if(this[i]==item){
this.remove(i);
break;
}
}
};
Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Array.prototype.removeItem;
}
if(!Array.prototype.indices){
Array.prototype.indices=function(){
var _251=new Array();
for(index in this){
var _252=false;
for(var i=0;i<Rico.ArrayExtensions.length;i++){
if(this[index]==Rico.ArrayExtensions[i]){
_252=true;
break;
}
}
if(!_252){
_251[_251.length]=index;
}
}
return _251;
};
Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Array.prototype.indices;
}
if(window.DOMParser&&window.XMLSerializer&&window.Node&&Node.prototype&&Node.prototype.__defineGetter__){
if(!Document.prototype.loadXML){
Document.prototype.loadXML=function(s){
var doc2=(new DOMParser()).parseFromString(s,"text/xml");
while(this.hasChildNodes()){
this.removeChild(this.lastChild);
}
for(var i=0;i<doc2.childNodes.length;i++){
this.appendChild(this.importNode(doc2.childNodes[i],true));
}
};
}
Document.prototype.__defineGetter__("xml",function(){
return (new XMLSerializer()).serializeToString(this);
});
}
document.getElementsByTagAndClassName=function(_257,_258){
if(_257==null){
_257="*";
}
var _259=document.getElementsByTagName(_257)||document.all;
var _25a=new Array();
if(_258==null){
return _259;
}
for(var i=0;i<_259.length;i++){
var _25c=_259[i];
var _25d=_25c.className.split(" ");
for(var j=0;j<_25d.length;j++){
if(_25d[j]==_258){
_25a.push(_25c);
break;
}
}
}
return _25a;
};
Rico.Accordion=Class.create();
Rico.Accordion.prototype={initialize:function(_25f,_260){
this.container=$(_25f);
this.lastExpandedTab=null;
this.accordionTabs=new Array();
this.setOptions(_260);
this._attachBehaviors();
if(!_25f){
return;
}
this.container.style.borderBottom="1px solid "+this.options.borderColor;
if(this.options.onLoadShowTab>=this.accordionTabs.length){
this.options.onLoadShowTab=0;
}
for(var i=0;i<this.accordionTabs.length;i++){
if(i!=this.options.onLoadShowTab){
this.accordionTabs[i].collapse();
this.accordionTabs[i].content.style.display="none";
}
}
this.lastExpandedTab=this.accordionTabs[this.options.onLoadShowTab];
if(this.options.panelHeight=="auto"){
var _262=(this.options.onloadShowTab===0)?1:0;
var _263=parseInt(RicoUtil.getElementsComputedStyle(this.accordionTabs[_262].titleBar,"height"));
if(isNaN(_263)){
_263=this.accordionTabs[_262].titleBar.offsetHeight;
}
var _264=this.accordionTabs.length*_263;
var _265=parseInt(RicoUtil.getElementsComputedStyle(this.container.parentNode,"height"));
if(isNaN(_265)){
_265=this.container.parentNode.offsetHeight;
}
this.options.panelHeight=_265-_264-2;
}
this.lastExpandedTab.content.style.height=this.options.panelHeight+"px";
this.lastExpandedTab.showExpanded();
this.lastExpandedTab.titleBar.style.fontWeight=this.options.expandedFontWeight;
},setOptions:function(_266){
this.options={expandedBg:"#63699c",hoverBg:"#63699c",collapsedBg:"#6b79a5",expandedTextColor:"#ffffff",expandedFontWeight:"bold",hoverTextColor:"#ffffff",collapsedTextColor:"#ced7ef",collapsedFontWeight:"normal",hoverTextColor:"#ffffff",borderColor:"#1f669b",panelHeight:200,onHideTab:null,onShowTab:null,onLoadShowTab:0};
Object.extend(this.options,_266||{});
},showTabByIndex:function(_267,_268){
var _269=arguments.length==1?true:_268;
this.showTab(this.accordionTabs[_267],_269);
},showTab:function(_26a,_26b){
if(this.lastExpandedTab==_26a){
return;
}
var _26c=arguments.length==1?true:_26b;
if(this.options.onHideTab){
this.options.onHideTab(this.lastExpandedTab);
}
this.lastExpandedTab.showCollapsed();
var _26d=this;
var _26e=this.lastExpandedTab;
this.lastExpandedTab.content.style.height=(this.options.panelHeight-1)+"px";
_26a.content.style.display="";
_26a.titleBar.style.fontWeight=this.options.expandedFontWeight;
if(_26c){
new Rico.Effect.AccordionSize(this.lastExpandedTab.content,_26a.content,1,this.options.panelHeight,100,10,{complete:function(){
_26d.showTabDone(_26e);
}});
this.lastExpandedTab=_26a;
}else{
this.lastExpandedTab.content.style.height="1px";
_26a.content.style.height=this.options.panelHeight+"px";
this.lastExpandedTab=_26a;
this.showTabDone(_26e);
}
},showTabDone:function(_26f){
_26f.content.style.display="none";
this.lastExpandedTab.showExpanded();
if(this.options.onShowTab){
this.options.onShowTab(this.lastExpandedTab);
}
},_attachBehaviors:function(){
var _270=this._getDirectChildrenByTag(this.container,"DIV");
for(var i=0;i<_270.length;i++){
var _272=this._getDirectChildrenByTag(_270[i],"DIV");
if(_272.length!=2){
continue;
}
var _273=_272[0];
var _274=_272[1];
this.accordionTabs.push(new Rico.Accordion.Tab(this,_273,_274));
}
},_getDirectChildrenByTag:function(e,_276){
var kids=new Array();
var _278=e.childNodes;
for(var i=0;i<_278.length;i++){
if(_278[i]&&_278[i].tagName&&_278[i].tagName==_276){
kids.push(_278[i]);
}
}
return kids;
}};
Rico.Accordion.Tab=Class.create();
Rico.Accordion.Tab.prototype={initialize:function(_27a,_27b,_27c){
this.accordion=_27a;
this.titleBar=_27b;
this.content=_27c;
this._attachBehaviors();
},collapse:function(){
this.showCollapsed();
this.content.style.height="1px";
},showCollapsed:function(){
this.expanded=false;
this.titleBar.style.backgroundColor=this.accordion.options.collapsedBg;
this.titleBar.style.color=this.accordion.options.collapsedTextColor;
this.titleBar.style.fontWeight=this.accordion.options.collapsedFontWeight;
this.content.style.overflow="hidden";
},showExpanded:function(){
this.expanded=true;
this.titleBar.style.backgroundColor=this.accordion.options.expandedBg;
this.titleBar.style.color=this.accordion.options.expandedTextColor;
this.content.style.overflow="auto";
},titleBarClicked:function(e){
if(this.accordion.lastExpandedTab==this){
return;
}
this.accordion.showTab(this);
},hover:function(e){
this.titleBar.style.backgroundColor=this.accordion.options.hoverBg;
this.titleBar.style.color=this.accordion.options.hoverTextColor;
},unhover:function(e){
if(this.expanded){
this.titleBar.style.backgroundColor=this.accordion.options.expandedBg;
this.titleBar.style.color=this.accordion.options.expandedTextColor;
}else{
this.titleBar.style.backgroundColor=this.accordion.options.collapsedBg;
this.titleBar.style.color=this.accordion.options.collapsedTextColor;
}
},_attachBehaviors:function(){
this.content.style.border="1px solid "+this.accordion.options.borderColor;
this.content.style.borderTopWidth="0px";
this.content.style.borderBottomWidth="0px";
this.content.style.margin="0px";
this.titleBar.onclick=this.titleBarClicked.bindAsEventListener(this);
this.titleBar.onmouseover=this.hover.bindAsEventListener(this);
this.titleBar.onmouseout=this.unhover.bindAsEventListener(this);
}};
Rico.AjaxEngine=Class.create();
Rico.AjaxEngine.prototype={initialize:function(){
this.ajaxElements=new Array();
this.ajaxObjects=new Array();
this.requestURLS=new Array();
this.options={};
},registerAjaxElement:function(anId,_281){
if(!_281){
_281=$(anId);
}
this.ajaxElements[anId]=_281;
},registerAjaxObject:function(anId,_283){
this.ajaxObjects[anId]=_283;
},registerRequest:function(_284,_285){
this.requestURLS[_284]=_285;
},sendRequest:function(_286,_287){
if(arguments.length>=2){
if(typeof arguments[1]=="string"){
_287={parameters:this._createQueryString(arguments,1)};
}
}
this.sendRequestWithData(_286,null,_287);
},sendRequestWithData:function(_288,_289,_28a){
var _28b=this.requestURLS[_288];
if(_28b==null){
return;
}
if(arguments.length>=3){
if(typeof arguments[2]=="string"){
_28a.parameters=this._createQueryString(arguments,2);
}
}
new Ajax.Request(_28b,this._requestOptions(_28a,_289));
},sendRequestAndUpdate:function(_28c,_28d,_28e){
if(arguments.length>=3){
if(typeof arguments[2]=="string"){
_28e.parameters=this._createQueryString(arguments,2);
}
}
this.sendRequestWithDataAndUpdate(_28c,null,_28d,_28e);
},sendRequestWithDataAndUpdate:function(_28f,_290,_291,_292){
var _293=this.requestURLS[_28f];
if(_293==null){
return;
}
if(arguments.length>=4){
if(typeof arguments[3]=="string"){
_292.parameters=this._createQueryString(arguments,3);
}
}
var _294=this._requestOptions(_292,_290);
new Ajax.Updater(_291,_293,_294);
},_requestOptions:function(_295,_296){
var _297=["X-Rico-Version",Rico.Version];
var _298="post";
if(_296==null){
if(Rico.prototypeVersion<1.4){
_297.push("Content-type","text/xml");
}else{
_298="get";
}
}
(!_295)?_295={}:"";
if(!_295._RicoOptionsProcessed){
if(_295.onComplete){
_295.onRicoComplete=_295.onComplete;
}
if(_295.overrideOnComplete){
_295.onComplete=_295.overrideOnComplete;
}else{
_295.onComplete=this._onRequestComplete.bind(this);
}
_295._RicoOptionsProcessed=true;
}
this.options={requestHeaders:_297,parameters:_295.parameters,postBody:_296,method:_298,onComplete:_295.onComplete};
Object.extend(this.options,_295);
return this.options;
},_createQueryString:function(_299,_29a){
var _29b="";
for(var i=_29a;i<_299.length;i++){
if(i!=_29a){
_29b+="&";
}
var _29d=_299[i];
if(_29d.name!=undefined&&_29d.value!=undefined){
_29b+=_29d.name+"="+escape(_29d.value);
}else{
var ePos=_29d.indexOf("=");
var _29f=_29d.substring(0,ePos);
var _2a0=_29d.substring(ePos+1);
_29b+=_29f+"="+escape(_2a0);
}
}
return _29b;
},_onRequestComplete:function(_2a1){
if(!_2a1){
return;
}
if(_2a1.status!=200){
return;
}
var _2a2=_2a1.responseXML.getElementsByTagName("ajax-response");
if(_2a2==null||_2a2.length!=1){
return;
}
this._processAjaxResponse(_2a2[0].childNodes);
var _2a3=this.options.onRicoComplete;
if(_2a3!=null){
_2a3();
}
},_processAjaxResponse:function(_2a4){
for(var i=0;i<_2a4.length;i++){
var _2a6=_2a4[i];
if(_2a6.nodeType!=1){
continue;
}
var _2a7=_2a6.getAttribute("type");
var _2a8=_2a6.getAttribute("id");
if(_2a7=="object"){
this._processAjaxObjectUpdate(this.ajaxObjects[_2a8],_2a6);
}else{
if(_2a7=="element"){
this._processAjaxElementUpdate(this.ajaxElements[_2a8],_2a6);
}else{
alert("unrecognized AjaxResponse type : "+_2a7);
}
}
}
},_processAjaxObjectUpdate:function(_2a9,_2aa){
_2a9.ajaxUpdate(_2aa);
},_processAjaxElementUpdate:function(_2ab,_2ac){
_2ab.innerHTML=RicoUtil.getContentAsString(_2ac);
}};
var ajaxEngine=new Rico.AjaxEngine();
Rico.Color=Class.create();
Rico.Color.prototype={initialize:function(red,_2ae,blue){
this.rgb={r:red,g:_2ae,b:blue};
},setRed:function(r){
this.rgb.r=r;
},setGreen:function(g){
this.rgb.g=g;
},setBlue:function(b){
this.rgb.b=b;
},setHue:function(h){
var hsb=this.asHSB();
hsb.h=h;
this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);
},setSaturation:function(s){
var hsb=this.asHSB();
hsb.s=s;
this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);
},setBrightness:function(b){
var hsb=this.asHSB();
hsb.b=b;
this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);
},darken:function(_2b9){
var hsb=this.asHSB();
this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,Math.max(hsb.b-_2b9,0));
},brighten:function(_2bb){
var hsb=this.asHSB();
this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,Math.min(hsb.b+_2bb,1));
},blend:function(_2bd){
this.rgb.r=Math.floor((this.rgb.r+_2bd.rgb.r)/2);
this.rgb.g=Math.floor((this.rgb.g+_2bd.rgb.g)/2);
this.rgb.b=Math.floor((this.rgb.b+_2bd.rgb.b)/2);
},isBright:function(){
var hsb=this.asHSB();
return this.asHSB().b>0.5;
},isDark:function(){
return !this.isBright();
},asRGB:function(){
return "rgb("+this.rgb.r+","+this.rgb.g+","+this.rgb.b+")";
},asHex:function(){
return "#"+this.rgb.r.toColorPart()+this.rgb.g.toColorPart()+this.rgb.b.toColorPart();
},asHSB:function(){
return Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b);
},toString:function(){
return this.asHex();
}};
Rico.Color.createFromHex=function(_2bf){
if(_2bf.length==4){
var _2c0=_2bf;
var _2bf="#";
for(var i=1;i<4;i++){
_2bf+=(_2c0.charAt(i)+_2c0.charAt(i));
}
}
if(_2bf.indexOf("#")==0){
_2bf=_2bf.substring(1);
}
var red=_2bf.substring(0,2);
var _2c3=_2bf.substring(2,4);
var blue=_2bf.substring(4,6);
return new Rico.Color(parseInt(red,16),parseInt(_2c3,16),parseInt(blue,16));
};
Rico.Color.createColorFromBackground=function(elem){
var _2c6=RicoUtil.getElementsComputedStyle($(elem),"backgroundColor","background-color");
if(_2c6=="transparent"&&elem.parentNode){
return Rico.Color.createColorFromBackground(elem.parentNode);
}
if(_2c6==null){
return new Rico.Color(255,255,255);
}
if(_2c6.indexOf("rgb(")==0){
var _2c7=_2c6.substring(4,_2c6.length-1);
var _2c8=_2c7.split(",");
return new Rico.Color(parseInt(_2c8[0]),parseInt(_2c8[1]),parseInt(_2c8[2]));
}else{
if(_2c6.indexOf("#")==0){
return Rico.Color.createFromHex(_2c6);
}else{
return new Rico.Color(255,255,255);
}
}
};
Rico.Color.HSBtoRGB=function(hue,_2ca,_2cb){
var red=0;
var _2cd=0;
var blue=0;
if(_2ca==0){
red=parseInt(_2cb*255+0.5);
_2cd=red;
blue=red;
}else{
var h=(hue-Math.floor(hue))*6;
var f=h-Math.floor(h);
var p=_2cb*(1-_2ca);
var q=_2cb*(1-_2ca*f);
var t=_2cb*(1-(_2ca*(1-f)));
switch(parseInt(h)){
case 0:
red=(_2cb*255+0.5);
_2cd=(t*255+0.5);
blue=(p*255+0.5);
break;
case 1:
red=(q*255+0.5);
_2cd=(_2cb*255+0.5);
blue=(p*255+0.5);
break;
case 2:
red=(p*255+0.5);
_2cd=(_2cb*255+0.5);
blue=(t*255+0.5);
break;
case 3:
red=(p*255+0.5);
_2cd=(q*255+0.5);
blue=(_2cb*255+0.5);
break;
case 4:
red=(t*255+0.5);
_2cd=(p*255+0.5);
blue=(_2cb*255+0.5);
break;
case 5:
red=(_2cb*255+0.5);
_2cd=(p*255+0.5);
blue=(q*255+0.5);
break;
}
}
return {r:parseInt(red),g:parseInt(_2cd),b:parseInt(blue)};
};
Rico.Color.RGBtoHSB=function(r,g,b){
var hue;
var _2d8;
var _2d9;
var cmax=(r>g)?r:g;
if(b>cmax){
cmax=b;
}
var cmin=(r<g)?r:g;
if(b<cmin){
cmin=b;
}
_2d9=cmax/255;
if(cmax!=0){
_2d8=(cmax-cmin)/cmax;
}else{
_2d8=0;
}
if(_2d8==0){
hue=0;
}else{
var redc=(cmax-r)/(cmax-cmin);
var _2dd=(cmax-g)/(cmax-cmin);
var _2de=(cmax-b)/(cmax-cmin);
if(r==cmax){
hue=_2de-_2dd;
}else{
if(g==cmax){
hue=2+redc-_2de;
}else{
hue=4+_2dd-redc;
}
}
hue=hue/6;
if(hue<0){
hue=hue+1;
}
}
return {h:hue,s:_2d8,b:_2d9};
};
Rico.Corner={round:function(e,_2e0){
var e=$(e);
this._setOptions(_2e0);
var _2e1=this.options.color;
if(this.options.color=="fromElement"){
_2e1=this._background(e);
}
var _2e2=this.options.bgColor;
if(this.options.bgColor=="fromParent"){
_2e2=this._background(e.offsetParent);
}
this._roundCornersImpl(e,_2e1,_2e2);
},_roundCornersImpl:function(e,_2e4,_2e5){
if(this.options.border){
this._renderBorder(e,_2e5);
}
if(this._isTopRounded()){
this._roundTopCorners(e,_2e4,_2e5);
}
if(this._isBottomRounded()){
this._roundBottomCorners(e,_2e4,_2e5);
}
},_renderBorder:function(el,_2e7){
var _2e8="1px solid "+this._borderColor(_2e7);
var _2e9="border-left: "+_2e8;
var _2ea="border-right: "+_2e8;
var _2eb="style='"+_2e9+";"+_2ea+"'";
el.innerHTML="<div "+_2eb+">"+el.innerHTML+"</div>";
},_roundTopCorners:function(el,_2ed,_2ee){
var _2ef=this._createCorner(_2ee);
for(var i=0;i<this.options.numSlices;i++){
_2ef.appendChild(this._createCornerSlice(_2ed,_2ee,i,"top"));
}
el.style.paddingTop=0;
el.insertBefore(_2ef,el.firstChild);
},_roundBottomCorners:function(el,_2f2,_2f3){
var _2f4=this._createCorner(_2f3);
for(var i=(this.options.numSlices-1);i>=0;i--){
_2f4.appendChild(this._createCornerSlice(_2f2,_2f3,i,"bottom"));
}
el.style.paddingBottom=0;
el.appendChild(_2f4);
},_createCorner:function(_2f6){
var _2f7=document.createElement("div");
_2f7.style.backgroundColor=(this._isTransparent()?"transparent":_2f6);
return _2f7;
},_createCornerSlice:function(_2f8,_2f9,n,_2fb){
var _2fc=document.createElement("span");
var _2fd=_2fc.style;
_2fd.backgroundColor=_2f8;
_2fd.display="block";
_2fd.height="1px";
_2fd.overflow="hidden";
_2fd.fontSize="1px";
var _2fe=this._borderColor(_2f8,_2f9);
if(this.options.border&&n==0){
_2fd.borderTopStyle="solid";
_2fd.borderTopWidth="1px";
_2fd.borderLeftWidth="0px";
_2fd.borderRightWidth="0px";
_2fd.borderBottomWidth="0px";
_2fd.height="0px";
_2fd.borderColor=_2fe;
}else{
if(_2fe){
_2fd.borderColor=_2fe;
_2fd.borderStyle="solid";
_2fd.borderWidth="0px 1px";
}
}
if(!this.options.compact&&(n==(this.options.numSlices-1))){
_2fd.height="2px";
}
this._setMargin(_2fc,n,_2fb);
this._setBorder(_2fc,n,_2fb);
return _2fc;
},_setOptions:function(_2ff){
this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false};
Object.extend(this.options,_2ff||{});
this.options.numSlices=this.options.compact?2:4;
if(this._isTransparent()){
this.options.blend=false;
}
},_whichSideTop:function(){
if(this._hasString(this.options.corners,"all","top")){
return "";
}
if(this.options.corners.indexOf("tl")>=0&&this.options.corners.indexOf("tr")>=0){
return "";
}
if(this.options.corners.indexOf("tl")>=0){
return "left";
}else{
if(this.options.corners.indexOf("tr")>=0){
return "right";
}
}
return "";
},_whichSideBottom:function(){
if(this._hasString(this.options.corners,"all","bottom")){
return "";
}
if(this.options.corners.indexOf("bl")>=0&&this.options.corners.indexOf("br")>=0){
return "";
}
if(this.options.corners.indexOf("bl")>=0){
return "left";
}else{
if(this.options.corners.indexOf("br")>=0){
return "right";
}
}
return "";
},_borderColor:function(_300,_301){
if(_300=="transparent"){
return _301;
}else{
if(this.options.border){
return this.options.border;
}else{
if(this.options.blend){
return this._blend(_301,_300);
}else{
return "";
}
}
}
},_setMargin:function(el,n,_304){
var _305=this._marginSize(n);
var _306=_304=="top"?this._whichSideTop():this._whichSideBottom();
if(_306=="left"){
el.style.marginLeft=_305+"px";
el.style.marginRight="0px";
}else{
if(_306=="right"){
el.style.marginRight=_305+"px";
el.style.marginLeft="0px";
}else{
el.style.marginLeft=_305+"px";
el.style.marginRight=_305+"px";
}
}
},_setBorder:function(el,n,_309){
var _30a=this._borderSize(n);
var _30b=_309=="top"?this._whichSideTop():this._whichSideBottom();
if(_30b=="left"){
el.style.borderLeftWidth=_30a+"px";
el.style.borderRightWidth="0px";
}else{
if(_30b=="right"){
el.style.borderRightWidth=_30a+"px";
el.style.borderLeftWidth="0px";
}else{
el.style.borderLeftWidth=_30a+"px";
el.style.borderRightWidth=_30a+"px";
}
}
if(this.options.border!=false){
el.style.borderLeftWidth=_30a+"px";
}
el.style.borderRightWidth=_30a+"px";
},_marginSize:function(n){
if(this._isTransparent()){
return 0;
}
var _30d=[5,3,2,1];
var _30e=[3,2,1,0];
var _30f=[2,1];
var _310=[1,0];
if(this.options.compact&&this.options.blend){
return _310[n];
}else{
if(this.options.compact){
return _30f[n];
}else{
if(this.options.blend){
return _30e[n];
}else{
return _30d[n];
}
}
}
},_borderSize:function(n){
var _312=[5,3,2,1];
var _313=[2,1,1,1];
var _314=[1,0];
var _315=[0,2,0,0];
if(this.options.compact&&(this.options.blend||this._isTransparent())){
return 1;
}else{
if(this.options.compact){
return _314[n];
}else{
if(this.options.blend){
return _313[n];
}else{
if(this.options.border){
return _315[n];
}else{
if(this._isTransparent()){
return _312[n];
}
}
}
}
}
return 0;
},_hasString:function(str){
for(var i=1;i<arguments.length;i++){
if(str.indexOf(arguments[i])>=0){
return true;
}
}
return false;
},_blend:function(c1,c2){
var cc1=Rico.Color.createFromHex(c1);
cc1.blend(Rico.Color.createFromHex(c2));
return cc1;
},_background:function(el){
try{
return Rico.Color.createColorFromBackground(el).asHex();
}
catch(err){
return "#ffffff";
}
},_isTransparent:function(){
return this.options.color=="transparent";
},_isTopRounded:function(){
return this._hasString(this.options.corners,"all","top","tl","tr");
},_isBottomRounded:function(){
return this._hasString(this.options.corners,"all","bottom","bl","br");
},_hasSingleTextChild:function(el){
return el.childNodes.length==1&&el.childNodes[0].nodeType==3;
}};
Rico.DragAndDrop=Class.create();
Rico.DragAndDrop.prototype={initialize:function(){
this.dropZones=new Array();
this.draggables=new Array();
this.currentDragObjects=new Array();
this.dragElement=null;
this.lastSelectedDraggable=null;
this.currentDragObjectVisible=false;
this.interestedInMotionEvents=false;
this._mouseDown=this._mouseDownHandler.bindAsEventListener(this);
this._mouseMove=this._mouseMoveHandler.bindAsEventListener(this);
this._mouseUp=this._mouseUpHandler.bindAsEventListener(this);
},registerDropZone:function(_31d){
this.dropZones[this.dropZones.length]=_31d;
},deregisterDropZone:function(_31e){
var _31f=new Array();
var j=0;
for(var i=0;i<this.dropZones.length;i++){
if(this.dropZones[i]!=_31e){
_31f[j++]=this.dropZones[i];
}
}
this.dropZones=_31f;
},clearDropZones:function(){
this.dropZones=new Array();
},registerDraggable:function(_322){
this.draggables[this.draggables.length]=_322;
this._addMouseDownHandler(_322);
},clearSelection:function(){
for(var i=0;i<this.currentDragObjects.length;i++){
this.currentDragObjects[i].deselect();
}
this.currentDragObjects=new Array();
this.lastSelectedDraggable=null;
},hasSelection:function(){
return this.currentDragObjects.length>0;
},setStartDragFromElement:function(e,_325){
this.origPos=RicoUtil.toDocumentPosition(_325);
this.startx=e.screenX-this.origPos.x;
this.starty=e.screenY-this.origPos.y;
this.interestedInMotionEvents=this.hasSelection();
this._terminateEvent(e);
},updateSelection:function(_326,_327){
if(!_327){
this.clearSelection();
}
if(_326.isSelected()){
this.currentDragObjects.removeItem(_326);
_326.deselect();
if(_326==this.lastSelectedDraggable){
this.lastSelectedDraggable=null;
}
}else{
this.currentDragObjects[this.currentDragObjects.length]=_326;
_326.select();
this.lastSelectedDraggable=_326;
}
},_mouseDownHandler:function(e){
if(arguments.length==0){
e=event;
}
var _329=e.which!=undefined;
if((_329&&e.which!=1)||(!_329&&e.button!=1)){
return;
}
var _32a=e.target?e.target:e.srcElement;
var _32b=_32a.draggable;
var _32c=_32a;
while(_32b==null&&_32c.parentNode){
_32c=_32c.parentNode;
_32b=_32c.draggable;
}
if(_32b==null){
return;
}
this.updateSelection(_32b,e.ctrlKey);
if(this.hasSelection()){
for(var i=0;i<this.dropZones.length;i++){
this.dropZones[i].clearPositionCache();
}
}
this.setStartDragFromElement(e,_32b.getMouseDownHTMLElement());
},_mouseMoveHandler:function(e){
var _32f=e.which!=undefined;
if(!this.interestedInMotionEvents){
return;
}
if(!this.hasSelection()){
return;
}
if(!this.currentDragObjectVisible){
this._startDrag(e);
}
if(!this.activatedDropZones){
this._activateRegisteredDropZones();
}
this._updateDraggableLocation(e);
this._updateDropZonesHover(e);
this._terminateEvent(e);
},_makeDraggableObjectVisible:function(e){
if(!this.hasSelection()){
return;
}
var _331;
if(this.currentDragObjects.length>1){
_331=this.currentDragObjects[0].getMultiObjectDragGUI(this.currentDragObjects);
}else{
_331=this.currentDragObjects[0].getSingleObjectDragGUI();
}
if(RicoUtil.getElementsComputedStyle(_331,"position")!="absolute"){
_331.style.position="absolute";
}
if(_331.parentNode==null||_331.parentNode.nodeType==11){
document.body.appendChild(_331);
}
this.dragElement=_331;
this._updateDraggableLocation(e);
this.currentDragObjectVisible=true;
},_leftOffset:function(e){
return e.offsetX?document.body.scrollLeft:0;
},_topOffset:function(e){
return e.offsetY?document.body.scrollTop:0;
},_updateDraggableLocation:function(e){
var _335=this.dragElement.style;
_335.left=(e.screenX+this._leftOffset(e)-this.startx)+"px";
_335.top=(e.screenY+this._topOffset(e)-this.starty)+"px";
},_updateDropZonesHover:function(e){
var n=this.dropZones.length;
for(var i=0;i<n;i++){
if(!this._mousePointInDropZone(e,this.dropZones[i])){
this.dropZones[i].hideHover();
}
}
for(var i=0;i<n;i++){
if(this._mousePointInDropZone(e,this.dropZones[i])){
if(this.dropZones[i].canAccept(this.currentDragObjects)){
this.dropZones[i].showHover();
}
}
}
},_startDrag:function(e){
for(var i=0;i<this.currentDragObjects.length;i++){
this.currentDragObjects[i].startDrag();
}
this._makeDraggableObjectVisible(e);
},_mouseUpHandler:function(e){
if(!this.hasSelection()){
return;
}
var _33c=e.which!=undefined;
if((_33c&&e.which!=1)||(!_33c&&e.button!=1)){
return;
}
this.interestedInMotionEvents=false;
if(this.dragElement==null){
this._terminateEvent(e);
return;
}
if(this._placeDraggableInDropZone(e)){
this._completeDropOperation(e);
}else{
this._terminateEvent(e);
new Rico.Effect.Position(this.dragElement,this.origPos.x,this.origPos.y,200,20,{complete:this._doCancelDragProcessing.bind(this)});
}
Event.stopObserving(document.body,"mousemove",this._mouseMove);
Event.stopObserving(document.body,"mouseup",this._mouseUp);
},_retTrue:function(){
return true;
},_completeDropOperation:function(e){
if(this.dragElement!=this.currentDragObjects[0].getMouseDownHTMLElement()){
if(this.dragElement.parentNode!=null){
this.dragElement.parentNode.removeChild(this.dragElement);
}
}
this._deactivateRegisteredDropZones();
this._endDrag();
this.clearSelection();
this.dragElement=null;
this.currentDragObjectVisible=false;
this._terminateEvent(e);
},_doCancelDragProcessing:function(){
this._cancelDrag();
if(this.dragElement!=this.currentDragObjects[0].getMouseDownHTMLElement()&&this.dragElement){
if(this.dragElement.parentNode!=null){
this.dragElement.parentNode.removeChild(this.dragElement);
}
}
this._deactivateRegisteredDropZones();
this.dragElement=null;
this.currentDragObjectVisible=false;
},_placeDraggableInDropZone:function(e){
var _33f=false;
var n=this.dropZones.length;
for(var i=0;i<n;i++){
if(this._mousePointInDropZone(e,this.dropZones[i])){
if(this.dropZones[i].canAccept(this.currentDragObjects)){
this.dropZones[i].hideHover();
this.dropZones[i].accept(this.currentDragObjects);
_33f=true;
break;
}
}
}
return _33f;
},_cancelDrag:function(){
for(var i=0;i<this.currentDragObjects.length;i++){
this.currentDragObjects[i].cancelDrag();
}
},_endDrag:function(){
for(var i=0;i<this.currentDragObjects.length;i++){
this.currentDragObjects[i].endDrag();
}
},_mousePointInDropZone:function(e,_345){
var _346=_345.getAbsoluteRect();
return e.clientX>_346.left+this._leftOffset(e)&&e.clientX<_346.right+this._leftOffset(e)&&e.clientY>_346.top+this._topOffset(e)&&e.clientY<_346.bottom+this._topOffset(e);
},_addMouseDownHandler:function(_347){
htmlElement=_347.getMouseDownHTMLElement();
if(htmlElement!=null){
htmlElement.draggable=_347;
Event.observe(htmlElement,"mousedown",this._onmousedown.bindAsEventListener(this));
Event.observe(htmlElement,"mousedown",this._mouseDown);
}
},_activateRegisteredDropZones:function(){
var n=this.dropZones.length;
for(var i=0;i<n;i++){
var _34a=this.dropZones[i];
if(_34a.canAccept(this.currentDragObjects)){
_34a.activate();
}
}
this.activatedDropZones=true;
},_deactivateRegisteredDropZones:function(){
var n=this.dropZones.length;
for(var i=0;i<n;i++){
this.dropZones[i].deactivate();
}
this.activatedDropZones=false;
},_onmousedown:function(){
Event.observe(document.body,"mousemove",this._mouseMove);
Event.observe(document.body,"mouseup",this._mouseUp);
},_terminateEvent:function(e){
if(e.stopPropagation!=undefined){
e.stopPropagation();
}else{
if(e.cancelBubble!=undefined){
e.cancelBubble=true;
}
}
if(e.preventDefault!=undefined){
e.preventDefault();
}else{
e.returnValue=false;
}
},initializeEventHandlers:function(){
if(typeof document.implementation!="undefined"&&document.implementation.hasFeature("HTML","1.0")&&document.implementation.hasFeature("Events","2.0")&&document.implementation.hasFeature("CSS","2.0")){
document.addEventListener("mouseup",this._mouseUpHandler.bindAsEventListener(this),false);
document.addEventListener("mousemove",this._mouseMoveHandler.bindAsEventListener(this),false);
}else{
document.attachEvent("onmouseup",this._mouseUpHandler.bindAsEventListener(this));
document.attachEvent("onmousemove",this._mouseMoveHandler.bindAsEventListener(this));
}
}};
var dndMgr=new Rico.DragAndDrop();
dndMgr.initializeEventHandlers();
Rico.Draggable=Class.create();
Rico.Draggable.prototype={initialize:function(type,_34f){
this.type=type;
this.htmlElement=$(_34f);
this.selected=false;
},getMouseDownHTMLElement:function(){
return this.htmlElement;
},select:function(){
this.selected=true;
if(this.showingSelected){
return;
}
var _350=this.getMouseDownHTMLElement();
var _351=Rico.Color.createColorFromBackground(_350);
_351.isBright()?_351.darken(0.033):_351.brighten(0.033);
this.saveBackground=RicoUtil.getElementsComputedStyle(_350,"backgroundColor","background-color");
_350.style.backgroundColor=_351.asHex();
this.showingSelected=true;
},deselect:function(){
this.selected=false;
if(!this.showingSelected){
return;
}
var _352=this.getMouseDownHTMLElement();
_352.style.backgroundColor=this.saveBackground;
this.showingSelected=false;
},isSelected:function(){
return this.selected;
},startDrag:function(){
},cancelDrag:function(){
},endDrag:function(){
},getSingleObjectDragGUI:function(){
return this.htmlElement;
},getMultiObjectDragGUI:function(_353){
return this.htmlElement;
},getDroppedGUI:function(){
return this.htmlElement;
},toString:function(){
return this.type+":"+this.htmlElement+":";
}};
Rico.Dropzone=Class.create();
Rico.Dropzone.prototype={initialize:function(_354){
this.htmlElement=$(_354);
this.absoluteRect=null;
},getHTMLElement:function(){
return this.htmlElement;
},clearPositionCache:function(){
this.absoluteRect=null;
},getAbsoluteRect:function(){
if(this.absoluteRect==null){
var _355=this.getHTMLElement();
var pos=RicoUtil.toViewportPosition(_355);
this.absoluteRect={top:pos.y,left:pos.x,bottom:pos.y+_355.offsetHeight,right:pos.x+_355.offsetWidth};
}
return this.absoluteRect;
},activate:function(){
var _357=this.getHTMLElement();
if(_357==null||this.showingActive){
return;
}
this.showingActive=true;
this.saveBackgroundColor=_357.style.backgroundColor;
var _358="#ffea84";
var _359=Rico.Color.createColorFromBackground(_357);
if(_359==null){
_357.style.backgroundColor=_358;
}else{
_359.isBright()?_359.darken(0.2):_359.brighten(0.2);
_357.style.backgroundColor=_359.asHex();
}
},deactivate:function(){
var _35a=this.getHTMLElement();
if(_35a==null||!this.showingActive){
return;
}
_35a.style.backgroundColor=this.saveBackgroundColor;
this.showingActive=false;
this.saveBackgroundColor=null;
},showHover:function(){
var _35b=this.getHTMLElement();
if(_35b==null||this.showingHover){
return;
}
this.saveBorderWidth=_35b.style.borderWidth;
this.saveBorderStyle=_35b.style.borderStyle;
this.saveBorderColor=_35b.style.borderColor;
this.showingHover=true;
_35b.style.borderWidth="1px";
_35b.style.borderStyle="solid";
_35b.style.borderColor="#ffff00";
},hideHover:function(){
var _35c=this.getHTMLElement();
if(_35c==null||!this.showingHover){
return;
}
_35c.style.borderWidth=this.saveBorderWidth;
_35c.style.borderStyle=this.saveBorderStyle;
_35c.style.borderColor=this.saveBorderColor;
this.showingHover=false;
},canAccept:function(_35d){
return true;
},accept:function(_35e){
var _35f=this.getHTMLElement();
if(_35f==null){
return;
}
n=_35e.length;
for(var i=0;i<n;i++){
var _361=_35e[i].getDroppedGUI();
if(RicoUtil.getElementsComputedStyle(_361,"position")=="absolute"){
_361.style.position="static";
_361.style.top="";
_361.style.top="";
}
_35f.appendChild(_361);
}
}};
Rico.Effect={};
Rico.Effect.SizeAndPosition=Class.create();
Rico.Effect.SizeAndPosition.prototype={initialize:function(_362,x,y,w,h,_367,_368,_369){
this.element=$(_362);
this.x=x;
this.y=y;
this.w=w;
this.h=h;
this.duration=_367;
this.steps=_368;
this.options=arguments[7]||{};
this.sizeAndPosition();
},sizeAndPosition:function(){
if(this.isFinished()){
if(this.options.complete){
this.options.complete(this);
}
return;
}
if(this.timer){
clearTimeout(this.timer);
}
var _36a=Math.round(this.duration/this.steps);
var _36b=this.element.offsetLeft;
var _36c=this.element.offsetTop;
var _36d=this.element.offsetWidth;
var _36e=this.element.offsetHeight;
this.x=(this.x)?this.x:_36b;
this.y=(this.y)?this.y:_36c;
this.w=(this.w)?this.w:_36d;
this.h=(this.h)?this.h:_36e;
var difX=this.steps>0?(this.x-_36b)/this.steps:0;
var difY=this.steps>0?(this.y-_36c)/this.steps:0;
var difW=this.steps>0?(this.w-_36d)/this.steps:0;
var difH=this.steps>0?(this.h-_36e)/this.steps:0;
this.moveBy(difX,difY);
this.resizeBy(difW,difH);
this.duration-=_36a;
this.steps--;
this.timer=setTimeout(this.sizeAndPosition.bind(this),_36a);
},isFinished:function(){
return this.steps<=0;
},moveBy:function(difX,difY){
var _375=this.element.offsetLeft;
var _376=this.element.offsetTop;
var _377=parseInt(difX);
var _378=parseInt(difY);
var _379=this.element.style;
if(_377!=0){
_379.left=(_375+_377)+"px";
}
if(_378!=0){
_379.top=(_376+_378)+"px";
}
},resizeBy:function(difW,difH){
var _37c=this.element.offsetWidth;
var _37d=this.element.offsetHeight;
var _37e=parseInt(difW);
var _37f=parseInt(difH);
var _380=this.element.style;
if(_37e!=0){
_380.width=(_37c+_37e)+"px";
}
if(_37f!=0){
_380.height=(_37d+_37f)+"px";
}
}};
Rico.Effect.Size=Class.create();
Rico.Effect.Size.prototype={initialize:function(_381,w,h,_384,_385,_386){
new Rico.Effect.SizeAndPosition(_381,null,null,w,h,_384,_385,_386);
}};
Rico.Effect.Position=Class.create();
Rico.Effect.Position.prototype={initialize:function(_387,x,y,_38a,_38b,_38c){
new Rico.Effect.SizeAndPosition(_387,x,y,null,null,_38a,_38b,_38c);
}};
Rico.Effect.Round=Class.create();
Rico.Effect.Round.prototype={initialize:function(_38d,_38e,_38f){
var _390=document.getElementsByTagAndClassName(_38d,_38e);
for(var i=0;i<_390.length;i++){
Rico.Corner.round(_390[i],_38f);
}
}};
Rico.Effect.FadeTo=Class.create();
Rico.Effect.FadeTo.prototype={initialize:function(_392,_393,_394,_395,_396){
this.element=$(_392);
this.opacity=_393;
this.duration=_394;
this.steps=_395;
this.options=arguments[4]||{};
this.fadeTo();
},fadeTo:function(){
if(this.isFinished()){
if(this.options.complete){
this.options.complete(this);
}
return;
}
if(this.timer){
clearTimeout(this.timer);
}
var _397=Math.round(this.duration/this.steps);
var _398=this.getElementOpacity();
var _399=this.steps>0?(this.opacity-_398)/this.steps:0;
this.changeOpacityBy(_399);
this.duration-=_397;
this.steps--;
this.timer=setTimeout(this.fadeTo.bind(this),_397);
},changeOpacityBy:function(v){
var _39b=this.getElementOpacity();
var _39c=Math.max(0,Math.min(_39b+v,1));
this.element.ricoOpacity=_39c;
this.element.style.filter="alpha(opacity:"+Math.round(_39c*100)+")";
this.element.style.opacity=_39c;
},isFinished:function(){
return this.steps<=0;
},getElementOpacity:function(){
if(this.element.ricoOpacity==undefined){
var _39d=RicoUtil.getElementsComputedStyle(this.element,"opacity");
this.element.ricoOpacity=_39d!=undefined?_39d:1;
}
return parseFloat(this.element.ricoOpacity);
}};
Rico.Effect.AccordionSize=Class.create();
Rico.Effect.AccordionSize.prototype={initialize:function(e1,e2,_3a0,end,_3a2,_3a3,_3a4){
this.e1=$(e1);
this.e2=$(e2);
this.start=_3a0;
this.end=end;
this.duration=_3a2;
this.steps=_3a3;
this.options=arguments[6]||{};
this.accordionSize();
},accordionSize:function(){
if(this.isFinished()){
this.e1.style.height=this.start+"px";
this.e2.style.height=this.end+"px";
if(this.options.complete){
this.options.complete(this);
}
return;
}
if(this.timer){
clearTimeout(this.timer);
}
var _3a5=Math.round(this.duration/this.steps);
var diff=this.steps>0?(parseInt(this.e1.offsetHeight)-this.start)/this.steps:0;
this.resizeBy(diff);
this.duration-=_3a5;
this.steps--;
this.timer=setTimeout(this.accordionSize.bind(this),_3a5);
},isFinished:function(){
return this.steps<=0;
},resizeBy:function(diff){
var _3a8=this.e1.offsetHeight;
var _3a9=this.e2.offsetHeight;
var _3aa=parseInt(diff);
if(diff!=0){
this.e1.style.height=(_3a8-_3aa)+"px";
this.e2.style.height=(_3a9+_3aa)+"px";
}
}};
Rico.LiveGridMetaData=Class.create();
Rico.LiveGridMetaData.prototype={initialize:function(_3ab,_3ac,_3ad,_3ae){
this.pageSize=_3ab;
this.totalRows=_3ac;
this.setOptions(_3ae);
this.ArrowHeight=16;
this.columnCount=_3ad;
},setOptions:function(_3af){
this.options={largeBufferSize:7,nearLimitFactor:0.2};
Object.extend(this.options,_3af||{});
},getPageSize:function(){
return this.pageSize;
},getTotalRows:function(){
return this.totalRows;
},setTotalRows:function(n){
this.totalRows=n;
},getLargeBufferSize:function(){
return parseInt(this.options.largeBufferSize*this.pageSize);
},getLimitTolerance:function(){
return parseInt(this.getLargeBufferSize()*this.options.nearLimitFactor);
}};
Rico.LiveGridScroller=Class.create();
Rico.LiveGridScroller.prototype={initialize:function(_3b1,_3b2){
this.isIE=navigator.userAgent.toLowerCase().indexOf("msie")>=0;
this.liveGrid=_3b1;
this.metaData=_3b1.metaData;
this.createScrollBar();
this.scrollTimeout=null;
this.lastScrollPos=0;
this.viewPort=_3b2;
this.rows=new Array();
},isUnPlugged:function(){
return this.scrollerDiv.onscroll==null;
},plugin:function(){
this.scrollerDiv.onscroll=this.handleScroll.bindAsEventListener(this);
},unplug:function(){
this.scrollerDiv.onscroll=null;
},sizeIEHeaderHack:function(){
if(!this.isIE){
return;
}
var _3b3=$(this.liveGrid.tableId+"_header");
if(_3b3){
_3b3.rows[0].cells[0].style.width=(_3b3.rows[0].cells[0].offsetWidth+1)+"px";
}
},createScrollBar:function(){
var _3b4=this.liveGrid.viewPort.visibleHeight();
this.scrollerDiv=document.createElement("div");
var _3b5=this.scrollerDiv.style;
_3b5.borderRight=this.liveGrid.options.scrollerBorderRight;
_3b5.position="relative";
_3b5.left=this.isIE?"-6px":"-3px";
_3b5.width="19px";
_3b5.height=_3b4+"px";
_3b5.overflow="auto";
this.heightDiv=document.createElement("div");
this.heightDiv.style.width="1px";
this.heightDiv.style.height=parseInt(_3b4*this.metaData.getTotalRows()/this.metaData.getPageSize())+"px";
this.scrollerDiv.appendChild(this.heightDiv);
this.scrollerDiv.onscroll=this.handleScroll.bindAsEventListener(this);
var _3b6=this.liveGrid.table;
_3b6.parentNode.parentNode.insertBefore(this.scrollerDiv,_3b6.parentNode.nextSibling);
var _3b7=this.isIE?"mousewheel":"DOMMouseScroll";
Event.observe(_3b6,_3b7,function(evt){
if(evt.wheelDelta>=0||evt.detail<0){
this.scrollerDiv.scrollTop-=(2*this.viewPort.rowHeight);
}else{
this.scrollerDiv.scrollTop+=(2*this.viewPort.rowHeight);
}
this.handleScroll(false);
}.bindAsEventListener(this),false);
},updateSize:function(){
var _3b9=this.liveGrid.table;
var _3ba=this.viewPort.visibleHeight();
this.heightDiv.style.height=parseInt(_3ba*this.metaData.getTotalRows()/this.metaData.getPageSize())+"px";
},rowToPixel:function(_3bb){
return (_3bb/this.metaData.getTotalRows())*this.heightDiv.offsetHeight;
},moveScroll:function(_3bc){
this.scrollerDiv.scrollTop=this.rowToPixel(_3bc);
if(this.metaData.options.onscroll){
this.metaData.options.onscroll(this.liveGrid,_3bc);
}
},handleScroll:function(){
if(this.scrollTimeout){
clearTimeout(this.scrollTimeout);
}
var _3bd=this.lastScrollPos-this.scrollerDiv.scrollTop;
if(_3bd!=0){
var r=this.scrollerDiv.scrollTop%this.viewPort.rowHeight;
if(r!=0){
this.unplug();
if(_3bd<0){
this.scrollerDiv.scrollTop+=(this.viewPort.rowHeight-r);
}else{
this.scrollerDiv.scrollTop-=r;
}
this.plugin();
}
}
var _3bf=parseInt(this.scrollerDiv.scrollTop/this.viewPort.rowHeight);
this.liveGrid.requestContentRefresh(_3bf);
this.viewPort.scrollTo(this.scrollerDiv.scrollTop);
if(this.metaData.options.onscroll){
this.metaData.options.onscroll(this.liveGrid,_3bf);
}
this.scrollTimeout=setTimeout(this.scrollIdle.bind(this),1200);
this.lastScrollPos=this.scrollerDiv.scrollTop;
},scrollIdle:function(){
if(this.metaData.options.onscrollidle){
this.metaData.options.onscrollidle();
}
}};
Rico.LiveGridBuffer=Class.create();
Rico.LiveGridBuffer.prototype={initialize:function(_3c0,_3c1){
this.startPos=0;
this.size=0;
this.metaData=_3c0;
this.rows=new Array();
this.updateInProgress=false;
this.viewPort=_3c1;
this.maxBufferSize=_3c0.getLargeBufferSize()*2;
this.maxFetchSize=_3c0.getLargeBufferSize();
this.lastOffset=0;
},getBlankRow:function(){
if(!this.blankRow){
this.blankRow=new Array();
for(var i=0;i<this.metaData.columnCount;i++){
this.blankRow[i]="&nbsp;";
}
}
return this.blankRow;
},loadRows:function(_3c3){
var _3c4=_3c3.getElementsByTagName("rows")[0];
this.updateUI=_3c4.getAttribute("update_ui")=="true";
var _3c5=new Array();
var trs=_3c4.getElementsByTagName("tr");
for(var i=0;i<trs.length;i++){
var row=_3c5[i]=new Array();
var _3c9=trs[i].getElementsByTagName("td");
for(var j=0;j<_3c9.length;j++){
var cell=_3c9[j];
var _3cc=cell.getAttribute("convert_spaces")=="true";
var _3cd=RicoUtil.getContentAsString(cell);
row[j]=_3cc?this.convertSpaces(_3cd):_3cd;
if(!row[j]){
row[j]="&nbsp;";
}
}
}
return _3c5;
},update:function(_3ce,_3cf){
var _3d0=this.loadRows(_3ce);
if(this.rows.length==0){
this.rows=_3d0;
this.size=this.rows.length;
this.startPos=_3cf;
return;
}
if(_3cf>this.startPos){
if(this.startPos+this.rows.length<_3cf){
this.rows=_3d0;
this.startPos=_3cf;
}else{
this.rows=this.rows.concat(_3d0.slice(0,_3d0.length));
if(this.rows.length>this.maxBufferSize){
var _3d1=this.rows.length;
this.rows=this.rows.slice(this.rows.length-this.maxBufferSize,this.rows.length);
this.startPos=this.startPos+(_3d1-this.rows.length);
}
}
}else{
if(_3cf+_3d0.length<this.startPos){
this.rows=_3d0;
}else{
this.rows=_3d0.slice(0,this.startPos).concat(this.rows);
if(this.rows.length>this.maxBufferSize){
this.rows=this.rows.slice(0,this.maxBufferSize);
}
}
this.startPos=_3cf;
}
this.size=this.rows.length;
},clear:function(){
this.rows=new Array();
this.startPos=0;
this.size=0;
},isOverlapping:function(_3d2,size){
return ((_3d2<this.endPos())&&(this.startPos<_3d2+size))||(this.endPos()==0);
},isInRange:function(_3d4){
return (_3d4>=this.startPos)&&(_3d4+this.metaData.getPageSize()<=this.endPos());
},isNearingTopLimit:function(_3d5){
return _3d5-this.startPos<this.metaData.getLimitTolerance();
},endPos:function(){
return this.startPos+this.rows.length;
},isNearingBottomLimit:function(_3d6){
return this.endPos()-(_3d6+this.metaData.getPageSize())<this.metaData.getLimitTolerance();
},isAtTop:function(){
return this.startPos==0;
},isAtBottom:function(){
return this.endPos()==this.metaData.getTotalRows();
},isNearingLimit:function(_3d7){
return (!this.isAtTop()&&this.isNearingTopLimit(_3d7))||(!this.isAtBottom()&&this.isNearingBottomLimit(_3d7));
},getFetchSize:function(_3d8){
var _3d9=this.getFetchOffset(_3d8);
var _3da=0;
if(_3d9>=this.startPos){
var _3db=this.maxFetchSize+_3d9;
if(_3db>this.metaData.totalRows){
_3db=this.metaData.totalRows;
}
_3da=_3db-_3d9;
if(_3d9==0&&_3da<this.maxFetchSize){
_3da=this.maxFetchSize;
}
}else{
var _3da=this.startPos-_3d9;
if(_3da>this.maxFetchSize){
_3da=this.maxFetchSize;
}
}
return _3da;
},getFetchOffset:function(_3dc){
var _3dd=_3dc;
if(_3dc>this.startPos){
_3dd=(_3dc>this.endPos())?_3dc:this.endPos();
}else{
if(_3dc+this.maxFetchSize>=this.startPos){
var _3dd=this.startPos-this.maxFetchSize;
if(_3dd<0){
_3dd=0;
}
}
}
this.lastOffset=_3dd;
return _3dd;
},getRows:function(_3de,_3df){
var _3e0=_3de-this.startPos;
var _3e1=_3e0+_3df;
if(_3e1>this.size){
_3e1=this.size;
}
var _3e2=new Array();
var _3e3=0;
for(var i=_3e0;i<_3e1;i++){
_3e2[_3e3++]=this.rows[i];
}
return _3e2;
},convertSpaces:function(s){
return s.split(" ").join("&nbsp;");
}};
Rico.GridViewPort=Class.create();
Rico.GridViewPort.prototype={initialize:function(_3e6,_3e7,_3e8,_3e9,_3ea){
this.lastDisplayedStartPos=0;
this.div=_3e6.parentNode;
this.table=_3e6;
this.rowHeight=_3e7;
this.div.style.height=(this.rowHeight*_3e8)+"px";
this.div.style.overflow="hidden";
this.buffer=_3e9;
this.liveGrid=_3ea;
this.visibleRows=_3e8+1;
this.lastPixelOffset=0;
this.startPos=0;
},populateRow:function(_3eb,row){
for(var j=0;j<row.length;j++){
_3eb.cells[j].innerHTML=row[j];
}
},bufferChanged:function(){
this.refreshContents(parseInt(this.lastPixelOffset/this.rowHeight));
},clearRows:function(){
if(!this.isBlank){
this.liveGrid.table.className=this.liveGrid.options.loadingClass;
for(var i=0;i<this.visibleRows;i++){
this.populateRow(this.table.rows[i],this.buffer.getBlankRow());
}
this.isBlank=true;
}
},clearContents:function(){
this.clearRows();
this.scrollTo(0);
this.startPos=0;
this.lastStartPos=-1;
},refreshContents:function(_3ef){
if(_3ef==this.lastRowPos&&!this.isPartialBlank&&!this.isBlank){
return;
}
if((_3ef+this.visibleRows<this.buffer.startPos)||(this.buffer.startPos+this.buffer.size<_3ef)||(this.buffer.size==0)){
this.clearRows();
return;
}
this.isBlank=false;
var _3f0=this.buffer.startPos>_3ef;
var _3f1=_3f0?this.buffer.startPos:_3ef;
var _3f2=(this.buffer.startPos+this.buffer.size<_3ef+this.visibleRows)?this.buffer.startPos+this.buffer.size:_3ef+this.visibleRows;
var _3f3=_3f2-_3f1;
var rows=this.buffer.getRows(_3f1,_3f3);
var _3f5=this.visibleRows-_3f3;
var _3f6=_3f0?0:_3f3;
var _3f7=_3f0?_3f5:0;
for(var i=0;i<rows.length;i++){
this.populateRow(this.table.rows[i+_3f7],rows[i]);
}
for(var i=0;i<_3f5;i++){
this.populateRow(this.table.rows[i+_3f6],this.buffer.getBlankRow());
}
this.isPartialBlank=_3f5>0;
this.lastRowPos=_3ef;
this.liveGrid.table.className=this.liveGrid.options.tableClass;
var _3f9=this.liveGrid.options.onRefreshComplete;
if(_3f9!=null){
_3f9();
}
},scrollTo:function(_3fa){
if(this.lastPixelOffset==_3fa){
return;
}
this.refreshContents(parseInt(_3fa/this.rowHeight));
this.div.scrollTop=_3fa%this.rowHeight;
this.lastPixelOffset=_3fa;
},visibleHeight:function(){
return parseInt(RicoUtil.getElementsComputedStyle(this.div,"height"));
}};
Rico.LiveGridRequest=Class.create();
Rico.LiveGridRequest.prototype={initialize:function(_3fb,_3fc){
this.requestOffset=_3fb;
}};
Rico.LiveGrid=Class.create();
Rico.LiveGrid.prototype={initialize:function(_3fd,_3fe,_3ff,url,_401,_402){
this.options={tableClass:$(_3fd).className,loadingClass:$(_3fd).className,scrollerBorderRight:"1px solid #ababab",bufferTimeout:20000,sortAscendImg:"images/sort_asc.gif",sortDescendImg:"images/sort_desc.gif",sortImageWidth:9,sortImageHeight:5,ajaxSortURLParms:[],onRefreshComplete:null,requestParameters:null,inlineStyles:true};
Object.extend(this.options,_401||{});
this.ajaxOptions={parameters:null};
Object.extend(this.ajaxOptions,_402||{});
this.tableId=_3fd;
this.table=$(_3fd);
this.addLiveGridHtml();
var _403=this.table.rows[0].cells.length;
this.metaData=new Rico.LiveGridMetaData(_3fe,_3ff,_403,_401);
this.buffer=new Rico.LiveGridBuffer(this.metaData);
var _404=this.table.rows.length;
this.viewPort=new Rico.GridViewPort(this.table,this.table.offsetHeight/_404,_3fe,this.buffer,this);
this.scroller=new Rico.LiveGridScroller(this,this.viewPort);
this.options.sortHandler=this.sortHandler.bind(this);
if($(_3fd+"_header")){
this.sort=new Rico.LiveGridSort(_3fd+"_header",this.options);
}
this.processingRequest=null;
this.unprocessedRequest=null;
this.initAjax(url);
if(this.options.prefetchBuffer||this.options.prefetchOffset>0){
var _405=0;
if(this.options.offset){
_405=this.options.offset;
this.scroller.moveScroll(_405);
this.viewPort.scrollTo(this.scroller.rowToPixel(_405));
}
if(this.options.sortCol){
this.sortCol=_401.sortCol;
this.sortDir=_401.sortDir;
}
this.requestContentRefresh(_405);
}
},addLiveGridHtml:function(){
if(this.table.getElementsByTagName("thead").length>0){
var _406=this.table.cloneNode(true);
_406.setAttribute("id",this.tableId+"_header");
_406.setAttribute("class",this.table.className+"_header");
for(var i=0;i<_406.tBodies.length;i++){
_406.removeChild(_406.tBodies[i]);
}
this.table.deleteTHead();
this.table.parentNode.insertBefore(_406,this.table);
}
new Insertion.Before(this.table,"<div id='"+this.tableId+"_container'></div>");
this.table.previousSibling.appendChild(this.table);
new Insertion.Before(this.table,"<div id='"+this.tableId+"_viewport' style='float:left;'></div>");
this.table.previousSibling.appendChild(this.table);
},resetContents:function(){
this.scroller.moveScroll(0);
this.buffer.clear();
this.viewPort.clearContents();
},sortHandler:function(_408){
if(!_408){
return;
}
this.sortCol=_408.name;
this.sortDir=_408.currentSort;
this.resetContents();
this.requestContentRefresh(0);
},adjustRowSize:function(){
},setTotalRows:function(_409){
this.resetContents();
this.metaData.setTotalRows(_409);
this.scroller.updateSize();
},initAjax:function(url){
ajaxEngine.registerRequest(this.tableId+"_request",url);
ajaxEngine.registerAjaxObject(this.tableId+"_updater",this);
},invokeAjax:function(){
},handleTimedOut:function(){
this.processingRequest=null;
this.processQueuedRequest();
},fetchBuffer:function(_40b){
if(this.buffer.isInRange(_40b)&&!this.buffer.isNearingLimit(_40b)){
return;
}
if(this.processingRequest){
this.unprocessedRequest=new Rico.LiveGridRequest(_40b);
return;
}
var _40c=this.buffer.getFetchOffset(_40b);
this.processingRequest=new Rico.LiveGridRequest(_40b);
this.processingRequest.bufferOffset=_40c;
var _40d=this.buffer.getFetchSize(_40b);
var _40e=false;
var _40f;
if(this.options.requestParameters){
_40f=this._createQueryString(this.options.requestParameters,0);
}
_40f=(_40f==null)?"":_40f+"&";
_40f=_40f+"id="+this.tableId+"&page_size="+_40d+"&offset="+_40c;
if(this.sortCol){
_40f=_40f+"&sort_col="+escape(this.sortCol)+"&sort_dir="+this.sortDir;
}
this.ajaxOptions.parameters=_40f;
ajaxEngine.sendRequest(this.tableId+"_request",this.ajaxOptions);
this.timeoutHandler=setTimeout(this.handleTimedOut.bind(this),this.options.bufferTimeout);
},setRequestParams:function(){
this.options.requestParameters=[];
for(var i=0;i<arguments.length;i++){
this.options.requestParameters[i]=arguments[i];
}
},requestContentRefresh:function(_411){
this.fetchBuffer(_411);
},ajaxUpdate:function(_412){
try{
clearTimeout(this.timeoutHandler);
this.buffer.update(_412,this.processingRequest.bufferOffset);
this.viewPort.bufferChanged();
}
catch(err){
}
finally{
this.processingRequest=null;
}
this.processQueuedRequest();
},_createQueryString:function(_413,_414){
var _415="";
if(!_413){
return _415;
}
for(var i=_414;i<_413.length;i++){
if(i!=_414){
_415+="&";
}
var _417=_413[i];
if(_417.name!=undefined&&_417.value!=undefined){
_415+=_417.name+"="+escape(_417.value);
}else{
var ePos=_417.indexOf("=");
var _419=_417.substring(0,ePos);
var _41a=_417.substring(ePos+1);
_415+=_419+"="+escape(_41a);
}
}
return _415;
},processQueuedRequest:function(){
if(this.unprocessedRequest!=null){
this.requestContentRefresh(this.unprocessedRequest.requestOffset);
this.unprocessedRequest=null;
}
}};
Rico.LiveGridSort=Class.create();
Rico.LiveGridSort.prototype={initialize:function(_41b,_41c){
this.headerTableId=_41b;
this.headerTable=$(_41b);
this.options=_41c;
this.setOptions();
this.applySortBehavior();
if(this.options.sortCol){
this.setSortUI(this.options.sortCol,this.options.sortDir);
}
},setSortUI:function(_41d,_41e){
var cols=this.options.columns;
for(var i=0;i<cols.length;i++){
if(cols[i].name==_41d){
this.setColumnSort(i,_41e);
break;
}
}
},setOptions:function(){
new Image().src=this.options.sortAscendImg;
new Image().src=this.options.sortDescendImg;
this.sort=this.options.sortHandler;
if(!this.options.columns){
this.options.columns=this.introspectForColumnInfo();
}else{
this.options.columns=this.convertToTableColumns(this.options.columns);
}
},applySortBehavior:function(){
var _421=this.headerTable.rows[0];
var _422=_421.cells;
for(var i=0;i<_422.length;i++){
this.addSortBehaviorToColumn(i,_422[i]);
}
},addSortBehaviorToColumn:function(n,cell){
if(this.options.columns[n].isSortable()){
cell.id=this.headerTableId+"_"+n;
cell.style.cursor="pointer";
cell.onclick=this.headerCellClicked.bindAsEventListener(this);
cell.innerHTML=cell.innerHTML+"<span id=\""+this.headerTableId+"_img_"+n+"\">"+"&nbsp;&nbsp;&nbsp;</span>";
}
},headerCellClicked:function(evt){
var _427=evt.target?evt.target:evt.srcElement;
var _428=_427.id;
var _429=parseInt(_428.substring(_428.lastIndexOf("_")+1));
var _42a=this.getSortedColumnIndex();
if(_42a!=-1){
if(_42a!=_429){
this.removeColumnSort(_42a);
this.setColumnSort(_429,Rico.TableColumn.SORT_ASC);
}else{
this.toggleColumnSort(_42a);
}
}else{
this.setColumnSort(_429,Rico.TableColumn.SORT_ASC);
}
if(this.options.sortHandler){
this.options.sortHandler(this.options.columns[_429]);
}
},removeColumnSort:function(n){
this.options.columns[n].setUnsorted();
this.setSortImage(n);
},setColumnSort:function(n,_42d){
if(isNaN(n)){
return;
}
this.options.columns[n].setSorted(_42d);
this.setSortImage(n);
},toggleColumnSort:function(n){
this.options.columns[n].toggleSort();
this.setSortImage(n);
},setSortImage:function(n){
var _430=this.options.columns[n].getSortDirection();
var _431=$(this.headerTableId+"_img_"+n);
if(_430==Rico.TableColumn.UNSORTED){
_431.innerHTML="&nbsp;&nbsp;";
}else{
if(_430==Rico.TableColumn.SORT_ASC){
_431.innerHTML="&nbsp;&nbsp;<img width=\""+this.options.sortImageWidth+"\" "+"height=\""+this.options.sortImageHeight+"\" "+"src=\""+this.options.sortAscendImg+"\"/>";
}else{
if(_430==Rico.TableColumn.SORT_DESC){
_431.innerHTML="&nbsp;&nbsp;<img width=\""+this.options.sortImageWidth+"\" "+"height=\""+this.options.sortImageHeight+"\" "+"src=\""+this.options.sortDescendImg+"\"/>";
}
}
}
},getSortedColumnIndex:function(){
var cols=this.options.columns;
for(var i=0;i<cols.length;i++){
if(cols[i].isSorted()){
return i;
}
}
return -1;
},introspectForColumnInfo:function(){
var _434=new Array();
var _435=this.headerTable.rows[0];
var _436=_435.cells;
for(var i=0;i<_436.length;i++){
_434.push(new Rico.TableColumn(this.deriveColumnNameFromCell(_436[i],i),true));
}
return _434;
},convertToTableColumns:function(cols){
var _439=new Array();
for(var i=0;i<cols.length;i++){
_439.push(new Rico.TableColumn(cols[i][0],cols[i][1]));
}
return _439;
},deriveColumnNameFromCell:function(cell,_43c){
var _43d=cell.innerText!=undefined?cell.innerText:cell.textContent;
return _43d?_43d.toLowerCase().split(" ").join("_"):"col_"+_43c;
}};
Rico.TableColumn=Class.create();
Rico.TableColumn.UNSORTED=0;
Rico.TableColumn.SORT_ASC="ASC";
Rico.TableColumn.SORT_DESC="DESC";
Rico.TableColumn.prototype={initialize:function(name,_43f){
this.name=name;
this.sortable=_43f;
this.currentSort=Rico.TableColumn.UNSORTED;
},isSortable:function(){
return this.sortable;
},isSorted:function(){
return this.currentSort!=Rico.TableColumn.UNSORTED;
},getSortDirection:function(){
return this.currentSort;
},toggleSort:function(){
if(this.currentSort==Rico.TableColumn.UNSORTED||this.currentSort==Rico.TableColumn.SORT_DESC){
this.currentSort=Rico.TableColumn.SORT_ASC;
}else{
if(this.currentSort==Rico.TableColumn.SORT_ASC){
this.currentSort=Rico.TableColumn.SORT_DESC;
}
}
},setUnsorted:function(_440){
this.setSorted(Rico.TableColumn.UNSORTED);
},setSorted:function(_441){
this.currentSort=_441;
}};
var RicoUtil={getElementsComputedStyle:function(_442,_443,_444){
if(arguments.length==2){
_444=_443;
}
var el=$(_442);
if(el.currentStyle){
return el.currentStyle[_443];
}else{
return document.defaultView.getComputedStyle(el,null).getPropertyValue(_444);
}
},createXmlDocument:function(){
if(document.implementation&&document.implementation.createDocument){
var doc=document.implementation.createDocument("","",null);
if(doc.readyState==null){
doc.readyState=1;
doc.addEventListener("load",function(){
doc.readyState=4;
if(typeof doc.onreadystatechange=="function"){
doc.onreadystatechange();
}
},false);
}
return doc;
}
if(window.ActiveXObject){
return Try.these(function(){
return new ActiveXObject("MSXML2.DomDocument");
},function(){
return new ActiveXObject("Microsoft.DomDocument");
},function(){
return new ActiveXObject("MSXML.DomDocument");
},function(){
return new ActiveXObject("MSXML3.DomDocument");
})||false;
}
return null;
},getContentAsString:function(_447){
return _447.xml!=undefined?this._getContentAsStringIE(_447):this._getContentAsStringMozilla(_447);
},_getContentAsStringIE:function(_448){
var _449="";
for(var i=0;i<_448.childNodes.length;i++){
var n=_448.childNodes[i];
if(n.nodeType==4){
_449+=n.nodeValue;
}else{
_449+=n.xml;
}
}
return _449;
},_getContentAsStringMozilla:function(_44c){
var _44d=new XMLSerializer();
var _44e="";
for(var i=0;i<_44c.childNodes.length;i++){
var n=_44c.childNodes[i];
if(n.nodeType==4){
_44e+=n.nodeValue;
}else{
_44e+=_44d.serializeToString(n);
}
}
return _44e;
},toViewportPosition:function(_451){
return this._toAbsolute(_451,true);
},toDocumentPosition:function(_452){
return this._toAbsolute(_452,false);
},_toAbsolute:function(_453,_454){
if(navigator.userAgent.toLowerCase().indexOf("msie")==-1){
return this._toAbsoluteMozilla(_453,_454);
}
var x=0;
var y=0;
var _457=_453;
while(_457){
var _458=0;
var _459=0;
if(_457!=_453){
var _458=parseInt(this.getElementsComputedStyle(_457,"borderLeftWidth"));
var _459=parseInt(this.getElementsComputedStyle(_457,"borderTopWidth"));
_458=isNaN(_458)?0:_458;
_459=isNaN(_459)?0:_459;
}
x+=_457.offsetLeft-_457.scrollLeft+_458;
y+=_457.offsetTop-_457.scrollTop+_459;
_457=_457.offsetParent;
}
if(_454){
x-=this.docScrollLeft();
y-=this.docScrollTop();
}
return {x:x,y:y};
},_toAbsoluteMozilla:function(_45a,_45b){
var x=0;
var y=0;
var _45e=_45a;
while(_45e){
x+=_45e.offsetLeft;
y+=_45e.offsetTop;
_45e=_45e.offsetParent;
}
_45e=_45a;
while(_45e&&_45e!=document.body&&_45e!=document.documentElement){
if(_45e.scrollLeft){
x-=_45e.scrollLeft;
}
if(_45e.scrollTop){
y-=_45e.scrollTop;
}
_45e=_45e.parentNode;
}
if(_45b){
x-=this.docScrollLeft();
y-=this.docScrollTop();
}
return {x:x,y:y};
},docScrollLeft:function(){
if(window.pageXOffset){
return window.pageXOffset;
}else{
if(document.documentElement&&document.documentElement.scrollLeft){
return document.documentElement.scrollLeft;
}else{
if(document.body){
return document.body.scrollLeft;
}else{
return 0;
}
}
}
},docScrollTop:function(){
if(window.pageYOffset){
return window.pageYOffset;
}else{
if(document.documentElement&&document.documentElement.scrollTop){
return document.documentElement.scrollTop;
}else{
if(document.body){
return document.body.scrollTop;
}else{
return 0;
}
}
}
}};
Object.prototype.extend["finalize"]=function(){
};
var BaseHandler=Class.create();
BaseHandler.prototype={initialize:function(){
},processAjaxRequest:function(url,_460,_461,_462){
if(_460!=null&&_460.length>0){
_460+="&ajax=true";
}else{
_460="ajax=true";
}
this.successMethod=_461;
this.errorMethod=_462;
var _463=new Ajax.Request(url,{method:"post",parameters:_460,requestTimeout:300,onComplete:this.processAjaxResponse.bind(this),onFailure:this.processAjaxFailure.bind(this),onTimeout:this.processAjaxTimeout.bind(this)});
},processAjaxResponse:function(_464){
try{
var _465=_464.getResponseHeader("X-JSONDataLength");
var _466=_464.responseText.length-_465;
var _467=_464.responseText.substring(0,_466);
var _468=_464.responseText.substr(_466);
var _469=eval("("+_468+")");
_469.responseBody=_467;
if(_469.isError==true){
if(_469.errorMsg){
alert(_469.errorMsg);
}
if(this.errorMethod!=null){
this.errorMethod();
}
}else{
if(_469.redirectPage==true&&_469.redirectURL&&_469.loadAsOverlay!=true){
window.location=_469.redirectURL;
}else{
this.successMethod(_469);
}
}
}
catch(e){
if(this.errorMethod!=null){
this.errorMethod();
}
return;
}
},processAjaxFailure:function(_46a){
if(this.errorMethod!=null){
this.errorMethod();
}
},processAjaxTimeout:function(_46b){
if(this.errorMethod!=null){
this.errorMethod();
}
}};
BaseHandler.purge=function(d){
var a=d.attributes,i,l,n;
if(a){
l=a.length;
for(i=0;i<l;i++){
n=a[i].name;
if(typeof d[n]=="function"){
d[n]=null;
}
}
}
a=d.childNodes;
if(a){
l=a.length;
for(i=0;i<l;i++){
BaseHandler.purge(d.childNodes[i]);
}
}
};
BaseHandler.buildQueryString=function(_46e){
try{
if(_46e==null){
return "";
}
var _46f="";
for(var key in _46e){
if(_46f.length>0){
_46f+="&"+key+"="+escape(_46e[key]);
}else{
_46f=key+"="+escape(_46e[key]);
}
}
return _46f;
}
catch(e){
return "";
}
};
var TabHandler=Class.create();
TabHandler.prototype={initialize:function(_471,_472){
this.tabHeaderEl=$(_471);
this.tabHeaderId=this.tabHeaderEl.getAttribute("id");
this.tabPanelEl=$(_472);
this.tabPanelId=_472;
this.handleClick();
},handleClick:function(){
var _473=this.tabHeaderEl.parentNode;
var _474=this.tabPanelEl.parentNode;
var _475="";
if(_473==null||_474==null){
return;
}
tabHeaders=_473.childNodes;
tabPanels=_474.childNodes;
if(tabHeaders==null||tabPanels==null){
return;
}
if(tabHeaders.length!=tabPanels.length){
return;
}
_475=this.getCurrentActiveTab(tabHeaders);
for(var i=0;i<tabHeaders.length;i++){
headerId=tabHeaders[i].getAttribute("id");
panelId=tabPanels[i].getAttribute("id");
headerClass=tabHeaders[i].className;
headerAjaxCallMade=tabHeaders[i].getAttribute("ajaxCallMade");
if(headerId==this.tabHeaderId){
if(tabHeaders[i].getAttribute("ajaxCallMade")==null&&headerId!=_475){
url=tabHeaders[i].childNodes[0].getAttribute("href");
tabPanels[i].style.display="block";
this.saveTabAttributes();
new DivReplaceHandler(url,tabPanels[i],"loadingOverlay",this.setTabAttributes.bind(this)).execute();
tabHeaders[i].setAttribute("ajaxCallMade","true");
this.turnOffTabs(tabHeaders);
tabHeaders[i].className=headerClass+" active";
}else{
tabPanels[i].style.display="block";
this.turnOffTabs(tabHeaders);
tabHeaders[i].className=headerClass+" active";
if(tabHeaders[i].getAttribute("ajaxCallMade")==null){
tabHeaders[i].setAttribute("ajaxCallMade","true");
}
}
}else{
if(headerId==_475&&tabHeaders[i].getAttribute("ajaxCallMade")==null){
tabHeaders[i].setAttribute("ajaxCallMade","true");
}
tabPanels[i].style.display="none";
}
}
},saveTabAttributes:function(){
this.tabHeaderEl.style.cursor="wait";
},setTabAttributes:function(){
this.tabHeaderEl.style.cursor="default";
},turnOffTabs:function(_477){
for(var i=0;i<_477.length;i++){
if(_477[i].className.indexOf("active")!=-1){
_477[i].className=_477[i].className.replace(/active/g,"");
}
}
},getCurrentActiveTab:function(_479){
var _47a="";
for(var i=0;i<_479.length;i++){
if(_479[i].className.indexOf("active")!=-1){
_47a=_479[i].getAttribute("id");
break;
}
}
return _47a;
}};
var DivReplaceHandler=Class.create();
DivReplaceHandler.prototype={initialize:function(url,_47d,_47e,_47f){
this.url=url;
this.divEl=$(_47d);
this.callback=_47f;
this.styleClass=_47e;
this.loadingHandler=null;
return this;
},continueProcessing:function(){
if(this.divEl==null||this.url==null){
return false;
}else{
return true;
}
},execute:function(){
if(!this.continueProcessing()){
return;
}
this.origOnClick=null;
if(this.divEl.style.display=="none"){
this.divEl.style.display="block";
}
if(this.divEl.getAttribute("onclick")!=null){
this.origOnClick=this.divEl.getAttribute("onclick");
this.divEl.onclick="javascript:void();";
}
this.divEl.style.cursor="wait";
if(this.styleClass!=null&&this.styleClass.length>0){
this.loadingHandler=new LoadingHandler();
this.loadingHandler.showLoading(this.divEl,this.styleClass);
}
(new BaseHandler()).processAjaxRequest(this.url,"",this.processResponse.bind(this),this.handleError.bind(this));
},processResponse:function(_480){
if(this.loadingHandler!=null){
this.loadingHandler.hideLoading();
}
this.divEl.innerHTML=_480.responseBody;
this.divEl.style.cursor="default";
if(this.origOnClick!=null){
this.divEl.onclick=this.origOnClick;
}
if(this.callback!=null){
this.callback(_480);
}
if(this.divEl.innerHTML!=null){
addReflections();
}
},handleError:function(){
var _481="";
if(this.loadingHandler!=null){
_481=this.loadingHandler.hideLoading();
}
if(_481.length>0){
this.divEl.innerHTML=_481;
}
this.divEl.style.cursor="default";
if(this.origOnClick!=null){
this.divEl.onclick=this.origOnClick;
}
if(this.callback!=null){
this.callback();
}
}};
var FormHandler=Class.create();
FormHandler.prototype={initialize:function(el,_483,_484,_485,_486){
this.el=$(el);
this.divEl=$(_483);
this.url=this.el.getAttribute("action");
this.styleClass=_485;
this.callback=_486;
this.loadingHandler=null;
if(_484==null||_484.length==0){
this.method="get";
}else{
this.method=_484.toLowerCase();
}
},continueProcessing:function(){
if(this.el==null||this.divEl==null||this.url==null){
return false;
}else{
return true;
}
},submit:function(){
if(!this.continueProcessing()){
return;
}
var _487="";
if(this.method=="get"){
params=Form.serialize(this.el);
if(this.url.indexOf("?")==-1){
this.url+="?"+params;
}else{
this.url=this.url.substring(this.url.indexOf("?"));
this.url+="?"+params;
}
}else{
_487=Form.serialize(this.el);
}
this.divEl.style.cursor="wait";
if(this.styleClass!=null&&this.styleClass.length>0){
this.loadingHandler=new LoadingHandler();
this.loadingHandler.showLoading(this.divEl,this.styleClass);
}
(new BaseHandler()).processAjaxRequest(this.url,_487,this.processResponse.bind(this),this.handleError.bind(this));
},processResponse:function(_488){
var _489="";
if(this.loadingHandler!=null){
this.loadingHandler.hideLoading();
}
if(this.callback!=null){
this.callback(_488);
}else{
this.divEl.innerHTML=_488.responseBody;
}
this.divEl.style.cursor="default";
},handleError:function(){
var _48a="";
if(this.loadingHandler!=null){
_48a=this.loadingHandler.hideLoading();
}
if(_48a.length>0){
this.divEl.innerHTML=_48a;
}
this.divEl.innerHTML=this.origDivInnerHTML;
this.divEl.style.cursor="default";
}};
var Form={serialize:function(form){
var _48c=Form.getElements($(form));
var _48d=new Array();
for(var i=0;i<_48c.length;i++){
var _48f=Form.Element.serialize(_48c[i]);
if(_48f){
_48d.push(_48f);
}
}
return _48d.join("&");
},getElements:function(form){
var form=$(form);
var _491=new Array();
for(tagName in Form.Element.Serializers){
var _492=form.getElementsByTagName(tagName);
for(var j=0;j<_492.length;j++){
_491.push(_492[j]);
}
}
return _491;
},getInputs:function(form,_495,name){
var form=$(form);
var _497=form.getElementsByTagName("input");
if(!_495&&!name){
return _497;
}
var _498=new Array();
for(var i=0;i<_497.length;i++){
var _49a=_497[i];
if((_495&&_49a.type!=_495)||(name&&_49a.name!=name)){
continue;
}
_498.push(_49a);
}
return _498;
},disable:function(form){
var _49c=Form.getElements(form);
for(var i=0;i<_49c.length;i++){
var _49e=_49c[i];
_49e.blur();
_49e.disabled="true";
}
},enable:function(form){
var _4a0=Form.getElements(form);
for(var i=0;i<_4a0.length;i++){
var _4a2=_4a0[i];
_4a2.disabled="";
}
},focusFirstElement:function(form){
var form=$(form);
var _4a4=Form.getElements(form);
for(var i=0;i<_4a4.length;i++){
var _4a6=_4a4[i];
if(_4a6.type!="hidden"&&!_4a6.disabled){
Field.activate(_4a6);
break;
}
}
},reset:function(form){
$(form).reset();
}};
Form.Element={serialize:function(_4a8){
var _4a8=$(_4a8);
var _4a9=_4a8.tagName.toLowerCase();
var _4aa=Form.Element.Serializers[_4a9](_4a8);
if(_4aa){
return encodeURIComponent(_4aa[0])+"="+encodeURIComponent(_4aa[1]);
}
},getValue:function(_4ab){
var _4ab=$(_4ab);
var _4ac=_4ab.tagName.toLowerCase();
var _4ad=Form.Element.Serializers[_4ac](_4ab);
if(_4ad){
return _4ad[1];
}
}};
Form.Element.Serializers={input:function(_4ae){
switch(_4ae.type.toLowerCase()){
case "submit":
case "hidden":
case "password":
case "text":
return Form.Element.Serializers.textarea(_4ae);
case "checkbox":
case "radio":
return Form.Element.Serializers.inputSelector(_4ae);
}
return false;
},inputSelector:function(_4af){
if(_4af.checked){
return [_4af.name,_4af.value];
}
},textarea:function(_4b0){
return [_4b0.name,_4b0.value];
},select:function(_4b1){
var _4b2="";
if(_4b1.type=="select-one"){
var _4b3=_4b1.selectedIndex;
if(_4b3>=0){
_4b2=_4b1.options[_4b3].value||_4b1.options[_4b3].text;
}
}else{
_4b2=new Array();
for(var i=0;i<_4b1.length;i++){
var opt=_4b1.options[i];
if(opt.selected){
_4b2.push(opt.value||opt.text);
}
}
}
return [_4b1.name,_4b2];
}};
var ReadMoreHandler=Class.create();
ReadMoreHandler.prototype={initialize:function(_4b6,_4b7,href){
this.tabHeader=_4b6;
this.tabPanel=_4b7;
this.href=href;
this.handleClick();
},handleClick:function(){
if(window.location.href.indexOf(this.href)==-1){
window.location=this.href;
return;
}
var _4b9=document.getElementById("tabsetHeader");
var _4ba=document.getElementById("tabsetPanel");
if(_4b9==null||_4ba==null){
return;
}
tabHeaders=_4b9.childNodes;
tabPanels=_4ba.childNodes;
if((tabHeaders==null||tabPanels==null)||(tabHeaders.length!=tabPanels.length)){
return;
}
var _4bb=this.getCurrentActiveTab(tabHeaders);
if(_4bb!=this.tabHeader){
this.turnOffTabs(tabHeaders);
this.hidePanels(tabPanels);
document.getElementById(this.tabPanel).style.display="block";
document.getElementById(this.tabHeader).className=document.getElementById(this.tabHeader).className+" active";
}
window.scrollTo(300,400);
},turnOffTabs:function(_4bc){
for(var i=0;i<_4bc.length;i++){
if(_4bc[i].className.indexOf("active")!=-1){
_4bc[i].className=_4bc[i].className.replace(/active/g,"");
}
}
},getCurrentActiveTab:function(_4be){
var _4bf="";
for(var i=0;i<_4be.length;i++){
if(_4be[i].className.indexOf("active")!=-1){
_4bf=_4be[i].getAttribute("id");
break;
}
}
return _4bf;
},hidePanels:function(_4c1){
for(var i=0;i<_4c1.length;i++){
_4c1[i].style.display="none";
}
}};
var LoadingHandler=Class.create();
LoadingHandler.prototype={initialize:function(){
return this;
},showLoading:function(_4c3,_4c4){
this.divEl=$(_4c3);
this.origHTML=this.divEl.innerHTML;
this.styleClass=_4c4;
this.origClass=this.divEl.className;
this.divEl.innerHTML="";
this.divEl.className=this.styleClass;
},hideLoading:function(){
this.divEl.className=this.origClass;
return this.origHTML;
}};
var overlayUtil=Class.create();
var Overlay;
overlayUtil={windowWidth:function(){
if(document.documentElement&&document.documentElement.clientWidth){
return document.documentElement.clientWidth;
}else{
if(document.body&&document.body.clientWidth){
return document.body.clientWidth;
}
}
},scrollOffset:function(){
var _4c5;
if(self.pageYOffset){
_4c5=self.pageYOffset;
}else{
if(document.documentElement&&document.documentElement.scrollTop){
_4c5=document.documentElement.scrollTop;
}else{
if(document.body){
_4c5=document.body.scrollTop;
}
}
}
return (_4c5>0)?_4c5:0;
},centeredOffset:function(_4c6){
var _4c7=overlayUtil.windowWidth();
if(_4c7>980){
_4c7=980;
}
var _4c8=(_4c7-_4c6.offsetWidth)/2;
if(_4c8<0||_4c8>=_4c7){
_4c8=0;
}
return (_4c8>0)?_4c8:0;
},updatePosition:function(_4c9){
_4c9.style.top=overlayUtil.scrollOffset()+20+"px";
},resetScroll:function(_4ca){
window.scrollTo(0,_4ca);
},handleResize:function(_4cb){
_4cb.style.width=overlayUtil.windowWidth()+"px";
},fitToPage:function(elem){
elem.style.height=document.body.scrollHeight+"px";
elem.style.width=overlayUtil.windowWidth()+"px";
},showMask:function(_4cd){
overlayUtil.fitToPage(_4cd);
_4cd.style.display="block";
if(document.all&&document.getElementById){
var _4ce=document.getElementsByTagName("SELECT");
for(var i=0;i<_4ce.length;i++){
_4ce[i].className=_4ce[i].className.replace(new RegExp(" overlayOn\\b"),"");
_4ce[i].className+=" overlayOn";
}
}
},showContent:function(_4d0,_4d1){
_4d0.style.visibility="hidden";
_4d0.style.display="block";
_4d0.style.marginLeft=overlayUtil.centeredOffset(_4d0)+"px";
overlayUtil.resetScroll(_4d1);
overlayUtil.updatePosition(_4d0);
_4d0.style.visibility="visible";
},close:function(_4d2,_4d3){
if(document.all&&document.getElementById){
var _4d4=document.getElementsByTagName("SELECT");
for(var i=0;i<_4d4.length;i++){
_4d4[i].className=_4d4[i].className.replace(new RegExp(" overlayOn\\b"),"");
}
}
_4d2.style.display="none";
_4d3.style.display="none";
}};
var popupUrlHandler=Class.create();
var Overlay;
popupUrlHandler.prototype={initialize:function(url,_4d7,_4d8,_4d9){
this.url=url;
this.divEl=$(_4d7);
this.maskEl=$("pageMask");
this.callback=_4d9;
this.styleClass=_4d8;
this.loadingHandler=null;
return this;
},continueProcessing:function(){
if(this.divEl==null||this.url==null){
return false;
}else{
return true;
}
},execute:function(){
if(!this.continueProcessing()){
return;
}
this.origOnClick=null;
if(this.divEl.getAttribute("onclick")!=null){
this.origOnClick=this.divEl.getAttribute("onclick");
this.divEl.onclick="javascript:void();";
}
if(this.styleClass!=null&&this.styleClass.length>0){
this.loadingHandler=new LoadingHandler();
this.loadingHandler.showLoading(this.divEl,this.styleClass);
}
(new BaseHandler()).processAjaxRequest(this.url,"",this.processResponse.bind(this),this.handleError.bind(this));
},processResponse:function(_4da){
if(this.loadingHandler!=null){
this.loadingHandler.hideLoading();
}
BaseHandler.purge(this.divEl);
this.divEl.innerHTML=_4da.responseBody;
overlayUtil.showMask(this.maskEl);
Event.observe(window,"resize",this.handleResize.bind(this));
this.originalScroll=overlayUtil.scrollOffset();
overlayUtil.showContent(this.divEl,this.originalScroll);
if(this.origOnClick!=null){
this.divEl.onclick=this.origOnClick;
}
if(this.callback!=null){
this.callback();
}
},handleError:function(){
var _4db="";
if(this.loadingHandler!=null){
_4db=this.loadingHandler.hideLoading();
}
if(_4db.length>0){
this.divEl.innerHTML=_4db;
}
if(this.origOnClick!=null){
this.divEl.onclick=this.origOnClick;
}
if(this.callback!=null){
this.callback();
}
},handleResize:function(){
overlayUtil.handleResize(this.maskEl);
},resetScroll:function(){
overlayUtil.resetScroll(this.originalScroll);
},close:function(){
overlayUtil.close(this.divEl,this.maskEl);
}};
var popupContentHandler=Class.create();
popupContentHandler.prototype={initialize:function(_4dc,_4dd,_4de){
this.jsonResponse=_4dc;
this.divEl=$(_4dd);
this.maskEl=$("pageMask");
this.callback=_4de;
return this;
},continueProcessing:function(){
if(this.divEl==null||this.jsonResponse==null){
return false;
}else{
return true;
}
},execute:function(){
if(!this.continueProcessing()){
return;
}
BaseHandler.purge(this.divEl);
this.divEl.innerHTML=this.jsonResponse.responseBody;
overlayUtil.showMask(this.maskEl);
Event.observe(window,"resize",this.handleResize.bind(this));
this.originalScroll=overlayUtil.scrollOffset();
overlayUtil.showContent(this.divEl,this.originalScroll);
if(this.callback!=null){
this.callback();
}
},handleResize:function(){
overlayUtil.handleResize(this.maskEl);
},resetScroll:function(){
overlayUtil.resetScroll(this.originalScroll);
},close:function(){
overlayUtil.close(this.divEl,this.maskEl);
}};
var NextGenHandler=Class.create();
NextGenHandler.prototype={initialize:function(el,_4e0,_4e1,_4e2,_4e3){
this.el=$(el);
this.formDivId=$(_4e0);
this.method=_4e1;
this.styleClass=_4e2;
this.queueDiv=$("queueContentsContainer");
this.similarMoviesUrl=_4e3;
},continueProcessing:function(){
if(this.el==null||this.formDivId==null){
return false;
}else{
return true;
}
},submit:function(){
if(!this.continueProcessing()){
return;
}
new FormHandler(this.el,this.formDivId,this.method,this.styleClass,this.processResponse.bind(this)).submit();
},processResponse:function(_4e4){
if(_4e4.validationError!=null){
this.formDivId.innerHTML=_4e4.responseBody;
}else{
DndUtil.clearQueueDragAndDrop();
this.queueDiv.innerHTML=_4e4.responseBody;
var _4e5=document.getElementById("mQueueCorners");
if(_4e5){
_4e5.style.display="none";
_4e5.style.display="block";
}
new UpdateButtons().update(_4e4);
DndUtil.registerQueueDragAndDrop();
Overlay.close();
Facebook.publish_action("queue",Queue.getSplashPageUrl());
Queue.overlay=new QueueOverlay(this.similarMoviesUrl,"boxPopup","","");
Queue.overlay.execute();
}
}};
function createCookie(){
var a=document.URL;
var _4e7="BB_URL_PATH_COOKIE="+a+"; path=/";
document.cookie=_4e7;
}
var FriendsHandler=Class.create();
var Overlay;
FriendsHandler.prototype={initialize:function(el,_4e9,_4ea,_4eb,_4ec,_4ed,_4ee){
this.el=$(el);
this.divEl=$(_4e9);
this.errorDivId=$(_4ea);
this.method=_4eb;
this.styleClass=_4ec;
this.hideDiv=null;
this.callback=_4ee;
if(_4ed!=null){
this.hideDiv=$(_4ed);
}
},continueProcessing:function(){
if(this.el==null||this.divEl==null||this.errorDivId==null){
return false;
}else{
return true;
}
},submit:function(){
if(!this.continueProcessing()){
return;
}
this.setCursor("wait");
new FormHandler(this.el,this.divEl,this.method,this.styleClass,this.processResponse.bind(this)).submit();
},processResponse:function(_4ef){
if(_4ef.validationError!=null){
this.errorDivId.innerHTML=_4ef.responseBody;
this.errorDivId.style.display="block";
}else{
if(_4ef.loadAsOverlay==true){
Overlay=new popupContentHandler(_4ef,"boxPopup",null);
Overlay.execute();
}else{
this.errorDivId.style.display="none";
this.divEl.innerHTML=_4ef.responseBody;
}
if(this.hideDiv!=null){
this.hideDiv.style.display="none";
}
if(this.callback!=null){
this.callback();
}
}
this.setCursor("default");
},setCursor:function(_4f0){
for(var i=0;i<this.el.length;i++){
if(this.el[i].nodeType==1){
this.el[i].style.cursor=_4f0;
}
}
this.el.style.cursor=_4f0;
}};
var ContactImportHandler=Class.create();
ContactImportHandler.prototype={initialize:function(){
this.el=null;
this.divId=null;
this.errorDivId=null;
this.passwordEl=null;
},showHideDiv:function(_4f2,_4f3){
var _4f4=$(_4f2);
if(_4f4==null){
return;
}
var _4f5=_4f4.childNodes;
for(var i=0;i<_4f5.length;i++){
divId=_4f5[i].getAttribute("id");
if(divId==_4f3){
_4f5[i].className="displayBlock";
}else{
_4f5[i].className="displayNone";
}
}
},importContacts:function(_4f7,_4f8,_4f9,_4fa,_4fb,_4fc){
this.el=$(_4f7);
this.divId=$(_4f8);
this.errorDivId=$(_4f9);
this.passwordEl=$(_4fc);
if(this.el==null||this.divId==null||this.errorDivId==null){
return;
}
new FormHandler(this.el,this.divId,_4fa,_4fb,this.processResponse.bind(this)).submit();
},sendInvites:function(_4fd,_4fe,_4ff){
this.el=$(_4fd);
this.divId=$(_4fe);
this.errorDivId=$(_4ff);
var _500=0;
for(var i=0;i<this.el.length;i++){
if(this.el[i].type=="checkbox"&&this.el[i].checked){
_500++;
break;
}
}
if(_500>0){
var url=this.el.getAttribute("action");
if(url){
new FormHandler(this.el,this.divId,"post","",this.processResponse.bind(this)).submit();
document.body.style.cursor="wait";
}
}else{
alert("You must select at least one contact.");
}
},processResponse:function(_503){
if(_503.validationError!=null){
this.errorDivId.innerHTML=_503.responseBody;
this.errorDivId.style.display="block";
if(this.passwordEl!=null){
this.passwordEl.value="";
}
}else{
if(_503.loadAsOverlay==true){
Overlay=new popupContentHandler(_503,"boxPopup",null);
Overlay.execute();
}else{
this.errorDivId.style.display="none";
this.divId.innerHTML=_503.responseBody;
if(_503.responseBody.indexOf("class=\"error\"")!=-1&&this.passwordEl!=null){
this.passwordEl.value="";
}
}
}
document.body.style.cursor="default";
},setDefaultRadioButton:function(){
var _504=$("yahooProvider");
var _505=$("hotmailProvider");
var _506=$("gmailProvider");
var _507=$("aolProvider");
if(_504!=null&&_504.checked){
this.showHideDiv("loginBox","yahooLoginDiv");
}else{
if(_505!=null&&_505.checked){
this.showHideDiv("loginBox","hotmailLoginDiv");
}else{
if(_506!=null&&_506.checked){
this.showHideDiv("loginBox","gMailLoginDiv");
}else{
if(_507!=null&&_507.checked){
this.showHideDiv("loginBox","aolLoginDiv");
}else{
this.showHideDiv("loginBox","yahooLoginDiv");
}
}
}
}
}};
var importHandler=new ContactImportHandler();
function swapOneFormatDropdownAndDiv(_508,_509,_50a){
var _50b=$(_508);
var _50c=$(_509);
var _50a=$(_50a);
var _50d=_50b.selectedIndex;
var _50e=_50b.options[_50d].value;
var _50f=_50b.options[_50b.selectedIndex].innerHTML;
var _510=0;
if(_50d==0){
_510=1;
}
_50c.value=_50b.options[_510].value;
_50a.innerHTML=_50b.options[_510].innerHTML;
}
function swapTwoFormatDropdownsAndDiv(_511,_512,_513,_514){
var _515=$(_511);
var _516=$(_512);
var _517=$(_513);
var _514=$(_514);
var _518=_515.selectedIndex;
var _519=_515.options[_518].value;
var _51a=_515.options[_515.selectedIndex].innerHTML;
var _51b=0;
for(i=0;i<_515.options.length;i++){
if(i!=_518){
_516.options[_51b].value=_515.options[i].value;
_516.options[_51b].innerHTML=_515.options[i].innerHTML;
_51b++;
}
}
for(i=0;i<_516.options.length;i++){
if(_516.options[0].value!="DVD"&&_516.options[1].value!="DVD"){
if(_516.options[i].value==_515.options[0].value){
_516.selectedIndex=i;
}else{
_517.value=_516.options[i].value;
_514.innerHTML=_516.options[i].innerHTML;
}
}else{
if(_516.options[i].value=="BR"||_516.options[i].value=="HD"){
_516.selectedIndex=i;
}else{
_517.value=_516.options[i].value;
_514.innerHTML=_516.options[i].innerHTML;
}
}
}
}
function updateFormatOfMovie(_51c,_51d,_51e,_51f){
var _520=$(_51c);
if(_520.selectedIndex==0){
return;
}
if(_520.selectedIndex==1){
window.location.href="/discformat/updateFormatOfMovie/"+_51d+"/"+_51e;
}else{
if(_520.selectedIndex==2){
window.location.href="/discformat/updateFormatOfMovie/"+_51d+"/"+_51f;
}
}
}
function checkAllCheckBoxes(_521,_522){
allAvailableCheckbox=$(_521);
if(allAvailableCheckbox.checked){
var _523=document.getElementsByClassName(_522);
for(i=0;i<_523.length;i++){
_523[i].checked=true;
}
}else{
var _523=document.getElementsByClassName(_522);
for(i=0;i<_523.length;i++){
_523[i].checked=false;
}
}
}
var FBEvent=Class.create();
FBEvent.prototype={initialize:function(){
return this;
},publish_event:function(_524,url){
if(_524!=null&&url!=null){
var _526="http://"+document.location.host+document.location.port+url;
if(FBEvent.facebookBeaconEnabled){
try{
if(Facebook!=null&&Facebook.publish_action!=null){
Facebook.publish_action(_524,_526);
}
}
catch(e){
}
}
}
}};
var fbEvent=new FBEvent();
var AnonAddToQueue=Class.create();
AnonAddToQueue.prototype={initialize:function(el,URL,_529,tit){
this.el=$(el);
this.Url=URL;
this.type=_529;
this.title=tit;
},add:function(){
try{
new BaseHandler().processAjaxRequest(this.Url,"",this.processResponse.bind(this),this.handleError.bind(this));
}
catch(e){
this.log("anonAddToQueue.add(): "+e.message);
}
},processResponse:function(_52b){
try{
if(_52b.loadAsOverlay==true){
Overlay=new popupContentHandler(_52b,"boxPopup",null);
Overlay.execute();
this.el.removeAttribute("addClicked");
this.setCursors("default");
this.el.style.cursor="pointer";
}
}
catch(e){
this.log("anonAddToQueue.processResponse(): "+e.message);
}
},setCursors:function(_52c){
this.el.style.cursor=_52c;
document.body.style.cursor=_52c;
if(this.mainParentNode!=null){
this.mainParentNode.style.cursor=_52c;
}
},handleError:function(){
this.setCursors("default");
this.el.removeAttribute("addClicked");
this.el.style.cursor="pointer";
}};
var BBDragAndDrop=Class.create();
BBDragAndDrop.prototype=(new Rico.DragAndDrop()).extend({initialize:function(){
this._mouseDown=this._mouseDownHandler.bindAsEventListener(this);
this._mouseMove=this._mouseMoveHandler.bindAsEventListener(this);
this._mouseUp=this._mouseUpHandler.bindAsEventListener(this);
this.mouseCoords=new Array();
this.origMouseCoords=new Array();
},setStartDragFromElement:function(e,_52e){
this.origPos=RicoUtil.toDocumentPosition(_52e);
this.interestedInMotionEvents=this.hasSelection();
this._terminateEvent(e);
},_mouseDownHandler:function(e){
if(arguments.length==0){
e=event;
}
var _530=e.which!=undefined;
if((_530&&e.which!=1)||(!_530&&e.button!=1)){
return;
}
var _531=e.target?e.target:e.srcElement;
var _532=_531.draggable;
var _533=_531;
while(_532==null&&_533.parentNode){
_533=_533.parentNode;
_532=_533.draggable;
}
if(_532==null){
return;
}
this.updateSelection(_532,e.ctrlKey);
if(this.hasSelection()){
for(var i=0;i<this.dropZones.length;i++){
this.dropZones[i].clearPositionCache();
}
}
this.mouseCoords=[Event.pointerX(e),Event.pointerY(e)];
this.origMouseCoords=[Event.pointerX(e),Event.pointerY(e)];
this.setStartDragFromElement(e,_532.getMouseDownHTMLElement());
},_mouseMoveHandler:function(e){
try{
var _536=e.which!=undefined;
if(!this.interestedInMotionEvents){
return;
}
if(!this.hasSelection()){
return;
}
if(!this.currentDragObjectVisible){
this._startDrag(e);
}
if(!this.activatedDropZones){
this._activateRegisteredDropZones();
}
this.mouseCoords=[Event.pointerX(e),Event.pointerY(e)];
this._updateDraggableLocation(e);
this._updateDropZonesHover(e);
this._terminateEvent(e);
}
catch(e){
this.log("BBDragAndDrop._mouseMoveHandler(): "+e.message);
}
},_updateDraggableLocation:function(e){
var _538=this.dragElement.style;
_538.left=this.mouseCoords[0]+"px";
_538.top=this.mouseCoords[1]+"px";
},_updateDropZonesHover:function(e){
var n=this.dropZones.length;
for(var i=0;i<n;i++){
if(!this._mousePointInDropZone(e,this.dropZones[i])){
this.dropZones[i].hideHover();
}
}
for(var i=0;i<n;i++){
if(this._mousePointInDropZone(e,this.dropZones[i])){
if(this.dropZones[i].canAccept(this.currentDragObjects)){
this.dropZones[i].showHover(e);
}
}
}
},_mouseUpHandler:function(e){
if(!this.hasSelection()){
return;
}
var _53d=e.which!=undefined;
if((_53d&&e.which!=1)||(!_53d&&e.button!=1)){
return;
}
this.interestedInMotionEvents=false;
if(this.dragElement==null){
this._terminateEvent(e);
return;
}
if(this._placeDraggableInDropZone(e)){
this._completeDropOperation(e);
s.linkTrackVars="eVar7,events";
s.linkTrackEvents="event5";
s.events="event5";
s.eVar8="";
s.tl(this,"o","Queue Action Drag and Drop");
}else{
this._terminateEvent(e);
var x=0;
var y=0;
if(this.origMouseCoords!=null){
x=this.origMouseCoords[0];
y=this.origMouseCoords[1];
}
new Rico.Effect.Position(this.dragElement,x,y,50,5,{complete:this._doCancelDragProcessing.bind(this)});
}
Event.stopObserving(document.body,"mousemove",this._mouseMove);
Event.stopObserving(document.body,"mouseup",this._mouseUp);
},registerDraggable:function(_540){
if($("queue")!=null){
if(_540.type=="MovieDraggable"&&_540.actionPath==null){
return;
}else{
this.draggables[this.draggables.length]=_540;
this._addMouseDownHandler(_540);
}
}
},clearDraggables:function(_541){
try{
for(var i=this.draggables.length-1;i>=0;i--){
if(this.draggables[i].type==_541){
this.draggables.removeItem(this.draggables[i]);
}
}
}
catch(e){
this.log("BBDragAndDrop.clearDraggables(): "+e.message);
}
},log:function(msg){
logger.error(msg);
}});
var dndBBMgr=new BBDragAndDrop();
dndBBMgr.initializeEventHandlers();
var BBDraggable=Class.create();
BBDraggable.removeOnDrop=false;
BBDraggable.revereNamesOnDrop=true;
BBDraggable.prototype=(new Rico.Draggable()).extend({initialize:function(el){
try{
if(el==null||el.length==0){
return null;
}
this.type="Custom";
this.htmlElement=$(el);
if(!this.continueProcessing()){
return null;
}
}
catch(e){
this.log("BBDraggable.initialize(): "+e.message);
}
},log:function(msg){
logger.error(msg);
},continueProcessing:function(){
try{
if(this.htmlElement!=null){
return true;
}else{
return false;
}
}
catch(e){
this.log("BBDraggable.continueProcessing(): "+e.message);
return false;
}
},select:function(){
this.selected=true;
},deselect:function(){
this.selected=false;
},startDrag:function(){
BBDraggable.isDragging=true;
},cancelDrag:function(){
BBDraggable.isDragging=false;
},endDrag:function(){
BBDraggable.isDragging=false;
if(BBDraggable.removeOnDrop){
this.htmlElement.style.display="none";
}
},getSingleObjectDragGUI:function(e){
},getDroppedGUI:function(){
},mousedOver:function(evt){
},mousedOut:function(evt){
},showLoading:function(evt){
},showFailure:function(evt){
this.log("<br/>Error retrieving movie details...");
},toString:function(){
var _54b="";
_54b="this.type: "+this.type+"<br/>";
_54b+="this.htmlElement: "+this.htmlElement+"<br/>";
_54b+="BBDraggable.isDragging: "+BBDraggable.isDragging+"<br/>";
return _54b;
}});
BBDraggable.isDragging=false;
var BBDroppable=Class.create();
BBDroppable.prototype=(new Rico.Dropzone()).extend({initialize:function(el,_54d,_54e){
this.htmlElement=$(el);
this.absoluteRect=null;
this.acceptedObjects=[];
this.marker=_54d;
this.position=_54e;
this.offset=navigator.userAgent.toLowerCase().indexOf("msie")>=0?0:1;
this.droppedPosition=_54e;
this.queueDiv=null;
this.actionPath=null;
},activate:function(){
},deactivate:function(){
},showHover:function(e){
try{
this.droppedPosition=this.position;
var x=0;
var y=0;
if(document.all){
x=event.clientX;
y=event.clientY;
}else{
x=e.pageX;
y=e.pageY;
}
var _552=false;
this.where="upper";
Position.prepare();
Position.within(this.htmlElement,x,y);
if(Position.overlap("vertical",this.htmlElement)<0.5){
this.where="lower";
this.droppedPosition++;
}
Position.clone(this.htmlElement,this.marker);
this.marker.style.top=parseInt(this.marker.style.top)+1+"px";
this.marker.style.height="1px";
if(this.where=="lower"){
this.marker.style.top=parseInt(this.marker.style.top)+parseInt(this.htmlElement.offsetHeight)+"px";
}
_552=true;
if(_552){
Element.show(this.marker);
}else{
Element.hide(this.marker);
}
}
catch(e){
this.log("BBDroppable.showHover(): "+e.message);
}
},hideHover:function(){
try{
if(this.marker!=null){
Element.hide(this.marker);
}
}
catch(e){
this.log("BBDroppable.hideHover(): "+e.message);
}
},accept:function(_553){
try{
var _554=_553[0];
if(_554.type==null||_554.type.length==0){
return;
}
if(_554.type=="MovieDraggable"&&_554.actionPath==null){
alert("No rentable product for this movie. Please try again later.");
return;
}
if(!this.prepareAjaxRequest(_554)){
return;
}
this.setCursors("wait");
(new BaseHandler()).processAjaxRequest(this.actionPath,"",this.processResponse.bind(this),this.handleError.bind(this));
}
catch(e){
this.log("BBDroppable.accept(): "+e.message);
}
},prepareAjaxRequest:function(_555){
try{
if(_555.type=="QueueDraggable"){
if(_555.actionPath==null){
return false;
}
this.queueDiv=_555.queueDiv;
this.actionPath=_555.actionPath;
if(this.actionPath.indexOf("?")!=-1){
this.actionPath+="&";
}else{
this.actionPath+="?";
}
this.actionPath+="position="+this.droppedPosition;
return true;
}else{
return false;
}
}
catch(e){
this.log("BBDroppable.prepareAjaxRequest(): "+e.message);
return false;
}
},processResponse:function(_556){
try{
if(_556.loadAsOverlay==true){
Overlay=new popupContentHandler(_556,"boxPopup",null);
Overlay.execute();
this.setCursors("default");
document.body.style.cursor="default";
}else{
DndUtil.clearQueueDragAndDrop();
this.queueDiv.innerHTML=_556.responseBody;
var _557=document.getElementById("mQueueCorners");
if(_557){
_557.style.display="none";
_557.style.display="block";
}
new UpdateButtons().update(_556);
DndUtil.registerQueueDragAndDrop();
this.setCursors("default");
}
}
catch(e){
this.log("BBDroppable.processResponse(): "+e.message);
}
},handleError:function(){
this.setCursors("default");
},setCursors:function(_558){
try{
nodes=this.queueDiv.childNodes;
for(i=0;i<nodes.length;i++){
if(nodes[i].nodeType==1){
nodes[i].style.cursor=_558;
}
}
this.queueDiv.style.cursor=_558;
document.body.style.cursor=_558;
}
catch(e){
this.log("BBDroppable.setCursors(): "+e.message);
}
},canAccept:function(_559){
try{
for(var i=0;i<_559.length;i++){
if(_559[i]==null){
return false;
}
}
return true;
}
catch(e){
this.log("BBDroppable.canAccept(): "+e.message);
return false;
}
},displayDetails:function(_55b){
},showLoading:function(evt){
},showFailure:function(evt){
},log:function(msg){
logger.error(msg);
}});
var DndUtil=Class.create();
DndUtil.createDropZones=function(el){
try{
this.htmlElement=$(el);
if(this.htmlElement==null){
return;
}
var _560=this.htmlElement.childNodes;
if(_560==null||_560.length==0){
return;
}
this.marker=$("dropmarker");
if(this.marker==null){
return;
}
for(i=0;i<_560.length;i++){
if(_560[i].nodeType==1){
dndBBMgr.registerDropZone(new BBDroppable(_560[i],this.marker,i));
}
}
}
catch(e){
logger.error("DndUtil.createDropZones(): "+e.message);
}
};
DndUtil.clearQueueDragAndDrop=function(){
try{
dndBBMgr.clearDropZones();
dndBBMgr.clearDraggables("QueueDraggable");
}
catch(e){
logger.error("DndUtil.clearQueueDragAndDrop(): "+e.message);
}
};
DndUtil.registerQueueDragAndDrop=function(){
try{
DndUtil.createDropZones("queueCurrentList");
DndUtil.createQueueDraggables("queueCurrentList");
}
catch(e){
logger.error("DndUtil.registerQueueDragAndDrop(): "+e.message);
}
};
DndUtil.createQueueDraggables=function(el){
try{
this.htmlElement=$(el);
if(this.htmlElement==null){
return;
}
var _562=this.htmlElement.childNodes;
if(_562==null||_562.length==0){
return;
}
for(var i=0;i<_562.length;i++){
if(_562[i].nodeType==1){
dndBBMgr.registerDraggable(new QueueDraggable(_562[i]));
}
}
}
catch(e){
logger.error("DndUtil.createQueueDraggables(): "+e.message);
}
};
var QueueDraggable=Class.create();
QueueDraggable.prototype=(new BBDraggable()).extend({initialize:function(el){
this.type="QueueDraggable";
this.htmlElement=$(el);
this.actionPath=null;
this.queueType=null;
this.queueDiv=$("queueContentsContainer");
this.movieTitle="Untitled";
this.titleElement=null;
this.anchorElement=null;
this.titleRollover=null;
this.posElement=null;
this.moveTopElement=null;
this.removeElement=null;
this.ratingElement=null;
this.queueFormatElement=null;
if(this.htmlElement==null){
return;
}
this.extractDataFromQueueTag();
if(this.queueType!=null&&this.queueType=="full"){
this.handleFullQueueDraggable();
}
},extractDataFromQueueTag:function(){
try{
var _565=this.htmlElement.getElementsByTagName("qi")[0];
if(_565==null||_565.length==0){
return;
}
this.queueType=_565.getAttribute("queueType").toLowerCase();
if(this.queueType!="mini"&&this.queueType!="full"){
return;
}
var _566=_565.getAttribute("setId");
var _567=_565.getAttribute("itemId");
if(_565.getAttribute("movieTitle")!=null){
this.movieTitle=_565.getAttribute("movieTitle");
}
var _568="";
if(this.queueType=="mini"){
_568="miniQueue";
}else{
_568="fullQueue";
}
if(_566!=null&&_566.length>0){
this.actionPath="/queuemgmt/"+_568+"/moveSet?setId="+_566;
}else{
if(_567!=null&&_567.length>0){
this.actionPath="/queuemgmt/"+_568+"/moveItem?itemId="+_567;
}
}
}
catch(e){
this.log("QueueDraggable.getActionPath(): "+e.message);
}
},getSingleObjectDragGUI:function(e){
try{
var div=document.createElement("div");
div.className="MovieItemUI dragToQLabel";
var _56b=this.movieTitle;
while(_56b.indexOf(" ")!=-1){
_56b=_56b.replace(" ","&nbsp;");
}
div.style.zIndex="1000";
new Insertion.Top(div,_56b);
return div;
}
catch(e){
this.log("QueueDraggable.getSingleObjectDragGUI(): "+e.message);
return null;
}
},handleFullQueueDraggable:function(){
this.killDraggingBasedOnClass();
this.findTitleElement();
if(this.titleElement==null){
return;
}
this.findAnchorElement();
if(this.anchorElement==null){
return;
}
this.titleRollover=new Rollover(this.titleElement,this.anchorElement);
},findTitleElement:function(){
try{
var divs=this.htmlElement.getElementsByTagName("div");
if(divs!=null&&divs.length>0){
for(var i=0;i<divs.length;i++){
if(divs[i].className!=null&&divs[i].className.indexOf("title")!=-1){
this.titleElement=divs[i];
break;
}
}
}
}
catch(e){
this.log("QueueDraggable.findTitleElement(): "+e.message);
}
},findAnchorElement:function(){
try{
var _56e=this.titleElement.getElementsByTagName("a");
if(_56e!=null&&_56e.length>0){
if(_56e[0].getAttribute("href")!=null&&_56e[0].getAttribute("href").length>0){
this.anchorElement=_56e[0];
}
}
}
catch(e){
this.log("QueueDraggable.findAnchorElement(): "+e.message);
}
},killDraggingBasedOnClass:function(){
try{
this.posElement=document.getElementsByClassName("bvr-pos",this.htmlElement)[0];
this.moveTopElement=document.getElementsByClassName("bvr-qmovetop",this.htmlElement)[0];
this.removeElement=document.getElementsByClassName("bvr-qremove",this.htmlElement)[0];
this.ratingElement=document.getElementsByClassName("bvr-rating",this.htmlElement)[0];
this.queueFormatElement=document.getElementsByClassName("bvr-qformat",this.htmlElement)[0];
if(this.posElement!=null){
this.handlerTextChange=this.onPositionChange.bindAsEventListener(this);
Event.observe(this.posElement,"change",this.handlerTextChange);
Event.observe(this.posElement,"mousedown",this.eventSoak);
}
if(this.moveTopElement!=null){
Event.observe(this.moveTopElement,"mousedown",this.eventSoak);
}
if(this.removeElement!=null){
Event.observe(this.removeElement,"mousedown",this.eventSoak);
}
if(this.ratingElement!=null){
Event.observe(this.ratingElement,"mousedown",this.eventSoak);
}
if(this.queueFormatElement!=null){
Event.observe(this.queueFormatElement,"mousedown",this.eventSoak);
}
}
catch(e){
this.log("QueueDraggable.killDraggingBasedOnClass(): "+e.message);
}
},eventSoak:function(e){
Event.stop(e);
},onPositionChange:function(){
var _570=this.posElement.value;
if(isNaN(_570)||parseInt(_570)<=0){
this.posElement.value=this.posElement.id;
}
},toString:function(){
var _571="";
_571="this.type: "+this.type+"<br/>";
_571+="this.htmlElement: "+this.htmlElement+"<br/>";
_571+="this.actionPath: "+this.actionPath+"<br/>";
_571+="this.movieTitle: "+this.movieTitle+"<br/>";
_571+="this.titleElement: "+this.titleElement+"<br/>";
_571+="this.titleRollover: "+this.titleRollover+"<br/>";
return _571;
},log:function(msg){
logger.error(msg);
}});
var QueuePosition=Class.create();
QueuePosition.prototype.initialize=function(){
};
QueuePosition.position=function(){
if(!document.getElementById){
return;
}
if(!this._oHead||!this._oNav||!this._oQueue||!this._oContents||!this._oReco||(this._oQueue.className.indexOf("mQueue")==-1)){
return;
}
this._oRecent=$("queueRecent");
this._oRecos=$("reco");
var _573=0;
var _574=12;
var _575=9;
var _576=(this._oHead.offsetHeight+this._oNav.offsetHeight+_573+(this._oRecos?this._oRecos.offsetHeight+_574:0));
var _577=_576-window.pageYOffset;
var _578=window.innerHeight-(_577>0?_577:0)-_575;
if(_578<document.body.offsetHeight){
this._oQueue.style.maxHeight=document.body.offsetHeight+"px";
}else{
this._oQueue.style.maxHeight=_578+"px";
}
this._oQueue.style.zIndex="5";
this._oContents.style.height="auto";
this._oContents.style.position="relative";
if(_577<1){
this._oQueue.style.width=(this._oReco.offsetWidth)+"px";
this._oQueue.style.position="fixed";
this._oQueue.style.top="0";
}else{
this._oQueue.style.position="relative";
this._oQueue.style.width="auto";
this._oQueue.style.top="0";
}
if(this._oRecent){
this._oRecent.style.position="relative";
this._oRecent.style.left="0";
this._oRecent.style.zIndex="3";
var _579=this._oQueue.offsetHeight-this._oContents.offsetHeight;
if(_579>0){
_579=0;
}
this._oRecent.style.top=_579+"px";
}
};
function Main(){
if(window.MainHasRun){
return;
}
window.MainHasRun=true;
var _57a=new QueuePosition();
_57a._oHead=$("head");
_57a._oNav=$("nav");
_57a._oQueue=$("queue");
_57a._oRecent=$("queueRecent");
_57a._oContents=$("qContents");
_57a._oReco=$("reco");
if(!document.all){
QueuePosition.position();
Event.observe(window,"scroll",QueuePosition.position.bind(_57a));
Event.observe(window,"resize",QueuePosition.position.bind(_57a));
setInterval("QueuePosition.position();",500);
}
DndUtil.windowLoaded=true;
}
Event.observe(window,"DOMContentLoaded",Main);
Event.observe(window,"load",Main);
var Queue=Class.create();
Queue.prototype={initialize:function(el,_57c,_57d){
this.el=$(el);
this.queueDiv=$("queueContentsContainer");
this.updateMiniQueue=true;
this.cartDiv=$("miniCart");
this.titleId=null;
this.packageId=null;
this.productId=null;
this.listName=null;
this.catalystInfo=null;
this.catalystUrl=location.href;
this.movieTitle="Untitled";
this.url=null;
this.tempUrl=null;
this.movieTag=null;
this.position=(_57c!=null&&_57c.length>0)?_57c:-1;
this.completeAction=true;
this.movieDiv=null;
this.movieId=null;
this.expanded=true;
this.mainParentNode=null;
this.similarMoviesUrl=_57d;
this.actionType="";
this.saveQ=false;
this.overloadRunning="false";
if(this.el==null){
this.completeAction=false;
return this;
}
this.url=this.el.getAttribute("href");
this.tempUrl=this.url;
if(this.queueDiv==null){
this.updateMiniQueue=false;
if(this.cartDiv==null){
this.completeAction=false;
}
}
this.url=this.el.getAttribute("href");
if(this.url==null||this.url.length==0){
this.completeAction=false;
return this;
}
tokens=this.url.split("?");
var id=null;
if(tokens==null){
this.completeAction=false;
return this;
}
this.url=tokens[0];
if(tokens.length>1){
var _57f=tokens[1].split("&");
this.movieId=_57f[0].split("=")[1];
var _580=_57f[1].split("/");
if(_580.length>1){
if(_580[0].split("=")[1]=="true"){
this.saveQ=true;
}
this.overloadRunning=_580[1];
this.url=this.url+"/overlay";
}else{
if(_57f[1].split("=")[1]=="true"){
this.saveQ=true;
}
}
}
this.mainParentNode=this.findParent(this.el);
return this;
},log:function(msg){
logger.error(msg);
},readCookie:function(name){
var _583=name+"=";
var ca=document.cookie.split(";");
for(var i=0;i<ca.length;i++){
var c=ca[i];
while(c.charAt(0)==" "){
c=c.substring(1,c.length);
}
if(c.indexOf(_583)==0){
return c.substring(_583.length,c.length);
}
}
return null;
},add:function(){
try{
this.url=this.url.replace(/^https?:\/\/[^\/]+/,"");
if((this.readCookie("BB_SA_COOKIE")==null&&this.readCookie("BB_HA_COOKIE")==null)){
this.processAnonUser();
return this;
}
if(this.el.getAttribute("addClicked")!=null){
return true;
}
this.actionType="add";
this.movieDiv=$(this.movieId);
if(this.movieDiv==null){
this.overloadRunning="true";
return false;
}
if(this.movieDiv.getElementsByTagName("mt")!=null&&this.movieDiv.getElementsByTagName("mt").length>0){
this.movieTag=this.movieDiv.getElementsByTagName("mt")[0];
this.titleId=this.movieTag.getAttribute("titleId");
this.facebookTitleId=this.titleId;
}else{
if(this.movieDiv.getElementsByTagName("mpkg")!=null&&this.movieDiv.getElementsByTagName("mpkg").length>0){
this.movieTag=this.movieDiv.getElementsByTagName("mpkg")[0];
this.packageId=this.movieTag.getAttribute("packageId");
}else{
if(this.movieDiv.getElementsByTagName("mpr")!=null&&this.movieDiv.getElementsByTagName("mpr").length>0){
this.movieTag=this.movieDiv.getElementsByTagName("mpr")[0];
this.productId=this.movieTag.getAttribute("productId");
}
}
}
this.listName=this.movieTag.getAttribute("listName");
this.catalystInfo=this.movieTag.getAttribute("catalystInfo");
var _587=this.movieDiv.getElementsByTagName("a");
if(_587!=null){
this.movieTitle=_587[0].getAttribute("title");
}
var _588=new Array();
if(this.titleId!=null){
_588["titleId"]=this.titleId;
}
if(this.packageId!=null){
_588["packageId"]=this.packageId;
}
if(this.productId!=null){
_588["productId"]=this.productId;
}
if(this.listName!=null){
_588["listName"]=this.listName;
}
if(this.catalystUrl!=null){
_588["catalystUrl"]=this.catalystUrl;
}
if(this.catalystInfo!=null){
_588["catalystInfo"]=this.catalystInfo;
}
_588["position"]=this.position;
this.url=this.urlWithQueryString(this.url,_588);
this.setCursors("wait");
this.el.setAttribute("addClicked","true");
new BaseHandler().processAjaxRequest(this.url,"",this.processResponse.bind(this),this.handleError.bind(this));
return true;
}
catch(e){
this.log("Queue.add(): "+e.message);
return false;
}
},moveSet:function(_589){
try{
if(!this.completeAction){
return;
}
var _58a=new Array();
if(_589!=null){
_58a["setId"]=_589;
}
_58a["position"]=this.position;
this.url=this.urlWithQueryString(this.url,_58a);
this.setCursors("wait");
(new BaseHandler()).processAjaxRequest(this.url,"",this.processResponse.bind(this),this.handleError.bind(this));
}
catch(e){
this.log("Queue.moveSet(): "+e.message);
return;
}
},moveItem:function(_58b){
try{
if(!this.completeAction){
return;
}
var _58c=new Array();
if(_58b!=null){
_58c["itemId"]=_58b;
}
_58c["position"]=this.position;
this.url=this.urlWithQueryString(this.url,_58c);
this.setCursors("wait");
(new BaseHandler()).processAjaxRequest(this.url,"",this.processResponse.bind(this),this.handleError.bind(this));
}
catch(e){
this.log("Queue.moveItem(): "+e.message);
return;
}
},removeSet:function(_58d){
try{
if(!this.completeAction){
return;
}
var _58e=new Array();
if(_58d!=null){
_58e["setId"]=_58d;
}
this.url=this.urlWithQueryString(this.url,_58e);
this.setCursors("wait");
(new BaseHandler()).processAjaxRequest(this.url,"",this.processResponse.bind(this),this.handleError.bind(this));
}
catch(e){
this.log("Queue.removeSet(): "+e.message);
return;
}
},removeItem:function(_58f){
try{
if(!this.completeAction){
return;
}
var _590=new Array();
if(_58f!=null){
_590["itemId"]=_58f;
}
this.url=this.urlWithQueryString(this.url,_590);
this.setCursors("wait");
(new BaseHandler()).processAjaxRequest(this.url,"",this.processResponse.bind(this),this.handleError.bind(this));
}
catch(e){
this.log("Queue.removeItem(): "+e.message);
return;
}
},breakSet:function(_591){
try{
if(!this.completeAction){
return;
}
if(_591==null||_591.length==0){
return;
}
if(confirm("This will break up this set/series, do you want to proceed?")){
var _592=new Array();
if(_591!=null){
_592["setId"]=_591;
}
this.url=this.urlWithQueryString(this.url,_592);
this.setCursors("wait");
(new BaseHandler()).processAjaxRequest(this.url,"",this.processResponse.bind(this),this.handleError.bind(this));
}
}
catch(e){
this.log("Queue.breakSet(): "+e.message);
return;
}
},refresh:function(){
try{
this.url="/queuemgmt/updateQueue";
(new BaseHandler()).processAjaxRequest(this.url,"",this.processResponse.bind(this),this.handleError.bind(this));
}
catch(e){
this.log("Queue.refresh(): "+e.message);
return;
}
},processResponse:function(_593){
try{
if(this.overloadRunning!="true"&&_593.loadAsOverlay=="true"){
if(this.actionType=="add"&&this.facebookTitleId!=null){
s.linkTrackVars="eVar7,events";
s.linkTrackEvents="event5";
s.events="event5";
if(this.position==-1&&this.saveQ==true){
s.eVar7="Queue Actions Save to Queue";
}else{
if(this.position==-1){
s.eVar7="Queue Actions Add to Queue";
}else{
if(this.position==0){
s.eVar7="Queue Actions Go to Top";
}
}
}
s.eVar8="";
s.tl(this,"o","Queue Action Add/Save/Top");
}
try{
if(_593.titleIds==null||_593.packageIds==null||_593.productIds==null){
return;
}
var _594=null;
if(this.titleId!=null){
_594="title";
}
if(this.packageId!=null){
_594="package";
}
if(this.productId!=null){
_594="product";
}
var _595="/queuemgmt/queue/overlay/"+_594+"/"+this.movieId;
Queue.overlay=new QueueOverlay(_595,"boxPopup","",null);
Queue.overlay.execute();
}
catch(e){
this.log("Queue.processResponse(): "+e.message);
}
if(this.updateMiniQueue==true){
DndUtil.clearQueueDragAndDrop();
this.queueDiv.innerHTML=_593.responseBody;
var _596=document.getElementById("mQueueCorners");
if(_596){
_596.style.display="none";
_596.style.display="block";
}
DndUtil.registerQueueDragAndDrop();
}
new UpdateButtons().update(_593);
this.setCursors("");
this.el.removeAttribute("addClicked");
}else{
if(_593.loadAsOverlay==true){
Overlay=new popupContentHandler(_593,"boxPopup",null);
Overlay.execute();
this.el.removeAttribute("addClicked");
this.setCursors("default");
this.el.style.cursor="pointer";
}else{
if(this.updateMiniQueue==true){
DndUtil.clearQueueDragAndDrop();
this.queueDiv.innerHTML=_593.responseBody;
var _596=document.getElementById("mQueueCorners");
if(_596){
_596.style.display="none";
_596.style.display="block";
}
DndUtil.registerQueueDragAndDrop();
}
new UpdateButtons().update(_593);
this.setCursors("default");
if(this.actionType!="add"&&this.position==0){
s.linkTrackVars="eVar7,events";
s.linkTrackEvents="event5";
s.events="event5";
s.eVar7="Queue Actions Go to Top";
s.eVar8="";
s.tl(this,"o","Queue Action Go to Top");
}
if(this.actionType=="add"&&this.facebookTitleId!=null){
if(this.facebookTitleId!=null){
fbEvent.publish_event("queue","/aff/p.26880/catalog/movieDetails/"+this.facebookTitleId);
}
s.linkTrackVars="eVar7,events";
s.linkTrackEvents="event5";
s.events="event5";
if(this.position==-1&&this.saveQ==true){
s.eVar7="Queue Actions Save to Queue";
}else{
if(this.position==-1){
s.eVar7="Queue Actions Add to Queue";
}else{
if(this.position==0){
s.eVar7="Queue Actions Go to Top";
}
}
}
s.eVar8="";
s.tl(this,"o","Queue Action Add/Save/Top");
}
}
}
}
catch(e){
this.log("Queue.processResponse(): "+e.message);
}
},handleError:function(){
this.setCursors("default");
this.el.removeAttribute("addClicked");
this.el.style.cursor="pointer";
},setCursors:function(_597){
this.el.style.cursor=_597;
document.body.style.cursor=_597;
if(this.mainParentNode!=null){
this.mainParentNode.style.cursor=_597;
}
},findParent:function(el){
try{
if(el.getAttribute("id")!=null){
if(el.getAttribute("id")==this.movieId){
return el;
}else{
return this.findParent(el.parentNode);
}
}else{
return this.findParent(el.parentNode);
}
}
catch(e){
return null;
}
},processAnonUser:function(){
try{
var _599=null;
var _59a=null;
if(this.tempUrl.indexOf("addTitleToQueue")>0){
this.movieType="title";
}else{
if(this.tempUrl.indexOf("addPackageToQueue")>0){
this.movieType="package";
}else{
this.movieType="product";
}
}
var _59b=this.tempUrl.split("?");
if(_59b.length>1){
var _59c=_59b[1].split("&");
this.movieID=_59c[0].split("=")[1];
}
var _59d="/queuemgmt/Queue/anonUserAddToQueue/"+this.movieType+"/"+this.movieID+"/find/false";
new BaseHandler().processAjaxRequest(_59d,"",this.processResponse.bind(this),this.handleError.bind(this));
}
catch(e){
this.log("Queue.processAnonUser(): "+e.message);
}
return this;
},urlWithQueryString:function(url,_59f){
var hash=$H(_59f);
var _5a1=hash.toQueryString();
if(_5a1!=null&&_5a1.length>0){
url+="?"+_5a1;
}
return url;
}};
Queue.expandCollapse=function(el,_5a3){
if(_5a3==null||_5a3.length==0){
return;
}
this.el=$(el);
expandCollapseEl=$(_5a3);
if(expandCollapseEl==null){
return;
}
var _5a4=getCookie("browsingSession");
if(_5a4=="block"){
expandCollapseEl.style.display="none";
this.el.parentNode.className="toggleExpand";
setCookie("browsingSession","none","100");
}else{
expandCollapseEl.style.display="block";
this.el.parentNode.className="toggle";
setCookie("browsingSession","block","100");
}
};
Queue.getSplashPageUrl=function(){
var url=window.location.href;
var _5a6="http://";
if(url.indexOf("http://")!=-1){
url=url.substring(7);
}else{
if(url.indexOf("https://")!=-1){
_5a6="https://";
url=url.substring(8);
}
}
serverAndPort=url.substring(0,url.indexOf("/")+1);
return (_5a6+serverAndPort);
};
Queue.getTitleUrl=function(_5a7){
var url=window.location.href;
var _5a9="http://";
if(url.indexOf("http://")!=-1){
url=url.substring(7);
}else{
if(url.indexOf("https://")!=-1){
_5a9="https://";
url=url.substring(8);
}
}
serverAndPort=url.substring(0,url.indexOf("/")+1);
return (_5a9+serverAndPort+"/aff/p.26880//catalog/movieDetails/"+_5a7);
};
var UpdateButtons=Class.create();
UpdateButtons.prototype={initialize:function(){
},log:function(msg){
logger.error(msg);
},update:function(_5ab){
try{
if(_5ab.titleIds==null||_5ab.packageIds==null||_5ab.productIds==null){
return;
}
this.updateByTitleIds(_5ab.titleIds);
this.updateByPackageIds(_5ab.packageIds);
this.updateByProductIds(_5ab.productIds);
}
catch(e){
this.log("UpdateButtons.update(): "+e.message);
}
},updateByTitleIds:function(_5ac){
try{
tags=document.getElementsByTagName("mt");
this.updateMovieDivs(tags,_5ac,"titleId");
}
catch(e){
this.log("UpdateButtons.updateByTitleIds(): "+e.message);
}
},updateByPackageIds:function(_5ad){
try{
tags=document.getElementsByTagName("mpkg");
this.updateMovieDivs(tags,_5ad,"packageId");
}
catch(e){
this.log("UpdateButtons.updateByPackageIds(): "+e.message);
}
},updateByProductIds:function(_5ae){
try{
tags=document.getElementsByTagName("mpr");
this.updateMovieDivs(tags,_5ae,"productId");
}
catch(e){
this.log("UpdateButtons.updateByProductIds(): "+e.message);
}
},updateMovieDivs:function(_5af,ids,_5b1){
try{
for(i=0;i<_5af.length;i++){
id=_5af[i].getAttribute(_5b1);
parentNode=_5af[i].parentNode;
if(id==null){
continue;
}
if(ids[id]!=null&&ids[id]){
Element.addClassName(parentNode,"inQueue");
}
}
}
catch(e){
this.log("UpdateButtons.updateMovieDivs(): "+e.message);
}
}};
var QueueOverlay=Class.create();
QueueOverlay.prototype=(new popupUrlHandler()).extend({updatePosition:function(){
var head=$("head");
var nav=$("nav");
var _5b4=(head?head.offsetHeight:0)+(nav?nav.offsetHeight:0)+8;
if(_5b4<0){
_5b4=20;
}
this.divEl.style.top=this.scrollOffset()+_5b4+"px";
}});
var RegisteredUserOverlay=Class.create();
RegisteredUserOverlay.prototype={initialize:function(el,URL){
this.el=$(el);
this.Url=URL;
},add:function(){
try{
new BaseHandler().processAjaxRequest(this.Url,"",this.processResponse.bind(this),this.handleError.bind(this));
}
catch(e){
this.log("RegisteredUserOverlay.add(): "+e.message);
}
},processResponse:function(_5b7){
try{
if(_5b7.loadAsOverlay==true){
Overlay=new popupContentHandler(_5b7,"boxPopup",null);
Overlay.execute();
this.setCursors("default");
this.el.style.cursor="pointer";
}
}
catch(e){
this.log("RegisteredUserOverlay.processResponse(): "+e.message);
}
},setCursors:function(_5b8){
this.el.style.cursor=_5b8;
document.body.style.cursor=_5b8;
if(this.mainParentNode!=null){
this.mainParentNode.style.cursor=_5b8;
}
},handleError:function(){
this.setCursors("default");
this.el.removeAttribute("addClicked");
this.el.style.cursor="pointer";
}};
var Cart=Class.create();
Cart.prototype={initialize:function(el,_5ba){
this.el=$(el);
this.similarMoviesUrl=_5ba;
this.cartDiv=$("cartContentsContainer");
this.url=null;
this.jsonResponse=null;
this.objectId=null;
this.objectType=null;
this.listName=null;
this.catalystInfo=null;
this.pageName=location.href;
this.movieId=null;
this.marketingId=null;
if(this.el!==null){
this.url=this.el.getAttribute("href");
}
},log:function(msg){
logger.error(msg);
},addMarketing:function(){
try{
if(this.url==null||this.url.length==0){
return true;
}
if(this.el.getAttribute("addClicked")!=null){
return false;
}
tokens=this.similarMoviesUrl.split("/");
if(tokens.length>1){
this.marketingId=tokens[4];
}
this.objectType="FOH Marketing";
var _5bc=new Array();
if(this.listName!=null){
_5bc["listName"]=this.listName;
}
if(this.pageName!=null){
_5bc["pageName"]=this.pageName;
}
if(this.catalystInfo!=null){
_5bc["catalystInfo"]=this.catalystInfo;
}
if(this.marketingId!=null){
_5bc["objectId"]=this.marketingId;
}
if(this.objectType!=null){
_5bc["objectType"]=this.objectType;
}
this.url=this.urlAppendQueryString(this.url,_5bc);
this.setCursors("wait");
this.el.setAttribute("addClicked","true");
new BaseHandler().processAjaxRequest(this.url,"",this.storeAjaxResponse.bind(this),this.handleError.bind(this));
return false;
}
catch(e){
this.log("Cart.addMarketing(): "+e.message);
return true;
}
},add:function(){
try{
if(this.url==null||this.url.length==0){
return true;
}
if(this.el.getAttribute("addClicked")!=null){
return false;
}
tokens=this.similarMoviesUrl.split("/");
if(tokens.length>1){
this.movieId=tokens[5];
}
this.movieDiv=$(this.movieId);
if(this.movieDiv==null){
return false;
}
if(this.movieDiv.getElementsByTagName("mt")!=null&&this.movieDiv.getElementsByTagName("mt").length>0){
this.movieTag=this.movieDiv.getElementsByTagName("mt")[0];
this.objectId=this.movieTag.getAttribute("titleId");
this.objectType="Title";
}else{
if(this.movieDiv.getElementsByTagName("mpkg")!=null&&this.movieDiv.getElementsByTagName("mpkg").length>0){
this.movieTag=this.movieDiv.getElementsByTagName("mpkg")[0];
this.objectId=this.movieTag.getAttribute("packageId");
this.objectType="Package";
}else{
if(this.movieDiv.getElementsByTagName("mpr")!=null&&this.movieDiv.getElementsByTagName("mpr").length>0){
this.movieTag=this.movieDiv.getElementsByTagName("mpr")[0];
this.objectId=this.movieTag.getAttribute("productId");
this.objectType="Product";
}
}
}
this.listName=this.movieTag.getAttribute("listName");
this.catalystInfo=this.movieTag.getAttribute("catalystInfo");
var _5bd=new Array();
if(this.listName!=null){
_5bd["listName"]=this.listName;
}
if(this.pageName!=null){
_5bd["pageName"]=this.pageName;
}
if(this.catalystInfo!=null){
_5bd["catalystInfo"]=this.catalystInfo;
}
if(this.objectId!=null){
_5bd["objectId"]=this.objectId;
}
if(this.objectType!=null){
_5bd["objectType"]=this.objectType;
}
this.url=this.urlWithQueryString(this.url,_5bd);
this.setCursors("wait");
this.el.setAttribute("addClicked","true");
new BaseHandler().processAjaxRequest(this.url,"",this.storeAjaxResponse.bind(this),this.handleError.bind(this));
return false;
}
catch(e){
this.log("Cart.add(): "+e.message);
return true;
}
},update:function(_5be,_5bf,url){
try{
this.url=url;
this.updateDiv=_5bf;
this.el=$(_5bf);
new FormHandler(_5be,_5bf,"get","",this.cartUpdated.bind(this)).submit();
}
catch(e){
this.log("Cart.update(): "+e.message);
}
},createBoxPopup:function(){
var div=document.createElement("div");
div.setAttribute("id","boxPopup");
document.body.appendChild(div);
},createPageMask:function(){
var div=document.createElement("div");
div.setAttribute("id","pageMask");
document.body.appendChild(div);
},storeAjaxResponse:function(_5c3){
this.jsonResponse=_5c3;
if(this.jsonResponse.pkgAlreadyInCart!=null){
s.linkTrackVars="events";
s.linkTrackEvents="scAdd";
s.events="scAdd";
s.eVar8="";
s.tl(this,"o","Shopping cart add");
if(this.similarMoviesUrl!==null&&this.similarMoviesUrl.length>0){
if(this.jsonResponse.pkgAlreadyInCart=="true"){
this.similarMoviesUrl+="/true";
}else{
this.similarMoviesUrl+="/false";
}
Cart.overlay=new MiniCartOverlay(this.similarMoviesUrl,"boxPopup","",this.processResponse.bind(this));
Cart.overlay.execute();
}
}else{
this.setCursors("");
}
},processResponse:function(){
try{
if(this.cartDiv!=null&&this.jsonResponse.pkgAddedToCart=="true"&&this.jsonResponse.pkgAlreadyInCart!="true"){
this.showMiniCartContainer();
this.cartDiv.innerHTML=this.jsonResponse.responseBody;
$("headerShoppingCart").innerHTML="Shopping Cart ("+this.jsonResponse.movieQuantityInCart+")";
}
this.setCursors("");
this.el.removeAttribute("addClicked");
}
catch(e){
this.log("Cart.processResponse(): "+e.message);
}
},cartUpdated:function(_5c4){
try{
if(this.url==null||this.url.length==0){
return;
}
if($("cartContentsContainer")!=null){
this.quantityUpdatedJsonResponse=_5c4;
this.cartDiv=$("miniCartQuantity");
if(this.cartDiv===null){
return;
}
this.setCursors("wait");
new BaseHandler().processAjaxRequest(this.url,"",this.processUpdateResponse.bind(this),this.handleError.bind(this));
}else{
$(this.updateDiv).innerHTML=_5c4.responseBody;
}
}
catch(e){
this.log("Cart.cartUpdated(): "+e.message);
}
},processUpdateResponse:function(_5c5){
try{
$(this.updateDiv).innerHTML=this.quantityUpdatedJsonResponse.responseBody;
this.showMiniCartContainer();
this.cartDiv.innerHTML=_5c5.responseBody;
$("headerShoppingCart").innerHTML="Shopping Cart ("+_5c5.movieQuantityInCart+")";
this.setCursors("");
}
catch(e){
this.log("Cart.processUpdateResponse(): "+e.message);
}
},handleError:function(){
this.setCursors("");
},showMiniCartContainer:function(){
if($("miniCart").style.display=="none"){
$("miniCart").style.display="block";
$("miniCartEmpty").style.display="none";
}
},setCursors:function(_5c6){
this.el.style.cursor=_5c6;
document.body.style.cursor=_5c6;
},urlWithQueryString:function(url,_5c8){
var hash=$H(_5c8);
var _5ca=hash.toQueryString();
if(_5ca!=null&&_5ca.length>0){
url+="?"+_5ca;
}
return url;
},urlAppendQueryString:function(url,_5cc){
var hash=$H(_5cc);
var _5ce=hash.toQueryString();
if(_5ce!=null&&_5ce.length>0){
url+=_5ce;
}
return url;
}};
Cart.expandCollapse=function(el,_5d0){
if(_5d0==null||_5d0.length==0){
return;
}
this.el=$(el);
expandCollapseEl=$(_5d0);
if(expandCollapseEl==null){
return;
}
if(getCookie("browsingSession")=="block"){
expandCollapseEl.style.display="none";
this.el.parentNode.className="toggleExpand";
setCookie("outletBrowsingSession","none","100");
}else{
expandCollapseEl.style.display="block";
this.el.parentNode.className="toggle";
setCookie("outletBrowsingSession","block","100");
}
};
var MiniCartOverlay=Class.create();
MiniCartOverlay.prototype=(new popupUrlHandler()).extend({updatePosition:function(){
var head=$("head");
var nav=$("nav");
var _5d3=(head?head.offsetHeight:0)+(nav?nav.offsetHeight:0)+8;
if(_5d3<0){
_5d3=20;
}
this.divEl.style.top=this.scrollOffset()+_5d3+"px";
}});
var SelectEdition=Class.create();
SelectEdition.prototype={initialize:function(el,_5d5){
this.el=$(el);
this.editionsUrl=_5d5;
this.cartDiv=$("cartContentsContainer");
this.url=null;
this.jsonResponse=null;
this.movieTitleDetailId=null;
this.moviePackageDetailId=null;
this.saleType=null;
this.movieId=null;
this.movieDiv=null;
this.objectId=null;
this.objectType=null;
this.listName=null;
this.catalystInfo=null;
this.pageName=location.href;
this.movieTag=null;
if(this.el!==null){
this.url=this.el.getAttribute("href");
}
tokens=this.editionsUrl.split("/");
if(tokens.length>1){
this.movieId=tokens[5];
}
},log:function(msg){
logger.error(msg);
},add:function(){
try{
if(this.editionsUrl==null||this.editionsUrl.length==0){
return true;
}
tokens=this.editionsUrl.split("/");
var list=null;
if(tokens.length>6){
list=tokens[6];
}
if(this.el.getAttribute("addClicked")!=null){
return false;
}
if((list!=null)&&((list.toString()=="hdDvdPackage")||(list.toString()=="brDvdPackage"))){
this.editionsUrl="/"+tokens[1]+"/"+tokens[2]+"/"+tokens[3]+"/"+tokens[4]+"/"+tokens[5];
this.listName=list;
this.catalystInfo="A";
}else{
this.movieDiv=$(this.movieId);
if(this.movieDiv==null){
return false;
}
if(this.movieDiv.getElementsByTagName("mt")!=null&&this.movieDiv.getElementsByTagName("mt").length>0){
this.movieTag=this.movieDiv.getElementsByTagName("mt")[0];
}else{
if(this.movieDiv.getElementsByTagName("mpkg")!=null&&this.movieDiv.getElementsByTagName("mpkg").length>0){
this.movieTag=this.movieDiv.getElementsByTagName("mpkg")[0];
}
}
this.listName=this.movieTag.getAttribute("listName");
this.catalystInfo=this.movieTag.getAttribute("catalystInfo");
}
this.objectType="Package";
this.setCursors("wait");
this.el.setAttribute("addClicked","true");
new BaseHandler().processAjaxRequest(this.editionsUrl,"",this.storeAjaxResponse.bind(this),this.handleError.bind(this));
return false;
}
catch(e){
this.log("SelectEdition.add(): "+e.message);
return true;
}
},createBoxPopup:function(){
var div=document.createElement("div");
div.setAttribute("id","boxPopup");
document.body.appendChild(div);
},createPageMask:function(){
var div=document.createElement("div");
div.setAttribute("id","pageMask");
document.body.appendChild(div);
},storeAjaxResponse:function(_5da){
this.jsonResponse=_5da;
this.moviePackageDetailId=_5da.moviePackageDetailId;
this.movieTitleDetailId=_5da.movieTitleDetailId;
this.saleType=_5da.saleType;
if(this.jsonResponse.moviePackageDetailId!=null){
s.linkTrackVars="events";
s.linkTrackEvents="scAdd";
s.events="scAdd";
s.eVar8="";
s.tl(this,"o","Shopping cart add");
var _5db="/outlet/retail/shoppingcart/processAddPackageToShoppingCart?moviePackageId="+_5da.moviePackageDetailId+"&saleType="+_5da.saleType+"&listName="+this.listName+"&catalystInfo="+this.catalystInfo+"&pageName="+this.pageName+"&objectId="+_5da.moviePackageDetailId+"&objectType="+this.objectType;
new BaseHandler().processAjaxRequest(_5db,"",this.storeAddToCartResponse.bind(this),this.handleError.bind(this));
}else{
if(this.jsonResponse.availablePackagesCount=="0"){
window.location=this.url;
}else{
SelectEdition.overlay=new popupUrlHandler(this.editionsUrl,"boxPopup","",this.processResponse.bind(this));
SelectEdition.overlay.execute();
}
}
},storeAddToCartResponse:function(_5dc){
this.jsonResponse=_5dc;
try{
if(this.cartDiv!=null){
this.cartDiv.innerHTML=this.jsonResponse.responseBody;
}
if(this.jsonResponse.pkgAlreadyInCart!=null){
var _5dd="/outlet/minicart/overlay/"+this.movieTitleDetailId+"/"+this.moviePackageDetailId+"/"+this.saleType;
if(this.jsonResponse.pkgAlreadyInCart=="true"){
_5dd+="/true";
}else{
_5dd+="/false";
}
Cart.overlay=new MiniCartOverlay(_5dd,"boxPopup","",this.processAddToCartResponse.bind(this));
Cart.overlay.execute();
}
this.setCursors("");
this.el.removeAttribute("addClicked");
}
catch(e){
this.log("SelectEdition.processResponse(): "+e.message);
}
},processResponse:function(){
try{
this.setCursors("");
this.el.removeAttribute("addClicked");
}
catch(e){
this.log("SelectEdition.processResponse(): "+e.message);
}
},processAddToCartResponse:function(){
try{
this.showMiniCartContainer();
this.cartDiv.innerHTML=this.jsonResponse.responseBody;
$("headerShoppingCart").innerHTML="Shopping Cart ("+this.jsonResponse.movieQuantityInCart+")";
this.setCursors("");
this.el.removeAttribute("addClicked");
}
catch(e){
this.log("SelectEdition.processAddToCartResponse(): "+e.message);
}
},handleError:function(){
this.setCursors("");
},showMiniCartContainer:function(){
if($("miniCart").style.display=="none"){
$("miniCart").style.display="block";
$("miniCartEmpty").style.display="none";
}
},setCursors:function(_5de){
this.el.style.cursor=_5de;
document.body.style.cursor=_5de;
}};
var valueLink=Class.create();
var giftCardNumber;
var pinNumber;
var errorMessage;
valueLink.prototype={initialize:function(_5df,_5e0){
giftCardNumber=(document.getElementsByName("giftCard.clearTextAccountNumber"))[0].value;
pinNumber=(document.getElementsByName("giftCard.pinNumber"))[0].value;
this.divEl=document.getElementById(_5e0);
if(giftCardNumber[0]==""&&pinNumber[0]==""){
this.divEl.innerHTML="<p style='color:red'> Please enter the Gift Card Number and Pin Number</p>";
return false;
}else{
if(giftCardNumber==""){
this.divEl.innerHTML="<p style='color:red'> Please enter the Gift Card Number </p>";
return false;
}else{
if(pinNumber==""){
this.divEl.innerHTML="<p style='color:red'> Please enter the Pin Number </p>";
return false;
}
}
}
this.jsonResponse=null;
this.url=_5df+giftCardNumber+"/"+pinNumber;
},add:function(){
try{
(new BaseHandler()).processAjaxRequest(this.url,"",this.processResponse.bind(this),this.handleError.bind(this));
return false;
}
catch(e){
this.log("ValueLink.add(): "+e.message);
return true;
}
},processResponse:function(_5e1){
BaseHandler.purge(this.divEl);
document.getElementById("checkBalance1").style.display="none";
document.getElementById("checkBalance2").style.display="none";
document.getElementById("currentBalance").style.display="block";
if(_5e1.cardNumber==null){
this.divEl.innerHTML="<p style='color:red'>Please provide a valid gift card and pin number.</p>";
}else{
this.divEl.innerHTML="The remaining balance on <br />GiftCard "+_5e1.cardNumber+" is <b>$"+_5e1.balance+"</b>";
}
s.pageName="Gift Card Balance Check";
void (s.t());
},handleError:function(){
this.divEl.innerHTML="<p style='color:red'> Please provide a valid gift card and pin number.</p>";
}};
var RatingWidget=Class.create();
RatingWidget.prototype={initialize:function(_5e2,_5e3,_5e4){
this.imgEl=$(_5e2);
this.origRating=_5e3;
this.titleId=_5e4;
if(this.imgEl.getAttribute("mapCreated")!=null){
return;
}
var _5e5=this.imgEl.parentNode;
if(_5e5==null){
return;
}
_5e5.setAttribute("origRating",this.origRating);
_5e5.setAttribute("titleId",this.titleId);
this.mapId=RatingWidget.sequence++;
if(!document.all){
this.imgEl.setAttribute("usemap","#ratingMap_"+this.mapId);
}else{
this.imgEl.setAttribute("useMap","#ratingMap_"+this.mapId);
}
var map=document.getElementsByTagName("map");
var _5e7=false;
if(map!=null){
for(i=0;i<map.length;i++){
if(map[i].getAttribute("name").indexOf("ratingMap")!=-1){
_5e7=true;
}
}
}
if(!_5e7){
RatingWidget.setup();
RatingWidget.fillInVersion(this.imgEl.src);
}
var _5e8="<map name=\"ratingMap_"+this.mapId+"\">";
_5e8+="<area shape=\"rect\" title=\"Don&#8217;t show me this movie again.\" coords=\"0,0,12,15\" rating=\"rt-1\">";
_5e8+="<area shape=\"rect\" title=\"I really hated this movie.\" coords=\"12,0,21,15\" rating=\"rt5\">";
_5e8+="<area shape=\"rect\" title=\"I hated this movie.\" coords=\"21,0,29,15\" rating=\"rt10\">";
_5e8+="<area shape=\"rect\" title=\"I really didn&#8217;t like this movie.\" coords=\"29,0,37,15\" rating=\"rt15\">";
_5e8+="<area shape=\"rect\" title=\"I didn&#8217;t like this movie.\" coords=\"37,0,45,15\" rating=\"rt20\">";
_5e8+="<area shape=\"rect\" title=\"This movie was just so-so.\" coords=\"45,0,53,15\" rating=\"rt25\">";
_5e8+="<area shape=\"rect\" title=\"This movie was okay.\" coords=\"53,0,61,15\" rating=\"rt30\">";
_5e8+="<area shape=\"rect\" title=\"I liked this movie.\" coords=\"61,0,69,15\" rating=\"rt35\">";
_5e8+="<area shape=\"rect\" title=\"I really liked this movie.\" coords=\"69,0,77,15\" rating=\"rt40\">";
_5e8+="<area shape=\"rect\" title=\"I loved this movie.\" coords=\"77,0,85,15\" rating=\"rt45\">";
_5e8+="<area shape=\"rect\" title=\"I absolutely loved this movie.\" coords=\"85,0,91,15\" rating=\"rt50\">";
_5e8+="</map>";
var _5e9=document.createElement("div");
_5e9.innerHTML=_5e8;
_5e5.appendChild(_5e9);
var _5ea=_5e9.childNodes[0].childNodes;
for(i=0;i<_5ea.length;i++){
_5ea[i].onmouseover=this.handleMouseOver.bind(this);
_5ea[i].onmouseout=this.handleMouseOut.bind(this);
_5ea[i].onclick=this.handleClick.bind(this);
}
this.imgEl.onmouseover="";
this.imgEl.setAttribute("mapCreated","true");
},handleMouseOver:function(evt){
var _5ec="";
if(!document.all){
_5ec=$(evt.target);
}else{
_5ec=$(event.srcElement);
}
rating=_5ec.getAttribute("rating");
this.ratingWidgetEl=_5ec.parentNode.parentNode.parentNode;
this.ratingWidgetEl.style.cursor="pointer";
(_5ec.parentNode.parentNode.parentNode.getElementsByTagName("img")[0]).src=RatingWidget.getImageSrc(rating);
},handleMouseOut:function(evt){
var _5ee="";
if(!document.all){
_5ee=$(evt.target);
}else{
_5ee=$(event.srcElement);
}
this.ratingWidgetEl.style.cursor="default";
(_5ee.parentNode.parentNode.parentNode.getElementsByTagName("img")[0]).src=RatingWidget.getImageSrc(_5ee.parentNode.parentNode.parentNode.getAttribute("origRating"));
},handleClick:function(evt){
var _5f0="";
if(!document.all){
_5f0=$(evt.target);
}else{
_5f0=$(event.srcElement);
}
this.rating=_5f0.getAttribute("rating");
this.ratingWidgetEl=_5f0.parentNode.parentNode.parentNode;
url="/community/ratingSnippet";
numRating=rating;
if(numRating.indexOf("avg")!=-1){
numRating=numRating.substring(3);
}else{
if(numRating.indexOf("rt")!=-1){
numRating=numRating.substring(2);
}else{
return;
}
}
url+="?titleId="+this.ratingWidgetEl.getAttribute("titleId")+"&rating="+numRating;
this.ratingWidgetEl.style.cursor="wait";
new BaseHandler().processAjaxRequest(url,"",this.processResponse.bind(this),this.handleError.bind(this));
return false;
},processResponse:function(_5f1){
this.ratingWidgetEl.setAttribute("origRating",this.rating);
this.imgEl.src=RatingWidget.getImageSrc(this.rating);
movieRatingEl=document.getElementById("movieRating");
s.linkTrackVars="eVar8,events";
s.linkTrackEvents="event7";
s.events="event7";
s.eVar8=this.rating;
s.prop5="";
s.prop6="";
s.eVar1="";
s.eVar7="";
s.tl(this,"o","Queue Action Rate a movie");
if(movieRatingEl!=null&&movieRatingEl.parentNode.getAttribute("id")==this.titleId){
movieRatingImg=movieRatingEl.getElementsByTagName("img")[0];
movieRatingImg.src=RatingWidget.getImageSrc(this.rating);
}
this.ratingWidgetEl.style.cursor="default";
},handleError:function(){
this.ratingWidgetEl.style.cursor="default";
},handleTimeout:function(_5f2){
alert("Your request has timed out.");
if(this.errorMethod!=null){
this.errorMethod();
}
}};
RatingWidget.sequence=0;
var ratingImage=new Array(24);
RatingWidget.setup=function(){
ratingImage["avg-1"]={path:"/app/@@version@@/img/rating/avg-1.gif",image:new Image()};
ratingImage["avg0"]={path:"/app/@@version@@/img/rating/avg0.gif",image:new Image()};
ratingImage["avg5"]={path:"/app/@@version@@/img/rating/avg5.gif",image:new Image()};
ratingImage["avg10"]={path:"/app/@@version@@/img/rating/avg10.gif",image:new Image()};
ratingImage["avg15"]={path:"/app/@@version@@/img/rating/avg15.gif",image:new Image()};
ratingImage["avg20"]={path:"/app/@@version@@/img/rating/avg20.gif",image:new Image()};
ratingImage["avg25"]={path:"/app/@@version@@/img/rating/avg25.gif",image:new Image()};
ratingImage["avg30"]={path:"/app/@@version@@/img/rating/avg30.gif",image:new Image()};
ratingImage["avg35"]={path:"/app/@@version@@/img/rating/avg35.gif",image:new Image()};
ratingImage["avg40"]={path:"/app/@@version@@/img/rating/avg40.gif",image:new Image()};
ratingImage["avg45"]={path:"/app/@@version@@/img/rating/avg45.gif",image:new Image()};
ratingImage["avg50"]={path:"/app/@@version@@/img/rating/avg50.gif",image:new Image()};
ratingImage["rt-1"]={path:"/app/@@version@@/img/rating/rt-1.gif",image:new Image()};
ratingImage["rt0"]={path:"/app/@@version@@/img/rating/rt0.gif",image:new Image()};
ratingImage["rt5"]={path:"/app/@@version@@/img/rating/rt5.gif",image:new Image()};
ratingImage["rt10"]={path:"/app/@@version@@/img/rating/rt10.gif",image:new Image()};
ratingImage["rt15"]={path:"/app/@@version@@/img/rating/rt15.gif",image:new Image()};
ratingImage["rt20"]={path:"/app/@@version@@/img/rating/rt20.gif",image:new Image()};
ratingImage["rt25"]={path:"/app/@@version@@/img/rating/rt25.gif",image:new Image()};
ratingImage["rt30"]={path:"/app/@@version@@/img/rating/rt30.gif",image:new Image()};
ratingImage["rt35"]={path:"/app/@@version@@/img/rating/rt35.gif",image:new Image()};
ratingImage["rt40"]={path:"/app/@@version@@/img/rating/rt40.gif",image:new Image()};
ratingImage["rt45"]={path:"/app/@@version@@/img/rating/rt45.gif",image:new Image()};
ratingImage["rt50"]={path:"/app/@@version@@/img/rating/rt50.gif",image:new Image()};
};
RatingWidget.fillInVersion=function(_5f3){
try{
if(ratingImage["avg-1"]==null||ratingImage["avg-1"].path==null){
return;
}
if((ratingImage["avg-1"].path).indexOf("@@version@@")==-1){
return;
}
src=_5f3.substring(_5f3.indexOf("app/"));
tokens=src.split("/");
if(tokens.length==0){
return;
}
version=tokens[1];
for(var key in ratingImage){
if(ratingImage[key].path==null||ratingImage[key].path=="undefined"){
continue;
}
ratingImage[key].path=ratingImage[key].path.replace("@@version@@",version);
ratingImage[key].image.src=ratingImage[key].path;
}
}
catch(e){
return;
}
};
RatingWidget.getImageSrc=function(_5f5){
return ratingImage[_5f5].image.src;
};
var Reviews=Class.create();
Reviews.prototype={initialize:function(){
return this;
},write:function(el,_5f7){
this.el=$(el);
this.divId=_5f7;
if(_5f7==null||_5f7.length==0){
this.displayError("Error going to Write a Review");
return;
}
this.url=this.el.getAttribute("href");
if(this.url==null||this.url.length==0){
this.displayError("Error going to Write a Review");
return;
}
new DivReplaceHandler(this.url,this.divId,"loadingOverlay").execute();
},submit:function(el,_5f9){
new FormHandler(el,_5f9,"post","loadingOverlay").submit();
},goBackToReviews:function(el,_5fb){
this.el=$(el);
this.url=this.el.getAttribute("href");
this.divId=_5fb;
if(this.el==null||this.url==null){
return;
}
new DivReplaceHandler(this.url,this.divId,"loadingOverlay").execute();
},updateFeedback:function(el){
this.el=$(el);
if(this.el==null){
return;
}
this.divEl=this.el.parentNode.parentNode;
if(this.divEl==null){
this.displayError("Error updating feedback");
return;
}
this.url=this.el.getAttribute("href");
if(this.url==null||this.url.length==0){
this.displayError("Error updating feedback");
return;
}
new DivReplaceHandler(this.url,this.divEl,"loadingOverlayNoPadding").execute();
},displayError:function(_5fd){
alert(_5fd);
}};
Reviews.toggleReadMore=function(el,_5ff){
if(el==null){
return;
}
anchorEl=$(el);
if(anchorEl==null){
return;
}
divEl=anchorEl.parentNode;
if(divEl==null){
return;
}
parentEl=divEl.parentNode;
if(parentEl==null){
return;
}
childDivs=parentEl.childNodes;
if(childDivs==null||childDivs.length==0){
return;
}
showDivEl=null;
for(i=0;i<childDivs.length;i++){
if(childDivs[i].getAttribute("id")==_5ff){
showDivEl=$(childDivs[i].getAttribute("id"));
break;
}
}
if(showDivEl==null){
return;
}
divEl.style.display="none";
showDivEl.style.display="block";
};
function swapTabs(_600,_601,_602){
_600.blur();
Element.removeClassName(_601+"_tab","active");
hideDiv(_601);
showDiv(_602);
Element.addClassName(_602+"_tab","active");
return false;
}
function checkUncheckAll(_603){
var _604=_603.form,z=0;
for(z=0;z<_604.length;z++){
if(_604[z].type=="checkbox"&&_604[z].name!="checkall"){
_604[z].checked=_603.checked;
}
}
}
function selectAll(_605){
if(!confirm("Do you want to set all movies to "+_605+"?")){
return false;
}
var rb=document.getElementsByClassName(_605);
for(i=0;i<rb.length;i++){
if(!rb[i].checked){
rb[i].checked=true;
}
}
return true;
}
function confirmDelete(_607){
return confirm("Remove "+_607+" from your network?");
}
function changeCheckboxes(form,_609){
for(var z=0;z<form.length;z++){
if(form[z].type=="checkbox"){
form[z].checked=_609;
}
}
}
function goToUrlOnChange(el,url){
var idx=el.selectedIndex;
var _60e=el.options[idx].value;
url+="?viewType="+_60e;
if(url!=null){
window.location.href=url;
}
}
function checkScreenNameAvailability(url,_610,_611,_612){
enteredScreenName=$(_611).value;
currentScreenName=$(_612).value;
new DivReplaceHandler(url+"?enteredScreenName="+enteredScreenName+"&currentScreenName="+currentScreenName+"&screenNameQueryFieldId="+_611,_610,"loadingOverlayNoPadding",null).execute();
}
function openCloseDiv(_613,_614,_615,_616){
var el=$(_613);
var _618=$(_614);
var _619=$(_615);
if(_616=="open"){
el.style.display="block";
_618.style.display="none";
_619.style.display="block";
}else{
el.style.display="none";
_618.style.display="block";
_619.style.display="none";
}
}
function updateFormField(_61a,_61b){
$(_61a).value=_61b;
}
function toggleShowLocation(el,_61d,_61e){
if($(el).checked){
$(_61d).style.display="block";
$(_61e).checked=true;
}else{
$(_61d).style.display="none";
}
}
function updateLocationCity(el,_620){
$(_620).innerHTML=($(el).value.length>0)?$(el).value:"City";
}
function updateLocationStateCode(el,_622,_623){
var _624=$(el).options[$(el).selectedIndex].innerHTML;
if(_624.length==0){
_624="State";
}
$(_622).innerHTML=_624;
$(_623).innerHTML="My location is "+_624;
}
function profileHelpSearch(el,_626,url){
var _628=$(_626);
var _629=url+"?keyword="+_628.value;
window.open(_629,"searchPopupWnd","width=800,height=600,menubar=1,location=1,scrollbars=1,status=1,toolbar=1,resizeable=1");
return false;
}
function setAvatarRadioBtn(_62a,_62b){
var _62c=document.getElementsByName(_62a);
if(_62c!=null&&_62c.length>0){
for(i=0;i<_62c.length;i++){
if(_62c[i].value==_62b){
_62c[i].checked=true;
break;
}
}
}
}
function avatarsRight(_62d){
if(window.avatarPosition==undefined){
avatarPosition=0;
}
avatarPosition=avatarPosition+4;
if(avatarPosition>(_62d-4)){
avatarPosition=_62d-4;
}
if(avatarPosition==_62d-4){
Element.addClassName("avatarRightButton","grayedOut");
}else{
Element.removeClassName("avatarRightButton","grayedOut");
}
if(avatarPosition==0){
Element.addClassName("avatarLeftButton","grayedOut");
}else{
Element.removeClassName("avatarLeftButton","grayedOut");
}
var _62e=110;
new Effect.Move($("scrollerAvatars"),{x:-avatarPosition*_62e,mode:"absolute",delay:0.5});
}
function avatarsLeft(_62f){
if(window.avatarPosition==undefined){
avatarPosition=0;
}
avatarPosition=avatarPosition-4;
if(avatarPosition<0){
avatarPosition=0;
}
if(avatarPosition==_62f-4){
Element.addClassName("avatarRightButton","grayedOut");
}else{
Element.removeClassName("avatarRightButton","grayedOut");
}
if(avatarPosition==0){
Element.addClassName("avatarLeftButton","grayedOut");
}else{
Element.removeClassName("avatarLeftButton","grayedOut");
}
var _630=110;
new Effect.Move($("scrollerAvatars"),{x:-avatarPosition*_630,mode:"absolute",delay:0.5});
}
var Rollover=Class.create();
Rollover.prototype={initialize:function(_631,_632){
this.parentElement=$(_631);
this.draggableElement=$(_632);
if(this.parentElement==null||this.draggableElement==null){
return;
}
this.draggableElementProxy=null;
this.boxart=this.setBoxArt();
this.delayShow=500;
this.delayHide=150;
this.isRolloverShowing=false;
this.elementTimer=null;
this.rolloverTimer=null;
this.rolloverUrl=this.getRolloverContentSrc();
this.rolloverDetails=null;
if(this.rolloverUrl==null){
return;
}
if(Rollover.rolloverElement==null){
this.createRolloverElement();
}
if(Rollover.rolloverElement!=null){
this.draggableElement.onmouseover=this.mousedOver.bindAsEventListener(this);
this.draggableElement.onmouseout=this.mousedOut.bindAsEventListener(this);
}
},getRolloverContentSrc:function(){
try{
var _633=null;
var divs=this.parentElement.getElementsByTagName("div");
if(divs!=null&&divs.length>0){
for(i=0;i<divs.length;i++){
if(divs[i].className!=null&&divs[i].className.indexOf("rolloverDetailsDiv")!=-1){
_633=divs[i];
break;
}
}
}
if(_633!=null){
return _633.getAttribute("contentsrc");
}else{
return null;
}
}
catch(e){
this.log("Rollover.getRolloverContentSrc(): "+e.message);
}
},createRolloverElement:function(){
var div=document.createElement("div");
div.setAttribute("id","rolloverDetails");
div.className="rolloverDetails";
div.style.zIndex="1000";
document.body.appendChild(div);
Rollover.rolloverElement=document.getElementById("rolloverDetails");
},setBoxArt:function(){
try{
var _636=this.draggableElement.getElementsByTagName("img");
if(_636.length){
return _636[0];
}else{
var _637=this.parentElement.getElementsByTagName("a");
var _638=null;
for(var i=0;i<_637.length;i++){
var img=_637[i].childNodes[0];
if(img!=null&&img.src!=null){
this.draggableElementProxy=_637[i];
_638=img;
break;
}
}
return _638;
}
}
catch(e){
this.log("Rollover.setBoxArt(): "+e.message);
}
},mousedOver:function(evt){
try{
if(BBDraggable.isDragging){
return;
}
Rollover.rolloverElement.onmouseover=this.mousedOverRollover.bindAsEventListener(this);
Rollover.rolloverElement.onmouseout=this.mousedOutRollover.bindAsEventListener(this);
this.rolloverTimer=clearTimeout(this.rolloverTimer);
this.elementTimer=setTimeout(this.displayRolloverDetail.bind(this),this.delayShow);
}
catch(e){
this.log("Rollover.mousedOver(): "+e.message);
}
},mousedOut:function(evt){
try{
this.elementTimer=clearTimeout(this.elementTimer);
if(!this.rolloverTimer){
this.rolloverTimer=setTimeout(this.hideRolloverDetail.bind(this),this.delayHide);
}
}
catch(e){
this.log("Rollover.mousedOut(): "+e.message);
}
},mousedOverRollover:function(evt){
try{
if(BBDraggable.isDragging){
return;
}
if(this.rolloverTimer){
this.rolloverTimer=clearTimeout(this.rolloverTimer);
}
}
catch(e){
this.log("Rollover.mousedOverRollover(): "+e.message);
}
},mousedOutRollover:function(evt){
try{
if(!this.rolloverTimer){
this.rolloverTimer=setTimeout(this.hideRolloverDetail.bind(this),this.delayHideMs);
}
}
catch(e){
this.log("Rollover.mousedOutRollover(): "+e.message);
}
},displayRolloverDetail:function(){
try{
if(BBDraggable.isDragging){
this.hideRolloverDetail();
return;
}
if(this.rolloverDetails==null){
(new BaseHandler()).processAjaxRequest(this.rolloverUrl,"",this.processResponse.bind(this));
}else{
this.displayRollover();
}
}
catch(e){
this.log("Rollover.displayRolloverDetail(): "+e.message);
}
},processResponse:function(_63f){
try{
if(BBDraggable.isDragging){
this.hideRolloverDetail();
return;
}
this.rolloverDetails=_63f.responseBody;
this.displayRollover();
}
catch(e){
this.log("Rollover.processResponse(): "+e.message);
}
},hideRolloverDetail:function(){
try{
this.elementTimer=clearTimeout(this.elementTimer);
this.rolloverTimer=clearTimeout(this.rolloverTimer);
Element.hide(Rollover.rolloverElement);
Element.removeClassName(Rollover.rolloverElement,"rdDefault");
Element.removeClassName(Rollover.rolloverElement,"rdRight");
Element.removeClassName(Rollover.rolloverElement,"rdBottom");
Element.removeClassName(Rollover.rolloverElement,"rdRightBottom");
this.isRolloverShowing=false;
}
catch(e){
this.log("Rollover.hideRolloverDetail(): "+e.message);
}
},displayRollover:function(){
try{
if(BBDraggable.isDragging){
this.hideRolloverDetail();
}else{
this.isRolloverShowing=true;
el=Rollover.rolloverElement;
el.innerHTML=this.rolloverDetails;
var _640=null;
if(this.draggableElementProxy!=null){
_640=this.draggableElementProxy;
}else{
_640=this.draggableElement;
}
Element.removeClassName(el,"rdDefault");
Element.removeClassName(el,"rdRight");
Element.removeClassName(el,"rdBottom");
Element.removeClassName(el,"rdRightBottom");
Element.show(el);
var _641=el.offsetWidth;
var _642=el.offsetHeight;
Position.clone((this.boxart||this.parentElement),el);
if(this.boxart){
el.style.left=(parseInt(el.style.left)+this.boxart.offsetWidth+5)+"px";
el.style.top=(parseInt(el.style.top)+this.boxart.offsetHeight-25)+"px";
}else{
var _643=_640.offsetWidth;
if(_640.offsetWidth>_640.parentNode.parentNode.offsetWidth){
_643=_640.parentNode.parentNode.offsetWidth;
}
el.style.left=(parseInt(el.style.left)+_643+17)+"px";
el.style.top=(parseInt(el.style.top)+_640.offsetHeight-17)+"px";
}
el.style.width="1px";
el.style.height="1px";
el.style.overflow="hidden";
el.style.visibility="hidden";
Position.prepare();
var _644=Position.cumulativeOffset(el);
_644[0]+=_641-Position.deltaX;
_644[1]+=_642-Position.deltaY;
var _645="";
if(window.innerHeight){
_645=[window.innerWidth,window.innerHeight];
}else{
if(document.body.clientHeight){
_645=[document.body.clientWidth,document.body.clientHeight];
}else{
if(document.documentElement){
_645=[document.documentElement.clientWidth,document.documentElement.clientHeight];
}
}
}
if(_644[0]>_645[0]||_644[1]>_645[1]){
Position.clone(this.boxart||this.parentElement,el);
el.style.width="1px";
el.style.height="1px";
bOffsetX=0;
bOffsetY=0;
if(_644[0]>_645[0]&&_644[1]>_645[1]){
Element.addClassName(el,"rdRightBottom");
if(this.boxart){
bOffsetX=-430;
bOffsetY=-_642+25;
}else{
bOffsetX=-440;
bOffsetY=-_642+13;
}
newCoordinateY=(_644[1]-_642-_642);
if(this.boxart){
newCoordinateY=newCoordinateY+33-this.boxart.offsetHeight;
}
if(newCoordinateY<0&&newCoordinateY<0){
var divs=el.getElementsByTagName("div");
contentsOffset=-newCoordinateY;
for(var i=0,j=divs.length;i<j;i++){
if(divs[i].className=="start"){
divs[i].style.top=(contentsOffset-18)+"px";
}
if(divs[i].className=="contents"){
divs[i].style.top=contentsOffset+"px";
divs[i].style.position="relative";
}
if(divs[i].className=="end"){
divs[i].style.bottom=(-14-contentsOffset)+"px";
}
}
}
}else{
if(_644[0]>_645[0]){
Element.addClassName(el,"rdRight");
if(this.boxart){
bOffsetX=-430;
bOffsetY=this.boxart.offsetHeight-25;
}else{
bOffsetX=-440;
bOffsetY=_640.offsetHeight-13;
}
}else{
if(_644[1]>_645[1]){
Element.addClassName(el,"rdBottom");
if(this.boxart){
bOffsetX=this.boxart.offsetWidth+5;
bOffsetY=-_642+25;
}else{
bOffsetX=_640.offsetWidth+13;
bOffsetY=-_642+13;
}
newCoordinateY=(_644[1]-_642-_642);
if(this.boxart){
newCoordinateY=newCoordinateY+33-this.boxart.offsetHeight;
}
if(newCoordinateY<0&&newCoordinateY<0){
var divs=el.getElementsByTagName("div");
contentsOffset=-newCoordinateY;
for(var i=0,j=divs.length;i<j;i++){
if(divs[i].className=="start"){
divs[i].style.top=(contentsOffset-18)+"px";
}
if(divs[i].className=="contents"){
divs[i].style.top=contentsOffset+"px";
divs[i].style.position="relative";
}
if(divs[i].className=="end"){
divs[i].style.bottom=(-14-contentsOffset)+"px";
}
}
}
}
}
}
el.style.left=(parseInt(el.style.left)+bOffsetX)+"px";
el.style.top=(parseInt(el.style.top)+bOffsetY)+"px";
}else{
Element.addClassName(el,"rdDefault");
}
el.style.width="420px";
el.style.height="auto";
el.style.overflow="visible";
el.style.visibility="visible";
}
}
catch(e){
this.log("Rollover.displayRollover(): "+e.message);
}
},log:function(msg){
logger.error(msg);
},toString:function(){
var _649="";
_649="this.parentElement: "+this.parentElement+"<br/>";
_649+="this.draggableElement: "+this.draggableElement+"<br/>";
_649+="this.draggableElementProxy: "+this.draggableElementProxy+"<br/>";
_649+="this.boxart: "+this.boxart+"<br/>";
_649+="this.delayShow: "+this.delayShow+"<br/>";
_649+="this.delayHide: "+this.delayHide+"<br/>";
_649+="this.isRolloverShowing: "+this.isRolloverShowing+"<br/>";
_649+="this.rolloverUrl: "+this.rolloverUrl+"<br/>";
_649+="this.rolloverDetails: "+this.rolloverDetails+"<br/>";
return _649;
}};
Rollover.rolloverElement=null;
var AvatarRollover=Class.create();
AvatarRollover.prototype=(new Rollover()).extend({initialize:function(_64a,_64b){
this.draggableElement=$(_64a);
this.parentElement=this.draggableElement;
this.draggableElementProxy=null;
this.boxart=null;
this.delayShow=150;
this.delayHide=150;
this.isRolloverShowing=false;
this.elementTimer=null;
this.rolloverTimer=null;
this.rolloverDetails=$(_64b).innerHTML;
if(Rollover.rolloverElement==null){
this.createRolloverElement();
}
this.draggableElement.onmouseover=this.mousedOver.bindAsEventListener(this);
this.draggableElement.onmouseout=this.mousedOut.bindAsEventListener(this);
this.mousedOver();
},toString:function(){
var _64c="";
_64c="this.parentElement: "+this.parentElement+"<br/>";
_64c+="this.draggableElement: "+this.draggableElement+"<br/>";
_64c+="this.draggableElementProxy: "+this.draggableElementProxy+"<br/>";
_64c+="this.boxart: "+this.boxart+"<br/>";
_64c+="this.delayShow: "+this.delayShow+"<br/>";
_64c+="this.delayHide: "+this.delayHide+"<br/>";
_64c+="this.isRolloverShowing: "+this.isRolloverShowing+"<br/>";
_64c+="this.AvatarRolloverId: "+this.AvatarRolloverId+"<br/>";
_64c+="this.rolloverDetails: "+this.rolloverDetails+"<br/>";
return _64c;
},displayRollover:function(){
try{
this.isRolloverShowing=true;
el=Rollover.rolloverElement;
el.innerHTML=this.rolloverDetails;
var _64d=this.draggableElement;
Element.show(el);
var _64e=el.offsetWidth;
var _64f=el.offsetHeight;
Position.clone(this.parentElement,el);
var _650=_64d.offsetWidth;
if(_64d.offsetWidth>_64d.parentNode.parentNode.offsetWidth){
_650=_64d.parentNode.parentNode.offsetWidth;
}
el.style.left=(parseInt(el.style.left)+_650+17)+"px";
el.style.top=(parseInt(el.style.top)+_64d.offsetHeight-17)+"px";
el.style.width="1px";
el.style.height="1px";
el.style.overflow="hidden";
el.style.visibility="hidden";
Position.prepare();
var _651=Position.cumulativeOffset(el);
_651[0]+=_64e-Position.deltaX;
_651[1]+=_64f-Position.deltaY;
var _652="";
if(window.innerHeight){
_652=[window.innerWidth,window.innerHeight];
}else{
if(document.body.clientHeight){
_652=[document.body.clientWidth,document.body.clientHeight];
}else{
if(document.documentElement){
_652=[document.documentElement.clientWidth,document.documentElement.clientHeight];
}
}
}
if(_651[0]>_652[0]||_651[1]>_652[1]){
Position.clone(this.parentElement,el);
el.style.width="1px";
el.style.height="1px";
bOffsetX=0;
bOffsetY=0;
additionalXOffset=-40;
additionalYOffset=50;
if(!window.innerHeight){
additionalYOffset=50;
}
if(_651[0]>_652[0]&&_651[1]>_652[1]){
bOffsetX=-240+additionalXOffset;
bOffsetY=-_64f+additionalYOffset;
}else{
if(_651[0]>_652[0]){
bOffsetX=-240+additionalXOffset;
bOffsetY=_64d.offsetHeight-additionalYOffset;
}else{
if(_651[1]>_652[1]){
bOffsetX=_64d.offsetWidth+additionalXOffset;
bOffsetY=-_64f+additionalYOffset;
}
}
}
el.style.left=(parseInt(el.style.left)+bOffsetX)+"px";
el.style.top=(parseInt(el.style.top)+bOffsetY)+"px";
}
el.style.width="240px";
el.style.height="auto";
el.style.overflow="visible";
el.style.visibility="visible";
}
catch(e){
}
}});
var ReadMoreRollover=Class.create();
ReadMoreRollover.prototype=(new Rollover()).extend({initialize:function(_653,url){
this.draggableElement=$(_653);
this.parentElement=this.draggableElement;
this.draggableElementProxy=null;
this.boxart=null;
this.delayShow=500;
this.delayHide=150;
this.isRolloverShowing=false;
this.elementTimer=null;
this.rolloverTimer=null;
this.rolloverUrl=url;
this.rolloverDetails=null;
if(Rollover.rolloverElement==null){
this.createRolloverElement();
}
this.draggableElement.onmouseover=this.mousedOver.bindAsEventListener(this);
this.draggableElement.onmouseout=this.mousedOut.bindAsEventListener(this);
this.mousedOver();
},toString:function(){
var _655="";
_655="this.parentElement: "+this.parentElement+"<br/>";
_655="this.draggableElement: "+this.draggableElement+"<br/>";
_655="this.draggableElementProxy: "+this.draggableElementProxy+"<br/>";
_655="this.boxart: "+this.boxart+"<br/>";
_655="this.delayShow: "+this.delayShow+"<br/>";
_655="this.delayHide: "+this.delayHide+"<br/>";
_655="this.isRolloverShowing: "+this.isRolloverShowing+"<br/>";
_655="this.rolloverDetails: "+this.rolloverDetails+"<br/>";
return _655;
}});
var MovieRollover=Class.create();
MovieRollover.prototype={initialize:function(el){
this.htmlElement=$(el);
this.actionPath=null;
this.movieElement=this.findMovieElement(this.htmlElement);
if(this.movieElement!=null){
this.actionPath=this.getActionPath(this.movieElement);
}
this.movieRollover=new Rollover(this.movieElement,this.htmlElement);
this.movieRollover.mousedOver();
},findMovieElement:function(el){
try{
if(el.className!=null){
if(el.className.indexOf("bvr-movielistitem")!=-1){
return el;
}else{
return this.findMovieElement(el.parentNode);
}
}else{
return this.findMovieElement(el.parentNode);
}
}
catch(e){
this.log("MovieRollover.findMovieElement(): "+e.message);
return null;
}
},getActionPath:function(el){
try{
var _659=el.getElementsByTagName("a");
var _65a=null;
for(i=0;i<_659.length;i++){
if(_659[i]!=null&&_659[i].className.indexOf("bvr-qadd")!=-1){
if(_659[i].getAttribute("href")!=null){
_65a=_659[i].getAttribute("href");
}
break;
}
}
return _65a;
}
catch(e){
this.log("MovieRollover.getActionPath(): "+e.message);
return null;
}
},toString:function(){
var _65b="";
_65b="this.htmlElement: "+this.htmlElement+"<br/>";
_65b+="this.movieElement: "+this.movieElement+"<br/>";
_65b+="this.movieRollover: "+this.movieRollover+"<br/>";
_65b+="this.actionPath: "+this.actionPath+"<br/>";
return _65b;
},log:function(msg){
logger.error(msg);
}};
var QuickHelpRollover=Class.create();
QuickHelpRollover.prototype=(new Rollover()).extend({initialize:function(_65d){
this.draggableElement=$(_65d);
this.parentElement=this.draggableElement;
this.draggableElementProxy=null;
this.boxart=null;
this.delayShow=500;
this.delayHide=150;
this.isRolloverShowing=false;
this.elementTimer=null;
this.rolloverTimer=null;
this.helpId=this.draggableElement.id.replace(" ","").toLowerCase();
this.rolloverDetails=document.getElementById(this.helpId).innerHTML;
if(Rollover.rolloverElement==null){
this.createRolloverElement();
}
this.draggableElement.onmouseover=this.mousedOver.bindAsEventListener(this);
this.draggableElement.onmouseout=this.mousedOut.bindAsEventListener(this);
this.mousedOver();
},toString:function(){
var _65e="";
_65e="this.parentElement: "+this.parentElement+"<br/>";
_65e="this.draggableElement: "+this.draggableElement+"<br/>";
_65e="this.draggableElementProxy: "+this.draggableElementProxy+"<br/>";
_65e="this.boxart: "+this.boxart+"<br/>";
_65e="this.delayShow: "+this.delayShow+"<br/>";
_65e="this.delayHide: "+this.delayHide+"<br/>";
_65e="this.isRolloverShowing: "+this.isRolloverShowing+"<br/>";
_65e+="this.helpId: "+this.helpId+"<br/>";
_65e="this.rolloverDetails: "+this.rolloverDetails+"<br/>";
return _65e;
}});
var Download=Class.create();
Download.prototype={initialize:function(el,_660){
this.el=$(el);
this.editionsUrl=_660;
this.jsonResponse=null;
this.xml=null;
},log:function(msg){
logger.error(msg);
},handleError:function(){
},setCursors:function(_662){
this.el.style.cursor=_662;
document.body.style.cursor=_662;
},processHandoff:function(){
try{
new BaseHandler().processAjaxRequest(this.editionsUrl,"",this.storeAjaxHandoffResponse.bind(this),this.handleError.bind(this));
return false;
}
catch(e){
this.log("Download.processHandoff(): "+e.message);
return true;
}
},storeAjaxHandoffResponse:function(_663){
this.jsonResponse=_663;
var _664=_663.partialSuccessMessage;
if(_664!=""){
document.getElementById("mmFeedback").innerHTML=_664;
}else{
window.location.reload();
}
},addMultipleOrder:function(){
try{
new BaseHandler().processAjaxRequest(this.editionsUrl,"",this.storeAjaxMultipleAddOrderResponse.bind(this),this.handleError.bind(this));
return false;
}
catch(e){
this.log("Download.addMultipleOrder(): "+e.message);
return true;
}
},storeAjaxMultipleAddOrderResponse:function(_665){
this.jsonResponse=_665;
var _666=(_665.handOffXml);
var _667=_665.orderDetailId;
try{
var _668=new ActiveXObject("MovielinkBroker.MCCommandBroker");
_668.SetAffiliate("77","www.blockbuster.com");
var _669=(_668.Add(_666));
printCustomerFeedback(_669,_667);
}
catch(e){
return false;
}
},addTOS:function(){
try{
new BaseHandler().processAjaxRequest(this.editionsUrl,"",this.storeAjaxTOSResponse.bind(this),this.handleError.bind(this));
return false;
}
catch(e){
this.log("SelectEdition.add(): "+e.message);
return true;
}
},storeAjaxTOSResponse:function(_66a){
this.jsonResponse=_66a;
var _66b=(_66a.handOffXml);
try{
var _66c=new ActiveXObject("MovielinkBroker.MCCommandBroker");
_66c.SetAffiliate("77","www.blockbuster.com");
var _66d=(_66c.Add(_66b));
printCustomerFeedback(_66d,"");
}
catch(e){
return false;
}
},verifyAge:function(){
try{
new BaseHandler().processAjaxRequest(this.editionsUrl,"",this.processAgeCheckResponse.bind(this),this.handleError.bind(this));
return false;
}
catch(e){
this.log("verifyAge(): "+e.message);
return true;
}
},processAgeCheckResponse:function(_66e){
this.jsonResponse=_66e;
var _66f=_66e.skuId;
if(_66e.ageVerified=="Y"){
try{
if(_66e.isTOS=="Y"){
document.forms[0].action="/download/digital/checkout/tosCheckout/"+_66f;
}else{
document.forms[0].action="/download/digital/checkout/downloadAuthentication/"+_66f;
}
document.forms[0].submit();
return false;
}
catch(e){
this.log("processAgeCheckResponse: "+e.message);
return true;
}
}else{
var age=_66e.age;
document.getElementById("errorDiv_"+_66f).innerHTML="<br/>You must be at least "+age+" years of age to rent or buy this movie.";
document.getElementById("errorDiv_"+_66f).style.color="red";
}
},verifyCustomerDetails:function(){
try{
new BaseHandler().processAjaxRequest(this.editionsUrl,"",this.processCustomerDetailsResponse.bind(this),this.handleError.bind(this));
return false;
}
catch(e){
this.log("verifyCustomerDetails(): "+e.message);
return true;
}
},processCustomerDetailsResponse:function(_671){
this.jsonResponse=_671;
if(_671.nameVerified=="N"){
document.getElementById("errorDiv").innerHTML="Please enter your name.";
document.getElementById("errorDiv").style.color="red";
}else{
if(_671.questionVerified=="N"){
document.getElementById("errorDiv").innerHTML="Please tell us how we can help you.";
document.getElementById("errorDiv").style.color="red";
}else{
try{
document.forms[0].action="https://admin.instantservice.com/servlet/Customer";
document.forms[0].submit();
}
catch(e){
this.log("processCustomerDetailsResponse: "+e.message);
return true;
}
}
}
}};
var mmStatusCount=0;
var M3Static;
var MMStatus;
var INSTALL_WMP=6;
var isEhome="false";
var latestVersion="";
var showHandOffDebug="false";
var handOffTimeOut="1000";
var indexArray=new Array();
var titleArray=new Array();
var tokenArray=new Array();
var retCodeArray=new Array();
function testMMStatus(_672){
if(mmStatusCount<=0){
mmStatusCount++;
return;
}
if(isMMInstalled()=="true"){
switch(_672){
case "upgrade":
if((M3Static.GetStatus()=="1")){
if(mmStatusCount<=0){
mmStatusCount++;
break;
}
window.clearInterval(MMStatus);
mmStatusCount=0;
SendDownloadRequest();
}
break;
case "install":
window.clearInterval(MMStatus);
SendDownloadRequest();
break;
case "myAccount":
if(mmStatusCount<=0){
mmStatusCount++;
break;
}
window.clearInterval(MMStatus);
mmStatusCount=0;
setTimeout("window.location.reload()",2000);
break;
}
}
}
function SendDownloadRequest(){
createMMStaticObject();
}
function initiateDownloadTOS(_673,_674,_675,_676,_677){
hideDiv("downloadBlock1");
hideDiv("downloadBlock2");
showDiv("waitTOSDownload1");
showDiv("waitTOSDownload2");
createMMStaticObject();
var _678=document.getElementById("latestMMVersion").value;
if(!checkMMVersion(_678)){
var _679="' /updatecheck /now '";
mmStatusCount=-10;
try{
createMMStaticObject();
M3Static.ExecuteUserCommandLong(2002,0,_679);
MMStatus=setInterval("testMMStatus(\"upgrade\")",2500);
}
catch(e){
}
}
if(!checkMMVersionUpgrade(_678)){
timeOutDownloadTOS(_678,_673,_674,_675,_676,_677);
}else{
M3Static.ExecuteUserCommandLong(2002,1,"");
try{
new Download(this,"/download/digital/downloadHandoffTOSXml?skuId="+_673+"&licenseId="+_674+"&downloadId="+_675+"&licenseExpiration="+_676+"&licenseUrl="+_677).addTOS();
return true;
}
catch(e){
return false;
}
}
}
function timeOutDownloadTOS(_67a,_67b,_67c,_67d,_67e,_67f){
setTimeout(function(){
if(!checkMMVersionUpgrade(_67a)){
timeOutDownloadTOS(_67a,_67b,_67c,_67d,_67e,_67f);
}else{
M3Static.ExecuteUserCommandLong(2002,1,"");
try{
new Download(this,"/download/digital/downloadHandoffTOSXml?skuId="+_67b+"&licenseId="+_67c+"&downloadId="+_67d+"&licenseExpiration="+_67e+"&licenseUrl="+_67f).addTOS();
return true;
}
catch(e){
return false;
}
}
},1000);
}
function initiateDownloadAll(){
var ids="";
var _681=document.getElementsByName("selectedDownload").length;
document.getElementById("mmFeedback").innerHTML="";
var _682=0;
for(i=0;i<document.getElementsByName("selectedDownload").length;i++){
if(document.getElementsByName("selectedDownload")[i].checked){
ids=ids+document.getElementsByName("selectedDownload")[i].value+",";
_682++;
}
}
if(ids!=""){
ids=ids.substr(0,ids.length-1);
}
if(_682==0){
document.getElementById("mmFeedback").innerHTML="<font color=red>Please select at least one movie</font>";
return false;
}
hideDiv("downloadBlock1");
hideDiv("downloadBlock2");
showDiv("waitDownload1");
showDiv("waitDownload2");
createMMStaticObject();
var _683=document.getElementById("latestMMVersion").value;
if(!checkMMVersion(_683)){
var _684="' /updatecheck /now '";
mmStatusCount=-10;
try{
createMMStaticObject();
M3Static.ExecuteUserCommandLong(2002,0,_684);
MMStatus=setInterval("testMMStatus(\"upgrade\")",2500);
}
catch(e){
}
}
if(!checkMMVersionUpgrade(_683)){
timeOutDownload(_683,ids);
}else{
M3Static.ExecuteUserCommandLong(2002,1,"");
try{
new Download(this,"/download/digital/downloadMultipleHandoffXml?orderDetailIds="+ids).addMultipleOrder();
return true;
}
catch(e){
return false;
}
}
}
function timeOutDownload(_685,ids){
setTimeout(function(){
if(!checkMMVersionUpgrade(_685)){
timeOutDownload(_685,ids);
}else{
M3Static.ExecuteUserCommandLong(2002,1,"");
try{
new Download(this,"/download/digital/downloadMultipleHandoffXml?orderDetailIds="+ids).addMultipleOrder();
return true;
}
catch(e){
return false;
}
}
},1000);
}
function createMMStaticObject(){
try{
if(typeof (M3Static)=="undefined"){
M3Static=new ActiveXObject("M3Static.Tool");
return true;
}
}
catch(e){
return false;
}
}
function isMMInstalled(){
if(checkMMInstalled()=="error"){
return "error";
}else{
if(checkMMInstalled()=="true"){
return "true";
}else{
return "false";
}
}
}
function checkMMInstalled(){
try{
createMMStaticObject();
if(M3Static.IsInstalled()){
return "true";
}else{
return "false";
}
}
catch(e){
return "error";
}
}
function checkMMVersion(_687){
try{
return mmVersionCheck(M3Static.GetVersion(),_687);
}
catch(e){
return false;
}
}
function checkMMVersionUpgrade(_688){
try{
return mmVersionCheck(M3Static.GetVersion(),_688);
}
catch(e){
return false;
}
}
function mmVersionCheck(_689,_68a){
aryBase=_68a.split(".");
aryCur=_689.split(".");
for(var i=0;i<aryBase.length;i++){
if(parseInt(aryBase[i])<parseInt(aryCur[i])){
return true;
}else{
if(parseInt(aryBase[i])>parseInt(aryCur[i])){
return false;
}
}
}
return true;
}
function printCustomerFeedback(_68c,_68d){
try{
if(_68d!=""){
new Download(this,"/download/digital/processMultipleHandOffResponse?orderDetailId="+_68d+"&handOffXml="+_68c).processHandoff();
}else{
new Download(this,"/download/digital/processMultipleHandOffResponse?handOffXml="+_68c).processHandoff();
window.location.reload();
}
}
catch(e){
}
}
function launchMMGUI(){
createMMStaticObject();
try{
M3Static.ExecuteUserCommandLong(2002,1,"");
}
catch(e){
return false;
}
}
function retrieveMMVersion(){
createMMStaticObject();
return M3Static.GetVersion();
}
function startInstallManager(){
document.getElementById("getPlayer").style.display="none";
if(document.getElementById("waitInstall")!=null){
document.getElementById("waitInstall").style.display="";
}
mmStatusCount=0;
MMStatus=setInterval("testMMStatus(\"myAccount\")",100);
}
function checkPlayerExistence(){
var _68e=isMMInstalled();
if(_68e=="true"){
hideDiv("getPlayer");
showDiv("downloadBlock1");
showDiv("downloadBlock2");
}else{
showDiv("getPlayer");
hideDiv("downloadBlock1");
hideDiv("downloadBlock2");
}
}
function verifyAge(age,_690,_691){
if(document.getElementById("option_"+_690)){
var _692=document.getElementById("option_"+_690).checked;
new Download(this,"/download/digital/checkout/ageVerification?&ageCheck="+_692+"&skuId="+_690+"&age="+age+"&isTOS="+_691).verifyAge();
}
}
function chatCustomerCare(){
var _693=document.forms[0].userName.value;
var _694=document.forms[0].optionaldata.value;
new Download(this,"/download/digital/checkout/processChat?&userName="+_693+"&optionaldata="+_694).verifyCustomerDetails();
}
function launchGUI(){
if(isMMInstalled()){
launchMMGUI();
}else{
}
return true;
}
function checkUnCheckDownloads(_695){
var _696=document.getElementsByName("selectedDownload").length;
for(i=0;i<document.getElementsByName("selectedDownload").length;i++){
if(_695.checked){
document.getElementsByName("selectedDownload")[i].checked=true;
}else{
document.getElementsByName("selectedDownload")[i].checked=false;
}
}
}
function showOverlayForDownload(_697,name){
var _699=document.getElementsByName(name);
var mode="";
for(var i=0;i<_699.length;i++){
if(_699[i].checked==true){
mode=_699[i].value;
}
}
if(mode!=""){
Overlay=new popupUrlHandler("/download/digital/checkout/downloadOffer/"+_697+"/"+mode,"boxPopup","",null);
Overlay.execute();
return false;
}
}
function showSelectedDownloadOffer(_69c,_69d,form){
var mode="";
var _6a0=form.downloadMode;
for(var i=0;i<_6a0.length;i++){
if(_6a0[i].checked==true){
mode=_6a0[i].value;
}
}
if(mode!=""){
Overlay=new popupUrlHandler("/download/digital/checkout/downloadPackageOffer/"+_69c+"/"+_69d+"/"+mode,"boxPopup","",null);
Overlay.execute();
return false;
}
}
function showDownloadOffer(_6a2,_6a3,mode){
Overlay=new popupUrlHandler("/download/digital/checkout/downloadPackageOffer/"+_6a2+"/"+_6a3+"/"+mode,"boxPopup","",null);
Overlay.execute();
return false;
}
function showDownloadOffer(_6a5,mode){
Overlay=new popupUrlHandler("/download/digital/checkout/downloadOffer/"+_6a5+"/"+mode,"boxPopup","",null);
Overlay.execute();
return false;
}
function detectConfigurationSettings(){
var _6a7=false;
try{
var _6a8=new ActiveXObject("Msxml2.XMLHTTP");
var _6a7=detectPlugin("MediaPlayer.MediaPlayer.1","Windows Media Player");
return _6a7;
}
catch(err){
return false;
}
}
function detectPlugin(_6a9,name){
result=false;
document.write("<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject(\""+_6a9+"\"))</SCRIPT>\n");
return result;
}
function detectBrowserSetting(){
if(detectConfigurationSettings){
var _6ab=document.getElementById("browserDownload");
if(_6ab!=null){
showDiv("browserDownload");
}
}
}
function showBuyDownload(){
showDiv("buyOfferDetails");
showDiv("buyDownloadLink");
hideDiv("buyDownloadDetails");
hideDiv("buyDownloadLinkClose");
hideDiv("rentOfferDetails");
hideDiv("rentDownloadDetails");
hideDiv("rentDownloadLink");
hideDiv("rentDownloadLinkClose");
}
function showRentDownload(){
showDiv("rentOfferDetails");
showDiv("rentDownloadLink");
hideDiv("rentDownloadDetails");
hideDiv("rentDownloadLinkClose");
hideDiv("buyOfferDetails");
hideDiv("buyDownloadDetails");
hideDiv("buyDownloadLink");
hideDiv("buyDownloadLinkClose");
}
function showBuyTermsOpen(){
showDiv("buyDownloadDetails");
showDiv("buyDownloadLinkClose");
hideDiv("buyDownloadLink");
}
function showBuyTermsClose(){
hideDiv("buyDownloadDetails");
showDiv("buyDownloadLink");
hideDiv("buyDownloadLinkClose");
}
function showRentTermsOpen(){
hideDiv("rentDownloadLink");
showDiv("rentDownloadDetails");
showDiv("rentDownloadLinkClose");
}
function showRentTermsClose(){
showDiv("rentDownloadLink");
hideDiv("rentDownloadDetails");
hideDiv("rentDownloadLinkClose");
}
function _element(){
this.type="element";
this.name=new String();
this.attributes=new Array();
this.contents=new Array();
this.uid=_Xparse_count++;
_Xparse_index[this.uid]=this;
}
function _chardata(){
this.type="chardata";
this.value=new String();
}
function _pi(){
this.type="pi";
this.value=new String();
}
function _comment(){
this.type="comment";
this.value=new String();
}
function _frag(){
this.str=new String();
this.ary=new Array();
this.end=new String();
}
var _Xparse_count=0;
var _Xparse_index=new Array();
function Xparse(src){
var frag=new _frag();
frag.str=_prolog(src);
var root=new _element();
root.name="ROOT";
frag=_compile(frag);
root.contents=frag.ary;
root.index=_Xparse_index;
_Xparse_index=new Array();
return root;
}
function _compile(frag){
while(1){
if(frag.str.length==0){
return frag;
}
var _6b0=frag.str.indexOf("<");
if(_6b0!=0){
var _6b1=frag.ary.length;
frag.ary[_6b1]=new _chardata();
if(_6b0==-1){
frag.ary[_6b1].value=_entity(frag.str);
frag.str="";
}else{
frag.ary[_6b1].value=_entity(frag.str.substring(0,_6b0));
frag.str=frag.str.substring(_6b0,frag.str.length);
}
}else{
if(frag.str.substring(1,2)=="?"){
frag=_tag_pi(frag);
}else{
if(frag.str.substring(1,4)=="!--"){
frag=_tag_comment(frag);
}else{
if(frag.str.substring(1,9)=="![CDATA["){
frag=_tag_cdata(frag);
}else{
if(frag.str.substring(1,frag.end.length+3)=="/"+frag.end+">"||_strip(frag.str.substring(1,frag.end.length+3))=="/"+frag.end){
frag.str=frag.str.substring(frag.end.length+3,frag.str.length);
frag.end="";
return frag;
}else{
frag=_tag_element(frag);
}
}
}
}
}
}
return "";
}
function _tag_element(frag){
var _6b3=frag.str.indexOf(">");
var _6b4=(frag.str.substring(_6b3-1,_6b3)=="/");
if(_6b4){
_6b3-=1;
}
var _6b5=_normalize(frag.str.substring(1,_6b3));
var _6b6=_6b5.indexOf(" ");
var _6b7=new String();
var name=new String();
if(_6b6!=-1){
name=_6b5.substring(0,_6b6);
_6b7=_6b5.substring(_6b6+1,_6b5.length);
}else{
name=_6b5;
}
var _6b9=frag.ary.length;
frag.ary[_6b9]=new _element();
frag.ary[_6b9].name=_strip(name);
if(_6b7.length>0){
frag.ary[_6b9].attributes=_attribution(_6b7);
}
if(!_6b4){
var _6ba=new _frag();
_6ba.str=frag.str.substring(_6b3+1,frag.str.length);
_6ba.end=name;
_6ba=_compile(_6ba);
frag.ary[_6b9].contents=_6ba.ary;
frag.str=_6ba.str;
}else{
frag.str=frag.str.substring(_6b3+2,frag.str.length);
}
return frag;
}
function _tag_pi(frag){
var _6bc=frag.str.indexOf("?>");
var val=frag.str.substring(2,_6bc);
var _6be=frag.ary.length;
frag.ary[_6be]=new _pi();
frag.ary[_6be].value=val;
frag.str=frag.str.substring(_6bc+2,frag.str.length);
return frag;
}
function _tag_comment(frag){
var _6c0=frag.str.indexOf("-->");
var val=frag.str.substring(4,_6c0);
var _6c2=frag.ary.length;
frag.ary[_6c2]=new _comment();
frag.ary[_6c2].value=val;
frag.str=frag.str.substring(_6c0+3,frag.str.length);
return frag;
}
function _tag_cdata(frag){
var _6c4=frag.str.indexOf("]]>");
var val=frag.str.substring(9,_6c4);
var _6c6=frag.ary.length;
frag.ary[_6c6]=new _chardata();
frag.ary[_6c6].value=val;
frag.str=frag.str.substring(_6c4+3,frag.str.length);
return frag;
}
function _attribution(str){
var all=new Array();
while(1){
var eq=str.indexOf("=");
if(str.length==0||eq==-1){
return all;
}
var id1=str.indexOf("'");
var id2=str.indexOf("\"");
var ids=new Number();
var id=new String();
if((id1<id2&&id1!=-1)||id2==-1){
ids=id1;
id="'";
}
if((id2<id1||id1==-1)&&id2!=-1){
ids=id2;
id="\"";
}
var _6ce=str.indexOf(id,ids+1);
var val=str.substring(ids+1,_6ce);
var name=_strip(str.substring(0,eq));
all[name]=_entity(val);
str=str.substring(_6ce+1,str.length);
}
return "";
}
function _prolog(str){
var A=new Array();
A=str.split("\r\n");
str=A.join("\n");
A=str.split("\r");
str=A.join("\n");
var _6d3=str.indexOf("<");
if(str.substring(_6d3,_6d3+3)=="<?x"||str.substring(_6d3,_6d3+3)=="<?X"){
var _6d4=str.indexOf("?>");
str=str.substring(_6d4+2,str.length);
}
var _6d3=str.indexOf("<!DOCTYPE");
if(_6d3!=-1){
var _6d4=str.indexOf(">",_6d3)+1;
var dp=str.indexOf("[",_6d3);
if(dp<_6d4&&dp!=-1){
_6d4=str.indexOf("]>",_6d3)+2;
}
str=str.substring(_6d4,str.length);
}
return str;
}
function _strip(str){
var A=new Array();
A=str.split("\n");
str=A.join("");
A=str.split(" ");
str=A.join("");
A=str.split("\t");
str=A.join("");
return str;
}
function _normalize(str){
var A=new Array();
A=str.split("\n");
str=A.join(" ");
A=str.split("\t");
str=A.join(" ");
return str;
}
function _entity(str){
var A=new Array();
A=str.split("&lt;");
str=A.join("<");
A=str.split("&gt;");
str=A.join(">");
A=str.split("&quot;");
str=A.join("\"");
A=str.split("&apos;");
str=A.join("'");
A=str.split("&amp;");
str=A.join("&");
return str;
}
var TrailerHandler=Class.create();
TrailerHandler.prototype={initialize:function(_6dc,_6dd,_6de,_6df,_6e0,_6e1,_6e2,_6e3,_6e4){
this.channel=_6e3;
this.movieTrailerPlayer=_6dc;
this.specificMovie=_6e2;
this.titleSpan=_6dd;
this.clipsEl=_6de;
this.navigationEl=_6df;
this.titleId=_6e1;
if(_6e2){
new DivReplaceHandler(this.channel+"http://www.blockbuster.com/catalog/movie/movieTrailers/"+_6e1+"/"+true,_6e0,null,this.processInitializeTitles.bind(this)).execute();
}else{
if(_6e4){
new DivReplaceHandler(this.channel+"http://www.blockbuster.com/catalog/movie/movieTrailers/"+_6e1+"/"+true,_6e0,null,this.processInitializeTitles.bind(this)).execute();
}
new DivReplaceHandler(this.channel+"http://www.blockbuster.com/catalog/movie/browseTrailersTab",this.navigationEl,null,this.processBrowseTrailersTab.bind(this)).execute();
}
},nextTitle:function(_6e5){
var _6e6=this.findCurrentTitleEl();
if(_6e6!=null&&this.titlePosition!=(this.titlePlaylist.length-1)){
_6e6.className="clip";
}
this.titlePosition++;
if(this.titlePlaylist.length==this.titlePosition){
return;
}
var _6e7=this.findCurrentTitleEl();
_6e7.className="clip currentTitle";
var _6e8=this.titlePlaylist[this.titlePosition].id;
new DivReplaceHandler(this.channel+"http://www.blockbuster.com/catalog/movie/trailerBoxart/"+_6e8,"boxartLayout",null,this.processNextTitleResponse.bind(this)).execute();
return false;
},findCurrentTitleEl:function(){
var _6e9;
if(this.titlePosition==-1){
return null;
}
if(!this.specificMovie){
_6e9="title_"+this.titlePlaylist[this.titlePosition].id;
}else{
_6e9="title_"+this.titlePosition;
}
return $(_6e9);
},nextClip:function(){
this.clipsPosition++;
if(this.clipsPlaylist.length==this.clipsPosition){
if(this.titlePlaylist.length>=0){
this.nextTitle();
}else{
this.clipsPosition--;
}
}else{
this.playCurrentClip();
$("clip_"+this.clipsPosition).previousSibling.className="clip";
$("clip_"+this.clipsPosition).className="clip currentClip";
}
},goToClip:function(_6ea){
if($("clip_"+this.clipsPosition)!=null){
$("clip_"+this.clipsPosition).className="clip";
}
this.clipsPosition=_6ea;
this.playCurrentClip();
},goToTitle:function(_6eb){
if($("title_"+this.titlePosition)!=null){
$("title_"+this.titlePosition).className="clip";
}
this.titlePosition=_6eb;
$("title_"+this.titlePosition).className="clip currentTitle";
var _6ec=this.titlePlaylist[_6eb].id;
new DivReplaceHandler(this.channel+"http://www.blockbuster.com/catalog/movie/trailerBoxart/"+_6ec,"boxartLayout",null,this.processNextTitleResponse.bind(this)).execute();
return false;
},browseTrailers:function(_6ed,_6ee,_6ef,_6f0){
this.resetTitlesStyles();
if($(_6ed).innerHTML==""){
this.arrowEl=_6ee;
this.menuName=_6ef;
if(_6f0){
new DivReplaceHandler(this.channel+"http://www.blockbuster.com/catalog/movie/browseTrailerLists/"+_6ef,_6ed,null,this.processExpandMenuResponse.bind(this)).execute();
}else{
new DivReplaceHandler(this.channel+"http://www.blockbuster.com/catalog/movie/browseTrailerTitles/"+_6ef,_6ed,null,this.processExpandSubMenuResponse.bind(this)).execute();
}
}else{
if($(_6ed).style.display=="none"){
$(_6ed).style.display="block";
$(this.arrowEl).className="listCollapse";
this.menuName=_6ef;
if(!_6f0){
new DivReplaceHandler(this.channel+"http://www.blockbuster.com/catalog/movie/browseTrailerTitles/"+_6ef,_6ed,null,this.processExpandSubMenuResponse.bind(this)).execute();
}
}else{
$(_6ed).style.display="none";
$(_6ee).className="listExpand";
}
}
},browseTrailersTab:function(){
this.specificMovie=false;
new DivReplaceHandler(this.channel+"http://www.blockbuster.com/catalog/movie/browseTrailersTab",this.navigationEl,null,this.processBrowseTrailersTab.bind(this)).execute();
},processInitializeTitles:function(_6f1){
this.titlePlaylist=_6f1.queuedTitles;
this.titlePosition=0;
new DivReplaceHandler(this.channel+"http://www.blockbuster.com/catalog/movie/trailerClips/"+this.titleId,this.clipsEl,null,this.processInitializeClips.bind(this)).execute();
},processInitializeClips:function(_6f2){
this.clipsPlaylist=_6f2.clips;
this.clipsPosition=0;
this.playCurrentClip();
},processNextTitleResponse:function(_6f3){
var _6f4=this.titlePlaylist[this.titlePosition].id;
new DivReplaceHandler(this.channel+"http://www.blockbuster.com/catalog/movie/trailerClips/"+_6f4,this.clipsEl,null,this.processInitializeClips.bind(this)).execute();
},processExpandMenuResponse:function(_6f5){
$(this.arrowEl).className="listCollapse";
},processExpandSubMenuResponse:function(_6f6){
$(this.arrowEl).className="listCollapse";
var _6f7=$("json_"+this.menuName).innerHTML;
this.titlePlaylist=eval("("+_6f7+")");
this.titlePosition=-1;
this.nextTitle();
new DivReplaceHandler(this.channel+"http://www.blockbuster.com/catalog/movie/trailerBoxart/"+this.titlePlaylist[0].id,"boxartLayout",null,this.processNextTitleResponse.bind(this)).execute();
},processBrowseTrailersTab:function(_6f8){
$(this.clipsEl).innerHTML="";
},resetTitlesStyles:function(_6f9){
var i=0;
if(this.titlePlaylist==null){
this.titlePlaylist=0;
}
for(i=0;i<this.titlePlaylist.length;i++){
titleEl="title_"+this.titlePlaylist[i].id;
titleLink=$(titleEl);
if(titleLink!=null){
titleLink.className="clip";
}
}
},playCurrentClip:function(){
var _6fb=this.clipsPlaylist[this.clipsPosition].eclipId;
var _6fc=this.clipsPlaylist[this.clipsPosition].bitrateId;
$("clip_"+this.clipsPosition).className="clip currentClip";
this.findSWF(this.movieTrailerPlayer).playNextClip(_6fb,_6fc);
},findSWF:function(_6fd){
if(navigator.appName.indexOf("Microsoft")!=-1){
return window[_6fd];
}else{
return document[_6fd];
}
}};
var BrowseTrailerUtil=Class.create();
BrowseTrailerUtil={selectCategory:function(_6fe){
categoryEl=$(_6fe);
if(categoryEl.style.display=="none"){
categoryEl.style.display="";
}else{
categoryEl.style.display="none";
}
}};
function selectDefaultPlan(id){
var _700=document.getElementsByName("selectedPlanId");
for(var i=0;i<_700.length;i++){
if(_700[i].value==document.getElementById(id).value){
_700[i].checked=true;
}
}
}
function checkForSuspendOption(_702,_703,_704,_705){
var _706=document.getElementsByName(_702);
var _707=document.getElementsByName(_703);
var _708=new Array();
var _709=0;
var _70a="";
for(var i=0;i<_706.length;i++){
if(_706[i].checked==true){
_708[_709]=_706[i];
_709=_709+1;
}
}
if(_708.length==1){
for(var j=0;j<_707.length;j++){
if(_708[0].value==_707[j].value){
_70a=_708[0].value;
}
}
}
if(_70a!=""){
Overlay=new popupUrlHandler("/acctmgmt/suspendSubscriptionOption?suspendReasonCode="+_70a+"&actionPath="+_704+"&cancelPage="+_705,"boxPopup","",null);
Overlay.execute();
return false;
}
return true;
}
function showOverlay(id1,id2,id3,id4,id5){
var _712=document.getElementsByName(id2);
for(var i=0;i<_712.length;i++){
if(_712[i].checked==true){
var _714=_712[i].value;
}
}
if(_714==undefined){
_714="";
}
var _715=document.getElementById(id1).value;
var _716=_715.replace(/\n/g,"m1b2k3");
var _717=document.getElementById(id3).value;
var _718=document.getElementById(id4).value;
var _719=document.getElementById(id5).value;
Overlay=new popupUrlHandler("/giftsubscription/buy/previewEcard?message="+_716+"&greeting="+_717+"&plan="+_714+"&recipientFirstName="+_718+"&recipientLastName="+_719,"boxPopup","",null);
Overlay.execute();
}
function showThankYouOverlay(id){
var _71b=document.getElementById(id).value;
var _71c=_71b.replace(/\n/g,"m1b2k3");
Overlay=new popupUrlHandler("/giftsubscription/redeem/previewThankYouECard?message="+_71c,"boxPopup","",null);
Overlay.execute();
}
function showOutstandingDVDOverlay(url){
Overlay=new popupUrlHandler(url,"boxPopup","",null);
Overlay.execute();
}
function showHideRateCard(){
showDiv("planLimited");
showDiv("additionalplans");
showDiv("btaCap3");
showDiv("btaCap2");
showDiv("btaCap1");
showDiv("threePlanView");
showDiv("belowRateCardExpanded");
showDiv("rateCardMail3");
showDiv("rateCardMail2");
showDiv("rateCardMail1");
showDiv("helpBTAM");
hideDiv("plans");
hideDiv("signupMbox");
hideDiv("twoPlanView");
hideDiv("belowRateCardDefault");
document.getElementById("rateCardBTA3").style.width="160px";
document.getElementById("rateCardBTA2").style.width="160px";
document.getElementById("rateCardBTA1").style.width="160px";
document.getElementById("rateCardBTALimited12").style.width="160px";
document.getElementById("signupContent").style.width="729px";
document.getElementById("signupContent").style.margin="0px";
document.getElementById("headerImg").style.width="483px";
document.getElementById("plansPromo").style.width="594px";
if(document.getElementById("rpFlowDescription")!=null){
document.getElementById("rpFlowDescription").style.width="45.9%";
document.getElementById("rpFlow").style.width="53.9%";
document.getElementById("rpFlowText").style.width="200px";
}
document.SignupActionForm.showExpandedView.value="true";
}
function showSelectedDiv(_71e){
var _71f=findSelectedValue(_71e.paymentMethod);
if(_71f==""){
return;
}
if(_71f=="155"){
enableBillingFields();
enableAddressFields();
hideDiv("paymentMethodCC");
showDiv("paymentMethodCheck");
hideDiv("paymentMethodCheckBusiness");
showDiv("paymentMethodCheckPersonal");
hideDiv("businessCheckPhone");
showDiv("personalCheckPhone");
}else{
if(_71f=="156"){
hideDiv("paymentMethodCC");
showDiv("paymentMethodCheck");
showDiv("paymentMethodCheckBusiness");
hideDiv("paymentMethodCheckPersonal");
showDiv("businessCheckPhone");
hideDiv("personalCheckPhone");
disableBillingFields();
}else{
enableAddressFields();
showDiv("paymentMethodCC");
hideDiv("paymentMethodCheck");
hideDiv("paymentMethodCheckBusiness");
hideDiv("paymentMethodCheckPersonal");
hideDiv("businessCheckPhone");
hideDiv("personalCheckPhone");
}
}
}
function disableBillingFields(){
document.getElementById("checkAccount.firstName").readOnly=true;
document.getElementById("checkAccount.lastName").readOnly=true;
document.getElementById("checkAccount.routingNumber").readOnly=true;
document.getElementById("checkAccount.clearTextAccountNumber").readOnly=true;
document.getElementById("checkAccount.companyName").readOnly=true;
document.getElementById("checkAccount.phoneAreaCode").readOnly=true;
document.getElementById("checkAccount.phoneNumberPreffix").readOnly=true;
document.getElementById("checkAccount.phoneNumberSuffix").readOnly=true;
document.getElementById("billingAddress.addressLine1").readOnly=true;
document.getElementById("billingAddress.addressLine2").readOnly=true;
document.getElementById("billingAddress.city").readOnly=true;
document.getElementById("billingAddress.stateCode").disabled=true;
document.getElementById("billingAddress.zipCode").readOnly=true;
document.getElementById("billingPhoneNumber.areaCode").readOnly=true;
document.getElementById("billingPhoneNumber.prefix").readOnly=true;
document.getElementById("billingPhoneNumber.suffix").readOnly=true;
}
function enableAddressFields(){
if(document.getElementById("billingAddress.addressLine1").value!=""){
document.getElementById("billingAddress.addressLine1").readOnly=false;
document.getElementById("billingAddress.addressLine2").readOnly=false;
document.getElementById("billingAddress.city").readOnly=false;
document.getElementById("billingAddress.stateCode").disabled=false;
document.getElementById("billingAddress.zipCode").readOnly=false;
document.getElementById("billingPhoneNumber.areaCode").readOnly=false;
document.getElementById("billingPhoneNumber.prefix").readOnly=false;
document.getElementById("billingPhoneNumber.suffix").readOnly=false;
}
}
function enableBillingFields(){
document.getElementById("checkAccount.firstName").readOnly=false;
document.getElementById("checkAccount.lastName").readOnly=false;
document.getElementById("checkAccount.routingNumber").readOnly=false;
document.getElementById("checkAccount.clearTextAccountNumber").readOnly=false;
document.getElementById("checkAccount.phoneAreaCode").readOnly=false;
document.getElementById("checkAccount.phoneNumberPreffix").readOnly=false;
document.getElementById("checkAccount.phoneNumberSuffix").readOnly=false;
}
function fnShowMap(_720){
var _721=null;
if(_721!=null){
_721.close();
_721=null;
}
var URL="/stores/storelocator/storeDetailMap?locationId="+_720;
_721=window.open(URL,"openWin","width=675,height=350,scrollbars=no,topmargin=0,leftmargin=0");
}
function onMouseDown(_723){
if(_723.button==2||_723.button==3){
if(document.getElementById("accountInfo.confirmEmail")){
disableContextMenu(document.getElementById("accountInfo.confirmEmail"));
}
if(document.getElementById("accountInfo.verifyPassword")){
disableContextMenu(document.getElementById("accountInfo.verifyPassword"));
}
if(document.getElementById("registrationRequest.confirmEmail")){
disableContextMenu(document.getElementById("registrationRequest.confirmEmail"));
}
if(document.getElementById("registrationRequest.verifyPassword")){
disableContextMenu(document.getElementById("registrationRequest.verifyPassword"));
}
if(document.getElementById("giftSubscriptionInfo.confirmRecipientEmailAddress")){
disableContextMenu(document.getElementById("giftSubscriptionInfo.confirmRecipientEmailAddress"));
}
}
}
function onKeyDown(_724){
if(_724.ctrlKey){
_724.returnValue=false;
var _725=String.fromCharCode(_724.keyCode).toLowerCase();
if(_725=="c"||_725=="v"){
_724.returnValue=false;
return false;
}
}
}
function disablePassword(_726){
passwordObj=document.getElementById("accountInfo.password");
verfPasswordObj=document.getElementById("accountInfo.verifyPassword");
emailObj=document.getElementById("accountInfo.email");
confirmEmailObj=document.getElementById("accountInfo.confirmEmail");
if(_726=="true"){
passwordObj.disabled=false;
verfPasswordObj.disabled=false;
emailObj.readOnly=false;
confirmEmailObj.readOnly=false;
}else{
passwordObj.disabled=true;
verfPasswordObj.disabled=true;
emailObj.readOnly=true;
confirmEmailObj.readOnly=true;
}
}
function submitForm(path){
document.CancelSubscriptionActionForm.suspendDeclined.value="true";
document.CancelSubscriptionActionForm.suspendEligible.value="false";
document.CancelSubscriptionActionForm.action=document.getElementById(path).value;
document.CancelSubscriptionActionForm.submit();
}
function marquee(_728,_729,_72a,_72b){
var _72c=document.getElementById(_728+"MarqueeBox");
var _72d=document.getElementById(_728+"Marquee");
var _72e=(_72c.style.left==null||_72c.style.left=="")?"0px":_72c.style.left;
var _72f=(_72c.getElementsByTagName("mt").length/_72a)*_72b;
var _730=Math.abs(_72f)<=(Math.abs(_72d.innerHTML)+_72b);
if(_72d.innerHTML==""){
_72d.innerHTML=0;
}
if(_729=="left"&&_72d.innerHTML>=0){
return false;
}else{
if(_729=="right"&&_730==true){
return false;
}
}
if(_729=="right"){
_72d.innerHTML=parseInt(_72d.innerHTML)-_72b;
}else{
_72d.innerHTML=parseInt(_72d.innerHTML)+_72b;
}
if(_72d.innerHTML==0){
Element.addClassName(_728+"LeftButton","leftDisable");
}else{
Element.removeClassName(_728+"LeftButton","leftDisable");
new Effect.Move($(_728+"MarqueeBox"),{x:_72d.innerHTML,mode:"absolute",delay:0.5});
}
if(Math.abs(_72f)<=(Math.abs(_72d.innerHTML)+_72b)){
Element.addClassName(_728+"RightButton","rightDisable");
}else{
Element.removeClassName(_728+"RightButton","rightDisable");
new Effect.Move($(_728+"MarqueeBox"),{x:_72d.innerHTML,mode:"absolute",delay:0.5});
}
}
function scroller(_731,_732,_733){
if(window.position==undefined){
position=0;
}
if(_731=="right"){
position=position+4;
if(position>(_732-4)){
position=_732-4;
}
}else{
position=position-4;
if(position<0){
position=0;
}
}
if(position==_732-4){
Element.addClassName("scrollerRightButton","disable");
}else{
Element.removeClassName("scrollerRightButton","disable");
}
if(position==0){
Element.addClassName("scrollerLeftButton","disable");
}else{
Element.removeClassName("scrollerLeftButton","disable");
}
new Effect.Move($("scroller"),{x:-position*_733,mode:"absolute",delay:0.5});
}
function chkLength(evt,len){
var str=document.getElementById("textMessage");
if(str.value.length<len){
document.getElementById("ecardLimit").style.display="none";
showOverlay("textMessage","selectedPlanId","greetingType","recipientFirstName","recipientLastName");
}else{
document.getElementById("ecardLimit").style.display="block";
document.getElementById("textMessage").focus();
}
}
function setCookie(_737,_738,_739){
var _73a=new Date();
_73a.setTime(_73a.getTime()+(_739*24*3600*1000));
document.cookie=_737+"="+escape(_738)+((_739==null)?"":"; expires="+_73a);
}
function delCookie(_73b){
if(getCookie(_73b)){
document.cookie=_73b+"="+"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
function getCookie(_73c){
if(document.cookie.length>0){
begin=document.cookie.indexOf(_73c+"=");
if(begin!=-1){
begin+=_73c.length+1;
end=document.cookie.indexOf(";",begin);
if(end==-1){
end=document.cookie.length;
}
return unescape(document.cookie.substring(begin,end));
}
}
return null;
}
function openSection(el,_73e){
setCookie(_73e+"Cookie","open","1");
Element.addClassName(el,_73e+"Display");
}
function closeSection(el,_740){
setCookie(_740+"Cookie","close","1");
Element.removeClassName(el,_740+"Display");
}
function showDiv(div){
document.getElementById(div).style.display="block";
}
function hideDiv(div){
document.getElementById(div).style.display="none";
}
function findSelectedValue(_743){
for(var i=0;i<_743.length;i++){
if(_743[i].selected){
return _743[i].value;
}
}
return -1;
}
function submitOnce(form){
var _746=form.getAttribute("alreadySubmitted")?true:false;
if(_746){
return false;
}else{
form.setAttribute("alreadySubmitted",true);
return true;
}
}
function disableContextMenu(_747){
_747.oncontextmenu=function(){
return false;
};
}
function anchorAt(_748){
window.location.hash=_748;
return false;
}
if(!document.myGetElementsByClassName){
document.myGetElementsByClassName=function(_749){
var _74a=document.getElementsByTagName("*")||document.all;
var _74b=new Array();
for(var i=0;i<_74a.length;i++){
var _74d=_74a[i];
var _74e=_74d.className.split(" ");
for(var j=0;j<_74e.length;j++){
if(_74e[j]==_749){
_74b.push(_74d);
break;
}
}
}
return _74b;
};
}
var Reflection={defaultHeight:0.5,defaultOpacity:0.5,add:function(_750,_751){
Reflection.remove(_750);
doptions={"height":Reflection.defaultHeight,"opacity":Reflection.defaultOpacity};
if(_751){
for(var i in doptions){
if(!_751[i]){
_751[i]=doptions[i];
}
}
}else{
_751=doptions;
}
try{
var d=document.createElement("div");
var p=_750;
var _755=p.className.split(" ");
var _756="";
for(j=0;j<_755.length;j++){
if(_755[j]!="reflect"){
if(_756){
_756+=" ";
}
_756+=_755[j];
}
}
var _757=Math.floor(p.height*_751["height"]);
var _758=Math.floor(p.height*(1+_751["height"]));
var _759=p.width;
if(document.all&&!window.opera){
if(p.parentElement.tagName=="A"){
var d=document.createElement("a");
d.href=p.parentElement.href;
}
d.className=_756;
p.className="reflected";
d.style.cssText=p.style.cssText;
p.style.cssText="vertical-align: bottom";
var _75a=document.createElement("img");
_75a.src=p.src;
_75a.style.width=_759+"px";
_75a.style.display="block";
_75a.style.height=p.height+"px";
_75a.style.marginBottom="-"+(p.height-_757)+"px";
_75a.style.filter="flipv progid:DXImageTransform.Microsoft.Alpha(opacity="+(_751["opacity"]*100)+", style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy="+(_751["height"]*100)+")";
d.style.width=_759+"px";
d.style.height=_758+"px";
p.parentNode.replaceChild(d,p);
d.appendChild(p);
d.appendChild(_75a);
}else{
var _75b=document.createElement("canvas");
if(_75b.getContext){
d.className=_756;
p.className="reflected";
d.style.cssText=p.style.cssText;
p.style.cssText="vertical-align: bottom";
var _75c=_75b.getContext("2d");
_75b.style.height=_757+"px";
_75b.style.width=_759+"px";
_75b.height=_757;
_75b.width=_759;
d.style.width=_759+"px";
d.style.height=_758+"px";
p.parentNode.replaceChild(d,p);
d.appendChild(p);
d.appendChild(_75b);
_75c.save();
_75c.translate(0,_750.height-1);
_75c.scale(1,-1);
_75c.drawImage(_750,0,0,_759,_750.height);
_75c.restore();
_75c.globalCompositeOperation="destination-out";
var _75d=_75c.createLinearGradient(0,0,0,_757);
_75d.addColorStop(1,"rgba(255, 255, 255, 1.0)");
_75d.addColorStop(0,"rgba(255, 255, 255, "+(1-_751["opacity"])+")");
_75c.fillStyle=_75d;
if(navigator.appVersion.indexOf("WebKit")!=-1){
_75c.fill();
}else{
_75c.fillRect(0,0,_759,_757*2);
}
}
}
}
catch(e){
}
},remove:function(_75e){
if(_75e.className=="reflected"){
_75e.className=_75e.parentNode.className;
_75e.parentNode.parentNode.replaceChild(_75e,_75e.parentNode);
}
}};
function addReflections(){
var _75f=document.myGetElementsByClassName("reflect");
for(i=0;i<_75f.length;i++){
var _760=null;
var _761=null;
var _762=_75f[i].className.split(" ");
for(j=0;j<_762.length;j++){
if(_762[j].indexOf("rheight")==0){
var _760=_762[j].substring(7)/100;
}else{
if(_762[j].indexOf("ropacity")==0){
var _761=_762[j].substring(8)/100;
}
}
}
Reflection.add(_75f[i],{height:_760,opacity:_761});
}
}
function createCookie(){
var a=document.URL;
var _764="BB_URL_PATH_COOKIE="+a+"; path=/";
document.cookie=_764;
}
function changePaymentInformation(_765){
if(_765=="true"){
showDiv("continuePayPal");
hideDiv("startSubscription");
hideDiv("paymentInformation");
hideDiv("billingAddressGroup");
}else{
showDiv("startSubscription");
hideDiv("continuePayPal");
showDiv("paymentInformation");
showDiv("billingAddressGroup");
}
}
function continueWithPayPal(_766){
_766.paymentMethod.value="157";
_766.submit();
}
function showPayPalOptions(){
hideDiv("paymentType");
hideDiv("error");
hideDiv("paymentMethodCC");
hideDiv("paymentMethodCheck");
hideDiv("paymentMethodCheckPersonal");
hideDiv("paymentMethodCheckBusiness");
hideDiv("billingAddress");
hideDiv("businessCheckPhone");
hideDiv("personalCheckPhone");
showDiv("paypal");
hideDiv("creditCard");
showDiv("error");
}
function showSelectedOptions(_767){
if(_767=="155"){
enableBillingFields();
enableAddressFields();
showDiv("paymentType");
hideDiv("paymentMethodCC");
showDiv("paymentMethodCheck");
hideDiv("paymentMethodCheckBusiness");
showDiv("paymentMethodCheckPersonal");
hideDiv("businessCheckPhone");
showDiv("personalCheckPhone");
showDiv("billingAddress");
showDiv("creditCard");
hideDiv("paypal");
showDiv("error");
}else{
if(_767=="156"){
showDiv("paymentType");
hideDiv("paymentMethodCC");
showDiv("paymentMethodCheck");
showDiv("paymentMethodCheckBusiness");
hideDiv("paymentMethodCheckPersonal");
showDiv("businessCheckPhone");
hideDiv("personalCheckPhone");
disableBillingFields();
showDiv("billingAddress");
showDiv("creditCard");
hideDiv("paypal");
showDiv("error");
}else{
if(_767=="157"){
hideDiv("paymentType");
hideDiv("paymentMethodCC");
hideDiv("paymentMethodCheck");
hideDiv("paymentMethodCheckPersonal");
hideDiv("paymentMethodCheckBusiness");
hideDiv("businessCheckPhone");
hideDiv("personalCheckPhone");
hideDiv("billingAddress");
showDiv("paypal");
hideDiv("creditCard");
hideDiv("error");
}else{
enableAddressFields();
enableBillingFields();
showDiv("paymentType");
showDiv("paymentMethodCC");
hideDiv("paymentMethodCheck");
hideDiv("paymentMethodCheckBusiness");
hideDiv("paymentMethodCheckPersonal");
hideDiv("businessCheckPhone");
hideDiv("personalCheckPhone");
showDiv("billingAddress");
showDiv("creditCard");
hideDiv("paypal");
showDiv("error");
}
}
}
}
if(!window.foresee){
window.foresee=new Object();
}
foresee.triggerParms=new Array();
foresee.triggerParms["displayMode"]=3;
foresee.triggerParms["mid"]="UY4MsoN0sRNERoMhwQsdMA==";
foresee.triggerParms["cid"]="s5IJk4VUQdN0AQJlAFIgYg==";
foresee.triggerParms["dLF"]=6;
foresee.triggerParms["spL"]=1;
foresee.triggerParms["rw"]=129600;
foresee.triggerParms["npc"]=0;
foresee.triggerParms["compliant508"]=0;
foresee.triggerParms["width"]=450;
foresee.triggerParms["height"]=500;
foresee.triggerParms["domain"]=".blockbuster.com";
foresee.triggerParms["dhtmlURL"]="/external/html/oeFSRInvite.html";
foresee.triggerParms["oeMode"]=1;
foresee.triggerParms["sMode"]=1;
foresee.triggerParms["dLFPreCheck"]=1;
foresee.triggerParms["trackerURL"]="/external/html/surveyTracker.html";
foresee.triggerParms["lfcookie"]="ForeseeLoyalty";
foresee.triggerParms["ascookie"]="ForeseeSurveyShown";
foresee.triggerParms["olpu"]=1;
foresee.triggerParms["userURL"]=1;
foresee.triggerParms["capturePageView"]=1;
foresee.triggerParms["spE"]=100;
foresee.triggerParms["dhtmlIndex"]=10000;
foresee.triggerParms["dhtmlWidth"]=450;
foresee.triggerParms["dhtmlHeight"]=290;
foresee.triggerParms["dhtmlDelay"]=100;
foresee.triggerParms["dhtmlHighlight"]=0;
foresee.triggerParms["dhtmlOverlayBgClr"]="#EFEFEF";
foresee.triggerParms["dhtmlOverlayOpacity"]="0.85";
foresee.xPosition="CENTER";
foresee.yPosition="CENTER";
foresee.triggerParms["trackerRetry"]=2;
foresee.triggerParms["trackerDelay"]=1000;
foresee.triggerParms["trackerWidth"]=500;
foresee.triggerParms["trackerHeight"]=325;
foresee.triggerParms["trackerThirdPartyCheck"]=0;
foresee.triggerParms["trackerWinRep"]=0;
foresee.triggerParms["trackerExclude"]=0;
foresee.triggerParms["captureTriggerVersion"]="OE7.3rel26";
foresee.triggerParms["evtListener"]=1;
foresee.triggerParms["useOneCookie"]=1;
foresee.triggerParms["fsrCkSeparator"]="||";
foresee.triggerParms["fsrParmSeparator"]="=";
foresee.triggerParms["flashDetect"]=0;
foresee.fsrMSG1="Sorry, but you have already surveyed once - Thank you";
foresee.midLookupTable=new Array();
foresee.midLookupTable["/outlet/retail/shoppingCart"]="0:40:tB9AhxsNph80QwIh9BMxEQ==";
foresee.midLookupTable["/stream"]="0:40:tB9AhxsNph80QwIh9BMxEQ==";
foresee.includeList=new Array();
foresee.includeList[0]="/browse";
foresee.includeList[1]="/outlet/retail/shoppingCart";
foresee.includeList[2]="/stream";
foresee.popupURL="//www.foreseeresults.com/survey/display";
foresee.FSRImgURL="//www.foreseeresults.com/survey/FSRImg";
foresee.CSURL="//www.foreseeresults.com/survey/processCPP";
foresee.OTCImgURL="//controller.foreseeresults.com/fsrSurvey/OTCImg";
foresee.fullURL="";
foresee.winOptions="toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=1,height=1,top=4000,left=4000";
foresee.ckAlreadyShown=foresee.triggerParms["ascookie"];
foresee.ckLoyaltyCount=foresee.triggerParms["lfcookie"];
foresee.surveyPresentedBy="normal";
foresee.dcQString="";
foresee.fsrTrackerImg=null;
foresee.OTCImg=null;
foresee.FSRImg=null;
foresee.rNum=null;
foresee.newDt=null;
foresee.currTime=null;
foresee.runningscout=null;
foresee.scoutTracker=null;
foresee.trackerFromClick=false;
foresee.timeoutId=null;
foresee.fsrAbortTimer=false;
foresee.hParent=window.opener;
foresee.tempURL=null;
foresee.oeCounter=1;
foresee.fireBug=(typeof (console)=="undefined")?false:true;
foresee.PROCESS_RSID=1;
foresee.PROCESS_CPP=2;
foresee.persistentExpires=new Date();
foresee.persistentExpires.setTime(foresee.persistentExpires.getTime()+(foresee.triggerParms["rw"]*60*1000));
foresee.detect=navigator.userAgent.toLowerCase();
foresee.version=navigator.appVersion.toLowerCase();
foresee.fsr_aol=((foresee.detect.indexOf("aol")>=0)||(foresee.detect.indexOf("america online browser")>=0))?1:0;
foresee.fsr_opera=(foresee.detect.indexOf("opera")>=0)?1:0;
foresee.fsr_NS=((foresee.detect.indexOf("netscape")>=0)||(foresee.detect.indexOf("firefox")>=0))?1:0;
foresee.fsr_NS8=(foresee.detect.indexOf("netscape/8")>=0)?1:0;
foresee.fsr_NS70=(foresee.detect.indexOf("netscape")>=0&&foresee.detect.indexOf("7.0")>=0)?1:0;
foresee.fsr_NS62=(foresee.detect.indexOf("netscape")>=0&&foresee.detect.indexOf("6.2")>=0)?1:0;
foresee.fsr_mac=(navigator.platform.indexOf("Win32")<0)?1:0;
foresee.fsr_safari=(foresee.detect.indexOf("safari")>=0)?1:0;
foresee.fsr_safari_2_x=(foresee.fsr_mac&&foresee.detect.indexOf("safari")>=0&&foresee.detect.indexOf("412")>=0)?1:0;
foresee.fsr_ie=(foresee.detect.indexOf("msie")>=0&&foresee.version.indexOf("win")!=-1)?1:0;
foresee.fsr_ie5=(foresee.detect.indexOf("msie 7")>=0&&foresee.version.indexOf("win")!=-1)?1:0;
foresee.fsr_sp2=(navigator.appMinorVersion&&navigator.appMinorVersion.toLowerCase().indexOf("sp2")!=-1)?1:0;
if(typeof (foresee.triggerParms["domain"])=="undefined"){
foresee.triggerParms["domain"]=document.domain;
}
if(foresee.fsr_safari||(foresee.fsr_ie&&foresee.fsr_sp2)){
foresee.triggerParms["sMode"]=0;
}
foresee.triggerParms["dhtmlLeft"]=0;
foresee.triggerParms["dhtmlTop"]=0;
foresee.cppUrlPatch=function cppUrlPatch(s){
var _769="";
var i;
var _76b=0;
for(i=0;(_76b=s.indexOf(":",_76b))!=-1;){
_769+=s.substring(i,_76b)+"|";
i=_76b+1;
_76b++;
}
_769+=s.substring(i,s.length);
return _769;
};
foresee.specialEscape=function specialEscape(str){
var _76d="";
var i;
var _76f=0;
for(i=0;(_76f=str.indexOf("+",_76f))!=-1;){
_76d+=str.substring(i,_76f)+"%2B";
i=_76f+1;
_76f++;
}
_76d+=str.substring(i,str.length);
return _76d;
};
foresee.fsrExceptionHandler=function fsrExceptionHandler(obj,e){
if(foresee.fireBug){
console.log("Error in "+obj+"."+e.name+"="+e.message);
}
};
foresee.fsrAttachEvent=function fsrAttachEvent(obj,evt,fnc,_775){
if(foresee.triggerParms["evtListener"]==0){
return false;
}
if(fnc==null||obj==null){
return true;
}
if(obj.addEventListener&&document.addEventListener){
if(evt=="beforeunload"){
return false;
}
obj.addEventListener(evt,fnc,_775);
}else{
if(obj.attachEvent){
obj.attachEvent("on"+evt,fnc);
}else{
foresee.triggerParms["evtListener"]=0;
return false;
}
}
return true;
};
foresee.fsrCallCookieTimer=function fsrCallCookieTimer(){
if(foresee.fsrReadCookie(foresee.ckAlreadyShown)!=null){
return;
}
foresee.fsrWriteCookie("currentURL",escape(window.location.href));
foresee.timeoutId=setTimeout("foresee.fsrCallCookieTimer()",1000,"JavaScript");
};
foresee.ForeCStdGetCookie=function ForeCStdGetCookie(name){
var arg=name+"=";
var alen=arg.length;
var clen=document.cookie.length;
var i=0;
while(i<clen){
var j=i+alen;
if(document.cookie.substring(i,j)==arg){
return foresee.ForeCStdGetCookieVal(j);
}
i=document.cookie.indexOf(" ",i)+1;
if(i==0){
break;
}
}
return null;
};
foresee.ForeCStdGetCookieVal=function ForeCStdGetCookieVal(_77c){
var _77d=document.cookie.indexOf(";",_77c);
if(_77d==-1){
_77d=document.cookie.length;
}
return document.cookie.substring(_77c,_77d);
};
foresee.ForeCStdSetCookie=function ForeCStdSetCookie(name,_77f,_780,path,_782,_783){
if((document.domain.toLowerCase().indexOf("localhost"))!=-1){
_782="";
}
document.cookie=name+"="+_77f+((_780)?";expires="+_780.toGMTString():"")+((path)?";path="+path:"")+((_782)?";domain="+_782:"")+((_783)?";secure":"");
};
foresee.fsrFindCookieVal=function fsrFindCookieVal(_784,name){
if(_784==null||typeof _784=="undefined"||name==null){
return null;
}
var _786=_784.split(foresee.triggerParms["fsrCkSeparator"]);
for(var i=0;i<_786.length;i++){
var _788=_786[i].split(foresee.triggerParms["fsrParmSeparator"]);
if(name.toLowerCase()==_788[0].toLowerCase()){
return unescape(_788[1]);
}
}
return null;
};
foresee.fsrReplaceCookieVal=function fsrReplaceCookieVal(_789,name,_78b){
if(_789==null||typeof _789=="undefined"){
return "";
}
var _78c="";
var _78d=_789.split(foresee.triggerParms["fsrCkSeparator"]);
for(var i=0;i<_78d.length;i++){
var _78f=_78d[i].split(foresee.triggerParms["fsrParmSeparator"]);
_78c+=_78f[0];
if(name.toLowerCase()==_78f[0].toLowerCase()){
var _790=_78f[1].replace(_78f[1],_78b);
_78f[1]=_790;
}
if(_78f[1]!=null){
_78c+=foresee.triggerParms["fsrParmSeparator"]+_78f[1];
}
if(i+1<_78d.length){
_78c+=foresee.triggerParms["fsrCkSeparator"];
}
}
return _78c;
};
foresee.fsrReadCookie=function fsrReadCookie(_791,_792){
var _793="FSRCookie";
if(arguments.length==2){
_793=_792;
}
if(foresee.triggerParms["useOneCookie"]==0&&arguments.length==1){
return foresee.ForeCStdGetCookie(_791);
}
var _794=foresee.ForeCStdGetCookie(_793);
return foresee.fsrFindCookieVal(_794,_791);
};
foresee.fsrWriteCookie=function fsrWriteCookie(_795,_796,_797,_798){
if(foresee.fsrReadCookie(foresee.ckAlreadyShown)=="true"){
return;
}
var _799="FSRCookie";
if(arguments.length==4){
_799=_797;
}
if(foresee.triggerParms["useOneCookie"]==0&&arguments.length==2){
(foresee.triggerParms["npc"]==0&&_795==foresee.ckAlreadyShown)?foresee.ForeCStdSetCookie(_795,_796,foresee.persistentExpires,"/",foresee.triggerParms["domain"]):foresee.ForeCStdSetCookie(_795,_796,null,"/",foresee.triggerParms["domain"]);
return;
}
if(_795==null||_796==null||typeof (_796)=="undefined"){
return;
}
if(_796.length==0){
return;
}
if(_795=="ScoutRunningCheck"){
_796=escape(_796);
}
var _79a=(foresee.ForeCStdGetCookie(_799)==null)?"":foresee.ForeCStdGetCookie(_799);
var _79b=false;
if(_79a.indexOf(_795)!=-1){
_79a=foresee.fsrReplaceCookieVal(_79a,_795,_796);
_79b=true;
}
if(!_79b){
if(_79a.length>0){
_79a+=foresee.triggerParms["fsrCkSeparator"];
}
_79a+=_795+foresee.triggerParms["fsrParmSeparator"]+_796;
}
if(arguments.length==4){
foresee.ForeCStdSetCookie(_799,_79a,_798,"/",foresee.triggerParms["domain"]);
}else{
(foresee.triggerParms["npc"]==0&&_795==foresee.ckAlreadyShown)?foresee.ForeCStdSetCookie(_799,_79a,foresee.persistentExpires,"/",foresee.triggerParms["domain"]):foresee.ForeCStdSetCookie(_799,_79a,null,"/",foresee.triggerParms["domain"]);
}
};
foresee.fsrDeleteCookie=function fsrDeleteCookie(name){
var _79d="Fri, 3 Aug 2001 00:00:00 GMT";
document.cookie=name+"="+";expires="+_79d+";path=/"+((typeof (foresee.triggerParms["domain"])!="undefined")?";domain="+foresee.triggerParms["domain"]:"");
};
foresee.fsrDeleteAdminCookie=function fsrDeleteAdminCookie(val){
if(foresee.triggerParms["useOneCookie"]==0){
foresee.fsrDeleteCookie(foresee.ckAlreadyShown);
foresee.fsrDeleteCookie("ScoutRunningCheck");
}else{
foresee.fsrDeleteCookie("FSRCookie");
foresee.fsrDeleteCookie("FSRAdmin");
}
};
foresee.fsrWriteAdminCookie=function fsrWriteAdminCookie(val,lf,sp){
if(foresee.triggerParms["useOneCookie"]==0&&val=="1"){
foresee.fsrDeleteCookie("ScoutRunningCheck");
}else{
if(foresee.triggerParms["useOneCookie"]==1&&val=="1"){
foresee.fsrDeleteCookie("FSRCookie");
}
}
var _7a2=new Date();
_7a2.setTime(_7a2.getTime()+(24*60*1000));
if(val=="0"){
foresee.fsrWriteCookie("lf",lf,"FSRAdmin",_7a2);
foresee.fsrWriteCookie("sp",sp,"FSRAdmin",_7a2);
}else{
foresee.fsrWriteCookie("dLF",lf,"FSRAdmin",_7a2);
foresee.fsrWriteCookie("spL",sp,"FSRAdmin",_7a2);
}
};
foresee.fsrOnBeforeUnload=function fsrOnBeforeUnload(){
if(foresee.triggerParms["oeMode"]==1&&foresee.fsrReadCookie(foresee.ckAlreadyShown)==null){
if(foresee.fsrReadCookie("currentURL")!=null||foresee.fsrReadCookie("currentURL")!="blank"){
foresee.fsrWriteCookie("previousURL",escape(foresee.fsrReadCookie("currentURL")));
}
foresee.fsrWriteCookie("currentURL","blank");
}
};
foresee.fsrOnUnload=function fsrOnUnload(){
if(foresee.triggerParms["oeMode"]==1&&foresee.fsrReadCookie(foresee.ckAlreadyShown)==null){
if(foresee.fsrReadCookie("currentURL")!="blank"){
foresee.fsrWriteCookie("previousURL",escape(foresee.fsrReadCookie("currentURL")));
}
foresee.fsrWriteCookie("currentURL","blank");
}
};
foresee.fsrOnUnloadTracker=function fsrOnUnloadTracker(){
if(foresee.triggerParms["trackerWinRep"]==0){
foresee.fsrWriteCookie("ScoutRunningCheck","ScoutClosed");
}
};
foresee.fsrGetURLParameters=function fsrGetURLParameters(_7a3){
if(_7a3==null||typeof (_7a3)=="undefined"){
return "";
}
try{
var sURL=window.document.URL.toString();
if(sURL.indexOf("?")==-1){
return "";
}
var _7a5=sURL.split("?");
var _7a6=_7a5[1].split("&");
for(var i=0;i<_7a6.length;i++){
var _7a8=_7a6[i].split("=");
if(_7a3.toLowerCase()==_7a8[0].toLowerCase()){
if(_7a8[1]=="undefined"){
return "";
}
return unescape(_7a8[1]);
}
}
}
catch(e){
}
return "";
};
foresee.setFSRSurveyCookie=function setFSRSurveyCookie(){
foresee.fsrWriteCookie(foresee.ckAlreadyShown,"true");
};
foresee.fsrSizeWindow=function fsrSizeWindow(w,h){
window.moveTo(self.screen.width/2-w/2,self.screen.height/2-h/2);
window.resizeTo(w,h);
};
foresee.fsrIsCookieEnabled=function fsrIsCookieEnabled(){
var _7ab=(navigator.cookieEnabled)?true:false;
if(typeof navigator.cookieEnabled=="undefined"&&!_7ab){
document.cookie="testcookie";
_7ab=(document.cookie.indexOf("testcookie")!=-1)?true:false;
}
return _7ab;
};
foresee.isReferrerSponsoredLink=function isReferrerSponsoredLink(){
if((window.document.referrer!="")&&(window.document.referrer!="-")){
if(foresee.fsrIsOnList(foresee.referrerList,foresee.triggerParms["trackerExclude"],document.referrer)){
return true;
}
}
return false;
};
foresee.fsrIsOnList=function fsrIsOnList(list,_7ad,_7ae){
if(typeof (list)=="undefined"){
return false;
}
if(list.length==0){
return false;
}
if(arguments.length==1||_7ae==null){
foresee.hParent=window.opener;
if(foresee.hParent!=null){
_7ae=foresee.hParent.location.href;
}else{
_7ae=window.parent.location.href;
}
}
for(var i=0;i<list.length;i++){
if((_7ae.toLowerCase()).indexOf(list[i].toLowerCase())!=-1){
if(typeof (trgActFlg)!="undefined"&&_7ad==1){
foresee.closeTrackerWin();
}
return true;
}
}
return false;
};
foresee.oeImgProc=function oeImgProc(){
if(foresee.triggerParms["compliant508"]==1){
foresee.showDHTMLWin();
}else{
setTimeout("foresee.showDHTMLWin();",foresee.triggerParms["dhtmlDelay"],"JavaScript");
}
};
foresee.fsrShowSurvey=function fsrShowSurvey(){
if(foresee.dcQString==""){
foresee.oeImgProc();
}else{
foresee.newDt=new Date();
foresee.currTime=foresee.newDt.getTime();
foresee.FSRImg=new Image();
foresee.FSRImg.onerror=foresee.imgErrorProc;
foresee.FSRImg.onload=foresee.imgOnloadProc;
foresee.FSRImg.src=foresee.FSRImgURL+"?"+foresee.dcQString+"&uid="+foresee.currTime;
}
};
foresee.imgOnloadProc=function imgOnloadProc(){
if(foresee.FSRImg.width==3){
foresee.oeImgProc();
}
return true;
};
foresee.imgErrorProc=function imgErrorProc(){
return true;
};
foresee.otcOnloadProc=function otcOnloadProc(){
if(foresee.OTCImg.width==3){
foresee.fsrShowSurvey();
}
return true;
};
foresee.otcErrorProc=function otcErrorProc(){
foresee.fsrShowSurvey();
return true;
};
foresee.fsrSendReq=function fsrSendReq(_7b0){
var _7b1=(foresee.triggerParms["mid"]==null)?foresee.triggerParms["sid"]:foresee.specialEscape(escape(foresee.triggerParms["mid"]));
if(_7b0==foresee.PROCESS_RSID){
foresee.CSURL+="?actionId="+_7b0+"&mid="+_7b1;
}else{
if(_7b0==foresee.PROCESS_CPP){
foresee.CSURL+="?actionId="+_7b0+"&mid="+_7b1+foresee.fsrGetCPP();
}
}
foresee.fsrTrackerImg=new Image();
foresee.fsrTrackerImg.onerror=foresee.fsrOnImgError;
foresee.fsrTrackerImg.onload=foresee.fsrOnImgLoad;
foresee.newDt=new Date();
foresee.currTime=foresee.newDt.getTime();
foresee.fsrTrackerImg.src=foresee.CSURL+"&uid="+foresee.currTime;
};
foresee.fsrOnImgLoad=function fsrOnImgLoad(){
if(foresee.fsrTrackerImg.width>=5){
if(foresee.triggerParms["sMode"]==1){
foresee.fsrWriteCookie("fsrImgLoaded",false);
window.close();
}
}else{
if(foresee.triggerParms["sMode"]==1){
foresee.fsrWriteCookie("fsrImgLoaded",true);
}
}
};
foresee.fsrOnImgError=function fsrOnImgError(){
if(foresee.triggerParms["sMode"]==1){
foresee.fsrWriteCookie("fsrImgLoaded",false);
}
};
foresee.fsrSetFilter=function fsrSetFilter(){
foresee.fullURL+="&sid="+foresee.triggerParms["sid"];
if(foresee.triggerParms["patternType"]!=null&&(foresee.triggerParms["patternType"].toUpperCase()).indexOf("URL")!=-1){
var _7b2="";
if(foresee.fsrReadCookie("currentURL")!=null&&foresee.fsrReadCookie("currentURL")!="blank"){
_7b2=foresee.fsrReadCookie("currentURL");
}else{
if(foresee.fsrReadCookie("previousURL")!=null){
_7b2=foresee.fsrReadCookie("previousURL");
}
}
foresee.fullURL+="&pattern="+escape(_7b2);
}else{
if(foresee.triggerParms["patternType"]!=null&&(foresee.triggerParms["patternType"].toUpperCase()).indexOf("CK=")!=-1){
var pos=foresee.triggerParms["patternType"].indexOf("=");
var _7b4=foresee.fsrReadCookie(foresee.triggerParms["patternType"].substring(pos+1));
foresee.fullURL+="&pattern="+escape(_7b4);
}else{
if(foresee.triggerParms["patternType"]!=null&&(foresee.triggerParms["patternType"].toUpperCase())!=null&&foresee.triggerParms["patternType"].length>0){
foresee.fullURL+="&pattern="+escape(foresee.triggerParms["patternType"]);
}
}
}
};
foresee.fsrSetFullURL=function fsrSetFullURL(){
foresee.fullURL=foresee.popupURL+"?"+"width="+foresee.triggerParms["width"]+"&height="+foresee.triggerParms["height"]+"&cid="+foresee.specialEscape(escape(foresee.triggerParms["cid"]));
if(foresee.triggerParms["sid"]!=null&&foresee.triggerParms["mid"]==null){
foresee.fsrSetFilter();
}
if(foresee.triggerParms["mid"]!=null){
foresee.fullURL+="&mid="+foresee.specialEscape(escape(foresee.triggerParms["mid"]));
}
if(foresee.triggerParms["omb"]!=null){
foresee.fullURL+="&omb="+escape(foresee.triggerParms["omb"]);
}
if((foresee.triggerParms["cmetrics"])!=null){
foresee.fullURL+="&cmetrics="+escape(foresee.triggerParms["cmetrics"]);
}
if(foresee.triggerParms["olpu"]==1){
foresee.fullURL+="&olpu=1";
}
if((foresee.triggerParms["dcUniqueId"])!=null){
foresee.fullURL+="&dcUniqueId="+escape(foresee.triggerParms["dcUniqueId"]);
}
if((foresee.triggerParms["midexp"])!=null){
foresee.fullURL+="&ndc=1&fsexp=5256000&midexp="+foresee.triggerParms["midexp"];
}
if(foresee.triggerParms["sMode"]!=null){
foresee.fullURL+="&sMode="+foresee.triggerParms["sMode"];
}
};
foresee.getCPPString=function getCPPString(){
var _7b5="";
for(paramKey in foresee.triggerParms){
if(paramKey.substring(0,3)=="cpp"){
_7b5+="&"+paramKey+"="+escape(foresee.triggerParms[paramKey]);
}
}
return _7b5;
};
foresee.fsrGetCPP=function fsrGetCPP(){
var _7b6=foresee.fsrReadCookie(foresee.ckLoyaltyCount);
if(_7b6==null){
_7b6=1;
}
if(foresee.triggerParms["capturePageView"]==1){
foresee.triggerParms["cpp_2"]="PageView:"+_7b6;
}
var _7b7=foresee.triggerParms["sMode"];
if(foresee.triggerParms["sMode"]==null){
_7b7=0;
}
foresee.triggerParms["cpp_3"]="Browser:OE_Mode"+foresee.triggerParms["oeMode"]+";Survey_Mode"+_7b7+";"+foresee.cppUrlPatch(foresee.detect)+";"+foresee.triggerParms["captureTriggerVersion"]+";"+foresee.fsrGetURLParameters("surveypresented");
var _7b8=4;
for(paramKey in foresee.triggerParms){
if(paramKey.substring(0,5)=="oecpp"){
var _7b9=foresee.triggerParms[paramKey];
var _7ba=foresee.fsrReadCookie(_7b9);
if(_7ba!=null){
foresee.triggerParms["cpp_"+_7b8]=_7b9.substring(8,_7b9.length)+":"+foresee.cppUrlPatch(_7ba);
_7b8++;
}
}
}
return foresee.getCPPString();
};
foresee.fsrShowConsole=function fsrShowConsole(msg){
if(foresee.fireBug){
console.log(msg);
}
};
foresee.popSurvey=function popSurvey(){
if(!foresee.oePoll()){
foresee.fsrWriteCookie("fsrTrackerStatus","closed_foresee.popSurvey");
window.close();
}
foresee.fsrAbortTimer=true;
};
foresee.isParentClosed=function isParentClosed(){
try{
if(window.opener.closed){
return true;
}
}
catch(e){
return true;
}
return false;
};
foresee.retryScout=function retryScout(){
if(foresee.oeCounter<foresee.triggerParms["trackerRetry"]){
foresee.oeCounter++;
return true;
}
try{
if(foresee.triggerParms["oeMode"]==1){
foresee.hParent=window.opener;
foresee.fsrShowConsole("retryScout() - Checking domain false positive check");
if(foresee.triggerParms["domain"]==null||typeof (foresee.triggerParms["domain"])=="undefined"){
foresee.triggerParms["domain"]=window.location.hostname;
}
if((foresee.hParent.location.hostname).indexOf(foresee.triggerParms["domain"])!=-1){
if(foresee.oeCounter>1){
foresee.oeCounter=1;
}
return true;
}
}
}
catch(e){
foresee.fsrShowConsole("retryScout() - domain check failed - popping survey");
}
if(!foresee.fsrAbortTimer){
foresee.popSurvey();
}
return false;
};
foresee.updateParentURL=function updateParentURL(){
try{
if(foresee.triggerParms["userURL"]==1){
if(foresee.triggerParms["oeMode"]==0){
foresee.hParent=window.opener;
foresee.triggerParms["cpp_1"]="userURL:"+foresee.cppUrlPatch(foresee.hParent.location.href);
}else{
if(foresee.fsrReadCookie("previousURL")!=null&&arguments.length==0&&foresee.triggerParms["nLF"]==null){
foresee.triggerParms["cpp_1"]="userURL:"+foresee.cppUrlPatch(foresee.fsrReadCookie("previousURL"));
}else{
if(foresee.fsrReadCookie("currentURL")=="blank"){
foresee.triggerParms["cpp_1"]="userURL:"+foresee.cppUrlPatch(foresee.fsrReadCookie("previousURL"));
}else{
foresee.triggerParms["cpp_1"]="userURL:"+foresee.cppUrlPatch(foresee.fsrReadCookie("currentURL"));
}
}
}
}
}
catch(e){
foresee.fsrShowConsole(e);
foresee.errortrap();
}
};
foresee.updateLoyaltyFactor=function updateLoyaltyFactor(){
try{
var _7bc=null;
if(arguments.length==0&&foresee.triggerParms["oeMode"]==0){
foresee.hParent=window.opener;
_7bc=foresee.hParent.location.href;
}else{
if(foresee.triggerParms["oeMode"]==1){
_7bc=foresee.fsrReadCookie("currentURL");
}
}
if(_7bc!=foresee.tempURL&&_7bc!="blank"){
var _7bd=foresee.fsrReadCookie(foresee.ckLoyaltyCount);
if(_7bd==null){
_7bd=1;
}else{
if(arguments.length==0){
_7bd++;
}
}
foresee.fsrWriteCookie(foresee.ckLoyaltyCount,_7bd);
}
foresee.tempURL=_7bc;
if(typeof (foresee.excludeList)!="undefined"){
if(foresee.fsrIsOnList(foresee.excludeList,foresee.triggerParms["trackerExclude"])){
return;
}
}
}
catch(e){
foresee.fsrShowConsole(e);
foresee.errortrap();
}
};
foresee.javaUpdate=function javaUpdate(){
foresee.updateParentURL();
if(foresee.triggerParms["dLFPreCheck"]==0){
foresee.updateLoyaltyFactor();
}
if(foresee.triggerParms["nLF"]!=null){
var _7be=foresee.fsrReadCookie(foresee.ckLoyaltyCount);
if(_7be>=foresee.triggerParms["nLF"]&&(foresee.fsrReadCookie("fsrImgLoaded")!=null&&foresee.fsrReadCookie("fsrImgLoaded")=="true")){
foresee.trackerFromClick=true;
if(!foresee.fsrAbortTimer){
foresee.popSurvey();
}
}
}
};
foresee.fsrSurveyTimeout=function fsrSurveyTimeout(){
try{
foresee.fsrShowConsole("foresee.fsrSurveyTimeout() - checking exit condition...");
if(foresee.fsrAbortTimer){
foresee.fsrShowConsole("foresee.fsrSurveyTimeout() - STOP checking...");
return false;
}
if(foresee.fsrReadCookie("ScoutRunningCheck")==null||foresee.fsrReadCookie(foresee.ckAlreadyShown)!=null){
foresee.fsrWriteCookie("fsrTrackerStatus","closed_foresee.fsrSurveyTimeout");
window.close();
}
foresee.javaUpdate();
foresee.hParent=window.opener;
if(foresee.triggerParms["oeMode"]==0){
if(window.document.domain!=foresee.hParent.document.domain){
if(foresee.retryScout()&&!foresee.fsrAbortTimer){
setTimeout("foresee.fsrSurveyTimeout();",foresee.triggerParms["trackerDelay"],"JavaScript");
}
}else{
if(!foresee.fsrAbortTimer){
setTimeout("foresee.fsrSurveyTimeout();",foresee.triggerParms["trackerDelay"],"JavaScript");
}
}
}else{
foresee.fsrIsCookieBlank();
}
}
catch(e){
foresee.fsrShowConsole(e);
foresee.errortrap();
}
};
foresee.fsrIsCookieBlank=function fsrIsCookieBlank(){
try{
if(foresee.fsrReadCookie("currentURL")==null){
foresee.fsrWriteCookie("fsrTrackerStatus","closed_foresee.fsrIsCookieBlank");
window.close();
}else{
if(foresee.fsrReadCookie("currentURL")=="blank"){
foresee.fsrShowConsole("fsrIsCookieBlank() - Cookie blank check :"+foresee.oeCounter);
foresee.fsrWriteCookie("fsr_retry",foresee.oeCounter);
if(foresee.retryScout()&&!foresee.fsrAbortTimer){
setTimeout("foresee.fsrSurveyTimeout();",foresee.triggerParms["trackerDelay"],"JavaScript");
}
}else{
if(foresee.oeCounter>1){
foresee.oeCounter=1;
}
if(!foresee.fsrAbortTimer){
setTimeout("foresee.fsrSurveyTimeout();",foresee.triggerParms["trackerDelay"],"JavaScript");
}
}
}
}
catch(e){
foresee.fsrShowConsole(e);
}
};
foresee.errortrap=function errortrap(){
foresee.fsrShowConsole("errortrap() - Exception caught");
if(foresee.fsrReadCookie("ScoutRunningCheck")==null){
foresee.fsrWriteCookie("fsrTrackerStatus","closed_foresee.errortrap");
window.close();
}
foresee.hParent=window.opener;
if(foresee.triggerParms["oeMode"]==0){
if(foresee.hParent==null||(foresee.fsr_ie&&foresee.isParentClosed())){
foresee.oeCounter=foresee.triggerParms["trackerRetry"];
}
if(foresee.retryScout()&&!foresee.fsrAbortTimer){
setTimeout("foresee.fsrSurveyTimeout();",foresee.triggerParms["trackerDelay"],"JavaScript");
}
}else{
foresee.fsrIsCookieBlank();
}
return true;
};
foresee.showDHTMLWin=function showDHTMLWin(){
if((foresee.runningscout!=null&&!foresee.runningscout.closed&&foresee.fsr_aol==false)||foresee.scoutTracker!=null){
return;
}
foresee.surveyPresentedBy="dhtml";
if(document.all){
if(foresee.triggerParms["dhtmlHighlight"]==1){
document.all.fsrOverlayDiv.style.visibility="visible";
}
document.all.FSRInviteWin.style.visibility="visible";
}else{
if(document.getElementById){
if(foresee.triggerParms["dhtmlHighlight"]==1){
document.getElementById("fsrOverlayDiv").style.visibility="visible";
}
document.getElementById("FSRInviteWin").style.visibility="visible";
}
}
};
foresee.FSRInviteAct=function FSRInviteAct(_7bf){
if(_7bf=="1"){
if(arguments.length>1){
foresee.triggerParms["mid"]=arguments[1];
foresee.fsrWriteCookie(foresee.triggerParms["oecpp_Language"],arguments[2]);
}
foresee.openTrackerWin();
}else{
foresee.setFSRSurveyCookie();
}
if(document.all){
if(foresee.triggerParms["dhtmlHighlight"]==1){
document.all.fsrOverlayDiv.style.visibility="hidden";
}
document.all.FSRInviteWin.style.visibility="hidden";
}else{
if(document.getElementById){
if(foresee.triggerParms["dhtmlHighlight"]==1){
document.getElementById("fsrOverlayDiv").style.visibility="hidden";
}
document.getElementById("FSRInviteWin").style.visibility="hidden";
}
}
};
foresee.fsrSetDivPos=function fsrSetDivPos(){
var _7c0;
var _7c1;
if(window.innerHeight){
_7c0=window.innerWidth;
_7c1=window.innerHeight;
}else{
if(document.documentElement.clientHeight>0){
_7c0=document.documentElement.clientWidth;
_7c1=document.documentElement.clientHeight;
}else{
_7c0=document.body.clientWidth;
_7c1=document.body.clientHeight;
}
}
if(foresee.xPosition=="CENTER"){
foresee.triggerParms["dhtmlLeft"]=(_7c0/2)-(foresee.triggerParms["dhtmlWidth"]/2);
}else{
if(foresee.xPosition=="LEFT"){
foresee.triggerParms["dhtmlLeft"]=10;
}else{
if(foresee.xPosition=="RIGHT"){
foresee.triggerParms["dhtmlLeft"]=(_7c0)-(foresee.triggerParms["dhtmlWidth"])-30;
}
}
}
if(foresee.yPosition=="CENTER"){
foresee.triggerParms["dhtmlTop"]=(_7c1/2)-(foresee.triggerParms["dhtmlHeight"]/2);
}else{
if(foresee.yPosition=="TOP"){
foresee.triggerParms["dhtmlTop"]=10;
}else{
if(foresee.yPosition=="BOTTOM"){
foresee.triggerParms["dhtmlTop"]=(_7c1)-(foresee.triggerParms["dhtmlHeight"])-30;
}
}
}
};
foresee.fsrShowDIV=function fsrShowDIV(_7c2,_7c3,dTop,_7c5,_7c6,_7c7,zIdx,pos,_7ca){
var _7cb=document.getElementsByTagName("BODY")[0];
if(_7cb==null||typeof (_7cb)=="undefined"){
return false;
}
var oDiv=document.createElement("div");
oDiv.id=_7c2;
oDiv.style.background=foresee.triggerParms["dhtmlOverlayBgClr"];
oDiv.style.position=pos;
oDiv.style.left=_7c3+"pt";
oDiv.style.top=dTop+"pt";
oDiv.style.width=_7c5+"%";
oDiv.style.height=_7c6+"%";
oDiv.style.border="0";
oDiv.style.visibility=_7c7;
oDiv.style.zIndex=zIdx;
oDiv.style.opacity=foresee.triggerParms["dhtmlOverlayOpacity"];
oDiv.style.filter="-moz-opacity ="+foresee.triggerParms["dhtmlOverlayOpacity"];
oDiv.style.filter="alpha(opacity="+foresee.triggerParms["dhtmlOverlayOpacity"]*100+")";
oDiv.style.cursor=_7ca;
_7cb.appendChild(oDiv);
return true;
};
foresee.fsrCreateInvite=function fsrCreateInvite(type,_7ce,_7cf,dTop,_7d1,_7d2,_7d3,_7d4,_7d5,_7d6,_7d7,_7d8){
if(type==1){
foresee.fsrSetDivPos();
_7cf=foresee.triggerParms["dhtmlLeft"];
dTop=foresee.triggerParms["dhtmlTop"];
}
if(foresee.triggerParms["evtListener"]==0&&type==1){
var _7d9="<div id=\""+_7ce+"\" style=\"position:absolute; left:"+_7cf+"px; top:"+dTop+"px; z-index:"+foresee.triggerParms["dhtmlIndex"]+"; border:0; visibility:"+_7d3+";\">"+"<iframe id=\""+_7d4+"\" src=\""+_7d8+"\" FrameBorder=0 Scrolling="+_7d7+" width="+_7d5+" height="+_7d6+"></iframe></div>";
document.write(_7d9);
return true;
}
var _7da=document.getElementsByTagName("BODY")[0];
if(_7da==null||typeof (_7da)=="undefined"){
return false;
}
var oDiv=document.createElement("div");
oDiv.id=_7ce;
oDiv.style.position="absolute";
oDiv.style.left=_7cf+"px";
oDiv.style.top=dTop+"px";
if(type==0){
oDiv.style.width=_7d1+"%";
oDiv.style.height=_7d2+"%";
}
oDiv.style.border="0";
oDiv.style.visibility=_7d3;
oDiv.style.zIndex=foresee.triggerParms["dhtmlIndex"];
_7da.appendChild(oDiv);
var _7dc=document.getElementById(_7ce);
var _7dd=document.createElement("iframe");
_7dd.id=_7d4;
_7dd.src=_7d8;
if(type==1){
_7dd.width=_7d5+"px";
_7dd.height=_7d6+"px";
}else{
_7dd.width=_7d5+"%";
_7dd.height=_7d6+"%";
}
_7dd.frameBorder="0";
_7dd.scrolling=_7d7;
_7dc.appendChild(_7dd);
return true;
};
foresee.fsrCreateScript=function fsrCreateScript(_7de,tag){
var _7e0=document.getElementsByTagName(tag)[0];
var _7e1=document.createElement("script");
_7e1.type="text/javascript";
_7e1.src=_7de;
_7e0.appendChild(_7e1);
};
foresee.fsrLoadIFrame=function fsrLoadIFrame(){
if(foresee.triggerParms["sMode"]==1){
foresee.fsrSetFullURL();
foresee.fsrCreateInvite("0","FSRSurveyDiv",0,0,100,100,"hidden","FSRSurveyIframeWin",100,100,"YES",foresee.fullURL);
}
};
foresee.closeTrackerWin=function closeTrackerWin(){
foresee.scoutTracker=foresee.fsrReadCookie("ScoutRunningCheck");
if(foresee.scoutTracker!=null){
var _7e2=window.open("","ForeseeSurveyWindow");
if(_7e2!=null&&!_7e2.closed){
_7e2.close();
}
}
};
foresee.fsrCheckPageVisited=function fsrCheckPageVisited(){
if(foresee.triggerParms["dLFPreCheck"]==0){
return foresee.triggerParms["dLF"];
}
var _7e3=foresee.fsrReadCookie(foresee.ckLoyaltyCount);
if(_7e3==null){
_7e3=0;
}
if(arguments.length==1){
_7e3++;
foresee.fsrWriteCookie(foresee.ckLoyaltyCount,_7e3);
}
return _7e3;
};
foresee.openFSRSurveyLink=function openFSRSurveyLink(){
foresee.fsrSetClientCPPS();
foresee.closeTrackerWin();
var lf=(self.screen.width-foresee.triggerParms["width"])/2;
var tp=(self.screen.height-foresee.triggerParms["height"])/2;
foresee.winOptions="toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,top="+tp+",left="+lf+",width="+foresee.triggerParms["width"]+",height="+foresee.triggerParms["height"];
foresee.trackerFromClick=true;
if(!foresee.oePoll(true)){
alert(foresee.fsrMSG1);
}
};
foresee.oePoll=function oePoll(){
foresee.rNum=Math.random()*100;
var _7e6=foresee.fsrReadCookie(foresee.ckLoyaltyCount);
var _7e7=foresee.fsrReadCookie(foresee.ckAlreadyShown);
if(_7e7==null&&_7e6!=null){
if(foresee.rNum<=foresee.triggerParms["spE"]){
foresee.setFSRSurveyCookie();
if(foresee.triggerParms["sMode"]==1&&arguments.length==0){
foresee.fsrSendReq(foresee.PROCESS_CPP);
if(foresee.triggerParms["olpu"]==0){
window.blur();
}else{
window.focus();
}
document.getElementById("FSRTrackerDiv").style.visibility="hidden";
document.getElementById("FSRSurveyDiv").style.visibility="visible";
foresee.fsrSizeWindow(foresee.triggerParms["width"],foresee.triggerParms["height"]);
return true;
}else{
foresee.fsrSetFullURL();
foresee.fullURL+=foresee.fsrGetCPP();
document.getElementById("FSRTrackerDiv").innerHTML="<font class='subtitle'>Survey is loading. Please wait...</font>";
var _7e8=window.open(foresee.fullURL,"ForeseeSurveyWindow",foresee.winOptions);
if(_7e8==null||_7e8.closed){
return false;
}
if(foresee.triggerParms["olpu"]==0){
_7e8.blur();
}else{
_7e8.focus();
}
return true;
}
}
}
return false;
};
foresee.openTrackerWin=function openTrackerWin(){
var sl=(screen.width-foresee.triggerParms["trackerWidth"])/2;
var st=(screen.height-foresee.triggerParms["trackerHeight"])/2;
var _7eb="top="+st+",left="+sl+",width="+foresee.triggerParms["trackerWidth"]+",height="+foresee.triggerParms["trackerHeight"]+",resizable=1,toolbar=0,location=0,statusbar=0,menubar=0";
if(foresee.triggerParms["sMode"]==1){
_7eb+=",scrollbars=0";
}else{
_7eb+=",scrollbars=1";
}
if(arguments.length==0){
foresee.rNum=0;
}
foresee.scoutTracker=foresee.fsrReadCookie("ScoutRunningCheck");
if(foresee.scoutTracker==null){
if(foresee.fsrCheckPageVisited()>=foresee.triggerParms["dLF"]&&foresee.rNum<=foresee.triggerParms["spL"]){
if(foresee.triggerParms["displayMode"]==3&&arguments[0]>0){
return 0;
}
foresee.runningscout=window.open(foresee.triggerParms["trackerURL"]+"?mid="+escape(foresee.triggerParms["mid"])+"&sid="+foresee.triggerParms["sid"]+"&surveypresented="+foresee.surveyPresentedBy,"ForeseeSurveyWindow",_7eb);
}else{
return 1;
}
}else{
var _7ec="";
if(typeof (foresee.triggerParms["mid"])=="undefined"){
_7ec=foresee.triggerParms["sid"];
}
if(typeof (foresee.triggerParms["sid"])=="undefined"){
_7ec=foresee.triggerParms["mid"];
}
if(foresee.fsrReadCookie(foresee.ckAlreadyShown)!=null||foresee.scoutTracker==_7ec){
return 1;
}
foresee.runningscout=window.open(foresee.triggerParms["trackerURL"]+"?mid="+escape(foresee.triggerParms["mid"])+"&sid="+foresee.triggerParms["sid"]+"&surveypresented="+foresee.surveyPresentedBy,"ForeseeSurveyWindow",_7eb);
}
if((foresee.trackerFromClick==true||arguments.length==0)&&foresee.runningscout!=null&&!foresee.runningscout.closed){
foresee.runningscout.blur();
}
window.parent.focus();
if(foresee.triggerParms["sMode"]==1||(foresee.triggerParms["sid"]!=null&&foresee.triggerParms["mid"]==null&&foresee.triggerParms["patternType"]!=null)){
foresee.fsrSendReq(foresee.PROCESS_RSID);
}
return 0;
};
foresee.openFSRTracker=function openFSRTracker(){
var _7ed=foresee.fsrReadCookie(foresee.ckAlreadyShown);
var _7ee=foresee.fsr_NS62||foresee.fsr_safari_2_x;
if(foresee.triggerParms["displayMode"]==0||_7ee||_7ed!=null||foresee.fsrReadCookie("ScoutRunningCheck")=="ScoutClosed"||!foresee.fsrIsCookieEnabled()){
return;
}
foresee.fsrSetAdminParms();
foresee.fsrCheckPageVisited(true);
var _7ef=false;
if(typeof (foresee.includeList)!="undefined"){
if(foresee.fsrIsOnList(foresee.includeList)){
_7ef=true;
}
}
var _7f0=false;
if(typeof (foresee.excludeList)!="undefined"){
_7f0=foresee.fsrIsOnList(foresee.excludeList,foresee.triggerParms["trackerExclude"]);
}
if(_7f0||!_7ef||foresee.isReferrerSponsoredLink()){
return;
}
foresee.trackerFromClick=false;
if(arguments.length>0&&arguments[0]=="0"){
foresee.triggerParms["displayMode"]=0;
}
if(arguments.length>0&&arguments[1]==true){
foresee.trackerFromClick=true;
}
if(foresee.triggerParms["sid"]!=null&&foresee.triggerParms["mid"]==null&&foresee.triggerParms["patternType"]!=null&&(foresee.triggerParms["patternType"].toUpperCase()).indexOf("URL")!=-1){
foresee.triggerParms["sMode"]=0;
if(foresee.triggerParms["oeMode"]==0){
foresee.fsrWriteCookie("currentURL",escape(window.location.href));
}
}
foresee.rNum=Math.random()*100;
if(foresee.fsrSetClientFunc()==false){
return;
}
var _7f1=foresee.openTrackerWin(foresee.rNum);
if(foresee.fsr_aol){
try{
foresee.runningscout.focus();
_7f1=1;
}
catch(e){
_7f1=0;
}
}
if(!foresee.trackerFromClick&&!foresee.fsr_NS70&&(_7f1==null||_7f1==0)&&foresee.triggerParms["displayMode"]!=2){
if(foresee.fsr_NS8){
foresee.triggerParms["dhtmlHeight"]=foresee.triggerParms["dhtmlHeight"]+15;
}
if(foresee.triggerParms["dhtmlHighlight"]==1){
foresee.fsrShowDIV("fsrOverlayDiv",0,0,100,100,"hidden",9999,"fixed","wait");
}
if(!foresee.fsrCreateInvite("1","FSRInviteWin",foresee.triggerParms["dhtmlLeft"],foresee.triggerParms["dhtmlTop"],100,100,"hidden","cframe",foresee.triggerParms["dhtmlWidth"],foresee.triggerParms["dhtmlHeight"],"NO",foresee.triggerParms["dhtmlURL"])){
foresee.fsrWriteCookie("FSRDivCreated","false");
return;
}
if((foresee.triggerParms["midexp"])!=null){
foresee.dcQString="ndc=1&midexp="+foresee.triggerParms["midexp"]+"&mid="+foresee.specialEscape(escape(foresee.triggerParms["mid"]));
if(foresee.triggerParms["dcUniqueId"]!=null){
foresee.dcQString+="&dcUniqueId="+foresee.specialEscape(escape(foresee.triggerParms["dcUniqueId"]));
}
}
foresee.newDt=new Date();
foresee.currTime=foresee.newDt.getTime();
foresee.OTCImg=new Image();
foresee.OTCImg.onerror=foresee.otcErrorProc;
foresee.OTCImg.onload=foresee.otcOnloadProc;
foresee.OTCImg.src=foresee.OTCImgURL+"?protocol="+window.location.protocol+"&uid="+foresee.currTime;
}
};
foresee.openMultiVendorSurvey=function openMultiVendorSurvey(_7f2){
foresee.closeTrackerWin();
var _7f3=foresee.triggerParms["spL"];
for(var key in foresee.vendorLookupTable){
pos=foresee.vendorLookupTable[key].indexOf(foresee.triggerParms["fsrCkSeparator"]);
vendorSP=foresee.vendorLookupTable[key].substring(0,pos);
vendorURL=foresee.vendorLookupTable[key].substring(pos+2);
if(_7f2>_7f3&&_7f2<=vendorSP){
foresee.setFSRSurveyCookie();
foresee.fsrCreateScript(vendorURL,"head");
return;
}
_7f3=vendorSP;
}
};
foresee.fsrSetAdminParms=function fsrSetAdminParms(){
if(foresee.fsrReadCookie("dLF","FSRAdmin")!=null&&foresee.fsrReadCookie("spL","FSRAdmin")!=null){
foresee.triggerParms["dLF"]=foresee.fsrReadCookie("dLF","FSRAdmin");
foresee.triggerParms["spL"]=foresee.fsrReadCookie("spL","FSRAdmin");
}
};
foresee.fsrSetMode1Parms=function fsrSetMode1Parms(){
if(foresee.triggerParms["oeMode"]==1&&foresee.fsrReadCookie(foresee.ckAlreadyShown)==null){
if(foresee.fsr_ie){
foresee.fsrAttachEvent(window,"beforeunload",foresee.fsrOnBeforeUnload,false);
}
foresee.fsrAttachEvent(window,"unload",foresee.fsrOnUnload,false);
setTimeout("foresee.fsrCallCookieTimer()",1000,"JavaScript");
}
};
foresee.fsrSetTrackerParms=function fsrSetTrackerParms(){
midVal=foresee.fsrGetURLParameters("mid");
if(midVal==""){
midVal=foresee.fsrGetURLParameters("sid");
if(midVal==""){
midVal=foresee.triggerParms["mid"];
}
}else{
foresee.triggerParms["mid"]=midVal;
}
foresee.fsrWriteCookie("ScoutRunningCheck",midVal);
foresee.fsrSetTriggerParms();
};
foresee.fsrSetTriggerParms=function fsrSetTriggerParms(_7f5){
if(foresee.fsr_ie5){
foresee.triggerParms["evtListener"]=0;
}
if(typeof (foresee.midLookupTable)=="undefined"){
return false;
}
if(_7f5==null){
foresee.hParent=window.opener;
if(foresee.hParent!=null){
_7f5=foresee.hParent.location.href;
}else{
_7f5=window.location.href;
}
}
for(var key in foresee.midLookupTable){
if((_7f5.toLowerCase()).indexOf(key.toLowerCase())!=-1){
var _7f7=foresee.midLookupTable[key].split(":");
foresee.triggerParms["dLF"]=_7f7[0];
foresee.triggerParms["spL"]=_7f7[1];
foresee.triggerParms["mid"]=_7f7[2];
if(_7f7.length==4){
foresee.triggerParms["nLF"]=_7f7[3];
}
return true;
}
}
return false;
};
foresee.fsrTagEvent=function fsrTagEvent(tag,_7f9,evt,fnc){
var _7fc=null;
if(window.opener){
_7fc=window.opener.document.getElementsByTagName(tag.toLowerCase());
}else{
_7fc=document.getElementsByTagName(tag.toLowerCase());
}
for(var i=0;i<_7fc.length;i++){
var oTag=_7fc[i];
var _7ff=oTag.href;
if(_7ff!=null){
if((_7ff.toLowerCase()).indexOf(_7f9.toLowerCase())!=-1){
foresee.fsrAttachEvent(oTag,evt,fnc);
}
}
}
};
foresee.fsrTagEventListeners=function fsrTagEventListeners(_800){
if(typeof (foresee.eventTagList)=="undefined"||foresee.fsrReadCookie(foresee.ckAlreadyShown)!=null){
return;
}
if(_800==null){
return;
}
for(var _801 in foresee.eventTagList){
var _802=foresee.eventTagList[_801].split("|");
if(_802.length==2){
foresee.fsrTagEvent(_802[0],_801,_802[1],_800);
}
}
};
foresee.fsrSetClientFunc=function fsrSetClientFunc(){
foresee.fsrTagEventListeners(foresee.closeTrackerWin);
if(typeof (foresee.vendorLookupTable)!="undefined"){
if(foresee.rNum>0&&foresee.rNum>foresee.triggerParms["spL"]){
foresee.openMultiVendorSurvey(foresee.rNum);
return false;
}
}
if(foresee.triggerParms["flashDetect"]==1){
if(foresee.fsrDetectFlash()==false){
return false;
}
}
return true;
};
foresee.fsrDetectFlash=function fsrDetectFlash(){
if(document.embeds&&document.embeds.length>0){
return false;
}else{
if(document.all){
var obj=document.all.tags("OBJECT");
for(var e=0;e<obj.length;e++){
for(var d=0;d<obj[e].attributes.length;d++){
if((obj[e].attributes[d].name).toLowerCase()=="classid"){
return false;
}
}
}
}
}
return true;
};
try{
if(window.name=="ForeseeSurveyWindow"||(window.opener&&foresee.triggerParms["displayMode"]==2)){
window.name="ForeseeSurveyWindow";
foresee.fsrSetTrackerParms();
setTimeout("foresee.fsrSurveyTimeout();",foresee.triggerParms["trackerDelay"],"JavaScript");
}else{
foresee.fsrSetTriggerParms();
foresee.fsrSetMode1Parms();
if(!foresee.fsrAttachEvent(window,"load",foresee.openFSRTracker,false)){
foresee.openFSRTracker();
}
}
}
catch(e){
foresee.fsrExceptionHandler(foresee.triggerParms["captureTriggerVersion"],e);
}
