function submit_this1() {
	if ( document.login.bid.value == "" ) {
		alert ('¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.') ;
		document.login.bid.focus();
		return false ;
	}

	if ( document.login.bpw.value == "" ) {
		alert ('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.') ;
		document.login.bpw.focus();
		return false ;
	}
	return true ;
}

function submit_this2() {
	var r_check=0;
	form = document.write_form;
//	re=/[^°¡-ÆRa-z0-9!@#$%^&*,.~`{}[+_=|¤§¤»¤¾¤º¤¼¤Ñ¤Ì¤Ð()?<>:/'"\-\s\]\;]/gi;
//	form.contents.value = form.contents.value.replace(re,"");
	form.contents.value = form.contents.value.replace(/¡¡/gi,"");
	if (Check_login("dongauserid"))	{
		if (form.contents.value.replace(/(^\s*)|(\s*$)/g, "") == "") {
			alert ('ÀÇ°ßÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.') ;
			form.contents.value = "";
			form.contents.focus();
		} else if (form.contents.value == "") {
			alert ('ÀÇ°ßÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.') ;
			form.contents.value = "";
			form.contents.focus();
		} else if (form.contents.value.length > 401) {
			alert ('ÃÖ´ë ±ÛÀÚ¼ö 400ÀÚ¸¦ ³Ñ¾ú½À´Ï´Ù.') ;
			form.contents.focus();
		} else {
			if (badword_check(form.contents) == false) return ;
			form.ok.style.display='none';
			write_comment() ;
		}
	} else {
		alert ('·Î±×ÀÎÇØÁÖ¼¼¿ä.') ;
		document.login.bid.focus();
		return ;
	}
}

function submit_this1_n() {
	if ( document.login1.bid.value == "" ) {
		alert ('¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.') ;
		document.login1.bid.focus();
		return false ;
	}

	if ( document.login1.bpw.value == "" ) {
		alert ('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.') ;
		document.login1.bpw.focus();
		return false ;
	}
	return true ;
}

function submit_this2_n() {
	form = document.write_form1;
//	re=/[^°¡-ÆRa-z0-9!@#$%^&*,.~`{}[+_=|¤§¤»¤¾¤º¤¼¤Ñ¤Ì¤Ð()?<>:/'"\-\s\]\;]/gi;
//	form.contents.value = form.contents.value.replace(re,"");
	form.contents.value = form.contents.value.replace(/¡¡/gi,"");
	if (Check_login("dongauserid"))	{
		if (form.contents.value.replace(/(^\s*)|(\s*$)/g, "") == "") {
			alert ('ÀÇ°ßÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.') ;
			form.contents.value = "";
			form.contents.focus();
		} else if (form.contents.value == "" ) {
			alert ('ÀÇ°ßÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.') ;
			form.contents.value = "";
			form.contents.focus();
		} else if (form.contents.value.length > 401) {
			alert ('ÃÖ´ë ±ÛÀÚ¼ö 400ÀÚ¸¦ ³Ñ¾ú½À´Ï´Ù.') ;
			form.contents.focus();
		} else {
			if (badword_check(form.contents) == false)  return ;
			form.ok.style.display='none';
			write_comment_n() ;
		}
	} else {
		alert ('·Î±×ÀÎÇØÁÖ¼¼¿ä.') ;
		document.login1.bid.focus();
		return ;
	}
}

function move_url(a) {
	window.open(a,'','width=10,height=10');
}

function write_comment() {
	var gourl;
	gourl = escape(location.href);
	document.write_form.method="post";
	document.write_form.action="./comic_opinion/comic_comment_add.php?gourl="+gourl;
	document.write_form.submit();
}

function write_comment_n() {
	var gourl;
	gourl = escape(location.href);
	document.write_form1.method="post";
	document.write_form1.action="./comic_opinion/comic_comment_add.php?pgubun=n2&gourl="+gourl;
	document.write_form1.submit();
}

function Check_login(name) {
    var cname = name + "=";
    var dc = document.cookie;
    var val = "";

    if (dc.length > 0) {
        begin = dc.indexOf(cname);
        if (begin != -1) {
            begin += cname.length;
            end = dc.indexOf(";", begin);
            if (end == -1) end = dc.length;
            val += unescape(dc.substring(begin, end));
        }
    }
    return val;
}

function loginarea_opinion() {
	var gourl;
	gourl = escape(location.href);

	loginhtml = "";
	loginhtml +="<form name='login' action='http://www.donga.com/members/trans_exe.php' method='post' OnSubmit='return submit_this1()'> ";
	loginhtml +="<input type='hidden' name='e'> ";
	loginhtml +="<input type='hidden' name='gourl' value='"+gourl+"'> ";
	loginhtml +="  <td><table width='500' border='0' cellspacing='0' cellpadding='0'>";
	loginhtml +="   <tr><td width='80' height='25' align='left' valign='middle'><strong>³ªÀÇ ÀÇ°ß </strong></td>";
	loginhtml +="    <td width='342' align='right' valign='middle'><img src='http://image.donga.com/sportsdonga/2010/bullet_2.gif' width='4' height='6' align='baseline'><span class='id_pw'> ¾ÆÀÌµð</span>";
	loginhtml +="    <input type='text' name='bid' class='input_box' size='12'>";
	loginhtml +="    &nbsp; <img src='http://image.donga.com/sportsdonga/2010/bullet_2.gif' width='4' height='6' align='baseline'> <span class='id_pw'>ºñ¹Ð¹øÈ£</span>";
	loginhtml +="    <input type='password' name='bpw' class='input_box' size='10'>";
	loginhtml +="    <td width='78' height='30' align='right'>";
	loginhtml +="    <input type='image' src='http://image.donga.com/sportsdonga/2010/login.gif' width='70' height='21'></td>";
	loginhtml +="</form>";

	logouthtml = "";
	logouthtml +="  <td><table width='500' border='0' cellspacing='0' cellpadding='0'>";
	logouthtml +="   <tr><td width='80' height='25' align='left' valign='middle'><strong>³ªÀÇ ÀÇ°ß </strong></td>";
	logouthtml +="    <td width='342' align='right' valign='middle'><img src='http://image.donga.com/sportsdonga/2010/bullet_2.gif' width='4' height='6' align='baseline'>&nbsp;<span class='id_pw'><b>"+Check_login("dongausernameuni")+"("+Check_login("dongauserid")+")</b>&nbsp;´Ô&nbsp;</span>";
	logouthtml +="    &nbsp;</td>";
	logouthtml +="    <td width='78' height='30' align='right'><a href='http://www.donga.com/members/logout.php?gourl="+gourl;
	logouthtml +="	'><img src='http://image.donga.com/sportsdonga/image/sub_logout.gif' width='61' height='20' hspace='3' border='0' align='absmiddle' border='0'></a></td>";

	if(Check_login("dongauserid")) document.write(logouthtml);
	else document.write(loginhtml);
}

function loginarea_opinion_n() {
	var gourl;
	gourl = escape(location.href);

	loginhtml = "";
	loginhtml +="<form name='login' action='http://www.donga.com/members/trans_exe.php' method='post' OnSubmit='return submit_this1()'> ";
	loginhtml +="<input type='hidden' name='e'> ";
	loginhtml +="<input type='hidden' name='gourl' value='"+gourl+"'> ";
	loginhtml +="  <td width='342' align='right'><table width='500' border='0' cellspacing='0' cellpadding='0'>";
	loginhtml +="   <tr><td width='80' height='25' align='left' valign='middle'><strong>³ªÀÇ ÀÇ°ß </strong></td>";
	loginhtml +="    <td width='342' align='right' valign='middle'><img src='http://image.donga.com/sportsdonga/2010/bullet_2.gif' width='4' height='6' align='baseline'><span class='id_pw'> ¾ÆÀÌµð</span>";
	loginhtml +="    <input type='text' name='bid' class='input_box' size='12'>";
	loginhtml +="    &nbsp; <img src='http://image.donga.com/sportsdonga/2010/bullet_2.gif' width='4' height='6' align='baseline'> <span class='id_pw'>ºñ¹Ð¹øÈ£</span>";
	loginhtml +="    <input type='password' name='bpw' class='input_box' size='10'>";
	loginhtml +="    <td width='78' height='30' align='right'>";
	loginhtml +="    <input type='image' src='http://image.donga.com/sportsdonga/2010/login.gif' width='70' height='21'></td></tr></table></td>";
	loginhtml +="</form>";

	logouthtml ="";
	logouthtml +="  <td width='342' align='right'><table width='500' border='0' cellspacing='0' cellpadding='0'>";
	logouthtml +="   <tr><td width='80' height='25' align='left' valign='middle'><strong>³ªÀÇ ÀÇ°ß </strong></td>";
	logouthtml +="    <td width='342' align='right' valign='middle'><img src='http://image.donga.com/sportsdonga/2010/bullet_2.gif' width='4' height='6' align='baseline'><span class='id_pw'><b>"+Check_login("dongausernameuni")+"("+Check_login("dongauserid")+")</b>&nbsp;´Ô&nbsp;</span>";
	logouthtml +="    &nbsp; <a href='http://www.donga.com/members/logout.php?gourl="+gourl;
	logouthtml +="	'><img src='http://image.donga.com/sportsdonga/image/sub_logout.gif' width='61' height='20' hspace='3' border='0' align='absmiddle' border='0'></a></td></tr></table></td>";

	if(Check_login("dongauserid")) document.write(logouthtml);
	else document.write(loginhtml);
}

//·Î±ä¾ÈÇÏ°í ±Û¾²±â ÇÒ¶§
alert_value=0;
function CheckStrLen() {
	if(!Check_login("dongauserid")&&alert_value == 0) {
		alert("·Î±×ÀÎÀ» ¸ÕÀú ÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.");
		alert_value=1;
	}

}

function login_yn() {
	if(!Check_login("dongauserid")){
		alert("º» ¼­ºñ½º´Â ·Î±×ÀÎÀ» ÇØ¾ß ÀÌ¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
		document.login.bid.focus();
	}
}

function login_yn_n() {
	if(!Check_login("dongauserid")){
		alert("º» ¼­ºñ½º´Â ·Î±×ÀÎÀ» ÇØ¾ß ÀÌ¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
		document.login1.bid.focus();
	}
}

function view_reple(val) {
	reple = eval('re_' + val);
	if (reple.style.display == 'none') reple.style.display = '';
	else reple.style.display = 'none';
}

function submit_this_val(val, i) {
	form = eval('document.frm_' + val);
//	re=/[^°¡-ÆRa-z0-9!@#$%^&*,.~`{}[+_=|¤§¤»¤¾¤º¤¼¤Ñ¤Ì¤Ð()?<>:/'"\-\s\]\;]/gi;
//	form.contents.value = form.contents.value.replace(re,"");
	form.contents.value = form.contents.value.replace(/¡¡/gi,"");
	if (Check_login("dongauserid"))	{
		if (form.contents.value.replace(/(^\s*)|(\s*$)/g, "") == "") {
			alert ('ÀÇ°ßÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.') ;
			form.contents.value = "";
			form.contents.focus();
		} else if (form.contents.value == "" ) {
			alert ('ÀÇ°ßÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.') ;
			form.contents.value = "";
			form.contents.focus();
		} else if (form.contents.value.length > 401) {
			alert ('ÃÖ´ë ±ÛÀÚ¼ö 400ÀÚ¸¦ ³Ñ¾ú½À´Ï´Ù.') ;
			form.contents.focus();
		} else {
			if (badword_check(form.contents) == false)  return ;
			ii = eval('document.ok_' + i);
			ii.style.display='none';
			write_comment_val(val) ;
		}
	} else {
		alert ('·Î±×ÀÎÇØÁÖ¼¼¿ä.') ;
		document.login.bid.focus();
		return ;
	}
}

function write_comment_val(val) {
	var gourl;
	gourl = escape(location.href);
	form = eval('document.frm_' + val);
	form.method="post";
	form.action="./comic_opinion/comic_comment_add.php?gourl="+gourl;
	form.submit();
}




