function OnOff(name) {
if(((init == "net")&&(browserVer >=3))||((init == "ie")&&(browserVer >= 4))) {
  if(document.search[name].value=='on')
  {
   document.search[name].value='off';
   ImgSrc=eval(name+"_off.src");
   document[name].src=ImgSrc;
  }
  else
  {
   document.search[name].value='on';
   ImgSrc=eval(name+"_on.src");
   document[name].src=ImgSrc;
  }
 }
}

 function reverse() {
   var i, chked=0;
   if(confirm('¸ñ·ÏÀ» ¹ÝÀüÇÏ½Ã°Ú½À´Ï±î?\n\n¹ÝÀüÀ» ¿øÇÏÁö ¾Ê´Â´Ù¸é Ãë¼Ò¸¦ ´©¸£½Ã¸é ´ÙÀ½À¸·Î ³Ñ¾î°©´Ï´Ù'))
   {
    for(i=0;i<document.list.length;i++)
    {
     if(document.list[i].type=='checkbox')
     {
      if(document.list[i].checked) { document.list[i].checked=false; }
      else { document.list[i].checked=true; }
     }
    }
   }
   for(i=0;i<document.list.length;i++)
   {
    if(document.list[i].type=='checkbox')
    {
     if(document.list[i].checked) chked=1;
    }
   }
   if(chked) {
    if(confirm('¼±ÅÃµÈ Ç×¸ñÀ» º¸½Ã°Ú½À´Ï±î?'))
     {
      document.list.selected.value='';
      document.list.exec.value='view_all';
      for(i=0;i<document.list.length;i++)
      {
       if(document.list[i].type=='checkbox')
       {
        if(document.list[i].checked)
        {
         document.list.selected.value=document.list[i].value+';'+document.list.selected.value;
        }
       }
      }
      document.list.submit();
      return true;
     }
    }
   }

 function delete_all(id) {
  var i, chked=0;
  for(i=0;i<document.list.length;i++)
  {
   if(document.list[i].type=='checkbox')
   {
    if(document.list[i].checked) chked=1;
    }
   }
  if(chked)
  {
    document.list.selected.value='';
    document.list.exec.value='delete_all';
    for(i=0;i<document.list.length;i++)
    {
     if(document.list[i].type=='checkbox')
     {
      if(document.list[i].checked)
      {
       document.list.selected.value=document.list[i].value+';'+document.list.selected.value;
      }
     }
    }
    window.open("select_list_all.php?id="+id+"&selected="+document.list.selected.value,"°Ô½Ã¹°Á¤¸®","width=260,height=180,toolbars=no,resize=no,scrollbars=no");
  }
  else {alert('Á¤¸®ÇÒ °Ô½Ã¹°À» ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿ä');}
 }

 function category_change(obj) {
  var myindex=obj.selectedIndex;
  document.search.category.value=obj.options[myindex].value;
  document.search.submit();
  return true;
 }

function view_comment(id, parent, page) {
	var url='view_comment.php?parent='+parent+'&id='+id+'&page='+page;
	var opt='width=600,height=500,scrollbars=yes,toolbars=no,location=no,directories=no,status=no,menubar=no,resizable=no,left=100,top=100,copyhistory=yes';
		window.open(url, 'comments_'+parent, opt);
}

function view_emblem(imgstr, e)
{
	var x, y;

	if(e)
	{
		x = e.pageX+50;
		y = e.pageY-50;
	}
	else
	{
		x = event.x+document.body.scrollLeft + 50;
		y = event.y+document.body.scrollTop - 50;
	}

	document.getElementById('show_emblem').style.top = y+"px";
	document.getElementById('show_emblem').style.left = x+"px";

	if(imgstr!="justmove")
		document.getElementById('show_emblem').innerHTML = "<img src="+imgstr+" border=0 align=absmiddle>";

	if(document.getElementById('show_emblem').style.visibility!="visible")
		document.getElementById('show_emblem').style.visibility = "visible";
}


function vote_article(voteType, no, id, member_no)
{
	exe_frame.location.href="vote_new.php?type="+voteType+"&no="+no+"&id="+id+"&member_no="+member_no;
}

function clearField(field){
	if (field.value == field.defaultValue) {
	field.value = '';
	}
}

function write_emoticon(e_num)
{
	clearField(memo)
	memo.value += "[emoticon_"+e_num+"]";
}


function delete_new(no, id, c_no, skin, d_target)
{
	exe_frame.location.href="delete_new_ok.php?parent="+no+"&id="+id+"&no="+c_no+"&skin="+skin+"&d_target="+d_target;
}

function onclick_submit(no, id, skin, memo, d_target)
{
	write_comment.target = "exe_frame";
	write_comment.action = "comment_new_ok.php";
	write_comment.parent.value = no;
	write_comment.id.value = id;
	write_comment.skin.value = skin;
	write_comment.memo.value = memo.value;
	write_comment.d_target.value = d_target;
	write_comment.submit();

	memo.value = '';

	write_comment.target = '';
}

function anony_report(board, article_no, reporter)
{
	window.open("anony_report.php?board="+board+"&article_no="+article_no+"&reporter="+reporter, "accuse", "width=400,height=150");
}

function scrap(board, article_no, member_no)
{
	exe_frame.location.href = "scrap.php?board="+board+"&article_no="+article_no+"&member_no="+member_no;
}

function show_banner()
{
	tok = document.getElementById('tok1');

	if(tok)
		tok.innerHTML = '<iframe src="http://pann.nate.com/jsp/tok_ticker.jsp?type=3&ndr_id=1" frameborder="0" width="414" height="37" scrolling="no"></iframe>';

	tok = document.getElementById('tok2');

	if(tok)
		tok.innerHTML = '<iframe frameborder=0 src="http://pann.nate.com/jsp/tok_ticker.jsp?type=5&ndr_id=1&w_len=121" width=121 height=288 scrolling=no></iframe>';
}

function check_comment_submit(obj) 
{
	if(obj.memo.value.length<5) {
		alert("ÄÚ¸àÆ®´Â 6ÀÚ ÀÌ»ó Àû¾îÁÖ¼¼¿ä");
		obj.memo.focus();
		return false;
	}
	return true;
}

function show(o)
{
	if(o.style.visibility=='hidden')
		o.style.visibility = 'visible';
	else
		o.style.visibility = 'hidden';
}

function change_commenter(c, member_no)
{
	document.getElementById('commenter').innerHTML = c.innerHTML;
	commenter_list.style.visibility = 'hidden';

	document.getElementById('member_to').value = member_no;
}

function zb_img_check(){
	var zb_main_table_width = document.zb_get_table_width.width;
	var zb_target_resize_num = document.zb_target_resize.length;
	for(i=0;i<zb_target_resize_num;i++){ 
		if(document.zb_target_resize[i].width > zb_main_table_width) {
			document.zb_target_resize[i].width = zb_main_table_width;
		}
	}
}
