
/* misc inits */

$(document).ready(function(){

	//navs first/last child (for IE)
	$('ul li:first-child').addClass('first-child');
	$('ul li:last-child').addClass('last-child');
	
	//navs hovers
	$('ul.n-primary li').hover(
		function() { $(this).addClass('over'); /*$(this).find('ul.n-flyout').show();*/},
		function() {  if( !$(this).hasClass('active') )  $(this).removeClass('over'); /*$(this).find('ul.n-flyout').fadeOut('fast');*/}
	);
	
	//big tabs
	$('div.b-tabbed-box div.b-tabs div.b-tab').hover(
		function() { if( !$(this).hasClass('active') ) $(this).addClass('over');},
		function() { $(this).removeClass('over');}
	);
	
	$('div.b-tabbed-box div.b-tabs div.b-tab').click(function(){Util.SwitchTab(this);});
	
	//table.data
	$('table.data tbody tr').hover(
		function() { $(this).addClass('over');},
		function() { $(this).removeClass('over');}
	);
	
	//table.data no background in first tr
	$('tr.no-bg').hover( function() { $(this).removeClass('over');} );
		
	//last-child for cols like w-50, w-33 etc
	$('.h-cols .w-33:last-child').addClass('last-child');
	$('.h-cols .w-45:last-child').addClass('last-child');
	$('.h-cols .w-50:last-child').addClass('last-child');

	// pagination
	$('ul.b-pagination li').hover(
		function() { if( !$(this).hasClass('active') ) $(this).addClass('over'); },
		function() { $(this).removeClass('over');}
	);

	if(  window.location.hash != "" ) { Util.SwitchTab( $('div.b-tabbed-box div.b-tabs div.b-tab:nth-child('+  window.location.hash.replace(/#tab(\d)/,"$1")  +')') ); }
});
