function setImage(ImgD){
    if (ImgD.width>0 && ImgD.height>0){
    	if (ImgD.width>600){
    	   ImgD.height = ImgD.height*600/ImgD.width;
    	   ImgD.width=600; 
    	}
    }
}

function setImg(ImgD,hei,wid){
	if (ImgD.width>0 && ImgD.height>0){
		if (ImgD.width>wid){
    	   ImgD.height = ImgD.height*wid/ImgD.width;
    	   ImgD.width=wid; 
    	}
    	if (ImgD.height>hei){
    		ImgD.width = ImgD.width*hei/ImgD.height;
    	   ImgD.height=hei; 
    	}
    	
	}
}