//tab effects

$(document).ready(function() {
	var loc = 0;
//	TabbedContent.init();
	$(".slide_content").animate({top: ($(".slide_content").height()*-1)-40 + "px"}, 0);
	$(".moving_bg").animate({height: '0px', top: '60px'}, 0);
//	slide_content
	$(".slide_content").hover(
		function() {
			$(".slide_content").stop().animate({top: '0px'}, 300);
			$(".moving_bg").stop().animate({height: '60px', top: '0px', left: loc}, 300);
		},
		function() {
			$(".slide_content").stop().animate({top: ($(".slide_content").height()*-1)-40 + "px"}, 300);
			$(".moving_bg").stop().animate({height: '0px', top: '60px'}, 300);
		}
	);
	$(".tab_item").hover(
		function() {
			var background = $(this).parent().find(".moving_bg");
			$(this).css({color: '#000000'}, 0);
			//$(".moving_bg").text($(background).position()['left']);
			if($(background).position()['top'] >= '60'){
				var margin = $(".slideContentArea").width();
				margin = margin * ($(this).prevAll().size() - 2);
				margin = margin * -1;
				$(".tabslider").stop().animate({marginLeft: margin + "px"}, 0);
				loc = $(this).position()['left'];
				$(background).stop().animate({left: loc}, 0);
				$(background).animate({height: '60px', top: '0px'}, 300);
				$(".slide_content").stop().animate({top: '0px'}, 300);
			}else{
				var margin = $(".slideContentArea").width();
				margin = margin * ($(this).prevAll().size() - 2);
				margin = margin * -1;
				$(this).parent().parent().find(".tabslider").stop().animate({marginLeft: margin + "px"}, 300);
				loc = $(this).position()['left'];
				$(background).stop().animate({height: '60px', top: '0px', left: loc}, 300);
				$(".slide_content").stop().animate({top: '0px'}, 300);
			}
			//$(background).stop().animate({left: ($(this).position()['left'])}, 300);
		},
		function() {
			$(this).css({color: '#ffffff'}, 0);
			$(".slide_content").stop().animate({top: ($(".slide_content").height()*-1)-40 + "px"}, 300);
			$(".moving_bg").stop().animate({height: '0px', top: '60px'}, 300);
		}
	);
		//$(background).stop().animate({
		//	left: $(this).position()['left']
		//}, {
		//	duration: 300
		//});
		
		//TabbedContentOld.slideContent($(this));

});
