function focus() {
  if(!(uid = Gookie("uid"))) {
    document.login.id.focus();
  }
  else {
    document.login.passwd.focus();
  }
}

function GookieVal(offset) {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1)
      endstr = document.cookie.length;
   return unescape(document.cookie.substring(offset, endstr));
}

function Gookie(name) {
   var arg = name + "=";
   var alen = arg.length;
   var clen = document.cookie.length;
   var i = 0;
   while (i < clen) {
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg)
         return GookieVal (j);
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0) break;
   }
   return null;
}

function Sookie(name, value, expires, path, domain, secure) {
   document.cookie = name + "=" + escape (value) +
      ((expires == null) ? "" : ("; expires="
       + expires.toGMTString())) +
      ((path == null) ? "" : ("; path=" + path)) +
      ((domain == null) ? "" : ("; domain=" + domain)) +
      ((secure == true) ? "; secure" : "");
}

function id()
{
    if ( document.login.id.value == "" )
    {
        alert( "½Ð¶ñ¼g¡iID¡j !" ) ;
        document.login.id.focus();
        return( false ) ;
    }
             return( true ) ;
}
function pass()
{
    if ( document.login.passwd.value == "" )
    {
        alert( "½Ð¶ñ¼g¡iPassword¡j!" ) ;
        document.login.passwd.focus();
        return( false ) ;
    }
    return( true ) ;
}
function noerror()
{
    if ( !id()){ return( false ) ; }
    if ( !pass()){ return( false ) ; }
    document.login.submit() ;
    return( true ) ;
}

function GookieVal(offset) {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1)
      endstr = document.cookie.length;
   return unescape(document.cookie.substring(offset, endstr));
}
function Gookie(name) {
   var arg = name + "=";
   var alen = arg.length;
   var clen = document.cookie.length;
   var i = 0;
   while (i < clen) {
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg)
         return GookieVal (j);
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0) break;
   }
   return null;
}  

function checkmember(){
	if ( (Gookie("pchome_cookie")) && (Gookie("id_pchome")) && (Gookie("message_pchome")) ) {
		return (true);
	}else{
		winobj = window.open('/adm/memlogin.html','win_mem','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,width=204,height=128');
		return (false);
	}
}