$(document).ready(function(){



//EFFETTO HOVER BANNER DI DESTRA
var banners = $("div.banner_dx").length;
	if (banners>0)  {
	$("div.banner_dx").hover(function() 
		 {  
		    hoverimg = $(this).children("a").children("img").attr("longdesc");
			previmg  = $(this).children("a").children("img").attr("src");
			$(this).children("a").children("img").attr("src",hoverimg);
		 }, function() {
			$(this).children("a").children("img").attr("src",previmg);
			})
	}


//TOPBAR ANIMATIONS

$(".top_tab").hover(function(){
							 $('#topbar_text_cont').stop().animate({height: '87px'}, 1000, function() {});
							 //alert(".topbar_text#"+$(this).attr("id"));
							 $(".topbar_text").hide();
							 $(".topbar_text#"+$(this).attr("id").replace("tab_","")).fadeIn();
							 },function(){
							$('#topbar_text_cont').stop().animate({height: '0'}, 1000);
							 });

//MENU LINGUA

$(".top_lang_active").hover(function(){$(this).css("background-color","#666")},function(){$(this).css("background-color","#333")})
$(".top_lang").hover(function(){$(this).css("background-color","#666")},function(){$(this).css("background-color","#333")})

$(".top_lang_active").click(function() {

$(".top_lang.top_lang").slideToggle();


//if ( $(".top_lang#lang_inactive").height() < 2 )
//{
//	$("#logo").children("a").children("img").attr("src","img/volteco_logo_home2.gif");
//}
//else
//{
//	$("#logo").children("a").children("img").attr("src","img/volteco_logo_home.gif");
//}

})


//BREADCRUMB
var breadcrumb = $("#breadCrumb").length;
if (breadcrumb>0) jQuery("#breadCrumb").jBreadCrumb();


/*	$(function() {
		var zIndexNumber = 2000;
		$('div').each(function() {
			$(this).css('zIndex', zIndexNumber);
			zIndexNumber -= 10;
		});
	});*/

$("#logo").css('zIndex', 999);
$("#menu_out").css('zIndex', 2);


//SOCIAL BUTTONS
//$(".social_button").hover(
//    function() { $.data(this, 'hover', true); },
//    function() { $.data(this, 'hover', false); }
//).data('hover', false);

//$("#social_buttons").mouseout(function() {
//		if ($(".social_button").data('hover')==false)
//		$("#social_buttons")	.slideUp();							  
//})


});





function showSocial(which)
{
if (which=='fb')
{
	$("#twitter").hide();		
	$("#facebook").show()	;

}
else if (which=='tw')
{
	$("#facebook").hide();	
	$("#twitter").show();
}
else
{
	$("#facebook").hide();	
	$("#twitter").hide();
}
$("#social_buttons")	.slideDown();
}


