function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); }; } } function setShellBG() { var shellEl = ""; if ( document.getElementById("shell") != null ) { shellEl = document.getElementById("shell"); shellEl.style.background = '#000'; } } // addLoadEvent(setShellBG); /* begin common cookie functions. see http://techweb/javascript_commons/docs/cookies.html for documentation. */ /* Set cookie value */ function setCookie(name, value, escapeValue, expires, path, domain, secure) { var cookieToken = name + '=' + ((escapeValue) ? escape(value) : value) + ((expires) ? '; expires=' + expires.toGMTString() : '') + ((path) ? '; path=' + path : '') + ((domain) ? '; domain=' + domain : '') + ((secure) ? '; secure' : ''); document.cookie = cookieToken; } /* Get cookie value */ function getCookie(name) { var allCookies = document.cookie; var cookieName = name + "="; var start = allCookies.indexOf("; " + cookieName); if (start == -1) { start = allCookies.indexOf(cookieName); if (start != 0) return null; } else start += 2; var end = document.cookie.indexOf(";", start); if (end == -1) end = allCookies.length; return unescape(allCookies.substring(start + cookieName.length, end)); } /* Delete a cookie */ function deleteCookie(name, path, domain) { var value = getCookie(name); if (value != null) document.cookie = name + '=' + ((path) ? '; path=' + path : '') + ((domain) ? '; domain=' + domain : '') + '; expires=Thu, 01-Jan-70 00:00:01 GMT'; return value; } /* Test for cookie support */ function verifyCookieSafe() { setCookie('pingCookies', 'hello'); if (getCookie('pingCookies')) return true; else return false; } /* end common cookie functions. */ /* begin text size widget */ function setActiveStyleSheet(title) { var i, a, main; for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { a.disabled = true; if(a.getAttribute("title") == title) a.disabled = false; } } } function getActiveStyleSheet() { var i, a; for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title"); } return null; } function getPreferredStyleSheet() { var i, a; for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") == -1 && a.getAttribute("title") ) return a.getAttribute("title"); } return null; } window.onunload = function(e) { var title = getActiveStyleSheet(); //var expiration = new Date(); //var expDuration = expiration.getTime() + (365*24*60*60*1000); //expiration.setTime(expDuration); setCookie("style", title, false, "", "/", "", false); } var textPref = getCookie("style"); var title = textPref ? textPref : getPreferredStyleSheet(); setActiveStyleSheet(title); /* end text size widget */ function footerSubOffers() { var offersEl = ""; var offersUL = ""; var offersYcoord = ""; var offersListHeight = ""; var dropDown = new Boolean(false); var screenHeight = document.body.clientHeight; if ( document.getElementById("suboffers") != null ) { offersEl = document.getElementById("suboffers"); offersYcoord = findPosY(offersEl); if ( document.getElementById("suboffers_list") != null ) { offersUL = document.getElementById("suboffers_list"); offersListHeight = offersUL.offsetHeight; if ( ( offersYcoord + 421 ) < screenHeight) { dropDown = true; } offersEl.onclick = function() { offersEl.style.backgroundPosition = "0 -16px"; if (dropDown == false) { offersUL.style.top = "-421px"; } offersUL.style.display = "block"; offersUL.onmouseover = function() { offersEl.style.backgroundPosition = "0 -16px"; offersUL.style.display = "block"; } } offersEl.onmouseout = function() { offersEl.style.backgroundPosition = "0 0"; offersUL.style.display = "none"; } } } } function findPosY(obj) { var curtop = 0; if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetTop; obj = obj.offsetParent; } } else if (obj.y) curtop += obj.y; return curtop; } addLoadEvent(footerSubOffers); function showSponsorTxt() { var sponsorEl = ""; var popularEl = ""; var multimediaEl = ""; var adImg = ""; var popularAdImg = ""; var multimediaAdImg = ""; if ( document.getElementById("sponsor") != null ) { sponsorEl = document.getElementById("sponsor"); adImg = sponsorEl.getElementsByTagName('img'); if ( adImg.length != 0 ) { for (var i=0; i < adImg.length; i++) { if (adImg[i].width > 1 && document.getElementById("byTxt") != null ) document.getElementById("byTxt").style.display = "block"; } } } if ( document.getElementById("popular_sponsor") != null ) { popularEl = document.getElementById("popular_sponsor"); popularAdImg = popularEl.getElementsByTagName('img'); if ( popularAdImg.length != 0 ) { for (var i=0; i < popularAdImg.length; i++) { if (popularAdImg[i].width > 1 && document.getElementById("popular_byTxt") != null ) document.getElementById("popular_byTxt").style.display = "block"; } } } if ( document.getElementById("sponsorMM") != null ) { multimediaEl = document.getElementById("sponsorMM"); multimediaAdImg = multimediaEl.getElementsByTagName('img'); if ( multimediaAdImg.length != 0 ) { for (var i=0; i < multimediaAdImg.length; i++) { if (multimediaAdImg[i].width > 1 && document.getElementById("byTxtMM") != null ) document.getElementById("byTxtMM").style.display = "block"; } } } } addLoadEvent(showSponsorTxt); // Social Sites Dropdown function showHideSocial(obj) { var hiddenList = ""; if ( document.getElementById("hidden_list") != null ) { hiddenList = document.getElementById('hidden_list'); if (obj.id == 'hidden_list'){ hiddenList.style.display = 'none'; } else { hiddenList.style.display = 'block'; } } } // Popup Window with auto centering function launchWindow(url, maxW, maxH){ offset = 100; LeftPosition = (screen.width) ? (screen.width-maxW)/2 : 0; TopPosition = (screen.height) ? ((screen.height-maxH)/2)-offset : 0; var w = window.open ( url, 'myWindow', 'width='+maxW+', height='+maxH+', top='+TopPosition+', left='+LeftPosition+',scrollbars=yes,location=yes,menubar=yes,status=yes,toolbar=yes,resizable=yes'); w.focus(); } //Google Search validation: Don't submit if no search query function validateSearch(formName) { if(formName.elements["query"].value == "") { return false; } else { return true; } } function setSearchDefaults(query, sitename, targetSearchForm) { if(targetSearchForm!="" && query!="") { document.forms[targetSearchForm].query.value=query; } if(targetSearchForm!="" && sitename!="") { for(i=0;i