	var windowcarbClosed = false;
	var ewW = 315;
	var ewH = 300;
	var ewTime = null;
	var ewCookie = 'ffff';
  var urlclosed = 'http://newsletter.sexy-media.com';

	function loadCarbWindow() {
		var windowcarb = document.getElementById( 'windowcarbAlert' );
		var pos = parseInt( windowcarb.style.top );
		if( pos > 0 ) { windowcarb.style.top = ( pos - 5 ) + 'px'; setTimeout( 'loadCarbWindow()', 30 ); }
	}
	
	function closeCarbWindow( test ) {
		if( windowcarbClosed == false && test == false ) { window.open(urlclosed); }
		document.getElementById( 'windowcarbone' ).style.display = 'none';
		windowcarbClosed = true;
		clearTimeout( ewTime );
	}
	
	function positionCarbWindow() {
		divBG = document.getElementById( 'windowcarbone' );
		divBG.style.top = ( getScrollTop() + getWindowHeight() - ewH ) + 'px';
		divBG.style.left = ( getScrollLeft() + getWindowWidth() - ewW - 10 ) + 'px';
		ewTime = setTimeout( "positionCarbWindow()", 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 = ewCookie + '=' + ( parseInt( getCookie( ewCookie ) ) + 1 );

	function addOnLoadEvent( func ) {
		if( typeof window.onload != 'function' ) { window.onload = func; }
		else { var oldOnload = window.onload; window.onload = function() { oldOnload(); func(); } }
	}


if( getCookie( ewCookie ) <= 0 || 0 == 0 ) {

		document.write( '<style type="text/css">' );
		document.write( '#windowcarbone {margin:0px;padding:0px;font:normal 12px Arial;color:#000000;}' );
		document.write( '#windowcarbone {width:315px;height:300px;}' );
		document.write( '#windowcarbone {position:absolute;right:10px;bottom:0px;overflow:hidden;z-index:5;}' );
		document.write( '#windowcarbAlert{ position:relative; }' );
		document.write( '.sexy { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #333333; }' );
		document.write( '.sexy a:link { color: #0000FF; text-decoration: none; font-weight:normal; }' );
		document.write( '.sexy a:active { color: #0000FF;text-decoration: none; font-weight:normal; }' );
		document.write( '.sexy a:visited { color: #0000FF; text-decoration: none; font-weight:normal; }' );
		document.write( '.sexy a:hover { color: #333333; text-decoration: none; font-weight:normal; }' );
		document.write( '</style>' );
		document.write( '<div id="windowcarbone" onselectstart="return false;">' );
    document.write( '<div id="windowcarbAlert" style="top:300px">' );
		document.write( '<table class=sexy width="310" border="0" cellpadding="0">' );
		document.write( '<tr><td align="center"><img src="http://newsletter.sexy-media.com/images/dhtml.png"></td>' );
		document.write( '</tr><tr><td align="center"><table class=sexy width="100%" border="1" cellpadding="0" bordercolor="#CC33CC">' );
		document.write( '<form action="http://newsletter.sexy-media.com/index.php?a=ajout" method="post" target="_blank">' );
		document.write( '<tr><td align="center" bgcolor="#FFFFFF"><br>' );
		document.write( '<font color=black>Votre Email :&nbsp;&nbsp;<input type="text" name="lemail">&nbsp;&nbsp;<input type=submit name=submit value=" OK "><br><br></td></form>' );
		document.write( '</tr></table></td></tr><tr>' );
		document.write( '<td align="center"><img src="http://newsletter.sexy-media.com/images/dhtml.jpg" border="0"></td>' );
		document.write( '</tr><tr><td bgcolor=white align=right><a href=# onClick="closeCarbWindow( true )">Fermer</a></td></tr></table></div>' );
		document.write( '</div></div>' );

function loadCarbWindowNow() { positionCarbWindow(); loadCarbWindow(); }
addOnLoadEvent(	function() { setTimeout( 'loadCarbWindowNow()', 0 * 1000 ); } );
}