var ns=(document.layers)?1:0;
var ns6=(document.getElementById&&!document.all)?1:0;
var ie=document.all

var Cstep = 0;
var Step = Math.random()*0.1+0.05;

function fly() {
	var WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
	var WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
	var hscrll=(ns||ns6)?window.pageYOffset:document.body.scrollTop;
	var wscrll=(ns||ns6)?window.pageXOffset:document.body.scrollLeft;
	var stop = 0;
	var Speed = 2;
	var Xpos = parseInt( libellule.style.marginLeft);
	var Ypos = parseInt( libellule.style.top);
	
	sy = Speed*Math.sin(Cstep);
	sx = Speed*2;
	Ypos+=sy;
	Xpos+=sx;
	if (Xpos > WinWidth/2 -40){
		stop = 1;
	  	libellule.style.visibility = 'hidden';
		Ypos=Math.round(Math.random()*WinHeight);
		Xpos=-60;
		Speed=Math.random()*5+1;
	}

	libellule.style.marginLeft = (Xpos+wscrll) + 'px';
	libellule.style.top = Ypos + 'px';
	
	Cstep+=Step;
	if ( !stop)
	  var timer = setTimeout('fly()',20);

}
