//*********************************************************
//函数:AutoSizeImg(图片对象, 指定宽, 指定高)
//功能:自动根据指定尺寸生成缩略图片
//作者:xiaotian
//最后修改日期:2004-4-15
//*********************************************************
function AutoSizeImg(objImg, theWidth, theHeight)
{
	var image=new Image();
	image.src=objImg.src;
	if(objImg.width>0 && objImg.height>0){
		if(image.width/image.height>= theWidth/theHeight){
			if(image.width>theWidth){
				objImg.width=theWidth;
				objImg.height=(image.height*theWidth)/image.width;
			}else{
				objImg.width=image.width;
				objImg.height=image.height;
			}
			//objImg.alt=image.width+"×"+image.height;
		}
		else{
			if(image.height>theHeight){
				objImg.height=theHeight;
				objImg.width=(image.width*theHeight)/image.height;
			}else{
				objImg.width=image.width;
				objImg.height=image.height;
			}
			//objImg.alt=image.width+"×"+image.height;
		}
	}
   /*else{
    objImg.src="";
    objImg.alt=""
    }*/
}

function search_product(sn_name,st_name)
{
	var sn_ctr=document.all(sn_name);
	var sn=sn_ctr.value;
	var st_ctr=document.all(st_name);
	var st=st_ctr.item(st_ctr.selectedIndex).value;
	window.location='Products.asp?issearch=1&search_name='+sn+'&search_type='+st
}