
var lastHoverTab = false;

function hoverTab(linkNode) {
  if (linkNode.innerHTML == lastHoverTab) return;
  lastHoverTab = linkNode.innerHTML;
  var node = $(linkNode);
  node.addClass('menu-item-over');
  setTimeout(function() {
    node.animate({top:-10,height:37}, 130, function() {
      node.animate({top:0,height:27}, 130, function() {
          node.removeClass('menu-item-over');
      });
    });
  }, 60);
}

window.onload = function() {
	
  sly.page = new slyPage(); 
  sly.screen = {width: document.all ? document.documentElement.clientWidth : window.innerWidth, height: document.all ? document.documentElement.clientHeight : window.innerHeight };
  new slyTable({entity:'news'});
  $('#pageTitle h1').effect('slide', 800);

  setInterval(function() {
	$('#header img').eq(-2).css('opacity', 0);
	$('#header img').eq(-2).animate({opacity:1}, 2000);
	$('#header img').last().animate({opacity:0}, 2000, function() {
      $('#header img').last().prependTo($('#header'));
    });
  }, 7000);

  if ($('#newslist')) {
	  setInterval(function() {
	    var nodes = $('.news-item');
	    if (nodes.length < 5) return;
	    $('#newslist').animate({top:-nodes[0].offsetHeight}, 1000, function() {
	      var li = document.createElement('li');
	      li.className = 'news-item';
	      li.innerHTML = nodes[0].innerHTML;
	      try {
	    	  nodes[0].parentNode.removeChild(nodes[0]); 
	      } catch (err) {}
	      document.getElementById('newslist').style.top = '0px';
	      nodes[1].parentNode.appendChild(li);
	    });
	  }, 6000);
  }
};







