var temp_menu;
var temp_sottomenu;
var temp_sotto_sottomenu;
$( 
	function() {

		$('.show').bind('mouseover',function() {
		        $(this).siblings(0).animate({"top": "35px"}, "fast");
		       // $(this).css({'background' : 'none'});
		        $(this).parent().css({'background' : 'url(\'^sitepath^layout/immagini/tab-over.gif\') no-repeat'});
		        $('.opacity').css('opacity',0.7);
		        $('.opacity').children(0).css('opacity',1);
		        
		        
		}).parent().bind('mouseleave', function(e) {
		        $(this).children('.opacity').css({'z-index':0});
       		        //if ('#'+e.target.children(0).id!=pagina)
		        $(this).css({'background' : 'url(\'^sitepath^layout/immagini/tab.gif\') no-repeat'});
				$(this).children('.opacity').animate({"top": "0px"}, "fast");
									
		});
       altezza=$('#alt').height();
       altezza=parseInt(altezza)-260;
       $('#testotd').css({'height':''+altezza+'px'});
       
       $('.livello_2').bind('click' , function() {
       			if ((temp_sotto_sottomenu!=null)) {
       				temp_sotto_sottomenu.slideUp('slow');
       				$(this).next().slideDown('slow');
       				temp_sotto_sottomenu=$(this).next();
       			} else {
	       			$(this).next().slideDown('slow');
	       			temp_sotto_sottomenu=$(this).next();	       			
	       		}
     });

		$('.livello_1').bind('click' , function() {
       			if ((temp_sottomenu!=null)) {
       				temp_sottomenu.slideUp('slow');
       				$(this).next().slideDown('slow');
       				temp_sottomenu=$(this).next();
       			} else {
	       			$(this).next().slideDown('slow');
	       			temp_sottomenu=$(this).next();	       			
	       		}
     });
     $('.livello_0').bind('click' , function() {
       			if ((temp_menu!=null)) {
       				temp_menu.slideUp('slow');
       				$(this).next().slideDown('slow');
       				temp_menu=$(this).next();
       			} else {
	       			$(this).next().slideDown('slow');
	       			temp_menu=$(this).next();	       			
	       		}
     });

});


function pop(URL,nome,winWidth,winHeight,winLeft,winTop,SB,RSZ) {
	if (winLeft < 0)
		winLeft = screen.width - winWidth + winLeft
	if (winTop < 0)
		winTop = screen.height - winHeight + winTop
	if (winTop == "cen")
		winTop = (screen.height - winHeight)/2 - 20
	if (winLeft == "cen")
		winLeft = (screen.width - winWidth)/2
	if (winLeft>0 & winTop>0)
		window.open(URL, nome, 'width='+winWidth+',height='+winHeight+',fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars='+SB+',resizable='+RSZ+',directories=no,location=no,left='+winLeft+',top='+winTop+',screenX='+winLeft+',screenY='+winTop);
}		


var temp;


function fzoom(box) {
	document.getElementById(box).style.display='block';
}


function nozoom(box) {
	box.parentNode.style.display='none';
}


function zoom(box,imgZoom) {
	try {
		document.getElementById(temp).style.display='none';
	}
	catch (e) {
	}
	document.getElementById(box).innerHTML='<div onmouseout="nozoom(this)" class="zoom"><img alt="" src="/ext/shop/img/'+ imgZoom +'" /></div><div style="width:5px;"></div>';
	//alert('http://1.pre.wineuropa.net/ext/shop/img/'+ imgZoom);
	temp=box;
	setTimeout('fzoom(temp)',500);
}