var player= {
	tempo : 3000,
	currentActive : null,	
	timer : null,
	currentId :0,
	arr_li : [],
	build : function() {
		var player = document.getElementById('player');				
		
		var arr_li = player.childNodes;
		var is_first_li = false;
		
		for(var i=0; i<arr_li.length; i++) {
			if (arr_li[i].tagName=="LI" && arr_li[i].firstChild!=undefined && arr_li[i].firstChild.firstChild!=undefined) {        		
				//Evenement de mouse over
				arr_li[i].firstChild.firstChild.onmouseover = this.onMouseOver;
				arr_li[i].firstChild.firstChild.onmouseout = this.onMouseOut;
				this.arr_li.push(arr_li[i].firstChild.firstChild);
				//active	par defaut					
				if (!is_first_li) {
					is_first_li = true;
					this.currentActive = arr_li[i];
	                if (document.createEvent) {
	                    var evObj = document.createEvent('MouseEvents');
	                    evObj.initMouseEvent('mouseover', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
	                    arr_li[i].firstChild.firstChild.dispatchEvent(evObj);
	                } else {
	                    arr_li[i].firstChild.firstChild.fireEvent("onmouseover");
	                }
				} 
			}
		}
		this.start();
	},
	onMouseOut : function() {
		clearInterval(player.timer);
		player.start();
	},
	onMouseOver : function(e, bool) {	
		
		if (bool==undefined) {
			clearInterval(player.timer);
		}
		
		//suppression de classe active sur courant
		if (player.currentActive!=null) {
			player.currentActive.className=player.currentActive.className.replace(/active/, '');
		}
		
		var li = this.parentNode.parentNode;
		var href = this.parentNode.href;
				
		//mise aÂ  jour des contenus
		document.getElementById('full').innerHTML = li.innerHTML;
		document.getElementById('title').innerHTML = '<a href="'+href+'">'+this.getAttribute("title")+'</a>';
		
		
		//remplacement de classe
		if (li.className!=null) {
			li.className+= 'active';
		} else {
			li.className= 'active';
		}
		
		player.currentActive = li;
	},
	start : function() {
		player.timer = setInterval(function() {player.swap();}, player.tempo);
	},
	swap : function() {
		player.arr_li[player.currentId++].onmouseover(null, true);		
		if (player.currentId>player.arr_li.length-1) {player.currentId=0;}
	}
};
