var IE6 = navigator.appVersion.indexOf("MSIE 6") != -1; var idToHideOnClick_; function get(id) { return document.getElementById(id); } function setLocByEvent(event, obj, xoff, yoff) { if (xoff == null) xoff = 0; if (yoff == null) yoff = 0; obj.style.left = ((event.x == null ? event.pageX : event.x+document.body.scrollLeft) + 10 + xoff) + "px"; obj.style.top = ((event.y == null ? event.pageY : event.y+document.body.scrollTop) + yoff) + "px"; } function changePage(key, args) { args = args == null ? "" : "?" + args; form_.action = urlStart_ + "/" + key + args; form_.submit(); form_.target = null; } function call(meth, args) { if (args == null) args = ""; changePage(pageKey_ + "." + meth + "?" + args); } function nada() { } function submitToInnerFrame() { form_.target=hiddenFrameName_; } function setInnerFrameLoc(loc, w, h, x, y) { submitToInnerFrame(); setInnerFrameDim(w, h, x, y); sub.location=loc; form_.target = null; } function setInnerFrameDim(width, height, left, top) { var p = get(hiddenFrameName_); p.style.display=''; p.style.width=width + "px"; p.style.height=height + "px"; //if it's -1, then we just center the frame on the page if (left == -1) left = (document.body.clientWidth/2) - (width/2); if (top == -1) top = (document.body.clientHeight/2) - (height/2) + document.body.scrollTop; p.style.top = top + "px"; p.style.left = left + "px"; } function closeIFrame() { var o = parent.document.getElementById(hiddenFrameName_); if (o == null) return false; if (o.style.display == 'none') return false; o.style.display='none'; o.location='/blank.html'; return true; } function hide(id) { if (id == null) return; var o = get(id); if (o == null) return; o.style.display="none"; } function show(id) { var o = get(id); if (o == null) return; o.style.display=""; } function showTip(event, msg, xoff, yoff) { if (msg == null || msg == "") return; var div = get("tooltip"); div.innerHTML = "
" + msg + "
\n"; show("tooltip"); setLocByEvent(event, div, xoff, yoff); } function hideTip() { hide("tooltip"); } function focus(name) { eval("form_." + name).focus(); } function setIdToHideOnClick(id) { window.setTimeout("idToHideOnClick_ = '" + id + "';", 200); } document.onclick = hideExtraComp; function hideExtraComp(event) { if (idToHideOnClick_ == null) return true; id_ = null; //so we don't think PD is open hide(idToHideOnClick_); idToHideOnClick_ = null; return true; } function closeSelectBox() { if (idToHideOnClick_ == null) return false; return hideExtraComp(null); } var scrollFn; if (IE6) { scrollFn = function scrollEvent(event) { var div = get("bot"); if (div == null) return; if (div.style.bottom == "0px") div.style.bottom = "-1px"; else div.style.bottom = "0px"; }} else if (document.doctype == null) { scrollFn = function scrollEvent(event) { var div = get("bot"); if (div == null) return; var scroll = document.body.scrollTop; div.style.bottom=(-1*scroll) + "px"; }} else { scrollFn = function scrollEvent(event) { //html5 support var div = get("bot"); if (div == null) return; var scroll = document.documentElement.scrollTop; div.style.bottom=(-1*scroll) + "px"; }} window.onscroll = scrollFn; function keyPressed(e, fn) { if (fn == null) fn = "doDefaultAction()"; var code = e.keyCode != null ? code = e.keyCode : e.which; if (code == 13) { var src = e.srcElement == null ? e.target : e.srcElement; if (src.type == "textarea") return true; e.cancelBubble=true; //this is key to avoiding beeps eval(fn); return false; } else if (code == 27) { //ESC if (!closeIFrame() && !closeSelectBox()) { try { updateRankings(e, false, true); } catch (x) { //not on scores page } } } return true; } var t = get("banner"); if (t != null) t.style.height=document.body.clientHeight-45;