var currentPage = 0;
var default_value_mail = 'Entrez votre courriel';
$(function() {
	$("#mc_mv_EMAIL").val(default_value_mail);
	$("#mc_mv_EMAIL").focus(function(){
		if($(this).val()==default_value_mail)
			$("#mc_mv_EMAIL").val('');
	});
	$("#mc_mv_EMAIL").blur(function(){
		if($(this).val() == '' )
			$("#mc_mv_EMAIL").val(default_value_mail);
	});
	$("#staff-links img").hover(
		 function()
		 {
		  this.src = this.src.replace("over","petit");
		 },
		 function()
		 {
		  this.src = this.src.replace("petit","over");
		 }
	);
	$("ul.menu li:first-child").addClass("first_page_item");
	$("ul.menu li:last-child").addClass("last_page_item");
	$("#sidebar .section:last-child").addClass("last_section");
	$(".col").css("height","auto");		
	$('ul.sf-menu').superfish({ 
            pathClass:  'current_page_ancestor',
			speed: 0,
			delay: 500		
     });
		
	$(".mc_merge_var br").remove();
	$(".mc_merge_var label.mc_var_label").remove();
	$("#primary-menu li.current_page_ancestor>a, #primary-menu  .sf-breadcrumb>a.sf-with-ul").css("font-weight","bold").css("color", "#666");
	$(".portfolio-text>p").hide();
	
	var api = $("#browsable").scrollable(
		{
			onSeek: function(event){
				currentPage = this.getIndex();
				$(".portfolio-text>p").hide();
				var text= 	$(".portfolio-text>p").eq(currentPage);
				text.show();				
				var currentClientId = text.attr("clientid");
				var currentClientLinkId = ".page-item-"+currentClientId;
				$("#third-menu li").removeClass("current_page_item");
				$(currentClientLinkId).addClass("current_page_item");
			},
			api: true
		}
	);	
	if(api){
		api.seekTo(currentPage);
		$(".portfolio-text>p").eq(currentPage).show();	
	}	
	$('.col').equalHeights(450);
	
	
 });
  
(function($) {
	$.fn.equalHeights = function(minHeight, maxHeight) {
		tallest = (minHeight) ? minHeight : 0;
		this.each(function() {
			if($(this).height() > tallest) {
				tallest = $(this).height();
			}
		});
		if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
		return this.each(function() {
			$(this).height(tallest);//.css("overflow","auto");
		});
	}
})(jQuery);
  
