
jQuery.preloadImages = function()
{
	for(var i = 0; i<arguments.length; i++)
	jQuery("<img>").attr("src", arguments[i]);
}
jQuery.preloadImages("tab-1.jpg", "tab-1.jpg", "tab-2.jpg", "tab-2o.jpg", "tab-3.jpg", "tab-3o.jpg");



jQuery(document).ready(function(){
	$("#tab1").hover(
		function(){
			$(this).children("img").animate({opacity: ".65"}, "fast");
		},
		function(){
			$(this).children("img").animate({opacity: "1"}, "fast");
		}),
	$("#tab1").click(
		function(){
			$("#img-title1").children("img").css("display", "block");
			$("#tab3").children("img").animate({opacity: "show"}, "fast");
			//$("#tab3").animate({width:"13%"}, "slow");
			$("#tab2").children("img").animate({opacity: "show"}, "fast");
			//$("#tab2").animate({width:"13%"}, "slow");
			//$(this).animate({width:"74%"}, "slow");
			$(this).css("width", "74%");
			$(this).children("img").animate({opacity: "hide"}, "fast");
			
			
			$(this).css("cursor", "auto");
			//
			
			$("#tab2").css("width", "13%");
			$("#tab3").css("width", "13%");
			//$("#tab2").children("img").css("opacity", "100");
			//$("#tab3").children("img").css("opacity", "100");
			$("#tab2").css("cursor", "pointer");
			$("#tab3").css("cursor", "pointer");
			$("#img-title2").children("img").css("display", "none");
			$("#img-title3").children("img").css("display", "none");
		}),
	$("#tab2").hover(
		function(){
			$(this).children("img").animate({opacity: ".65"}, "fast");
		},
		function(){
			$(this).children("img").animate({opacity: "1"}, "fast");
		}),
	$("#tab2").click(
		function(){
			$("#img-title2").children("img").css("display", "block");
			/*$(this).children("img").animate({opacity: "hide"}, "fast");
			$(this).animate({width:"74%"}, "1");
			$(this).css("cursor", "auto");
			$("#tab1").animate({width:"13%"}, "1");
			$("#tab3").animate({width:"13%"}, "1");
			$("#tab1").children("img").animate({opacity: "show"}, "fast");
			$("#tab3").children("img").animate({opacity: "show"}, "fast");
			$("#tab1").css("cursor", "pointer");
			$("#tab3").css("cursor", "pointer");
			*/
			$("#tab1").children("img").animate({opacity: "show"}, "fast");
			//$("#tab3").animate({width:"13%"}, "slow");
			$("#tab3").children("img").animate({opacity: "show"}, "fast");
			//$("#tab2").animate({width:"13%"}, "slow");
			//$(this).animate({width:"74%"}, "slow");
			$(this).css("width", "74%");
			$(this).children("img").animate({opacity: "hide"}, "fast");
			
			
			$(this).css("cursor", "auto");
			//
			
			$("#tab1").css("width", "13%");
			$("#tab3").css("width", "13%");
			//$("#tab2").children("img").css("opacity", "100");
			//$("#tab3").children("img").css("opacity", "100");
			$("#tab1").css("cursor", "pointer");
			$("#tab3").css("cursor", "pointer");
			$("#img-title1").children("img").css("display", "none");
			$("#img-title3").children("img").css("display", "none");
		}),	
	$("#tab3").hover(
		function(){
			$(this).children("img").animate({opacity: ".65"}, "fast");
		},
		function(){
			$(this).children("img").animate({opacity: "1"}, "fast");
		}),
	$("#tab3").click(
		function(){
			$("#img-title3").children("img").css("display", "block");
			/*$(this).children("img").animate({opacity: "hide"});
			$(this).animate({width:"74%"}, "1");
			$(this).css("cursor", "auto");
			$("#tab1").animate({width:"13%"}, "1");
			$("#tab2").animate({width:"13%"}, "1");
			$("#tab1").children("img").animate({opacity: "show"}, "fast");
			$("#tab2").children("img").animate({opacity: "show"}, "fast");
			$("#tab1").css("cursor", "pointer");
			$("#tab2").css("cursor", "pointer");*/
			$("#tab1").children("img").animate({opacity: "show"}, "fast");
			//$("#tab3").animate({width:"13%"}, "slow");
			$("#tab2").children("img").animate({opacity: "show"}, "fast");
			//$("#tab2").animate({width:"13%"}, "slow");
			//$(this).animate({width:"74%"}, "slow");
			$(this).css("width", "74%");
			$(this).children("img").animate({opacity: "hide"}, "fast");
			
			
			$(this).css("cursor", "auto");
			//
			
			$("#tab1").css("width", "13%");
			$("#tab2").css("width", "13%");
			//$("#tab2").children("img").css("opacity", "100");
			//$("#tab3").children("img").css("opacity", "100");
			$("#tab1").css("cursor", "pointer");
			$("#tab2").css("cursor", "pointer");
			$("#img-title1").children("img").css("display", "none");
			$("#img-title2").children("img").css("display", "none");
		})/*,
	$("#iconbar li ").mouseover(
		function(){
			var iconName = $(this).children("img").attr("src");
			var origen = iconName.split(".jpg")[0];
			$(this).children("img").attr({src: "" + origen + "o.jpg"});
			$(this).css("cursor", "pointer");
			$(this).animate({ width: "240px" }, {queue:false, duration:"normal"} );
			$(this).children("span").animate({opacity: "show"}, "fast");
		}), 
	$("#iconbar li ").mousewheel(
		function(){
			var iconName = $(this).children("img").attr("src");
			var origen = iconName.split("o.")[0];
			$(this).children("img").attr({src: "" + origen + ".jpg"});			
			$(this).animate({ width: "125px" }, {queue:false, duration:"normal"} );
			$(this).children("span").animate({opacity: "hide"}, "fast");
		});*/
});
