function ajaxReadBooks( page ){
	document.getElementById("linkbookDiv").style.display = "none";
	document.getElementById("linkbook_waiting").style.display = "block";
	var url = "resourceDetail?_method=ajaxReadBooks&rid="+rid+"&p="+page;
	if (req) {
		req.open("get", url, true);
		req.setRequestHeader("Accept","text/html");
		req.onreadystatechange = rbComplete;
		req.send(null);
	}
}
function rbComplete() {
	if (req.readyState == 4) {
		if (req.status == 200) {
			var xmldoc = req.responseXML;
			var Results = xmldoc.getElementsByTagName("result");

			var t_bookname, t_bookcode, t_isbn, t_pubname, t_coverimgurl;
			var i = 0;
			if( Results == null || Results.length == 0 ){
			}else{
				for (i; i<Results.length; i++) {
					//alert("add");
					t_bookname = Results[i].childNodes[0].firstChild.data;
					t_bookcode = Results[i].childNodes[1].firstChild.data;
					t_isbn = Results[i].childNodes[2].hasChildNodes()? Results[i].childNodes[2].firstChild.data:"";
					t_pubname = Results[i].childNodes[3].hasChildNodes()?Results[i].childNodes[3].firstChild.data:"";
					t_coverimgurl = Results[i].childNodes[4].firstChild.data;
					//在这里填充面板
					var panel = document.getElementById('item'+i);
					fillRBPanel( panel,t_bookname,t_bookcode,t_isbn,t_pubname,t_coverimgurl);
				}
				for( i;i<3;i++ ){
					var panel = document.getElementById('item'+i);
					clearRBPanel( panel );
				}
			}
			document.getElementById("linkbookDiv").style.display = "block";
			document.getElementById("linkbook_waiting").style.display = "none";
		}
	}
}
function fillRBPanel(panel,t_bookname,t_bookcode,t_isbn,t_pubname,t_coverimgurl){
	var content = "<div class='book_left'><a href='bookDetail?bid="+t_bookcode+"' target='_blank'><img src='."+t_coverimgurl+"' /></a></div>";
	content += "<div class='book_right'><ul><li>书名:<span class='dtoInfo'>"+t_bookname+"</span></li><li>ISBN:<span class='dtoInfo'>"+t_isbn+"</span></li><li>出版社:<span class='dtoInfo'>"+t_pubname+"</span></li></ul></div>";
	panel.innerHTML = content;
}
function clearRBPanel( panel ){
	panel.innerHTML = "";
}
