// Rotating Did You Know Facts

numOfFacts = 5;

fact = new Array(numOfFacts);

// Create each quote - start with '0', so 5 Facts = '0' through '4' */
//fact[1] = "Landmines and other explosive remnants of war injure or kill between 15,000 and 20,000 people annually.";
//fact[2] = "Six countries that have not joined the mine-ban treaty still hold an estimated 180 million stockpiled landmines.";
//fact[3] = "As of September 2004, 143 countries had ratified or acceded to the antipersonnel mine-ban treaty.  These include:<br><br><li>Every country in the Americas except Cuba, Haiti and the United States.<br><br><li>Every member of the European Union except Finland, Latvia and Poland.<br><br><li>All sub-Saharan African countries except Somalia.";


fact[1] = "There are 78 countries thought to be affected to some extent by landmines or explosive remnants of war.";
fact[2] = "152 countries participate in the anti-personnel mine-ban treaty, as of 4 January 2007. ";
fact[3] = "Forty countries were not participating in the anti-personnel mine-ban treaty as of 4 January 2007. ";
fact[4] = "An estimated 178 million anti-personnel landmines are still stockpiled by 50 countries. ";
fact[5] = "Between 15,000 and 20,000 new victims are claimed by landmines and explosive remnants of war every year. ";


 

function RandomNumber(max) {  
	var now = new Date();
	var number = (Math.round((Math.abs(Math.sin(now.getTime()))*1000))%max) + 1;
	return number;
}

var quoteNum = RandomNumber(numOfFacts);

var DYKtext = fact[quoteNum];


// Rollover Variables and Function
var goodToGo = "no";


// Rollovers
topbtn = new Image(); topbtn.src = "images/btn_mineaction.gif";
topbtn_hi = new Image(); topbtn_hi.src = "images/btn_mineaction_hi.gif";

backbtn = new Image(); backbtn.src = "images/btn_back.gif";
backbtn_hi = new Image(); backbtn_hi.src = "images/btn_back_hi.gif";

sub1 = new Image(); sub1.src = "images/btn_see_video.gif";
sub1_hi = new Image(); sub1_hi.src = "images/btn_see_video_hi.gif";

sub2 = new Image(); sub2.src = "images/btn_read_chroek.gif";
sub2_hi = new Image(); sub2_hi.src = "images/btn_read_chroek_hi.gif";

sub3 = new Image(); sub3.src = "images/btn_jose_angola.gif";
sub3_hi = new Image(); sub3_hi.src = "images/btn_jose_angola_hi.gif";

sub4 = new Image(); sub4.src = "images/btn_chroek_nuch.gif";
sub4_hi = new Image(); sub4_hi.src = "images/btn_chroek_nuch_hi.gif";

adopt = new Image(); adopt.src = "images/btn_adopt.gif";
adopt_hi = new Image(); adopt_hi.src = "images/btn_adopt_hi.gif";

stopland = new Image(); stopland.src = "images/btn_stoplandmines.gif";
stopland_hi = new Image(); stopland_hi.src = "images/btn_stoplandmines_hi.gif";

thisland = new Image(); thisland.src = "images/btn_thislandwasmine.gif";
thisland_hi = new Image(); thisland_hi.src = "images/btn_thislandwasmine_hi.gif";



function flash(imageName,imageFile) {
	if(document.images && goodToGo == "yes") {
		eval('document.images[imageName].src = '+imageFile+'.src');
	}
}

/* 
 *************************************************** 
 ******Ê CENTERED POPUP SCRIPT 
 ******Ê created mostly by TED P. 
 ******Ê a little bit by GABRIEL R. 
 ******Ê mod. date: 09/24/03 
 ******Ê version : 1.0 
 *************************************************** 
*/ 

// Initizalize Vars 
var calledPage = ''; 
var openHeight = ''; 

// centeredPopup() 
// This is the main function called to call for a popup 
// Args: thePage = The page put into the popup 
//       theWidth = The width of the popup 
//       theHeight = The height of the popup (100>750) 
// 
function centeredPopup(thePage, theWidth, theHeight) {
      calledPage = thePage 
      openHeight = theHeight 
      openWidth = theWidth 
      if (window.popWin) { 
         if (!window.popWin.closed) { 
            window.popWin.close(); 
         } 
         delayToEnsurePopperPop = setTimeout("popperFunc(calledPage,openWidth,openHeight);",500); 
      } else { 
         popperFunc(thePage,openWidth,openHeight); 
      } 
   } 

// popperFunc() 
// This is a private function used by popup() and 
// should not be called directly from a page 
function popperFunc(thePage, theWidth, theHeight) { 
      if (!theHeight || theHeight > 750) theHeight = 750; 
      if (theHeight < 100) theHeight = 100; 
      var winl = Math.floor((screen.width - theWidth) / 2); 
      var wint = Math.floor((screen.height - theHeight) / 2); 
       
      popWin = window.open(thePage, 'popWin', 'width='+theWidth+',height='+theHeight+',top='+wint+',left='+winl+',toolbar=no,scrollbars=no,resizable=no,dependent=yes');
      if (window.popWin.focus()) setTimeout("focusPopper();",200); 
} 

// focusPopper() 
// A simple focus function 
function focusPopper() { 
	window.popWin.focus(); 
} 