var NS4 = (navigator.appName.indexOf("Netscape")>=0 && parseFloat(navigator.appVersion) >= 4 && parseFloat(navigator.appVersion) < 5)? true : false;
var IE4 = (document.all)? true : false;
var NS6plus = (parseFloat(navigator.appVersion) >= 5 && navigator.appName.indexOf("Netscape")>=0 )? true: false;
var isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
var IEmac = ((document.all) && (isMac)) ? true : false;
var IE4plus = (document.all) ? true : false;
var IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
var IE6 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 6.")!=-1)) ? true : false;
var Opera7plus = ((document.all)&&(navigator.userAgent.indexOf("Opera 7")!=-1)) ? true : false;
var FF1 = (navigator.userAgent.indexOf("Firefox\/1")!=-1) ? true : false;
var Opera = (navigator.userAgent.indexOf("Opera")!=-1) ? true : false;
var Mozilla = (NS6plus && (navigator.userAgent.indexOf("Netscape") < 0));
var IsLocal = (location.href.indexOf("file://")>-1)? true : false;
var initPlayer = 0; 
var idI;

var oPres = 
{'SLIDES':[
{'SlideSeq': '1', 'Title': 'Population Policies, Programs, and the Environment', 'ClipFile': '1.wma', 'SlideFile': 'slide_1_1.png', 'TimePoint': 0},
{'SlideSeq': '2', 'Title': 'Food, Water and PopulationPresentation to:The Fred F. Bixby ForumThe World in 2050', 'ClipFile': '1.wma', 'SlideFile': 'slide_2_2.png', 'TimePoint': 33000},
{'SlideSeq': '3', 'Title': 'The current status of food security', 'ClipFile': '1.wma', 'SlideFile': 'slide_3_3.png', 'TimePoint': 38000},
{'SlideSeq': '4', 'Title': 'Reasons for recent food insecurity', 'ClipFile': '1.wma', 'SlideFile': 'slide_4_4.png', 'TimePoint': 78000},
{'SlideSeq': '5', 'Title': 'Impact of under nutrition', 'ClipFile': '1.wma', 'SlideFile': 'slide_5_5.png', 'TimePoint': 118000},
{'SlideSeq': '6', 'Title': 'Factors relating to food security', 'ClipFile': '1.wma', 'SlideFile': 'slide_6_6.png', 'TimePoint': 163000},
{'SlideSeq': '7', 'Title': 'Availability of food increased more rapidly than population from 1950-2000', 'ClipFile': '1.wma', 'SlideFile': 'slide_7_7.png', 'TimePoint': 188000},
{'SlideSeq': '8', 'Title': 'Current and projected future demands on life-supporting ecosystems threaten future food security', 'ClipFile': '1.wma', 'SlideFile': 'slide_8_8.png', 'TimePoint': 240000},
{'SlideSeq': '9', 'Title': 'Continued…', 'ClipFile': '1.wma', 'SlideFile': 'slide_9_9.png', 'TimePoint': 276000},
{'SlideSeq': '10', 'Title': 'Water shortage is a growing problem', 'ClipFile': '1.wma', 'SlideFile': 'slide_10_10.png', 'TimePoint': 304000},
{'SlideSeq': '11', 'Title': 'Population growth will increase demands on already inadequate crop and range lands', 'ClipFile': '1.wma', 'SlideFile': 'slide_11_11.png', 'TimePoint': 365000},
{'SlideSeq': '12', 'Title': 'Wild Fisheries are at their limit', 'ClipFile': '1.wma', 'SlideFile': 'slide_12_12.png', 'TimePoint': 396000},
{'SlideSeq': '13', 'Title': 'Climate Change is a major threat to food security', 'ClipFile': '1.wma', 'SlideFile': 'slide_13_13.png', 'TimePoint': 428000},
{'SlideSeq': '14', 'Title': 'The FAO lists 34 countries either in food crisis or at high risk of food insecurity due to high food prices', 'ClipFile': '1.wma', 'SlideFile': 'slide_14_14.png', 'TimePoint': 521000},
{'SlideSeq': '15', 'Title': 'An Action Agenda', 'ClipFile': '1.wma', 'SlideFile': 'slide_15_15.png', 'TimePoint': 551000},
{'SlideSeq': '16', 'Title': 'Unintended pregnancy is the factor in continued population growth that is most amenable to program and policy intervention', 'ClipFile': '1.wma', 'SlideFile': 'slide_16_16.png', 'TimePoint': 623000},
{'SlideSeq': '17', 'Title': 'Funding shortfalls for Family Planning in developing countries', 'ClipFile': '1.wma', 'SlideFile': 'slide_17_17.png', 'TimePoint': 653000},
{'SlideSeq': '18', 'Title': 'Assuming $15 billion/year is needed for family planning in developing countries and 1/3 should come from donors, then $5 billion/year is needed', 'ClipFile': '1.wma', 'SlideFile': 'slide_18_18.png', 'TimePoint': 694000},
{'SlideSeq': '19', 'Title': 'Stabilizing climate will be essential', 'ClipFile': '1.wma', 'SlideFile': 'slide_19_19.png', 'TimePoint': 789000},
{'SlideSeq': '20', 'Title': 'Features of a new economy to restore natural systems', 'ClipFile': '1.wma', 'SlideFile': 'slide_20_20.png', 'TimePoint': 844000},
{'SlideSeq': '21', 'Title': 'Discussant:Daniel KammenUniversity of California, Berkeley', 'ClipFile': '1.wma', 'SlideFile': 'slide_21_21.png', 'TimePoint': 892000},
{'SlideSeq': '22', 'Title': 'Discussion', 'ClipFile': '1.wma', 'SlideFile': 'slide_22_22.png', 'TimePoint': 1498000}
]}
var currSlideSeq=1;
var currDivId = "nt1";

function TabSelected(sel) { 
	tmpC=(parent.tabs.document.getElementById('tabNavigation').children.length -1)
	
	for (var i = 0; i < tmpC; i++) { 
		style2=parent.tabs.document.getElementById('tabNavigation').children[i]		
		if (i==sel) { 
			style2.className="selectedTab"
		} else { 
			style2.className=""	
		}
		
	} 

} 

function ChangeTab() {	
	var argv = ChangeTab.arguments;
	var argc = argv.length;
	for (var i = 0; i < argc; i++) {		
		style1=parent.tabcontent.document.getElementById(argv[i]).style
			
		if (i==0) { 
			style1.display="block"			
		} else { 
			style1.display="none"			
		} 
		if (argv[i]=='outline') { 
			parent.tabs.document.getElementById('tabNavBar').innerHTML="<div id='tabNavBar' style='background: #6D6FF9;border-top: line-height: 20px;text-align:right;padding: 0 0 0 0;color: #FFF;font-weight: bold;'>&nbsp;</div>"
		} else { 
			parent.tabs.document.getElementById('tabNavBar').innerHTML="<div id='tabNavBar' style='background: #6D6FF9;border-top: line-height: 20px;text-align:right;padding: 0 0 0 0;color: #FFF;font-weight: bold;'>Time Point</div>"
		} 
	}	
	return false; 	
}

var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos) {
	if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
	if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=yes,toolbar=no,resizable=yes';
	win=window.open(mypage,myname,settings);
}

function SetCurrentSlide(sSeq){
	for (i=0;i<parent.oPres.SLIDES.length;i++) { 
		elem = parent.tabcontent.document.getElementById('row_' + parent.oPres.SLIDES[i].SlideSeq);
		elem1 = parent.thumbs.document.getElementById('trow_' + parent.oPres.SLIDES[i].SlideSeq);
		elem2 = parent.thumbs.document.getElementById('trow_' + parent.oPres.SLIDES[i].SlideSeq + 'a');
		elem3 = parent.thumbs.document.getElementById('trow_' + parent.oPres.SLIDES[i].SlideSeq + 'b');
		if (sSeq == parent.oPres.SLIDES[i].SlideSeq) { 			
			elem.className = 'current';
			elem1.className = 'current';
			elem2.className = 'current';
			elem3.className = 'current';			
			currSlideSeq=sSeq; 			
		}  else { 
			elem.className = '';
			elem1.className = '';
			elem2.className = '';
			elem3.className = '';
		} 

	} 

}
function GetSlideIdxByTimepoint(tMS) { 
	for (j=0; j<oPres.SLIDES.length; j++) { 		
		if (tMS==oPres.SLIDES[j].TimePoint) { 				
			return j;
		} 
	}
} 