/**
 * Funktionen um Produktmenu anzuzeigen
 */
var t;

function getPos(i)  {
    var obj = document.getElementById('entrie' + i);
    var pos = {left:0, top:0};
	if(typeof obj.offsetLeft != 'undefined') {
	   while (obj) {
	       pos.top += obj.offsetTop;
	       obj = obj.offsetParent;
	   }
	} else {
	   pos.top = obj.top ;
	}

    return pos;
}

function sfHoverMain(i) {
    var pos = getPos(i);
    var obj = document.getElementById("sub" + i);
    window.setTimeout(function() {
    obj.className = "submenu-active";
    obj.style.top = (pos.top - 1) + "px";
    }, 1000, obj, pos);
}

function sfOutMain(i) {
    var id = "sub" + i;
    t = window.setTimeout(function() {
	document.getElementById(id).className = "submenu";
    }, 1000, id);
}

function sfHoverSub(i) {
    window.clearTimeout(t);
    var pos = getPos(i);
    var obj = document.getElementById("sub" + i);
    obj.className = "submenu-active";
    obj.style.top = (pos.top - 1) + "px";
}

function sfOutSub(i)  {
    var obj = document.getElementById("sub" + i);
    obj.className="submenu";
}
