
function OpenWin(url, width, height)
{
	ContentWindow = window.open(url,"_blank","toolbar=no,top=60,left=50,width=" + width + ",height=" + height + ",directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no")
	
}
function Opennew(url,width,height)
{
	if(width==0&&height==0){
		width = screen.availWidth;
		height = screen.availHeight;
	}
	ContentWindow = window.open(url,"_blank","toolbar=no,top=60,left=50,width=" + width + ",height=" + height + ",directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no")
	
}

function getByid(id) {
	if (document.getElementById) {
		return document.getElementById(id);
	}else if (document.all) {
		return document.all[id];
	}else if (document.layers) {
		return document.layers[id];
	}else {
		return null;
	}
}

function ResizeImages(objID) {
	var maxwidth=600;//设置图片最大宽度
	if (getByid(objID)!=null){
		var imgs = getByid(objID).getElementsByTagName('img');
		var oldwidth="";
		for (i=0; i<imgs.length; i++) {
			oldwidth = imgs[i].width;
			if(oldwidth > maxwidth) {
                imgs[i].title = '点击图片可在新窗口打开';
                imgs[i].onclick = function() {Opennew(this.src,0,0);}//打开新窗口
				imgs[i].width = maxwidth;
				//imgs[i].height = imgs[i].height * (maxwidth/oldwidth);
			}
		}
	}
}


function CheckSearch(obj){
	if (obj.SearchKey.value=="")
	{
		alert("请输入关键字查询！");
		obj.SearchKey.focus();
		return false;
	}
	return true;
}

