//Site code/functionality that'll start up when ready
 
$(document).ready(function() {

	//Hover-show the subnabs
	$('.navitem').hover(
		function() {
			$('.sub_nav',this).show();
		},
		function() {
			var id = $(this).attr('id');
			var tid = setTimeout(function() { $('#'+id+' .sub_nav').hide();},300);
			$(this).attr('delayHide',tid);  //Delay its hiding, but store the timeout id
		}
	);
	//Conintue showing if over menu
	$('.navitem .sub_nav').hover(
		function() {
			clearTimeout($(this).parent().attr('delayHide'));	//Clear the timeout from above, so it doesn't blink out once we get there.
			$(this).show();
		},
		function() {
			$(this).hide();
		}
	);

});



//Articles funtions

function change_list(v) {
	$.get('getArticles.php',{select:v},function(xh) {
		$('#articles_right').html(xh);
	});
}