DynaWindow=function(_2){this._b=DynaWindow.instances.length;DynaWindow.instances[this._b]=this;this._1d='DynaWindow.instances['+this._b+']';this._5=0;this._4=0;this._g=0;this._j=0;this._Q=false;this._R=false;this._S=true;this._M=false;this._X=true;this._Y=false;this._Z=false;this._W=false;this._V=false;this._2=_2;this._8=null;this._3={};this._a=null;this._A=null;this._$=null;this._18=false;this._o=null;this._l=null};DynaWindow.instances=[];DynaWindow.largestZIndex=1;DynaWindow._O={};DynaWindow._E=null;DynaWindow._N='DynaWindow_hiddenIframeId';DynaWindow._G=null;DynaWindow._P=null;DynaWindow._J=false;DynaWindow._12=null;DynaWindow._13=null;DynaWindow._16=null;DynaWindow._11=null;DynaWindow._14=null;DynaWindow._15=null;DynaWindow.create=function(_2){if(DynaWindow.instances.length==0)window.setInterval('DynaWindow._1F()',40);if(!DynaWindow._15)DynaWindow._15=window.setInterval("DynaWindow.$propagateEventHandlers()",1000);var _d=new DynaWindow(_2);_d.moveTo(_2.left,_2.top,_2.relativeToViewport);_d.resizeTo(_2.width,_2.height);if(_2.preventRightClick)_d.disableRightClick();return _d};DynaWindow.handleEvent=function(_C,_i,_1){var _d=!DynaWindow.instances[_C]||DynaWindow.instances[_C]._1i(_i,_1);if(_1&&!_d)DynaWindow._p(_1);return _d};DynaWindow.handleButton=function(_C,_k,_i,_1){var _d=!DynaWindow.instances[_C]||DynaWindow.instances[_C]._1t(_k,_i,_1);if(_1&&!_d)DynaWindow._p(_1);return _d};DynaWindow._p=function(_1){if(_1){if(_1.stopPropagation)_1.stopPropagation();_1.cancelBubble=true}};DynaWindow._1w=function(_1v){this._O[_1v._b]=true;if(!DynaWindow._E)DynaWindow._E=window.setTimeout('DynaWindow._s()',1)};DynaWindow._s=function(){window.clearTimeout(DynaWindow._E);DynaWindow._E=null;for(var _b in DynaWindow._O)DynaWindow.instances[_b]._s();this._O={}};DynaWindow._1F=function(){if(DynaWindow._12!=DynaWindow._h()||DynaWindow._13!=DynaWindow._f()||DynaWindow._16!=DynaWindow._t()||DynaWindow._11!=DynaWindow._q()){DynaWindow._12=DynaWindow._h();DynaWindow._13=DynaWindow._f();DynaWindow._16=DynaWindow._t();DynaWindow._11=DynaWindow._q();DynaWindow._1x()}};DynaWindow._1x=function(){clearTimeout(DynaWindow._14);DynaWindow._14=setTimeout('DynaWindow.$invalidateDriftingWindows()',200)};DynaWindow.$propagateEventHandlers=function(){for(var i=0;i<DynaWindow.instances.length;i++)if(DynaWindow.instances[i].isRightClickDisabled())DynaWindow.instances[i]._1e()};DynaWindow.$invalidateDriftingWindows=function(){for(var i=0;i<DynaWindow.instances.length;i++)if(DynaWindow.instances[i]._I())DynaWindow.instances[i]._e()};DynaWindow._1s=function(){if(!DynaWindow._J)return;DynaWindow._J=false;var _9=document.getElementsByTagName('iframe');for(var i=0;i<_9.length;i++)if(!_1y(_9[i]._F)&&_9[i]._F!==null){_9[i].style.visibility=_9[i]._F;_9[i]._F=null}};DynaWindow._1B=function(_1G){if(DynaWindow._J)return;DynaWindow._J=true;var _9=document.getElementsByTagName('iframe');for(var i=0;i<_9.length;i++)if(_9[i].style.visibility!='hidden'&&_9[i].id!=DynaWindow._N){_9[i]._F=_9[i].style.visibility;_9[i].style.visibility='hidden'}};DynaWindow._h=function(){return document.body.parentNode.scrollLeft||document.body.scrollLeft};DynaWindow._f=function(){return document.body.parentNode.scrollTop||document.body.scrollTop};DynaWindow._1A=function(){return document.body.parentNode.scrollWidth};DynaWindow._1z=function(){return Math.max(document.body.scrollHeight,document.body.parentNode.scrollHeight)};DynaWindow._t=function(){return document.body.parentNode.clientWidth||document.body.clientWidth};DynaWindow._q=function(){return document.body.parentNode.clientHeight||document.body.clientHeight};DynaWindow._u=function(){if(!DynaWindow._G)if(window.opera)DynaWindow._G=DynaWindow.create({templates:{background:'<div style="width: 100%; height: 100%; background: url(data:image/gif;base64,R0lGODlhCAAIAIABAP///////yH5BAEAAAEALAAAAAAIAAgAAAIMDIxwi5nM3IKNKhkKADs=);"></div>'}});else DynaWindow._G=DynaWindow.create({templates:{background:'<div style="width: 100%; height: 100%; background-color: white; -moz-opacity: 0.7; filter: progid:DXImageTransform.Microsoft.Alpha(opacity=70);"></div>'}});return DynaWindow._G};DynaWindow._r=function(){if(!DynaWindow._P)DynaWindow._P=DynaWindow.create({left:-10000,top:-10000,width:1,height:1,templates:{background:''}});return DynaWindow._P};DynaWindow.prototype={getLeft:function(){return this._5},setLeft:function(_,_v){if(_v)_+=DynaWindow._h();if(this._5!=_){this._5=_;this._e()}},getTop:function(){return this._4},setTop:function(_,_v){if(_v)_+=DynaWindow._f();if(this._4!=_){this._4=_;this._e()}},moveTo:function(_5,_4,_v){this.setLeft(_5,_v);this.setTop(_4,_v)},moveBy:function(_1u,_1f){this.setLeft(this.getLeft()+_1u);this.setTop(this.getTop()+_1f)},moveToCenter:function(){this.setLeft((DynaWindow._t()-this.getWidth())>>1);this.setTop((DynaWindow._q()-this.getHeight())>>1);if(!this._I())this.moveBy(DynaWindow._h(),DynaWindow._f())},getWidth:function(){return this._g},setWidth:function(_){if(this._2.minWidth)_=Math.max(_,this._2.minWidth);if(this._g!=_){this._g=_;this._e()}},getHeight:function(){return this._j},setHeight:function(_){if(this._2.minHeight)_=Math.max(_,this._2.minHeight);if(this._j!=_){this._j=_;this._e()}},resizeTo:function(_g,_j){this.setWidth(_g);this.setHeight(_j)},resizeBy:function(_1j,_1r){this.setWidth(this.getWidth()+_1j);this.setHeight(this.getHeight()+_1r)},fitContent:function(){this._s();if(this._3.content){this._3.content.style.width='auto';this._3.content.style.height='auto';var _7=this._K('content'),_g=this._3.content.firstChild.offsetWidth+_7[1]+_7[3],_j=this._3.content.firstChild.offsetHeight+_7[0]+_7[2];this.setWidth(_g);this._s();if(this._3.title){_7=this._K('title');_j+=_7[0]+_7[2]+this._3.title.offsetHeight};this.setHeight(_j);this._s()}},fitContentPeriodically:function(_1h){this.fitContent();this._1g=window.setInterval(this._1d+'.fitContent()',_1h||1000)},stopContentFitting:function(){window.clearInterval(this._1g)},isVisible:function(){return this._Q},setVisibility:function(_){if(this._Q!=_){if(!_)this.disableModality();this._Q=_;this._e()}},show:function(){this.setVisibility(true)},hide:function(){this.setVisibility(false)},toggleVisibility:function(){this.setVisibility(!this.isVisible())},isDrifting:function(){return this._R},_I:function(){return this.isDrifting()||this.isMaximized()},setDrifting:function(_){if(this._R!=_){this._R=_;if(_)this.moveTo(this.getLeft()-DynaWindow._h(),this.getTop()-DynaWindow._f());else this.moveTo(this.getLeft()+DynaWindow._h(),this.getTop()+DynaWindow._f());this._e()}},enableDrifting:function(){this.setDrifting(true)},disableDrifting:function(){this.setDrifting(false)},toggleDrifting:function(){this.setDrifting(!this.isDrifting())},isRightClickDisabled:function(){return this._18},setRightClickDisabling:function(_){this._18=_},disableRightClick:function(){this.setRightClickDisabling(true)},enableRightClick:function(){this.setRightClickDisabling(false)},toggleRightClickDisabling:function(){this.setRightClickDisabling(!this.isRightClickDisabled())},isMobile:function(){return this._S},setMobility:function(_){if(this._S!=_){if(!_)this.stopMoving();this._S=_}},enableMobility:function(){this.setMobility(true)},disableMobility:function(){this.setMobility(false)},toggleMobility:function(){this.setMobility(!this.isMobile())},isMoving:function(){return this._M},startMoving:function(_1){if(_1.button!=2&&this.isMobile()&&!this.isMoving()&&!this.isMaximized()){this._M=true;if(_1.srcElement&&_1.srcElement.setCapture){this._o=_1.srcElement;this._o.setCapture()}else{this._o=null;DynaWindow._1B()};this.moveToTop();var _D=this;if(!this._a)this._a={_U:function(_1){return DynaWindow._p(_1||window.event)},__:function(_1){return DynaWindow._p(_1||window.event)},_n:function(_1){return _D._n(_1||window.event)},_m:function(_1){return _D._m(_1||window.event)}};if(document.addEventListener){document.addEventListener('mousemove',this._a._n,false);document.addEventListener('mouseup',this._a._m,true)}else{this._y={_U:document.onselectstart,__:document.ondrag,_n:document.onmousemove,_m:document.onmouseup};document.onselectstart=this._a._U;document.ondrag=this._a.__;document.onmousemove=this._a._n;document.onmouseup=this._a._m};this._H={_5:this._5-_1.screenX,_4:this._4-_1.screenY}}},stopMoving:function(){if(this.isMoving()){this._M=false;if(this._o){if(this._o.releaseCapture)this._o.releaseCapture();this._o=null}else DynaWindow._1s();if(document.addEventListener&&this._a){document.removeEventListener('mousemove',this._a._n,false);document.removeEventListener('mouseup',this._a._m,true)}else{document.onselectstart=this._y._U;document.ondrag=this._y.__;document.onmousemove=this._y._n;document.onmouseup=this._y._m;this._y=null};if(this._l)this._l.stopResizing()}},isResizable:function(){return this._X},setResizability:function(_){if(this._X!=_){if(!_)this.stopResizing();this._X=_}},enableResizing:function(){this.setResizability(true)},disableResizing:function(){this.setResizability(false)},toggleResizing:function(){this.setResizability(!this.isResizable())},isResizing:function(){return this._Y},startResizing:function(_1){if(_1.button!=2&&this.isResizable()&&!this.isResizing()&&!this.isMaximized()){this._Y=true;this._$=[this.getLeft(),this.getTop(),this.getWidth(),this.getHeight()];DynaWindow._r()._l=this;DynaWindow._r().moveToTop();DynaWindow._r().show();DynaWindow._r().startMoving(_1)}},stopResizing:function(){if(this.isResizing()){this._Y=false;DynaWindow._r().hide();DynaWindow._r()._l=null}},isContracted:function(){return this._Z},setContraction:function(_){if(this._Z!=_){this._Z=_;this._e()}},contract:function(){this.setContraction(true)},expand:function(){this.setContraction(false)},toggleContraction:function(){this.setContraction(!this.isContracted())},isModal:function(){return this._W},setModality:function(_){if(this._W!=_){if(_){DynaWindow._u().moveTo(0,0);DynaWindow._u().moveToTop();DynaWindow._u().resizeTo(DynaWindow._1A(),DynaWindow._1z());DynaWindow._u().show();this.moveToTop()}else{DynaWindow._u().hide();DynaWindow._u().moveTo(-10000,-10000)};this._W=_;this._e()}},enableModality:function(){this.setModality(true)},disableModality:function(){this.setModality(false)},toggleModality:function(){this.setModality(!this.isModal())},isMaximized:function(){return this._V},setMaximization:function(_){if(_!=this._V){this.stopMoving();this.expand();this._V=_;if(_)this._A=[this.getLeft(),this.getTop(),this.getWidth(),this.getHeight()];else{this.moveTo(this._A[0],this._A[1]);this.resizeTo(this._A[2],this._A[3])};this._e()}},maximize:function(){this.setMaximization(true)},restore:function(){this.setMaximization(false)},toggleMaximization:function(){this.setMaximization(!this.isMaximized())},moveToTop:function(){this._1c().style.zIndex=DynaWindow.largestZIndex++},_e:function(){DynaWindow._1w(this)},_s:function(){function _1b(_6,_5,_4){if(_6){_6.style.left=_5+'px';_6.style.top=_4+'px'}};function _10(_6,_){if(_6)_6.style.width=Math.max(0,_)+'px'};function _1a(_6,_){if(_6)_6.style.height=Math.max(0,_)+'px'};if(this.isMaximized()){this.moveTo(0,0);this.resizeTo(DynaWindow._t(),DynaWindow._q())};var _z=this._1c().style;var _7=this._K('title');var _19=this.isContracted()?this.getHeight()-((this._3.title||{}).offsetHeight||0)-_7[0]-_7[2]:0;_z.visibility=this.isVisible()?'visible':'hidden';_z.left=(this.getLeft()+(this._I()?DynaWindow._h():0))+'px';_z.top=(this.getTop()+(this._I()?DynaWindow._f():0))+'px';_z.width=this.getWidth()+'px';_z.height=(this.getHeight()-_19)+'px';_1b(this._3.title,_7[3],_7[0]);_10(this._3.title,this.getWidth()-_7[1]-_7[3]);var _x=this._K('content');_1b(this._3.content,_x[3],_x[0]+(this._3.title&&this._3.title.offsetHeight+_7[0]+_7[2]||0));_10(this._3.content,this.getWidth()-_x[1]-_x[3]);_1a(this._3.content,this.getHeight()-_x[0]-_x[2]-(this._3.title&&this._3.title.offsetHeight+_7[0]+_7[2]||0));(this._3.content||{style:{}}).style.visibility=this.isContracted()?'hidden':'inherit';_10(this._3.background,this.getWidth());_1a(this._3.background,this.getHeight()-_19);if(this._2.buttons)for(var _k in this._2.buttons)(document.getElementById(this._T(_k))||{}).src=this._L(_k,false)},_1i:function(_i,_1){return this._2.handlers&&this._2.handlers[_i]&&this._2.handlers[_i](this,_1)},_1t:function(_k,_i,_1){switch(_i){case'onmouseover':case'onmouseout':(document.getElementById(this._T(_k))||{}).src=this._L(_k,_i=='onmouseover');break;case'onmousedown':var _2=this._2.buttons&&this._2.buttons[_k];if(_2&&_2.onclick){_2.onclick(this);this._s()};break};return false},_n:function(_1){if(this._l){this._l.resizeTo(this._l._$[2]+this._H._5-this._5+_1.screenX,this._l._$[3]+this._H._4-this._4+_1.screenY)}else{var _5=this._H._5+_1.screenX,_4=this._H._4+_1.screenY;var _w=20;if(this.isDrifting()){_5=Math.max(_w-this._g,_5);_4=Math.max(0,_4);_5=Math.min(DynaWindow._t()-_w,_5);_4=Math.min(DynaWindow._q()-_w,_4)}else{_5=Math.max(DynaWindow._h()+_w-this._g,_5);_4=Math.max(DynaWindow._f(),_4);_5=Math.min(DynaWindow._h()+DynaWindow._t()-_w,_5);_4=Math.min(DynaWindow._f()+DynaWindow._q()-_w,_4)};this.moveTo(_5,_4)};DynaWindow._p(_1);return false},_m:function(_1){this.stopMoving();DynaWindow._p(_1);return false},_1c:function(){if(!this._8){var _1k=this;this._8=document.createElement('div');this._8.oncontextmenu=function(_1){if(!_1)_1=eval('event');if(_1k.isRightClickDisabled()){DynaWindow._p(_1);return false};return true};this._8.style.position='absolute';this._8.style.visibility='hidden';this._8.style.zIndex=DynaWindow.largestZIndex++;if(!window.opera)this._8.innerHTML='<iframe id="'+DynaWindow._N+'" tabindex="-1" frameborder="0" src="javascript:false" scroll="none" style="filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);width:100%;height:100%;"></iframe>';document.body.appendChild(this._8);for(var _6 in this._2.templates){this._3[_6]=document.createElement('div');this._3[_6].style.position='absolute';this._3[_6].innerHTML=this._1l(_6);this._3[_6].style.left=0;this._3[_6].style.top=0;this._3[_6].style.overflow='hidden';this._8.appendChild(this._3[_6])}};return this._8},_1l:function(_6){var _D=this;function _1p(_1E,_1q,_17){switch(_1q){case'handler':return'return DynaWindow.handleEvent('+_D._b+', \''+_17+'\', window.event || arguments[0]);';case'button':return _D._1o(_17);default:return''}};return this._2.templates[_6].replace(/\{(\w+):(\w+)\}/g,_1p)},_1o:function(_c){var _2=this._2.buttons&&this._2.buttons[_c];if(!_2)return'';return'<img id="'+this._T(_c)+'" src="'+this._L(_c,false)+'" width="'+_2.size[0]+'" height="'+_2.size[1]+'" alt="'+_2.tip+'" title="'+_2.tip+'" onmouseover="return DynaWindow.handleButton('+this._b+', \''+_c+'\', \'onmouseover\', window.event || arguments[0]);" onmousedown="return DynaWindow.handleButton('+this._b+', \''+_c+'\', \'onmousedown\', window.event || arguments[0]);" onmouseout="return DynaWindow.handleButton('+this._b+', \''+_c+'\', \'onmouseout\', window.event || arguments[0]);" />'},_T:function(_c){return DynaWindow._N+'_'+this._b+'_button_'+_c},_L:function(_c,_1n){var _2=this._2.buttons&&this._2.buttons[_c];if(!_2)return'';return _2[_2.onupdate?_2.onupdate(this):'images'][_1n?1:0]},_K:function(_1m){return this._2.padding&&this._2.padding[_1m]||[0,0,0,0]},_1e:function(){if(this._8){var _B=this._8.getElementsByTagName('IFRAME');for(var i=0;i<_B.length;i++){try{if(_B[i].contentWindow&&_B[i].contentWindow.document){_B[i].contentWindow.document.onmousedown=this._8.onmousedown;_B[i].contentWindow.document.oncontextmenu=this._8.oncontextmenu}}catch(e){}}}}};function _1y(_){return typeof _=='undefined'};function _1D(_){return typeof _=='number'};function _1C(_){return typeof _=='string'}

DynaWindow._showIframes = DynaWindow._1s;
DynaWindow._hideIframes = DynaWindow._1B;

var x = 40, y = 40, dWin = null, dWinPopUp = null;

function createDynaWindow(contentFile)
{
    if (!dWin)
    {
                
        var winWidth = 500;
        var winHeight = 450;
        dWin = DynaWindow.create(
            {
                preventRightClick:true,
                relativeToViewport:true,
                left:x,
                top:y,
                minWidth:150,
                minHeight:150,
                width:winWidth,
                height:winHeight,
                templates:
                {
                    background:'<table class="background" cellspacing="5"><tr><td>&nbsp;</td></tr></table>',
                    title:
                        '<div class="wintitle" onmousedown="{handler:onstartmoving}">'
                        + '<div class="winbuttons">'
                        + '{button:collapse}'
                        + '{button:close}'
                        + '</div>'
                        + 'Close Up'
                        + '</div>',
                        content:'<img id="contentImage" src="' + contentFile + '" />'
                    //content:'<iframe frameborder="0" class="content" src="' + contentFile + '"></iframe>'
                },
                padding:
                {
                    content:[ 0, 5, 5, 5 ]
                },
                buttons:
                {
                    close:
                    {
                        size:[ 17, 17 ],
                        images:[ 'images/winclose_out.gif', 'images/winclose_over.gif' ],
                        tip:'Close',
                        onclick:function (_window)
                        {
                            _window.hide();
                        }
                    },
                    collapse:
                    {
                        size:[ 17, 17 ],
                        images1:[ 'images/collapse_out.gif', 'images/collapse_over.gif' ],
                        images2:[ 'images/collapse_over.gif', 'images/collapse_out.gif' ],
                        tip:'Contract/Expand',
                        onupdate:function (_window)
                        {
                            return _window.isContracted() ? 'images2' : 'images1';
                        },
                        onclick:function (_window)
                        {
                            _window.toggleContraction();
                        }
                    }
                },
                handlers:
                {
                    onstartmoving:function (_window, _event)
                    {
                        _window.moveToTop();
                        _window.startMoving(_event);
                        return false;
                    },
                    ontogglecontraction:function (_window)
                    {
                        _window.toggleContraction();
                        return false;
                    },
                    onclose:function (_window)
                    {
                        _window.hide();
                        return false;
                    }
                }
            }
        );

        dWin.fitContentPeriodically();
    }
    else
    {
        document.getElementById('contentImage').src = contentFile;
    }

    dWin.show();
    dWin.enableModality();

}

function createDynaWindowPopUp(contentFile, wHeight, wWidth, title, video)
{
    if (!dWinPopUp)
    {
                
        var winWidth = wWidth;
        var winHeight = wHeight;
        dWinPopUp = DynaWindow.create(
            {
                preventRightClick:true,
                relativeToViewport:true,
                left:x,
                top:y,
                minWidth:150,
                minHeight:150,
                width:winWidth,
                height:winHeight,
                templates:
                {
                    background:'<table class="background" cellspacing="5"><tr><td>&nbsp;</td></tr></table>',
                    title:
                        '<div class="wintitle" onmousedown="{handler:onstartmoving}">'
                        + '<div class="winbuttons">'
                        + '{button:collapse}'
                        + '{button:close}'
                        + '</div>'
                        + title
                        + '</div>',
						content:'<iframe frameborder="0" id="ContentFile" class="content" src="' + contentFile + '"></iframe>'
                        //content:'<img id="contentImage" src="' + contentFile + '" />'
                },
                padding:
                {
                    content:[ 0, 5, 5, 5 ]
                },
                buttons:
                {
                    close:
                    {
                        size:[ 17, 17 ],
                        images:[ 'images/winclose_out.gif', 'images/winclose_over.gif' ],
                        tip:'Close',
                        onclick:function (_window)
                        {
                            document.getElementById('ContentFile').src = 'javascript:false';
                            _window.hide();
                            dWinPopUp = null;
                        }
                    },
                    collapse:
                    {
                        size:[ 17, 17 ],
                        images1:[ 'images/collapse_out.gif', 'images/collapse_over.gif' ],
                        images2:[ 'images/collapse_over.gif', 'images/collapse_out.gif' ],
                        tip:'Contract/Expand',
                        onupdate:function (_window)
                        {
                            return _window.isContracted() ? 'images2' : 'images1';
                        },
                        onclick:function (_window)
                        {
                            _window.toggleContraction();
                        }
                    }
                },
                handlers:
                {
                    onstartmoving:function (_window, _event)
                    {
                        _window.moveToTop();
                        _window.startMoving(_event);
                        return false;
                    },
                    ontogglecontraction:function (_window)
                    {
                        _window.toggleContraction();
                        return false;
                    },
                    onclose:function (_window)
                    {
                        _window.hide();
                        dWinPopUp = null;
                        return false;
                    }
                }
            }
        );

        //dWinPopUp.fitContentPeriodically();
    }
    else
    {
        document.getElementById('ContentFile').src = contentFile;
    }

	if (dWinPopUp)
	{
		dWinPopUp.enableModality();
		dWinPopUp.show();
                DynaWindow._hideIframes();
                setTimeout(DynaWindow._showIframes, 1);
	}

}
