
$(document).ready(function()
{
   
   	// Using default configuration
		
	// Using custom configuration
	$("#foo1").carouFredSel({
		height : 150,
		item   :
		{
		visible:5,
		},
		direction			: "left",
		scroll : {
		items			: 1,
			
			duration		: 2000,	
			pauseDuration   : 3000,						
			pauseOnHover	: true
		}	
						
	});	
	

			
				$("a[rel=example_group]").fancybox({
				'width'				: '150',
				'height'			: '75',
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over"><b>Photo ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? '</b> &nbsp; ' + title : '') + '</span>';
				}
			});
	



//Default Action
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
		
		
		
		
	});



$('#diaryview').click(function()
{
var now = new Date();


afficher_calendrier($('#etbvalue').val(),'8',now.getFullYear());

}


);




//////////////////////////////////// UPDATE INFORMATIONS PERSONNELLES //////////////////////////////////////////////////////

$('#contacter_proprio').click(function() 
{


$.ajax(
{
type: "POST",
url: "/ajax/envoi_mail.php",
data: "&to="+$('#to').val()+"&nom="+$('#nom').val()+"&email="+$('#email').val()+"&tel="+$('#tel').val()+"&message="+$('#message').val()+"&etb="+$('#etb').val()+"&copie="+$('#check_copie').val()+"&newsletter="+$('#check_newsletter').val(),
success: function() {

$('#contact_proprio').html('<div style="width:620px; height:200px;text-align:center; padding-top:70px;">Votre message a bien été envoyé au propriétaire :-)</div>')


 }
});

});

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


//////////////////////////////////// UPDATE INFORMATIONS PERSONNELLES //////////////////////////////////////////////////////

$('#contacter_support').click(function() 
{


$.ajax(
{
type: "POST",
url: "/ajax/envoi_mail_support.php",
data: "&to="+$('#to').val()+"&nom="+$('#nom').val()+"&email="+$('#email').val()+"&tel="+$('#tel').val()+"&message="+$('#message').val()+"&etb="+$('#etb').val()+"&copie="+$('#check_copie').val()+"&newsletter="+$('#check_newsletter').val(),
success: function() {

$('#contact_proprio').html('<div style="width:620px; height:200px;text-align:left; padding-top:70px;font-size:14px;">Votre message a bien été envoyé.<br><br>Nous allons vous répondre très rapidement.<br><br>iGites.fr</div>')


 }
});

});

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////






});


function afficher_calendrier(id_etablissement, mois_afficher, annee_afficher)
{
//	writediv('bloc_calendrier', '<br /><br /><br /><p class="align_centre"><img src="/i/ajax-loader.gif" alt="" title="" /></p><p class="align_centre">Veuillez patientez...</p>')
//	texte=file('calendrier.php?id_etablissement='+id_etablissement+'&mois_afficher='+mois_afficher+'&mois_afficher='+annee_afficher);
//	writediv('bloc_calendrier', texte)
	
	
	$.ajax({
type: "GET", 
url: "/modif/calendrier.php", 
data: 
{
id_etablissement:id_etablissement,
mois_afficher:mois_afficher,
annee_afficher:annee_afficher
}, 

success: function(reponse)  
{  
$('#bloc_calendrier').html(reponse);


}
});

}



