var imageScale, imageWidth, imageHeight; function setImageAttr(image){ if(typeof(image) == "string"){ im = getObj(image); }else if(typeof(image) == "object"){ im =image; }else{ return; } imageWidth = im.width; imageHeight = im.height; imageScale = 100; scaleImage(im,"fit"); } function scaleImage(image,size){ if(typeof(image) == "string"){ im = getObj(image); }else if(typeof(image) == "object"){ im =image; }else{ return; } if(imageWidth == null){ imageWidth = im.width; imageHeight = im.height; imageScale = 100; } switch(size){ case "fit": // fit image to window proportions var winSizeArr = getWindowSize(); if(winSizeArr[0] && winSizeArr[1]){ if(imageWidth/imageHeight > winSizeArr[0]/winSizeArr[1]){//image is proportionally wider - constrain to width im.width = winSizeArr[0]; im.height = Math.round(imageHeight*(winSizeArr[0]/imageWidth)); }else{ im.height = winSizeArr[1]; im.width = Math.round(imageWidth*(winSizeArr[1]/imageHeight)); } imageScale = Math.round(100*im.width/imageWidth); } break; case 100: // scale to size im.width = imageWidth; im.height = imageHeight; imageScale = 100; break; default: // find the current scale var i=0; while(imageScale > 25){ imageScale *= 0.5; i++; } imageScale = 25; for(j=0;j0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p); } if(!(obj=d[n])&&d.all) obj=d.all[n]; for (i=0;!obj&&i