// JavaScript Document

var homepage_current_id = 1;
var homepage_mode_auto = true;

function homepage_infos_change_onglet(id) {
	document.getElementById("VRinfosRight"+homepage_current_id).className = 'VRinfosRightContent';
	document.getElementById("VRinfosRight"+id).className = 'VRinfosRightContentSelected';
	document.getElementById("VRinfosRightH2"+homepage_current_id).className = 'blue';
	document.getElementById("VRinfosRightH2"+id).className = 'white';
	$("#VRinfosLeft"+homepage_current_id).fadeOut(1000);
	$("#VRinfosLeft"+id).fadeIn(1000);
	homepage_set_current_id(id);
}

function homepage_set_current_id(id) {
	homepage_current_id = id;
}

function homepage_infos_onclick(id) {
	homepage_stop_autorun();
	if(homepage_current_id != id)
		homepage_infos_change_onglet(id);
}

function homepage_stop_autorun() {
	homepage_mode_auto = false;
}

function homepage_infos_autoone(duree) {
	if(homepage_mode_auto) {
		var id = homepage_current_id + 1;
		if(id > 4)
			id = 1;
		homepage_infos_change_onglet(id);
		homepage_infos_autorun(duree);
	}
}
function homepage_infos_autorun(duree) {
	setTimeout("homepage_infos_autoone("+duree+")", duree);
}



// -----------------------------------------------------

$(document).ready(function(){
	$("#nav-one li").hover(
		function(){ $("ul", this).fadeIn("fast"); }, 
		function() { } 
	);
	if (document.all) {
		$("#nav-one li").hoverClass ("sfHover");
	}
});

$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover( 
			function() { $(this).addClass(c);  },
			function() { $(this).removeClass(c); }
		);
	});
};

