//put issues list detaill here. first variable is the link, second is description
var detailArray = new Array;
detailArray[0] = ["donate.html", "Monthly giving is the best way to support Freeplay Foundation. A reliable income enables us to make long term commitments to the communities we work with.<br/><br/>Take the cost of your Sunday newspapers and donate it monthly. After just one year you will have helped us provide a Lifeline radio to bring the latest local and international news to 40 people in a rural community in Africa.<br/><br/>Donate just the cost of your Monday morning coffee and you can help us send two Lifeline radios a year to coffee farmers in Rwanda.<br/><br/>Make a monthly donation equal to your home Internet subscription and help us bring  radio to hundreds of children, women and vulnerable people every year.<br/><br />Set up a monthly gift online.<a href=\"donate.html\">here</a>.<br/><br/>Your payment will be processed by our partners WorldPay Plc who specialise in the secure processing of online transactions. The credit card form is secure and all processing of your donation is automatic.<br /><br/>Or, take a few minutes today to complete a monthly order form, send it to us and we will do the rest.<br /><br /><a href=\"documents/UKStandingOrder.pdf\">Download UK Monthly Donor Form Standing order PDF</a><br /><a href=\"documents/FreeplayFoundationUSAMonthlyGiftbyMail.pdf\">Download US Monthly Donor Form US Monthly Gift PDF</a><br/><br /><br/>Download <a href=\"http://www.adobe.com/products/acrobat/readstep2.html\">Adobe Reader</a>"];
detailArray[1] = ["donate.html", "<br/>If you are a UK taxpayer, completing a Gift Aid declaration will increase the value of your donation without costing you a penny. Gift Aid means that for every pound you give, we can claim an extra 28 pence from the Inland Revenue. So a donation of &pound;1 becomes &pound;1.28, &pound;10 becomes &pound;12.80 and &pound;100 becomes &pound;128. Whatever the size of your gift to Freeplay Foundation, Gift Aid it!<br/><br/><img src=\"images/giftAidIt.gif\" alt=\"gift aid it\" width=\"162\" height=\"88\" /></p><p>If you have any queries about how to make your donation to Freeplay Foundation, email<strong> <a href=\"mailto:fundraising@freeplayfoundation.org\">fundraising@freeplayfoundation.org</a></strong></p><br/>"];
detailArray[2] = ["donate.html", "<br/><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"593\" colspan=\"3\"><br/><p>You\'re a few clicks away from changing lives. Remember one Lifeline radio can allow 40 children at once to tune in to education in some of the most remote areas of Africa. <a href=\"documents/GiftAidDeclaration.pdf\">DONATE NOW</a></p><br/><p>A gift of &pound;35, $70 or R450 could send a Lifeline radio to one of our education projects in Africa. Make your cheque out to Freeplay Foundation, and send to one of our offices.</p><br/></td></tr><tr><td width=\"298\" valign=\"top\"><p>Freeplay Foundation<br />71 Gloucester Place<br />London W1U 8JW<br />United Kingdom </p><p>Online Gift Aid Declaration<br />Download a Gift Aid declaration </p><p>Registered Charity No.: 1100340 </p></td><td width=\"298\" valign=\"top\"><p>Freeplay Foundation<br />First Floor, Dunkeld West Centre<br />281 Jan Smuts Avenue<br />Dunkeld West, 2196<br />Johannesburg<br />South Africa </p><p>Section 21 Non-Profit: 2003/014622/08</p></td><td width=\"298\" valign=\"top\"><p>Freeplay Foundation <br />c/o Ubuntu Education Fund <br />32 Broadway, Suite 414<br />New York, NY 10004<br />United States </p><p>We will issue an IRS tax receipt. </p><p>Registered 510 (c) (3) EIN: 13-4133423 </p></td></tr></table><br/>"];
detailArray[3] = ["donate.html", "<br/>Visit <a href=\"http://www.changingthepresent.org/gifts/search?search_text=freeplay+foundation\">Changing The Present</a> and give something different for a special occasion.<br/><br/><a href=\"http://www.changingthepresent.org/nonprofits/show/79\"><img alt=\"ChangingThePresent\" src=\"images/nonprofit_banner_horizontal_banner_79.gif\" style=\"width: 468px; height: 60px;\" /></a><br/>"];
detailArray[4] = ["donate.html", "<br/>Use <a href=\"http://www.goodsearch.com/?charityid=843483\">Goodsearch</a> ($) or <a href=\"http://charities.everyclick.com/info.xq?id=569075\">Everyclick</a> (&pound;) and nominate Freeplay Foundation as your charity. The more you search, the more you raise! <br /><br/><a href=\"http://www.goodsearch.com/?charityid=843483\"><img src=\"images/goodSearch.gif\" alt=\"good search\" style=\"width: 115px; height: 40px;\" border=\"0\" /></a><a href=\"http://charities.everyclick.com/info.xq?id=569075\"><img src=\"images/everyClick.gif\" alt=\"every click\" style=\"width:81px; height: 62px;\" border=\"0\" /></a><br/>"];
detailArray[5] = ["donate.html", "<br/>With payroll giving (or Give As You Earn), tax-free donations are deducted from your salary or occupational pension.&nbsp; This means each &pound;10 you donate will only cost you &pound;7.80 or &pound;6.00 if you\'re a higher rate tax payer. Tell your employer how much, and how often, you would like to give to support the work of the Freeplay Foundation. They may also offer a gift matching scheme for charitable donations. For information on payroll giving in the USA or South Africa, or any queries about how to make your donation to Freeplay Foundation please <a href=\"mailto:fundraising@freeplayfoundation.org\">contact</a> us.<br/>"];
detailArray[6] = ["donate.html", "<br/>You\'re a few clicks away from changing lives. Remember one Lifeline radio can allow 40 children at once to tune in to education in some of the most remote areas of Africa. <a href=\"donate.html\">DONATE NOW</a><br/>"];
detailArray[7] = ["donate.html", "<br/>Sell your unwanted items on eBay and donate the proceeds to Freeplay Foundation.&nbsp; Visit <a href=\"http://www.missionfish.org/NPMMF/nphomepage.jsp?NP_ID=13944\">www.missionfish.org</a> ($) or <a href=\"http://www.missionfish.org.uk/NPMMF/nphomepage.jsp?NP_ID=13982\">www.missionfish.org.uk</a> (&pound;) to find out more.<br/><br/><img src=\"images/ebayForCharity.gif\" alt=\"ebay for charity\" width=\"121\" height=\"64\" /><img src=\"images/missionFish.gif\" alt=\"mission fish\" width=\"155\" height=\"55\" /><br/>"];
detailArray[8] = ["donate.html", "<br/>Nominate Freeplay Foundation to receive all or part of your tax repayment - we can also  reclaim the Gift Aid.&nbsp; Simply quote YAS63GG on your Self Assessment tax return.<br/>"];
detailArray[9] = ["donate.html", "<br/>Many companies will match donations or money raised by employees for charity. Ask your employer about their gift matching scheme and watch your donations double!<br/><br/><img src=\"images/giftAidIt.gif\" alt=\"gift aid it\" width=\"162\" height=\"88\">If you are a UK taxpayer, completing a Gift Aid declaration will increase the value of your donation without costing you a penny.&nbsp; Gift Aid means that for every pound you give, we can claim an extra 28 pence from the Inland Revenue.&nbsp; So a donation of &pound;1 becomes &pound;1.28, &pound;10 becomes &pound;12.80 and &pound;100 becomes &pound;128. Whatever the size of your gift to Freeplay Foundation, Gift Aid it!<br/>"];

//put subnav here. first variable is the link, second is title
var subnavArray = new Array;
subnavArray[0] = [];
subnavArray[1] = [["who_we_are.html", "Who we are"],["how_we_do_it.html", "How we work"],["our_values.html", "Our values"],["history.html", "Our History"],["our_boards.html", "Our Boards"],["team.html", "Our Team"],["faqs.html", "FAQs"],["contact_us.html", "Contact us"]];
subnavArray[2] = [["issues_in_focus.html","Issues in Focus"],["agriculture.html", "Agriculture"],["education.html", "Education"],["emergencies.html", "Emergencies"],["enterprise.html", "Enterprise"],["environment.html", "Environment"],["health.html", "Health"],["information.html", "Information"],["peacemaking.html", "Peacemaking"]];
subnavArray[3] = [["ei_index.html", "Technologies"],["lifeline_radio.html", "Lifeline Radio"],["lifelight.html", "Lifelight"],["weza.html", "Weza"]];
subnavArray[4] = [["where_we_work.html", "Where we work"],["http://freeplayfoundation.org/blog/category/updates-from-field/", "Updates from the field"],["photo_gallery.html", "Photo Gallery"],["testimonials.html", "Testimonials"],["project_archive.html", "Project Archive"]];
subnavArray[5] = [["donate.html", "Ways To Donate"],["volunteer.html", "Volunteer Opportunities"],["become_fundraiser.html", "become a fundraiser"],["your_donation.html", "How We Use Your Donation"],["project_in_focus.html", "Project In Focus"],["our_fundraisers.html", "Our Fundraisers"],["our_friends.html", "Our Friends"]];
subnavArray[6] = [["news_index.html", "Highlights"],["mediacentre_videos.html", "Videos"],["press_clippings.html", "Stories in the News"],["news_release.html", "Press Releases"],["award_recognition.html","Awards &amp; Recognition"]];
subnavArray[7] = [["our_ambassadors.html", "Freeplay Foundation Ambassadors"],["tomhanks.html", "Tom Hanks"],["sibusisovilane.html", "Sibusiso Vilane"],["terrywaite.html", "Terry Waite (CBE)"]];


function showDetail(obj){ 
	if (document.getElementById("issuesList")) {
		var objL = document.getElementById("issuesList").getElementsByTagName("LI");
		var i = objL.length;
		while(i-->0) {   // LOOP THROUGH THE A's
			objL[i].className = ""; // turn off As
			if (objL[i].childNodes[1]){
				objL[i].removeChild(objL[i].childNodes[1]);
			}
		}

		obj.parentNode.className = "on";
		var detail = document.createElement("p");
		/*detail.innerHTML = detailArray[obj.parentNode.id.substring(6,7)][1] + '<br/><a href="' + detailArray[obj.parentNode.id.substring(6,7)][0]+'">see more &gt;&gt;</a>'*/
		detail.innerHTML = detailArray[obj.parentNode.id.substring(6,7)][1] + '<br/><a href="' + detailArray[obj.parentNode.id.substring(6,7)][0]+'"></a>'
		obj.parentNode.appendChild(detail);
	
	}
}

function showSubNav(obj,page){ 
	if (document.getElementById("leftNav")) {
		var objL = document.getElementById("leftNav").getElementsByTagName("LI");
		var i = objL.length;
	    if(obj.parentNode.className!="on"){
		    while(i-->0) {   // LOOP THROUGH THE LI's
				objL[i].className = ""; // turn off Lis
				if (objL[i].childNodes[1]){
					objL[i].removeChild(objL[i].childNodes[1]);
				}
			}
			obj.parentNode.className = "on";
			var detail = document.createElement("ul");
			for (var j=0; j< subnavArray[obj.parentNode.id.substring(3,4)].length; j++){
				detailLi = document.createElement("li");
				if (page.toLowerCase() == (subnavArray[obj.parentNode.id.substring(3,4)][j][1]).toLowerCase()){
				detailLi.innerHTML = '<a href ="'+subnavArray[obj.parentNode.id.substring(3,4)][j][0]+'" class="on"><span>'+subnavArray[obj.parentNode.id.substring(3,4)][j][1]+'</span></a>';
				}else{
				detailLi.innerHTML = '<a href ="'+subnavArray[obj.parentNode.id.substring(3,4)][j][0]+'"><span>'+subnavArray[obj.parentNode.id.substring(3,4)][j][1]+'</span></a>';
				}
				detail.appendChild(detailLi);
			}
			obj.parentNode.appendChild(detail);
		}else{
		    
			obj.parentNode.className = "";
			obj.parentNode.removeChild(obj.parentNode.lastChild);
		}

	}
}
var newsArray = new Array;
newsArray[0] = ["#","Our South African Freeplay Foundation Ambassador, Sibusiso Vilane, is on his way to the South Pole and is dedicating every kilometer he walks to ensure Lifeline radios are delivered to the vulnerable children of South Africa."]
newsArray[1] = ["#","The Freeplay Foundation is delighted to announce that our CEO, Kristine Pearson, has been named one of TIME magazine's Heroes of the Environment for 2007."]
newsArray[2] = ["#","Womens associations in Chepkopia receive 20 Lifeline radios in their efforts to promote peace and assist with the social economic development in the district."]
newsArray[3] = ["#","Reuters teams rally to support Lifeline Radios for Zambia"]
newsArray[4] = ["#","Tom Hanks and Rita Wilson fund 500 Lifeline Radios to Rwanda"]

var the_count = 0;
var the_timeout;
function doTimer(){
	var obj = document.getElementById("newsRotate");
	obj.innerHTML = '<p>'+newsArray[the_count][1]+' <a href="'+newsArray[the_count][0]+'">read more &gt;&gt;</a></p>';
	the_count += 1;
	the_count = (the_count)%(newsArray.length);
	the_timeout = setTimeout("doTimer();", 4000);
}

var galleryArray = new Array;
galleryArray[0] = ["Mozambique", "images/gallery_images_1.jpg"]
galleryArray[1] = ["Mozambique", "images/gallery_images_2.jpg"]
galleryArray[2] = ["Mozambique", "images/gallery_images_3.jpg"]
galleryArray[3] = ["Mozambique", "images/gallery_images_4.jpg"]
galleryArray[4] = ["Mozambique", "images/gallery_images_5.jpg"]
galleryArray[5] = ["Mozambique", "images/gallery_images_6.jpg"]
galleryArray[6] = ["Mozambique", "images/gallery_images_7.jpg"]
galleryArray[7] = ["Mozambique", "images/gallery_images_8.jpg"]
galleryArray[8] = ["Mozambique", "images/gallery_images_9.jpg"]
galleryArray[9] = ["Mozambique", "images/gallery_images_10.jpg"]

function updateGallery(pageNumber){
	var photoGalleryObj = document.getElementById("photoGalleryDiv");
	
	while( photoGalleryObj.hasChildNodes() )
    {
        photoGalleryObj.removeChild(photoGalleryObj.lastChild);
    }
	
	var head = document.createElement("h2");
	head.className="hdGreen";
	var prev ='<span class="pages">page ';
	var next ='</span>Photo Gallery';
	
	if ((pageNumber>0)&&(pageNumber<Math.ceil(galleryArray.length/8))){
		next = ' <a href="#" onclick="updateGallery('+(pageNumber+1)+');return false;"><img src="images/arrow_right.gif" alt=""></a></span>Photo Gallery'
	}
	
	if (pageNumber>1){
		prev = '<span class="pages"><a href="#" onclick="updateGallery('+(pageNumber-1)+');return false;"><img src="images/arrow_left.gif" alt=""></a> page ' 
	}
	head.innerHTML = prev+pageNumber+' of '+Math.ceil(galleryArray.length/8)+next;
	
	var galleryList = document.createElement("ul");
	galleryList.setAttribute("id","photoGallery");
	
	for (var i=0;i<=7;i++){
		var theClassName = "";
		if (((i+1)%4)==0){
			theClassName = "rightest";
		}
		
		if(galleryArray[i+(pageNumber-1)*8]){
			var galleryListItem = document.createElement("li")
			galleryListItem.className = theClassName;
			galleryListItem.innerHTML = '<img src="'+galleryArray[i+(pageNumber-1)*8][1]+'" alt="" width="148" height="148" border="0"><br>' +galleryArray[i+(pageNumber-1)*8][0];
			galleryList.appendChild(galleryListItem);
		}
	}
	var clearDiv = document.createElement("div");
	clearDiv.className = "cl";
    photoGalleryObj.appendChild(head);
	photoGalleryObj.appendChild(galleryList);
	photoGalleryObj.appendChild(clearDiv);
}



function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
