// Fonction javascript : www.weblinear.fr V3

// Fonction DATE du jour
var tabMois = new Array(2);
tabMois[0] = new Array(12);
tabMois[1] = new Array(12);

tabMois[0][0] = "1";
tabMois[0][1] = "2";
tabMois[0][2] = "3";
tabMois[0][3] = "4";
tabMois[0][4] = "5";
tabMois[0][5] = "6";
tabMois[0][6] = "7";
tabMois[0][7] = "8";
tabMois[0][8] = "9";
tabMois[0][9] = "10";
tabMois[0][10] = "11";
tabMois[0][11] = "12";

tabMois[1][0] = "January";
tabMois[1][1] = "February";
tabMois[1][2] = "March";
tabMois[1][3] = "April";
tabMois[1][4] = "May";
tabMois[1][5] = "June";
tabMois[1][6] = "July";
tabMois[1][7] = "August";
tabMois[1][8] = "September";
tabMois[1][9] = "October";
tabMois[1][10] = "November";
tabMois[1][11] = "December";

Today = new Date;
Jour = Today.getDate();
Mois = (Today.getMonth())+1;
Annee = Today.getFullYear();
for (i=0;i<12;i++)
{
	if (Mois == tabMois[0][i])
	{
		Mois = tabMois[1][i];
	}
}
if (Jour < 10)
{
	Jour = "0"+Jour;
}
else{
	Jour = Jour;
}
//Message = Jour + "/" + Mois + "/" + Annee;
Mess_Jour = Jour ;
Mess_Mois = Mois ;
Mess_Annee = Annee;

// Fonction Heure
function HoraWeblinear()
	{
	weblinear = new Date;
	heure = weblinear.getHours();
	min = weblinear.getMinutes();
	sec = weblinear.getSeconds();
	jour = weblinear.getDate();
	mois = weblinear.getMonth()+1;
	annee = weblinear.getFullYear();
	if (sec < 10)
		sec0 = "0";
	else
		sec0 = "";
	if (min < 10)
		min0 = "0";
	else
		min0 = "";
	if (heure < 10)
		heure0 = "0";
	else
		heure0 = "";
	DinaHeure = heure0 + heure + ":" + min0 + min + ":" + sec0 + sec ;
	which = DinaHeure
	if (document.getElementById){
		document.getElementById("weblinear_heure").innerHTML=which;
	}
	setTimeout("HoraWeblinear()", 1000)
	}
window.onload = HoraWeblinear;


// Fonction MENU

$(document).ready(function() {
	
	
	$("#topnav li").prepend("<span></span>"); //Throws an empty span tag right before the a tag
	
	$("#topnav li").each(function() { //For each list item...
		var linkText = $(this).find("a").html(); //Find the text inside of the a tag
		$(this).find("span").show().html(linkText); //Add the text in the span tag
	}); 
	
	$("#topnav li").hover(function() {	//On hover...
		$(this).find("span").stop().animate({ 
			marginTop: "-40" //Find the span tag and move it up 40 pixels
		}, 250);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "0" //Move the span back to its original state (0px)
		}, 250);
	});
	
	
});


