/*================================================================================*/
/*                                                                                */
/*             BW2Technologies.Web.JScript.Framework (Alpha V1.0.0.0)             */
/*                                                                                */
/*                             Web-Framework Global                               */
/*                                                                                */
/*              Copyright © 2006-2007 by BW2Technologies (HP. Lassnig)            */
/*                                                                                */
/*================================================================================*/

var _oActiveObject = null;
var _oResizeObjects = new Array();
var _oSkinImages = new Array();
var _oSkinCssClasses = new Array();
var _oWindowWait = null;

var _fSyncLock = false;
var _fResizeEvent = false;

var _nCount = 0, _nStep = 0, _nStepTime = 0, _nStepValue = 0, _nStepWidth = 0;
var _nWindowWaitLeft = 0, _nWindowWaitTop = 0;

/*--------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------*/


/*================================================================================*/
/* <Function> FrameWork Error </Function>
/*================================================================================*/
function __bw2FrameworkError(strName, strDescription, lNumber) {
	       this.name = strName;
	       this.description = strDescription;
	       this.number = lNumber;

	       return this;
}

/*--------------------------------------------------------------------------------*/

__bw2FrameworkError.prototype.toString = function() { return this.name + " " + this.description; }

/*================================================================================*/
/* <Function> Add to Event-Listener </Function>
/*================================================================================*/
function __bw2AddEventListener(oObj, strEvent, refEventFunction, fCapture) {
         if (!(oObj = __bw2GetElementById(oObj))) return; //{ alert('__bw2AddEventListener no Object'); return; }
         strEvent = strEvent.toLowerCase();

         //if ((!_fIE4Up && !_fOp7Up && !_fNs8) && oObj == window) {
         if ((!_fIE4Up && !_fOp7Up && !_fNs8 && oObj != window)) {
            if (strEvent == 'resize') { 
               window.ClientWidth = __bw2WindowWidth(); 
               window.ClientHeight = __bw2WindowHeight(); 

               if (window.EventResizeFunctions == null) window.EventResizeFunctions = new Array();
               
               if (oObj.id != null) {
                  var oSet = new Object();

                  oSet.Function = refEventFunction; 
                  oSet.ID = oObj.id; 
                  oSet.OldWidth = oObj.offsetWidth;
                  oSet.OldHeight = oObj.offsetHeight;
               
                  window.EventResizeFunctions[window.EventResizeFunctions.length] = oSet;

                  if (!_fResizeEvent) __bw2ResizeEvent();
               }
                
               return; 
            }

            if (strEvent == 'scroll') { 
               window.nScrollLeft = __bw2ScrollLeft(); 
               window.nScrollTop = __bw2ScrollTop(); 
               window.refEventScroll = refEventFunction; 
               __bw2ScrollEvent(); 
               return; 
            } 
         }

         try {
             if (oObj.addEventListener) {
                //__bw2Debug('oObj.addEventListener');         
                oObj.addEventListener(strEvent, refEventFunction, fCapture);
             } else if (oObj.attachEvent) {
               oObj.attachEvent('on' + strEvent, refEventFunction);

               if (fCapture == true) { 
                  //__bw2Debug('oObj.attachEvent : ' + strEvent + ', ' + fCapture);         
                  //oObj.setCapture();
               } 
            } else {
               //__bw2Debug('eval');         
               eval('oObj.on' + strEvent + ' = refEventFunction');
            }
         } catch (e) {
//             alert('__bw2AddEventListener : ' + e);
         }
}

/*================================================================================*/
/* <Function> Remove from Event-Listener </Function>
/*================================================================================*/
function __bw2RemoveEventListener(oObj, strEvent, refEventFunction, fCapture) {
         if (!(oObj = __bw2GetElementById(oObj))) return;
         strEvent = strEvent.toLowerCase();
         
         if (oObj.removeEventListener) {
            oObj.removeEventListener(strEvent, refEventFunction, fCapture);
//__bw2Debug('removeEventListener');
         } else if (oObj.detachEvent) {
            //if (fCapture) oObj.releaseCapture();
            oObj.detachEvent('on' + strEvent, refEventFunction);

//__bw2Debug('detachEvent');
         } else {
            eval('oObj.on' + strEvent + ' = null');
//__bw2Debug('eval');
         }
}

/*================================================================================*/
/* <Function> Set Active-Object </Function>
/*================================================================================*/
function __bw2SetActiveObject(oObject) {
         if (oObject == null) return;
         
         try {
             var oHidden = __bw2GetElementById('__ACTIVEOBJECT');

             _oActiveObject = oObject;
             oHidden.value = _oActiveObject.id;

             //__bw2Debug('Set Active-Object : ' + _oActiveObject.id);
         } catch (ex) {
         }
}

/*================================================================================*/
/* <Function> Resize Object-Childs </Function>
/*================================================================================*/
function __bw2ChildResize(oObject, strTag) {
         if (strTag == null) strTag = 'DIV';

         for (nI = 0; nI < oObject.childNodes.length; nI++) {
             if ((oObject.childNodes[nI].tagName == strTag) && (oObject.childNodes[nI].NoResize != true)) {
                with (oObject.childNodes[nI]) {
                     if (_fIE) {
                        style.width = oObject.offsetWidth;
                        style.height = oObject.offsetHeight;
                     } else {
                        style.width = oObject.offsetWidth - parseInt(style.borderLeftWidth) - parseInt(style.borderRightWidth);
                        style.height = oObject.offsetHeight - parseInt(style.borderTopWidth) - parseInt(style.borderBottomWidth);
                     }   
                }
             }
         }
}

/*================================================================================*/
/* <Function> Get Valid-Date </Function>
/*================================================================================*/
function __bw2IsValidDate(Day, Mn, Yr){

         var DateVal = Mn + "/" + Day + "/" + Yr;
         var dDate = new Date(DateVal);

         if (Date.getDate() != Day){
            alert('Invalid Date');
            return(false);
         } else if (Date.getMonth() != Mn-1) {
           //this is for the purpose JavaScript starts the month from 0
            alert('Invalid Date');
            return(false);
         } else if (Date.getFullYear() != Yr) {
            alert('Invalid Date');
            return(false);
         }
        
         return(true);
 }
 
/*================================================================================*/
/* <Function> Get Client-Height </Function>
/*================================================================================*/
function __bw2WindowHeight() {
         var nH = 0;
         
         if (_fOp6Dn) nH = window.innerHeight;
         else if (document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientHeight)
            nH = document.documentElement.clientHeight;
         else if (document.body && document.body.clientHeight)
            nH = document.body.clientHeight;
         else if (__bw2Def(window.innerWidth, window.innerHeight, document.width)) {
            nH = window.innerHeight;
            if (document.width > window.innerWidth) nH -= 16;
         }

         return nH;
}

/*================================================================================*/
/* <Function> Get Client-Width </Function>
/*================================================================================*/
function __bw2WindowWidth() {
         var nW = 0;
  
         if (_fOp6Dn) nW = window.innerWidth;
         else if (document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientWidth) nW = document.documentElement.clientWidth;
         else if (document.body && document.body.clientWidth) nW = document.body.clientWidth;
         else if (__bw2Def(window.innerWidth, window.innerHeight, document.height)) {
            nW = window.innerWidth;
            if (document.height > window.innerHeight) nW -= 16;
         }
  
         return nW;
}

/*================================================================================*/
/* <Function> Def </Function>
/*================================================================================*/
function __bw2Def() {
         for (var nI = 0; nI < arguments.length; ++nI) {
             if (typeof(arguments[nI]) == 'undefined') return false;
         }
         
         return true;
}

/*================================================================================*/
/* <Function> EventClientX </Function>
/*================================================================================*/
function __bw2EventClientX(oEvent) {
         if (_fIE) { return oEvent.clientX; } else { return oEvent.pageX; }
}

/*================================================================================*/
/* <Function> EventClientY </Function>
/*================================================================================*/
function __bw2EventClientY(oEvent) {
         if (_fIE) { return oEvent.clientY; } else { return oEvent.pageY; }
}

/*================================================================================*/
/* <Function> EventOffsetX </Function>
/*================================================================================*/
function __bw2EventOffsetX(oEvent) {
         if (_fIE) { return oEvent.offsetX; } else { return oEvent.layerX; }
}

/*================================================================================*/
/* <Function> EventOffsetY </Function>
/*================================================================================*/
function __bw2EventOffsetY(oEvent) {
         if (_fIE) { return oEvent.offsetY; } else { return oEvent.layerY; }
}

/*================================================================================*/
/* <Function> EventClientY </Function>
/*================================================================================*/
function __bw2EventSource(oEvent, strType) {
         if (!oEvent) return null;
         
         try{
             if (!strType) {
               if (_fIE) { return oEvent.srcElement; } else { return oEvent.target; }
             } else {
                switch(strType.toLowerCase) {
                      case 'from' :
                           if (_fIE) { return oEvent.fromElement; } else { return oEvent.relatedTarget; }
                           break;
                      case 'src' :
                           if (_fIE) { return oEvent.srcElement; } else { return oEvent.target; }
                           break;
                      case 'to' :
                           if (_fIE) { return oEvent.toElement; } else { return oEvent.currentTarget; }
                           break;
                      default :                     
                           if (_fIE) { return oEvent.fromElement; } else { return oEvent.relatedTarget; }
                           break;
                }
             }
         } catch (e) {
             alert('__bw2EventSource : ' + e);
             return null;
         }
}

/*================================================================================*/
/* <Function> Get Element by ID </Function>
/*================================================================================*/
function __bw2GetClientInfo() {
         try {
             var oCI = __bw2GetElementById('__CLIENTINFO'); 
             var strD = window.screen.width + '&';

             strD += window.screen.height + '&';
             strD += window.screen.colorDepth; 
             
             if (oCI != null) oCI.value = strD;
                
             /*--- Ajax Posted Information ---*/ 
             __bw2AjaxPost('__CLIENTINFO', _strAjaxURL, strD);
         } catch (e) {
         }
}

/*================================================================================*/
/* <Function> Get Element by ID </Function>
/*================================================================================*/
function __bw2GetElementById(oObj) {
         if (typeof(oObj) != 'string') return oObj;
         if (document.getElementById) oObj = document.getElementById(oObj);
         else if (document.all) oObj = document.all[oObj];
         else oObj = null;
         return oObj;
}

/*================================================================================*/
/* <Function> Get BW2-Form Object </Function>
/*================================================================================*/
function __bw2GetFormObject(oObj) {
         try {
             if ((oObj.Type) && (oObj.Type == 'form')) {
                return oObj;
             } else if (oObj.parentElement != null) {
__bw2Debug('parentElement');             
                return __bw2GetFormObject(oObj.parentElement);
             } else if (oObj.parentNode != null) {
__bw2Debug('parentNode');             
                return __bw2GetFormObject(oObj.parentNode);
             } else {
__bw2Debug('No Parents');             
             }
         } catch (e) {
             __bw2Debug('__bw2GetFormObject Error : ' + e);
         }
}

/*================================================================================*/
/* <Function> Get Cursor-Position </Function>
/*================================================================================*/
function __bw2GetCursorPosition(oObj) {
    oObj = oObj || window.event;

    var aCursor = {x:0, y:0};

    if (oObj.pageX || oObj.pageY) {
       aCursor.x = oObj.pageX;
       aCursor.y = oObj.pageY;
    } else {
       var oDE = document.documentElement;
       var oB = document.body;
        aCursor.x = oObj.clientX + (oDE.scrollLeft || oB.scrollLeft) - (oDE.clientLeft || 0);
        aCursor.y = oObj.clientY + (oDE.scrollTop || oB.scrollTop) - (oDE.clientTop || 0);
    }
    
    return aCursor;
}

/*================================================================================*/
/* <Function> Gib Nummer </Function>
/*================================================================================*/
function __bw2GetNumber(strValue) {
         if (strValue == null) return;
         var nN =  Number(strValue.replace(/px/, ''));
         return nN;
}

/*================================================================================*/
/* <Function> Get encoded HTML </Function>
/*================================================================================*/
function __bw2HTMLEncode(strData) {
         var strBuffer = '';

         for (nI = 0; nI < strData.length; nI++) {
             var cC = strData.charAt(nI); 

             if (cC >= 'a' && cC <= 'z' || cC >= 'A' && cC <= 'Z' || cC >= '0' && cC <= '9') {
                strBuffer += cC;
             } else {
                strBuffer += '&amp;#' + strData.charCodeAt(nI) + ';';
             }

             alert('Buffer : ' + strBuffer);
         }

         return strData;
}

/*================================================================================*/
/* <Function> Get decoded HTML </Function>
/*================================================================================*/
function __bw2HTMLDecode(strData) {
         var strBuffer = '';

         for (nI = 0; nI < strData.length; nI++) {
             var cC = strData.charAt(nI); 

             if (cC >= 'a' && cC <= 'z' || cC >= 'A' && cC <= 'Z' || cC >= '0' && cC <= '9') {
                strBuffer += cC;
             } else {
                strBuffer += '&amp;#' + strData.charCodeAt(nI) + ';';
             }

             alert('Buffer : ' + strBuffer);
         }

         return strData;
}

/*================================================================================*/
/* <Function> Num </Function>
/*================================================================================*/
function __bw2Num() {
         for (var nI = 0; nI < arguments.length; ++nI) { 
             if (isNaN(arguments[i]) || typeof(arguments[i])!='number') return false;
         }

         return true;
}

/*================================================================================*/
/* <Function> Neu anordnen der Content-Componenten </Function>
/*================================================================================*/
function __bw2ReorderContent(oObj) {
         try {
             if (oObj.childNodes.length > 0) {
                var oPrev = null;
                var nH = 0;
                
                if (_fIE) {
                   for (nI = 0; nI < oObj.childNodes.length; nI++) {
                       var oCN = oObj.childNodes[nI];

//alert('__bw2ReorderContent ' + oCN.id + ', ' + oCN.Type);

                       if ((oCN.Type == null) || (oCN.Type == 'menubar')) {
                          var oMB = oCN.childNodes[0];

                          oCN.style.width = oMB.offsetWidth;

                          if (oPrev != null) {
                             var nPO = oPrev.offsetLeft + oPrev.offsetWidth;
                             var nPW = oObj.offsetWidth - oCN.offsetWidth;

                             if (nPO < nPW) {
                                oCN.style.position = 'absolute';
                                oCN.style.left = nPO + 1;
                                oCN.style.top = oPrev.offsetTop;
                             } else {
                                oCN.style.position = 'relative';
                                oCN.style.left = 0;
                                oCN.style.top = 0;
                             }
                          }

                          oPrev = oCN;
                       }
                   }
                } else {
                   var oC = oObj.childNodes; 

                   for (nI = 0; nI < oC.length; nI++) {
                       var oChild = oC[nI];
                       
                       try {
                           if ((oChild.id == null) || (oChild.Type != 'menubar')) oChild = null;
                       } catch (e) {
                           oChild = null;
                       }

                       if (oChild != null) {
//__bw2Debug('Reorder : ' + oChild.id);
                          var oCN = oChild;
                          var oCNC = oCN.childNodes;
                          var oMB = oCNC[1];

                          oCN.style.width = oMB.offsetWidth;

                          if (oPrev != null) {
                             var nPO = oPrev.offsetLeft + oPrev.offsetWidth;
                             var nPW = oObj.offsetWidth - oMB.offsetWidth + 19;
  
//alert('Reorder : ' + oChild.id + ', ' + nPO + ', ' + nPW);
                       
                             if (nPO < nPW) {
                                oCN.style.position = 'absolute';
                                oCN.style.left = nPO + 1;
                                oCN.style.top = oPrev.offsetTop;
                             } else {
                                oCN.style.position = 'relative';
                                oCN.style.left = 0;
                                oCN.style.top = 0;
                             }
                          }

                          oPrev = oCN;
                       }     
                   } 
                   return; 
                }
             }    

         } catch (e) { 
         }
}

/*================================================================================*/
/* <Function> Resize </Function>
/*================================================================================*/
function __bw2ResizeEvent() {
         _fResizeEvent = true; 

         _nCount += 1;

         try {
             for (oI in window.EventResizeFunctions) {
                 var oObj = window.EventResizeFunctions[oI];
                 var oElem = __bw2GetElementById(oObj.ID);

                 if (oElem != null && (oObj.OldWidth != oElem.offsetWidth || oObj.OldHeight != oElem.offsetHeight)) { 
                    //__bw2Debug('Resize : ' + oObj.ID + ', ' + _nCount + '\n\r' + oObj.Function);
                    oObj.OldWidth = oElem.offsetWidth; 
                    oObj.OldHeight = oElem.offsetHeight;

                    if (oObj.Function) oObj.Function(oElem);
                 }
             }
         } catch (e) {
         }

         setTimeout('__bw2ResizeEvent()', 250);
}

/*================================================================================*/
/* <Function> Event Scroll </Function>
/*================================================================================*/
function __bw2ScrollEvent() {
         if (window.refEventScroll) setTimeout('__bw2ScrollEvent()', 250);
  
         var nSL = __bw2ScrollLeft();
         var nST = __bw2ScrollTop();
  
         if (window.nScrollLeft != nSL || window.nScrollTop != nST) { 
            window.nScrollLeft = sl; 
            window.nScrollTop = st; 
            if (window.refEventScroll) window.refEventScroll(); 
         }
}

/*================================================================================*/
/* <Function> Scroll-Left </Function>
/*================================================================================*/
function __bw2ScrollLeft(oObj, fWin) {
         var nOffset=0;

         if (!__bw2Def(oObj) || fWin || oObj == document || oObj.tagName.toLowerCase() == 'html' || oObj.tagName.toLowerCase() == 'body') {
            var oW = window;
     
            if (fWin && oObj) oW = oObj;
            if (oW.document.documentElement && oW.document.documentElement.scrollLeft) nOffset = oW.document.documentElement.scrollLeft;
            else if (oW.document.body && __bw2Def(oW.document.body.scrollLeft)) nOffset = oW.document.body.scrollLeft;
         } else {
            oObj = __bw2GetElementById(oObj);
            if (oObj && __bw2Num(oObj.scrollLeft)) nOffset = oObj.scrollLeft;
         }
  
         return nOffset;
}

/*================================================================================*/
/* <Function> Scroll-Top </Function>
/*================================================================================*/
function __bw2ScrollTop(oObj, fWin) {
         var nOffset=0;

         if (!__bw2Def(oObj) || fWin || oObj == document || oObj.tagName.toLowerCase() == 'html' || oObj.tagName.toLowerCase() == 'body') {
            var oW = window;
            
            if (fWin && oObj) oW = oObj;
            if (oW.document.documentElement && oW.document.documentElement.scrollTop) nOffset = oW.document.documentElement.scrollTop;
            else if (oW.document.body && __bw2Def(oW.document.body.scrollTop)) nOffset = oW.document.body.scrollTop;
         } else {
            oObj = xGetElementById(oObj);
            if (oObj && __bw2Num(oObj.scrollTop)) nOffset = oObj.scrollTop;
         }
  
         return oOffset;
}

/*================================================================================*/
/* <Function> Set Focus by Object-Name </Function>
/*================================================================================*/
function __bw2setFocusByObject(oObj, fSelected) {
         if (fSelected == true) oObj.select();
         oObj.focus();
}

/*================================================================================*/
/* <Function> Set Focus by Object-Name </Function>
/*================================================================================*/
function __bw2SetFocusByObjectName(strObjectName, fSelected) {
         try {
             var oObj = document.getElementById(strObjectName);
             if (oObj == null) return;
             if (fSelected == true) oObj.select();
             oObj.focus();
         } catch (ex) {
         }
}

/*--------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------*/


/*================================================================================*/
/* <Function> Ermittle Left-Pos eines Objektes </Function>
/*================================================================================*/
function __bw2ObjectOffsetLeft(oObj) {

         var nOffsetLeft = oObj.offsetLeft;
         var oOffsetParent = oObj.offsetParent;

         while (oOffsetParent) {
              nOffsetLeft += oOffsetParent.offsetLeft;
              oOffsetParent = oOffsetParent.offsetParent;
         }
       
         return nOffsetLeft;
}

/*================================================================================*/
/* <Function> Ermittle Top-Pos eines Objektes </Function>
/*================================================================================*/
function __bw2ObjectOffsetTop(oObj) {

         var nOffsetTop = oObj.offsetTop;
         var oOffsetParent = oObj.offsetParent;

         while (oOffsetParent) {
               nOffsetTop += oOffsetParent.offsetTop;
               oOffsetParent = oOffsetParent.offsetParent;
         }
       
         return nOffsetTop;
}

/*================================================================================*/
/* <Function> Verschiebe DHTML-Object </Function>
/*================================================================================*/
function __bw2ObjectMove(oEvent) {
         var oEO;
         var oSrc = __bw2EventSource(oEvent);
         var oBSrc = oSrc;
         var oForm = __bw2GetElementById('oForm');
         var nOffX = 0;
         var nOffY = 0;

         if (!oSrc) return;
         if (oSrc.BaseObject) oBSrc = oSrc.BaseObject;

         if ((oBSrc.Type) && (oBSrc.Type == 'form')) {
            if (oBSrc.WindowState == -1) {
               oBSrc.Minimize();
               return;
            }
            if (!oBSrc.Moving) return;
         }
         
         __bw2ZOrder(oSrc);

         if (!oSrc.Moving) return;
         //if (!oForm.Moving) return;
         if (oSrc.BaseObject) oBSrc = oSrc.BaseObject;
         if (oForm) oEO = oForm; else oEO = oBSrc;
         
         window.ObjectMove = oBSrc;
                   
         try {
             nOffX = oEvent.clientX - window.ObjectMove.offsetLeft
             nOffY = oEvent.clientY - window.ObjectMove.offsetTop

             __bw2AddEventListener(oEO, 'mousemove', _ObjectMove, false);
             __bw2AddEventListener(oEO, 'mouseup', _ObjectMoveEnd, false);

         } catch (e) {
             alert('__bw2ObjectMove : ' + e);
         }

         function _ObjectMove(oEvent) {
                  window.ObjectMove.style.left = oEvent.clientX - nOffX;
                  window.ObjectMove.style.top = oEvent.clientY - nOffY;
                  //__bw2Debug('__bw2ObjectMove:_ObjectMove -> ' + oEvent.clientX + ', ' + oEvent.clientY);
         }

         function _ObjectMoveEnd(oEvent) {
                  window.ObjectMove.OffsetX = window.ObjectMove.offsetLeft;
                  window.ObjectMove.OffsetY = __bw2WindowHeight() - window.ObjectMove.offsetTop;
                  
                  __bw2RemoveEventListener(oEO, 'mousemove', _ObjectMove, false);
                  __bw2RemoveEventListener(oEO, 'mouseup', _ObjectMoveEnd, false);
                  //__bw2Debug('__bw2ObjectMove:_ObjectMoveEnd -> ' + window.ObjectMove.OffsetX + ', ' + window.ObjectMove.OffsetY);
         }
}

/*================================================================================*/
/* <Function> Close Node (Slide) </Function>
/*================================================================================*/
function __bw2ObjectBlend(oObj, strMode, nStepTime, nSteps) {
         if (oObj == null) return;

         _oActiveObject = oObj;
         _nStepTime = nStepTime;
         _nStepWidth = nSteps;

         /*--- Blend IN ---*/
         if (strMode.toUpperCase() == 'IN') {
            _nStep = 0;
            _nStepValue = 0;
            setTimeout('__bw2ObjectBlendIn()', _nStepTime);
         } else if (_fIE) {
            _nStep = nSteps;
            _nStepValue = 100;
            setTimeout('__bw2ObjectBlendOut()', _nStepTime);
         } else if (_fFox) {
            _nStep = nSteps;
            _nStepValue = 1;
            setTimeout('__bw2ObjectBlendOut()', _nStepTime);
         }
}

/*--------------------------------------------------------------------------------*/

function __bw2ObjectBlendIn() {
         try {
             if (_oActiveObject.style.display != 'block') _oActiveObject.style.display = 'block';

             if (_fIE) {
                _oActiveObject.style.filter = 'progid:dximagetransform.microsoft.alpha(style=0, opacity=' + _nStepValue + ')';

                _nStep += 1;
                _nStepValue = (100 / _nStepWidth) * _nStep;
   
                if (_nStepValue < 100) {
                   setTimeout('__bw2ObjectBlendIn()', _nStepTime);
                } else {
                   try {
                       if (_oActiveObject.Type == 'form') {
                          __bw2ZOrder(_oActiveObject, 'form');
                          //_oActiveObject.Activate();
                       } else {
                          _oActiveObject.style.filter = 'progid:dximagetransform.microsoft.alpha(style=0, opacity=100)';
                       }
                   } catch (e) {
                   }
                }

             } else if (_fFox) {
                if (_nStepValue < 1) _oActiveObject.style.opacity = _nStepValue;

                _nStep += 1;
                _nStepValue = (1 / _nStepWidth) * _nStep;

                if (_nStepValue < 1) {
                   setTimeout('__bw2ObjectBlendIn()', _nStepTime);
                } else if (_oActiveObject.Type == 'form') {
                  __bw2ZOrder(_oActiveObject, 'form');
                  //_oActiveObject.Activate();
                } else {
                  _oActiveObject.style.opacity = 1;
                }
             }
         } catch (e) {
         }
}

/*--------------------------------------------------------------------------------*/

function __bw2ObjectBlendOut() {
         try {
             if (_fIE) {
                _oActiveObject.style.filter = 'progid:dximagetransform.microsoft.alpha(style=0, opacity=' + _nStepValue + ')';

                _nStep -= 1;
                _nStepValue = (100 / _nStepWidth) * _nStep;

             } else if (_fFox) {
                if (_nStepValue < 1) _oActiveObject.style.opacity = _nStepValue;

                _nStep -= 1;
                _nStepValue = (1 / _nStepWidth) * _nStep;
             }

             if (_nStepValue > 0) {
                setTimeout('__bw2ObjectBlendOut()', _nStepTime);

             } else if (_oActiveObject.Type == 'form') {
                _oActiveObject.style.display = 'none';
                _oActiveObject.Close();
             } else {
                _oActiveObject.style.display = 'none';
             }
         } catch (e) {
         }
}

/*================================================================================*/
/* <Function> Object Effect-Opacity (0-100) </Function>
/*================================================================================*/
function __bw2ObjectEffectOpacity(oObj, nOpacity) {
         try {
             if (_fIE) {
                oObj.style.filter = 'progid:dximagetransform.microsoft.alpha(style=0, opacity=' + nOpacity + ')';
             } else if (_fFox) {
                oObj.style.opacity = nOpacity / 100;
             }
         } catch (e) {
         }
}

/*================================================================================*/
/* <Function> Image Object </Function>
/*================================================================================*/
function __bw2Image(strName, nWidth, nHeight, strImage, strImageOnOver, strImageOnClick, strImageDisabled) {
         this.Name = strName;
         this.Width = nWidth;
         this.Height = nHeight;

         if (strImageOnOver == null) strImageOnOver = strImage;
         if (strImageOnClick == null) strImageOnClick = strImage;
         if (strImageDisabled == null) strImageDisabled = strImage;

         this.Image = strImage;
         this.ImageOnOver = strImageOnOver;
         this.ImageOnClick = strImageOnClick;
         this.ImageDisabled = strImageDisabled;

         this.ImageObject = __bw2ImageObject;

/*--------------------------------------------------------------------------------*/

         function __bw2ImageObject() {
                  var oI = new Image();
                  oI.Moving = false;
                  oI.src = this.Image;
                  oI.style.position = 'absolute';
                  return oI;
         } 
}

/*================================================================================*/
/* <Function> Warte bis Child-Window geschlossen wird </Function>
/*================================================================================*/
function __bw2WindowWaitForClose(oWindow) {
         try {
             if (oWindow != null) {
                this.Window = oWindow;
                this.WindowLeft = window.screenLeft; 
                this.WindowTop = window.screenTop - 60;

                window.moveTo(window.screenLeft, window.screen.height);
                setTimeout('__bw2WindowWaitForClose(null)', 1000)

             } else {
                if (this.Window.closed) {
                   //window.moveTo(this.WindowLeft, this.WindowTop);
                   window.close();
                } else { 
                   setTimeout('__bw2WindowWaitForClose(null)', 1000)
                }
             }
         } catch (e) {
         }
}
         
/*================================================================================*/
/* <Function> DHTML-Object nach vorne bringen </Function>
/*================================================================================*/
function __bw2ZOrder(oObj, strType) {
         if (!oObj) return;

         try{
             if ((!strType) || (strType = 'form')) {
                var oForm = __bw2GetFormObject(oObj);

                if (oForm != null) {
                   if (!window.ActiveForm) {
                      oForm.style.zIndex = 1;
                      
                   } else if (window.ActiveForm != oForm){
                      oForm.style.zIndex = Number(window.ActiveForm.style.zIndex) + 1;
                   } else {
                      return; 
                   }   

                   if (oForm.Activate) {
                      oForm.Activate();
                   } else {
                      window.ActiveForm = oForm;
                   }
                } else {
                }
             } else {
                alert('Z-Order default : ' + strType);             
             }
         } catch (e) {
             alert('__bw2ZOrder : ' + e);
         }
}

/*--------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------*/

