function getElementsByClass(searchClass, node, tag) { 
    var classElements = new Array(); 
    if ( node == null ) 
        node = document; 
    if ( tag == null ) 
        tag = '*'; 
    var els = node.getElementsByTagName(tag); 
    var elsLen = els.length; 
    var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)"); 
    for (i = 0, j = 0; i < elsLen; i++) { 
        if ( pattern.test(els[i].className) ) { 
            classElements[j] = els[i]; 
            j++; 
        } 
    } 
    return classElements; 
} 
  
function tailleFonte(classe, taille) { 
    cibles = getElementsByClass(classe); 
    for (i=0; i < cibles.length; i++) { 
        cibles[i].style.fontSize = taille; 
        } 
    }

function reflow() {
    var photo = document.getElementById("refond");
    photo.style.border = photo.style.border;
}

// functions pour roll-over et click on table

	var arrayOfRolloverClasses = new Array();
	var arrayOfClickClasses = new Array();
	var activeRow = false;
	var activeRowClickArray = new Array();
	
function highlightTableRow(){
	var tableObj = this.parentNode;
	if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;

	if(this!=activeRow){
		this.setAttribute('origCl',this.className);
		this.origCl = this.className;}

	this.className = arrayOfRolloverClasses[tableObj.id];
		activeRow = this;
}
	
function clickOnTableRow(){
	var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;		
		
	if(activeRowClickArray[tableObj.id] && this!=activeRowClickArray[tableObj.id]){
		activeRowClickArray[tableObj.id].className='';}

	this.className = arrayOfClickClasses[tableObj.id];
		activeRowClickArray[tableObj.id] = this;
}
	
function resetRowStyle(){
	var tableObj = this.parentNode;
		if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;

	if(activeRowClickArray[tableObj.id] && this==activeRowClickArray[tableObj.id]){
		this.className = arrayOfClickClasses[tableObj.id];
			return;}

	var origCl = this.getAttribute('origCl');
	if(!origCl)origCl = this.origCl;
		this.className=origCl;
}
		
function addTableRolloverEffect(tableId,whichClass,whichClassOnClick){
	arrayOfRolloverClasses[tableId] = whichClass;
	arrayOfClickClasses[tableId] = whichClassOnClick;
		
	var tableObj = document.getElementById(tableId);
	var tBody = tableObj.getElementsByTagName('TBODY');
		if(tBody){var rows = tBody[0].getElementsByTagName('TR');
		}else{
			var rows = tableObj.getElementsByTagName('TR');}

	for(var no=0;no<rows.length;no++){
		rows[no].onmouseover = highlightTableRow;
		rows[no].onmouseout = resetRowStyle;
			
	if(whichClassOnClick){
	//	rows[no].onclick = clickOnTableRow;	
		rows[no].onmousedown = clickOnTableRow;}
	}
}
