window.onerror = function(){return true;}
String.prototype.trim = function(){ return this.replace(/(^\s*)|(\s*$)/g, "");}

function ImageZoom(Img,width,height)
{ 
	var image=new Image(); 
	image.src=Img.src;
	if(image.width>width||image.height>height)
	{
		w=image.width/width; 
		h=image.height/height; 
		if(w>h)
		{
			Img.width=width; 
			Img.height=image.height/w; 
		}
		else
		{
			Img.height=height; 
			Img.width=image.width/h; 
		} 
	}
}

function ImageOpen(Img)
{
	window.open(Img.src);
}

function ChkUserLogin(frm)
{
	if(frm.User_Name.value.trim()=='')
	{
		alert("请输入您的用户名。");
		frm.User_Name.focus();
		return false;
	}
	if(frm.User_Password.value.trim()=='')
	{
		alert("请输入您的密码。");
		frm.User_Password.focus();
		return false;
	}
	return true;
}

function ChkUserSearch(frm)
{
	if(frm.keyword.value.trim()=="")
	{
		alert("请输入你要查询的关键词。");
		frm.keyword.focus()
		return false;
	}
	return true;
}

