

function proDownImage(ImgD,MW,MH){
	if(typeof(ImgD)!='object') {ImgD = document.getElementById(ImgD);}
	var image = new Image();
	image.src=ImgD.src;
	//alert(image.src +" : "+image.width + " : " +image.height);
	if(image.width>0 && image.height>0){
		var rate =(MW/image.width < MH/image.height)?MW/image.width:MH/image.height;
			if(rate < 1){
				ImgD.width = image.width*rate;
				ImgD.height =image.height*rate;
			}else {
				ImgD.width = image.width;
				ImgD.height =image.height;
			}
	}			
}

//================================================================================================================================

var _move = null;

function Down(){
	a();
	function a(){
		var other = document.getElementById("other");
		if(other.scrollTop< other.scrollHeight-400){
			other.scrollTop=other.scrollTop+3;
		}
		_move = setTimeout(a,10);
		if(other.scrollTop>=other.scrollHeight-400){
			window.clearTimeout(_move);
		}
	}
}

function Top(){
	 var left = 0;
	a();
	function a(){
		var other = document.getElementById("other");
		if(other.scrollTop>0){
			other.scrollTop=other.scrollTop-3;
		}
		_move = setTimeout(a,10);
		if(other.scrollTop<=0){
			window.clearTimeout(_move);
		}
	}
}

function Clear(){
	if(_move!=null){
		window.clearTimeout(_move);
	}
	_move = null;
}