/*Admin View*/
var enabled;
enabled=false;
document.onkeydown = adminView
function adminView(e) {
	var keycode;
	var allH6 = document.getElementsByTagName("h6");
	if (window.event)keycode = window.event.keyCode; /*windows*/
	else if (e) keycode = e.which; /*firefox*/
	if (keycode==123 && enabled == false ) 
	{
		for (var i = 0; i < allH6.length; i++)
			allH6[i].className = "adminViewTrue";
		enabled = true;
	}
	else if (keycode==123 && enabled == true) 
	{
		for (var i = 0; i < allH6.length; i++)
			allH6[i].className = "adminViewFalse";
		enabled = false;
	}
}

/*Montrer ou cacher un objet*/
function showHideObject(myId) {
	var myObject = document.getElementById(myId);
	myObject.className = myObject.className == "hideMe" ? "showMe" : "hideMe";
}

/*Montrer ou cacher deux objets*/
function showHideObjects(myId, myId1) {
	var myObject = document.getElementById(myId);
	var myObject1 = document.getElementById(myId1);
	myObject.className = myObject.className == "hideMe" ? "showMe" : "hideMe";
	myObject1.className = myObject1.className == "hideMe" ? "showMe" : "hideMe";
}


/*Ticker*/
function startTicker()
{
	theCurrentStory     = -1;
	theCurrentLength    = 0;
	
	if (document.getElementById) {	
		theAnchorObject     = document.getElementById("previsions");
		runTheTicker();   	
	}
	else {
		document.write("<style>#prevision{display:none;}</style>");
		return true;
	}
}

function runTheTicker()
{
	var myTimeout;  
	
	if(theCurrentLength == 0)
	{
		if(theSummaries.length == (theCurrentStory + 1) ){
			theCurrentStory=0;
		}else{
			theCurrentStory++;
		}
		theCurrentStory      = theCurrentStory % theItemCount;
		theStorySummary      = theSummaries[theCurrentStory].replace(/&quot;/g,'"');
	}
	
	theAnchorObject.innerHTML = theStorySummary.substring(0,theCurrentLength) + whatWidget();
	
	if(theCurrentLength != theStorySummary.length)
	{
		theCurrentLength++;
		myTimeout = theCharacterTimeout;
	}
	else
	{
		theCurrentLength = 0;
		myTimeout = theStoryTimeout;
	}
	
	setTimeout("runTheTicker()", myTimeout);
	}
	
	function whatWidget()
	{
	if(theCurrentLength == theStorySummary.length)
	{
		return theWidgetNone;
	}
	
	if((theCurrentLength % 2) == 1)
	{
		return theWidgetOne;
	}
	else
	{
		return theWidgetTwo;
	}
}
var theCharacterTimeout = 25;
var theStoryTimeout     = 4000;
var theWidgetOne        = "_";
var theWidgetTwo        = "-";
var theWidgetNone       = "";
var theSummaries = new Array();