/*kim dae ho (propolo@hanmail.net)*/
var _Source_replyimo = "";


/* start : display string in a tag */
function _dp_string(str,cname,tag){
	return "<"+tag+" class=\""+cname+"\">"+str+"</"+tag+">";
}

/* start : make anchor and display (string and script style) */
function _dp_makeLink(style,dowhat,str,cname,proc){
	var rtnValue;
	if (style == "string"){
		if ( proc == "_sample" || dowhat == '')
			rtnValue = "<A HREF=# OnClick=\"return false;\" CLASS=\""+cname+"\">" + str + "</A>";
		else
			rtnValue = "<A HREF=" + dowhat + " CLASS="+cname+">" + str + "</A>";
	}else if (style == "script"){
		if ( proc == "_sample" || dowhat == '')
			rtnValue = "<A HREF=# OnClick=\"return false;\" CLASS=\""+cname+"\">" + str + "</A>";
		else
			rtnValue = "<A HREF=# onClick=\"" + dowhat + ";return false;\" CLASS="+cname+">" + str + "</A>";
	}else
		rtnValue = _dp_string(str,cname,"span");
	return rtnValue;
}

/* start : display image (logo) */
function _dp_image(ipath,iname,iwsize,ihsize,imsize,idpath,idname,cname,vflag,proc){
		var rtnValue='';
		if (vflag == true){
			var rwsize,rheight;
			var strTag;
			var strScript;
			if ( iname == '')
				rtnValue += "<img src="+idpath+idname+" BORDER=0 CLASS=\""+cname+"\">";
			else{
				if(iwsize > imsize){
					rhsize = Math.round(imsize * ihsize / iwsize);rwsize = imsize;
				}else{
					rhsize = ihsize;rwsize = iwsize;
				}
				strScript = "oriImgview('" +  ipath+iname + "'," + iwsize + "," + ihsize + ",'logo')";
				strTag = "<img src="+ipath+iname+" width="+rwsize+" height="+rhsize+" BORDER=0 CLASS=\""+cname+"\">";
				rtnValue += _dp_makeLink("script",strScript,strTag,cname,proc);
			}
		}
		return rtnValue;
}

/* start : display list (type #1)*/
function _dp_list_type1(vflag,cname,arrLen,arrLink,arrTitle,linkPath,linkOpt,proc){
	var rtnValue = "";
	if ( vflag == true ){
		rtnValue += "<DIV CLASS=\""+cname+"\">\r\n";
		if ( arrLen >= 0 ){
			for (i = 0; i <= arrLen; i++){
				if ( proc != "_sample" )
					rtnValue += "<LI CLASS=\""+cname+"\">"+_dp_makeLink("string",linkPath + arrLink[i] + linkOpt,arrTitle[i],cname,proc)+"</LI>";
				else
					rtnValue += "<LI CLASS=\""+cname+"\">"+_dp_makeLink("script","",arrTitle[i],cname,proc)+"</LI>";				
			}
		}
		rtnValue += "	</DIV>\r\n";
	}
	return rtnValue;
}

/* start : display list (type #2)*/
function _dp_list_type2(vflag,cname,arrLen,arrLink,arrTitle,linkPath,linkOpt,proc,arrOpt1,arrOpt2){
	var rtnValue = "";
	if ((typeof(arrOpt1) != "undefined")&&(typeof(arrOpt2) != "undefined")){
		if ( vflag == true ){
			rtnValue += "<DIV CLASS=\""+cname+"\">\r\n";
			if ( arrLen >= 0 ){
				for (i = 0; i <= arrLen; i++){
					rtnValue += "<LI CLASS=\""+cname+"\"><SPAN CLASS=\""+cname+"_small\">[" + arrOpt2[i] + " / " + arrOpt1[i] + "]</SPAN> <br>";
					if ( proc != "_sample" )
						rtnValue += ""+_dp_makeLink("string",linkPath + arrLink[i] + linkOpt,arrTitle[i],cname,proc)+" ";
					else
						rtnValue += "<LI CLASS=\""+cname+"\">"+_dp_makeLink("script","",arrTitle[i],cname,proc)+" ";
					rtnValue += "</LI>";
					}
				}
			rtnValue += "	</DIV>\r\n";
		}
	}else
		rtnValue = _dp_list_type1(vflag,cname,arrLen,arrLink,arrTitle,linkPath,linkOpt,proc);

	return rtnValue;
}

/* start : display date (korean type)*/
function _dp_date_kor(daydate,hhmmview){
	var rtnValue = '';
	if (typeof(daydate) != 'undefined'){
		var yymmdd = daydate.substring(0,10).split("-");
		rtnValue +=	yymmdd[0] + "³â " + yymmdd[1] + "¿ù " + yymmdd[2] + "ÀÏ";
		if (hhmmview == true){rtnValue += "("+daydate.split(" ")[1]+")";}
	}
	return rtnValue;
}

/* start : display archivepost subject per page*/
function _dp_perPageArchiveSubject(archivepostdate){
	var rtnValue = '';
	archivepostdate = archivepostdate.substring(0,10).split("-");
	rtnValue += archivepostdate[0] + "³â " + archivepostdate[1] + "¿ù¿¡ ÀÛ¼ºµÈ ±Û";
	return rtnValue;
}

/* start : display archivepost list per page*/
function _dp_perPageArchiveList(postcount,postonoff,postidx,postsubject,postdate,postunick,uppageflag,downpageflag,cname,proc){
	var rtnValue = "";
	if (uppageflag == true){rtnValue += "<span class=\"small\">(ÇØ´ç¿ùÀÇ ÀÌÈÄ³¯Â¥¿¡ ÀÛ¼ºµÈ ±ÛÀÌ ÀÖ½À´Ï´Ù.)</span><br>";}
	for (var i = 0; i <= postcount; i++){
		rtnValue += "<LI CLASS="
		if ( postonoff[i] == false )
			rtnValue +=  + cname + ">";
		else
			rtnValue +=  + cname + "_off>";

		rtnValue += _dp_makeLink("string","#" + postidx[i],postsubject[i],cname,proc);
		rtnValue += " <SPAN CLASS=\""+cname+"_small\">[" + postdate[i] + postunick[i] + "]</SPAN></LI>";
	}
	if (downpageflag == true){rtnValue += "<br><span class=\"small\">(ÇØ´ç¿ùÀÇ ÀÌÀü³¯Â¥¿¡ ÀÛ¼ºµÈ ±ÛÀÌ ÀÖ½À´Ï´Ù.)</span>";}
	return rtnValue;
}

/* start : ºí·Î±× È¨ÆäÀÌÁö ´º½ºÇü Æ÷½ºÆ® Ã³¸®*/
function _dp_wzPostBody(postidx,postsubject,postonoff,postimagefilename,postimagefilewidth,postimagefileheight,postimagefilepath,postcontent,blogid,postdate,postgroupidx,postgroupsubject,proc){
	var rtnValue = "";
	var mainString = "";
	var imgTag = "";
	mainString += _dp_makeLink("string",_Source_homeUrl + "/" + postidx.toString() + "/",_dp_string(postsubject,"wzpostsubject","span"),"wzpostsubject",proc);
	mainString += "<br>" + _dp_string(postcontent+" ...","wzpostcontent","span");
	mainString += "<br>" + _dp_string(_dp_makeLink("string",_Source_homeUrl + "/_clist/_" + postgroupidx + "/","- " + postgroupsubject,"wzpostgroupsubject",proc) + " | " + _dp_makeLink("string",_Source_homeUrl + "/" + postidx.toString() + "/",_dp_date_kor(postdate,true),"wzpostgroupsubject",proc),"wzpostnavi","div");
	if (postimagefilename != ""){
		if (postimagefilewidth > 150){
			var imgwidth = 150;
			var imgheight = Math.round((150) * postimagefileheight / postimagefilewidth);
			if (imgheight > 190){imgheight = 190;}
		}else{
			var imgwidth = postimagefilewidth;
			var imgheight = postimagefileheight;
		}
		imgTag += _dp_makeLink("script","oriImgview(\'" +  postimagefilepath + postimagefilename + "\'," + postimagefilewidth + "," + postimagefileheight + ",'1')","<IMG CLASS=wzpostimg SRC=\"" + postimagefilepath + postimagefilename + "\" BORDER=0 WIDTH=" + imgwidth.toString() + " HEIGHT=" + imgheight.toString() + " ALIGN=LEFT>","wzpostimg",proc);
	}
	rtnValue += "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=\"100%\">";
	rtnValue += "<TR><TD WIDTH=100%>";
	rtnValue += imgTag + mainString;
	rtnValue += "</TD></TR>";
	rtnValue += "</TABLE>";	
	return rtnValue;
}

/* start : disply post edit, del menu */
function _dp_postMenu(postwriter,postidx){
	var rtnValue = "";
	if (_Source_visitorLevel == 5 || _Source_visitorId == postwriter ){
		rtnValue += _dp_makeLink("string",_Ctrl_urlPostEdit + "?bid=" + _Source_blogId + "&idx=" + postidx.toString() + "&rtnurl=" + _Ctrl_urlReturn,_Ctrl_btnPostEdit,"btnpostedit",_Ctrl_proc);
		rtnValue += " " + _Ctrl_separatorPostBtn + " ";
		rtnValue += _dp_makeLink("script","delPost2(\'" + postwriter + "\',\'" + _Source_blogId + "\',\'" + postidx.toString() + "\','" + _Ctrl_urlReturn + "','" + _Ctrl_Session + "')",_Ctrl_btnPostDel,"btnpostdel",_Ctrl_proc)+" ";
	}else
		rtnValue += "&nbsp;&nbsp;";
	return rtnValue;
}

/* start : disply post subject */
function _dp_postSubject(postidx,postsubject,postonoff){
	var rtnValue="";
	if ( postonoff != true )
		rtnValue += "¢Ò ";
	rtnValue += "<A NAME=\"" + postidx + "\">" + postsubject + "</A>";
	return rtnValue;
}

/* start : display post body (content) */
function _dp_postBody(blogmainurl,blogid,postidx,attatchname,attatchfilename,attatchfilepath,attatchfilesize,postimagewidth,postimageheight,postimagepath,postimagename,postimagemaxwidth,proc,postcontent,postimagesize){
	var rtnValue = "";
	rtnValue += _dp_string(_dp_makeLink("string",blogmainurl + "/" + blogid + "/" + postidx + "/",blogmainurl + "/" + blogid + "/" + postidx + "/","posturl",proc),"posturl","span");
	if (attatchname != '')
		rtnValue += "<br>" + _dp_string("+ Ã·ºÎÆÄÀÏ : " + _dp_makeLink("string",attatchfilepath + attatchfilename + " target=_blank",attatchname + "("+attatchfilesize+"MBytes)","attatch",proc),"attatch","span") + "<br>";
	rtnValue += "<br><br>";
	if (postimagename != "" && postimagesize != ""){
			if (postimagewidth > postimagemaxwidth){var imgwidth = postimagemaxwidth;var imgheight = Math.round(postimagemaxwidth * postimageheight / postimagewidth);}else{var imgwidth = postimagewidth;var imgheight = postimageheight;}
			rtnValue += "<CENTER>"+_dp_makeLink("script","oriImgview('" +  postimagepath + postimagename + "'," + postimagewidth + "," + postimageheight + ",'post')","<IMG SRC=\"" + postimagepath + postimagename + "\" BORDER=0 WIDTH=" + imgwidth.toString() + " HEIGHT=" + imgheight.toString() + ">","",proc)+"</CENTER>";
	}
	rtnValue += postcontent.replace(/\<\/?script[^\>]*\>/ig,'');
	return rtnValue;
}

/* start : display post navigation (ref info) */
function _dp_postNavi(homeurl,postgroupidx,postgroupsubject,proc,postwriternick,postidx,postdate,posttrbflag,posttrbcnt,blogid,postrpycnt,postrpyflag,rpypemwrite,postsubject,postwriterbid,mainurl){
	var rtnValue = "";
		rtnValue += " -  " + _dp_makeLink("string",homeurl + "/_clist/_" + postgroupidx,postgroupsubject,"postnavi_clist",proc) + " - <br>";
	if ( posttrbflag == true ){
			rtnValue += _dp_makeLink("script","trbview(\'" + postidx + "\',\'" + blogid + "\',\'" + homeurl + "/" + postidx.toString() + "\',\'" + postsubject + "\',\'" + proc + "\',\'" + _Ctrl_urlReturn + "\')","<B>¿«ÀÎ±Û<SPAN ID=trbcnt" + postidx.toString() + ">" + posttrbcnt + "</SPAN>°Ç</B>","postnavi_trb",proc);
	}
	if ( postrpyflag == true ){
			rtnValue +=  "&nbsp;&nbsp;"+ _dp_makeLink("script","rpyview(\'" + postidx + "\',\'" + blogid + "\',\'" + proc + "\',\'" + rpypemwrite + "\')","<B>¸®ÇÃ<SPAN ID=rpycnt" + postidx.toString() + ">" + postrpycnt + "</SPAN>°Ç</B>","postnavi_rpy",proc);
	}
	rtnValue += _dp_string(" | " + _dp_makeLink("string",mainurl+"/"+postwriterbid+"/",postwriternick,"postnavi_nick",proc) + " | "+_dp_makeLink("string",homeurl+"/"+postidx.toString() + "/",postdate,"postnavi_day",proc),"postsubmenu","span");
	rtnValue += " " + _dp_makeLink("string","#","(¡ètop)","postnavi_top",proc) + " ";
	return rtnValue;
}

/* start : disply uppagebtn */
function _dp_upPageBtn(pageflag,blogurl,proc,upidx,extra,upbtn){
	var rtnValue = "";
	if (pageflag == true)
		rtnValue += _dp_makeLink("string",blogurl + "/" + proc + "_uppg/" + upidx.toString() + "_" + extra.toString() + "/",upbtn,"naviupdown",proc);
	else
		rtnValue +=  upbtn;
	return rtnValue;
}
/* start : display downpagebtn */
function _dp_downPageBtn(pageflag,blogurl,proc,downidx,extra,downbtn){
	var rtnValue = "";
	if (pageflag == true)
		rtnValue += _dp_makeLink("string",blogurl + "/" + proc + "_downpg/" +downidx.toString() + "_" + extra.toString() + "/",downbtn,"naviupdown",proc);
	else
		rtnValue += downbtn;
	return rtnValue;
}

function _dp_levelment(visitorLevel){
	var rtnValue = "";
	switch(visitorLevel){
		case "0" :
			rtnValue = "±ÇÇÑÀÌ ¸ðµç »ç¿ëÀÚ¿¡°Ô Çã¿ëµÇ¾î ÀÖ½À´Ï´Ù.";
			break;
		case "1" :
			rtnValue = "±ÇÇÑÀÌ ·Î±×ÀÎ »ç¿ëÀÚ ÀÌ»óÀÇ µî±ÞÀ¸·Î ¼³Á¤µÇ¾î ÀÖ½À´Ï´Ù.";
			break;
		case "2" :
			rtnValue = "±ÇÇÑÀÌ ÀÌ¿ôºí·Î°Å ÀÌ»óÀÇ µî±ÞÀ¸·Î ¼³Á¤µÇ¾î ÀÖ½À´Ï´Ù.";
			break;
		case "3" :
			rtnValue = "±ÇÇÑÀÌ Âòºí·Î°Å ÀÌ»óÀÇ µî±ÞÀ¸·Î ¼³Á¤µÇ¾î ÀÖ½À´Ï´Ù.";
			break;
		case "4" :
			rtnValue = "Ä£±¸ºí·Î°Å ÀÌ»óÀÇ µî±ÞÀ¸·Î ¼³Á¤µÇ¾î ÀÖ½À´Ï´Ù.";
			break;
		case "5" :
			rtnValue = "±ÇÇÑÀÌ ¿î¿µÀÚ µî±ÞÀ¸·Î ¼³Á¤µÇ¾î ÀÖ½À´Ï´Ù.";
			break;
	}
	return rtnValue;
}

function _dp_perPostTrbRpy(homeurl,postidx,visitorid,visitorhasblog,visitorblogid,blogmainurl,visitornick,proc,blogid,urllogin,urlreturn,visitorlevel,session,trbviewflag,trbsubject,trbcount,trburl,trbblogsubject,trbdate,trbwriter,trbidx,trbtitle,trbtext,replyviewflag,replyonoff,replycount,replyidx,replyblogurl,replywriter,replywriternick,replydate,replycontent,replypemwrite, replyimo){
	var rtnValue = "";
	if (proc == "_view"){
		var tmpValue = "";
		var tmpStrTrbWrite = "[±Û¿«±â]&nbsp;&nbsp;³» ºí·Î±×¿¡ ¿«ÀÎ±Û ÀÛ¼ºÇÏ±â";
		var tmpTrbLinkType	= "";
		var tmpStrTrbLink = "";
		if (trbviewflag == true){
			if (visitorid == ''){
				tmpTrbLinkType = "string";
				tmpStrTrbLink = urllogin + "?gotoURL=" + urlreturn;
			} else if (visitorhasblog == true){
				tmpTrbLinkType = "script";
				tmpStrTrbLink = "postreftrb(\'" + escape(trbsubject) + "\',\'" + homeurl + "/" + postidx + "\',\'" + proc + "\',\'" + postidx + "\',\'" + blogid + "\',\'" + urlreturn + "\')";
			} else {
				tmpTrbLinkType = "script";
				tmpStrTrbLink = "qnaCreateBlog(\'" + visitorid + "\',\'" + urlreturn + "\')";
			}

			rtnValue += " ÁÖÁ¦ : " + _dp_string(trbsubject,"trackback_subject","span") + "<br>";
			rtnValue += " URL : " + _dp_string(homeurl + "/" + postidx+"/","small2","span") + "<br>";
			rtnValue += " ¡æ " + _dp_makeLink(tmpTrbLinkType,tmpStrTrbLink,tmpStrTrbWrite,"trackback_write",proc) + "<br>";
			rtnValue = _dp_string(rtnValue,"trackback_head","div");

			if (parseInt(trbcount)>0){rtnValue += _dp_string("","reply_hr","div");}
			for (var i=0;i <= (parseInt(trbcount)-1);i++){
				tmpValue = "¿«ÀÎ±Û from " + _dp_makeLink("string",trburl[i]+"/ target=_blank","<B>" + trbblogsubject[i] + "</B>","",proc) + " (" +  _dp_date_kor(trbdate[i],true) + ") ";
				if (visitorlevel == 5 || visitorid == trbwriter[i]){
					tmpValue += _dp_makeLink("script","deltrackback(\'" + trbidx[i] + "\',\'" + postidx + "\',\'" + blogid + "\',\'" + trbwriter[i] + "\',\'" + trburl[i] + "\',\'" + trbtitle[i] + "\',\'" + proc + "\',\'" + urlreturn + "\',\'" + session + "\')","¨ä","reply_del",proc);
				}
				rtnValue += _dp_string(tmpValue,"reply_title","div");
				rtnValue += _dp_string(" ¡¤ <b>Á¦¸ñ</b> : " + _dp_makeLink("string",trburl[i]+"/ target=_blank",trbtitle[i],"trackback_title",proc) + "<BR>  ¡¤  <b>³»¿ë</b> : " + trbtext[i] + " ... " + _dp_makeLink("string",trburl[i]+"/ target=_blank","ÀüÃ¼º¸±â","trackback_more",proc),"reply_ment","div");
			}
			rtnValue += _dp_string("","reply_hr","div");
		}
		tmpValue = "";
		if (replyviewflag == true && parseInt(replycount) >0){
			for (var i=0; i <= (parseInt(replycount)-1) ;i++ ){
				if (replyonoff[i] == false){tmpValue = "¢Ò "}
				tmpValue += "<img align=absmiddle src=" + replyimo[i] + "> ";
				if (replyblogurl[i] != "")
					tmpValue += _dp_makeLink("string",replyblogurl[i],"<B>" + replywriternick[i] + "</B>","reply_writernick",proc);
				else
					tmpValue += "<B>" + replywriternick[i] + "</B>";
				tmpValue += " &nbsp;&nbsp;&nbsp;" + _dp_date_kor(replydate[i],true) + "&nbsp;";
				if( visitorlevel == 5 || (visitorid != "" && replywriter[i] == visitorid))
					tmpValue += _dp_makeLink("script","qnaDelReply(\'" + blogid +  "\',\'" + postidx.toString() + "\',\'" + replyidx[i].toString() + "\',\'" + replywriter[i] + "\',\'" + proc + "\',\'" + session + "\')","¨ä","reply_del",proc);
				else if (replywriter[i] == "")
					tmpValue += _dp_makeLink("script","delReply(\'" + blogid +  "\',\'" + postidx.toString() + "\',\'" + replyidx[i].toString() + "\',\'" + replywriter[i] + "\',\'" + proc + "\',\'" + session + "\')","¨ä","reply_del",proc);
				tmpValue = _dp_string(tmpValue,"reply_title","div");
				if ( ( visitorlevel == 5 && replyonoff[i] == false ) || ( replywriter[i] != "" && replywriter[i] == visitorid && replyonoff[i] == false ) || replyonoff[i] == true )
					tmpValue += _dp_string(replycontent[i],"reply_ment","div");
				else{
					tmpValue += _dp_string("ºí·Î±× È¨ÆäÀÌÁö °³¼³ÀÚ¿Í ¸®ÇÃ ÀÛ¼ºÀÚ¿¡°Ô¸¸ º¸¿©Áö´Â ºñ°ø°³ ¸®ÇÃÀÔ´Ï´Ù.","reply_secret","div");
				}
			}
		}
			tmpValue += _dp_string("","reply_hr","div");
		if (replyviewflag == true){
			tmpValue += "		<DIV CLASS=reply_write>\r\n";
			tmpValue += "[¸®ÇÃ ¾²±â] <br>\r\n";
			tmpValue += "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=90% ALIGN=CENTER>\r\n";
			tmpValue += "<FORM FORM NAME=rpyform TARGET=ifrmrt ACTION=" + blogmainurl + "/_blogpost/_execReplyInsert.html METHOD=POST onSubmit=\"return writeReply(document.rpyform," + visitorlevel + ");\">\r\n";
			tmpValue += "<INPUT TYPE=HIDDEN NAME=bid VALUE=" + blogid + ">\r\n";
			tmpValue += "<INPUT TYPE=HIDDEN NAME=idx VALUE=" + postidx + ">\r\n";
			tmpValue += "<INPUT TYPE=HIDDEN NAME=skproc VALUE=" + proc + ">\r\n";
			tmpValue += "<TR HEIGHT=30><TD COLSPAN=5><table width=100% cellpadding=0 cellspacing=0><tr><td align=center><img src=/_blogpost/images/happy.gif></td><td align=center><img src=/_blogpost/images/evil.gif></td><td align=center><img src=/_blogpost/images/confused.gif></td><td align=center><img src=/_blogpost/images/dog.gif></td><td align=center><img src=/_blogpost/images/ermm.gif></td><td align=center><img src=/_blogpost/images/Disappointed.gif></td><td align=center><img src=/_blogpost/images/grin.gif></td><td align=center><img src=/_blogpost/images/cheeky.gif></td><td align=center><img src=/_blogpost/images/depressed.gif></td></tr><td align=center><input type=radio name=imo checked value=/_blogpost/images/happy.gif></td><td align=center><input type=radio name=imo value=/_blogpost/images/evil.gif></td><td align=center><input type=radio name=imo value=/_blogpost/images/confused.gif></td><td align=center><input type=radio name=imo value=/_blogpost/images/dog.gif></td><td align=center><input type=radio name=imo value=/_blogpost/images/ermm.gif></td><td align=center><input type=radio name=imo value=/_blogpost/images/Disappointed.gif></td><td align=center><input type=radio name=imo value=/_blogpost/images/grin.gif></td><td align=center><input type=radio name=imo value=/_blogpost/images/cheeky.gif></td><td align=center><input type=radio name=imo value=/_blogpost/images/depressed.gif></td></tr></table></TD></TR>\r\n";
			if(visitorlevel == 0){
				tmpValue += "<TR HEIGHT=26>\r\n";
				tmpValue += "	<TD WIDTH=60>ÀÌ ¸§ : </TD>\r\n";
				tmpValue += "	<TD><INPUT TYPE=TEXT NAME=name MAXLENGTH=10 CLASS=REPLYINPUT STYLE=WIDTH:100></TD>\r\n";
				tmpValue += "	<TD WIDTH=20></TD>\r\n";
				tmpValue += "	<TD WIDTH=80>ºñ¹Ð¹øÈ£ : </TD>\r\n";
				tmpValue += "	<TD><INPUT TYPE=password NAME=passwd MAXLENGTH=10 CLASS=REPLYINPUT STYLE=WIDTH:100></TD></TR>\r\n";
				tmpValue += "<TR><TD COLSPAN=5 HEIGHT=5></TD></TR>\r\n";
			}else{
				tmpValue += "	<INPUT TYPE=hidden NAME=name VALUE=" + visitornick + ">\r\n";
				tmpValue += "	<INPUT TYPE=hidden NAME=passwd VALUE=" + visitorid + ">\r\n";
				if (visitorhasblog == true)
					tmpValue += "	<INPUT TYPE=hidden NAME=homepage VALUE=" + blogmainurl + "/" + visitorblogid + "/>\r\n";
			}
			tmpValue += "<TR><TD COLSPAN=5><TEXTAREA NAME=comment CLASS=REPLYINPUT COLS=50 ROWS=3";
			if (parseInt(visitorlevel) < parseInt(replypemwrite))
				tmpValue += " readonly";
			tmpValue += ">";
			if (parseInt(visitorlevel) < parseInt(replypemwrite))
				tmpValue += _dp_levelment(replypemwrite);
			tmpValue +=	"</TEXTAREA></TD></TR>\r\n";
			tmpValue += "<TR><TD COLSPAN=5>\r\n";
			tmpValue += "	 <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=90% >\r\n";
			tmpValue += "	 <TR><TD WIDTH=50% ALIGN=LEFT><INPUT TYPE=CHECKBOX NAME=security VALUE=0> ºí·Î±× ÁÖÀÎ¿¡°Ô¸¸ º¸ÀÌ±â</TD>\r\n";
			tmpValue += "		 <TD WIDTH=50% HEIGHT=20 ALIGN=RIGHT><INPUT TYPE=submit VALUE=\"¸®ÇÃ ÀúÀå\" STYLE='CURSOR:HAND;PADDING:2 0 0 0;BORDER:BFAE78 1 SOLID;BACKGROUND-COLOR: EFEFEF'";
			if (parseInt(visitorlevel) < parseInt(replypemwrite))
				tmpValue += " DISABLED";
			tmpValue += "></TD></FORM></TR>\r\n";
			tmpValue += "	 </TABLE></TD></TR>\r\n";
			tmpValue += "</TABLE>\r\n";
			tmpValue += "		</DIV>\r\n";
		}

		rtnValue += tmpValue;
		rtnValue = _dp_string(rtnValue,"reply","div");
	}
	return rtnValue;
}
/* start : parse*/
function _dp_parsePost(){
	if (_Source_perPagePostCount >= 0  && _Ctrl_proc == "_mlist" ){
		_Output_perPageArchiveSubject	= _dp_perPageArchiveSubject(_Source_perPagePostDate.split("|")[0]);
		_Output_perPageArchiveList		= _dp_perPageArchiveList(_Source_perPagePostCount,_Source_perPagePostOnoff,_Source_perPagePostIdx.split("|"),_Source_perPagePostSubject,_Source_perPagePostDate.split("|"),_Source_perPagePostWriterNick,_Source_upPageFlag,_Source_downPageFlag,"archivepost",_Ctrl_proc);
	}
	for (var i = 0; i <= _Source_perPagePostCount; i++){
		if ((_Ctrl_proc == "_list" || _Ctrl_proc == "_sample" ) && _Ctrl_listType == "1"){
			_Output_perPagePostBody[i] = _dp_wzPostBody(_Source_perPagePostIdx.split("|")[i],_Source_perPagePostSubject[i],_Source_perPagePostOnoff[i],_Source_perPagePostImageName[i],_Source_perPagePostImageWidth.split("|")[i],_Source_perPagePostImageHeight.split("|")[i],_Source_perPagePostImagePath.split("|")[i],_Source_perPagePostContent[i],_Source_perPagePostWriterBid.split("|")[i],_Source_perPagePostDate.split("|")[i],_Source_perPagePostGroupIdx.split("|")[i],_Source_perPagePostGroupSubject[i],_Ctrl_proc);
		}else{
			_Output_perPagePostMenu[i] = _dp_postMenu(_Source_perPagePostWriter.split("|")[i],_Source_perPagePostIdx.split("|")[i]);
			_Output_perPagePostSubject[i] = _dp_postSubject(_Source_perPagePostIdx.split("|")[i],_Source_perPagePostSubject[i],_Source_perPagePostOnoff[i]);
			_Output_perPagePostBody[i]	= _dp_postBody(_Source_blogMainUrl,_Source_blogId,_Source_perPagePostIdx.split("|")[i],_Source_perPagePostAttatchName[i],_Source_perPagePostAttatchFileName[i],_Source_perPagePostAttatchFilePath.split("|")[i],_Source_perPagePostAttatchFileSize.split("|")[i],_Source_perPagePostImageWidth.split("|")[i],_Source_perPagePostImageHeight.split("|")[i],_Source_perPagePostImagePath.split("|")[i],_Source_perPagePostImageName[i],_Ctrl_postImageMaxWidth,_Ctrl_proc,_Source_perPagePostContent[i],_Source_perPostImageSize.split("|")[i]);
			_Output_postNavi[i]	= _dp_postNavi(_Source_homeUrl,_Source_perPagePostGroupIdx.split("|")[i],_Source_perPagePostGroupSubject[i],_Ctrl_proc,_Source_perPagePostWriterNick[i],_Source_perPagePostIdx.split("|")[i],_Source_perPagePostDate.split("|")[i],_Source_perPagePostTrbFlag[i],_Source_perPagePostTrbCount.split("|")[i],_Source_blogId,_Source_perPagePostRpyCount.split("|")[i],_Source_perPagePostRpyFlag[i],_Source_perPagePostRpyPemWrite.split("|")[i],_Source_perPagePostSubject[i],_Source_perPagePostWriterBid.split("|")[i],_Source_blogMainUrl);
			_Output_perPagePostCrt[i] = "<SPAN ID=crt" + _Source_perPagePostIdx.split("|")[i] + ">" + _dp_perPostTrbRpy(_Source_homeUrl,_Source_perPagePostIdx.split("|")[i],_Source_visitorId,_Source_visitorHasBlog,_Source_visitorBlogId,_Source_blogMainUrl,_Source_visitorNick,_Ctrl_proc,_Source_blogId,_Ctrl_urlLogin,_Ctrl_urlReturn,_Source_visitorLevel,_Ctrl_Session,_Source_perPagePostTrbFlag[i],_Source_perPagePostSubject[i],_Source_perPagePostTrbCount.split("|")[i],_Source_trbUrl.split("|"),_Source_trbBlogSubject,_Source_trbDate.split("|"),_Source_trbWriter.split("|"),_Source_trbIdx.split("|"),_Source_trbTitle,_Source_trbText,_Source_perPagePostRpyFlag[i],_Source_replyOnoff,_Source_perPagePostRpyCount.split("|")[i],_Source_replyIdx.split("|"),_Source_replyBlogUrl.split("|"),_Source_replyWriter.split("|"),_Source_replyWriterNick,_Source_replyDate.split("|"),_Source_replyContent,_Source_perPagePostRpyPemWrite.split("|")[i],_Source_replyimo.split("|")) + "</SPAN>";
		}			
	}
}
function _dp_parsing(){
	_Output_homeSubject = _dp_makeLink("string",_Source_homeUrl+"/",_Source_homeSubject,"homesubject",_Ctrl_proc);
	_Output_homeUrl = _dp_makeLink("string",_Source_homeUrl+"/",_Source_homeUrl+"/","homeurl",_Ctrl_proc);
	_Output_copyright = _dp_string(_Source_copyright,"homecopyright","span");
	_Output_homeLogo = _dp_image(_Source_homeLogoPath,_Source_homeLogoName,_Source_homeLogoWidth,_Source_homeLogoHeight,_Ctrl_homeLogoMaxWidth,'',_Source_defaultLogoUrl,"logo",_Source_homeLogoView,_Ctrl_proc);
	_Output_homeIntro = _dp_string(_Source_homeIntro,"homeintro","span");
	_Output_homeOwnerNick = _dp_string("&nbsp;&nbsp;by " + _Source_homeOwnerNick,"ownernick","span");
	_Output_homeVisit = _dp_string("¡¤Today : " + _Source_homeVisitToday.toString() + " <br>¡¤Total : " + _Source_homeVisitTotal.toString(),"visit","span");
	_Output_homeCalendar = _dp_calendar();
	_Output_homeMenu = _dp_list_type2(_Source_homeMenuView,"homemenu",_Source_homeMenuCount,_Source_homeMenuIdx.split("|"),_Source_homeMenuName,_Source_homeUrl + "/_clist/_","/",_Ctrl_proc);
	_Output_homeArchive = _dp_list_type2(_Source_homeArchiveView,"homearchive",_Source_homeArchiveCount,_Source_homeArchiveLink.split("|"),_Source_homeArchiveDate.split("|"),_Source_homeUrl + "/_mlist/_","/",_Ctrl_proc);
	_Output_homeFavorite = _dp_list_type2(_Source_homeFavoriteView,"homefavorite",_Source_homeFavoriteCount,_Source_homeFavoriteBlogid.split("|"),_Source_homeFavoriteSubject,_Source_blogMainUrl + "/","/",_Ctrl_proc);
	_Output_homeLastReply = _dp_list_type2(_Source_homeLastReplyView,"homelastrpy",_Source_homeLastReplyCount,_Source_homeLastReplyIdx.split("|"),_Source_homeLastReplyText,_Source_homeUrl + "/","/",_Ctrl_proc,_Source_homeLastReplyNick,_Source_homeLastReplyDate.split("|"));
	_Output_homeVisitBloger = _dp_list_type2(_Source_homeVisitBlogerView,"homevisitbloger",_Source_homeVisitBlogerCount,_Source_homeVisitBlogerBid.split("|"),_Source_homeVisitBlogerSubject,_Source_blogMainUrl + "/","/",_Ctrl_proc);
	if (_Source_homeFreezoneView == true){_Output_homeFreezone=_dp_string(_Source_homeFreezoneHtml,"homefzone","div");}else{_Output_homeFreezone="";}
	_Output_noMorePost = _dp_string("+ µî·ÏµÈ ³»¿ëÀÌ ¾ø½À´Ï´Ù. +","nomorepost","div");
	_dp_parsePost();
	_Output_upPageBtn = _dp_upPageBtn(_Source_upPageFlag,_Source_homeUrl,_Ctrl_proc,_Source_upPageIdx,_Ctrl_extra,_Ctrl_btnUpPage);
	_Output_downPageBtn = _dp_downPageBtn(_Source_downPageFlag,_Source_homeUrl,_Ctrl_proc,_Source_downPageIdx,_Ctrl_extra,_Ctrl_btnDownPage);
}
function _dp_outerpulldata(sourceHTML,subject,url,post,uplink,downlink,logo,intro,nick,visit,calendar,copyright,lmenu,rmenu){
	var rtnValue = sourceHTML;
	rtnValue = rtnValue.replace(/\<\+_rslt_subject_url\+\>/g,subject);
	rtnValue = rtnValue.replace(/\<\+_rslt_blogurl\+\>/g,url);
	rtnValue = rtnValue.replace(/\<\+post\+\>/g,post);
	rtnValue = rtnValue.replace(/\<\+_rslt_uppostlink\+\>/g,uplink);
	rtnValue = rtnValue.replace(/\<\+_rslt_downpostlink\+\>/g,downlink);
	rtnValue = rtnValue.replace(/\<\+_rslt_bloglogo\+\>/g,logo);
	rtnValue = rtnValue.replace(/\<\+_rslt_blogintro\+\>/g,intro);
	rtnValue = rtnValue.replace(/\<\+_rslt_blogunick\+\>/g,nick);
	rtnValue = rtnValue.replace(/\<\+_rslt_blogvisit\+\>/g,visit);
	rtnValue = rtnValue.replace(/\<\+_rslt_calendar\+\>/g,calendar);
	rtnValue = rtnValue.replace(/\<\+_rslt_copyrights\+\>/g,copyright);
	rtnValue = rtnValue.replace(/\<\+menuleft\+\>/g,lmenu);
	rtnValue = rtnValue.replace(/\<\+menuright\+\>/g,rmenu);
	return rtnValue;
}
function _dp_wzpostpulldata(sourceHTML,cont){return sourceHTML.replace(/\<\+postcont\+\>/g,cont);}
function _dp_postpulldata(sourceHTML,subject,cmn,cont,navi,rpyview){
	var rtnValue = sourceHTML;
	rtnValue = rtnValue.replace(/\<\+postcmn\+\>/g,cmn);
	rtnValue = rtnValue.replace(/\<\+postnavi\+\>/g,navi);
	rtnValue = rtnValue.replace(/\<\+postsubject\+\>/g,subject);
	rtnValue = rtnValue.replace(/\<\+postcont\+\>/g,cont);
	rtnValue = rtnValue.replace(/\<\+rpyview\+\>/g,rpyview);
	return rtnValue;
}
function _dp_menupulldata(sourceHTML,ttl,cont){
	var rtnValue = sourceHTML;
	rtnValue = rtnValue.replace(/\<\+bhmntitle\+\>/g,ttl);
	rtnValue = rtnValue.replace(/\<\+bhmnbody\+\>/g,cont);
	return rtnValue;
}
//º¯¼ö »ý¼º ÇØ¾ßÇÔ
function _dp_makeMenu(lr,l,d,sourceHTML,menuidord,homemenuview,homearchiveview,homefavoriteview,homelastreplyview,homevisitblogerview,homefreezoneview,homemenuttl,homearchivettl,homefavoritettl,homelastreplyttl,homevisitblogerttl,homefreezonettl,homemenucont,homearchivecont,homefavoritecont,homelastreplycont,homevisitblogercont,homefreezonecont){
	var rtnValue = "";
		for ( var i = l ; i < d ; i ++ ){	
			if (menuidord[i].toString() == "1"){
				if (homemenuview==true)
					rtnValue += _dp_menupulldata(sourceHTML,homemenuttl,homemenucont);
			}else if (menuidord[i].toString() == "2"){
				if (homearchiveview==true)
					rtnValue += _dp_menupulldata(sourceHTML,homearchivettl,homearchivecont);
			}else if (menuidord[i].toString() == "3"){
				if (homefavoriteview==true)
					rtnValue += _dp_menupulldata(sourceHTML,homefavoritettl,homefavoritecont);
			}else if (menuidord[i].toString() == "4"){
				if (homelastreplyview==true)
					rtnValue += _dp_menupulldata(sourceHTML,homelastreplyttl,homelastreplycont);
			}else if (menuidord[i].toString() == "5"){
				if (homevisitblogerview==true)
					rtnValue += _dp_menupulldata(sourceHTML,homevisitblogerttl,homevisitblogercont);
			}else if (menuidord[i].toString() == "6"){
				if (homefreezoneview==true)
					rtnValue += _dp_menupulldata(sourceHTML,homefreezonettl,homefreezonecont);
			}else
				rtnValue += '';
		}
		return rtnValue;
}

/* start : display blogware*/
function _dp_exec()
{
	var leftmenuinnerHTML = "";
	var rightmenuinnerHTML = "";	
	var postinnerHTML = "";
	_dp_parsing();
	if (_Source_menuIdOrd.split("|").length>0&&( _Ctrl_bjwLoc=="both"||_Ctrl_bjwLoc=="updown" )){
		leftmenuinnerHTML += _dp_makeMenu('left',0,_Ctrl_bjwDiv,_Ctrl_leftmenuSource,_Source_menuIdOrd.split("|"),_Source_homeMenuView,_Source_homeArchiveView,_Source_homeFavoriteView,_Source_homeLastReplyView,_Source_homeVisitBlogerView,_Source_homeFreezoneView,_Source_homeMenuTitle,_Source_homeArchiveTitle,_Source_homeFavoriteTitle,_Source_homeLastReplyTilte,_Source_homeVisitBlogerTitle,_Source_homeFreezoneTitle,_Output_homeMenu,_Output_homeArchive,_Output_homeFavorite,_Output_homeLastReply,_Output_homeVisitBloger,_Output_homeFreezone);
		rightmenuinnerHTML += _dp_makeMenu('right',_Ctrl_bjwDiv,_Source_menuIdOrd.split("|").length,_Ctrl_rightmenuSource,_Source_menuIdOrd.split("|"),_Source_homeMenuView,_Source_homeArchiveView,_Source_homeFavoriteView,_Source_homeLastReplyView,_Source_homeVisitBlogerView,_Source_homeFreezoneView,_Source_homeMenuTitle,_Source_homeArchiveTitle,_Source_homeFavoriteTitle,_Source_homeLastReplyTilte,_Source_homeVisitBlogerTitle,_Source_homeFreezoneTitle,_Output_homeMenu,_Output_homeArchive,_Output_homeFavorite,_Output_homeLastReply,_Output_homeVisitBloger,_Output_homeFreezone);
	}else 
		eval(_Ctrl_bjwLoc+"menuinnerHTML += _dp_makeMenu(_Ctrl_bjwLoc,0,_Source_menuIdOrd.split(\"|\").length,_Ctrl_"+_Ctrl_bjwLoc+"menuSource,_Source_menuIdOrd.split(\"|\"),_Source_homeMenuView,_Source_homeArchiveView,_Source_homeFavoriteView,_Source_homeLastReplyView,_Source_homeVisitBlogerView,_Source_homeFreezoneView,_Source_homeMenuTitle,_Source_homeArchiveTitle,_Source_homeFavoriteTitle,_Source_homeLastReplyTilte,_Source_homeVisitBlogerTitle,_Source_homeFreezoneTitle,_Output_homeMenu,_Output_homeArchive,_Output_homeFavorite,_Output_homeLastReply,_Output_homeVisitBloger,_Output_homeFreezone);");
	if ( _Source_perPagePostCount == -1 )
		postinnerHTML +=  _dp_postpulldata(_Ctrl_postSource,"","",_Output_noMorePost,"","");
	else{
		if ( _Ctrl_proc == "_mlist" )
			postinnerHTML +=  _dp_postpulldata(_Ctrl_postSource,_Output_perPageArchiveSubject,"",_Output_perPageArchiveList,"","");
		for (i = 0; i <= _Source_perPagePostCount; i++){
			if ((_Ctrl_proc == "_list" || _Ctrl_proc == "_sample" ) && _Ctrl_listType == "1")
				postinnerHTML +=  _dp_wzpostpulldata(_Ctrl_wzpostSource,_Output_perPagePostBody[i]);
			else
				postinnerHTML +=  _dp_postpulldata(_Ctrl_postSource,_Output_perPagePostSubject[i],_Output_perPagePostMenu[i],_Output_perPagePostBody[i],_Output_postNavi[i],_Output_perPagePostCrt[i]);			
		}
	}
	document.write(_dp_outerpulldata(_Ctrl_outerSource,_Output_homeSubject,_Output_homeUrl,postinnerHTML,_Output_upPageBtn,_Output_downPageBtn,_Output_homeLogo,_Output_homeIntro,_Output_homeOwnerNick,_Output_homeVisit,_Output_homeCalendar,_Output_copyright,leftmenuinnerHTML,rightmenuinnerHTML));
}
