// ¾ÆÀÌº¸µå ±Ûº¸±â ÇÔ¼ö
function iboard_view(id,no,targetname,iwidth,iheight) {
	var topvalue = window.screenTop;
	var leftvalue = window.screenLeft+100;
	window.open('yhbiboard.php?iboard_id='+id+'&ino='+no,targetname,'left='+leftvalue+',top='+topvalue+',width='+iwidth+',height='+iheight+',toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	}

function ifileview(url) {
	var topvalue = window.screenTop;
	var leftvalue = window.screenLeft+100;
	var WindowScroll = 'scrollbars=no,resizable=no';
	nowimg = new Image();
	nowimg.src = url;
	var imgwidth = nowimg.width;
	var imgheight = nowimg.height;
	if(!imgwidth) {
		imgwidth = 400;
		var WindowScroll = 'scrollbars=yes,resizable=yes';
		}
	if(!imgheight) {
		imgheight = 400;
		var WindowScroll = 'scrollbars=yes,resizable=yes';
		}
	now = window.open('','PhotoView','left='+leftvalue+',top='+topvalue+',width='+imgwidth+',height='+imgheight+',menubar=no,toolbar=no,status=no,'+WindowScroll);
	now.document.write("<title>»çÁøº¸±â</title>");
	now.document.write("<body leftmargin=0 marginwidth=0 topmargin=0 marginheight=0>");
	now.document.write("<img id=zoomimg onclick='window.close();' src="+url+" title='Ã¢À»´Ý½À´Ï´Ù.' style=cursor:hand;filters.blendTrans.play;>");
	now.document.write("</body>");
	}
	
function iBigSize(naimg) {
	var topvalue = window.screenTop;
	var leftvalue = window.screenLeft+100;
	var WindowScroll = 'scrollbars=no,resizable=no';
	nowimg = new Image();
	nowimg.src = naimg.src;
	var imgwidth = nowimg.width;
	var imgheight = nowimg.height;
	if(!imgwidth) {
		imgwidth = 400;
		var WindowScroll = 'scrollbars=yes,resizable=yes';
		}
	if(!imgheight) {
		imgheight = 400;
		var WindowScroll = 'scrollbars=yes,resizable=yes';
		}
	now = window.open('','PhotoView','left='+leftvalue+',top='+topvalue+',width='+imgwidth+',height='+imgheight+',menubar=no,toolbar=no,status=no,'+WindowScroll);
	now.document.write("<title>»çÁøº¸±â</title>");
	now.document.write("<body leftmargin=0 marginwidth=0 topmargin=0 marginheight=0>");
	now.document.write("<img id=zoomimg onclick='window.close();' src="+nowimg.src+" title='Ã¢À»´Ý½À´Ï´Ù.' style=cursor:hand;filters.blendTrans.play;>");
	now.document.write("</body>");
	}
// ÀÌ¹ÌÁö »çÀÌÁî Á¶Á¤
function ImageResize(myImage,resizes) {
	var newImage = new Image();
	newImage.src = myImage.src;
	if(newImage.width>resizes) myImage.width = resizes;
	else myImage.width = newImage.width;
	}

// ±Û Ä¿Æ® ÇÔ¼ö
function cutStr(str,limit) {
  var tmpStr = str;
  var byte_count = 0;
  var len = str.length;
  var dot = "";
  for (i = 0 ; i < len ; i++ ) {
    byte_count += chr_byte(str.charAt(i));
    if(byte_count == limit-1){
      if(chr_byte(str.charAt(i+1)) == 2){
        tmpStr = str.substring(0,i+1);
        dot = "...";
      }else {
        if(i+2 != len) dot = "..";
        tmpStr = str.substring(0,i+2);
      }
      break;
    }else if(byte_count == limit){
      if(i+1 != len) dot = "..";
      tmpStr = str.substring(0,i+1);
      break;
    }
  }
  document.writeln(tmpStr+dot);
  return true;
}

function chr_byte(chr){
  if(escape(chr).length > 4)
    return 2;
  else
    return 1;
}

