// Juice - Javascript User Interface Common Elements
// Copyright (C) 2007 IP Labs GmbH <http://www.iplabs.de/>
// $Id: ModalBox.js 84386 2009-10-01 11:47:48Z k.reimer $
var HTMLUtils;var Workarounds;
if(HTMLUtils===undefined){alert("ModalBox depends on HTMLUtils");
}if(Workarounds===undefined){alert("ModalBox depends on Workarounds");
}function ModalBox(n){this.q=n;this.s();}ModalBox.w=ModalBox.prototype;
ModalBox.w.q=null;ModalBox.w.r=null;ModalBox.w.absolutePosition=null;
ModalBox.w.functions=null;ModalBox.w.s=function(){this.functions={};
this.r=document.createElement("div");this.r.className="modalboxOverlayMask";
this.r.style.position="absolute";this.r.style.left=0;this.r.style.top=0;
this.r.style.zIndex=99;this.r.style.display="none";
this.q.parentNode.removeChild(this.q);this.q.style.position="absolute";
this.q.style.visibility="hidden";this.q.style.display="block";
this.q.style.zIndex=100;this.q.style.left=0;this.q.style.top=0;
this.q.modalBox=this;document.body.appendChild(this.r);
document.body.appendChild(this.q);};
ModalBox.w.open=function(){ModalBox.latestBox=this;Workarounds.maskElements();
this.u();this.v();};ModalBox.w.t=function(){var _,a;
if(window.innerHeight&&window.scrollMaxY){_=document.body.scrollWidth;
a=window.innerHeight+window.scrollMaxY;
}else if(document.body.scrollHeight>document.body.offsetHeight){_=document.body.scrollWidth;
a=document.body.scrollHeight;
}else if(document.documentElement&&document.documentElement.scrollHeight>document.documentElement.offsetHeight){_=document.documentElement.scrollWidth;
a=document.documentElement.scrollHeight;}else{_=document.body.offsetWidth;
a=document.body.offsetHeight;}return{"width":_,"height":a};};
ModalBox.w.u=function(){var b=this.t();this.r.style.left=0;this.r.style.top=0;
this.r.style.width=b.width+"px";this.r.style.height=b.height+"px";
this.r.style.display="block";};ModalBox.w.v=function(){var c,d,e,f;var _,a;
var i,j;var k,l;var m;e=this.q.offsetWidth;f=this.q.offsetHeight;
if(this.absolutePosition!==null){c=this.absolutePosition.x;
d=this.absolutePosition.y;
}else{m={"innerWidth":0,"innerHeight":0,"scrollLeft":0,"scrollTop":0};
if(self.innerHeight){m.innerWidth=self.innerWidth;
m.innerHeight=self.innerHeight;
if(self.pageYOffset!==undefined){m.scrollLeft=self.pageXOffset;
m.scrollTop=self.pageYOffset;
}}else if(document.documentElement&&document.documentElement.clientHeight){m.innerWidth=document.documentElement.clientWidth;
m.innerHeight=document.documentElement.clientHeight;
if(document.documentElement.scrollTop!==undefined){m.scrollLeft=document.documentElement.scrollLeft;
m.scrollTop=document.documentElement.scrollTop;
}}else if(document.body&&document.body.clientHeight){m.innerWidth=document.body.clientWidth;
m.innerHeight=document.body.clientHeight;
if(document.body.scrollTop!==undefined){m.scrollLeft=document.body.scrollLeft;
m.scrollTop=document.body.scrollTop;
}}c=m.innerWidth?((m.innerWidth-e)>>1)+m.scrollLeft:0;
d=m.innerHeight?((m.innerHeight-f)>>1)+m.scrollTop:0;}this.q.style.left=c+"px";
this.q.style.top=d+"px";this.q.style.visibility="visible";};
ModalBox.w.close=function(){ModalBox.latestBox=null;this.r.style.display="none";
this.q.style.visibility="hidden";Workarounds.unmaskElements();};
ModalBox.close=function(p){var n;
if(p!==undefined){n=HTMLUtils.getParentByClassName(p,"modalBox").modalBox;
}else{n=ModalBox.latestBox;}n.close();};