// JavaScript Document

function Open(thisform){
  if (thisform.options[thisform.selectedIndex].value.length>0)
  	window.open(thisform.options[thisform.selectedIndex].value);
}
function openwin(url,w,h){
   var newwin=window.open(url,"NewCN_OpenWindow","top="+(screen.availheight-h)/2+",left="+(screen.availwidth-w)/2+",width="+w+",height="+h+",scrollbars=yes,toolbar=n,location=no,directories=no,status=no,menubar=no,resizable=0");
   newwin.focus();
   return(newwin);
}//结合screen对象实现屏幕居中弹出窗口

function doZoom(size){
	document.getElementById('Zoom').style.fontSize=size+'px'
}

//setColor
function setColor(color_val) {
document.getElementById('textBody').style.backgroundColor = color_val;
document.getElementById('textBody').style.backgroundColor = color_val;
	writeCookie("bgColor_cookie", color_val, 24)
}

//getColor
function getColor() {
	  textBody.style.backgroundColor = "#FFFFFF";
	var bg_color = readCookie("bgColor_cookie");
	if (bg_color != null) {
		textBody.style.backgroundColor = bg_color
	//alert(bg_color);
	}
}

//分页转向
function gopage(){
  var pno=document.pages.pageno.value;
  if (window.event.keycode==13){
	document.location.href='?pageno='+pno;
  }
}

// writeCookie
function writeCookie(name, value, expires)
{
  var expire = "";
  if(expires != null)
  {
	expire = new Date((new Date()).getTime() + expires * 3600000);
	expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire;
}
//刷新验证码
function RefreshCodeImg(){
	document.all.checkcode.src='NewCnSystem/inc/getcode.asp';
}
function CheckForm()
{
	if(document.myform.AdminName.value=="")
	{
		alert("请输入您的管理帐号！");
		document.myform.AdminName.focus();
		return false;
	}
	if(document.myform.PassWord.value == "")
	{
		alert("请输入您的密码！");
		document.myform.PassWord.focus();
		return false;
	}
	if (document.myform.verifycode.value==""){
       alert ("请输入您的图形验证码！");
       document.myform.verifycode.focus();
       return(false);
    }
}
