var navOpen = false;
var url=location.pathname;
var path;
var index=0;
if((url.indexOf('articles') != -1) || (url.indexOf('gift_store') != -1))
		path = "../../media/";
else if((url.indexOf('museum') != -1) || (url.indexOf('Pictures') != -1)  || (url.indexOf('pictures') != -1)  || (url.indexOf('trivia') != -1)  || (url.indexOf('education') != -1) || (url.indexOf('BerlinChapter') != -1) || (url.indexOf('MidwestChapter') != -1) || (url.indexOf('bcmt') != -1) || (url.indexOf('media') != -1) || (url.indexOf('1956') != -1) || (url.indexOf('praguespring') != -1) || (url.indexOf('contributions') != -1) || (url.indexOf('other') != -1))
        path = "../media/";
else {
        path = "media/";
        index=1;
}

if(document.images) {
        if(index == 1) {
                online_exhibits_off = new Image();
                online_exhibits_off.src = path + "online_exhibits_off.gif";
                gift_store_off = new Image();
                gift_store_off.src = path + "gift_store_off.gif";
                contributions_store_off = new Image();
                contributions_store_off.src = path + "contributions_store_off.gif";
                smithsonian_affiliation_off = new Image();
                smithsonian_affiliation_off.src = path + "smithsonian_affiliation_off.gif";
                educational_programs_off = new Image();
                educational_programs_off.src = path + "educational_programs_off.gif";
                congressional_testimony_off = new Image();
                congressional_testimony_off.src = path + "congressional_testimony_off.gif";
                museum_chapters_off = new Image();
                museum_chapters_off.src = path + "museum_chapters_off.gif";
                coldwar_times_off = new Image();
                coldwar_times_off.src = path + "coldwar_times_off.gif";
                online_exhibits_on = new Image();
                online_exhibits_on.src = path + "online_exhibits_on.gif";
                gift_store_on = new Image();
                gift_store_on.src = path + "gift_store_on.gif";
                contributions_store_on = new Image();
                contributions_store_on.src = path + "contributions_store_on.gif";
                smithsonian_affiliation_on = new Image();
                smithsonian_affiliation_on.src = path + "smithsonian_affiliation_on.gif";
                educational_programs_on = new Image();
                educational_programs_on.src = path + "educational_programs_on.gif";
                congressional_testimony_on = new Image();
                congressional_testimony_on.src = path + "congressional_testimony_on.gif";
                museum_chapters_on = new Image();
                museum_chapters_on.src = path + "museum_chapters_on.gif";
                coldwar_times_on = new Image();
                coldwar_times_on.src = path + "coldwar_times_on.gif";
        }
        other_off = new Image();
        other_off.src = path + "other_off.gif";
        other_on = new Image();
        other_on.src = path + "other_on.gif";

        the40s_off = new Image();
        the40s_off.src = path + "the40s_off.gif";
        the40s_on = new Image();
        the40s_on.src = path + "the40s_on.gif";

        the50s_off = new Image();
        the50s_off.src = path + "the50s_off.gif";
        the50s_on = new Image();
        the50s_on.src = path + "the50s_on.gif";

        the60s_off = new Image();
        the60s_off.src = path + "the60s_off.gif";
        the60s_on = new Image();
        the60s_on.src = path + "the60s_on.gif";

        the70s_off = new Image();
        the70s_off.src = path + "the70s_off.gif";
        the70s_on = new Image();
        the70s_on.src = path + "the70s_on.gif";

        the80s_off = new Image();
        the80s_off.src = path + "the80s_off.gif";
        the80s_on = new Image();
        the80s_on.src = path + "the80s_on.gif";

        the90s_off = new Image();
        the90s_off.src = path + "the90s_off.gif";
        the90s_on = new Image();
        the90s_on.src = path + "the90s_on.gif";
		
		buy_off = new Image();
		buy_off.src = path + "buy_off.gif";
		buy_on = new Image();
		buy_on.src = path + "buy_on.gif";
		
        function IOn(imgName,type) {
                document[imgName].src = eval(imgName + "_on.src");
        }
        function IOff(imgName,type) {
                document[imgName].src = eval(imgName + "_off.src");
        }
}

var navOpen = false;


function showNav2(inSection){
	
	if (document.getElementById(inSection + 'nav2').style.display == 'inline')
	{
	document.getElementById(inSection + 'nav2').style.display = 'none'
	document.getElementById(inSection + 'img').src = '/media/plus.gif'
	document.cookie = inSection + '=noshow; path=/;'
	}
	else
	{
	document.getElementById(inSection + 'nav2').style.display = 'inline'
	document.getElementById(inSection + 'img').src = '/media/minus.gif'
	document.cookie = inSection + '=' + escape(inSection) +'; path=/;'
	}
}

function closeNav(inSection){
	var img = document.getElementById(inSection);
	var sect = document.getElementById(inSection + 'nav');
	
	if (!navOpen){
		if (sect.style.visibility == 'visible')
		{
		img.src = img.src.slice(0,img.src.length-7) + '.gif';
		}
		sect.style.visibility = 'hidden';	
	}
}

function ReadCookie(cookieName) {
 var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

