
/************************************************
	ÃÖ¼®±Õ_Syaku
	2007³â10¿ù08ÀÏ

	modified by ccanth 2010.07 ~ 2010.08
	- XHTML 1.0 Transitional¿¡ ¸Â°Ô ¾à°£¸¸ ¼öÁ¤
	- °¡´ÉÇÑ ºÎºÐÀº css·Î ºÐ¸®
*************************************************/

var IE = (navigator.userAgent.indexOf('MSIE') != -1) ? true : false;
var Check_IE = (navigator.userAgent.indexOf('MSIE 6.0') != -1) ? true : false;
var xmlHttp = null;
var xmlHttp_newbook = null;
var xmlUrl = "/main/xml.asp";
dealy_time="5";

var roll = null;

function createXMLHttpRequest() {
	var x = null;
	if (window.ActiveXObject) {
		try {
			x = new ActiveXObject("Msxml2.XMLHTTP");		
		}
		catch (e1) {
			try {
				x = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e2) { }
		}
	}
	else if (window.XMLHttpRequest) {
		x = new XMLHttpRequest();                
		if (x.overrideMimeType) {
			x.overrideMimeType('text/xml');
		}
	}

	return x;
}

// ½Å°£ µµ¼­ ºÒ·¯¿À±â
function NeweBookLoading() {
	xmlHttp = createXMLHttpRequest();
	xmlHttp.open("GET", xmlUrl + "?mode=new", true);
	xmlHttp.onreadystatechange = NeweBookLoadingCallBack;
	xmlHttp.send(null);
}

// ½Å°£ µµ¼­ ºÒ·¯¿À±â (new layout)
function NeweBookLoading_main2() {
	xmlHttp_newbook = createXMLHttpRequest();
	xmlHttp_newbook.open("GET", xmlUrl + "?mode=new", true);
	xmlHttp_newbook.onreadystatechange = NeweBookLoadingCallBack_main2;
	xmlHttp_newbook.send(null);
}


// ½Å°£ µµ¼­ ºÒ·¯¿À±â
function NeweBookLoadingCallBack() {

	var Cnt = 0;
	var Div = 0;
	var text = "";
	
	if (xmlHttp.readyState == 4) {
		if (xmlHttp.status == 200) {
			Cnt = xmlHttp.responseXML.getElementsByTagName("book").length;
			Div = Cnt/2;

			for (var i=0; i < Cnt;i++) {

				book_num = xmlHttp.responseXML.getElementsByTagName("book_num")[i].childNodes[0].nodeValue;
				link = xmlHttp.responseXML.getElementsByTagName("link")[i].childNodes[0].nodeValue;
				cover = xmlHttp.responseXML.getElementsByTagName("cover")[i].childNodes[0].nodeValue;
				title = xmlHttp.responseXML.getElementsByTagName("title")[i].childNodes[0].nodeValue;
				author = xmlHttp.responseXML.getElementsByTagName("author")[i].childNodes[0].nodeValue;
				description = xmlHttp.responseXML.getElementsByTagName("description")[i].childNodes[0].nodeValue;

				title = title.replace(/\'/g,"") 

				text += "<a href='" + link + "'>" 
					+ "<img src='" + cover + "' alt='"+ title +"'"+"title='"+ title +"'"+"width='98' height='144' " 
					+ "onmouseover=\"ShowHtml('<b><font color=#000000>" + title + " / " + author + "</font></b>');"
					+ "this.style.border='2px solid #FF7602';\" "
					+ "onmouseout=\"ShowHtml('');this.style.border='none';\">"
					+ "</a>";
			}
		} else if (xmlHttp.status == 204){
			text += "<p>ÇØ´ç µµ¼­°¡ ¾ø½À´Ï´Ù.</p>";
		}

		var NL = document.getElementById('Newbook_list');
		NL.innerHTML = text;

		if (Cnt != "0") {
			roll = new js_rolling('Newbook_list');
			//var roll = new js_rolling(document.getElementById('Newbook_list'));

			roll.move_gap = 4;	//¿òÁ÷ÀÌ´Â ÇÈ¼¿´ÜÀ§
			roll.time_dealy = dealy_time; //¿òÁ÷ÀÌ´Â Å¸ÀÓµô·¹ÀÌ
			roll.time_dealy_pause = 1000;//ÇÏ³ªÀÇ ´ë»óÀÌ »õ·Î ½ÃÀÛÇÒ ¶§ ¸ØÃß´Â ½Ã°£, 0 ÀÌ¸é Àû¿ë ¾ÈÇÔ
			roll.set_direction(4); // ¹ÝÇâÀ» ¹Ù²Þ. 1: top, 4:left ±×¿ÜÀÇ °æ¿ì µ¿ÀÛ¾ÈÇÔ
			roll.start(); //·Ñ¸µ µ¿ÀÛ
		}
		setTimeout("eBookLoading('best')", 200); 
	}
}



/* 2nd layoutÀÇ freshbook list ¿¡¼­ »ç¿ëµÇ´Â º¯¼öµé */
var newbook_cursor = 0;
var bestbook_loaded = 0;
var newbook_cnt = 0;
var items_per_line = 4;
var refresh_time = 5000;
var interval_id = null;

function DisplayItems_main2()
{
	var text = "";

	newbook_cnt = xmlHttp_newbook.responseXML.getElementsByTagName("book").length;

	for ( var i = newbook_cursor; i < newbook_cursor + items_per_line && i < newbook_cnt; i++ ) {

		book_num = xmlHttp_newbook.responseXML.getElementsByTagName("book_num")[i].childNodes[0].nodeValue;
		link = xmlHttp_newbook.responseXML.getElementsByTagName("link")[i].childNodes[0].nodeValue;
		cover = xmlHttp_newbook.responseXML.getElementsByTagName("cover")[i].childNodes[0].nodeValue;
		title = xmlHttp_newbook.responseXML.getElementsByTagName("title")[i].childNodes[0].nodeValue;
		author = xmlHttp_newbook.responseXML.getElementsByTagName("author")[i].childNodes[0].nodeValue;
		description = xmlHttp_newbook.responseXML.getElementsByTagName("description")[i].childNodes[0].nodeValue;

		
		title = title.replace(/\'/g,"");
		if ( title.length > 9 ) title = title.substr(0, 9) + "..";
		if ( description.length > 22 ) description = description.substr(0, 22) + "..";

		text += ('\t<li>\n'
				+'\t\t<a href="' + link + '">\n' 
				+'\t\t\t<img src="' + cover + '" class="freshbook_cover" />\n'
				+'\t\t\t<p class="freshbook_title">' + title + '</p>\n'
				+'\t\t\t<p class="freshbook_author">' + author + '</p>\n'
				+'\t\t\t<p class="freshbook_desc">' + description + '</p>\n'
				+'\t\t</a>\n\t</li>\n');

	}

	var NL = document.getElementById('Newbook_list');
	NL.innerHTML = text;

}


// ½Å°£ µµ¼­ ºÒ·¯¿À±â (new layout)
function NeweBookLoadingCallBack_main2() {

	var Cnt = 0;
	var Div = 0;
	var text = "";

	if (xmlHttp_newbook.readyState == 4) 
	{
		if (xmlHttp_newbook.status == 200) {

			DisplayItems_main2();
		
		}
		else if (xmlHttp_newbook.status == 204) {

			text += "\t<li>ÇØ´ç µµ¼­°¡ ¾ø½À´Ï´Ù.</li>";
		}

		if ( bestbook_loaded == 0 )
		{
			eBookLoading_main2('best');
			bestbook_loaded = 1;
		}
		interval_id = setInterval("DisplayFreshbookItemsNext()", refresh_time); 
	}
}

function DisplayFreshbookItemsNext()
{
	if (newbook_cnt != 0) {
		newbook_cursor += items_per_line;
		if (newbook_cursor >= newbook_cnt) newbook_cursor = 0;
		DisplayItems_main2();
	}
}

// ÀÎ±â ¹× º£½ºÆ® µµ¼­ ºÒ·¯¿À±â
function eBookLoading_main2(mode) {
	
	var BL = document.getElementById('book_list');
	document.getElementById('list_mode').value = mode;

	var bt_best = document.getElementById('bt_best');
	var bt_editor = document.getElementById('bt_editor');

	var more_link = document.getElementById('bt_more');

	if (mode == "best") {
		bt_best.className = "book_tab1_on";
		bt_editor.className = "book_tab2_off";
		more_link.href = "/main/bestbook.asp";

	} else {
		bt_best.className = "book_tab1_off";
		bt_editor.className = "book_tab2_on";
		more_link.href = "/main/choice.asp";
	}	

	xmlHttp = createXMLHttpRequest();
	xmlUrl += "?mode=" + mode;
	xmlHttp.open("GET", xmlUrl, true);s
	xmlHttp.onreadystatechange = eBookLoadingCallBack_main2;
	xmlHttp.send(null);
}


function ShowHtml(str) {
	var NN = document.getElementById('Newbook_Name');
	if (str == "") {
		NN.innerHTML = "&nbsp;";
	} else {
		NN.innerHTML = str;
	}
}

// ÀÎ±â ¹× º£½ºÆ® µµ¼­ ºÒ·¯¿À±â More
function eBookMainMore() {
	var mode = document.getElementById('list_mode').value;

	if (mode == "best") {
		document.location.href = "../main/bestbook.asp";
	} else {
		document.location.href = "../main/choice.asp";
	}
}

// ÀÎ±â ¹× º£½ºÆ® µµ¼­ ºÒ·¯¿À±â
function eBookLoading(mode) {
	
	var BL = document.getElementById('book_list');
	document.getElementById('list_mode').value = mode;

	var bt_best = document.getElementById('bt_best');
	var bt_editor = document.getElementById('bt_editor');


	var more_link = document.getElementById('bt_more');

	if (mode == "best") {
		bt_best.className = "book_tab_on";
		bt_editor.className = "book_tab_off";
		more_link.href = "/main/bestbook.asp";

	} else {
		bt_best.className = "book_tab_off";
		bt_editor.className = "book_tab_on";
		more_link.href = "/main/choice.asp";
	}	

	xmlHttp = createXMLHttpRequest();
	xmlUrl += "?mode=" + mode;
	xmlHttp.open("GET", xmlUrl, true);
	xmlHttp.onreadystatechange = eBookLoadingCallBack;
	xmlHttp.send(null);
}

// ÀÎ±â ¹× º£½ºÆ® µµ¼­ ºÒ·¯¿À±â
function eBookLoadingCallBack() {

	var Cnt = 0;
	var text = '<ul id="bestbookitem">\n';
	if (xmlHttp.readyState == 4) {		
		if (xmlHttp.status == 200) {			
			Cnt = xmlHttp.responseXML.getElementsByTagName("book").length;
			for (var i=0; i < Cnt;i++) {
				if (i%2 == 0) {
					text += '<li>\n';
				} else {
					text += '<li class="odd">\n';
				}

				book_num = xmlHttp.responseXML.getElementsByTagName("book_num")[i].childNodes[0].nodeValue;
				link = xmlHttp.responseXML.getElementsByTagName("link")[i].childNodes[0].nodeValue;
				cover = xmlHttp.responseXML.getElementsByTagName("cover")[i].childNodes[0].nodeValue;
				title = xmlHttp.responseXML.getElementsByTagName("title")[i].childNodes[0].nodeValue;
				author = xmlHttp.responseXML.getElementsByTagName("author")[i].childNodes[0].nodeValue;
				description = xmlHttp.responseXML.getElementsByTagName("description")[i].childNodes[0].nodeValue;

				text += '<a href="' + link + '" /a>\n';
				text += '<div class="boxshadow">\n'
				text += '<img src="' + cover + '" title="'+title+'"alt="'+ title +'" style="cursor:hand"/>\n';
				text += '</div>\n';
				text += '<p class="booktitle" style="cursor:hand" >' + title + '</p>\n'
				text += '<p class="bookauthor" style="cursor:hand" >' + author + '</p>\n'
				text += '<p class="bookdesc" style="cursor:hand">' + description + '</p>\n'
				text += '\n';

				text += '</a></li>\n';
			}
		} else if (xmlHttp.status == 204){
			text += '<li class="none">ÇØ´ç µµ¼­°¡ ¾ø½À´Ï´Ù.</li>';
		}

		text += "</ul>\n";	
		
		var BL = document.getElementById('book_list');
		BL.innerHTML = text;

	}
}


// ÀÎ±â ¹× º£½ºÆ® µµ¼­ ºÒ·¯¿À±â
function eBookLoadingCallBack_main2() {

	var Cnt = 0;
	var text = '<ul id="bestbookitem">\n';
	if (xmlHttp.readyState == 4) {		
		if (xmlHttp.status == 200) {	
			DisplayItems_main2();
			Cnt = xmlHttp.responseXML.getElementsByTagName("book").length;
			if (Cnt > 6) Cnt = 6;
			for (var i=0; i < Cnt;i++) {
				if (i%2 == 0) {
					text += '<li>\n';
				} else {
					text += '<li class="odd">\n';
				}

				book_num = xmlHttp.responseXML.getElementsByTagName("book_num")[i].childNodes[0].nodeValue;
				link = xmlHttp.responseXML.getElementsByTagName("link")[i].childNodes[0].nodeValue;
				cover = xmlHttp.responseXML.getElementsByTagName("cover")[i].childNodes[0].nodeValue;
				title = xmlHttp.responseXML.getElementsByTagName("title")[i].childNodes[0].nodeValue;
				author = xmlHttp.responseXML.getElementsByTagName("author")[i].childNodes[0].nodeValue;
				description = xmlHttp.responseXML.getElementsByTagName("description")[i].childNodes[0].nodeValue;

				text += '<a href="' + link + '" /a>\n';
				text += '<div class="boxshadow">\n'
				text += '<img src="' + cover + '" />\n';
				text += '</div>\n';
				text += '<p class="booktitle">' + title + '</p>\n'
				text += '<p class="bookauthor">' + author + '</p>\n'
				text += '<p class="bookdesc">' + description + '</p>\n'
				text += '</a>\n';

				text += '</li>\n';
			}
		} else if (xmlHttp.status == 204){
			text += '<li class="none">ÇØ´ç µµ¼­°¡ ¾ø½À´Ï´Ù.</li>';
		}

		text += "</ul>\n";	
		
		var BL = document.getElementById('book_list');
		BL.innerHTML = text;

	}
}


function xWrite(str,wsize,hsize) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + wsize + '" height="' + hsize + '">');
	document.write('<param name="movie" value="' + str + '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<embed src="' + str + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + wsize + '" height="' + hsize + '" />');
	document.write('</object>');
}

function xDownLoadeBook(Web,User) {
	document.write('<OBJECT ID="eBookAgent" CLASSID="CLSID:90D1D09A-EE24-4284-8A97-D5E4C189AC10" CODEBASE="http://www.bluemountainsoft.com/Agent/eBookAgent.ocx#version=2,0,0,6" width=100% height=100%>');
	document.write('<PARAM NAME="VendorID"		VALUE="B2B" />');
	document.write('<PARAM NAME="Param1"		VALUE="' + User + '" />');
	document.write('<PARAM NAME="Session"		VALUE="library_user_num" />');
	document.write('<PARAM NAME="DownloadUrl"	VALUE="' + Web + '/main/pi.asp" />');
	document.write('<PARAM NAME="LogoImageUrl"	VALUE="" />');
	document.write('<PARAM NAME="LoginViewType"	VALUE="TRUE" />');
	document.write('<PARAM NAME="DeskShortCut"	VALUE="FALSE" />');
	document.write('<PARAM NAME="SiteParam"		VALUE="" />');
	document.write('</OBJECT>');
}

function login_check (Value) {
	var frm = document.form_login;
	if(Value =="A") {  //´ëÃâÀÚ ¾ÆÀÌµð
		if(frm.txtID.value.length == 0){
			alert("´ëÃâÀÚID¸¦ ÀÔ·ÂÇÏ¼¼¿ä!");
			frm.txtID.focus();
			return false;
		}
		frm.method ="post"
		frm.action ="/member/login_k_ok.asp";
		frm.submit();	
	}else {            //ÀÏ¹ÝÈ¸¿ø¾ÆÀÌµð
		if(frm.txtID.value.length == 0){
			alert("È¸¿øID¸¦ ÀÔ·ÂÇÏ¼¼¿ä!");
			frm.txtID.focus();
			return false;
		}

		if(frm.txtPW.value.length == 0){
			alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä!");
			frm.txtPW.focus();
			return false;
		}
		frm.method ="post"
		frm.action ="/member/login_ok.asp";
		frm.submit();	
	}

}


function login_check2 (Value) {
	var frm = document.form_login2;
	if(Value =="A") {  //´ëÃâÀÚ ¾ÆÀÌµð
		if(frm.txtID2.value.length == 0){
			alert("´ëÃâÀÚID¸¦ ÀÔ·ÂÇÏ¼¼¿ä!");
			frm.txtID2.focus();
			return false;
		}
		frm.method ="post"
		frm.action ="/member/login_k_ok.asp";
		frm.submit();	
	}else {            //ÀÏ¹ÝÈ¸¿ø¾ÆÀÌµð
		if(frm.txtID2.value.length == 0){
			alert("È¸¿øID¸¦ ÀÔ·ÂÇÏ¼¼¿ä!");
			frm.txtID2.focus();
			return false;
		}

		if(frm.txtPW2.value.length == 0){
			alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä!");
			frm.txtPW.focus();
			return false;
		}
		frm.method ="post"
		frm.action ="/member/login_ok.asp";
		frm.submit();	
	}

}

function SetC(arg){
	window.open("/main/temp_pi.asp?arg="+arg,"set","width=330,height=210,scrollbars=no,resizable=no,top=200,left=300");
}

function SetC2(arg){
	window.open("/main/pda_pi.asp?arg="+arg,"set","width=1,height=1,scrollbars=no,resizable=no,top=2000,left=3000");
}

function SetC3(arg){
	window.open("/main/temp_pi2.asp?arg="+arg,"set","width=330,height=210,scrollbars=no,resizable=no,top=200,left=300");
}

function SetC4(book_num){
	window.open("/main/lent_ip.asp?book_num="+book_num,"set","width=330,height=231,scrollbars=no,resizable=no,top=200,left=300");
}

function SetCRead(arg){
	window.open("/main/temp_pi_read.asp?arg="+arg,"set","width=330,height=210,scrollbars=no,resizable=no,top=200,left=300");
}

function Wiz(url,book_num,path,part,mode) {
	if (mode == "XX")
	{
		window.open(url + "/djvu_toolbar/index.asp?vodPath="+path+"&wizid="+book_num,"","width="+screen.availWidth+",height="+screen.availHeight+",left=0,top=0,screenX=0,screenY=0");
	} else {
		window.open(url + "/Common/elib_proc/CUMS_Wizbook.asp?content_id=" + book_num + "&file_id=" + part,"set","width=330,height=231,scrollbars=no,resizable=no,top=200,left=300");
	}
}

function Kyobo(url,id,barcode,topic){

	window.open(url+"/drm/view_barobook.asp?barcode="+barcode + "&topic="+topic+ "&id="+id,"add_book","width=330,height=231,scrollbars=no,resizable=no,top=200,left=300");

//	self.close();
}

function SetK(arg){

	window.open("/DRM/view.asp?K_arg="+arg,"set","width=330,height=231,scrollbars=no,resizable=no,top=2000,left=3000");
}
function Dongsamo(arg,code){	
	window.open("/ebook/contents/contents_barobook_view.php?flash_file="+arg+"&code="+code,"set","width=800,height=600,scrollbars=no,resizable=yes,top=200,left=300");
}


function Nuri(book_num){
	window.open("/nuri/"+book_num +"/index.htm",'NuriEBook','width=976,height=726,top=20,left=50,fullscreen=no,scrollbars=no,toolbar=no,menubar=no,resizable=yes,status=no');
}

function openbook1(Nuri){
		window.open(Nuri,'NuriEBook_web','width=1024,height=768,top=20,left=50,fullscreen=no,scrollbars=no,toolbar=no,menubar=no,resizable=yes,status=no');
	}
function openbook2(Nuri){
		window.open(Nuri,'NuriEBook','width=976,height=726,top=20,left=50,fullscreen=no,scrollbars=no,toolbar=no,menubar=no,resizable=yes,status=no');
	}	

function downPDF(arg){
	   window.open(arg,'','width=976,height=726,top=20,left=50,fullscreen=no,scrollbars=no,toolbar=no,menubar=no,resizable=yes,status=no');
}

function reader_download_show(id,img,mode) {
	if(mode == "barobook") {
		if(id.style.display == 'none'){			
			id.style.display = '';
			img.src = "../img/cums_help/help_close.gif"
		} else {
			id.style.display = 'none';
			img.src = "../img/cums_help/help_open.gif"
		}
	}else if(mode == "wizbook") {
		if(id.style.display == 'none'){			
			id.style.display = '';
			img.src = "../img/cums_help/help_close.gif"
		} else {
			id.style.display = 'none';
			img.src = "../img/cums_help/help_open.gif"
		}
	}else if(mode == "kyobo") {
		if(id.style.display == 'none'){			
			id.style.display = '';
			img.src = "../img/cums_help/help_close.gif"
		} else {
			id.style.display = 'none';
			img.src = "../img/cums_help/help_open.gif"
		}
	}
}

function reader_help_show(id,img,mode) {
	if(mode == "barobook") {
		if(id.style.display == 'none'){			
			id.style.display = '';
			img.src = "../img/cums_help/help_close.gif"
		} else {
			id.style.display = 'none';
			img.src = "../img/cums_help/help_open.gif"
		}
	}else if(mode == "wizbook") {
		if(id.style.display == 'none'){			
			id.style.display = '';
			img.src = "../img/cums_help/help_close.gif"
		} else {
			id.style.display = 'none';
			img.src = "../img/cums_help/help_open.gif"
		}
	}else if(mode == "kyobo") {
		if(id.style.display == 'none'){			
			id.style.display = '';
			img.src = "../img/cums_help/help_close.gif"
		} else {
			id.style.display = 'none';
			img.src = "../img/cums_help/help_open.gif"
		}
	}
}

//·Ñ¿À¹ö ±â´É ½ÃÀÛ
function MenuOn(branch,len_num) {
	SubListLoading(branch)

	var tempX = 0;
	var tempY = 0;                    
	tempX = event.clientX + document.body.scrollLeft;
	tempY = event.clientY + document.body.scrollTop;
	if (tempX < 0){tempX = 0;}
	if (tempY < 0){tempY = 0;}  

		total_len = 29 + (len_num*10) + 20;
		submenu.style.top = tempY -5 ;
		submenu.style.left = total_len;
	MenuOn_1();
}
function MenuOn_1() {
	v = document.getElementById("submenu");
	v.style.display = "inline";
}
function MenuOut() {
	v = document.getElementById("submenu");
	v.style.display = "none";
}
//·Ñ¿À¹ö ±â´É ³¡

//¸®´õ
function UpdateReader(width,height,url,name) {
	window.open(url,name,'statusbar=no,scrollbars=yes,status=no,resizable=yes,width='+width+',height='+height)
}

//À¥ÄÁÅÙÃ÷
function WebContentView(width,height,url,login_check) {
	if(login_check == "N") {
		alert("·Î±×ÀÎ ÇÏ¼¼¿ä.");
	}else {
		window.open(url,'top','statusbar=no,scrollbars=yes,status=no,resizable=yes,width='+width+',height='+height)
	}
}

//Èñ¸Áµµ¼­
function hope_ebook_x(){
	window.open('../main/hope_ebook_list.asp','hope_ebook','width=715,height=850,top=0,scrollbars=yes');
}



function fb_first()
{
	roll.act_move_book_first();
}
function fb_prev()
{
	roll.act_move_book_left();
}
function fb_pause()
{
	roll.pause();
}
function fb_play()
{
	roll.resume();
}
function fb_next()
{
	roll.act_move_book_right();
}
function fb_last()
{
	roll.act_move_book_last();
}

	
function fb_first2()
{
	newbook_cursor = 0;
	DisplayItems_main2();
}
function fb_prev2()
{
	newbook_cursor -= items_per_line;
	if ( newbook_cursor < 0 ) newbook_cursor = 0;
	DisplayItems_main2();
}
function fb_pause2()
{
	newbook_cursor = 0;
	clearInterval( interval_id );
}
function fb_play2()
{
	newbook_cursor = 0;
	interval_id = setInterval( 'DisplayFreshbookItemsNext()', refresh_time );
}
function fb_next2()
{
	newbook_cursor += items_per_line;
	if ( newbook_cnt <= newbook_cursor )
		newbook_cursor = Math.floor((newbook_cnt-1) / items_per_line) * items_per_line;
	DisplayItems_main2();
}
function fb_last2()
{
	newbook_cursor = Math.floor((newbook_cnt-1) / items_per_line) * items_per_line;
	DisplayItems_main2();
}
