//document.title = "1µîÀ½Áú/1À§À½¿ø¼ö/À½¾ÇÀåÅÍ±îÁö - Å¥ÆÃ";
document.title = "À½¾ÇÀÌ Èå¸£´Â ¼¼»ó - Å¥ÆÃ";
var tel_key_code=Array("010","011","016","017","018","019","02","031","032","033","041","042","043","051","052","053","054","061","062","063","064","ÇØ¿Ü");



/***** Moving Banner(Right) Start *****/

self.onError=null;
currentX = currentY = 0; 
whichIt = null; 
lastScrollX = 0; lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;

function floatBanner()
{
	try{
	
	if(IE)
	{ 
		diffY = document.body.scrollTop; 
		diffX = 0; 
	}
	
	if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
	
	if(diffY != lastScrollY)
	{
		percent = .1 * (diffY - lastScrollY);
		if(percent > 0) percent = Math.ceil(percent);
		else percent = Math.floor(percent);
		if(IE) document.all.floater1.style.pixelTop += percent;
		//if(IE) document.all.floater2.style.pixelTop += percent;
		if(NS) document.floater1.top += percent; 
		//if(NS) document.floater2.top += percent; 
		lastScrollY = lastScrollY + percent;
	}
	
	if(diffX != lastScrollX)
	{
		percent = .1 * (diffX - lastScrollX);
		if(percent > 0) percent = Math.ceil(percent);
		else percent = Math.floor(percent);
		//if(IE) document.all.floater1.style.pixelLeft += percent;
		if(IE) document.all.floater1.style.pixelLeft = 950;
		//if(IE) document.all.floater2.style.pixelLeft += percent;
		if(NS) document.floater1.top += percent;
		//if(NS) document.floater2.top += percent;
		lastScrollY = lastScrollY + percent;
	}
	
	}catch(e){}
}

if(NS || IE) action = window.setInterval("floatBanner()",1);

/***** Moving Banner(Right) End *****/
 
 
/***** Paging Start *****/ 
function pageGo(groupNo, pageNo)
{
	f1.curPageNo.value  = pageNo;
	f1.curGroupNo.value = groupNo;
	
	f1.submit();
}
/***** Paging End *****/ 


/***** Paging Start *****/ 
function pageGo2(groupNo, pageNo)
{
	f12.curPageNo2.value  = pageNo;
	f12.curGroupNo2.value = groupNo;
	
	f12.submit();
}
/***** Paging End *****/ 


/***** Paging Start *****/ 
function pageGo_Comm(groupNo, pageNo)
{
	f1.cmnt_curPageNo.value  = pageNo;
	f1.cmnt_curGroupNo.value = groupNo;
	
	f1.submit();
}
/***** Paging End *****/ 


/***** nPang Player ¼³Ä¡¿©ºÎ *****/
/*
function nPangInstallCheck()
{
	var result;
	try
	{
		result = IMWI2.IsInstalled("nPang", "http://www.nter10.com/player/npang.ini");
		//result = IMWI2.IsInstalled("nPang", "http://dev.nter10.com/player/npang.ini");
		
		if( result != 0 )
		{
			if( confirm("PangÀ» ¾÷±×·¹ÀÌµå ÇØ¾ß ¼­ºñ½º¸¦ ÀÌ¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù..!\n\n¾÷±×·¹ÀÌµå ÇÏ½Ã°Ú½À´Ï±î?") )
			{
				result = IMWI2.InstallModule("nPang", "nPang", "http://www.nter10.com/player/npang.ini");
				//result = IMWI2.InstallModule("nPang", "nPang", "http://dev.nter10.com/player/npang.ini");
				//alert(result);
				result = IMWI2.IsInstalled("nPang", "http://www.nter10.com/player/npang.ini");
				
				if( result != 0 )
				{
					alert("nPang ¾÷±×·¹ÀÌµå°¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù..! ´Ù½Ã ½ÃµµÇÏ¼¼¿ä. \n\n(°è¼Ó ½ÇÆÐÇÒ °æ¿ì 1:1 »ó´ã°Ô½ÃÆÇ¿¡ ¹®ÀÇ ¹Ù¶ø´Ï´Ù.)");
					return false;
				}
			}
			else
				return false;
		}
	}
	catch(e)
	{
		alert("Active-X¸¦ ¼³Ä¡ÇØ¾ß ¼­ºñ½º ÀÌ¿ëÀÌ °¡´ÉÇÕ´Ï´Ù..!");
		return false;
	}
	
	return true;
}
*/

function hangul_check(data)
{
   for(var i = 0; i < data.length; i++)
	{
		 var chr = data.substr(i,1); 
		 chr = escape(chr); 

		 if (chr.charAt(1) == "u")
		 {
			  chr = chr.substr(2, (chr.length - 1)); 
			  if ((chr < "AC00") || (chr > "D7A3"))
			  {
					 return -1;
			  }
			  else
			  {
					return 0;
			  }
		 }
		 else
		 {
			  return -1;
		 } 
	}
   return 0;
}

function IsUserID(data)
{
   if (data.length < 3 || data.length > 15)
   {
		     return false;
   }

   for(var i = 0; i < data.length; i++)
   {
		     var chr = data.substr(i,1);         
       if ((chr < '0' || chr > '9') && (chr < 'a' || chr > 'z') && (chr < 'A' || chr > 'Z'))
       {
		          return false;
       }
   }
   return true;   
}   

function IsUserPassWD(data)
{
   if (data.length < 6 || data.length > 12)
   {
		     return false;
   }

   for(var i = 0; i < data.length; i++)
   {
		     var chr = data.substr(i,1);         
       if ((chr < '0' || chr > '9') && (chr < 'a' || chr > 'z') && (chr < 'A' || chr > 'Z'))
       {
		          return false;
       }
   }
   return true;   
}   

function IsNumber(data)
{
   for(var i = 0; i < data.length; i++)
   {
     		var chr = data.substr(i,1);
       if ((chr < '0' || chr > '9') && chr!='.')
       {
        			return false;
       }
   }
	  return true;
}

function IsSSNCheck(data1,data2) 
{
   var max_day=new Array("31","28","31","30","31","30","31","31","30","31","30","31");
   var check_digit=new Array(2,3,4,5,6,7,8,9,2,3,4,5);
   var id_no=data1+data2;

   var imsi_year=eval(id_no.substring(0,2))+1900;
   var imsi_month=eval(id_no.substring(2,4));
   var imsi_day=eval(id_no.substring(4,6));

   // ³âµµ Ã¼Å©
   if (((imsi_year%4)==0) && ((imsi_year%100)!=0) || ((imsi_year%400)==0)) 
   {
        max_day[1]="29";
   }
   else
   {
        max_day[1]="28";
   }
 
   // »ý¿ù Ã¼Å©
   if (imsi_month<1 || imsi_month>12)
   {
       return -1;
   }

   // »ýÀÏ Ã¼Å©
   if (imsi_day<1 || imsi_day>max_day[imsi_month-1])
   {
       return -1;
   }

   // ¼ºº° Ã¼Å©
   if (data2.substring(0,1)<"1" || data2.substring(0,1)>"6")
   {
       return -1;
   }

   // ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å©
   var sum=0;
   for(var i=0;i<id_no.length-1;i++)
   {
       sum+=check_digit[i]*eval(id_no.substring(i,i+1));
   }

   var id_check=sum%11;
   var id_check=11-id_check;
   var id_check=id_check%11;

   if (id_check!=id_no.substring(12,13))
   {
       return -1;
   }

   return id_no.substring(12,13);
} 

function email_check(mail_str)
{
   var filter=/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
   var url_check=new Array("com","net","org","info","biz","co.kr","pe.kr","or.kr","ne.kr","re.kr","ac.kr",
                           "go.kr","seoul.kr","busan.kr","daegu.kr","incheon.kr","gwangju.kr","daejeon.kr",
                           "ulsan.kr","gyeonggi.kr","gangwon.kr","chungbuk.kr","chungnam.kr",
                           "jeonbuk.kr","jeonnam.kr","gyeongbuk.kr","gyeongnam.kr","jeju.kr");

   if (filter.test(mail_str))
   {
       var imsi_pos=mail_str.indexOf(".");
       var imsi_pos=mail_str.indexOf(".")+1;
       var imsi_str=mail_str.substring(imsi_pos,mail_str.length);

       imsi_check=0;
       for(var i=0;i<url_check.length;i++)
       {
           if (url_check[i]==imsi_str)
           {
               imsi_check=i+1;
           }
       }

       if (imsi_check==0)
       {
           return -1;
       }
       else
       {
           return 0;
       }
   }
   else
   {
       return -1;
   }
}

function errMsg(text)
{ 
   alert(text); 
   history.go(-1);
   return;
} 

function msgBox(text)
{ 
   alert(text); 
   return;
} 

function msgBoxUrl(text,url)
{ 
   alert(text);
   document.location=url;
   return;
} 

var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input, len, e)
{
   var keyCode = (isNN) ? e.which : e.keyCode; 
   var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];

   if (input.value.length >= len && !containsElement(filter,keyCode))
   {
       input.value = input.value.slice(0, len);
       input.form[(getIndex(input)+1) % input.form.length].focus();
   }
}

function containsElement(arr, ele)
{
   var found = false, index = 0;
   while(!found && index < arr.length)
   {
         if (arr[index] == ele)
             found = true;
         else
             index++;
   }
   return found;
}

function getIndex(input)
{
   var index = -1, i = 0, found = false;
   while(i < input.form.length && index == -1)
   {
         if (input.form[i] == input)
             index = i;
         else
             i++;
         return index;
   }
   return true;
}

function download(var1,var2,var3)
{
   document.file_down.table_id.value=var1;
   document.file_down.data_num.value=var2;
   document.file_down.file_no.value=var3;
   document.file_down.submit();
   return;
}

function date_choice(form_name,form_pos)
{
   window.open("/common/calender.php?form_name=" + form_name + "&form_pos=" + form_pos,"date_choice","width=245, height=260, top=5, left=5, resizable=no, scrollbars=no");
   return;
}

function zipcode_search(form_name)
{
   window.open("../common/zipcode_search.php?form_name=" + form_name,"new","width=530, height=440, top=0, left=0, resizable=no, scrollbars=no");
   return;
}

function school_search(flag)
{
   window.open("../common/school_search.php?flag=" + flag,"new","width=530, height=440, top=0, left=0, resizable=no, scrollbars=no");
   return;
}

function board_data_view(data)
{
   window.open("./board_info_view.php?bc_board_title=" + data,"new","width=750, height=500, top=5, left=5, resizable=no, scrollbars=yes");
   return;
}

function popup_image_view(fold,data)
{
   window.open("../common/popup_image_view.php?img_fold=" + fold + "&img_data=" + data,"new","resizable=no, scrollbars=no");
   return;
}

function image_upload(fold_name)
{
			ts = document.getElementsByName("total_attached_size_kb")[0].value;
			window.open("/common/image_upload.php?fold_name=" + fold_name, "image_upload", "width=216,height=230");
}

function send_mail(proc_name,data_src,data,page,memo_page,seek_flag,seek_word)
{
   var proc_url="../common/send_mail_form.php?proc_name=" + proc_name + "&data_src=" + data_src + "&data_num=" + data + "&start=" + page + "&memo_start=" + memo_page + "&seek_flag=" + seek_flag + "&seek_word=" + seek_word;
   window.open(proc_url,"send_mail","width=567, height=475, top=5, left=5, resizable=no, scrollbars=no");
   return;
}

function data_print(table_id,bo_num)
{
   var path_url="../common/data_print.php?table_id=" + table_id + "&data_num=" + bo_num;
   window.open(path_url,"data_print","width=630, height=400, top=5, left=5, resizable=no, scrollbars=1");
   return;
}

function table_id_check()
{
			if (!document.myform.bc_table_id.value)
			{
							alert("Å×ÀÌºí¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä. !!");
							document.myform.bc_table_id.focus();
							document.myform.bc_table_id.select();
							return;	 
			}
			else
			{
							if (!IsUserID(document.myform.bc_table_id.value))
							{
											alert("Å×ÀÌºí¸íÀº ¿µ.¼ýÀÚ 4~10ÀÚÀÌ³»·Î ÀÔ·ÂÇÏ¼¼¿ä. !!");
											document.myform.bc_table_id.focus();
											document.myform.bc_table_id.select();
											return;
							}      
			}
   window.open("../common/table_id_check.php?table_id=" + document.myform.bc_table_id.value,"","width=300,height=200, top=5, left=5, resizable=no, scrollbars=yes");
   return;
}

function calendar(var1)
{
   window.open("../common/calendar.php?chk_pos=" + var1,"","width=250,height=250, top=5, left=5, resizable=no, scrollbars=no");
   return;
}

function id_check()
{
			if (!document.myform.mm_id.value)
			{
							alert("È¸¿øID¸¦ ÀÔ·ÂÇÏ¼¼¿ä. !!");
							document.myform.mm_id.focus();
							document.myform.mm_id.select();
							return;	 
			}
			else
			{
							if (!IsUserID(document.myform.mm_id.value))
							{
											alert("È¸¿øID´Â ¿µ.¼ýÀÚ 4~10ÀÚÀÌ³»·Î ÀÔ·ÂÇÏ¼¼¿ä. !!");
											document.myform.mm_id.focus();
											document.myform.mm_id.select();
											return;
							}      
			}
			window.open("../common/id_check.php?id=" + document.myform.mm_id.value,"new","width=530,height=440, top=5, left=5, resizable=no, scrollbars=no");
   return;
}

function nick_name_check()
{
			if (!document.myform.mm_nick_name.value)
			{
							alert("´Ð³×ÀÓÀ» ÀÔ·ÂÇÏ¼¼¿ä. !!");
							document.myform.mm_nick_name.focus();
							document.myform.mm_nick_name.select();
							return;	 
			}
			window.open("../common/nick_name_check.php?nick_name=" + document.myform.mm_nick_name.value,"new","width=400,height=200, top=5, left=5, resizable=no, scrollbars=no");
   return;
}

function ssn_check()
{
			if (!document.myform.mm_ssn1.value)
			{
							alert("ÁÖ¹Îµî·Ï¹øÈ£(¾Õ6ÀÚ¸®)¸¦ ÀÔ·ÂÇÏ¼¼¿ä. !!");
							document.myform.mm_ssn1.focus();
							return;	 
			}
			if (!document.myform.mm_ssn2.value)
			{
							alert("ÁÖ¹Îµî·Ï¹øÈ£(µÞ7ÀÚ¸®)¸¦ ÀÔ·ÂÇÏ¼¼¿ä. !!");
							document.myform.mm_ssn2.focus();
							return;	 
			}
			if (document.myform.mm_ssn1.value)
			{
							if (!IsNumber(document.myform.mm_ssn1.value))
							{
											alert("ÁÖ¹Îµî·Ï¹øÈ£´Â ¹Ýµå½Ã ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù. !!");
											document.myform.mm_ssn1.focus();
											document.myform.mm_ssn1.select();
											return;
							}
			}      
			if (document.myform.mm_ssn2.value)
			{
							if (!IsNumber(document.myform.mm_ssn2.value))
							{
											alert("ÁÖ¹Îµî·Ï¹øÈ£´Â ¹Ýµå½Ã ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù. !!");
											document.myform.mm_ssn2.focus();
											document.myform.mm_ssn2.select();
											return;
							}
			}
   var check_digit=IsSSNCheck(document.myform.mm_ssn1.value,document.myform.mm_ssn2.value);
			if (check_digit!=document.myform.mm_ssn2.value.substring(6,7) || check_digit==-1)
			{
							alert("À¯È¿ÇÏÁö ¾ÊÀº ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù. !!");
							document.myform.mm_ssn1.focus();
							document.myform.mm_ssn1.select();
							return;
			}	
			window.open("../common/ssn_check.php?ssn1=" + document.myform.mm_ssn1.value + "&ssn2=" + document.myform.mm_ssn2.value,"new","width=400,height=200, top=5, left=5, resizable=no, scrollbars=no");
   return;
}

var newFiles = new Array;
var delFiles = new Array;

function addDelFileList(realname)
{
   delFiles.push(realname);
   document.getElementsByName('del_files')[0].value=delFiles.join('/');
}

function addNewFileList(realname)
{
   newFiles.push(realname);
   document.getElementsByName('new_files')[0].value=newFiles.join('/');    
   rebuildFileInfos();
}

function rebuildFileInfos()
{
   var fileListObj = document.getElementsByName('file_list')[0];
   var fileInfos = new Array();

   for(i=1;i<fileListObj.length;++i)
   {
       var chunk = fileListObj.options[i].value.split(':');
       fileInfos[i-1] = chunk[0]+':'+chunk[1]+':'+chunk[2];
   }

   document.getElementsByName('file_infos')[0].value = fileInfos.join('/');
}

function delNewFileList(realname)
{
   var index;

   for(i=0;i<newFiles.length;i++)
   {
       if (newFiles[i]==realname)
       {
           index=i;
           break;
       }
   }

   for(i=index;i<newFiles.length-1;i++)
   {
       newFiles[i]=newFiles[i+1];
   }

   newFiles.pop();
   document.getElementsByName('new_files')[0].value=newFiles.join('/');
}

function addFileList(showname, size, realname)
{
   var sizeObj = document.getElementsByName('total_attached_size_kb')[0];
   var fileListObj = document.getElementsByName('file_list')[0];
   sizeObj.value = eval(sizeObj.value)+eval(size);
   fileListObj[fileListObj.length] = new Option(showname+'   '+size+'KB',size+':'+showname+':'+realname+':new');
   addNewFileList(realname);
}

function addNewFileList(realname)
{
   newFiles.push(realname);
   document.getElementsByName('new_files')[0].value=newFiles.join('/');  
   rebuildFileInfos();
}

function delFileList()
{
   var sizeObj=document.getElementsByName('total_attached_size_kb')[0];
   var fileListObj=document.getElementsByName('file_list')[0];
   var idx = fileListObj.selectedIndex;

   if (idx == 0)
   {
       alert("»èÁ¦ÇÏ½Ç ÆÄÀÏÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä. !!!");
       return;
   }

   var objValue = fileListObj.options[idx].value.split(':');
   var delSize = objValue[0];
   var showname = objValue[1];
   var realname = objValue[2];
   var type = objValue[3];

   delNewFileList(realname);
   addDelFileList(realname);

   sizeObj.value = eval(sizeObj.value)-eval(delSize);
   fileListObj.options[idx] = null;

   rebuildFileInfos();
}

function changemode()
{
  	if (document.myform.edit_type[1].checked == true)
       var sMode = "text";
  	else
       var sMode = "html";

  	if (sMode=="text")
  	{
     		//¿¡µðÅÍ
							MyEditor.disableEditBar(0);

    			MyEditor.htmlContents.value = MyEditor.tbContentElement.DOM.body.innerHTML;
							document.all.MyEditor.height = "320";
	  }
  	else
  	{
							MyEditor.disableEditBar(1);

     		if (MyEditor.htmlContents.value != "")
     		{
        			MyEditor.tbContentElement.DOM.body.innerHTML = MyEditor.htmlContents.value;
     		}
	  }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function notice_list()
{
   document.location="../events/events_01.php?table_id=notice";
   return;
}

var htmlString = "";
var wait_flag=true, wait_imageflag=true, mouseOver=1;
var i=0, j=0, count=1, temp=0;
var scrollSpeed=1;	     // Scrolling ¼Óµµ
var scrollDelay=2500;		// ±â»ç°£ ¸ØÃß´Â ½Ã°£
var height=20;			      // ½ºÅ©·Ñ ¿µ¿ª ¼¼·Î Å©±â
var s_amount=20;	     	// 1È¸ ½ºÅ©·Ñ »çÀÌÁî
var content_text1=new Array(), content_image1=new Array();

function startText()
{
	  for(i=0;i<content_text1.length;i++) textArea(i);
  	window.setTimeout("news_scroll()",scrollDelay);
}

function news_scroll()		// ´º½º ½ºÅ©·Ñ
{
	  var oElement;

  	if (navigator.appName == "Microsoft Internet Explorer")
   {
		     if (navigator.appVersion.indexOf("MSIE 4")>-1)	return;
  	}

  	if (mouseOver && wait_flag)
   {
		     for(i=0;i<content_text1.length;i++)
       {
        			if (temp==0 && wait_imageflag)
           {
           				for(j=0;j<content_image1.length;j++)
               {
              					oElement = document.getElementById('image_area'+j).style;
              					if (count % content_image1.length == j)
                   {
                 						oElement.display = '';
              					}
                   else
                   {
                 						oElement.display = 'none';
              					}
           				}
           				wait_imageflag=false;
           				count++;
           }
           temp++;
           oElement = document.getElementById('text_area'+i).style;
           oElement.top = parseInt(oElement.top)-scrollSpeed;
           if (parseInt(oElement.top) <= height*(-1))
           {
           				oElement.top = height*(content_text1.length-1);
        			}
        			if (temp>(s_amount-1)*content_text1.length)
           {
           				wait_flag=false;
           				temp=0;
           				window.setTimeout("wait_flag=true;temp=0;wait_imageflag=true;",scrollDelay);
        			}
       }
   }
   window.setTimeout("news_scroll()",1);
}

function textArea(i)
{
	  htmlString='<div style="left: 0px; width: 250px; position: absolute; top: '+(height*i+1)+'px" id="text_area'+i+'">\n';
  	htmlString+=content_text1[i]+'\n'+'</div>\n';
  	document.write(htmlString);
}

var htmlString2 = "";
var wait_flag2=true, wait_imageflag2=true, mouseOver2=1;
var i2=0, j2=0, count2=1, temp2=0;
var scrollSpeed2=0;	     // Scrolling ¼Óµµ
var scrollDelay2=2500; 		// ±â»ç°£ ¸ØÃß´Â ½Ã°£
var height2=20;			       // ½ºÅ©·Ñ ¿µ¿ª ¼¼·Î Å©±â
var s_amount2=20;	     	 // 1È¸ ½ºÅ©·Ñ »çÀÌÁî
var content_text2=new Array(), content_image2=new Array();

function startText2()
{
	  for(i2=0;i2<content_text2.length;i2++) textArea2(i2);
  	window.setTimeout("news_scroll2()",scrollDelay2);
}

function news_scroll2()		// ´º½º ½ºÅ©·Ñ
{
	  var oElement2;

  	if (navigator.appName == "Microsoft Internet Explorer")
   {
		     if (navigator.appVersion.indexOf("MSIE 4")>-1)	return;
  	}

  	if (mouseOver2 && wait_flag2)
   {
		     for(i2=0;i2<content_text2.length;i2++)
       {
        			if (temp2==0 && wait_imageflag2)
           {
           				for(j2=0;j2<content_image2.length;j2++)
               {
              					oElement2 = document.getElementById('image_area2'+j2).style;
              					if (count2 % content_image2.length == j2)
                   {
                 						oElement2.display = '';
              					}
                   else
                   {
                 						oElement2.display = 'none';
              					}
           				}
           				wait_imageflag2=false;
           				count2++;
           }
           temp2++;
           oElement2 = document.getElementById('text_area2'+i2).style;
           oElement2.top = parseInt(oElement2.top)-scrollSpeed2;
           if (parseInt(oElement2.top) <= height2*(-1))
           {
           				oElement2.top = height2*(content_text2.length-1);
        			}
        			if (temp2>(s_amount2-1)*content_text2.length)
           {
           				wait_flag2=false;
           				temp2=0;
           				window.setTimeout("wait_flag2=true;temp2=0;wait_imageflag2=true;",scrollDelay2);
        			}
       }
   }
   window.setTimeout("news_scroll2()",1);
}

function textArea2(i2)
{
	  htmlString2='<div style="left: 0px; width: 146px; position: absolute; top: '+(height2*i2+1)+'px" id="text_area2'+i2+'">\n';
  	htmlString2+=content_text2[i2]+'\n'+'</div>\n';
  	document.write(htmlString2);
}

function search_form_check()
{
   if (document.main_search_form.main_search_text.value=="")
   {
       alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
       document.main_search_form.main_search_text.focus();
       return;
   }
   document.main_search_form.submit();
   return;
}

function pop_win(location,width,height)
{
   sx = (screen.width - width)/2;
   sy = (screen.height - height)/2-25;

   a_win = window.open(location,"popwin", "width=" + width + ",height=" + height + ",top=" + sy + ",left=" + sx + ",resizable=no,scrollbars=yes");
   a_win.focus();
   return;
}

function pop_win1(url,width,height,scr)
{
	  sx = (screen.width - width)/2;
  	sy = (screen.height - height)/2-25;

   if (scr=="" || scr=="no")
   {
       a_win=window.open(url,"popwin", "width=" + width + ",height=" + height + ",top=" + sy + ",left=" + sx + ",resizable=no,scrollbars=no");
       a_win.focus();
   }
   else if (scr=="yes")
   {
       a_win=window.open(url,"popwin", "width=" + width + ",height=" + height + ",top=" + sy + ",left=" + sx + ",resizable=no,scrollbars=yes");
       a_win.focus();
   }
   return;
}

var today, year, month, day, hours, minutes, seconds;

function gettime()
{
   today = new Date();

   year = today.getYear();
   month =  today.getMonth();
   month = month + 1;

   day = today.getDate();
   hours = today.getHours();
   minutes = today.getMinutes();
   seconds = today.getSeconds();
}

var each_hh, each_dd;
function timeSet(zone)
{
   gettime();

   each_hh = parseInt(hours) + parseInt(zone);
   each_dd = day;
   if (each_hh < 0)
   {
       each_hh = each_hh + 24;
       each_dd = each_dd - 1;
   }
   if (each_hh > 23)
   {
       each_hh = each_hh - 24;
       each_dd = each_dd + 1;
   }

   if (each_hh < 10) each_hh = "0"+each_hh;
   if (minutes < 10) minutes = "0"+minutes;
   if (seconds < 10) seconds = "0"+seconds;
   if (each_dd < 10) each_dd = "0"+each_dd;
}

function citytime()
{
   timeSet(0);
   document.clock.seoul.value= each_hh + ":" + minutes + ":" + seconds+"("+each_dd+"ÀÏ)";

   z = document.clock.w_timediff.value;
   timeSet(z);
   document.clock.washington.value= each_hh + ":" + minutes + ":" + seconds+"("+each_dd+"ÀÏ)";

   z = document.clock.v_timediff.value;
   timeSet(z);
   document.clock.vancouver.value= each_hh + ":" + minutes + ":" + seconds+"("+each_dd+"ÀÏ)";

   z = document.clock.m_timediff.value;
   timeSet(z);
   document.clock.moscow.value= each_hh + ":" + minutes + ":" + seconds+"("+each_dd+"ÀÏ)";

   z = document.clock.a_timediff.value;
   timeSet(z);
   document.clock.auckland.value= each_hh + ":" + minutes + ":" + seconds+"("+each_dd+"ÀÏ)";

   setTimeout("citytime()", 1000);
}

function hidestatus()
{ 
   window.status='' //»óÅÂÇ¥½ÃÁÙÀÇ ³»¿ëÀ» Áö¿î´Ù.
   return true 
} 

if (document.layers) 
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT) 
document.onmouseover=hidestatus //¸¶¿ì½º¸¦ ¿Ã·Á³õ¾ÒÀ»¶§ hidestatus()ÇÔ¼ö¸¦ Àû¿ëÇÑ´Ù.
document.onmouseout=hidestatus  //¸¶¿ì½º°¡ ¸µÅ©¿¡¼­ ¹þ¾î³µÀ»¶§µµ hidestatus()ÇÔ¼ö¸¦ Àû¿ëÇÑ´Ù.

function callme(image)
{ 
   img.filters[0].Apply(); 
   img.src=image; 
   img.filters[0].Play(); 
} 

function TSlinkrotation()
{
   this.addLink = addLink;
   this.rotateLink = rotateLink;
   this.start = function() {
                if (document.all || document.getElementById)
                        setInterval(this.objName+'.rotateLink()', this.refreshTime);
        }
}

function RandomRotation(refreshTime, divName) {
        this.linklist = new Array();
        this.objName = "linkrotation" + (TSlinkrotation.id++);
        eval(this.objName + "=this");
        this.refreshTime = refreshTime * 1000;
    this.divName = divName;
    this.setCurrentIndex = function() {
        var n;

        do {
            n = Math.floor(Math.random() * (this.linklist.length - 1));
        }
        while ( n == this.currentIndex);

        this.currentIndex = n;
    }

    
}

RandomRotation.prototype = new TSlinkrotation;

function NormalRotation(refreshTime, divName) {

        this.linklist = new Array();
        this.objName = "linkrotation" + (TSlinkrotation.id++);
        eval(this.objName + "=this");
        this.refreshTime = refreshTime * 1000;
    this.divName = divName;
    this.currentIndex = -1;
    this.setCurrentIndex = function() {
        if (this.currentIndex >= this.linklist.length - 1)
            this.currentIndex = 0;
        else this.currentIndex++;
    }
}

NormalRotation.prototype = new TSlinkrotation;

function addLink(link) {
        this.linklist[this.linklist.length] = link;
}

function rotateLink() {
    this.setCurrentIndex();
    if (document.getElementById && document.createRange) {
        var range = document.createRange();
        var div = document.getElementById(this.divName);
        range.setStartBefore(div);
        var currentLink = range.createContextualFragment(this.linklist[this.currentIndex]);
        while (div.hasChildNodes())
            div.removeChild(div.lastChild);
        div.appendChild(currentLink);
    }


    else if (document.all) {
        eval('document.all.'+this.divName+'.innerHTML = this.linklist[this.currentIndex]');
    }
}

TSlinkrotation.id = 0; 

function lo2sopen(page,opt){
  window.open(page,"",opt);
  }


function goto_page(num)
{
   switch(num)
   {
          case "6":
                document.location="../index.php?dir=company&view=company_01";
                break;
          case "5":
                document.location="../index.php?dir=academy&view=academy_search";
                break;
          case "4":
                document.location="../index.php?dir=quiz&view=quiz_guide";
                break;
          case "3":
                document.location="../index.php?dir=shop&view=product_list";
                break;
          case "2":
                document.location="../index.php?dir=community&view=community";
                break;
          case "1":
                document.location="../index.php?dir=event&view=photo_fest";
                break;
          case "0":
                document.location="../index.php";
                break;
   }
}

function school_info1(sido)
{
}

function school_info2(sido,gugun)
{
   document.location="../index.php?dir=academy&view=academy_search&sido=" + sido + "&gugun=" + gugun;
   return;
}

function notice_setCookie(name, value, expiredays)
{
   var todayDate = new Date();

   todayDate.setDate(todayDate.getDate() + expiredays);
   document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function notice_closeWin() 
{
   if (document.forms[0].Notice.checked) 
       notice_setCookie( "Notice", "done" , 1); // 1=ÇÏ·íµ¿¾È °øÁöÃ¢ ¿­Áö ¾ÊÀ½
   self.close(); 
}

function fnOpenPopup(url,left,top,width,height)
{
	window.open(url,"","left="+left+",top="+top+",width="+width+",height="+height+",scrollbars=yes");
}

var _resizeInterval;
function resizeIframe() {
	_resizeInterval=setInterval('resizeContentWindow()', 200);
}
function resizeContentWindow() {
	if (window.frameElement && document && document.body && document.body.scrollHeight) {
		window.frameElement.style.height=document.body.scrollHeight;
		if (parent && parent.frames[window.frameElement.name] && parent.resizeContentWindow)
			parent.resizeContentWindow();
	}
	if (document.readyState == 'complete')
		clearTimeout(_resizeInterval);
}






// ÆË¾÷Ã¢ °ü¸® °ü·Ã
var POPUP_REGISTRY = null;			// µî·ÏµÈ ÆË¾÷ °´Ã¼ ¹è¿­
function Popup_RegisterPopup(popupObject)
{
	if (POPUP_REGISTRY == null)
		POPUP_REGISTRY = new Array();
	if (popupObject != null)
		POPUP_REGISTRY[POPUP_REGISTRY.length] = popupObject;
}
function Popup_ShowPopup()
{
	if (POPUP_REGISTRY != null)
	{
		for (var i = 0; i < POPUP_REGISTRY.length; i++)
		{
			if (POPUP_REGISTRY[i] != null)
				POPUP_REGISTRY[i].show();
		}
	}
}
function PopupObject(name, url, width, height)
{
	this.name	= (name == null)? "popup": name;
	this.url	= (url == null)? "about:blank": url;
	this.width	= (width == null)? 300: width;
	this.height	= (height == null)? 400: height;
	this.top	= null;
	this.left	= null;
	this.scroll	= null;
	this.resize	= null;
	this.showFrom	= null;
	this.showTo		= null;

	this.open = PopupObject_Open;
	this.show = PopupObject_Show;
}
function PopupObject_Open()
{
	var feature = "width=" + this.width;
	feature += ",height=" + this.height;
	if (this.top != null)
		feature += ",top=" + this.top;
	if (this.left != null)
		feature += ",left=" + this.left;
	if (this.scroll != null)
		feature += ",scrollbars=" + this.scroll;
	if (this.resize != null)
		feature += ",resizable=" + this.resize;
	return window.open(this.url, this.name, feature);
}
function PopupObject_Show()
{
	// °Ô½Ã ±â°£ÀÌ ¼³Á¤µÇ¾ú´Ù¸é
	if (this.showFrom != null && this.showTo != null)
	{
		var now = new Date();
		if (this.showFrom.valueOf() > now.valueOf() || this.showTo.valueOf() < now.valueOf())
			return false;
	}

	// ÄíÅ°°¡ ¼³Á¤µÇ¾ú´Ù¸é
	if (GetCookie(this.name) == 'nothanks')
		return false;

	return this.open();
}

// ÄíÅ° °ü·Ã
var COOKIE = null;					// ºÐ¼®µÈ ÄíÅ° ¹è¿­
function GetCookie(cookie_name)
{
	if (COOKIE == null)
	{
		COOKIE = new Array();
		var s = String(document.cookie);
		var a = s.split(/\s*;\s*/);
		for (i = 0; i < a.length; i++)
		{
			var b = a[i].split(/\s*=\s*/);
			if (b[1] != null && b[1] != "")
				COOKIE[b[0]] = unescape(b[1]);
		}
	}
	return COOKIE[cookie_name];
}
function Popup_SetCookie(name, value, expire_time)
{
	if (expire_time == null)
		expire_time = 24;		// 1ÀÏ
	var today = new Date();
	today.setHours(today.getHours() + expire_time);
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";";
}


function inputColorSet(colorObj,colorFlag)
{
	if(colorFlag == 1)
	{
		colorObj.style.color="#333333";
		colorObj.style.cursor="hand";
	}
	else
	{
		colorObj.style.color="#333333";
	}
}

function trColorChage(trColorObj,trColor)
{
	trColorObj.style.backgroundColor=trColor;
}

function myAlbum(mode,con_id,con_type)
{
	var sess_qry = (window.sessionID) ? "&sess_id="+sessionID: "";
	var myAlbumOpen = window.open("/main/myAlbum/myAlbumReg.php?mode="+mode+"&con_id="+con_id+"&con_type="+con_type+sess_qry,"myAlbum","width=781,height=554");
	myAlbumOpen.focus();
}

function albumNameSet(name,flag) {
	var tagName = eval(name);
	for(i=0;i<tagName.options.length;i++) {
		if(tagName.options[i].value == flag)
		{
			//tagName.options[i].selected = true;
			document.getElementById("folder_name").innerHTML = "<img src='/images/myAlbum/star_icon.gif' width='9' height='9'><strong> "+tagName.options[i].text+"</strong>";
			//tagName.options[i] = null;
		}
	}
}

// ¹ÂÁ÷ºñµð¿À ÇÃ·¹ÀÌ¾î 1.1
function videoPlayer_1_1(songList,mode) {
	url="/miniPlayer/VideoPlayer2.1.php?songid="+songList+"&mode="+mode;
	var videoPlayer = window.open(url,'videoView','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width=810,height=523,scrollbars=no');
	videoPlayer.focus();
}

// ¹ÂÁ÷ºñµð¿À ÇÃ·¹ÀÌ¾î 2.2
function videoPlayer_2_2(songList,mode) {
	var sess_qry = (window.sessionID) ? "&sess_id="+sessionID: "";
	url="/miniPlayer/VideoPlayer2.2.php?songid="+songList+"&mode="+mode+sess_qry;
	var videoPlayer = window.open(url,'videoView','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width=810,height=523,scrollbars=no');
	videoPlayer.focus();
}

// °øÅë µ¡±Û ÀÔ·Â
function globalCmntInsert(f,jobSect,id)
{
	if(jobSect == 1)
	{
		// f : Æû ÀÌ¸§
		if(!f.comment.value)
		{
			alert("µ¡±Û ³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä!");
			f.comment.focus();
			return;
		}
		f.target = "cmnt_work";
		f.action = "/main/cmnt/CmntProcess.php?jobSect="+jobSect;
		f.submit();
	}
	else
	{
		// iframe ÀÌ¸§
		if(confirm("µ¡±ÛÀ» »èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?")==false) return;
		f.location = "/main/cmnt/CmntProcess.php?commentID="+id+"&jobSect="+jobSect;
	}
}

// °¡»ç º¸±â
function lyricView(id)
{
	url = "/main/common/LyricViewer.php?piece_id="+id;
	var lyricViewer = window.open(url,'lyricView','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,width=450,height=533,scrollbars=no');
	lyricViewer.focus();
}

//iframe Å©±â Á¶Àý
function resizeFrame(iframeObj){
        var innerBody = iframeObj.contentWindow.document.body;
        oldEvent = innerBody.onclick;
        innerBody.onclick = function(){ resizeFrame(iframeObj, 1);oldEvent; };
        var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight);
        iframeObj.style.height = innerHeight;
        var innerWidth = innerBody.scrollWidth + (innerBody.offsetWidth - innerBody.clientWidth);
        iframeObj.style.width = innerWidth;     
        if( !arguments[1] )        /* Æ¯Á¤ ÀÌº¥Æ®·Î ÀÎÇÑ È£Ãâ½Ã ½ºÅ©·ÑÀ» ±×³É µÐ´Ù. */
                this.scrollTo(1,1);
}








// basic  --- ÀåÀ±¼±Ãß°¡ 2008.3.10 
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->