/////////////////////////////////////////////////////////////////////////// // B R O W S E R D E T E C T I O N /////////////////////////////////////////////////////////////////////////// var isIE4 = document.all && !document.getElementById; var isDOM2 = document.getElementById; var isNS4 = false; var isIE6 = false; var sDetect = navigator.userAgent.toLowerCase(); var sOS, sBrowser, sVersion, sPlace, sAgentString; if (btCheckString('konqueror')) { sBrowser = "Konqueror"; sOS = "Linux"; } else if (btCheckString('safari')) sBrowser = "Safari" else if (btCheckString('omniweb')) sBrowser = "OmniWeb" else if (btCheckString('opera')) sBrowser = "Opera" else if (btCheckString('webtv')) sBrowser = "WebTV"; else if (btCheckString('icab')) sBrowser = "iCab" else if (btCheckString('msie')) sBrowser = "Internet Explorer" else if (!btCheckString('compatible')) { sBrowser = "Netscape Navigator" sVersion = sDetect.charAt(8); } else { alert(sDetect); sBrowser = "An unknown browser"; } if (!sVersion) sVersion = sDetect.charAt(sPlace + sAgentString.length); if (!sOS) { if (btCheckString('linux')) sOS = "Linux"; else if (btCheckString('x11')) sOS = "Unix"; else if (btCheckString('mac')) sOS = "Mac" else if (btCheckString('win')) sOS = "Windows" else sOS = "an unknown operating system"; } if (sBrowser == "Internet Explorer") { if (sVersion == "6") isIE6 = true; } else if (sBrowser == "Netscape Navigator") { if (sVersion == "4") isNS4 = true; } function btCheckString(sFind) { sPlace = sDetect.indexOf(sFind) + 1; sAgentString = sFind; return sPlace; } function btWriteCss() { if (sBrowser == "Internet Explorer") { document.write(""); } else if (sBrowser == "Opera") { document.write(""); } else if (sBrowser == "Netscape Navigator") { document.write(""); } else if (sBrowser == "Konqueror" || sBrowser == "Safari") { document.write(""); } else { document.write(""); } } /////////////////////////////////////////////////////////////////////////// // Internet Explorer can't handle the :hover attribute on things which // aren't links, and it also can't handle z-index when there are SELECT // elements involved... The following provides a workaround for these // two shortcomings. function btFixIeHover() { if (sBrowser != "Internet Explorer") return; var vElem = document.getElementById("topMenu").getElementsByTagName("li"); for (var i = 0; i < vElem.length; i++) { vElem[i].onmouseover = function() { this.className += " iehover"; } vElem[i].onmouseout = function() { this.className = this.className.replace(new RegExp(" iehover\\b"), ""); } } var vWrapper = document.getElementById("menuBarWrapper"); if (vWrapper) { vNew = document.createElement("iframe"); vNew.id = "menuBarFrame"; vWrapper.appendChild(vNew); vNew = document.createElement("div"); vNew.id = "menuBarFrameCover"; vWrapper.appendChild(vNew); } var vElem = document.getElementById("topMenu").getElementsByTagName("ul"); for (var i = 0; i < vElem.length; i++) { var vMenuItems = 0; var vSeparators = 0; var vItem = vElem[i].firstChild; do { if (vItem.tagName == 'LI') { if (vItem.className == 'menusep') vSeparators++; else vMenuItems++; } } while (vItem = vItem.nextSibling); vNew = document.createElement("iframe"); vNew.height = (vMenuItems * 19) + (vSeparators * 7) + 3; vElem[i].parentNode.appendChild(vNew); } // window.attachEvent("onscroll", onIeScroll); } function btDrawMenu() { document.write(''); } /////////////////////////////////////////////////////////////////////////// // T I C K E R /////////////////////////////////////////////////////////////////////////// var delay = 10000; //set delay between message change (in miliseconds) var maxsteps = 20; // number of steps to take to change from start color to endcolor var stepdelay = 30; // time in miliseconds of a single step // With a lot of steps IE shows the ugly hourglass cursor if (sBrowser == "Internet Explorer") { maxsteps = 5 stepdelay = 5; } //**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect var startcolor= new Array(55, 86, 145); // start color (red, green, blue) var endcolor=new Array(255, 255, 255); // end color (red, green, blue) var aTickerLines = new Array(); aTickerLines[0]="W E L C O M E    T O    B A T T R I C K !"; aTickerLines[1]="C R I C K E T    H A S    N E V E R    B E E N    S O    M U C H    F U N"; aTickerLines[2]="B A T T R I C K    . . .    I T ' S    M O R E    T H A N    J U S T    A    G A M E . . ."; aTickerLines[3]="I R C    Q & A    S E S S I O N S    1 7 / 5    2 1 : 0 0    A N D    2 2 / 5    0 9 : 0 0"; aTickerLines[4]="B A T T R I C K    I S    C U R R E N T L Y    I N    H I B E R N A T I O N"; var fwidth='150px'; //set scroller width var fheight='150px'; //set scroller height var fadelinks=1; //should links inside scroller content also fade like text? 0 for no, 1 for yes. var faderdelay=0; var index=0; /*********************************************** * Fading Scroller- © Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code ***********************************************/ function btDrawTicker() { if (isIE4 || isDOM2) { document.write('
'); } if (window.addEventListener) window.addEventListener("load", btChangeTicker, false); else if (window.attachEvent) window.attachEvent("onload", btChangeTicker); else if (document.getElementById) window.onload = btChangeTicker; } /*Rafael Raposo edited function*/ //function to change content function btChangeTicker() { if (index >= aTickerLines.length) index = 0; if (isDOM2) { document.getElementById("ticker").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"; document.getElementById("ticker").innerHTML = "
" + aTickerLines[index] + "
"; if (fadelinks) linkcolorchange(1); ColorFade(1, true); } else if (isIE4) document.all.ticker.innerHTML = "
" + aTickerLines[index] + "
"; index++; } // colorfade() partially by Marcio Galli for Netscape Communications. //////////// // Modified by Dynamicdrive.com // Modified again by Wickesy function linkcolorchange(step) { var obj=document.getElementById("ticker").getElementsByTagName("A"); if (obj.length>0) { for (i=0;i 0) { newcolor[i] = startcolor[i]-(Math.round((diff/maxsteps)) * nStep); } else { newcolor[i] = startcolor[i]+(Math.round((Math.abs(diff)/maxsteps)) * nStep); } } else { diff = (endcolor[i] - startcolor[i]); if(diff > 0) { newcolor[i] = endcolor[i]-(Math.round((diff/maxsteps)) * nStep); } else { newcolor[i] = endcolor[i]+(Math.round((Math.abs(diff)/maxsteps)) * nStep); } } } return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")"); } function gotoTop() { // Scroll to the top of the page window.scrollTo(0, 0); } function btInitHeaderTime() { if (sBrowser == "Safari" || sBrowser == "Opera") document.write('
'); else document.write(''); } function btSetHeaderTime(sTime) { if (sBrowser == "Safari" || sBrowser == "Opera") document.getElementById('serverClock').innerHTML = sTime; else document.getElementById('serverClock').value = sTime; } function btPageInit() { vElems = document.getElementsByTagName("INPUT"); // Find all the individual input elements and set them up for (var i = 0; i < vElems.length; i++) { if (vElems[i].type == "text" && vElems[i].className == "btInput") { btSetupInput(vElems[i]); } } // Add ourselves a submit handler so we can clear ourselves if // necessary... vForms = document.getElementsByTagName("FORM"); for (var j = 0; j < vForms.length; j++) { if (vForms[j].attachEvent) vForms[j].attachEvent("onsubmit", btClearInput); else if (vForms[j].addEventListener) vForms[j].addEventListener("submit", btClearInput, false); else { vForms[j].onunload = btClearInput; } } if (window.attachEvent) window.attachEvent("onbeforeunload", btUnloadInput); else if (window.addEventListener) window.addEventListener("unload", btUnloadInput, false); else if (document.addEventListener) document.addEventListener("unload", btUnloadInput, false); else { if (window.onunload) window.nextOnunload = window.onunload; window.onunload = btUnloadInput; } } g_aInputElements = new Array(); function btSetupInput(vElem) { vElem.onfocus = btFocusInput; vElem.onblur = btBlurInput; g_aInputElements.push(vElem); if (!vElem.value.length) { vElem.value = vElem.title; g_aInputElements.push('no'); } else { vElem.className = "btInputFocus"; g_aInputElements.push('yes'); } } function btUnloadInput() { btClearInput(); if (window.nextOnunload) window.nextOnunload(); } function btClearInput() { for (var i = 0; i < g_aInputElements.length; i += 2) { if (g_aInputElements[i+1] == 'no') { g_aInputElements[i].value = "";; } } } function btFocusInput() { if (!btFocusEdited(this)) { this.value = ""; this.className = "btInputFocus"; } } function btBlurInput() { sEdited = 'yes'; if (!this.value.length) { this.className = "btInput"; this.value = this.title; sEdited = 'no'; } for (var i = 0; i < g_aInputElements.length; i += 2) { if (this == g_aInputElements[i]) { g_aInputElements[i + 1] = sEdited; break; } } } function btFocusEdited(vElem) { for (var i = 0; i < g_aInputElements.length; i += 2) { if (vElem == g_aInputElements[i]) return g_aInputElements[i + 1] == 'yes'; } return false; } function getElem(sId) { return document.getElementById(sId); } function getPos(vElem) { if (vElem.offsetParent) { for (var cx = 0, cy = 0; vElem.offsetParent; vElem = vElem.offsetParent) { cx += vElem.offsetLeft; cy += vElem.offsetTop; } return [cx, cy]; } return [vElem.x, vElem.y]; } g_nScrolls = 0; g_nPrevScrolls = 0; g_vMenu = null; function onIeScroll() { if (!g_nScrolls) { if (!g_vMenu) g_vMenu = getElem('menuBarWrapper'); g_vMenu.style.pixelLeft = -9999; g_nScrolls++; setTimeout('btCheckScrolling()', 200); } else { g_nScrolls++; } } function btCheckScrolling() { if (g_nScrolls == g_nPrevScrolls) { g_nScrolls = 0; g_nPrevScrolls = 0; btMoveMenu(); } else { g_nPrevScrolls = g_nScrolls; setTimeout('btCheckScrolling()', 200); } } g_nMenuSlide = 0; function btMoveMenu() { g_nMenuSlide = 25; g_vMenu.style.pixelTop = document.body.scrollTop - g_nMenuSlide; g_vMenu.style.pixelLeft = 0; setTimeout('btSlideMenu()', 20); } function btSlideMenu() { g_vMenu.style.pixelTop = document.body.scrollTop - g_nMenuSlide; if (g_nMenuSlide-- && g_nScrolls == g_nPrevScrolls) setTimeout('btSlideMenu()', 20); } function btDrawLogo() { var vElem = document.getElementById('teamLogo'); btDrawLogoImpl(vElem, 175, true); } function btDrawMiniLogo(vElem) { btDrawLogoImpl(vElem, 80, false); } function btZoomLogo() { var vElem; if (this.id.indexOf('Zoom') >= 0) vElem = document.getElementById(this.id); else vElem = document.getElementById(this.id + 'Zoom'); if (vElem.style.display != "block") { vElem.style.display = "block"; vElem.style.visibility = "visible"; } else { vElem.style.display = "none"; vElem.style.visibility = "hidden"; } } function btDrawLogoImpl(vElem, nMaxWidth, fDrawBorder) { if (vElem.width > nMaxWidth) { var nRealWidth = vElem.width; var nRealHeight = vElem.height; // Resize the old one vElem.height /= (nRealWidth / nMaxWidth); vElem.width = nMaxWidth; // If it's larger than 250px then show a zoomed version of this // resized image, otherwise they live with the resizing... if (nRealWidth > (nMaxWidth * 3) / 2) { vElem.title = "Click to view larger image"; if (fDrawBorder) vElem.style.border = "1px dashed #a6a6a6"; // Work out the zoomed dimensions var nZoomWidth = nRealWidth; var nZoomHeight = nRealHeight; if (nRealWidth > 500) { nZoomWidth = 500; nZoomHeight /= (nRealWidth / 500); } // Create a div with the real logo as a larger version vNew = document.createElement("div"); vNew.className = "teamLogoZoom"; vNew.id = vElem.id + 'Zoom'; vElem.parentNode.appendChild(vNew); vImg = document.createElement("img"); vImg.className = "teamLogoZoomImg"; vImg.src = vElem.src; vImg.width = nZoomWidth; vImg.height = nZoomHeight; vNew.appendChild(vImg); vText = document.createElement("div"); vText.className = "teamLogoZoomText"; vText.innerHTML = "Click anywhere to close"; vText.width = nZoomWidth; vNew.appendChild(vText); vElem.onclick = btZoomLogo; vNew.onclick = btZoomLogo; vElem.style.cursor = "pointer"; vImg.style.cursor = "pointer"; vElem.style.display = "block"; vElem.style.visibility = "visible"; var aPos = getPos(vElem); vNew.style.left = aPos[0] + 'px'; vNew.style.top = aPos[1] + 'px'; return; } } vElem.style.display = "block"; vElem.style.visibility = "visible"; } function showLevels(sLevel, sType) { vNew = window.open('levels.asp?l=' + sLevel + '&t=' + sType,'levels','height=400,width=225,scrollbars'); vNew.focus(); }