
//
//All Javascript copyright 2002-2005 by BeetleCraft Web & Graphics Design - 
//http://www.beetlecraft.net
//
var rimgs = new Array();
var rfun = new Array();
var dir="../graphics/mouseover/";

function rroll() {
	this.seq++;
	if ( this.seq > this.imgarr.length-1 ) {
		this.seq = 0;
	}
	document.images[this.imgname].src = dir + this.imgarr[this.seq];
	this.tmer = setTimeout( "rfun[" + this.image + "].rroll()", this.delay);
}

function rshow(i) {
    document.images[this.imgname].src=dir + this.imgarr[i];
}

function rpfl() {
	for (n=0;n<this.imgarr.length;n++) {
		i = new Image(1,1);
		i.src = dir + this.imgarr[n];
	}
}
	
function rfunc() {
	this.imgarr = null;
	this.imgname = "";
	this.image = -1;
	this.seq = -1;
	this.delay = 4000;
	this.tmer = null;
	this.rroll = rroll;
	this.rshow = rshow;
	this.prel = rpfl;
}


function rsw(n,i) {
	if ( i < 0 ) {
		if (rfun[n].tmer == null) {
			rfun[n].image=n;
            rfun[n].seq=-1;
			rfun[n].rroll();
		} else {
			clearTimeout(rfun[n].tmer);
			rfun[n].tmer = null;
			rfun[n].image=-1;
		}
	} else {
		if (rfun[n].tmer) {
			clearTimeout(rfun[n].tmer);
			rfun[n].tmer = null;
			rfun[n].image=-1;
		}
		rfun[n].rshow(i);
	}
}



