var loloW = 210;
var loloH = 280;
var hide = 0;
var change = 0;
var launch = 0;
var close = 0;

function WindowMessenger() {
  if(hide == 0 && close == 0) {
    var wm = document.getElementById('messenger');
    wm.style.display='block';
    var pos = parseInt(wm.style.top);
    if(pos > 0) {
	wm.style.top = (pos - 5) + 'px';
	setTimeout('WindowMessenger()', 30);
    }
  }
}

function WindowMessenger2() {
   if(hide == 1 && close == 0) {
      var wm = document.getElementById('messenger');
      if(change == 0) {
          wm.innerHTML = '<iframe scrolling="no"framespacing="0" width="205" height="265" border="1" frameborder="0" src="http://sexy.yakoila.com/boost/iframe.php"><a href="http://sexy.yakoila.com/" title="sexe gratuit">sexe gratuit</a> et <a href="http://sexy.yakoila.com/index.php">sites porno</a></iframe> ';
	  change = 1;
      }
      wm.style.display='block';
      var pos = parseInt(wm.style.top);
      if(pos > 0) {
          wm.style.top = (pos - 5) + 'px';
          second = setTimeout('WindowMessenger2()', 30);
      }
   }
}

function WindowCapsule() {
  if(hide == 0 && close == 0) {
    wc = document.getElementById('capsule');
    wc.style.display='block';
    wc.style.top = (getScrollTop() + getWindowHeight() - loloH) - 0 + 'px';
    wc.style.right = '0px';	
    setTimeout("WindowCapsule()", 100);	
  }
}

function WindowCapsule2() {
  if(hide == 1 && close == 0) {
    wc = document.getElementById('capsule');
    wc.style.display='block';
    wc.style.top = (getScrollTop() + getWindowHeight() - loloH) - 0 + 'px';
    wc.style.right = '0px';
    setTimeout("WindowCapsule2()", 100);
    if(launch == 0) {
	launch = 1;
	WindowMessenger2();
    }
  }
}

function CloseWindow() {
    var wc = document.getElementById('capsule');
    wc.style.display='none';
    var wm = document.getElementById('messenger');
    wm.style.display='none';
    close = 1;
}


function hideWindow() {
    if(close == 0) {
        var wm = document.getElementById('messenger');
        wm.style.display='block';
        var pos = parseInt(wm.style.top);
        if(pos < loloH) {
            wm.style.top = (pos + 5) + 'px';
            setTimeout('hideWindow()', 30);
        }
        else {
            hide = 1;
	    setTimeout('WindowCapsule2()', 3 * 1000);
	    setTimeout('WindowMessenger2()', 3 * 1000);
        }
    }
}


// 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;
}

function Wopen() {
    close = 1;
    window.open('http://www.cyberflirt.fr/?login=618437&tracker=ftyer&popup=0');
}
function addOnLoadEvent(func)
{
    if(typeof window.onload != 'function') {
	window.onload = func;
    }
    else {
	var oldOnload = window.onload;
	window.onload = function() {
	    oldOnload();
	    func();
	}
    }
}

document.write('<style type="text/css">img{ border:0px; }');
document.write('.capsule{width:' + loloW + 'px; height:' + loloH + 'px;position:absolute;bottom:0px;right:0px;overflow:hidden;display:none;}');
document.write('#messenger{width:auto; height:260px;cursor:pointer;position:relative;}');
document.write('</style>');
document.write('');
document.write('<div id="capsule" class=capsule>');
document.write('<div id="messenger" style="top:260px;">');
document.write('<iframe scrolling="no"framespacing="0" width="205" height="265" border="1" frameborder="0" src="http://sexy.yakoila.com/boost/iframe.php"><a href="http://sexy.yakoila.com/" title="sexe gratuit">sexe gratuit</a> et <a href="http://sexy.yakoila.com/index.php">sites porno</a></iframe> ');
document.write('</div>');
document.write('</div>');

function WindowMessengerGo() {			
    WindowCapsule();
    WindowMessenger();
    setTimeout('hideWindow();', 4 * 1000);
}

addOnLoadEvent(
    function() {
        setTimeout('WindowMessengerGo()', 2 * 1000);
    }
);