function scrollingImageDef(name,dir,offset,delay,enable,load,click,over,out) {
	this.name = name;
	this.type = "Applet";
	this.dir = dir;
	this.offset = offset;
	this.delay = delay;
	this.enable = enable;
	this.onLoad = load;
	this.onClick = click;
	this.onMouseOver = over;
	this.onMouseOut = out;
	this.play = siP;
	this.stop = siS;
	this.getDelay = siGD;
	this.setDelay = siSD;
	this.getOffset = siGO;
	this.setOffset = siSO;
	this.SIsetVel = siSV;
	this.setDir = siSDir;
	this.isDirectionUp = siIDU;
	this.setDirectionUp = siSDU;
	this.isDirectionDown = siIDD;
	this.setDirectionDown = siSDD;
	this.isDirectionLeft = siIDL;
	this.setDirectionLeft = siSDL;
	this.isDirectionRight = siIDR;
	this.setDirectionRight = siSDR;
	this.getElementID = getElementID;
	this.elementResolved = elementResolved;
	this.elementID = null;
}

function siP() {
	this.enable = 1;
	this.SIsetVel(this.offset);
}

function siS() {
	this.SIsetVel(0);
	this.enable = 0;
}

function siGD() {
	return this.delay;
}

function siSD(Delay) {
	if (Delay < 0) return;
	if (this.elementResolved())
		this.elementID.setDelay(Delay);
	this.delay = Delay;
}

function siGO() {
	return this.offset;
}

function siSO(pixels) {
	if (pixels < 0) return;
	with(this) {
		offset = pixels;
		SIsetVel(pixels);
	}
}

function siSV(pixels) {
	with(this) {
		if (!enable || !elementResolved()) return;
		if (dir == 0) {
			elementID.setVelocityY(-1 * pixels);	// up
		} else if (dir == 1) {
			elementID.setVelocityY(pixels);			// down
		} else if (dir == 2) {
			elementID.setVelocityX(-1 * pixels);	// left
		} else {
			elementID.setVelocityX(pixels);			// right
		}
	}
}

function siIDU() {
	return (this.dir == 0);
}

function siIDD() {
	return (this.dir == 1);
}

function siIDL() {
	return (this.dir == 2);
}

function siIDR() {
	return (this.dir == 3);
}

function siSDU() {
	if (this.dir != 0) this.setDir(0);
}

function siSDD() {
	if (this.dir != 1) this.setDir(1);
}

function siSDL() {
	if (this.dir != 2) this.setDir(2);
}

function siSDR() {
	if (this.dir != 3) this.setDir(3);
}

function siSDir(Dir) {
	with(this) {
		SIsetVel(0);
		dir = Dir;
		SIsetVel(offset);
	}
}

