

function showDiv(aId) {
	el = $(aId);
	if(el != null) 
    el.style.display = 'block';
}
	
function hideDiv(aId) {
	el = $(aId);
	if(el != null)
    el.style.display = 'none';
}

function showSubMenu(aId, aSubMenu) {
	hideSubMenu();
	showDiv(aId);
	if(aSubMenu){
	   $(aSubMenu).style.color = "#ae0000";
  }
}


function hideSubMenu(){
	hideDiv('peintures');
	hideDiv('illustrations');
}

/* Methode permettant de faire appel au contenu d'une page à travers un appel ajax et de mettre à jour le 
block désiré, elle initialise également l'objet shadowbox. */
function callGallery(url){
   
   new Fx.Style('gallery', 'opacity',{duration:50, wait:true}).start(1,0); 
    
	  var tempus = $('gallery').empty().addClass('ajax-loading');
  
    new Ajax(
  		url, {
  		asynchronous: true,
  		method: "get",
  		onSuccess: function(request) {
  		    $('gallery').setHTML(request);
  	      setUpShadowBox();
  		},
  	  onFailure: function(request) {
  	    alert("La demande n'a pas pu aboutir.");
  	  }
  	
  	}).request();
  	
  	 tempus.removeClass('ajax-loading');
  	 
  	 new Fx.Style('gallery', 'opacity',{duration:1000, wait:true}).start(0,1);
}

/* Cette méthode permet de d'initialiser Shadowbox*/
function setUpShadowBox(){
  
    Shadowbox.init();
   
    var links = $('gallery').getElementsByTagName('a');
    
    Shadowbox.setup(links
    ,{
        gallery:        'tableaux',
        displayCounter: false,
        continuous:     true,
        counterType:    'skip',
        animSequence:   'sync'
    });

};



