	function setCookie (name, value, expires) {
	  document.cookie = name + "=" + escape (value) +
		"; path=/; expires=" + expires.toGMTString();
	}

	function getCookie(Name) {
	  var search = Name + "="
	  if (document.cookie.length > 0) { // ÄíÅ°°¡ ¼³Á¤µÇ¾î ÀÖ´Ù¸é
		offset = document.cookie.indexOf(search)
		if (offset != -1) { // ÄíÅ°°¡ Á¸ÀçÇÏ¸é
		  offset += search.length
		  // set index of beginning of value
		  end = document.cookie.indexOf(";", offset)
		  // ÄíÅ° °ªÀÇ ¸¶Áö¸· À§Ä¡ ÀÎµ¦½º ¹øÈ£ ¼³Á¤
		  if (end == -1)
			end = document.cookie.length
		  return unescape(document.cookie.substring(offset, end))
		}
	  }
	  return "";
	}

	function saveid(form) {
	  var expdate = new Date();
	  // ±âº»ÀûÀ¸·Î 30ÀÏµ¿¾È ±â¾ïÇÏ°Ô ÇÔ. ÀÏ¼ö¸¦ Á¶ÀýÇÏ·Á¸é * 30¿¡¼­ ¼ýÀÚ¸¦ Á¶ÀýÇÏ¸é µÊ
	  if (form.checksaveid.checked)
		expdate.setTime(expdate.getTime() + 1000 * 3600 * 24 * 7); // 7ÀÏ
	  else
		expdate.setTime(expdate.getTime() - 1); // ÄíÅ° »èÁ¦Á¶°Ç

	    setCookie("saveid", form.vPmemberId.value, expdate);
	}

	function getid(form) {
      if (form)
        form.checksaveid.checked = ((form.vPmemberId.value = getCookie("Name")) != "");
	}

	function check_enter(){
		if(event.keyCode==13)
			go_logincheck();
	}

	function go_logincheck(){
		if(document.login_form.vPmemberId.value==''){
			alert('ID¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä');
			document.login_form.vPmemberId.focus();
			return;
		}
		if(document.login_form.vPmemberPw.value==''){
			alert('ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä');
			document.login_form.vPmemberPw.focus();
			return;
		}


	/*
	update description :ºÒÇÊ¿äÇÑfunction ÀÌ¿ë Á¦°Å
	update date : 20090324
	updated by valense in CA
	*/
		host_name= document.domain;
		//var url = new String(document.location);
		//var host_name = get_host_name(url);
		//////// ÃÖÃÊ ·Î±×ÀÎ½Ã 10,000 Æ÷ÀÎÆ® Ãß°¡ ½ÃÀÛ : event_type = 1 (kkab 081214)//////////////////
		// 2009³â 1¿ù 15ÀÏ [Á¶ÀÌ³Ý ¾÷¹«¿äÃ»¸®½ºÆ®->¿î¿µ¿äÃ»¼­ ÂüÁ¶][ÃÖ¿µÈ£ºÎÀå¿äÃ»] 10000Æ÷ÀÎÆ® Áö±ÞÇà»ç Áß´ÜµÇ¾î 1¿ù16ÀÏ ¿ÀÀü10½ÃºÎ·Î ¼­ºñ½º Àû¿ë Áß´Ü¿äÃ»ÇÔ
		//¼öÁ¤ÀÏ½Ã [2009-1-15 ¿ÀÈÄ 6½Ã 40ºÐ¿¡ Àû¿ëÇÔ]
		if (document.login_form.ssl_check.checked) 
			document.login_form.action = 'https://'+host_name+'/member/member_login_db_20060220.asp';
		else
			document.login_form.action = 'http://'+host_name+'/member/member_login_db_20060220.asp';

		document.login_form.submit();
	}

	function check_logout(){
		if(confirm('·Î±×¾Æ¿ô ÇÏ½Ã°Ú½À´Ï±î?')==true){
			document.login_form.action='logout.asp';
			document.login_form.submit();
		}
	}

    function logout() {
       if(confirm("·Î±×¾Æ¿ô ÇÏ½Ã°Ú½À´Ï±î")) {
          document.location.href = "/member/member_logout.asp";          
        }
    }
    
    if (document.login_form)
      getid(document.login_form);	
    
	function get_host_name(url) {
		var result;
		var Ptr
			Ptr = url.indexOf(".kr/");


			if (Ptr>0){
					result = url.substring(url.indexOf("://")+3, url.indexOf(".co.kr/")+6);
			}else{
					result = url.substring(url.indexOf("://")+3, url.indexOf(".com/")+4);

			}
		
		return result;
	}
window.Blink = function(args){
  // Set the color and seconds below, e.g., [args,'COLOR',SECONDS]
    args = (/,/.test(args))?  args.split(/,/):  [args,'white',1];
    var who = document.getElementById(args[0]);
    var count = parseInt(args[2]);
    if (--count <=0) {
          who.style.backgroundColor = '';
          if(who.focus) who.focus();
    } else {
          args[2]=count+'';
          who.style.backgroundColor=(count%2==0)? '': args[1];
         args='\"'+args.join(',')+'\"';
          setTimeout("Blink("+args+")",500);
    }
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(function() {
  Blink('vPmemberId'); //ÀÌ°÷¿¡¼­ ÁöÁ¤ÇÑ ID°ª ¹Ú½º°¡ ±ôºýÀÔ´Ï´Ù.
 });


