Function.prototype.method=function(_1,_2){
this.prototype[_1]=_2;
return this;
};
if(typeof OverlayManager=="undefined"){
OverlayManager=function(_3,_4,_5,_6){
function Constructor(){
this.manager=(_3)?_3:this;
this.debugManager=(this.manager.debugManager)?this.manager.debugManager:new DebugManager(this,"");
this.styleManager=(this.manager.styleManager)?this.manager.styleManager:new StyleManager(this);
this.eventsManager=(this.manager.eventsManager)?this.manager.eventsManager:new EventsManager(this);
this.useEmbedPlayer=(_6)?(_6==true||_6==false):true;
this.popupWidth;
this.popupHeight;
this.popupWidthCurrent;
this.popupHeightCurrent;
this.popupPosition="mc";
this.fadeOpacity=60;
this.fadeOpacityIncrement=5;
this.currentOpacity=0;
this.fadeInterval=50;
this.backgroundColor="black";
this.isOverlayOpen=false;
this.runOnCloseOverlayFunction;
this.runOnMouseOverFunction;
this.runOnMouseOutFunction;
this.runOnClickFunction;
this.divName_background="overlay_background";
this.divName_popup="overlay_popup";
this.closeButtonSpan="<span id=\"overlay_span_closeButton\" class=\"overlay_span_closeButton\"><a id=\"overlay_a_closeButton\" class=\"overlay_a_closeButton\" href=\"javascript:void(overlayManager.closeOverlay())\" onMouseOver=\"overlayManager.runOnEvent('MouseOver')\" onMouseOut=\"overlayManager.runOnEvent('MouseOut')\" onClick=\"overlayManager.runOnEvent('Click')\">[CLOSEBUTTONTEXT]</a></span>";
this.closeButtonText=(_5==null||_5=="")?"&nbsp;[X]":_5;
this.overlayHTML=_4;
this.overlayHTMLCurrent="";
document.write("<style type=\"text/css\">");
if(!this.styleManager.findClass("a.overlay_a_closeButton")){
document.write("a.overlay_a_closeButton\t\t\t{font-family:arial;font-style:normal;font-size:20px;text-decoration:none;color:silver;}");
}
if(!this.styleManager.findClass("a.overlay_a_closeButton:hover")){
document.write("a.overlay_a_closeButton:hover\t{ color:gray;text-decoration:none;}");
}
document.write("</style>");
this.eventsManager.modify("window.onresize","this.setBackground()");
this.eventsManager.modify("window.onresize","this.positionPopup()");
this.eventsManager.modify("window.onscroll","this.setBackground()");
this.eventsManager.modify("window.onscroll","this.positionPopup()");
this.eventsManager.modify("window.onload","this.createBackgroundDiv()","beforeExisting");
}
with(Constructor){
method("createBackgroundDiv",function(){
var _7="OverlayManager.createBackgroundDiv()";
var _8="OverlayManager.createBackgroundDiv()";
try{
if(!(document.getElementById(this.divName_background))){
this.createDiv(this.divName_background);
document.getElementById(this.divName_background).onclick=function(){
overlayManager.closeOverlay();
};
return true;
}else{
return false;
}
}
catch(e){
this.debugManager.output(_7,_8,"TRY/CATCH - "+e.message,"error");
return false;
}
});
method("setRunOnEvent",function(_9,_a){
var _b="OverlayManager.setRunOnEvent(eventName,functionCall)";
var _c="OverlayManager.setRunOnEvent(\""+_9+"\",\""+_a+"\")";
try{
eval("this.runOn"+_9+"Function = \""+_a+"\"");
return true;
}
catch(e){
this.debugManager.output(_b,_c,"TRY/CATCH - "+e.message,"error");
return false;
}
});
method("runOnEvent",function(_d){
var _e="OverlayManager.runOnEvent(eventName)";
var _f="OverlayManager.runOnEvent(\""+_d+"\")";
try{
if(_d=="MouseOver"||_d=="MouseOut"||_d=="Click"||_d=="CloseOverlay"){
eval(eval("this.runOn"+_d+"Function"));
return true;
}else{
this.debugManager.output(_e,_f,"Invalid eventName ("+_d+")","error");
return false;
}
}
catch(e){
this.debugManager.output(_e,_f,"TRY/CATCH - "+e.message,"error");
return false;
}
});
method("setProperty",function(_10,_11){
var _12="OverlayManager.setProperty(propertyName,propertyValue)";
var _13="OverlayManager.setProperty(\""+_10+"\",\""+_11+"\")";
try{
var _14=false;
switch(_10){
case "closeButtonText":
if(!(_11==""||_11==null)){
this.closeButtonText=_11;
_14=true;
}
break;
case "overlayHTML":
if(!(_11==""||_11==null)){
this.overlayHTML=_11;
_14=true;
}
break;
case "backgroundColor":
if(!(_11==""||_11==null)){
this.backgroundColor=_11;
_14=true;
}
break;
case "popupPosition":
if(_11=="tl"||_11=="tc"||_11=="tr"||_11=="ml"||_11=="mc"||_11=="mr"||_11=="bl"||_11=="bc"||_11=="br"){
this.popupPosition=_11;
_14=true;
}
break;
case "useEmbedPlayer":
if(_11==true||_11==false){
_14=true;
this.useEmbedPlayer=_11;
}
break;
case "fadeOpacity":
if(!(isNaN(_11)||_11<0||_11>100)){
_14=true;
this.fadeOpacity=_11;
}
break;
case "fadeOpacityIncrement":
if(!(isNaN(_11)||_11<1||_11>10)){
_14=true;
this.fadeOpacityIncrement=this.fadeOpacity/_11;
}
break;
case "fadeInterval":
if(!(isNaN(_11)||_11<1||_11>500)){
_14=true;
this.fadeInterval=_11;
}
break;
default:
this.debugManager.output(_12,_13,"Invalid propertyName ("+_11+") ","error");
return false;
}
if(_14==false){
this.debugManager.output(_12,_13,"Invalid property value ("+_11+") - ","error");
return false;
}
return true;
}
catch(e){
this.debugManager.output(_12,_13,"TRY/CATCH - "+e.message,"error");
return false;
}
});
method("closeOverlay",function(){
var _15="OverlayManager.closeOverlay()";
var _16="OverlayManager.closeOverlay()";
try{
this.runOnEvent("CloseOverlay");
this.isOverlayOpen=false;
this.removeDiv(this.divName_popup,true);
this.fadeBackground("out",this.currentOpacity);
if(this.useEmbedPlayer==true){
if(typeof embeddedPlayerManager!="undefined"&&typeof embeddedPlayerManager.getPlayer()!="undefined"){
if(typeof embeddedPlayerManager.getPlayer().getCurrentTimeStart!="undefined"&&typeof embeddedPlayerManager.getPlayer().getCurrentTimeStart()!="undefined"){
embeddedPlayerManager.getPlayer().play();
}
embeddedPlayerManager.unHidePlayerAll();
embeddedPlayerManager.updatePositions();
}
}
this.popupWidth=0;
this.popupHeight=0;
this.popupWidthCurrent=0;
this.popupHeightCurrent=0;
this.setRunOnEvent("MouseOver","");
this.setRunOnEvent("MouseOut","");
this.isOverlayOpen=false;
return true;
}
catch(e){
this.debugManager.output(_15,_16,"TRY/CATCH - "+e.message,"error");
return false;
}
});
method("openOverlay",function(w,h,_19){
var _1a="OverlayManager.openOverlay(w,h,replaceString)";
var _1b="OverlayManager.openOverlay("+w+","+h+",\""+_19+"\")";
try{
this.fadeBackground("in",0);
this.isOverlayOpen=true;
this.createDiv(this.divName_popup);
this.overlayHTMLCurrent=this.overlayHTML;
this.overlayHTMLCurrent=this.overlayHTMLCurrent.replace("[CLOSEBUTTON]",this.closeButtonSpan);
this.overlayHTMLCurrent=this.overlayHTMLCurrent.replace("[CLOSEBUTTONTEXT]",this.closeButtonText);
if(!(_19==null||_19=="")){
var _1c=eval("new Array("+"'"+_19.replace(/\,/g,"','")+"'"+",'[W]=="+w+"','[H]=="+h+"')");
for(var i=0;i<_1c.length;i++){
var _1e=eval("new Array("+"'"+_1c[i].replace(/\==/g,"','")+"'"+")");
this.overlayHTMLCurrent=eval("this.overlayHTMLCurrent.replace(/"+_1e[0].replace(/\[/g,"\\[").replace(/\]/g,"\\]")+"/g,'"+_1e[1]+"')");
}
}
this.popupWidth=w;
this.popupHeight=h;
this.setBackground();
document.getElementById(this.divName_popup).style.display="block";
document.getElementById(this.divName_popup).style.visibility="visible";
document.getElementById(this.divName_popup).style.position="absolute";
this.positionPopup();
document.getElementById(this.divName_popup).innerHTML=this.overlayHTMLCurrent;
if(this.useEmbedPlayer==true){
if(typeof embeddedPlayerManager!="undefined"&&typeof embeddedPlayerManager.getPlayer()!="undefined"){
if(typeof embeddedPlayerManager.getPlayer().pause!="undefined"){
embeddedPlayerManager.getPlayer().pause();
}
embeddedPlayerManager.hidePlayerAll();
}
}
return true;
}
catch(e){
this.debugManager.output(_1a,_1b,"TRY/CATCH - "+e.message,"error");
return false;
}
});
method("fadeBackground",function(_1f,_20){
var _21="OverlayManager.fadeBackground(direction,currentOpacity)";
var _22="OverlayManager.fadeBackground(\""+_1f+"\","+_20+")";
try{
if(_1f=="in"){
if(_20<this.fadeOpacity){
_20+=this.fadeOpacityIncrement;
document.getElementById(this.divName_background).style.filter="alpha(opacity="+_20+")";
document.getElementById(this.divName_background).style.opacity=_20/100;
document.getElementById(this.divName_background).style.background=this.backgroundColor;
window.setTimeout("overlayManager.fadeBackground('in',"+_20+")",this.fadeInterval);
}else{
this.currentOpacity=_20;
return true;
}
}else{
if(this.currentOpacity>0){
this.currentOpacity-=this.fadeOpacityIncrement;
document.getElementById(this.divName_background).style.filter="alpha(opacity="+this.currentOpacity+")";
document.getElementById(this.divName_background).style.opacity=this.currentOpacity/100;
document.getElementById(this.divName_background).style.background=this.backgroundColor;
window.setTimeout("overlayManager.fadeBackground('out')",this.fadeInterval);
}else{
this.removeDiv(this.divName_background,false);
return true;
}
}
}
catch(e){
this.debugManager.output(_21,_22,"TRY/CATCH - "+e.message,"error");
return false;
}
});
method("setBackground",function(){
var _23="OverlayManager.setBackground()";
var _24="OverlayManager.setBackground()";
try{
if(document.getElementById(this.divName_background)&&document.getElementById(this.divName_popup)&&this.isOverlayOpen==true){
document.getElementById(this.divName_background).style.display="block";
document.getElementById(this.divName_background).style.visibility="visible";
document.getElementById(this.divName_background).style.width=this.getDimension("pageWidth")+"px";
document.getElementById(this.divName_background).style.height=this.getDimension("pageHeight")+"px";
document.getElementById(this.divName_background).style.position="absolute";
document.getElementById(this.divName_background).style.left="0px";
document.getElementById(this.divName_background).style.top="0px";
document.getElementById(this.divName_background).style.overflow="hidden";
document.getElementById(this.divName_background).style.background=this.backgroundColor;
return true;
}
return false;
}
catch(e){
this.debugManager.output(_23,_24,"TRY/CATCH - "+e.message,"error");
return false;
}
});
method("positionPopup",function(){
var _25="OverlayManager.positionPopup()";
var _26="OverlayManager.positionPopup()";
try{
if(!(document.getElementById(this.divName_popup))){
return false;
}
var _27=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;
_27=_27?_27:0;
switch(this.popupPosition){
case "tl":
if(this.popupWidth){
document.getElementById(this.divName_popup).style.left="0px";
document.getElementById(this.divName_popup).style.top=0+_27+"px";
}
return true;
break;
case "tc":
if(this.popupWidth){
document.getElementById(this.divName_popup).style.left=(this.getDimension("windowWidth")/2)-((this.getDimension("windowWidth")<this.popupWidth)?(this.getDimension("windowWidth")-(0.1*this.getDimension("windowWidth"))):(this.popupWidth/2))+"px";
document.getElementById(this.divName_popup).style.top=0+_27+"px";
}
return true;
break;
case "tr":
if(this.popupWidth){
document.getElementById(this.divName_popup).style.left=this.getDimension("windowWidth")-this.popupWidth+"px";
document.getElementById(this.divName_popup).style.top="0px";
}
return true;
break;
case "ml":
if(this.popupWidth){
document.getElementById(this.divName_popup).style.left="0px";
document.getElementById(this.divName_popup).style.top=(this.getDimension("windowHeight")/2)-(((this.getDimension("windowHeight")<this.popupHeight)?(this.getDimension("windowHeight")-(0.1*this.getDimension("windowHeight"))):this.popupHeight)/2)+(_27-(20))+"px";
}
return true;
break;
case "mc":
if(this.popupWidth){
document.getElementById(this.divName_popup).style.left=(this.getDimension("windowWidth")/2)-((this.getDimension("windowWidth")<this.popupWidth)?(this.getDimension("windowWidth")-(0.1*this.getDimension("windowWidth"))):(this.popupWidth/2))+"px";
document.getElementById(this.divName_popup).style.top=(this.getDimension("windowHeight")/2)-(((this.getDimension("windowHeight")<this.popupHeight)?(this.getDimension("windowHeight")-(0.1*this.getDimension("windowHeight"))):this.popupHeight)/2)+(_27-(20))+"px";
}
return true;
break;
case "mr":
if(this.popupWidth){
document.getElementById(this.divName_popup).style.left=this.getDimension("windowWidth")-this.popupWidth+"px";
document.getElementById(this.divName_popup).style.top=(this.getDimension("windowHeight")/2)-(((this.getDimension("windowHeight")<this.popupHeight)?(this.getDimension("windowHeight")-(0.1*this.getDimension("windowHeight"))):this.popupHeight)/2)+(_27-(20))+"px";
}
return true;
break;
case "bl":
if(this.popupWidth){
document.getElementById(this.divName_popup).style.left="0px";
document.getElementById(this.divName_popup).style.top=this.getDimension("windowHeight")-this.popupHeight+"px";
}
return true;
break;
case "bc":
if(this.popupWidth){
document.getElementById(this.divName_popup).style.left=(this.getDimension("windowWidth")/2)-((this.getDimension("windowWidth")<this.popupWidth)?(this.getDimension("windowWidth")-(0.1*this.getDimension("windowWidth"))):(this.popupWidth/2))+"px";
document.getElementById(this.divName_popup).style.top=this.getDimension("windowHeight")-this.popupHeight+"px";
}
return true;
break;
case "br":
if(this.popupWidth){
document.getElementById(this.divName_popup).style.left=this.getDimension("windowWidth")-this.popupWidth+"px";
document.getElementById(this.divName_popup).style.top=this.getDimension("windowHeight")-this.popupHeight+"px";
}
return true;
break;
}
return false;
}
catch(e){
this.debugManager.output(_25,_26,"TRY/CATCH - "+e.message,"error");
return false;
}
});
method("createDiv",function(_28){
var _29="OverlayManager.createDiv(divID)";
var _2a="OverlayManager.createDiv(\""+_28+"\")";
try{
if(document.getElementById(_28)){
return false;
}
var _2b=document.createElement("div");
_2b.id=_28;
_2b.style.display="none";
_2b.style.visibility="hidden";
document.body.appendChild(_2b);
return true;
}
catch(e){
this.debugManager.output(_29,_2a,"TRY/CATCH - "+e.message,"error");
return false;
}
});
method("removeDiv",function(_2c,_2d){
var _2e="OverlayManager.removeDiv(divID)";
var _2f="OverlayManager.removeDiv(\""+_2c+"\")";
try{
if(document.getElementById(_2c)){
document.getElementById(_2c).style.display="none";
document.getElementById(_2c).style.visibility="hidden";
if(_2d==true){
var _30=document.getElementById(_2c);
document.body.removeChild(_30);
}
}
return true;
}
catch(e){
this.debugManager.output(_2e,_2f,"TRY/CATCH - "+e.message,"error");
return false;
}
});
method("getDimension",function(_31){
var _32="OverlayManager.getDimension(dimensionName)";
var _33="OverlayManager.getDimension(\""+_31+"\")";
try{
var _34;
var _35;
if(window.innerHeight&&window.scrollMaxY){
_34=document.body.scrollWidth;
_35=window.innerHeight+window.scrollMaxY;
}else{
if(document.body.scrollHeight>document.body.offsetHeight){
_34=document.body.scrollWidth;
_35=document.body.scrollHeight;
}else{
_34=document.body.offsetWidth;
_35=document.body.offsetHeight;
}
}
var _36;
var _37;
if(self.innerHeight){
_36=self.innerWidth;
_37=self.innerHeight;
}else{
if(document.documentElement&&document.documentElement.clientHeight){
_36=document.documentElement.clientWidth;
_37=document.documentElement.clientHeight;
}else{
if(document.body){
_36=document.body.clientWidth;
_37=document.body.clientHeight;
}
}
}
pageHeight=(_35<_37)?_37:_35;
pageWidth=(_34<_36)?_36:_34;
var _38;
var _39;
if(document.all){
_38=(pageWidth-_36==21)?-21:0;
_39=(pageHeight-_37==4)?-4:0;
}else{
_38=-16;
_39=0;
}
pageWidth=pageWidth+_38;
pageHeight=pageHeight+_39;
switch(_31){
case "windowWidth":
return _36;
break;
case "windowHeight":
return _37;
break;
case "pageWidth":
return pageWidth;
break;
case "pageHeight":
return pageHeight;
break;
default:
this.debugManager.output(_32,_33,"Invalid dimensionName ("+_31+")","error");
return false;
}
}
catch(e){
this.debugManager.output(_32,_33,"TRY/CATCH - "+e.message,"error");
return false;
}
});
}
return new Constructor();
};
}


