$(document).ready(function() {

Cufon.replace('.infosConseil .contentRight h2,.recrutement .contentRight h2', { fontFamily: "Edwardian Script ITC", hover: true });

$(".rightPane").find("a.btnAcheter").mouseover(function() {
		$(this).fadeTo("1000",1);
	}).mouseout(function() {
		$(this).fadeTo("1000",0.5);
	});
	
$(".rightPane").find("a.btnLouer").mouseover(function() {
		$(this).fadeTo("1000",1);
	}).mouseout(function() {
		$(this).fadeTo("1000",0.5);
	});

});

	
	
//menu déroulant//

function navNivOver() {
$("#navNiv1 .navNiv2").addClass('sfhover');
$("#navNiv2 .navNiv2").removeClass('sfhover');
$("#navNiv3 .navNiv2").removeClass('sfhover');
}
function navNivOver2() {
$("#navNiv2 .navNiv2").addClass('sfhover');
$("#navNiv1 .navNiv2").removeClass('sfhover');
$("#navNiv3 .navNiv2").removeClass('sfhover');
}
function navNivOver3() {
$("#navNiv3 .navNiv2").addClass('sfhover');
$("#navNiv2 .navNiv2").removeClass('sfhover');
$("#navNiv1 .navNiv2").removeClass('sfhover');
}

//scrolling progressig//

var scrolling = function(){
	var speed     = 2000;
	jQuery('a[href^="#"]').bind('click',function(){
		var id = jQuery(this).attr('href');
		if(id == '#')
			goTo('body');
		else
			goTo(id);
		return(false);
	 void(0);
	});
	function goTo(ancre){jQuery('html,body').animate({scrollTop:jQuery(ancre).offset().top},speed,'swing',function(){
		  if(ancre != 'body')
				window.location.hash = ancre;
		  else
			  window.location.hash = '#';
		  jQuery(ancre).attr('tabindex','-1');
		  jQuery(ancre).focus();
		  jQuery(ancre).removeAttr('tabindex');
	  });
	}
};

$(document).ready(
		function(){
			$('ul#portfolio').innerfade({
				speed: 1000,
				timeout: 5000,
				type: 'sequence',
				containerheight: '220px'
			});
			$('ul#portfolio2').innerfade({
				speed: 1000,
				timeout: 5000,
				type: 'sequence',
				containerheight: '220px'
			});
	});


	
	

function verifForm(formEstimation) {
if ((document.formEstimation.agence.value == "") || (document.formEstimation.nom.value == "") || (document.formEstimation.prenom.value == "") || (document.formEstimation.ville.value == "") || (document.formEstimation.surface.value == "") || (document.formEstimation.infosSup.value == ""))
	{alert('Veuillez remplir les champs marqués d\'une * ! Merci.');}
	else {	adresse = formEstimation.mail.value;
	var place = adresse.indexOf("@",1);
	var point = adresse.indexOf(".",place+1);
	if ((place > -1)&&(adresse.length >2)&&(point > 1))
		{
		formEstimation.submit();
		return(true);
		}
	else
		{
		alert('Entrez une adresse e-mail valide! Merci.');
		return(false);
		}
	}}

	

function agenceChtx() {
$("#agenceChtx").show();
$("#agenceBourges").hide();
$("#agenceArgenton").hide();
$("#chtx").addClass('active');
$("#bourges").removeClass('active');
$("#argenton").removeClass('active');
}

function agenceBourges() {
$("#agenceBourges").show();
$("#agenceChtx").hide();
$("#agenceArgenton").hide();
$("#bourges").addClass('active');
$("#chtx").removeClass('active');
$("#argenton").removeClass('active');
}

function agenceArgenton() {
$("#agenceArgenton").show();
$("#agenceChtx").hide();
$("#agenceBourges").hide();
$("#argenton").addClass('active');
$("#chtx").removeClass('active');
$("#bourges").removeClass('active');
}

	
	
