//´ñ±Û¿ë ÀÚ¹Ù½ºÅ©¸³Æ®
var comment_is_login;
var comment_images_url;
var comment_hidden_name;
var comment_write_level;
var comment_reply_opend=0;
var comment_modify_opend=0;
var comment_write_click=false;
function comment_write_do(parent_no,cmode,cthread,cdepth) {
//	if(comment_write_click){
//		alert('´ñ±Û ÀÔ·Â ¹öÆ°Àº ÇÑ¹ø¸¸ ´©¸£¼¼¿ä');
//		return false;
//	}
	comment_write_click=true;
	var f = document.commentForm;
	var b = "";
	if(parent_no>0)
		if (cmode=="cr0229"){
			b = document.getElementById('comment_contents' + parent_no);
		}else{
			b = document.getElementById('comment_modify_contents' + parent_no);
		}
	else
		b = document.getElementById('comment_contents');

	var s = b.value;
	
	if(s=='') { comment_write_click=false; alert('Please Enter message!'); b.focus(); return false; }

	f.comment_contents.value = s;
	f.commentNum.value = parent_no;
	if (cmode=="cr0229"){
		f.Thread.value = cthread;
		f.depth.value = cdepth;
	}

	f.cmode.value = cmode;
	f.action = "./CommentSuccess_ok.asp";
	f.submit();
}

function inc_comment_writebox() {
	document.getElementById('comment_textarea').rows += 3;
}


function show_comment_reply(parent_no) {
	
	document.getElementById('comment_modify' + parent_no).style.display='none';
	comment_modify_opend=0;
	if(comment_reply_opend){
		document.getElementById('comment_write' + comment_reply_opend).style.display='none';
		
		if(comment_reply_opend==parent_no){
			comment_reply_opend=0;
			return;
		}else
			comment_reply_opend=0;
	}

	document.getElementById('comment_write' + parent_no).style.display='';
	
	comment_reply_opend = parent_no;
}



function show_comment_modify(parent_no2) {

	document.getElementById('comment_write' + parent_no2).style.display='none';
	comment_reply_opend=0;
	if(comment_modify_opend){
		document.getElementById('comment_modify' + comment_modify_opend).style.display='none';
		if(comment_modify_opend==parent_no2){
			comment_modify_opend=0;
			return;
		}else
			comment_modify_opend=0;
	}

	document.getElementById('comment_modify' + parent_no2).style.display='';
	
	comment_modify_opend = parent_no2;
}

function delete_comment(comment_idx) {
	if(confirm('Delete post then press Ok?')){
		var f = document.commentDeleteForm;
		f.commentNum.value = comment_idx;
		f.action = "./CommentSuccess_ok.asp";
		f.submit();
	}
}

function sendSpamForm(spam_idx) {
	if(confirm('Would you like to report reply as a spam?')){
		var f = document.spamReportForm;
		f.commentNum.value = spam_idx;
		f.action = "./CommentSuccess_ok.asp";
		f.submit();
	}
}

function delete_comment2(comment_idx) {
	if(confirm('Delete post then press Ok?')){
		var f = document.comment_deleteform2;
		f.idx.value = comment_idx;
		f.submit();
	}
}



function comment_write_checkkey() {

	if(window.event.altKey){
		if((window.event.keyCode==83))
			return true;
		else
			return false;
	}else
		return false;
}

function goto_comment_list(){
	document.location.href = '#comment_list';
}

function comment_noname_button_click(comment_idx){
	if(document.getElementById('comment_noname_button' + comment_idx).src == comment_images_url + '/btn_noname2.gif'){
		document.getElementById('comment_noname_button' + comment_idx).src = comment_images_url + '/btn_noname.gif';
		document.getElementById('comment_wname' + comment_idx).style.display='none';
	}else{
		document.getElementById('comment_noname_button' + comment_idx).src = comment_images_url + '/btn_noname2.gif';
		document.getElementById('comment_wname' + comment_idx).style.display='';
		document.getElementById('comment_wname' + comment_idx).focus();
	}
}



function site_Log(vmsg){

	if (vmsg==""){
		vmsg="To post a message, please sign in";
	}

	if (confirm(vmsg)){
		document.getElementById("userid").focus();
	}


}


function resizeImage(num)
{
    var oImg = eval("document.getElementById('userImg" + num + "')");
    if(oImg.width <= 500)
    {
        return;
    }
    else 
    {
      if(oImg.width > oImg.height) 
        {		
            if(oImg.width > 500){								   
               oImg.height = (oImg.height*500/oImg.width);
               oImg.width = 500;		
            }

        }
        else
        {
           oImg.width = (oImg.width*500/oImg.height);
		   oImg.height = oImg.height;					
           
        }
    }


}


function contents_delete() {
	if(confirm('Delete post then press Ok?')){
		var f = document.forumForm;
		f.mode.value = "Erase";
		f.action="./Contents_Delete.asp";
		f.submit();
	}
}

