/* SCROLL */
$(document).ready(function(){
	$(".boutonScroll").click(function(event){
		event.preventDefault();
		var full_url = $(this).attr("href");
		var parts = full_url.split("#");
		var trgt = parts[1];
		var target_offset = $("#"+trgt).offset().top;
		$('html, body').animate({scrollTop:target_offset}, 1000);
	});
});
/* POP */
function pop(URLfen,W,H,L,T) {
		var w=window.open(URLfen,"","status=no,location=no,scrollbars=yes,toolbar=no,directories=no,resizable=yes,width="+W+",height="+H+",top="+T+",left="+L);
}

/* BLOC SERVICES */
function servicesBloc(divid) {
	$t = $('.'+divid);
	$t.find('li').first().addClass('liActif');
	$ul = $t.find('ul');
	$count = $t.find('li').length;
	$ul.width($count * $t.find('li').first().outerWidth(true) + 1);
	$gauche =$t.find('.gauche');
	$droite =  $t.find('.droite');
	$gauche.css('cursor','pointer');
	$droite.css('cursor','pointer');
	$gauche.click(function() {
		var $actif = $t.find('.liActif');
		var $next = $actif.prev();
		if($next.length == 0) {
			$next = $ul.find('li').last();
			var $width = $next.outerWidth(true);
			var $calcul = $ul.width()-$width;
			$ul.animate({marginLeft:-$calcul+'px'},250);
		} else {
			var $ml = parseInt($ul.css('margin-left'));
			var $width = $actif.outerWidth(true);
			console.log("ml"+$ml+$width);
			$ul.animate({marginLeft:($ml+$width)+'px'},250);
		}
		$actif.removeClass('liActif');
		$next.addClass('liActif');
	});
	$droite.click(function() {
		var $actif = $t.find('.liActif');
		var $next = $actif.next();
		if($next.length == 0) {
			$next = $ul.find('li').first();
			$ul.animate({marginLeft:'0px'},250);
		} else {
			var $ml = parseInt($ul.css('margin-left'));
			var $width = $actif.outerWidth(true);
			$ul.animate({marginLeft:($ml-$width)+'px'},250);
		}
		$actif.removeClass('liActif');
		$next.addClass('liActif');
	});
};
/* FAVO */
function favoris() {if ( navigator.appName != 'Microsoft Internet Explorer' ) {window.sidebar.addPanel("www.chevalier-sauvetre.com","http://www.chevalier-sauvetre.com",""); } else { window.external.AddFavorite("http://www.chevalier-sauvetre.com","www.chevalier-sauvetre.com"); } }<!-- ID3x v4.60 (422) - X2 - 00.009.528 - none - 23/02/2012 00:43:45 - scripts\functions.js -->
