	function checkIt(){
		f=document.tmpform;
		if(!f.id.value){
			alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
			f.id.focus();
			return false;
		}
		if(!f.passwd.value){
			alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
			f.passwd.focus();
			return false;
		}
		return true;
	}

function getCookie(name)
{
	var cookie_name = name + '=';
	var i = 0;
	while(i <= document.cookie.length)
	{
		var k = (i + cookie_name.length);
		if(document.cookie.substring(i,k) == cookie_name){
			if((cookie_end = document.cookie.indexOf(';',k)) == -1)
				cookie_end = document.cookie.length;
				return unescape(document.cookie.substring(k,cookie_end));
				//return document.cookie.substring(k,cookie_end);
		}
		i = document.cookie.indexOf(' ',i) + 1;
		if(i == 0) break;
	}
	return null;
}




if(getCookie('_userid') == null){

		document.writeln("<table align=\"center\" border='0' cellspacing='3' cellpadding='0'>");
        document.writeln("<form name=tmpform action='/chnet2/member/login_ok.php' method='post' onsubmit='return checkIt();'>");
        document.writeln("<INPUT TYPE='hidden' name='method' value='in'>");
        document.writeln("<tr>");
        document.writeln("<td><img src='/images/home/id.gif' width='21' height='11'></td>");
        document.writeln("<td width='90'><input name='id' type='text' tabindex='1' size='12' style=\"BORDER:#D2D2D2 solid 1px;BACKGROUND-COLOR:#FFFFFF;color:#5E5E5E;font-size:11px;width:80px;height:18px;\"></td>");
        document.writeln("<td rowspan='2'><input name='image' type='image' src='/images/home/login.gif' width='44' height='45'></td>");
        document.writeln("</tr>");
        document.writeln("<tr>");
        document.writeln("<td><img src='/images/home/pw.gif' width='21' height='11'></td>");
        document.writeln("<td><input name='passwd' type='password' tabindex='2' size='12' style=\"BORDER:#D2D2D2 solid 1px;BACKGROUND-COLOR:#FFFFFF;color:#5E5E5E;font-size:11px;width:80px;height:18px;\"></td>");
        document.writeln("</tr>");
        document.writeln("<tr>");
        document.writeln("<td colspan='3' height='35'><div align='center'><a href=\"#\" onClick=\"MM_openBrWindow('/chnet2/member/join_2.htm?mode=pop&url=reload','','scrollbars=yes,left=0,top=0,width=580,height=550')\" style='cursor:hand;'><img src=\"/images/home/ga.gif\" width=\"64\" height=\"20\" border=\"0\"></a> <a href=\"#\" onClick=\"MM_openBrWindow('/chnet2/member/auth_search.php','','scrollbars=yes,left=0,top=0,width=580,height=300')\" style='cursor:hand;'><img src=\"/images/home/idpw.gif\" width=\"74\" height=\"20\" border=\"0\"></a></div></td>");
        document.writeln("</tr>");
        document.writeln("</form>");
        document.writeln("</table>");

}else{
		document.writeln("<table border='0' cellspacing='3' cellpadding='0'>");
		document.writeln("<tr>");
        document.writeln("<td>");
	if(getCookie('level')!='1'){
        document.writeln("<table border='0' cellspacing='0' cellpadding='0'>");
		document.writeln("<tr>");
		document.writeln("<td height=\"40\" width=\"190\"> <div align=\"center\"><b>[<font class=\"orangebig\">"+getCookie('_userid')+"</font>]</b> ´Ô È¯¿µÇÕ´Ï´Ù.</div></td>");
		document.writeln("</tr>");
		document.writeln("<tr>");
		document.writeln("<td align='center' height='35'><div align=\"center\"><a href='/chnet2/member/login_ok.php?method=out'><img src=\"/images/home/logout.gif\" width=\"64\" height=\"20\" border=\"0\"></a> <a href=\"#\" onClick=\"MM_openBrWindow('/chnet2/member/edit.php','','scrollbars=yes,left=0,top=0,width=580,height=550')\" style='cursor:hand;'><img src=\"/images/home/jeongbo.gif\" width=\"82\" height=\"20\" border=\"0\"></a></div></td>");
		document.writeln("</tr>");
		document.writeln("</table>");
		}else{
		document.writeln("<table border='0' cellspacing='0' cellpadding='0'>");
		document.writeln("<tr>");
		document.writeln("<td height=\"40\" width=\"190\"><div align=\"center\"><b>[<font class=\"orangebig\">°ü¸®ÀÚ</font>]</b> ´Ô È¯¿µÇÕ´Ï´Ù.</div></td>");
		document.writeln("<tr>");
		document.writeln("<td height='35'><div align=\"center\"><a href='/chnet2/member/login_ok.php?method=out'><img src=\"/images/home/logout.gif\" width=\"64\" height=\"20\" border=\"0\"></a> <a href='/chnet2/admin' target='_blank'><img src=\"/images/home/admin.gif\" width=\"56\" height=\"20\" border=\"0\"></a></div></td>");
		document.writeln("</tr>");
		document.writeln("</table>");
		}
		document.writeln("</td>");
		document.writeln("</tr>");
		document.writeln("</table>");
}
