/* This file compensates for the lack of certain CSS 2.1 selectors (notably :first-child and :hover) in InternetExplorer 6. It also handles photogallery thumbnails and font size widgets. Also handles some special functionality for the events filter form */ function surveyMonkey() { window.open('http://www.surveymonkey.com/jsPopInvite.aspx?sm=y%2bOPEwzmh9T0LQcLT89CQw%3d%3d', 'win', 'height=160,width=300,scrollbars=yes,resizable=yes,status=yes'); } function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function clearFilters(oInput){ var oFilterForm = document.getElementById("filter_form"); var oFilterGroup = new Array(); var count = 0; for(var i=0; i < oFilterForm.elements.length; i++){ if(oFilterForm.elements[i].name == oInput.name){ oFilterGroup[count] = oFilterForm.elements[i]; count++; } } if(oInput == oFilterGroup[0]){ if(oInput.checked){ for(i=0; i < oFilterGroup.length; i++){ oFilterGroup[i].checked = true; } } else { for(i=0; i < oFilterGroup.length; i++){ oFilterGroup[i].checked = false; } } } else { oFilterGroup[0].checked = false; } } function compensate_init() { //COMPENSATE FOR LACK OF A RELIABLE :FIRST-CHILD SELECTOR $("#header li:first-child").addClass("first"); $("#footer li:first-child").addClass("first"); $("#content .chunk h2").append(" \"\""); $(".pod:first-child").addClass("first"); $("#main .chunk").hover( function(){ $(this).addClass("chunk-over"); }, function(){ $(this).removeClass("chunk-over"); } ); $("#main .review").hover( function(){ $(this).addClass("review-over"); }, function(){ $(this).removeClass("review-over"); } ); $("#main .chunk").click(function(){ var link = $("h2 a", this); var the_href = link.get(0).getAttribute("href", 2); window.location.href = the_href; return false; }); $("#main .review").click(function(){ var link = $("h3 a", this); var the_href = link.get(0).getAttribute("href", 2); window.location.href = the_href; return false; }); $(".gallery_link").bind("click", function (e){ $("#main_photo").get(0).src = this.getAttribute("href", 2); $("#main_photo_caption").html($("#gallery_" + this.getAttribute("id")).html()); $("#main_photo").get(0).setAttribute("alt", $("img", this).get(0).getAttribute("alt")); return false; }); //FONT SIZE WIDGETS $(".font_size_up_link").bind("click", function(e){ $("body").addClass("largeprint"); $(".font_size_up_link").hide(); $(".font_size_down_link").show(); createCookie("fontsize", "largeprint", 365); return false; }); $(".font_size_down_link").bind("click", function(e){ $("body").removeClass("largeprint"); $(".font_size_up_link").show(); $(".font_size_down_link").hide(); createCookie("fontsize", "normal", 365); return false; }); if (cookiecontents == "largeprint") { $("body").addClass("largeprint"); $(".font_size_up_link").hide(); } else { $(".font_size_down_link").hide(); } $(".font_size_up_link").html("\"Increase"); $(".font_size_down_link").html("\"Decrease"); //TAB FUNCTIONS FOR THE HOMEPAGE $("#tab_contents2").hide(); $("#tab_contents3").hide(); $(".initially_hidden").removeClass("initially_hidden"); $("#homepage_tab1").click(function() { $("#homepage_tabs").removeClass("tab2"); $("#tab_contents2").hide(); $("#homepage_tabs").removeClass("tab3"); $("#tab_contents3").hide(); $("#homepage_tabs").addClass("tab1"); $("#tab_contents1").show(); return false; }); $("#homepage_tab2").click(function() { $("#homepage_tabs").removeClass("tab1"); $("#tab_contents1").hide(); $("#homepage_tabs").removeClass("tab3"); $("#tab_contents3").hide(); $("#homepage_tabs").addClass("tab2"); $("#tab_contents2").show(); return false; }); $("#homepage_tab3").click(function() { $("#homepage_tabs").removeClass("tab1"); $("#tab_contents1").hide(); $("#homepage_tabs").removeClass("tab2"); $("#tab_contents2").hide(); $("#homepage_tabs").addClass("tab3"); $("#tab_contents3").show(); return false; }); //Fix right nav flashContent('/ui/nav.swf','210','400','nav','test', true, "pageId=860"); } function remove_compensate() { //redefines the function to be empty so it won't execute a second time in Firefox 1.5.* compensate_init = function() { /*pass */ } } window.onpageshow = function() { compensate_init(); remove_compensate(); }; var cookiecontents = readCookie("fontsize"); var initialized = false; $(document).load(window.onpageshow);