var hoofditems = new Array();
var subitems = new Array();

var navRootURL = "/archief/2006/winterspelen2006";
hoofditems['name'] = new Array('dummy', 'Voorpagina', 'Beeld&nbsp;en&nbsp;geluid', 'Nieuwsoverzicht', 'Programma', 'Uitslagen', 'Medailles', 'Nederlanders', 'Historie', 'Rubrieken');
hoofditems['link'] = new Array('dummy', '/voorpagina/', '/beeld_en_geluid/', '/nieuwsoverzicht/', '/programma/', '/uitslagen/', '/medailles/', '/nederlanders/', '/historie/', '/rubrieken/');
hoofditems['id'] = new Array('dummy', 05, 07, 10, 17, 20, 25, 30, 40, 50);
subitems[17] = new Array();
subitems[17]['name'] = new Array('dummy', 'Vandaag', 'Schaatsen', 'Shorttrack', 'Kunstrijden', 'Ijshockey', 'Alpine&nbsp;ski&euml;n', 'Langlaufen', 'Biathlon', 'Freestyle&nbsp;ski&euml;n', 'Schansspringen', 'Noordse&nbsp;combinatie', 'Bobsleeën', 'Rodelen', 'Skeleton', 'Snowboard', 'Curling');
subitems[17]['link'] = new Array('dummy', '/programma/vandaag/', '/programma/schaatsen/', '/programma/shorttrack/', '/programma/kunstrijden/', '/programma/ijshockey/', '/programma/alpineskien/', '/programma/langlaufen/', '/programma/biathlon/', '/programma/freestyleskien/', '/programma/schansspringen/', '/programma/noordsecombinatie/', '/programma/bobsleeen/', '/programma/rodelen/', '/programma/skeleton/', '/programma/snowboard/', '/programma/curling/');
subitems[20] = new Array();
subitems[20]['name'] = new Array('dummy', 'Live', 'Schaatsen', 'Shorttrack', 'Kunstrijden', 'Ijshockey', 'Alpine&nbsp;ski&euml;n', 'Langlaufen', 'Biathlon', 'Freestyle&nbsp;ski&euml;n', 'Schansspringen', 'Noordse&nbsp;combinatie', 'Bobsleeën', 'Rodelen', 'Skeleton', 'Snowboard', 'Curling');
subitems[20]['link'] = new Array('dummy', '/uitslagen/live/', '/uitslagen/schaatsen/', '/uitslagen/shorttrack/', '/uitslagen/kunstrijden/', '/uitslagen/ijshockey/', '/uitslagen/alpineskien/', '/uitslagen/langlaufen/', '/uitslagen/biathlon/', '/uitslagen/freestyleskien/', '/uitslagen/schansspringen/', '/uitslagen/noordsecombinatie/', '/uitslagen/bobsleeen/', '/uitslagen/rodelen/', '/uitslagen/skeleton/', '/uitslagen/snowboard/', '/uitslagen/curling/');
subitems[25] = new Array();
subitems[25]['name'] = new Array('dummy', 'Algemeen', 'Nederlanders');
subitems[25]['link'] = new Array('dummy', '/medailles/algemeen/', '/medailles/nederlanders/');
subitems[50] = new Array();
subitems[50]['name'] = new Array('dummy', 'De&nbsp;voorbeschouwing', 'Bericht&nbsp;vanuit&nbsp;Turijn', 'Reageer&nbsp;op&nbsp;Ria');
subitems[50]['link'] = new Array('dummy', '/rubrieken/devoorbeschouwing/', '/rubrieken/berichtvanuitturijn/', '/rubrieken/reageeropria/');

ReplaceMainTopicURL(17); 
ReplaceMainTopicURL(20); 
ReplaceMainTopicURL(25);

//alert ("REDIRECT: location.pathname " + location.pathname);
switch (location.pathname){
   case navRootURL +'/' :
      // Redirect to main page
      location.replace(navRootURL + hoofditems['link'][1] + 'index.html')
      break;
   case navRootURL+'/index.html' :
      // Redirect to main page
     location.replace(navRootURL + hoofditems['link'][1] + 'index.html')
      break;
}



function ReplaceMainTopicURL(id)
{
  for(i=1;i<hoofditems['id'].length;i++){
      if(id == hoofditems['id'][i]) {
//         document.write (navRootURL + hoofditems['link'][i] + 'index.html');
         if (location.pathname == navRootURL + hoofditems['link'][i] + 'index.html'){
//           alert ("REDIRECT: document.location " + location.host + navRootURL + subitems[id]['link'][1] );
           location.href = navRootURL+subitems[id]['link'][1] + 'index.html';
         } else {
         hoofditems['link'][i] = subitems[id]['link'][1];
         }
      }
  }
}

function displayMainTopic(topic, url, selected)
{
if (topic == 'Over&nbsp;Studio&nbsp;Sport') {
document.write('  <tr> ');
		document.write('    <td colspan="2" height="1"><img src="/gfx/global/menu/menu_button_inactive_top.gif" width="156" height="1" alt="" border="0" /></td>');
	document.write('  <tr>');
	document.write('    <td height="19" colspan="2" style="background: url(/gfx/global/menu/menu_middlebg.gif);" bgcolor="#B5B5B5" align="center" class="tussenkopnav">PROGRAMMA\'S</td>');
	document.write('  </tr>');
	document.write('  <tr> ');
		document.write('    <td colspan="2" height="1"><img src="/gfx/global/menu/menu_button_inactive_bottom.gif" width="156" height="1" alt="" border="0" /></td>');
		document.write('  </tr>');
}

   if (topic.toLowerCase( ) == selected.toLowerCase( ))
	{
//           alert ("displayMainTopic: topic.toLowerCase( ) == selected.toLowerCase( )");
		document.write('  <tr> ');
		document.write('    <td colspan="2" height="19" style="background:    url(/gfx/global/menu/menu_button_active.gif);" valign="middle" bgcolor="#101010" id="'+ topic +'" onMouseOver="swapSubMenu(\''+ topic +'\',\'in\')" onMouseOut="swapSubMenu(\''+ topic +'\',\'out\')" onClick="goUrl(\''+navRootURL+url+'index.html\');">');
		document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="'+navRootURL+url+'index.html" class="menu_active" id="'+ topic +'_link" onMouseOver="javascript:swapSubMenu(\''+ topic +'\',\'in\')">' + topic + '</a>');
		document.write('  </td></tr>');
		document.write('  <tr> ');
		document.write('    <td colspan="2" height="1"><img src="/gfx/global/menu/menu_button_active_bottom.gif" width="156" height="1" alt="" border="0" /></td>');
		document.write('  </tr>');
	} else {
//           alert ("displayMainTopic: topic.toLowerCase( ) <> selected.toLowerCase( )");
		document.write('  <tr> ');
		document.write('    <td colspan="2" height="1"><img src="/gfx/global/menu/menu_button_inactive_top.gif" width="156" height="1" alt="" border="0" /></td>');
		document.write('  </tr>');	
		document.write('  <tr> ');
		document.write('    <td colspan="2" height="19" style="background:    url(/gfx/global/menu/menu_button_inactive.gif);" valign="middle" bgcolor="#B5B5B5" id="'+ topic +'" onMouseOver="swapMenu(\''+ topic +'\',\'in\')" onMouseOut="swapMenu(\''+ topic +'\',\'out\')" onClick="goUrl(\''+navRootURL+url+'index.html\');">');
		document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="'+navRootURL+url+'index.html" class="menu_inactive" id="'+ topic +'_link" onMouseOver="javascript:swapMenu(\''+ topic +'\',\'in\')">' + topic + '</a>');
		document.write('  </td></tr>');
		document.write('  <tr> ');
		document.write('    <td colspan="2" height="1"><img src="/gfx/global/menu/menu_button_inactive_bottom.gif" width="156" height="1" alt="" border="0" /></td>');
		document.write('  </tr>');
	}
} // displayMainTopic

function displaySubTopics(key,subselected)
{
		if(typeof subitems[key] != "undefined")
		{
			for(j=1;j<subitems[key]['name'].length;j++){
				var url = subitems[key]['link'][j];
				if(subitems[key]['name'][j].toLowerCase( ) == subselected.toLowerCase( )) {  //check selected
					document.write('<tr> ');
					document.write('	<td colspan="2" height="18" style="background:    url(/gfx/global/menu/menu_sub_button_active.gif);"bgcolor="#929292" valign="middle" id="s'+j+'" onMouseOver="swapSubMenu(\'s'+j+'\',\'in\')" onMouseOut="swapSubMenu(\'s'+j+'\',\'out\')" onClick="goUrl(\''+navRootURL+url+'index.html\');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="'+navRootURL+url+'index.html" class="submenu" id="s'+j+'_link" onMouseOver="javascript:swapSubMenu(\'s'+j+'\',\'in\')">'+subitems[key]['name'][j]+'</a></td>');
					document.write('</tr>');
				} else {
					document.write('<tr> ');
               document.write('	<td colspan="2" height="18" style="background:    url(/gfx/global/menu/menu_sub_button_inactive.gif);" valign="middle" bgcolor="" id="s'+j+'" onMouseOver="swapSubMenu(\'s'+j+'\',\'in\')" onMouseOut="swapSubMenu(\'s'+j+'\',\'out\')" onClick="goUrl(\''+navRootURL+url+'index.html\');">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="'+navRootURL+url+'index.html" class="submenu" id="s'+j+'_link" onMouseOver="javascript:swapSubMenu(\'s'+j+'\',\'in\')">'+subitems[key]['name'][j]+'</a></td>');
					document.write('</tr>');
				}
			}
		}
} // displaySubTopics


function displayHoofdNav(selected,subselected)
{
	document.write('<table cellspacing="0" cellpadding="0" border="0">');
	document.write('  <tr> ');
	document.write('    <td colspan="2" height="1"><img src="/gfx/global/menu/menu_button_inactive_top.gif" width="155" height="1" alt="" border="0" /></td>');
	document.write('  </tr>');	
	document.write('  <tr> ');
	document.write('    <td colspan="2" height="19" style="background: url(/gfx/global/menu/menu_button_backsite.gif);" valign="middle" bgcolor="#B5B5B5" id="eerste" onMouseOver="swapMenu(\'eerste\',\'in\')" onMouseOut="swapMenu(\'eerste\',\'out\')" onClick="goUrl(\'http://www.nos.nl/nosstudiosport/voorpagina/index.html\');">');
	document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.nos.nl/nosstudiosport/voorpagina/index.html" class="menu_inactive" id="eerste_link" onMouseOver="javascript:swapMenu(\'eerste\',\'in\')">Studio Sport</a>');
	document.write('  </td></tr>');
	
	document.write('  <tr> ');
	document.write('    <td colspan="2" height="1"><img src="/gfx/global/menu/menu_button_inactive_top.gif" width="156" height="1" alt="" border="0" /></td>');
	document.write('  <tr>');
	document.write('    <td height="19" colspan="2" style="background: url(/gfx/global/menu/menu_middlebg.gif);" bgcolor="#B5B5B5" align="center" class="tussenkopnav">WINTERSPELEN</td>');
	document.write('  </tr>');
	document.write('  <tr> ');
	document.write('    <td colspan="2" height="1"><img src="/gfx/global/menu/menu_button_inactive_bottom.gif" width="156" height="1" alt="" border="0" /></td>');
	document.write('  </tr>');

  for(i=1;i<hoofditems['name'].length;i++){
		displayMainTopic(hoofditems['name'][i],hoofditems['link'][i],selected);
	if(selected.toLowerCase( ) == hoofditems['name'][i].toLowerCase( )) {
			displaySubTopics(hoofditems['id'][i],subselected);
		}
  }
  
	document.write('  <tr valign="bottom"> ');
	document.write('    <td height="11" colspan="2"><img src="/gfx/global/menu/menu_bottom.gif" alt="" width="156" border="0" /></td>');
	document.write('  </tr>');
	document.write('</table>');
} // einde functie displayHoofdNav


function displayHoofdNavEntree(selected,subselected,spacerHeight)
{
   document.write('<table cellspacing="0" cellpadding="0" border="0">');
   document.write('  <tr> ');
   document.write('    <td height="28" colspan="2" bgcolor="#373737"><img src="/gfx/global/hoofdmenu/menu_nieuws_topbg.gif" width="156" height="28" alt="Home | Nieuws | Sport" title="Home | Nieuws | Sport" border="0" usemap="#hoofdmenu" /></td>');
   document.write('  </tr>');
   document.write('  <tr> ');
   document.write('    <td width="2" style="background:    url(/gfx/global/menu/menu_leftbg.gif);"><img src="/gfx/global/spacer.gif" width="2" height="1" alt="" border="0" /></td>');
   document.write('    <td height="66" width="155"><a href="index.html"><img src="/gfx/nieuws/menu/menu_nieuws_entree.gif" width="155" height="66" alt="" border="0" /></a></td>');
   document.write('  </tr>');

  for(i=1;i<hoofditems['name'].length;i++){
      displayMainTopic(hoofditems['name'][i],hoofditems['link'][i],selected);
      if(selected.toLowerCase( ) == hoofditems['name'][i].toLowerCase( )) {
         displaySubTopics(hoofditems['id'][i],subselected);
      }
  }

   document.write('  <tr>');
   document.write('    <td height="15" colspan="2" style="background:    url(/gfx/global/menu/menu_middlebg.gif);" bgcolor="#B5B5B5">&nbsp;</td>');
   document.write('  </tr>');
   document.write('  <tr> ');
   document.write('    <td width="156" height="6" colspan="2" style="background:    url(/gfx/global/menu/menu_middlebg.gif);" bgcolor="#B5B5B5"> ');
   document.write('<IMG SRC="/gfx/global/spacer.gif" width="156" height="6" BORDER=0 />');
   document.write('</td>');
   document.write('  </tr>');

  for(i=hoofditems['id'].length;i<11;i++){
      displayNoTopic();
  }
   document.write('  <tr valign="bottom"> ');
   document.write('    <td colspan="2"><img src="/gfx/global/menu/menu_bottom.gif" alt="" width="156" border="0" /></td>');
   document.write('  </tr>');
   document.write('</table>');

} // einde functie displayHoofdNavEntree

function displayNoTopic()
{
   document.write('<tr> ');
   document.write('    <td width="140" height="21" colspan="2" style="background:    url(/gfx/global/menu/menu_middlebg.gif);" bgcolor="#B5B5B5"> ');
   document.write('</tr> ');
} // displayNoTopic