var its; var browserName; var browserNameLong; var browserNew; var preloadFlag = false; var Macintosh = navigator.userAgent.indexOf('Mac')>0; /* get the browser and platform */ function its() { var n = navigator; var ua = ' ' + n.userAgent.toLowerCase(); var pl = n.platform.toLowerCase(); var an = n.appName.toLowerCase(); this.version = n.appVersion; this.nn = ua.indexOf('mozilla') > 0; if(ua.indexOf('compatible') > 0) { this.nn = false; } this.opera = ua.indexOf('opera') > 0; this.ie = ua.indexOf('msie') > 0; this.major = parseInt( this.version ); this.minor = parseFloat( this.version ); this.mac = ua.indexOf('mac') > 0; this.win = ua.indexOf('win') > 0; if(this.ie) { if(ua.indexOf("msie 5") > 1) { var msieIndex = navigator.appVersion.indexOf("MSIE") + 5; this.major = parseFloat(navigator.appVersion.substr(msieIndex,3)); } } return this; } /* get the browser name */ function browserNaming() { its = new its(); if (!document.getElementById) { browserNew = false; } else { browserNew = true; } if (its.opera) { browserName = "Opera"; } else if (its.ie) { browserName = "IE"; } else { browserName = "NS"; } browserNameLong = browserName + its.major; } /* DOM set property */ function setIdProperty(id, property, value) { var styleObject = document.getElementById(id); if (styleObject != null) { styleObject = styleObject.style; styleObject[property] = value; } } /* show a hidden layer */ function show(id) { if (browserNew) { setIdProperty(id, "visibility", "visible"); } else { if (browserName == "NS") { document.layers[id].visibility = "show"; } else { document.all[id].style.visibility = "visible"; } } } /* hide a visible layer */ function hide(id) { if (browserNew) { setIdProperty(id,"visibility","hidden"); } else { if (browserName == "NS") { document.layers[id].visibility = "hide"; } else { document.all[id].style.visibility = "hidden"; } } } /* image preloading */ function preload(imgName, imgSrc) { if (loadFlag) { eval(imgName + ' = new Image()'); eval(imgName + '.src = "' + imgSrc + '"'); return imgName; } } /* turn image on */ function mson(imgName) { document[imgName].src = eval(imgName + "_on.src"); } /* turn image off */ function msoff(imgName) { document[imgName].src = eval(imgName + "_off.src"); } /* switch an image */ function changeImg(imgName, newImg) { document[imgName].src = eval(newImg + ".src"); } /* open new centered window */ function openWin(url,popW,popH) { version = navigator.appVersion; var w = 800, h = 600; if (version.toLowerCase().indexOf("mac")!=-1) { popW = eval("popW-18"); } if (document.all || document.layers) { w = screen.availWidth; h = screen.availHeight; } var leftPos = (w-popW)/2, topPos = (h-popH)/2; window.open(url,'popup','width=' + popW + ',height=' + popH + ',scrollbars=yes,toolbar=no,status=yes,resizable=no,top=' + topPos + ',left=' + leftPos);void(0); } function playerPop(url,popW,popH) { version = navigator.appVersion; var w = 800, h = 600; if (document.all || document.layers) { w = screen.availWidth; h = screen.availHeight; } var leftPos = (w-popW)/2, topPos = (h-popH)/2; window.open(url,'popup','width=' + popW + ',height=' + popH + ',scrollbars=no,toolbar=no,status=yes,resizable=no,top=' + topPos + ',left=' + leftPos);void(0); } function helpPop(url,popW,popH) { version = navigator.appVersion; var w = 800, h = 600; if (document.all || document.layers) { w = screen.availWidth; h = screen.availHeight; } var leftPos = (w-popW)/2, topPos = (h-popH)/2; window.open(url,'','width=' + popW + ',height=' + popH + ',scrollbars=no,toolbar=no,status=yes,resizable=no,top=' + topPos + ',left=' + leftPos);void(0); }