﻿var currentMenu;
var showShadow=true;
function SubSel(id){
id.className="SubMenuItemHover"}



function SubUnSel(id){
id.className="SubMenuItem"}


function SubDown(id){
//id.style.width=id.offsetWidth;
//down=true;
//doSubItemClick(id);

mnu.style.visibility="visible";
}

function linkClicked(){
var mnu = document.getElementById("mnu" + currentMenu);
mnu.style.visibility="hidden";
//window.location=path;
}
function SubUp(id){
//id.style.width=id.offsetWidth;

}

function Down(id){
if (id.disabled==true) return

}
function Up(id){
if (id.disabled==true) return
}


function f_scrollLeft() 
{
	return f_filterResults (window.pageXOffset ? window.pageXOffset : 0,
		                    document.documentElement ? document.documentElement.scrollLeft : 0,
		                    document.body ? document.body.scrollLeft : 0);
}

function f_scrollTop() 
{
	return f_filterResults (window.pageYOffset ? window.pageYOffset : 0,
		                    document.documentElement ? document.documentElement.scrollTop : 0,
		                    document.body ? document.body.scrollTop : 0);
}

function f_filterResults(n_win, n_docel, n_body) 
{
	var n_result = n_win ? n_win : 0;
	
	if (n_docel && (!n_result || (n_result > n_docel)))
	    n_result = n_docel;
	
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}
function findPos(obj) {
	var curleft = curtop = 0;
	var w=0;
	
w = parseInt(document.getElementById("mnu" + obj.id).style.width);
	
if (obj.offsetParent) {
do {
			curleft += obj.pageX;
			curtop += obj.pageY;
} while (obj = obj.offsetParent);

}

if (parseInt(curleft+w)>document.body.clientWidth)
curleft=document.body.clientWidth-w + f_scrollLeft();


 // curtop+=parseInt(f_scrollTop());

return [curleft,curtop];
}

  function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

  function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }

function Sel(id,i){

//if (document.getElementById(id).disabled==true)
//  return;
 
        document.getElementById(id).className = "MenuItemHover" ;
      
    
}

function MenuMove(obj){


Sel(document.getElementById(obj));
}
function MenuOut(obj){
UnSel(document.getElementById(currentMenu),obj);
}

function UnSel(id){
document.getElementById(id).className="MenuItem"

}

function doSubItemClick(mnu){
//currentMenu.className="PopupMenu"
//currentMenu.style.display="Block"
}
