	imgArr=Array();
	function imgFit(obj,width,height,skip)
	{
		if(!skip)imgArr.push({"obj":obj,"width":width,"height":height});
		if(parseInt(obj.offsetWidth)==0){
			return;
		}

		if(obj.offsetWidth>width || obj.offsetHeight>height)
		{
			imageRate1=parseInt(obj.offsetWidth)/width;
			imageRate2=parseInt(obj.offsetHeight)/height;
			
			if(imageRate2>imageRate1)
				obj.style.height = obj.offsetHeight/imageRate2+"px";
			else
				obj.style.width = obj.offsetWidth/imageRate1 +"px";
		}
	}
	
	var hkuc_cache_img_array=Array();
	function hkuc_cache_img(url){
		temp_img = new Image();
		temp_img.src=url;
		hkuc_cache_img_array.push(temp_img);		
	}
	
	function reassure(){
		for(i=0;i<imgArr.length;i++)
			imgFit(imgArr[i].obj,imgArr[i].width,imgArr[i].height,true);
	}
	
function addLoadEvent(func) {
  if (window.addEventListener)
    window.addEventListener("load",func,false);
  else if (document.addEventListener)
    document.addEventListener("load",func,false);
  else if (window.attachEvent)
    window.attachEvent("onload",func);
  else if (document.attachEvent)
    document.attachEvent("onload",func);
}

addLoadEvent(reassure);
	
	