<!--
function init(param){
  var iText = Content.document;
  iText.designMode = "On";
  Content.document.open();
  Content.document.write("<style> p {margin-top:0px;margin-bottom:0px;} body {font-size:10pt; font-family:µ¸¿ò;} </style>");
  Content.document.close();

  if (param == "edit")
  {
	TextEditView.style.display="inline";
	writeForm.style.display="none";
	Content.document.write ("<style> p {margin-top:0px;margin-bottom:0px;} body {font-size:10pt; font-family:µ¸¿ò;}</style>"+ writeForm.Contents.value);
	Content.focus();
  }

  TextEditView.style.display="inline";
}

function btnUp(param) {
  param.style.border="1px outset";
  param.style.background="#D4D4D4";
}

function btnDn(param) {
  param.style.border="";
  param.style.background="#D4D4D4";
}

function CommandExec(Btn, cmd) {
  Content.focus();
  var EdRange = Content.document.selection.createRange();
  EdRange.execCommand(cmd);

	//ÀÔ·Â¹ÞÀº °ª
	if (EdRange.parentElement().tagName=="A")
	{
		var A_value = EdRange.parentElement().href;
	}

	//»õÃ¢À¸·Î ÁöÁ¤
	var oAnchors = Content.document.all.tags("A");

	if (oAnchors != null)
	{
		for (var i = oAnchors.length - 1; i >= 0; i--)
		{
			if (oAnchors[i].href == A_value && oAnchors[i].target=="")
			{
				oAnchors[i].target="_blank";
			}
		}
	}
}

function changeFC(param,cmd){
  var ed
  ed = Content.document.selection.createRange();
  ed.execCommand(cmd, false, param);
}

function changeFN_FS(o, cmd) {
  var ed=Content.document.selection.createRange();
  ed.execCommand(cmd, false, o.value);
}

function insSmile(){
  Content.focus();
  str=showModalDialog('edit_board/Smile.html', 0, 'dialogWidth:500px; dialogHeight:340px;status:0;scroll:1; help:0;');
  if (str)
    Content.document.selection.createRange().pasteHTML(str);
}

function insTable(){
  Content.focus();
  str=showModalDialog('edit_board/insTable.php', 0, 'dialogWidth:550px; dialogHeight:500px;status:0;scroll:0; help:0;');
  if (str)
    Content.document.selection.createRange().pasteHTML(str);
}

function chMode(text) {
  var strPos = writeForm.currentMode.value;
  if (text == 0) {  // ÆíÁýÈ­¸é  
  	if (strPos == 1){		
		Preview.innerHTML = writeForm.Contents.value;
	    Content.document.body.innerHTML = writeForm.Contents.value;
		}

		TextMode.style.display = 'inline';
		TextMenuView.style.display = 'inline';
		
    writeForm.currentMode.value=0;
    htmlView.style.display="none";
    Preview.style.display="none";
    TextEditView.style.display="inline";
  }
  else if (text == 1) {  // html º¸±â
  	TextMode.style.display = 'none';
		TextMenuView.style.display = 'none';
	
    writeForm.currentMode.value=1;
    writeForm.Contents.value = Content.document.body.innerHTML;
    TextEditView.style.display="none";
    Preview.style.display="none";
    htmlView.style.display="inline";
  }
  else if (text == 2) {  // ¹Ì¸®º¸±â
    if (strPos == 0) {
      Preview.innerHTML = Content.document.body.innerHTML;
      writeForm.Contents.value = Content.document.body.innerHTML;
    }
    else if (strPos == 1) {
      Preview.innerHTML = writeForm.Contents.value;
      Content.document.body.innerHTML = writeForm.Contents.value;
    }
  	TextMode.style.display = 'none';
		TextMenuView.style.display = 'none';
	
    TextEditView.style.display="none";
    htmlView.style.display="none";
    Preview.style.display="inline";
  }
}

function ReturnList(where) {
  history.back();
}

//-->

var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");
function CheckUIElements(){
        var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;

        if ( bNetscape4plus ) { 
                yMenuFrom   = document["gotop"].top;
                yMenuTo     = top.pageYOffset + 500; 
        }
        else if ( bExplorer4plus ) {
                yMenuFrom   = parseInt (gotop.style.top, 10);
                yMenuTo     = document.body.scrollTop + 500; 
        }

        timeoutNextCheck = 10;

        if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
                setTimeout ("CheckUIElements()", timeoutNextCheck);
                return;
        }

        if ( yButtonFrom != yButtonTo ) {
                yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 3 );
                if ( yButtonTo < yButtonFrom )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["divLinkButton"].top += yOffset;
                else if ( bExplorer4plus )
                        divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }
        if ( yMenuFrom != yMenuTo ) {
                yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 3 );
                if ( yMenuTo < yMenuFrom )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["gotop"].top += yOffset;
                else if ( bExplorer4plus )
                        gotop.style.top = parseInt (gotop.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }

        setTimeout ("CheckUIElements()", timeoutNextCheck);
}

function OnLoad()
{
        var y;
        if ( top.frames.length )
        if ( bNetscape4plus ) {
                document["gotop"].top = top.pageYOffset ;
                document["gotop"].visibility = "visible";
        }
        else if ( bExplorer4plus ) {
                gotop.style.top = document.body.scrollTop ;
                gotop.style.visibility = "visible";
        }
        CheckUIElements();
        return true;
}

function openUp( ) {
	var window_left = (screen.width-380)/2;
	var window_top = (screen.height-500)/2;   
	window.open('upimg.php?code=<?=$code?>','img_win','toolbar=no,location=no,directories=no, status=no,menubar=no,resizable=no,scrolling=yes,width=400,height=200,top=' + window_top + ',left=' + window_left);
} 

function check(code, page, number, fid, keyfield, key){
	var window_left = (screen.width-380)/2;
	var window_top = (screen.height-500)/2;   
	var url = 'check_ok.php?code='+code+'&page='+page+'&number='+number+'&fid='+fid+'&keyfield='+keyfield+'&key='+key; 
	window.open(url,'Check', 'width=200,height=130,scrollbars=no,resizeable=no,top=' + window_top + ',left=' + window_left + '');
}

function reply_del(code, page, number, keyfield, key, del_num, direct){
	var window_left = (screen.width-380)/2;
	var window_top = (screen.height-500)/2;   
	var url = '../board/check_ok.php?code='+code+'&page='+page+'&number='+number+'&keyfield='+keyfield+'&key='+key+'&del_num='+del_num+'&re_mode=del'+'&direct='+direct;
	window.open(url,'Check', 'width=200,height=130,scrollbars=no,resizeable=no,top=' + window_top + ',left=' + window_left + '');
}

function music_off(){
	document.all.music_on.style.display="inline";
	document.all.music_off.style.display="none";
	top.frames['bottomFrame'].music_stop();
}

function music_on(){
	document.all.music_on.style.display="none";
	document.all.music_off.style.display="inline";
	top.frames['bottomFrame'].music_play();
}

function visit(mode,number,page){ // Guest
	var window_left = (screen.width-500)/2;
	var window_top = (screen.height-200)/2;    
	window.open('visit_process.php?mode='+mode+'&number='+number+'&page='+page,'visit','width=500, height=200, scrollbars=no, top=' + window_top + ',left=' + window_left + '');
}