/* Image Handling Routines... */
/* Requires Browser code... */
/* Version 1.00 - 06/01/99 */
function imagesImage(aName, aSRC, aWidth, aHeight){
	this.name = aName;
	this.src = aSRC;
	this.obj = null;
	this.width = aWidth;
	this.height = aHeight;
	if (aSRC){
		if ((aWidth == null) || (aHeight == null)){
			alert('Unable to add image with null Height or Width');
		} else {
			this.obj = new Image(aWidth, aHeight);
			this.obj.src = aSRC;
		}
	}
}

function imagesObject(){
	this.count = -1
	this.img = new imagesImage;
	this.find = imagesFind;
	this.add = imagesAdd;
	this.getSrc = imagesGetSrc;
	this.getFullSrc = imagesGetFullSrc;
	this.getTag = imagesGetTag;
}

function imagesFind(aName){
	var aResult = -1;
	var iCount;
	for(iCount = 0; iCount <= this.count; iCount++){
		if(this.img[iCount].name == aName){
			aResult = iCount;
			break;
		}
	}
	return aResult;
}

function imagesAdd(aName, aSRC, aWidth, aHeight){
	var iTemp = this.find(aName);
	if(iTemp == -1){
		iTemp = ++this.count;
	}
	this.img[iTemp] = new imagesImage(aName, aSRC, aWidth, aHeight);
}

function imagesGetSrc(aName){
	var iTemp = this.find(aName);
	if (iTemp == -1)
		alert('Error locating image ' + aName + ' (getSrc)');
	return ((iTemp == -1)? "" : this.img[iTemp].src);
}

function imagesGetFullSrc(aName){
	var iTemp = this.find(aName);
	if (iTemp == -1)
		alert('Error locating image ' + aName + ' (getFullSrc)');
	return((iTemp == -1)? "" : this.img[iTemp].obj.src);
}

function imagesGetTag(aName, aID, altText){
	var iTemp = this.find(aName);
	if(iTemp == -1){ 
		return '';
	}
	if(this.img[iTemp].src == ''){
		return '';
	}
	with (this.img[iTemp]){
		
		var aResult = "<IMG SRC=\"" + src + "\" WIDTH=\"" + width + "\" HEIGHT=\"" + height + "\" BORDER=\"0\" \
ALIGN=\"LEFT\" HSPACE=\"0\" VSPACE=\"0\"";
		if(aID != ''){
			aResult += " NAME=\"" + aID + "\"";
		}
		aResult += " ALT=\"" + altText + "\">";
	}
	return aResult;
}


		
