function silentErrorHandler(){return true;}
window.onerror=silentErrorHandler
function checkHash(){
var pageNames=new Array()
pageNames[0]="index"
pageNames[1]="about"
pageNames[2]="faq"
pageNames[3]="prizes"
pageNames[4]="top10"
pageNames[5]="wherethemoneygoes"
pageNames[6]="stories"
pageNames[7]="planning"
pageNames[8]="wrappingup"
pageNames[9]="promote"
pageNames[10]="organize"
pageNames[11]="nightof"
pageNames[12]="community"
pageNames[13]="flikr"
pageNames[14]="youtube"
pageNames[15]="feed"
pageNames[16]="facebook"
pageNames[17]="signup"
pageNames[18]="donate"
pageNames[19]="signin"
pageNames[20]="celebrities"
pageNames[21]="youthambassadors"
pageNames[22]="celeb_stories"
pageNames[23]="contact"
pageNames[24]="haiti"
pageNames[25]="downloads"
pageNames[26]="survey"
pageNames[27]="kombo"
var pageFound=false
if(window.location.hash){
var target=window.location.hash.substring(1,window.location.hash.length)
target=target.toLowerCase()
if(target=="facebook"){
document.getElementById('contentFrame').src='http://www.facebook.com/30HRFamine'
}else if(target=="youtube"){
document.getElementById('contentFrame').src='http://www.youtube.com/30HourFamineCanada'
}else if(target=="flikr"){
document.getElementById('contentFrame').src='http://www.flickr.com/photos/30hrfamine/'
}else if(target=="index"){
document.getElementById('contentFrame').src='home.html'
}else{
var pageNameLength=pageNames.length
for(var i=0;i<pageNameLength;i++){
if(pageNames[i].match(target)){
pageFound=true}}
if(pageFound==true){
document.getElementById('contentFrame').src=target+'.html'
}else{
document.getElementById('contentFrame').src='home.html'}
}
} else {
window.location = "index.asp#index"
}
}
function resize_iframe(){
var height=window.innerWidth
if(document.body.clientHeight){
height=document.body.clientHeight}
document.getElementById("contentFrame").style.height=parseInt(height-
document.getElementById("contentFrame").offsetTop-1)+"px"}
window.onresize=resize_iframe
function hideCallbox(cbHidden){
if(cbHidden==false){
document.getElementById("callBoxes").style.display="block"
}else{
document.getElementById("callBoxes").style.display="none"}}
function hideToolbar(hideMe){
if(hideMe=='true'){
document.getElementById("footer").style.display="none"
document.getElementById("subNav").style.display="none"
document.getElementById("miniLogo").style.display="none"
document.getElementById("showFooter").style.display="block"
document.getElementById("push").style.height="115px"
}else{
document.getElementById("showFooter").style.display="none"
document.getElementById("subNav").style.display="block"
document.getElementById("miniLogo").style.display="block"
document.getElementById("footer").style.display="block"
document.getElementById("push").style.height="68px"}}
function checkEmail(myForm){
if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.recipientEmail.value)){
return(true)}
alert("Invalid Recipient E-mail Address. Please re-enter.")
return(false)
if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.senderEmail.value)){
return(true)}
alert("Invalid Sender E-mail Address. Please re-enter.")
return(false)}
var currentTab=1
var currentWidth
function tabOver(whichTab){
if(whichTab){
document.getElementById("tabButton1").style.backgroundPosition="center 5px"
document.getElementById("tabButton2").style.backgroundPosition="center 5px"
document.getElementById("tabButton3").style.backgroundPosition="center 5px"
document.getElementById("tabButton4").style.backgroundPosition="center 5px"
document.getElementById("tabButton"+whichTab).style.backgroundPosition="bottom center"
if(whichTab==1){
document.getElementById("tabButton"+whichTab).style.width="175px"
}else if(whichTab==2){
document.getElementById("tabButton"+whichTab).style.width="132px"
}else if(whichTab==3){
document.getElementById("tabButton"+whichTab).style.width="172px"
}else if(whichTab==4){
document.getElementById("tabButton"+whichTab).style.width="88px"}
}else if(whichTab==4){
document.getElementById("tabButton"+whichTab).style.width="88px"}
else{
document.getElementById("tabButton1").style.backgroundPosition="center 5px"
document.getElementById("tabButton2").style.backgroundPosition="center 5px"
document.getElementById("tabButton3").style.backgroundPosition="center 5px"
document.getElementById("tabButton4").style.backgroundPosition="center 5px"
document.getElementById("tabButton1").style.width="171px"
document.getElementById("tabButton2").style.width="126px"
document.getElementById("tabButton3").style.width="170px"
document.getElementById("tabButton4").style.width="82px"
document.getElementById("tabButton"+currentTab).style.backgroundPosition="bottom center"
document.getElementById("tabButton"+currentTab).style.width=currentWidth}}
function showHide(showThis){
if(showThis){
document.getElementById("tab1").style.display="none"
document.getElementById("tab2").style.display="none"
document.getElementById("tab3").style.display="none"
document.getElementById("tab4").style.display="none"
document.getElementById("tab"+showThis).style.display="block"
document.getElementById("tabButton1").style.backgroundPosition="center 5px"
document.getElementById("tabButton2").style.backgroundPosition="center 5px"
document.getElementById("tabButton3").style.backgroundPosition="center 5px"
document.getElementById("tabButton4").style.backgroundPosition="center 5px"
document.getElementById("tabButton1").style.cursor="pointer"
document.getElementById("tabButton2").style.cursor="pointer"
document.getElementById("tabButton3").style.cursor="pointer"
document.getElementById("tabButton4").style.cursor="pointer"
document.getElementById("tabButton"+showThis).style.backgroundPosition="bottom center"
document.getElementById("tabButton"+showThis).style.cursor="default"
document.getElementById("tabButton1").style.width="171px"
document.getElementById("tabButton2").style.width="126px"
document.getElementById("tabButton3").style.width="170px"
document.getElementById("tabButton4").style.width="82px"
if(showThis==1){
document.getElementById("tabButton"+showThis).style.width="175px"
}else if(showThis==2){
document.getElementById("tabButton"+showThis).style.width="132px"
}else if(showThis==3){
document.getElementById("tabButton"+showThis).style.width="172px"
}else if(showThis==4){
document.getElementById("tabButton"+showThis).style.width="88px"}
currentWidth=document.getElementById("tabButton"+showThis).style.width
currentTab=showThis
}else{
document.getElementById("tab2").style.display="none"
document.getElementById("tab3").style.display="none"
document.getElementById("tab4").style.display="none"
document.getElementById("tabButton1").style.backgroundPosition="bottom center"
currentWidth="175px"}}
var popupStatus=0
var currentDiv="#popup"
function loadPopup(mydiv){
currentDiv=mydiv
if(popupStatus==0){
jQuery("#backgroundPopup").css({
"opacity": "0.5"
})
jQuery("#backgroundPopup").fadeIn("slow")
jQuery(mydiv).fadeIn("slow")
jQuery("#close").fadeIn("slow")
popupStatus=1}}
function disablePopup(){
if(popupStatus==1){
jQuery("#backgroundPopup").fadeOut("slow")
jQuery(currentDiv).fadeOut("slow")
jQuery("#close").fadeOut("slow")
popupStatus=0}}
function centerPopup(myDiv){
var windowWidth=document.documentElement.clientWidth
var windowHeight=document.documentElement.clientHeight
var popupHeight=jQuery(myDiv).height()
var popupWidth=jQuery(myDiv).width()
jQuery(myDiv).css({
"position": "absolute",
"top": windowHeight/2-popupHeight/2,
"left": windowWidth/2-popupWidth/2
})
jQuery("#backgroundPopup").css({
"height": windowHeight
})}
jQuery(document).ready(function(){


<!--  TIME CHECKER  -->
var target=window.location.hash.substring(1,window.location.hash.length)
target=target.toLowerCase()
if(target=="home" || target=="home1" || target=="home2" || target=="home3" || target=="home4" || target=="home5" || target=="home5b" || target=="index" || target=="thankyou"){

	var today = get_cookie("FamineDate");
	var hour = get_cookie("FamineHour");
	
	if (today < "12") {
		document.getElementById('contentFrame').src = "home.html"
	} else if (today == "12") {
		document.getElementById('contentFrame').src = "home1.html"
	} else if (today == "13") {
		document.getElementById('contentFrame').src = "home2.html"
	} else if (today == "14") {
		document.getElementById('contentFrame').src = "home3.html"
	} else if (today == "15") {
		document.getElementById('contentFrame').src = "home4.html"
	} else if (today == "16") {
		if (hour < "20") {
			document.getElementById('contentFrame').src = "home5.html"
		} else if (hour >= "20") {
			document.getElementById('contentFrame').src = "home5b.html"
		}
	} else if (today > "16") {
		document.getElementById('contentFrame').src = "thankyou.html"
	}
}

<!--  END TIME CHECKER  -->
jQuery("#close").click(function(){
disablePopup()
})
jQuery("#nextYear").click(function(){
loadPopup("#nextYearUp");
})

jQuery("#close2").click(function(){
disablePopup()
})
jQuery("#backgroundPopup").click(function(){
disablePopup()
})
jQuery(document).keypress(function(e){
if(e.keyCode==27&&popupStatus==1){
disablePopup()}
})
})
var storyNames=new Array()
storyNames[0]="Eliza"
storyNames[1]="Jabbie & Jengo"
storyNames[2]="Anitha"
storyNames[3]="Rachel"
storyNames[4]="Jean"
storyNames[5]="Nachugai"
storyNames[6]="Djelika"
storyNames[7]="Noura"
storyNames[8]="Warejia"
storyNames[9]="Byamungu"
storyNames[10]="Joshua"
storyNames[11]="Vivian"
storyNames[12]="Fred"
storyNames[13]="Oumou"
storyNames[14]="Jamvura"
var nextName=1
var prevName=14
function checkCookie(){
var sPath=window.top.location.pathname
var sPage=sPath.substring(sPath.lastIndexOf('/')+1,sPath.lastIndexOf('/')+11)
if(get_cookie("FamineLanguage")=="francais"&&sPage=="/index.asp"){
document.location.href="/fr/index-fr.html"
}else if(get_cookie("FamineLanguage")=="english"&&sPage=="index-fr.h"){
document.location.href="/index.asp"
}else if(get_cookie("FamineLanguage")=="" || get_cookie("FamineLanguage")==null) {
jQuery("#backgroundPopup").css({
"opacity": "0.55"
})
jQuery("#backgroundPopup").fadeIn("slow")
jQuery("#lang").fadeIn("slow")}}
$(document).ready(function(){
checkCookie()
var $panels=$('#slider .panel')
var $container=$('#slider .scrollContainer')
var $scroll=$('#slider .scroll').css('overflow','hidden')
$('#storySubNav .navigation a').click(selectNav)
function selectNav(){
$(this)
.parents('ul:first')
.find('li')
.removeClass('selected')
.end()
.end()
.parents('li:first')
.addClass('selected')
.end()
.end()}
var scrollOptions={
target: $scroll,
items: $panels,
navigation: '#storySubNav .navigation a',
prev: '.left',
next: '.right',
axis: 'xy',
duration: 500,
easing: 'swing'}
$('#slider').serialScroll(scrollOptions);
$.localScroll(scrollOptions)
if(window.location.hash){
var target=window.location.hash.substring(2,window.location.hash.length)
for(var i=0;i<storyNames.length;i++){
if(storyNames[i].match(target)){
$('.storySubNav .navigation a:eq('+i+')').click()
getName(i)}}
}else{
getName('0')}
})
function getName(direction){
if(direction=='forward'){
if(nextName==1){
nextName++
prevName=0
}else if(nextName==14){
nextName=0
prevName++
}else{
nextName++
prevName++}
}else if(direction=='back'){
if(nextName==0){
nextName=14
prevName--
}else if(prevName==0){
nextName--
prevName=14
}else{
nextName--
prevName--}
}else if(direction){
var yourInt=parseInt(direction)
if(yourInt=='0'){
nextName=1
prevName=14
}else if(yourInt==14){
nextName=0
prevName=yourInt-1
}else{
nextName=yourInt+1
prevName=yourInt-1}}
document.getElementById("leftArrow").innerHTML=storyNames[prevName]
document.getElementById("rightArrow").innerHTML=storyNames[nextName]
var nextImage="url('images/stories/"+nextName+".jpg')";
document.getElementById("body").style.backgroundImage = nextImage;
if(nextName==0){
document.getElementById("body").style.backgroundImage = "url(images/stories/15.jpg)";
$('#storySubNav .navigation a:eq('+(nextName+15)+')').click()
}else{
$('#storySubNav .navigation a:eq('+(nextName-1)+')').click()}}
function set_cookie(name,value,exp_y,exp_m,exp_d,path,domain,secure){
var cookie_string=name+"="+escape(value)
if(exp_y){
var expires=new Date(exp_y,exp_m,exp_d)
cookie_string+="; expires="+expires.toGMTString()}
if(domain)
cookie_string+="; domain="+escape(domain)
if(secure)
cookie_string+="; secure"
cookie_string+="; path=/"
document.cookie=cookie_string}
function get_cookie(cookie_name){
var results=document.cookie.match('(^|;) ?'+cookie_name+'=([^;]*)(;|$)')
if(results)
return(unescape(results[2]))
else
return null}
function delete_cookie(cookie_name){
document.cookie = 'FamineLanguage=expired; expires=Fri, 31 Dec 2009 05:00:00 GMT; path=/;';}
function setLang(mylang){
delete_cookie("FamineLanguage")
set_cookie("FamineLanguage",mylang,2010,11,31,"","","")
jQuery("#lang").fadeOut("slow")
jQuery("#backgroundPopup").fadeOut("slow")
var sPath=window.location.pathname
var sPage=sPath.substring(sPath.lastIndexOf('/')+1,sPath.lastIndexOf('/')+11)
if(mylang=="francais"){
document.location.href="/fr/index-fr.html#index";
}}