// Build an array initializer

function makeArray(){
var args=makeArray.arguments;
for (var i=0; i< args.length; i++){
    this[i]=args[i];
    }
  this.length=args.length;
}


function getFullYear(dateObject){
        var y = dateObject.getYear();
                if (y<2000) y+=1900;
        return y;
}

// Use this function to retrieve a cookie.
function getCookie(name){
var cname = name + "=";               
var dc = document.cookie;             
    if (dc.length > 0) {              
    begin = dc.indexOf(cname);       
        if (begin != -1) {           
        begin += cname.length;       
        end = dc.indexOf(";", begin);
            if (end == -1) end = dc.length;
            return unescape(dc.substring(begin, end));
        } 
    }
return null;
}

// Use this function to save a cookie.
function setCookie(name, value, expires) {
document.cookie = name + "=" + escape(value) + "; path=/" +
((expires == null) ? "" : "; expires=" + expires.toGMTString());
}

// Use this function to delete a cookie.
function delCookie(name) {
document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT" +  "; path=/";
}

function getValue(element) {
var value=getCookie(element.name);
 if (value != null) element.value =value;
}

function setValue(element) {
setCookie(element.name, element.value,exp);
}


var isnMonths= new makeArray("January","February","March","April","May","June","July","August","September","October","November","December");
var isnDays= new makeArray("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var exp =new Date();
exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 1));
today = new Date();
now = new Date();

var pages = new makeArray ("Select A Page", 
"Dr. King Posters",
"MLKJr Directions",
"Sign Guestbook", 
"Add your Event", 
"Join our Mailing List", 
"Link your Website", 
"Add your Group", 
"EOP Sound Clips", 
"News Reporters", 
"Admin Guests", 
"Admin Events", 
"Selections",
"Earliteens",
"Online Bible");

var urls = new makeArray ("",
"http://www.gospelnation.com/drKingPosters.htm", 
"http://www.gospelnation.com/mljrdirections.htm",
"http://www.gospelnation.com/addguest.htm", 
"http://www.gospelnation.com/addevents.htm", 
"http://www.gospelnation.com/addmail.htm", 
"http://www.gospelnation.com/addlinks.htm", 
"http://www.gospelnation.com/addlinks.htm", 
"http://www.gospelnation.com/soundpage.htm", 
"http://www.gospelnation.com/addnews.htm", 
"http://www.gospelnation.com/guests.htm", 
"http://www.gospelnation.com/events.htm", 
"http://selections.iuma.com",
"http://sspm.gc.adventist.org/ss/Cornerstone.htm",
"http://bible.gospelcom.net/");


var AdsNum = 6;
var imag = new makeArray(AdsNum);
var link = new makeArray(AdsNum);
var lint = new makeArray(AdsNum);

imag[1] = "http://www.gospelnation.com/banners/gn41.jpg";
link[1] = "http://www.gospelnation.com";
lint[1] = "_top";


imag[2] = "http://images.allposters.com/images/banners/BNR_general_3.gif";
link[2] = "http://affiliates.allposters.com/link/redirect.asp?aid=677843&search=african+religion";
lint[2] = "_top";


imag[3] = "http://www.gospelnation.com/banners/gn41.jpg";
link[3] = "http://www.gospelnation.com";
lint[3] = "_top";


imag[4] = "http://www.gospelnation.com/banners/gn41.jpg";
link[4] = "http://www.gospelnation.com";
lint[4] = "_top";

imag[5] = "http://www.sdasingles.net/banners/banner2.gif";
link[5] = "http://www.sdasingles.net/home/default.asp";
lint[5] = "_blank";

imag[6] = "http://www.gospelnation.com/banners/gn41.jpg";
link[6] = "http://www.gospelnation.com";
lint[6] = "_top";

function goPage(form){
i=form.menu.selectedIndex;
if (i!= 0) {
	window.location.href=urls[i];
	}
}


bName=navigator.appName
bVer= parseInt(navigator.appVersion);

if ((bName="Netscape" && bVer>=3) || 
     (bName == "Microsoft Internet Explorer" && bVer >= 4 ))br="n3";
		else br="n2";
if (br=="n3") {
homeon=new Image(); homeon.src="images/homeon.gif";
homeoff=new Image();homeoff.src="images/homeoff.gif";
gospelnationon=new Image(); gospelnationon.src="images/gnaton.gif";
gospelnationoff=new Image();gospelnationoff.src="images/gnatoff.gif";

whatsnewoff=new Image(); whatsnewoff.src="images/whatsnewoff.gif";
whatsnewon=new Image(); whatsnewon.src="images/whatsnewon.gif";
archivesoff=new Image(); archivesoff.src="images/archivesoff.gif";
archiveson=new Image(); archiveson.src="images/archiveson.gif";
eventsoff=new Image(); eventsoff.src="images/eventsoff.gif";
eventson=new Image(); eventson.src="images/eventson.gif";
expressoff=new Image(); expressoff.src="images/expressoff.gif";
expresson=new Image(); expresson.src="images/expresson.gif";
gospelstuffoff=new Image(); gospelstuffoff.src="images/gospelstuffoff.gif";
gospelstuffon=new Image();gospelstuffon.src="images/gospelstuffon.gif";

eopoff=new Image(); eopoff.src="images/eopoff.gif";
eopon=new Image(); eopon.src="images/eopon.gif";
}

function clearit(){
window.status=""
return true
}

function showit(var1){
window.status=var1;
return true
}


function rand(n) {
seed = (0x015a4e35 * seed) % 0x7fffffff;
return (seed>>16) % n +1;
}


function imgAct(imgName){
document[imgName].src=eval(imgName +"on.src");

showit(imgName);
}

function imgInAct(imgName){
document[imgName].src=eval(imgName +"off.src");
clearit();
}



// set up the random seed and value
function GetRand()
{
  day = new Date();
  seed = day.getTime();
  return parseInt(((seed - (parseInt(seed/1000,10) * 1000)) /10) /100 * AdsNum + 1,10);
}


// set up the sidebar random seed and value
function GetsRand()
{
  day = new Date();
  seed = day.getTime();
  return parseInt(((seed - (parseInt(seed/1000,10) * 1000)) /10) /100 * 9  + 1,10);
}


var sideno=GetsRand();
var RandNumber = GetRand();
var OldRandNum = RandNumber;


function ShowAd()
{
  while( OldRandNum == RandNumber) RandNumber = GetRand();
  OldRandNum = RandNumber;
  document.all.lnk1.href = link[RandNumber];
  document.all.img1.src = imag[RandNumber];
  window.setTimeout("ShowAd()",15000);
}
if(document.all) //if NS ever supports this then pooh!
  window.setTimeout("ShowAd()",15000);



function Pup() {
document.cookie='c=1;';
if (document.cookie) {
r = new Date(); r = r.getSeconds() % 6;
c = new Array(); c[0]="mark"; 
if (c[0] && document.cookie.indexOf("|"+c[0]) == -1) {

win=window.open("http://www.gospelnation.com/asp1/mk.htm",'tCw','width=330,height=330');
if (!win.opener)win.opener=self;
if (win.focus)win.focus();
}}} window.pup = Pup;


function adwinn(){
if(window.pup!=null)pup()
}

