
    function modify_book(_id)
    {
        last_info_id = _id;
        
        var book_info_edit = document.getElementById("book_info_edit_" + _id);
        //book_info_edit.style.display = "block";
        givestar(parseInt(document.getElementById("info_stars_" + _id).value));
        var _cat = document.getElementById("info_usercategory2_" + _id).value;
        var _catkor = document.getElementById("info_usercategory2_kr_" + _id).value;
        
        var _cat1 = document.getElementById("info_usercategory_" + _id).value;
        document.getElementById("category1_" + _id + "_" + _cat1).checked = true;
        
        
        document.getElementById("purchaseDate_" + _id).value = document.getElementById("info_puchased_date_" + _id).value;
        document.getElementById("startDate_" + _id).value = document.getElementById("info_start_date_" + _id).value;
        document.getElementById("endDate_" + _id).value = document.getElementById("info_end_date_" + _id).value;
        document.getElementById("name_rent_" + _id).value = document.getElementById("info_name_rent_" + _id).value;
        document.getElementById("date_rent_" + _id).value = document.getElementById("info_date_rent_" + _id).value;
        if (document.getElementById("info_is_rentable_" + _id).value == "1")
            document.getElementById("is_rentable_" + _id).checked = true;

        //document.getElementById("rd_readBook_" + _cat).checked = true;
        cat_change(_cat, _catkor, _id);
        
    }

    function modify()
    {
    	
    	var category = cur_cat;
        var category1 = 1;
        if (document.getElementById("category1_" + last_info_id + "_2").checked) category1 = "2";
        if (document.getElementById("category1_" + last_info_id + "_3").checked) category1 = "3";
        
        var starsgiven = document.getElementById("starsgiven").value;
        var comments = document.getElementById("comments_" + last_info_id).value;

    	var pd = document.getElementById("purchaseDate_" + last_info_id).value;
    	var sd = document.getElementById("startDate_" + last_info_id).value;
    	var ed = document.getElementById("endDate_" + last_info_id).value;
        var name_rent = document.getElementById("name_rent_" + last_info_id).value;
        var date_rent = document.getElementById("date_rent_" + last_info_id).value;
        var is_rentable = "0"
        if (document.getElementById("is_rentable_" + last_info_id))
            if (document.getElementById("is_rentable_" + last_info_id).checked) is_rentable = "1"
        
        
        httpcall_post("/ajax_exe/edit_book/" + last_info_id + "/", "puchased_date=" + Base64.URLEncode(pd) + "&start_date=" + Base64.URLEncode(sd) + "&end_date=" + Base64.URLEncode(ed) + "&name_rent=" + Base64.URLEncode(name_rent) + "&date_rent=" + date_rent + "&category1=" + category1 + "&category=" + category + "&starsgiven=" + starsgiven + "&is_rentable=" + is_rentable + "&comments=" + Base64.URLEncode(comments), modify_res);
        
        div_close("book_info_edit_" + last_info_id);
        
    }

	function givestar(star)
	{
	    ret = "";
	    
	    for (i=1;i<=star;i++)
	        ret += "<a href=\"#\" onmouseover=\"givestar(" + i +");\" ><img src=\"http://media." + smu + "/images/star_on.gif\" /></a>";
	    for (i=star+1;i<=5;i++)
	        ret += "<a href=\"#\" onmouseover=\"givestar(" + i +");\" ><img src=\"http://media." + smu + "/images/star_off.gif\" /></a>";

        if (star == 0)
		{
			ret += "<i class=\"textPoint\">아직 모르겠어요.</i>";
		}
		else if (star == 1)
		{
			ret += "<i class=\"textPoint\">추천하지 않아요.</i>";
		}
		else if (star == 2)
		{
			ret += "<i class=\"textPoint\">그냥 그래요.</i>";
		}
		else if (star == 3)
		{
			ret += "<i class=\"textPoint\">읽을 만 해요.</i>";
		}
		else if (star == 4)
		{
			ret += "<i class=\"textPoint\">아주 좋아요!</i>";
		}
		else
		{
			ret += "<i class=\"textPoint\">강력 추천!!</i>";
		}
	    currentStar = star;
        document.getElementById("starsgiven").value = star;
	    document.getElementById('stars_edit_' + last_info_id).innerHTML = ret;
	}
	
	function cat_change(key,v, _id)
	{
	    cur_cat = key;
	    document.getElementById("check_cat_10_" + _id).className = "";
	    document.getElementById("check_cat_20_" + _id).className = "";
	    document.getElementById("check_cat_30_" + _id).className = "";
	    document.getElementById("check_cat_40_" + _id).className = "";
	    
	    document.getElementById("category").value = key;
	    document.getElementById("category_kor_" + _id).innerHTML = v;
	    
	    
	    document.getElementById("check_cat_" + key + "_" + _id).className = "current";
	    
	    
        
	    if (key == 40)
	        document.getElementById('add_lend_' + _id).style.display = "block";
	    else
	        document.getElementById('add_lend_' + _id).style.display = "none";
        
	}	

// 댓글


    function add_comment(type, id, txt)
    {
        
        txtv = trim(txt.value);
        
        if (txtv == "")
        {
            show_and_fadeout_status("댓글에 내용이 없습니다.",1000);
            return false;
        }
        else if (txtv.length > 1999)
        {
            show_and_fadeout_status("댓글의 내용이 너무 깁니다.",1000);
            return false;
        }
        
        div_close(type + "_" + id + "_comment_btn");
        div_open(type + "_" + id + "_comment_btn_wait");
        
        httpcall_ajax_post("/ajax_exe/add_comment/home/" + type + "/" + id + "/", "comment=" + Base64.URLEncode(txtv), add_comment_res);
     
    }



    
    
    function modify_comment (_type,_id, _id2, _body)
    {
        var _target;
        var _t_name;
        
        _t_name = "reply_" + _type + "_" + _id + "_" + _id2;
        _target = document.getElementById(_t_name);
        
        if (_target.innerHTML.substr(0,4) == "<DIV" || _target.innerHTML.substr(0,4) == "<div")
        {
            var _txt = document.getElementById(_t_name + "_ta");
            txtv = trim(_txt.value);
            txtv = Base64.URLEncode(txtv);
            
            
            if (txtv == "")
            {
                show_and_fadeout_status("댓글에 내용이 없습니다.",1000);
                return false;
            }
            else if (txtv.length > 1999)
            {
                show_and_fadeout_status("댓글의 내용이 너무 깁니다.",1000);
                return false;
            }                    
            httpcall_ajax_post("/ajax_exe/modify_comment/home/" + _type + "/" + _id + "/" + _id2 + "/","comment=" + txtv, modify_comment_res);
            return false;
        }
        else
        {
            //var crt_body = _target.innerHTML;
            var crt_body = _body;
            _body = to_HTML(addslashes2(_body));
            var _kk = "<textarea id=\"" + _t_name + "_ta\"></textarea><p><input class=\"submit\" type=\"submit\" value=\"저장하기\" onclick=\"modify_comment('" + _type + "', " + _id + ", " + _id2 + ",'');return false;\" title=\"저장합니다.\"/><a class=\"cancel\" href=\"#\"onclick=\"cancel_comment('" + _type + "', " + _id + ", " + _id2 + ",'" + _body + "');return false;\" >취소</a></p>";
            var el = document.createElement("div");
            el.innerHTML = _kk;
            el.className = "comment_edit";
            document.getElementById(_t_name).innerHTML = "";
            document.getElementById(_t_name).appendChild(el);
            document.getElementById(_t_name + "_ta").value = crt_body;
            
        }
    }
    
    function remove_comment (type,id,id2)
    {
        yesno ("정말 삭제하시겠습니까?", function t(){remove_comment_act(type,id,id2);});
    }
    
    function remove_comment_act(type, id, id2)
    {
        var _target;
        var _t_name;
        
        _t_name = "reply_" + type + "_" + id + "_" + id2;
        _target = document.getElementById(_t_name);
        
        httpcall_html("/ajax_exe/remove_comment/home/" + type + "/" + id + "/" + id2 + "/", remove_comment_res);
    }
    
    function remove_comment_res(rt)
    {
	    rt_arr = rt.split("|");
	    var target_str = "reply_" + rt_arr[0] + "_" + rt_arr[1] + "_" + rt_arr[2] + "_li";
	    document.getElementById("reply_" + rt_arr[0] + "_"  + rt_arr[1]).removeChild(document.getElementById(target_str));

	    var _cnt = document.getElementById("reply_" + rt_arr[0] + "_" + rt_arr[1] + "_cnt").innerHTML
	    _c2 = parseInt(_cnt);
	    _c2 = _c2-1;
	    if (_c2 == 1)
	    {
            document.getElementById("reply_" + rt_arr[0] + "_" + rt_arr[1] + "_cnt_af").innerHTML = "개의 댓글";
    	    document.getElementById("reply_" + rt_arr[0] + "_" + rt_arr[1] + "_cnt").innerHTML = _c2;
	    }
	    else if (_c2 == 0)
	    {
    	    document.getElementById("reply_" + rt_arr[0] + "_" + rt_arr[1] + "_cnt").innerHTML = "댓글 달기";
    	    document.getElementById("reply_" + rt_arr[0] + "_" + rt_arr[1] + "_cnt").className = "";
    	    document.getElementById("reply_" + rt_arr[0] + "_" + rt_arr[1] + "_cnt_af").innerHTML = "";
	    }
	    else
	    {
    	    document.getElementById("reply_" + rt_arr[0] + "_" + rt_arr[1] + "_cnt").innerHTML = _c2;
	    }
	    
    }
    
    function modify_comment_res (_res)
    {
        if (_res.error_code != 0)
    	{
    	    alert(_res.error_str);
    	}
    	else
    	{
    	    
		    var target_str = "reply_" + _res.get("type") + "_" + _res.get("f_idx") + "_" + _res.get("cmt_idx");
            var ret = addBR(_res.get("body")) + "&nbsp;<a class=\"edit\" href=\"#\" onclick=\"modify_comment('" + _res.get("type");
            ret = ret + "', " + _res.get("f_idx") + ", " + _res.get("cmt_idx") + ", '";
            ret = ret + addslashes2(_res.get("body")) + "');return false;\">수정하기</a> <a class=\"edit_alt\" href=\"#\" onclick=\"remove_comment('";
            ret = ret + _res.get("type") + "', ";
            ret = ret + _res.get("f_idx") + ", " + _res.get("cmt_idx") + ");return false;\">삭제</a>";
		    document.getElementById(target_str).innerHTML = ret;
    		    
    	}
    }


    function add_comment_res(_res) {
        if (_res.error_code != 0)
    	{
    	    alert(_res.error_str);
    	}
    	else
    	{
		    var _body = addslashes2(_res.get("body"));
		    document.getElementById("ta_" + _res.get("type") + "_" + _res.get("f_idx")).value = "";
		    var target_str = "reply_" + _res.get("type") + "_" + _res.get("f_idx");
		    if (_res.get("type") == "quote")
		    {
    		    ret = "<li id=\"" + target_str + "_" + _res.get("cmt_idx") + "_li\"><a href=\"" + user_url + "\"><img src=\"" + user_pic + "/30/30/\" alt=\"" + user_nick + "\" /></a> <span class=\"commentor\"><a href=\"" + user_url + "\" class=\"userName\">" + user_nick + "</a><span class=\"date\">지금 막</span></span><span id=\"reply_" + _res.get("type") + "_" + _res.get("f_idx")  + "_" + _res.get("cmt_idx") + "\">" + addBR(_res.get("body")) + "&nbsp;<a class=\"edit\" href=\"#\" onclick=\"modify_comment('" + _res.get("type") + "', " + _res.get("f_idx") + ", " + _res.get("cmt_idx") + ", '" + _body + "');return false;\">수정하기</a> <a class=\"edit_alt\" href=\"#\" onclick=\"remove_comment('" + _res.get("type") + "', " + _res.get("f_idx") + ", " + _res.get("cmt_idx") + ");return false;\">삭제</a></span></li>";
    		}
    		else
    		{
    		    ret = "<li id=\"" + target_str + "_" + _res.get("cmt_idx") + "_li\"><a href=\"" + user_url + "\"><img src=\"" + user_pic + "/30/30/\" alt=\"" + user_nick + "\" /></a> <p class=\"commentor\"><a href=\"" + user_url + "\" class=\"userName\">" + user_nick + "</a><small class=\"date\">지금 막</small></p><p><span id=\"reply_" + _res.get("type") + "_" + _res.get("f_idx") + "_" + _res.get("cmt_idx") + "\">" + addBR(_res.get("body")) + "&nbsp;<a class=\"edit\" href=\"#\" onclick=\"modify_comment('" + _res.get("type") + "', " + _res.get("f_idx") + ", " + _res.get("cmt_idx") + ", '" + _body + "');return false;\">수정하기</a> <a class=\"edit_alt\" href=\"#\" onclick=\"remove_comment('" + _res.get("type") + "', " + _res.get("f_idx") + ", " + _res.get("cmt_idx") + ");return false;\">삭제</a></span></p></li>";
    		}
		    document.getElementById(target_str).innerHTML = document.getElementById(target_str).innerHTML + ret;
		    var _cnt = document.getElementById(target_str + "_cnt").innerHTML
		    _c2 = parseInt(_cnt);
		    if (_c2)
		    {
		        _c2 = _c2+1;
		        if (_c2 == 2)
    		        document.getElementById(target_str + "_cnt_af").innerHTML = "개의 댓글들";
		    }
		    else
		    {
		        _c2 = 1;
		        document.getElementById(target_str + "_cnt_af").innerHTML = "개의 댓글";
        	    document.getElementById(target_str + "_cnt").className = "cnt";
		    }
		    document.getElementById(target_str + "_cnt").innerHTML = _c2;

            div_open(_res.get("type") + "_" + _res.get("f_idx") + "_comment_btn")
            div_close(_res.get("type") + "_" + _res.get("f_idx") + "_comment_btn_wait");

    	}


    }	


    function cancel_comment (_type,_id,_id2, _body)
    {
        var _target;
        var _t_name;
        
        _t_name = "reply_" + _type + "_" + _id + "_" + _id2;
        _target = document.getElementById(_t_name);
        var ret = to_HTML(_body) + "&nbsp;<a class=\"edit\" href=\"#\" onclick=\"modify_comment('" + _type + "', " + _id + ", " + _id2 + ", '" + addslashes(_body) + "');return false;\">수정하기</a> <a class=\"edit_alt\" href=\"#\" onclick=\"remove_comment('" + _type + "', " + _id + ", " + _id2 + ");return false;\">삭제</a>";
        _target.innerHTML = ret;
    }
    
    function delete_additional_info(id)
    {
        document.getElementById("moreInfoAdd").style.display = "none";

  	    s_str = "/ajax_exe/additional_info_remove/" + id + "/";
    	httpcall (s_str, delete_additional_info_res);
        return false;
    }
    
    function delete_additional_info_res(_res)
    {
        if(_res && _res.readyState == 4)
    	{
    		if(_res.status == 200)
    		{
    		    rt = _res.responseText;
    		    
                k = document.getElementById("additional_info_" + rt);
                document.getElementById("additional_info").removeChild(k);
                
                
    		}
    	}            
    }
    
    function ai_add()
    {
        document.frm_myshelf_detail.ai_title.value = "";
        document.frm_myshelf_detail.ai_link.value = "";
        //document.getElementById("moreInfoAdd").style.display = "block";
        ai_status = "add";
        ai_id = "";
    }
    
    function edit_additional_info(id, title, link)
    {
        document.frm_myshelf_detail.ai_title.value = document.getElementById("additional_info_title_" + id).value;
        document.frm_myshelf_detail.ai_link.value = link;
        document.getElementById("moreInfoAdd").style.display = "block";
        ai_status = "modify";
        ai_id = id;
        
    }
    
    function ai_submit()
    {
        document.getElementById("moreInfoAdd").style.display = "none";

    	if (ai_status == "add")
    	{
    	    s_str = "/ajax_exe/additional_info_add/" + book_id + "/?title=" + Base64.URLEncode(document.frm_myshelf_detail.ai_title.value) + "&link=" + Base64.URLEncode(document.frm_myshelf_detail.ai_link.value);
    	}
    	else
    	{
    	    s_str = "/ajax_exe/additional_info_edit/" + ai_id + "/?title=" + Base64.URLEncode(document.frm_myshelf_detail.ai_title.value) + "&link=" + Base64.URLEncode(document.frm_myshelf_detail.ai_link.value);
    	}
    	httpcall (s_str, ai_submit_res);
        return false;
        
    }
    
    function ai_submit_res(_res)
    {
    	if(_res && _res.readyState == 4)
    	{
    		if(_res.status == 200)
    		{
    		    rt = _res.responseText;
    		    rt_arr = rt.split("|");

                if (ai_status == "add")
                {
                    ai_id = rt_arr[0];
        		    link = rt_arr[1];
        		    title = rt_arr[2];
        		    if (rt_arr.length>3)
        		        for (i=3;i<rt_arr;i++)
        		        {
        		            title = title + rt_arr[i];
        		        }


    		        ret = "<li id=\"additional_info_" + ai_id + "\">&nbsp;<a class=\"addiInfo\" href=\"http://" + link + "\">" + to_HTML(title) + "</a>&nbsp;&nbsp;by&nbsp;<a class=\"userName\" href=\"" + user_url + "\">" + user_nick + "</a>&nbsp;&nbsp;<a class=\"edit\" href=\"#\" onclick=\"edit_additional_info('" + ai_id + "','','" + link + "');return false;\">수정하기</a>&nbsp;<input type=\"hidden\" id=\"additional_info_title_" + ai_id + "\" value=\"" + to_HTML(title) + "\"><a class=\"edit_alt\" href=\"#\" onclick=\"delete_additional_info('" + ai_id + "');return false;\">삭제</a></li>";
    		        
    		        document.getElementById("additional_info").innerHTML = document.getElementById("additional_info").innerHTML + ret;
                }
                else
                {    		    
        		    ai_id = rt_arr[0];
        		    link = rt_arr[1];
        		    title = rt_arr[2];
        		    
        		    if (rt_arr.length>3)
        		        for (i=3;i<rt_arr;i++)
        		        {
        		            title = title + rt_arr[i];
        		        }

    		        ret = "&nbsp;<a class=\"addiInfo\" href=\"http://" + link + "\">" + to_HTML(title) + "</a>&nbsp;&nbsp;by&nbsp;<a class=\"userName\" href=\"http://" + user_url + "\">" + user_nick + "</a>&nbsp;&nbsp;<a class=\"edit\" href=\"#\" onclick=\"edit_additional_info('" + ai_id + "','','" + link + "');return false;\">수정하기</a>&nbsp;<a class=\"edit_alt\" href=\"#\" onclick=\"delete_additional_info('" + ai_id + "');return false;\">삭제</a><input type=\"hidden\" id=\"additional_info_title_" + ai_id + "\" value=\"" + to_HTML(title) + "\">";
    		        document.getElementById("additional_info_" + ai_id).innerHTML = ret;
    		    }
    		}
    	}        
    }        
    
// 밑줄 친 문장
    function add_quote_submit()
    {
        comment = document.frm_myshelf_detail.comment.value;
        page = document.frm_myshelf_detail.page.value;
        quote = trim(document.frm_myshelf_detail.quote.value);
        
        if (page == "" || !isNumeric(page))
        {
            show_and_fadeout_status("인용 페이지는 숫자로만 입력 해 주세요",5000);
            return false;
        }
        
    	if (current_quote == "") type = "add_quote"; else type = "modify_quote";
    	var _url = "/ajax_exe/" + type + "/" + book_id + "/";
    	var _query = "page=" + page + "&quote=" + Base64.URLEncode(quote) + "&comment=" + Base64.URLEncode(comment) + "&quote_id=" + current_quote;
    	httpcall_post (_url, _query, add_quote_submit_res);
        
        document.getElementById("div_quote_add").style.display = "none";
            
    }

    function add_quote_submit_res(_res) {
    	if(_res && _res.readyState == 4)
    	{
    		if(_res.status == 200)
    		{
    		    rt = _res.responseText;

            	if (current_quote == "")
            	{
            	    current_quote = rt;
    		        ret = "<div id=\"quote_" + current_quote + "\" class=\"quot\"><blockquote><span  class=\"page\"><em><span id=\"page_" + current_quote + "\">" + page + "</span></em> page</span><p><span id=\"quote_v_" + current_quote + "\">"+ to_HTML(quote) +"</span></p></blockquote><div class=\"udCmt\"><small><a href=\"" + user_url + "\"><img src=\"" + user_pic + "/30/30/\" alt=\"" + user_nick + "\" /></a><span class=\"commentor\"><a href=\"" + user_url + "\" class=\"userName\">" + user_nick + "</a></span><span class=\"date\">지금 막</span><span id=\"comment_" + current_quote + "\" class=\"quot_comment\">" + to_HTML(comment) + "</span><i><a class=\"edit\" href=\"#\" onclick=\"modify_quote('" + current_quote + "');$('#div_quote_add').fadeIn('slow');return false;\">밑줄 문장 수정하기</a><a class=\"edit_alt\" href=\"#\" onclick=\"remove_quote('" + current_quote + "');return false;\">삭제</a></i><span class=\"udCmt_count\"><a href=\"#\" onclick=\"$('#d_reply_quote_" + current_quote + "').slideToggle('normal');return false;\"><span id=\"reply_quote_" + current_quote + "_cnt\">댓글 달기</span> <span id=\"reply_quote_" + current_quote + "_cnt_af\" class=\"cnt_af\"></span></a></span></small><div class=\"udCmt_tail\" id=\"d_reply_quote_" + current_quote + "\" style=\"display:none;\"><ul id=\"reply_quote_" + current_quote + "\"></ul><textarea cols=\"60\" rows=\"3\" title=\"댓글을 입력하세요.\" id=\"ta_quote_" + current_quote + "\"></textarea><p class=\"buttonWrap\" id=\"quote_" + current_quote + "_comment_btn\"><input class=\"submit udl_bt\" type=\"submit\" value=\"입력\" title=\"입력합니다.\" onclick=\"add_comment('quote','" + current_quote + "', document.frm_myshelf_detail.ta_quote_" + current_quote + ");return false;\"/></p><p class=\"buttonWrap\" id=\"quote_" + current_quote + "_comment_btn_wait\" style=\"display:none;\"><span class=\"loading\">Loading...</span></p></div></div></div>";
    		        
    		        document.getElementById("div_quote").innerHTML = document.getElementById("div_quote").innerHTML + ret;
    		    }
    		    else
    		    {
                    document.getElementById("comment_" + current_quote).innerHTML = to_HTML(comment);
                    document.getElementById("page_" + current_quote).innerHTML = page;
                    document.getElementById("quote_v_" + current_quote).innerHTML = to_HTML(quote);
    		    }
    		    
    		}
    	}
    }        

    function remove_quote(_id)
    {
        yesno("정말 삭제하시겠습니까?", function t(){remove_quote2(_id)});
        
    }

    function remove_quote2(_id)
    {
        comment = document.frm_myshelf_detail.comment.value;
        page = document.frm_myshelf_detail.page.value;
        quote = document.frm_myshelf_detail.quote.value;
        
    	if (current_quote == "") type = "add_quote"; else type = "modify_quote";
    	var _url = "/ajax_exe/remove_quote/" + _id + "/";
    	httpcall (_url, remove_quote_res);
        
    }

    function remove_quote_res(_res) {
    	if(_res && _res.readyState == 4)
    	{
    		if(_res.status == 200)
    		{
    		    rt = trim(_res.responseText);
                document.getElementById("quote_" + rt).innerHTML = "";
    		    
    		}
    	}
    }        

    function cancel_quote()
    {
        var div_quote_add = document.getElementById("div_quote_add");
        div_quote_add.style.display = "none";
    }
    
    function add_quote()
    {
        current_quote = ""
        var div_quote_add = document.getElementById("div_quote_add");
//        div_quote_add.style.display = "";
        div_quote_add.style.top = (offsetTop("addudbtn") -150) + "px";

        document.frm_myshelf_detail.comment.value = "";
        document.frm_myshelf_detail.page.value = "";
        document.frm_myshelf_detail.quote.value = "";
        //div_quote_add.style.left = "400px";
    }

    function modify_quote(id)
    {
        current_quote = id;
        
        var div_quote_add = document.getElementById("div_quote_add");
//        div_quote_add.style.display = "";
        //div_quote_add.style.left = "400px";
        div_quote_add.style.top = (offsetTop("quote_" + id) -150) + "px";
        
        document.frm_myshelf_detail.comment.value = to_plain(document.getElementById("comment_" + id).innerHTML);
        document.frm_myshelf_detail.page.value = document.getElementById("page_" + id).innerHTML;
        document.frm_myshelf_detail.quote.value = to_plain(document.getElementById("quote_v_" + id).innerHTML);
                
    }        
    
// 검색

	function naver()
    {
        
        
    	s_str = "http://openapi.naver.com/search?key=c83e28600467fb306de833b2af583de2&target=webkr&display=5&start=1&sort=sim&query=" + book_name;
    	
    	httpcall ("/ajax_exe/get/?q=" + Base64.URLEncode(s_str), naver_res);
    	document.getElementById("google_result").innerHTML = "<span class=\"loading\">Loading...</span>";
        return false;
        
        
	}
    
    var lastsearch = "";
    function naver_res(_res)
    {

    	if(_res && _res.readyState == 4)
    	{
    		if(_res.status == 200)
    		{
    		    rt = _res.responseText;
    		    
    		    rt = rt.replace(/&lt;b&gt;/g,'-');
    		    rt = rt.replace(/&lt;\/b&gt;/g,'-');
    		    
                var myObject = JINDO.xml2obj(rt);
                var ret = "";
                
                for (i=0;i<myObject.channel.item.length;i++)
                {
                    vUrl = myObject.channel.item[i].link;
                    v_show_url = cut(myObject.channel.item[i].link,80);
                    vTitle = myObject.channel.item[i].title;
                    vContent = myObject.channel.item[i].description;
                    ret = ret + "<li><dl><dt><a href=\"" + vUrl + "\" target=\"_blank\">" + vTitle + "</a></dt><dd>" + vContent + "</dd><dd><a href=\"" + vUrl + "\" target=\"_blank\">" + v_show_url + "</a></dd></dl></li>";
                    
                
                }
                
                document.getElementById("google_result").innerHTML = ret;
                document.getElementById("google_result").style.visibility = "visible";
                document.getElementById("result_powered").innerHTML = "<p class=\"api_vendor\">powered by <a href=\"http://naver.com\" class=\"sc_naver\">naver</a></p>";
                document.getElementById("result_more").style.display = "block";
                lastsearch = "naver";
    		    
    		}
    	}
    	
        
        
        
    }

    function search_more()
    {
        if (lastsearch == "naver")
            window.open("http://search.naver.com/search.naver?where=nexearch&query=" + book_name);
        else if (lastsearch == "daum")
            window.open("http://search.daum.net/search?w=tot&t__nil_searchbox=btn&nil_id=tot&top_sp=&stype=tot&q=" + book_name);
        else 
            window.open("http://www.google.co.kr/search?complete=1&hl=ko&q=" + book_name + "&btnG=Google+검색&lr=&aq=f");
        
    }


	function daum()
    {
    	s_str = "http://apis.daum.net/search/blog?apikey=300fadc32329bd5e81dbc907b127f872d3d3ebc5&result=5&output=json&q=" + book_name;
    	httpcall ("/ajax_exe/get/?q=" + Base64.URLEncode(s_str), daum_res);
    	document.getElementById("google_result").innerHTML = "<span class=\"loading\">Loading...</span>";
        return false;
	    
	}

    function daum_res(_res)
    {

    	if(_res && _res.readyState == 4)
    	{
    		if(_res.status == 200)
    		{
    		    rt = _res.responseText;
                
    		    rt = rt.replace(/&lt;b&gt;/g,'-');
    		    rt = rt.replace(/&lt;\/b&gt;/g,'-');
                
                var myObject = JSON.parse(rt);
                var ret = "";
    		    
                
                for (i=0;i<myObject.channel.item.length;i++)
                {
                    vUrl = myObject.channel.item[i].link;
                    v_show_url = myObject.channel.item[i].link;
                    vTitle = myObject.channel.item[i].title;
                    vContent = myObject.channel.item[i].description;
                    ret = ret + "<li><dl><dt><a href=\"" + vUrl + "\" target=\"_blank\">" + vTitle + "</a></dt><dd>" + vContent + "</dd><dd><a href=\"" + vUrl + "\" target=\"_blank\">" + vUrl + "</a></dd></dl></li>";
                
                }
                
                document.getElementById("google_result").innerHTML = ret;
                document.getElementById("google_result").style.visibility = "visible";
                document.getElementById("result_powered").innerHTML = "<p class=\"api_vendor\">powered by <a href=\"http://daum.net\" class=\"sc_daum\">daum</a></p>";
                document.getElementById("result_more").style.display = "block";
                lastsearch = "daum";
   		    
    		}
    	}
    	
        
        
        
    }

    
    function google()
    {

    	s_str = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=" + book_name;
    	httpcall("/ajax_exe/get/?q=" + Base64.URLEncode(s_str), google_res);
    	document.getElementById("google_result").innerHTML = "<span class=\"loading\">Loading...</span>";
        return false;
                    
    }
    
    function google_res(_res)
    {

    	if(_res && _res.readyState == 4)
    	{
    		if(_res.status == 200)
    		{
    		    rt = _res.responseText;
                var myObject = JSON.parse(rt);
                var ret = "";
                for (i=0;i<myObject.responseData.results.length;i++)
                {
                    vUrl = myObject.responseData.results[i].unescapedUrl;
                    v_show_url = myObject.responseData.results[i].url;
                    vTitle = myObject.responseData.results[i].title;
                    vContent = myObject.responseData.results[i].content;
                    ret = ret + "<li><dl><dt><a href=\"" + vUrl + "\" target=\"_blank\">" + vTitle + "</a></dt><dd>" + vContent + "</dd><dd><a href=\"" + vUrl + "\" target=\"_blank\">" + vUrl + "</a></dd></dl></li>";
                
                }
                
                document.getElementById("google_result").innerHTML = ret;
                document.getElementById("google_result").style.visibility = "visible";
                document.getElementById("result_powered").innerHTML = "<p class=\"api_vendor\">powered by <a href=\"http://google.com\" class=\"sc_google\">google</a></p>";
                document.getElementById("result_more").style.display = "block";
                lastsearch = "google";
    		    
    		}
    	}
    	
        
        
        
    }    
    

