function changeBackground() {
  if(document.getElementById('atelier').className == 'screen1') {
    document.getElementById('atelier').className = 'screen2';
 //   document.getElementById('campagnes').className ='button2';      
  } else {
    document.getElementById('atelier').className = 'screen1';
  //  document.getElementById('campagnes').className ='button1';      
  } 
}

var tableau = {
  
  init : function(el) {
    // end loop
    this.openContent(el);
    this.removeActive(el);
  },
  
  openContent : function(el) {
    items = $(el).getElementsByTagName("div");
    details = items[2].id; // detail DIV is the last item in each containers
	
  	// getter
  	currentHeight = parseInt($(details).getStyle('height'));
if(isNaN(currentHeight)) {
	currentHeight = 220;
}
   //setter
  	$(el).className = $(el).className + " actif";
	
  	var myResizes = new fx.Styles(el, {duration: 1000, transition: fx.sinoidal, onComplete: function (){ tableau.close(el) }});
    myResizes.custom({'height': [17, currentHeight + 50]});
	
  },
  
  removeActive : function(el) {
    list = $("tableau").getElementsByTagName("li");
    // reset list to their original value and remove class Actif to any item
    for(i = 0; i < list.length; i++) {
      // evaluate each array in this loop
      arrayName = "classes_" + i;
      var arrayName = new Array();

      // temporary store the list of class in a string
      // then split the list into array with Space delimiter
      if(list[i].id != $(el).id) {
        temp = $(list[i]).className;
        arrayName = temp.split(" ");      

        // apply original class on the item
        list[i].className = arrayName[0];
    	}
  	}
  },
  
  close : function(el) {
    list = $("tableau").getElementsByTagName("li");

    // reset list to their original value and remove class Actif to any item
    for(i = 0; i < list.length; i++) {
      if(list[i].id != $(el).id) {
        // getter
      	currentLoopItemHeight = parseInt(list[i].getStyle('height'));
      	        
        // setter
        var myResizes = new fx.Styles(list[i], {duration: 1000, transition: fx.sinoidal });                  
        if(currentLoopItemHeight > 17) {
			
          myResizes.custom({'height': [currentLoopItemHeight, 17]});      
        }
      }

    } // end loop
    
  }
  
};
// target _blank fix to keep pages xhtml valid
// ================================================
function getExternalLinks() {
  links = document.getElementsByTagName('a');

  for(i = 0; i < links.length; i++) {
    if(links[i].rel == "external") {
      e = links[i];
      e.setAttribute("target", "_blank");
    }    
  }
}

