
function nb_chList(nb_gubn, nb_over) {
  //var form = document.sertopForm;
   // form.nb_gubn.value = nb_gubn;
    //form.nb_over.value = nb_over;
	//form.action = "nb_list.asp";

	location.href = "/koita/information/nb_list.asp?nb_gubn="+nb_gubn+"&nb_over="+nb_over;
	//form.submit();
}

//°³ÀÎÁ¤º¸¸¶Å© ¿ÀÇÂÃ¢
function openWinPrivacy() {
	var urlname = "/koita/introduce/privacyimg.asp";
	var w = (screen.width-402)/2;
	var h = (screen.height-569)/2;
	window.open(urlname,"ViewPrivacy","top="+h+", left="+w+", height=569,width=402, menubar=no,directories=no,resizable=no,status=no,scrollbars=no");
}	

//·Î±×ÀÎ°æ°í
function loginalert(){
 // alert("È¸¿øÀü¿ë¼­ºñ½ºÀÔ´Ï´Ù.");
  userlogin();
}


//·Î±×ÀÎ°æ°í
function loginalert(gb){
  //alert("È¸¿øÀü¿ë¼­ºñ½ºÀÔ´Ï´Ù.");
  userlogin(gb);
}


//·Î±×ÀÎ°æ°í
function loginalertmove(){
 // alert("È¸¿øÀü¿ë¼­ºñ½ºÀÔ´Ï´Ù.");
  //location.href="/member/";
  userlogin();
}

//¹®ÀÇÇÏ±â ¿ÀÇÂÃ¢
function openWinQnA(email,kid) {
  var loca = $("pagetitle").innerHTML;
  var urlname = "/koita/main/inquiry.asp?loca="+loca+"&amp;email="+email+"&amp;kid="+kid;
	var w = (screen.width-550)/2;
	var h = (screen.height-640)/2;
	window.open(urlname,"ViewPrivacy","top="+h+", left="+w+", height=625,width=550, menubar=no,directories=no,resizable=no,status=no,scrollbars=no");
	//window.showModalDialog(urlname,'openWinQnA',"dialogHeight : 673px; dialogWidth : 550px; resizable : no; help : No; status : No; scroll : no;");
}

//½ºÅ©·¦
function scrap() {
  try{
    var loca = $("pagetitle").innerHTML;
    loca = encodeURIComponent(loca);
    var qstr = Object.toQueryString( {loca: loca} );
    var url = "/ko_comm/inc/scrapIN.asp?" + qstr;
	  new Ajax(url, {
		  method: 'get',
		  onComplete: this.setScrap.bind(this)
	  }).request();
	
    
  }catch(e){
    
  }
}

//Á¶Á÷µµ ÆË¾÷Ã¢

function organization(tcode)
{
  var url = '/koita/introduce/organization_pop.asp?teamcode=' + tcode ;
  var w = "577";
  var h = "500";
  if ( tcode == "01" ) {  //Á¤Ã¥°³¹ßÆÀ
    h = "615";
  }else if ( tcode == "02" ) {  //¿¬±¸¼ÒÀÎÁ¤ÆÀ
    h = "593";
  }else if ( tcode == "03" ) {  //½Ã»óÀÎÁõÆÀ
    h = "585";
  }else if ( tcode == "04" ) {  //±¹Á¦Çù·ÂÆÀ
    h = "478";
  }else if ( tcode == "05" ) {  //±³À°¿¬¼öÆÀ
    h = "660";
  }else if ( tcode == "06" ) {  //Á¶»ç¿¬±¸ÆÀ
    h = "550";
  }else if ( tcode == "07" ) {  //Àü»êÁ¤º¸ÆÀ
    h = "503";
  }else if ( tcode == "08" ) {  //°æ¿µ±âÈ¹ÆÀ
    h = "600";
  }else if ( tcode == "09" ) {  //ÀçÁ¤¿î¿µÆÀ
    h = "660";
  }else if ( tcode == "15" ) {  //È¸¿ø»ç¾÷´Ü
    h = "520";
  }else if ( tcode == "12" ) {  //´ëÀü»ç¹«¼Ò
    h = "415";
  }else if ( tcode == "13" ) {  //Àü·«±â¼úÁ¾ÇÕÁ¤º¸¼¾ÅÍ
    h = "443";
  }else if ( tcode == "14" ) {  //¿µ³²»ç¹«¼Ò
    h = "418";
  }else if ( tcode == "90" ) {  //±â¼úÇù·ÂÆÀ
    h = "490";
  }else if ( tcode == "93" ) {  //¿¬±¸ÀÎ·ÂÆÀ
    h = "530";
  }else if ( tcode == "94" ) {  //ÀÌ°ø°èÀÎ·ÂÁß°³¼¾ÅÍ
    h = "480";
  }
  
	var win=window.open(url,'organization_pop','width='+w+',height='+h+', menubar=no,directories=no,resizable=no,status=no,scrollbars=no');
	win.focus();
}

function setScrap(data, xml){
  
	var item = xml.getElementsByTagName("item")[0];
	var msg = item.getElementsByTagName("msg")[0].firstChild.nodeValue;
	var tf = item.getElementsByTagName("tf")[0].firstChild.nodeValue;
	
	if ( tf == "T" ) {
	  alert(msg);
	}else {
	  alert(msg);
	  userlogin();
	}
	
}

function recommendMail(){
  try{
    var loca = $("pagetitle").innerHTML;
    loca = encodeURIComponent(loca);
    var qstr = Object.toQueryString( {loca: loca} );
    var url = "/ko_comm/inc/recommendmail.asp?" + qstr;
	  new Ajax(url, {
		  method: 'get',
		  onComplete: this.openMail.bind(this)
	  }).request();
	
    
  }catch(e){
    
  }
}

function openMail(data, xml){
  
	var item = xml.getElementsByTagName("item")[0];
	var msg = item.getElementsByTagName("msg")[0].firstChild.nodeValue;
	var tf = item.getElementsByTagName("tf")[0].firstChild.nodeValue;
	var loca = item.getElementsByTagName("loca")[0].firstChild.nodeValue;
	var lurl = item.getElementsByTagName("lurl")[0].firstChild.nodeValue;
	
	if ( tf == "T" ) {
	  url = '/koita/main/contentmail.asp?loca='+loca+'&lurl='+lurl;
	  window.open (url,'mailwin','width=552,height=565,menubars=no,scrollbars=no')
	}else {
	  alert(msg);
	  userlogin();
	}
	
}

function userlogin(){	
	url = '/member/join/login.asp';
	window.open (url,'loginwin','width=605,height=410,menubars=no,scrollbars=no')
}

function userlogin(gb){	
	url = '/member/join/login.asp?cgb='+gb;
	//alert(url);
	window.open (url,'loginwin','width=605,height=410,menubars=no,scrollbars=no')
}

function flashWrite(obj) {
	document.write(obj);
}
function writeEmbed(obj){
	document.writeln(obj);
}
/////////////////////////////////////////
function check_search(form){
	var form = document.serForm;
	if(!form.searchword.value.trim())	{
		alert("°Ë»öÇÒ ´Ü¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		form.searchword.focus();
		return;
	}
	form.submit();
}


/////////////////////////////////////////Åë°è¿ä¶÷ ÀÌ¹ÌÁöº¸±â
function tongview(yyyy, que, subject){
  var url = "/dextdata/tong/tong_" + yyyy;
	url = url+'/img.asp?subject='+subject+'&que='+que;
	window.open (url,'tongwin','menubars=no,scrollbars=yes')
}

function tongview2(yyyy,fstr){
  var url = "/dextdata/tong/tong_" + yyyy;
	url = url+'/'+fstr;
	window.open (url,'tongwin','menubars=no,scrollbars=yes')
}

function tongview3(yyyy,fstr){
  var url = "/dextdata/tong/tong_" + yyyy;
	url = url+'/'+fstr+'.gif';
	window.open (url,'tongwin','menubars=no,scrollbars=yes')
}


/////////////////////////////////////////

function changeList(form){
	var form = document.serForm;
	form.submit();
}

////////////////////////////////////////////
function setKeycode(e)
{
	var keynum
	
	if(window.event) // IE
	{
		keynum = e.keyCode
	}
	else if(e.which) // Netscape/Firefox/Opera
	{
		keynum = e.which
	}
	return keynum
}

////////////////////////////////////////////º¹»ç¹æÁö
function setNoCopy(){
	$$("input").filterByAttribute("data1","=","nocopy").addEvents({	
		'onPaste' : function(event){
			event.preventDefault();
		},
		'onDrop' : function(event){
			event.preventDefault();
		}
	})
}

////////////////////////////////////////////ÀÌ¸ÞÀÏÃ¼Å©
function checkEmail(input) {
  var format = /^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/;
  return checkFormat(input,format);
}

function checkFormat(input,format) {
  if (input.value.search(format) == -1) {
    return true;
  }
	else if (input.value.charAt(input.value.indexOf('@')+1)=='.')
		return true;
    return false;
}

////////////////////////////////////////////
function setOnlyNumber(){
	$$("input").filterByAttribute("data","=","number").addEvents({	
		'keyup' : function(event){
			onlyNumber(event);
		},
		'keydown' : function(event){
			onlyNumber(event);
		},
		'keypress' : function(event){
			onlyNumber(event);
		}
	}).setStyle( "ime-mode" , "disabled" );
}

function onlyNumber(event){
	var number = "[48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [96] [97] [98] [99] [100] [101] [102] [103] [104] [105] [35] [36] [46] [37] [39] [8] [9]";
	var event = new Event(event);
	var val = event.code;
	if(number.indexOf("["+val+"]") == -1) event.preventDefault();
}

//////////////////////////////////////////////

////////////////////////////////////////////
function setNoComma(){
	$$("input").filterByAttribute("data","=","comma").addEvents({	
		'keyup' : function(event){
			noComma(event);
		},
		'keydown' : function(event){
			noComma(event);
		},
		'keypress' : function(event){
			noComma(event);
		}
	}).setStyle( "ime-mode" , "active" );
}

function noComma(event){
	var number = "[188]";
	var event = new Event(event);
	var val = event.code;
	if(number.indexOf("["+val+"]") == 0) event.preventDefault();
}
//////////////////////////////////////////////

function zipview(upfile) { 
	var ext = (upfile.substring(upfile.lastIndexOf(".")+1, upfile.length)).toLowerCase( ); //ÆÄÀÏ È®ÀåÀÚ 
	if( ext != "zip" ) { 
		if(ext !=""){
			alert("¾ÐÃàÆÄÀÏ¸¸ µî·ÏÇÏ½Ê½Ã¿ä. (zip)");
		}		
	}
}

function commonview(upfile) { 
	var ext = (upfile.substring(upfile.lastIndexOf(".")+1, upfile.length)).toLowerCase( ); //ÆÄÀÏ È®ÀåÀÚ 
	if( !(ext == "zip" || ext == "doc" || ext == "xls" || ext == "ppt" || ext == "txt" || ext == "jpg" || ext == "jpeg" || ext == "gif" || ext == "png" || ext == "hwp" || ext == "pdf") ) { 
		if(ext !=""){
			alert("ÀÌ¹ÌÁö, ¾ÐÃà, ¹®¼­ÆÄÀÏ¸¸ µî·ÏÇÏ½Ê½Ã¿ä.\n(zip, doc, xls, ppt, txt, jpg, gif, png, hwp, pdf)");
		}
	}
	
}

function csvview(upfile) { 
	var ext = (upfile.substring(upfile.lastIndexOf(".")+1, upfile.length)).toLowerCase( ); //ÆÄÀÏ È®ÀåÀÚ 
	if( ext != "csv" ) { 
		if(ext !=""){
			alert("csvÆÄÀÏ¸¸ µî·ÏÇÏ½Ê½Ã¿ä. (csv)");
		}		
	}
}

function imageview(upfile) { 
	var ext = (upfile.substring(upfile.lastIndexOf(".")+1, upfile.length)).toLowerCase( ); //ÆÄÀÏ È®ÀåÀÚ 
	if( !(ext == "jpg" || ext == "jpeg" || ext == "gif" || ext == "png") ) { 
		if(ext !=""){
			alert("ÀÌ¹ÌÁöÆÄÀÏ¸¸ µî·ÏÇÏ½Ê½Ã¿ä. (jpg, gif, png)");
		}
	}
	
}

function pdfview(upfile) { 
	var ext = (upfile.substring(upfile.lastIndexOf(".")+1, upfile.length)).toLowerCase( ); //ÆÄÀÏ È®ÀåÀÚ 
	if( ext != "pdf" ) { 
		if(ext !=""){
			alert("PDFÆÄÀÏ¸¸ µî·ÏÇÏ½Ê½Ã¿ä. (PDF)");
		}		
	}
}

function htmlview(upfile) { 
	var ext = (upfile.substring(upfile.lastIndexOf(".")+1, upfile.length)).toLowerCase( ); //ÆÄÀÏ È®ÀåÀÚ 
	if( !(ext == "html" || ext == "htm") ) { 
		if(ext !=""){
			alert("HTMLÆÄÀÏ¸¸ µî·ÏÇÏ½Ê½Ã¿ä. (html, htm)");
		}
	}
}


//ÆÄÀÏ¸íÀ¸·Î ¾ÆÀÌÄÜ °¡Á®¿À±â

function view_icon(filename){	
	var imageHat = filename.split(".");
	imageHat = imageHat[imageHat.length - 1];
	switch(imageHat){
		case "gif" :
			var imgTag = "<img src='../images/icon/gif.gif' class='middle' />";
			break;
		case "jpg" :
			var imgTag = "<img src='../images/icon/jpg.gif' class='middle' />";
			break;
		case "png" :
			var imgTag = "<img src='../images/icon/png.gif' class='middle' />";
			break;
		default :
			var imgTag = "<img src='../images/icon/etc.gif' class='middle' />";
			break;
	}
	return imgTag;
}

function zerofill(n){
	var str = "";
	for( var i=0; i<n; i++ ){
		str += "00";
	}
	return str;
}

function webbookstart(str){
	var MinimumExplorerVersion = 5;
	var MinimumResolutionWidth = 1024;
	var BrowName = navigator.appName;var BrowVer =  navigator.appVersion;
	if(BrowName=="Microsoft Internet Explorer"){
		if(BrowVer.substring(BrowVer.indexOf("MSIE ")+5,BrowVer.indexOf("MSIE ")+6) >= MinimumExplorerVersion){
			if(screen.width >= MinimumResolutionWidth){
				window.open(str,"","scrollbars,width=1016,height=710");
			}
			else{
				alert("webBookÀº È­¸éÇØ»óµµ 1024¡¿768 ÀÌ»ó¿¡¼­¸¸ µ¿ÀÛÇÕ´Ï´Ù.\n\nwebBookÀ» »ç¿ëÇÏ½Ã·Á¸é È­¸é ÇØ»óµµ¸¦ Á¶Á¤ÇÏ½Å ÈÄ ÀçÁ¢¼ÓÇØ ÁÖ½Ã±â¹Ù¶ø´Ï´Ù.");
			}
		}
		else{
			alert("webBookÀº ÀÎÅÍ³Ý ÀÍ½ºÇÃ·Î·¯ 5.0ÀÌ»ó¿¡¼­¸¸ µ¿ÀÛÇÕ´Ï´Ù.\n\nwebBookÀ» »ç¿ëÇÏ½Ã·Á¸é ÀÎÅÍ³Ý ÀÍ½ºÇÃ·Î·¯5.0ÀÌ»ó ¹öÀüÀ¸·Î ¾÷±×·¹ÀÌµå ÇÑÈÄ Á¢¼ÓÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
		}
	}
	else{
		alert("webBookÀº ÀÎÅÍ³Ý ÀÍ½ºÇÃ·Î·¯¿¡¼­¸¸ µ¿ÀÛÇÕ´Ï´Ù.\n\nwebBookÀ» »ç¿ëÇÏ½Ã·Á¸é ÀÎÅÍ³Ý ÀÍ½ºÇÃ·Î·¯·Î Á¢¼ÓÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
	}
	return;
}

//ÇØ´ç ´Þ·Â ºÎ¸£±â
function calendar(leftpx, toppx, dateid, yyyymm,e){
  if ( leftpx == "" ){
    var pos = abspos(e);
    leftpx = pos.x;
    toppx = pos.y;
  }
 	var qstr = Object.toQueryString( {leftpx: leftpx, toppx: toppx, yyyymm: yyyymm, dateid: dateid} );
	var url = "/komn/comm/include/calendar.asp?" + qstr;
	new Ajax(url, {
		method: 'get',
		onComplete: this.viewcalender1.bind(this)
	}).request();
}

//´Þ·Â ´Ý±â
function calendar_close(){
  $("mn_calendar").setStyle("display","none");
}

//´Þ·Â°ü·Ã ÇÔ¼ö - ´Þ·Â ÀÏÀÚ °ª³Ö±â
function setcalendar(dateid,datevalue){
  $(dateid).value = datevalue;
  calendar_close();
}

//ÇØ´ç ¿ù ´Þ·Â »ý¼ºÇÏ±â
function viewcalender(data, xml){
	var item = xml.getElementsByTagName("item")[0];
	var list = item.getElementsByTagName("list");
	
	var view = item.getElementsByTagName("view")[0].firstChild.nodeValue;
	var leftpx = item.getElementsByTagName("leftpx")[0].firstChild.nodeValue;
	var toppx = item.getElementsByTagName("toppx")[0].firstChild.nodeValue;
	var dateid = item.getElementsByTagName("dateid")[0].firstChild.nodeValue;
	var before_yyyymm = item.getElementsByTagName("before_yyyymm")[0].firstChild.nodeValue;
	var after_yyyymm = item.getElementsByTagName("after_yyyymm")[0].firstChild.nodeValue;
	var summary_title = item.getElementsByTagName("summary_title")[0].firstChild.nodeValue;
	$("mn_calendar").innerHTML = "";
	if (view == "Y"){
	  $("mn_calendar").setStyle("display","");
	  $("mn_calendar").setStyle("left",leftpx);
	  $("mn_calendar").setStyle("top",toppx);
	  $("mn_calendar").innerHTML = "<a href='javascript:calendar_close();' class='btn_close'>CLOSE</a>";
	  $("mn_calendar").innerHTML += "<table border='0'  cellpadding='0' cellspacing='0' class='mn_calendar' summary=" + summary_title + ">";
	  $("mn_calendar").innerHTML += "<caption>";
	  $("mn_calendar").innerHTML += "<a href=javascript:calendar('" + leftpx + "','" + toppx + "','" + dateid + "','" + before_yyyymm + "'); class='btn_calendar_left'>¢¸</a>";
	  $("mn_calendar").innerHTML += "<strong>" + summary_title+ "</strong>";
	  $("mn_calendar").innerHTML += "<a href=javascript:calendar('" + leftpx + "','" + toppx + "','" + dateid + "','" + after_yyyymm + "'); class='btn_calendar_right'>¢º</a>";
	  $("mn_calendar").innerHTML += "</caption>";
	  $("mn_calendar").innerHTML += "<thead>";
	  $("mn_calendar").innerHTML += "<tr>";
	  $("mn_calendar").innerHTML += "<th>ÀÏ</th>";
	  $("mn_calendar").innerHTML += "<th>¿ù</th>";
	  $("mn_calendar").innerHTML += "<th>È­</th>";
	  $("mn_calendar").innerHTML += "<th>¼ö</th>";
	  $("mn_calendar").innerHTML += "<th>¸ñ</th>";
	  $("mn_calendar").innerHTML += "<th>±Ý</th>";
	  $("mn_calendar").innerHTML += "<th>Åä</th>";
	  $("mn_calendar").innerHTML += "</tr>";
	  $("mn_calendar").innerHTML += "</thead>";	  
	  $("mn_calendar").innerHTML += "<tbody>";
	  if(list.length > 0) {
		  var j=list.length;
		  for(var i=0; i<j; i++){
			  var tr_date = list[i].getElementsByTagName("tr_date")[0].firstChild.nodeValue; 		
			  
  			$("mn_calendar").innerHTML += tr_date ;
		  }
	  }
	
	  $("mn_calendar").innerHTML += "</tbody>";
	  $("mn_calendar").innerHTML += "</table>";
	}else{
	  $("mn_calendar").setStyle("display","none");
	}	
}

function viewcalender1(data, xml){
	var item = xml.getElementsByTagName("item")[0];
	var list = item.getElementsByTagName("list");
	
	var view = item.getElementsByTagName("view")[0].firstChild.nodeValue;
	var leftpx = item.getElementsByTagName("leftpx")[0].firstChild.nodeValue;
	var toppx = item.getElementsByTagName("toppx")[0].firstChild.nodeValue;
	var dateid = item.getElementsByTagName("dateid")[0].firstChild.nodeValue;
	var before_yyyymm = item.getElementsByTagName("before_yyyymm")[0].firstChild.nodeValue;
	var after_yyyymm = item.getElementsByTagName("after_yyyymm")[0].firstChild.nodeValue;
	var summary_title = item.getElementsByTagName("summary_title")[0].firstChild.nodeValue;
	$("mn_calendar").innerHTML = "";
	if (view == "Y"){
	  $("calendar_wrap").setStyle("display","");
	  $("calendar_wrap").setStyle("left",leftpx);
	  $("calendar_wrap").setStyle("top",toppx);
	  
	}else{
	  $("calendar_wrap").setStyle("display","none");
	}	
}

// Å¬¸¯ ÀÌº¥Æ®°¡ ¹ß»ýÇÑ ¹Ù·Î ±× À§Ä¡
function abspos(e){  
  var event = e || window.event;
  this.x = event.pageX || event.clientX;
  this.y = event.pageY || event.clientY;
	return this; 
}

// Ã·ºÎÆÄÀÏ Ã£±â
function getFileClick(index, gubun){
	var qstr = Object.toQueryString( {index: index, gubun: gubun} );
	//var url = "/ko_comm/inc/getFileClick.asp?" + qstr;
	var url = "/ko_comm/inc/down.asp?" + qstr;
	//location.reload(url);
	location.href(url);
}

// Ã·ºÎÆÄÀÏ ºÎ¸£±â
function setFielClick(data, xml){
  
	var item = xml.getElementsByTagName("item")[0];
	var linkurl = item.getElementsByTagName("linkurl")[0].firstChild.nodeValue;
	var tf = item.getElementsByTagName("tf")[0].firstChild.nodeValue;
	var endName = item.getElementsByTagName("endName")[0].firstChild.nodeValue;
	
	if (tf == "T"){
	  /*
	  if ( endName == "hwp" ) {
	    var url = "/ko_comm/inc/down.asp?linkurl="+linkurl;
	    location.href(linkurl);
	  }else{
	    window.open(linkurl, "", "");
		}
		*/
		var url = "/ko_comm/inc/down.asp?linkurl="+linkurl;
	  location.href(url);
	  
	}else{
	  alert("ÀÚ·á°¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù.");
	}
	
}

//  Ã¼Å©¹Ú½º °è¿­ Ã¼Å©
function checkedRadioButton(input) {
    if (input.length > 1) {
        for (var inx = 0; inx < input.length; inx++) {
            if (input[inx].checked) return true;
        }
    } else {
        if (input.checked) return true;
    }
    return false;
}

//  Ã¼Å©¹Ú½º °è¿­ Ã¼Å©
function checkedRadioButtonCnt(input) {
    var cnt;
    cnt = 0 ;
    if (input.length > 1) {
        for (var inx = 0; inx < input.length; inx++) {
            if (input[inx].checked) cnt +=1 ;
        }
    } else {
        if (input.checked) cnt = 1;
    }
    return cnt;
}

// ¿¢¼¿Ãâ·Â
function SendExcel(url,name,left,top,width,height,toolbar,menubar,statusbar,scrollbar,resizable)
{
	toolbar_str = toolbar ? 'yes' : 'no';
	menubar_str = menubar ? 'yes' : 'no';
	statusbar_str = statusbar ? 'yes' : 'no';
	scrollbar_str = scrollbar ? 'yes' : 'no';
	resizable_str = resizable ? 'yes' : 'no';
	window.open(url,name,'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

//·Î±×ÀÎ
function mainlogin() {
	var form = document.loginform;
	
	if(!form.topid.value.trim()){
		alert('ID¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.');
		form.topid.focus();
		return;
	}
	
	if(!form.toppw.value.trim()){
		alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.');
		form.toppw.focus();
		return;
	}
	//form.prepage.value = escape(document.referrer);
	form.prepage.value = document.referrer;
	form.action = "/member/mypage/loginOK.asp"
	form.submit();
}

function mainloginPress() {
  var knum = setKeycode(event);
  
	if(knum == 13)
	{
		mainlogin()
	}
}


function memberprintDiv () { 
  
  try{
    var chk = objSelection.innerHTML;
    if (document.all && window.print) { 
      window.onbeforeprint = koitabeforeDivs; 
      window.onafterprint = afterDivs; 
      window.print(); 
    }
  }catch(e){
    
  }
  
} 

function memberbeforeDivs () { 
  
  try{
    if (document.all) { 
      wrap.style.display = 'none'; 
      objSelection.innerHTML = document.all['content'].innerHTML; 
    }
  }catch(e){
    
  } 
  
} 

function koitaprintDiv () { 
  try{
    var chk = objSelection.innerHTML;
    if (document.all && window.print) { 
      window.onbeforeprint = koitabeforeDivs; 
      window.onafterprint = afterDivs; 
      window.print(); 
    }
  }catch(e){
    
  } 
} 

function koitabeforeDivs () { 
  
  try{
    if (document.all) { 
      wrap.style.display = 'none'; 
//      objSelection.innerHTML = document.all['cont_body'].innerHTML; 
      objSelection.innerHTML = document.all['content'].innerHTML; 
    }
  }catch(e){
    
  } 
   
}

function afterDivs () { 
  
  try{
    if (document.all) { 
      wrap.style.display = 'block'; 
      objSelection.innerHTML = ""; 
    }
  }catch(e){
    
  }  
} 

//¿¬±¸¼Ò ÇÁ¸°Æ®
function ynprintDiv () { 
  try{
    var chk = objSelection.innerHTML;
    if (document.all && window.print) { 
      window.onbeforeprint = ynbeforeDivs; 
      window.onafterprint = ynafterDivs; 
      window.print(); 
    }
  }catch(e){
    
  } 
} 

function ynbeforeDivs () { 
  
  try{
    if (document.all) { 
      CONTENTS.style.display = 'none'; 
      objSelection.innerHTML = document.all['column-a'].innerHTML; 
    }
  }catch(e){
    
  } 
   
}

function ynafterDivs () { 
  
  try{
    if (document.all) { 
      CONTENTS.style.display = 'block'; 
      objSelection.innerHTML = ""; 
    }
  }catch(e){
    
  }  
} 


function koitafullmenu(mtype){
  if ( mtype == "open" ){
    
   	$("fullmenu").setProperties({
			"class": "skip" 					
		});
		
		 $("fullmenu_open").setProperties({
			"class": "" 					
		});
				
  }else{
  
    $("fullmenu_open").setProperties({
			"class": "skip" 					
		});
		
		$("fullmenu").setProperties({
			"class": "" 					
		});
  
  }
}

function memberfullmenu(mtype){
  if ( mtype == "open" ){
   
    $("fullmenu").setProperties({
			"class": "skip" 					
		});
		 
    $("fullmenuOpen").setProperties({
			"class": "" 					
		});
		
				
  }else{
  
    $("fullmenuOpen").setProperties({
			"class": "skip" 					
		});
		
		$("fullmenu").setProperties({
			"class": "" 					
		});
  
  }
}

function ynfullmenu(mtype){
  if ( mtype == "open" ){
    /*
    $("globalNavigation").setProperties({
			"class": "skip" 					
		});
		*/
		$("globalNavigation").innerHTML = "";
    $("fullmenuOpen").setProperties({
			"class": "" 					
		});
				
  }else{
  
    $("fullmenuOpen").setProperties({
			"class": "skip" 					
		});
		
		$("globalNavigation").innerHTML = "<h2><a href=javascript:ynfullmenu('open');><img src='/institute/images/common/btn_menudrop.gif' alt='»çÀÌÆ® ÀüÃ¼ ¸Þ´º' /></a></h2>";
		/*
		$("globalNavigation").setProperties({
			"class": "" 					
		});
		*/
  
  }
}


function getCookie(name) { 
	var from_idx = document.cookie.indexOf(name+'='); 
	if (from_idx != -1) { 
		from_idx += name.length + 1 
		to_idx = document.cookie.indexOf(';', from_idx) 
		if (to_idx == -1) { 
			to_idx = document.cookie.length 
		} 
		return unescape(document.cookie.substring(from_idx, to_idx)) 
	} 
}

function setCookie(name, value)
{
  var todayDate = new Date();
  todayDate.setHours(23); 
  todayDate.setMinutes(59);
  todayDate.setSeconds(59);
  document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
}



// +, - Å°¸¦ ÀÔ·ÂÇÏ¸é È­¸é È®´ë, Ãà¼Ò¸¦ ÇÑ´Ù.

/* ºñÀ²È®´ë
*/
function zoomIn(ptype) {
  
  try{
    
    newZoom = parseInt(wrap.style.zoom)+2+'%'
    if ( ptype == "koita" ) {
      
      //main_container.style.zoom = newZoom;
      //container_wrap.style.zoom = newZoom;
      wrap.style.zoom = newZoom;
      
    }else if ( ptype == "member" ) {
      wrap.style.zoom = newZoom;
    }else if ( ptype == "yn" ) {
    }else if ( ptype == "eng" ) {
    }
    setCookie("fontsize", newZoom);
  }catch(e){
    
  } 
}
 
function zoomOut(ptype) {
  try{
    newZoom = parseInt(wrap.style.zoom)-2+'%'
    if ( ptype == "koita" ) {
      
      //main_container.style.zoom = newZoom;
      //container_wrap.style.zoom = newZoom;
      wrap.style.zoom = newZoom;
      
    }else if ( ptype == "member" ) {
      wrap.style.zoom = newZoom;
    }else if ( ptype == "yn" ) {
    }else if ( ptype == "eng" ) {
    }
    setCookie("fontsize", newZoom);
  }catch(e){
    
  } 
} 

function zoomset(ptype){
	
	try{
    var fontsize = getCookie("fontsize");
    if (fontsize==""){
		  fontsize = "100%";
	  }
	  if ( ptype == "koita" ) {
      wrap.style.zoom = fontsize;
    }else if ( ptype == "member" ) {
      wrap.style.zoom = fontsize;
    }else if ( ptype == "yn" ) {
    }else if ( ptype == "eng" ) {
    }
	  
  }catch(e){
    //wrap.style.zoom = "100%";
  } 
}

function zoomreset(ptype){
  if ( ptype == "koita" ) {
    //main_container.style.zoom = "100%";
    //container_wrap.style.zoom = "100%";
    //mainwrap.style.zoom = "100%";
    wrap.style.zoom = "100%";
  }else if ( ptype == "member" ) {
    wrap.style.zoom = "100%";
  }else if ( ptype == "yn" ) {
  }else if ( ptype == "eng" ) {
  }
  setCookie("fontsize", "100%");
}


function fontup(ptype){
  try{
	  var fontsize = getCookie("mfontsize");
	  if (fontsize == "" || fontsize == "NaN"){
		  fontsize = 12;
	  }
	  fontsize = Number(fontsize) + 1;
	  
	  if (fontsize > 50) fontsize = 50;
  	
	  setCookie("mfontsize", fontsize);
	  
  	if ( ptype == "koita" ) {
	    $("cont_body").setStyle("font-size", fontsize + "px");
	    $("cont_body").setStyle("line-height","normal");
	  }else if ( ptype == "member" ) {
	    $("content").setStyle("font-size", fontsize + "px");
	    $("content").setStyle("line-height","normal");
	  }else if ( ptype == "yn" ) {
	    $("CONTENTS").setStyle("font-size", fontsize + "px");
	    $("CONTENTS").setStyle("line-height","normal");
	  }
	}catch(e){
    
  } 
}
 
function fontdown(ptype){
  try{
	  var fontsize = getCookie("mfontsize");
	  if (fontsize == "" || fontsize == "NaN"){
		  fontsize = 12;
	  }
  	
	  fontsize = Number(fontsize) - 1;
	  if (fontsize < 8) fontsize = 8;
  	
	  setCookie("mfontsize", fontsize);
	  
	  if ( ptype == "koita" ) {
	    $("cont_body").setStyle("font-size", fontsize + "px");
	    $("cont_body").setStyle("line-height","normal");
	  }else if ( ptype == "member" ) {
	    $("content").setStyle("font-size", fontsize + "px");
	    $("content").setStyle("line-height","normal");
	  }else if ( ptype == "yn" ) {
	    $("CONTENTS").setStyle("font-size", fontsize + "px");
	    $("CONTENTS").setStyle("line-height","normal");
	  }
	  
	}catch(e){
    
  } 
}

function fontreset(ptype){
  try{
	  setCookie("mfontsize", "NaN");
  	if ( ptype == "koita" ) {
	    $("cont_body").setStyle("font-size","");
	    $("cont_body").setStyle("line-height","");
	  }else if ( ptype == "member" ) {
	    $("content").setStyle("font-size","");
	    $("content").setStyle("line-height","");
	  }else if ( ptype == "yn" ) {
	    $("CONTENTS").setStyle("font-size","");
	    $("CONTENTS").setStyle("line-height","");
	  }
	}catch(e){
    
  } 
	
}

function fontset(ptype){
	
	try{
	  var fontsize = getCookie("mfontsize");
	  
    if (fontsize == "" || fontsize == "NaN"){
		  fontsize = 12;
	  }
	  if ( ptype == "koita" ) {
	    $("cont_body").setStyle("font-size", fontsize + "px");
	  }else if ( ptype == "member" ) {
	    $("content").setStyle("font-size", fontsize + "px");
	  }else if ( ptype == "yn" ) {
	    $("CONTENTS").setStyle("font-size", fontsize + "px");
	  }else{
	    $("cont_body").setStyle("font-size", fontsize + "px");
	  }
  }catch(e){
    
  } 
}

function initNavigation(seq) {
	var nav = document.getElementById("topmenu");
	nav.menu = new Array();
	nav.current = null;
	nav.menuseq = 0;
	navLen = nav.childNodes.length;
	
	allA = nav.getElementsByTagName("a");
	for(k = 0; k < allA.length; k++) {

		allA.item(k).onmouseover = allA.item(k).onfocus = function () {
			nav.isOver = true;
		}
		allA.item(k).onmouseout = allA.item(k).onblur = function () {
			nav.isOver = false;
			//alert(event.button);
			setTimeout(function () {
				if (nav.isOver == false) {
					if (nav.menu[seq]) {
						nav.menu[seq].onmouseover();	
					} else if(nav.current) {			
						if( seq != 0)
						this.current.parentNode.className = this.current.parentNode.className.replace(" over","");						
						if (nav.current.submenu)						
							nav.current.submenu.style.display = "none";
						nav.current = null;					
					}
				}
			}, 300);
		}
	}

	for (i = 0; i < navLen; i++) {
		navItem = nav.childNodes.item(i);
		if (navItem.tagName != "LI")
			continue;

		  navAnchor = navItem.getElementsByTagName("a").item(0);
		  navAnchor.submenu = navItem.getElementsByTagName("ul").item(0);
  		
		  navAnchor.onmouseover = navAnchor.onfocus = function () {
			if (nav.current) {		
				if( seq !=0)
				nav.current.parentNode.className = nav.current.parentNode.className.replace(" over","");			
				if (nav.current.submenu)				
					nav.current.submenu.style.display = "none";
				nav.current = null;
			}
			
			if (nav.current != this) {
				if( seq !=0)
		      this.submenu.parentNode.className +=" over";			
				if (this.submenu)		{						
					this.submenu.style.display = "block";
				}
				nav.current = this;
			}
			nav.isOver = true;
		}
		nav.menuseq++;
		nav.menu[nav.menuseq] = navAnchor;
	}
	if (nav.menu[seq])
		nav.menu[seq].onmouseover();
}

function trbgcolor(ptype, is){
	try{
	  if ( ptype == "over" ) {
	    is.style.backgroundColor='#EFEFEF';
	  }else if ( ptype == "out" ) {
	    is.style.backgroundColor='#FFFFFF';
	  }
  }catch(e){
    
  } 
}

function boardbgcolor(ptype, id){
	try{
	  if ( ptype == "over" ) {
	    $("tr_id_"+id).setStyle("backgroundColor", "#EFEFEF");
	  }else if ( ptype == "out" ) {
	    $("tr_id_"+id).setStyle("backgroundColor", "#FFFFFF");
	  }
  }catch(e){
    
  } 
}


//¿¹Àü±³À°½ÅÃ»
function openEduRegOtherTeam(selidx) {
	var urlpath;
	
	urlpath= '/member/education/pop_edu_step1.asp?seq='+selidx+'&chk_on=O';
	window.open(urlpath,"eduregwindow","height=520,width=647, menubar=no,directories=no,resizable=no,status=no,scrollbars=yes,top=10,left=10");
}

//±³À°½ÅÃ»
function openEdu(selidx) {
	var urlpath;
	
	urlpath= '/member/education/pop_edu_step1.asp?seq='+selidx+'&chk_on=N';
	window.open(urlpath,"eduregwindow","height=520,width=647, menubar=no,directories=no,resizable=no,status=no,scrollbars=yes,top=10,left=10");
}

//¹è³Ê Å¬¸¯
function clickBanner(tnum){
	var qstr = Object.toQueryString( {tnum: tnum} );
	var url = "/ko_comm/inc/banner.asp?" + qstr;
	
	new Ajax(url, {
		method: 'get',
		onComplete: this.moveBanner.bind(this)
	}).request();
}

function moveBanner(data, xml){
	var item = xml.getElementsByTagName("item")[0];
	var sb = item.getElementsByTagName("target_sb")[0].firstChild.nodeValue;
	var url = item.getElementsByTagName("url")[0].firstChild.nodeValue;
	
	if ( sb == "S" ) {
	  location.href (url);
	}else{
	  window.open(url);
	}
}
//¹è³Ê Å¬¸¯

//È¸Àå,ºÎÈ¸Àå,ÀÓ¿ø ÆË¾÷

function organization_chair(tcode)
{
  var url = '/koita/popup/popup_9201.html';
  var w = "450";
  var h = "370";
  if ( tcode == "01" ) {  //È¸Àå
    url = '/koita/popup/popup_9201.html';
  }else if ( tcode == "02" ) {  //ºÎÈ¸Àå
    url = '/koita/popup/popup_9202.html';
  }else if ( tcode == "03" ) {  //ÇÑÀÌ»ç
    h = "320";
    url = '/koita/popup/popup_9203.html';
  }else if ( tcode == "04" ) {  //±èÀÌ»ç
    url = '/koita/popup/popup_9204.html';
	h = "320";
  }
  
	var win=window.open(url,'organization_chair','width='+w+',height='+h+', menubar=no,directories=no,resizable=no,status=no,scrollbars=no');
	win.focus();
}

