$references = []; function addLoadEvent(pFunction) { window.onload = AppendFunction(window.onload, pFunction); } function AppendFunction(pFunction, pNewFunction, pStart) { var fNewFunction; if (typeof(pNewFunction) == 'function') { if (typeof(pFunction) == 'function') { if (pStart) { fNewFunction = function() { pNewFunction(); pFunction(); }; } else { fNewFunction = function() { pFunction(); pNewFunction(); }; } } else { fNewFunction = function() { pNewFunction(); }; } } return fNewFunction; } function isInteger(pValue) { return parseInt(pValue) == pValue; } function isID(pValue) { return isInteger(pValue) && pValue > 0; } function getElement(_id) { if ($references[_id]) { return $references[_id]; } $references[_id] = document.getElementById(_id); return $references[_id]; } function GetMousePosition(pEvent, pXOffset, pYOffset) { pEvent = pEvent || window.event; var fPosition = {x: (pXOffset ? pXOffset : 0), y: (pYOffset ? pYOffset : 0)}; if (pEvent.pageX || pEvent.pageY) { fPosition = {x: pEvent.pageX, y: pEvent.pageY}; } else if (pEvent.clientX || pEvent.clientY) { fPosition = {x: pEvent.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft), y: pEvent.clientY + (document.documentElement.scrollTop || document.body.scrollTop)}; } return fPosition; } function GetPosition(pElement, pXOffset, pYOffset) { var fPosition = {x: (pXOffset ? pXOffset : 0), y: (pYOffset ? pYOffset : 0)} while (pElement) { fPosition.x += pElement.offsetLeft; fPosition.y += pElement.offsetTop; pElement = pElement.offsetParent; } return fPosition; } function LoadMouseOvers() { var fImage; var fImages = document.getElementsByTagName('img'); var a; var z; for (a = 0, z = fImages.length; a < z; a++) { if (fImages[a].className == '_MouseOver_') { fImage = new Image(); if (fImages[a].src.indexOf('_on') == -1) { fImages[a].onmouseover = MouseOver; fImages[a].onmouseout = MouseOut; fImage.src = fImages[a].src.replace(/_off(\.[a-z0-9]+)$/i, '_on$1'); } else { fImages[a].onmouseover = MouseOut; fImages[a].onmouseout = MouseOver; fImage.src = fImages[a].src.replace(/_on(\.[a-z0-9]+)$/i, '_off$1'); } } } delete fImages; delete a; delete z; } function MouseOver() { if (this.src.indexOf('_sel') == -1) { this.src = this.src.replace(/_off(\.[a-z0-9]+)$/i, '_on$1'); } } function MouseOut() { if (this.src.indexOf('_sel') == -1) { this.src = this.src.replace(/_on(\.[a-z0-9]+)$/i, '_off$1'); } } function SetOpacity(pElement, pOpacity) { if (pElement) { pElement.style.opacity = pOpacity / 100; pElement.style.mozOpacity = pOpacity / 100; pElement.style.filter = 'alpha(opacity=' + pOpacity + ')'; } } function Toggle(pID, pToggle, pType) { var fElement = getElement(pID); if (fElement) { if (pType) { fElement.style.visibility = pToggle ? 'visible' : 'hidden'; } else { fElement.style.display = pToggle ? (pToggle == 2 ? 'inline' : 'block') : 'none'; } } delete fElement; } window.onload = AppendFunction(window.onload, LoadMouseOvers);