var global_pageside = 0;
function spawn (targ,x,y) { window.open(targ,'secondary','width=' + x + ',height=' + y + ',scrollbars=yes'); }
function schedulebox () { window.open('http://www.pbs.org/wgbh/pages/frontline/programs/pbsv.html','schedule','width=500,height=600,scrollbars=yes'); }
function mailafriend () { window.open('http://www.pbs.org/wgbh/pages/frontline/us/mailfriend.html?page='+encodeURIComponent(location.href),'mail','width=500,height=500,scrollbars=yes'); }
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++) { document.F.loadedImages[arg] = new Image(); document.F.loadedImages[arg].src = preload.arguments[arg]; } } }
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 videobox(urlprefix,url){ window.open("http://www.pbs.org/wgbh/pages/frontline/"+urlprefix+url+".html","video","toolbar=no,location=no,directories=no,menubar=no,width=680,height=700,scrollbars=yes"); }
function flvpop(url){ window.open("http://www.pbs.org/frontlineworld"+url+".html","video","toolbar=no,location=no,directories=no,menubar=no,width=750,height=640,scrollbars=no"); }
function player(mode,segid,pkgcode,divid){ if(divid == undefined){ divid = 'paplayer'; }  document.write('<div id="' + divid + '"><p>You\'ll need Flash 9 or better to view this content.<br /><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&ogn=EN_US-gntray_dl_getflashplayer" style="color: #f44">Downlad Flash</a></p></div>'); var paplayer = new SWFObject("/wgbh/pages/frontline/video/flv/v8.swf",divid,"750","584","9","#222222"); paplayer.addVariable("menu","false"); paplayer.useExpressInstall('/wgbh/pages/frontline/video/flv/expressinstall.swf'); paplayer.addParam("allowFullScreen", "true"); paplayer.addVariable("pap_brand","frow"); paplayer.addVariable("pap_brandid","3"); paplayer.addVariable("pap_entitycode","0"); paplayer.addVariable("pap_mode",mode); paplayer.addVariable("pap_pkgcode",pkgcode); if(segid != undefined && segid > 0) { paplayer.addVariable("pap_segidx",segid); } paplayer.write(divid); }
function handleclick (targ) { opener.location.href = targ; window.close(self); }
function oldvideo (url) { newwindow=window.open(url,'name','height=600,width=570'); if (window.focus) {newwindow.focus()} return false; }
function oldvideo43 (url) { newwindow=window.open(url,'name','height=660,width=570'); if (window.focus) {newwindow.focus()} return false; }
function popplayer(mode,segid,pkgcode,divid){ if(divid == undefined){ divid = 'paplayer'; } document.write('<div id="' + divid + '"><p>You\'ll need Flash 9 or better to view this content.<br /><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&ogn=EN_US-gntray_dl_getflashplayer" style="color: #f44">Downlad Flash</a></p></div>'); var paplayer = new SWFObject("/wgbh/pages/frontline/video/flv/v8.swf",divid,"750","584","9","#222222"); paplayer.addVariable("menu","false"); paplayer.useExpressInstall('/wgbh/pages/frontline/video/flv/expressinstall.swf'); paplayer.addParam("allowFullScreen", "true"); paplayer.addVariable("pap_brand","frow"); paplayer.addVariable("pap_brandid","3"); paplayer.addVariable("pap_entitycode","0"); paplayer.addVariable("pap_mode",mode); paplayer.addVariable("pap_pkgcode",pkgcode); if(segid != undefined && segid > 0) { paplayer.addVariable("pap_segidx",segid); } paplayer.write(divid); }
function videopop(pkg,segid,mode){ window.open("http://www.pbs.org/frontlineworld/watch/player.html?pkg="+pkg+"&seg="+segid+"&mod="+mode,"video","toolbar=no,location=no,directories=no,menubar=no,width=750,height=640,scrollbars=no"); }
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 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;
}
