$(document).ready(function(){
//Load Flash Header//	
	$('#flash-holder').flash({
		swf: '/header.swf',
		height: 223,
		width: 1024,
		hasVersion: 8, 
		expressInstaller: '/expressInstall.swf',
		params: { 
		wmode: 'transparent'
		} 
	});
//Drop Down Menu Script//
	$("#navigation ul").superfish({
      	delay:       100,                            // one second delay on mouseout 
      	animation:   {height:'show'}, 				// slide-down animation 
      	speed:       'fast',                          // faster animation speed 
      	autoArrows:  false,                           // disable generation of arrow mark-up 
      	dropShadows: false                            // disable drop shadows 
	});
//Set Menu On State//
	var url = location.pathname.substring(1);
		var path = url.split("/");
		path.shift();
		if(path.length>1){
			path.pop();
			path='/'+path.join('/')+'/';
		}
		else path=path[0];

		if ( path ) {
			$('#navigation li a[href*="' + path + '"]').addClass('selected');
		} else if (url) {
			$('#navigation li a[href*="' + url + '"]').addClass('selected');
		} else {
			$('.n-home a').addClass('selected');
		}
	
//Featured News//	
	$('#fade').innerfade({
		speed: 'slow',
		timeout: 8000,
		type: 'sequence',
		containerheight: '348px'
	});
//Latest Stories Tab Menu Script//
	$(".latest-stories .nav").idTabs();
//Contents Tab Menu Script//
	$(".content-tabs .nav").idTabs();
//Press Releases Script//
	$(".item-holder").each(function(i){
		$(this)
			.click(function() {window.location = $(this).find("h2:first a:first").attr("href");})
			.hover(
				  function() {$(this).addClass("item-holder-hover").append('<div class="item-holder-readmore">Read More</div>');},
				  function() {$(this).removeClass("item-holder-hover").find(".item-holder-readmore").remove();}
			);
		if (i % 2 == 0) $(this).addClass("item-holder-bgcolor");
	});
//Press Releases Script//
	$(".fanzone-holder").each(function(i){
		href=$(this).find("h2:first a:first").attr("href"); 
		$(this)
			.click(function() {if(href!==undefined)window.location = $(this).find("h2:first a:first").attr("href");})
			.hover(
				  function() {$(this).addClass("fanzone-holder-hover").append('<div class="fanzone-holder-readmore">Listen</div>');},
				  function() {$(this).removeClass("fanzone-holder-hover").find(".fanzone-holder-readmore").remove();}
			);
		if (i % 2 == 0) $(this).addClass("fanzone-holder-bgcolor");
	});
		
	
	
	
	
//Latest Stories Script//	
	$('.latest-stories-list > li > a').each(function(i){
		if (i % 2 == 0) $(this).addClass("stories-bgcolor");
		$(this).hover(
			function(){
			 	$(this)
				.addClass("stories-hover")
			},
			function(){
				$(this)
				.removeClass("stories-hover")
			}
		);
	});
	
//Team Holder Script//
	$(".team-holder").click(function() {
  		window.location = $(this).find("h2:first a:first").attr("href");
	});

//Store Holder Script//
	$(".store-holder").click(function() {
  		window.location = $(this).find("h2:first a:first").attr("href");
	});

});

/* LightBox Script
--------------------------------------------------------------------------------------- */
$(function() {
  $('a[rel*="gallery"]').lightBox({
  	overlayBgColor:	'#000000',
	overlayOpacity:	0.8,
	imageLoading:	'/images/lightbox/lightbox-ico-loading.gif',
	imageBtnClose:	'/images/lightbox/lightbox-btn-close.gif',
	imageBtnPrev:	'/images/lightbox/lightbox-btn-prev.gif',
	imageBtnNext:	'/images/lightbox/lightbox-btn-next.gif',
	imageBlank:		'/images/lightbox/lightbox-blank.gif',
	containerResizeSpeed: 400,
	txtImage:	'Photo',
	txtOf:		'of',
	keyToClose:	'c',
	keyToPrev:	'p',
	keyToNext:	'n'
   });
});
