popup = function( aConfig){this.aEvtShw = aConfig[ "aEvtShw"] != undefined ? aConfig[ "aEvtShw"] : "";this.aEvtHde = aConfig[ "aEvtHde"] != undefined ? aConfig[ "aEvtHde"] : "";this.aEvtStp = aConfig[ "aEvtStp"] != undefined ? aConfig[ "aEvtStp"] : "";this.sRefElmId = aConfig[ "sRefElmId"] != undefined ? aConfig[ "sRefElmId"] : "";this.sPopElmId = aConfig[ "sPopElmId"] != undefined ? aConfig[ "sPopElmId"] : "";this.aCssSty = aConfig[ "aCssSty"] != undefined ? aConfig[ "aCssSty"] : "";this.sCssCla = aConfig[ "sCssCla"] != undefined ? aConfig[ "sCssCla"] : "";this.sHtm = aConfig[ "sHtm"] != undefined ? aConfig[ "sHtm"] : "";this.sPosRel = aConfig[ "sPosRel"] != undefined ? aConfig[ "sPosRel"] : "none";this.sBrdDis = aConfig[ "sBrdDis"] != undefined ? aConfig[ "sBrdDis"] : "none";this.aPopElmOff = aConfig[ "aPopOff"] != undefined ? aConfig[ "aPopOff"] : { "x" : 0, "y" : 0};this.sPpy = aConfig[ "sPpy"] != undefined ? aConfig[ "sPpy"] : "none";this.sNdeId = aConfig[ "sNdeId"] != undefined ? aConfig[ "sNdeId"] : "";this.iFdeDly = aConfig[ "iFdeDly"] != undefined ? aConfig[ "iFdeDly"] : 0;this.bDef = aConfig[ "bDef"] != undefined ? aConfig[ "bDef"] : false;this.bIniShw = aConfig[ "bIniShw"] != undefined ? aConfig[ "bIniShw"] : false;this.bDelAll = aConfig[ "bDelAll"] != undefined ? aConfig[ "bDelAll"] : false;this.bHdeMve = aConfig[ "bHdeMve"] != undefined ? aConfig[ "bHdeMve"] : false;this.oEvtIni = aConfig[ "oEvtIni"] != undefined ? aConfig[ "oEvtIni"] : "";this.shwCalPop = shwCalPop;this.shwPop = shwPop;this.hdePop = hdePop;this.mvePop = mvePop;this.isPop = isPop;this.addEvt = addEvt;this.remEvt = remEvt;this.stpEvt = stpEvt;this.getMsePos = getMsePos;this.getWinSze = getWinSze;this.getElmPos = getElmPos;this.getElmSze = getElmSze;this.getWinOff = getWinOff;this.calRelPos = calRelPos;this.chkStyPos = chkStyPos;this.chkFlpPos = chkFlpPos;this.dynMveSta = dynMveSta;this.dynMveEnd = dynMveEnd;this.setOpy = setOpy;this.mngElmEvt = mngElmEvt;this.iStsIE = ( /msie/i.test( navigator.userAgent) && ! /opera/i.test( navigator.userAgent));this.iStsSafari = /safari/i.test( navigator.userAgent);this.iStsOpera = /opera/i.test( navigator.userAgent);this.bDynMve = false;this.aDynMveOff = { x : 0, y : 0};this.iOpy = 0;this.bFdeHde = false;if( ! document.getElementById( this.sRefElmId)) return false;if( this.bDef && "" != this.sRefElmId){this.aCssSty = { "zIndex" : 100, "font" : "normal 11px Arial, Verdana, sans-serif;", "lineHeight" : "1.2", "color" : "#666666", "backgroundColor" : "#FCFCFC", "margin" : "0px", "border" : "1px solid #666666", "padding" : "5px"};eval( "this.aEvtHde = { '"+this.sRefElmId+"' : 'mouseout'}");this.sPosRel = ( this.sPosRel != "none" ? this.sPosRel : "top");this.sBrdDis = "both";this.aPopElmOff = ( ( this.aPopElmOff.x != 0 || this.aPopElmOff.y != 0) ? this.aPopElmOff : { "x" : 0, "y" : -5});this.bIniShw = true;}this.oPopElm = document.createElement( "div");if( "" != this.sPopElmId) this.oPopElm.setAttribute( "id", this.sPopElmId);if( "" != this.sCssCla) this.oPopElm.setAttribute( this.iStsIE ? "className" : "class", this.sCssCla);if( "" != this.aCssSty) for( sAttribute in this.aCssSty) eval( "this.oPopElm.style."+sAttribute+"='"+this.aCssSty[ sAttribute]+"'");if( "" == this.oPopElm.style.position){this.oPopElm.style.position="absolute";this.oPopElm.style.top="-1000px";this.oPopElm.style.left="-1000px";}this.hdePop;this.oPopElm.innerHTML = this.sHtm;if( "" != this.sNdeId) document.getElementById( this.sNdeId).appendChild( this.oPopElm);else document.getElementsByTagName( "body")[0].appendChild( this.oPopElm);with( this){this.mthStpEvent = function( oEvt){ stpEvt(oEvt); };this.mthHdePop1 = function( oEvt){ if( ! isPop( oEvt)) hdePop(); };this.mthShwCalPop = function( oEvt){ shwCalPop( oEvt); };this.mthDynMveSta = function( oEvt){ dynMveSta( oEvt); };this.mthDynMveEnd = function(){ dynMveEnd(); };this.mthShwPop = function(){ shwPop(); };this.mthHdePop2 = function(){ hdePop(); };}this.mngElmEvt( this.aEvtShw, this.mthShwCalPop, true);this.mngElmEvt( this.aEvtHde, this.mthHdePop1, true);this.mngElmEvt( this.aEvtStp, this.mthStpEvent, true);if( this.bIniShw) this.shwCalPop( this.oEvtIni);};shwCalPop = function( oEvt){if( "" != this.sRefElmId){var aMsePos = ( "undefined" == typeof( oEvt) ? { "x" : 0, "y" : 0} : this.getMsePos( oEvt));var aWinSze = this.getWinSze();var aWinOff = this.getWinOff();var aPopElmSze = this.getElmSze( this.oPopElm);var bCalRelPos = true;var bChkFlpPos = true;var bChkStyPos = true;if( - 1 == aMsePos.x && this.iStsSafari && ( "both" == this.sBrdDis || "stay" == this.sBrdDis)) return false;if( true == this.bDynMve){var aRefElmPos = { x : ( aMsePos.x + ( ( this.iStsIE || this.iStsOpera) ? aWinOff.x : 0)), y : ( aMsePos.y + ( ( this.iStsIE || this.iStsOpera) ? aWinOff.y : 0))};var aRefElmSze = { w : 24, h : 24};if( 0 < this.aDynMveOff.x){aRefElmPos.x -= this.aDynMveOff.x;}if( 0 < this.aDynMveOff.y){aRefElmPos.y -= this.aDynMveOff.y;}if( "drag" == this.sPpy) bCalRelPos = bChkFlpPos = false;if( "move" == this.sPpy && "pointer" != this.sRefElmId) bCalRelPos = bChkFlpPos = false;}else if( "pointer" == this.sRefElmId){var aRefElmPos = { x : ( aMsePos.x + ( ( this.iStsIE || this.iStsOpera) ? aWinOff.x : 0)), y : ( aMsePos.y + ( ( this.iStsIE || this.iStsOpera) ? aWinOff.y : 0))};var aRefElmSze = { w : 24, h : 24};}else {var oRefElm = document.getElementById( this.sRefElmId);var aRefElmPos = this.getElmPos( oRefElm);var aRefElmSze = this.getElmSze( oRefElm);}var aPopElmPos = { x : aRefElmPos.x + ( true == this.bDynMve ? 0 : this.aPopElmOff.x), y : aRefElmPos.y + ( true == this.bDynMve ? 0 : this.aPopElmOff.y)};if( bCalRelPos) aPopElmPos = this.calRelPos( aPopElmPos, aPopElmSze, aRefElmSze);if( bChkFlpPos) aPopElmPos = this.chkFlpPos( aPopElmPos, aPopElmSze, aRefElmPos, aRefElmSze, aWinSze, aWinOff);if( bChkStyPos) aPopElmPos = this.chkStyPos( aPopElmPos, aPopElmSze, aWinSze, aWinOff);this.mvePop( aPopElmPos);}this.shwPop();if( "move" == this.sPpy && false == this.bDynMve){this.dynMveSta( oEvt);}else if( "drag" == this.sPpy && false == this.bDynMve){this.addEvt( this.oPopElm, "mousedown", this.mthDynMveSta, false);this.addEvt( this.oPopElm, "mouseup", this.mthDynMveEnd, false);}};shwPop = function(){if( 0 < this.iFdeDly && this.iOpy <= 100 && false == this.bFdeHde){this.setOpy( this.oPopElm, this.iOpy);this.iOpy += 20;setTimeout( this.mthShwPop, this.iFdeDly);}if( this.oPopElm.style.visibility != "visible") this.oPopElm.style.visibility = "visible";};hdePop = function(){if( 0 < this.iFdeDly && this.iOpy >= 0){this.setOpy( this.oPopElm, this.iOpy);this.iOpy -= 20;setTimeout( this.mthHdePop2, this.iFdeDly);this.bFdeHde = true;}else{this.oPopElm.style.visibility = "hidden";this.bFdeHde = false;if( this.bDelAll){this.mngElmEvt( this.aEvtShw, this.mthShwCalPop, false);this.mngElmEvt( this.aEvtHde, this.mthHdePop1, false);this.mngElmEvt( this.aEvtStp, this.mthStpEvent, false);if( "" != this.sNdeId)document.getElementById( this.sNdeId).removeChild( this.oPopElm);else document.getElementsByTagName( "body")[0].removeChild( this.oPopElm);}if( this.bHdeMve){this.oPopElm.style.position="absolute";this.oPopElm.style.top="-1000px";this.oPopElm.style.left="-1000px";}}if( "move" == this.sPpy){this.remEvt( document, "mousemove", this.mthShwCalPop, false);this.bDynMve = false;}};mvePop = function( aPos){this.oPopElm.style.left=aPos.x+"px";this.oPopElm.style.top=aPos.y+"px";};dynMveSta = function( oEvt){var aMsePos = this.getMsePos( oEvt);var aPopElmPos = this.getElmPos( this.oPopElm);var aWinOff = this.getWinOff();this.aDynMveOff = { x : aMsePos.x - aPopElmPos.x + ( ( this.iStsIE || this.iStsOpera) ? aWinOff.x : 0), y : aMsePos.y - aPopElmPos.y + ( ( this.iStsIE || this.iStsOpera) ? aWinOff.y : 0)};this.bDynMve = true;this.addEvt( document, "mousemove", this.mthShwCalPop, false);};dynMveEnd = function(){this.bDynMve = false;this.aDynMveOff = { "x" : 0, "y" : 0};this.remEvt( document, "mousemove", this.mthShwCalPop, false);};calRelPos = function( aPopElmPos, aPopElmSze, aRefElmSze){switch( this.sPosRel){case "left":aPopElmPos.x += - aPopElmSze.w;break;case "right":aPopElmPos.x += aRefElmSze.w;break;case "top":aPopElmPos.y += - aPopElmSze.h;break;case "bottom":aPopElmPos.y = aPopElmPos.y + aRefElmSze.h;break;}return aPopElmPos;};chkStyPos = function( aPopElmPos, aPopElmSze, aWinSze, aWinOff){if( "stay" == this.sBrdDis || "both" == this.sBrdDis){aPopElmPos.x = ( ( aWinSze.w < aPopElmPos.x + aPopElmSze.w - aWinOff.x) ? ( aWinSze.w - aPopElmSze.w + aWinOff.x) : aPopElmPos.x);aPopElmPos.y = ( ( aWinSze.h < aPopElmPos.y + aPopElmSze.h - aWinOff.y) ? ( aWinSze.h - aPopElmSze.h + aWinOff.y) : aPopElmPos.y);aPopElmPos.x = ( 0 > aPopElmPos.x - aWinOff.x ? aWinOff.x : aPopElmPos.x);aPopElmPos.y = ( 0 > aPopElmPos.y - aWinOff.y ? aWinOff.y : aPopElmPos.y);}return aPopElmPos;};chkFlpPos = function( aPopElmPos, aPopElmSze, aRefElmPos, aRefElmSze, aWinSze, aWinOff){if( "" != this.sRefElmId && ( "both" == this.sBrdDis || "flip" == this.sBrdDis)){bValPosLft = ( aWinOff.x <= aRefElmPos.x - aPopElmSze.w + this.aPopElmOff.x ? true : false);bValPosRgt = ( ( aWinSze.w > aRefElmPos.x + aRefElmSze.w + aPopElmSze.w + this.aPopElmOff.x - aWinOff.x) ? true : false);bValPosTop = ( aWinOff.y <= aRefElmPos.y - aPopElmSze.h + this.aPopElmOff.y ? true : false);bValPosBtm = ( ( aWinSze.h > aRefElmPos.y + aRefElmSze.h + aPopElmSze.h + this.aPopElmOff.y - aWinOff.y) ? true : false);switch( this.sPosRel){case "left":aPopElmPos.x = ( bValPosLft ? aPopElmPos.x : ( ( ! bValPosLft && ! bValPosRgt) ? aPopElmPos.x : aRefElmPos.x + aRefElmSze.w - this.aPopElmOff.x));break;case "right":aPopElmPos.x = ( bValPosRgt ? aPopElmPos.x : ( ( ! bValPosLft && ! bValPosRgt) ? aPopElmPos.x : aRefElmPos.x - aPopElmSze.w - this.aPopElmOff.x));break;case "top":aPopElmPos.y = ( bValPosTop ? aPopElmPos.y : ( ( ! bValPosTop && ! bValPosBtm) ? aPopElmPos.y : aRefElmPos.y + aRefElmSze.h - this.aPopElmOff.y));break;case "bottom":aPopElmPos.y = ( bValPosBtm ? aPopElmPos.y : ( ( ! bValPosTop && ! bValPosBtm) ? aPopElmPos.y : aRefElmPos.y - aPopElmSze.h - this.aPopElmOff.y));break;}}return aPopElmPos;};isPop = function( oEvt){if( oEvt.relatedTarget) var oElm = oEvt.relatedTarget;if( ! oElm){var type = oEvt.type;if( type == "mouseover")oElm = oEvt.fromElement;else if( type == "mouseout")oElm = oEvt.toElement;}while( oElm){if( oElm == this.oRefElm || ( "select" == this.sPpy && oElm.id == this.oPopElm.id)) {return true;}else{oElm = oElm.parentNode;}}return false;};mngElmEvt = function( aEvtElm, oFnc, bReg){if( "" != aEvtElm){for( var sElmId in aEvtElm){oElm = ( "document" == sElmId ? document : document.getElementById( sElmId));if( "object" == typeof( aEvtElm[ sElmId])){for( var iIdx = 0; iIdx < aEvtElm[ sElmId].length; iIdx ++){if( bReg)this.addEvt( oElm, aEvtElm[ sElmId][ iIdx], oFnc, false);else this.remEvt( oElm, aEvtElm[ sElmId][ iIdx], oFnc, false);}}else {if( bReg)this.addEvt( oElm, aEvtElm[ sElmId], oFnc, false);else this.remEvt( oElm, aEvtElm[ sElmId], oFnc, false);}}}};setOpy = function( oElm, iOpy){iOpy = ( iOpy >= 100 ? 99.999 : ( iOpy < 0 ? 0 : iOpy));oElm.style.filter = "alpha( opacity="+iOpy+")";oElm.style.KHTMLOpacity = iOpy/100;oElm.style.MozOpacity = iOpy/100;oElm.style.opacity = iOpy/100;};getWinOff = function(){var aWinOff = { x : 0, y : 0};if( this.iStsSafari){aWinOff.y = document.body.scrollTop;aWinOff.x = document.body.scrollLeft;}else if( typeof document.documentElement != undefined){aWinOff.y = document.documentElement.scrollTop;aWinOff.x = document.documentElement.scrollLeft;}return aWinOff;};getMsePos = function( oEvt){return { x : ( document.all ? window.event.x : oEvt.pageX), y : ( document.all ? window.event.y : oEvt.pageY)};};getElmPos = function( oElm){var aOff = { x : oElm.offsetLeft, y : oElm.offsetTop};var oPar = oElm.offsetParent;while( oPar && oPar.tagName != "BODY" && oPar.tagName != "HTML"){var iScrollTop = oPar.scrollTop ? oPar.scrollTop : 0;var iScrollLft = oPar.scrollLft ? oPar.scrollLft : 0;aOff.x += ( this.iStsOpera ? oPar.offsetLeft : oPar.offsetLeft - iScrollLft);aOff.y += ( this.iStsOpera ? oPar.offsetTop : oPar.offsetTop - iScrollTop);oPar = oPar.offsetParent;}return aOff;};getElmSze = function( oElm){var aSze = { w : oElm.offsetWidth, h : oElm.offsetHeight};return aSze;};getWinSze = function(){var aSze = { w : document.body.clientWidth, h : 0};if( typeof( window.innerHeight) == "number")aSze.h = window.innerHeight;else if( document.documentElement && document.documentElement.clientHeight)aSze.h = document.documentElement.clientHeight;else if( document.body && document.body.clientHeight)aSze.h = document.body.clientHeight;return aSze;};addEvt = function( oElm, sEvt, oFun, bUseCap){if( oElm.attachEvent)oElm.attachEvent( "on" + sEvt, oFun);else if( oElm.addEventListener)oElm.addEventListener( sEvt, oFun, bUseCap);else oElm[ "on" + sEvt] = oFun;};remEvt = function( oElm, sEvt, oFun, bUseCap){if( oElm.detachEvent)oElm.detachEvent( "on" + sEvt, oFun);else if( oElm.removeEventListener)oElm.removeEventListener( sEvt, oFun, bUseCap);else oElm[ "on" + sEvt] = null;};stpEvt = function( oEvt){oEvt || ( oEvt = window.event);if( this.iStsIE){oEvt.cancelBubble = true;}else{oEvt.stopPropagation();}};