$( function () {
	$(".B_agenda_advSearch").slideUp (0, function() { 
		$('.B_agendaContent_wrapper .contentScroll').jScrollPane({
			showArrows:true, 
			scrollbarWidth: 19, 
			arrowSize: 11, 
			scrollbarMargin: 0
		});
	});
	
	
	$(".B_agenda_search_Item .lien a").click ( function () {
		$(".B_agenda_advSearch").toggle();
		return false;
	});
	
	$(".B_agenda_advSearch .fermer a").click ( function () {
		$(".B_agenda_advSearch").hide();
		return false;
	});
	
	$('.zoom').lightBox({ 
		fixedNavigation:false,
		overlayOpacity:0.5,
		caption:'rel',
		imageLoading: 'images/design/lightbox-image-loader.gif',
		imageBtnClose: 'images/design/lightbox-btn-close.gif',
		navigation:false,
		imagePos:false,
		maxHeight: $(window).height(),
		maxWidth: $(window).width()
	});
	
	$("#B_agenda_search_form").find('input[@type=radio]').each ( function (index) {
		$(this).click ( function () {
			//alert (this.value + ' - ' + index);
			$('#B_agenda_advancedSearch_lieu').css('visibility', index == 0 ? 'visible':'hidden');
			loadType ( this.value, "#B_agenda_advancedSearch_type"  );
		});
		
	});
	
/*	$('#B_agenda_search_rv').click ( function () {
		$('#B_agenda_advancedSearch_lieu').css('visibility', 'hidden');
	});
	
	$('#B_agenda_search_evenement').click ( function () {
		$('#B_agenda_advancedSearch_lieu').css('visibility', 'visible');
	});*/
	
	loadType = function ( source, target ) {
		$source = eval (source);
		$(target).get(0).length = 1;
		for (i=0; i < $source.length; i++ ) {
			$(target).get(0).options[i] = new Option( $source[i][1], $source[i][0], false, false );
		}
	}
});
