﻿// JScript File
function date() { 
var myDate=new Date();
myDate.setDate(myDate.getDate());
document.write(myDate);
}

function startTime()
{
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
// add a zero in front of numbers<10
m=checkTime(m);
s=checkTime(s);
document.getElementById('txt').innerHTML=h+":"+m+":"+s;
t=setTimeout('startTime()',500);
}

function today()
{
var today=new Date();
var d=today.getDate();
d = checkTime(d);
var m=today.getMonth() + 1;
m = checkTime(m);
var y=today.getFullYear();
document.getElementById('txt').innerHTML=d+"/"+m+"/"+y;
}


function checkTime(i)
{
if (i<10)
  {
  i="0" + i;
  }
return i;
}

function loadpage() { 
index1 = 0;
listofimages = new Array(5);
listofimages[0] = new Image(125,125)
listofimages[0].src = "images/linux.png"
listofimages[1] = new Image(125,125)
listofimages[1].src = "images/windows.png"
listofimages[2] = new Image(125,125)
listofimages[2].src = "images/opensource.png" 
listofimages[3] = new Image(125,125)
listofimages[3].src = "images/mysql.png"
listofimages[4] = new Image(125,125)
listofimages[4].src = "images/apache.png"

thetimer = setTimeout("changeimage()", 2000);

} 

function changeimage(){ 
index1 = index1 + 1
if (index1 == "5") { 
index1 = 0 
} 
imagesource = listofimages[index1].src
window.document.banner1.src = imagesource

thetimer = setTimeout("changeimage()", 1500);

} 

function changepage() { 
if (index1 == 0) { 
newlocation = "http://www.access.wvu.edu/itrc/" 
}
else if (index1 == 1) { 
newlocation = "http://www.wvu.edu" 
}
else if (index1 == 2) { 
newlocation = "http://www.oit.wvu.edu" 
}
else if (index1 == 3) { 
newlocation = "http://www.access.wvu.edu" 
}
location = newlocation 
} 

