ImageObject = function(src,id,width,height) {
	this.id = id;	
	this.src = src;
	this.width = width;
	this.height = height;		
}
ImageObject.prototype.getHTML = function() {
	var html = "";
	if ( (!this.width || this.width == 0) || (!this.height || this.height == 0) ) {
		html = '<img id="'+this.id+'" src="'+this.src+'" />';		
	} else {
		html = '<img id="'+this.id+'" src="'+this.src+'" width="'+this.width+'" height="'+this.height+'" />';		
	}
	return html;
}
ImageObject.prototype.write = function(elementId) {
	if (elementId) {
		document.getElementById(elementId).innerHTML = this.getHTML();
	} else {
		document.write(this.getHTML());
	}		
}