var galleriePhoto = {
	activites : {
		init : function($version){
			$.ajax({
				type: "GET",
				url: "./xml/activites"+$version+"/activite.xml?"+new Date().getTime(),
				dataType: "xml",
				success: function(xml){
					$(xml).find('activites').each(
						function(){
							$(this).find('activite').each(
								function(i){
									if(i >= 1){
										$(this).find('blocCentre').each(
											function(){												
												var $url_grande_image = $(this).find('sourceImg').text();
												var $titre_grande_image = '';	
												var $description = $(this).find('detail').text();											
												var $chaine = '<span id="load_detail_'+i+'" style="display:none;">';		      	
												$chaine += '<span class="imgBig"><img src="'+$url_grande_image+'" width="532" id="produitGm" alt="'+$titre_grande_image+'" titre="'+$titre_grande_image+'"/></span>';
												$chaine += '<span id="descArtiste">'+$description+'</span>';
												$chaine += '</span>';
												$("#load_detail").append($chaine);	
											}
										);
										$(this).find('blocGauche').each(
											function(){
												var $photo_gauche = '<img src="'+$(this).find('sourceImg').text()+'" height="120" width="180" alt=""/>';
												var $titre = $(this).find('titre').text();
												var $societe = $(this).find('societe').text();
												var $date = 'Le '+$(this).find('dateActivite').text();
												var $texte_gauche = $(this).find('texteGauche').text();
												var $gauche = '<span id="load_detail_gauche_'+i+'" style="display:none;">';
												$gauche += '<p>'+$photo_gauche+'</p>';
												$gauche += '<p style="font-weight:bold!important;">'+$titre+'</p>';
												$gauche += '<p style="font-weight:bold!important;">'+$societe+'</p>';
												$gauche += '<p>'+$date+'</p>';									
												$gauche += '<p class="inRight" style="font-weight:bold!important;font-style:italic;font-size:12px;">&laquo; '+$texte_gauche+' &raquo;</p>';
												$gauche += '</span>';
												$("#load_detail_gauche").append($gauche);	
											}
										);																														
									}
								}
							);
						}
					);
				}								
			});
		},
		changeImage : function(inc){
			$("span[id*='load_detail_']").each(
				function(i){
					if(i == inc){
						$("#load_detail_"+i).show();
						$("#load_detail_gauche_"+i).show();
						$("#imgList_"+i).css({'background-color':'#555555'});
					}
					else{
						$("#load_detail_"+i).hide();
						$("#load_detail_gauche_"+i).hide();
						$("#imgList_"+i).css({'background-color':'#CCCCCC'});
					}
				}
			);
		}
	}
};
