/* window open½Ã Áß¾Ó¿¡ À§Ä¡ */
function setCenter(winwidth, winheight) {

	winx = Math.ceil((screen.availWidth - winwidth) / 2);
	winy = Math.ceil((screen.availHeight - winheight) / 2);

	if (winwidth == screen.availWidth) winwidth = screen.availWidth - 10;
	if (winheight == screen.availHeight) winheight = screen.availHeight - 30;

	return "left=" + winx + ",top=" + winy + ",width=" + winwidth + ",height=" + winheight;
}
function setWinHide(winwidth, winheight) {
	return "left=10000,top=10000,width=" + winwidth + ",height=" + winheight;
}
/*--------------------¼öÁÖÃßÁøÇÁ·ÎÁ§Æ®°ü¸®--------------------*/
//¼öÃßÃßÁøÇÁ·ÎÁ§Æ® ÀÐ±â
var popWin_224 = null;
function Pread(in_g_gubun,in_rfq_no) {
	document.read.g_gubun.value=in_g_gubun;
	document.read.rfq_no.value=in_rfq_no;	
	var url ='AC224CJ02.jsp?g_gubun='+in_g_gubun+'&rfq_no='+in_rfq_no;
	
	if( self.popWin_224 && !popWin_224.closed ) {
		popWin_224.location=url;
		popWin_224.focus();
	} 
	else {	
		Size_w = 780;
		Size_h =550;
		winFeature = setCenter(Size_w, Size_h) + ",menubar=no,resizable=no,scrollbars=yes";

		popWin_224=window.open("","popWin_224",winFeature);
		popWin_224.location =url;
		popWin_224.focus();
	}
}
//¼öÃßÃßÁøÇÁ·ÎÁ§Æ® ½Å±Ôµî·ÏÃ¢ open
function Pwrite() {	
	var url ='AC224CJ01.jsp';		
	if( self.popWin_224 && !popWin_224.closed ) {
		popWin_224.location=url;
		popWin_224.focus();
	} 
	else {	
		Size_w = 780;
		Size_h =500;
		winFeature = setCenter(Size_w, Size_h) + ",menubar=no,resizable=no,scrollbars=yes";
		popWin_224=window.open("","popWin_224",winFeature);
		popWin_224.location =url;
		popWin_224.focus();
	}
}
//¼öÃßÃßÁøÇÁ·ÎÁ§Æ® ½Å±Ôµî·ÏÃ¢ °ßÀûÁ¤º¸ °Ë»öÃ¢ open
function Psearch() {	
	var url ='AC224CJ07.jsp';		
	if( self.popWin_22407 && !popWin_22407.closed ) {
		popWin_22407.location=url;
		popWin_22407.focus();
	} 
	else {	
		Size_w = 600;
		Size_h =400;
		winFeature = setCenter(Size_w, Size_h) + ",menubar=no,resizable=no,scrollbars=yes";
		popWin_22407=window.open("","popWin_22407",winFeature);
		popWin_22407.location =url;
		popWin_22407.focus();
	}
}
//¼öÃßÃßÁøÇÁ·ÎÁ§Æ® »èÁ¦
function Pdel(in_g_gubun,in_rfq_no)
{
	var DELWin = null;	
	if(confirm("»èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?")) {
		//À©µµ¿ì°¡ ÀÌ¹Ì ¿­·Á ÀÖ´Â °æ¿ì¿£ ÀÌÀüÀÇ À©µµ¿ì¿¡ ´Ù½Ã ¿¬´Ù.
		if( self.DELWin && !DELWin.closed ) {
			DELWin.location ="AC224CJ03.jsp?g_gubun="+in_g_gubun+"&rfq_no="+in_rfq_no;
			DELWin.focus();
		} else {
			Size = 300;
			Height = 150;
			winFeature = setCenter(Size, Height) + ",status=no,menubar=no,resizable=no,scrollbars=no";
			pwdDWin = window.open("","DELWin",winFeature);
			pwdDWin.location ="AC224CJ03.jsp?g_gubun="+in_g_gubun+"&rfq_no="+in_rfq_no;
			pwdDWin.focus();
		}	
	}
}
//¼öÁÖÃßÁøÇÁ·ÎÁ§Æ® ÀÔ.¼öÁ¤ ÀÔ·Â°ª À¯È¿¼º Ã¼Å©
function PcheckValue(frm) {
	if(!confirm("ÀÛ¾÷ ÇÏ½Ã°Ú½À´Ï±î?")) {
		return;
	}	
	if (frm.rfq_no.value == "") {
		alert("°ßÀû¹øÈ£¸¦ ¸ÕÀú Á¶È¸ÇÏ¼¼¿ä.");
		return;
	}
	frm.submit();
}
/*--------------------    ºÎ½Ç¾÷Ã¼°ü¸®    --------------------*/
/*ºÎ½Ç¾÷Ã¼ Á¤º¸ÀÐ±â*/
var popWin1 = null;
function read(value) {

	document.read.cust_code.value = value;
	var url ='AC202CJ.jsp?cust_code='+value;
	
	if( self.popWin1 && !popWin1.closed ) {
		popWin1.location=url;
		popWin1.focus();
	} 
	else {	
		Size_w = 780;
		Size_h =500;
		winFeature = setCenter(Size_w, Size_h) + ",menubar=no,resizable=no,scrollbars=yes";

		popWin1=window.open("","popWin1",winFeature);
		popWin1.location =url;
		popWin1.focus();
	}
}
function wirte() {

	var url ='AC204CJ.jsp';
	
	if( self.popWin1 && !popWin1.closed ) {
		popWin1.location=url;
		popWin1.focus();
	} 
	else {	
		Size_w = 780;
		Size_h =500;
		winFeature = setCenter(Size_w, Size_h) + ",menubar=no,resizable=no,scrollbars=yes";

		popWin1=window.open("","popWin1",winFeature);
		popWin1.location =url;
		popWin1.focus();
	}
}
	
function page(value){
	document.page.page.value=value;
	document.page.submit();
}
	
function go(value){
	document.index.action=value+".jsp";
	document.index.submit();
}

//ºÎ½Ç¾÷Ã¼°ü¸® ÀÔ.¼öÁ¤ ÀÔ·Â°ª À¯È¿¼º Ã¼Å©
function checkValue() {
	if(!confirm("ÀÛ¾÷ ÇÏ½Ã°Ú½À´Ï±î?")) {
		return;
	}	
	var f=document.forms[0];
	
	if (f.cust_code.value == "") {
		alert("¾÷Ã¼¸¦ ¸ÕÀú Á¶È¸ÇÏ¼¼¿ä.");
		return;
	}
	if (f.reg_resion.value == "") {
		alert("µî·Ï»çÀ¯À» ¼±ÅÃÇÏ¼¼¿ä.");
		f.reg_resion.focus();
		return;
	}
	if (f.reg_grd.value == "") {
		alert("ºÎ½Çµî±ÞÀ» ¼±ÅÃÇÏ¼¼¿ä.");
		f.reg_grd.focus();
		return;
	}	
	f.submit();
}
//ºÎ½Ç¾÷Ã¼°ü¸® °Å·¡¼± Á¶È¸È­¸é open
function openCustSearch() {
	var f=document.forms[0];
          
	var url ="AC204CJ01.jsp";
  var Size = 600;
	var Height =400;
	var winFeature = setCenter(Size, Height) + ",menubar=no,resizable=no,scrollbars=yes";
	
	open_win = window.open(url,"",winFeature);
	open_win.focus();	
}
function isNull(obj)
{
    if( obj.length == 0 )
     return true;
    else
     return false;
}

//ºÎ½Ç¾÷Ã¼°ü¸®-»èÁ¦
function del(in_cust_code)
{
	var DELWin = null;	
	if(confirm("»èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?")) {
		//À©µµ¿ì°¡ ÀÌ¹Ì ¿­·Á ÀÖ´Â °æ¿ì¿£ ÀÌÀüÀÇ À©µµ¿ì¿¡ ´Ù½Ã ¿¬´Ù.
		if( self.DELWin && !DELWin.closed ) {
			DELWin.location ="AC203CJ.jsp?cust_code="+in_cust_code;
			DELWin.focus();
		} else {
			Size = 300;
			Height = 150;
			winFeature = setCenter(Size, Height) + ",status=no,menubar=no,resizable=no,scrollbars=no";
			pwdDWin = window.open("","DELWin",winFeature);
			pwdDWin.location ="AC203CJ.jsp?cust_code="+in_cust_code;
			pwdDWin.focus();
		}	
	}
}

//¾÷Á¾ÄÚµå¼±ÅÃ
function chk_company_upjong(a,x){
	if(a.company_upjong.value=="00"){
		alert("¾÷Á¾¸®½ºÆ® Áß No.ÄÚµå¸¦ ¼±ÅÃÇÏ¼¼¿ä.")
		a.company_upjong.focus();
		return;
	}
}

/*--------------------    °í°´Á¢Á¡°ü¸®    --------------------*/
//°í°´¿¬¶ôÃ³ µî·ÏÈ­¸é OPEN
function showContactAdd(sCustCode) {
	var f=document.forms[0];	
	
	if (sCustCode == "") {
		alert("¸ÕÀú ¾÷Ã¼¸¦ ¼±ÅÃÇÏ¼¼¿ä!!!.");
		f.tCust_Name.focus();
		return;
	}		

	var url ='AC212CJ.jsp?tCust_Code='+sCustCode;
	
	if( self.popWin1 && !popWin1.closed ) {
		popWin1.location=url;
		popWin1.focus();
	} 
	else {	
		Size_w = 780;
		Size_h =500;
		winFeature = setCenter(Size_w, Size_h) + ",menubar=no,resizable=no,scrollbars=yes";

		popWin1=window.open("","popWin1",winFeature);
		popWin1.location =url;
		popWin1.focus();
	}
}

//°í°´¿¬¶ôÃ³ ÀÔ.¼öÁ¤ ÀÔ·Â°ª À¯È¿¼º Ã¼Å©
function checkValue_ContactAdd() {
	if(!confirm("ÀÛ¾÷ ÇÏ½Ã°Ú½À´Ï±î?")) {
		return;
	}	
	var f=document.forms[0];
	
	if (f.tCust_Code.value == "") {
		alert("°Å·¡¼±ÄÚµå Á¤º¸°¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù.");
		return;
	}	
	if (f.tUSERNAME.value == "") {
		alert("ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.");
		f.tUSERNAME.focus();
		return;
	}
	
	f.tUSERNAME.value = f.tUSERNAME.value.toUpperCase();
	f.tE_MAIL.value = f.tE_MAIL.value.toUpperCase();
	f.tPROJNO.value = f.tPROJNO.value.toUpperCase();
 
	f.submit();
}
//DB ÀÔ·Â/¼öÁ¤½Ã ÇÑ±Û ¿µ¹® ±æÀÌ check
function GetConLen (szVal) { 

	var i, iLen, iRealLen = 0, iHanChk ;
	var szChar = "" ;
	iLen = szVal.length ;
	if (iLen <= 0)
		return iLen ;
	for (i = 0; i < iLen; i++) {
		iHanChk = 0 ;
		if ((szChar = szVal.charAt (i)) >= unescape ("%A0"))
			iHanChk++ ;
		if (!(iHanChk % 2))
			iRealLen++ ;
		else                /* ÇÑ±ÛÀÌ¸é */
			iRealLen += 2 ;
	}
	return iRealLen ;
}

