﻿ Event.observe(window, 'load', function() {
	Event.observe('mw_podcast_itunes', 'click', function(e) {Event.stop(e); mw_podcast.Itunes();});
	Event.observe('mw_podcast_zune', 'click', function(e) {Event.stop(e); mw_podcast.Zune();});
	Event.observe('mw_podcast_tversity', 'click', function(e) {Event.stop(e); mw_podcast.Tversity();});
	Event.observe('mw_podcast_rss', 'click', function(e) {Event.stop(e); mw_podcast.Rss();});
	
	    
	if ($('mw_download_itunes') != null)
	    Event.observe('mw_download_itunes', 'click', function(e) {Event.stop(e); mw_download.Itunes();});
	   
	if ($('mw_download_zune') != null)
	    Event.observe('mw_download_zune', 'click', function(e) {Event.stop(e); mw_download.Zune();});
	
	if ($('mw_download_xbox') != null)
	    Event.observe('mw_download_xbox', 'click', function(e) {Event.stop(e); mw_download.Xbox();});
	
	if ($('mw_download_amazon') != null)
	    Event.observe('mw_download_amazon', 'click', function(e) {Event.stop(e); mw_download.Amazon();});	
	    
	if ($('mw_download_psn') != null)
	    Event.observe('mw_download_psn', 'click', function(e) {Event.stop(e); mw_download.Psn();});
	}
);
	
mw_podcast =  {
	Itunes: function () {
		mw_podcast.Nav('mw_podcast_itunes');
		mw_podcast.Content('mw_podcast_content_itunes');
		},
	Zune: function () {
		mw_podcast.Nav('mw_podcast_zune');
		mw_podcast.Content('mw_podcast_content_zune');
		},
	Tversity: function () {
		mw_podcast.Nav('mw_podcast_tversity');
		mw_podcast.Content('mw_podcast_content_tversity');
		},
	Rss: function () {
		mw_podcast.Nav('mw_podcast_rss');
		mw_podcast.Content('mw_podcast_content_rss');
		},
	Nav: function (selectedNav) {
		var mw_Array = $$('#mw_podcast_nav li');
		mw_Array.each(function(mw_Array){mw_Array.removeClassName('selected');});
		$(selectedNav).addClassName('selected');
		},
	Content: function (selectedContent) {
		var mw_content_Array = $$('#mw_podcast_content li');
		mw_content_Array.each(function(mw_content_Array){mw_content_Array.hide()});
		$(selectedContent).show();
		}
	}



mw_download =  {
	Itunes: function () {
		mw_download.Nav('mw_download_itunes');
		mw_download.Content('mw_download_content_itunes');
		},
	Zune: function () {
		mw_download.Nav('mw_download_zune');
		mw_download.Content('mw_download_content_zune');
		},
	Xbox: function () {
		mw_download.Nav('mw_download_xbox');
		mw_download.Content('mw_download_content_xbox');
		},
	Amazon: function () {
		mw_download.Nav('mw_download_amazon');
		mw_download.Content('mw_download_content_amazon');
		},
	Psn: function () {
		mw_download.Nav('mw_download_psn');
		mw_download.Content('mw_download_content_psn');
		},		
	Nav: function (selectedNav) {
		var mw_Array = $$('#mw_download_nav li');
		mw_Array.each(function(mw_Array){mw_Array.removeClassName('selected');});
		$(selectedNav).addClassName('selected');
		},
	Content: function (selectedContent) {
		var mw_content_Array = $$('#mw_download_content li');
		mw_content_Array.each(function(mw_content_Array){mw_content_Array.hide()});
		$(selectedContent).show();
		}
	}


arrLinks = new Array();
arrLinks[0] = "lnkMWRss";
arrLinks[1] = "lnkMWpodcast";
arrLinks[2] = "lnkMWmobile";
arrLinks[3] = "lnkMWvod";
arrLinks[4] = "lnkMWdownload";
arrLinks[5] = "lnkMWnews";


	
function showHide(parentID, open, close1, close2, close3, close4, close5)
{
    objDiv = document.getElementById(parentID);
	if ($(open).style.display == 'none') 
	{
	    for (iii=0; iii<arrLinks.length; iii++)
        {
            if(arrLinks[iii] != parentID)
            {
                document.getElementById(arrLinks[iii]).className =  document.getElementById(arrLinks[iii]).className.replace(" menu_on", "");
            }
        }
	    objDiv.className =  objDiv.className + " menu_on";
		new Effect.BlindDown($(open), {duration: .3});
		new Effect.BlindUp($(close1), {duration: .3});
		new Effect.BlindUp($(close2), {duration: .3});	
		new Effect.BlindUp($(close3), {duration: .3});
		new Effect.BlindUp($(close4), {duration: .3});	
		new Effect.BlindUp($(close5), {duration: .3});
	} 
	else 
	{
	    objDiv.className =  objDiv.className.replace(" menu_on", "");
		new Effect.BlindUp($(open), {duration: .3});
	}
}