// unobtrusive javascript

$(document).ready(function(){	/**
	 * Afficher le bouton Imprimer
	 */
	$("#imprimer").show();

	/**
	 * Gère le clic sur le bouton "ajouter aux favoris"
	 */
	$("a.jQueryBookmark").click(function(e){
		e.preventDefault();
		var bookmarkUrl = this.href;
		var bookmarkTitle = this.title;
		if(bookmarkTitle){
			bookmarkTitle = bookmarkTitle.replace("Mettre cette page en favoris : ","");
		}

		if (window.sidebar) { // Pour Firefox
			window.sidebar.addPanel(bookmarkTitle, bookmarkUrl,"");
		} else if( window.external || document.all) { // Pour IE
			window.external.AddFavorite( bookmarkUrl, bookmarkTitle);
		} else if(window.opera) { // Pour Opera
			$("a.jQueryBookmark").attr("href",bookmarkUrl);
			$("a.jQueryBookmark").attr("title",bookmarkTitle);
			$("a.jQueryBookmark").attr("rel","sidebar");
		} else { // Pour les autres...
			 alert('Votre navigateur ne supporte pas cette commande. Utilisez l\'interface de votre navigateur pour mettre page dans vos favoris.');
			 return false;
		}
	});

	$('map area').each(function() {
		$(this).hover(function() {
			id=$(this).attr('id').split('zone')[1];
			$('#puce'+id).attr('class','on');
			$('#puce'+id).children('a').attr('class','on');
		}, function() {
			id=$(this).attr('id').split('zone')[1];
			$('#puce'+id).attr('class','');
			$('#puce'+id).children('a').attr('class','');
		});
	});
	$('#carte ul li').each(function() {
		$(this).hover(function() {
			$(this).children('a').attr('class','on');
			$(this).attr('class','on');
		}, function() {
			$(this).children('a').attr('class','');
			$(this).attr('class','');
		});
	});


}); // end dom ready
