function formatimg(newvalue)
	{
		begintxt="<img src="+newvalue+".gif border=0>"
		endtxt="";
		dealcontent()
	}
	
function dealcontent()
	{
		
		if ((document.selection)&&(document.selection.type == "Text"))
		{
		var range = document.selection.createRange();
		var ch_text=range.text;
		range.text = begintxt + ch_text + endtxt;
		} 
		else 
		{
		document.reply.reinfo_content.value=begintxt+document.reply.reinfo_content.value+endtxt;
		document.reply.reinfo_content.focus();
		}
	}
	
	
function ScaleImage(ImgD,w1,h1){
var flag=false;
var image=new Image();
image.src=ImgD.src;

if(image.width>0 && image.height>0){
   flag=true;
   if(image.width/image.height>= w1/h1){
      if(image.width>w1){ 
        ImgD.width=w1;
        ImgD.height=(image.height*w1)/image.width;
      }else{
        ImgD.width=image.width; 
        ImgD.height=image.height;
   }   
}
else{
      if(image.height>h1){ 
         ImgD.height=h1;
         ImgD.width=(image.width*h1)/image.height; 
      }else{
         ImgD.width=image.width; 
         ImgD.height=image.height;
      }     
  }
 }
} 