function MM_swapImgRestore() {
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() {
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() {
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function ViewMenu(obj)
{
	if (obj.style.display != "none") 
	{
		obj.style.display = "none";
	}
	else 
	{
		obj.style.display = "";
	}
}

var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
function getRef(id) {
	if (isDOM) return document.getElementById(id);
	if (isIE4) return document.all[id];
	if (isNS4) return document.layers[id];
}
var isNS = navigator.appName == "Netscape";
function moveRightEdge() {
	var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;
	if (isNS4) {
		yMenuFrom   = divMenu.top;
		yMenuTo     = windows.pageYOffset + 130;   // À§ÂÊ À§Ä¡
	} else if (isDOM) {
		yMenuFrom   = parseInt (divMenu.style.top, 10);
		yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop) + 130; // À§ÂÊ À§Ä¡
	}
	timeoutNextCheck = 500;
	if (yMenuFrom != yMenuTo) {
		yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 20);
		if (yMenuTo < yMenuFrom)
			yOffset = -yOffset;
		if (isNS4)
			divMenu.top += yOffset;
		else if (isDOM)
			divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
			timeoutNextCheck = 10;
	}
	setTimeout ("moveRightEdge()", timeoutNextCheck);
}

function makeWin(url, winname, width, height)
{
   xposition=0; yposition=0;
   if (parseInt(navigator.appVersion) >= 4){
      xposition = (screen.width - width) / 2;
      yposition = (screen.height - height) / 2;
   }
   args = "width=" + width + "," + "height=" + height + "," + "location=0," + "menubar=0," + "resizable=0,"
         + "scrollbars=0," + "status=0," + "titlebar=0," + "toolbar=0," + "hotkeys=0,"
   + "screenx=" + xposition + ","  //NN Only
   + "screeny=" + yposition + ","  //NN Only
   + "left=" + xposition + ","     //IE Only
   + "top=" + yposition;           //IE Only

   newWin=window.open(url,winname,args)
   newWin.focus();
}

function makeWinSize(url, winname, width, height, WinX, WinY )
{
   xposition=0; yposition=0;
   if (parseInt(navigator.appVersion) >= 4){
      xposition = (screen.width - width) / 2;
      yposition = (screen.height - height) / 2;
   }
   args = "width=" + width + "," + "height=" + height + "," + "location=0," + "menubar=0," + "resizable=0,"
         + "scrollbars=0," + "status=0," + "titlebar=0," + "toolbar=0," + "hotkeys=0,"
   + "screenx=" + WinX + ","  //NN Only
   + "screeny=" + WinY + ","  //NN Only
   + "left=" + WinX + ","     //IE Only
   + "top=" + WinY;           //IE Only

   newWin=window.open(url,winname,args)
   newWin.focus();
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function checkform(form)
{
		
    var result = true;
    if(form.p_loginid.value < 1)
    {
        alert("»ç¿ëÀÚ ID¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä");
        result = false;
        form.p_loginid.focus();
        return false;
    }
    
    if(result && form.p_pswd.value < 1)
    {
        alert("¾ÏÈ£¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä");
        result = false;
        form.p_pswd.focus();    
        return false;
    }

	return true;
}

function LoginChk(form)
{
	
  if(checkform(form) == true){
		
    if(form.LoginType['0'].checked){
    //form.action = "http://www.korcham.net/kcncomon/logon/login_chk.asp";	//¼öÁ¤Àü
	  //form.action = "http://network.korcham.net/login_chk.asp";	//¼öÁ¤(2003.12.11)
	  //form.action = "https://member.korcham.net/login_chk.asp";	//¼öÁ¤(2004.01.19)
//	    form.action = "http://www.s-erp.co.kr/login/login_chk_per.asp";  
	    form.action = "http://www.s-erp.co.kr/login/login_chk_per.asp";  
    }else{
    
      form.action = "http://www.s-erp.co.kr/login/login_chk.asp";
    }
    form.submit();

  } else {

	return false;

  }
  
  return true;
}

function fn_openNew(form) {

	if(form.LoginType['0'].checked){
		//var url = "/sub02/member_guide_person.html"
		//url="";
		// "http://www.korcham.net/kcncomon/logon/KC-KH-WD-member-body-001.asp?cciid=&p_op_type=I&p_op_type2=&B_ID=&gubun4=P&p_source_system=ERP&p_isPopup=Y";
		//var url = "http://hp.korcham.net/cd/KC-KH-WD-member-body-001.asp?p_op_type=I";
		//var url = "http://network.korcham.net/per_info_updform.asp"
		var h_value = 400;

		//var win = window.open(url, "perUpdWin", "top=20,left=20,width=450,height=" + h_value + ",scrollbars=no,resizable=no,status=no");
		//win.focus();

		form.action="http://www.s-erp.co.kr/per_member/member_guide_person.asp";
    	 form.submit();	
//		 form.action = "http://www.s-erp.co.kr/login/login_chk.asp";
	}else{
		//makeWin("/sub02/member_guide.html", "MemWin", 350, 583);

	//	 form.action = "http://www.s-erp.co.kr/login/login_chk.asp";
  // 	 form.submit();	

	}

}

function fn_openPerModWin() {
		//var url = "http://www.korcham.net/kcncomon/logon/KC-KH-WD-member-body-001.asp?p_op_type=U&p_source_system=ERP&p_isPopup=Y"; //¼öÁ¤Àü
		var url = "https://member.korcham.net/member/member-body-001.asp?p_op_type=U&p_source_system=ERP&p_isPopup=Y"; // ¼öÁ¤ÈÄ
		//var url = "http://hp.korcham.net/cd/KC-KH-WD-member-body-001.asp?p_op_type=I";
		//var url = "http://network.korcham.net/per_info_updform.asp"
		var h_value = 600;

//		var win = window.open(url, "perUpdWin", "top=20,left=20,width=860,height=" + h_value + ",scrollbars=yes,resizable=yes,status=yes");
		win.focus();
}

function open_id(form){
	if(form.LoginType['0'].checked){
	//	window.open ('http://hp.korcham.net/member/login_id_search.asp','search_id','width=576,height=265,scrollbars=yes,toolbar=no, resizable=yes,menubar=no');
	}else{
		alert ('±â¾÷È¸¿øÀº °í°´Áö¿ø¼¾ÅÍ·Î ¹®ÀÇÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n\n°³ÀÎÈ¸¿øÀÇ "¾ÆÀÌµðÃ£±â"´Â ·Î±äÃ¢ÀÇ \n°³ÀÎÈ¸¿øÀ» Ã¼Å©ÈÄ "¾ÆÀÌµðÃ£±â"¸¦ ´­·ÁÁÖ¼¼¿ä');
	}
}

function open_pw(form){
	if(form.LoginType['0'].checked){
	//	window.open ('http://hp.korcham.net/member/login_pw_search.asp','search_passwd','width=576,height=265,scrollbars=yes,toolbar=no, resizable=yes,menubar=no');
	}else{
		alert ('±â¾÷È¸¿øÀº °í°´Áö¿ø¼¾ÅÍ·Î ¹®ÀÇÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n\n°³ÀÎÈ¸¿øÀÇ "ºñ¹Ð¹øÈ£Ã£±â"´Â ·Î±äÃ¢ÀÇ \n°³ÀÎÈ¸¿øÀ» Ã¼Å©ÈÄ "ºñ¹Ð¹øÈ£Ã£±â"¸¦ ´­·ÁÁÖ¼¼¿ä');
	}
}

