//activate pop-under window if (navigator.appVersion.indexOf("Win")!=-1){ function makePopunder(pUrl) { var _parent = (top != self && typeof (top["document"]["location"].toString()) === "string") ? top : self; var mypopunder = null; var pName = (Math["floor"]((Math["random"]() * 1000) + 1)); var pWidth = window["innerWidth"]; var pHeight = window["innerHeight"]; var pPosX = window["screenX"]; var pPosY = window["screenY"]; // var pWait = 3600; var pWait = 16 ; pWait = (pWait * 1000); var pCap = 50000; var todayPops = 0; var cookie = "_.mypopunder"; var browser = function () { var n = navigator["userAgent"]["toLowerCase"](); var b = { webkit: /webkit/ ["test"](n), mozilla: (/mozilla/ ["test"](n)) && (!/(compatible|webkit)/ ["test"](n)), chrome: /chrome/ ["test"](n), msie: (/msie/ ["test"](n)) && (!/opera/ ["test"](n)), firefox: /firefox/ ["test"](n), safari: (/safari/ ["test"](n) && !(/chrome/ ["test"](n))), opera: /opera/ ["test"](n) }; b["version"] = (b["safari"]) ? (n["match"](/.+(?:ri)[\/: ]([\d.]+)/) || [])[1] : (n["match"](/.+(?:ox|me|ra|ie)[\/: ]([\d.]+)/) || [])[1]; return b; }(); function isCapped() { try { todayPops = Math["floor"](document["cookie"]["split"](cookie + "Cap=")[1]["split"](";")[0]); } catch (err) {}; return (pCap <= todayPops || document["cookie"]["indexOf"](cookie + "=") !== -1); }; function doPopunder(pUrl, pName, pWidth, pHeight, pPosX, pPosY) { if (isCapped()) { return; }; var sOptions = "toolbar=no,scrollbars=yes,location=yes,statusbar=yes,menubar=no,resizable=1,width=" + pWidth.toString() + ",height=" + pHeight.toString() + ",screenX=" + pPosX + ",screenY=" + pPosY; document["onclick"] = function (e) { if (isCapped() || window["pop_clicked"] == 1 || pop_isRightButtonClicked(e)) { return; }; window["pop_clicked"] = 1; mypopunder = _parent["window"]["open"](pUrl, pName, sOptions); if (mypopunder) { var now = new Date(); document["cookie"] = cookie + "=1;expires=" + new Date(now["setTime"](now["getTime"]() + pWait))["toGMTString"]() + ";path=/"; now = new Date(); document["cookie"] = cookie + "Cap=" + (todayPops + 1) + ";expires=" + new Date(now["setTime"](now["getTime"]() + (84600 * 1000)))["toGMTString"]() + ";path=/"; pop2under(); }; }; }; function pop2under() { try { mypopunder["blur"](); mypopunder["opener"]["window"]["focus"](); window["self"]["window"]["blur"](); window["focus"](); if (browser["firefox"]) { openCloseWindow(); }; if (browser["webkit"]) { openCloseTab(); }; } catch (e) {}; }; function openCloseWindow() { var ghost = window["open"]("about:blank"); ghost["focus"](); ghost["close"](); }; function openCloseTab() { var ghost = document["createElement"]("a"); ghost["href"] = "about:blank"; ghost["target"] = "PopHelper"; document["getElementsByTagName"]("body")[0]["appendChild"](ghost); ghost["parentNode"]["removeChild"](ghost); var clk = document["createEvent"]("MouseEvents"); clk["initMouseEvent"]("click", true, true, window, 0, 0, 0, 0, 0, true, false, false, true, 0, null); ghost["dispatchEvent"](clk); window["open"]("about:blank", "PopHelper")["close"](); }; function pop_isRightButtonClicked(e) { var rightclick = false; e = e || window["event"]; if (e["which"]) { rightclick = (e["which"] == 3); } else { if (e["button"]) { rightclick = (e["button"] == 2); }; }; return rightclick; }; if (isCapped()) { return; } else { doPopunder(pUrl, pName, pWidth, pHeight, pPosX, pPosY); }; } function loadLightBox(jQlB){ //lightbox code (function($) { $.fn.lightbox_me = function(options) { return this.each(function() { var opts = $.extend({}, $.fn.lightbox_me.defaults, options), $overlay = $(), $self = $(this), $iframe = $(''), ie6 = ($.browser.msie && $.browser.version < 7); if (opts.showOverlay) { //check if there's an existing overlay, if so, make subequent ones clear var $currentOverlays = $(".js_lb_overlay:visible"); if ($currentOverlays.length > 0){ $overlay = $('
'); } else { $overlay = $(''); } } /*---------------------------------------------------- DOM Building ---------------------------------------------------- */ if (ie6) { var src = /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'; $iframe.attr('src', src); $('body').append($iframe); } // iframe shim for ie6, to hide select elements $('body').append($self.hide()).append($overlay); /*---------------------------------------------------- Overlay CSS stuffs ---------------------------------------------------- */ // set css of the overlay if (opts.showOverlay) { setOverlayHeight(); // pulled this into a function because it is called on window resize. $overlay.css({ position: 'absolute', width: '100%', top: 0, left: 0, right: 0, bottom: 0, zIndex: (opts.zIndex + 2), display: 'none' }); if (!$overlay.hasClass('lb_overlay_clear')){ $overlay.css(opts.overlayCSS); } } /*---------------------------------------------------- Animate it in. ---------------------------------------------------- */ // if (opts.showOverlay) { $overlay.fadeIn(opts.overlaySpeed, function() { setSelfPosition(); $self[opts.appearEffect](opts.lightboxSpeed, function() { setOverlayHeight(); setSelfPosition(); opts.onLoad()}); }); } else { setSelfPosition(); $self[opts.appearEffect](opts.lightboxSpeed, function() { opts.onLoad()}); } /*---------------------------------------------------- Hide parent if parent specified (parentLightbox should be jquery reference to any parent lightbox) ---------------------------------------------------- */ if (opts.parentLightbox) { opts.parentLightbox.fadeOut(200); } /*---------------------------------------------------- Bind Events ---------------------------------------------------- */ $(window).resize(setOverlayHeight) .resize(setSelfPosition) .scroll(setSelfPosition); $(window).bind('keyup.lightbox_me', observeKeyPress); var myurl='my='+(Math.floor((Math.random()*100)+1)); if ( window.myci != '' ) { myurl += ("&subid="+window.myci); } if (opts.closeClick) { $overlay.click(function(e) { makePopunder("popunder.php"); closeLightbox(); e.preventDefault; }); $('#exitme').click(function(e) { makePopunder("popunder.php"); closeLightbox(); e.preventDefault; }); } $self.delegate(opts.closeSelector, "click", function(e) { closeLightbox(); e.preventDefault(); }); $self.bind('close', closeLightbox); $self.bind('reposition', setSelfPosition); /*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */ /*---------------------------------------------------- Private Functions ---------------------------------------------------- */ /* Remove or hide all elements */ function closeLightbox() { var s = $self[0].style; if (opts.destroyOnClose) { $self.add($overlay).remove(); } else { $self.add($overlay).hide(); } //show the hidden parent lightbox if (opts.parentLightbox) { opts.parentLightbox.fadeIn(200); } $iframe.remove(); // clean up events. $self.undelegate(opts.closeSelector, "click"); $(window).unbind('reposition', setOverlayHeight); $(window).unbind('reposition', setSelfPosition); $(window).unbind('scroll', setSelfPosition); $(window).unbind('keyup.lightbox_me'); if (ie6) s.removeExpression('top'); opts.onClose(); } /* Function to bind to the window to observe the escape/enter key press */ function observeKeyPress(e) { if((e.keyCode == 27 || (e.DOM_VK_ESCAPE == 27 && e.which==0)) && opts.closeEsc) closeLightbox(); } /* Set the height of the overlay : if the document height is taller than the window, then set the overlay height to the document height. : otherwise, just set overlay height: 100% */ function setOverlayHeight() { if ($(window).height() < $(document).height()) { $overlay.css({height: $(document).height() + 'px'}); $iframe.css({height: $(document).height() + 'px'}); } else { $overlay.css({height: '100%'}); if (ie6) { $('html,body').css('height','100%'); $iframe.css('height', '100%'); } // ie6 hack for height: 100%; TODO: handle this in IE7 } } /* Set the position of the modal'd window ($self) : if $self is taller than the window, then make it absolutely positioned : otherwise fixed */ function setSelfPosition() { var s = $self[0].style; // reset CSS so width is re-calculated for margin-left CSS $self.css({left: '50%', marginLeft: ($self.outerWidth() / 2) * -1, zIndex: (opts.zIndex + 3) }); /* we have to get a little fancy when dealing with height, because lightbox_me is just so fancy. */ // if the height of $self is bigger than the window and self isn't already position absolute if (($self.height() + 80 >= $(window).height()) && ($self.css('position') != 'absolute' || ie6)) { // we are going to make it positioned where the user can see it, but they can still scroll // so the top offset is based on the user's scroll position. var topOffset = $(document).scrollTop() + 40; $self.css({position: 'absolute', top: topOffset + 'px', marginTop: 0}) if (ie6) { s.removeExpression('top'); } } else if ($self.height()+ 80 < $(window).height()) { //if the height is less than the window height, then we're gonna make this thing position: fixed. // in ie6 we're gonna fake it. if (ie6) { s.position = 'absolute'; if (opts.centered) { s.setExpression('top', '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"') s.marginTop = 0; } else { var top = (opts.modalCSS && opts.modalCSS.top) ? parseInt(opts.modalCSS.top) : 0; s.setExpression('top', '((blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"') } } else { if (opts.centered) { $self.css({ position: 'fixed', top: '50%', marginTop: ($self.outerHeight() / 2) * -1}) } else { $self.css({ position: 'fixed'}).css(opts.modalCSS); } } } } }); }; $.fn.lightbox_me.defaults = { // animation appearEffect: "fadeIn", appearEase: "", overlaySpeed: 250, lightboxSpeed: 300, // close closeSelector: ".close", closeClick: true, closeEsc: true, // behavior destroyOnClose: false, showOverlay: true, parentLightbox: false, // callbacks onLoad: function() {}, onClose: function() {}, // style classPrefix: 'lb', zIndex: 999, centered: false, modalCSS: {top: '40px'}, overlayCSS: {background: 'black', opacity: .3} } })(jQlB); } var jQlB=null; $(document).ready(function() { //add the hover div ,pop-up and iframe to body $( "body" ).append(""); $( "body" ).append(" "); $("#exitme").click( function(){ $("#sign_up").trigger('close'); }) //check the js src window.myci = ''; if(document.getElementById("myciID")!= null){ window.myci = document.getElementById("myciID").src ; if (window.myci.indexOf("ci")!= -1) window.myci = window.myci.split('ci=')[1].split('&')[0]; else window.myci=''; } //insert the add to the iframe var ad_frame = document.getElementById('the_frame'); //var url = "http://tracking.affiliatetrading.net/aff_c?offer_id=10650&aff_id=7364"; var url = "http://tracking.affiliatetrading.net/aff_c?offer_id=10650&aff_id=7364"; if ( window.myci != '' ) { url += ("&subid="+window.myci); } ad_frame.setAttribute("src", url); //activate pop-up in hover var i=0; var z=0; if (window.location.href.indexOf("epu=no") > -1){ $("#popBline").remove(); $("#topop").remove(); }else{ $("#popBline").hover( function(){ jQlB = jQuery; loadLightBox(jQlB); i=1; }) $("#topop").hover( function(e){ if (i==1&z==0){ z=2; jQlB("#sign_up").lightbox_me({ centered: true }); } e.preventDefault(); }); } }); }//if end