function chkLogin() 
{
	var oForm = document.login;

	if (oForm.id.value == "" || oForm.id.value == 0) {
		PopMsg("ID¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		oForm.id.select();
		return false;
	}

	if (oForm.pwd.value == "" ) {
		PopMsg("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		oForm.pwd.select();
		return false;
	}

	oForm.secure.value = document.getElementById("securelogin").checked == true ? 'Y' : 'N';

	var packedVal = oForm.id.value+"\n"+oForm.pwd.value;

	if (oForm.secure.value == 'Y')
	{
		var encVal = NiceFCryptEncrypt(packedVal);
		if (encVal.substring(0, 5) == 'ERROR')
		{
			oForm.secure.value = 'N';
		}
		else
		{
			packedVal = encVal;
		}
	}

	//alert(packedVal);
	oForm.lgval.value = packedVal;

	try
	{
		var flag = (oForm.securelogin.checked == true) ? "y" : "n";
		FlexSetSecureLoginState(flag);
		
		if(oForm.saveID.checked == true)
		{	
			FlexSetSavedID(oForm.id.value);
		}
		else
		{
			FlexClearSavedID();
		}							
	}
	catch (e)
	{
	}

	oForm.id.value = '';
	oForm.pwd.value = '';

	oForm.submit();
}

function SetSecureLoginCheckboxState(destObj)
{
	if (typeof(_NICE_FCRYPT_OBJ_) == "undefined")
	{
		destObj.checked = false;
	}
	else
	{
		try
		{
			//alert(FlexGetSecureLoginState());
			//destObj.checked = (FlexGetSecureLoginState() == "n") ? false : true;	//±âº»°ªÀ» º¸¾ÈÁ¢¼ÓÀ¸·Î
			destObj.checked = (FlexGetSecureLoginState() == "y") ? true : false;	//±âº»°ªÀ» ÀÏ¹ÝÁ¢¼ÓÀ¸·Î
		}
		catch (e)
		{
			destObj.checked = false;
		}
	}
}

function DefaultSavedID(destObj)
{
	if (typeof(_NICE_FCRYPT_OBJ_) == "undefined")
	{
		//destObj.checked = false;
	}
	else
	{
		try
		{
			//alert(FlexGetSavedID());
			destObj.value = FlexGetSavedID();
			if(destObj.value != "")
			{
				destObj.style.backgroundImage = "none";
				document.forms["login"].saveID.checked = true;
				document.forms["login"].pwd.focus();
			}
			else
			{
				//document.forms["login"].id.focus();
			}
		}
		catch (e)
		{
			//destObj.checked = false;
		}
	}
}

function ChkSaveID()
{
	if(document.forms["login"].saveID.checked == true)
	{
		alert("°ø°øÀå¼Ò¿¡¼­´Â IDÀúÀåÀ» ÀÚÁ¦ÇØÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
	}
}

function find_user()
{
   url = "http://nas.nice3355.co.kr/find/find_id_pwd.htm";
   remote = window.open( url, "find_user", "toolbar=no,directories=no,menubar=no,width=600,height=500" );
}

function new_user()
{
   //url = "http://user.nicenet.co.kr/user/reg_check.htm?from_site=http://www.nice3355.co.kr";

   //url = "http://user.nicenet.co.kr/user/reg_check.htm?from_site=http://myhompy.to";
   url = "http://nas.nice3355.co.kr/join/join.html?origin="+location.href;

   window.location.href = url;
   // remote = window.open( url, "insNice", "toolbar=no,directories=no,menubar=no,scrollbars=yes,width=760,height=650,left=0,top=0" );
}

function upd_user()
{
   url = "http://nas.nicesms.co.kr/modify/modify_userinfo.htm";
   remote = window.open( url, "updNice", "toolbar=no,directories=no,menubar=no,scrollbars=yes,width=760,height=650" );
}
