function fadeIt(direction) 
{
    // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! A remettre si on veut les flèches de défilement !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! document.getElementById('pp').innerHTML = "<a href=\"javascript:void(0);\" onclick=\"stopIt();\" id=\"picStop\"><strong>Stop</strong></a>";
    
		var imageObj = new fx.Opacity('image'+count, {duration:1000});
		/*var headerObj = new fx.Opacity('header'+count, {duration:1000});
		var textObj = new fx.Opacity('text'+count, {duration:1000});*/
		
		/*textObj.setOpacity(1);
		textObj.custom(1,0);	
		
		headerObj.setOpacity(1);
		headerObj.custom(1,0);	*/
		
		imageObj.setOpacity(1);
		imageObj.custom(1,0);	
		
		if(direction=='forwards') {
			if(count < total) {
				count=count+1;
			} else {
				count=1;
			}
		} else {
			if(count > 1) {
				count=count-1;
			} else {
				count=total;
			}
		}
		
		/*if(document.getElementById('text'+count).style.display!='block') {
			document.getElementById('text'+count).style.display='block';
		}*/
		
		if(document.getElementById('image'+count).style.display!='block') {
			document.getElementById('image'+count).style.display='block';
		}
		
		/*if(document.getElementById('header'+count).style.display!='block') {
			document.getElementById('header'+count).style.display='block';
		}*/
				
		var imageObj = new fx.Opacity('image'+count, {duration:1000});
		/*var headerObj = new fx.Opacity('header'+count, {duration:1000});
		var textObj = new fx.Opacity('text'+count, {duration:1000});*/
		
		/*textObj.setOpacity(0);
		textObj.custom(0,1);	
		
		headerObj.setOpacity(0);
		headerObj.custom(0,1);	*/
		
		imageObj.setOpacity(0);
		imageObj.custom(0,1);
		
		// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! A remettre si on veut les flèches de défilement !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
		//!!!!!!!!!!!!!!!!!!!!!!!!!!! showCount();
		scrollTimer();
	}
	
	
	
	
	
function hideThem() {
		//document.getElementById('text1').style.display='block';
		document.getElementById('image1').style.display='block';
		//document.getElementById('header1').style.display='block';
		
		for(var loopCount = 2; loopCount <= total; loopCount++) {
			/*var textObj = new fx.Opacity('text'+loopCount);
			textObj.setOpacity(0);
			var headerObj = new fx.Opacity('header'+loopCount);
			headerObj.setOpacity(0);*/
			var imageObj = new fx.Opacity('image'+loopCount);
			imageObj.setOpacity(0);
		}
	}
	
	
	
	
function showCount() {
		document.getElementById('counterBox').innerHTML=count+'/'+total;
}
	
scrollTime = 5000; //0
	
function scrollTimer() 
{
		window.clearTimeout(tOut);
		tOut = setTimeout("fadeIt('forwards');",scrollTime); 
}

function stopIt()
{
	 window.clearTimeout(tOut);
	 document.getElementById('pp').innerHTML = "<a href=\"javascript:void(0);\" onclick=\"playIt();\" id=\"picPlay\"><strong>Play</strong></a>";
}

function playIt()
{
    tOut = setTimeout("fadeIt('forwards');",1); 
    document.getElementById('pp').innerHTML = "<a href=\"javascript:void(0);\" onclick=\"stopIt();\" id=\"picStop\"><strong>Stop</strong></a>";
}
	
	
	
	
	
function mouseover(id) {
		id.className = "viral-video-box-hover";
}
	
function mouseout(id) {
		id.className = "viral-video-box";
}
