$(document).ready(function()
{
	$('table.colors tbody tr:not([th]):odd').addClass('odd');
	$('table.colors tbody tr:not([th]):even').addClass('even');
	
	$('a.external').attr('target', '_blank');
	
	makeButtons();
	tableruler();
});

sfHover = function() {
	var sfEls = document.getElementById('navigation').getElementsByTagName('li');
	for (var i=0; i<sfEls.length; i++)
	{
		sfEls[i].onmouseover = function()
		{
			this.className += ' sfhover';
		}
		sfEls[i].onmouseout = function()
		{
			this.className = this.className.replace(new RegExp(" sfhover\\b"), '');
		}
	}
}
if (window.attachEvent) window.attachEvent('onload', sfHover);

function tableruler()
{
	if (document.getElementById && document.createTextNode)
	{
		var tables = document.getElementsByTagName('table');
		for (var i=0; i<tables.length; i++)
		{
			if(tables[i].className == 'taulukko')
			{
				var trs = tables[i].getElementsByTagName('tr');
				for(var j=0; j<trs.length; j++)
				{
					trs[j].onmouseover = function(){ this.className = 'ruled'; return false; }
					trs[j].onmouseout = function(){ this.className = 'testi'; return false; }					
				}
			}
		}
	}
}
