function help_ie()
{
	if($.browser.msie)
	{
		$('#mainnav li').hover(function(){
			$(this).addClass('over');
		},
		function(){
			$(this).removeClass('over');
		});
		
		$('input.button').hover(function(){
			$(this).addClass('over');
		},
		function(){
			$(this).removeClass('over');
		});
	}
}
				
function table_helper()
{
	$('table:not(.nohover) tbody tr').hover(function(){
		$(this).addClass('over');
	},
	function(){
		$(this).removeClass('over');
	});
	
	$('table:not(.nohover) tbody tr td:first-child').addClass('l');
	
	$('table:not(.nohover .noLinks) tbody tr td a').each(function(){
		var rowhref=$(this).attr('href');
		$(this).parent().parent().click(function(){
			window.location.href=rowhref;
		})
	});
}
	

function search_focus()
{
	$('#search input:first').focus(function(){
		$(this).val('');
	});
}

function init_lightbox()
{
	$('a[@name*=zoom]').lightBox({
		overlayBgColor:'#FFF',
		overlayOpacity:0.8,
		imageBlank:'/global/img/lightbox/blank.gif',
		imageLoading:'/global/img/lightbox/loading.gif',
		imageBtnClose:'/global/img/lightbox/close.gif',
		imageBtnPrev:'/global/img/lightbox/prev.gif',
		imageBtnNext:'/global/img/lightbox/next.gif',
		containerBorderSize:10,
		containerResizeSpeed:350,
		txtImage:'',
		txtOf:''
	});
}

$(document).ready( function(){
		table_helper();
		help_ie();
		init_lightbox();
		search_focus();
		$("#catdownloads").tablesorter({sortList: [[0,0], [1,0]]});
});