document.write("<style type='text/css'> img#photo {visibility:hidden;}</style>");

var critere = 1;

window.onload = function() {
    initImage();
    if(document.getElementById('selectionCritere')){
      initCritere();
      afficherCritere();
    }
}

function initImage() {
				 imageId = 'photo';
				 if(document.getElementById(imageId)){
  				 imageGd = document.getElementById(imageId);
  				 setOpacity(imageGd, 0);
  				 imageGd.style.visibility = 'visible';
  				 fadeIn(imageId,0);
  			 }
}

function setOpacity(obj, opacity) {
				 opacity = (opacity == 100)?99.999:opacity;

				 //IE/Win
				 obj.style.filter = "alpha(opacity:"+opacity+")";

				 //Safari<1.2, Konqueror
				 obj.styleKHMTLOpacity = opacity/100;

				 //Older Mozilla and Firefox
				 obj.style.MozOpacity = opacity/100;

				 //Safari 1.2, newer Firefox and Mozilla, CSS3
				 obj.style.opacity = opacity/100;
}

function fadeIn(objId,opacity) {
				 if (document.getElementById) {
				 		obj = document.getElementById(objId);
						if (opacity <= 100) {
							 setOpacity(obj, opacity);
							 opacity += 10;
							 window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
						}
				 }
}

function initCritere(){
      document.getElementById('selectionCritere').onclick = afficherCritere;
}

function afficherCritere(){
        if (critere==1 ){
          document.getElementById('formCritere').style.display ="none";
          critere=0;
        }
        else{
          if (critere==0 ){
            document.getElementById('formCritere').style.display ="block";
            critere=1;
          }
        }
}




function diapoCritere(objet){
    document.getElementById("critereType").value=objet.name;
    document.getElementById("critereValeur").value=objet.value;
}




//fonctions javascript
function openWin(url, largeur, hauteur ,param, nom) {
	if(document.all) {
			var x = (screen.width-largeur)/2;
			var y = (screen.height-hauteur)/2;
	}else {
		 var x=100; var y=100;
	}
	window.open(url,nom,param+(param!="" ? "," : "")+"width="+largeur+",height="+hauteur+",left="+x+",top="+y);
}






