var popAdClosed = false; var paW = 200; var paH = 116; var paTime = null; var paCookie = 'panum'; function loadPopAd() { var popAd = document.getElementById( 'popAdAlert' ); var pos = parseInt( popAd.style.top ); if( pos > 0 ) { popAd.style.top = ( pos - 4 ) + 'px'; setTimeout( 'loadPopAd()', 30 ); } } function closePopAd( test ) { if( popAdClosed == false && test == false ) { window.open( 'http://www.elena-dvd.com/' ); } document.getElementById( 'popAdAlertBackground' ).style.display = 'none'; popAdClosed = true; clearTimeout( paTime ); } function positionPopAd() { divBG = document.getElementById( 'popAdAlertBackground' ); divBG.style.top = ( getScrollTop() + getWindowHeight() - paH ) + 'px'; divBG.style.left = ( getScrollLeft() + getWindowWidth() - paW - 10 ) + 'px'; paTime = setTimeout( "positionPopAd()", 100 ); } // fonction de positions var is_Netscape = navigator.appName.indexOf("Netscape")!= -1; var is_Body = document.body; function getWindowHeight() { if( typeof window.innerHeight == 'number' ) { var winH = window.innerHeight; if( window.scrollMaxX > 0 ) { winH -= 17; } return winH; } else if ( document.documentElement.clientHeight) { return document.documentElement.clientHeight; } else if( typeof document.body.clientHeight == 'number' ) { return document.body.clientHeight; } } function getWindowWidth() { if( typeof window.innerWidth == 'number' ) { var winW = window.innerWidth; if( window.scrollMaxY > 0 ) { winW -= 17; } return winW; } else if ( document.documentElement.clientWidth ) { return document.documentElement.clientWidth; } else if( document.body && document.body.clientWidth ) { return document.body.clientWidth; } } function getScrollLeft() { var posLeft = false; if( is_Netscape ) { posLeft = window.pageXOffset; } else if( document.documentElement && document.documentElement.scrollTop ) { posLeft = document.documentElement.scrollLeft; } else if( is_Body ) { posLeft = document.body.scrollLeft; } return typeof posLeft == 'number' ? posLeft : 0; } function getScrollTop() { var posTop = false; if (window.innerHeight) { posTop = window.pageYOffset; } else if( document.documentElement && document.documentElement.scrollTop ) { posTop = document.documentElement.scrollTop; } else if( is_Body ) { posTop = document.body.scrollTop; } return typeof posTop == 'number' ? posTop : 0; } // cookies function getCookie( name ) { var cookieLen = name.length; var cookieData = document.cookie; var allcookieLen = cookieData.length; var i = 0; var cookieEnd; while( i < allcookieLen ) { var j = i + cookieLen; if( cookieData.substring( i, j ) == name ) { cookieEnd = cookieData.indexOf( ";", j ); if( cookieEnd == -1 ) { cookieEnd = cookieData.length; } return unescape( cookieData.substring( j + 1, cookieEnd ) ); } i++; } return 0; } document.cookie = paCookie + '=' + ( parseInt( getCookie( paCookie ) ) + 1 ); function addOnLoadEvent( func ) { if( typeof window.onload != 'function' ) { window.onload = func; } else { var oldOnload = window.onload; window.onload = function() { oldOnload(); func(); } } } if( getCookie( paCookie ) <= 0 || 0 == 0 ) { document.write( '
' ); function loadPopAdNow() { positionPopAd(); loadPopAd(); } addOnLoadEvent( function() { setTimeout( 'loadPopAdNow()', 5 * 1000 ); } ); }