function show(nav){
	restore();
    document.getElementById(nav).style.display="block";
}
function restore(){
	var menus = document.getElementById("navLevel2").getElementsByTagName("ul");
	var num_menus = menus.length;
	for (i = 0; i < num_menus; i++) {
		if (menus[i].style.display == "block") menus[i].style.display = "none";
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function NewWindow(mypage, myname, w, h, scroll) {

var winl = (screen.width - w) / 2;

var wint = (screen.height - h) / 2;

winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable';

win = open(mypage, myname, winprops);

if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }

if (win.opener == null) win.opener = self;

}


function topmenu (mn) {
	var menuname = new Array();
	menuname['news'] = new Array (
				new Array ("Local&nbsp;&amp;&nbsp;Global", "World&nbsp;&amp;&nbsp;National", "NPR&nbsp;News", "Specials"),
				new Array ("/news.php", "/news/newspecial.html", "http://publicbroadcasting.net/ncpr/news", "/news/nprnews.php")
				);
	menuname['prog'] = new Array (
				new Array ("Programs&nbsp;Overview", "Local", "National", "Complete&nbsp;Schedule", "Web-Only"),
				new Array ("/programs.html", "/programs/localpro.html", "/programs/nationpro.html", "/programs/grid.html", "/programs/webonly.html")
				);
	menuname['wthr'] = new Array (
				new Array ("Current&nbsp;Conditions", "Weather&nbsp;by&nbsp;Zip&nbsp;or&nbsp;City", "Weather&nbsp;Links"),
				new Array ("/weather.html", "http://www.publicbroadcasting.net/ncpr/news.newsmain?action=weather", "http://www.northcountrypublicradio.org/weather.html#weatherlinks")
				);
	menuname['memb'] = new Array (
				new Array ("Membership", "Underwriting", "Underwriters", "Sweethearts", "Endowment", "Volunteer", "Public&nbsp;Store", "Pledge&nbsp;Online"),
				new Array ("/support/membership.html", "/support/under1.htm", "/support/underw.htm", "/support/sweethearts.html", "/support/endowment.html", "/support/volunteer.html", "http://publicbroadcasting.net/ncpr/store", "https://www.safepage.com/ncpr")
				);
	menuname['cont'] = new Array (
				new Array ("Staff&nbsp;Email", "Comments", "Newsletter"),
				new Array ("/contact/email.html", "/contact.html", "/contact/newsletter.html")
				);
	menuname['arts'] = new Array (
				new Array ("Arts&nbsp;@&nbsp;NCPR", "Concert&nbsp;Hall", "Gallery", "Reviews", "Public&nbsp;Arts"),
				new Array ("/arts.html", "/arts/concert.html", "/arts/gallery.html", "/arts/reviews.html", "http://publicbroadcasting.net/ncpr/arts")
				);
	menuname['cldr'] = new Array (
				new Array ("Special&nbsp;Events", "Community&nbsp;Calendar", "New@NCPR"),
				new Array ("/events/specevents.html", "/upnorth/comcalendar.html", "/events/newatncpr.html")
				);
	menuname['svcs'] = new Array (
				new Array ("Reading&nbsp;Service", "Production&nbsp;Studio"),
				new Array ("/services/reading.html", "/services/production.html")
				);
	menuname['ncpr'] = new Array (
				new Array ("Staff", "Coverage&nbsp;Map", "Awards", "Station&nbsp;History", "Future&nbsp;Vision"),
				new Array ("/about/staff.html", "/about/coverage.html", "/about/awards.html", "/about/history.html", "/about/future.html")
				);
	menuname['unth'] = new Array (
				new Array ("UpNorth&nbsp;Home", "Calendar", "Gallery", "Concert&nbsp;Hall", "Links", "Meet&nbsp;the&nbsp;Masters"),
				new Array ("/upnorth.html", "/upnorth/comcalendar.html", "/arts/gallery.html", "/arts/concert.html", "/upnorth/links.html", "/upnorth/masters/masters.html")
				);
	var i=0;
	do {
		if (i>0) document.write (" | ");
		document.write ("<a class='topmenu' href='" + menuname[mn][1][i] + "'>" + menuname[mn][0][i] + "</a>");
		i = i + 1;
	} while (menuname[mn][0][i]);
}

function newWindow(file,window,options) {
    msgWindow=open(file,window,options);
    if (msgWindow.opener == null) msgWindow.opener = self;
}

function xmlhttpPost(v,str,strURL,destid) {
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            document.getElementById(destid).innerHTML = (self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(v + '=' + str);
}

// NPR Localize Variable Definitions

window.station="WSLU_FM"; // our ID
window.localize=true; // do we want our stuff localized?
window.thumbnail=true;
window.categories = "top"; // Default display as defined here is "Top Stories From NPR" - other options include: "top,us,world,business,health,arts"
window.newscasts = "true"; // "true"=display NPR Hourly Newscast link; "false"=don't display Hourly Newscast link
window.topstories = "http://www.northcountrypublicradio.org/news/nprnews.php"; // Location of complete NPR News Stories


// ShareThis stuff

function includejs(uri, dynamic) {
    if (dynamic) {
        var head, script;
        if (document.createElement && document.getElementsByTagName
		        && (head = document.getElementsByTagName('head')[0]) && head.appendChild
                && (script = document.createElement('script'))) {
            script.type = 'text/javascript';
            script.src = uri;
            head.appendChild(script);
        } else return false;
    } //else document.write('<script type="text/javascript" src="' + uri + '"><\/script>');
    return true;
}

/*
var ss = document.createElement('script');
ss.type = 'text/javascript';
ss.src = 'http://w.sharethis.com/button/sharethis.js#tabs=web%2Cpost%2Cemail&amp;charset=utf-8&amp;style=default&amp;publisher=3d54a5dd-4782-4777-a5d5-7eaba8f95eb3'; // etc...etc..
document.getElementsByTagName('head')[0].appendChild(ss);
*/

var uri;
uri = 'http://w.sharethis.com/button/sharethis.js#tabs=email%2Cweb%2Cpost&amp;charset=utf-8&amp;services=reddit%2Cdigg%2Cfacebook%2Cmyspace%2Cdelicious%2Cstumbleupon%2Ctechnorati%2Cgoogle_bmarks%2Cyahoo_bmarks%2Cyahoo_myweb%2Cwindows_live%2Clinkedin%2Cmixx%2Cyahoo_buzz&amp;style=default&amp;publisher=3d54a5dd-4782-4777-a5d5-7eaba8f95eb3';
document.write('<script type="text/javascript" src="' + uri + '"><\/script>');
uri = 'http://www.northcountrypublicradio.org/javascript/swfobject.js';
document.write('<script type="text/javascript" src="' + uri + '"><\/script>');