﻿/*
* Advanced Layer Popup 1.05
* 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
                { hEl.style[sStyle] = sValue; } 
            }
            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; this.bWireframe = false; if (cDomObject.hasClass(hElement, 'elementResizable'))
    { this.bResizable = true; }
    if (cDomObject.hasClass(hElement, 'elementDragWireframe'))
    { this.bWireframe = true; }
    this.initEventHandlers();
}
cDragable.CS_ID = 'draggable'; cDragable.CS_WIREFRAME_ID = 'draggable_wireframe'; cDragable.CS_WIREFRAME_CLASS = 'dmxWireframeWindow'; 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.sWireframeId = ''; 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 (this.bWireframe)
    { var hWF = document.getElementById(cDragable.CS_WIREFRAME_ID); cDomObject.setStyle(hWF, 'left', cDomObject.getLeft(hElement) + 'px'); cDomObject.setStyle(hWF, 'top', cDomObject.getTop(hElement) + 'px'); cDomObject.setStyle(hWF, 'width', cDomObject.getWidth(hElement) + 'px'); cDomObject.setStyle(hWF, 'height', cDomObject.getHeight(hElement) + 'px'); cDomObject.setStyle(hWF, 'visibility', 'visible'); }
    if (typeof cDomObject != 'undefined') {
        if (!this.bWireframe) {
            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 }; var bRetY = true; if (this.bWireframe)
    { layerpos.x = cDomObject.getLeft(cDragable.CS_WIREFRAME_ID); layerpos.y = cDomObject.getTop(cDragable.CS_WIREFRAME_ID); }
    else
    { layerpos.x = cDomObject.getLeft(this.sId); layerpos.y = cDomObject.getTop(this.sId); }
    var hElement = document.getElementById(this.sId); if (this.bWireframe) {
        var hWF = document.getElementById(cDragable.CS_WIREFRAME_ID); cDomObject.setStyle(hWF, 'left', (layerpos.x + dX) + 'px'); if (layerpos.y + dY < 0)
        { bRetY = false; }
        else
        { cDomObject.setStyle(hWF, 'top', (layerpos.y + dY) + 'px'); } 
    }
    else {
        hElement.style.left = (layerpos.x + dX) + 'px'; if (layerpos.y + dY < 0)
        { bRetY = false; }
        else
        { hElement.style.top = (layerpos.y + dY) + 'px'; } 
    }
    var hRet = [true, bRetY]; return hRet;
}
cDragable.prototype.resize = function(dX, dY) {
    var hRet = [true, true]; var layersize = { w: 0, h: 0 }; if (this.bWireframe)
    { layersize.w = cDomObject.getWidth(cDragable.CS_WIREFRAME_ID); layersize.h = cDomObject.getHeight(cDragable.CS_WIREFRAME_ID); }
    else
    { 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 {
        if (this.bWireframe)
        { var hWF = document.getElementById(cDragable.CS_WIREFRAME_ID); cDomObject.setStyle(hWF, 'width', (layersize.w + dX) + 'px'); }
        else
        { hElement.style.width = (layersize.w + dX) + 'px'; } 
    }
    if (nH < cDragable.CA_MIN_CONSTRAINTS[1])
    { hRet[1] = false; }
    else {
        if (this.bWireframe)
        { var hWF = document.getElementById(cDragable.CS_WIREFRAME_ID); cDomObject.setStyle(hWF, 'height', (layersize.h + dY) + 'px'); }
        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'); }
    var hElement = document.getElementById(this.sId); if (this.bWireframe) {
        var hWF = document.getElementById(cDragable.CS_WIREFRAME_ID); cDomObject.setStyle(hElement, 'left', cDomObject.getLeft(hWF) + 'px'); cDomObject.setStyle(hElement, 'top', cDomObject.getTop(hWF) + 'px'); cDomObject.setStyle(hElement, 'width', cDomObject.getWidth(hWF) + 'px'); cDomObject.setStyle(hElement, 'height', cDomObject.getHeight(hWF) + 'px'); if (hElement.ondragresize)
        { hElement.ondragresize.call(this, this.sId); }
        cDomObject.setStyle(hWF, 'visibility', 'hidden');
    } 
}
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); }
    cDragable.sWireframeId = cDragable.CS_WIREFRAME_ID; var hWF = document.createElement('div'); hWF.id = cDragable.sWireframeId; cDomObject.addNodeClass(hWF, cDragable.CS_WIREFRAME_CLASS); document.body.appendChild(hWF);
}
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 CHEMBEDDABLE_NOPROTECT = /\.(gif|jpg|jpeg|png)/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); }
        if (cDomObject.isIE && !cDomObject.isIE7)
        { hOverlay.style.width = cDomObject.getDocumentWidth() + 16 + 'px'; }
        else
        { hOverlay.style.width = cDomObject.getDocumentWidth() + 'px'; }
        hOverlay.style.height = cDomObject.getDocumentHeight() + 'px'; if (cDomObject.isIE && !cDomObject.isIE7) {
            { 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'; if (cDomObject.isIE) {
                if (cDomObject.isIE && !cDomObject.isIE7)
                { 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; }
        if (cDomObject.isIE && !cDomObject.isIE7)
        { hOverlay.style.width = cDomObject.getViewportWidth() + 16 + 'px'; }
        else
        { hOverlay.style.width = cDomObject.getViewportWidth() + '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'; }
        if (hContentFrame)
        { hContentFrame.style.height = cDomObject.getHeight(hFrameHolder) + '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 || hAttr.bResizable) {
            if (!hAttr.bDragable)
            { hWindow.setAttribute('draghandle', 'Title0x00' + hWindow.id); }
            else
            { 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); if (hAttr.sContent.match(CHEMBEDDABLE_NOPROTECT))
                    { cDomObject.addNodeClass(hContent.parentNode, 'dmxNoProtect'); } 
                }
                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'; cDomObject.setStyle(hFrameHolder, 'background-color', hAttr.sContentBgColor); 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;
            }
            if (hAttr.bWireframe)
            { cDomObject.addNodeClass(hWin, 'elementDragWireframe'); }
            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.top = nStartTop + 'px'; hWin.style.left = nStartLeft + 'px'; var nMoveSteps = Math.floor(hAttr.nStartDelay / 1000 * CNFPS); hE = new cMoEffects.cMover(hWin.id, null, null, nLeft, nTop, nShowEffect, false, { nSteps: nMoveSteps, nDuration: hAttr.nStartDelay });
        }
        else
        { nTop = nTop < 0 ? 0 : nTop; hWin.style.left = nLeft + 'px'; hWin.style.top = nTop + 'px'; }
        if (hAttr.bFadeIn)
        { 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; if (hWin.dmxData.hAttr.hCloseTimeout)
            { window.clearTimeout(hWin.dmxData.hAttr.hCloseTimeout) }
            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)
            { 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.bWireframe = false; this.bShadow = true; this.sContentBgColor = '#ffffff'; 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.isOpera = (navigator.userAgent.toLowerCase().indexOf('opera') > -1); cMoEffects.isIE = (window.ActiveXObject) && !cMoEffects.isOpera; cMoEffects.isIE7 = cMoEffects.isIE && (navigator.userAgent.indexOf('msie 7') >= 0); cMoEffects.easing = { easeNone: function(t, b, c, d) { return c * t / d + b; }, easeIn: function(t, b, c, d) { return c * (t /= d) * t + b; }, easeOut: function(t, b, c, d) { return -c * (t /= d) * (t - 2) + b; }, easeBoth: function(t, b, c, d) {
        if ((t /= d / 2) < 1) { return c / 2 * t * t + b; }
        return -c / 2 * ((--t) * (t - 2) - 1) + b;
    }, easeInStrong: function(t, b, c, d) { return c * (t /= d) * t * t * t + b; }, easeOutStrong: function(t, b, c, d) { return -c * ((t = t / d - 1) * t * t * t - 1) + b; }, easeBothStrong: function(t, b, c, d) {
        if ((t /= d / 2) < 1) { return c / 2 * t * t * t * t + b; }
        return -c / 2 * ((t -= 2) * t * t * t - 2) + b;
    }, elasticIn: function(t, b, c, d, a, p) {
        if (t == 0) { return b; }
        if ((t /= d) == 1) { return b + c; }
        if (!p) { p = d * .3; }
        if (!a || a < Math.abs(c)) { a = c; var s = p / 4; }
        else { var s = p / (2 * Math.PI) * Math.asin(c / a); }
        return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
    }, elasticOut: function(t, b, c, d, a, p) {
        if (t == 0) { return b; }
        if ((t /= d) == 1) { return b + c; }
        if (!p) { p = d * .3; }
        if (!a || a < Math.abs(c)) { a = c; var s = p / 4; }
        else { var s = p / (2 * Math.PI) * Math.asin(c / a); }
        return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
    }, elasticBoth: function(t, b, c, d, a, p) {
        if (t == 0) { return b; }
        if ((t /= d / 2) == 2) { return b + c; }
        if (!p) { p = d * (.3 * 1.5); }
        if (!a || a < Math.abs(c)) { a = c; var s = p / 4; }
        else { var s = p / (2 * Math.PI) * Math.asin(c / a); }
        if (t < 1) { return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; }
        return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
    }, backIn: function(t, b, c, d, s) {
        if (typeof s == 'undefined') { s = 1.70158; }
        return c * (t /= d) * t * ((s + 1) * t - s) + b;
    }, backOut: function(t, b, c, d, s) {
        if (typeof s == 'undefined') { s = 1.70158; }
        return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
    }, backBoth: function(t, b, c, d, s) {
        if (typeof s == 'undefined') { s = 1.70158; }
        if ((t /= d / 2) < 1) { return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b; }
        return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
    }, bounceIn: function(t, b, c, d) { return c - cMoEffects.easing.bounceOut(d - t, 0, c, d) + b; }, bounceOut: function(t, b, c, d) {
        if ((t /= d) < (1 / 2.75)) { return c * (7.5625 * t * t) + b; } else if (t < (2 / 2.75)) { return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b; } else if (t < (2.5 / 2.75)) { return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b; }
        return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
    }, bounceBoth: function(t, b, c, d) {
        if (t < d / 2) { return cMoEffects.easing.bounceIn(t * 2, 0, c, d) * .5 + b; }
        return cMoEffects.easing.bounceOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b;
    } 
    }; 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); }
        this.hOptions.nInterval = this.nInterval; if (this.hOptions.easing == undefined)
        { this.hOptions.easing = cMoEffects.easing.easeIn; }
        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 nDelta = this.nEndOpacity - this.nStartOpacity; for (var nI = 0; nI < this.hOptions.nSteps - 1; nI++)
        { this.aOpacities[nI] = Math.round(this.hOptions.easing(nI * this.hOptions.nInterval, this.nStartOpacity, nDelta, this.hOptions.nDuration) * 100) / 100; }
        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 (typeof hElement.style.filter == 'string') {
                    if (cMoEffects.isIE && !cMoEffects.isIE7)
                    { window.setTimeout(function() { hElement.style.filter = 'alpha(opacity=' + parseFloat(nValue) + ')'; }, 1); }
                    else
                    { hElement.style.filter = 'alpha(opacity=' + parseFloat(nValue) + ')'; }
                    if (!hElement.currentStyle || !hElement.currentStyle.hasLayout)
                    { hElement.style.zoom = 1; } 
                }
                else {
                    nValue = nValue / 100; hElement.style['opacity'] = nValue; try
{ hElement.style['MozOpacity'] = nValue; }
                    catch (hE)
{ } 
                } 
            }
            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 nDeltaR = nEndR - nStartR; var nDeltaG = nEndG - nStartG; var nDeltaB = nEndB - nStartB; var nColor; for (var nI = 0; nI < this.hOptions.nSteps - 1; nI++)
        { nColor = this.hOptions.easing(nI * this.hOptions.nInterval, nStartR, nDeltaR, this.hOptions.nDuration) << 16 | this.hOptions.easing(nI * this.hOptions.nInterval, nStartG, nDeltaG, this.hOptions.nDuration) << 8 | this.hOptions.easing(nI * this.hOptions.nInterval, nStartB, nDeltaB, this.hOptions.nDuration); 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) {
        if (hOptions == undefined && typeof nType == 'object')
        { hOptions = nType; }
        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.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; var sX = this.nStartWidth; var sY = this.nStartHeight; for (nI = 0; nI < this.hOptions.nSteps - 1; nI++)
        { this.aSizes[nI] = { w: this.hOptions.easing(nI * this.hOptions.nInterval, sX, dX, this.hOptions.nDuration), h: this.hOptions.easing(nI * this.hOptions.nInterval, sY, dY, this.hOptions.nDuration) }; }
        this.aSizes[nI] = { w: this.nEndWidth, h: this.nEndHeight };
    }
    cMoEffects.cResizer.prototype.playAgain = function(nStartWidth, nStartHeight, nEndWidth, nEndHeight, nType) {
        var aSize = [cDomObject.getWidth(this.sId), cDomObject.getHeight(this.sId)]
        this.nStartWidth = nStartWidth != null ? nStartWidth : aSize[0]; this.nStartHeight = nStartHeight != null ? nStartHeight : aSize[1]; this.nEndWidth = nEndWidth != null ? nEndWidth : aSize[0]; this.nEndHeight = nEndHeight != null ? nEndHeight : aSize[1]; 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) {
        if (hOptions == undefined && typeof nType == 'object')
        { hOptions = nType; }
        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.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; var sX = this.nStartX; var sY = this.nStartY; for (nI = 0; nI < this.hOptions.nSteps - 1; nI++)
        { this.aPositions[nI] = { left: this.hOptions.easing(nI * this.hOptions.nInterval, sX, dX, this.hOptions.nDuration), top: this.hOptions.easing(nI * this.hOptions.nInterval, sY, dY, this.hOptions.nDuration) }; }
        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 aXY = [cDomObject.getLeft(this.sId), cDomObject.getTop(this.sId)]; this.nStartX = (nStartX == null) ? aXY[0] : nStartX; this.nStartY = (nStartY == null) ? aXY[1] : nStartY; 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'; } 
    }


    function dmxAdvLayerPopup(sTitle, sURL, sPopupName, sContent, sClass, nPositionLeft, nPositionRight, nWidth, nHeight, nAutoCloseTime, bDragable, bResizable, bOverlay, nOverlayOpacity, sIncomingEffect, sIncomingEffectEasing, nIncomingEffectDuration, bFadeIn, sOutgoingEffect, sOutgoingEffectEasing, nOutgoingEffectDuration, bFadeOut, sSlideEffect, nEffectTime, nSlideTime, bClosable, bWireframe, bgContentColor) { // v1.05
        var aURL, aSlides = sURL.split('|');
        if (aSlides && aSlides.length > 1) {
            aURL = [];
            for (var si = 0; si < aSlides.length; si++) {
                var cf = aSlides[si], nW = '', nH = '', nS = '';
                if (cf.substr(cf.length - 1, 1) == ']') {
                    var bd = cf.lastIndexOf('[');
                    if (bd > 0) {
                        var di = cf.substring(bd + 1, cf.length - 1);
                        var da = di.split('x');
                        nW = da[0]; nH = da[1];
                        if (da.length == 3) nS = da[2];
                        cf = cf.substring(0, bd)
                    }
                }
                aURL[si] = new Object();
                aURL[si].src = cf;
                aURL[si].nWidth = (nW != '' ? nW : nWidth);
                aURL[si].nHeight = (nH != '' ? nH : nHeight);
                aURL[si].nDelay = (nS != '' ? nS : nSlideTime);
            }
        } else aURL = sURL;
        if (!cDMXPopupWindow) {
            alert('The Advanced Layer Popup script is missing on your website!\nPlease upload the file ScriptLibrary/advLayerPopup.js to your live server.');
        } else {
            if (sClass == 'OS_Look') sClass = (navigator.userAgent.toLowerCase().indexOf('mac') != -1 ? 'dmxOSX' : 'dmxXP');
            cDMXPopupWindow.buildWindow({ sTitle: sTitle, sURL: aURL, sPopupName: sPopupName, sContent: sContent, sClass: sClass, aPosition: [nPositionLeft, nPositionRight], aSize: [nWidth, nHeight], nCloseDelay: nAutoCloseTime, bDragable: bDragable, bResizable: bResizable, bOverlay: bOverlay, nOverlayOpacity: nOverlayOpacity, sStartPosition: sIncomingEffect, sStartShowEffect: sIncomingEffectEasing, nIncomingEffectDuration: nIncomingEffectDuration, bFadeIn: bFadeIn, sEndPosition: sOutgoingEffect, sEndShowEffect: sOutgoingEffectEasing, nOutgoingEffectDuration: nOutgoingEffectDuration, bFadeOut: bFadeOut, sSlideEffect: sSlideEffect, nEffectTime: nEffectTime, nSlideTime: nSlideTime, bClosable: bClosable, bWireframe: bWireframe, sContentBgColor: bgContentColor });
        }
        document.MM_returnValue = false;
    }
