var flag=false;

function DrawImage(ImgD){

var image=new Image();

image.src=ImgD.src;

if(image.width>0 && image.height>0){

flag=true;

if(image.width/image.height>= 128/128){

if(image.width>128){

ImgD.width=128;

ImgD.height=(image.height*128)/image.width;

}else{

ImgD.width=image.width;

ImgD.height=image.height;

}

//ImgD.alt=image.width+"กม"+image.height;

}

else{

if(image.height>128){

ImgD.height=128;

ImgD.width=(image.width*128)/image.height;

}else{

ImgD.width=image.width;

ImgD.height=image.height;

}

//ImgD.alt=image.width+"กม"+image.height;

}

}

/*else{

ImgD.src="";

ImgD.alt=""

}*/

}

function FileChange(Value){

flag=false;

document.all.uploadimage.width=1;

document.all.uploadimage.height=1;

document.all.uploadimage.alt="";

document.all.uploadimage.src=Value;

}
