// JavaScript Document
function changeOnOver(idButton){
	if(document.getElementById(idButton)){
		document.getElementById(idButton).getElementsByTagName('img')[0].src="/images/buttons/"+idButton+"_on.gif";
	}
	if(idButton=="home"){
		if(document.getElementById("toolTipBoxHome")){
			document.getElementById("toolTipBoxHome").style.display="block";	
		}		
	}
	if(idButton=="sitemap"){
		if(document.getElementById("toolTipBoxMap")){
			document.getElementById("toolTipBoxMap").style.display="block";
		}		
	}
	if(idButton=="mail"){
		if(document.getElementById("toolTipBoxMail")){
			document.getElementById("toolTipBoxMail").style.display="block";	
		}		
	}
}
function changeOnOut(idButton){
	if(document.getElementById(idButton)){
		document.getElementById(idButton).getElementsByTagName('img')[0].src="/images/buttons/"+idButton+".gif";
	}	
	allToolTipHide();
}
function allToolTipHide(){
	if(document.getElementById("toolTipBoxHome")){
		document.getElementById("toolTipBoxHome").style.display="none";
	}
	if(document.getElementById("toolTipBoxMap")){
		document.getElementById("toolTipBoxMap").style.display="none";
	}
	if(document.getElementById("toolTipBoxMail")){
		document.getElementById("toolTipBoxMail").style.display="none";	
	}
}

function clock() {
var title="JavaScriptSource The home of free scripts!";
var date=new Date();
var year=date.getFullYear();
var month=date.getMonth();
var day=date.getDate();
var hour=date.getHours();
var minute=date.getMinutes();
var second=date.getSeconds();
var months=new Array("JAN", "F&Eacute;V", "MARS", "AVR", "MAI", "JUIN", "JUILLET", "AO&Ucirc;T", "SEPT", "OCT", "NOV", "D&Eacute;C")

var monthname=months[month];

if (minute < 10) {
minute="0"+minute;
}

if (second < 10) {
second="0"+second;
}


document.getElementById('countdownTime').innerHTML=day+" "+monthname+" "+year+" - "+hour+":"+minute+":"+second;

setTimeout("clock()", 1000)
}

function showBigPicture(id){
	if(document.getElementById(id)){
		document.getElementById(id).style.left=(screen.width-600)/2;
		document.getElementById(id).style.display="block";		
	}
	if(document.getElementById("podlojka")){
		document.getElementById("podlojka").style.left=(screen.width-600)/2;
		document.getElementById("podlojka").style.display="block";		
	}
}
function hideBigPicture(img){
	img.style.display="none";
	document.getElementById("podlojka").style.display="none";	
}

function moveBox(){
	this.ver=navigator.appVersion;
	this.agent=navigator.userAgent;
	this.dom=document.getElementById?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.opera=this.agent.indexOf("Opera")>-1;
	function checkVisible(j){
		return document.getElementsByClassName("MultiBoxContainer")[j].style.display;
	}
	if(this.ie6){
		//document.getElementsByClassName("MultiBoxContainer")[i].style.top = 160 + window.getScrollTop() + "px";	
	}
	else if(!this.opera){
		for(i=0;i<document.getElementsByClassName("MultiBoxContainer").length;i++){
			document.getElementsByClassName("MultiBoxContainer")[i].style.position = "fixed";
		}
	}	
}
function setSizes(idName){
	var idArray = new Array(idName+"1",idName+"2",idName+"3",idName+"4",idName+"5");
	var wid = document.documentElement.clientWidth - 70;
	var hei = document.documentElement.clientHeight - 115;
	for(i=0;i<idArray.length;i++){
		if(document.getElementById(idArray[i])){
			document.getElementById(idArray[i]).rel = "width:" + wid + ",height:" + hei;
		}
	}
}
function showBlackBg(){
	var bg = document.getElementById("blackBg");
	if(bg){
		bg.style.display = "block";
		bg.style.width = document.body.clientWidth + "px";
		bg.style.height = document.body.clientHeight + "px";
	}
}
function hideBlackBg(){
	var bg = document.getElementById("blackBg");
	if(bg){
		bg.style.display = "none";
	}
}
document.getElementsByClassName = function(clsName){    
	var retVal = new Array();    
	var elements = document.getElementsByTagName("*");    
	for(var i = 0;i < elements.length;i++){        
		if(elements[i].className.indexOf(" ") >= 0){            
			var classes = elements[i].className.split(" ");            
			for(var j = 0;j < classes.length;j++){                
				if(classes[j] == clsName)                    
					retVal.push(elements[i]);            
			}        
		}        
		else if(elements[i].className == clsName)
			retVal.push(elements[i]);    
	}    
	return retVal;
}
function doRedirect(list){
	if(list.value != ""){
		location.href = "/actualites/horaires2010.jsp#"+list.value;
	}
}
function showVideo(src){
	var videoBlock = document.getElementById("videoBlock");
	if(videoBlock){
		videoBlock.style.display = "block";
		videoBlock.getElementsByTagName("iframe")[0].src = src;
	}
}
function hideVideo(){
	var videoBlock = document.getElementById("videoBlock");
	if(videoBlock){
		videoBlock.style.display = "none";
		videoBlock.getElementsByTagName("iframe")[0].src = "";
	}
}
function showSlideShow(){
	var sBlock = document.getElementById("slideshowBlock");
	if(sBlock){
		sBlock.style.display = "block";
	}
}
function hideSlideshow(){
	var sBlock = document.getElementById("slideshowBlock");
	if(sBlock){
		sBlock.style.display = "none";
	}
}