//onload="loaded(this,w,h);"
function loaded(myimg,w,h){
	var tmp_img = new Image();
	tmp_img.src=myimg.src;
	var mywidth=w;
	var myhight=h;
	var image_x=0,image_y=0;
	image_x = tmp_img.width;
	image_y = tmp_img.height;
	if(image_x > mywidth){	//宽度大于要求
		tmp_img.height=image_y * mywidth / image_x;
		tmp_img.width=mywidth;
	}else if(image_y > myhight){	//高度大于要求
		tmp_img.width=image_x * myhight / image_y;
		tmp_img.height=myhight;
	}
	myimg.width=tmp_img.width;
	myimg.height=tmp_img.height;
	window.status='loaded';
	if (typeof autoContainer=="function") autoContainer();
	if (typeof flushBody=="function") flushBody();
}
