
/* run when page has loaded */
$(document).ready(function() {

	// toggle audio/video extra stuff
	$(".accordion .toggle").click(function() {
		if ($(this).next('.accordionContent').is(":hidden")) {
			$(this).addClass("expanded");
		    $(this).parent().addClass("acc-expanded");
			$(this).next('.accordionContent').slideDown("fast");
		} else {
			$(this).removeClass("expanded");
		    $(this).next('.accordionContent').slideUp("fast",function(){
				$(this).parent().removeClass("acc-expanded");
		    });
		}
		return false;
	});
	
	// toggle catalog program sections
	$(".accordion .toggle a").click(function() {
		if ($(this).parent().parent().next().next().is(":hidden")) {
			$(".accordion .toggle a").removeClass("expanded");
			$(".accordion .toggle a").html("View Programs");
			$(this).html("Hide Programs");
			$(this).addClass("expanded");
			$(".accordion .accordionContent").slideUp("fast");
			$(this).parents(".toggle").nextAll(".accordionContent").slideDown("fast");
		} else {
			$(this).removeClass("expanded");
			$(this).html("View Programs");
			$(this).parents(".toggle").nextAll(".accordionContent").slideUp("fast");
		}
		return false;
	})	
	
});

function addToFavorites(title, url) {
	var a,
		isIEmac = false;/*@cc_on @if(@_jscript&&!(@_win32||@_win16)&&(@_jscript_version<5.5)) isIEmac=true; @end @*/

	if (window.sidebar) {
		window.sidebar.addPanel(title, url, "");	
	} else if (document.all && !isIEmac) {
		window.external.AddFavorite(url, title);
	} else if (window.opera) {
		a = document.createElement("a");
		a.href = url;
		a.title = title;
		a.rel = "sidebar";
		a.click();
	} else {
		alert("Your browser doesn't support bookmarking.\n\nPlease bookmark this page using your browser's bookmark menu."); 
	}
}


