////////////////////////////////////////////////////////////////
// Change la couleur des lignes d'un tableau
function setPointer(theRow, thePointerColor)
{
	
//	if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
//		return false;
//	}
	if (typeof(document.getElementsByTagName) != 'undefined') {
		var theCells = theRow.getElementsByTagName('td');
	}
	else if (typeof(theRow.cells) != 'undefined') {
		var theCells = theRow.cells;
	}
	else {
		return false;
	}
	var rowCellsCnt  = theCells.length;
	for (var c = 0; c < rowCellsCnt; c++) {
	theCells[c].style.backgroundColor = thePointerColor;
	}
	return true;
}


////////////////////////////////////////////////////////////////
 // DEPLIE OU REPLIE UN DIV
function depliRepli(nameDiv){
	if (document.getElementById(nameDiv).style.display != 'block'){
		document.getElementById(nameDiv).style.display='block';
	}
	else{
		document.getElementById(nameDiv).style.display='none';
	}
}



function loadBandeau(){
	var flash = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="390" height="514" id="bTop" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/lib/images/telephone_recyclage.swf" /><param name="quality" value="best" /><param name="wmode" value="transparent" /><embed src="/lib/images/telephone_recyclage.swf" wmode="transparent" quality="high" width="390" height="514" name="bTop" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
	document.getElementById('barre').innerHTML = flash;
}

function createPopup(txt){
	var body = $(document.body);
	var h = window.getHeight();
	var l = window.getScrollWidth();
	var myBox = new Element('div', {
	    'id':'message',
		'html': txt,
		'class':'myBox'
	});
	myBox.inject(body);
	clearBox.delay(1000);
}
function resize(){
	var scroll = window.getScroll();
	var h = window.getHeight();
	var l = window.getScrollWidth();
	var size = $('message').getSize();
	var top = (h-size.y)/2+scroll.y;
	var left = (l-size.x)/2;
	$('message').setStyle('top', top+'px');
	$('message').setStyle('left', left+'px');
	
}
function clearBox(){
	var myEffect = new Fx.Morph('message', {duration: '500', transition: Fx.Transitions.Sine.easeOut});
	myEffect.start({
	    'height': 0, 
	    'width': 0,
	    'opacity' : 0
	});
	destroyBox.delay(800);
}
function destroyBox(){
	$('message').destroy();
	showResult();
}
function createPopupResult(txt){
	var body = $(document.body);
	var h = window.getHeight();
	var l = window.getScrollWidth();
	var myBox = new Element('div', {
	    'id':'message',
		'html': txt,
		'class':'myBox'
	});
	myBox.inject(body);
	
}
