// JavaScript Document
$(document).ready(function(){
    /* Autoanim Ancore */
	var autoAnimInterval = 3500;
   setTimeout("autoAnimAncore("+autoAnimInterval+")",autoAnimInterval);
	$("#headerWrapper").animate({"height":"8px"},"slow");
	$("#headerWrapper").hover(function(){
		$(this).stop().animate({"height":"126px"},"slow");
	},function(){
		$(this).stop().animate({"height":"8px"},"fast");
	});
	$("#lang_bar p a").hover(function(){
		$("img", this).stop().animate({"width":"18px","height":"18px","top":"-3px"},"fast");
	},function(){
		$("img", this).stop().animate({"width":"14px","height":"14px","top":"0px"},"fast");
	});
	
	
	$(".listaretaileri ul li a:first-child").hover(function(){
		$(this).parent().css("position","relative");															
		$(this).parent().find("p").each(function(){
			if($(this).html().length>3)
				$(this).css({"overflow":"auto",
					"background":"#fff","padding":"10px","z-index":"100",
					"border":"1px solid #ccc",
					"width":"200px",
					"position":"absolute",
					"left":"-20px"}).stop().fadeIn("600");
		});
	},function(){
		$(this).parent().find("p").stop().fadeOut("fast");
	});
	
	
	//GALERIE SUBMENU
	$("#galleriiSubMenuA").hover(function(){
		if($("#galleriiSubMenu").css("display")=="none")
			$("#galleriiSubMenu").fadeIn(400);
		else{
			$("#galleriiSubMenu").stop().fadeTo(0,1);;
		}
	}, function(){
		$("#galleriiSubMenu").fadeOut(400);
	});
	
	$("#galleriiSubMenu").hover(function(){
		$("#galleriiSubMenu").stop().fadeIn(0);;
	}, function(){
		$("#galleriiSubMenu").stop().fadeOut(300);
	});
	
});
function autoAnimAncore(interval){
	stepcarousel.stepBy('mygallery', 1);
	setTimeout("autoAnimAncore("+interval+")",interval);
}