//¾ÆÀÌµð ÀúÀå
function user_id_save(form){
	var expdate = new Date();
	
	if (form.save_check.checked){
		expdate.setTime(expdate.getTime() + 1000 * 3600 * 24 * 30);
	}else{
		expdate.setTime(expdate.getTime() - 1);
	}
	set_cookie("save_user_id", form.user_id.value, expdate);
}

//È¸¿ø°¡ÀÔ 2 ÀÌ¸§ ÁÖ¹Î¹øÈ£ Ã¼Å©
function nextFocus(sFormName,sNow,sNext)
{
	var sForm = 'document.'+ sFormName +'.'
	var oNow = eval(sForm + sNow);

	if (typeof oNow == 'object')
	{
		if ( oNow.value.length == oNow.maxLength)
		{
			var oNext = eval(sForm + sNext);

			if ((typeof oNext) == 'object')
				oNext.focus();
		}
	}
}

function fnSubmit()
{
	with(document.member02form)
	{
		/*if(radiobutton[0].checked == false){
			alert('¾à°ü¿¡ µ¿ÀÇ ÇÏ¼Å¾ß È¸¿ø°¡ÀÔÀ» ÇÏ½Ç¼öÀÖ½À´Ï´Ù..');
			radiobutton[0].focus();
			return;
		}*/
		if ( user_name.value == '' )
		{
			alert('¼º¸íÀ» ÀÔ·ÂÇÏ½Ê½Ã¿ä.');
			user_name.focus();
			return;
		}
		if (user_jumin1.value.length != 6 )
		{
			alert('ÁÖ¹Î¹øÈ£¸¦ È®ÀÎÇÏ¼¼¿ä.');
			user_jumin1.focus();
			return;
		}
		if (user_jumin2.value.length != 7 )
		{
			alert('ÁÖ¹Î¹øÈ£¸¦ È®ÀÎÇÏ¼¼¿ä.');
			user_jumin2.focus();
			return;
		}	
	}	
	document.member02form.action = "https://www.mtree.kr/namecheck/nc_p.jsp";
	document.member02form.submit();
}

//¾ÆÀÌµð ºÒ·¯¿À±â
function user_id_get(form){
	if(get_cookie("save_user_id") != ""){
		form.user_id.value = get_cookie("save_user_id");
		form.save_check.checked = true;
	}
}

//·Î±×ÀÎ Æû Ã¼Å© ¸ÞÀÎÈ­¸é
function login_form_check(){
	var f = document.all;

	if(f.user_id.value == ""){
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		f.user_id.focus();
		return false;
	}
	if(f.password.value == ""){
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		f.password.focus();
		return false;
	}
	user_id_save(f);
	return true;
}

//ÄíÅ° ÀúÀåÇÏ±â
function set_cookie(name, value, expires){
  document.cookie = name + "=" + escape (value) + "; path=/; expires=" + expires.toGMTString();
}

//ÄíÅ° ºÒ·¯¿À±â
function get_cookie(Name){
	var search = Name + "="

	if (document.cookie.length > 0){ 
		offset = document.cookie.indexOf(search)
		if (offset != -1){ 
			offset += search.length
			end = document.cookie.indexOf(";", offset)
			if (end == -1){
				end = document.cookie.length;
			}
			return unescape(document.cookie.substring(offset, end))
		}
	}
	return "";
}

function flash(id, width, height, name,op){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+width+'" height="'+height+'" id="'+name+'">'
	+'<param name="movie" value="'+id+'">'
	+'<param name="quality" value="high">'
	+'<param name="wmode" value="'+op+'">'
    +'<param name="allowScriptAccess" value="always" >'
	+'<embed  src="'+id+'" quality="high" wmode="transparent" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" showLiveConnect="true" name="'+name+'" allowScriptAccess="always"></embed>'
	+'</object>');
}

// flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î)
function swf(src,width,height) {
    object = '';
    object += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="param" width="'+width+'" height="'+height+'">';
    object += '<param name="movie" value="'+src+'">';
	object += '<PARAM NAME=wmode VALUE=transparent>';
    object += '<embed src="'+src+'" quality="high" wmode="transparent" bgcolor="#ffffff" menu="false" width="'+width+'" height="'+height+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
    object += '<\/object>';
    document.write(object);
}



	function faqView(idx) {
		var oFaq = document.getElementById('faqView' + idx);
		if(oFaq.style.display == "block") {
			oFaq.style.display = "none";
		} else {
			oFaq.style.display = "block";
		}
	}
			function Search()
		{
			if(document.frmFaq.gubun.value=="")
			{
				alert("ºÐ·ù¸¦ ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿À.");
				document.frmFaq.gubun.focus();
				return;
			}
			if(document.frmFaq.keyword.value=="")
			{
				alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿À.");
				document.frmFaq.keyword.focus();
				return;
			}
			document.frmFaq.action="FaqList.asp";
			document.frmFaq.submit();
		}
	//ÇÃ·¡½¬ Á¶Á¤
	function flashOver() {
		document.getElementById("flash-test").style.zIndex = 100;
	}
	function flashOut() {
		document.getElementById("flash-test").style.zIndex = 1;
	}

	//·Î±×ÀÎ Æû Ã¼Å© ¸ÞÀÎÈ­¸é
function sub_login_check(){
var f = document.all;

if(f.user_id.value == ""){
	alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
	f.user_id.focus();
	return false;
}
if(f.password.value == ""){
	alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
	f.password.focus();
	return false;
}
return true;
}

function req_login()
{
	location.href='http://www.mtree.kr/member/subLogin.jsp?fromWhere=/index.jsp';
}