// scripts for entire site
$(document).ready(function() {
	// add selected class to current navigation
	/*$(function(){
	 var path = location.pathname.substring(1);
	 if ( path )
	   $('#nav > li > a[href$="' + path + '"]').attr('class', 'selected');
	});	*/				   
	// remove class for css fallback and hide all submenus
	//$('#nav > li > ul.submenu').removeClass('submenu').hide();
	// show submenu of current section
	//$('#nav > li > a.selected').next('ul').show();	
	// show submenus on hover
	/*$('#nav > li').hover(function(){
		if ($(this).children('a').hasClass('selected')) {
			$(this).find('ul').show();
		} else {
			$('#nav > li > a.selected').next('ul').hide();
			$(this).find('ul').fadeIn(300,'swing');
		}									
	}, function(){
		if ($(this).children('a').hasClass('selected')) {
			$(this).find('ul').show();
		} else {
			$(this).find('ul').fadeOut(300,'swing');
			$('#nav > li > a.selected').next('ul').show();
		}*/
		/*$(this).stop().find('ul').fadeOut(300,'swing');
		$('#nav > li > a.selected').next('ul').show();
	});*/
	$('#mainContent').prepend('<div id="toolbar"><a href="javascript:" id="toolbar_print" class="imageReplace">Print</a><a class="a2a_dd floatright imageReplace" href="http://www.addtoany.com/share_save"></a><script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script></div>');
	// print page function
	$('#toolbar_print').click(function(){
		window.print();
		return false;
	});
	// schedule lightbox, normal lightbox
	$(".titleAbbr,.fancy,.a_tooltip").fancybox({
		'titleShow'		: false,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'autoDimensions': 'true',
		'overlayColor': '#000'
	});
	// youtube video lightbox
	$(".youtube").click(function() {
		$.fancybox({
				'padding'		: 0,
				'autoScale'		: false,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none',
				'title'			: this.title,
				'width'		: 680,
				'height'		: 495,
				'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
				'type'			: 'swf',
				'swf'			: {
					 'wmode'		: 'transparent',
					'allowfullscreen'	: 'true'
				}
			});
		return false;
	});
	// iframe lightbox
	$(".iframe").fancybox({
		'width'				: '75%',
		'height'			: '75%',
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	// footer popup
	$('#footerCredit div').hide().removeClass('showHide');
	$('a#footerCredit').hover(function() {
		$(this).children('div').fadeIn();						   
	}, function() {
		$(this).children('div').fadeOut();	
	});
});//doc ready functions
