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': '2009 World Population Data Sheet', 'ClipFile': '1.wmv', 'SlideFile': 'slide_1_2.png', 'TimePoint': 0},
{'SlideSeq': '2', 'Title': 'World Population Growth Is Almost Entirely Concentrated in the World\'s Poorer Countries.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_2_4.png', 'TimePoint': 255000},
{'SlideSeq': '3', 'Title': 'The World’s Youth Population Will Become More Concentrated in Africa and Asia.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_3_5.png', 'TimePoint': 452000},
{'SlideSeq': '4', 'Title': 'More Developed Countries Have Fewer Young People Relative to Elderly.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_4_6.png', 'TimePoint': 521000},
{'SlideSeq': '5', 'Title': 'Less Developed Countries Have Far More Young People Relative to Elderly.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_5_7.png', 'TimePoint': 578000},
{'SlideSeq': '6', 'Title': 'To Slow Population Growth, Developing Countries’ Fertility Decline Must Be Rapid.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_6_8.png', 'TimePoint': 617000},
{'SlideSeq': '7', 'Title': 'From 1980 to Today, There Has Been Very Little Change in Africa’s Population Under 15.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_7_9.png', 'TimePoint': 671000},
{'SlideSeq': '8', 'Title': 'Africa’s Population of 1 Billion Is Projected to Grow Rapidly Through 2050.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_8_10.png', 'TimePoint': 756000},
{'SlideSeq': '9', 'Title': 'The Differences Between Developed and Developing Countries Can Be Stark.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_9_11.png', 'TimePoint': 780000},
{'SlideSeq': '10', 'Title': 'The U.S. Has a Younger Age Structure Than Other Developed Countries.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_10_12.png', 'TimePoint': 904000},
{'SlideSeq': '11', 'Title': 'Today’s Youth Will Be in the Prime Working Ages in 2030.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_11_13.png', 'TimePoint': 958000},
{'SlideSeq': '12', 'Title': 'High School Dropout Rates Are Declining, but Remain Higher Among Hispanic Youth.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_12_14.png', 'TimePoint': 1066000},
{'SlideSeq': '13', 'Title': 'College Enrollment Is Lower Among Black and Hispanic Youth.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_13_15.png', 'TimePoint': 1107000},
{'SlideSeq': '14', 'Title': 'The Birth Rate Among U.S. Teenagers Is Twice the Average for all Developed Countries.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_14_16.png', 'TimePoint': 1188000},
{'SlideSeq': '15', 'Title': 'Birth Rates Remain Much Higher Among Black and Hispanic Teens.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_15_17.png', 'TimePoint': 1226000},
{'SlideSeq': '16', 'Title': 'By 2030, More Than Half of all Youth Will Be Members of a Racial or Ethnic Minority.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_16_18.png', 'TimePoint': 1305000},
{'SlideSeq': '17', 'Title': 'In One-Third of U.S. Counties, at Least 25 Percent of Children Live in Poverty.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_17_19.png', 'TimePoint': 1342000},
{'SlideSeq': '18', 'Title': 'The Diversity of Youth', 'ClipFile': '1.wmv', 'SlideFile': 'slide_18_20.png', 'TimePoint': 1440000},
{'SlideSeq': '19', 'Title': 'Peru’s Population Structure Is in Transition.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_19_21.png', 'TimePoint': 1551000},
{'SlideSeq': '20', 'Title': 'Young Women in Peru Have Options.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_20_22.png', 'TimePoint': 1577000},
{'SlideSeq': '21', 'Title': 'Young Women in Peru Face Other Issues.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_21_23.png', 'TimePoint': 1627000},
{'SlideSeq': '22', 'Title': 'Zambia’s Population Structure Is Youthful.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_22_24.png', 'TimePoint': 1661000},
{'SlideSeq': '23', 'Title': 'Young Women in Zambia Have Fewer Opportunities.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_23_25.png', 'TimePoint': 1678000},
{'SlideSeq': '24', 'Title': 'Young Women in Zambia Face Other Challenges.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_24_26.png', 'TimePoint': 1743000},
{'SlideSeq': '25', 'Title': 'Mali Has a Very Young Population.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_25_27.png', 'TimePoint': 1797000},
{'SlideSeq': '26', 'Title': 'Being a Young Woman in Mali Is Difficult.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_26_28.png', 'TimePoint': 1812000},
{'SlideSeq': '27', 'Title': 'Young Women in Mali Face Many Challenges.', 'ClipFile': '1.wmv', 'SlideFile': 'slide_27_29.png', 'TimePoint': 1869000},
{'SlideSeq': '28', 'Title': 'Q&A', 'ClipFile': '1.wmv', 'SlideFile': 'slide_28_30.png', 'TimePoint': 1957000}
]}
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;
		} 
	}
} 