// Convert document.lastModified to 'dd mmmm yyyy'
function modDate(z) {
x = new Date(z);
x = x.toLocaleString();
y = x.indexOf(":");
x = x.slice(0,y - 3);
document.write(x)
}

// onClick pop-ups (add new ones to the end of the array and call them by index number)
function jAlert(z) {
tArray = new Array("He Already Knows What You Want To Ask.","Jesus Has Changed Your Life.\r\rSave Changes ?","The Spirit Has Moved.\r\rClick OK To Follow.","Thanks Robin");
alert(tArray[z])
}

// Countdown Timer (z=Name of Event(ie 'Christmas'), y=Date of Event(ie 'December 25, 2006'))
function cDown(z,y) {
var urodz = new Date(y);
var now = new Date();
var ile = urodz.getTime() - now.getTime();
var dni = Math.floor(ile / (1000 * 60 * 60 * 24));
if (dni > 1)
document.write("Only " + dni + " days until " + z)
else if (dni == 1)
document.write("Only two days until " + z)
else if (dni == 0)
document.write("Only one day until " + z)
else if (dni == -1)
document.write("Today is " + z);
else
document.write(z + " is here");
}

// cDown('The Opening Ceremony','July 27, 2012')

// Long document.LastModified
function NmodDate(z) {
lastmod = document.lastModified; // get date
modarray=lastmod.split("/"); // split it
lastmod = modarray[1]+"/"+modarray[0]+"/"+modarray[2]; // convert it to International format
lastmoddate = Date.parse(lastmod); // convert it back to a date
if(lastmoddate == 0){ // check it
document.writeln(" "); // oops, lost it
}
else {
document.writeln(lastmod); // show it
}
}


// Title Bar Scroller : use var msg=""; ScrollTitle() to activate
function ScrollTitle() {
        document.title=msg;
        msg=msg.substring(1,msg.length)+msg.charAt(0);
        setTimeout("ScrollTitle()",200);
}


