// JavaScript Document

$(document).ready(function(){
$('#no-script').remove();
$('.top-left').hover(function(){
		         $(this).children('.front').stop().animate({'top' : '150px', 'left' : '360px'}, 500);
		 }, function(){$(this).children('.front').stop().animate({'top' : '0px', 'left' : '0px'}, 500);});
		  $('.top-center').hover(function(){
		         $(this).children('.front').stop().animate({'top' : '150px'}, 500);
		 }, function(){$(this).children('.front').stop().animate({'top' : '0px', 'left' : '0px'}, 500);});
		 $('.bottom-center').hover(function(){
		         $(this).children('.front').stop().animate({'top' : '-180px'}, 500);
		 }, function(){$(this).children('.front').stop().animate({'top' : '0px', 'left' : '0px'}, 500);});
		 $('.left').hover(function(){
		         $(this).children('.front').stop().animate({'left' : '360px'}, 500);
		 }, function(){$(this).children('.front').stop().animate({'top' : '0px', 'left' : '0px'}, 500);});
		 $('.right').hover(function(){
		         $(this).children('.front').stop().animate({'left' : '-360px'}, 500);
		 }, function(){$(this).children('.front').stop().animate({'top' : '0px', 'left' : '0px'}, 500);});
		 $('.top-right').hover(function(){
		         $(this).children('.front').stop().animate({'top' : '150px','left' : '-300px'}, 500);
		 }, function(){$(this).children('.front').stop().animate({'top' : '0px', 'left' : '0px'}, 500);});
		 
});


var TabbedContent = {
	init: function() {	
		$(".tab_item").mouseover(function() {

			var background = $(this).parent().find(".moving_bg");

			$(background).stop().animate({
				left: $(this).position()['left']
			}, {
				duration: 300
			});

			TabbedContent.slideContent($(this));
			
		});
	},

	slideContent: function(obj) {

		var margin = $(obj).parent().parent().find(".slide_content").width();
		margin = margin * ($(obj).prevAll().size() - 1);
		margin = margin * -1;

		$(obj).parent().parent().find(".tabslider").stop().animate({
			marginLeft: margin + "px"
		}, {
			duration: 300
		});
	}
}

$(document).ready(function() {
	TabbedContent.init();
});


