/***********************************************
* Swap layers to display / hide graphics
***********************************************/

var vis = new Array();

carre.src = 'square_minus.gif';
carre = new Image();


function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function swap_layer(couche) {
	carre = MM_findObj('Sqr' + couche);
	mytop = MM_findObj('Top' + couche);
	layer = MM_findObj('Layer' + couche);
		
	if (!(layer = MM_findObj('Layer' + couche))) return;
	
	if (layer.className == 'news_down') vis[couche] = 'shown';
	
	if (vis[couche] == 'hidden' || !vis[couche]) {
		if (carre) carre.src = '/img/square_minus.gif'; // + rtl + '.gif';
		layer.className = 'news_down';
		vis[couche] = 'shown';
	} else {
		if (carre) carre.src = '/img/square_plus.gif';
		layer.className = 'news_up';
		vis[couche] = 'hidden';
	}
}

function highlight(couche) {
	if (!(myrow = MM_findObj('Row' + couche))) return;
	style = 'highlight';
	if (myrow.className == 'error') {
		style = 'highlight_error';
	} 
	myrow.className = style;
	return;
}

function lowlight(couche,style) {
	if (!(row = MM_findObj('Row' + couche))) return;
	myrow.className = style;
}

function changeclass(objet, myClass)
{
		objet.className = myClass;
}