function rollover()
{
   var e=document.getElementById(this.id);
	if (e.previousSibling) e=e.previousSibling.previousSibling; else e=e.parentNode.previousSibling.previousSibling;
   if (e.getAttribute('src').indexOf('menu_bullet_current')==-1) e.setAttribute('src','img/menu_bullet.png');
}

function rollout()
{
   var e=document.getElementById(this.id);
	if (e.previousSibling) e=e.previousSibling.previousSibling; else e=e.parentNode.previousSibling.previousSibling;
   if (e.getAttribute('src').indexOf('menu_bullet_current')==-1) e.setAttribute('src','img/menu_bullet_none.png');
}

function loading()
{
   // Image preloading
   var image1=new Image();
   image1.src="img/menu_bullet.png";
   var image2=new Image();
   image2.src="img/menu_bullet_none.png";
   var image3=new Image();
   image3.src="img/menu_bullet_current.png";

	var elements=document.links;
   for (i=0;i<elements.length;i++)
   {
      if (elements[i].className!='btn') continue;

      p=elements[i];
      cut=p.getAttribute('href').substr(p.getAttribute('href').lastIndexOf('/')+1);
      a1='/'+cut;
      a2=window.location.pathname.substr(window.location.pathname.lastIndexOf('/')).replace('\\','/');
		if (window.location.search!='') a2=a2+window.location.search;
		if (!elements[i].id) elements[i].id='mnu'+window.parseInt(Math.random()*10000);
      var e=document.getElementById(elements[i].id);
   	if (e.previousSibling) e=e.previousSibling.previousSibling; else e=e.parentNode.previousSibling.previousSibling;
      if (a1==a2)
      {
         e.setAttribute('src','img/menu_bullet_current.png');
      } else
		{
         e.setAttribute('src','img/menu_bullet_none.png');
      }
      elements[i].onfocus=rollover;
      elements[i].onblur=rollout;
      elements[i].onmouseover=rollover;
      elements[i].onmouseout=rollout;
   }
}
