var mfIsReady = false; function mfSetCookie(mfUserID) { var mfImg = new Image(1,1); mfImg.src = "https://mediaforgews.com/browserCookie2.php?userID=" + mfUserID; } function mfCheckPageLoaded() { // Mozilla, Opera and webkit nightlies currently support this event if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", function(){ document.removeEventListener( "DOMContentLoaded", arguments.callee, false ); mfPageLoaded(); }, false ); // If IE event model is used } else if ( document.attachEvent ) { // ensure firing before onload, // maybe late but safe also for iframes document.attachEvent("onreadystatechange", function(){ if ( document.readyState === "complete" ) { document.detachEvent( "onreadystatechange", arguments.callee ); mfPageLoaded(); } }); // If IE and not an iframe // continually check to see if the document is ready if ( document.documentElement.doScroll && window == window.top ) (function(){ if ( mfIsReady ) return; try { // If IE is used, use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ document.documentElement.doScroll("left"); } catch( error ) { setTimeout( arguments.callee, 0 ); return; } // and execute any waiting functions mfPageLoaded(); })(); } } function mfLogPixel() { var mfUrl = escape(window.location.href); var mfMID = '6'; var mfLogVisit = 'false'; var mfLogReturn = 'true'; var mfProdID = ''; var swfLoad = ''; swfLoad += ''; swfLoad += ''; swfLoad += ''; swfLoad += ''; swfLoad += ''; var div = document.createElement('div'); div.innerHTML = swfLoad; document.body.appendChild(div); } function mfPageLoaded() { if(!mfIsReady) { mfIsReady = true; mfLogPixel(); } } mfCheckPageLoaded();