//File: scripts.js
//Authors: Jason Tablante and Jason Neuswanger
//URL: http://library.advanced.org/25009
//Purpose: Navigation, real media interface, random trivia generator and image rollovers

//script for the rollovers in the pages

if (parseInt(navigator.appVersion.substring(0,1))>=3) { // 3.0 or greater.
menu1_on = new Image();
menu1_off = new Image();

menu2_on = new Image();
menu2_off = new Image();

menu3_on = new Image();
menu3_off = new Image();

menu4_on = new Image();
menu4_off = new Image();

menu5_on = new Image();
menu5_off = new Image();

menu6_on = new Image();
menu6_off = new Image();

menu7_on = new Image();
menu7_off = new Image();

menu8_on = new Image();
menu8_off = new Image();

menu9_on = new Image();
menu9_off = new Image();

menu10_on = new Image();
menu10_off = new Image();

menu1_on.src = 'media/people.button1b.jpg'
menu1_off.src = 'media/people.button1.jpg'

menu2_on.src = 'media/worldview.button1b.jpg'
menu2_off.src = 'media/worldview.button1.jpg'

menu3_on.src = 'media/causes.button1b.jpg'
menu3_off.src = 'media/causes.button1.jpg'

menu4_on.src = 'media/results.button1b.jpg'
menu4_off.src = 'media/results.button1.jpg'

menu5_on.src = 'media/solutions.button1b.jpg'
menu5_off.src = 'media/solutions.button1.jpg'

menu6_on.src = 'media/experience.button1b.jpg'
menu6_off.src = 'media/experience.button1.jpg'

menu7_on.src = 'media/teach.button1b.jpg'
menu7_off.src = 'media/teach.button1.jpg'

menu8_on.src = 'media/team.button1b.jpg'
menu8_off.src = 'media/team.button1.jpg'

menu9_on.src = 'media/contents.button1b.jpg'
menu9_off.src = 'media/contents.button1.jpg'

menu10_on.src = 'media/interactive.button1b.jpg'
menu10_off.src = 'media/interactive.button1.jpg'
}

function on(image) {
  if (parseInt(navigator.appVersion.substring(0,1))>=3) { // 3.0 or greater.
      imagesrc = eval(image + '_on.src');
      document[image].src = imagesrc;
	  
  }
}

function off(image, index) {
  if (parseInt(navigator.appVersion.substring(0,1))>=3) { // 3.0 or greater.
      imagesrc = eval(image + '_off.src');
      document[image].src = imagesrc;
	  
 }
}

// added script for the status bar messages

function bar(message) { 
  if (parseInt(navigator.appVersion.substring(0,1))>=3) { // 3.0 or greater
window.status = message; return true 
  }
} 

function topArrow(lcoord){
	NS4 = (document.layers) ? 1 : 0;
	IE4 = (document.all) ? 1 : 0;
	V4 = (NS4 || IE4) ? 1 : 0;
	if (!V4) return true;
	arrow = (NS4) ? document.layers['arrowDiv'] : document.all['arrowDiv'];
	if (lcoord == -1) {
		if (NS4) arrow.visibility = "hide";
		if (IE4) arrow.style.visibility = "hidden";
		} else {
		if (NS4) {
			arrow.left = lcoord;
			arrow.visibility = "show";
			}
		if (IE4) {
			arrow.style.pixelLeft = lcoord;
			arrow.style.visibility = "visible";
			}
		}
	return true;
	}

//these functions below are the navigation for the articles
//the team section
function about_jump(){
	//find out what is currently selected
	 var loc=document.info.jumpmenu.options[document.info.jumpmenu.selectedIndex].text;
	//go to selected page
     if (loc == "Jason Tablante"){
          location="about.tablante.html";
     }else if (loc == "Jason Neuswanger"){
          location="about.neuswanger.html";
     }else if (loc == "Wu Lishan"){
          location="about.lishan.html";
     }else if (loc == "Overview"){
          location="about.overview.html";
     }else if (loc == "Thank Yous"){
          location="about.thankyous.html";
	 }else if (loc == "Credits and Resources"){
          location="about.credits.html";
     }else if (loc == "Awards"){
          location="about.awards.html";
     }else if (loc == "Coaches"){
          location="about.coaches.html";
     }else if (loc == "Feedback"){
          location="about.feedback.html";
     }
}

//the experience section
function experience_jump(){
	//find out what is currently selected
	 var loc=document.info.jumpmenu.options[document.info.jumpmenu.selectedIndex].text;
	//go to selected page
     if (loc == "Immersion Program"){
          location="experience.immersion.html";
     }else if (loc == "Tulong Dunong"){
          location="experience.tulongdunong.html";
     }else if (loc == "Jesuit Volunteers"){
          location="experience.jvp.html";
     }else if (loc == "The Calcutta Experience"){
          location="experience.calcutta.html";
     }else if (loc == "Poverty Interview"){
          location="experience.interview.html";
     }
}

//the causes section
function causes_jump(){
	//find out what is currently selected
	 var loc=document.info.jumpmenu.options[document.info.jumpmenu.selectedIndex].text;
	//go to selected page
     if (loc == "Economics"){
          location="causes.economics.html";
     }else if (loc == "Supply and Demand"){
          location="causes.supplydemand.html";
     }else if (loc == "Social/Cultural Issues"){
          location="causes.social.html";
     }else if (loc == "Poverty Cycle"){
          location="causes.cycle.html";
     }else if (loc == "Natural Disasters"){
          location="causes.disasters.html";
	 }else if (loc == "Poor Education"){
          location="causes.education.html";
	 }
}

//the teach section
function teach_jump(){
	//find out what is currently selected
	 var loc=document.info.jumpmenu.options[document.info.jumpmenu.selectedIndex].text;
	//go to selected page
     if (loc == "1) Economic Relevance"){
          location="teach.lesson1.html";
     }else if (loc == "2) Economic Principles"){
          location="teach.lesson2.html";
     }else if (loc == "3) Economic Tasks"){
          location="teach.lesson3.html";
     }else if (loc == "4) Economic Systems"){
          location="teach.lesson4.html";
     }else if (loc == "5) Price Determination"){
          location="teach.lesson5.html";
	 }else if (loc == "6) Justice"){
          location="teach.lesson6.html";
	 }else if (loc == "7) Human Rights"){
          location="teach.lesson7.html";
	 }else if (loc == "8) Poverty Cycle"){
          location="teach.lesson8.html";
	 }else if (loc == "9) 3-Core Values"){
          location="teach.lesson9.html";
	 }else if (loc == "10) Experiments"){
          location="teach.lesson10.html";
	 }else if (loc == "Interactive"){
          location="interactive.html";
	 }else if (loc == "Glossary"){
          location="teach.glossary.html";
	 }
}

//the people section
function people_jump(){
	//find out what is currently selected
	 var loc=document.info.jumpmenu.options[document.info.jumpmenu.selectedIndex].text;
	//go to selected page
     if (loc == "Squatters"){
          location="people.squatters.html";
     }else if (loc == "Street Children"){
          location="people.streetchildren.html";
     }else if (loc == "Rural Farmers"){
          location="people.farmers.html";
     }else if (loc == "Rural Fishermen"){
          location="people.fishermen.html";
     }else if (loc == "Blue Collar Workers"){
          location="people.laborers.html";
	 }
}

//the solutions section
function solutions_jump(){
	//find out what is currently selected
	 var loc=document.info.jumpmenu.options[document.info.jumpmenu.selectedIndex].text;
	//go to selected page
     if (loc == "Justice"){
          location="solutions.justice.html";
     }else if (loc == "Religious Stand"){
          location="solutions.religion.html";
     }else if (loc == "Human Rights"){
          location="solutions.humanrights.html";
     }else if (loc == "DSWD"){
          location="solutions.dswd.html";
     }else if (loc == "PCSO"){
          location="solutions.pcso.html";
	 }else if (loc == "NEDA"){
          location="solutions.neda.html";
	 }else if (loc == "Fil-Mentoring"){
          location="solutions.filmentoring.html";
	 }else if (loc == "PEPE"){
          location="solutions.pepe.html";
	 }else if (loc == "Stairway Foundation"){
          location="solutions.stairway.html";
	 }else if (loc == "PRRM"){
          location="solutions.prrm.html";
	 }else if (loc == "Bantay Bata 163"){
          location="solutions.bantaybata.html";
	 }else if (loc == "UNICEF"){
          location="solutions.unicef.html";
	 }else if (loc == "WHO"){
          location="solutions.who.html";
	 }else if (loc == "Salvation Army"){
          location="solutions.salvationarmy.html";
	 }else if (loc == "Oxfam"){
          location="solutions.oxfam.html";
	 }else if (loc == "StreetCats Foundation"){
          location="solutions.streetcats.html";
	 }else if (loc == "Let The Children Live"){
          location="solutions.childrenlive.html";
	 }else if (loc == "Muslim Aid Australia"){
          location="solutions.muslimaid.html";
	 }
}

//the worldview section
function worldview_jump(){
	//find out what is currently selected
	 var loc=document.info.jumpmenu.options[document.info.jumpmenu.selectedIndex].text;
	//go to selected page
     if (loc == "India"){
          location="worldview.india.html";
     }else if (loc == "Southeast Asia"){
          location="worldview.southeastasia.html";
     }else if (loc == "Latin America"){
          location="worldview.latinamerica.html";
     }else if (loc == "Africa"){
          location="worldview.africa.html";
     }else if (loc == "United States"){
          location="worldview.america.html";
	 }else if (loc == "Japan"){
          location="worldview.japan.html";
	 }else if (loc == "Europe"){
          location="worldview.europe.html";
	 }
}

//the results section
function results_jump(){
	//find out what is currently selected
	 var loc=document.info.jumpmenu.options[document.info.jumpmenu.selectedIndex].text;
	//go to selected page
     if (loc == "Child Labor"){
          location="results.childlabor.html";
     }else if (loc == "Prostitution"){
          location="results.prostitution.html";
     }else if (loc == "Unemployment"){
          location="results.unemployment.html";
     }else if (loc == "Rise of Crime Rate"){
          location="results.crime.html";
     }else if (loc == "Malnutrition"){
          location="results.malnutrition.html";
     }
}

//random trivia
function randomtrivia(){
var trivialines = new Array();
var randomnum = Math.round(Math.random() * 25);
var finaltrivia
trivialines[0] = "In developing countries, 132 million are out of school and 2/3 such figure are women.";
trivialines[1] = "The parents of the kids who are involved in muro-ami gets about Php 2,000 for letting their child work. They receive an additional 1,000 more or so when their child is successful.";
trivialines[2] = "A CD could feed a family of 6?  It was estimated that the daily survival cost of a family of 6 in Metro Manila is about 450 pesos and 445.83 outside Metro Manila.  The daily minimum wage is only 198 pesos and that only fulfills only 44% of their daily needs.";
trivialines[3] = "In the whole world, 855,000,000 people are illiterate.  That is 1/6 of humanity and 2/3 of that are girls.";
trivialines[4] = "Did you know that the added income of the three major oil companies have been earning 29.6M daily because of the subsequent oil price hikes?  This affects all basic goods and commodities and transportation.  With all the prices increasing, when will the wages increase too?";
trivialines[5] = "(1998) Of the total families in the Philippines, only 2.4 percent received any educational/scholarship assistance for tertiary education programs. Of these families, 0.5 percent are poor.";
trivialines[6] = "Poverty is an issue of social inequity.  In 1994, the Family Income Expenditure Survey projected that 20% richest (those belonging to the 9th and 10th decile) account for 51.9% of the total family income of the Philippines.  The first three deciles account for 8.8%.  The richer get such a high income that they are about ½ of the country's total family income.";
trivialines[7] = "Did you know that 53% of the hours of all work in underdeveloped countries are done by women? And in this figure 2/3 are unpaid labor.";
trivialines[8] = "Did you know that most women are wageworkers?  They only earn the minimum wage that does not even compensate their labor justly and are often  small because of exploitation.";
trivialines[9] = "Did you know that the Philippines is the biggest exporter of labor in the world?  In 1997 alone, there were 747,696 overseas Filipino workers deployed.";
trivialines[10] = "Did you know that OFW remittances help keep our economy afloat?  In 1997, $5.7B was remitted to the government.";
trivialines[11] = "Most of the OFW remittances come from the United States with $472.3 M, next is from Saudi Arabia with $98.8 M then from Hong Kong with $12.7 M.";
trivialines[12] = "Most of the OFWs decided to leave the country for a brighter future for their families.  But even before they could leave, they have to pay certain pre-departure fees.  The government earns 25.9 M pesos from sea based and 40.0 M pesos from land based processing fees alone.";
trivialines[13] = "Did you know that out of 11, 407,262 households in 1990, 6, 280, 370 already have electricity?  That is more than 50% of the total households in the country.  A large percentage still depends on Kerosene, Liquefied Petroleum Gas, Oil and other means for their lighting.";
trivialines[14] = "Did you know that the biggest use of land/vegetation in the Philippines is agricultural?  They account for 34%, woodland, while grasslands come in second with 30%.";
trivialines[15] = "Did you know that in the last quarter of 1998 (October), the employment by major industry groups were concentrated in agriculture, fishery and forestry with 11,272 workers out of 28,262?";
trivialines[16] = "Did you know that the unemployment rate in the Philippines shot up from 7.9 in 1997 to 9.4 in 1998?";
trivialines[17] = "Did you know that in 1998 (August), there were a total of 61 Institution/Centers/Facilities involved in the distribution of social services?  12 are involved in child caring, 32 are youth centered/facilities and 9 are substitute homes for women in especially difficult circumstances.";
trivialines[18] = "Did you know that there was a decline from 1997 of facilities for disabled or elderly persons and special groups in the Philippines from 19 centers to only 8 in 1998?";
trivialines[19] = "Did you know that in the Philippines, (1998) the ratio of policemen to population was 1:706 while the ratio of firemen to population was 1:5836?";
trivialines[20] = "Did you know that in 1994, the majority of deaths in the Philippines come from the under one year old age group?  There were 31, 073 cases reported.";
trivialines[21] = "Did you know that in 1990, about a million households in the Philippines still depend on direct natural resources for their drinking water?  They amount to 1,313,963 households that get water from spings, lakes, rivers, etc. About 1,566,243 are from dug wells.";
trivialines[22] = "Did you know that women carry out auxiliary jobs to the major operations of industries?";
trivialines[23] = "Of 72% of all poor households, the highest educational attainment was a primary school education.";
trivialines[24] = "In 1993, the country ranks lowest in primary school completion compared to neighboring countries such as Singapore, China, Thailand, Malaysia and Indonesia.";
trivialines[25] = "In 1992, the country had the highest student-teacher ratio with 34 students to 1 teacher compared to neighboring countries such as Singapore, China, Thailand, Malaysia and Indonesia.";
finaltrivia = "<p align=left>" + trivialines[randomnum] + "</p>";
document.write(finaltrivia);
}

//popup windows
function popup(filename, thewindow, thewidth, theheight, thescrollbar){
var attributes = "width=" + thewidth + ",height=" + theheight + ",scrollbars=" + thescrollbar + ",resizable=0";
window.open(filename, thewindow, attributes);
}