function getAbsolutePosition(el) {
        var r = { x: el.offsetLeft, y: el.offsetTop };
        if (el.offsetParent) {
                var tmp = getAbsolutePosition(el.offsetParent);
                r.x += tmp.x;
                r.y += tmp.y;
        }
        return r;
}

function menuhover(elem,pos,body){
document.getElementById('menu-1').style.background="url(/images/menu-bottom.gif) left 50px repeat-x";
document.getElementById('menu-2').style.background="url(/images/menu-bottom2.gif) left 55px repeat-x";
document.getElementById('menu-3').style.background="url(/images/menu-bottom.gif) left 50px repeat-x";
document.getElementById('menu-4').style.background="url(/images/menu-bottom2.gif) left 55px repeat-x";
document.getElementById('menu-5').style.background="url(/images/menu-bottom.gif) left 50px repeat-x";
document.getElementById('menu-6').style.background="url(/images/menu-bottom2.gif) left 55px repeat-x";
document.getElementById('menu-7').style.background="url(/images/menu-bottom.gif) left 50px repeat-x";
document.getElementById('menu-10').style.background="url(/images/menu-bottom2.gif) left 55px repeat-x";

document.getElementById(elem).style.background="url(/images/menu-hover-back.png) left 7px repeat-x";
}

function menuout(elem){
if(document.getElementById(elem).className=="top-menu")
document.getElementById(elem).style.background="url(/images/menu-bottom.gif) left 50px repeat-x";
else
document.getElementById(elem).style.background="url(/images/menu-bottom2.gif) left 55px repeat-x";
}

function body_load(body){
menu_load('menu-1','menu-1-ul',body);
menu_load('menu-2','menu-2-ul',body);
menu_load('menu-3','menu-3-ul',body);
menu_load('menu-4','menu-4-ul',body);
menu_load('menu-5','menu-5-ul',body);
menu_load('menu-6','menu-6-ul',body);
menu_load('menu-7','menu-7-ul',body);
menu_load('menu-10','menu-10-ul',body);
MM_preloadImages('/images/menu-hover-back.png')
}

function menu_load(elem,pos,body){
var posit=0;
posit=getAbsolutePosition(document.getElementById(elem)).x;
//posit=document.getElementById(elem).clientWidth;
if(pos=="menu-1-ul"||pos=="menu-2-ul"||pos=="menu-3-ul"||pos=="menu-4-ul"||pos=="menu-5-ul"||pos=="menu-6-ul") document.getElementById(pos).style.left=posit-7+'px';
else{posit=document.getElementById(body).clientWidth-posit-document.getElementById(elem).clientWidth;
document.getElementById(pos).style.right=posit-7+'px';}
}

function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}