var current = 0;
var x = 0;
var speed = 40;        // Vitesse d'écriture 
var speed2 = 1000;     // Temps de pause entre les lignes


	
function typewrite() {
	var now = new Date();
	var jour = now.getDay();
	var mois = now.getMonth();
	var an = now.getYear();
	var hours = now.getHours();
	var minutes = now.getMinutes();
	var seconds = now.getSeconds();
	if (now.getDate() < 10){
		lejour= "0" + now.getDate();
	}else{
		lejour= now.getDate();
	}		
	timeValue = lesjours[jour] + " " + now.getDate() + " " + lesmois[mois] + " " + an
	timeValue += " à " +((hours < 10) ? "0" : "") + hours
	timeValue += ((minutes < 10) ? ":0" : ":") + minutes
	timeValue += ((seconds < 10) ? ":0" : ":") + seconds
	
	var m = typ[current];

	if (x == m.length + 1) {
		window.status = timeValue + " - " + m.substring(0, x++);	
		x = 0;
		current++;
		if (current > typ.length - 1){current = 0;}
		setTimeout("typewrite()", speed2);
	} else {
		window.status = timeValue + " - " + m.substring(0, x++) + "_";
		setTimeout("typewrite()", speed);
	}
}



function initphrase(){

	var now = new Date();
	var jour = now.getDay();
	var mois = now.getMonth();
	var an = now.getYear();	
	steValue = "Aujourd'hui nous fêtons la " + ste[mois+1][now.getDate()];
	eveValue = ""+ eve[mois+1][now.getDate()]
			
	if (eveValue.length < 1){
		typ = new initArray(2)
		typ[0]="Bienvenue sur le site des vidéos sexy"
		typ[1]=steValue		
	}else{			
		typ = new initArray(3)
		typ[0]="Bienvenue sur le site des vidéos sexy"
		typ[1]=steValue		
		typ[2]=eveValue		
	}
}

function initArray(n) {
  this.length = n;
  for (var i =1; i <= n; i++) {
    this[i] = ' '
  }
}