//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:: general_functions_js.asp //:: created: christopher j falvey (05.13.01) //:: //:: version: 2.0 //:: desc: general javascript functions //:: //:: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:: javascript globals //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: var giMouseX var giMouseY //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:: captureMouseMove //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function captureMouseMove(e) { {giMouseX=e.pageX; giMouseY=e.pageY;} } document.onmousemove = captureMouseMove; document.captureEvents(Event.MOUSEMOVE); //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:: javascript functions //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:: popUp //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function popUp(sUrl , iWidth , iHeight , bScrollBars) { sPageName = "DFPopUp" window.open(sUrl , sPageName , "status=1,scrollbars=" + bScrollBars + ",width=" + iWidth + ",height=" + iHeight + ",resizable=yes"); } //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:: popUpPrintable //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function popUpPrintable(sUrl , iWidth , iHeight , bScrollBars) { sPageName = "DFPopUp" window.open(sUrl , sPageName , "status=1,scrollbars=" + bScrollBars + ",width=" + iWidth + ",height=" + iHeight + ",resizable=yes,toolbar=yes"); } //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:: popUpWindow //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function popUpWindow(sUrl , sWin, iWidth , iHeight , bScrollBars) { window.open(sUrl , sWin , "status=1,scrollbars=" + bScrollBars + ",width=" + iWidth + ",height=" + iHeight + ",resizable=yes"); } //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:: flipImage //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function flipImage(sImageName , sFlipTo , sExtension) { document.images[sImageName].src = "images/" + sImageName + "_" + sFlipTo + "." & sExtension } //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:: refreshPage //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function refreshPage() { document.location = document.location } //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:: getStyleAttribute //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function getStyleAttribute(sID , sAttribute) { sCurrentTop = new String(eval("document." + sID + "." + sAttribute)) return sCurrentTop } //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:: setStyleAttribute //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function setStyleAttribute(sID , sAttribute , sValue) { sStyleToSet = "document." + sID + "." + sAttribute + "='" + sValue + "'" eval(sStyleToSet) } //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:: moveDiv //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function moveDiv(sID , sAttribute , iValue) { iCurrentPos = getStyleAttribute(sID , sAttribute) iCurrentPos = cPxToInt(iCurrentPos) sNextTopNumber = new String(iCurrentPos + iValue) sNextPos = sNextTopNumber + "px" setStyleAttribute(sID , sAttribute , sNextPos) } //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:: cPxToInt //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function cPxToInt(sPx) { iInt = Number(sPx.replace(/px/gi,"")) return iInt } //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:: getRandomNumber //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function getRandomNumber(iBeginNum , iEndNum) { iNumberToSend = iBeginNum - 1 while(iNumberToSend < iBeginNum || iNumberToSend > iEndNum) { iNumberToSend = iBeginNum + (Math.random() * iEndNum) } return Math.round(iNumberToSend) } //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:: (decimal to hex functions) //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function cHex(i) { a2 = '' ihex = hexQuot(i); idiff = eval(i + '-(' + ihex + '*16)') a2 = itohex(idiff) + a2; while( ihex >= 16) { itmp = hexQuot(ihex); idiff = eval(ihex + '-(' + itmp + '*16)'); a2 = itohex(idiff) + a2; ihex = itmp; } a1 = itohex(ihex); return a1 + a2 ; } function hexQuot(i) { return Math.floor(eval(i +'/16')); } function itohex(i) { if(i == 0){aa = '0'} if(i == 1){aa = '1'} if(i == 2){aa = '2'} if(i == 3){aa = '3'} if(i == 4){aa = '4'} if(i == 5){aa = '5'} if(i == 6){aa = '6'} if(i == 7){aa = '7'} if(i == 8){aa = '8'} if(i == 9){aa = '9'} if(i == 10){aa = 'A'} if(i == 11){aa = 'B'} if(i == 12){aa = 'C'} if(i == 13){aa = 'D'} if(i == 14){aa = 'E'} if(i == 15){aa = 'F'} return aa } //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:: functions_js.asp //:: created: //:: //:: version: 0.0 //:: desc: site-specific javascript functions //:: //:: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:: javascript functions //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //:: functionName //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::