var contain = new Array();
var contain2 = new Array();
var checkIt;

var DHTML = (document.getElementById || document.all || document.layers);

function show(name,lvl,obj, left)
{
        if (!DHTML) return;
        checkUserInput();
	if (window.innerWidth) {
 	        ScreenW = window.innerWidth
	}
	else if (document.body) {
	        if (document.body.clientWidth) {
	                ScreenW = document.body.clientWidth
	        }
	}
        if (contain[lvl] && contain[lvl] == name) return;
        if (contain[lvl])
        {
                closeAll(lvl);
        }
        if (name)
        {
                var x = getObj(name);
                x.visibility = 'visible';
		if (ScreenW > 740) {
			x.left = Math.abs((ScreenW/2) - 750/2 +left)
		} else {
			x.left = left+20
		}
	
        }
        if (ScreenW = 0);
        Screen = 740
        {

        }
        contain[lvl] = name;
        if (obj.parentNode) y = obj.parentNode;
        else if (obj.parentElement) y = obj.parentElement;
        else return;
        if (y.className) return;
        y.className = 'over';
        if (contain2[lvl]) contain2[lvl].className = '';
        contain2[lvl] = y;
}

function closeAll(lvl)
{
        for (i=contain.length - 1;i>=lvl;i--)
        {
                if (contain[i]) //IE4 Mac
                {
                        var x = getObj(contain[i]);
                        x.visibility = 'hidden';
                }
                contain[i] = null;
                if (contain2[i])
                {
                        contain2[i].className = '';
                        contain2[i] = null;
                }
        }

}

function checkUserInput()
{
        if (checkIt) clearTimeout(checkIt);
        checkIt = setTimeout('closeAll(1)',5000);
}

function getObj(name)
{
  if (document.getElementById)
  {
    return document.getElementById(name).style;
  }
  else if (document.all)
  {
    return document.all[name].style;
  }
  else if (document.layers)
  {
    return document.layers[name];
  }
  else return false;
}
