( function globalNav() {
	$( document ).ready( function() {
		var globalNavAnchors = $( '#nav li' )
		var subNavs = $( '#nav li div.subNav' );
		globalNavAnchors.mouseover( function() {
			$( this ).addClass( 'active' );
		} );
		$( '#nav > ul > li' ).mouseout( function() {
			$( this ).removeClass( 'active' );
		} );
	} );
}() );

/*
( function popup() {
	$( document ).ready( function() {
		$("a[rel='popup']").click(function () { 
      		var features = 'height=558,width=607,status=1,resizable=1';
      		newwindow=window.open(this.href, 'Player Popup', features); 		
      		return false; 
 		});
	} );
}() );
*/
( function popup() {
	$( document ).ready( function () {
		var newwindow = '';
		$( '.popup' ).click( function() {
			var target = $( this ).attr( 'href' );
				if (!newwindow.closed && newwindow.location) {
				newwindow.location.href = target;
			}
			else {
				newwindow=window.open(target,'name','height=558,width=607,status=1,resizable=1');
				if (!newwindow.opener) newwindow.opener = self;
			}
			if (window.focus) {newwindow.focus()}
			return false;
		} );
	} );
}() );


( function userForms() {
	$( document ).ready( function() {
		$('div.detailForm fieldset').hide();
		$('div.detailForm fieldset.active').show();
		
		$('div.detailForm a.togglePanel').click( function() {
			var currentPanel = $( this ).attr('rel');
			if ($('div.detailForm fieldset.'+currentPanel).hasClass('active')) {
				return false;
			} else {
				$('div.detailForm fieldset').hide().removeClass('active');
				$('div.detailForm fieldset.'+currentPanel).addClass('active').fadeIn();
				return false;
			}
		});
		
		$("input[class^='toggle-']").click( function() {
			var togglePanel = $( this ).attr('class');
			$('div.detailForm fieldset.'+togglePanel).toggle();
		});
	} );
}() );

( function schedule() {
	$( document ).ready( function() {
		if ( $('div.schedule').length > 0 ) {
			var my_day= new Date()
			var day_name = new Array( 'sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday');
			
			$( '.schedulewrapper .day').hide();
			$( "div#Navigationtabs > ul > li > a[href='#"+day_name[my_day.getDay()]+"']").addClass('defaulttabs');
			$('#'+day_name[my_day.getDay()]).show();
			
			$( '#Navigationtabs a' ).click( function() {
				$( '.schedulewrapper .day').hide();
				$( $( this ).attr('href') ).show();
				$( '#Navigationtabs a' ).removeClass('defaulttabs');
				$( this ).addClass('defaulttabs');
				return false;
			});
		}
	} );
}() );











