// JavaScript Document

/*Creating functions for writing breadcrumbs*/

function breadcrumb_everypage () {
	document.write("<a href='../../../index.php'>" + "Home<\/a>" + " > ");
	document.write("<a href='../../programmes/programmes_home.html'>" + "Programmes<\/a>" + " > ");
	document.write("<a href='programmes_children.html'>" + "Children & Youth Home<\/a>");
}

function breadcrumb_aboutUs () {
	document.write(" > " + "<a href='about_us.html'>" + "About Us<\/a>");
}
function breadcrumb_contactUs () {
	document.write(" > " + "<a href='contact_us.html'>" + "Contact Us<\/a>");
}
function breadcrumb_media () {
	document.write(" > " + "<a href='media.html'>" + "Media<\/a>");
}
function breadcrumb_aboutUs_more () {
	document.write(" > " + "<a href='aboutus_more.html'>" + "More about Children &amp; Youth<\/a>");
}
function breadcrumb_partnerships () {
	document.write(" > " + "<a href='partnerships.html'>" + "Partnerships<\/a>");
}
function breadcrumb_photoGallery () {
	document.write(" > " + "<a href='photo_gallery.html'>" + "Photo Gallery<\/a>");
}
function breadcrumb_programs () {
	document.write(" > " + "<a href='whatwedo.html'>" + "What We Do<\/a>");
}
function breadcrumb_tools () {
	document.write(" > " + "<a href='tools.html'>" + "Tools<\/a>");
}
function breadcrumb_sisi () {
	document.write(" > " + "<a href='sisi_aminata.html'>" + "Sisi Aminata<\/a>");
}
function breadcrumb_videoGallery () {
	document.write(" > " + "<a href='video_gallery.html'>" + "Video Gallery<\/a>");
}
function breadcrumb_wncac () {
	document.write(" > " + "<a href='wncac.html'>" + "WNCAC<\/a>");
}
function breadcrumb_wncac_archive () {
	document.write(" > " + "<a href='wncac_archive.html'>" + "WNCAC Archive<\/a>");
}
function breadcrumb_wncac_meetings () {
	document.write(" > " + "<a href='wncac_meetings.html'>" + "WNCAC Meetings<\/a>");
}
function breadcrumb_wncac_photos () {
	document.write(" > " + "<a href='wncac_photos.html'>" + "WNCAC Photos<\/a>");
}
function breadcrumb_wncac_resources () {
	document.write(" > " + "<a href='wncac_resources.html'>" + "WNCAC Resources<\/a>");
}


/*POP UP FLYER FUNCTION*/
	function openFlyer(pic){
		window.open(pic,"popup","resizable=1,height=600");
		}
	//preloading flyer image
	var image = new Image ();
	image.src="../pdf/toolkit.pdf";


/*FEATURED PROGRAM/STORY FOR CHILDREN AND YOUTH*/

/*used for testing
var now = new Date("3/20/2009 0:00");*/

function featured () {
	var now = new Date ();
	var day = now.getDay()+1;
	var month = now.getMonth()+1;
	var date = now.getDate();
	var year = now.getFullYear();
	
	if (day>4 && day<=6) {
	document.write("<h2>" + "Program Highlight: Angola" + "<\/h2>");
	document.write("<div class='float-left'>" + "<img src='images/smaller_images/angola_small.jpg' />" + "<\/div>");
	document.write("<p>" + "In Angola, a School Parliament Project is giving students a hands-on lesson in democracy. The project educates key youth about the practices and principles of democracy, foster interaction and dialogue among youth, and create a forum for the Angolan government to engage in policy and development strategy dialogue. This lesson comes at an important time as September 2008 marked the first Angolan elections in 16 years." + 
"<br>" + "<a href=''>" + "Read More" + "<\/a>" + ".<\/p>");
	}
else if (day>2 && day<=4) {
	document.write("<h2>" + "Program Highlight: Guinea" + "<\/h2>");
	document.write("<div class='float-left'>" + "<img src='images/smaller_images/guinea_featured_country_img.jpg' width='130'>" + "<\/div>");
	document.write("<p>" + "For the past two years, Children and Youth staff in Guinea have trained more than 800 youths in " + "non-violence and civic engagement with the help of two SFCG mini-grants. The program is design to not only train youths" + " in core strategies for nonviolence and human rights, but also to create a space for important messages to reach a broader" + " audience in two geographic areas of Guinea." + 
"<br>" + "<a href='whatwedo.html'>" + "Read More" + "<\/a>" + ".<\/p>");
	}
else if (day>0 && day<=2) {
	document.write("<h2>" + "Program Highlight: Indonesia" + "<\/h2>");
	document.write("<div class='float-left'>" + "<img src='images/smaller_images/featured_indonesia.jpg' width='137'>" + "<\/div>");
	document.write( "<p>" + "Youth are often marginalized in the development and peace building process, but SFCG-Indonesia seeks to address this opportunity gap with the Aceh Youth Radio Program.  In a country where youth make up approximately 50% of prisoners, 60% of the people living with HIV/AIDS, and 40% of combatants, the program provides much needed space for a youth perspective. As youth voices become more prominent, their experiences and needs have begun to influence the decision making process that leads to policy in peace and development, resulting in policies that are more responsive to youth’s specific needs." + 
"<br>" + "<a href='whatwedo.html'>" + "Read More" + "<\/a>" + ".<\/p>");
	}
else {
	document.write("<h2>" + "Featured Story" + "<\/h2>");
	document.write("<div class='float-left'>" + "<img src='images/smaller_images/angola_small.jpg' />" + "<\/div>");
	document.write("<p>" + "In Angola, a School Parliament Project is giving students a hands-on lesson in democracy. The project aimed to educate key youth about the practices and principles of democracy, foster interaction and dialogue among youth, and create a forum for the Angolan government to engage in policy and development strategy dialogue. This lesson comes at an important time as September 2008 marked the first Angolan elections in 16 years." + 
"<br>" + "<a href='whatwedo.html'>" + "Read More" + "<\/a>" + ".<\/p>");
	}
}

/*FOR PHOTO SLIDESHOW (MANUALLY ADVANCED) IN WNCAC PHOTOS PAGE*/

/*TRYING ANOTHER WAY, WHERE IMAGE CAPTIONS ARE TEXT, NOT IMAGES*/
captions = [ "WNCAC members networking prior to the 2/13/09 event", 
             "Youth Unemployment attracted the largest turnout to date for WNCAC on 2/13/09",
             "WNCAC members prepare to discuss the issue of youth unemployment in crisis settings on 2/13/09",
             "Mark Hamilton engages with WNCAC members about youth incentives for mobilization" ];

files = ["2009-01-1.jpg", "2009-01-2.jpg", "2009-01-3.jpg", "WNCAC-2.jpg"];

// pre-load the images

images = new Array();
i = 0;
while( i < files.length ) {
    images[i] = new Image();
    images[i].src="../images/wncac/"+files[i];
    i = i + 1;
}

var current = 0;

function nextSlide() {
    current = current+1;
    if( current >= images.length ) {
        current = 0;
    }
    document.slide.src = images[current].src;
    document.fred.box.value = captions[current];
}

function prevSlide() {
    current = current - 1;
    if( current < 0 ) {
        current = images.length - 1;
    }
    document.slide.src = images[current].src;
    document.fred.box.value = captions[current];
}

