﻿
String.prototype.trim = function(){
	return this.replace(/(^\s*)|(\s*$)/gi, "");
}

//숫자 입력체크
function NumberCheck(a,b)  {               
	for(i=0; i<a.value.length; i++){
		if(a.value.charAt(i)<"0" || a.value.charAt(i) >"9"){
			if(b==0){   
				alert("숫자만 입력가능합니다.");
				a.focus();  
				a.value=""; 
			}else{
				a.value="";
			}
			return;
		}
	}
}

function LoadNamo(NamoId, Width, Height, ConfigType){
	//2번째 로드할경우는 N
	if (ConfigType=="Y")
	{
		document.write ('<OBJECT WIDTH=0 HEIGHT=0 CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331">'
		+'<PARAM NAME="LPKPath" VALUE="/Common/Namo/NamoWec6_shindongah_M.lpk">'
		+'</OBJECT>');
	}
	document.write ('<OBJECT ID="'+NamoId+'" WIDTH="'+Width+'" HEIGHT="'+Height+'" '
	+'CLASSID="CLSID:9DFB56D3-EC60-49D5-B26A-1AA468C68604">'
	+'<param name="UseNamoNet" value="0">'
	+'<param name="InitFileURL" value="http://adminwinchest.icgist.com/Common/namowec.env">'
	+'<textarea name="comment" style="width:100%; height:100%; overflow:visible">\r\n이 문구가 보이시면, ActiveSquare6가 정상적인 설치가 안되었습니다.\r\n설치과정이 진행 중이라면, 완료 후 페이지를 새로고침을 해주십시요.</textarea>'
	+'</OBJECT>');
	if (ConfigType=="Y")
	{
	document.write('<OBJECT ID="WecWecInstall" "WIDTH=0 HEIGHT=0  CLASSID="clsid:AF465549-1D22-4140-A273-386FA8877E0A"'
	+'CodeBase="/Common/Namo/NamoInstaller.Cab#Version=3,0,0,1"'
	+'border="0" width="0%" height="0%" OnError="InfoSetup()">'
	+'</OBJECT>');
	}
}


/******************************************************************************* 
* 함수명 : openWindow 
* 내용 : 지정한 크기의 팝업 윈도우를 화면 중앙에 오픈(윈도우의 스크롤, 메뉴등은 no값) 
* 입력 : URL, 설명, 폭, 높이 
* 출력 : 팝업윈도우 
*******************************************************************************/ 
function openCenterWindow(url, description, width, height) { 
   var screenPosX = screen.availWidth/2 - width/2; 
   var screenPosY = screen.availHeight/2 - height/2; 
   var features = "'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, top="+screenPosY+", left="+screenPosX+", width="+width+", height="+height+"'"; 

   window.open(url, description, features); 
} 
function openCenterWindow_scroll(url, description, width, height) { 
   var screenPosX = screen.availWidth/2 - width/2; 
   var screenPosY = screen.availHeight/2 - height/2; 
   var features = "'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, top="+screenPosY+", left="+screenPosX+", width="+width+", height="+height+"'"; 

   window.open(url, description, features); 
} 

function flashmenu(depth1, depth2, depth3){
	var Str_folder = "";
	switch(depth1) {

		case "1": 
			location.href='../News/NewsList.asp';
			break;

		case "2": 

			if(depth2==1){
				location.href='../Business/Brand.asp';
			}else if(depth2==2){
				location.href='../Business/ImportBrand.asp';
			}else if(depth2==3){
				location.href='../Business/OnLineShop.asp';
			}else{
				location.href='../Business/Brand.asp';
			}

			break;

		case "3": 
			
			if(depth2==1){
				location.href='../Company/Overview.asp';
			}else if(depth2==2){
				location.href='../Company/Organization.asp';
			}else{
				location.href='../Company/Overview.asp';
			}
			break;
		
		case "4": 
			

			if(depth2==1){
				location.href='../Contact/Contact.asp';
			}else if(depth2==2){
				location.href='../Contact/Recruit.asp';
			}else{
				location.href='../Contact/Contact.asp';
			}
			break;
		
		case "5": 
			location.href='../Photo/PhotoList.asp';
			break;

		case "6": 
			location.href='../Until/Partners.asp';
			break;

		case "7": 
			location.href='../Until/CustomerCenter.asp';
			break;

		case "8": 
			location.href='../Sitemap/Sitemap.asp';
			break;

	}
	
}

function go_venist(NationType){
	/*
	if (NationType=="K")
	{
		alert("준비중입니다.");
	}else if (NationType=="E")
	{
		alert("Under Construction, Please Wait.");
	}else if (NationType=="J")
	{
		alert("現在準備しております。");
	}
	*/
	window.open('http://www.venist.com');
}

function go_venistyle(NationType){
	/*
	if (NationType=="K")
	{
		alert("준비중입니다.");
	}else if (NationType=="E")
	{
		alert("Under Construction, Please Wait.");
	}else if (NationType=="J")
	{
		alert("現在準備しております。");
	}
	*/
	window.open('http://www.venistyle.co.kr');
}

function go_icgist(NationType){
	/*
	if (NationType=="K")
	{
		alert("준비중입니다.");
	}else if (NationType=="E")
	{
		alert("Under Construction, Please Wait.");
	}else if (NationType=="J")
	{
		alert("現在準備しております。");
	}
	*/
	window.open('http://www.icgist.com');
}


function go_brochure(NationType){
	if (NationType=="K")
	{
		alert("준비중입니다...");
	}else if (NationType=="E")
	{
		alert("Under Construction, Please Wait.");
	}else if (NationType=="J")
	{
		alert("現在準備しております。");
	}
	//window.open('http://www.venistyle.com');
}

function part(){
	location.href='../Until/Partners.asp';
}
function cust(){
	flashmenu("7","","");
}
function site(){
	flashmenu("8","","");
}
function kor(){
	location.href='/Kor/Main/Index.asp';
}
function eng(){
	location.href='/Eng/Main/Index.asp';
}
function jap(){
	location.href='/Jap/Main/Index.asp';
}
function goindex(){
	location.href='../Main/Index.asp';
}


function WriteYearOptions(YearsAhead,StrYear)
{
		//날짜지정 관련함수
		Now = new Date();
		NowDay = Now.getDate();
		NowMonth = Now.getMonth();
		NowYear = Now.getYear();
        line = "";
        for (i=0; i<YearsAhead; i++)
        {
                
				if (StrYear==(NowYear-i)){
					line += "<OPTION  value='"+(NowYear-i)+"' selected>";
				}else{
					line += "<OPTION value='"+(NowYear-i)+"'>";
				}
                line += NowYear - i;
        }
        return line;
}
function WriteMonthOptions(StrMonth)
{
		//날짜지정 관련함수
		Now = new Date();
		NowDay = Now.getDate();
		NowMonth = Now.getMonth();
		NowYear = Now.getYear();
        line = "";
        for (i=1; i<13; i++)
        {
				if (StrMonth==i){
					if (i<10){
	              	  line += "<OPTION value='0"+i+"' selected>";
					}else{
	               	 line += "<OPTION value='"+i+"' selected>";
					}
				}else{
					if (i<10){
	              	  line += "<OPTION value='0"+i+"'>";
					}else{
	               	 line += "<OPTION value='"+i+"'>";
					}
				}
				if (i<10){
                line += "0"+i;
				}else{
                line += i;
				}
        }
        return line;
}
