var CheckPopup = false;
var nowBrowser = getBrowser();

//===ÆË¾÷¶ç¿ì±â
function openwindow(url, name, width, height, align, valign, option) {
	var x,y;
	var window_option = "width="+width+",height="+height;

	if (option!=null) window_option+=","+option;
	if (align==null) align="center";
	if (valign==null) valign="center";

	if (align=="left") x=0;
	else if (align=="right") x=(screen.width-width);
	else if (align=="center") x=(screen.width-width)/2

	if (valign=="top") y=0;
	else if (valign=="bottom") y=(screen.height-height);
	else if (valign=="center") y=(screen.height-height)/2

	window_option+=",left="+x+",top="+y;

	var win_obj = window.open(url,name,window_option);

	win_obj.focus();
	return win_obj;
}

/* ´ñ±Û ´Þ±â ¾ÆÀÌÄÜ º¸¿©ÁÖ±â */
function show_icon(list_name,basic_name,change_form,change_img)
{
	if(	document.getElementById(list_name) )
	{
		delElement(list_name,true);
	}else
	{
		show_icon_list(list_name,basic_name,change_form,change_img);
	}
}
function show_icon_list(list_name,basic_name,change_form,change_img)
{
	var comment_div = document.createElement('div');
	cssText="position:absolute;width:200px; height:50px;";
	comment_div.style.cssText=cssText;
	comment_div.id = list_name;
	
	divInerHTML = "<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#dbdbdb\" style=\"border-collapse:collapse\">";
	divInerHTML += "<tr align=\"center\" bgcolor=\"#FFFFFF\"> ";
	divInerHTML += "<td width=\"25\" height=\"25\"><img src=\"/images/novel_images/character_01.gif\" style=\"cursor:pointer\" onclick=\"javascript:insert_icon('01','"+list_name+"','"+change_form+"','"+change_img+"');\"></td>";
	divInerHTML += "<td width=\"25\" height=\"25\"><img src=\"/images/novel_images/character_02.gif\" style=\"cursor:pointer\" onclick=\"javascript:insert_icon('02','"+list_name+"','"+change_form+"','"+change_img+"');\"></td>";
	divInerHTML += "<td width=\"25\" height=\"25\"><img src=\"/images/novel_images/character_03.gif\" style=\"cursor:pointer\" onclick=\"javascript:insert_icon('03','"+list_name+"','"+change_form+"','"+change_img+"');\"></td>";
	divInerHTML += "<td width=\"25\" height=\"25\"><img src=\"/images/novel_images/character_04.gif\" style=\"cursor:pointer\" onclick=\"javascript:insert_icon('04','"+list_name+"','"+change_form+"','"+change_img+"');\"></td>";
	divInerHTML += "<td width=\"25\" height=\"25\"><img src=\"/images/novel_images/character_05.gif\" style=\"cursor:pointer\" onclick=\"javascript:insert_icon('05','"+list_name+"','"+change_form+"','"+change_img+"');\"></td>";
	divInerHTML += "</tr>";
	divInerHTML += "<tr align=\"center\" bgcolor=\"#FFFFFF\">";
	divInerHTML += "<td width=\"25\" height=\"25\"><img src=\"/images/novel_images/character_06.gif\" style=\"cursor:pointer\" onclick=\"javascript:insert_icon('06','"+list_name+"','"+change_form+"','"+change_img+"');\"></td>";
	divInerHTML += "<td width=\"25\" height=\"25\"><img src=\"/images/novel_images/character_07.gif\" style=\"cursor:pointer\" onclick=\"javascript:insert_icon('07','"+list_name+"','"+change_form+"','"+change_img+"');\"></td>";
	divInerHTML += "<td width=\"25\" height=\"25\"><img src=\"/images/novel_images/character_08.gif\" style=\"cursor:pointer\" onclick=\"javascript:insert_icon('08','"+list_name+"','"+change_form+"','"+change_img+"');\"></td>";
	divInerHTML += "<td width=\"25\" height=\"25\"><img src=\"/images/novel_images/character_09.gif\" style=\"cursor:pointer\" onclick=\"javascript:insert_icon('09','"+list_name+"','"+change_form+"','"+change_img+"');\"></td>";
	divInerHTML += "<td width=\"25\" height=\"25\"><img src=\"/images/novel_images/character_10.gif\" style=\"cursor:pointer\" onclick=\"javascript:insert_icon('10','"+list_name+"','"+change_form+"','"+change_img+"');\"></td>";

	divInerHTML += "</table>";

	comment_div.innerHTML = divInerHTML;

	icon_id = document.getElementById(basic_name);
	icon_top = getObjectTop(icon_id) ;
	icon_left = getObjectLeft(icon_id) ;
	icon_width = icon_id.offsetWidth;

	comment_div.style.top = icon_top;
	comment_div.style.left = icon_left + icon_width;
	document.body.appendChild(comment_div);
}


//== ´ñ±Û ¾ÆÀÌÄÜ ÀÔ·Â
function insert_icon(val,list_name,change_form,change_img)
{
	eval(change_form).value = val;
	document.getElementById(change_img).src = "../images/novel_images/character_"+val+".gif";
	delElement(list_name,true);
}

//== °³Ã¼ TOP À§Ä¡
function getObjectTop(obj)
{
	if(obj.offsetParent == document.body)
		return obj.offsetTop;
	else
		return obj.offsetTop + getObjectTop(obj.offsetParent);
}

//=== °³Ã¼ LEFT À§Ä¡
function getObjectLeft(obj)
{
	if(obj.offsetParent == document.body)
	   return obj.offsetLeft;
   else
	   return obj.offsetLeft + getObjectLeft(obj.offsetParent);
}

//=== ·Î±×ÀÎÇÒ¶§ °Ë»ç
function loginCheck()
{
	f = document.loginform;
	if(f.chat_id.value == "")
	{
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		f.chat_id.focus();
		return false;
	}
	if(f.passwd.value == "")
	{
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		f.passwd.focus();
		return false;
	}
	return;
}

//=== Ã¼Å©¹Ú½º ÀüÃ¼¼±ÅÃ/ÇØÁ¦±â´É
function all_ckbox(obj,ele) {
	var frm = obj.form.name;
	var form = "document."+frm;
	var chkBox = eval(form).elements[ele];

	if(chkBox == undefined){
		return;
	}
	var chkLen = chkBox.length;

	if(chkLen == undefined){
		if(obj.checked==true){
			if(chkBox.disabled == false){
				chkBox.checked = true;
			}
		}else{
			chkBox.checked =false;
		}
	}else{
		if(obj.checked==true){
			for ( i=0;i <chkLen;i++) {
				if(chkBox[i].disabled == false){
	    		chkBox[i].checked = true;
				}
			}
		}else{
			for ( i=0;i <chkLen;i++) {
				chkBox[i].checked =false;
			}
		}
	}
}

//===°Ë»ö °Ë»ç
function search_word()
{
	f = document.search;
	if(f.sword.value == "")
	{
		alert("°Ë»öÇÒ ³»¿ëÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		f.sword.focus();
		return false;
	}
	return;
}

//===¸®½ºÆ®¿¡¼­ °Ë»ö °Ë»ç
function search_check()
{
	f = document.list_search;
	if(f.type.value == "")
	{
		alert("°Ë»öÇÒ ºÐ·ù¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä.");
		f.type.focus();
		return false;
	}
	if(f.smode.value == "")
	{
		alert("°Ë»öÇÒ ºÐ·ù¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä.");
		f.smode.focus();
		return false;
	}
	if(f.sword.value == "")
	{
		alert("°Ë»öÇÒ ´Ü¾î¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		f.sword.focus();
		return false;
	}
	f.action = "/"+f.type.value+"/list.htm";
	return;
}

//(ÃâÃ³) ºÙÀÌ±â
function contents_cp()
{
	if (window.event)
	{
		window.event.returnValue = true;
		window.setTimeout('attach_kinref()', 25);
	}
}

function attach_kinref()
{
	if (window.clipboardData) // IE
	{
		// get data from clipboard
		var txt = window.clipboardData.getData('Text');
		// attach the source at the end of text
		txt = txt + '\r\n(ÃâÃ³ : ¾ÆÁÜ¸¶´åÄÄ - »çÀÌ¹öÀÛ°¡)\r\n';
		// set data to clibboard
		var result = window.clipboardData.setData('Text', txt);
	}
}
//=== °Ô½Ã¹° ÇÏ´Ü ¹Ù·Î°¡±â
function go_site(url)
{
	var url = "http://"+url;
	window.open(url) ;
}

//=== À¥ ºê¶ó¿ìÁ® ¹öÀü.
function getBrowser()
{
	var browserName = null;
	var userAgent = self.navigator.userAgent.split(";");
	var re = /MSIE\s([\d\.]+)/gi;
	var result = re.exec(userAgent[1]);
	if( (result != null) && (result.length == 2) )
	{
		browserName = "MSIE";
	}else
	{
		re = /rv\:([\d\.\w]+)\)\sGecko/gi;
		result = re.exec(userAgent[4]);
		if( (result != null) && (result.length == 2) )
		{
			browserName = "Mozilla";
		}
	}
	return browserName;
}

//=== ·¹ÀÌ¾î Ãâ·Â (ÀÛ°¡³ëÆ® º¸±âµîµî..)
var nowAuthorPK = 0;
function attatchDiv(table,pk,encode_id)
{
	if( document.getElementById('authorInfoDiv') != null)
	{
		document.body.removeChild(document.getElementById('authorInfoDiv'));
	}

	if(pk != nowAuthorPK)
	{
		var obj = document.getElementById("author_"+pk);
		var athDiv = document.createElement("DIV");
		athDiv.id = "authorInfoDiv";
		var divTop = getObjectTop(obj);
		var divLeft = getObjectLeft(obj) + obj.offsetWidth;
		athDiv.style.cssText = "position:absolute; top:"+divTop+"; left:"+divLeft+"; background:#dfdfdf; width:107px; height:87px;";
		var str = "<div style='position: relative; background:#FFFFFF; left:-2px; top:-2px; padding:10 5 10 5; border:2px solid #8f8f8f; width:107px; height:87px;'>";
		str += "<table border='0' cellspacing='0' cellpadding='0'>";
		str += "<tr>";
		str += "<td style='padding:5 5 4 0px; border-bottom:1px dotted #dbd7d3;'><img src='../images/novel_images/icon_arrow.gif' width='12' height='5' align='absmiddle'><a href='../mynote/list.htm?type="+table+"&encode_member_id="+encode_id+"' target='_top'>ÀÛ°¡³ëÆ® º¸±â</a></td>";
		str += "</tr>";
		str += "<tr>";
		str += "<td style='padding:5 5 4 0px; border-bottom:1px dotted #dbd7d3;'><img src='../images/novel_images/icon_arrow.gif' width='12' height='5' align='absmiddle'><a href='../_board/addInterest.php?mode=author&encode_member_id="+encode_id+"' target='hidden_frame'>°ü½ÉÀÛ°¡ Ãß°¡</a></td>";
		str += "</tr>";
		str += "<tr>";
		str += "<td style='padding:5 5 4 0px;'><img src='../images/novel_images/icon_arrow.gif' width='12' height='5' align='absmiddle'><a href='../_board/addInterest.php?mode=product&type="+table+"&pk="+pk+"' target='hidden_frame'>°ü½ÉÀÛÇ° Ãß°¡</a></td>";
		str += "</tr>";
		str += "<tr>";
		str += "<td style='padding:5 5 4 0px;'><img src='../images/novel_images/icon_arrow.gif' width='12' height='5' align='absmiddle'><a href='../mynote/fan_list.htm?encode_member_id="+encode_id+"' target='_top'>ÆÒ°Ô½ÃÆÇ °¡±â</a></td>";
		str += "</tr>";
		str += "</table>";
		str += "</div>";

		athDiv.innerHTML = str;
		document.body.appendChild(athDiv);
		nowAuthorPK = pk;
	}else
	{
		nowAuthorPK = 0;
	}
}

//=== ¸®½ºÆ®¿¡¼­ º£½ºÆ® Ã¼ÀÎÄ¡
function listTopChange(val)
{
	if(val ==1)
	{
		document.getElementById('bestCount').style.display = "inline";
		document.getElementById('bestCountBtn').src = "../images/novel_images/opinion_07.gif";
		document.getElementById('bestComment').style.display = "none";
		document.getElementById('bestCommentBtn').src = "../images/novel_images/opinion_08_2.gif";
	}else
	{
		document.getElementById('bestCount').style.display = "none";
		document.getElementById('bestCountBtn').src = "../images/novel_images/opinion_07_2.gif";
		document.getElementById('bestComment').style.display = "inline";
		document.getElementById('bestCommentBtn').src = "../images/novel_images/opinion_08.gif";
	}
}

//=== ÁÖ¼Òº¹»çÇÏ±â
function cpp_address() {
	window.clipboardData.setData('Text',top.location.href);
	alert("ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù");
}
//===ÄíÅ°°ª °¡Á®¿À±â
function getCookie( name )
{
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length )
	{
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
			break;
	}
	return "";
}

//===½Å°íÃ¢ check
function badCheck()
{
	f = document.badreport;
	if(f.type.value == '' || f.pk.value == '' || f.division.value == '')
	{
		alert('¿À·ù°¡ »ý°å½À´Ï´Ù.\n\n»õ·Î°íÄ§(F5)ÈÄ ´Ù½Ã ½ÃµµÇØÁÖ¼¼¿ä.');
		return false;
	}
	if(f.content.value == "")
	{
		alert('½Å°í»çÀ¯¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.');
		f.content.focus();
		return false;
	}
	f.submit();
}

//=== ½Å°íÃ¢ ÆË¾÷¶ç¿ì±â
function bad(type,pk,division,encode_member_id)
{
	var cookie_id = getCookie('chat_name');

	if(cookie_id != '')
	{
		if(CheckPopup == false)
		{
			inputForm = document.createElement('DIV');
			inputForm.id = "inputFormBad";
			inputForm_top = document.body.scrollTop + ((document.body.clientHeight / 2) - 204);
			inputForm_left = (document.body.clientWidth / 2) - 250;
			inputForm.style.cssText = "position:absolute; top:"+inputForm_top+"; left:"+inputForm_left+"; width:500; height:408; z-index:10001;";

			var str = "<form name='badreport' method='post' action='../_board/etcAction.php' target='hidden_frame'>";
			str += "<input type='hidden' name='mode' value='bad'>";
			str += "<input type='hidden' name='type' value='"+type+"'>";
			str += "<input type='hidden' name='pk' value='"+pk+"'>";
			str += "<input type='hidden' name='division' value='"+division+"'>";
			str += "<input type='hidden' name='encode_member_id' value='"+encode_member_id+"'>";
			str += "<table width='500' border='0' align='center' cellpadding='0' cellspacing='0'>";
			str += "<tr> ";
			str += "<td height='62' align='right' valign='top' background='../images/novel_images/layers_8.gif'><img src='../images/novel_images/layers_3.gif' width='20' height='22' border='0' style='cursor:pointer;' onclick='deleteLayer(\""+inputForm.id+"\")'></td>";
			str += "</tr>";
			str += "<tr> ";
			str += "<td background='../images/novel_images/layers_5.gif'> ";
			str += "<table border='0' align='center' cellpadding='0' cellspacing='0'>";
			str += "<tr> ";
			str += "<td height='15' colspan='2' style='padding:5 0 10 0;'>¿ì¸® ¾ÆÁÜ¸¶µéÀÇ °ø°£¿¡ ±¤°í,È«º¸,¿å¼³,ºñ¹æ µî ÀÌ¹ÌÁö¸¦ ½ÇÃß½ÃÅ°´Â ±ÛÀ» <br>½Å°íÇØ ÁÖ¼¼¿ä. ºÒ·®±Û·Î ½Å°íµÈ ±ÛÀº ±Û ¾Õ¿¡ <strong><font color='#f1503e'>'°æ°íÄ«µå'</font></strong>°¡ ºÙÀ¸¸ç, <br>µ¿½Ã¿¡ ±ÛÀÌ Å¬¸¯µÇÁö ¾Ê¾Æ ±ÛÀ» ÀÐÀ» ¼ö ¾ø°Ô µË´Ï´Ù. <br>µµ¿ì¹ÌÀÇ È®ÀÎ ÈÄ ¿ÏÀüÈ÷ »èÁ¦µÇ°Å³ª, ÇãÀ§ ½Å°íÀÏ °æ¿ì º¹¿øµË´Ï´Ù.</td>";
			str += "</tr>";
			str += "<tr align='right' bgcolor='dbdbdb'> ";
			str += "<td height='1' colspan='2'></td>";
			str += "</tr>";
			str += "<tr> ";
			str += "<td width='45' style='padding-top:15px; padding-bottom:12px;'>½Å°íÀÎ</td>";
			str += "<td style='padding-top:12px; padding-bottom:12px;'><input name='member_id' type='text' value='"+cookie_id+"' class='inp' style='width:200;height:20' readonly></td>";
			str += "</tr>";
			str += "<tr> ";
			str += "<td height='32'>»çÀ¯</td>";
			str += "<td height='30'><textarea name='content' style='width:385;height:150' class='inp9' ></textarea> ";
			str += "</td>";
			str += "</tr>";
			str += "<tr align='right'> ";
			str += "<td height='15' colspan='2'></td>";
			str += "</tr>";
			str += "<tr align='right' bgcolor='dbdbdb'> ";
			str += "<td height='1' colspan='2'></td>";
			str += "</tr>";
			str += "</table>";
			str += "</td>";
			str += "</tr>";
			str += "<tr> ";
			str += "<td height='40' align='center' background='../images/novel_images/layers_5.gif' style='padding-top:10px'><img src='../images/novel_images/novel_popup_button11.gif' onclick='javascript:badCheck();' style='cursor:pointer;'>";
			str += "&nbsp;<img src='../images/novel_images/novel_popup_button10.gif' width='54' height='28' border='0' onclick='deleteLayer(\""+inputForm.id+"\")' style='cursor:pointer;'></td>";
			str += "</tr>";
			str += "<tr> ";
			str += "<td><img src='../images/novel_images/layers_6.gif' width='500' height='10'></td>";
			str += "</tr>";
			str += "</table>";
			str += "</form>";
			inputForm.innerHTML = str;
			document.body.appendChild(inputForm);

			if (window.addEventListener){
				window.addEventListener("scroll", moveLayer, false);
			} else{
				window.attachEvent("onscroll", moveLayer);
			}
			CheckPopup = true;
		}else
		{
			alert("ÀÌ¹Ì ÆË¾÷Ã¢ÀÌ ¶°ÀÖ½À´Ï´Ù.\n\nÆË¾÷Ã¢À» Á¦°ÅÇÑÈÄ ´Ù½Ã ½ÃµµÇØÁÖ¼¼¿ä.");
		}
	}else
	{
		if( confirm('·Î±×ÀÎÀ» ÇÏ¼Å¾ß ½Å°í°¡ °¡´ÉÇÕ´Ï´Ù.\n\n·Î±×ÀÎÇÏ½Ã°Ú½À´Ï±î?') )
		{
			var back_url = escape(top.location.href);
			top.location.href = "http://www.azoomma.com/customer_center/login_index.htm?back_url="+back_url;
		}
	}
}

//== µû¶ó´Ù´Ï´Â ·¹ÀÌ¾î
var topMargin = 0;
function moveLayer()
{
	var menuTop = getObjectTop(document.getElementById('inputForm'));
	ChangeTop = document.body.scrollTop + ((document.body.clientHeight / 2) - (document.getElementById('inputForm').offsetHeight / 2));
	document.getElementById('inputForm').style.top = ChangeTop;
}
//=== OBJECT »èÁ¦
function delElement(obj,me)
{
	var oChild = document.getElementById(obj).childNodes;
	for(i=0;i<oChild.length;i++)
	{
		if(oChild[i] != null)
		{
			document.getElementById(obj).removeChild(oChild[i]);
		}
	}
	if(me)
	{
		document.body.removeChild(document.getElementById(obj));
	}
}
//=== ·¹ÀÌ¾î »èÁ¦
function deleteLayer(objID)
{
	delElement(objID,true);

	if (window.removeEventListener){
		window.removeEventListener("scroll", moveLayer, false);
	} else{
		window.detachEvent('onscroll',moveLayer);
	}
	CheckPopup = false;
}
//=== »õ·ÎÀº ¼Ò¼³¹æ ¸¸µé±â
function new_fiction(locate)
{
	if(getCookie( 'chat_name' ) != '')
	{
		if(CheckPopup == false)
		{
			//== ºê¶ó¿ìÁ®º° Åõ¸íµµ ¼³Á¤
			if(nowBrowser == "Mozilla")
			{
				var opa = "opacity:0.4;";
			}else
			{
				var opa = "filter:alpha(opacity=40);";
			}
		
			if(locate == "write")
			{
				//===¹é±×¶ó¿îµå ·¹ÀÌ¾î ±ò±â
				backDIV = document.createElement('DIV');
				backDIV.id = "backDIV";
				backDIV.style.cssText = "position:absolute; top:0px; left:0px; width:"+document.body.scrollWidth+"; height:"+document.body.scrollHeight+" ; background:#000000; "+ opa +" z-index:100;";
				document.body.appendChild(backDIV);
			}
			inputForm = document.createElement('DIV');
			inputForm.id = "inputForm";
			inputForm_top = document.body.scrollTop + (document.body.clientHeight / 2) - 135;
			inputForm_left = (document.body.clientWidth / 2) - 230;
			inputForm.style.cssText = "position:absolute; top:"+inputForm_top+"; left:"+inputForm_left+"; width:460px; height:270px; z-index:101;";
		
			var str = "<form name='input_Form' action='../_board/addCategory.php' method='post' target='hidden_frame'>";
			str += "<input type='hidden' name='mode' value='insert'>";
			str += "<input type='hidden' name='type' value='fiction'>";
			str += "<input type='hidden' name='locate' value='"+locate+"'>";
			str += "<table width='500' border='0' align='center' cellpadding='0' cellspacing='0'>";
			str += "<tr>";
			str += "<td height='62' align='right' valign='top' background='/images/novel_images/layers_7.gif'><img src='/images/novel_images/layers_3.gif' onclick='javascript:init_writer_form(\""+locate+"\");' style='cursor:pointer;'></td>";
			str += "</tr>";
			str += "<tr>";
			str += "<td background='/images/novel_images/layers_5.gif'>";
			str += "<table border='0' align='center' cellpadding='0' cellspacing='0'>";
			str += "<tr align='right' bgcolor='dbdbdb'>";
			str += "<td height='1' colspan='2'></td>";
			str += "</tr>";
			str += "<tr>";
			str += "<td width='85' style='padding-top:15px'>¼Ò¼³ ´ëÁ¦¸ñ</td>";
			str += "<td style='padding-top:12px'><input name='title' type='text' class='inp' style='width:200;height:20'></td>";
			str += "</tr>";
			str += "<tr>";
			str += "<td height='38'>ÀÛ°¡(¿¹)¸í</td>";
			str += "<td height='30'> <input name='name' type='text' class='inp' style='width:200;height:20'></td>";
			str += "</tr>";
			str += "<tr>";
			str += "<td height='32'>¼Ò¼³¹æ ¼Ò°³±Û</td>";
			str += "<td height='30'><textarea name='introduce' style='width:345;height:150' class='inp9' ></textarea>";
			str += "</td>";
			str += "</tr>";
			str += "<tr align='right'>";
			str += "<td height='15' colspan='2'></td>";
			str += "</tr>";
			str += "<tr align='right' bgcolor='dbdbdb'>";
			str += "<td height='1' colspan='2'></td>";
			str += "</tr>";
			str += "</table>";
			str += "</td>";
			str += "</tr>";
			str += "<tr>";
			str += "<td height='40' align='center' background='/images/novel_images/layers_5.gif' style='padding-top:10px'><img src='/images/novel_images/novel_popup_button4.gif' onclick='javascript:checkMake();' style='cursor:pointer;'></a> &nbsp;<img src='/images/novel_images/novel_popup_button10.gif' onclick='javascript:init_writer_form(\""+locate+"\");' style='cursor:pointer;'></td>";
			str += "</tr>";
			str += "<tr>";
			str += "<td><img src='/images/novel_images/layers_6.gif' width='500' height='10'></td>";
			str += "</tr>";
			str += "</table>";
			str += "</form>";
	
			inputForm.innerHTML = str;
			document.body.appendChild(inputForm);
			
			if (window.addEventListener){
				window.addEventListener("scroll", moveLayer, false);
			} else{
				window.attachEvent("onscroll", moveLayer);
			}
			CheckPopup = true;
		}else
		{
			alert("ÀÌ¹Ì ÆË¾÷Ã¢ÀÌ ¶°ÀÖ½À´Ï´Ù.\n\nÆË¾÷Ã¢À» Á¦°ÅÇÑÈÄ ´Ù½Ã ½ÃµµÇØÁÖ¼¼¿ä.");
		}
	}else
	{
		if( confirm('·Î±×ÀÎÀ» ÇÏ¼Å¾ß ¼Ò¼³¹æ ¸¸µé±â°¡ °¡´ÉÇÕ´Ï´Ù.\n\n·Î±×ÀÎÇÏ½Ã°Ú½À´Ï±î?') )
		{
			var back_url = escape(top.location.href);
			top.location.href = "http://www.azoomma.com/customer_center/login_index.htm?back_url="+back_url;
		}
	}
}

//=== »õ·Î¾²´Â ¼Ò¼³ Æû Áö¿ì±â
function init_writer_form(locate)
{
	if(locate == "write")
	{
		delElement('backDIV',true);
	}
	delElement('inputForm',true);
	
	if (window.removeEventListener){
		window.removeEventListener("scroll", moveLayer, false);
	} else{
		window.detachEvent('onscroll',moveLayer);
	}
	CheckPopup = false;
}

//=== ¼Ò¼³ µî·Ï ÆûÃ¼Å©
var submit_count = 0;
function checkMake()
{
	if( submit_count > 0 )
	{
		alert("µ¥ÀÌÅÍ¸¦ Àü¼ÛÁßÀÔ´Ï´Ù.\n\nÀá½Ã¸¸ ±â´Ù·ÁÁÖ¼¼¿ä.");
		return false;
	}else
	{
		var f = document.input_Form;
		if( f.title.value == "" )
		{
			alert("Á¦¸ñÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.");
			f.title.focus();
			return false;
		}
		if( f.name.value == "" )
		{
			alert("ÀÛ°¡¸íÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.");
			f.name.focus();
			return false;
		}
		if( f.introduce.value == "" )
		{
			alert("¼Ò°³¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
			f.introduce.focus();
			return false;
		}
		submit_count++;
		f.submit();
	}
}
//=== ÀÛ°¡¹æ µî·Ï ÆûÃ¼Å©
var submit_count2 = 0;
function checkMake2()
{
	/*
	if( submit_count2 > 0 )
	{
		alert("µ¥ÀÌÅÍ¸¦ Àü¼ÛÁßÀÔ´Ï´Ù.\n\nÀá½Ã¸¸ ±â´Ù·ÁÁÖ¼¼¿ä.");
		return false;
	}else
	{
	*/
		var f = document.input_Form;
		if( f.title.value == "" )
		{
			alert("Á¦¸ñÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.");
			f.title.focus();
			return false;
		}
		if( f.name.value == "" )
		{
			alert("ÀÛ°¡¸íÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.");
			f.name.focus();
			return false;
		}
		if( f.introduce.value == "" )
		{
			alert("¼Ò°³¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
			f.introduce.focus();
			return false;
		}
		submit_count2++;
		return;
		//f.submit2();
	//}
}
//=== »õ·ÎÀº ³ªÀÇ±Û¹æ ¸¸µé±â
function new_author()
{
	if(getCookie( 'chat_name' ) != '')
	{
		if(CheckPopup == false)
		{
			//== ºê¶ó¿ìÁ®º° Åõ¸íµµ ¼³Á¤
			if(nowBrowser == "Mozilla")
			{
				var opa = "opacity:0.4;";
			}else
			{
				var opa = "filter:alpha(opacity=40);";
			}
		
			inputForm = document.createElement('DIV');
			inputForm.id = "inputForm";
			inputForm_top = document.body.scrollTop + (document.body.clientHeight / 2) - 135;
			inputForm_left = (document.body.clientWidth / 2) - 230;
			inputForm.style.cssText = "position:absolute; top:"+inputForm_top+"; left:"+inputForm_left+"; width:460px; height:270px; z-index:101;";
		
			var str = "<form name='input_Form' action='../_board/addCategory.php' method='post' target='hidden_frame' enctype='multipart/form-data' onsubmit='javascript:return checkMake2();'>";
			str += "<input type='hidden' name='mode' value='insert'>";
			str += "<input type='hidden' name='type' value='author'>";
			str += "<table width='500' border='0' align='center' cellpadding='0' cellspacing='0'>";
			str += "<tr>";
			str += "<td height='62' align='right' valign='top' background='/images/novel_images/layers_1.gif'><img src='/images/novel_images/layers_3.gif' onclick='javascript:init_writer_form(\"\");' style='cursor:pointer;'></td>";
			str += "</tr>";
			str += "<tr>";
			str += "<td background='/images/novel_images/layers_5.gif'>";
			str += "<table border='0' align='center' cellpadding='0' cellspacing='0'>";
			str += "<tr align='right' bgcolor='dbdbdb'>";
			str += "<td height='1' colspan='2'></td>";
			str += "</tr>";
			str += "<tr>";
			str += "<td width='85' style='padding-top:15px'>ÀÛ°¡ ±Û¹æ Á¦¸ñ</td>";
			str += "<td style='padding-top:12px'><input name='title' type='text' class='inp' style='width:200;height:20'></td>";
			str += "</tr>";
			str += "<tr>";
			str += "<td height='38'>ÀÛ°¡(¿¹)¸í</td>";
			str += "<td height='30'> <input name='name' type='text' class='inp' style='width:200;height:20'></td>";
			str += "</tr>";
			str += "<tr>";
			str += "<td height='32'>ÀÛ°¡ ±Û¹æ ¼Ò°³±Û</td>";
			str += "<td height='30'><textarea name='introduce' style='width:345;height:150' class='inp9' ></textarea>";
			str += "</td>";
			str += "</tr>";
			str += "<tr>";
			str += "<td height='32'>»çÁø¿Ã¸®±â</td>";
			str += "<td height='30'><input type='file' name='upfile' size='20'><br></font><font color=\"#888888\">(ÀÌ¹ÌÁö »çÀÌÁîÀÇ ÃÖÀûÈ­´Â 100*75 ÀÔ´Ï´Ù) </font></span>";
			str += "</td>";
			str += "</tr>";
			str += "<tr align='right'>";
			str += "<td height='15' colspan='2'></td>";
			str += "</tr>";
			str += "<tr align='right' bgcolor='dbdbdb'>";
			str += "<td height='1' colspan='2'></td>";
			str += "</tr>";
			str += "</table>";
			str += "</td>";
			str += "</tr>";
			str += "<tr>";
			str += "<td height='40' align='center' background='/images/novel_images/layers_5.gif' style='padding-top:10px'><input type='image' src='/images/novel_images/novel_popup_button4.gif'> &nbsp;<img src='/images/novel_images/novel_popup_button10.gif' onclick='javascript:init_writer_form(\"\");' style='cursor:pointer;'></td>";
			str += "</tr>";
			str += "<tr>";
			str += "<td><img src='/images/novel_images/layers_6.gif' width='500' height='10'></td>";
			str += "</tr>";
			str += "</table>";
			str += "</form>";
	
			inputForm.innerHTML = str;
			document.body.appendChild(inputForm);

			if (window.addEventListener){
				window.addEventListener("scroll", moveLayer, false);
			}else{
				window.attachEvent("onscroll", moveLayer);
			}
			CheckPopup = true;
		}else
		{
			alert("ÀÌ¹Ì ÆË¾÷Ã¢ÀÌ ¶°ÀÖ½À´Ï´Ù.\n\nÆË¾÷Ã¢À» Á¦°ÅÇÑÈÄ ´Ù½Ã ½ÃµµÇØÁÖ¼¼¿ä.");
		}
	}else
	{
		if( confirm('·Î±×ÀÎÀ» ÇÏ¼Å¾ß ³ªÀÇ ±Û¹æ ¸¸µé±â°¡ °¡´ÉÇÕ´Ï´Ù.\n\n·Î±×ÀÎÇÏ½Ã°Ú½À´Ï±î?') )
		{
			var back_url = escape(top.location.href);
			top.location.href = "http://www.azoomma.com/customer_center/login_index.htm?back_url="+back_url;
		}
	}
}