﻿$(document).ready(function() {
    $('.slideshow').cycle({
        fx: 'fade',     // choose your transition type, ex: fade, scrollUp, shuffle, etc...
        speed: 500,
        timeout: 7000		
    });
});


var donateDefaultText = "You have the power to change a child’s life ";
var volunteerDefaultText = "You can make a difference today ";
var getInvolvedDefaultText = "Take charge and show your support ";
var countries = ['international/', 'canada/', 'norway', 'netherlands', 'switzerland', 'uk', 'usa', 'fr-ca'];


function Donate() {
    var currentCountry = GetCurrentCountry();
    if (currentCountry !== null && currentCountry.length > 0) {
        if (currentCountry === 'switzerland') {
            document.write('<H3><IMG alt="Donate" src="/Style%20Library/Images/RightToPlay/title-donate-se.gif" width=149 height=12></H3>So können Sie das Leben eines Kindes verändern </DIV><A class=rtp-plus-icon href="/switzerland/get-involved/Pages/Spendenm%c3%b6glichkeiten.aspx">Expand</A>');
        }
        else if (currentCountry === 'netherlands') {
            document.write('<H3><IMG alt="Donate" src="/Style%20Library/Images/RightToPlay/title-donate-nl.gif" width=50 height=10></H3>Jij kunt het leven van kinderen in achtergestelde gebieden veranderen </DIV><A class=rtp-plus-icon href="/netherlands/get-involved/Pages/Donate.aspx">Expand</A>');
        }
         else if (currentCountry === 'fr-ca') {
            document.write('<H3><IMG alt="Faire un don" src="/Style%20Library/Images/RightToPlay/title-donate-fr.gif" width=86 height=10></H3>Vous pouvez transformer la vie d\'un enfant </DIV><A class=rtp-plus-icon href="/fr-ca/simpliquer/Pages/faireundon.aspx">Expand</A>');
        }
        else {
            document.write('<H3><IMG alt="Donate" src="/Style%20Library/Images/RightToPlay/title-donate.gif" width=50 height=10></H3>You have the power to change a child’s life </DIV><A class=rtp-plus-icon href="/' + currentCountry + '/get-involved/Pages/Donate.aspx">Expand</A>');
        }
    }
}

function Volunteer() {
    var currentCountry = GetCurrentCountry();
    if (currentCountry !== null && currentCountry.length > 0) {
        if (currentCountry === 'switzerland') {
            document.write('<H3><IMG alt="Volunteer" src="/Style%20Library/Images/RightToPlay/title-volunteer-se.gif" width=151 height=12></H3>So können Sie ab heute den Unterschied machen </DIV><A class=rtp-plus-icon href="/switzerland/get-involved/Pages/Volunteer.aspx">Expand</A>');
        }
        else if (currentCountry === 'netherlands') {
            document.write('<H3><IMG alt="Volunteer" src="/Style%20Library/Images/RightToPlay/title-volunteer-nl.gif" width=126 height=10></H3>Jij kunt vandaag nog het verschil maken </DIV><A class=rtp-plus-icon href="/netherlands/get-involved/Pages/Volunteer.aspx">Expand</A>');
        }
          else if (currentCountry === 'fr-ca') {
            document.write('<H3><IMG alt="Être bénévole" src="/Style%20Library/Images/RightToPlay/title-volunteer-fr.gif" width=73 height=14></H3>Vous pouvez faire une différence dès aujourd\'hui </DIV><A class=rtp-plus-icon href="/fr-ca/simpliquer/Pages/devenirbenevole.aspx">Expand</A>');
        }

        else {
            document.write('<H3><IMG alt="Volunteer" src="/Style%20Library/Images/RightToPlay/title-volunteer.gif" width=74 height=10></H3>You can make a difference today </DIV><A class=rtp-plus-icon href="/' + currentCountry + '/get-involved/Pages/Volunteer.aspx">Expand</A>');
        }
    }
}

function GetInvolved() {
    var currentCountry = GetCurrentCountry();
    if (currentCountry !== null && currentCountry.length > 0) {
        if (currentCountry === 'switzerland') {
            document.write('<H3><IMG alt="Get Involved" src="/Style%20Library/Images/RightToPlay/title-get_involved-se.gif" width=109 height=12></H3>So können Sie uns unterstützen </DIV><A class=rtp-plus-icon href="/switzerland/get-involved/Pages/Fundraise.aspx">Expand</A>');
        }
        else if (currentCountry === 'netherlands') {
            document.write('<H3><IMG alt="Get Involved" src="/Style%20Library/Images/RightToPlay/title-get_involved-nl.gif" width=60 height=10></H3>Kom in actie en steun ons </DIV><A class=rtp-plus-icon href="/netherlands/get-involved/Pages/Fundraise.aspx">Expand</A>');
        }
         else if (currentCountry === 'fr-ca') {
            document.write('<H3><IMG alt="S\'impliquer" src="/Style%20Library/Images/RightToPlay/title-get_involved-fr.gif" width=81 height=12></H3>Prenez l\'initiative et démontrez votre appui</DIV><A class=rtp-plus-icon href="/fr-ca/simpliquer/Pages/amasserdesfonds.aspx">Expand</A>');
        }
        else {
            document.write('<H3><IMG alt="Get Involved" src="/Style%20Library/Images/RightToPlay/title-get_involved.gif" width=90 height=10></H3>Take charge and show your support </DIV><A class=rtp-plus-icon href="/' + currentCountry + '/get-involved/Pages/Fundraise.aspx">Expand</A>');
        }
    }
}

function GetCurrentCountry() {
    for (var i = 0; i < countries.length; i++) {
        if (location.href.toLowerCase().indexOf(countries[i]) !== -1) {
            return countries[i];
        }
    }
    return null;
}
