// SubscribeEmail function SubscribeEmail() { //Ajax request xmlHTTPRetrievePost("/SubscribeEmail.asp?NewsletterSubscription=yes&email="+document.getElementById("email").value,"SubscribeBox"); } //Post an XML HTTP Request for AJAX function xmlHTTPRetrievePost(strURL, divName) { var xmlHttpReq = null; if (xmlHttpReq != null) { } //var self = this; // Mozilla/Safari if (window.XMLHttpRequest) { xmlHttpReq = new XMLHttpRequest(); } // IE else if (window.ActiveXObject) { xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); } xmlHttpReq.open('GET', strURL, true); xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttpReq.onreadystatechange = function() { if (xmlHttpReq.readyState == 4) { //alert('ready state:' + xmlHttpReq.readyState); //alert('status: ' + xmlHttpReq.status); //alert('response: ' + xmlHttpReq.responseText); populateSubscribeBox(xmlHttpReq.responseText, divName); } } //Compose and send the request string xmlHttpReq.send("divName=" + divName); } function populateSubscribeBox(strResult, divName) { var ctrl = document.getElementById(divName); if (ctrl) ctrl.innerHTML = strResult; } //function to fix the IE rollover function fixIE6flicker(fix) { try { document.execCommand("BackgroundImageCache", false, fix); } catch(err) { } } //homepage - display section on hover function setIslandContent() { $('.splash #island .nav li:last').addClass('last'); //set first nav item and spotlight as selected/visible $('.splash #island .nav li:first a').addClass('selected'); $('.splash #island .spot:first').addClass('selected'); //show widget $('.splash #island .nav').css('display','block'); //set on-state for active button and corresponding copy $('.splash #island .nav a').hover( function() { var navlength = $(this).parents('ul.nav').children(); var navlinks = navlength.find('a'); for(var i=0;i!=navlength.length;i++){ if(navlinks.eq(i).hasClass('selected')){ navlinks.eq(i).removeClass('selected'); } } $(this).addClass('selected'); var spots = $('.splash #island .spot'); for(var j=0;j!=navlength.length;j++){ if(navlinks.eq(j).hasClass('selected')){ for(var k=0;k!=spots.length;k++){ if(spots.eq(k).hasClass('selected')){ spots.eq(k).removeClass('selected'); } } spots.eq(j).addClass('selected'); } } } ) }; //homepage - underline heading when hovering over related photo function setIslandText() { $('.splash #island .spot a.photolink').hover( function() { $(this).next('.content').find('h1 a').css('text-decoration','underline'); }, function() { $(this).next('.content').find('h1 a').css('text-decoration','none'); } ) }; $(document).ready(function(){ fixIE6flicker(true); setIslandContent(); setIslandText(); });