var navArray = new Array(8);
var Features=0;
var Departments=1;
var Multimedia=2;
var OnlineExtras=3;
var Forums=4;
var FunStuff=5;
var Archives=6;
var Subscribe=7;
var Home=8;
var NGMCurrentLocation = 0;
navArray[0] = '%3Ctable%20id%3D%22yellowNav%22%20cellpadding%3D%220%22%20cellspacing%3D%220%22%20border%3D%220%22%3E%3Ctbody%3E%3Ctr%3E%3Ctd%20id%3D%22yellowNavFeatures%22%20valign%3D%22middle%22%20height%3D%2227%22%3E%3Ca%20href%3D%22/ngm/0509/feature1/index.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EViews%20of%20Africa%3C/a%3E%3Ca%20href%3D%22/ngm/0509/feature2/index.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3ENairobi%3C/a%3E%3Ca%20href%3D%22/ngm/0509/feature3/index.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EChad%20Oil%20Boon%3C/a%3E%3Ca%20href%3D%22/ngm/0509/feature4/index.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3ELiving%20With%20AIDS%3C/a%3E%3Ca%20href%3D%22/ngm/0509/feature5/index.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EMbuti%20Pygmies%3C/a%3E%3Ca%20href%3D%22/ngm/0509/feature6/index.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EReturn%20to%20Zambia%3C/a%3E%3Ca%20href%3D%22/ngm/0509/feature7/index.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3ESpirit%20of%20the%20Wild%3C/a%3E%3C/td%3E%3C/tr%3E%3C/tbody%3E%3C/table%3E';
navArray[1] = '%3Ctable%20id%3D%22yellowNav%22%20cellpadding%3D%220%22%20cellspacing%3D%220%22%20border%3D%220%22%3E%3Ctbody%3E%3Ctr%3E%3Ctd%20id%3D%22yellowNavDepartments%22%20valign%3D%22middle%22%20height%3D%2227%22%3E%3Ca%20href%3D%22/ngm/0509/flashback.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EFlashback%3C/a%3E%3Ca%20href%3D%22/ngm/0509/resources_geo.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EGeographica%3A%20Free%20Speech%3C/a%3E%3Ca%20href%3D%22/ngm/0509/resources_geo2.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EGeographica%3A%20The%20Shape%20of%20Africa%3C/a%3E%3Ca%20href%3D%22/ngm/0509/resources_who.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EWho%20Knew%3F%3C/a%3E%3C/td%3E%3C/tr%3E%3C/tbody%3E%3C/table%3E';
navArray[2] = '%3Ctable%20id%3D%22yellowNav%22%20cellpadding%3D%220%22%20cellspacing%3D%220%22%20border%3D%220%22%3E%3Ctbody%3E%3Ctr%3E%3Ctd%20id%3D%22yellowNavMultimedia%22%20valign%3D%22middle%22%20height%3D%2227%22%3E%3Ca%20href%3D%22/ngm/0509/sights_n_sounds/index.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EZambia%3C/a%3E%3Ca%20href%3D%22/ngm/0509/feature1/multimedia2.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EAerial%20Africa%3C/a%3E%3Ca%20href%3D%22/ngm/0509/feature1/multimedia1.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EMegaflyover%3C/a%3E%3Ca%20href%3D%22/ngm/0509/feature2/multimedia1.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EStreets%20of%20Kenya%3C/a%3E%3Ca%20href%3D%22/ngm/0509/feature2/multimedia2.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EMy%20Nairobi%3C/a%3E%3Ca%20href%3D%22/ngm/0509/feature2/multimedia3.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EEarth%20Mother%3C/a%3E%3Ca%20href%3D%22/ngm/0509/feature4/multimedia.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EAIDS%3C/a%3E%3Ca%20href%3D%22/ngm/0509/feature5/multimedia.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EPygmies%3C/a%3E%3Ca%20href%3D%22/ngm/0509/editor.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EWhy%20Africa%3F%3C/a%3E%3C/td%3E%3C/tr%3E%3C/tbody%3E%3C/table%3E';
navArray[3] = '%3Ctable%20id%3D%22yellowNav%22%20cellpadding%3D%220%22%20cellspacing%3D%220%22%20border%3D%220%22%3E%3Ctbody%3E%3Ctr%3E%3Ctd%20id%3D%22yellowNavOnlineExtras%22%20valign%3D%22middle%22%20height%3D%2227%22%3E%3Ca%20href%3D%22/ngm/0509/online_extra.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EMake%20a%20Difference%3C/a%3E%3Ca%20href%3D%22/ngm/0509/feature1/zoomify/index.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EHuman%20Footprint%3C/a%3E%3Ca%20href%3D%22/ngm/0509/quiz/index.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EAfrica%20Quiz%3C/a%3E%3Ca%20href%3D%22/ngm/0509/editor.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EWhy%20We%20Chose%20Africa%3C/a%3E%3Ca%20href%3D%22/ngm/megaflyover/%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EAfrica%20Megaflyover%3C/a%3E%3Ca%20href%3D%22/ngm/africaarchive/index.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EAfrica%20Map%20and%20Archive%3C/a%3E%3C/td%3E%3C/tr%3E%3C/tbody%3E%3C/table%3E';
navArray[4] = '%3Ctable%20id%3D%22yellowNav%22%20cellpadding%3D%220%22%20cellspacing%3D%220%22%20border%3D%220%22%3E%3Ctbody%3E%3Ctr%3E%3Ctd%20id%3D%22yellowNavForums%22%20valign%3D%22middle%22%20height%3D%2227%22%3E%3Ca%20href%3D%22%23%22%20class%3D%22yellowNav%22%20onClick%3D%22return%20PopWindow%28%27/ngm/0509/forum_pop.html%27%2C%20450%2C%20415%2C%20%27no%27%29%22%3EThe%20Shape%20of%20Africa%3C/a%3E%3Ca%20href%3D%22%23%22%20class%3D%22yellowNav%22%20onClick%3D%22return%20PopWindow%28%27/ngm/0509/feature1/forum_pop.html%27%2C%20450%2C%20415%2C%20%27no%27%29%22%3EViews%20of%20Africa%3C/a%3E%3Ca%20href%3D%22%23%22%20class%3D%22yellowNav%22%20onClick%3D%22return%20PopWindow%28%27/ngm/0509/feature3/forum_pop.html%27%2C%20450%2C%20415%2C%20%27no%27%29%22%3EChad%20Oil%20Boon%3C/a%3E%3Ca%20href%3D%22%23%22%20class%3D%22yellowNav%22%20onClick%3D%22return%20PopWindow%28%27/ngm/0509/feature4/forum_pop.html%27%2C%20450%2C%20415%2C%20%27no%27%29%22%3ELiving%20With%20AIDS%3C/a%3E%3Ca%20href%3D%22%23%22%20class%3D%22yellowNav%22%20onClick%3D%22return%20PopWindow%28%27/ngm/0509/feature5/forum_pop.html%27%2C%20450%2C%20415%2C%20%27no%27%29%22%3EMbuti%20Pygmies%3C/a%3E%3Ca%20href%3D%22%23%22%20class%3D%22yellowNav%22%20onClick%3D%22return%20PopWindow%28%27/ngm/0509/feature6/forum_pop.html%27%2C%20450%2C%20415%2C%20%27no%27%29%22%3EReturn%20to%20Zambia%3C/a%3E%3C/td%3E%3C/tr%3E%3C/tbody%3E%3C/table%3E';
navArray[5] = '%3Ctable%20id%3D%22yellowNav%22%20cellpadding%3D%220%22%20cellspacing%3D%220%22%20border%3D%220%22%3E%3Ctbody%3E%3Ctr%3E%3Ctd%20id%3D%22yellowNavFunStuff%22%20valign%3D%22middle%22%20height%3D%2227%22%3E%3Ca%20href%3D%22/ngm/wallpaper2.tmpl%3Fissue_id%3D20050901%22%20class%3D%22yellowNav%22%20onClick%3D%22undefined%22%3EWallpaper%3C/a%3E%3Ca%20href%3D%22/ngm/postcard2.tmpl%3Fissue_id%3D20050901%26postcard_index%3D1%22%20class%3D%22yellowNav%22%20onClick%3D%22undefined%22%3EPostcards%3C/a%3E%3Ca%20href%3D%22/ngm/match2.tmpl%3Fissue_id%3D20050901%22%20class%3D%22yellowNav%22%20onClick%3D%22undefined%22%3EMatch%20Wits%3C/a%3E%3Ca%20href%3D%22%23%22%20class%3D%22yellowNav%22%20onClick%3D%22return%20PopWindow%28%27/ngm/0509/poll.html%27%2C%20455%2C%20305%2C%20%27no%27%29%22%3EPoll%3C/a%3E%3Ca%20href%3D%22/ngm/wildcamafrica/wildcam.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3ELive%20Webcam%3C/a%3E%3Ca%20href%3D%22/ngm/0509/quiz/index.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EInteractive%20Quiz%3C/a%3E%3C/td%3E%3C/tr%3E%3C/tbody%3E%3C/table%3E';
navArray[6] = '%3Ctable%20id%3D%22yellowNav%22%20cellpadding%3D%220%22%20cellspacing%3D%220%22%20border%3D%220%22%3E%3Ctbody%3E%3Ctr%3E%3Ctd%20id%3D%22yellowNavArchives%22%20valign%3D%22middle%22%20height%3D%2227%22%3E%3Ca%20href%3D%22/ngm/archives.html%22%20class%3D%22yellowNav%22%20onClick%3D%22undefined%22%3EMagazine%20Archive%3C/a%3E%3Ca%20href%3D%22%23%22%20class%3D%22yellowNav%22%20onClick%3D%22return%20PopWindowToolbar%28%20%27/publications/explore.html%27%2C%20800%2C%20600%2C%20%27auto%27%20%29%22%3ESociety%20Publications%20Index%3C/a%3E%3Ca%20href%3D%22/ngm/best/%22%20class%3D%22yellowNav%22%20onClick%3D%22return%20PopWindowToolbar%28%20%27/ngm/best%27%2C%20800%2C%20600%2C%20%27auto%27%20%29%22%3ECollector%27s%20Editions%3C/a%3E%3Ca%20href%3D%22%23%22%20class%3D%22yellowNav%22%20onClick%3D%22return%20PopWindowToolbar%28%20%27http%3A//stylemanual.nationalgeographic.com%27%2C%20800%2C%20600%2C%20%27auto%27%20%29%22%3EStyle%20Manual%3C/a%3E%3Ca%20href%3D%22/ngm/africaarchive/index.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EAfrica%20Archive%3C/a%3E%3Ca%20href%3D%22/ngm/inthenews/index.html%22%20class%3D%22yellowNav%22%20onClick%3D%22%22%3EHot%20Topics%3C/a%3E%3C/td%3E%3C/tr%3E%3C/tbody%3E%3C/table%3E';
navArray[7] = '%3Ctable%20id%3D%22yellowNav%22%20cellpadding%3D%220%22%20cellspacing%3D%220%22%20border%3D%220%22%3E%3Ctbody%3E%3Ctr%3E%3Ctd%20id%3D%22yellowNavSubscribe%22%20valign%3D%22middle%22%20height%3D%2227%22%3E%3Ca%20href%3D%22%23%22%20class%3D%22yellowNav%22%20onClick%3D%22return%20PopWindowToolbar%28%27https%3A//w1.buysub.com/servlet/OrdersGateway%3Fcds_mag_code%3DNGM%26cds_page_id%3D31670%26cds_misc_5%3D2005ARCH7%27%2C%20800%2C%20600%2C%20%27auto%27%20%29%3B%22%3ESpecial%20%2415%20Offer%3C/a%3E%3Ca%20href%3D%22%23%22%20class%3D%22yellowNav%22%20onClick%3D%22return%20PopWindowToolbar%28%20%27http%3A//www.ngmservice.com%27%2C%20800%2C%20600%2C%20%27auto%27%20%29%22%3EMagazine%20Customer%20Service%3C/a%3E%3Ca%20href%3D%22%23%22%20class%3D%22yellowNav%22%20onClick%3D%22return%20PopWindowToolbar%28%27https%3A//w1.buysub.com/servlet/GiftsGateway%3Fcds_mag_code%3DNGM%26cds_page_id%3D31677%26cds_misc_5%3D2005ARCH7%27%2C%20800%2C%20600%2C%20%27auto%27%20%29%3B%22%3EGift%20Subscriptions%3C/a%3E%3C/td%3E%3C/tr%3E%3C/tbody%3E%3C/table%3E';
navArray[8] = '%3Ctable%20id%3D%22yellowNav%22%20cellpadding%3D%220%22%20cellspacing%3D%220%22%20border%3D%220%22%3E%3Ctbody%3E%3Ctr%3E%3Ctd%20valign%3D%22middle%22%20height%3D%2227%22%3E%3Cimg%20src%3D%22/ngm/images/shim.gif%22%20height%3D%2227%22%20width%3D%221%22%3E%3C/td%3E%3C/tr%3E%3C/tbody%3E%3C/table%3E';
if(typeof(NGMNavType) != 'undefined')
{
     var flipped = false;
		if( window.location.href.indexOf( 'editor.aspx' ) == -1 )
		{
			var pagePath = window.location.href.toLowerCase();
			if( pagePath.indexOf( 'forums.ngm.com' ) > -1 || pagePath.indexOf( 'localhost' ) > -1 || pagePath.indexOf( 'aurora' ) > -1 )
			{
				var issueYear = 999;
				var issueMonth = 999;
			}
			else
			{
				var issueDate = window.location.href.slice( window.location.href.indexOf( '/ngm/' ), window.location.href.indexOf( '/ngm/' ) + 9 );
				var tempArray = new Array();
				tempArray = issueDate.split( '/' );
				issueDate = tempArray[2];
				tempArray = issueDate.split( '0' );
				var issueYear = tempArray[1];
				var issueMonth = tempArray[2];
			}

			if( issueYear <= 6 && issueMonth < 5 )
			{
				if( NGMNavType == 8 ) { NGMNavType = 0; flipped = true; }
     			document.write( unescape( navArray[NGMNavType] ) );
     			if(flipped) NGMNavType=8
     			NGMCurrentLocation = NGMNavType;
			}
			else
			{
				if( NGMNavType == 7 ) { NGMNavType = 0; flipped = true; }
     			document.write( unescape( navArray[NGMNavType] ) );
     			if(flipped) NGMNavType=7
     			NGMCurrentLocation = NGMNavType;
			}
		}
}
else
{
     document.write( unescape( navArray[FunStuff] ) );
     NGMCurrentLocation = FunStuff;
}

window.onload = NavOnLoadEvent;

function NavOnLoadEvent()
{
     CheckBrowser();
     var trimmedLoc = window.location.href;
     // fix for zoomify flash sniffer
     var showWhit = false;
     if( trimmedLoc.toLowerCase().indexOf( '/zoomify/main.html' ) > -1 ) trimmedLoc = trimmedLoc.replace( 'main.html', 'index.html' );
     if( trimmedLoc.toLowerCase().indexOf( 'match_vote2.tmpl' ) > -1 ){ showWhit = true; }
     var tableMain = document.getElementById('yellowNav');
     var kids = tableMain.getElementsByTagName('A');
     var itemCount = kids.length;

     if( trimmedLoc.toLowerCase().indexOf( 'forum2.tmpl' ) > -1 )
     {
          var forumIndex = trimmedLoc.slice( trimmedLoc.indexOf( 'forum_index=' ) + 12 );
          forumIndex = parseInt(forumIndex) - 1;
          kids[forumIndex].className = 'yellowNavOn';
          return;
     }
     if( trimmedLoc.toLowerCase().indexOf( 'wallpaper2.tmpl' ) > -1 ) { kids[0].className = 'yellowNavOn'; return; }
     if( ( typeof(NGMNavType) != 'undefined' && NGMNavType == 0 && ( typeof(subNavID) == 'undefined' || NGMCurrentLocation == subNavID ) ) )
     {
		     var cPathSplit = window.location.href.split('/');
		     var loc = cPathSplit[cPathSplit.length-2];

		     for( var i = 0; i < itemCount; i++ )
		     {
			      var cPathSplit2 = kids[i].href.split('/');
			      var locNav = cPathSplit2[cPathSplit2.length-2];

			      if( locNav == loc && kids[i].href.charAt(kids[i].href.length - 1) != '#' && kids[i].href.indexOf( 'multimedia' ) == -1 )
			      {
				       kids[i].className = 'yellowNavOn';
				       break;
			      }
		     }

          if( cPathSplit[cPathSplit.length-1].indexOf( 'multimedia' ) > -1 )
          {
	              loc = cPathSplit[cPathSplit.length-2] + '/' + cPathSplit[cPathSplit.length-1];

				  for( var i = 0; i < itemCount; i++ )
               {
                    var cPathSplit2 = kids[i].href.split('/');
                    var locNav = cPathSplit2[cPathSplit2.length-2] + '/' + cPathSplit2[cPathSplit2.length-1];

                    if( locNav == loc  && kids[i].href.charAt( kids[i].href.length - 1 ) != '#' )
                    {
                         kids[i].className = 'yellowNavOn';
                         break;
                    }
               }

          }
	    }
     else
     {
	         if( ( typeof(subNavID) == 'undefined' || subNavID == null ) || NGMCurrentLocation == subNavID )
          {
		          for( var i = 0; i < itemCount; i++ )
		          {
                    if( kids[i].href == trimmedLoc || ( trimmedLoc.indexOf( 'flashback.html' ) > -1 && kids[i].href.indexOf( 'flashback.html' ) > -1 ) || ( showWhit && kids[i].href.indexOf( 'match2.tmpl' ) > -1 ) )
                    {
				            kids[i].className = 'yellowNavOn';
				            break;
                    }
		          }
	         }
	    }
}
/*<A HREF='/ngm/0509/feature1/index.html'>Views of Africa</A>
<A HREF='/ngm/0509/feature2/index.html'>Nairobi</A>
<A HREF='/ngm/0509/feature3/index.html'>Chad Oil Boon</A>
<A HREF='/ngm/0509/feature4/index.html'>Living With AIDS</A>
<A HREF='/ngm/0509/feature5/index.html'>Mbuti Pygmies</A>
<A HREF='/ngm/0509/feature6/index.html'>Return to Zambia</A>
<A HREF='/ngm/0509/feature7/index.html'>Spirit of the Wild</A>
<A HREF='/ngm/0509/flashback.html'>Flashback</A>
<A HREF='/ngm/0509/resources_geo.html'>Geographica: Free Speech</A>
<A HREF='/ngm/0509/resources_geo2.html'>Geographica: The Shape of Africa</A>
<A HREF='/ngm/0509/resources_who.html'>Who Knew?</A>
<A HREF='/ngm/0509/sights_n_sounds/index.html'>Zambia</A>
<A HREF='/ngm/0509/feature1/multimedia2.html'>Aerial Africa</A>
<A HREF='/ngm/0509/feature1/multimedia1.html'>Megaflyover</A>
<A HREF='/ngm/0509/feature2/multimedia1.html'>Streets of Kenya</A>
<A HREF='/ngm/0509/feature2/multimedia2.html'>My Nairobi</A>
<A HREF='/ngm/0509/feature2/multimedia3.html'>Earth Mother</A>
<A HREF='/ngm/0509/feature4/multimedia.html'>AIDS</A>
<A HREF='/ngm/0509/feature5/multimedia.html'>Pygmies</A>
<A HREF='/ngm/0509/editor.html'>Why Africa?</A>
<A HREF='/ngm/0509/online_extra.html'>Make a Difference</A>
<A HREF='/ngm/0509/feature1/zoomify/index.html'>Human Footprint</A>
<A HREF='/ngm/0509/quiz/index.html'>Africa Quiz</A>
<A HREF='/ngm/0509/editor.html'>Why We Chose Africa</A>
<A HREF='/ngm/megaflyover/'>Africa Megaflyover</A>
<A HREF='/ngm/africaarchive/index.html'>Africa Map and Archive</A>
<A HREF='#'>The Shape of Africa</A>
<A HREF='#'>Views of Africa</A>
<A HREF='#'>Chad Oil Boon</A>
<A HREF='#'>Living With AIDS</A>
<A HREF='#'>Mbuti Pygmies</A>
<A HREF='#'>Return to Zambia</A>
<A HREF='/ngm/wallpaper2.tmpl?issue_id=20050901'>Wallpaper</A>
<A HREF='/ngm/postcard2.tmpl?issue_id=20050901&postcard_index=1'>Postcards</A>
<A HREF='/ngm/match2.tmpl?issue_id=20050901'>Match Wits</A>
<A HREF='#'>Poll</A>
<A HREF='/ngm/wildcamafrica/wildcam.html'>Live Webcam</A>
<A HREF='/ngm/0509/quiz/index.html'>Interactive Quiz</A>
<A HREF='/ngm/archives.html'>Magazine Archive</A>
<A HREF='#'>Society Publications Index</A>
<A HREF='/ngm/best/'>Collector's Editions</A>
<A HREF='#'>Style Manual</A>
<A HREF='/ngm/africaarchive/index.html'>Africa Archive</A>
<A HREF='/ngm/inthenews/index.html'>Hot Topics</A>
<A HREF='#'>Special $15 Offer</A>
<A HREF='#'>Magazine Customer Service</A>
<A HREF='#'>Gift Subscriptions</A>
*/
