// JavaScript Document
function Resizespics(pic,id)
{
	
   var imgsrc=pic;
   var myimgwidth,myimgheight;
	var maxwidth=200;
  	var maxheight=150;
	var spic=document.createElement("img");
	spic.src=imgsrc;

	   if(spic.width>0 && spic.height>0)
	   {
		flag=true;
		if(spic.width/spic.height>= maxwidth/maxheight)
		{
			 if(spic.width>maxwidth){ 
				 myimgwidth=maxwidth;
				 myimgheight=(spic.height*maxwidth)/spic.width;
			 }else{
				 myimgwidth=spic.width; 
				 myimgheight=spic.height;
				 
			 }
		 //spic.alt="原始尺寸:宽" + spic.width+",高"+spic.height;
		 }else{
			if(spic.height>maxheight)
			{ 
				 myimgheight=maxheight;
				 myimgwidth=(spic.width*maxheight)/spic.height;     
				 
			}else{
				 myimgwidth=spic.width; 
				 myimgheight=spic.height;
			}
		 //spic.alt="原始尺寸:宽" + spic.width+",高"+spic.height;
		 }
		}
		spic.width=myimgwidth;
		spic.height=myimgheight;
  	var a_height=0;
	//var imgs="<a href='introduct.php?id="+id+"' target='_blank'><img src='"+imgsrc+"' width='"+myimgwidth+"' height='"+myimgheight+"' /></a>";
	//document.write(imgs);
	document.getElementById("img"+id).appendChild(spic);
	
 	if(myimgheight<maxheight){
		var new_height=maxheight-myimgheight;
		 a_height=new_height/2;
		document.getElementById("rq"+id).style.marginTop=a_height;
	 }

}
//缩放图片到合适大小


	
