// Displaying a catfish popup var popupzone = 1; var popupid = 64; var popupintervaldays = 7; var popupemail = ''; // "The Catfish is a Plenty Good Enough Fish For Anyone" // Mark Twain //logging info var catfishnow = new Date(), catfishuid = catfishnow.getTime() + '-' + catfishnow.getMilliseconds() + '-' + Math.floor(Math.random() * 10000000); //list exceptions - pages containing this URL fragment //will never generate a popup var catfish_exceptions = [ '/dustmeselectors', '/books/rails1', '/about', '/contact', '/contact.php', '/contest', '/glossary.php', '/mediakit', '/missing', '/newsletter', '/privacy.php', '/search', '/sitemap', '/syndication', '/translate_c', '/u' ]; function createcatfish() { // create catfish here catfish = document.createElement('div'); catfish.id = 'catfish'; if (catfishpopulate) catfishpopulate(catfish); return catfish; } function deploycatfish(catfish) { cookiearray = document.cookie.split(/;\s*/); var slideme = true; for (entry in cookiearray) { if (cookiearray[entry] == 'SPsub=1') return; if (cookiearray[entry] == 'SPcookie=1') return; if (cookiearray[entry] == 'SPcatfish=1') return; if (cookiearray[entry] == 'SPcatfish=2') slideme = false; } if (!document.defaultView) { // IE position:fixed hacking scrollheight = document.body.parentNode.scrollTop; var subelements = []; for (var i = 0; i < document.body.childNodes.length; i++) { subelements[i] = document.body.childNodes[i]; } var zip = document.createElement('div'); // Create the outer-most div (zip) zip.className = 'zip'; // call it zip for (var i = 0; i < subelements.length; i++) { zip.appendChild(subelements[i]); } document.body.appendChild(zip); // add the major div catfish.style.position = 'absolute'; document.body.className = 'zipped'; document.body.parentNode.className = 'zipped'; zip.scrollTop = scrollheight; document.body.parentNode.scrollTop = 0; } catfish.style.marginBottom = '-500px'; document.body.appendChild(catfish); catfishheight = catfish.offsetHeight ? catfish.offsetHeight : 20; catfish.style.marginBottom = (0 - catfishheight) + 'px'; catfishposition = 0; if (slideme) catfishtimeout = setTimeout(startcatfish, 1600); else finishcatfish(); } function startcatfish() // starts the catfish sliding up { catfishtimeout = setInterval(positioncatfish, 25); } function positioncatfish() { catfishposition += 10; catfish.style.marginBottom = '-' + (((100 - catfishposition) / 100) * catfishheight) + 'px'; if (catfishposition >= 100) { clearTimeout(catfishtimeout); catfishtimeout = setTimeout(finishcatfish, 1); } } function finishcatfish() { catfish.style.marginBottom = '0'; // jump the bottom of the document to give room for the catfish when scrolled right down document.body.parentNode.style.paddingBottom = (catfishheight - getcatfishoverlap()) +'px'; // set cookie so it won't 'slide' up for the rest of the session document.cookie = 'SPcatfish=2; path=/'; // logging via remote scripting var logu = document.createElement('img'); logu.src = '/popup/popuplog.php?zoneid='+popupzone+'&popupid='+popupid+'&type=catfish&path=' + encodeURI(document.location.pathname) + '&uid=' + catfishuid; } function destroycatfish() { if (!catfish) return false; document.body.removeChild(catfish); document.body.parentNode.style.paddingBottom = '0'; // set cookie so it won't appear for the rest of the day var expire = new Date(); expire.setTime(expire.getTime() + (43200000)); // 12 hours document.cookie = 'SPcatfish=1; expires=' + expire.toGMTString() + '; path=/'; return false; } function destroycatfishnoreturn() { destroycatfish(); var expire = new Date(); expire.setTime(expire.getTime() + (86400000 * 365)); document.cookie = 'SPsub=1; expires=' + expire.toGMTString() + '; path=/'; return false; } function catfishlaunchpopup() { //open the window pp = window.open(this.href, 'catfishpopup', 'toolbar,location,status,menubar,scrollbars,resizable,width=1024,height=768'); //if it opened successfully, log conversion and don't follow the link if(pp && !pp.closed) { var logu = document.createElement('img'); logu.src = '/popup/popuplog.php?converted=1&uid=' + catfishuid; if(typeof event != 'undefined') { event.cancelBubble = true; }//for IE return false; } //otherwise just follow the link else { return true; } } //test for cookies enabled popupcookiesenabled = false; var expire = new Date(); expire.setTime(expire.getTime() + (10000)); document.cookie = 'SPtestcookie=1; expires=' + expire.toGMTString() + '; path=/'; cookiearray = document.cookie.split(/;\s*/); for (entry in cookiearray) { if (cookiearray[entry] == 'SPtestcookie=1') popupcookiesenabled = true; } //now run through the exceptions and turn off cookie support //if we find an exception match with the current location //this will result in the popups not happening for(var i=0; i= 1024) { p.appendChild(document.createTextNode(tagtext)); p.style.color = '#DAEEF3'; p.appendChild(document.createElement('br')); } var img2 = document.createElement('img'); img2.src = 'http://www.counton2extras.com/bocp/template_files/hurricanecenter/assets/images/icon_interactive.gif'; img2.alt = 'The Olympics!'; img2.style.verticalAlign = 'middle'; p.appendChild(img2); p.appendChild(document.createTextNode(' ')); p.appendChild(a); // Middle Text Style p.style.margin = '63px 0 0 35%'; catfish.appendChild(p); } function getcatfishoverlap() // returns how many pixels this catfish overlaps the content by { return 22; }