
// 2005-09-03
// F5¸¦ ´­·¶À»¶§ iframe ³»ºÎ¸¸ refresh µÇµµ·Ï Ã³¸®
document.onkeydown = trapRefresh;
function trapRefresh()
{
	if (event.keyCode == 116)
	{
		event.keyCode = 0; 
		event.cancelBubble = true; 
		event.returnValue = false;
		//document.location.reload();
	}
}


function reSize()
{
	    var ParentFrame	    =	prwebboard.document.body;
	    var ContentFrame	=	document.all["prwebboard"];
	    ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight) + 50;
		//ContentFrame.style.width = ParentFrame.scrollWidth + (ParentFrame.offsetWidth - ParentFrame.clientWidth);
		
}

function reSizeF()
{
	    var ParentFrame	    =	prwebboard.document.body;
	    var ContentFrame	=	document.all["prwebboard"];
	    ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
		
}

function reSize0()
{
	    var ParentFrame	    =	prwebboard.document.body;
	    var ContentFrame	=	document.all["prwebboard"];
	    ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
		//ContentFrame.style.width = ParentFrame.scrollWidth + (ParentFrame.offsetWidth - ParentFrame.clientWidth);

		//parent.document.location.href = parent.document.location.href + '#';
}

function reSize2(fno)
{
	    
	    var ParentFrame	    =	eval("CommentFrm" + fno +  ".document.body");
	    var ContentFrame	=	eval("document.all.CommentFrm" +fno);

	    ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
		parent.reSize0();
}

function reSize3(fno)
{
	    
	    var ParentFrame	    =	eval("EventCommentFrm" + fno +  ".document.body");
	    var ContentFrame	=	eval("document.all.EventCommentFrm" +fno);

	    ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
		parent.reSize();
}
function reSize4(obj)
{
	    var ParentFrame	    =	eval(obj+".document.body");
	    var ContentFrame	=	eval("document.all."+obj);
	    ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
}

function paperInit()
{
	    parent.reSize();
	    //parent.document.location.href = '#';
}
function paperInit2()
{
	    parent.reSizeF();
	    //parent.document.location.href = '#';
}
function paperInit_sub(fno)
{
	    parent.reSize2(fno);
	 //parent.document.location.href = parent.document.location.href + '#';
}
function paperInit_eventcomment(fno)
{
	    parent.reSize3(fno);
	 //parent.document.location.href = parent.document.location.href + '#';
}

function strLenCk(str)
{
  var len = 0;
  for (var i=0;i<str.length; i++) {
    var n = str.charCodeAt(i);
    if ((n>= 0)&&(n<256)) {
      len ++;
    } else {
      len += 2;
	}
  }
  return len;
}







function comment_sub(){
		//´ñ±Û ¸®»çÀÌÁî
		parent.document.all["CommentFrm"].style.height = document.body.scrollHeight;
		//self.resizeTo(document.body.scrollWidth+10,document.body.scrollHeight);

		//±Û³»¿ë ¸®»çÀÌÁî [°Ô½ÃÆÇ]
//		parent.self.resizeTo(document.body.scrollWidth,document.body.scrollHeight);
//		parent.prwebboard.document.body.style.height = document.body.scrollHeight;
//	    ContentFrame.style.height = document.all["prwebboard"].scrollHeight + (document.all["prwebboard"].offsetHeight - document.all["prwebboard"].clientHeight);
//		ContentFrame.style.width = ParentFrame.scrollWidth + (ParentFrame.offsetWidth - ParentFrame.clientWidth);
		
		//ÀüÃ¼ ¸®»çÀÌÁî
		parent.comment_parent_resize();

}

function comment_parent_resize(){

	    var ParentFrame	    =	parent.prwebboard.document.body;
	    var ContentFrame	=	parent.document.all["prwebboard"];
	    var AutoHeight = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
		
			if(AutoHeight < 400 ){
			ContentFrame.style.height = 400;
			}
			else{
				ContentFrame.style.height = AutoHeight;
			}
}
function paper2Init()
{
		comment_parent_resize();

}
