////// Login ////////////////////////////////////
function _submit_login(){
	document.loginform.submit();
}
function _join(){
	document.location.href='register.php'
}
function _find_pw(){
	document.location.href='login.php'
}
function change_type(){
	document.loginform.password.value="";
}
function enter_login(){
	if(event.keyCode==13)
		_submit_login();
}
////////////////////////////////////////////////

function collapse(){
	document.getElementById('menupane').style.display="none";
//	document.getElementById('menupane').style.width="1px";
}

function confirm_delete_get(url){
	if(confirm("정말로 삭제하겠습니까?")){
		document.location=url;
	}
}
////////edit comment ////////////////////////////
function edit_comment(commentid,postid){
	var r = document.getElementById('comment_body_'+commentid);
	var w = document.getElementById('comment_writer_layer');
	var f = document.getElementById('editframe');
	f.src = "comment_write.php?commentid="+commentid+"&postid="+postid;
	var fl = document.getElementById('framelayer');
	var p = r.parentNode;
		p.replaceChild(fl,r);
	fl.style.width = "800px";
	fl.style.display="block";
	/*
	var f = document.createElement('iframe');
	
	f.src="comment_write.php?commentid="+commentid+"&postid="+postid;
	f.setAttribute("scrolling", "no");
	f.setAttribute("frameborder", "0");
	f.style.width = "1000px";
	f.style.height = "180px";
	f.style.border = "1px solid #fff";
	
	*/
}
////////  admin /////////////////////////////////
function changename_category(ob,id){
	do_ajax('admin_category_.php','cres','id='+id+'&title='+ob.value);
}

var comment_write_toggle = false;
function toggle_comment(){
	if(comment_write_toggle){
		document.getElementById('commentwriteframe').style.display='none';
	}else{
		document.getElementById('commentwriteframe').style.display='block';
	}
	comment_write_toggle = !comment_write_toggle;
}

function comments_all_window(){
	window.open('comments_all.php','','location=0,status=0,scrollbars=1,width=500, height=700');
}


function message(receiverid){
	var letter = window.open('message.php?rcver='+receiverid,'letter','location=0,status=0,scrollbars=1,width=450, height=520');
	letter.focus();
}