var delay = (function(){
		var timer = 0;
		return function(callback, ms){
		clearTimeout (timer);
			timer = setTimeout(callback, ms);
		};
	})();

jQuery(document).ready(function() {

	if ($('#google_map').length)
	{
		$('#google_map').googleMaps({
			latitude: 45.871477759931366,
			longitude:0.9010612964630127,
			depth: 11,
			markers: {
				latitude: 45.871477759931366,
				longitude: 0.9010612964630127,
				draggable: true
			}
		});

		// hack du jquery qui est lui même un hack
		$('#mtgt_unnamed_0').live("click", function() { window.location.assign("http://maps.google.com/maps?q=Restaurant+Lauryvan,+87200+Saint-Junien,+France&hl=en&ll=45.878417,0.902681&spn=0.024917,0.074844&sll=37.0625,-95.677068&sspn=46.946584,76.640625&vpsrc=0&hq=Restaurant+Lauryvan,&hnear=Saint-Junien,+Haute-Vienne,+Limousin,+France&t=m&z=14"); });
	}

	if ( ($('#banniere img').length > 1) && ($('#caroussel-fleche-gauche').length == 0) )
	{
		$('#banniere').nivoSlider({
			effect: "fade",
			controlNav: false,
			manualAdvance: true,
			directionNavHide: false
		});
	}

	$('input[type="text"], textarea')
		.hover(
			function() {
				$(this).addClass("active");
			},
			function() {
				if ($(this).is(":focus") === false)
				{
					$(this).removeClass("active");
				}
			}
		)
		.focus(function() {
			if ($(this).hasClass("active") === false)
			{
				$(this).addClass("active");
			}
		})
		.blur(function() {
			$(this).removeClass("active");
		});
});
