function  goMore_board(){
	url = "/about/news/antenna.jsp";	// Antenna ·Î ÀÌµ¿
	location.href = url;
}

function  goMore_board_eng(){
	url = "/eng/about/news/e_antenna.jsp";	// Antenna ·Î ÀÌµ¿
	location.href = url;
}

function goMore_paper(){
	url = "/research/investigate/treatise.jsp"; 
	location.href = url;
}

function goMore_paper_eng(){
	url = "/eng/research/e_research_article.jsp"; 
	location.href = url;
}

function goMore_WS(){
	url = "/career/working/investigator.jsp"; 
	location.href = url;
}

function goView_board(bid, idx){
	url = "";
	if(bid == "1"){	url = "/about/news/antenna_view.jsp?idx="+idx; }
	if(bid == "2"){	url = "/about/news/news_view.jsp?idx="+idx; }
	if(bid == "3"){	url = "/career/recruit/notice_view.jsp?idx="+idx; }

	location.href = url;
}

function goView_board_eng(bid, idx){
	url = "";
	if(bid == "1"){	url = "/eng/about/news/e_antenna_view.jsp?idx="+idx; }
	if(bid == "2"){	url = "/eng/about/news/e_press_view.jsp?idx="+idx; }
	if(bid == "3"){	url = "/eng/career/recruit/e_notice_view.jsp?idx="+idx; }

	location.href = url;
}

function goView_paper(num){
	url = "";
	url = "/research/investigate/pop_view.jsp?kid="+num;
	pops(url,"SAIT",690,487);
}

function goView_paper_eng(num){
	url = "";
	url = "/eng/research/e_pop_view.jsp?kid="+num;
	pops(url,"SAIT",612,425);
}

function goView_WS(idx){
	url = "";
	url = "/career/working/investigator.jsp";
	location.href = url;
}

function openWin(dir,inputname,form1){
	window.open("/common/upload.jsp?dir="+dir+"&inputName="+inputname+"&Func=setfname&openerform="+form1,"filepopup","scrollbars=no,resizable=no,status=no,width=360,height=160,left=0,top=0");
}

function openWin4Intern(dir,inputname,form1){
	window.open("/common/upload4Intern.jsp?dir="+dir+"&inputName="+inputname+"&Func=setfname&openerform="+form1,"filepopup","scrollbars=no,resizable=no,status=no,width=360,height=160,left=300,top=300");
}


function download(fname, str_root){
	
	location.href="/common/fdownload.jsp?strDownPath="+fname+"&str_root="+str_root;
	
}

function download_Brainsam(fname, str_root){

	location.href="/common/fdownload_UTF.jsp?strDownPath="+fname+"&str_root="+str_root;
	
}

/*
	* 2005-03-25
	* ¹è½ÂÁø
	* ÀÌ¹ÌÁö ¿øº» »çÀÌÁî·Î º¸¿©ÁÖ±â
*/
function popView(file_path){
	window.open("/common/pop_img.php?file_path="+file_path,"","width=500,height=500,scrollbars=yes");
}
/**ÆË¾÷Ã¢ ¶ç¿ì±â*/
function pop(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=no') } //Popup(½ºÅ©·Ñ¹Ù¾øÀ½)
function pops(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=yes') } //Popup(½ºÅ©·Ñ¹ÙÀÖÀ½)
/** 
* 2005-02-17 ¹è½ÂÁø 
* ÇØ´ç ÆÄÀÏ ÀÌ¹ÌÁö¿Í ³»¿ë º¸¿©ÁÖ±â
*/
function showMSG2(img,view,msg,imgsize){
	if(img){
		if(imgsize == "s"){
			sMSG.innerHTML="<table border=0 cellpadding=2 cellspacing=0 width=100><tr><td><img src='"+img+"' width=100 border=0><td></tr><tr><td>"+msg+"</td></tr></table>";
		}
		else 	sMSG.innerHTML="<table border=0 cellpadding=2 cellspacing=0 width=200><tr><td><img src='"+img+"' width=200 border=0><td></tr><tr><td>"+msg+"</td></tr></table>";
	}else{
		sMSG.innerHTML="";
	}

	sMSG.style.pixelLeft=event.clientX+15;
	sMSG.style.pixelTop=event.clientY+15+document.body.scrollTop;

	if(view) sMSG.style.display="block";
	else sMSG.style.display="none";
}

function showMSG(img,view,msg){
	if(img){
		sMSG.innerHTML="<table border=0 cellpadding=2 cellspacing=0 width=200><tr><td><img src='"+img+"' width=200 border=0><td></tr><tr><td>"+msg+"</td></tr></table>";
	}else{
		sMSG.innerHTML="";
	}

	sMSG.style.pixelLeft=event.clientX+15;
	sMSG.style.pixelTop=event.clientY+15+document.body.scrollTop;

	if(view) sMSG.style.display="block";
	else sMSG.style.display="none";
}

function moveMSG(){
	sMSG.style.pixelLeft=event.clientX+15;
	sMSG.style.pixelTop=event.clientY+15+document.body.scrollTop;
}

// isBlank °ø¹é¿©ºÎ È®ÀÎ (°´Ã¼ÀÌ¸§,¸Þ¼¼Áö³»¿ë,Æ÷Ä¿½º»ç¿ëY/N)

function isBlank(strName,strMsg,useFocus)
{
	if (strName.value.trim())

	{ 
		return false; }

	else

	{

		alert(strMsg);

		if ( useFocus == 'Y' )

		{

			cmd_focus(strName);

		}

		return true;

	}
	
alert('EXIT');
}

// radio, checkbox¿Í °°Àº input formÀÇ Ã¼Å©¿©ºÎ

function isChecked(strName,strMsg,useFocus)

{

	var blockFlag = true;

	for(i = 0; i < strName.length; i++)

		if( strName[i].checked )

			blockFlag = false;

	if ( blockFlag )

	{

		alert(strMsg);

		if ( useFocus == 'Y' )
			cmd_focus(strName[0]);

		return false;

	}

	else

		return true;

}


// ¾ÕµÚ °ø¹é¹®ÀÚ ¾ø¾Ö±â

String.prototype.trim = function()

{

	return this.replace(/(^\s*)|(\s*$)/g, "");

}



// E-mail °ø¹é¿©ºÎ È®ÀÎ (°´Ã¼ÀÌ¸§,BlankÃ¼Å©Y/N,Æ÷Ä¿½º»ç¿ëY/N)

function isEmail(strEmail,useBlank,useFocus)

{
	if ( useBlank == 'Y' )

	{
		if (isBlank(strEmail,' ÀÌ¸ÞÀÏÀ» ÀÔ·ÂÇÏ¼¼¿ä. \n\n Insert your E-mail address ! ','Y'))

		{

			return false;

		}

	}
	if (chkEmail(strEmail.value))

	{
		return true;

	}

	else

	{
		alert(strEmail.value + ' (Àº)´Â Àß¸øµÈ E-mail Çü½Ä ÀÔ´Ï´Ù. \n\n ' + strEmail.value + ' is an incorrect E-mail address. ');

		if (useFocus == 'Y')

		{

			cmd_focus(strEmail);

		}

		return false;

	}
	
}


// E-mail Ã¼Å© (Email)

function chkEmail(strEmail)

{

	var pos = strEmail.indexOf("@");

	if (pos == -1 || pos == 0)

		return false;

	var value = strEmail.split("@");

	if (value[1].length < 1)

		return false;

	var domain = value[1].split(".");

	if (domain.length < 2 || domain[1].length < 1)

		return false;

	return true;

}


// ÁÖ¹Î¹øÈ£ °ø¹é¿©ºÎ È®ÀÎ (°´Ã¼ÀÌ¸§,BlankÃ¼Å©Y/N,Æ÷Ä¿½º»ç¿ëY/N)

function isJno(strJno1, strJno2,useBlank,useFocus)

{

	if ( useBlank == 'Y' )

	{

		if (isBlank(strJno1,'ÁÖ¹Î¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä','Y'))

		{

			return false;

		}

	}

	if (chkJno(strJno1.value,strJno2.value))
	{

		return true;

	}

	else

	{

		alert(strJno1.value + ' - ' +strJno2.value + ' (Àº)´Â Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ´Ï´Ù');

		if (useFocus == 'Y')

		{

			strJno1.value = '';

			strJno2.value = '';

			strJno1.focus();

		}

		return false;

	}

}



// ÁÖºó¹øÈ£ Ã¼Å©

function chkJno(valueJno1, valueJno2)

{
	var ssno = valueJno1+ "-" + valueJno2;

	if (isNaN(parseInt(valueJno1))) return false;

	if (isNaN(parseInt(valueJno2))) return false;

	tval=ssno.charAt(0)*2 + ssno.charAt(1)*3 + ssno.charAt(2)*4

		+ ssno.charAt(3)*5 + ssno.charAt(4)*6 + ssno.charAt(5)*7

		+ ssno.charAt(7)*8+ ssno.charAt(8)*9 + ssno.charAt(9)*2

		+ ssno.charAt(10)*3 + ssno.charAt(11)*4 + ssno.charAt(12)*5;

	tval2=11- (tval % 11);

	tval2=tval2 % 10;

	if (ssno.charAt(13)==tval2 &&  (ssno.charAt(7)=="1" ||ssno.charAt(7)=="2"))

		return true;

	else

		return false;

}



//¼ýÀÚ ÀÔ·Â

function isNo(strName,useBlank,msgBlank,useFocus)

{

	if ( useBlank == 'Y')

	{

		if (isBlank(strName,msgBlank,'Y'))

		{

			return false;

		}

	}



	if (!isNaN(strName.value))

	{

		return true;

	}

	else

	{

		alert('¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù');

		if (useFocus == 'Y')

		{

			cmd_focus(strName);

		}

	}

}




// ¿µ¹®,¼ýÀÚ°ª¸¸ ¹ÝÈ¯

function isEngNo(strName,useFocus)

{

var chkStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";

var strValue = strName.value;

	for (i=0; i<strValue.length; i++)

	{

		idcheck = strValue.charAt(i);

		for (j=0;  j< chkStr.length; j++)

		if (idcheck == chkStr.charAt(j))
		break;

		if( j == chkStr.length)

		{

		alert("¿µ¹®ÀÚ ¶Ç´Â ¼ýÀÚ¸¸ °¡´ÉÇÕ´Ï´Ù.");

			if (useFocus == 'Y')

			{

				cmd_focus(strName);

			}

			return false;

		}

	}

	return true;

}



// Æ÷Ä¿½º

function cmd_focus(strName)

{

	strName.value = '';

	strName.focus();

}



// ¹®ÀÚ¿­ ±æÀÌ

function getLenStr(strName)

{

var strValue = strName.value;

var cntStr;

cntStr = 0;

	for (i=0;  i<strValue.length; i++)

	{

		if(is2Byte(strValue.charAt(i)))

		{cntStr = Number(cntStr + 2)}

		else

		{cntStr = Number(cntStr + 1)}

	}

	return cntStr;

}



// ¿øÇÏ´Â ¹®ÀÚ¿­ ±æÀÌ Ã¼Å©

function chkLenStr(strName,strLen,useFocus)

{

var strValue = strName;

	if(getLenStr(strValue)>=strLen)

	{

		alert('ÀÔ·ÂÇÑ ¹®ÀÚÀÇ ±æÀÌ´Â ÃÑ ' + (strLen-1) + ' Byte¸¦ ³ÑÀ» ¼ö ¾ø½À´Ï´Ù');

		if (useFocus == 'Y')

		{

			cmd_focus(strName);

			return false;

		}
	}

			return true;

}




// 2Byte ¹®ÀÚ Ã¼Å© true ¹ÝÈ¯

function is2Byte(str)

{

var i;

var ch;



	for (i=0;i<str.length;i++)
	{

		ch = escape(str.charAt(i));        //ISO-Latin-1 ¹®ÀÚ¼ÂÀ¸·Î º¯°æ

		if (chkByte(ch) != 2)

		{

			return false;

		}

	}

return true;

}



function chkByte(strCh)

{

	if (strCh.substring(0, 2) == '%u')

	{

		if (strCh.substring(2,4) == '00')

		{	return 1; }

		else

		{	return 2; }       //ÇÑ±Û

	}

	else if (strCh.substring(0,1) == '%')

	{

		if (parseInt(strCh.substring(1,3), 16) > 127)

		{	return 2; }        //ÇÑ±Û

		else

		{	return 1; }

	}

	else

	{

		return 1;

	}
}
/**
 * ÀÔ·Â°ªÀÌ ÀüÈ­¹øÈ£ Çü½Ä(¼ýÀÚ-¼ýÀÚ-¼ýÀÚ)ÀÎÁö Ã¼Å©
 */
function isValidPhone(input) {
    var format = /^(\d+)-(\d+)-(\d+)$/;
    return isValidFormat(input,format);
}
/**
 * ÀÔ·Â°ªÀÌ »ç¿ëÀÚ°¡ Á¤ÀÇÇÑ Æ÷¸Ë Çü½ÄÀÎÁö Ã¼Å©
 * ÀÚ¼¼ÇÑ format Çü½ÄÀº ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ 'regular expression'À» ÂüÁ¶
 */
function isValidFormat(input,format) {
    if (input.value.search(format) != -1) {
        return true; //¿Ã¹Ù¸¥ Æ÷¸Ë Çü½Ä
    }
    return false;
}


