//---------------------------------------------------------
// 메뉴 링크
//---------------------------------------------------------
function ClickMenu(b_no, m_no, s_no)
{
	b_no = Number(b_no);
	m_no = Number(m_no);
	s_no = Number(s_no);


	var url = "";

	if (b_no != 2)
	{
		if (m_no == 0) m_no = 1;
		if (s_no == 0) s_no = 1;
	}
	else
	{
		if (m_no == 0) m_no = 9;
		if (s_no == 0) s_no = 1;
	}

	var folder_name = "Korean"


	// 회사소개
	if (b_no == 1)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Company/outline.asp"; break;
			case 2	: url = "/Front/"+folder_name+"/Company/Company/CEO/list.asp"; break;
			case 3	: url = "/Front/"+folder_name+"/Company/Company/org_Chart.asp"; break;
			case 4	: url = "/Front/"+folder_name+"/Company/Company/vision.asp"; break;
			case 5	: url = "/Front/"+folder_name+"/Company/Company/ideal.asp"; break;
			case 6	: url = "/Front/"+folder_name+"/Company/Company/History/list.asp"; break;
			case 7  : url = "/Front/"+folder_name+"/Company/Company/Award/list.asp"; break;
			case 8	: url = "/Front/"+folder_name+"/Company/Company/RND.asp"; break;
			case 9	: url = "/Front/"+folder_name+"/Company/Company/CI.asp"; break;
			case 10	:
					if (s_no == "1")				 url = "/Front/"+folder_name+"/Company/Company/Place/internal.asp";
					else if (s_no == "2")			 url = "/Front/"+folder_name+"/Company/Company/Place/oversea.asp";
					else if (s_no == "3")			 url = "/Front/"+folder_name+"/Company/Company/Place/cooperation.asp";
					break;
		}
	}

	// 사업영역
	if (b_no == 2)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Business/HomeNetwork/default.asp"; break;
			case 2	: url = "/Front/"+folder_name+"/Company/Business/HomeAuto/default.asp"; break;
			case 3	: url = "/Front/"+folder_name+"/Company/Business/Remodeling/default.asp"; break;
			case 4	: url = "/Front/"+folder_name+"/Company/Business/VideoPhone/default.asp"; break;
			case 5	: url = "/Front/"+folder_name+"/Company/Business/DoorPhone/default.asp"; break;
			case 6	: url = "/Front/"+folder_name+"/Company/Business/Security/default.asp"; break;
			case 7	: url = "/Front/"+folder_name+"/Company/Business/Hospital/default.asp"; break;
			case 8	: url = "/Front/"+folder_name+"/Company/Business/PA/default.asp"; break;
			case 9	: url = "/Front/"+folder_name+"/Company/Business/Mobile/default.asp"; break;
		}
	}


	// 투자정보
	if (b_no == 3)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Invest/public.asp"; break;
			case 2	: url = "/Front/"+folder_name+"/Company/Invest/stock.asp"; break;
			case 3	: url = "/Front/"+folder_name+"/Company/Invest/finance.asp"; break;
			case 4	: url = "/Front/"+folder_name+"/Company/Invest/IR.asp"; break;
		}
	}

	// 사이버홍보
	if (b_no == 4)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Cyber/News/list.asp"; break;
			case 2	: url = "/Front/"+folder_name+"/Company/Cyber/Press/list.asp"; break;
			case 3	:
					if (s_no == "1")				 url = "/Front/"+folder_name+"/Company/Cyber/Ad/Ad_Paper/list.asp";
					else if (s_no == "2")			 url = "/Front/"+folder_name+"/Company/Cyber/Ad/Ad_Video/list.asp";
					break;
			case 4	: url = "/Front/"+folder_name+"/Company/Cyber/Historical_View/default.asp"; break;
			case 5	: url = "/Front/"+folder_name+"/Company/Cyber/Simulation_View/default.asp"; break;
		}
	}

	// 인재채용
	if (b_no == 5)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Recruit/man.asp"; break;
			case 2	: url = "/Front/"+folder_name+"/Company/Recruit/intro.asp"; break;
			case 3	: url = "/Front/"+folder_name+"/Company/Recruit/welf.asp"; break;
			case 4	: url = "/Front/"+folder_name+"/Company/Recruit/guid.asp"; break;
			case 5	: url = "/Front/"+folder_name+"/Company/Recruit/Recruit_Notice/list.asp"; break;
			case 6	: url = "/Front/"+folder_name+"/Company/Recruit/Recruit_FAQ/list.asp?bbs_option_cd=RECRUIT"; break;
		}
	}

	// 고객지원
	if (b_no == 6)
	{
		switch (m_no)
		{
			case 1	:
					if (s_no == "1")				url = "/Front/"+folder_name+"/Company/Customer/Service/location.asp?location_cd=01";
					else if (s_no == "2")			url = "/Front/"+folder_name+"/Company/Customer/Service/standard.asp";
					else if (s_no == "3")			url = "/Front/"+folder_name+"/Company/Customer/Service/AS_Web/write.asp";
					break;
			case 2	: url = "/Front/"+folder_name+"/Company/Customer/FAQ/list.asp?bbs_option_cd=SITE"; break;
			case 3	: url = "/Front/"+folder_name+"/Company/Customer/QNA/write.asp"; break;
			case 4	: url = "/Front/"+folder_name+"/Company/Customer/Staff_Contact/list.asp"; break;
		}
	}

	// 다운로드 센터
	if (b_no == 7)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Download/Product/list.asp?product_pds_cd=MNL"; break;
			case 2	: url = "/Front/"+folder_name+"/Company/Download/Product/list.asp?product_pds_cd=SFTW"; break;
			case 3	: url = "/Front/"+folder_name+"/Company/Download/Product/list.asp?product_pds_cd=BRCH"; break;
			case 4	: url = "/Front/"+folder_name+"/Company/Download/Common/list.asp?Common_pds_cd=PRPS"; break;
			case 5	: url = "/Front/"+folder_name+"/Company/Download/Product/list.asp?product_pds_cd=ETC"; break;
		}
	}

	// 회원가입
	if (b_no == 8)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Login/login.asp"; break;
			case 2	: url = "/Front/"+folder_name+"/Company/Join/search_id.asp"; break;
			case 3	: url = "/Front/"+folder_name+"/Company/Join/join.asp"; break;
			case 4	: url = "/front/"+folder_name+"/company/footer/list02.asp"; break;		//수정
			case 5	: url = "/front/"+folder_name+"/company/footer/list03.asp"; break;		//수정
		}
	}

	// 마이페이지 - 일반
	if (b_no == 9)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Mypage/info.asp"; break;
			case 2	: url = "/Front/"+folder_name+"/Company/Mypage/QNA/list.asp"; break;
		}
	}

	// 마이페이지 - 기업
	if (b_no == 10)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Compage/company_info_01.asp"; break;
			case 2	: url = "/Front/"+folder_name+"/Company/Compage/company_info_02.asp"; break;
			case 3	: url = "/Front/"+folder_name+"/Company/Compage/company_info_03.asp"; break;
			case 4	: url = "/Front/"+folder_name+"/Company/Compage/company_info_04.asp"; break;
			case 5	: url = "/Front/"+folder_name+"/Company/Compage/company_info_05.asp"; break;
			case 6	: url = "/Front/"+folder_name+"/Company/Compage/company_info_06.asp"; break;
			case 7	: url = "/Front/"+folder_name+"/Company/Compage/company_info_07.asp"; break;
			case 8	: url = "/Front/"+folder_name+"/Company/Compage/company_info_08.asp"; break;

		}
	}

	// 파트너센터 11
	if (b_no == 11)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Partner/Agency_Bbs/list.asp"; break;
			case 2	: url = "/Front/"+folder_name+"/Company/Partner/Agency_Bbs02/list.asp"; break;
			case 3	: url = "/Front/"+folder_name+"/Company/Partner/Agency_Bbs03/list.asp"; break;
		}
	}


	// 사이트맵
	if (b_no == 12)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Etc/sitemap.asp"; break;
		}
	}


	//윤리 경영
	if(b_no == 13)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Company/Ethic/charter.asp"; break;
			case 2	: url = "/Front/"+folder_name+"/Company/Company/Ethic/standard.asp"; break;
			case 3	: url = "/Front/"+folder_name+"/Company/Company/Ethic/HelpLine/line01.asp"; break;

		}
	}


	if (url == "")
	{
		//alert("b_no : " + b_no +" / m_no : " + m_no + " / s_no : " + s_no);
		alert("페이지를 준비중입니다.");
	}
	else
	{
		//alert("b_no : " + b_no +" / m_no : " + m_no + " / s_no : " + s_no);
		location.href = url;
	}
}

//제품 링크
function ClickMenu2(b_no, m_no, s_no)
{

	var	folder_name = "Korean"

	b_no = Number(b_no);
	m_no = Number(m_no);
	s_no = Number(s_no);

	var url = "";
	if (m_no == 0) m_no = 1;
	if (s_no == 0) s_no = 1;

	// 홈네트워크
	if (b_no == 1)				url = "/Front/"+folder_name+"/Product/Category/default.asp?category_b_no=1"
	// 홈오토메이션
	else if (b_no == 2)			url = "/Front/"+folder_name+"/Product/Category/default.asp?category_b_no=2"
	// 리모델링
	else if (b_no == 3)			url = "/Front/"+folder_name+"/Product/Category/default.asp?category_b_no=3"
	// 비디오폰
	else if (b_no == 4)			url = "/Front/"+folder_name+"/Product/Category/default.asp?category_b_no=4"
	// 도어폰/인터폰/인터
	else if (b_no == 5)			url = "/Front/"+folder_name+"/Product/Category/default.asp?category_b_no=5"
	// 씨큐리티
	else if (b_no == 6)			url = "/Front/"+folder_name+"/Product/Category/default.asp?category_b_no=6"
	// 너스쿨
	else if (b_no == 7)			url = "/Front/"+folder_name+"/Product/Category/default.asp?category_b_no=7"
	// 방송장비
	else if (b_no == 8)			url = "/Front/"+folder_name+"/Product/Category/default.asp?category_b_no=8"

	//url = "/Front/"+folder_name+"/Product/Category/default.asp?category_b_no=1"

	if (url == "")
	{
		//alert("b_no : " + b_no +" / m_no : " + m_no + " / s_no : " + s_no);
		alert("페이지를 준비중입니다.");
	}
	else
	{
		//alert("b_no : " + b_no +" / m_no : " + m_no + " / s_no : " + s_no);
		location.href = url;
	}
}


//다국어 - 컴퍼니 링크
function ClickMenuMulti(b_no, m_no, s_no, lang_cd)
{
	var folder_name = langCdToFolder(lang_cd);
	b_no = Number(b_no);
	m_no = Number(m_no);
	s_no = Number(s_no);

	var url = "";

	if (b_no != 2)
	{
		if (m_no == 0) m_no = 1;
		if (s_no == 0) s_no = 1;
	}
	else
	{
		if (m_no == 0) m_no = 9;
		if (s_no == 0) s_no = 1;
	}


	// 회사소개
	if (b_no == 1)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Company/outline.asp"; break;
			case 2	: url = "/Front/"+folder_name+"/Company/Company/CEO/list.asp"; break;
			case 3	: url = "/Front/"+folder_name+"/Company/Company/org_Chart.asp"; break;
			case 4	: url = "/Front/"+folder_name+"/Company/Company/vision.asp"; break;
			case 5	: url = "/Front/"+folder_name+"/Company/Company/ideal.asp"; break;
			case 6	: url = "/Front/"+folder_name+"/Company/Company/History/list.asp"; break;
			case 7  : url = "/Front/"+folder_name+"/Company/Company/Award/list.asp"; break;
			case 8	: url = "/Front/"+folder_name+"/Company/Company/RND.asp"; break;
			case 9	: url = "/Front/"+folder_name+"/Company/Company/CI.asp"; break;
			case 10	: url = "/Front/"+folder_name+"/Company/Company/Place/internal.asp"; break;
		}
	}

	// 사업영역
	if (b_no == 2)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Business/HomeNetwork/default.asp"; break;
			case 2	: url = "/Front/"+folder_name+"/Company/Business/HomeAuto/default.asp"; break;
			case 3	: url = "/Front/"+folder_name+"/Company/Business/Multi-entry/default.asp"; break;
			case 4	: url = "/Front/"+folder_name+"/Company/Business/VideoPhone/default.asp"; break;
			case 5	: url = "/Front/"+folder_name+"/Company/Business/DoorPhone/default.asp"; break;
			case 6	: url = "/Front/"+folder_name+"/Company/Business/Security/default.asp"; break;
			case 7	: url = "/Front/"+folder_name+"/Company/Business/Hospital/default.asp"; break;
			case 8	: url = "/Front/"+folder_name+"/Company/Business/PA/default.asp"; break;
			case 9	: url = "/Front/"+folder_name+"/Company/Business/Mobile/default.asp"; break;
		}
	}


	// NEWS (사이버)
	if (b_no == 3)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Cyber/News/list.asp"; break;
		}
	}


	// SUPPORT (고객지원)
	if (b_no == 4)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Customer/FAQ/list.asp"; break;
			case 2	: url = "/Front/"+folder_name+"/Company/Customer/QNA/write.asp"; break;
		}
	}

	// 다운로드 센터
	if (b_no == 5)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Download/Product/list.asp?product_pds_cd=MNL"; break;
			case 2	: url = "/Front/"+folder_name+"/Company/Download/Product/list.asp?product_pds_cd=SFTW"; break;
			case 3	: url = "/Front/"+folder_name+"/Company/Download/Product/list.asp?product_pds_cd=BRCH"; break;
			case 4	: url = "/Front/"+folder_name+"/Company/Download/Common/list.asp?Common_pds_cd=PRPS"; break;
			case 5	: url = "/Front/"+folder_name+"/Company/Download/Product/list.asp?product_pds_cd=ETC"; break;
		}
	}


	// MEMBERSHIP
	if (b_no == 6)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Login/login.asp"; break;
			case 2	: url = "/Front/"+folder_name+"/Company/Join/search_id.asp"; break;
			case 3	: url = "/Front/"+folder_name+"/Company/Join/join.asp"; break;
		}
	}

	// UPDATE PROFILE
	if (b_no == 7)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Mypage/info.asp"; break;
		}
	}

	// SITEMAP
	if (b_no == 8)
	{
		switch (m_no)
		{
			case 1	: url = "/Front/"+folder_name+"/Company/Etc/sitemap.asp"; break;
		}
	}

	if (url == "")
	{
		//alert("b_no : " + b_no +" / m_no : " + m_no + " / s_no : " + s_no);
		alert("페이지를 준비중입니다.");
	}
	else
	{
		//alert("b_no : " + b_no +" / m_no : " + m_no + " / s_no : " + s_no);
		location.href = url;
	}
}




// 다국어 제품 링크
function ClickMenuMulti2(b_no, m_no, s_no, lang_cd)
{
	var folder_name = langCdToFolder(lang_cd);

	b_no = Number(b_no);
	m_no = Number(m_no);
	s_no = Number(s_no);

	var url = "";
	if (m_no == 0) m_no = 1;
	if (s_no == 0) s_no = 1;

	// 홈네트워크
	if (b_no == 1)				url = "/Front/"+folder_name+"/Product/Category/default.asp?category_b_no=1"
	// 홈오토메이션
	else if (b_no == 2)			url = "/Front/"+folder_name+"/Product/Category/default.asp?category_b_no=2"
	// 리모델링
	else if (b_no == 3)			url = "/Front/"+folder_name+"/Product/Category/default.asp?category_b_no=3"
	// 비디오폰
	else if (b_no == 4)			url = "/Front/"+folder_name+"/Product/Category/default.asp?category_b_no=4"
	// 도어폰/인터폰/인터
	else if (b_no == 5)			url = "/Front/"+folder_name+"/Product/Category/default.asp?category_b_no=5"
	// 씨큐리티
	else if (b_no == 6)			url = "/Front/"+folder_name+"/Product/Category/default.asp?category_b_no=6"
	// 너스쿨
	else if (b_no == 7)			url = "/Front/"+folder_name+"/Product/Category/default.asp?category_b_no=7"
	// 방송장비
	else if (b_no == 8)			url = "/Front/"+folder_name+"/Product/Category/default.asp?category_b_no=8"

	//url = "/Front/"+folder_name+"/Product/Category/default.asp?category_b_no=1"

	if (url == "")
	{
		//alert("b_no : " + b_no +" / m_no : " + m_no + " / s_no : " + s_no);
		alert("페이지를 준비중입니다.");
	}
	else
	{
		//alert("b_no : " + b_no +" / m_no : " + m_no + " / s_no : " + s_no);
		location.href = url;
	}
}





// 플래시 파일 *****************************************************************
function flash(width, height, file, lang_cd)
{

	var flash_tag = "";
	flash_tag = '<object id=flash_"' + file + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
	flash_tag +='codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ';
	flash_tag +='WIDTH="'+width+'" HEIGHT="'+height+'" >';
	flash_tag +='<param name="allowScriptAccess" value="always" />';
	flash_tag +='<param name="movie" value="/_Design/Flash/'+lang_cd+'/'+file+'.swf">';
	flash_tag +='<param name="quality" value="high">';
	flash_tag +='<param name="wmode" value="transparent">';
	flash_tag +='<embed src="/_Design/Flash/'+lang_cd+'/'+file+'.swf" name=flash_"'+ file +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" ';
	flash_tag +='type="application/x-shockwave-flash" allowScriptAccess="always" wmode="transparent" WIDTH="'+width+'" HEIGHT="'+height+'"></embed></object>'

	document.write(flash_tag);
}


// 포커스 없애기 ***************************************************************
function autoBlur()
{
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG")
	document.body.focus();
}

document.onfocusin=autoBlur;

// 숫자만 입력 (INPUT) *********************************************************
function num_only()
{
	//alert(event.keyCode)
	if(((event.keyCode >= 48) && (event.keyCode <= 57)) || ((event.keyCode >= 96) && (event.keyCode <= 105)) || (event.keyCode == 8) || (event.keyCode == 9))
		event.returnValue=true;
	else
		event.returnValue=false;
}


// 주민등록번호 체크 ***********************************************************
function numbercheck(theform)
{
	var chk	= 0;
	var yy	= theform.id_no1.value.substring(0,2);
	var mm	= theform.id_no1.value.substring(2,4);
	var dd	= theform.id_no1.value.substring(4,6);
	var sex	= theform.id_no2.value.substring(0,1);

	// 주민등록번호 체크
	for (var i = 0; i <= 5 ; i++)
	{
		chk = chk + ((i % 8 + 2) * parseInt(theform.id_no1.value.substring(i, i + 1)));
	}
	for (var i = 6; i <= 11 ; i++)
	{
		chk = chk + ((i % 8 + 2) * parseInt(theform.id_no2.value.substring(i - 6, i - 5)));
	}
	chk = 11 - (chk % 11);
	chk = chk % 10;

	if (chk != theform.id_no2.value.substring(6, 7))
	{
		alert ("유효하지 않은 주민등록번호입니다.");
		theform.id_no1.value = "";
		theform.id_no1.focus();
		return false;
	}

	else if ((theform.id_no1.value.length != 6) || (yy < 25 || mm < 1 || mm >12 || dd < 1))
	{
		alert ("주민등록번호가 잘못되었습니다.");
		theform.id_no1.value = "";
		theform.id_no1.focus();
		return false;
	}

	else if ((sex != 1 && sex !=2 )||(theform.id_no2.value.length != 7 ))
	{
		alert ("주민등록번호가 잘못되었습니다.");
		theform.id_no2.value = "";
		theform.id_no2.focus();
		return false;
	}

	else
		return true;
}


// 이메일 형식 체크 ************************************************************
function emailcheck(value, lang_cd)
{
	if(checkSpace(value))
	{
		if (lang_cd == "kr")
			alert("이메일 주소를 빈공간 없이 넣으세요.");
		else
			alert("Please Enter Correct Email Address.");
		return false;
	}
	/* checkFormat */
	var isEmail = /[-!#$%&'*+\/^_~{}|0-9a-zA-Z]+(\.[-!#$%&'*+\/^_~{}|0-9a-zA-Z]+)*@[-!#$%&'*+\/^_~{}|0-9a-zA-Z]+(\.[-!#$%&'*+\/^_~{}|0-9a-zA-Z]+)*/;
	if( !isEmail.test(value))
	{
		if (lang_cd == "kr")
			alert("이메일 형식이 잘못 되었습니다.");
		else
			alert("Please Enter Correct Email Address.");
		return false;
	}
/*
	if( value.lastIndexOf("daum.net") >= 0 || value.lastIndexOf("hanmail.net") >= 0 )
	{
		alert("다음 메일 계정은 사용하실 수 없습니다.");
		return false;
	}
*/
     return true;
}


// 빈 공간 체크 ****************************************************************
function checkSpace(str)
{
     if(str.search(/\s/) != -1)
		return true;
     else
		return false;
}


// 숫자포맷 (,) 넣기 ***********************************************************
function number_format(number)
{
	unit		= 3;
	i			= 0;
	rst			= '';
	number		= number + '';
	len			= number.length;
	arr			= new Array(len);

	while(i <len){
		arr[i]	= number.charAt(len-i-1);
		rst		= arr[i] + rst;
		i++;
		if(i % unit == 0 && i != len)
			rst	= ',' + rst;
	}
	return rst;
}


// 팝업창 띄우기 ***************************************************************
function popup_win(url, target, width, height, left, top, scrollbars, resizable)
{
	if (left == "")
		left	= 0;
	if (top == "")
		top		= 0

	setting = 'width='+ width +', height='+ height +', left='+ left +', top='+ top +', scrollbars='+ scrollbars +', resizable='+ resizable;
	window.open(url, target, setting);
}


// 주소찾기 ******* 스크롤바가 들어가므로 본래width=354 보다 크게함*************************************************************
function popup_addressCheck(formName, siName, dongName,moreName, zipCodeName)
{
	var win = "/_Library/TOOLKIT/NWS_address/address.asp?formName="+ formName +"&siName="+ siName +"&dongName="+ dongName +"&moreName="+ moreName +"&zipCodeName="+ zipCodeName;
	window.open(win, "address", "width=371, height=490, left=200, top=200, scrollbars=yes");
}


// 아이디 중복확인 *************************************************************
function check_id(formName, usr_id, lang_cd)
{

	var folder_name = langCdToFolder(lang_cd);

	var theform		= eval("document."+ formName);
	var usr_id		= eval("theform."+ usr_id);

	if(usr_id.value == "")
	{
		if (lang_cd.value == "kr")
		{
			alert("아이디를 입력해 주십시오.");
		}
		else if(lang_cd.value == "en")
		{
			alert("Enter ID.");
		}
		else if(lang_cd.value == "cn")
		{
			alert("Enter ID.");
		}
		else if(lang_cd.value == "ru")
		{
			alert("Enter ID.");
		}
		else if(lang_cd.value == "sp")
		{
			alert("Enter ID.");
		}
		else
		{
			alert("Enter ID.");
		}

		usr_id.focus();
	}
	else
	{
		var win		= "/Front/"+ folder_name +"/Company/Join/check_id.asp?formName="+ formName +"&usr_id="+ usr_id.value;
		window.open(win, "check_id", "width=354, height=340, left=200, top=200");
	}
}


// 사업자등록번호 중복확인 *************************************************************
function check_id_company(formName, id_no_01, id_no_02, id_no_03)
{
	var theform		= eval("document."+ formName);
	var id_no_01	= eval("theform."+ id_no_01);
	var id_no_02	= eval("theform."+ id_no_02);
	var id_no_03	= eval("theform."+ id_no_03);

	if(id_no_01.value == "")
	{
		alert("사업자 등록번호를 입력해 주십시오.");
		id_no_01.focus();
	}
	else if(id_no_02.value == "")
	{
		alert("사업자 등록번호를 입력해 주십시오.");
		id_no_02.focus();
	}
	else if(id_no_03.value == "")
	{
		alert("사업자 등록번호를 입력해 주십시오.");
		id_no_03.focus();
	}
	else
	{
		var win		= "/Front/Korean/Company/Join/check_id_company.asp?formName="+ formName +"&id_no_01="+ id_no_01.value +"&id_no_02="+ id_no_02.value +"&id_no_03="+ id_no_03.value;
		//alert('이미 가입하신 사업자번호입니다.')
		//alert('가입 가능한 사업자번호입니다.')
		window.open(win, "check_id_company", "width=0, height=0, left=1, top=1");
	}
}

// 닉네임 중복확인 *************************************************************
function check_nick(formName, nick_nm, mode)
{
	var theform		= eval("document."+ formName);
	var nick_nm		= eval("theform."+ nick_nm);

	if(nick_nm.value == "")
	{
		alert("닉네임을 입력해 주십시오.");
		nick_nm.focus();
	}
	else
	{
		var win		= "none.asp??=JOIN/POPUP/check_nick&formName="+ formName +"&nick_nm="+ nick_nm.value +"&mode="+ mode;
		window.open(win, "check_nick", "width=350, height=253, left=200, top=200");
	}
}


// 상품이미지 크게보기 *********************************************************
function popup_enlarge(item_idx)
{
	var url = 'none.asp??=item/popup_enlarge&item_idx=' + item_idx;
	window.open(url, "enlarge", "width=683, height=545");
}


// 로그인 **********************************************************************
function login(from_url)
{
	var win = "none.asp??=PASSPORT/POPUP/user_login&mode=login&from_url="+ escape(from_url);
	window.open(win, "login", "left=20, top=25, width=350, height=230");
}


// 아이디 찾기 *****************************************************************
function idsearch()
{
	var win = "none.asp??=PASSPORT/id_search";
	window.open(win, "login", "left=20, top=25, width=440, height=320");
}

// File Upload 창 띄우기 *******************************************************
function popup_upload(formName, inputName, uploadType)
{
	var win = '/_Library/Toolkit/NWS_upload/fileselect.asp?formName='+ formName +'&imageName='+ inputName +'&uploadType='+ uploadType;
	window.open(win, 'popup', 'width=350, height=250');
}


// 코드관리 POPUP **************************************************************
function popup_code_manage(code_fg)
{
	var win = "none.asp??=DBSYSTEM/POPUP/code_manage&file_mode=mng&code_fg=" + code_fg;
	window.open(win, 'popup', 'width=366, height=400, top=50, left=100, scrollbars=yes');
}


// 인쇄페이지 ******************************************************************
function popup_print(query)
{
	var url	= "print.asp?" + query;
	popup_win(url, "print", 600, 600, 0, 0, 1, 0);
}

function popup_print2(url)
{
	popup_win(url, "print", 600, 600, 0, 0, 1, 0);
}


// 마이페이지 조회날짜 변경 ****************************************************
function change_date(str_date)
{
	var date	= new Date();

	var today_year		= date.getFullYear();
	var today_month		= date.getMonth() + 1;
	var today_day		= date.getDate();

	if (("" + today_month).length == 1)
		today_month		= "0" + today_month;
	if (("" + today_day).length == 1)
		today_day		= "0" + today_day;

	document.frm.from_year.value	= str_date.substring(0, 4);
	document.frm.from_month.value	= str_date.substring(5, 7);
	document.frm.from_day.value		= str_date.substring(8, 10);
	document.frm.to_year.value		= today_year;
	document.frm.to_month.value		= today_month;
	document.frm.to_day.value		= today_day;
}


// 레이어 View or Hidden *******************************************************
function show_layer(lname)
{
	var layer = (navigator.appName == 'Netscape') ? document.layers[lname] : document.all[lname];
	if (lname == '') return;
	if (navigator.appName == 'Netscape') layer.visibility = 'show';
	else layer.style.visibility = 'visible';
}

function hide_layer(lname)
{
	if (lname)
	{
		var layer = (navigator.appName == 'Netscape') ? document.layers[lname] : document.all[lname];
		if (navigator.appName == 'Netscape') layer.visibility = 'hide';
		else layer.style.visibility = 'hidden';
	}
	else
	{
		for (i = 1 ; i <= 10 ; i ++)
		{
			var lname = 'layer'+i;
			var layer = (navigator.appName == 'Netscape') ? document.layers[lname] : document.all[lname];
			if (navigator.appName == 'Netscape') layer.visibility = 'hide';
			else layer.style.visibility = 'hidden';
		}
	}
}


// TOPMENU 검색 ****************************************************************
function checkform_top_search(theform)
{
	if (theform.search_value.value == "")
	{
		alert("검색어를 입력해 주십시오.");
		theform.search_value.focus();
		return false;
	}
//	else if (theform.search_value1.value.length < 3)
//	{
//		alert("검색어는 3자 이상이어야 합니다.");
//		theform.search_value1.focus();
//		return false;
//	}
}


// 이미지 크기 조절하여 img 태그 출력 ******************************************
function change_image_size(image_url, limit_width, limit_height)
{
	imgFile					= new Image();
	imgFile.src				= image_url;

	var real_width			= imgFile.width;
	var real_height			= imgFile.height;

	if (real_width >= real_height)
	{
		if (real_width <= limit_width)
		{
			result_width	= real_width;
			result_height	= real_height;
		}
		else
		{
			result_width	= limit_width;
			result_height	= parseInt((real_height * limit_width) / real_width);
		}
	}
	else
	{
		if (real_height <= limit_height)
		{
			result_width	= real_width;
			result_height	= real_height;
		}
		else
		{
			result_width	= parseInt((real_width * limit_height) / real_height);
			result_height	= limit_height;
		}
	}

	document.write ("<img src='"+ image_url +"' width='"+ result_width +"' height='"+ result_height +"' border='0' style='cursor:hand' onclick='showPicture(\""+ image_url +"\")'>");
}


// 이미지 제크기로 팝업창 띄우기 ***********************************************
function popup_realsize(src)
{
	var imgObj = new Image();
	imgObj.src = src;
	var wopt = "scrollbars=no,status=no,resizable=no";
	wopt += ",width=" + imgObj.width;
	wopt += ",height=" + imgObj.height;
	var wbody = "<head><title>사진 보기</title>";
	wbody += "<s"+"cript language='javascript'>";
	wbody += "function finalResize(){";
	wbody += "  var oBody=document.body;";
	wbody += "  var oImg=document.images[0];";
	wbody += "  var xdiff=oImg.width-oBody.clientWidth;";
	wbody += "  var ydiff=oImg.height-oBody.clientHeight;";
	wbody += "  window.resizeBy(xdiff,ydiff);";
	wbody += "}";
	wbody += "</"+"script>";
	wbody += "</head>";
	wbody += "<body onLoad='finalResize()' style='margin:0'>";
	wbody += "<a href='javascript:window.close()'><img src='" + src + "' border=0></a>";
	wbody += "</body>";
	winResult = window.open("about:blank","",wopt);
	winResult.document.open("text/html", "replace");
	winResult.document.write(wbody);
	winResult.document.close();
	return;
}


// TRIM ************************************************************************
function trim(str)
{
	str += '';				// 숫자라도 문자열로 변환
	return str.replace(/^\s*|\s*$/g, '');
}


// input or textarea OnFocus 내용지우기 ****************************************
function delete_contents(input)
{
	if (input.value == input.defaultValue)
	{
		input.value = "";
	}
}


// input or textarea OnFocus 내용채우기 ****************************************
function fill_contents(input)
{
	if (input.value == "")
	{
		input.value = input.defaultValue;
	}
}


// input or textarea OnFocus 배경이미지 지우기 *********************************
function delete_background(input)
{
	input.style.backgroundImage = "url(about:blank)";
}


// input or textarea OnFocus 배경이미지 채우기 *********************************
function fill_background(input)
{
	if (input.value == "")
	{
		input.style.backgroundImage = input.defaultValue;
	}
}


// input 값 초기화 *************************************************************
function reset_input(el_nm)
{
	var input			= document.getElementById(el_nm);
	input.value			= "";
}

// 날짜 유효성 체크 ************************************************************
function checkDate(date_value)
{
	var getNow				= new Date();
	var sYear				= date_value.substring(0, 4);
	var sMonth				= date_value.substring(5, 7);
	var sDay				= date_value.substring(8, 10);

	if (date_value.length != 10)
		return false;
	if (sYear == null || sYear == "" || sMonth == null || sMonth == "" || sDay == null || sDay == "")
		return false;

	var iYear				= parseInt(sYear);
	var iMonth				= sMonth.substring(0, 1) == "0"	? parseInt(sMonth.substring(1, 2)) : parseInt(sMonth);
	var iDay				= sDay.substring(0, 1) == "0"	? parseInt(sDay.substring(1, 2)) : parseInt(sDay);

	if (iMonth < 1 || iMonth > 12)
		return false;

	if (iDay < 1 || iDay > 31)
		return false;

	if (iMonth == 2)
	{
		if ((iYear % 400 == 0 || (iYear % 100 != 0 && iYear % 4 == 0)))
		{
			if (iDay > 29)
				return false;
		}
		else if (iDay > 28)
			return false;
	}
	else if (iMonth==4 || iMonth==6 || iMonth==9 || iMonth==11)
	{
		if (iDay > 30)
			return false;
	}
	else
	{
		if (iDay > 31)
			return false;
	}

//	if (iYear < 1900 || iYear > getNow.getFullYear() + 1)
//		return false;

	return true;
}


// 바이트 수 세기 **************************************************************
function calculateBytes(contents, maxBytes, bytesId)
{
	var tcount	= 0;
	var tmpStr1	= new String(contents.value);
	var tmpStr2	= "";
	var temp	= tmpStr1.length;
	var onechar;

	for (k=0; k<temp; k++)
	{
		onechar = tmpStr1.charAt(k);
		if (escape(onechar).length > 4)
		{
			tcount += 2;
		}
		else
		{
			tcount += 1;
		}

		if (tcount <= maxBytes)
		{
			tmpStr2	= tmpStr2 + onechar;
		}
	}

	if (bytesId != "")
	{
		var bytesId_input	= document.getElementById(bytesId);
		replaceText(bytesId_input, tcount);
	}

	if (tcount > maxBytes)
	{
		alert("최대 "+ maxBytes +"Byte 까지만 입력하실 수 있습니다.");
		contents.value	= tmpStr2;
		calculateBytes(contents, maxBytes, bytesId)
	}
}


function replaceText(el, text)
{
	if (el != null)
	{
		clearText(el);
		var newNode = document.createTextNode(text);
		el.appendChild(newNode);
	}
}

function clearText(el)
{
	if (el != null)
	{
		if (el.childNodes)
		{
			for (var i = 0; i < el.childNodes.length; i++)
			{
				var childNode = el.childNodes[i];
				el.removeChild(childNode);
			}
		}
	}
}

function getText(el)
{
	var text = "";
	if (el != null)
	{
		if (el.childNodes)
		{
			for (var i = 0; i < el.childNodes.length; i++)
			{
				var childNode = el.childNodes[i];
				if (childNode.nodeValue != null)
				{
					text = text + childNode.nodeValue;
				}
			}
		}
	}
	return text;
}

// 쿠키 찾기 *******************************************************************
function getCookie(name)
{
	var returnCookie		= "";
	var thisCookie			= document.cookie.split("; ") ;
	for (i = 0; i < thisCookie.length; i++)
	{
		// 쿠키가 발견될때까지 찾기
		if(thisCookie[i].split("=")[0] == name)
			returnCookie	= thisCookie[i].split("=")[1]; // 쿠키를 찾아서"=" 로 분리한후 변수로 저장
	}
	return returnCookie;
}


// 이미지 크기 조절하여 img 태그 출력 ******************************************
function change_image_size2(imgFile, limit_width, limit_height)
{
	var real_width			= imgFile.width;
	var real_height			= imgFile.height;

	if (limit_width == 0)
		limit_width			= real_width;
	if (limit_height == 0)
		limit_height		= real_height;

	if (real_width >= real_height)
	{
		if (real_width <= limit_width)
		{
			result_width	= real_width;
			result_height	= real_height;
		}
		else
		{
			result_width	= limit_width;
			result_height	= parseInt((real_height * limit_width) / real_width);
		}
	}
	else
	{
		if (real_height <= limit_height)
		{
			result_width	= real_width;
			result_height	= real_height;
		}
		else
		{
			result_width	= parseInt((real_width * limit_height) / real_height);
			result_height	= limit_height;
		}
	}

	imgFile.width			= result_width;
	imgFile.height			= result_height;
	imgFile.style.visibility	= "visible";
}


// Input 값 Disable 속성 *******************************************************
function toggleInputValue(input_obj, disable_yn)
{
	if (disable_yn)
	{
		input_obj.value = "";
		input_obj.disabled = true;
		input_obj.className = "disabled";
	}
	else
	{
		input_obj.disabled = false;
		input_obj.className = "txt";
	}
}

// 라디오 버튼 중 선택된 유뮤 **************************************************
function radioCheckedYN(input_obj)
{
	for (i = 0; i < input_obj.length ; i++)
	{
		if (input_obj[i].checked)
			return true;
	}

	return false;
}

// 라디오 인풋의 선택된 값 가져오기 ********************************************
function radioCheckedValue(input_obj)
{
	for (i = 0; i < input_obj.length ; i++)
	{
		if (input_obj[i].checked)
			return input_obj[i].value;
	}

	return "";
}

// 체크박스의 선택된 수 가져오기 ***********************************************
function inputCheckCnt(input_obj)
{
	var cnt = 0;

	for (i = 0; i < input_obj.length ; i++)
	{
		if (input_obj[i].checked)
			cnt += 1;
	}

	return cnt;
}

// 입력없음 체크 & 안내 ********************************************************
function emptyInputYN(input_obj, lable)
{
	var input = input_obj;
	var type = "";
	var type_no = 0;

	type = input_obj.type;

	if (type == undefined && input_obj.length != undefined)
		type = input_obj[0].type;
	else if (type == undefined)
		type_no = 1;

	if (type == undefined)
		type = "";
	else
		type = type.toUpperCase();

	if (type == "TEXT" || type == "HIDDEN" || type == "TEXTAREA" || type == "PASSWORD")
		type_no = 1;
	else if (type == "SELECT-ONE" || type == "SELECT-MULTIPLE")
		type_no = 2;
	else if (type == "RADIO" || type == "CHECKBOX")
		type_no = 3;

	if(type_no == 1 && input_obj.value == '')
	{
		alert("Enter " + lable + '.');
		if (!input_obj.readOnly && !input_obj.disabled)
			input_obj.focus();
		return true;
	}
	else if (type_no == 2 && input_obj.value == '')
	{
		alert("Select " + lable + '.');
		input_obj.focus();
		return true;
	}
	else if (type_no == 3)
	{
		if (input_obj.length > 1)
		{
			if (!radioCheckedYN(input_obj))
			{
				alert("Select " + lable + '.');
				input_obj[0].focus();
				return true;
			}
		}
	}
	else
		return false;
}

// 입력없음 체크 & 안내 (한글) *************************************************
function emptyInputYN_KR(input_obj, lable, focus_yn)
{
	var input = input_obj;
	var type = "";
	var type_no = 0;

	type = input_obj.type;

	if (type == undefined && input_obj.length != undefined)
		type = input_obj[0].type;
	else if (type == undefined)
		type_no = 1;

	if (type == undefined)
		type = "";
	else
		type = type.toUpperCase();

	if (type == "TEXT" || type == "HIDDEN" || type == "TEXTAREA" || type == "PASSWORD")
		type_no = 1;
	else if (type == "SELECT-ONE" || type == "SELECT-MULTIPLE")
		type_no = 2;
	else if (type == "RADIO" || type == "CHECKBOX")
		type_no = 3;

	if(type_no == 1 && input_obj.value == '')
	{
		alert(lable + ' 입력해 주세요.');
		if (!input_obj.readOnly && !input_obj.disabled && focus_yn)
			input_obj.focus();
		return true;
	}
	else if (type_no == 2 && input_obj.value == '')
	{
		alert(lable + ' 선택해 주세요.');
		if (focus_yn)
			input_obj.focus();
		return true;
	}
	else if (type_no == 3)
	{
		if (input_obj.length > 1)
		{
			if (!radioCheckedYN(input_obj))
			{
				alert(lable + ' 선택해 주세요.');
				if (focus_yn)
					input_obj[0].focus();
				return true;
			}
		}
	}
	else
		return false;
}

// 최소길이 & 안내 *************************************************************
function lengthCheckYN(input_obj, lable, num)
{
	if(emptyInputYN(input_obj, lable) && input_obj.value.length < num)
	{
		alert('Enter ' + lable + ' More Than ' + num + 'Character.');
		input_obj.focus();
		return false;
	}
	return true;
}


// 브라우저 체크 ***************************************************************
function BrowserIEYN()
{
	var isOpera, isIE = false;
	if(typeof(window.opera) != 'undefined')
		isOpera = true;
	if(!isOpera && navigator.userAgent.indexOf('MSIE') >= 0)
		isIE = true;

	return isIE;
}


// 비동기 페이지 호출 **********************************************************
function CallServer(pageName, paramStr)
{
	var objXmlHttp = null;
	try {
		// FireFox, Opera 8.0++, Safari, 익스 7.0+
		objXmlHttp = new XMLHttpRequest();
	} catch(e) {
		try {
			// 익스플로러 6.0+
			objXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				// 익스플로러 5.5+
				objXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
				alert("Ajax가 지원되지 않는 브라우져 입니다.");
				return;
			}
		}
	}
	objXmlHttp.open("POST", pageName, false);
	objXmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	objXmlHttp.send(paramStr);
	var txtStr = objXmlHttp.responseText;
	// 공백치환
	return txtStr.replace(/(^\s*)|(\s*$)/g, "");
}

// 이메일 수집 거부 *****************************************************************
function pop_email()
{
	var win = "/Front/Korean/company/footer/email.asp";
	window.open(win, "email", "left=100, top=50, width=354, height=246, scrollbars=no");
}

// 이미지의 경로를 over or out으로 변경
// @param type = over 또는 out 등
// @param target = 변경 하고자 하는 이미지객체
function replaceSrc(type , target)
{
	// 이미지 총경로
	var src = target.src;
	var srcArr = src.split("/");

	// 타입에 따라 파일면 변경
	srcArr[srcArr.length-1] = srcArr[srcArr.length-1].replace("_over","");
	if(type == "over") srcArr[srcArr.length-1]  = srcArr[srcArr.length-1].replace(".gif","_over.gif");

	//변경적용된 반환 경로
	var rtn_string = "";
	for(var i = 0; i < srcArr.length; i++)
	{
		if(i != srcArr.length-1 )	rtn_string += srcArr[i] + "/";
		else						rtn_string += srcArr[i];
	}
	target.src = rtn_string;
}




//---------------------------------------------------------
//  이미지 크게 보기 함수
//---------------------------------------------------------

function imgResize(img)
{
	img1 = new Image();
	img1.src = (img);
	imgControll(img);
}

function imgControll(img)
{
	if((img1.width!=0)&&(img1.height!=0))
	{
		viewImage(img);
	}
	else
	{
		controller="imgControll('"+img+"')";
		intervalID=setTimeout(controller, 20);
	}
}

function viewImage(img)
{
	var scroll = "yes";
	var W = img1.width;
	var H = img1.height;
	var AW = screen.availWidth;
	var AH = screen.availHeight;

	if (H > AH && W <= AW)
		W += 17;
	if (W > AW && H <= AH)
		H += 17;

	//alert("W:" + W + "/H:" + H +"/AW:" + AW+"/AH:" + AH)

	if (W <= AW && (H+52)<= AH)
	{
		scroll = "no";
	}
	else
	{
		W += 17;
	}

	var O = "width=" + W + ",height=" + H + ",scrollbars=" + scroll + ",left=100,top=0";
	imgWin=window.open("","",O);
	imgWin.document.write("<html><head><title>Image View</title></head>");
	imgWin.document.write("<body style='margin:0; text-align:center;'>");
	imgWin.document.write("<img src='"+img+"' onclick='self.close()' style='cursor:hand;'>");
	imgWin.document.write("</body></html>");
	imgWin.document.close();
}



function langCdToFolder(lang_cd)
{

	if (lang_cd == null || lang_cd == "kr")		return "Korean"
	else if (lang_cd == "en")	return "English"
	else if (lang_cd == "cn")	return "Chinese"
	else if (lang_cd == "ru")	return "Russian"
	else if (lang_cd == "sp")	return "Spanish"
	else						return "Korean"
}

// 페이지 언어 변경 *****************************************************************
function topLanguageLink(language)
{
	var url = "";

	if (language ==  "KOREAN")
	{
		url = "/Front/Korean/Product/main.asp";
	}
	else if (language ==  "ENGLISH")
	{
		url = "/Front/English/Product/main.asp";
	}
	else if (language ==  "CHINESE")
	{
		url = "/Front/Chinese/Product/main.asp";
	}
	else if (language ==  "SPANISH")
	{
		url = "/Front/Spanish/Product/main.asp";
	}
	else if (language ==  "RUSSIAN")
	{
		url = "/Front/Russian/Product/main.asp";
	}
	if (url != "")
	{
		location.href = url;
	}
}

// 하단 페밀리사이트 연결 *****************************************************************
function bottomFlashLink(num)
{
	var url = "";
/*
	if (num ==  "전자구매시스템")
	{
		url = "http://b2b.commax.co.kr";
	}
	else if (num ==  "코맥스레이저")
	{
		url = "http://laser.commax.com";
	}
	else if (num ==  "무한넷코리아")
	{
		url = "http://www.moohan.net";
	}
*/
	num = Number(num);
	if (num == 0)
	{
		url = "http://b2b.commax.co.kr";
	}
	else if (num ==  1)
	{
		url = "http://laser.commax.com";
	}
	else if (num ==  2)
	{
		url = "http://www.moohan.net";
	}


	if (url != "")
	{
		window.open(url);
	}
}

// 역사관, 체험관 열기 *****************************************************************
function popupGlobalEtcDiv(num, lang_cd)
{
	num = Number(num);
	//역사관
	if (num == 1 )
	{
		window.open("/Front/Common/PopupFlash/"+lang_cd+"/History/main.html","flashhistory","status=no, resizable=no,scrollbars=no,top=100,left=100,width=920,height=640" );
	}
	//체험관
	else if (num == 2)
	{
		window.open("/Front/Common/PopupFlash/"+lang_cd+"/Experience/main.html","flashhistory","status=no, resizable=no,scrollbars=no,top=100,left=100,width=920,height=600" );
	}
	/*
	//역사관
	if (num == 1 )
	{
		if (mode == "close")
		{
			document.getElementById("FlashHistoryDivArea").style.display = "none";
		}
		else
		{
			document.getElementById("FlashExperienceDivArea").style.display = "none";
			document.getElementById("FlashHistoryDivArea").style.display = "block";
		}
	}
	//체험관
	else if (num == 2)
	{
		if (mode == "close")
		{
			document.getElementById("FlashExperienceDivArea").style.display = "none";
		}
		else
		{
			document.getElementById("FlashHistoryDivArea").style.display = "none";
			document.getElementById("FlashExperienceDivArea").style.display = "block";
		}
	}
	*/
}

