var iSpeed = 2000;

var iCounter = 0;
var iLeft = 370;
var iTop = 100;
var iHeight = 500;
var iWidth = 1150;

var sLast = '';
var Highlights = new Array(); 
	Highlights[0]="Flexible";       
	Highlights[1]="User friendly";
	Highlights[2]="Up to date";

function start()
{
	$("#ENXFrame").append("<div id = 'movingbox'></div>");		
	goForBlane();
}

function goForBlane()
{	
	$('#movingbox').html( Highlights[iCounter] );
	iDoLeft = randomNumber( iLeft, iWidth ); 
	iDoTop = randomNumber( iTop, iHeight );
	
	while ( iDoLeft > 800 && iDoTop < 200 )
	{
		iDoLeft = randomNumber( iLeft, iWidth );			
	}
	
	$('#movingbox').css("left", iDoLeft );
	$('#movingbox').css("top", iDoTop );	

	
	
  //  $("#movingbox").effect("slide",{},500);


	$('#movingbox').fadeIn(iSpeed, function() {
		nTop = $('#movingbox').position().top;			
		nrTop = randomNumber( nTop-75, nTop+75 );
	
		nLeft = $('#movingbox').position().left;			
		nrLeft = randomNumber( nLeft-75, nLeft+75 );	
		
		//$("#movingbox").animate({top: nrTop, left: nrLeft }, 500);


		setTimeout( "fadeOut()", 1500 );
    });
	
	
	iCounter = iCounter + 1;
	if (iCounter > Highlights.length){
		iCounter = 0;
	}
}

function fadeOut(){
	
	$('#movingbox').fadeOut(iSpeed, function() {
		goForBlane();
	});	
	
}


function randomNumber( iAMin, iAMax )
{
	iAMax = iAMax + 1;
	var iDif = iAMax - iAMin;
	
	return (Math.floor(Math.random()*iDif) + iAMin);
}
