$(document).ready(function() {
	$('.close').each(function()
	{
		$(this).click(function() {
			$(this).parent().fadeOut(600);
		});
	});
	
	// Elimine les bordures autour des checkbox
	$(':input').each(function()
	{
		if ($(this).attr("type")=="checkbox") {
			$(this).css("border","none");
		}
	});
	$('.tooltip').each(function()
	{
		$(this).cluetip({
			arrows: true,
			splitTitle: '|',
			positionBy:'bottom',
			fx: {
				open:'fadeIn'
			},
			hoverIntent: {
				sensitivity:  1,
				interval:     200,
				timeout:      200    
			  }
		});
	});
	$('.tooltipimg').each(function()
	{
		$(this).cluetip({
			arrows: true,
			width:'500px',
			height:'350px',
			splitTitle: '|',
			positionBy:'bottom',
			fx: {
				open:'fadeIn'
			},
			hoverIntent: {
				sensitivity:  1,
				interval:     0,
				timeout:      0    
			  }
		});
	});
	$("#repli_recherche_article").click( function () {
		$("#repli_article").slideToggle("fast");
	});
	$("#repli_recherche_fiche").click( function () {
		$("#repli_fiche").slideToggle("fast");
	});		
	$("#repli_recherche_ann_fiche").click( function () {
		$("#repli_ann_fiche").slideToggle("fast");
	});	
	$("#bouton_contact_annonce").click( function() {
		$("#bloc_contact_annonce").slideDown('slow',function () {
			$('html, body').animate({
				scrollTop: $("#tableauform").offset().top
			}, 1500,function() {
				$("#nom").focus();
			});
		});
		
		
	});
	$("#bouton_annule_contact_annonce").click( function() {
		$("#bloc_contact_annonce").slideUp('slow');
		$('html, body').animate({
			scrollTop: $("body").offset().top
		}, 1500);		
	});
	$('.spotlight').click(function(){
		$(this).spotlight({
			opacity: .5,
			exitEvent: 'click'
		});
	});	
});
