// JavaScript Document
// MENU HOME JQUERY 1.3.2	
/**/

function soilmecHome(){
	$("div.scrollable").scrollable();
	
	$("body").append('<div class="tablehover"></div>');
	
	$("div.scrollable .items div img").mouseover(function(){
		$(".tablehover").html($(this).parent().find(".menu_home").html()).css({"top": + ($(this).offset().top + 400) + "px", "left": + $(this).offset().left + "px", "position":"absolute", "z-index":"1000"});
	});
	
	$("body").click(function(){
															 
		if ($(".tablehover").html() != "") {
			$(".tablehover").html('');
		}
	});
}

/*--------------------------------------------------
	LANGUAGES
--------------------------------------------------*/
function lang(){
	
	var over = false;
	var loop;
	//$("li.languages").mouseover(function() {
	$(".change_language").mouseover(function() {
		var over = true;
		$(".change_language a").not("div.mostra_lang a").addClass("lang_over");
		$("div.mostra_lang").animate({opacity: "show", top: "0"}, "slow");
	});
	
	$("div.change_language").mouseover(function(){
		over = true;								   
		clearTimeout(loop);
	}).mouseout(function(){
		over = false;
		loop = setTimeout(function(){
			if (!over){
				$("div.mostra_lang").stop().animate({opacity: "hide", top: "-10px"}, "fast");
				$(".change_language a").removeClass("lang_over");
			}
		},500);
	});	
}

$(document).ready(function(){
	lang();
	soilmecHome();	
/*	$("div.scrollable").scrollable();
	$("div.scrollable div.menu_home").hide();
	$("div.scrollable div.items img").data("canclose", true).hover(function(){
		$(this).data("canclose", false);
		var myEl = $(this).next().next().next();
		myEl.slideDown(400);
	}, function(){
		var myEl = $(this).next().next().next();
		var img = $(this);
		img.data("canclose", true);
		aTimer = setTimeout(
				function(){
					if(img.data("canclose")){
						myEl.slideUp(400);
					}
				},300);
	});
	$("div.scrollable div.items div.menu_home").hover(function(){
		var img = $(this).prev().prev().prev();
		//alert(img.attr("src"));
		img.data("canclose", false);
	}, function(){
		var myEl = $(this);
		var img = $(this).prev().prev().prev();
		img.data("canclose", true);
		aTimer = setTimeout(
				function(){
					if(img.data("canclose")){
						myEl.slideUp(400);
					}
				},300);			
	});
*/
});


