function checkpage(id,me){
	$(".listbox").each(function(){
		this.style.display='none';
	});
	$(".liston").each(function(){
		this.className='click';
	});
	$("#"+id).show();
	$("#"+me)[0].className='click';
}

function acheckpage(id,me){
	$(".listbox1").each(function(){
		this.style.display='none';
	});
	$(".liston").each(function(){
		this.className='click';
	});
	$("#"+id).show();
	$("#"+me)[0].className='click';
}

function AddFavorite(book_id){
	if(book_id){
		$.ajax({
		type: 	"GET",
 		url: 	"/admin/return.php",
 		data:   "action=addfav&bookid="+book_id,
 		success: function(msg){
 			if(msg=='exist'){
 				alert('This book is in the favorite');
 			}
 			if(msg==1){
 				alert('Add the favorite Ok!!');
 			}
 		 } 		
	});
	}
}
function goshare(){
	$.ajax({
		type: "GET",
		url: "/email.php",
		data: "userName="+$("#userName").val()+"&userEmail="+$("#userEmail").val()+"&userBook="+$("#userBook").val()+"&userHttp="+$("#selfurl").val()+"&selfbookname="+$("#selfbookname").val(),
		success: function(msg){
			if(msg==1){
				$("#newDiv").html("<div style=\"color:red;margin-top:60px;\"><center>Send email OK,Please close it! &nbsp;&nbsp;&nbsp;&nbsp;</center></div> <br><br><center><input type=button onclick=\"$('#newDiv')[0].style.display='none';\" value=OK ><center><br>");
			}
			else{
				$("#sussBack").html("<font color=red>The email  error,please try another&nbsp;&nbsp;&nbsp;&nbsp;</font><br>");
			}
		}
	});
}

var str ="<strong>Share Book</strong> <BR>Friend's email:<INPUT class=\"input_class\" onfocus=\"this.className='input_class_on'\" onblur=\"this.className='input_class'\" id=userEmail maxLength=50 size=25 name=userEmail style='width:300px;'>*<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Message: <select class=\"select_class\" onfocus=\"this.className='select_class_on'\" onblur=\"this.className='select_class'\" id=userBook name=userBook style='width:300px;'><option value=\"Excellent! This comic are extremely splendid, and I strongly recommend to you. You must have a look. I am sure that you will love it, as its drawing skill is exquisite and the senario would grasp your mind!! Can't miss it but worth it!!!\" >Excellent! This comic are extremely splendid... </option> <option value=\"A Good Comic. It is very good; both the scenario and drawing skills. I would like to recommend it to you, do please read it. I am sure you will love it same as me.\">A Good Comic! It is very good... </option> <option value=\"Not Bad. This comic is good to share, the drawing skill is just acceptable but the scenario is interesting. If you have time, just read it for fun!!\">Not Bad! This comic is good to share...</option></select><BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;URL:&nbsp;<INPUT class=\"input_class\" onfocus=\"this.className='input_class_on'\" onblur=\"this.className='input_class'\" size=30 id=userHttp maxLength=50 name=userHttp style='width:300px;'> <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;My name: <INPUT class=\"input_class\" onfocus=\"this.className='input_class_on'\" onblur=\"this.className='input_class'\" id=userName maxLength=25 name=userName style='width:300px;'>* <br><center><input type=button onclick=\"goshare()\" class=\"bottom_class\" onmouseover=\"this.className='bottom_class_on'\" onmouseout=\"this.className='bottom_class'\" name=submit value=Submit></center>"; 

var docEle = function() {
return document.getElementById(arguments[0]) || false;
}
function openNewDiv(_id) {
var m = "mask";
//if (docEle(_id)) document.removeChild(docEle(_id));
// 新激活图层
var newDiv = document.createElement("div");
newDiv.id = _id;
newDiv.style.position = "absolute";
newDiv.style.zIndex = "9999";
newDiv.style.width = "400px";
newDiv.style.height = "180px";
newDiv.style.color = "#000";
newDiv.style.top ="540px";
newDiv.style.left ="460px"; 
newDiv.style.background = "#f5f5f5";
newDiv.style.border = "5px solid #434343";
newDiv.style.padding = "5px";
newDiv.innerHTML = str;
document.body.appendChild(newDiv);
var newf = document.createElement("span");
newf.id = "sussBack";
newDiv.appendChild(newf);
$("#userHttp").val($("#selfurl").val());
// 关闭和新图层
var newA = document.createElement("a");
newA.href = "#";
newA.innerHTML = "close";
newA.onclick = function() {
  document.body.removeChild(docEle(_id));
  return false;
}
newDiv.appendChild(newA);
}
