var LastOne = new Array(10);
var LastObject;

// Create an array of all open submenu's
var nr = 1;
var coll = document.all.tags("div");
if (coll!=null)
{
    for (i=0; i<coll.length; i++) 
    {
      if (coll[i].style.display=='block')
      {
				LastOne[nr] = coll[i-1];
				nr = nr + 1;
      }
    }
}
LastObject = LastOne[nr-1];

// ** Change color for mouseover- and out ** Used all over
function oo(obj){
	if (obj.style.backgroundColor=='#e0e0e0') {  //#e0e0e0
		obj.style.backgroundColor='white';  //#7ad8e3
	} else {
		obj.style.backgroundColor='#e0e0e0'; } 
}

function musflyt(raekke)
{
	document.all(raekke.sourceIndex).style.backgroundColor='#eeeeee';
	window.event.cancelBubble = true;
}
function musud(raekke) 
{
	document.all(raekke.sourceIndex).style.backgroundColor='white';
	window.event.cancelBubble = true;
}
function musklik(menuobj,link)
{
  location.href="javascript:__doPostBack(" & menuobj & "," & link & ")";
}
function showhide(jaja)
{
	if (String(typeof(jaja.children[0])) != "undefined")
	{ 
		if (document.all(jaja.sourceIndex+2).style.display == 'none' || document.all(jaja.sourceIndex+2).style.display == '')
		{
			document.all(jaja.sourceIndex+2).style.display = 'block';
		}
	}
	
  window.event.cancelBubble = true;

  if (LastObject != null)
  {
    // If current object tabIndex is less than Last object tabIndex then
    // hide all lastobjects up to current level (NB: tabIndex = level)
    if (jaja.tabIndex < LastObject.tabIndex) 
    { 
      for (i=String(LastObject.tabIndex); i>=String(jaja.tabIndex); i--)
      {
		  document.all(LastOne[i].sourceIndex+2).style.display = 'none';
		  }
    }
    // If current object tabIndex is equal to last object tabIndex and current object are different from this object
    if (jaja.tabIndex == LastObject.tabIndex && jaja != LastObject)
    {
		  document.all(LastObject.sourceIndex+2).style.display = 'none';
    }
  }
  LastOne[String(jaja.tabIndex)] = jaja;
//  session("LastOne"+String(jaja.tabIndex)]= jaja;
  LastObject = jaja;
}

function showpic(obj)
// open a window to show large pic
{

}