	//Jquery Plugin
	(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);

$(document).ready(function() {

	$("#clientDevelopersContent").show();
		$("#clientsDevelopers").addClass("activeClientLink");
		$(".imgCont").hover(function(e) {
		$(this).children("img").fadeTo('fast','0.3');
		$(this).children(".clientTestimonial").show();
	},function(e) { 
		$(this).children("div").hide();
		$(this).children("img").fadeTo('fast','1');
		
	
	});
	$(".imgCont").mousemove(function(e) {
		var position = $(this).position();
		var height = $(this).height();
		var width = $(this).width();
		$(this).children("div").css({
			left: position.left+(width / 2)+"px",
			top: position.top+(height / 2)+"px"
			});
	});
	
	
		$("#clientsDevelopers").click(function(e) {
		$(".clientCats").hide();
		$(".activeClientLink").removeClass("activeClientLink");
		$("#clientsDevelopers").addClass("activeClientLink");
		$("#clientDevelopersContent").show('slow');
	});
	
		$("#clientsPMS").click(function(e) {
		$(".clientCats").hide();
		$(".activeClientLink").removeClass("activeClientLink");
		$("#clientsPMS").addClass("activeClientLink");
		$("#clientPMSContent").show('slow');
	});
	
		$("#clientsIndustries").click(function(e) {
		$(".clientCats").hide();
		$(".activeClientLink").removeClass("activeClientLink");
		$("#clientsIndustries").addClass("activeClientLink");
		$("#clientIndustriesContent").show('slow');
	});
	
		$("#clientsMainCs").click(function(e) {
		$(".clientCats").hide();
		$(".activeClientLink").removeClass("activeClientLink");
		$("#clientsMainCs").addClass("activeClientLink");
		$("#clientMainCsContent").show('slow');
	});
	
		$("#clientsConsultants").click(function(e) {
		$(".clientCats").hide();
		$(".activeClientLink").removeClass("activeClientLink");
		$("#clientsConsultants").addClass("activeClientLink");
		$("#clientConsultantsContent").show('slow');
	});
	
		$("#clientsLocal").click(function(e) {
		$(".clientCats").hide();
		$(".activeClientLink").removeClass("activeClientLink");
		$("#clientsLocal").addClass("activeClientLink");
		$("#clientLocalContent").show('slow');
	});
	
	
	
	
	
	ToActive();		
	
	$("#STcontainer").hover(function(){},function(){
	ToActive();	
	});
	
	
	
	var hoverConfig = {
		over: HoverIn,
		timeout: 0,
		out: HoverOut,
		interval:25
	};
		
	$(".STelement").hoverIntent(hoverConfig);
	
	function HoverIn(e){						
	
	if (!$(this).hasClass("active")){
		FromActive();
	}

	$(this).children(".STcontent").animate({height: "55"},'fast',function(){
				$(this).children(".STcontent span").fadeIn('slow');				
			});			
	}
			
	function HoverOut(e){
			if (!$(this).hasClass("active"))
			{			
			$(this).children(".STcontent").children("span").fadeOut('slow');
			$(this).children(".STcontent").animate({height: "0"},'slow');			
			}
			
			
	}
	
	function FromActive() {
	
		$(".active").children(".STcontent").children("span").fadeOut('slow');
		$(".active").children(".STcontent").animate({height: "0"},'slow');
	}
		
	function ToActive() {		
		$(".active").children(".STcontent").animate({height: "55"},'slow',function(){
			$(".active").children(".STcontent").children("span").fadeIn('slow');
		});		
	}
	
	
	 });
