var sortClass = '';

$(document).ready(function(){
	$("#project-slider-wrap").jCarouselLite({
		btnNext: "#next",
		btnPrev: "#back",
		circular: true,
		easing: "easeInOutQuad",
		speed: 900
	});


	// --- tooltip hoverings
	var leftoffsetX = 20;
	var leftoffsetY = 10;
	$('.hoverer').hover(function(e) {
		if($(this).children(".tooltip").html() != ''){ // --- only drop down if there is a tooltip
			$(this).children(".tooltip").slideDown('1000');
		}
		if($(this).children(".featuretooltip").html() != ''){ // --- only drop down if there is a tooltip
			$(this).children(".featuretooltip").slideDown('1000');
		}
		
	}, function() {
		$(this).children(".tooltip").slideUp('1000');
		$(this).children(".featuretooltip").slideUp('1000');
	});	






	// IE fixes
	if (jQuery.browser.msie){
		if(jQuery.browser.version < 7){
			// reset background for the first item in home page LIs
			$('#project-slider li').css('background-image',$('#project-slider li').eq(1).css('background-image'));
			
			// hide buttons because scroll doesn't work
			$('#next, #back').hide();
		}
	}

// panels expand/contract
	$("#panel, .panel").toggle(function(){
		if( this.id == "panel" ){ var height_is = "200px"; }
		else{ var height_is = "160px"; }
		$(this).animate({ height: height_is	}, 1000, "easeInQuint");
		$(this).find('h2 a').addClass('act');
		$(this).css('cursor','pointer');
	},function(){
		if( this.id == "panel" ){ var height_is = "36px"; }
		else{ var height_is = "26px"; }
		$(this).animate({ height: height_is }, 1000, "easeInQuint");
		$(this).find('h2 a').removeClass('act');
	});
	
	//Prevent the link for buttons
	$("a#next, a#back").attr({ onClick: "return false;" });
	
	
	

});//End document.ready
