var Scriptaculous={Version:"1.8.2",require:function(A){document.write('<script type="text/javascript" src="'+A+'"><\/script>')
},REQUIRED_PROTOTYPE:"1.6.0.3",load:function(){function A(C){var D=C.replace(/_.*|\./g,"");
D=parseInt(D+"0".times(4-D.length));
return C.indexOf("_")>-1?D-1:D
}if((typeof Prototype=="undefined")||(typeof Element=="undefined")||(typeof Element.Methods=="undefined")||(A(Prototype.Version)<A(Scriptaculous.REQUIRED_PROTOTYPE))){throw ("script.aculo.us requires the Prototype JavaScript framework >= "+Scriptaculous.REQUIRED_PROTOTYPE)
}var B=/scriptaculous\.js(\?.*)?$/;
$$("head script[src]").findAll(function(C){return C.src.match(B)
}).each(function(D){var E=D.src.replace(B,""),C=D.src.match(/\?.*load=([a-z,]*)/);
(C?C[1]:"builder,effects,dragdrop,controls,slider,sound").split(",").each(function(F){Scriptaculous.require(E+F+".js")
})
})
}};
Scriptaculous.load();String.prototype.parseColor=function(){var A="#";
if(this.slice(0,4)=="rgb("){var C=this.slice(4,this.length-1).split(",");
var B=0;
do{A+=parseInt(C[B]).toColorPart()
}while(++B<3)
}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var B=1;
B<4;
B++){A+=(this.charAt(B)+this.charAt(B)).toLowerCase()
}}if(this.length==7){A=this.toLowerCase()
}}}return(A.length==7?A:(arguments[0]||this))
};
Element.collectTextNodes=function(A){return $A($(A).childNodes).collect(function(B){return(B.nodeType==3?B.nodeValue:(B.hasChildNodes()?Element.collectTextNodes(B):""))
}).flatten().join("")
};
Element.collectTextNodesIgnoreClass=function(A,B){return $A($(A).childNodes).collect(function(C){return(C.nodeType==3?C.nodeValue:((C.hasChildNodes()&&!Element.hasClassName(C,B))?Element.collectTextNodesIgnoreClass(C,B):""))
}).flatten().join("")
};
Element.setContentZoom=function(A,B){A=$(A);
A.setStyle({fontSize:(B/100)+"em"});
if(Prototype.Browser.WebKit){window.scrollBy(0,0)
}return A
};
Element.getInlineOpacity=function(A){return $(A).style.opacity||""
};
Element.forceRerendering=function(A){try{A=$(A);
var C=document.createTextNode(" ");
A.appendChild(C);
A.removeChild(C)
}catch(B){}};
var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(A){return(-Math.cos(A*Math.PI)/2)+0.5
},reverse:function(A){return 1-A
},flicker:function(A){var A=((-Math.cos(A*Math.PI)/4)+0.75)+Math.random()/4;
return A>1?1:A
},wobble:function(A){return(-Math.cos(A*Math.PI*(9*A))/2)+0.5
},pulse:function(B,A){return(-Math.cos((B*((A||5)-0.5)*2)*Math.PI)/2)+0.5
},spring:function(A){return 1-(Math.cos(A*4.5*Math.PI)*Math.exp(-A*6))
},none:function(A){return 0
},full:function(A){return 1
}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(A){var B="position:relative";
if(Prototype.Browser.IE){B+=";zoom:1"
}A=$(A);
$A(A.childNodes).each(function(C){if(C.nodeType==3){C.nodeValue.toArray().each(function(D){A.insertBefore(new Element("span",{style:B}).update(D==" "?String.fromCharCode(160):D),C)
});
Element.remove(C)
}})
},multiple:function(B,C){var E;
if(((typeof B=="object")||Object.isFunction(B))&&(B.length)){E=B
}else{E=$(B).childNodes
}var A=Object.extend({speed:0.1,delay:0},arguments[2]||{});
var D=A.delay;
$A(E).each(function(G,F){new C(G,Object.extend(A,{delay:F*A.speed+D}))
})
},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(B,C){B=$(B);
C=(C||"appear").toLowerCase();
var A=Object.extend({queue:{position:"end",scope:(B.id||"global"),limit:1}},arguments[2]||{});
Effect[B.visible()?Effect.PAIRS[C][1]:Effect.PAIRS[C][0]](B,A)
}};
Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;
Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];
this.interval=null
},_each:function(A){this.effects._each(A)
},add:function(B){var C=new Date().getTime();
var A=Object.isString(B.options.queue)?B.options.queue:B.options.queue.position;
switch(A){case"front":this.effects.findAll(function(D){return D.state=="idle"
}).each(function(D){D.startOn+=B.finishOn;
D.finishOn+=B.finishOn
});
break;
case"with-last":C=this.effects.pluck("startOn").max()||C;
break;
case"end":C=this.effects.pluck("finishOn").max()||C;
break
}B.startOn+=C;
B.finishOn+=C;
if(!B.options.queue.limit||(this.effects.length<B.options.queue.limit)){this.effects.push(B)
}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)
}},remove:function(A){this.effects=this.effects.reject(function(B){return B==A
});
if(this.effects.length==0){clearInterval(this.interval);
this.interval=null
}},loop:function(){var C=new Date().getTime();
for(var B=0,A=this.effects.length;
B<A;
B++){this.effects[B]&&this.effects[B].loop(C)
}}});
Effect.Queues={instances:$H(),get:function(A){if(!Object.isString(A)){return A
}return this.instances.get(A)||this.instances.set(A,new Effect.ScopedQueue())
}};
Effect.Queue=Effect.Queues.get("global");
Effect.Base=Class.create({position:null,start:function(A){function B(D,C){return((D[C+"Internal"]?"this.options."+C+"Internal(this);":"")+(D[C]?"this.options."+C+"(this);":""))
}if(A&&A.transition===false){A.transition=Effect.Transitions.linear
}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),A||{});
this.currentFrame=0;
this.state="idle";
this.startOn=this.options.delay*1000;
this.finishOn=this.startOn+(this.options.duration*1000);
this.fromToDelta=this.options.to-this.options.from;
this.totalTime=this.finishOn-this.startOn;
this.totalFrames=this.options.fps*this.options.duration;
this.render=(function(){function C(E,D){if(E.options[D+"Internal"]){E.options[D+"Internal"](E)
}if(E.options[D]){E.options[D](E)
}}return function(D){if(this.state==="idle"){this.state="running";
C(this,"beforeSetup");
if(this.setup){this.setup()
}C(this,"afterSetup")
}if(this.state==="running"){D=(this.options.transition(D)*this.fromToDelta)+this.options.from;
this.position=D;
C(this,"beforeUpdate");
if(this.update){this.update(D)
}C(this,"afterUpdate")
}}
})();
this.event("beforeStart");
if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)
}},loop:function(C){if(C>=this.startOn){if(C>=this.finishOn){this.render(1);
this.cancel();
this.event("beforeFinish");
if(this.finish){this.finish()
}this.event("afterFinish");
return 
}var B=(C-this.startOn)/this.totalTime,A=(B*this.totalFrames).round();
if(A>this.currentFrame){this.render(B);
this.currentFrame=A
}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)
}this.state="finished"
},event:function(A){if(this.options[A+"Internal"]){this.options[A+"Internal"](this)
}if(this.options[A]){this.options[A](this)
}},inspect:function(){var A=$H();
for(property in this){if(!Object.isFunction(this[property])){A.set(property,this[property])
}}return"#<Effect:"+A.inspect()+",options:"+$H(this.options).inspect()+">"
}});
Effect.Parallel=Class.create(Effect.Base,{initialize:function(A){this.effects=A||[];
this.start(arguments[1])
},update:function(A){this.effects.invoke("render",A)
},finish:function(A){this.effects.each(function(B){B.render(1);
B.cancel();
B.event("beforeFinish");
if(B.finish){B.finish(A)
}B.event("afterFinish")
})
}});
Effect.Tween=Class.create(Effect.Base,{initialize:function(C,F,E){C=Object.isString(C)?$(C):C;
var B=$A(arguments),D=B.last(),A=B.length==5?B[3]:null;
this.method=Object.isFunction(D)?D.bind(C):Object.isFunction(C[D])?C[D].bind(C):function(G){C[D]=G
};
this.start(Object.extend({from:F,to:E},A||{}))
},update:function(A){this.method(A)
}});
Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))
},update:Prototype.emptyFunction});
Effect.Opacity=Class.create(Effect.Base,{initialize:function(B){this.element=$(B);
if(!this.element){throw (Effect._elementDoesNotExistError)
}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})
}var A=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});
this.start(A)
},update:function(A){this.element.setOpacity(A)
}});
Effect.Move=Class.create(Effect.Base,{initialize:function(B){this.element=$(B);
if(!this.element){throw (Effect._elementDoesNotExistError)
}var A=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});
this.start(A)
},setup:function(){this.element.makePositioned();
this.originalLeft=parseFloat(this.element.getStyle("left")||"0");
this.originalTop=parseFloat(this.element.getStyle("top")||"0");
if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;
this.options.y=this.options.y-this.originalTop
}},update:function(A){this.element.setStyle({left:(this.options.x*A+this.originalLeft).round()+"px",top:(this.options.y*A+this.originalTop).round()+"px"})
}});
Effect.MoveBy=function(B,A,C){return new Effect.Move(B,Object.extend({x:C,y:A},arguments[3]||{}))
};
Effect.Scale=Class.create(Effect.Base,{initialize:function(B,C){this.element=$(B);
if(!this.element){throw (Effect._elementDoesNotExistError)
}var A=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:C},arguments[2]||{});
this.start(A)
},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;
this.elementPositioning=this.element.getStyle("position");
this.originalStyle={};
["top","left","width","height","fontSize"].each(function(B){this.originalStyle[B]=this.element.style[B]
}.bind(this));
this.originalTop=this.element.offsetTop;
this.originalLeft=this.element.offsetLeft;
var A=this.element.getStyle("font-size")||"100%";
["em","px","%","pt"].each(function(B){if(A.indexOf(B)>0){this.fontSize=parseFloat(A);
this.fontSizeType=B
}}.bind(this));
this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;
this.dims=null;
if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]
}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]
}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]
}},update:function(A){var B=(this.options.scaleFrom/100)+(this.factor*A);
if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*B+this.fontSizeType})
}this.setDimensions(this.dims[0]*B,this.dims[1]*B)
},finish:function(A){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)
}},setDimensions:function(A,D){var E={};
if(this.options.scaleX){E.width=D.round()+"px"
}if(this.options.scaleY){E.height=A.round()+"px"
}if(this.options.scaleFromCenter){var C=(A-this.dims[0])/2;
var B=(D-this.dims[1])/2;
if(this.elementPositioning=="absolute"){if(this.options.scaleY){E.top=this.originalTop-C+"px"
}if(this.options.scaleX){E.left=this.originalLeft-B+"px"
}}else{if(this.options.scaleY){E.top=-C+"px"
}if(this.options.scaleX){E.left=-B+"px"
}}}this.element.setStyle(E)
}});
Effect.Highlight=Class.create(Effect.Base,{initialize:function(B){this.element=$(B);
if(!this.element){throw (Effect._elementDoesNotExistError)
}var A=Object.extend({startcolor:"#ffff99"},arguments[1]||{});
this.start(A)
},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();
return 
}this.oldStyle={};
if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");
this.element.setStyle({backgroundImage:"none"})
}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")
}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")
}this._base=$R(0,2).map(function(A){return parseInt(this.options.startcolor.slice(A*2+1,A*2+3),16)
}.bind(this));
this._delta=$R(0,2).map(function(A){return parseInt(this.options.endcolor.slice(A*2+1,A*2+3),16)-this._base[A]
}.bind(this))
},update:function(A){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(B,C,D){return B+((this._base[D]+(this._delta[D]*A)).round().toColorPart())
}.bind(this))})
},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))
}});
Effect.ScrollTo=function(C){var B=arguments[1]||{},A=document.viewport.getScrollOffsets(),D=$(C).cumulativeOffset();
if(B.offset){D[1]+=B.offset
}return new Effect.Tween(null,A.top,D[1],B,function(E){scrollTo(A.left,E.round())
})
};
Effect.Fade=function(C){C=$(C);
var A=C.getInlineOpacity();
var B=Object.extend({from:C.getOpacity()||1,to:0,afterFinishInternal:function(D){if(D.options.to!=0){return 
}D.element.hide().setStyle({opacity:A})
}},arguments[1]||{});
return new Effect.Opacity(C,B)
};
Effect.Appear=function(B){B=$(B);
var A=Object.extend({from:(B.getStyle("display")=="none"?0:B.getOpacity()||0),to:1,afterFinishInternal:function(C){C.element.forceRerendering()
},beforeSetup:function(C){C.element.setOpacity(C.options.from).show()
}},arguments[1]||{});
return new Effect.Opacity(B,A)
};
Effect.Puff=function(B){B=$(B);
var A={opacity:B.getInlineOpacity(),position:B.getStyle("position"),top:B.style.top,left:B.style.left,width:B.style.width,height:B.style.height};
return new Effect.Parallel([new Effect.Scale(B,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(B,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(C){Position.absolutize(C.effects[0].element)
},afterFinishInternal:function(C){C.effects[0].element.hide().setStyle(A)
}},arguments[1]||{}))
};
Effect.BlindUp=function(A){A=$(A);
A.makeClipping();
return new Effect.Scale(A,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(B){B.element.hide().undoClipping()
}},arguments[1]||{}))
};
Effect.BlindDown=function(B){B=$(B);
var A=B.getDimensions();
return new Effect.Scale(B,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:A.height,originalWidth:A.width},restoreAfterFinish:true,afterSetup:function(C){C.element.makeClipping().setStyle({height:"0px"}).show()
},afterFinishInternal:function(C){C.element.undoClipping()
}},arguments[1]||{}))
};
Effect.SwitchOff=function(B){B=$(B);
var A=B.getInlineOpacity();
return new Effect.Appear(B,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(C){new Effect.Scale(C.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(D){D.element.makePositioned().makeClipping()
},afterFinishInternal:function(D){D.element.hide().undoClipping().undoPositioned().setStyle({opacity:A})
}})
}},arguments[1]||{}))
};
Effect.DropOut=function(B){B=$(B);
var A={top:B.getStyle("top"),left:B.getStyle("left"),opacity:B.getInlineOpacity()};
return new Effect.Parallel([new Effect.Move(B,{x:0,y:100,sync:true}),new Effect.Opacity(B,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(C){C.effects[0].element.makePositioned()
},afterFinishInternal:function(C){C.effects[0].element.hide().undoPositioned().setStyle(A)
}},arguments[1]||{}))
};
Effect.Shake=function(D){D=$(D);
var B=Object.extend({distance:20,duration:0.5},arguments[1]||{});
var E=parseFloat(B.distance);
var C=parseFloat(B.duration)/10;
var A={top:D.getStyle("top"),left:D.getStyle("left")};
return new Effect.Move(D,{x:E,y:0,duration:C,afterFinishInternal:function(F){new Effect.Move(F.element,{x:-E*2,y:0,duration:C*2,afterFinishInternal:function(G){new Effect.Move(G.element,{x:E*2,y:0,duration:C*2,afterFinishInternal:function(H){new Effect.Move(H.element,{x:-E*2,y:0,duration:C*2,afterFinishInternal:function(I){new Effect.Move(I.element,{x:E*2,y:0,duration:C*2,afterFinishInternal:function(J){new Effect.Move(J.element,{x:-E,y:0,duration:C,afterFinishInternal:function(K){K.element.undoPositioned().setStyle(A)
}})
}})
}})
}})
}})
}})
};
Effect.SlideDown=function(C){C=$(C).cleanWhitespace();
var A=C.down().getStyle("bottom");
var B=C.getDimensions();
return new Effect.Scale(C,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:B.height,originalWidth:B.width},restoreAfterFinish:true,afterSetup:function(D){D.element.makePositioned();
D.element.down().makePositioned();
if(window.opera){D.element.setStyle({top:""})
}D.element.makeClipping().setStyle({height:"0px"}).show()
},afterUpdateInternal:function(D){D.element.down().setStyle({bottom:(D.dims[0]-D.element.clientHeight)+"px"})
},afterFinishInternal:function(D){D.element.undoClipping().undoPositioned();
D.element.down().undoPositioned().setStyle({bottom:A})
}},arguments[1]||{}))
};
Effect.SlideUp=function(C){C=$(C).cleanWhitespace();
var A=C.down().getStyle("bottom");
var B=C.getDimensions();
return new Effect.Scale(C,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:B.height,originalWidth:B.width},restoreAfterFinish:true,afterSetup:function(D){D.element.makePositioned();
D.element.down().makePositioned();
if(window.opera){D.element.setStyle({top:""})
}D.element.makeClipping().show()
},afterUpdateInternal:function(D){D.element.down().setStyle({bottom:(D.dims[0]-D.element.clientHeight)+"px"})
},afterFinishInternal:function(D){D.element.hide().undoClipping().undoPositioned();
D.element.down().undoPositioned().setStyle({bottom:A})
}},arguments[1]||{}))
};
Effect.Squish=function(A){return new Effect.Scale(A,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(B){B.element.makeClipping()
},afterFinishInternal:function(B){B.element.hide().undoClipping()
}})
};
Effect.Grow=function(C){C=$(C);
var B=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});
var A={top:C.style.top,left:C.style.left,height:C.style.height,width:C.style.width,opacity:C.getInlineOpacity()};
var G=C.getDimensions();
var H,F;
var E,D;
switch(B.direction){case"top-left":H=F=E=D=0;
break;
case"top-right":H=G.width;
F=D=0;
E=-G.width;
break;
case"bottom-left":H=E=0;
F=G.height;
D=-G.height;
break;
case"bottom-right":H=G.width;
F=G.height;
E=-G.width;
D=-G.height;
break;
case"center":H=G.width/2;
F=G.height/2;
E=-G.width/2;
D=-G.height/2;
break
}return new Effect.Move(C,{x:H,y:F,duration:0.01,beforeSetup:function(I){I.element.hide().makeClipping().makePositioned()
},afterFinishInternal:function(I){new Effect.Parallel([new Effect.Opacity(I.element,{sync:true,to:1,from:0,transition:B.opacityTransition}),new Effect.Move(I.element,{x:E,y:D,sync:true,transition:B.moveTransition}),new Effect.Scale(I.element,100,{scaleMode:{originalHeight:G.height,originalWidth:G.width},sync:true,scaleFrom:window.opera?1:0,transition:B.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(J){J.effects[0].element.setStyle({height:"0px"}).show()
},afterFinishInternal:function(J){J.effects[0].element.undoClipping().undoPositioned().setStyle(A)
}},B))
}})
};
Effect.Shrink=function(C){C=$(C);
var B=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});
var A={top:C.style.top,left:C.style.left,height:C.style.height,width:C.style.width,opacity:C.getInlineOpacity()};
var F=C.getDimensions();
var E,D;
switch(B.direction){case"top-left":E=D=0;
break;
case"top-right":E=F.width;
D=0;
break;
case"bottom-left":E=0;
D=F.height;
break;
case"bottom-right":E=F.width;
D=F.height;
break;
case"center":E=F.width/2;
D=F.height/2;
break
}return new Effect.Parallel([new Effect.Opacity(C,{sync:true,to:0,from:1,transition:B.opacityTransition}),new Effect.Scale(C,window.opera?1:0,{sync:true,transition:B.scaleTransition,restoreAfterFinish:true}),new Effect.Move(C,{x:E,y:D,sync:true,transition:B.moveTransition})],Object.extend({beforeStartInternal:function(G){G.effects[0].element.makePositioned().makeClipping()
},afterFinishInternal:function(G){G.effects[0].element.hide().undoClipping().undoPositioned().setStyle(A)
}},B))
};
Effect.Pulsate=function(C){C=$(C);
var B=arguments[1]||{},A=C.getInlineOpacity(),E=B.transition||Effect.Transitions.linear,D=function(F){return 1-E((-Math.cos((F*(B.pulses||5)*2)*Math.PI)/2)+0.5)
};
return new Effect.Opacity(C,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(F){F.element.setStyle({opacity:A})
}},B),{transition:D}))
};
Effect.Fold=function(B){B=$(B);
var A={top:B.style.top,left:B.style.left,width:B.style.width,height:B.style.height};
B.makeClipping();
return new Effect.Scale(B,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(C){new Effect.Scale(B,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(D){D.element.hide().undoClipping().setStyle(A)
}})
}},arguments[1]||{}))
};
Effect.Morph=Class.create(Effect.Base,{initialize:function(C){this.element=$(C);
if(!this.element){throw (Effect._elementDoesNotExistError)
}var A=Object.extend({style:{}},arguments[1]||{});
if(!Object.isString(A.style)){this.style=$H(A.style)
}else{if(A.style.include(":")){this.style=A.style.parseStyle()
}else{this.element.addClassName(A.style);
this.style=$H(this.element.getStyles());
this.element.removeClassName(A.style);
var B=this.element.getStyles();
this.style=this.style.reject(function(D){return D.value==B[D.key]
});
A.afterFinishInternal=function(D){D.element.addClassName(D.options.style);
D.transforms.each(function(E){D.element.style[E.style]=""
})
}
}}this.start(A)
},setup:function(){function A(B){if(!B||["rgba(0, 0, 0, 0)","transparent"].include(B)){B="#ffffff"
}B=B.parseColor();
return $R(0,2).map(function(C){return parseInt(B.slice(C*2+1,C*2+3),16)
})
}this.transforms=this.style.map(function(G){var F=G[0],E=G[1],D=null;
if(E.parseColor("#zzzzzz")!="#zzzzzz"){E=E.parseColor();
D="color"
}else{if(F=="opacity"){E=parseFloat(E);
if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})
}}else{if(Element.CSS_LENGTH.test(E)){var C=E.match(/^([\+\-]?[0-9\.]+)(.*)$/);
E=parseFloat(C[1]);
D=(C.length==3)?C[2]:null
}}}var B=this.element.getStyle(F);
return{style:F.camelize(),originalValue:D=="color"?A(B):parseFloat(B||0),targetValue:D=="color"?A(E):E,unit:D}
}.bind(this)).reject(function(B){return((B.originalValue==B.targetValue)||(B.unit!="color"&&(isNaN(B.originalValue)||isNaN(B.targetValue))))
})
},update:function(A){var D={},B,C=this.transforms.length;
while(C--){D[(B=this.transforms[C]).style]=B.unit=="color"?"#"+(Math.round(B.originalValue[0]+(B.targetValue[0]-B.originalValue[0])*A)).toColorPart()+(Math.round(B.originalValue[1]+(B.targetValue[1]-B.originalValue[1])*A)).toColorPart()+(Math.round(B.originalValue[2]+(B.targetValue[2]-B.originalValue[2])*A)).toColorPart():(B.originalValue+(B.targetValue-B.originalValue)*A).toFixed(3)+(B.unit===null?"":B.unit)
}this.element.setStyle(D,true)
}});
Effect.Transform=Class.create({initialize:function(A){this.tracks=[];
this.options=arguments[1]||{};
this.addTracks(A)
},addTracks:function(A){A.each(function(B){B=$H(B);
var C=B.values().first();
this.tracks.push($H({ids:B.keys().first(),effect:Effect.Morph,options:{style:C}}))
}.bind(this));
return this
},play:function(){return new Effect.Parallel(this.tracks.map(function(A){var D=A.get("ids"),C=A.get("effect"),B=A.get("options");
var E=[$(D)||$$(D)].flatten();
return E.map(function(F){return new C(F,Object.extend({sync:true},B))
})
}).flatten(),this.options)
}});
Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");
Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
String.__parseStyleElement=document.createElement("div");
String.prototype.parseStyle=function(){var B,A=$H();
if(Prototype.Browser.WebKit){B=new Element("div",{style:this}).style
}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';
B=String.__parseStyleElement.childNodes[0].style
}Element.CSS_PROPERTIES.each(function(C){if(B[C]){A.set(C,B[C])
}});
if(Prototype.Browser.IE&&this.include("opacity")){A.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])
}return A
};
if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(B){var A=document.defaultView.getComputedStyle($(B),null);
return Element.CSS_PROPERTIES.inject({},function(C,D){C[D]=A[D];
return C
})
}
}else{Element.getStyles=function(B){B=$(B);
var A=B.currentStyle,C;
C=Element.CSS_PROPERTIES.inject({},function(D,E){D[E]=A[E];
return D
});
if(!C.opacity){C.opacity=B.getOpacity()
}return C
}
}Effect.Methods={morph:function(A,B){A=$(A);
new Effect.Morph(A,Object.extend({style:B},arguments[2]||{}));
return A
},visualEffect:function(C,E,B){C=$(C);
var D=E.dasherize().camelize(),A=D.charAt(0).toUpperCase()+D.substring(1);
new Effect[A](C,B);
return C
},highlight:function(B,A){B=$(B);
new Effect.Highlight(B,A);
return B
}};
$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(A){Effect.Methods[A]=function(C,B){C=$(C);
Effect[A.charAt(0).toUpperCase()+A.substring(1)](C,B);
return C
}
});
$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(A){Effect.Methods[A]=Element[A]
});
Element.addMethods(Effect.Methods);if(typeof Effect=="undefined"){throw ("controls.js requires including script.aculo.us' effects.js library")
}var Autocompleter={};
Autocompleter.Base=Class.create({baseInitialize:function(B,C,A){B=$(B);
this.element=B;
this.update=$(C);
this.hasFocus=false;
this.changed=false;
this.active=false;
this.moveVideo=(typeof video!="undefined"&&video.client=="MOVE");
this.index=0;
this.entryCount=0;
this.oldElementValue=this.element.value;
if(this.setOptions){this.setOptions(A)
}else{this.options=A||{}
}this.options.paramName=this.options.paramName||this.element.name;
this.options.tokens=this.options.tokens||[];
this.options.frequency=this.options.frequency||0.4;
this.options.defaultIndex=this.options.defaultIndex||0;
this.options.minChars=this.options.minChars||1;
this.options.onShow=this.options.onShow||function(D,E){if(!E.style.position||E.style.position=="absolute"){E.style.position="absolute";
Position.clone(D,E,{setHeight:false,setWidth:false,offsetTop:D.offsetHeight,offsetLeft:-35})
}Effect.Appear(E,{duration:0.15})
};
this.options.onHide=this.options.onHide||function(D,E){new Effect.Fade(E,{duration:0.15})
};
if(typeof (this.options.tokens)=="string"){this.options.tokens=new Array(this.options.tokens)
}if(!this.options.tokens.include("\n")){this.options.tokens.push("\n")
}this.observer=null;
this.element.setAttribute("autocomplete","off");
Element.hide(this.update);
Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));
Event.observe(this.element,"keydown",this.onKeyPress.bindAsEventListener(this))
},show:function(){if(Element.getStyle(this.update,"display")=="none"){this.options.onShow(this.element,this.update)
}},hide:function(){this.stopIndicator();
if(Element.getStyle(this.update,"display")!="none"){this.options.onHide(this.element,this.update)
}},startIndicator:function(){if(this.options.indicator){Element.show(this.options.indicator)
}},stopIndicator:function(){if(this.options.indicator){Element.hide(this.options.indicator)
}},onKeyPress:function(A){if(this.active){switch(A.keyCode){case Event.KEY_RETURN:if(this.index!=-1){this.selectEntry();
Event.stop(A)
}else{this.hide();
return 
}case Event.KEY_ESC:this.hide();
this.active=false;
Event.stop(A);
return ;
case Event.KEY_LEFT:case Event.KEY_RIGHT:return ;
case Event.KEY_UP:this.markPrevious();
this.render();
Event.stop(A);
return ;
case Event.KEY_DOWN:this.markNext();
this.render();
Event.stop(A);
return 
}}else{if(A.keyCode==Event.KEY_TAB||A.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&A.keyCode==0)){return 
}}this.changed=true;
this.hasFocus=true;
if(this.observer){clearTimeout(this.observer)
}this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000)
},activate:function(){this.changed=false;
this.hasFocus=true;
this.getUpdatedChoices()
},onHover:function(B){var A=Event.findElement(B,"LI");
if(this.index!=A.autocompleteIndex){this.index=A.autocompleteIndex;
this.render()
}Event.stop(B)
},onClick:function(B){var A=Event.findElement(B,"LI");
this.index=A.autocompleteIndex;
this.selectEntry();
this.hide()
},onBlur:function(A){setTimeout(this.hide.bind(this),250);
this.hasFocus=false;
this.active=false
},render:function(){if(this.entryCount>0){for(var A=0;
A<this.entryCount;
A++){this.index==A?Element.addClassName(this.getEntry(A),"selected"):Element.removeClassName(this.getEntry(A),"selected")
}if(this.hasFocus){this.show();
this.active=true
}}else{this.active=false;
this.hide()
}},markPrevious:function(){if(this.index>0){this.index--
}else{this.index=this.entryCount-1;
this.update.scrollTop=this.update.scrollHeight
}selection=this.getEntry(this.index);
selection_top=selection.offsetTop;
if(selection_top<this.update.scrollTop){this.update.scrollTop=this.update.scrollTop-selection.offsetHeight
}},markNext:function(){if(this.index<this.entryCount-1){this.index++
}else{this.index=0;
this.update.scrollTop=0
}selection=this.getEntry(this.index);
selection_bottom=selection.offsetTop+selection.offsetHeight;
if(selection_bottom>this.update.scrollTop+this.update.offsetHeight){this.update.scrollTop=this.update.scrollTop+selection.offsetHeight
}},getEntry:function(A){return this.update.firstChild.childNodes[A]
},getCurrentEntry:function(){return this.getEntry(this.index)
},selectEntry:function(){this.active=false;
if(this.index!=-1){this.updateElement(this.getCurrentEntry())
}},updateElement:function(F){if(this.options.updateElement){this.options.updateElement(F);
return 
}var D="";
if(this.options.select){var A=$(F).select("."+this.options.select)||[];
if(A.length>0){D=Element.collectTextNodes(A[0],this.options.select)
}}else{D=Element.collectTextNodesIgnoreClass(F,"informal")
}var C=this.getTokenBounds();
if(C[0]!=-1){var E=this.element.value.substr(0,C[0]);
var B=this.element.value.substr(C[0]).match(/^\s+/);
if(B){E+=B[0]
}this.element.value=E+D+this.element.value.substr(C[1])
}else{this.element.value=D
}this.oldElementValue=this.element.value;
this.element.focus();
if(this.options.afterUpdateElement){this.options.afterUpdateElement(this.element,F)
}},updateChoices:function(C){if(!this.changed&&this.hasFocus){this.update.innerHTML=C;
Element.cleanWhitespace(this.update);
Element.cleanWhitespace(this.update.down());
if(this.update.firstChild&&this.update.down().childNodes){this.entryCount=this.update.down().childNodes.length;
for(var A=0;
A<this.entryCount;
A++){var B=this.getEntry(A);
if(this.moveVideo&&A>4){B.style.display="none"
}else{B.autocompleteIndex=A;
this.addObservers(B)
}}}else{this.entryCount=0
}this.stopIndicator();
this.update.scrollTop=0;
this.index=this.options.defaultIndex;
if(this.entryCount==1&&this.options.autoSelect){this.selectEntry();
this.hide()
}else{this.render()
}}},addObservers:function(A){Event.observe(A,"mouseover",this.onHover.bindAsEventListener(this));
Event.observe(A,"click",this.onClick.bindAsEventListener(this))
},onObserverEvent:function(){this.changed=false;
this.tokenBounds=null;
if(this.getToken().length>=this.options.minChars){this.getUpdatedChoices()
}else{this.active=false;
this.hide()
}this.oldElementValue=this.element.value
},getToken:function(){var A=this.getTokenBounds();
return this.element.value.substring(A[0],A[1]).strip()
},getTokenBounds:function(){if(null!=this.tokenBounds){return this.tokenBounds
}var E=this.element.value;
if(E.strip().empty()){return[-1,0]
}var F=arguments.callee.getFirstDifferencePos(E,this.oldElementValue);
var H=(F==this.oldElementValue.length?1:0);
var D=-1,C=E.length;
var G;
for(var B=0,A=this.options.tokens.length;
B<A;
++B){G=E.lastIndexOf(this.options.tokens[B],F+H-1);
if(G>D){D=G
}G=E.indexOf(this.options.tokens[B],F+H);
if(-1!=G&&G<C){C=G
}}return(this.tokenBounds=[D+1,C])
}});
Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos=function(C,A){var D=Math.min(C.length,A.length);
for(var B=0;
B<D;
++B){if(C[B]!=A[B]){return B
}}return D
};
Ajax.Autocompleter=Class.create(Autocompleter.Base,{initialize:function(C,D,B,A){this.baseInitialize(C,D,A);
this.options.asynchronous=true;
this.options.onComplete=this.onComplete.bind(this);
this.options.defaultParams=this.options.parameters||null;
this.url=B
},getUpdatedChoices:function(){this.startIndicator();
var A=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());
this.options.parameters=this.options.callback?this.options.callback(this.element,A):A;
if(this.options.defaultParams){this.options.parameters+="&"+this.options.defaultParams
}new Ajax.Request(this.url,this.options)
},onComplete:function(A){this.updateChoices(A.responseText)
}});
Autocompleter.Local=Class.create(Autocompleter.Base,{initialize:function(B,D,C,A){this.baseInitialize(B,D,A);
this.options.array=C
},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this))
},setOptions:function(A){this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(B){var D=[];
var C=[];
var H=B.getToken();
var G=0;
for(var E=0;
E<B.options.array.length&&D.length<B.options.choices;
E++){var F=B.options.array[E];
var I=B.options.ignoreCase?F.toLowerCase().indexOf(H.toLowerCase()):F.indexOf(H);
while(I!=-1){if(I==0&&F.length!=H.length){D.push("<li><strong>"+F.substr(0,H.length)+"</strong>"+F.substr(H.length)+"</li>");
break
}else{if(H.length>=B.options.partialChars&&B.options.partialSearch&&I!=-1){if(B.options.fullSearch||/\s/.test(F.substr(I-1,1))){C.push("<li>"+F.substr(0,I)+"<strong>"+F.substr(I,H.length)+"</strong>"+F.substr(I+H.length)+"</li>");
break
}}}I=B.options.ignoreCase?F.toLowerCase().indexOf(H.toLowerCase(),I+1):F.indexOf(H,I+1)
}}if(C.length){D=D.concat(C.slice(0,B.options.choices-D.length))
}return"<ul>"+D.join("")+"</ul>"
}},A||{})
}});
Field.scrollFreeActivate=function(A){setTimeout(function(){Field.activate(A)
},1)
};
Ajax.InPlaceEditor=Class.create({initialize:function(C,B,A){this.url=B;
this.element=C=$(C);
this.prepareOptions();
this._controls={};
arguments.callee.dealWithDeprecatedOptions(A);
Object.extend(this.options,A||{});
if(!this.options.formId&&this.element.id){this.options.formId=this.element.id+"-inplaceeditor";
if($(this.options.formId)){this.options.formId=""
}}if(this.options.externalControl){this.options.externalControl=$(this.options.externalControl)
}if(!this.options.externalControl){this.options.externalControlOnly=false
}this._originalBackground=this.element.getStyle("background-color")||"transparent";
this.element.title=this.options.clickToEditText;
this._boundCancelHandler=this.handleFormCancellation.bind(this);
this._boundComplete=(this.options.onComplete||Prototype.emptyFunction).bind(this);
this._boundFailureHandler=this.handleAJAXFailure.bind(this);
this._boundSubmitHandler=this.handleFormSubmission.bind(this);
this._boundWrapperHandler=this.wrapUp.bind(this);
this.registerListeners()
},checkForEscapeOrReturn:function(A){if(!this._editing||A.ctrlKey||A.altKey||A.shiftKey){return 
}if(Event.KEY_ESC==A.keyCode){this.handleFormCancellation(A)
}else{if(Event.KEY_RETURN==A.keyCode){this.handleFormSubmission(A)
}}},createControl:function(G,C,B){var E=this.options[G+"Control"];
var F=this.options[G+"Text"];
if("button"==E){var A=document.createElement("input");
A.type="submit";
A.value=F;
A.className="editor_"+G+"_button";
if("cancel"==G){A.onclick=this._boundCancelHandler
}this._form.appendChild(A);
this._controls[G]=A
}else{if("link"==E){var D=document.createElement("a");
D.href="#";
D.appendChild(document.createTextNode(F));
D.onclick="cancel"==G?this._boundCancelHandler:this._boundSubmitHandler;
D.className="editor_"+G+"_link";
if(B){D.className+=" "+B
}this._form.appendChild(D);
this._controls[G]=D
}}},createEditField:function(){var C=(this.options.loadTextURL?this.options.loadingText:this.getText());
var B;
if(1>=this.options.rows&&!/\r|\n/.test(this.getText())){B=document.createElement("input");
B.type="text";
var A=this.options.size||this.options.cols||0;
if(0<A){B.size=A
}}else{B=document.createElement("textarea");
B.rows=(1>=this.options.rows?this.options.autoRows:this.options.rows);
B.cols=this.options.cols||40
}B.name=this.options.paramName;
B.value=C;
B.className="editor_field";
if(this.options.submitOnBlur){B.onblur=this._boundSubmitHandler
}this._controls.editor=B;
if(this.options.loadTextURL){this.loadExternalText()
}this._form.appendChild(this._controls.editor)
},createForm:function(){var B=this;
function A(D,E){var C=B.options["text"+D+"Controls"];
if(!C||E===false){return 
}B._form.appendChild(document.createTextNode(C))
}this._form=$(document.createElement("form"));
this._form.id=this.options.formId;
this._form.addClassName(this.options.formClassName);
this._form.onsubmit=this._boundSubmitHandler;
this.createEditField();
if("textarea"==this._controls.editor.tagName.toLowerCase()){this._form.appendChild(document.createElement("br"))
}if(this.options.onFormCustomization){this.options.onFormCustomization(this,this._form)
}A("Before",this.options.okControl||this.options.cancelControl);
this.createControl("ok",this._boundSubmitHandler);
A("Between",this.options.okControl&&this.options.cancelControl);
this.createControl("cancel",this._boundCancelHandler,"editor_cancel");
A("After",this.options.okControl||this.options.cancelControl)
},destroy:function(){if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML
}this.leaveEditMode();
this.unregisterListeners()
},enterEditMode:function(A){if(this._saving||this._editing){return 
}this._editing=true;
this.triggerCallback("onEnterEditMode");
if(this.options.externalControl){this.options.externalControl.hide()
}this.element.hide();
this.createForm();
this.element.parentNode.insertBefore(this._form,this.element);
if(!this.options.loadTextURL){this.postProcessEditField()
}if(A){Event.stop(A)
}},enterHover:function(A){if(this.options.hoverClassName){this.element.addClassName(this.options.hoverClassName)
}if(this._saving){return 
}this.triggerCallback("onEnterHover")
},getText:function(){return this.element.innerHTML.unescapeHTML()
},handleAJAXFailure:function(A){this.triggerCallback("onFailure",A);
if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML;
this._oldInnerHTML=null
}},handleFormCancellation:function(A){this.wrapUp();
if(A){Event.stop(A)
}},handleFormSubmission:function(D){var B=this._form;
var C=$F(this._controls.editor);
this.prepareSubmission();
var E=this.options.callback(B,C)||"";
if(Object.isString(E)){E=E.toQueryParams()
}E.editorId=this.element.id;
if(this.options.htmlResponse){var A=Object.extend({evalScripts:true},this.options.ajaxOptions);
Object.extend(A,{parameters:E,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});
new Ajax.Updater({success:this.element},this.url,A)
}else{var A=Object.extend({method:"get"},this.options.ajaxOptions);
Object.extend(A,{parameters:E,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});
new Ajax.Request(this.url,A)
}if(D){Event.stop(D)
}},leaveEditMode:function(){this.element.removeClassName(this.options.savingClassName);
this.removeForm();
this.leaveHover();
this.element.style.backgroundColor=this._originalBackground;
this.element.show();
if(this.options.externalControl){this.options.externalControl.show()
}this._saving=false;
this._editing=false;
this._oldInnerHTML=null;
this.triggerCallback("onLeaveEditMode")
},leaveHover:function(A){if(this.options.hoverClassName){this.element.removeClassName(this.options.hoverClassName)
}if(this._saving){return 
}this.triggerCallback("onLeaveHover")
},loadExternalText:function(){this._form.addClassName(this.options.loadingClassName);
this._controls.editor.disabled=true;
var A=Object.extend({method:"get"},this.options.ajaxOptions);
Object.extend(A,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(C){this._form.removeClassName(this.options.loadingClassName);
var B=C.responseText;
if(this.options.stripLoadedTextTags){B=B.stripTags()
}this._controls.editor.value=B;
this._controls.editor.disabled=false;
this.postProcessEditField()
}.bind(this),onFailure:this._boundFailureHandler});
new Ajax.Request(this.options.loadTextURL,A)
},postProcessEditField:function(){var A=this.options.fieldPostCreation;
if(A){$(this._controls.editor)["focus"==A?"focus":"activate"]()
}},prepareOptions:function(){this.options=Object.clone(Ajax.InPlaceEditor.DefaultOptions);
Object.extend(this.options,Ajax.InPlaceEditor.DefaultCallbacks);
[this._extraDefaultOptions].flatten().compact().each(function(A){Object.extend(this.options,A)
}.bind(this))
},prepareSubmission:function(){this._saving=true;
this.removeForm();
this.leaveHover();
this.showSaving()
},registerListeners:function(){this._listeners={};
var A;
$H(Ajax.InPlaceEditor.Listeners).each(function(B){A=this[B.value].bind(this);
this._listeners[B.key]=A;
if(!this.options.externalControlOnly){this.element.observe(B.key,A)
}if(this.options.externalControl){this.options.externalControl.observe(B.key,A)
}}.bind(this))
},removeForm:function(){if(!this._form){return 
}this._form.remove();
this._form=null;
this._controls={}
},showSaving:function(){this._oldInnerHTML=this.element.innerHTML;
this.element.innerHTML=this.options.savingText;
this.element.addClassName(this.options.savingClassName);
this.element.style.backgroundColor=this._originalBackground;
this.element.show()
},triggerCallback:function(B,A){if("function"==typeof this.options[B]){this.options[B](this,A)
}},unregisterListeners:function(){$H(this._listeners).each(function(A){if(!this.options.externalControlOnly){this.element.stopObserving(A.key,A.value)
}if(this.options.externalControl){this.options.externalControl.stopObserving(A.key,A.value)
}}.bind(this))
},wrapUp:function(A){this.leaveEditMode();
this._boundComplete(A,this.element)
}});
Object.extend(Ajax.InPlaceEditor.prototype,{dispose:Ajax.InPlaceEditor.prototype.destroy});
Ajax.InPlaceCollectionEditor=Class.create(Ajax.InPlaceEditor,{initialize:function($super,C,B,A){this._extraDefaultOptions=Ajax.InPlaceCollectionEditor.DefaultOptions;
$super(C,B,A)
},createEditField:function(){var A=document.createElement("select");
A.name=this.options.paramName;
A.size=1;
this._controls.editor=A;
this._collection=this.options.collection||[];
if(this.options.loadCollectionURL){this.loadCollection()
}else{this.checkForExternalText()
}this._form.appendChild(this._controls.editor)
},loadCollection:function(){this._form.addClassName(this.options.loadingClassName);
this.showLoadingText(this.options.loadingCollectionText);
var options=Object.extend({method:"get"},this.options.ajaxOptions);
Object.extend(options,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(transport){var js=transport.responseText.strip();
if(!/^\[.*\]$/.test(js)){throw ("Server returned an invalid collection representation.")
}this._collection=eval(js);
this.checkForExternalText()
}.bind(this),onFailure:this.onFailure});
new Ajax.Request(this.options.loadCollectionURL,options)
},showLoadingText:function(B){this._controls.editor.disabled=true;
var A=this._controls.editor.firstChild;
if(!A){A=document.createElement("option");
A.value="";
this._controls.editor.appendChild(A);
A.selected=true
}A.update((B||"").stripScripts().stripTags())
},checkForExternalText:function(){this._text=this.getText();
if(this.options.loadTextURL){this.loadExternalText()
}else{this.buildOptionList()
}},loadExternalText:function(){this.showLoadingText(this.options.loadingText);
var A=Object.extend({method:"get"},this.options.ajaxOptions);
Object.extend(A,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(B){this._text=B.responseText.strip();
this.buildOptionList()
}.bind(this),onFailure:this.onFailure});
new Ajax.Request(this.options.loadTextURL,A)
},buildOptionList:function(){this._form.removeClassName(this.options.loadingClassName);
this._collection=this._collection.map(function(D){return 2===D.length?D:[D,D].flatten()
});
var B=("value" in this.options)?this.options.value:this._text;
var A=this._collection.any(function(D){return D[0]==B
}.bind(this));
this._controls.editor.update("");
var C;
this._collection.each(function(E,D){C=document.createElement("option");
C.value=E[0];
C.selected=A?E[0]==B:0==D;
C.appendChild(document.createTextNode(E[1]));
this._controls.editor.appendChild(C)
}.bind(this));
this._controls.editor.disabled=false;
Field.scrollFreeActivate(this._controls.editor)
}});
Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions=function(A){if(!A){return 
}function B(C,D){if(C in A||D===undefined){return 
}A[C]=D
}B("cancelControl",(A.cancelLink?"link":(A.cancelButton?"button":A.cancelLink==A.cancelButton==false?false:undefined)));
B("okControl",(A.okLink?"link":(A.okButton?"button":A.okLink==A.okButton==false?false:undefined)));
B("highlightColor",A.highlightcolor);
B("highlightEndColor",A.highlightendcolor)
};
Object.extend(Ajax.InPlaceEditor,{DefaultOptions:{ajaxOptions:{},autoRows:3,cancelControl:"link",cancelText:"cancel",clickToEditText:"Click to edit",externalControl:null,externalControlOnly:false,fieldPostCreation:"activate",formClassName:"inplaceeditor-form",formId:null,highlightColor:"#ffff99",highlightEndColor:"#ffffff",hoverClassName:"",htmlResponse:true,loadingClassName:"inplaceeditor-loading",loadingText:"Loading...",okControl:"button",okText:"ok",paramName:"value",rows:1,savingClassName:"inplaceeditor-saving",savingText:"Saving...",size:0,stripLoadedTextTags:false,submitOnBlur:false,textAfterControls:"",textBeforeControls:"",textBetweenControls:""},DefaultCallbacks:{callback:function(A){return Form.serialize(A)
},onComplete:function(B,A){new Effect.Highlight(A,{startcolor:this.options.highlightColor,keepBackgroundImage:true})
},onEnterEditMode:null,onEnterHover:function(A){A.element.style.backgroundColor=A.options.highlightColor;
if(A._effect){A._effect.cancel()
}},onFailure:function(B,A){alert("Error communication with the server: "+B.responseText.stripTags())
},onFormCustomization:null,onLeaveEditMode:null,onLeaveHover:function(A){A._effect=new Effect.Highlight(A.element,{startcolor:A.options.highlightColor,endcolor:A.options.highlightEndColor,restorecolor:A._originalBackground,keepBackgroundImage:true})
}},Listeners:{click:"enterEditMode",keydown:"checkForEscapeOrReturn",mouseover:"enterHover",mouseout:"leaveHover"}});
Ajax.InPlaceCollectionEditor.DefaultOptions={loadingCollectionText:"Loading options..."};
Form.Element.DelayedObserver=Class.create({initialize:function(B,A,C){this.delay=A||0.5;
this.element=$(B);
this.callback=C;
this.timer=null;
this.lastValue=$F(this.element);
Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this))
},delayedListener:function(A){if(this.lastValue==$F(this.element)){return 
}if(this.timer){clearTimeout(this.timer)
}this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);
this.lastValue=$F(this.element)
},onTimerEvent:function(){this.timer=null;
this.callback(this.element,$F(this.element))
}});Array.prototype.removeDuplicates=function(){for(var A=1;
A<this.length;
A++){if(this[A][0]==this[A-1][0]){this.splice(A,1)
}}};
Array.prototype.empty=function(){for(var A=0;
A<=this.length;
A++){this.shift()
}};
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")
};
function LyteBox(){this.theme="grey";
this.hideFlash=true;
this.hideMove=true;
this.outerBorder=true;
this.resizeSpeed=8;
this.maxOpacity=80;
this.autoResize=true;
this.doAnimations=false;
this.borderSize=0;
if(this.resizeSpeed>10){this.resizeSpeed=10
}if(this.resizeSpeed<1){resizeSpeed=1
}this.resizeDuration=(11-this.resizeSpeed)*0.15;
this.resizeWTimerArray=new Array();
this.resizeWTimerCount=0;
this.resizeHTimerArray=new Array();
this.resizeHTimerCount=0;
this.showContentTimerArray=new Array();
this.showContentTimerCount=0;
this.overlayTimerArray=new Array();
this.overlayTimerCount=0;
this.imageTimerArray=new Array();
this.imageTimerCount=0;
this.timerIDArray=new Array();
this.timerIDCount=0;
this.slideshowIDArray=new Array();
this.slideshowIDCount=0;
this.imageArray=new Array();
this.activeImage=null;
this.slideArray=new Array();
this.activeSlide=null;
this.frameArray=new Array();
this.activeFrame=null;
this.checkFrame();
this.isSlideshow=false;
this.isLyteframe=true;
/*@cc_on
		/*@if (@_jscript)
			this.ie = (document.all && !window.opera) ? true : false;
		/*@else @*/
this.ie=false;
/*@end
	@*/
this.ie7=(this.ie&&window.XMLHttpRequest);
this.initialize()
}LyteBox.prototype.initialize=function(){var C=this.doc.getElementsByTagName("body").item(0),G,F,E,D,B,A;
if(this.doc.getElementById("lbOverlay")){C.removeChild(this.doc.getElementById("lbOverlay"));
C.removeChild(this.doc.getElementById("lbMain"))
}G=this.doc.createElement("div");
G.setAttribute("id","lbOverlay");
G.setAttribute((this.ie?"className":"class"),this.theme);
if((this.ie&&!this.ie7)||(this.ie7&&this.doc.compatMode=="BackCompat")){G.style.position="absolute"
}G.style.display="none";
C.appendChild(G);
F=this.doc.createElement("div");
F.setAttribute("id","lbMain");
F.style.display="none";
C.appendChild(F);
E=this.doc.createElement("div");
E.setAttribute("id","lbOuterContainer");
E.setAttribute((this.ie?"className":"class"),this.theme);
F.appendChild(E);
D=this.doc.createElement("div");
D.setAttribute("id","lbIframeContainer");
D.style.display="none";
E.appendChild(D);
B=this.doc.createElement("iframe");
B.setAttribute("id","lbIframe");
B.setAttribute("name","lbIframe");
B.style.display="none";
D.appendChild(B);
A=this.doc.createElement("div");
A.setAttribute("id","lbLoading");
E.appendChild(A)
};
LyteBox.prototype.start=function(D,G,B){if(typeof (video)!="undefined"&&!video.paused&&!video.ended){pauseVideo();
video.paused=true;
this.hideFlash=false;
$("topAd").style.display="none"
}if(this.ie&&!this.ie7){this.toggleSelects("hide")
}if(this.hideFlash){this.toggleFlash("hide")
}if(this.hideMove){this.toggleMove("hide")
}this.isLyteframe=(B?true:false);
var I=this.getPageSize(),J=this.doc.getElementById("lbOverlay"),A,H,F,E,C;
J.style.height=I[1]+"px";
J.style.display="";
this.appear("lbOverlay",(this.doAnimations?0:this.maxOpacity));
A=(this.isFrame)?window.parent.frames[window.name].document.getElementsByTagName("a"):document.getElementsByTagName("a");
if(this.isLyteframe){this.frameArray=[];
this.frameNum=0;
if((D.getAttribute("rel")=="lyteframe")){H=D.getAttribute("rev");
this.frameArray.push(new Array(D.getAttribute("href"),D.getAttribute("title"),(H==null||H==""?"width: 400px; height: 400px; scrolling: auto;":H)))
}else{if(D.getAttribute("rel").indexOf("lyteframe")!=-1){for(F=0;
F<A.length;
F++){E=A[F];
if(E.getAttribute("href")&&(E.getAttribute("rel")==D.getAttribute("rel"))){H=E.getAttribute("rev");
this.frameArray.push(new Array(E.getAttribute("href"),E.getAttribute("title"),(H==null||H==""?"width: 400px; height: 400px; scrolling: auto;":H)))
}}this.frameArray.removeDuplicates();
while(this.frameArray[this.frameNum][0]!=D.getAttribute("href")){this.frameNum++
}}}}C=this.doc.getElementById("lbMain");
C.style.top="50px";
C.style.height=I[1]-50+"px";
C.style.display="";
if(!this.outerBorder){this.doc.getElementById("lbOuterContainer").style.border="none";
this.doc.getElementById("lbDetailsContainer").style.border="none"
}else{this.doc.getElementById("lbOuterContainer").style.borderBottom="";
this.doc.getElementById("lbOuterContainer").setAttribute((this.ie?"className":"class"),this.theme)
}this.isSlideshow=G;
this.isPaused=(this.slideNum!=0?true:false);
this.changeContent(this.frameNum)
};
LyteBox.prototype.changeContent=function(B){this.activeImage=this.activeSlide=this.activeFrame=B;
if(!this.outerBorder){this.doc.getElementById("lbOuterContainer").style.border="none"
}else{this.doc.getElementById("lbOuterContainer").style.borderBottom="";
this.doc.getElementById("lbOuterContainer").setAttribute((this.ie?"className":"class"),this.theme)
}this.doc.getElementById("lbLoading").style.display="";
this.doc.getElementById("lbIframe").style.display="none";
this.doc.getElementById("lbIframeContainer").style.display="none";
var G=myLytebox.doc.getElementById("lbIframe"),H,D,C,A,F,E;
H=this.frameArray[this.activeFrame][2];
D=H.split(";");
for(C=0;
C<D.length;
C++){if(D[C].indexOf("width:")>=0){A=D[C].replace("width:","");
G.width=A.trim()
}else{if(D[C].indexOf("height:")>=0){F=D[C].replace("height:","");
G.height=F.trim()
}else{if(D[C].indexOf("scrolling:")>=0){E=D[C].replace("scrolling:","");
G.scrolling=E.trim()
}else{if(D[C].indexOf("border:")>=0){}}}}}this.resizeContainer(parseInt(G.width),parseInt(G.height));
this.showContent()
};
LyteBox.prototype.resizeContainer=function(C,A,F){var E=myLytebox.doc.getElementById("lbIframe"),B,D;
E.height=A+20;
E.width=C;
this.wCur=this.doc.getElementById("lbOuterContainer").offsetWidth;
this.hCur=this.doc.getElementById("lbOuterContainer").offsetHeight;
this.xScale=((C+(this.borderSize*2))/this.wCur)*100;
this.yScale=((A+(this.borderSize*2))/this.hCur)*100;
D=(this.wCur-this.borderSize*2)-C;
B=(this.hCur-this.borderSize*2)-A;
if(!(B==0)){this.hDone=false;
this.resizeH("lbOuterContainer",this.hCur,A,this.getPixelRate(this.hCur,A))
}else{this.hDone=true
}if(!(D==0)){this.wDone=false;
this.resizeW("lbOuterContainer",this.wCur,C,this.getPixelRate(this.wCur,C))
}else{this.wDone=true
}};
LyteBox.prototype.showContent=function(){if(this.wDone&&this.hDone){for(var A=0;
A<this.showContentTimerCount;
A++){window.clearTimeout(this.showContentTimerArray[A])
}if(this.outerBorder){}this.doc.getElementById("lbLoading").style.display="none";
this.doc.getElementById("lbIframe").style.display="";
this.appear("lbIframe",(this.doAnimations?0:100));
this.doc.getElementById("lbIframeContainer").style.display=(this.isLyteframe?"":"none");
try{this.doc.getElementById("lbIframe").src=this.frameArray[this.activeFrame][0]
}catch(B){}}else{this.showContentTimerArray[this.showContentTimerCount++]=setTimeout("myLytebox.showContent()",200)
}};
LyteBox.prototype.end=function(C){var D=(C=="slideshow"?false:true),E,A,B;
if(this.isSlideshow&&this.isPaused&&!D){return 
}if(!this.doc.getElementById("lbMain")){return 
}this.doc.getElementById("lbMain").style.display="none";
this.fade("lbOverlay",(this.doAnimations?this.maxOpacity:0));
if(this.ie&&!this.ie7){this.toggleSelects("visible")
}if(this.hideFlash){this.toggleFlash("visible")
}if(this.hideMove){this.toggleMove("visible")
}if(this.ie){E=document.getElementById("globalSearchTextInput");
if(E){A=E.value;
E.focus();
document.getElementById("globalsearchbutton").focus()
}setTimeout(function(){E.value=A
},50)
}this.initialize();
if(this.onEnd){this.onEnd()
}if(typeof (video)!="undefined"&&!video.ended&&video.paused){video.paused=false;
$("topAd").style.display="block";
setTimeout(function(){window.scrollTo(0,275)
},100);
setTimeout(continueVideo,200)
}};
LyteBox.prototype.checkFrame=function(){this.isFrame=false;
this.lytebox="myLytebox";
this.doc=document
};
LyteBox.prototype.getPixelRate=function(C,A){var B=(A>C)?A-C:C-A;
if(B>=0&&B<=100){return 10
}if(B>100&&B<=200){return 15
}if(B>200&&B<=300){return 20
}if(B>300&&B<=400){return 25
}if(B>400&&B<=500){return 30
}if(B>500&&B<=600){return 35
}if(B>600&&B<=700){return 40
}if(B>700){return 45
}};
LyteBox.prototype.appear=function(E,B){var A=this.doc.getElementById(E).style,C;
A.opacity=(B/100);
A.MozOpacity=(B/100);
A.KhtmlOpacity=(B/100);
A.filter="alpha(opacity="+(B+10)+")";
if(B==100&&(E=="lbImage"||E=="lbIframe")){try{A.removeAttribute("filter")
}catch(D){}}else{if(B>=this.maxOpacity&&E=="lbOverlay"){for(C=0;
C<this.overlayTimerCount;
C++){window.clearTimeout(this.overlayTimerArray[C])
}return 
}else{if(B>=100&&E=="lbDetailsContainer"){try{A.removeAttribute("filter")
}catch(D){}for(C=0;
C<this.imageTimerCount;
C++){window.clearTimeout(this.imageTimerArray[C])
}this.doc.getElementById("lbOverlay").style.height=this.getPageSize()[1]+"px"
}else{if(E=="lbOverlay"){this.overlayTimerArray[this.overlayTimerCount++]=setTimeout("myLytebox.appear('"+E+"', "+(B+20)+")",1)
}else{this.imageTimerArray[this.imageTimerCount++]=setTimeout("myLytebox.appear('"+E+"', "+(B+10)+")",1)
}}}}};
LyteBox.prototype.fade=function(D,B){var A=this.doc.getElementById(D).style;
A.opacity=(B/100);
A.MozOpacity=(B/100);
A.KhtmlOpacity=(B/100);
A.filter="alpha(opacity="+B+")";
if(B<=0){try{A.display="none"
}catch(C){}}else{if(D=="lbOverlay"){this.overlayTimerArray[this.overlayTimerCount++]=setTimeout("myLytebox.fade('"+D+"', "+(B-20)+")",1)
}else{this.timerIDArray[this.timerIDCount++]=setTimeout("myLytebox.fade('"+D+"', "+(B-10)+")",1)
}}};
LyteBox.prototype.resizeW=function(B,E,D,I,F){if(!this.hDone){this.resizeWTimerArray[this.resizeWTimerCount++]=setTimeout("myLytebox.resizeW('"+B+"', "+E+", "+D+", "+I+")",100);
return 
}var G=this.doc.getElementById(B),C=F?F:(this.resizeDuration/2),A=(this.doAnimations?E:D),H;
G.style.width=(A)+"px";
if(A<D){A+=(A+I>=D)?(D-A):I
}else{if(A>D){A-=(A-I<=D)?(A-D):I
}}this.resizeWTimerArray[this.resizeWTimerCount++]=setTimeout("myLytebox.resizeW('"+B+"', "+A+", "+D+", "+I+", "+(C+0.02)+")",C+0.02);
if(parseInt(G.style.width)==D){this.wDone=true;
for(H=0;
H<this.resizeWTimerCount;
H++){window.clearTimeout(this.resizeWTimerArray[H])
}}};
LyteBox.prototype.resizeH=function(A,I,H,G,C){var B=C?C:(this.resizeDuration/2),D=this.doc.getElementById(A),F=(this.doAnimations?I:H),E;
D.style.height=(F)+"px";
if(F<H){F+=(F+G>=H)?(H-F):G
}else{if(F>H){F-=(F-G<=H)?(F-H):G
}}this.resizeHTimerArray[this.resizeHTimerCount++]=setTimeout("myLytebox.resizeH('"+A+"', "+F+", "+H+", "+G+", "+(B+0.02)+")",B+0.02);
if(parseInt(D.style.height)==H){this.hDone=true;
for(E=0;
E<this.resizeHTimerCount;
E++){window.clearTimeout(this.resizeHTimerArray[E])
}}};
LyteBox.prototype.getPageScroll=function(){if(self.pageYOffset){return this.isFrame?parent.pageYOffset:self.pageYOffset
}else{if(this.doc.documentElement&&this.doc.documentElement.scrollTop){return this.doc.documentElement.scrollTop
}else{if(document.body){return this.doc.body.scrollTop
}}}};
LyteBox.prototype.getPageSize=function(){var E,A,C,F,D,B;
if(window.innerHeight&&window.scrollMaxY){E=this.doc.scrollWidth;
A=(this.isFrame?parent.innerHeight:self.innerHeight)+(this.isFrame?parent.scrollMaxY:self.scrollMaxY)
}else{if(this.doc.body.scrollHeight>this.doc.body.offsetHeight){E=this.doc.body.scrollWidth;
A=this.doc.body.scrollHeight
}else{E=this.doc.getElementsByTagName("html").item(0).offsetWidth;
A=this.doc.getElementsByTagName("html").item(0).offsetHeight;
E=(E<this.doc.body.offsetWidth)?this.doc.body.offsetWidth:E;
A=(A<this.doc.body.offsetHeight)?this.doc.body.offsetHeight:A
}}if(self.innerHeight){C=(this.isFrame)?parent.innerWidth:self.innerWidth;
F=(this.isFrame)?parent.innerHeight:self.innerHeight
}else{if(document.documentElement&&document.documentElement.clientHeight){C=this.doc.documentElement.clientWidth;
F=this.doc.documentElement.clientHeight
}else{if(document.body){C=this.doc.getElementsByTagName("html").item(0).clientWidth;
F=this.doc.getElementsByTagName("html").item(0).clientHeight;
C=(C==0)?this.doc.body.clientWidth:C;
F=(F==0)?this.doc.body.clientHeight:F
}}}D=(A<F)?F:A;
B=(E<C)?C:E;
return new Array(B,D,C,F)
};
LyteBox.prototype.toggleFlash=function(E){var D=this.doc.getElementsByTagName("object"),B,C,A,G;
for(B=0;
B<D.length;
B++){if(this.ie){D[B].style.display=(E=="hide")?"none":"block"
}else{D[B].style.visibility=(E=="hide")?"hidden":"visible"
}}C=this.doc.getElementsByTagName("embed");
for(B=0;
B<C.length;
B++){if(this.ie){C[B].style.display=(E=="hide")?"none":"block"
}else{C[B].style.visibility=(E=="hide")?"hidden":"visible"
}}if(this.isFrame){for(B=0;
B<parent.frames.length;
B++){try{D=parent.frames[B].window.document.getElementsByTagName("object");
for(A=0;
A<D.length;
A++){D[A].style.visibility=(E=="hide")?"hidden":"visible"
}}catch(F){}try{C=parent.frames[B].window.document.getElementsByTagName("embed");
for(A=0;
A<C.length;
A++){C[A].style.visibility=(E=="hide")?"hidden":"visible"
}}catch(F){}}}G=$$("iframe");
for(B=0;
B<G.length;
B++){if(G[B].id!="lbIframe"){G[B].style.visibility=(E=="hide")?"hidden":"visible"
}}};
LyteBox.prototype.toggleMove=function(A){if(typeof video!="undefined"&&$("moveDiv_QMP")){if(!video.ended){$("moveDiv_QMP").style.visibility=(A=="hide")?"hidden":"visible"
}else{if(video.ended){$("moveDiv_QMP").style.visibility="hidden"
}}}};
LyteBox.prototype.toggleSelects=function(D){var C=this.doc.getElementsByTagName("select"),B,A;
for(B=0;
B<C.length;
B++){C[B].style.visibility=(D=="hide")?"hidden":"visible"
}if(this.isFrame){for(B=0;
B<parent.frames.length;
B++){try{C=parent.frames[B].window.document.getElementsByTagName("select");
for(A=0;
A<C.length;
A++){C[A].style.visibility=(D=="hide")?"hidden":"visible"
}}catch(E){}}}};
FastInit.addOnLoad(setTimeout(function(){myLytebox=new LyteBox();
if(typeof (user.startBox)!="undefined"){user.signingIn=true;
eval(user.startBox+"Overlay()")
}else{checkServerRequest()
}},500));
function startLytebox(C,B,D){var A=document.createElement("a");
A.setAttribute("rel","lyteframe");
A.setAttribute("href",settings.staticFile+"/popups/"+C);
A.setAttribute("rev","width: "+B+"px; height: "+D+"px; scrolling: auto;");
myLytebox.start(A,false,true);
setTimeout(function(){window.scrollTo(0,0)
},100)
}function startJspLytebox(D,B,C){window.scrollTo(0,0);
var A=document.createElement("a");
A.setAttribute("rel","lyteframe");
A.setAttribute("href",D);
A.setAttribute("rev","width: "+B+"px; height: "+C+"px; scrolling: auto;");
myLytebox.start(A,false,true)
}var head_end_zip="",head_end_registered=false;
function headEndZip(B,A){head_end_zip=B||"";
head_end_registered=!!A;
startLytebox("zip_head.html",710,280)
}function headEndOverlay(){headEndZip()
}function headEndZipOnly(A,B){user.head_end_zip_only=true;
user.redirect_url=B||false;
headEndZip(A)
}function headEndZipWithUrl(A){user.redirect_url=A;
headEndZip();
head_end_zip_only=true
}function signInOverlay(A,B){if(user.signedIn&&A){document.location=A;
return true
}user.redirect_url=A||user.redirect_url;
user.needVerify=B||false;
if(user.isLikely){startLytebox("comcast_signin.html",720,310)
}else{startLytebox("signin.html",700,310)
}}function loggedInVerified(verified,onEnd){if(user.signedIn&&(!verified||user.emailVerified)){user.next_step=undefined;
return true
}else{if(verified&&user.signedIn){new Ajax.Request("/userinfo.widget",{onComplete:function(transport){var resp=transport.responseText.evalJSON();
if(resp.emailVerified){user.emailVerified=true;
eval(user.next_step)
}else{verifyEmailOverlay()
}}});
return false
}else{createCookie("onEnd",onEnd,0);
handleSignInOut();
return false
}}}function setNextStep(A){user.next_step=A
}function reminderOverlay(){setNextStep("parent.reminderOverlay('"+entity.name+"','"+entity.globalUid+"')");
if(!loggedInVerified(true,reminderOverlay)){return false
}startLytebox("addAlert.html",700,420);
myLytebox.onEnd=function(){updateNotify(user.isNotified)
}
}function rateOverlay(A){if(A){user.ratingMain=true
}startLytebox("rate.html",400,350);
myLytebox.onEnd=function(){updateRating();
user.ratingMain=false
};
$("lbIframeContainer").addClassName("blue")
}function shareSlideshowOverlay(C,B){user.emailOverlay=true;
window.scrollTo(0,0);
var A=document.createElement("a");
A.setAttribute("rel","lyteframe");
if(typeof (B)!="undefined"&&B!=""){if(B.indexOf("slide")>-1){A.setAttribute("href","/share/slideshow/"+C+"/"+B.split("-")[1])
}}else{A.setAttribute("href","/share/slideshow/"+entity)
}A.setAttribute("rev","width: "+448+"px; height: "+310+"px; scrolling: auto;");
myLytebox.start(A,false,true)
}function sharePostOverlay(C,B){user.emailOverlay=true;
window.scrollTo(0,0);
var A=document.createElement("a");
A.setAttribute("rel","lyteframe");
if(typeof (B)!="undefined"&&B!=""){if(B.indexOf("Image")>-1){A.setAttribute("href","/post/entity/"+C+"/image/"+B.split("-")[1])
}else{if(B.indexOf("Video")>-1){A.setAttribute("href","/post/entity/"+C+"/video/"+B.split("-")[1])
}}}else{A.setAttribute("href","/post/entity/"+C+"/main")
}A.setAttribute("rev","width: "+448+"px; height: "+310+"px; scrolling: auto;");
myLytebox.start(A,false,true)
}function embedOverlay(A){video.restartTime=Number(JSFANCASTCONTAINER.getEmailTime());
entity.embedPath=A.replace("/embed","/embed?skipTo=0");
startLytebox("embed.html",440,260)
}function emailOverlay(D,C){user.emailOverlay=true;
window.scrollTo(0,0);
var B=document.createElement("a");
B.setAttribute("rel","lyteframe");
if(typeof (C)!="undefined"&&C!=""){if(C.indexOf("Image")>-1){B.setAttribute("href","/share/entity/"+D+"/image/"+C.split("-")[1])
}else{if(C.indexOf("Video")>-1){B.setAttribute("href","/share/entity/"+D+"/video/"+C.split("-")[1])
}}}else{B.setAttribute("href","/share/entity/"+D+"/main")
}var A="645";
if(typeof video!="undefined"&&video.restartTime>0){A="660"
}B.setAttribute("rev","width: "+448+"px; height: "+A+"px; scrolling: auto;");
myLytebox.start(B,false,true);
$("lbIframeContainer").addClassName("blue")
}function verifyEmailOverlay(A){user.pass_url=A;
user.next_step=undefined;
startLytebox("verifyEmail.html",500,220)
}function jspOverlay(){if(typeof (user.url)!="undefined"){if(!loggedInVerified(true)){return false
}startJspLytebox(user.url,700,300)
}}function emailVerifiedOverlay(){startLytebox("emailVerified.html",600,230)
}function deletedUserOverlay(){startLytebox("deletedUser.html",500,260)
}function registerOverlay(){startLytebox("register.html",700,472)
}function nielsonOverlay(){startLytebox("nielsons.html",540,330)
}function forgotOverlay(){startLytebox("forgot.html",700,300)
}function comcastOverlay(){startLytebox("comcastIntercept.html",700,160)
}function personalOverlay(){startLytebox("personalInfo.html",700,270)
}function setupSSO(){setCookieInObject("CTV_SSO_COOKIE",user);
return(typeof (user.partner)!="undefined")
}function comcastAutoRegisterOverlay(){if(setupSSO()){personalOverlay()
}}function comcastUsernameChangedOverlay(){if(setupSSO()){startLytebox("comcastUsernameChanged.html",700,300)
}}function cidUpsellOverlay(){startJspLytebox("/popups/commonid/upsell",700,300)
}function cidWelcomeOverlay(){startLytebox("cidActivate.html",700,300)
}function privacyOverlay(){var A=myLytebox.getPageSize(),B=document.getElementsByTagName("body").item(0);
if(A[1]<2045){B.style.height="2850px"
}startLytebox("privacy.html",700,2040)
}function termsOverlay(){var A=myLytebox.getPageSize(),B=document.getElementsByTagName("body").item(0);
if(A[1]<2845){B.style.height="2850px"
}startLytebox("terms.html",700,2820)
}function videoPlayerOverlay(C){var D=C.element().up().up();
var F=Event.findElement(C,"a"),E=F.href.replace(/videos$/,"lytebox");
var B=D.offsetTop+(D.down().getHeight()/2);
var A=document.createElement("a");
A.setAttribute("rel","lyteframe");
A.setAttribute("href",E);
A.setAttribute("outerBorder",true);
A.setAttribute("rev","width: "+930+"px; height: "+498+"px; scrolling: no; overflow: hidden;");
myLytebox.start(A,false,true);
object=myLytebox.doc.getElementById("lbMain");
object.style.top=B+"px";
setTimeout(function(){window.scrollTo(0,B-25)
},100);
$("lbIframe").addClassName("black");
Event.stop(C)
};var custom_var,_sp="%3A\\/\\/",_rp="%3A//",_poE=0,_poX=0,_sH=screen.height,_d=document,_w=window,_ht=escape(_w.location.href),_hr=_d.referrer,_tm=(new Date()).getTime(),_kp=0,_sW=screen.width;
_d.onkeypress=_fK;
function _fK(A){if(!A){A=_w.event
}var B=(typeof A.which=="number")?A.which:A.keyCode;
if((_kp==15&&B==12)){_w.open("https://dashboard.opinionlab.com/pv_controlboard.html?url="+_fC(_ht),"PageViewer","height=529,width=705,screenX="+((_sW-705)/2)+",screenY="+((_sH-529)/2)+",top="+((_sH-529)/2)+",left="+((_sW-705)/2)+",status=yes,toolbar=no,menubar=no,location=no,resizable=yes")
}_kp=B
}function _fC(_u){_aT=_sp+",\\/,\\.,-,_,"+_rp+",%2F,%2E,%2D,%5F";
_aA=_aT.split(",");
for(i=0;
i<5;
i++){eval("_u=_u.replace(/"+_aA[i]+"/g,_aA[i+5])")
}return _u
}function O_LC(){_w.open("https://secure.opinionlab.com/ccc01/comment_card.asp?time1="+_tm+"&time2="+(new Date()).getTime()+"&prev="+_fC(escape(_hr))+"&referer="+_fC(_ht)+"&height="+_sH+"&width="+_sW+"&custom_var="+custom_var,"comments","width=535,height=192,screenX="+((_sW-535)/2)+",screenY="+((_sH-192)/2)+",top="+((_sH-192)/2)+",left="+((_sW-535)/2)+",resizable=yes,copyhistory=yes,scrollbars=no")
}function _fPe(){if(Math.random()>=1-_poE){O_LC();
_poX=0
}}function _fPx(){if(Math.random()>=1-_poX){O_LC()
}}window.onunload=_fPx;
function O_GoT(A){_d.write("<a href='javascript:O_LC()' class='main_nav'>"+A+"</a>");
_fPe()
};