
$(function(){	
//$('#podContainer .showHide').css('background','url(/images_global/icon_plus.gif) left 2px no-repeat').css('padding-left','16px').css('outline','none' );

var windowLoc = "";
var firstPos = window.location.hash; 
if (firstPos) {
		windowLoc = '#podContainer ' + firstPos;
}
if (windowLoc != "") {
	if (window.location.pathname != "/media/podcasts_category.cfm") {
	$('#podContainer #currentPod').attr('id','');
	$(windowLoc).parent().parent().attr('id','currentPod').end().parents('ul').removeClass('hide').end().parent().parent().parent().find('a.showHide').css('background','url(/images_global/icon_minus.gif) left 2px no-repeat').end().parent().parent().parent().parent().parent().find('a.showHide:first').css('background','url(/images_global/icon_minus.gif) left 2px no-repeat');
	$.scrollTo(windowLoc);
	} else if (window.location.pathname == "/media/podcasts_category.cfm") {
	$(windowLoc).css('background','url(/images_global/icon_minus.gif) left 2px no-repeat').parent().next().attr('id','currentPod').removeClass('hide');
	}
}


// targets the next sibling of the parent of the clicked "showHide" object and hides/shows it
$('.showHide').click(function() {
	if (jQuery.browser.msie && parseInt(jQuery.browser.version) == "6" && $(this).parent().parent().parent().attr('id') == 'currentPod') {
		return false;
	}
	if ($(this).parent().next().css('display') == 'none') {
		$(this).css('background','url(/images_global/icon_minus.gif) left 2px no-repeat');
		$(this).parent().next().fadeIn("");
	} else {
		$(this).css('background','url(/images_global/icon_plus.gif) left 2px no-repeat');
		$(this).parent().next().fadeOut("");
	}
	return false;
	});
/*
$('#podContainer li h2').click(function() {
	$('#podContainer li#currentPod').removeAttr('id');
	$(this).parent().attr('id','currentPod');
	return false;
});

if (jQuery.browser.msie && parseInt(jQuery.browser.version) == "6") {
  $('#podContainer .learnMore ul').show();
  $('#podContainer .learnMore a.showHide').css('background','none');
}*/

$('#podNav li').click(function() {
	$('#podContainer').html('<ul class="infocont"><li><h2>Loading...</h2></li></ul>');
	$(this).siblings().removeClass('currentnav');
	$(this).addClass('currentnav');
	if ($(this).children().hasClass('showhelp')) {
		$('#podContainer').html('<ul class="infocont"><li><h2>Help</h2><p><h3>What are podcasts?</h3><p>Podcasts are like radio programs you listen to at your computer or on an mp3 player. You can download a podcast and listen to it anytime you like. Subscribe to our weekly podcast with <a href="http://www.apple.com/itunes/" target="_blank">iTunes,</a> a <a href="http://www.google.com/search?q=podcast+reader" target="_blank">podcast feed application</a>, or listen each week from our podcast page. We offer three versions of our podcast: one that\'s audio-only, one that includes a slideshow, and a video podcast.</p><h3>How do I listen to a podcast?</h3><p>You can listen to podcasts at your computer with a media player such as <a href="http://www.apple.com/itunes/" target="_blank">iTunes</a>, <a href="http://www.quicktime.com" target="_blank">Quicktime</a>, or <a href="http://www.microsoft.com/windows/products/winfamily/mediaplayer/default.mspx" target="_blank">Windows Media Player.</a> You can also listen on your mp3 player.</p><h3>How do I watch a video or enhanced podcast?</h3><p>Depending on how you set your browser\'s preferences, the enhanced or video podcasts may either save to your desktop or begin playing in a browser window. For best performance, we recommend that you use the most recent versions of your browser and the <a href="http://www.quicktime.com" target="_blank">Quicktime</a> player. </p><h3>How do I subscribe to podcasts?</h3><p>If you want to be notified each time a new podcast is posted, you can subscribe to our RSS feed. RSS stands for "Really Simple Syndication." Your <a href="http://www.google.com/search?q=rss+reader" target="_blank">RSS reader</a> will show you when a new item is added.</p><p>After downloading and installing an RSS reader, you can add our feed by clicking on one of the RSS buttons (<img src="/images_global/icon_rss.png" alt="rss icon" width="10" height="10" class="inline">) below. The URL shown in your browser is what you copy and paste to add the feed to your news reader.</p><p>You can also subscribe to the podcast through <a href="http://www.apple.com/itunes/" target="_blank">iTunes</a>, where each week\'s program can be automatically downloaded to your podcast library. Listen at your computer or on an mp3 player.</a><p>To subscribe to our <strong>audio podcasts</strong> (MP3), paste this url into your podcast software or RSS reader: <br /><a href="http://www.history.org/media/rssfeeds_cw.xml"><em class="rssfeed">http://www.history.org/media/rssfeeds_cw.xml</em></a></p><p>To subscribe to our <strong>image enhanced podcasts</strong> (AAC), paste this url into your podcast software: <br /><a href="http://www.history.org/media/rssfeeds_cw_enhanced.xml"><em class="rssfeed">http://www.history.org/media/rssfeeds_cw_enhanced.xml</em></a></p><p>To subscribe to our<strong> video podcasts</strong> (MP4), paste this url into your podcast software: <br /><a href="http://www.history.org/media/rssfeeds_cw_video.xml"><em class="rssfeed">http://www.history.org/media/rssfeeds_cw_video.xml</em></a></p></li></ul>');
	return false;
	} else if ($(this).children().hasClass('showabout')) {
		$('#podContainer').html('<ul class="infocont"><li><h2>About</h2><p>These audio files feature special interviews and photos available only to our Web users. Listen to standard mp3 files, image enhanced podcasts, and video podcasts on your computer or MP3 player. (<a href="http://www.apple.com/quicktime/" target="_blank">Quicktime</a> or <a href="http://www.microsoft.com/windows/windowsmedia/download/AllDownloads.aspx?displang=en&qstechnology=" target="_blank">Windows Media Player</a> are recommended)</p><p>Lloyd Dobyns, a former TV correspondent, is your host as you go "behind the scenes" to meet interpreters, chefs, tradesmen, musicians, historians, curators, and more.</p><p><br /><img src="/images_global/awards/WA_2009.jpg" alt="2009 Web Award" width="100" height="89" class="inline" /><a href="http://www.webaward.org/" target="_blank"><img src="/images_global/awards/WA_2008.gif" alt="Web Award 2008" width="100" height="89" class="inline"></a><a href="http://www.webaward.org/" target="_blank"><img src="/history/museums/images/WebAward_2007.jpg" alt="Web Award 2007" width="100" height="89" class="inline"></a><br /><img src="/images_global/awards/interactive_gold_15.gif" alt="Communicator Award" width="90" height="90" class="inline">&nbsp;<img src="/images_global/awards/w3winner_silver_wht.jpg" alt="W3 Silver Award" width="90" height="90" class="inline">&nbsp;<img src="images/interactive_silver.jpg" alt="Interactive Silver Award" width="90" height="90"  class="inline">&nbsp;</p></li></ul>');
	return false;
	}
});
	
	
});