var g_divPopups=[],g_divPopupStack=[];function _getTopWindow(){var a=null;try{if(top.g_divPopups)a=top}catch(c){}a||(a=getTopWindow());if(typeof a.g_divPopups=="undefined"){a.g_divPopups=[];a.g_divPopupStack=[]}return a}
function hideDivPopup(a){var c=_getTopWindow();if(popup=c.g_divPopups[a]){if(popup.cloned!=undefined&&popup.cloned){popup.cloned.style.display="none";window.document.body.appendChild(popup.cloned)}var e=c.g_divPopupStack;e.pop();var h=getLastPopup();h&&h.wnd&&h.wnd.focus();if(popup.divOuter){var g=getFirstPopup();if(g)g.divOuter=popup.divOuter;else popup.divOuter.parentNode.removeChild(popup.divOuter);popup.divOuter=null}if(popup.shadows){popup.shadows.parentNode.removeChild(popup.shadows);popup.shadows=
null}if(popup.wnd){popup.wnd.close();c.g_divPopups[a]=null}else{popup.obj.parentNode.removeChild(popup.obj);!browser.isIE&&popup.oldFocus?popup.oldFocus.focus():fixIEFocus()}popup.resizeHandler&&window_detachEvent("onresize",popup.resizeHandler);c.g_divPopups[a]=null;if((a=c.g_divPopups[e[0]])&&a.divOuter&&h&&(typeof g_useRealPopups=="undefined"||!g_useRealPopups)){a.divOuter.parentNode.insertBefore(a.divOuter,h.shadows||h.obj);a.divOuter.style.zIndex=h.shadows?h.shadows.style.zIndex:0}}}
function getDivPopup(a){var c=_getTopWindow();return c.g_divPopups[a]?c.g_divPopups[a].obj:false}function getDivPopupFromWindow(a){var c=_getTopWindow(),e;for(e in c.g_divPopups)if(c.g_divPopups[e]&&c.g_divPopups[e].wndHandle==a)return c.g_divPopups[e].obj;return false}function getPopupPosition(a){a=a.getElementsByTagName("iframe")[0];return getObjectPosition(a)}
function divpopup_createIframe(a,c){var e=a.createElement("iframe");e.style.width=c.width+"px";e.style.height=c.height+"px";e.style.border="none";e.frameBorder="0";e.vSpace="0";e.hSpace="0";e.scrolling="no";var h=function(g){var f=g||window.event;if((f.keyCode||f.which)==27){c.onClose&&c.onClose(c.id);_getTopWindow().hideDivPopup(c.id);cancelEvent(g);return false}};window.setTimeout(function(){e.src=c.url},0);e.attachEvent&&c.pass&&e.attachEvent("onload",function(){var g=e.contentWindow?e.contentWindow:
e;window_attachEvent("onkeyup",h,g);typeof g.document.attachEvent!="undefined"&&g.document.attachEvent("onkeyup",h);window_attachEvent("onfocus",function(){movePopupToTop(c.id)},g);var f=_getTopWindow();if(c.id&&f.g_divPopups[c.id])f.g_divPopups[c.id].wndHandle=g;for(var l in c.pass)if(l!="onload")g[l]=c.pass[l];c.pass.onload&&c.pass.onload(g)});return e}
function getLastPopup(){var a=_getTopWindow();if(a.g_divPopupStack.length==0)return null;return a.g_divPopups[a.g_divPopupStack[a.g_divPopupStack.length-1]]}function getFirstPopup(){var a=_getTopWindow();if(a.g_divPopupStack.length==0)return null;return a.g_divPopups[a.g_divPopupStack[0]]}function movePopupToTop(){}
function divPopup(a,c,e,h,g,f){var l=typeof g=="undefined"?null:g,o=f&&f.url&&f.width&&f.height&&(typeof g_useRealPopups!="undefined"&&g_useRealPopups||f.useRealPopup),m=o?document:getTop().document,b=typeof f=="undefined"?{}:f;if(typeof a=="string")b.id=a;if(b.doc)m=b.doc;var q=_getTopWindow(),t=getFirstPopup();if(f=(!t||!t.divOuter)&&!b.noOuterDiv?createTotalDiv("black",b.outerDivOpacity?b.outerDivOpacity:10,m,q):null){f.style.zIndex="300000";f.onclick=function(){var d=getLastPopup();d&&d.wnd&&
d.wnd.focus()};m=m.getElementsByTagName("body")[0];m.appendChild(f);if(t)t.divOuter=f}var x=q.g_divPopupStack,y=b.zIndex?b.zIndex:3E5;y+=x.length*3;(m=x.length>=1?x[x.length-1]:false)&&!o&&unsetClass(q.g_divPopups[m].obj.firstChild,"ontop");if(t&&t.divOuter&&!o&&!b.noOuterDiv){m=t.divOuter.parentNode;m.appendChild(t.divOuter);t.divOuter.style.zIndex=y}var A=false,B=false;x.push(a);if(o){b.url+=(b.url.search(/\?/)==-1?"?":"&")+"PHPSESSID="+getCookie(typeof g_sessionName!="undefined"?g_sessionName:
"PHPSESSID");g=Math.floor((screen.width-b.width)/2);o=Math.floor((screen.height-b.height)/2);var r=q.open("","popup_"+(h?h.replace(/[^a-zA-Z0-9]/g,"_"):""),"width="+b.width+", height="+b.height+", directories=0, location=0, menubar=0, status=0, toolbar=0, top="+o+", left="+g+(b.resizable?", resizable":""));q.g_divPopups[a]={wnd:r,divOuter:f,resizeHandler:false};r.document.open();r.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>'+
h+"</title><script type='text/javascript' src='"+dircat(common_resource_path,"include/common.js")+"'><\/script></head><body onload='browserCompat(); '></body></html>");r.document.close();var D=r.setInterval(function(){var d=r.document.getElementsByTagName("body")[0];if(d){r.clearInterval(D);d.style.margin="0";d.style.padding="0";l=divpopup_createIframe(r.document,b);d.appendChild(l);d=function(){b.onClose&&b.onClose(a)};var j=function(){var s=r.getScreenDimensions();l.style.width=s.availWidth+"px";
l.style.height=s.availHeight+"px"};if(typeof r.attachEvent!="undefined"){r.attachEvent("onunload",d);r.attachEvent("onresize",j)}else{r.addEventListener("unload",d);r.addEventListener("resize",j)}}},300)}else{var k=getTop().document.createElement("div");k.tabIndex=0;k.style.zIndex=y;k.style.position="absolute";if(typeof b=="undefined")b={};else if(b.url&&b.width&&b.height){b.noIframe=true;b.id=a;l=divpopup_createIframe(getTop().document,b)}if(typeof b.noIframe=="undefined")b.noIframe=true;var i=getTop().document.createElement("div");
setOpacity(k,0);k.appendChild(i);if(o=!b.noIframe?document.createElement("iframe"):null){o.frameBorder="0";o.style.zIndex="-2";o.style.opacity="0";o.src="about: blank;";k.appendChild(o)}i.className="popup ontop";m=getTop().document.getElementsByTagName("body")[0];m.appendChild(k);i.style.backgroundColor="white";i.style.position="absolute";i.style.zIndex=y+1;t=function(){if(i.offsetHeight<89)return false;var d=getTop(),j=function(E){var C=d.document.createElement("div");E.appendChild(C);return C},
s=d.document.createElement("div");s.className="popupShadows";s.style.zIndex=y;var p=d.document.createElement("div");p.style.width=i.offsetWidth+"px";p.className="top";j(j(p));s.appendChild(p);p=d.document.createElement("div");p.style.width=i.offsetWidth+"px";p.className="middle";p.style.height=i.offsetHeight-89+"px";j(p);s.appendChild(p);p=d.document.createElement("div");p.style.width=i.offsetWidth-24+"px";p.className="bottom";j(j(p));s.appendChild(p);d.document.body.insertBefore(s,k);s.style.top=
e+"px";s.style.left=c+"px";return s};var v=false,n=b.noTitle?null:getTop().document.createElement("div"),z=false;m=false;if(n){n.className="title";m=getTop().document.createElement("a");m.className="close";n.appendChild(m);if(b.resizable){m=getTop().document.createElement("a");m.className=b.maximized?"restore":"maximize";n.appendChild(m)}n.innerHTML+=h?h:"Titel";var w={};w.isPopup=true;w.dontCloneNode=true;w.modal=false;w.onDragDone=function(){setOpacity(i,100)};n.onmousedown=function(d){if(v)w.objects=
[v];movePopupToTop(a);d=d?d:getTop().event;var j=d.target?d.target:d.srcElement;getScreenPosX(j);if(j==n&&!z){window.navigator.userAgent.search(/firefox/i)==-1&&setOpacity(i,60);return drag_start(k,d,w)}return true};n.onmouseup=function(d){d=d?d:getTop().event;var j=d.target?d.target:d.srcElement;if(j.className=="close"){b.onClose&&b.onClose(a);hideDivPopup(a);cancelEvent(d);return false}else if(j.className=="maximize"){b.onMaximize&&b.onMaximize(a);A();j.className="restore";return true}else if(j.className==
"restore"){b.onRestore&&b.onRestore(a);B();j.className="maximize";return true}return true};setUnselectable(n);i.appendChild(n)}h=null;h=typeof l=="undefined"||l==null?i.appendChild(document.getElementById(a).cloneNode(true)):i.appendChild(l);h.style.display="";h.style.zIndex=3;q.g_divPopups[a]={obj:k,divOuter:f,resizeHandler:false,oldFocus:getFocussedElement(),cloned:g&&typeof l!="undefined"&&l!=null?l:null};f=getScreenDimensions(getTop());g=i.offsetHeight;if(g<b.height)g=b.height;var u=h.offsetWidth+
14;if(u<b.width)u=b.width;if(typeof c=="undefined"||c==null)c=Math.floor((f.availWidth-u)/2)+f.scrollLeft;else c-=Math.floor(i.offsetWidth/2);if(typeof e=="undefined"||e==null)e=Math.floor((f.availHeight-g)/2)+f.scrollTop;i.style.width=u-14+"px";if(n)n.style.width=u-24+"px";if(e-f.scrollTop+g+30>f.availHeight)e=f.availHeight+f.scrollTop-g-30;if(c-f.scrollLeft+u+30>f.availWidth)c=f.availWidth+f.scrollLeft-u-30;if(c<0)c=0;if(e<0)e=0;if(!browser.isIE||browser.version>6)v=q.g_divPopups[a].shadows=t();
if(o){o.style.width=u+14+"px";o.style.height=g+"px"}k.style.top=e+"px";k.style.left=c+"px";A=function(){var d=q.getScreenDimensions();e=parseInt(k.style.top);c=parseInt(k.style.left);k.style.top=d.scrollTop+"px";k.style.left=d.scrollLeft+"px";var j=d.availWidth+10;i.style.width=j-14+"px";if(n)n.style.width=j-24+"px";l.style.width=j-14+"px";l.style.height=d.availHeight-27+"px";z=true;if(v)v.style.display="none";if(q.g_divPopups[a]&&!q.g_divPopups[a].resizeHandler){q.g_divPopups[a].resizeHandler=function(){z&&
A()};q.window_attachEvent("onresize",q.g_divPopups[a].resizeHandler)}};B=function(){if(z){k.style.top=e+"px";k.style.left=c+"px";i.style.width=u-14+"px";if(n)n.style.width=u-24+"px";l.style.width=b.width+"px";l.style.height=b.height+"px";z=false;if(v){v.style.display="";var d=getObjectPosition(k);v.style.top=d.y+"px";v.style.left=d.x+"px"}}};if((e+i.offsetHeight>f.availHeight||c+i.offsetWidth>f.availWidth)&&b.resizable||b.maximized){A();n.getElementsByTagName("a")[1].className="restore"}setOpacity(k,
100);k.focus();return q.g_divPopups[a].obj}}function getScreenX(a){return a.layerX?a.layerX:a.offsetX+getScreenPosX(a.srcElement)}function getScreenY(a){return a.layerY?a.layerY:a.offsetY+getScreenPosY(a.srcElement)};

