jQuery.preloadImages = function()
{
	for(var i = 0; i<arguments.length; i++)
	jQuery("<img>").attr("src", arguments[i]);
}
//jQuery.preloadImages("/images/frances.png", "/images/franceso.png", "/images/ingles.png", "/images/ingleso.png", "/images/italian.png", "/images/italiano.png", "/images/aleman.png", "/images/alemano.png", "/images/castellan.png", "/images/castellano.png");

jQuery(document).ready(function(){
	
	$("#iconbar li a").hover(
		function(){
			var iconName = $(this).children("img").attr("src");
			var origen = iconName.split(".png")[0];
			$(this).children("img").attr({src: "" + origen + "o.png"});
			$(this).css("cursor", "pointer");
			$(this).animate({ width: "120px" }, {queue:false, duration:"normal"} );
			//$(this).children("span").animate({opacity: "show"}, "fast");
			$(this).children("span").stop().css({"display": "inline", "opacity": 0}).fadeTo("slow", 1);
		}, 
		function(){
			var iconName = $(this).children("img").attr("src");
			var origen = iconName.split("o.")[0];
			$(this).children("img").attr({src: "" + origen + ".png"});			
			$(this).animate({ width: "38px" }, {queue:false, duration:"normal"} );
			//$(this).children("span").animate({opacity: "hide"}, "fast");
			$(this).children("span").stop().fadeTo("fast", 0, function(){
		        $(this).css("display", "none");
		    });
		});
});
