Image=function(){this.HTML=document.createElement("img");this.HTML.src="./";this.id=YAHOO.util.Dom.generateId(this.HTML,"image");this.HTML.id=this.id;this.HTML.style.display="block";this.src="./";this.origWidth=this.HTML.width;this.origHeight=this.HTML.height;this.imageClicked=new YAHOO.util.CustomEvent("imageClicked");this.desktopCall=new YAHOO.util.CustomEvent("desktopCall");YAHOO.util.Event.addListener(this.HTML,"click",this.imageClick,this);};Image.prototype.change=function(c,b,a){src=b[0].data;srcTest=src.substring((src.length-4));if(srcTest==".jpg"){a.HTML.src=src;a.src=src;}};Image.prototype.insertShape=function(c,b,a){shape=b[0];a.HTML.appendChild(shape);};Image.prototype.imageClick=function(b,a){a.desktopCall.fire({obj:[a],callback:[""],type:"imageClicked",data:{obj:a.HTML,mousex:YAHOO.util.Event.getPageX(b),mousey:YAHOO.util.Event.getPageY(b)}});};Image.prototype.zoomIn=function(c,b,a){scale=parseInt(b[0].data.scale);newW=(parseInt(YAHOO.util.Dom.getStyle(a.HTML,"width"))*scale);newH=(parseInt(YAHOO.util.Dom.getStyle(a.HTML,"height"))*scale);YAHOO.util.Dom.setStyle(a.HTML,"width",newW+"px");YAHOO.util.Dom.setStyle(a.HTML,"height",newH+"px");};Image.prototype.zoomOut=function(c,b,a){scale=parseInt(b[0].data.scale);newW=(parseInt(YAHOO.util.Dom.getStyle(a.HTML,"width"))/scale);newH=(parseInt(YAHOO.util.Dom.getStyle(a.HTML,"height"))/scale);YAHOO.util.Dom.setStyle(a.HTML,"width",newW+"px");YAHOO.util.Dom.setStyle(a.HTML,"height",newH+"px");};Image.prototype.clearCoords=function(a){for(x in a.areas){area=a.areas[x];for(i in area.nodes){area.nodes[i].HTML.parentNode.removeChild(area.nodes[i].HTML);}area.nodes[x].length=0;for(i in area.lines){area.lines[i].remove();}}a.areas.length=0;a.curArea=null;for(i in a.imageRegions){a.imageRegions[i].HTML.parentNode.removeChild(panel.image.imageRegions[i].HTML);}a.imageRegions.length=0;};Image.prototype.getCoordOnOrig=function(b,a,c){xCor=parseInt(a);yCor=parseInt(c);imgObj=b.desktop.objects[b.id];xPercent=xCor/parseInt(b.offsetWidth);yPercent=yCor/parseInt(b.offsetHeight);realX=Math.round(xPercent*parseInt(imgObj.origWidth));realY=Math.round(yPercent*parseInt(imgObj.origHeight));result=[realX,realY];return result;};Image.prototype.getCoordOnCur=function(b,a,c){xCor=parseInt(a);yCor=parseInt(c);imgObj=b.desktop.objects[b.id];xPercent=xCor/imgObj.origWidth;yPercent=yCor/imgObj.origHeight;realX=Math.round(xPercent*parseInt(b.offsetWidth));realY=Math.round(yPercent*parseInt(b.offsetHeight));result=[realX,realY];return result;};