
jQuery.preloadImages = function()
{
	for(var i = 0; i<arguments.length; i++)
	jQuery("<img>").attr("src", arguments[i]);
}

jQuery.preloadImages("/basilicatanet/css/themes/theme_01/img/rss.png");
jQuery.preloadImages("/basilicatanet/css/themes/theme_01/img/rsso.png");
jQuery.preloadImages("/basilicatanet/css/themes/theme_01/img/youtube.png");
jQuery.preloadImages("/basilicatanet/css/themes/theme_01/img/youtubeo.png");
jQuery.preloadImages("/basilicatanet/css/themes/theme_01/img/space.png");
jQuery.preloadImages("/basilicatanet/css/themes/theme_01/img/spaceo.png");

jQuery(document).ready(function(){

	$("#iconbar li img").hover(
		function(){
			var iconName = $(this).attr("src");
			var origen = iconName.split(".")[0];
			$(this).attr({src: "" + origen + "o.png"});
			$(this).parent().parent().animate({ width: "100px" }, {queue:false, duration:"normal"} );
			$(this).parent().parent().find("span").animate({opacity: "show"}, "fast");
		},
		function(){
			var iconName = $(this).attr("src");
			var origen = iconName.split("o.")[0];
			$(this).attr({src: "" + origen + ".png"});
			$(this).parent().parent().animate({ width: "40px" }, {queue:false, duration:"normal"} );
			$(this).parent().parent().find("span").animate({opacity: "hide"}, "fast");
		});
});
