function _foreachInArray(tab, id) {
	for (var i=0; i<tab.length; i++) {
    	if(tab[i]==id) {
			document.getElementById(tab[i]).style.display="block";
		} else {
			document.getElementById(tab[i]).style.display="none";
		}
	}
	return true;
}

function ShowthemeDesc(id) {
	var themes = new Array("all", "det");
	_foreachInArray(themes, id);
	
  	return true;
}

function ShowthemeTableRights(id) {
	var tab = new Array("rights");
	_foreachInArray(tab, id);
	
  	return true;
}

function ShowReportScale(id) {
	var scale = new Array("display_scale", "");
	_foreachInArray(scale, id);
	
  	return true;
}

function ShowReportSdi(id) {
	var sdi = new Array("display_sdi", "");
	_foreachInArray(sdi, id);
	
  	return true;
}

function ShowSuppInfo(id) {
	var themes = new Array("mass_delete", "mass_modify");
    	if('mass_modify'==id) {
			document.getElementById('mass_modify').style.visibility="visible";
			document.getElementById('transfert').style.visibility="visible";
			document.getElementById('mass_delete').style.visibility="hidden";
		} else {
			document.getElementById('mass_modify').style.visibility="hidden";
			document.getElementById('transfert').style.visibility="hidden";
			document.getElementById('mass_delete').style.visibility="visible";
		}
  	return true;
}

function ChangeLocation(box) {
	val = box.options[box.selectedIndex].value;
	if(val!=-1) window.open (val,'_self');
	return true;
}

function ShowFilesLayer(id, rub) {
	if(rub=='news') {
	    if(id==3) {
			document.getElementById('layervisuel1').style.display="block";
			document.getElementById('layervisuel2').style.display="block";
		} 
	    if(id==1 || id==2) {
			document.getElementById('layervisuel1').style.display="block";
			document.getElementById('layervisuel2').style.display="none";
		} 
	  	if(id==4) {
			document.getElementById('layervisuel1').style.display="none";
			document.getElementById('layervisuel2').style.display="none";
		} 
	}
	if(rub=='contents') {
		if(id==1 || id==2) {
			document.getElementById('layervisuel1').style.display="block";
		} 
	  	if(id==3) {
			document.getElementById('layervisuel1').style.display="none";
		} 
	}
  	return true;
}


$(document).ready(function(){
    
	$("a.out").attr("target", "_blank");    
    $("div#aide").css('display', 'none');
    
    $("a.aideencre").click(function () {
      $("div#aide").slideToggle("slow");
    });

  });

