/**************************************************** Current Date Code ****************************************************/ function isnArray() { argnr=isnArray.arguments.length for (var i=0;i= 12) m = "PM"; else { m = "AM"; } return m; } function printDate(){ var isnMonths=new isnArray("January","February","March","April","May","June","July","August","September","October","November","December"); today=new Date(); document.write(isnMonths[today.getMonth()+1]+" "+ today.getDate()+", "+" "+getFullYear(today)+" "+ getStdHour(today)+":"+getStdMinutes(today)+" " +getMeridiem(today)); } /**************************************************** Open window code ****************************************************/ function openWindow(sUrl,sTarget,sOptions){ window.open(sUrl, sTarget, sOptions); } function openPopup(sUrl,sTarget, sHeight, sWidth, sScroll){ window.open(sUrl, sTarget, "titlebar=0,width=" + sWidth + ",innerWidth=" + sWidth + ",height=" + sHeight + ",innerHeight=" + sHeight + ",scrollbars=" + sScroll); } /**************************************************** Java Menu code ****************************************************/ var isDOM = (document.getElementById ? true : false); var isIE4 = ((document.all && !isDOM) ? true : false); var isNS4 = (document.layers ? true : false); var isDyn = (isDOM || isIE4 || isNS4); function getRef(id) { return (isDOM ? document.getElementById(id) : (isIE4 ? document.all[id] : document.layers[id])); } function getSty(id) { return (isNS4 ? getRef(id) : getRef(id).style); } var popTimer = 0; var litNow = new Array(); function popOver(menuNum, itemNum) { clearTimeout(popTimer); hideAllBut(menuNum); litNow = getTree(menuNum, itemNum); changeCol(true); targetNum = menu[menuNum][itemNum].target; if (targetNum > 0) { thisX = parseInt(menu[menuNum][0].ref.left) + parseInt(menu[menuNum][itemNum].ref.left); thisY = parseInt(menu[menuNum][0].ref.top) + parseInt(menu[menuNum][itemNum].ref.top); with (menu[targetNum][0].ref) { left = thisX + menu[targetNum][0].x; top = thisY + menu[targetNum][0].y; visibility = 'visible'; } } } function popOut(menuNum, itemNum) { if ((menuNum == 0) && !menu[menuNum][itemNum].target) hideAllBut(0); else popTimer = setTimeout('hideAllBut(0)', 100); } function popClick(menuNum, itemNum) { with (menu[menuNum][itemNum]) { switch (type) { case 'js:': { eval(href); break } case '': type = 'window'; default: if (href) eval(type + '.location.href = "' + href + '"'); } } hideAllBut(0); } function getTree(menuNum, itemNum) { itemArray = new Array(menu.length); while(1) { itemArray[menuNum] = itemNum; if (menuNum == 0) break; itemNum = menu[menuNum][0].parentItem; menuNum = menu[menuNum][0].parentMenu; } return itemArray; } function changeCol(isOver) { for (count = 0; count < litNow.length; count++) { if (litNow[count]) { with (menu[count][0]) with (menu[count][litNow[count]]) { newCol = isOver ? overCol : backCol; if (isNS4) ref.bgColor = newCol; else ref.backgroundColor = newCol; } } } } function hideAllBut(menuNum) { var keepMenus = getTree(menuNum, 1); for (count = 0; count < menu.length; count++) if (!keepMenus[count] && menu[count]) menu[count][0].ref.visibility = 'hidden'; changeCol(false); } function addProps(obj, data, names, addNull) { for (i = 0; i < names.length; i++) if(i < data.length || addNull) obj[names[i]] = data[i]; } function Menu() { var names = ['isVert', 'popInd', 'x','y', 'width', 'pad', 'overCol', 'backCol', 'borderClass', 'textClass', 'parentMenu', 'parentItem', 'ref']; addProps(this, arguments, names, true); } function Item() { var names = ['text', 'href', 'type', 'length', 'spacing', 'target', 'ref']; addProps(this, arguments, names, true); } function createMenus() { if (!isDyn) return; for (currMenu = 0; currMenu < menu.length; currMenu++) if (menu[currMenu]) with (menu[currMenu][0]) { var str = '', itemX = 0, itemY = 0; if (isNS4) pad++; for (currItem = 1; currItem < menu[currMenu].length; currItem++) with (menu[currMenu][currItem]) { var itemID = 'menu' + currMenu + 'item' + currItem; var shrink = (borderClass && isDOM && !document.all ? 2 : 0) var w = (isVert ? width : length) - shrink; var h = (isVert ? length : width) - shrink; if(itemY!=0) itemY = itemY - 2; if (isDOM || isIE4) { str += '
'; if (target > 0) { menu[target][0].parentMenu = currMenu; menu[target][0].parentItem = currItem; if (popInd) { if (isNS4) str += '' + popInd + ''; else str += '
' + popInd + '
'; } } if (isNS4) str += (borderClass ? '' : '') + '' + text + ''; else str += '
' + text + '
'; str += (isNS4 ? '' : '
'); if (isVert) itemY += length + spacing - 1; else itemX += length + spacing - 1; } /*alert(str);*/ if (document.all) { document.body.insertAdjacentHTML('beforeEnd', ''); ref = getSty('menu' + currMenu + 'div'); } else if (isDOM) { var newDiv = document.createElement('div'); document.body.appendChild(newDiv); newDiv.innerHTML = str; ref = newDiv.style; ref.position = 'absolute'; ref.visibility = 'hidden'; } else if (isNS4) { ref = new Layer(0); ref.document.write(str); ref.document.close(); } ref.left = x; ref.top = y; if (!isNS4) ref.cursor = (document.all ? 'hand' : 'pointer'); if (!document.all) ref.zIndex = 1000; for (currItem = 1; currItem < menu[currMenu].length; currItem++) { itemName = 'menu' + currMenu + 'item' + currItem; if (isDOM || isIE4) menu[currMenu][currItem].ref = getSty(itemName); if (isNS4) { menu[currMenu][currItem].ref = ref.document[itemName]; with (ref.document[itemName]) { document.captureEvents(Event.CLICK); document.onclick = new Function('popClick(' + currMenu + ', ' + currItem + ')'); } } } } menu[0][0].ref.visibility = 'visible'; } function resizeHandler() { if (!menu[0][0].ref) return; if (isNS4 && popOldWidth != window.innerWidth) location.reload() } function positionMenu() { } function colItem() { var names = ['text', 'href', 'type', 'length', 'spacing', 'overCol', 'backCol', 'target', 'ref']; addProps(this, arguments, names, true); } /**************************************************** Cookie code ****************************************************/ function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function SetCookie (name, value) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (argc > 2) ? argv[2] : null; var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); } function DeleteCookie (name) { var exp = new Date(); exp.setTime (exp.getTime() - 1); var cval = GetCookie (name); document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString(); } function getCookieVal(offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } /**************************************************** popup once code ****************************************************/ function popupOnce(popupUrl, windowProps, cookieName, expDays ){ var count = GetCookie(cookieName); var exp = new Date(); exp.setTime(exp.getTime() + (expDays*24*60*60*1000)); if (count == null) { count=1; SetCookie(cookieName, count, exp); window.open(popupUrl, "", windowProps); } /* else { count++; SetCookie(cookieName, count, exp); } */ } /**************************************************** Zipcode forecast code ****************************************************/ var accuZipCookieName = 'weather-accu-zip'; var accuZipCookieDays = 90; var accuCountCookieName = 'weather-accu-zip-count'; var accuCountCookieDays = 1; var accuPopupWindowProps = ''; function printZipCodeForm(){ var zip = GetCookie(accuZipCookieName); document.write('
\n'); if(zip==null){ document.write('\n'); document.write('\n'); document.write('
Remember my zipcode'); }else{ document.write('\n'); document.write('\n'); document.write('
Remember my zipcode'); } document.write('
\n'); } function submitZipCodeForm(){ // check the zipcode var zip = document.forms['accu-zip-form'].zipcode.value; var zipPattern = /^(\d{5})$/; var zipArray = zip.match(zipPattern); if(zipArray == null){ alert('Invalid zip code \'' + zip + '\'.'); return; } // check for the check box if(document.forms['accu-zip-form'].rememberzip.checked){ //alert('setting cookies'); var exp = new Date(); exp.setTime(exp.getTime() + (accuZipCookieDays*24*60*60*1000)); SetCookie(accuZipCookieName,zip,exp); } openWindow('/common/weather/zipforecast.aspx?zip=' + zip,'',accuPopupWindowProps); } function printZipCodeFormCustom(sUrl){ var zip = GetCookie(accuZipCookieName); document.write('
\n'); if(zip==null){ document.write('\n'); document.write('\n'); document.write('
Remember my zipcode'); }else{ document.write('\n'); document.write('\n'); document.write('
Remember my zipcode'); } document.write('
\n'); } function submitZipCodeFormCustom(sUrl){ // check the zipcode var zip = document.forms['accu-zip-form'].zipcode.value; var zipPattern = /^(\d{5})$/; var zipArray = zip.match(zipPattern); if(zipArray == null){ alert('Invalid zip code \'' + zip + '\'.'); return; } // check for the check box if(document.forms['accu-zip-form'].rememberzip.checked){ //alert('setting cookies'); var exp = new Date(); exp.setTime(exp.getTime() + (accuZipCookieDays*24*60*60*1000)); SetCookie(accuZipCookieName,zip,exp); } openWindow(sUrl + '?zip=' + zip,'',accuPopupWindowProps); } function popupZipCode(always){ var zip = GetCookie(accuZipCookieName); if(zip!=null){ if(always) openWindow('/common/weather/zipforecast.aspx?zip=' + zip,'',accuPopupWindowProps); else popupOnce('/common/weather/zipforecast.aspx?zip=' + zip, accuPopupWindowProps, accuCountCookieName, accuCountCookieDays); } } function cancelZipCode(){ DeleteCookie(accuZipCookieName); DeleteCookie(accuCountCookieName); alert('Weather pop-up cancelled'); } /**************************************************** Send and print story ****************************************************/ function sendStory(sTarget, sHeight, sWidth){ var sUrl = '/common/sendstory/default.aspx?url=' + escape(document.location.href); openPopup(sUrl,sTarget, sHeight, sWidth); } function printStory(sContentId, sTarget, sHeight, sWidth){ var sUrl = '/common/printstory/default.aspx?content_id=' + sContentId; openWindow(sUrl,sTarget, "titlebar=yes,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,innerWidth=" + sWidth + ",innerHeight=" + sHeight + ",width=" + sWidth + ",height=" + sHeight); } /**************************************************** Querystring Reader ****************************************************/ function PageQuery(q) { if(q.length > 1) this.q = q.substring(1, q.length); else this.q = null; this.keyValuePairs = new Array(); if(q) { for(var i=0; i < this.q.split("&").length; i++) { this.keyValuePairs[i] = this.q.split("&")[i]; } } this.getKeyValuePairs = function() { return this.keyValuePairs; } this.getValue = function(s) { for(var j=0; j < this.keyValuePairs.length; j++) { if(this.keyValuePairs[j].split("=")[0] == s) return this.keyValuePairs[j].split("=")[1]; } return false; } this.getParameters = function() { var a = new Array(this.getLength()); for(var j=0; j < this.keyValuePairs.length; j++) { a[j] = this.keyValuePairs[j].split("=")[0]; } return a; } this.getLength = function() { return this.keyValuePairs.length; } } function queryString(key){ var page = new PageQuery(window.location.search); return unescape(page.getValue(key)); } /* example querystring usage function displayItem(key){ if(queryString(key)=='false') { document.write("you didn't enter a ?name=value querystring item."); }else{ document.write(queryString(key)); } } */ /**************************************************** Browser Detection ****************************************************/ // JavaScript Browser Sniffer // Eric Krok, Andy King, Michel Plungjan Jan. 31, 2002 // see http://www.webreference.com/ for more information // // convert all characters to lowercase to simplify testing var agt=navigator.userAgent.toLowerCase(); var appVer = navigator.appVersion.toLowerCase(); // *** BROWSER VERSION *** var is_minor = parseFloat(appVer); var is_major = parseInt(is_minor); var is_opera = (agt.indexOf("opera") != -1); var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1); var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1); var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1); var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1); var is_opera6 = (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1); // new 020128- abk var is_opera7 = (agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1); // new 021205- dmr var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4); var is_opera6up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5); // new020128 var is_opera7up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5 && !is_opera6); // new021205 -- dmr // Note: On IE, start of appVersion return 3 or 4 // which supposedly is the version of Netscape it is compatible with. // So we look for the real version further on in the string // And on Mac IE5+, we look for is_minor in the ua; since // it appears to be more accurate than appVersion - 06/17/2004 var is_mac = (agt.indexOf("mac")!=-1); var iePos = appVer.indexOf('msie'); if (iePos !=-1) { if(is_mac) { var iePos = agt.indexOf('msie'); is_minor = parseFloat(agt.substring(iePos+5,agt.indexOf(';',iePos))); } else is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos))); is_major = parseInt(is_minor); } // ditto Konqueror var is_konq = false; var kqPos = agt.indexOf('konqueror'); if (kqPos !=-1) { is_konq = true; is_minor = parseFloat(agt.substring(kqPos+10,agt.indexOf(';',kqPos))); is_major = parseInt(is_minor); } var is_getElementById = (document.getElementById) ? "true" : "false"; // 001121-abk var is_getElementsByTagName = (document.getElementsByTagName) ? "true" : "false"; // 001127-abk var is_documentElement = (document.documentElement) ? "true" : "false"; // 001121-abk var is_safari = ((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))?true:false; var is_khtml = (is_safari || is_konq); var is_gecko = ((!is_khtml)&&(navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?true:false; var is_gver = 0; if (is_gecko) is_gver=navigator.productSub; var is_moz = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) && (is_gecko) && ((navigator.vendor=="")||(navigator.vendor=="Mozilla")||(navigator.vendor=="Debian"))); var is_fb = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) && (is_gecko) && (navigator.vendor=="Firebird")); var is_fx = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) && (is_gecko) && (navigator.vendor=="Firefox")); if ((is_moz)||(is_fb)||(is_fx)) { // 032504 - dmr var is_moz_ver = (navigator.vendorSub)?navigator.vendorSub:0; if(!(is_moz_ver)) { is_moz_ver = agt.indexOf('rv:'); is_moz_ver = agt.substring(is_moz_ver+3); is_paren = is_moz_ver.indexOf(')'); is_moz_ver = is_moz_ver.substring(0,is_paren); } is_minor = is_moz_ver; is_major = parseInt(is_moz_ver); } var is_fb_ver = is_moz_ver; var is_fx_ver = is_moz_ver; var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) && (!is_khtml) && (!(is_moz)) && (!is_fb) && (!is_fx)); // Netscape6 is mozilla/5 + Netscape6/6.0!!! // Mozilla/5.0 (Windows; U; Win98; en-US; m18) Gecko/20001108 Netscape6/6.0 // Changed this to use navigator.vendor/vendorSub - dmr 060502 // var nav6Pos = agt.indexOf('netscape6'); // if (nav6Pos !=-1) { if ((navigator.vendor)&& ((navigator.vendor=="Netscape6")||(navigator.vendor=="Netscape"))&& (is_nav)) { is_major = parseInt(navigator.vendorSub); // here we need is_minor as a valid float for testing. We'll // revert to the actual content before printing the result. is_minor = parseFloat(navigator.vendorSub); } var is_nav2 = (is_nav && (is_major == 2)); var is_nav3 = (is_nav && (is_major == 3)); var is_nav4 = (is_nav && (is_major == 4)); var is_nav4up = (is_nav && is_minor >= 4); // changed to is_minor for // consistency - dmr, 011001 var is_navonly = (is_nav && ((agt.indexOf(";nav") != -1) || (agt.indexOf("; nav") != -1)) ); var is_nav6 = (is_nav && is_major==6); // new 010118 mhp var is_nav6up = (is_nav && is_minor >= 6) // new 010118 mhp var is_nav5 = (is_nav && is_major == 5 && !is_nav6); // checked for ns6 var is_nav5up = (is_nav && is_minor >= 5); var is_nav7 = (is_nav && is_major == 7); var is_nav7up = (is_nav && is_minor >= 7); var is_ie = ((iePos!=-1) && (!is_opera) && (!is_khtml)); var is_ie3 = (is_ie && (is_major < 4)); var is_ie4 = (is_ie && is_major == 4); var is_ie4up = (is_ie && is_minor >= 4); var is_ie5 = (is_ie && is_major == 5); var is_ie5up = (is_ie && is_minor >= 5); var is_ie5_5 = (is_ie && (agt.indexOf("msie 5.5") !=-1)); // 020128 new - abk var is_ie5_5up =(is_ie && is_minor >= 5.5); // 020128 new - abk var is_ie6 = (is_ie && is_major == 6); var is_ie6up = (is_ie && is_minor >= 6); // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser // or if this is the first browser window opened. Thus the // variables is_aol, is_aol3, and is_aol4 aren't 100% reliable. var is_aol = (agt.indexOf("aol") != -1); var is_aol3 = (is_aol && is_ie3); var is_aol4 = (is_aol && is_ie4); var is_aol5 = (agt.indexOf("aol 5") != -1); var is_aol6 = (agt.indexOf("aol 6") != -1); var is_aol7 = ((agt.indexOf("aol 7")!=-1) || (agt.indexOf("aol7")!=-1)); var is_aol8 = ((agt.indexOf("aol 8")!=-1) || (agt.indexOf("aol8")!=-1)); var is_webtv = (agt.indexOf("webtv") != -1); // new 020128 - abk var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); var is_AOLTV = is_TVNavigator; var is_hotjava = (agt.indexOf("hotjava") != -1); var is_hotjava3 = (is_hotjava && (is_major == 3)); var is_hotjava3up = (is_hotjava && (is_major >= 3)); // end new // *** JAVASCRIPT VERSION CHECK *** // Useful to workaround Nav3 bug in which Nav3 // loads