jQuery.fn.cleanPanels = function(){
	$('body > div[id!=wrapper-outer]').each(function(){
		$(this).remove();
	});
	$('body').prepend('<div id="box"></div>');
	return $(this);
}
$(function(){
//	<script src="tpl/js/facelift/flir.js" type="text/javascript"></script>
	// FLIR.init({ path: 'tpl/js/facelift/' });
	// FLIR.replace( [
		// '#menu ul li a',
		// '.moreInfo strong',
		// '#editoInfo h4',
		// '#main h2',
		// '#main h4',
		// '#main .contact .name',
		// '#main form legend',
		// '#main form label',
		// '#main form p',
		// '#main form button',
		// '#box h3',
		// '#lang a'
		// ] , new FLIRStyle({ cFont:'usherwood' , mode:'wrap' }) );

	$('#map > area').each(function(){
		$(this).click(function(event){
			event.preventDefault();
			var area = $(this);
			$('body > #box:first').load(area.attr('href')+' #box', function(){
				var panel = $(this);
				$(this).dialog({
					closeOnEscape: true,
					draggable: true,
					resizable: false,
					width: 'auto'
				});
				$('.close', $(this)).click(function(event){
					event.preventDefault();
					panel.dialog('destroy');
				});
			});
		})
	})
	$('#chateaux > a').each(function(){
		$(this).click(function(event){
			event.preventDefault();
			var link = $(this);
			$('body > #box:first').load(link.attr('href')+' #box', function(){
				var panel = $(this);
				$(this).dialog({
					closeOnEscape: true,
					draggable: true,
					resizable: false,
					width: 'auto'
				});
				$('.close', $(this)).click(function(event){
					event.preventDefault();
					panel.dialog('destroy');
				});				
			});
		})
	})
	$('#cave2 a:first').click(function(event){
			event.preventDefault();
			var link = $(this);
			$('body > #box').load(link.attr('href')+' #box', function(){
				var panel = $(this);
				$(this).dialog({
					closeOnEscape: true,
					draggable: true,
					resizable: false,
					width: 'auto'
				});
				$('.close', $(this)).click(function(event){
					event.preventDefault();
					panel.dialog('destroy');
				});				
			});
	})
})