// JavaScript Document
//////////////////////////////////////////////////////////
//  CMS Copyright by www.Gamer-Templates.de 
var isHover = new Array(); var clearMe = new Array(); var zIndex=1;
function changePic(id,hide)
{
  isHover['info'] = 0; isHover['clan'] = 0; isHover['comm'] = 0; isHover['misc'] = 0; isHover['Facebook'] = 0;
  hideNavi('info'); hideNavi('clan'); hideNavi('comm'); hideNavi('misc'); hideNavi('Facebook'); 
  if(!$('#' + id)[0].src.match(/\_h/))
    $('#' + id)[0].src = $('#' + id)[0].src.replace(/\.jpg/, '_h.jpg');

  if(hide != 0) {
    $('#' + id)[0].onmouseout = function() {
      if(isHover[this.id] != 1) this.src = this.src.replace(/\_h\.jpg/, '.jpg');
    }
  } else {
    $('#' + id)[0].onmouseout = function() {
      isHover[this.id] = 0;
      hideNavi(this.id);
    }
  } 
}

function hideNavi(id,timer)
{

  if(timer == 1 && isHover[id] != 1)
  { 
    $('#n_' + id)[0].style.display = 'none';
    $('#' + id)[0].src = $('#' + id)[0].src.replace(/\_h\.jpg/, '.jpg');
  } else window.setTimeout("hideNavi('"+id+"',1)",100);
}

//////////////////////////////////////////////////////////////////////////

function showNavi(id)
{
  changePic(id, 0);
  isHover[id] = 1;
  $('#n_' + id)[0].style.display = 'block';
  $('#n_' + id)[0].style.zIndex = zIndex; zIndex++;
  
  $('#n_' + id)[0].onmouseover = function() {
    var id = this.id.replace(/n\_/, '');
    isHover[id] = 1;
  }

  $('#n_' + id)[0].onmouseout = function() {
    var id = this.id.replace(/n\_/, '');
    changePic(id);
  }
}

var img = new Array();
function initNavigation()
{
  var tags = $('#navi')[0].getElementsByTagName('img');
  for(var i=0;i<tags.length;i++)
  {
    if(tags[i].className == 'h')
    {
      img[tags[i].id] = new Image();
      img[tags[i].id].src = tags[i].src.replace(/\.jpg/,'_h.jpg');
    }
  }
}
