JavaScript Picture Auto Rotate Code
JavaScript Document
var Spicarr = new Array ();
var gindex = new Array ();
var sid = New Array ();
var timeout = 6000;
var Isie = (' Microsoft Internet Explorer ' = navigator.appname);
function Initslide (NAME,TIMEOUT1) {
Spicarr[name] = new Array ();
Gindex[name] = 0;
Sid[name] = null;
if (TIMEOUT1) {
Timeout = timeout1;
}
}
/*
Content = new Array (picture path, title, URL);
*/
function InitData (name, index, content) {
Spicarr[name][index] = content;
}
function Initfirst (name) {
Document.images[name + ' _pic '].src = spicarr[name][0][0];
Document.images[name + ' _pic '].alt = spicarr[name][0][1];
$ (name + ' _piclink '). href = spicarr[name][0][2];
$ (name + ' _title '). InnerHTML = spicarr[name][0][1];
$ (name + ' _title '). href = spicarr[name][0][2];
}
function $ (objname) {
if (document.getElementById) {
Return eval (' document.getElementById (' + objname + ') ');
else if (document.layers) {
Return eval ("document.layers['" + objname + "']");
}else{
Return eval (' document.all. ' + objname);
}
}
var plpic = new Image ();
function Slidepic (name,index) {
Gindex[name] = index;
if (Isie) {
Document.images[name + ' _pic '].filters.item (0). Transition = 12;
Document.images[name + ' _pic '].filters.item (0). Apply ();
}
Document.images[name + ' _pic '].src = spicarr[name][index][0];
Document.images[name + ' _pic '].alt = spicarr[name][index][1];
$ (name + ' _piclink '). href = spicarr[name][index][2];
$ (name + ' _title '). InnerHTML = spicarr[name][index][1];
$ (name + ' _title '). href = spicarr[name][index][2];
if ((index+1) <spicarr[name].length) {
PLPIC.SRC = Spicarr[name][index+1][0];//preload;
}
if (Isie) {
Document.images[name + ' _pic '].filters.item (0). Play ();
}
}
function Nextpic (name) {
Gindex[name] = ((gindex[name]+1) >=spicarr[name].length 0: (gindex[name]+1));
Slidepic (name, Gindex[name]);
}
function Prevpic (name) {
Gindex[name] = ((gindex[name]-1) <0? (spicarr[name].length-1): (gindex[name]-1));
Slidepic (name, Gindex[name]);
}
function Inislide (name) {
if (sid[name]==null) {
Sid[name] = setinterval (' nextpic (' +name+ ') ', timeout);
}
}
function Pauseslide (name) {
Clearinterval (Sid[name]);
Sid[name] = null;
}