/*
 * Advanced Layer Popup 1.04
 * Copyright(c) 2007, DMXzone.
 */


cDomEvent={e:null,type:'',button:0,key:0,x:0,y:0,pagex:0,pagey:0,target:null,from:null,to:null}
cDomEvent.init=function(e)
{if(window.event)e=window.event
this.e=e
this.type=e.type
this.button=(e.which)?e.which:e.button
this.key=(e.which)?e.which:e.keyCode
this.target=(e.srcElement)?e.srcElement:e.originalTarget
this.currentTarget=(e.currentTarget)?e.currentTarget:e.srcElement
this.from=(e.originalTarget)?e.originalTarget:(e.fromElement)?e.fromElement:null
this.to=(e.currentTarget)?e.currentTarget:(e.toElement)?e.toElement:null
this.x=(e.layerX)?e.layerX:(e.offsetX)?e.offsetX:null
this.y=(e.layerY)?e.layerY:(e.offsetY)?e.offsetY:null
this.screenX=e.screenX
this.screenY=e.screenY
this.pageX=(e.pageX)?e.pageX:e.x+document.body.scrollLeft
this.pageY=(e.pageY)?e.pageY:e.y+document.body.scrollTop}
cDomEvent.getEvent=function(e)
{if(window.event)e=window.event
return{e:e,type:e.type,button:(e.which)?e.which:e.button,key:(e.which)?e.which:e.keyCode,target:cDomEvent.getRealNode(e.target||e.srcElement),currentTarget:cDomEvent.getRealNode(e.currentTarget||e.srcElement),from:(e.originalTarget)?e.originalTarget:(e.fromElement)?e.fromElement:null,to:(e.currentTarget)?e.currentTarget:(e.toElement)?e.toElement:null,x:(e.layerX)?e.layerX:(e.offsetX)?e.offsetX:null,y:(e.layerY)?e.layerY:(e.offsetY)?e.offsetY:null,screenX:e.screenX,screenY:e.screenY,pageX:(e.pageX)?e.pageX:(e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),pageY:(e.pageY)?e.pageY:(e.clientY+(document.documentElement.scrollTop||document.body.scrollTop))}}
cDomEvent.getRealNode=function(el)
{if(el&&el.type==3)
{return el.parentNode}
else
{return el}}
cDomEvent.cancelEvent=function(e)
{if(e.preventDefault)
{e.preventDefault()}
e.returnValue=false
e.cancelBubble=true
return false}
cDomEvent.addEvent=function(hElement,sEvent,handler,bCapture)
{if(hElement.addEventListener)
{hElement.addEventListener(sEvent,handler,bCapture)
return true}
else if(hElement.attachEvent)
{return hElement.attachEvent('on'+sEvent,handler)}
else if(document.all||hElement.captureEvents)
{if(hElement.captureEvents)eval('hElement.captureEvents( Event.'+sEvent.toUpperCase()+' )')
eval('hElement.on'+sEvent+' = '+handler)}
else
{alert('Not implemented yet!')}}
cDomEvent.encapsulateEvent=function(hHandler)
{return function(hEvent)
{hEvent=cDomEvent.getEvent(hEvent)
hHandler.call(hEvent.target,hEvent.e)}}
cDomEvent.eventQueue=[];cDomEvent.hQueueTimer=null;cDomEvent.startQueueTimer=function()
{if(cDomEvent.hQueueTimer)
{window.clearTimeout(cDomEvent.hQueueTimer);}
for(var nI=0;nI<cDomEvent.eventQueue;nI++)
{if(cDomEvent.eventQueue[nI])
{cDomEvent.addEvent2(cDomEvent.eventQueue[nI][0],cDomEvent.eventQueue[nI][1],cDomEvent.eventQueue[nI][2],cDomEvent.eventQueue[nI][3])}}
cDomEvent.hQueueTimer=window.setTimeout(cDomEvent.startQueueTimer,100);}
cDomEvent.addEvent2=function(hElement,sEvent,handler,bCapture)
{if(typeof hElement=='string')
{hElement=document.getElementById(hElement)}
if(hElement)
{try
{if(hElement.addEventListener)
{hElement.addEventListener(sEvent,cDomEvent.encapsulateEvent(handler),bCapture)
return true}
else if(hElement.attachEvent)
{return hElement.attachEvent('on'+sEvent,cDomEvent.encapsulateEvent(handler))}
else
{alert('Not implemented!')}}
catch(hException)
{cDomEvent.eventQueue.push([hElement,sEvent,handler,bCapture]);cDomEvent.startQueueTimer()}}
else
{alert('wrong')}}
cDomEvent.DomLoaded={onload:[],loaded:function()
{if(arguments.callee.done)
{return}
arguments.callee.done=true
for(i=0;i<cDomEvent.DomLoaded.onload.length;i++)
{cDomEvent.DomLoaded.onload[i]()}},load:function(handler)
{this.onload.push(handler)
if(document.addEventListener)
{document.addEventListener("DOMContentLoaded",cDomEvent.DomLoaded.loaded,null)}
if(/KHTML|WebKit/i.test(navigator.userAgent))
{var _timer=setInterval(function()
{if(/loaded|complete/.test(document.readyState))
{clearInterval(_timer)
delete _timer
cDomEvent.DomLoaded.loaded()}},10)}
window.onload=cDomEvent.DomLoaded.loaded}}
cDomEvent.removeEvent=function(hElement,sEvent,handler,bCapture)
{if(hElement.addEventListener)
{hElement.removeEventListener(sEvent,handler,bCapture)
return true}
else if(hElement.attachEvent)
{return hElement.detachEvent('on'+sEvent,handler)}
else if(document.all||hElement.captureEvents)
{eval('hElement.on'+sEvent+' = null')}
else
{alert('Not implemented yet!')}}
cDomEvent.customEvent=function(sType,hScope)
{this.sType=sType;this.hScope=hScope||window;this.subscribers=[];this.returnValue=true;this.cancelBubble=false;this.eventData=null;}
cDomEvent.customEvent.prototype={fire:function()
{var hResult=true;this.returnValue=true;this.cancelBubble=false;this.eventData=null;var hArgs=[];var nLen=this.subscribers.length;if(nLen==0)
{return hResult;}
var nI;for(nI=0;nI<arguments.length;nI++)
{hArgs.push(arguments[nI]);}
for(nI=0;nI<nLen;nI++)
{if(this.subscribers[nI])
{var hScope=this.subscribers[nI].bOverride?this.subscribers[nI].hObject:this.hScope;hResult=this.subscribers[nI].hListener.call(hScope,this,hArgs,this.subscribers[nI].hObject);if(this.cancelBubble)
{break;}}}
return hResult;},subscribe:function(hListener,hObject,bOverride)
{this.subscribers.push(new cDomEvent.eventSubscriber(hListener,hObject,bOverride));},unsubscribe:function(hListener,hObject)
{var nLen=this.subscribers.length;for(var nI=0;nI<nLen;nI++)
{if(this.subscribers[nI]&&this.subscribers[nI].contains(hListener,hObject))
{this._delete(nI);return true;}}
return false;},_delete:function(nI)
{var hSub=this.subscribers[nI];if(hSub)
{delete hSub.hListener;delete hSub.hObject;}
this.subscribers.splice(nI,1);}}
cDomEvent.eventSubscriber=function(hListener,hObject,bOverride)
{this.hListener=hListener;this.hObject=hObject||null;this.bOverride=bOverride;}
cDomEvent.eventSubscriber.prototype.contains=function(hListener,hObject)
{if(this.hListener==hListener&&this.hObject==hObject)
{return true;}
return false;}

if(typeof cDomObject=='undefined')
{cDomObject={};(function()
{var ua=navigator.userAgent.toLowerCase();cDomObject.isOpera=(ua.indexOf('opera')>-1);cDomObject.isSafari=(ua.indexOf('safari')>-1);cDomObject.isIE=(window.ActiveXObject);cDomObject.isIE7=cDomObject.isIE&&(ua.indexOf('msie 7')>=0);cDomObject.sDocMode=document.compatMode||'';})();cDomObject.$=function(hElement)
{if(typeof(hElement)=='string')
{return document.getElementById(hElement);}
return hElement;}
cDomObject.getStyle=function(hElement,sStyleSelector)
{hElement=cDomObject.$(hElement);if(typeof(hElement.style[sStyleSelector])!='undefined'&&hElement.style[sStyleSelector]!='')
{return hElement.style[sStyleSelector];}
else if(hElement.currentStyle)
{if(typeof(hElement.currentStyle[sStyleSelector])!='undefined')
{return hElement.currentStyle[sStyleSelector];}}
else if(hElement.ownerDocument&&hElement.ownerDocument.defaultView&&hElement.ownerDocument.defaultView.getComputedStyle)
{var hStyle=hElement.ownerDocument.defaultView.getComputedStyle(hElement,null);if(hStyle)
{if(typeof(hStyle[sStyleSelector])!='undefined')
{return hStyle[sStyleSelector];}}}
return null;}
cDomObject.setStyleValue=function(hElement,sStyleSelector,sStyleValue)
{hElement=cDomObject.$(hElement);hElement.style[sStyleSelector]=sStyleValue;}
if(cDomObject.isIE)
{cDomObject.setStyle=function(hEl,sStyle,sValue)
{if(sStyle=='opacity')
{if(typeof hEl.style.filter=='string')
{hEl.style.filter='alpha(opacity='+parseFloat(sValue)*100+')';if(!hEl.currentStyle||!hEl.currentStyle.hasLayout)
{hEl.style.zoom=1;}}}
else
{sStyle=cDMX.util.toCamelCase(sStyle);hEl.style[sStyle]=sValue;}
return sValue;}}
else
{cDomObject.setStyle=function(hEl,sStyle,sValue)
{sStyle=cDMX.util.toCamelCase(sStyle);hEl.style[sStyle]=sValue;return sValue;}}
cDomObject.setAbsolutePositioned=function(hElement,zIndex)
{cDomObject.setStyleValue(hElement,'position','absolute');if(zIndex)
{cDomObject.setStyleValue(hElement,'z-index',zIndex);}}
cDomObject.setRelativePositioned=function(hElement,zIndex)
{cDomObject.setStyleValue(hElement,'position','relative');if(zIndex)
{cDomObject.setStyleValue(hElement,'z-index',zIndex);}}
cDomObject.getStyleValue=function(hElement,sStyleSelector)
{var sValue=cDomObject.getStyle(hElement,sStyleSelector);var nValue=parseInt(sValue);if(!isNaN(nValue))
{return nValue;}
else
{return null;}}
cDomObject.getLeft=function(hElement)
{hElement=cDomObject.$(hElement);var nLeft=cDomObject.getStyleValue(hElement,'left');if(isNaN(nLeft)||(nLeft==null))
{nLeft=parseInt(hElement.offsetLeft);}
return nLeft;}
cDomObject.getTop=function(hElement)
{hElement=cDomObject.$(hElement);var nTop=cDomObject.getStyleValue(hElement,'top');if(isNaN(nTop)||(nTop==null))
{nTop=parseInt(hElement.offsetTop);}
return nTop;}
cDomObject.getWidth=function(hElement)
{hElement=cDomObject.$(hElement);var nWidth=cDomObject.getStyleValue(hElement,'width');if(isNaN(nWidth)||(nWidth==null))
{nWidth=Math.max(hElement.offsetWidth,hElement.clientWidth);}
return nWidth;}
cDomObject.getHeight=function(hElement)
{hElement=cDomObject.$(hElement);var nHeight=cDomObject.getStyleValue(hElement,'height');if(isNaN(nHeight)||nHeight==null)
{nHeight=Math.max(hElement.offsetHeight,hElement.clientHeight);}
return nHeight;}
cDomObject.getScrollTop=function()
{return document.documentElement.scrollTop||document.body.scrollTop;}
cDomObject.getScrollLeft=function()
{return document.documentElement.scrollLeft||document.body.scrollLeft;}
cDomObject.getViewportHeight=function()
{var nHeight=-1;var mode=document.compatMode;if((mode||cDomObject.isIE)&&!cDomObject.isOpera)
{switch(mode)
{case'CSS1Compat':nHeight=document.documentElement.clientHeight;break;default:nHeight=document.body.clientHeight;}}
else
{nHeight=self.innerHeight;}
return nHeight;}
cDomObject.getViewportWidth=function()
{var nWidth=-1;var mode=document.compatMode;if(mode||cDomObject.isIE)
{switch(mode)
{case'CSS1Compat':nWidth=document.documentElement.clientWidth;break;default:nWidth=document.body.clientWidth;}}
else
{nWidth=self.innerWidth;}
return nWidth;}
cDomObject.getDocumentHeight=function()
{var nHeight=-1;switch(cDomObject.sDocMode)
{case'CSS1Compat':nHeight=document.documentElement.scrollHeight;break;default:nHeight=document.body.scrollHeight;}
return Math.max(nHeight,cDomObject.getViewportHeight());}
cDomObject.getDocumentWidth=function()
{var nWidth=-1;switch(cDomObject.sDocMode)
{case'CSS1Compat':nWidth=document.documentElement.scrollWidth;break;default:nWidth=document.body.scrollWidth;}
return Math.max(nWidth,cDomObject.getViewportWidth());}
cDomObject.hasClass=function(hElement,sClassName)
{if(hElement.className.toLowerCase().indexOf(sClassName.toLowerCase())>=0)
{return true}
else
{return false}}
cDomObject.addNodeClass=function(hElement,sClassName)
{sClassName=sClassName.replace(/^\s*|\s*$/g,'');var sClassNames=hElement.className;var aClassNames=sClassNames.split(' ');for(var nI=0;nI<aClassNames.length;nI++)
{aClassNames[nI]=aClassNames[nI].replace(/^\s*|\s*$/g,'');if(aClassNames[nI]==sClassName)
{return;}}
aClassNames[nI]=sClassName;sClassNames=aClassNames.join(' ');hElement.className=sClassNames;}
cDomObject.removeNodeClass=function(hElement,sClassName)
{sClassName=sClassName.replace(/^\s*|\s*$/g,'');var sClassNames=hElement.className;var aClassNames=sClassNames.split(' ');for(var nI=0;nI<aClassNames.length;nI++)
{aClassNames[nI]=aClassNames[nI].replace(/^\s*|\s*$/g,'');if(aClassNames[nI]==sClassName)
{delete(aClassNames[nI]);}}
sClassNames=aClassNames.join(' ');hElement.className=sClassNames;}
cDomObject.getNodeClasses=function(hElement,sClassName)
{sClassName=sClassName.replace(/^\s*|\s*$/g,'');var sClassNames=hElement.className;var aClassNames=sClassNames.split(' ');if(typeof aClassNames!='object')
{aClasNames=[sClassNames];}
for(var nI=0;nI<aClassNames.length;nI++)
{aClassNames[nI]=aClassNames[nI].replace(/^\s*|\s*$/g,'');if(aClassNames[nI].indexOf(sClassName)<0)
{delete(aClassNames[nI]);}}
return aClassNames.join(' ').replace(/^\s*|\s*$/g,'').split(' ');}
cDomObject.setOpacity=function(sId,nValue)
{var hElement=cDomObject.$(sId);if(hElement)
{try
{if(hElement.filters&&hElement.filters.alpha)
{hElement.filters.alpha.opacity=nValue;}
else if(typeof hElement.style.opacity!='undefined')
{hElement.style.opacity=nValue/100;}
else if(typeof hElement.style.MozOpacity!='undefined')
{hElement.style.MozOpacity=nValue/100;}}
catch(hE)
{return;}}}
cDomObject.Borders={'l':'borderLeftWidth','r':'borderRightWidth','t':'borderTopWidth','b':'borderBottomWidth'}
cDomObject.getBorderWidth=function(hElement,sBorder)
{var nR=0;for(var hI in cDomObject.Borders)
{if(sBorder.indexOf(hI)>=0)
{nR+=cDomObject.getStyleValue(hElement,cDomObject.Borders[hI]);}}
return nR;}
cDomObject.Paddings={'l':'paddingLeft','r':'paddingRight','t':'paddingTop','b':'paddingBottom'}
cDomObject.getPaddingWidth=function(hElement,sPadding)
{var nR=0;for(var hI in cDomObject.Paddings)
{if(sPadding.indexOf(hI)>=0)
{nR+=cDomObject.getStyleValue(hElement,cDomObject.Paddings[hI]);}}
return nR;}}

String.prototype.trim=function()
{var sThis=this.toString()
return sThis.replace(/^\s*|\s*$/g,'')}
cJSExtend={}
cJSExtend.extend=function(cBaseClass,cSubClass)
{function inherit(){};inherit.prototype=cBaseClass.prototype;cSubClass.prototype=new inherit();cSubClass.prototype.constructor=cSubClass;cSubClass.baseConstructor=cBaseClass;cSubClass.baseClass=cBaseClass.prototype;}
cDMX={};cDMX.util=function(){var sUniqueIdPrefix='DMXID_';var nUniqueId=0;dmxUtil={getUniqueId:function()
{return sUniqueIdPrefix+Math.round(Math.random()*10000)+(nUniqueId++);},toCamelCase:function(sString)
{sString=sString.replace(/[\-\.]/g,' ');var aStr=sString.split(' ');for(var nI=0;nI<aStr.length;nI++)
{aStr[nI].replace(/^\s+|\s+$/,'');if(nI>0)
{aStr[nI]=aStr[nI].charAt(0).toUpperCase()+aStr[nI].substr(1);}}
return aStr.join('');},isUndefined:function(hVar)
{if(typeof hVar=='undefined')
{return true;}
else
{return false;}}}
return dmxUtil;}();cDMX.delayedTask=function(hFunction,hScope,hArguments)
{var hTimeout=null;this.delay=function(nDelay)
{if(hTimeout)
{window.clearTimeout(hTimeout);}
hTimeout=window.setTimeout(function(){hFunction.call(hScope,hArguments)},nDelay);return this;}
this.cancel=function()
{if(hTimeout)
{window.clearTimeout(hTimeout);hTimeout=null;}}};cDMX.media=function()
{dmxMedia={createContentEnvelope:function(sContent,nWidth,nHeight)
{var sEnvelope='';var sWHStr='width="'+nWidth+'" height="'+nHeight+'"';if(sContent.match(/(gif|jpg|jpeg|png)$/i))
{sEnvelope='<img src="'+sContent+'" '+sWHStr+' />';}
else if(sContent.match(/\.swf/))
{var aVars=sContent.match(/\.swf\??(.*)$/i);var sParamTag='';var sParam='';if(aVars.length==2)
{sParam='flashvars="'+aVars[1]+'"';sParamTag='<param name="flashvars" value="'+aVars[1]+'"/> ';}
sEnvelope='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http:/'+'/download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" '+sWHStr+'> '+'<param name="movie" value="'+sContent+'"/> '+'<param name="quality" value="high"/> '+'<param name="wmode" value="transparent"/> '+
sParamTag+'<embed wmode="transparent" src="'+sContent+'"  '+sWHStr+' '+sParam+'></embed> '+'</object>';}
else if(sContent.match(/mov$/))
{sEnvelope='<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="320" codebase="http:/'+'/www.apple.com/qtactivex/qtplugin.cab" '+sWHStr+'> '+'<param name="src" value="'+sContent+'"> '+'<param name="autoplay" value="true"> '+'<param name="controller" value="true"> '+'<param name="loop" value="true"> '+'<embed src="'+sContent+'" autoplay="true" '+'controller="true" loop="true" pluginspage="http:/'+'/www.apple.com/quicktime/download/" '+sWHStr+'> '+'</embed> '+'</oject> ';}
else if(sContent.match(/wmv$/))
{sEnvelope='<object id="MediaPlayer" '+sWHStr+' classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player ..." type="application/x-oleobject" codebase="http:/'+'/activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112" '+sWHStr+'> '+'<param name="filename" value="'+sContent+'"> '+'<param name="Showcontrols" value="True"> '+'<param name="autoStart" value="True"> '+'<embed type="application/x-mplayer2" src="'+sContent+'" name="MediaPlayer" '+sWHStr+'></embed> '+'</object> ';}
else
{sEnvelope='<span> '+sContent+'"> '+'</span>';}
return sEnvelope;},calculateContentSize:function()
{}}
return dmxMedia;}();

cDragable=function(hElement)
{hElement=cDomObject.$(hElement);if(!hElement.id)
{hElement.id=cDragable.CS_ID+(cDragable.CN_COUNT++);}
if(!cDomObject.hasClass(hElement,'dragableElement'))
{cDomObject.addNodeClass(hElement,'dragableElement')}
hElement.setAttribute('unselectable','on')
this.sId=hElement.id;this.bDraging=false;this.bResizing=false;this.bResizable=false;if(cDomObject.hasClass(hElement,'elementResizable'))
{this.bResizable=true;}
this.initEventHandlers();}
cDragable.CS_ID='draggable';cDragable.CN_COUNT=0;cDragable.nZIndex=50000;cDragable.CA_MIN_CONSTRAINTS=[100,100];cDragable.CA_DEFAULT_SIZE=[600,520];cDragable.CA_DEFAULT_POSITION=['center','center'];cDragable.hPagePos={x:0,y:0};cDragable.dragQueue={};cDragable.dragQueue.nCount=0;cDragable.prototype.initEventHandlers=function(bIEOnly)
{var hElement=document.getElementById(this.sId);var hDragEl=this;if(typeof bIEOnly=='undefined')
{bIEOnly=false;}
if(hElement.addEventListener&&!bIEOnly)
{hElement.addEventListener('mousedown',function(e){hDragEl.onMouseDown(e);},false);hElement.addEventListener('mouseup',function(e){hDragEl.onMouseUp(e);},false);hElement.addEventListener('selectstart',function(e){hDragEl.onSelectStart(e);},false);}
else if(hElement.attachEvent)
{hElement.attachEvent('onmousedown',function(){var e=window.event;hDragEl.onMouseDown(e);});hElement.attachEvent('onmouseup',function(){var e=window.event;hDragEl.onMouseUp(e);});hElement.attachEvent('onselectstart',function(){var e=window.event;hDragEl.onSelectStart(e);});hElement.attachEvent('ondragstart',function(){return false;});}}
cDragable.prototype.onMouseDown=function(e)
{var hElement=document.getElementById(this.sId);var hTarget=e.srcElement||e.originalTarget;if(hElement.getAttribute('draghandle'))
{if(hTarget.className!='resizeHandle')
{if(!hTarget.id||(hTarget.id&&hElement.getAttribute('draghandle').indexOf(hTarget.id)<0))
{return;}}}
this.bDraging=true;var nZIndex=cDomObject.getStyleValue(hElement,'zIndex');if(nZIndex==null)
{nZIndex=cDragable.nZIndex++;}
else
{nZIndex++;}
hElement.style.zIndex=nZIndex;if(hTarget.className=='resizeHandle')
{this.bResizing=true;}
else
{this.bResizing=false;}
var elementpos={x:0,y:0};elementpos.x=e.layerX||e.offsetX;elementpos.y=e.layerY||e.offsetY;var pagepos={x:0,y:0};if(e.pageX||e.pageY)
{pagepos.x=e.pageX;pagepos.y=e.pageY;}
else if(e.clientX||e.clientY)
{pagepos.x=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;pagepos.y=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;}
cDragable.hPagePos=pagepos;cDragable.registerDragable(this);if(typeof cDomObject!='undefined')
{cDomObject.addNodeClass(hElement,'dmxMoving');if(this.bResizing)
{cDomObject.addNodeClass(hElement,'dmxResizing');}}}
cDragable.prototype.onMouseUp=function(e)
{cDragable.onMouseUp(e);}
cDragable.prototype.onSelectStart=function(e)
{e.cancelBubble=true;e.returnValue=false;return false;}
cDragable.prototype.move=function(dX,dY)
{var layerpos={x:0,y:0};layerpos.x=cDomObject.getLeft(this.sId);layerpos.y=cDomObject.getTop(this.sId);var hElement=document.getElementById(this.sId);hElement.style.left=(layerpos.x+dX)+'px';hElement.style.top=(layerpos.y+dY)+'px';var hRet=[true,true];return hRet;}
cDragable.prototype.resize=function(dX,dY)
{var hRet=[true,true];var layersize={w:0,h:0};layersize.w=cDomObject.getWidth(this.sId);layersize.h=cDomObject.getHeight(this.sId);var hElement=document.getElementById(this.sId);var nW=layersize.w+dX;var nH=layersize.h+dY;if(nW<cDragable.CA_MIN_CONSTRAINTS[0])
{hRet[0]=false;}
else
{hElement.style.width=(layersize.w+dX)+'px';}
if(nH<cDragable.CA_MIN_CONSTRAINTS[1])
{hRet[1]=false;}
else
{hElement.style.height=(layersize.h+dY)+'px';}
if(hElement.ondragresize)
{hElement.ondragresize.call(this,this.sId);}
return hRet;}
cDragable.prototype.stop=function()
{var hElement=document.getElementById(this.sId);this.bDraging=false;this.bResizing=false;if(typeof cDomObject!='undefined')
{cDomObject.removeNodeClass(hElement,'dmxMoving');cDomObject.removeNodeClass(hElement,'dmxResizing');}}
cDragable.registerDragable=function(hDragable)
{cDragable.dragQueue[hDragable.sId]=hDragable;cDragable.dragQueue.nCount++;}
cDragable.emptyQueue=function(hDraggable)
{for(var hI in cDragable.dragQueue)
{if(typeof cDragable.dragQueue[hI]=='object')
{cDragable.dragQueue[hI].stop();delete(cDragable.dragQueue[hI]);cDragable.dragQueue.nCount--;}}}
cDragable.findResizing=function()
{for(var hI in cDragable.dragQueue)
{if(typeof cDragable.dragQueue[hI]=='object'&&cDragable.dragQueue[hI].bResizing)
{return cDragable.dragQueue[hI];}}}
cDragable.onMouseMove=function(e)
{if(!e)
{e=window.event;}
var hWin=document.all?(e.srcElement.ownerDocument?e.srcElement.ownerDocument.parentWindow:e.srcElement.document.parentWindow):e.target.ownerDocument.defaultView;var hDoc=document;if(hWin!=hWin.parent)
{}
if(cDragable.dragQueue.nCount>0)
{pagepos={x:0,y:0};if(e.pageX||e.pageY)
{pagepos.x=e.pageX;pagepos.y=e.pageY;}
else if(e.clientX||e.clientY)
{pagepos.x=e.clientX+hDoc.body.scrollLeft+hDoc.documentElement.scrollLeft;pagepos.y=e.clientY+hDoc.body.scrollTop+hDoc.documentElement.scrollTop;if(hWin!=hWin.parent)
{pagepos.x+=cDomObject.getLeft(hWin.frameElement.parentNode);pagepos.y+=cDomObject.getTop(hWin.frameElement.parentNode);}}
var dX=pagepos.x-cDragable.hPagePos.x;var dY=pagepos.y-cDragable.hPagePos.y;var hRet=[false,false];for(var hI in cDragable.dragQueue)
{if(typeof cDragable.dragQueue[hI]=='object')
{if(!cDragable.dragQueue[hI].bResizing)
{hRet=cDragable.dragQueue[hI].move(dX,dY);}
else
{hRet=cDragable.dragQueue[hI].resize(dX,dY);}}}
if(hRet[0])
{cDragable.hPagePos.x=pagepos.x;}
if(hRet[1])
{cDragable.hPagePos.y=pagepos.y;}}}
cDragable.onMouseUp=function(e)
{if(!e)e=window.event;cDragable.emptyQueue();}
cDragable.init=function()
{if(document.addEventListener)
{document.addEventListener('mousemove',cDragable.onMouseMove,false);document.addEventListener('mouseup',cDragable.onMouseUp,false);}
else if(document.attachEvent)
{document.attachEvent('onmousemove',cDragable.onMouseMove);document.attachEvent('onmouseup',cDragable.onMouseUp);}}
if(window.addEventListener)
{window.addEventListener('load',cDragable.init,false);}
else if(document.attachEvent)
{window.attachEvent('onload',cDragable.init);}

cDMXPopupWindow=function()
{var zIndex=50000;var nScrollTopSaved=0;var CSOverlayId='dmxWindowOverlay';var CNResizeDelay=250;var CNFPS=22;var CHEMBEDDABLE=/\.(gif|jpg|jpeg|png|swf|mov|wmv)/i;var cDMXPopupObject=function(sId,hAttributes)
{this.sId=sId;this.hAttr=hAttributes;};var getIFrameId=function(sId)
{return sId+'ContentFrame';}
var getTitleId=function(sId)
{return sId+'Content';}
var getContentId=function(sId)
{return sId+'Content';}
return{createOverlay:function(nOpacity)
{var sId=CSOverlayId;var hOverlay=document.getElementById(sId);if(!hOverlay)
{hOverlay=document.createElement('div');hOverlay.id=sId;document.body.appendChild(hOverlay);hOverlay.style.width=cDomObject.getDocumentWidth()+16+'px';hOverlay.style.height=cDomObject.getDocumentHeight()+'px';}
{nScrollTopSaved=hOverlay.pageYOffset?hOverlay.pageYOffset:document.documentElement?document.documentElement.scrollTop:document.body?document.body.scrollTop:0;window.scrollTo(0,0);var hBody=document.getElementsByTagName('body')[0];hBody.style.height='100%';hBody.style.width='100%';hBody.style.overflow='hidden';var hHTML=document.getElementsByTagName('html')[0];hHTML.style.height='100%';hHTML.style.width='100%';hHTML.style.overflow='hidden';}
hOverlay.style.display='block';cDomObject.setStyle(hOverlay,"opacity",nOpacity);},removeOverlay:function()
{var sId=CSOverlayId;if(document.getElementById(sId))
{document.getElementById(sId).style.display='none';{window.scrollTo(0,nScrollTopSaved);nScrollTopSaved=0;var hBody=document.getElementsByTagName('body')[0];hBody.style.height='auto';hBody.style.width='auto';hBody.style.overflow='auto';var hHTML=document.getElementsByTagName('html')[0];hHTML.style.height='auto';hHTML.style.overflow='auto';}}},resizeOverlay:function()
{var sId=CSOverlayId;var hOverlay=document.getElementById(sId);if(!hOverlay)
{return;}
hOverlay.style.width=cDomObject.getViewportWidth()+16+'px';hOverlay.style.height=cDomObject.getViewportHeight()+'px';},resizeTo:function(sId,nW,nH)
{nW-=cDomObject.getBorderWidth(sId,'lr');nH-=cDomObject.getBorderWidth(sId,'tb');var hE=new cMoEffects.cResizer(sId,null,null,nW,nH,cMoEffects.cResizer.CN_RESIZE_GLIDE,{nSteps:8,nDuration:CNResizeDelay,onFinish:function(){cDMXPopupWindow.onResize(sId)}});},moveTo:function(sId,nX,nY)
{var hE=new cMoEffects.cMover(sId,null,null,nX,nY,cMoEffects.cResizer.CN_RESIZE_GLIDE,true,{nSteps:8,nDuration:CNResizeDelay});},onResize:function(sId)
{var hWindow=document.getElementById(sId);var hContentFrame=document.getElementById(sId+'ContentFrame');var hContent=document.getElementById(sId+'Content');var hFrameHolder=document.getElementById(sId+'FrameHolder');var hTitle=hWindow.getElementsByTagName('h2')[0];if(hFrameHolder)
{hFrameHolder.style.height=cDomObject.getHeight(hWindow)-hTitle.offsetHeight+'px';}},postCreateInit:function(sId,hAttr)
{var hWindow=document.getElementById(sId);var hContentFrame=document.getElementById(sId+'ContentFrame');var hFrameHolder=document.getElementById(sId+'FrameHolder');var hTitle=hWindow.getElementsByTagName('h2')[0];hTitle.innerHTML=hAttr.sTitle;if(hFrameHolder)
{hFrameHolder.style.height=cDomObject.getHeight(hWindow)-hTitle.offsetHeight+'px';}
var hClearFrame=document.getElementById(sId+'Clear');if(hClearFrame)
{var hDocument=hClearFrame.contentWindow.document;if(hDocument.attachEvent)
{hDocument.attachEvent('onmousemove',cDragable.onMouseMove);hDocument.attachEvent('onmouseup',cDragable.onMouseUp);}}
if(hAttr.bDragable)
{hWindow.setAttribute('draghandle',hWindow.id+'Title');var hDragable=new cDragable(hWindow);}
if(hAttr.hGallery)
{hAttr.hGallery.startSlideshow();}},createContent:function(hAttr,bExists)
{if(bExists==undefined)
{bExists=false;}
if(bExists)
{this.removeContent(hAttr);}
var hWin=cDomObject.$(hAttr.hIDList['winId']);var hContent=cDomObject.$(getContentId(hAttr.hIDList['winId']));var hFrame=cDomObject.$(getIFrameId(hAttr.hIDList['winId']));if(!hAttr.bIFrame)
{if(typeof hAttr.sContent=='string')
{var hPageElement=document.getElementById(hAttr.sContent);var nCW=cDomObject.getWidth(hContent);var nCH=cDomObject.getHeight(hWin)-cDomObject.getBorderWidth(hWin,'tb')-cDomObject.getBorderWidth(hContent,'tb')-hWin.getElementsByTagName('h2')[0].offsetHeight;hContent.style.height=nCH+'px';if(hPageElement)
{hContent.innerHTML=hPageElement.innerHTML;}
else if(hAttr.sContent.match(CHEMBEDDABLE))
{hContent.innerHTML=cDMX.media.createContentEnvelope(hAttr.sContent,nCW,nCH);}
else
{hContent.innerHTML=hAttr.sContent;}}
else
{cDomObject.addNodeClass(hWin,'dmxGallery');var hGallery=new cDMXSlideshow(hContent);hGallery.init(hAttr.sContent,200);hAttr.hGallery=hGallery;hGallery.onLoaded=function()
{if(this.aDim)
{var hOldDim=this.aDim;}
this.aDim=hGallery.getCurrentDimensions();if(hOldDim!=null)
{var dX=hOldDim[0]-this.aDim[0];var dY=hOldDim[1]-this.aDim[1];cDMXPopupWindow.moveTo(hWin.id,Math.floor(dX/2),Math.floor(dY/2));}
var nNewW=this.aDim[0]+cDomObject.getBorderWidth(hContent,'lr')+cDomObject.getBorderWidth(hWin,'lr');var nNewH=this.aDim[1]+cDomObject.getBorderWidth(hContent,'tb')+cDomObject.getBorderWidth(hWin,'tb')+hWin.getElementsByTagName('h2')[0].offsetHeight;cDMXPopupWindow.resizeTo(hWin.id,nNewW,nNewH);hContent.style.width=this.aDim[0]+cDomObject.getBorderWidth(hContent,'lr')+'px';hContent.style.height=this.aDim[1]+cDomObject.getBorderWidth(hContent,'tb')+'px';}}}
else if(hAttr.bIFrame)
{if(hFrame)
{hFrame.src=hAttr.sURL;}}},removeContent:function(hAttr)
{var hWin=cDomObject.$(hAttr.hIDList['winId']);var hContent=cDomObject.$(hAttr.hIDList['contentId']);var hFrame=cDomObject.$(hAttr.hIDList['iFrameId']);if(hContent)
{hContent.innerHTML='';}},buildWindow:function(hAPWAttributes)
{var hAttr=new cAPWAttributes(hAPWAttributes);var hDMX
if(hAttr.nOpenDelay>0)
{hAPWAttributes.nOpenDelay=0;window.setTimeout(function(){cDMXPopupWindow.buildWindow(hAPWAttributes)},hAttr.nOpenDelay)}
if(hAttr.bOverlay)
{cDMXPopupWindow.createOverlay(hAttr.nOverlayOpacity);cDomEvent.addEvent(window,'resize',function(){cDMXPopupWindow.resizeOverlay()});}
var sName=hAttr.sPopupName.replace('&nbsp;','');var sId='dmxPopup'+cDMX.util.toCamelCase(sName);var hWin=document.getElementById(sId);var bWasCreated=hWin!=null;var hContent=document.getElementById(sId+'Content');if(!hWin)
{hWin=document.createElement('div');hWin.className='dmxWindow';hWin.id=sId;}
else
{}
hAttr.hIDList['winId']=sId;if(!cDomObject.hasClass(hWin,hAttr.sClass))
{cDomObject.addNodeClass(hWin,hAttr.sClass);}
hWin.style.zIndex=zIndex++;hWin.style.width=hAttr.aSize[0]+'px';hWin.style.height=hAttr.aSize[1]+'px';var nW=cDomObject.getViewportWidth();var nH=cDomObject.getViewportHeight();var nSL=cDomObject.getScrollLeft();var nST=cDomObject.getScrollTop();var nWW=hAttr.aSize[0];var nWH=hAttr.aSize[1];var nLeft,nTop;switch(hAttr.aPosition[0])
{case'left':nLeft=nSL;break;case'center':nLeft=Math.round((nW-hAttr.aSize[0])/2)+nSL;break;case'right':nLeft=nSL+nW-hAttr.aSize[0];break;default:nLeft=parseInt(hAttr.aSize[0])!=Math.NaN?parseInt(hAttr.aSize[0]):nSL;break;}
switch(hAttr.aPosition[1])
{case'top':nTop=nST;break;case'center':nTop=Math.round((nH-hAttr.aSize[1])/2)+nST;break;case'bottom':nTop=nST+nH-hAttr.aSize[1];break;default:nTop=parseInt(hAttr.aSize[1])!=Math.NaN?parseInt(hAttr.aSize[1]):nST;break;}
if(!bWasCreated)
{if(cDomObject.isIE&&!cDomObject.isIE7)
{var hClearFrame=document.createElement('iframe');hClearFrame.id=sId+'Clear';hClearFrame.className='clear';hClearFrame.frameBorder=0;hWin.appendChild(hClearFrame);}
var hTitle=document.createElement('h2');hTitle.id=sId+'Title';hTitle.innerHTML=hAttr.sTitle;hWin.appendChild(hTitle);if(hAttr.bClosable)
{var hCloseHandle=document.createElement('a');hCloseHandle.href='javascript:false;';hCloseHandle.className='closeHandle';hCloseHandle.onclick=function(e)
{if(!e)e=window.event;window.setTimeout(function()
{cDMXPopupWindow.closeWindow(hWin.id);},10);e.cancelBubble=true;e.returnValue=false;return false;}
hWin.appendChild(hCloseHandle);}
var hFrameHolder=document.createElement('div');hFrameHolder.id=sId+'FrameHolder';hFrameHolder.className='frameHolder';if(hAttr.bIFrame)
{var hFrame=document.createElement('iframe');hFrame.id=getIFrameId(sId);hFrame.className='content';hFrameHolder.appendChild(hFrame)
cDomObject.addNodeClass(hFrameHolder,'dmxIFrame');}
else
{hContent=document.createElement('div');hContent.id=getContentId(sId);hAttr.hIDList['contentId']=hContent.id;hContent.className='content';hFrameHolder.appendChild(hContent)}
hWin.appendChild(hFrameHolder);if(hAttr.bResizable)
{cDomObject.addNodeClass(hWin,'elementResizable');var hResizeHandle=document.createElement('div');hResizeHandle.className='resizeHandle';hResizeHandle.onclick=function(e)
{if(!e)e=window.event;e.cancelBubble=true;e.returnValue=false;return false;}
hResizeHandle.onselectstart=function(e)
{if(!e)e=window.event;if(e.preventDefault){e.preventDefault();};e.cancelBubble=true;e.returnValue=false;return false;}
hResizeHandle.onmousedown=function(e)
{if(!e)e=window.event;if(e.preventDefault){e.preventDefault();};e.returnValue=false;return false;}
hWin.appendChild(hResizeHandle);hWin.ondragresize=cDMXPopupWindow.onResize;}
document.body.appendChild(hWin);}
this.createContent(hAttr,bWasCreated);var hE;if(hAttr.sStartPosition!='')
{var nStartLeft,nStartTop;switch(hAttr.sStartPosition)
{case'SlideInTop':nStartLeft=nLeft;nStartTop=nST-nWH;break;case'SlideInTopLeft':nStartLeft=nSL-nWW;nStartTop=nST-nWH;break;case'SlideInTopRight':nStartLeft=nSL+nW+nWW;nStartTop=nST-nWH;break;case'SlideInRight':nStartLeft=nSL+nW+nWW;nStartTop=nTop;break;case'SlideInBottom':nStartLeft=nLeft;nStartTop=nST+nH+nWH;break;case'SlideInBottomLeft':nStartLeft=nSL-nWW;nStartTop=nST+nH+nWH;break;case'SlideInBottomRight':nStartLeft=nSL+nW+nWW;nStartTop=nST+nH+nWH;break;case'SlideInLeft':nStartLeft=nSL-nWW;nStartTop=nTop;break;}
var nShowEffect=cMoEffects.cMover.CN_MOVE_GLIDEFAST;switch(hAttr.sStartShowEffect)
{case'Linear':nShowEffect=cMoEffects.cMover.CN_MOVE_SLIDE;break;case'FastSlow':nShowEffect=cMoEffects.cMover.CN_MOVE_GLIDE;break;case'SlowFase':nShowEffect=cMoEffects.cMover.CN_MOVE_GLIDEFAST;break;}
hWin.style.left=nStartLeft+'px';hWin.style.top=nStartTop+'px';var nMoveSteps=Math.floor(hAttr.nStartDelay/1000*CNFPS);hE=new cMoEffects.cMover(hWin.id,nLeft,nST-nWH,nLeft,nTop,nShowEffect,false,{nSteps:nMoveSteps,nDuration:hAttr.nStartDelay});}
else
{hWin.style.left=nLeft+'px';hWin.style.top=nTop+'px';}
if(hAttr.bFadeIn&&(!cDomObject.isIE||cDomObject.isIE7))
{cDomObject.setOpacity(hWin.id,0);hE=new cMoEffects.cFade(hWin.id,0,100,{nSteps:12,nDuration:hAttr.nStartDelay});}
hWin.style.visibility='visible';if(hAttr.nCloseDelay&&hAttr.nCloseDelay>500)
{if(hAttr.hCloseTimeout)
{window.clearTimeout(hAttr.hCloseTimeout);}
hAttr.hCloseTimeout=window.setTimeout(function()
{cDMXPopupWindow.closeWindow(hWin.id);},hAttr.nCloseDelay);}
if(hWin.dmxData)
{try
{hWin.dmxData=null;delete hWin.dmxData;}
catch(hE)
{}}
hWin.dmxData=new cDMXPopupObject(hWin.id,hAttr);window.setTimeout(function(){cDMXPopupWindow.postCreateInit(sId,hAttr)},1);return hWin;},closeWindow:function(sId)
{var hWin=document.getElementById(sId);this.removeOverlay();if(hWin&&!hWin.bClosing)
{hWin.removeCounter=0;var bDelayedRemove=false;var hE;if(hWin.dmxData.hAttr.hGallery)
{hWin.dmxData.hAttr.hGallery.stopSlideshow();}
if(hWin.dmxData.hAttr.sEndPosition!='')
{var nW=cDomObject.getViewportWidth();var nH=cDomObject.getViewportHeight();var nSL=cDomObject.getScrollLeft();var nST=cDomObject.getScrollTop();var nWW=hWin.offsetWidth;var nWH=hWin.offsetHeight;var nEndLeft,nEndTop;switch(hWin.dmxData.hAttr.sEndPosition)
{case'SlideOutTop':nEndLeft=null;nEndTop=nST-nWH;break;case'SlideOutTopLeft':nEndLeft=nSL-nWW;nEndTop=nST-nWH;break;case'SlideOutTopRight':nEndLeft=nSL+nW+nWW;nEndTop=nST-nWH;break;case'SlideOutRight':nEndLeft=nSL+nW+nWW;nEndTop=null;break;case'SlideOutBottom':nEndLeft=null;nEndTop=nST+nH+nWH;break;case'SlideOutBottomLeft':nEndLeft=nSL-nWW;nEndTop=nST+nH+nWH;break;case'SlideOutBottomRight':nEndLeft=nSL+nW+nWW;nEndTop=nST+nH+nWH;break;case'SlideOutLeft':nEndLeft=nSL-nWW;nEndTop=null;break;}
var nHideEffect=cMoEffects.cMover.CN_MOVE_GLIDEFAST;switch(hWin.dmxData.hAttr.sEndShowEffect)
{case'Linear':nHideEffect=cMoEffects.cMover.CN_MOVE_SLIDE;break;case'FastSlow':nHideEffect=cMoEffects.cMover.CN_MOVE_GLIDE;break;case'SlowFase':nHideEffect=cMoEffects.cMover.CN_MOVE_GLIDEFAST;break;}
bDelayedRemove=true;var nMoveSteps=Math.floor(hWin.dmxData.hAttr.nEndDelay/1000*CNFPS);hE=new cMoEffects.cMover(hWin.id,null,null,nEndLeft,nEndTop,nHideEffect,false,{nSteps:nMoveSteps,nDuration:hWin.dmxData.hAttr.nEndDelay,onFinish:function(){window.setTimeout(function(){cDMXPopupWindow.removeWindow(hWin.id)},100)}});}
if(hWin.dmxData.hAttr.bFadeOut&&(!cDomObject.isIE||cDomObject.isIE7))
{bDelayedRemove=true;hE=new cMoEffects.cFade(hWin.id,100,0,{nSteps:12,nDuration:hWin.dmxData.hAttr.nEndDelay,onFinish:function(){window.setTimeout(function(){cDMXPopupWindow.removeWindow(hWin.id)},100)}});}
if(!bDelayedRemove)
{hWin.style.visibility='hidden';this.removeWindow(hWin.id);}
hWin.bClosing=true;return hWin;}
else
{return false;}},removeWindow:function(sId)
{var hWin=document.getElementById(sId);if(hWin)
{document.body.removeChild(hWin);hWin=null;}}}}();cAttributes=function(hAttributes)
{for(var hI in hAttributes)
{this[hI]=hAttributes[hI];}}
cAPWAttributes=function(hAttributes)
{this.sTitle='';this.sPopupName='';this.sURL='';this.sContent='';this.bOverlay=false;this.bResizable=true;this.bClosable=true;this.sClass='dmxNova';this.nOpacity=0.4;this.nOverlayOpacity=0.3;this.nOpenDelay=0;this.nCloseDelay=0;this.aSize=cDragable.CA_DEFAULT_SIZE;this.aPosition=cDragable.CA_DEFAULT_POSITION;this.sStartPosition='';this.sStartShowEffect='Linear';this.nStartDelay=1;this.bFadeIn=false;this.sEndPosition='';this.sEndShowEffect='Linear';this.nEndDelay=0.2;this.bFadeOut=false;this.bDragable=true;this.bIFrame=false;this.bResizable=false;this.bShadow=true;this.hIDList={};cAPWAttributes.baseConstructor.call(this,hAttributes);if(this.sTitle=='')
{this.sTitle='&nbsp;'}
this.nOpenDelay*=1000;this.nCloseDelay*=1000;this.sStartPosition=this.sIncomingEffect?this.sIncomingEffect:this.sStartPosition;this.sStartShowEffect=this.sIncomingEffectEasing?this.sIncomingEffectEasing:this.sStartShowEffect;this.nStartDelay=this.nIncomingEffectDuration?this.nIncomingEffectDuration:this.nStartDelay;this.nStartDelay*=1000;this.sEndPosition=this.sOutgoingEffect?this.sOutgoingEffect:this.sEndPosition;this.sEndShowEffect=this.sOutgoingEffectEasing?this.sOutgoingEffectEasing:this.sEndShowEffect;this.nEndDelay=this.nOutgoingEffectDuration?this.nOutgoingEffectDuration:this.nEndDelay;this.nEndDelay*=1000;if(this.nOverlayOpacity>1)
{this.nOverlayOpacity=this.nOverlayOpacity/100;}
this.sPopupName=this.sPopupName||this.sTitle;if(typeof this.sURL=='object')
{this.sContent=this.sURL;for(var hGI in this.sContent)
{this.sContent[hGI].nDelay*=1000;this.sContent[hGI].nWidth=new Number(this.sContent[hGI].nWidth);this.sContent[hGI].nHeight=new Number(this.sContent[hGI].nHeight);}
this.aSize=[this.sContent[0].nWidth,this.sContent[0].nHeight];if(this.sContent.length==1)
{this.sContent[0].nDelay=0;}
this.bIFrame=false;}
else if(typeof this.sURL=='string')
{if(this.sURL.match(/\.(gif|jpg|jpeg|png|swf|mov|avi)/i))
{this.sContent=this.sURL;this.bIFrame=false;}
else
{this.bIFrame=true;}}
this.bResizable=!cDMX.util.isUndefined(this.bResizable)?this.bResizable:!this.bIFrame;}
cJSExtend.extend(cAttributes,cAPWAttributes);cDMX.TestResources=function()
{var hQueue={};var hTestTask=null;var nFailures=0;var nRegistered=0;var hTester={testCss:function(sFileName,sClassName)
{var hDiv=document.createElement('div');hDiv.id=cDMX.util.getUniqueId();document.body.appendChild(hDiv);hDiv.className=sClassName;hQueue[sFileName]=hDiv.id;nRegistered++;if(!hTestTask)
{hTestTask=new cDMX.delayedTask(cDMX.TestResources.check,window);}
hTestTask.delay(500);},check:function()
{for(var hI in hQueue)
{if(typeof hI=='string')
{var hEl=cDomObject.$(hQueue[hI]);if(hEl)
{if(hEl.offsetHeight&&hEl.offsetHeight>0)
{delete hQueue[hI];}
else
{nFailures++;}
nRegistered--;}
else
{nFailures++;}}}
if(nFailures>0)
{cDMX.TestResources.onFailure(cDMX.TestResources.generateListOfFailures());}},generateListOfFailures:function()
{var aList=[];for(var hI in hQueue)
{aList[aList.length]=hI;}
return aList.join(' ');}}
return hTester;}();cDMX.TestResources.onFailure=function(sList)
{window.alert('The CSS files needed for Advanced Layer Popup are not found or are outdated.\nPlease make sure you have uploaded the file(s) your Styles folder to your server.\nThe following file(s) are missing or outdated: '+sList);};cDomEvent.addEvent(window,'load',function(){cDMX.TestResources.testCss('dmxpopup.css','dmxPopupTest')});

cDMXSlideshow=function(hContainer,nStartDelay)
{hContainer=cDomObject.$(hContainer);this.sContainerId=hContainer.id;cDomObject.addNodeClass(hContainer,'dmxGalleryContainer');this.nStartDelay=nStartDelay||2000;this.aGallery=null;this.nPreviousPosition=0;this.nPosition=0;this.sBufferId=cDMX.util.getUniqueId();this.hTimeout=null;this.nCounter=0;this.onLoaded=function(){}}
cDMXSlideshow.CN_FPS=20;cDMXSlideshow.CN_TRANSITION_DURATION=800;cDMXSlideshow.CN_SLIDE_DURATION=3000;cDMXSlideshow.prototype={init:function(aGalleryElements,nDelay)
{if(typeof nDelay=='undefined')
{nDelay=0;}
this.aGallery=aGalleryElements;this.nDelay=nDelay;this.createSlides();},createSlides:function()
{if(!this.aGallery||this.aGallery.length==0)
{return false;}
var hContainer=cDomObject.$(this.sContainerId);var nMaxZIndex=this.aGallery.length;for(var nI=0;nI<this.aGallery.length;nI++)
{var hSlideElement=document.createElement('div');hSlideElement.id=this.sContainerId+'Slide'+(this.nCounter++);hSlideElement.className='dmxGallerySlide';hSlideElement.style.zIndex=nMaxZIndex--;hSlideElement.innerHTML=cDMX.media.createContentEnvelope(this.aGallery[nI].src,this.aGallery[nI].nWidth,this.aGallery[nI].nHeight);hContainer.appendChild(hSlideElement);}},startSlideshow:function()
{if(!this.aGallery||this.aGallery.length==0)
{return false;}
var hDMXG=this;this.nPosition=0;this.hTimeout=window.setTimeout(function(){hDMXG.nextSlide()},this.nStartDelay);},stopSlideshow:function()
{window.clearTimeout(this.hTimeout);},nextSlide:function()
{var hContainer=cDomObject.$(this.sContainerId);if(hContainer)
{var hDMXG=this;var nDuration,nSteps,hE;var hPreviousSlide=null;if(this.nPreviousPosition!=this.nPosition)
{hPreviousSlide=hContainer.childNodes[this.nPreviousPosition];}
var hNextSlide=hContainer.childNodes[this.nPosition];cDomObject.setOpacity(hNextSlide,0);hNextSlide.style.visibility='visible';hNextSlide.style.display='block';nDuration=this.aGallery[this.nPosition].nDelay;if(!nDuration)
{nDuration=cDMXSlideshow.CN_SLIDE_DURATION;}
nSteps=Math.round(cDMXSlideshow.CN_TRANSITION_DURATION/1000*cDMXSlideshow.CN_FPS);if(hPreviousSlide)
{hE=new cMoEffects.cFade(hPreviousSlide,100,0,{nSteps:nSteps,nDuration:cDMXSlideshow.CN_TRANSITION_DURATION,onFinish:function(){hPreviousSlide.style.visibility='hidden';hPreviousSlide.style.display='none'}})}
if(hNextSlide)
{hE=new cMoEffects.cFade(hNextSlide,0,100,{nSteps:nSteps,nDuration:cDMXSlideshow.CN_TRANSITION_DURATION,onFinish:function(){hDMXG.onLoaded()}})}
this.nPreviousPosition=this.nPosition;this.nPosition++;if(this.nPosition>=this.aGallery.length)
{this.nPosition=0;}
this.hTimeout=window.setTimeout(function(){hDMXG.nextSlide()},nDuration);}},getCurrentDimensions:function()
{return[this.aGallery[this.nPreviousPosition].nWidth,this.aGallery[this.nPreviousPosition].nHeight];}}

var cMoEffects;if(!cMoEffects)
{cMoEffects={};}
if(!cMoEffects.cEffect)
{cMoEffects.cEffect={};}
if(!Function.prototype.andThen)
{Function.prototype.andThen=function(g)
{var f=this;return function()
{f();g();}}}
cMoEffects.cEffect=function(hOptions)
{this.hTimer=null;this.nCurrentStep=0;this.nInterval=0;this.hOptions={nSteps:10,nFPS:0,nDuration:500,onStart:function(){},onStop:function(){},onFinish:function(){}};this.setOptions(hOptions);if(this.hOptions.nFPS>0)
{this.nInterval=Math.floor(1000/this.hOptions.nFPS);this.hOptions.nSteps=Math.round(this.nDuration/this.nInterval)+1;}
else
{this.nInterval=Math.round(this.hOptions.nDuration/this.hOptions.nSteps);}
return this;}
cMoEffects.cEffect.prototype.setOptions=function(hOptions)
{for(var hKey in hOptions)
{this.hOptions[hKey]=hOptions[hKey];}}
cMoEffects.cEffect.prototype.calculate=function()
{}
cMoEffects.cEffect.prototype.playAgain=function()
{}
cMoEffects.cEffect.prototype.start=function()
{this.hOptions.onStart();this.play();}
cMoEffects.cEffect.prototype.stop=function()
{this.hOptions.onStop()}
cMoEffects.cEffect.prototype.doFrame=function()
{}
cMoEffects.cEffect.prototype.play=function()
{this.nCurrentStep++;this.doFrame()
if(this.nCurrentStep<this.hOptions.nSteps-1)
{var hSelf=this;window.setTimeout(function(){hSelf.play()},this.nInterval);}
else
{(this.hOptions.onStop).andThen(this.hOptions.onFinish.call(this));}}
cMoEffects.cFade=function(hElement,nStartOpacity,nEndOpacity,hOptions)
{cMoEffects.cEffect.call(this,hOptions);if(typeof hElement=='string')
{hElement=document.getElementById(hElement);}
this.sId=hElement.id;this.aOpacities=new Array();this.playAgain(nStartOpacity,nEndOpacity);}
cMoEffects.cFade.prototype=new cMoEffects.cEffect();cMoEffects.cFade.prototype.constructor=cMoEffects.cFade;cMoEffects.cFade.prototype.calculate=function()
{var nOpacityStep=(this.nStartOpacity-this.nEndOpacity)/this.hOptions.nSteps;for(var nI=0;nI<this.hOptions.nSteps-1;nI++)
{this.aOpacities[nI]=this.nStartOpacity-nI*nOpacityStep;}
this.aOpacities[nI]=this.nEndOpacity;}
cMoEffects.cFade.prototype.playAgain=function(nStartOpacity,nEndOpacity)
{this.nStartOpacity=nStartOpacity;this.nEndOpacity=nEndOpacity;this.calculate();this.start();}
cMoEffects.cFade.prototype.doFrame=function()
{cMoEffects.cFade.setOpacity(this.sId,this.aOpacities[this.nCurrentStep]);}
cMoEffects.cFade.setOpacity=function(sId,nValue)
{var hElement=document.getElementById(sId);if(hElement)
{try
{nValue=Math.floor(nValue);if(hElement.filters!=null&&hElement.filters.alpha!=null)
{hElement.filters.alpha.opacity=nValue;}
else if(typeof hElement.style.opacity!='undefined')
{hElement.style.opacity=nValue/100;}
else if(typeof hElement.style.MozOpacity!='undefined')
{hElement.style.MozOpacity=nValue/100;}}
catch(hE)
{return;}}}
cMoEffects.cColor=function(hElement,nStartColor,nEndColor,bBGColor,hOptions)
{cMoEffects.cEffect.call(this,hOptions);if(typeof hElement=='string')
{hElement=document.getElementById(hElement);}
this.sId=hElement.id;this.aColors=new Array();if(typeof(nStartColor)=='string')
{nStartColor=cMoEffects.cColor.colorToNumber(nStartColor);}
if(typeof(nEndColor)=='string')
{nEndColor=cMoEffects.cColor.colorToNumber(nEndColor);}
this.playAgain(nStartColor,nEndColor,bBGColor);}
cMoEffects.cColor.prototype=new cMoEffects.cEffect();cMoEffects.cColor.prototype.constructor=cMoEffects.cColor;cMoEffects.cColor.prototype.calculate=function()
{var nColorStep=Math.round((this.nStartColor-this.nEndColor))/this.hOptions.nSteps;var nStartR=(this.nStartColor&0xff0000)>>>16;var nStartG=(this.nStartColor&0x00ff00)>>>8;var nStartB=(this.nStartColor&0x0000ff);var nEndR=(this.nEndColor&0xff0000)>>>16;var nEndG=(this.nEndColor&0x00ff00)>>>8;var nEndB=(this.nEndColor&0x0000ff);var nColor;for(var nI=0;nI<this.hOptions.nSteps-1;nI++)
{nColor=nStartR*((this.hOptions.nSteps-nI)/this.hOptions.nSteps)+nEndR*(nI/this.hOptions.nSteps)<<16|nStartG*((this.hOptions.nSteps-nI)/this.hOptions.nSteps)+nEndG*(nI/this.hOptions.nSteps)<<8|nStartB*((this.hOptions.nSteps-nI)/this.hOptions.nSteps)+nEndB*(nI/this.hOptions.nSteps);this.aColors[nI]=nColor;}
this.aColors[nI]=this.nEndColor;}
cMoEffects.cColor.prototype.playAgain=function(nStartColor,nEndColor,bBGColor)
{this.bBGColor=bBGColor;this.nStartColor=nStartColor;this.nEndColor=nEndColor;this.calculate();this.start();}
cMoEffects.cColor.prototype.doFrame=function()
{if(!this.bBGColor)
{cMoEffects.cColor.setColor(this.sId,this.aColors[this.nCurrentStep]);}
else
{cMoEffects.cColor.setBGColor(this.sId,this.aColors[this.nCurrentStep]);}}
cMoEffects.cColor.setColor=function(sId,nValue)
{var hElement=document.getElementById(sId);if(hElement)
{hElement.style.color=cMoEffects.cColor.numberToColor(nValue);}}
cMoEffects.cColor.setBGColor=function(sId,nValue)
{var hElement=document.getElementById(sId);if(hElement)
{hElement.style.backgroundColor=cMoEffects.cColor.numberToColor(nValue);}}
cMoEffects.cColor.colorToNumber=function(sColor)
{var sRCol=/^#/;return parseInt('0x'+sColor.replace(sRCol,''));}
cMoEffects.cColor.numberToColor=function(nColor)
{nColor|=1<<24;return'#'+nColor.toString(16).substr(1);}
cMoEffects.cResizer=function(hElement,nStartWidth,nStartHeight,nEndWidth,nEndHeight,nType,hOptions)
{cMoEffects.cEffect.call(this,hOptions);if(typeof hElement=='string')
{hElement=document.getElementById(hElement);}
hElement.style.overflow='hidden';this.sId=hElement.id;this.aSizes=new Array();this.playAgain(nStartWidth,nStartHeight,nEndWidth,nEndHeight,nType);}
cMoEffects.cResizer.CN_RESIZE_GLIDE=0x01;cMoEffects.cResizer.CN_RESIZE_SLIDE=0x02;cMoEffects.cResizer.CN_RESIZE_GLIDEFAST=0x03;cMoEffects.cResizer.prototype=new cMoEffects.cEffect();cMoEffects.cResizer.prototype.constructor=cMoEffects.cResizer;cMoEffects.cResizer.prototype.calculate=function()
{var hKey;while(hKey in this.aSizes)
{delete(this.aSizes[hKey]);}
var nI;var dX=this.nEndWidth-this.nStartWidth;var dY=this.nEndHeight-this.nStartHeight;if(this.nType==cMoEffects.cResizer.CN_RESIZE_GLIDE)
{var nAngleInc=90/(this.hOptions.nSteps+1);var nAngle=nAngleInc;var nC;nI=0;var sX=this.nStartWidth;var sY=this.nStartHeight;while(nAngle<90)
{nC=Math.sin(nAngle*Math.PI/180);this.aSizes[nI]={w:Math.floor(sX+dX*nC),h:Math.floor(sY+dY*nC)};nAngle+=nAngleInc;nI++;}}
if(this.nType==cMoEffects.cResizer.CN_RESIZE_GLIDEFAST)
{var nAngleInc=90/(this.hOptions.nSteps);var nAngle=90-nAngleInc;var nC;nI=0;var sX=this.nStartWidth;var sY=this.nStartHeight;while(nAngle>=0)
{nC=Math.sin(nAngle*Math.PI/180);this.aSizes[nI]={w:Math.floor(sX+dX*(1-nC)),h:Math.floor(sY+dY*(1-nC))};nAngle-=nAngleInc;nI++;}}else if(this.nType==cMoEffects.cResizer.CN_RESIZE_SLIDE)
{var nDeltaX=dX/this.hOptions.nSteps;var nDeltaY=dY/this.hOptions.nSteps;var sX=this.nStartWidth;var sY=this.nStartHeight;for(nI=0;nI<this.hOptions.nSteps-1;nI++)
{sX+=nDeltaX;sY+=nDeltaY;this.aSizes[nI]={w:Math.round(sX),h:Math.round(sY)};}}
this.aSizes[nI]={w:this.nEndWidth,h:this.nEndHeight};}
cMoEffects.cResizer.prototype.playAgain=function(nStartWidth,nStartHeight,nEndWidth,nEndHeight,nType)
{this.nStartWidth=nStartWidth!=null?nStartWidth:cDomObject.getWidth(this.sId);this.nStartHeight=nStartHeight!=null?nStartHeight:cDomObject.getHeight(this.sId);this.nEndWidth=nEndWidth!=null?nEndWidth:cDomObject.getWidth(this.sId);this.nEndHeight=nEndHeight!=null?nEndHeight:cDomObject.getHeight(this.sId);if(nType)
{this.nType=nType;}
this.calculate();this.start();}
cMoEffects.cResizer.prototype.doFrame=function()
{cMoEffects.cResizer.setSize(this.sId,this.aSizes[this.nCurrentStep]);}
cMoEffects.cResizer.setSize=function(sId,hSize)
{var hElement=document.getElementById(sId);try
{hElement.style.width=hSize.w+'px';hElement.style.height=hSize.h+'px';}
catch(hE)
{}}
cMoEffects.cMover=function(hElement,nStartX,nStartY,nEndX,nEndY,nType,bRelative,hOptions)
{cMoEffects.cEffect.call(this,hOptions);if(typeof hElement=='string')
{hElement=document.getElementById(hElement);}
this.sId=hElement.id;this.aPositions=new Array();this.playAgain(nStartX,nStartY,nEndX,nEndY,nType,bRelative);}
cMoEffects.cMover.CN_MOVE_GLIDE=0x01;cMoEffects.cMover.CN_MOVE_SLIDE=0x02;cMoEffects.cMover.CN_MOVE_GLIDEFAST=0x03;cMoEffects.cMover.prototype=new cMoEffects.cEffect();cMoEffects.cMover.prototype.constructor=cMoEffects.cMover;cMoEffects.cMover.prototype.calculate=function()
{var hKey;while(hKey in this.aPositions)
{delete(this.aPositions[hKey]);}
var nI;var dX=this.nEndX-this.nStartX;var dY=this.nEndY-this.nStartY;if(this.nType==cMoEffects.cMover.CN_MOVE_GLIDE)
{var nAngleInc=90/(this.hOptions.nSteps);var nAngle=nAngleInc;var nC;nI=0;var sX=this.nStartX;var sY=this.nStartY;while(nAngle<90)
{nC=Math.sin(nAngle*Math.PI/180);this.aPositions[nI]={left:Math.floor(sX+dX*nC),top:Math.floor(sY+dY*nC)};nAngle+=nAngleInc;nI++;}}
else if(this.nType==cMoEffects.cMover.CN_MOVE_GLIDEFAST)
{var nAngleInc=90/(this.hOptions.nSteps);var nAngle=90-nAngleInc;var nC;nI=0;var sX=this.nStartX;var sY=this.nStartY;while(nAngle>=0)
{nC=Math.sin(nAngle*Math.PI/180);this.aPositions[nI]={left:Math.floor(sX+dX*(1-nC)),top:Math.floor(sY+dY*(1-nC))};nAngle-=nAngleInc;nI++;}}
else if(this.nType==cMoEffects.cMover.CN_MOVE_SLIDE)
{var nDeltaX=dX/this.hOptions.nSteps;var nDeltaY=dY/this.hOptions.nSteps;var sX=this.nStartX;var sY=this.nStartY;for(nI=0;nI<this.hOptions.nSteps-1;nI++)
{sX+=(dX==0)?0:nDeltaX;sY+=(dY==0)?0:nDeltaY;this.aPositions[nI]={left:Math.round(sX),top:Math.round(sY)};}}
this.aPositions[nI]={left:this.nEndX,top:this.nEndY};}
cMoEffects.cMover.prototype.playAgain=function(nStartX,nStartY,nEndX,nEndY,nType,bRelative)
{if(bRelative==null)
{bRelative=false;}
var sPosition=cDomObject.getStyle(this.sId,'position');this.nStartX=cDomObject.getLeft(this.sId);this.nStartY=cDomObject.getTop(this.sId);if(bRelative)
{this.nEndX=nEndX!=null?this.nStartX+nEndX:this.nStartX;this.nEndY=nEndY!=null?this.nStartY+nEndY:this.nStartY;}
else
{this.nEndX=nEndX!=null?nEndX:this.nStartX;this.nEndY=nEndY!=null?nEndY:this.nStartY;}
if(nType)
{this.nType=nType;}
this.calculate();this.start();}
cMoEffects.cMover.prototype.doFrame=function()
{if(this.aPositions.length>this.nCurrentStep)
{cMoEffects.cMover.setPosition(this.sId,this.aPositions[this.nCurrentStep]);}}
cMoEffects.cMover.setPosition=function(sId,hPosition)
{var hElement=document.getElementById(sId);if(hElement)
{hElement.style.left=hPosition.left+'px';hElement.style.top=hPosition.top+'px';}}
