// JavaScript Document
//缩略图
//图片处理函数. 
//ImgD 图片对象ID
//width_s 最大宽
//height_s 最大高
function DrawImage(ImgD,width_s,height_s){
	var image=new Image();
	image.src=ImgD.src;
	if(image.width>0 && image.height>0){
		flag=true;
		if(image.width/image.height>=width_s/height_s){
			if(image.width>width_s){
				ImgD.width=width_s;
				ImgD.height=(image.height*width_s)/image.width;
			}else{
				ImgD.width=image.width;
				ImgD.height=image.height;
			}
		}
		else{
			if(image.height>height_s){
				ImgD.height=height_s;
				ImgD.width=(image.width*height_s)/image.height;
			}else{
				ImgD.width=image.width;
				ImgD.height=image.height;
			}
		}
	}
}

function SelectCategory(dom, value){
	$(dom).parent().find('a', this).removeClass('c_E70010');
	$(dom).addClass('c_E70010');
	$("[name='selectID']").val(value);
}
//验证型号搜索表单
function checkForm(str){
	if (str.lenght < 4 || str == '请输入IC型号'){
		alert("请填写3位以上的关键词！"); return false;
	}
	return true;
}





