

//ÄÚ¸àÆ® »èÁ¦ 
function delComment(home,no,mode,page,id ,parentNo,depth,type){
	if (confirm('»èÁ¦ÇÏ½Ã°Ú½À´Ï±î?')) location.href='/viewfinder/boardFunction.php?mode='+mode+'&type='+type+'&home='+home+'&no='+no+'&page='+page+'&id='+id+'&parent='+parentNo+'&depth='+depth;
	
	
}



//´ñ±Û ÅØ½ºÆ® º¸¿©ÁÖ±â  


function viewPComment(command, no){

	var commandPT = 1;
	var commandPM = 2;
	var commandPI = 3;


	var pText="pText";
	var pModify = 'pModify';
	var pInsert = 'pInsert';

        if(!document.getElementById(pText+no)){ alert('html logic error'); return false;}
        if(!document.getElementById(pModify+no)){ alert('html logic error'); return false;}
        if(!document.getElementById(pInsert+no)){ alert('html logic error'); return false; }


        var pText = document.getElementById(pText+no);
        var pModify = document.getElementById(pModify+no);
        var pInsert = document.getElementById(pInsert+no);



	switch(command){

		case commandPT:
			pText.style.display='block';
			pModify.style.display='none';
			pInsert.style.display='none';		
			PInsertMode = false;
			break;
		case commandPM:
			pText.style.display='none';
			pModify.style.display='block';
			pInsert.style.display='none';		
			PInsertMode = true;
			break;
		case commandPI:
			pText.style.display='block';
			pModify.style.display='none';
			pInsert.style.display='block';		
			PInsertMode = true;
			break;
	}

}

//ÂÊ±Û ÅØ½ºÆ® º¸¿©ÁÖ±â 
function viewCComment(command, no){

	var commandCT = 4;	
	var commandCM = 5;

	var cText='cText';
	var cModify='cModify';

	if(!document.getElementById(cText+no)){ alert('html logic error text'); return false; }
	if(!document.getElementById(cModify+no)){ alert('html logic error modify'); return false; }

        var cText = document.getElementById(cText+no);
        var cModify = document.getElementById(cModify+no);


	switch(command){

		case commandCT:
			cText.style.display='block';
			cModify.style.display='none';
			CInsertMode = false;
			break;
		case commandCM:
			cText.style.display='none';
			cModify.style.display='block';
			CInsertMode = true;
			break;
	}
}

//´ñ±Û ÅØ½ºÆ® º¸¿©ÁÖ±â  

function guestViewText(text, modify, child, cModify){
	if(!document.getElementById(text)) return false; 
	if(!document.getElementById(modify)) return false;
	if(!document.getElementById(child)) return false;
	if(!document.getElementById(cModify)) return false;
	
    	var pText = document.getElementById(text);
        var pModify = document.getElementById(modify);
		var pChild = document.getElementById(child);
		var childModify = document.getElementById(cModify);
	insertMode = false;

        pText.style.display = 'block';
        pModify.style.display = 'none';
        pChild.style.display = 'none';
		childModify.style.display = 'none';
}

//´ñ±Û ¼öÁ¤ º¸¿©ÁÖ±â
function guestViewModify(text, modify, child, pNum, cNum){
	
        var pText = document.getElementById(text);
        var pModify = document.getElementById(modify);
        var pChild = document.getElementById(child);
        var pModifyNum = document.getElementById('pModifyNum');
	
        var cModifyNum = document.getElementById('cModifyNum');
    
	if(pModifyNum.value||cModifyNum.value)
	{
	
		viewText('text'+pModifyNum.value,'modify'+pModifyNum.value,'child'+pModifyNum.value,'viewChildModify'+cModifyNum.value);
	
	}

       pModifyNum.value = pNum;
    
        cModifyNum.value = cNum;
    
	insertMode = true;

        pText.style.display = 'none';
    
       pModify.style.display = 'block';
    
        pChild.style.display = 'none';
    
}

//ÂÊ±Û ÀÔ·Â º¸¿©ÁÖ±â
function guestViewChild(text, modify, child, pNum, cNum){
        var pText = document.getElementById(text);
        var pModify = document.getElementById(modify);
        var pChild = document.getElementById(child);

	var pModifyNum = document.getElementById('pModifyNum');
        var cModifyNum = document.getElementById('cModifyNum');
        if(pModifyNum.value||cModifyNum.value)
        {
                viewText('text'+pModifyNum.value,'modify'+pModifyNum.value,'child'+pModifyNum.value,'viewChildModify'+cModifyNum.value);
        }
	insertMode = true;

        pModifyNum.value = pNum;
        cModifyNum.value = cNum;

        pText.style.display = 'block';
        pModify.style.display = 'none';
        pChild.style.display = 'block';
}

//ÂÊ±Û ÅØ½ºÆ® º¸¿©ÁÖ±â
function guestViewChildText(text, modify){
        var cText = document.getElementById(text);
        var cModify = document.getElementById(modify);

        cText.style.display = 'block';
        cModify.style.display = 'none';
}

//ÂÊ±Û ¼öÁ¤ º¸¿©ÁÖ±â
function guestViewChildModify(text, modify, pNum, cNum){
        var cText = document.getElementById(text);
        var cModify = document.getElementById(modify);

	var pModifyNum = document.getElementById('pModifyNum');
	var cModifyNum = document.getElementById('cModifyNum');
	var cModifyNum = document.getElementById('cModifyNum');
	
	if(pModifyNum.value||cModifyNum.value)
	{
		viewText('text'+pModifyNum.value,'modify'+pModifyNum.value,'child'+pModifyNum.value,'viewChildModify'+cModifyNum.value);
	}
	insertMode = true;

	pModifyNum.value = pNum;
	cModifyNum.value = cNum;
	

        cText.style.display = 'none';
        cModify.style.display = 'block';
}


function go_url(href){

    location.href='www.dicadong.net';  // ÆäÀÌÁö ÀÌµ¿...
 
}
function addRow(){

	var guestForm = document.getElementById('guestForm');
	var rows = guestForm.getAttribute('rows');
	
	rows = parseInt(rows) + 2;
	guestForm.setAttribute('rows',rows);

}
function defaultRow(){

	var guestForm = document.getElementById('guestForm');
	var rows = guestForm.getAttribute('rows');

	guestForm.setAttribute('rows',6);
}
