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



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 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 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 showElement(element){
	if(document.getElementById(element).style.display == 'none'){
		document.getElementById(element).style.display = 'block';
	}else{
		document.getElementById(element).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)+'')
}


