﻿if(document.location.protocol == "https:" && !window.location.href.match("([Ll]ogin|[Ll]ogout|[Cc]heckout|[Aa]dmin|[Mm]y[Aa]ccount|[Dd]onate[Nn]ow|[Aa]rabic|[Aa]utomatic[Gg]iving)"))
{
    window.location = window.location.href.replace(/https/, "http");
}
else if(document.location.protocol == "http:" && window.location.href.match("([Ll]ogin|[Ll]ogout|[Cc]heckout|[Aa]dmin|[Mm]y[Aa]ccount|[Dd]onate[Nn]ow|[Aa]rabic|[Aa]utomatic[Gg]iving)"))
{
    window.location = window.location.href.replace(/http/, "https");
}


//<!-- Begin Change Header Image
// Set up the image files to be used.
var theImages = new Array() // do not change this
theImages[0] = '/media/HeaderImages/Inner1.jpg';
theImages[1] = '/media/HeaderImages/Inner2.jpg';
theImages[2] = '/media/HeaderImages/Inner3.jpg';
theImages[3] = '/media/HeaderImages/Inner4.jpg';
theImages[4] = '/media/HeaderImages/Inner5.jpg';
theImages[5] = '/media/HeaderImages/Inner6.jpg';
theImages[6] = '/media/HeaderImages/Inner7.jpg';
theImages[7] = '/media/HeaderImages/Inner8.jpg';
theImages[8] = '/media/HeaderImages/Inner9.jpg';
theImages[9] = '/media/HeaderImages/Inner10.jpg';


// do not edit anything below this line

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));

function showImage()
{
document.getElementById("JohnImage").style.backgroundImage = "url(" + theImages[whichImage] + ")";
}

function AudioPlayer(ID)
{
    var link = '/AudioPlayer/' + ID;
   
    window.open(link, 'AudioPlayer', 'width=550,height=220,directories=no,location=0,menubar=no,resizable=0,scrollbars=0,status=no,toolbar=no');
}

function AudioPlayerByType(Type, ID)
{
    var link = '/AudioPlayer/' + Type + '/' + ID;
   
    window.open(link, 'AudioPlayer', 'width=550,height=220,directories=no,location=0,menubar=no,resizable=0,scrollbars=0,status=no,toolbar=no');
    return false;
}

function ToggleDownloadLinks(id)
{
    if(document.getElementById(id).style.display == "none")
        document.getElementById(id).style.display = "inline";
    else
        document.getElementById(id).style.display = "none";
}

