pad_left = 25
if(cat0 == "tong") pad_left = 38

function print_total() {
        document.write(""
        +"<table><td></table>"
        +"<table width=788 height=30>"
        +"<td style='padding-left:10' id=td_total style='font-size:13px'>ÀÚ·á¸¦ Ã£°íÀÖ½À´Ï´Ù. Àá½Ã¸¸ ±â´Ù·ÁÁÖ¼¼¿ä.."
        //+"<td align=right><A href=/know/request/><font color=red><b><u>ÀÚ·á¿äÃ»"
        +"</table>"
        +"")
        }

total = 0
function print_cat_title(table_name,cat_str,cnt) {
        total += parseInt(cnt,10)
        if(cat0=="tong") {
                //document.write("<br>")
                td_total.innerHTML = "<font style='font-size:10px'>¢º</font> ÀüÃ¼ <font color=red><b>"+IComma(total)+"</b></font> °ÇÀ» Ã£¾Ò½À´Ï´Ù."
                }

        rmsg = ""
        if(table_name=="time")   rmsg = "<A href=/study/cute/time/make.html><u><font color=0080ff>½Ã°£Ç¥¸¸µé±â</u></a> | <A href=/study/cute/ballpen/><u><font color=0080ff>º¼Ææ¶ì</u></a> | <A href=/study/cute/name/><u><font color=0080ff>ÀÌ¸§Ç¥</u></a>"
        if(table_name=="mvote")  rmsg = "<A href=/study/debate/vote/><u><font color=0080ff>¼³¹®Âü¿©, ¼³¹®µî·Ï</u></a>"
        if(table_name=="sooji")  rmsg = "<A href=/know/sooji/upload.html><u><font color=0080ff>Áú¹®ÇÏ±â</u></a>"
	//if(table_name=="poster") rmsg = "<A href=/study/poster/upload.html><u><font color=0080ff>Æ÷½ºÅÍµî·Ï</u></a>"
        if(table_name=="note")   rmsg = "<A href=/report/note/><u><font color=0080ff>³ëÆ®µî·Ï</u></a>"
        if(table_name=="kichul" && cat0 == "tong") rmsg = "<font color=cdcdcd><A href=#nul onclick=click_cat('ÃÊ4','','kichul')><font color=0080ff>ÃÊ4</font></a> | <A href=#nul onclick=click_cat('ÃÊ5','','kichul')><font color=0080ff>ÃÊ5</font></a> | <A href=#nul onclick=click_cat('ÃÊ6','','kichul')><font color=0080ff>ÃÊ6</font></a> | <A href=#nul onclick=click_cat('Áß1','','kichul')><font color=0080ff>Áß1</font></a> | <A href=#nul onclick=click_cat('Áß2','','kichul')><font color=0080ff>Áß2</font></a> | <A href=#nul onclick=click_cat('Áß3','','kichul')><font color=0080ff>Áß3</font></a> <!--| <A href=#nul onclick=click_cat('°í1','','kichul')><font color=0080ff>°í1</font></a> | <A href=#nul onclick=click_cat('°í2','','kichul')><font color=0080ff>°í2</font></a>-->"
        if(table_name=="report") rmsg = "<img src=http://www.sooheng.com/IMG/school/pics/file_file.gif align=absmiddle> <A href=/report/><u><font color=0080ff>ÀÚ·áµî·Ï (1°Ç´ç 500¿ø)</u></a>"

        if(table_name=="tamgu") rmsg = "<img src=/IMG/school/pics/file_zip.gif align=absmiddle> <A href=/IMG/school/science/files/°úÇÐÅ½±¸ÁÖÁ¦.exe><u><font color=0080ff>°úÇÐÅ½±¸ÁÖÁ¦ ²Ù·¯¹Ì ¼³Ä¡</u></a>"

        str = ""

        if(cat0 != "tong") str = cat_str
        else {
                str += "<A href=#nul title='´õ ÀÚ¼¼È÷ º¸±â' onclick=click_cat0('"+table_name+"')>" + cat_str + "</a>"
                if(cat1) str += " > <A href=#nul title='´õ ÀÚ¼¼È÷ º¸±â' onclick=click_cat1('"+cat1+"')>" + cat1 + "</a>"
                if(cat2) str += " > <A href=#nul title='´õ ÀÚ¼¼È÷ º¸±â' onclick=click_cat('"+cat1+"','"+cat2+"')>" + cat2 + "</a>"
                }

        if(cat0 != "tong") document.write("<table height=10><td></table>")

	w800 = 800
	if(cat0 == "report") w800 = 860

        document.write(""
        +"<table width="+w800+" height=35>"
        +"<tr><td style='padding-left:10'><img src=/IMG/school/pics/icon_"+table_name+".gif align=absmiddle> <b>"+str+"</b> °Ë»ö°á°ú <font color=red style='font-size:13px'><b>"+IComma(cnt)+"</b></font> °Ç")

        if(cat0 != "tong") {
                total_page = parseInt((total + scale - 1) / scale,10)
                document.write(" ["+page+"/"+total_page+" page]")
                }

	//+"<A href=#null onClick=\"window.external.AddFavorite(location.href,'¡Ú"+key+" - ÇØÇÇ·¹Æ÷Æ® °Ë»ö°á°ú'); return false;\"><font color=gray style='font-family:µ¸¿ò; font-size:11px' title='º» °Ë»ö°á°ú ÆäÀÌÁö¸¦ Áñ°ÜÃ£±â¿¡ Ãß°¡ÇÕ´Ï´Ù.'><img src=/IMG/main/pics/menu_bookmark.gif border=0></a>")
	//+"<A href=#null onClick=\"location.href='/search/batang_save.asp?key="+key+"&cat1="+cat1+"'\"><font color=gray style='font-family:µ¸¿ò; font-size:11px' title='º» °Ë»ö°á°ú ÆäÀÌÁö¸¦ ¹ÙÅÁÈ­¸é¿¡ ÀúÀåÇÕ´Ï´Ù.'><img src=/IMG/main/pics/menu_batang.gif border=0></a>")

	if(table_name == "report" || cat0 != "tong")
        document.write(""
	+"<td align=left><font style='font-size:11px; font-family:µ¸¿ò; color:gray'>°Ë»ö°á°ú</font> "
	+"<A href=#null onClick=\"location.href='/school/batang_save.asp?key="+key+"&cat1="+cat1+"&page="+page+"&url="+escape(u)+"'\"><font color=gray style='font-family:µ¸¿ò; font-size:11px' title2='º» °Ë»ö°á°ú ÆäÀÌÁö¸¦ ¹ÙÅÁÈ­¸é¿¡ ÀúÀåÇÕ´Ï´Ù.'><img src=http://www.happyreport.co.kr/IMG/main/pics/menu_batang.gif border=0 align=absmiddle></a> "
	+"<A href=#null onClick=\"window.external.AddFavorite(location.href,'¡Ú"+key+"-¼öÇà´åÄÄ °Ë»ö°á°ú'); return false;\"><font color=gray style='font-family:µ¸¿ò; font-size:11px' title=' º» °Ë»ö°á°ú ÆäÀÌÁö¸¦ Áñ°ÜÃ£±â¿¡ Ãß°¡ÇÕ´Ï´Ù.'><img src=http://www.happyreport.co.kr/IMG/main/pics/menu_bookmark.gif border=0 align=absmiddle></a> "
	)

	if(cat0=="report") document.write("<A href=#null onclick=sales_copy()><img src=http://www.happyreport.co.kr/IMG/main/pics/menu_sales.gif align=absmiddle border=0 alt='ÆÇ¸Å¼öÀÍÀÇ 50%¸¦ µå¸³´Ï´Ù'></a>")

	document.write(""
        +"<td align=right>"+rmsg
        +"<td width=10>"
	+"<tr><td height=10>"
        +"</table>")

	}


document.write("<table cellpadding=0 cellspacing=0><form name=form_sales><input type=hidden name=sales_ps><tr><td></tr></form></table>")
function sales_copy() {
	if(!cook_id) {
		alert("·Î±×ÀÎÈÄ ¼¼ÀÏÁîÄÚµå¸¦ º¹»çÇÏ¼¼¿ä.\n\nÈ«º¸/ÆÇ¸Å¼öÀÍÀÇ 50%¸¦ µå¸³´Ï´Ù.")
		location.href = "/alba/sales/"
		}
	else if(!sales_ps) alert("°Ë»ö°á°ú°¡ ¾ø½À´Ï´Ù.\n\nÈ«º¸ÇÒ ³»¿ëÀ¸·Î °Ë»öÇØÁÖ¼¼¿ä.")
	else {
		sales_ps2 = sales_ps + "\r\n\r\nÃâÃ³ : http://sales.sooheng.com/"+cook_id+"/"+sales_key+"/report/  -  '"+key+"~' °ü·ÃÀÚ·á½Ç"
		form_sales.sales_ps.value = sales_ps2
		temp=form_sales.sales_ps.createTextRange()
		temp.execCommand("Copy")

		sales_copy_sw = getCookie("sales_copy_sw")
		if(!sales_copy_sw) {
			alert("º¹»ç°¡ µÇ¾ú½À´Ï´Ù.(HTML)\n\n¿øÇÏ´Â °÷¿¡ ºÙÇô³Ö±â ÇØÁÖ¼¼¿ä.\n\n(ÀÌ ¸Þ¼¼Áö´Â ´ÙÀ½ºÎÅÍ ³ª¿ÀÁö ¾Ê½À´Ï´Ù.)")
			setCookie("sales_copy_sw","1")
			}
		}
	}


// °Ë»ö¹Ù
function print_search_bar(v) {
        make_cat_select()
        make_menu2(cat0)
        form47.key.value = key
        //form47.key.focus()
        if(v) form47.cat0.value = v
        else form47.cat0.value = cat0
        form47.cat1.value = cat1
        }



function over_cat0(v) {
        eval("img_"+v).src = "/IMG/school/pics/menu_"+v+"_.gif"
        }
function out_cat0(v) {
        eval("img_"+v).src = "/IMG/school/pics/menu_"+v+".gif"
        eval("img_"+cat0).src = "/IMG/school/pics/menu_"+cat0+"_.gif"
        }


function click_cat(v1,v2,v0) {
        if(!v0) v0 = cat0
        form47.cat0.value = v0
        form47.cat1.value = v1
        form47.cat2.value = v2
        check_submit()
        }
function click_cat1(v) {
        form47.cat1.value = v
        form47.cat2.value = ""
        check_submit()
        }
function click_cat2(v) {
        form47.cat1.value = cat1
        form47.cat2.value = v
        check_submit()
        }
function click_key(v,c0,c1) {
        if(c0) form47.cat0.value = c0; else form47.cat0.value = "tong"
        if(c1) form47.cat1.value = c1; else form47.cat1.value = ""
        form47.cat2.value = ""
        form47.key.value = v
        check_submit()
        }

function print_more(cat0,cat_str,key) {
        url = "/search/"+key+"_"+cat0+"___rday_1.html"

        document.write(""
        +"<table width=800>"
	+"<tr><td height=5>"
        +"<tr><td style='padding-left:45' align=left><img src=/IMG/school/pics/icon_view.gif align=absmiddle> <A href='"+url+"'><font color=#454545><b>"+cat_str+"</b> ´õº¸±â</a>"
        +"</table>"
        +"<br>"
        +"")
        }

function print_not_found() {
	if(cat0 != "report") print_cat_title(cat0,cat_str,0)

        if(cat0 == "tong") {
		td_total.innerHTML = "°Ë»öÀ» ¿Ï·á ÇÏ¿´½À´Ï´Ù."
		if(location.href.indexOf("cat0=tong")>-1) location.href = location.href.replace("cat0=tong","cat0=report")
		if(location.href.indexOf("_tong_")>-1) location.href = location.href.replace("_tong_","_report_")
		}
        clear_progress(0)

	nstr = "<center>"

        if(cat0 == "tong") nstr += "<br>"
        else nstr += "<br><br>"

        msg1 = ""
        if(key.indexOf("°¨»ó¹®")>-1) msg1 = "<br><br><font color=red>¶Ç´Â °Ë»ö¾î¿¡¼­ '°¨»ó¹®' ÀÌ¶ó´Â ´Ü¾î¸¦ Á¦¿ÜÇØ º¸¼¼¿ä.</font>"
        if(key.indexOf("µ¶ÈÄ°¨")>-1) msg1 = "<br><br><font color=red>¶Ç´Â °Ë»ö¾î¿¡¼­ 'µ¶ÈÄ°¨' ÀÌ¶ó´Â ´Ü¾î¸¦ Á¦¿ÜÇØ º¸¼¼¿ä.</font>"
        if(key.indexOf("±ÛÁþ±â")>-1) msg1 = "<br><br><font color=red>¶Ç´Â °Ë»ö¾î¿¡¼­ '±ÛÁþ±â' ¶ó´Â ´Ü¾î¸¦ Á¦¿ÜÇØ º¸¼¼¿ä.</font>"
        if(key.indexOf("¼÷Á¦")>-1) msg1 = "<br><br><font color=red>¶Ç´Â °Ë»ö¾î¿¡¼­ '¼÷Á¦' ¶ó´Â ´Ü¾î¸¦ Á¦¿ÜÇØ º¸¼¼¿ä.</font>"
        if(key.indexOf("±âÇà¹®")>-1) msg1 = "<br><br><font color=red>¶Ç´Â °Ë»ö¾î¿¡¼­ '±âÇà¹®' ÀÌ¶ó´Â ´Ü¾î¸¦ Á¦¿ÜÇØ º¸¼¼¿ä.</font>"
        if(key.indexOf("º¸°í¼­")>-1) msg1 = "<br><br><font color=red>¶Ç´Â °Ë»ö¾î¿¡¼­ 'º¸°í¼­' ¶ó´Â ´Ü¾î¸¦ Á¦¿ÜÇØ º¸¼¼¿ä.</font>"

	nstr += "<table width=520 style='border:solid 1px #C0C0C0'><td>"
        nstr += "<table bgcolor=efefef width=100% height=100% cellpadding=20>"
        nstr += "<tr><td style='line-height:22px'><font style='font-size:14px'>ÁË¼ÛÇÕ´Ï´Ù.<br><b><u>'"+key+"'</b> (À»)¸¦ Ã£À»¼ö ¾ø½À´Ï´Ù.</u>"
        //+"<br><br>¿äÃ»ÀÚ·á½ÇÀ» ÀÌ¿ëÇØº¸½Ã±â ¹Ù¶ø´Ï´Ù. --> <input type=button value='ÀÚ·á ¿äÃ»ÇÏ±â' onclick=location.href='/know/request/'>"
        nstr += msg1
        nstr += "<br><br>´Ù¸¥ Ä«Å×°í¸®¿¡¼­ Ã£°Å³ª, ´Ù¸¥ °Ë»ö¾î·Î ÀÔ·Â¹Ù¶ø´Ï´Ù.</font><br>"
        nstr += "<font color=gray>"
        nstr += "<br><font color=#0080FF>¡Ø <u>È¤½Ã ³Ê¹« ±ä ¹®ÀåÀ¸·Î °Ë»öÇÏÁö ¾ÊÀ¸¼Ì½À´Ï±î ?</font></u>"
        nstr += "<br>¡¡ex) ½ßÅÃÁãº£¸®ÀÇ ¾î¸°¿ÕÀÚ µ¶ÈÄ°¨  ---> ¾î¸°¿ÕÀÚ"
        nstr += "<br>¡¡ex) ¿ì¸®³ª¶óÀÇ ³âµµº° ¿¤¸®´¢ Æ¯Â¡ ---> ¿¤¸®´¢"
        nstr += "<br><font color=#0080FF>¡Ø <u>È¤½Ã À¯»ç ¹ßÀ½ÀÇ ´Ü¾î³ª, µ¿ÀÇÀÌÀ½¾î°¡ ÀÖÁö´Â ¾Ê½À´Ï±î ?</u></font>"
        nstr += "<br>¡¡ex) ½ßÅÃÁãº£, ½ß¶¨Âîº£·¹, »ýÅÃÁö»©¸® / Â¡±â½ºÄ­, Äª±âÁîÄ­, Äª±â½ºÄ­"
        nstr += "<br>¡¡ex) ¿¤¸®´¢, ¿¤´Ï´¢ / ½Ã¹Î´ÜÃ¼, NGO / Àå¹ßÀå, ·¹¹ÌÁ¦¶óºí"
        nstr += "</table>"
        nstr += "</table>"

	if(cat0 == "report") tdl.innerHTML = nstr
	else document.write(nstr)


        if(cat0 == "tong") document.write("<br><br>")
        }


function print_page() {
        total_page = parseInt((total + scale - 1) / scale,10)

        document.write("<table><td></table>")
        document.write("<TABLE cellpadding=0 cellspacing=1 width=800 height=30 border=0>")
        document.write("<TD width=150>")
	if(cook_sid && cat0 == "report") document.write("<font color=cdcdcd>Sales ID : "+cook_sid+"</font>")

	document.write("<TD colspan=5 align=center valign=middle>")
        ten = (page + 9) - ((page + 9) % 10)
        if(ten != 10) document.write("(<A href=# onclick='move_page(1); return false;' class=a1>Ã·..</a>) &nbsp <A href=# onclick='move_page("+(ten-10)+"); return false;' class=a1>ÀÌÀü<img border=0 src=/IMG/main/pics/icon_before.gif align=absmiddle></a> &nbsp ")
        for(i=ten-9; i<=ten; i++)
                if(i <= total_page)
                        if(i == page) document.write("<font color=red>["+i+"]</font>&nbsp")
                        else document.write("<A href=# onclick='move_page("+i+"); return false;'>["+i+"]</a>&nbsp")

        if(ten < total_page) document.write(" &nbsp <A href=# onclick='move_page("+(ten+1)+"); return false;' class=a1><img border=0 src=/IMG/main/pics/icon_after.gif align=absmiddle>´ÙÀ½</a>")

        document.write("<TD width=150>")
        document.write("</table>")
        }


function move_page(click_page) {
        ordr = "rday"

        if(navigator.appVersion.indexOf("MSIE 7.0")>-1) {}
        else if(navigator.appVersion.indexOf("MSIE 8.0")>-1) {}
        else key = escape(key)

        url = "/search/" + key +"_"+ cat0 +"_"+ cat1 +"_"+ cat2 +"_"+ ordr + "_" + click_page +".html?num="+num

        location.href = url
        }


function print_progress(v) {
        return false
        lf = location.href
        if(lf.indexOf(".html")>-1) return false
        document.write("<table cellpadding=0 cellspacing=0 width=800><td id=td_progress"+v+" style='text-align:center; padding:60 0 0 0'><img src=/IMG/school/pics/search_loading.gif></table>")
        setTimeout("clear_progress("+v+")",1000*3)
        }

function clear_progress(v) {
        return false
        lf = location.href
        if(lf.indexOf(".html")>-1) return false
        eval("td_progress"+v).innerHTML = ""
        }

// ºÎÇÏÁ¶Àý
function check_lastmodify() {
        lf = location.href
        if(lf.indexOf(".asp")>-1) return false

        cday = -1
        if(key) cday = -5

        if(cat0 == "kichul") cday = -999        //-30
        if(cat0 == "note")   cday = -15         //-3
        if(cat0 == "nonsool") cday = -999       //-30
        if(cat0 == "poster") cday = -999        //-30
        if(cat0 == "sooji")  cday = -999        //-7
        if(cat0 == "mvote")  cday = -15
        if(cat0 == "time")   cday = -15         //-10
        if(cat0 == "talk")   cday = -999        //-30
        if(cat0 == "feel")   cday = -999        //-30

        if("tong report note poster sooji mvote time".indexOf(cat0)>-1) {
                if(lf.indexOf("___rday_1")>-1) cday = -1
                }

        lastday = document.lastModified
        today = new Date()
        mday = parseInt((Date.parse(lastday)-Date.parse(today))/(1000*60*60*24),10)

	if(cook_id=="phpia" || cook_id=="[¼öÇàÁö±â]") cday = 999

        if(mday <= cday) document.write("<IFRAME width=0 height=0 src='/school/search_delete.asp?dfile="+lf+"'></iframe>")
        }


function print_bottom() {
        if(total==0) print_not_found()
	else if(key) print_key_record(key,total,cat0)

        if(cat0 != "tong") print_page()
        check_lastmodify()

	// ÃÀÇè´åÄÄ EVER ¹è³Ê ÀÓ½Ã
	//document.write("<br><br><center>")
	//swf2("http://www.openmobile.co.kr/20091223_ktft_swf/ever_468_60_01.swf",468,60);
        }




function print_report_right() {
	//if(cat0 == "tong") return false

	if(cat0 == "report") print_key_link()
	if(cat0 == "report") print_key_rank()
	if(cat0 == "report") print_key_banner()
	if(cat0 == "report") print_history()
	}



var cstr = ",<font color=gray>,<font color=#888888>,<font color=#444444>,<font color=#289BAC>,<font color=#289BAC><b>,<font color=#289BAC style='background:#EFEFEF; font-size:13px; padding:2'><b>,<font color=gray style='background:#efefef; font-size:13px; padding:2'><b>,<font color=#FFFFFF style='background:#39ACBA; font-size:13px; padding:2'><b>,<font color=#FFFFFF style='background:#39ACBA; font-size:13px; padding:2'><b>,"
var dstr1 = "À» ¸¦ Àº ´Â ÀÌ °¡ ÀÇ ¿Í °ú ¿¡ "
var dstr2 = "`,`,.,.,¡¶,¡·,(,),[,],;,-,¡¯,¡®,;,:,ÀÏ¹Ýµ¶ÈÄ°¨,°úÀÇ,´ëÇØ¼­,ÀÇÇÑ,´ëÇÏ¿©,°üÇÑ,¿¬±¸,°ü·ÃÇÑ,¿ä¾à,º¸°í¼­,Á¶»ç,À§ÇÑ,°á°ú,´ëÇØ,»ç·Ê,ºÐ¼®,¿¡°Ô,¾î¶»°Ô,ÀÐ°í,À» ÀÐ°í,¸¦ ÀÐ°í,À» º¸°í,¸¦ º¸°í,ÀÏ°í³ª¼­,ÀÐ°í³ª¼­,³ª¼­,°üÇÏ¿©,ÀÚ¼¼È÷,"
var dstr3 = "´Ï´Ù,¾úÀ»,À»±î,µÇ¾ú,¾î¿ä,ÀÖ¾î,¿¡¼­,ÇÏÀÚ,"

dstr1 = dstr1 + dstr1 + dstr1
dstr2 = dstr2 + dstr2 + dstr2 + dstr2 + dstr2

var msg_m2 = msg_m2_ = ""

// ·£´ý
msg_m2_ += "<A href=/mooche/english/><img src=/IMG/mooche/english/pics/banner_gyc1.gif style='border:solid 0px #1797D8'></a>"
msg_m2_ += "<A href=/mooche/english/><img src=/IMG/mooche/english/pics/banner_gyc2.gif style='border:solid 0px #1797D8'></a>"
msg_m2_ += "<A href=/mooche/english/><img src=/IMG/mooche/english/pics/banner_gyc3.gif style='border:solid 0px #1797D8'></a>"
msg_m2_ += "<A href=/mooche/english/><img src=/IMG/mooche/english/pics/banner_gyc4.gif style='border:solid 0px #1797D8'></a>"
msg_m2_ += "<A href=/mooche/english/><img src=/IMG/mooche/english/pics/banner_gyc5.gif style='border:solid 0px #1797D8'></a>"


	msg_m2_ = msg_m2_.split("</a>")
	rnum = parseInt(Math.random()*msg_m2_.length-1)
	msg_m2 = msg_m2_[rnum]+"</a>"


// ¿¬°ü Å°¿öµå
function print_key_link() {
	if(!key || !key_link) return false

	cnt = rnum = 0
	str = ""
	cstr = cstr.split(",")
	dstr2 = dstr2.split(",")
	dstr3 = dstr3.split(",")
	temp = key_link.split(" ")
	for(i=0; i<temp.length; i++) {
		for(j=0; j<dstr2.length-1; j++) {
			if(temp[i].indexOf(dstr2[j])>-1) temp[i] = temp[i].replace(dstr2[j],"")
			}
		if(dstr1.indexOf(" "+temp[i].charAt(temp[i].length-1)) > -1) temp[i] = temp[i].replace(temp[i].charAt(temp[i].length-1),"")

		sw3 = 1
		for(j=0; j<dstr3.length-1; j++)
			if(temp[i].indexOf(dstr3[j])>-1) sw3 = 0	// Á¦¿Ü´Ü¾î - ¼öÇàÃß°¡
		
		if(temp[i].length>2) // ¼öÇà¿¡¼­ Ãß°¡µÊ
		if(str.indexOf(temp[i])==-1 && temp[i] != key>1 && sw3==1) {
			cs = ""
			rnum = parseInt(Math.random()*cstr.length)
			cs = cstr[rnum]
			temp_i = CLen(temp[i],12)
			for(j=0; j<5; j++) temp_i = temp_i.replace("`","").replace("¡Ü","")
			str += "<A href='/search/"+temp[i]+"_"+cat0+"__rday_desc_1.html' title='"+temp[i]+"'>"+cs+temp_i+"</font></b></i></u></a>&nbsp "
			cnt += CLen(temp[i])
			if(cnt > 100) i = 999
			}
		}

        document.write(""
	+"<table width=100% cellpadding=0 cellspacing=0><td>"
        +"<fieldset style='padding:0'>"
        +"<table width=100% cellpadding=0 cellspacing=0><col style='padding-left:5px'>"
        +"<tr><td bgcolor=efefef colspan=2 height=25><font color=#E67C92>¿¬°ü°Ë»ö¾î</a>"
	+"<tr><td height=3>"
        +"<tr><td style='padding:3; color:gray; line-height:25px'>" + str
        +"</table>"
        +"</table>"

	+"<table><td></table>"
	)
        }



// ÀÎ±â°Ë»ö¾î
function print_key_rank() {
	temp = hot.split(" ")
	for(i=0; i<temp.length; i++) key_rank += temp[i] + "|"

	if(!key_rank) return false

	cnt = rnum = 0
	str = ""
	key_now = key_rank.split("|")
	for(i=0; i<key_now.length-1; i++) {
		key_now[i] = key_now[i].replace("-","").replace("¡¯","").replace("¡®","")

		str += "<tr><td><img src=http://www.happyreport.co.kr/IMG/main/pics/icon_num"+(++cnt)+".gif align=absmiddle> <A href='/search/"+key_now[i]+"_report__rday_desc_1.html' title='"+key_now[i]+"'>"+CLen(key_now[i],22)+"</a> <td align=right id=td_rank_"+i+"> "

		if(i > 6) i = 999
		}

        document.write(""
	+"<table width=100% cellpadding=0 cellspacing=0><td>"
        +"<fieldset style='padding:0'>"
        +"<table width=100% cellpadding=0 cellspacing=0><col style='padding-left:5px'>"
	+"<tr><td width=170 bgcolor=efefef colspan=2 height=25 style='padding-left:5px'><font color=#E67C92>½Ç½Ã°£ ÀÎ±â °Ë»ö¾î</a>"
	+"<tr><td height=3>"
        +"<tr><td style='padding:3; color:gray'><table width=100%>" + str + "</table></td></table>"
        +"</table>"
	)
	}


function print_key_banner() {
	document.write(""
	+"<table><td></table>"
	+"<a href=/myfolder/log/down.asp><img src=http://www.happyreport.co.kr/IMG/search/pics/btn_buy.gif border=0></a>"
	+"<table><td></table>"
	+"<a href=/myfolder/log/cart.asp><img src=http://www.happyreport.co.kr/IMG/search/pics/btn_cart.gif border=0></a>"
	+"<table><td></table>"
	+ msg_m2
	+"<table><td></table>"
	)
	}




// ³»°¡ Ã£¾Æº» ÀÚ·á
maxh = 10
function print_history() {
	cook_rdays = getCookie("cook_rdays")
	cook_titles = getCookie("cook_titles")
	cook_fexts = getCookie("cook_fexts")

	if(!cook_rdays) return false

	temp = cook_rdays.split("|*|")
	temp2 = cook_titles.split("|*|")
	temp3 = cook_fexts.split("|*|")

	str = ""
	tcnt = 0
	for(i=temp.length; i>0; i--)
	if(temp[i]) {
		str += "<tr><td valign=top><img src=/IMG/school/pics/file_"+temp3[i]+".gif alibn=absmiddle><td><A href=/detail/report_"+(temp[i].replace("/","").replace("/",""))+".html title='"+temp2[i]+"' class=A411>"+CLen(temp2[i],45)+"</td></tr>"
		tcnt++
		if(tcnt > maxh) i = temp.length+9
		}

	maxstr = ""
	if(temp.length > maxh) maxstr = "ÃÖ±Ù"+maxh+"°Ç"

	document.write(""
	+"<table width=100% cellpadding=0 cellspacing=0><td>"
        +"<fieldset style='padding:0'>"
        +"<table width=100% cellpadding=0 cellspacing=0><col style='padding-left:5px'>"
	+"<tr><td width=170 bgcolor=efefef colspan=2 height=25 style='padding-left:5px'><font color=#E67C92>³»°¡ Ã£¾Æº» ÀÚ·á.. "+maxstr+"</a>"
	+"<tr><td height=3>"
        +"<tr><td style='padding:3; color:gray'><table width=100%>" +str+ "</table></td>"
        +"</table>"
        +"</table>"
	)

	if(temp.length > maxh) {
		setCookie("cook_rdays",cook_rdays.replace("|*|"+temp[1],"|*|"))
		setCookie("cook_titles",cook_titles.replace("|*|"+temp2[1],"|*|"))
		setCookie("cook_fexts",cook_fexts.replace("|*|"+temp3[1],"|*|"))
		}
	}



//*************************************************
// ³»¿ëÃâ·Â ÇÔ¼ö
//*************************************************

function print_sdata() {
	sw = 1
	temp = sdata.split("¡«")
	for(i=0; i<temp.length-1; i++) {
		temp2	= temp[i].split("¦¢")

		r_day	= temp2[0]
		cat1_	= temp2[1]
		cat2_	= temp2[2]
		file	= temp2[3]
		title	= temp2[4]
		ps	= temp2[5]
		page_	= temp2[6]
		money	= temp2[7]
		wmode	= temp2[8]

		if(wmode == "E" && sw) {
			sw = 0
			print_extend_title(temp.length-i-1)
			}
		print_tong_report(r_day,cat1_,cat2_,file,title,ps,page_,money)
		}
        }

function print_extend_title(ex_cnt) {
	document.write("<table width=800><tr><td height=10><tr><td width=20><td width=40><hr size=1><td width=230><center><font color=gray>È®Àå°Ë»ö °á°ú <font color=red>"+ex_cnt+"</font> °ÇÀ» ´õ Ã£¾Ò½À´Ï´Ù.<td><hr size=1></table><br>")
	total += ex_cnt
	}


sales_ps = ""
function print_tong_report(r_day,cat1,cat2,file,title,ps,page_,money) {
        ext = file.substr(file.length-3,3)

	if(!sales_ps) {
		if(key.indexOf("ÀÚ±â¼Ò°³")>-1 || key.indexOf("ÀÚ±â ¼Ò°³")>-1) document.write("<table width=100%><tr><td style='padding-left:"+pad_left+"; line-height:17px'><img src=/IMG/school/pics/file_hwp.gif align=absmiddle> <A href=http://sales.happyreport.co.kr/sooheng//ÀÚ±â¼Ò°³¼­/ target=_blank><u><font color=#1935BC style='font-size:13px'>[Ãë¾÷/ÀÌ·Â¼­] °¢ ºÐ¾ßº°,±â¾÷º° ÇÕ°Ý <b>ÀÚ±â¼Ò°³¼­</b> ¸ðÀ½ÀÚ·á½Ç (ÇØÇÇ·¹Æ÷Æ®)</a><tr><td height=6><tr><td style='padding-left:45px; color:#808080; font-size:12px'>ÀÌ ¸µÅ©´Â ´ëÇÐ·¹Æ÷Æ® ÀÚ·á½Ç ÇØÇÇ·¹Æ÷Æ®·Î ÀÌµ¿ÇÕ´Ï´Ù. http://www.happyreport.co.kr<tr><td height=6></table>")
		if(key.indexOf("ÇÐ¾÷°èÈ¹")>-1 || key.indexOf("ÇÐ¾÷ °èÈ¹")>-1) document.write("<table width=100%><tr><td style='padding-left:"+pad_left+"; line-height:17px'><img src=/IMG/school/pics/file_hwp.gif align=absmiddle> <A href=http://sales.happyreport.co.kr/sooheng//ÇÐ¾÷°èÈ¹¼­/ target=_blank><u><font color=#1935BC style='font-size:13px'>[´ëÇÐ/´ëÇÐ¿ø] °¢ Àü°øº°,ÇÐ±³º° ÇÕ°Ý <b>ÇÐ¾÷°èÈ¹¼­</b> ¸ðÀ½ÀÚ·á½Ç (ÇØÇÇ·¹Æ÷Æ®)</a><tr><td height=6><tr><td style='padding-left:45px; color:#808080; font-size:12px'>ÀÌ ¸µÅ©´Â ´ëÇÐ·¹Æ÷Æ® ÀÚ·á½Ç ÇØÇÇ·¹Æ÷Æ®·Î ÀÌµ¿ÇÕ´Ï´Ù. http://www.happyreport.co.kr<tr><td height=6></table>")
		}

	sales_ps += ps + "\r\n"

        r_day2 = ""
        max_len = 999
        if(cat0 == "tong") {
                max_len = 86
                if(key=="") r_day2 = "<font color=#0080FF>"+r_day.substr(0,10)
                }
	
	ps2 = CLen(ps,max_len)
	ps = ps.replace(">","&gt").replace("<","&lt")

	if(key) {
		temp = title.split(" ")
		for(i=0; i<temp.length; i++) {
			if(key.indexOf(temp[i])>-1) title = title.replace(temp[i],"<b>"+temp[i]+"</b>")
			if(key.indexOf(temp[i].substring(0,temp[i].length-1))>-1) title = title.replace(temp[i].substring(0,temp[i].length-1),"<b>"+temp[i].substring(0,temp[i].length-1)+"</b>")
			}

		temp = ps2.split(" ")
		for(i=0; i<temp.length; i++) {
			if(key.indexOf(temp[i])>-1) ps2 = ps2.replace(temp[i],"<b>"+temp[i]+"</b>")
			if(key.indexOf(temp[i].substring(0,temp[i].length-1))>-1) ps2 = ps2.replace(temp[i].substring(0,temp[i].length-1),"<b>"+temp[i].substring(0,temp[i].length-1)+"</b>")
			}

		temp = key.split(" ")
		for(i=0; i<temp.length; i++) {
			if(title.indexOf(temp[i])>-1) title = title.replace(temp[i],"<b>"+temp[i]+"</b>")
			if(ps2.indexOf(temp[i])>-1) ps2 = ps2.replace(temp[i],"<b>"+temp[i]+"</b>")
			}
		
		title = title.replace(key,"<b>"+key+"</b>")
		ps2 = ps2.replace(key,"<b>"+key+"</b>")
		}

	document.write(""
		+"<table width=100%>"
		+"<tr><td style='padding-left:"+pad_left+"; line-height:17px'>"
			+"<img src=/IMG/school/pics/file_"+ext+".gif align=absmiddle> <A href=/detail/report_"+r_day.replace('/','').replace('/','')+".html class=t2 title='ÀÚ¼¼È÷º¸±â/´Ù¿î¹Þ±â'>["+cat1+"] "+title+"</u></font></a> <A href=/detail/report_"+r_day.replace('/','').replace('/','')+".html class=A411 target=_blank title='»õÃ¢¿¡¼­ ¿­±â'>[»õÃ¢]</a>"
		)

	if(cat0 == "report")
	document.write(""
			+"<table><td></table>"
			+"<table><td width=10><td>"
				+"<font style='font-size:12px; color:#808080'>"+ps2
				+"<table><td></table>"
				+"<font color=gray> <A href=#nul onclick=click_cat('"+cat1+"','','report') title='["+cat1+"] ¿¡¼­ Ã£±â'><font color=gray>"+cat1+"</font></a> > <A href=#nul onclick=click_cat('"+cat1+"','"+cat2+"','report') title='["+cat2+"] ¿¡¼­ Ã£±â'><font color=gray>"+cat2+"</font></a> &nbsp|&nbsp <font color=blue>"+page_+"</font> page &nbsp|&nbsp <font color=red>"+IComma(money)+"</font> ÄÚÀÎ &nbsp|&nbsp "+ext+" ÆÄÀÏ"
			+"</table>"
			)

	else
	document.write(""
		+"<table><td></table>"
		+"<table><td width=15><td><font color=gray>"+ps2+"</table>"
		+"<td align=right style='padding-right:10'><table><td>"+r_day2+"<td width=20><td align=right><font color=blue>"+page_+"</font><font color=gray> page<td width=20><td><font color=red>"+IComma(money)+"</font> <font color=gray>ÄÚÀÎ</table>"
		)

	document.write("</table>")
        }


function print_tong_nonsool(r_day,cat1,cat2,file,title,ps,page_,money,id) {
        ext = "hwp"
        if(file) ext = file.substr(file.length-3,3)

        if(id=="ÁÖ¿¬µ¶¼­") ext = "hwp"

        title = title.replace(key,"<b>"+key+"</b>")
        ps = ps.replace(key,"<b>"+key+"</b>")

        if(page_ == "0") page_ = "?"

        if(money != "0") price = "<font color=red>"+IComma(money)+"<font color=gray> ÄÚÀÎ"
        else price = "¹«·á"

        document.write(""
        +"<table width=800>"
        +"<tr><td style='padding-left:38'>"
        +"<img src=/IMG/school/pics/file_"+ext+".gif align=absmiddle> <A href=/detail/nonsool_"+r_day.replace('/','').replace('/','')+".html class=t2 title='ÀÚ¼¼È÷º¸±â/´Ù¿î¹Þ±â'>["+cat1+"-"+cat2+"] "+title+"</u></font></a><font color=#C0C0C0>("+cat2+")</font> <A href=/detail/nonsool_"+r_day.replace('/','').replace('/','')+".html class=A411 target=_blank title='»õÃ¢¿¡¼­ ¿­±â'>[»õÃ¢]</a>"
        +"<td align=right style='padding-right:10'><table><td><font color=blue>"+page_+"<font color=gray> page<td width=20><td>"+price+"</table>"
        +"</table>"
        +"")
        }


function print_tong_kichul(r_day,cat1,cat2,cat3,file,title,ps,page_,money,id) {
        ext = file.substr(file.length-3,3)
        if(id=="±âÃâ´åÄÄ") ext = "hwp"

        title2 = CLen(title,65)

        if(page_ == 0) page_ = "?"

        title2 = title2.replace(key,"<b>"+key+"</b>")
        ps = ps.replace(key,"<b>"+key+"</b>")

        document.write(""
        +"<table width=800>"
        +"<tr><td style='padding-left:38'>"
        +"<img src=/IMG/school/pics/file_"+ext+".gif align=absmiddle> <A href=/detail/kichul_"+r_day.replace('/','').replace('/','')+".html class=t2 title='ÀÚ¼¼È÷º¸±â/´Ù¿î¹Þ±â'>["+cat1+"-"+cat2+"] "+title2+"</u></font></a> <font color=#C0C0C0>("+cat3+") "
	+"<A href=/detail/kichul_"+r_day.replace('/','').replace('/','')+".html class=A411 target=_blank title='»õÃ¢¿¡¼­ ¿­±â'>[»õÃ¢]</a>"
        +"<td align=right style='padding-right:10'><table><td><font color=blue>"+page_+"<font color=gray> page<td width=20><td><font color=red>"+IComma(money)+"<font color=gray> ÄÚÀÎ</table>"
        +"</table>"
        +"")
        }


function print_tong_note(r_day,cat1,cat2,cat3,file,title,ps,page_,money,id) {
        r_day2 = r_day.substr(0,10)
        ext = file.substr(file.length-3,3)

        title = title.replace(key,"<b>"+key+"</b>")
        ps = ps.replace(key,"<b>"+key+"</b>")

        document.write(""
        +"<table width=800>"
        +"<tr><td style='padding-left:38; line-height:24px'>"
        +"<img src=/IMG/school/pics/file_"+ext+".gif align=absmiddle> <A href=/detail/note_"+r_day.replace('/','').replace('/','')+".html class=t2 title='ÀÚ¼¼È÷º¸±â/´Ù¿î¹Þ±â'>["+cat1+"-"+cat2+"] "+title+"</a> <font color=#C0C0C0>("+cat3+")</font> "
	+"<A href=/detail/note_"+r_day.replace('/','').replace('/','')+".html class=A411 target=_blank title='»õÃ¢¿¡¼­ ¿­±â'>[»õÃ¢]</a>"
        +"<br>¡¡<font style='font-size:12px; color:#808080'>"+CLen(ps,80)
        +"<td align=right style='padding-right:10'><table><td>"+id+"<td width=20><td><font color=blue>"+page_+"<font color=gray> page<td width=20><td><font color=red>"+IComma(money)+"<font color=gray> ÄÚÀÎ</table>"
        +"</table>"
        +"")
        }


function print_tong_sooji(r_day,id,cat,title,ps,select_id,reply) {
        r_day2 = r_day.substr(0,10)
        state = "ÁøÇàÁß"
        st_color = "#0080FF"
        if(select_id) {
                state = "¿Ï·á"
                st_color = "Gray"
                }

        title = title.replace(key,"<b>"+key+"</b>")
        ps = ps.replace(key,"<b>"+key+"</b>")

        document.write(""
        +"<table width=800>"
        +"<tr><td style='padding-left:38; line-height:24px'>"
        +"<A class=t2 href=/know/sooji/detail.asp?r_day="+r_day+">["+cat+"] "+title+"</a> "
        +"<font color="+st_color+">¡¥¡¦("+reply+") "+state+"</font>"

        +"<br>¡¡<font style='font-size:12px; color:#808080'>"+CLen(ps,90)
        +""
        +"<td align=right style='padding-right:10'>"
        +"<table><td>"+r_day2+"<td width=20><td>"+id+"</table>"
        +""
        +"</table>"
        +"")
        }



function print_tong_mvote(r_day,id,e_day,question,ps) {
        r_day2 = r_day.substr(0,10)
        state = "<A href=/study/vote/><font color=#0080FF>ÁøÇàÁß --> (Âü¿©ÇÏ±â)</font></a> "
        if(e_day) state = "¿Ï·á"

        question = question.replace(key,"<b>"+key+"</b>")
        ps = CLen(ps,90)

        document.write(""
        +"<table width=800>"
        +"<tr><td style='padding-left:38; line-height:24px'>"
        +" <A class=t2 href=/study/debate/vote/detail.asp?r_day="+r_day+">"+CLen(question,60)+"</a> ¡¦"+state
        +"<br><font color=gray>¡¡"+ps
        +"<td align=right style='padding-right:10'>"
        +"<table><td>"+r_day2+"<td width=20><td>"+id+"</table>"
        +"</table>"
        +"")
        }



function print_tong_poster(r_day,cat,title,ext,cnt) {
        file = r_day.replace("/","").replace("/","").replace("-","")

        document.write("<td>["+cat+"]<br><A href=/poster_detail/"+(r_day.replace("/","").replace("/",""))+".html><img src=http://photo.sooheng.com/poster/"+file+"_."+ext+" style='border:solid 1px gray' title='"+title+"'></a><br><font style='font-size:12px; color:#808080'>"+CLen(title,20))

        if(cnt % 5 == 0 && cnt > 0) document.write("<tr><td width=40>")
        }
function print_tong_poster_top() { document.write("<table width=800><tr><td width=40>") }
function print_tong_poster_bottom() { document.write("</table>") }



function print_tong_time(r_day,id,ps,cnt) {
        file = r_day.replace("/","").replace("/","").replace("-","")
        ps = ps.replace(key,"<b>"+key+"</b>")

        if(userp) {
                bg_file = "http://files.sooheng.com/time/"+id.charAt(0)+"/"+id+"/"+userp
                tcolor = "white"
                postion = "50% 50%"
                }
        else if(userb) {
                bg_file = "http://files.sooheng.com/time/"+id.charAt(0)+"/"+id+"/"+userb
                tcolor = "white"
                postion = "50% 50%"
                }
        else {
                bg_file = "/IMG/study/time/image/back_"+backg+".gif"
                tcolor = "gray"
                postion = "0% 0%"
                }

        for(i=1; i<5; i++) ttime = ttime.replace(";"," ")
        for(i=1; i<30; i++) ttime = ttime.replace(","," ")

        document.write(""
        +"<td width=160 valign=top><table style='cursor:hand; border:solid 1px gray' title=¹Ì¸®º¸±â onclick=time_preview('"+id+"') width=160 height=170 background="+bg_file+" style='background-position:"+postion+"; background-repeat:no-repeat'><td valign=bottom><font color="+ctime+" style='font-family:µ¸¿ò; font-size:11px'>¡¡¿ù¡¡ È­¡¡¼ö¡¡ ¸ñ¡¡±Ý¡¡ Åä<table height=1 width=100%><td bgcolor="+tcolor+" height=1></table>"+CLen(ttime,90-CLen(id))+"</table>"+CLen("<b>"+id+"</b> - <font color=gray>"+ps,75)+" ["+r_day.substr(5,5)+"]"
        +"")

        if(cnt % 4 == 0 && cnt > 0) document.write("<tr><td width=40>")
        }
function print_tong_time_top() { document.write("<table width=800><tr><td width=40>") }
function print_tong_time_bottom() { document.write("</table>") }
function time_preview(v) { tmode = "preview"; vid = v; window.open("/study/time/print.html","print","width=740,height=700,scrollbars=yes") }



function print_tong_feel(r_day,cat1,cat2,title,ps,link) {
        max_len = 250
        if(cat0 == "tong") max_len = 120

        title = title.replace(key,"<b>"+key+"</b>")
        ps = CLen(ps,max_len)

        document.write(""
        +"<table width=800>"
        +"<tr><td style='padding-left:38; line-height:24px'>"
        +" <A class=t2 href="+link+">"+CLen(title,60)+"</a> <font color=gray>("+cat1+")"
        +"<br><font color=gray style='line-height:18px'>¡¡"+ps
        +"<td align=right style='padding-right:10'>"
        +"</table>"
        +"")
        }




function print_tong_talk(r_day,cat1,cat2,title,ps,link) {
        max_len = 250
        if(cat0 == "tong") max_len = 120

        title = title.replace(key,"<b>"+key+"</b>")
        ps = CLen(ps,max_len)

        document.write(""
        +"<table width=800>"
        +"<tr><td style='padding-left:38; line-height:24px'>"
        +"<A class=t2 href="+link+">"+CLen(title,60)+"</a> <font color=gray>("+cat1+")"
        +"<table><td><td><font color=gray style='line-height:18px'>"+ps+"</table>"
        +"<td align=right style='padding-right:10'>"
        +"</table>"
        +"")
        }





function print_tong_tamgu(r_day,cat1,cat2,title,ps) {
        max_len = 250
        if(cat0 == "tong") max_len = 120

        title = title.replace(key,"<b>"+key+"</b>")
        ps = CLen(ps,max_len)
        ps = ps.replace(key,"<b>"+key+"</b>")

        document.write(""
        +"<table width=800>"
        +"<tr><td style='padding-left:38; line-height:24px'>  "
        +"<A class=t2 href=/tamgu/"+r_day.replace("/","").replace("/","")+".html>"+CLen(title,60)+"</a> <font color=gray>("+cat1+")"
        +"<table><td><td><font color=gray style='line-height:18px'>"+ps+"</table>"
        +"<td align=right style='padding-right:10'>"
        +"</table>"
        +"")
        }




// ºÎÇÏ
function print_key_record(key,num,cat1) {
	return false

	old_key = getCookie("old_key")
	if(old_key.indexOf(key)==-1) {
		if(num>0) {
			document.write("<IFRAME src='/school/key_record.asp?key="+escape(key)+"&num="+num+"&cat1="+cat1+"' width=0 height=0></iframe>")
			setCookie("old_key",key)
			}
		}
	}
