$(function(){
		//=== Home Slider
		$.featureList(
			$("#nav li a"),
			$("#output li"), {
				start_item	:	0
			}
		);
		
		//=== Slider partenaires
		$("#sliderPartenaires ul").Horinaja({
			capture:'sliderPartenaires',
			delai:0.5,
			duree:3,
			pagination:false
		});
		
		//=== Tableau Zebra
		$("section#right table tbody tr:odd").addClass('odd');
		
		//=== Accordéon resources views
		$("#id32 section#right ul.toggle").hide();
		$("#id32 section#right p.action").click(function(){
			if($(this).next("ul.toggle").is(":visible")) {
				$(this).next("ul.toggle").slideUp();
				$(this).removeClass("active");
			}
			else {
				$("section#right p.active").removeClass("active");
				$("ul.toggle").slideUp();
				$(this).next("ul.toggle").slideDown();
				$(this).addClass("active");
				
			}
		});
		
		//=== Home image effect
		$("div.imgHomeEffect").hover(function(){
			$(this).children('a').children('span').animate({'bottom':2+'px'});
			$(this).children('a').children('span').fadeTo("fast",0.9);
		}, function (){
			$(this).children('a').children('span').animate({'bottom':-13+'px'});	
			$(this).children('a').children('span').fadeTo("fast",0.4);			
		});
		
		//== Recherche annonce : Switch select surface
		$("#bType").change(function(){
			var newList = '';
			if($(this).val() == 'Bureau' ) {	newList = Blist;}
			if($(this).val() == 'Local' ) {	newList = Llist;}
			if($(this).val() == 'Terrain' ) {	newList = Tlist;}
			if($(this).val() == 'ZA' || $(this).val() == 0 ) {	newList = '<option value="0">Tous</option>';}
			
			$("#bSurface").html(newList);
		});
		
		//== annonces
		$('a.amore').click(function(){
			if($(this).prev('p.pmore').is(':visible')) {
				$(this).prev('p.pmore').slideUp();
			}
			else {
				$('p.pmore').slideUp();
				$(this).prev('p.pmore').slideDown();
			}
			
			return false;
		});
		
		//=== Selection bien 
		 $("label.addSelect input").click(function(){
		 	var extURL = '';
			$("label.addSelect input:checked").each(function(){
				if(extURL!='') {extURL += ',';}
				extURL += $(this).val();
			});
			$('a.moreBie').attr('href',myFURL+'&ida='+extURL);
		 });
		
		//=== Fancybox
		$("a.fancy").fancybox();
		$("a.fancyright").fancybox();
		$("a.fancyleft").fancybox();
		$("a.fancy img").parent().append('<img src="assets/templates/sinfin/images/ico-zoom.png" class="zoomIco" alt="Zoom"/>');
		$("a.fancyright img").parent().append('<img src="assets/templates/sinfin/images/ico-zoom.png" class="zoomIco" alt="Zoom"/>');
		$("a.fancyleft img").parent().append('<img src="assets/templates/sinfin/images/ico-zoom.png" class="zoomIco" alt="Zoom"/>');
		$("a.ifancy").fancybox({'type':'iframe'});
		//=== Validate Form
		$("form#cfForm").validate();
		$("form#projetcForm").validate();
		$("form#moreInfosForm").validate();
		$("form#alerteForm").validate();
		
		
		//=== First Child content
		 $("#content #right h4:first").addClass("firstH4");
		 $("#content #right h4:first").addClass("nofloat");


		/*** Header Contactez-nous Bloc ***/
		$('#blocContact').fadeIn('slow');

});

window.onload= function(){
		//=== Hard Remove
		$('#removeme').remove();
}

