// JavaScript Document

$(document).ready(function(){
 //scrollTo $('#content').localScroll();
	//tools
    	$("div.scrollable").scrollable({size: 1}).autoscroll(5000); //home top portfolio
    	

	
	//tooltips
	$(".quote :input").tooltip({position: "bottom center", offset: [1, 0], effect: "fade", tip: '.tooltip' });
	
	//accordion
	//$(".people h5:first").addClass("active");
	$(".people p").hide();
	$(".people p:first-child").show()
	$(".people h5:first").addClass("active");
	$(".people h5").click(function(){
	  $(this).prev("p").slideToggle("slow")
	  .siblings("p:visible").slideUp("slow");
	  $(this).toggleClass("active");
	  $(this).siblings("h5").removeClass("active");
	});
	
	//show hide people
	$("#nicolas, #deb, #tania, #vanessa, #karuru, #tim, #khoi, #renaud, #ashley").hide();
	
	$("h5.ashul").click(function(){
	  $("#ashul").fadeIn("slow");
	  $("#nicolas, #deb, #tania, #vanessa, #karuru, #tim, #khoi, #renaud, #ashley").hide();
	});
	$("h5.nicolas").click(function(){
	  $("#nicolas").fadeIn("slow");
	  $("#ashul, #deb, #tania, #vanessa, #karuru, #tim, #khoi, #renaud, #ashley").hide();
	});
	$("h5.deb").click(function(){
	  $("#deb").fadeIn("slow");
	  $("#ashul, #nicolas, #tania, #vanessa, #karuru, #tim, #khoi, #renaud, #ashley").hide();
	});
	$("h5.tania").click(function(){
	  $("#tania").fadeIn("slow");
	  $("#ashul, #nicolas, #deb, #vanessa, #karuru, #tim, #khoi, #renaud, #ashley").hide();
	});
	$("h5.vanessa").click(function(){
	  $("#vanessa").fadeIn("slow");
	  $("#ashul, #nicolas, #deb, #tania, #karuru, #tim, #khoi, #renaud, #ashley").hide();
	});
	$("h5.karuru").click(function(){
	  $("#karuru").fadeIn("slow");
	  $("#ashul, #nicolas, #deb, #tania, #vanessa, #tim, #khoi, #renaud, #ashley").hide();
	});
	$("h5.tim").click(function(){
	  $("#tim").fadeIn("slow");
	  $("#ashul, #nicolas, #deb, #tania, #vanessa, #karuru, #khoi, #renaud, #ashley").hide();
	});
	$("h5.khoi").click(function(){
	  $("#khoi").fadeIn("slow");
	  $("#ashul, #nicolas, #deb, #tania, #vanessa, #karuru, #tim, #renaud, #ashley").hide();
	});
	$("h5.renaud").click(function(){
	  $("#renaud").fadeIn("slow");
	  $("#ashul, #nicolas, #deb, #tania, #vanessa, #karuru, #tim, #khoi, #ashley").hide();
	});
	$("h5.ashley").click(function(){
	  $("#ashley").fadeIn("slow");
	  $("#ashul, #nicolas, #deb, #tania, #vanessa, #karuru, #tim, #khoi, #renaud").hide();
	});
	
	//SEO show/hide
	//$('.seo_container').hide(); // Hide container by default
  	/*$('.seo_trigger').click(function() {
		$('.seo_container').slideToggle("slow"); // toggle hide/show
	 	 return false;
   	});*/
//forms
	$("#footer label").hide();
	(function($){
		$.fn.edukaform = function(){
			return this.each(function(){
			   $(this).attr('value',$(this).prev().text());                            
		   
			   $(this).bind('focus',function(){
				$(this).addClass('active').attr('value',function ()
					{
						var e = $(this);
						if(e.attr('value') == e.prev().text()){
							e.attr('value','');
						}            
					});
				});
			   $(this).bind('blur',function(){
				$(this).removeClass('active').attr('value',function ()
					{
						var e = $(this);
						if(e.attr('value') == ''){						
								e.attr('value',e.prev().text());						
						}
						if($(this).next('.error')){
							if(e.attr('value') == $(this).prev().text()){
								e.next().css('display','inline');								
							}					
						}						
					});
				});
			});
			
		};
	})(jQuery);
	
	$("#footer .textbox, #footer .textarea, #footer .dropdownlist").edukaform();
});
