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]="community"
pageNames[12]="youtube"
pageNames[13]="facebook"
pageNames[14]="signup"
pageNames[15]="donate"
pageNames[16]="celebrities"
pageNames[17]="youthambassadors"
pageNames[18]="celeb_stories"
pageNames[19]="karl"
pageNames[20]="contact"
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/30heuresdefamine'
}else if(target=="youtube"){
document.getElementById('contentFrame').src='http://www.youtube.com/user/30heuresdefamine'
}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 = "/fr/index-fr.html#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("Adresse de destinataire non valide. Veuillez entrer de nouveau.")
return(false)
if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.senderEmail.value)){
return(true)}
alert("Adresse d'expéditeur non valide. Veuillez entrer de nouveau.")
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"
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(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(){
jQuery("#close").click(function(){
disablePopup()
})
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);
/* var subPage=document.getElementById('contentFrame').contentWindow.location.href;
var subPage=subPage.substring(sPath.lastIndexOf('/')+1,sPath.lastIndexOf('/')+11);
if (subPage=="karl.html") {

} else */ 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")}}
 
jQuery(document).ready(function(){
checkCookie()
var $panels=jQuery('#slider .panel')
var $container=jQuery('#slider .scrollContainer')
var $scroll=jQuery('#slider .scroll').css('overflow','hidden')
jQuery('#storySubNav .navigation a').click(selectNav)
function selectNav(){
jQuery(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'}
jQuery('#slider').serialScroll(scrollOptions);
jQuery.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)){
jQuery('.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)";
jQuery('#storySubNav .navigation a:eq('+(nextName+14)+')').click()
}else{
jQuery('#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"
}else if(mylang=="english"&&sPage=="index-fr.h"){
document.location.href="../index.asp#index";}}