var Fil_Nouvelle='<a id="fil_Nouvelle" href="" target="_top" class="news" ></a>';
var theItemCount ;	
function Affichetitre(title)
{	if ( document.getElementById )
	{	//document.all.titre.filters[0].Apply();
		document.getElementById("titre").innerHTML=title;	
		//document.all.titre.filters[0].Play()
	}
	else if (document.all)
	{	document.all["titre"].innerHTML=title;	}
}  

function aujourdhui()
{	
	var months=new Array(13);
	for(i=1;i<=12;i++){	months[i]=(i<10)?'0'+i:i;}
	var now=new Date();
	var lmonth=months[now.getMonth() + 1]; 
	var date=now.getDate();
	var year=now.getYear();
	if (year < 2000){year += 1900;}    
	if (date < 10){	date = "0" + date};
	document.write(date + "." + lmonth + "." + year);
}

function Typiste()
{	theItemCount=LesTitres.length ;	
	// Define run time values
	theCurrentStory     = -1;
	theCurrentLength    = 0;
	
	// Locate base objects
	if (document.getElementById) 
	{	Le_fil=document.getElementById("Fil");
		La_Nouvelle = document.getElementById("fil_Nouvelle");
		Ecrit();   	
	}else 
	{	document.write();
       return true;
	}
}
// Ticker main run loop
function Ecrit()
{
	var myTimeout;  
	// Go for the next story data block
	if(theCurrentLength == 0)
	{
		theCurrentStory++;
		theCurrentStory      = theCurrentStory % theItemCount;
		theStorySummary      = LesTitres[theCurrentStory].replace(/&quot;/g,'"');		
		theTargetLink        = LesLiens[theCurrentStory];
		if (theTargetLink != "")
		{	Le_fil.innerHTML=Fil_Nouvelle;
			La_Nouvelle = document.getElementById("fil_Nouvelle");
			//theTarget	=LesTargets[theCurrentStory]
			La_Nouvelle.href = theTargetLink;
			//La_Nouvelle.target=theTarget
		}
		else{La_Nouvelle.style.display="none";}
		thePrefix 	     = "<span class='news'>" + TypisteDebut + "</span>";
	}
	// Stuff the current ticker text into the anchor
	temp=thePrefix + theStorySummary.substring(0,theCurrentLength) + whatWidget();
	if (theTargetLink != ""){La_Nouvelle.innerHTML = temp;}
	else{Le_fil.innerHTML=temp;}
	
	// Modify the length for the substring and define the timer
	if(theCurrentLength != theStorySummary.length)
	{
		theCurrentLength++;
		myTimeout = CaractereTimout;
	}
	else
	{
		theCurrentLength = 0;
		myTimeout = TitreTimout;
	}
	// Call up the next cycle of the ticker
	setTimeout("Ecrit()", myTimeout);
}
// Widget generator
function whatWidget()
{
	if(theCurrentLength == theStorySummary.length)
	{
		return TypisteFin;
	}

	if((theCurrentLength % 2) == 1)
	{
		return carUn;
	}
	else
	{
		return carDeux;
	}
}
