// JavaScript Document
/*
	Developed by Robert Nyman, http://www.robertnyman.com
	Code/licensing: http://code.google.com/p/getelementsbyclassname/
*/


window.onload = loadFunction;

function loadFunction(){
	menuImgState() ;
	rollOverImg() ; 
	
	}

function getByClass(classname){
	alltag = window.document.getElementsByTagName("*");
	var arr = new Array();
	for(var i=0;i<alltag.length;i++){
		if(alltag[i].className.indexOf(classname) !== -1){
			arr.unshift(alltag[i]);
		}
	}
	return arr;
}

function menuImgState(){
	imgs = getByClass('menuImgState');
	for(var i=0;i<imgs.length;i++){
		imgs[i].onmouseover = function(){
			EXT = this.src.substr((this.src.length)-4);
			imgName = this.src.substr(0,(this.src.length)-4);
			this.setAttribute("src",imgName+'_over'+EXT);
			this.onmouseout = function(){ 
				this.setAttribute("src",imgName+EXT);
			}
			this.onmousedown = function(){ 
				this.setAttribute("src",imgName+'_on'+EXT);
			}
		};
	}
}

function rollOverImg(){
	imgs = getByClass('rollOverImg');
	for(var i=0;i<imgs.length;i++){
		imgs[i].onmouseover = function(){
			EXT = this.src.substr((this.src.length)-4);
			imgName = this.src.substr(0,(this.src.length)-4);
			this.setAttribute("src",imgName+'_over'+EXT);
			
			this.onmouseout = function(){ 
				this.setAttribute("src",imgName+EXT);
			}
		};
	}
}





function showElement(element){
	
	
	if(document.getElementById(element).style.display == 'none'){
		document.getElementById(element).style.display = 'block';
	}else{
		document.getElementById(element).style.display = 'none';
	}
	

	
}





var section = new Array;
section[0] = 'incription_detaillet1';
section[1] = 'incription_detaillet2';
section[2] = 'incription_detaillet3';
		
function switchContent(id){
	for(var i=0;i<section.length;i++){
		document.getElementById(section[i]).style.display = 'none';
	}
		document.getElementById(id).style.display = 'block';
	
	if(id == 'incription_detaillet1'){
		document.getElementById('menueheader_insc').className = 'a';
	}	
	if(id == 'incription_detaillet2'){
		document.getElementById('menueheader_insc').className = 'b';
		
	}	
	if(id == 'incription_detaillet3'){

		document.getElementById('menueheader_insc').className = 'c';
	}	

}


function switchBG(id){
	if(id == '1'){
		document.getElementById('menuhome').className = 'a';
		document.getElementById('redrow1').style.display = 'none';
		document.getElementById('redrow2').style.display = 'block';
		document.getElementById('redrow3').style.display = 'block';

	}	
	if(id == '2'){
	document.getElementById('menuhome').className = 'b';
		document.getElementById('redrow1').style.display = 'block';
		document.getElementById('redrow2').style.display = 'none';
		document.getElementById('redrow3').style.display = 'block';
	}	
	if(id == '3'){
		document.getElementById('menuhome').className = 'c';
		document.getElementById('redrow1').style.display = 'block';
		document.getElementById('redrow2').style.display = 'block';
		document.getElementById('redrow3').style.display = 'none';
		

	}	

}
function switchBG2(id){
	if(id == '1'){
		document.getElementById('menuhome2').className = 'a';
		document.getElementById('homeIframe').style.height = home_onglet1_height+'px';
	document.getElementById('redrow1').style.display = 'none';
		document.getElementById('redrow2').style.display = 'block';
		document.getElementById('redrow3').style.display = 'block';

	}	
	if(id == '2'){
	document.getElementById('menuhome2').className = 'b';
		document.getElementById('homeIframe').style.height = home_onglet2_height+'px';
		document.getElementById('redrow1').style.display = 'block';
		document.getElementById('redrow2').style.display = 'none';
		document.getElementById('redrow3').style.display = 'block';
	}	
	if(id == '3'){
		document.getElementById('menuhome2').className = 'c';
		document.getElementById('homeIframe').style.height = home_onglet3_height+'px';
		document.getElementById('redrow1').style.display = 'block';
		document.getElementById('redrow2').style.display = 'block';
		document.getElementById('redrow3').style.display = 'none';
		

	}	

}


function popup(url,widthh,heightt,name){
	/*
	
	
	*/
	larg=screen.width/2;
haut=screen.height/2;
test=haut-(haut/2)


	window.open (url, 'nom_interne_de_la_fenetre', config='height='+heightt+', width='+widthh+', toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, directories=no, status=no,top='+test+',left='+(larg-larg/2)+'')
}


