$(document).ready(function() {
	
	function openDir( form ) { 	
		var newIndex = form.province.selectedIndex; 	
		if ( newIndex == 0 ) { 	
			alert( "Please select a location!" ); 	
		} else { 	
			cururl = form.province.options[ newIndex ].value; 	
			window.location.assign( cururl ); 	
		} 
	} 
	
	//Rollovers Main Banner	
	$('table tr td:even').each(function () {	
		$(this).css('width', '30%');	
	});
	$('table tr td:odd label').each(function () {	
		$(this).css('position', 'relative');
		$(this).css('top', '-5px');			
		$(this).css('margin-left', '5px');
		$(this).css('font-weight', 'bold');
	});
	
	
	//Bio Expand
	$('.events h2').click(function(){	
		$(this).next("div").slideToggle("fast");
		$(this).toggleClass("active");				
 	 });
	
	
	
	//Back 2 Top
	$.easing.elasout = function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
		
	//this one is important, many browsers don't reset scroll on refreshes
	$('div.pane').scrollTo( 0 );//reset all scrollable panes to (0,0)
	$.scrollTo( 0 );//reset the screen to (0,0)			
	//TOC, shows how to scroll the whole window
	$('p.back2top a').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
		$.scrollTo( this.hash, 700, { easing:'elasout' });
		return false;
	});	

});
