// JavaScript Document
function ImageReSize(thisImg,Mw,Mh){
	var MaxW = Mw;
	var MaxH = Mh;
	var resizeW = false;
	var resizeH = false;
	if(thisImg.width>MaxW){
		resizeW=true;
	}
	if(thisImg.height>MaxH){
		resizeH=true;
	}
	if((resizeW==true)&&(resizeH==false)){
			var Step = thisImg.height*(MaxW/thisImg.width);
			thisImg.width = MaxW;
			thisImg.height = Step;	
	}
	if((resizeW==false)&&(resizeH==true)){
			var Step = thisImg.width * (MaxH/thisImg.height);
			thisImg.height = MaxH;
			thisImg.width = Step;	
	}
	if((resizeW==true)&&(resizeH==true)){
		if(thisImg.width>thisImg.height){
			var Step = thisImg.height*(MaxW/thisImg.width);
			thisImg.width = MaxW;
			thisImg.height = Step;	
		}else{
			var Step = thisImg.width * (MaxH/thisImg.height);
			thisImg.height = MaxH;
			thisImg.width = Step;		
		}
		
		if(thisImg.width>MaxW){
			var Step = thisImg.height*(MaxW/thisImg.width);
			thisImg.width = MaxW;
			thisImg.height = Step;		
		}
		if(thisImg.height>MaxH){
			var Step = thisImg.width * (MaxH/thisImg.height);
			thisImg.height = MaxH;
			thisImg.width = Step;				
		}		
	}		
}

