/*
V2.01 - 02/02/10 TS
- added alt tag parameter to AddImage()
*/
function RotatingImages() {
	this.imageWidth = 100;
	this.imageHeight = 100;
	this.fadeDelay = 3; // in seconds
	this.fadeImages = new Array();
	
	this.SetWidth = SetWidth;
	this.SetHeight = SetHeight;
	this.SetFadeDelay = SetFadeDelay;
	this.OutputImages = OutputImages
	this.AddImage = AddImage;	
}

function SetWidth(imageWidth) {
	this.imageWidth = imageWidth;
}

function SetHeight(imageHeight) {
	this.imageHeight = imageHeight;
}

function SetFadeDelay(fadeSeconds) {
	this.fadeDelay = fadeSeconds;
}

function AddImage(imageFile, url, target, altTag) {
	if (!url) url = "";
	if (!target) target = "";
	if (typeof(altTag) == 'undefined') altTag == '';
	var imageData = new Array(imageFile, url, target, altTag);
	this.fadeImages.push(imageData);	
}

function OutputImages() {
	if (this.fadeImages.length == 1) {
		document.write('<div style="overflow:hidden; width:'+this.imageWidth+'px; height: '+this.imageHeight+'px;">');
		if (this.fadeImages[0][1] != "") document.write('<a href="'+this.fadeImages[0][1]+'" target="'+this.fadeImages[0][2]+'">');
		document.write('<img src="'+this.fadeImages[0][0]+'" alt="'+this.fadeImages[0][3]+'" />');
		if (this.fadeImages[0][1] != "") document.write('</a>');
		document.write('</div>');
	} else if (this.fadeImages.length > 1) {
		new fadeshow(this.fadeImages, this.imageWidth, this.imageHeight, 0, this.fadeDelay*1000, 1, "R");
	}
}
