window.name = 'primary';

function preload() {
  if (document.images) {
    if (typeof(document.F) == 'undefined'){
                document.F = new Object();
    }
        document.F.loadedImages = new Array();
    var argLength = preload.arguments.length;
    for(arg=0;arg<argLength;arg++) {
        if(preload.arguments[arg]) {
            document.F.loadedImages[arg] = new Image();
            document.F.loadedImages[arg].src = preload.arguments[arg];
        }
    }
  }
}

        function popitup(url)
{
        newwindow=window.open(url,'name','height=600,width=570');
        if (window.focus) {newwindow.focus()}
        return false;
}

        function popitup43(url)
{
        newwindow=window.open(url,'name','height=660,width=570');
        if (window.focus) {newwindow.focus()}
        return false;
}

function imageswap(daImage, daSrc){
  var objStr,obj;
  if(document.images){
   if (typeof(daImage) == 'string') {
      objStr = 'document.' + daImage;
      obj = eval(objStr);
      obj.src = daSrc;
    } else if ((typeof(daImage) == 'object') && daImage && daImage.src) {
      daImage.src = daSrc;
    }
  }
}

function navtoggle(szDivID, iState) {
    //NN 4
    if(document.layers) {
       //document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    // NN6, IE5+
    else if(document.getElementById) {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    //IE 4
    else if(document.all) {
        //document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}

function makenav(stateflag,enablemenus) {

// function to build the top nav.  pass an integer to stateflag to change the status of a given menu item
// enablemenus: 1 for run them, 0 to ignore them (for flash situations)

        var n2status = '';
        var n3status = '';
        var n4status = '';
        var n5status = '';
        var n6status = '';

        if(stateflag == 2) { n2status = 's' }
        if(stateflag == 3) { n3status = 's' }
        if(stateflag == 4) { n4status = 's' }
        if(stateflag == 5) { n5status = 's' }
        if(stateflag == 6) { n6status = 's' }

        preload('/frontlineworld/images/newnav/p_n1a.gif','/frontlineworld/images/newnav/p_n2a.gif','/frontlineworld/images/newnav/p_n3a.gif','/frontlineworld/images/newnav/p_n4a.gif','/frontlineworld/images/newnav/p_n5a.gif','/frontlineworld/images/newnav/p_n6a.gif','/frontlineworld/images/newnav/p_n7a.gif');
        
        document.write('<table cellpadding="0" cellspacing="0" border="0" class="navmenu" width="736"><tr>');
        document.write('<td width=53 height=21><a href="/frontlineworld/" onmouseover="imageswap(\'tn1\',\'/frontlineworld/images/newnav/p_n1a.gif\');" onmouseout="imageswap(\'tn1\',\'/frontlineworld/images/newnav/p_n1.gif\');"><img src="/frontlineworld/images/newnav/p_n1.gif" width="53" height="21" border="0" alt="Home" name="tn1" /></a></td>');
        document.write('<td width="60" height="21"><a href="/frontlineworld/stories/" onmouseover="imageswap(\'tn2\',\'/frontlineworld/images/newnav/p_n2a.gif\');');
        if(enablemenus == 1) { document.write('navtoggle(\'n2menu\',1);'); }
        document.write('" onmouseout="imageswap(\'tn2\',\'/frontlineworld/images/newnav/p_n2' + n2status + '.gif\'); ');
        if(enablemenus == 1) { document.write('navtoggle(\'n2menu\',0);'); }
        document.write('"><img src="/frontlineworld/images/newnav/p_n2' + n2status + '.gif" width="60" height="21" border="0" alt="Stories" name="tn2" /></a>');
        if(enablemenus == 1) {
                document.write('<br><div id="n2menu" class="navhiddenmenu" onmouseover="imageswap(\'tn2\',\'/frontlineworld/images/newnav/p_n2a.gif\'); navtoggle(\'n2menu\',1);" onmouseout="imageswap(\'tn2\',\'/frontlineworld/images/newnav/p_n2' + n2status + '.gif\'); navtoggle(\'n2menu\',0);"><table cellpadding="3" cellspacing="0" border="0" width="200" class="menutop">\n');
                document.write('<tr><td class="topnavitem" id="tn21"><p>&#183; <a href="/frontlineworld/watch/" onmouseover="getElementById(\'tn21\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn21\').className=\'topnavitem\'">Watch Online</a></p></td></tr>\n');
                document.write('<tr><td class="topnavitem" id="tn22"><p>&#183; <a href="/frontlineworld/stories/" onmouseover="getElementById(\'tn22\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn22\').className=\'topnavitem\'">By Date</a></p></td></tr>\n');
                document.write('<tr><td class="topnavitem" id="tn23"><p>&#183; <a href="/frontlineworld/stories/bytheme.html" onmouseover="getElementById(\'tn23\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn23\').className=\'topnavitem\'">By Theme</a></p></td></tr>\n');
                document.write('<tr><td class="topnavitem" id="tn24"><p>&#183; <a href="/frontlineworld/stories/byplace.html" onmouseover="getElementById(\'tn24\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn24\').className=\'topnavitem\'">By Region</a></p></td></tr>\n');
                document.write('<tr><td class="topnavitem" id="tn25"><p>&#183; <a href="/frontlineworld/stories/fellows.html" onmouseover="getElementById(\'tn25\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn25\').className=\'topnavitem\'">Fellows Stories</a></p></td></tr>\n');
                document.write('<tr><td class="topnavitem" id="tn26"><p>&#183; <a href="/frontlineworld/stories/socialentrepreneurs.html" onmouseover="getElementById(\'tn26\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn26\').className=\'topnavitem\'">Social Entrepreneurs Stories</a></p></td></tr>\n');
                document.write('<tr><td class="topnavitem" id="tn27"><p>&#183; <a href="/frontlineworld/stories/rough_cut.html" onmouseover="getElementById(\'tn27\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn27\').className=\'topnavitem\'">Rough Cuts</a></p></td></tr>\n');
                        document.write('<tr><td class="topnavitem" id="tn28"><p>&#183; <a href="/frontlineworld/stories/flashpoint/" onmouseover="getElementById(\'tn28\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn28\').className=\'topnavitem\'">FlashPoint Slideshows</a></p></td></tr>\n');
        document.write('</table></div>');
        }
        document.write('</td><td width="48" height="21"><a href="/frontlineworld/react/" onmouseover="imageswap(\'tn3\',\'/frontlineworld/images/newnav/p_n3a.gif\');" onmouseout="imageswap(\'tn3\',\'/frontlineworld/images/newnav/p_n3' + n3status + '.gif\');"><img src="/frontlineworld/images/newnav/p_n3' + n3status + '.gif" width="48" height="21" border="0" alt="React" name="tn3" /></a></td>');
        document.write('<td width="154" height="21"><a href="/frontlineworld/about/" onmouseover="imageswap(\'tn4\',\'/frontlineworld/images/newnav/p_n4a.gif\');');
        if(enablemenus == 1) { document.write('navtoggle(\'n4menu\',1);'); }
        document.write('" onmouseout="imageswap(\'tn4\',\'/frontlineworld/images/newnav/p_n4' + n4status + '.gif\'); ');
        if(enablemenus == 1) { document.write('navtoggle(\'n4menu\',0);'); }
        document.write('"><img src="/frontlineworld/images/newnav/p_n4' + n4status + '.gif" width="154" height="21" border="0" alt="About FRONTLINE/World" name="tn4"></a>');
        if(enablemenus == 1) {
                document.write('<br><div id="n4menu" class="navhiddenmenu" onmouseover="imageswap(\'tn4\',\'/frontlineworld/images/newnav/p_n4a.gif\'); navtoggle(\'n4menu\',1);" onmouseout="imageswap(\'tn4\',\'/frontlineworld/images/newnav/p_n4' + n4status + '.gif\'); navtoggle(\'n4menu\',0);"><table cellpadding="3" cellspacing="0" border="0" width="150" class="menutop">\n');
                document.write('<tr><td class="topnavitem" id="tn41"><p>&#183; <a href="/frontlineworld/about/whatisworld.html" onmouseover="getElementById(\'tn41\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn41\').className=\'topnavitem\'">What is World</a></p></td></tr>\n');
                document.write('<tr><td class="topnavitem" id="tn42"><p>&#183; <a href="/frontlineworld/watch/schedule.html" onmouseover="getElementById(\'tn42\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn42\').className=\'topnavitem\'">Broadcast Schedule</a></p></td></tr>\n');
                document.write('<tr><td class="topnavitem" id="tn43"><p>&#183; <a href="/frontlineworld/about/reporterstories.html" onmouseover="getElementById(\'tn43\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn43\').className=\'topnavitem\'">Reporter Stories</a></p></td></tr>\n');
                
                document.write('<tr><td class="topnavitem" id="tn45"><p>&#183; <a href="/frontlineworld/about/purchaseatape.html" onmouseover="getElementById(\'tn45\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn45\').className=\'topnavitem\'">Purchase a Tape</a></p></td></tr>\n');
                document.write('</table></div>');
        }
        document.write('</td><td width="86" height="21"><a href="/frontlineworld/blog/" onmouseover="imageswap(\'tn5\',\'/frontlineworld/images/newnav/np_n5a.gif\');" onmouseout="imageswap(\'tn5\',\'/frontlineworld/images/newnav/np_n5' + n5status + '.gif\');"><img src="/frontlineworld/images/newnav/np_n5' + n5status + '.gif" width="74" height="21" border="0" alt="Dispatches" name="tn5" /></a></td>\n');
        document.write('<td width="72" height="21"><a href="/frontlineworld/educators/" onmouseover="imageswap(\'tn6\',\'/frontlineworld/images/newnav/p_n6a.gif\');" onmouseout="imageswap(\'tn6\',\'/frontlineworld/images/newnav/p_n6' + n6status + '.gif\');"><img src="/frontlineworld/images/newnav/p_n6' + n6status + '.gif" width="72" height="21" border="0" alt="Educators" name="tn6" /></a></td>\n');
        document.write('<td width="80" height="21"><a href="/frontline/" onmouseover="imageswap(\'tn7\',\'/frontlineworld/images/newnav/p_n7a.gif\');" onmouseout="imageswap(\'tn7\',\'/frontlineworld/images/newnav/p_n7.gif\');"><img src="/frontlineworld/images/newnav/p_n7.gif" width="80" height="21" border="0" alt="FRONTLINE" name="tn7" /></a></td>');
        document.write('<td width="195"><img src="/frontlineworld/images/blank.gif" width="195" height="1" alt=""></td></tr></table>');

}

function makenav2006(stateflag,enablemenus) {

// function to build the top nav.  pass an integer to stateflag to change the status of a given menu item
// enablemenus: 1 for run them, 0 to ignore them (for flash situations)

        var n2status = '';
        var n3status = '';
        var n4status = '';
        var n5status = '';
        var n6status = '';

        if(stateflag == 2) { n2status = 's' }
        if(stateflag == 3) { n3status = 's' }
        if(stateflag == 4) { n4status = 's' }
        if(stateflag == 5) { n5status = 's' }
        if(stateflag == 6) { n6status = 's' }

        preload('/frontlineworld/images/newnav2006/p_n1a.gif','/frontlineworld/images/newnav2006/p_n2a.gif','/frontlineworld/images/newnav2006/p_n3a.gif','/frontlineworld/images/newnav2006/p_n4a.gif','/frontlineworld/images/newnav2006/p_n5a.gif','/frontlineworld/images/newnav2006/p_n6a.gif','/frontlineworld/images/newnav2006/p_n7a.gif');
        
        document.write('<table cellpadding=0 cellspacing=0 border=0 class="navmenu" width=736><tr>');
        document.write('<td width=53 height=21><a href="/frontlineworld/" onmouseover="imageswap(\'tn1\',\'/frontlineworld/images/newnav2006/p_n1a.gif\');" onmouseout="imageswap(\'tn1\',\'/frontlineworld/images/newnav2006/p_n1.gif\');"><img src="/frontlineworld/images/newnav2006/p_n1.gif" width=53 height=21 border=0 alt="Home" name="tn1"></a></td>');
        document.write('<td width=60 height=21><a href="/frontlineworld/stories/" onmouseover="imageswap(\'tn2\',\'/frontlineworld/images/newnav2006/p_n2a.gif\');');
        if(enablemenus == 1) { document.write('navtoggle(\'n2menu\',1);'); }
        document.write('" onmouseout="imageswap(\'tn2\',\'/frontlineworld/images/newnav2006/p_n2' + n2status + '.gif\'); ');
        if(enablemenus == 1) { document.write('navtoggle(\'n2menu\',0);'); }
        document.write('"><img src="/frontlineworld/images/newnav2006/p_n2' + n2status + '.gif" width=60 height=21 border=0 alt="Stories" name="tn2"></a>');
        if(enablemenus == 1) {
                document.write('<br><div id="n2menu" class="navhiddenmenu" onmouseover="imageswap(\'tn2\',\'/frontlineworld/images/newnav2006/p_n2a.gif\'); navtoggle(\'n2menu\',1);" onmouseout="imageswap(\'tn2\',\'/frontlineworld/images/newnav2006/p_n2' + n2status + '.gif\'); navtoggle(\'n2menu\',0);"><table cellpadding=3 cellspacing=0 border=0 width=150 class="menutop">\n');
                document.write('<tr><td class="topnavitem" id="tn21"><p>&#183; <a href="/frontlineworld/watch/" onmouseover="getElementById(\'tn21\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn21\').className=\'topnavitem\'">Watch Online</a></p></td></tr>\n');
                document.write('<tr><td class="topnavitem" id="tn22"><p>&#183; <a href="/frontlineworld/stories/" onmouseover="getElementById(\'tn22\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn22\').className=\'topnavitem\'">By Date</a></p></td></tr>\n');
                document.write('<tr><td class="topnavitem" id="tn23"><p>&#183; <a href="/frontlineworld/stories/bytheme.html" onmouseover="getElementById(\'tn23\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn23\').className=\'topnavitem\'">By Theme</a></p></td></tr>\n');
                document.write('<tr><td class="topnavitem" id="tn24"><p>&#183; <a href="/frontlineworld/stories/byplace.html" onmouseover="getElementById(\'tn24\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn24\').className=\'topnavitem\'">By Region</a></p></td></tr>\n');
                document.write('<tr><td class="topnavitem" id="tn25"><p>&#183; <a href="/frontlineworld/stories/fellows.html" onmouseover="getElementById(\'tn25\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn25\').className=\'topnavitem\'">Fellows Stories</a></p></td></tr>\n');
                document.write('<tr><td class="topnavitem" id="tn26"><p>&#183; <a href="/frontlineworld/stories/socialentrepreneurs.html" onmouseover="getElementById(\'tn26\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn26\').className=\'topnavitem\'">Social Entrepreneurs</a></p></td></tr>\n');
        document.write('</table></div>');
        }
        document.write('</td><td width=48 height=21><a href="/frontlineworld/react/" onmouseover="imageswap(\'tn3\',\'/frontlineworld/images/newnav2006/p_n3a.gif\');" onmouseout="imageswap(\'tn3\',\'/frontlineworld/images/newnav2006/p_n3' + n3status + '.gif\');"><img src="/frontlineworld/images/newnav2006/p_n3' + n3status + '.gif" width=48 height=21 border=0 alt="React" name="tn3"></a></td>');
        document.write('<td width=154 height=21><a href="/frontlineworld/about/" onmouseover="imageswap(\'tn4\',\'/frontlineworld/images/newnav2006/p_n4a.gif\');');
        if(enablemenus == 1) { document.write('navtoggle(\'n4menu\',1);'); }
        document.write('" onmouseout="imageswap(\'tn4\',\'/frontlineworld/images/newnav2006/p_n4' + n4status + '.gif\'); ');
        if(enablemenus == 1) { document.write('navtoggle(\'n4menu\',0);'); }
        document.write('"><img src="/frontlineworld/images/newnav2006/p_n4' + n4status + '.gif" width=154 height=21 border=0 alt="About FRONTLINE/World" name="tn4"></a>');
        if(enablemenus == 1) {
                document.write('<br><div id="n4menu" class="navhiddenmenu" onmouseover="imageswap(\'tn4\',\'/frontlineworld/images/newnav2006/p_n4a.gif\'); navtoggle(\'n4menu\',1);" onmouseout="imageswap(\'tn4\',\'/frontlineworld/images/newnav2006/p_n4' + n4status + '.gif\'); navtoggle(\'n4menu\',0);"><table cellpadding=3 cellspacing=0 border=0 width=150 class="menutop">\n');
                document.write('<tr><td class="topnavitem" id="tn41"><p>&#183; <a href="/frontlineworld/about/whatisworld.html" onmouseover="getElementById(\'tn41\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn41\').className=\'topnavitem\'">What is World</a></p></td></tr>\n');
                document.write('<tr><td class="topnavitem" id="tn42"><p>&#183; <a href="/frontlineworld/watch/schedule.html" onmouseover="getElementById(\'tn42\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn42\').className=\'topnavitem\'">Broadcast Schedule</a></p></td></tr>\n');
                document.write('<tr><td class="topnavitem" id="tn43"><p>&#183; <a href="/frontlineworld/about/reporterstories.html" onmouseover="getElementById(\'tn43\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn43\').className=\'topnavitem\'">Reporter Stories</a></p></td></tr>\n');

                document.write('<tr><td class="topnavitem" id="tn45"><p>&#183; <a href="/frontlineworld/about/purchaseatape.html" onmouseover="getElementById(\'tn45\').className=\'topnavitemroll\'" onmouseout="getElementById(\'tn45\').className=\'topnavitem\'">Purchase a Tape</a></p></td></tr>\n');
                document.write('</table></div>');
        }
        document.write('</td><td width=86 height=21><a href="/frontlineworld/blog/" onmouseover="imageswap(\'tn5\',\'/frontlineworld/images/newnav2006/np_n5a.gif\');" onmouseout="imageswap(\'tn5\',\'/frontlineworld/images/newnav2006/np_n5' + n5status + '.gif\');"><img src="/frontlineworld/images/newnav2006/np_n5' + n5status + '.gif" width=74 height=21 border=0 alt="Dispatches" name="tn5"></a></td>\n');
        document.write('<td width=72 height=21><a href="/frontlineworld/educators/" onmouseover="imageswap(\'tn6\',\'/frontlineworld/images/newnav2006/p_n6a.gif\');" onmouseout="imageswap(\'tn6\',\'/frontlineworld/images/newnav2006/p_n6' + n6status + '.gif\');"><img src="/frontlineworld/images/newnav2006/p_n6' + n6status + '.gif" width=72 height=21 border=0 alt="Educators" name="tn6"></a></td>\n');
        document.write('<td width=80 height=21><a href="/frontline/" onmouseover="imageswap(\'tn7\',\'/frontlineworld/images/newnav2006/p_n7a.gif\');" onmouseout="imageswap(\'tn7\',\'/frontlineworld/images/newnav2006/p_n7.gif\');"><img src="/frontlineworld/images/newnav2006/p_n7.gif" width=80 height=21 border=0 alt="FRONTLINE" name="tn7"></a></td>');
        document.write('<td width=195><img src="/frontlineworld/images/blank.gif" width=195 height=1 alt=""></td></tr></table>');

}

function popUp(strURL,strType,strHeight,strWidth) {
var strOptions="";
if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
window.open(strURL, 'newWin', strOptions);
}

// open video window 
//PBSVideoWindow_X=585; 
//PBSVideoWindow_Y=475;


// standard img rollover
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


