function griserChampsActu(champ)
{
	element = document.getElementById(champ).value;
	
	if(champ == 'type_actu') {
		if(document.getElementById('periode').selectedIndex != 0) reinitChamp('periode');
		GriseChamp('periode');
		
		BlancChamp('type_actu');
	} else if(champ == 'periode') {
		if(document.getElementById('type_actu').selectedIndex != 0) reinitChamp('type_actu');
		GriseChamp('type_actu');
		
		BlancChamp('periode');
	}

}

function griserChampsProjets(champ)
{
	element = document.getElementById(champ).value;
	
	if(champ == 'region') {
		if(document.getElementById('type').selectedIndex != 0) reinitChamp('type');
		if(document.getElementById('annee').selectedIndex != 0) reinitChamp('annee');
		if(document.getElementById('projet').selectedIndex != 0) reinitChamp('projet');
		GriseChamp('type');
		GriseChamp('annee');
		GriseChamp('projet');
		
		BlancChamp('region');
	} else if(champ == 'type') {
		if(document.getElementById('region').selectedIndex != 0) reinitChamp('region');
		if(document.getElementById('annee').selectedIndex != 0) reinitChamp('annee');
		if(document.getElementById('projet').selectedIndex != 0) reinitChamp('projet');
		GriseChamp('region');
		GriseChamp('annee');
		GriseChamp('projet');
		
		BlancChamp('type');
	} else if(champ == 'annee') {
		if(document.getElementById('region').selectedIndex != 0) reinitChamp('region');
		if(document.getElementById('type').selectedIndex != 0) reinitChamp('type');
		if(document.getElementById('projet').selectedIndex != 0) reinitChamp('projet');
		GriseChamp('region');
		GriseChamp('type');
		GriseChamp('projet');
		
		BlancChamp('annee');
	} else if(champ == 'projet') {
		if(document.getElementById('region').selectedIndex != 0) reinitChamp('region');
		if(document.getElementById('type').selectedIndex != 0) reinitChamp('type');
		if(document.getElementById('annee').selectedIndex != 0) reinitChamp('annee');
		GriseChamp('region');
		GriseChamp('type');
		GriseChamp('annee');
		
		BlancChamp('projet');
	}
}

function griserChampsTemoin(champ)
{
	element = document.getElementById(champ).value;
		
		
	if(champ == 'theme') {
		if(document.getElementById('annee').selectedIndex != 0) reinitChamp('annee');
		if(document.getElementById('temoin').selectedIndex != 0) reinitChamp('temoin');
		GriseChamp('annee');
		GriseChamp('temoin');
		
		BlancChamp('theme');
	} else if(champ == 'annee') {
		if(document.getElementById('theme').selectedIndex != 0) reinitChamp('theme');
		if(document.getElementById('temoin').selectedIndex != 0) reinitChamp('temoin');
		GriseChamp('theme');
		GriseChamp('temoin');
		
		BlancChamp('annee');
	} else if(champ == 'temoin') {
		if(document.getElementById('annee').selectedIndex != 0) reinitChamp('annee');
		if(document.getElementById('theme').selectedIndex != 0) reinitChamp('theme');
		GriseChamp('annee');
		GriseChamp('theme');
		
		BlancChamp('temoin');
	}
}

function reinitChamp(champ)
{
	champ = new String(champ);
	document.getElementById(champ).selectedIndex = 0;
}

function GriseChamp(champ)
{
	champ = new String(champ);
	document.getElementById(champ).style.background = '#cccccc';
}

function BlancChamp(champ)
{
	champ = new String(champ);
	document.getElementById(champ).style.background = '#FFFFFF';
}


/* LITE WINDOWS */
function afficher_push_droit(modele,id_article,id_secteur)
{
	emplacement = document.getElementById('pour_push').style;
	largeur = document.documentElement.clientWidth;
	if(largeur == '')	largeur = window.innerWidth;
	if(largeur == '')	largeur = document.width;
	
	hauteur = document.documentElement.clientHeight;
	if(hauteur == 0)	hauteur = window.innerHeight-2;
	if(navigator.appName == "Opera")	hauteur = window.innerHeight-2;

	var scrollX, scrollY;

	if (document.all)
	{
		if (!document.documentElement.scrollLeft)
			scrollX = document.body.scrollLeft;
		else
			scrollX = document.documentElement.scrollLeft;
		
		if (!document.documentElement.scrollTop)
			scrollY = document.body.scrollTop;
		else
			scrollY = document.documentElement.scrollTop;
	}
	else
	{
		scrollX = window.pageXOffset;
		scrollY = window.pageYOffset;
	} 

	emplacement.display = 'block';
	//emplacement.left=(largeur-950)/2+'px';
	emplacement.width = largeur + 'px';
	//emplacement.top=scrollY+"px";
	emplacement.marginTop = scrollY + "px";
	var so = new SWFObject("./squelettes/IMG/anim_fenetre_push.swf?id_article=" + id_article + "&id_secteur=" + id_secteur, "pour_push_div", largeur, hauteur, "8", "");
	so.addParam("wmode","transparent");
	so.addParam("scale","noscale");
	//so.addParam("FlashVars","id_article="+id_article);
	so.addParam("FlashVars","id_secteur=" + id_secteur);
	so.write("pour_push");
	
	if (isNavigatorOk()) {
		bodyMovinInit();
	}
}

function effacer_push(){
	clearTimeout(bodyMovin());
	document.getElementById('pour_push').innerHTML='';
	emplacement=document.getElementById('pour_push').style;
	emplacement.display='none';
	emplacement.left=0+'px';
	emplacement.width=0+'px';
	emplacement.top=0+"px";
	
}

agent = navigator.userAgent.toLowerCase();
app = navigator.appName.toLowerCase();

function isNavigatorOk() {
	if (agent.indexOf("msie 5") != -1 && agent.indexOf("mac_powerpc") != -1) return false;
	if (agent.indexOf("firefox") != -1) return true;
	if (agent.indexOf("safari") != -1) return true;
	if (agent.indexOf("msie") != -1) return true;
	if (agent.indexOf("mozilla/5.0") != -1) return true;
	return false;
}

function bodyMovinInit() {
	BM_Y_DIFF = 220;
	BM_Y_TMP_DIFF = 220;
	BM_Y_LIMIT = 0; // valeur à changer (voir aussi calque)
	BM_SPEED = 20;
	BM_DECALAGE = 0; // valeur négative pour les positionnements bas dans la page)*/
	BM_LAYER = "pour_push";
	BM_OBJ = document.getElementById(BM_LAYER);
	if (BM_OBJ != null) {
		bodyMovin();
	}
}

function bodyMovin() {
	BM_Y_DIFF = 220;
	BM_Y_TMP_DIFF = 220;
	BM_Y_LIMIT = 0; // valeur à changer (voir aussi calque)
	BM_SPEED = 20;
	BM_DECALAGE = 0; // valeur négative pour les positionnements bas dans la page)*/
	BM_LAYER = "pour_push";
	BM_OBJ = document.getElementById(BM_LAYER);
	if (window.XMLHttpRequest) {
		if(document.all){
			//IE7
			BM_Y_DIFF = document.documentElement.scrollTop + BM_DECALAGE;
		} else {
			//mozilla, safari, opera 9…etc
			BM_Y_DIFF = window.pageYOffset + BM_DECALAGE;
		}
	} else {
		// IE6, anciens navigateurs
		BM_Y_DIFF = document.documentElement.scrollTop + BM_DECALAGE;
		
	}
	

	if (BM_Y_DIFF < BM_Y_LIMIT) {
		BM_Y_DIFF = BM_Y_LIMIT;
	} else {
		BM_Y_DIFF += BM_SPEED;
	}

	if (BM_Y_DIFF != BM_Y_TMP_DIFF) {
		BM_Y_DIFF = (1 * (BM_Y_DIFF - BM_Y_TMP_DIFF)) + BM_Y_TMP_DIFF;
		
		BM_OBJ.style.marginTop = (BM_Y_DIFF-20) + "px";
	}

	BM_Y_TMP_DIFF = BM_Y_DIFF;
	setTimeout('bodyMovin()', 1);
}