function frmopen(str) {
document.getElementById('frm').src=str;
}

function myopen(str) {
window.open(str, "win1", "width=700, height=550, Fullwindow=yes, left=0, top=0");
}

function toggleMenu(mn) {
document.getElementById(mn).style.display = 'none';
}

function bookmark() {
	if ( (navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4) && (navigator.userAgent.toLowerCase().indexOf("win") != -1) ) {
		window.external.AddFavorite(location.href, document.title);
	} else {
		alert("To bookmark this page, click \"OK\" below    \nand then press Control-D on your keyboard.\n(Macintosh users press Command-D.)");
	}
	return false;
}

  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 category_change(obj) {
  var myindex=obj.selectedIndex;
  document.search.category.value=obj.options[myindex].value;
  document.search.submit();
  return true;
 }

function img_check() {
	var max_img_width = 510;
	if (!document.pic_resize) {
		return;
	}
	if (!document.pic_resize.length) {
		if (document.pic_resize.width > max_img_width) {
			document.pic_resize.width = max_img_width;
		}
		return;
	}
	var pic_resize_num = document.pic_resize.length;
	for(i=0;i<pic_resize_num;i++){
		if(document.pic_resize[i].width > max_img_width) {
			document.pic_resize[i].width = max_img_width;
		}
	}
}

function openImage(imgUrl, width, height)
{
	//
	var imgInfo = new Image();

    imgInfo.src = imgUrl;
    imgWidth = imgInfo.width + 16;
    imgHeight = imgInfo.height + 24; 

	//
	x = Math.round((screen.width - imgWidth) / 2);
	y = Math.round((screen.height - imgHeight) / 2);

	window.open(imgUrl,'image_view','width=' + imgWidth + ',height=' + imgHeight + 'left='+x+',top='+y+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no');
}

function flashWrite(url,w,h,id,bg,win){

	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<embed src='"+url+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";

	document.write(flashStr);
}
