<!--
function killErrors()
{   
	return true;   
}   
window.onerror = killErrors;  



//取得id的obj
function $()
{
	if(typeof(arguments[0]) == "string")
	{
		return document.getElementById?document.getElementById(arguments[0]):eval(arguments[0]);
	}
	else
	{
		return arguments[0];
	}
}



//询问对话框
function hintandturn(str,url,torf)
{
	if(confirm(str) && torf){
		window.location=url;
		return true;
	}else{
		return false;
		}
}


function hintandturn1(str,url,torf,t)
{
	if(confirm(str) && torf){
		t.disabled = true;
		t.value = "稍候..";
		
		window.location=url;
		return true;
	}else{
		return false;
		}
}


//选择所有复选框
function CheckAll(FormName,CheckboxName,chkAllName){
  for (var i=0;i<eval("document." + FormName + "." + CheckboxName + ".length");i++){
		var e = eval("document." + FormName + "." + CheckboxName + "[" + i + "]");
		if (e.Name != chkAllName){
			e.checked = eval("document." + FormName + "." + chkAllName + ".checked");
		}
    }
}
function UnSelectAll(FormName,chkAllName){
    eval("document." + FormName + "." + chkAllName + ".checked=1")	
}


//鼠标控制Div背景颜色
function divsetbg(obj){
	obj.style.backgroundColor = '#ffffff';
}
function divrebg(obj){
	obj.style.backgroundColor = '';
}
function divrebgcheck(obj){
	var objChildCheck = document.all ? obj.children[0].children[0] : obj.childNodes[1].childNodes[1];
	if(objChildCheck.checked){
		return false;
	}
	obj.style.backgroundColor = '';
}


function onloadimg(obj,widthnum,heightnum){  
	//if(obj.width > obj.height){  
	//	if(obj.width > widthnum){  
	//		obj.width = widthnum;  
	//	}  
	//}else{  
	//	if(obj.height > heightnum){  
	//		obj.height = heightnum;  
	//	}  
	//}
	if(obj.width > widthnum){  
		obj.width = widthnum;  
	} 
}  




function ClickFace(FaceId){
	for(var i=1;i<=12;i++){
		eval("document.GB.faceid" + i + ".style.border='1px solid #f0f0f0';");
	}
	eval("document.GB." + FaceId + ".style.border='1px solid #000000';");
	eval("document.GB.GBFace.value=document.GB." + FaceId + ".name;");
}
function SelectFace(FaceType){
	for(var i=1;i<=12;i++){
		eval("document.GB.faceid" + i + ".src='images/gbface/"+ FaceType + i + ".jpg';");
		eval("document.GB.faceid" + i + ".name='"+ FaceType + i + ".jpg';");
	}
	ClickFace("faceid1");
}
function ChkGB(){
	var FormName=document.GB;
	if(FormName.GBTitle.value=="")
	{
		alert("请填写标题");
		FormName.GBTitle.focus();
		return false;
	}
	if(FormName.GBContent.value=="")
	{
		alert("请填写内容");
		FormName.GBContent.focus();
		return false;
	}
	return true;
}

//文件按等比重置宽高度。使用例子：<img src="..." onload='imgSizeReSet(this,120,120);'>
function imgSizeReSet(ImgD,w,h) {
	var maxWidth = w;
	var maxHeight = h;
	var image = new Image();
	image.src = ImgD.src;
	if (image.width > 0 && image.height > 0) {
		if (image.width / image.height >= maxWidth / maxHeight) {
			if (image.width > maxWidth) {
				ImgD.width = maxWidth;
				ImgD.height = (image.height * maxWidth) / image.width;
			} else {
				ImgD.width = image.width;
				ImgD.height = image.height;
			}
		} else {
			if (image.height > maxHeight) {
				ImgD.height = maxHeight;
				ImgD.width = (image.width * maxHeight) / image.height;
			} else {
				ImgD.width = image.width;
				ImgD.height = image.height;
			}
		}
	}
}

function goQuickLink(o)
{
	if(o.value != "0")
	{
		window.location.href=o.value;	
	}
}


function returnMDf(WINwidth,WINheight)
{
	var showX = window.screen.width / 2 - WINwidth / 2;
	var showY = window.screen.height / 2 - WINheight / 2;
	var newWINwidth = WINwidth + 4 + 18;
	var features =
		'dialogWidth:' + newWINwidth + 'px;' +
		'dialogHeight:' + WINheight + 'px;' +
		'dialogLeft:' + showX + 'px;' +
		'dialogTop:' + showY + 'px;' +
		'directories:no; localtion:no; menubar:no; status=no; toolbar=no;scrollbars:yes;Resizeable=no';
	return features;
}

function newsSelectColor(bc,hv)
{
	retval = window.showModalDialog("../inc/selcolor.asp", "sColor" , returnMDf(290,280) );
	if( retval != null ){
		var a = document.getElementById(bc);
		var b = document.getElementById(hv);
		
		a.style.backgroundColor = retval;
		b.value = retval;
	}
}
//-->
