So I wanna have a rotating banner on my main page, but it's not working. I put this code inside the header:
[i]<*!-- Hide from old browsers
// Copyright © 2004 Spirit Avenue, LLC
// Created by Laif(laif[at]spiritavenue.com)
var i = 1;
banner1= new Image();
banner1.src = "/banners/definition.gif";
banner2 = new Image();
banner2.src = "banners/tzzz.gif";
banner3= new Image();
banner3.src = "/banners/jadebanner.jpg";
banner4 = new Image();
banner4.src = "banners/djabeatsbanner.gif";
banner5= new Image();
banner5.src = "/banners/resonated.jpg";
banner6 = new Image();
banner6.src = "http://img78.exs.cx/img78/862/banner38.gif";
links = new Array
links[1] = "http://neblinarecords.com"
links[2] = "http://tzarism.com"
links[3] = "http://jade-foxx.com"
links[4] = "http://djabeats.com
links[5] = "http://resonatedrecords.com"
links[6] = "http://abb-d.com"
function startTime(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
closeTime=hours*3600+mins*60+secs;
closeTime+=10; // How many seconds til the next rotation
Timer();
}
function Timer(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
curTime=hours*3600+mins*60+secs
if (curTime>=closeTime){
if (i < 6){ // The number 6 is the amount of banners that you have
i++;
document.banner.src = eval("banner" + i + ".src");
}
else{
i = 1;
document.banner.src = eval("banner" + i + ".src");
}
startTime();
}
else{
window.setTimeout("Timer()",1000)}
}
function clickLink(){
top.location = links[i]
}
function descript(){
window.status = description
}
// -->
</script*>
Then I added this to the opening body tag:
onLoad="startTime();">
Then this within the body:
<a onmouseover="descript(); return true;" onclick="clickLink(); return false;" onmouseout="window.status=''" href=""><img alt="" src="banners/definition.gif" border="0" name="banner"></a>
What happens is the first banner stays on indefinately. I tried editing locally, and editing online with the same results. The editor on cPanel deletes the stuff I add onto the opening body tag. Edited locally, the page has errors and the banner still won't switch. Please tell me what I'm doing wrong before I shoot this computer. 