function PreImage(app, id, size,path){if(!app.preImages[id]){this.id= id;this.app= app
this.type= PREIMAGE_TYPE
this.index= app.preImages.length;this.appObjectModelPath= APP_NAME + ".preImages[" + this.index + "]"
this.size= size.getCopy();this.img= null;this.path= IMAGE_PATH + path;this.cache= cachePreImage;this.getHtml= getHtmlPreImage;if(this.index>0){this.previous= this.app.preImages[this.index-1];this.previous.next= this}else{this.app.firstPreImage=this}
app.preImages[id]= app.preImages[this.index]= this}else{return app.preImages[id]}
return this}
function cachePreImage(){if(!this.img){this.img= new Image();this.img.src= this.path}}
function getHtmlPreImage(size,alt){size= (!size?this.size:size);alt= (!alt?"":'alt="'+alt+'" ');return '<img name="pi' + this.id + '" border="0" src="' + this.path + '" height="' + size.height + '" width="' + size.width + '" ' + alt + '>'}
