	i =2;
	maxi=7;
    function fadeElement(){

		if(i <= maxi & i >= 1){
			idElementShow='fade' + (i);
			idElementHide='fade' + (i-1);
			i++;
		}else if(i == 1){
			idElementShow='fade' + (i+1);
			idElementHide='fade' + (i);
			i++;
		}else{
			i=1;
			idElementHide='fade' + (maxi);
			idElementShow='fade' + (i);
			i++;
	}
		$(idElementHide).fade({ duration: 2.0 });
		$(idElementShow).appear({ duration: 2.0 });
		setTimeout("fadeElement()",10000);

		//Effect.Appear('id_of_element');Effect.Appear('id_of_element', { duration: 3.0 });

	 }
function afficheIds(baliseId)
  {
  if (document.getElementById && document.getElementById(baliseId) != null){
    document.getElementById(baliseId).style.display='block';
    }
  }

function cacheIds(baliseId)
  {
  if (document.getElementById && document.getElementById(baliseId) != null){
    document.getElementById(baliseId).style.display='none';
    }
  }

function afficheIds1(baliseId,parentid)  {
  if (document.getElementById && document.getElementById(baliseId) != null){
	 if (document.getElementById(parentid).checked == true){
		 document.getElementById(baliseId).style.display='block';}
	 else if (document.getElementById(parentid).checked == false){
		 document.getElementById(baliseId).style.display='none';
	 }
    }
  }

function countElementsByClass(){
var count = 0;
var o = document.getElementById("menu-left").getElementsByTagName("li");
for(var i=0; i<o.length; i++){
    if(o[i].className == "menu")
        count ++;
}
return count;
}

function shows(num) {
	long = countElementsByClass();
	for(i = 1 ; i <= long ; i++) {
		document.getElementById('souslist' + (i) ).style.display='none';
	}
	document.getElementById('souslist' + num).style.display='block';
  }

function change_visibility(element_id, action){
  if (element_id != '' && action == 'show'){
    document.getElementById(element_id).style.visibility = 'visible';
                                           }
    else if(element_id != '' && action == 'hide'){
        document.getElementById(element_id).style.visibility = 'hidden';
                                                 }
                                               }

  function hideDiv() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('hideshow').style.visibility = 'hidden';
}
else {
if (document.layers) { // Netscape 4
document.hideshow.visibility = 'hidden';
}
else { // IE 4
document.all.hideshow.style.visibility = 'hidden';
}
}
}

function showDiv() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('hideshow').style.visibility = 'visible';
}
else {
if (document.layers) { // Netscape 4
document.hideshow.visibility = 'visible';
}
else { // IE 4
document.all.hideshow.style.visibility = 'visible';
}
}
}

var fileFieldCount = 1;
function addFileField() {
    if (fileFieldCount >= 10) return false
    fileFieldCount++;
    var f = document.createElement("input");
    f.type = "file";
    f.name = "picture_file[]";
    f.size = 20;
    p = document.getElementById("attachments_fields");
    p.appendChild(document.createElement("br"));
    p.appendChild(f);

}
function affiche(num){
	elemnt = document.getElementById('policy').getElementsByClassName('block');
	lengths = elemnt.length;
	for(i = 1 ; i <= lengths ; i++) {
		//elemnt[i-1].setAttribute('class','menus');
		document.getElementById('block' + (i) ).style.display='none';
	}
	document.getElementById('block' + num).style.display='block';
  }
  function toggleOpenClosedById(id) {
    var elem = document.getElementById(id);
    if (elem) {
        // See if the element has a class of 'closed'
        if ((' ' + elem.className + ' ').indexOf(' closed ') != -1) {
            // Replace the 'closed' part of the class with 'open'
            elem.className = elem.className.replace('closed', 'open');
        } else {
            // Replace the 'open' part of the class with 'closed'
            elem.className = elem.className.replace('open', 'closed');
        }
    }
}


