// JavaScript Document

//######### SHOW THE MENU #########
function show_menu() {
	
//image position in the page
var ricette_left = findPosX(document.getElementById("ricette_id"));
var ricette_up = findPosY(document.getElementById("ricette_id"));
	
if (navigator.appName=='Microsoft Internet Explorer') {
var menu_ricette_top = parseInt(ricette_up) + 21;
document.getElementById("menu_div_id").style.top= menu_ricette_top + "px" ;
document.getElementById("menu_div_id").style.left= ricette_left + "px";
} else {
var menu_ricette_top = parseInt(ricette_up) + 17;
document.getElementById("menu_div_id").style.top= menu_ricette_top + "px" ;
document.getElementById("menu_div_id").style.left= ricette_left + "px";
}

document.getElementById("menu_id").style.visibility="visible";
document.getElementById("menu_div_id").style.backgroundColor="#0B2756";
document.getElementById("menu_id").style.fontSize="14px";
document.getElementById("ricette_id").onmouseout = hide_menu;
document.getElementById("menu_div_id").onmouseout = hide_menu;
}

//######### HIDE THE MENU #########
function hide_menu() {
document.getElementById("menu_id").style.visibility="hidden";
document.getElementById("menu_div_id").style.backgroundColor="transparent";
document.getElementById("ricette_id").style.textDecoration="none";
document.getElementById("ricette_id").style.textDecoration=null;
}

//######### PUT HAND & UNDERLINE TEXT #########
function hand_underline() {
//document.getElementById("ricette_id").style.cursor="pointer";
document.getElementById("ricette_id").style.textDecoration="underline";
}

//function no_underline() {
//document.getElementById("ricette_id").style.textDecoration=null;
//}

//######### FIND THE IMAGE POSITION #########

function findPosX(obj) {
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;

    return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;

    return curtop;
}