//Pop-under window- By JavaScript Kit //Credit notice must stay intact for use //Visit javascriptkit.com for this script //specify page to pop-under var popunder='http://www.fupa.com/freeplay.aspx'; var winfeatures="width=1000,height=710,scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0"; var once_per_session=1; function getCookie(c_name) { var i,x,y,ARRcookies=document.cookie.split(";"); for (i=0;i0) { subid = cat1.toLowerCase(); } if (docurl.indexOf(cat2)>0) { subid = cat2.toLowerCase(); } if (docurl.indexOf(cat3)>0) { subid = cat3.toLowerCase(); } if (docurl.indexOf(cat4)>0) { subid = cat4.toLowerCase(); } if (docurl.indexOf(cat5)>0) { subid = cat5.toLowerCase(); } if (docurl.indexOf(cat6)>0) { subid = cat6.toLowerCase(); } if (docurl.indexOf(cat7)>0) { subid = cat7.toLowerCase(); } if (docurl.indexOf(cat8)>0) { subid = cat8.toLowerCase(); } if (docurl.indexOf(cat9)>0) { subid = cat9.toLowerCase(); } if (docurl.indexOf(cat10)>0) { subid = cat10.toLowerCase(); } if (docurl.indexOf(cat11)>0) { subid = cat11.toLowerCase(); } if (docurl.indexOf(cat12)>0) { subid = cat12.toLowerCase(); } if (docurl.indexOf(cat13)>0) { subid = cat13.toLowerCase(); } if (docurl.indexOf(cat14)>0) { subid = cat14.toLowerCase(); } if (docurl.indexOf(cat15)>0) { subid = cat15.toLowerCase(); } if (docurl.indexOf(cat16)>0) { subid = cat16.toLowerCase(); } if (spoplink.indexOf("mmotraffic.com")>0) { spoplink = spoplink + "?subid=" + subid; } win2=window.open(spoplink,"fupasignup",winfeatures) win2.blur() window.focus() } function email() { open("mailto"+":"+"web"+"master"+"@"+"fupa"+".com"); } function bookmark(){ var title = 'Fupa.com - Number one source for free online games!'; var url = 'http://www.fupa.com/'; if (document.all) window.external.AddFavorite(url, title); else if (window.sidebar) window.sidebar.addPanel(title, url, "") else if (window.sidebar&&window.sidebar.addPanel) window.sidebar.addPanel(title,url,""); } function toggleDiv(divid){ if(document.getElementById(divid).style.display == 'none'){ document.getElementById(divid).style.display = 'block'; }else{ document.getElementById(divid).style.display = 'none'; } } function setDivOff(divid){ document.getElementById(divid).style.display = 'none'; } if (window != top) top.location.href = location.href; /*! Copyright (c) 2008 Brandon Aaron (http://brandonaaron.net) * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * * Version: @VERSION * * Requires: jQuery 1.2+ */ (function($) { var elements = [], timeout; $.fn.extend({ viewable: function(callback) { this .bind('viewable', callback) .each(function() { elements.push(this); }); if ( $.isReady ) checkVisibility(); return this; }, stopViewable: function() { return this.each(function() { var self = this; $.each( elements, function(i, element) { if ( self == element ) delete elements[i]; }); }); } }); // Check the elements visibility function checkVisibility() { // Get necessary viewport dimensions var winHeight = $(window).height(), winTop = self.pageYOffset || $.boxModel && document.documentElement.scrollTop || document.body.scrollTop, winBottom = winHeight + winTop; // Loop through the elements and check to see if they are viewable $.each(elements, function(i, element) { if ( !element ) return; // Get element top offset and height var elTop = $(element).offset().top, elHeight = parseInt( $(element).css('height') ), elBottom = elTop + elHeight, percentage = 0, hiddenTop = 0, hiddenBottom = 0; // Get percentage of unviewable area if ( elTop < winTop ) // Area above the viewport hiddenTop = winTop-elTop; if ( elBottom > winBottom ) // Area below the viewport hiddenBottom = elBottom-winBottom; percentage = 1 - ((hiddenTop + hiddenBottom)/elHeight); // Trigger viewable event along with percentage of viewable $(element).trigger('viewable', [ (percentage > 1 ? 1 : percentage < 0 ? 0 : parseFloat(percentage)) ]); }); }; $(function() { // Bind scroll function to window when document is ready $(window) .bind('scroll.viewable', function() { // Clear timeout if scrolling hasn't paused if ( timeout ) clearTimeout(timeout); // Create timeout to run actual calculations for once scrolling has paused timeout = setTimeout(checkVisibility, 250); }); // Check to see if the element is already visible checkVisibility(); }); })(jQuery);