// -- programing: Justas Vinevičius --
// -- email: dadka@one.lt --


function ImageObject() {
	this.images=new Array();
}

function ImageAdd(Object,url,n) {
	Object.images[n]=new Image();
	Object.images[n].src=url;
}

function GetImage(name) {
	if (isIEDOM2) { return document.getElementById(name); }
	if (isNNDOM1) { return FindImage(name, document); }
	if (isNNDOM2 || isIEDOM1) { return document.images[name]; }
	return null;
}

function FindImage(name, doc) {
	var i, obj;
	for (i = 0; i < doc.images.length; i++)	{
	if (doc.images[i].name == name) return doc.images[i];
	}
	for (i = 0; i < doc.layers.length; i++) {
	if ((obj = FindImage(name, doc.layers[i].document)) != null) { return obj; }
	}
	return null;
}

function ImageChange(Object,name,n) {
	DocumentImage=GetImage(name);
	if (Loaded==true && DocumentImage!=null) { DocumentImage.src=Object.images[n].src; }
}
