/**
 * JS: Tab System
 * @author Darío Ruellan <druellan@ecimtech.com>
 * @copyright ecimTech 2009
 */

$(function()
{
	var tabs = $(".tabs .tabs-area");
	var texts = $(".tabs .text-area");
	
	// Start Tab system
	$("div", texts).hide();
	$("div:first", texts).show();
	
	
	$("li a", tabs).click(function()
	{
		$("li a.selected", tabs)
		.removeClass("selected")
		.css(
		{
			backgroundPosition: '0 0'
		})
		.stop()
		.animate(
		{
			backgroundPosition: '(0px 31px)'
		});
		$(this)
		.stop()
		.css(
		{
			backgroundPosition: '0 31px'
		})
		.animate(
		{
			backgroundPosition: '(0px 0px)'
		},  function()
			{
				$(this).addClass("selected")
			});

		var selected = $(this).attr("rel");
	
		$("div", texts).slideUp("normal");
		$("div."+selected, texts).slideDown("normal");
	
		return false;

	});
	
});
