//°øÅë URL º¯¼ö
var pTxt = location.host;
var pTxtArr = pTxt.split(".");
var xx = pTxtArr.length-1;
if(pTxtArr[xx] == "kr") {
	var html_server = "http://"+pTxtArr[0]+".qting.co.kr";
} else {
	var html_server = "http://"+pTxtArr[0]+".qting.com";
}

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","ÇØ¿Ü");

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'))
       if ((chr < '0' || chr > '9') && (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=/^([A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*)@((?:\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 sc_check(sc_str)
{
	for (var i=0; i < sc_str.length; i++) 
	{
		var ch_char = sc_str.charAt(i);	

		var ch = ch_char.charCodeAt();
		
		if(ch >= 33 && ch <= 39) 
		{
			return -1;
		}
	}
	return 0;
}

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+",scroll=yes");
}

var _resizeInterval;
function resizeIframe()
{
	_resizeInterval=setInterval('resizeContentWindow()', 1);
}

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);
}

function popup_buy(market_id,ret_url)
{
	window.open("/main/market/PBuyInstant.php?retUrl="+ret_url+"&market_id="+market_id,"buy","width=480, height=300, top=0, left=0, resizable=no, scrollbars=no");
   	return;
}

function no_buy_msg()
{
   alert("ÆÇ¸Å±â°£ÀÌ Áö³ª¼­ ±¸¸ÅÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
   return;
}

function login_msgbox()
{
   alert("·Î±×ÀÎÀ» ¸ÕÀúÇÏ¼¼¿ä. !!");
   return;
}
