$(function(){
	clicktabs("#tabsone li","#consone>ul","cur");
//	clicktabs(".tittwo li",".olwrap>ol","cur");
	clicktabs("#tabstwo li","#constwo>div","cur");
//	clicktabs("#tabsthree li","#consthree>ul","cur");
	clicktabs("#tabszxsb li","#conszxsb>ul","cur");

	function getmybook_all(){
		var myhsbooks = orderbook(gethsbooks()),
		hscontent = new Array();
		for (var i in myhsbooks) {
			hscontent.push('<li><span class="r_spanone"><a href="' + myhsbooks[i][1] + '">' + myhsbooks[i][0] + '</a></span><span class="r_spantwo">最近观看时间：' + myhsbooks[i][5] + '</span><span class="r_spanthree">看到：' + myhsbooks[i][2] + '</span><span class="r_spanfour"><a href="' + myhsbooks[i][3] + '">接着阅读</a></span><span class="dxx"></span></li>');
		}
		hscontent = hscontent.join('');
		if (hscontent) {
			$("#recbigbox").html('<div class="r_tline"></div><div class="recently_read"  id="recently_id"><h5>我最近看的</h5><div class="recently_list"><ul>' + hscontent + '</ul></div></div><div class="r_bline"></div>');
		}
	}

	$(".dxx").live('click',function(){
		var tp = $(this),
		txt = tp.parent().find('.r_spanone').text();
		var myhsbooks = orderbook(gethsbooks()),
			arr = new Array();
		for (var i in myhsbooks) {
			if (txt != myhsbooks[i][0]) {
				arr.push(myhsbooks[i].join("||"));
			}
		}

		$.cookie('bvalues', arr.join("|||"), {expires: 365});

		tp.parent().remove();
		getmybook_all();
	});

	getmybook_all();
});
