﻿String.prototype.Format = function(){//字符串格式
	var tmpStr = this;
	var iLen = arguments.length;
	for(var i=0;i<iLen;i+=1) tmpStr = tmpStr.replace(new RegExp("\\{" + i + "\\}", "g"), arguments[i]);
	return tmpStr;
};
if(!window.Snda) var Snda=window.Snda={};
(function(){
 var userAgent = navigator.userAgent.toLowerCase();
 Snda.browser = {
 version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
 safari: /webkit/.test( userAgent ),
 opera: /opera/.test( userAgent ),
 msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
 mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
 };
 Snda.Utility={//通用工具
 fadeIn:function( elem, to, speed ) {//淡进
 Snda.Utility.setOpacity( elem, 0 );
 Snda.Utility.show( elem );
 for ( var i = 0; i <= 100; i += 5 ) {
 (function(){
 		 var opacity = i;
 setTimeout(function(){
 Snda.Utility.setOpacity( elem, ( opacity / 100 ) * to );
 }, ( i + 1 ) * speed );
 })();
 };
 },
 fadeOut:function ( elem, speed, remove,callBack ) {//淡出
 for ( var i = 0; i < 100; i += 2 ) {
 (function(){
 		 var opacity = i;
 setTimeout(function(){
 Snda.Utility.setOpacity( elem, 100 - opacity );
				 if ( opacity == 98 ){
				 if(!remove) Snda.Utility.hide( elem );
				 else Snda.Utility.removeNode( elem );
				 callBack();
				 };
 }, ( i + 1 ) * speed );
 })();
 };
 },
 getStyle:function( elem, name ) {//获取样式值
 if (elem.style[name]) return elem.style[name];
 else if (elem.currentStyle) return elem.currentStyle[name];
 else if (document.defaultView && document.defaultView.getComputedStyle) {
 name = name.replace(/([A-Z])/g,"-$1");
 name = name.toLowerCase();
 var s = document.defaultView.getComputedStyle(elem,"");
 return s && s.getPropertyValue(name);
 }else return null;
 },
 hide:function( elem ) {//隐藏
 var curDisplay = Snda.Utility.getStyle( elem, "display" );
 if ( curDisplay != "none" ) elem.$oldDisplay = curDisplay;
 elem.style.display = "none";
 return Snda.Utility;
 },
 show:function(elem){//显示
 elem.style.display = elem.$oldDisplay || "block";
 return Snda.Utility;
 },
 removeNode:function(elem){//移除元素
 elem.parentNode && elem.parentNode.removeChild(elem);
 return Snda.Utility;
 },
 setOpacity:function( elem, level ) {//设置透明度
 if ( elem.filters ) elem.style.filter= "alpha(opacity="+level+")";
 else elem.style.opacity = level / 100;
 return Snda.Utility;
 },
 setX:function(elem, pos) {
 elem.style.left = pos + "px";
 return Snda.Utility;
 },
 setY:function(elem, pos){
 elem.style.top = pos + "px";
 return Snda.Utility;
 },
 StopDefault:function(e){//阻止浏览器默认行为
 if(e&&e.preventDefault) e.prefentDefault();
 else window.event.returnValue=false;
 return false;
 },
 cancelBubble:function(evt){//取消冒泡
 evt = evt|| window.event; 
 if (window.event) evt.cancelBubble=true; 
 else evt.stopPropagation(); 
 },
 Event:{//事件
 addEventHandler :function (oTarget, sEventType, fnHandler,bool){//事件绑定
 if(oTarget.addEventListener) oTarget.addEventListener(sEventType, fnHandler, bool); //FF方法
 else if (oTarget.attachEvent) oTarget.attachEvent("on" + sEventType, fnHandler); //IE方法
 else oTarget["on" + sEventType] = fnHandler; //其他未知浏览器
 },
 removeEventHandler:function(obj,EventType,Handler,bool){
 if(obj.removeEventListener) obj.removeEventListener(EventType,Handler,bool);
 else if(obj.detachEvent) obj.detachEvent('on'+EventType,Handler); 
 else obj['on'+EventType] = null;
 },
 getCurrentElem:function(evt){//获取事件元素
 evt = evt || window.event ; 
 return evt.srcElement || evt.target; 
 }
 },
 Postion:{
 scrollX:function(){//拖动条移动x轴距离
 var de=document.documentElement;
 return self.pageXOffset||(de&&de.scrollLeft)|| document.body.scrollLeft || 0;
 },
 scrollY:function(){//拖动条移动y轴距离
 var de=document.documentElement;
 return self.pageYOffset||(de&&de.scrollTop)|| document.body.scrollTop || 0;
 },
 windowWidth:function(){//屏幕宽
 var de = document.documentElement;
 return self.innerWidth ||( de && de.clientWidth ) || document.body.clientWidth;
 },
 windowHeight:function(){//屏幕高
 var de = document.documentElement;
 return self.innerHeight ||( de && de.clientHeight ) || document.body.clientHeight;
 },
 pageWidth:function() {//页面高
 return document.body.scrollHeight;
 },
 pageHeight:function() {//页面宽
 return document.body.scrollWidth;
 }
 }
 };
 Snda.Layer={
 zIndex:2009,
 Hash:{},
 Config:{
 bg:'<iframe id="pop_bg2_{0}" scrolling=0 frameborder=0 class="pop_BackGround" ></iframe>'+
 '<div id="pop_bg1_{0}" class="pop_BackGround" ></div>',
 con:'<div class="pop_Content" id="{3}{0}">'+
	 '<h1 id="{4}{0}"><span id="pop_title_{0}" class="pop_Title">{6}</span></h1><span id="{5}{0}" class="pop_close" title="关闭"></span>'+
	 '<div class="pop_Main"><iframe id="pop_frame_{0}" frameborder="0" scrolling="no" haslayout="-1" src="{1}"></iframe></div>'+
	 '<div class="pop_Footer" id="pop_footer_{0}">{2}</div></div>'
 },
 Show:function(config){//显示
 if(!config) throw {msg:'请输入参数'};
 var _json={
 title: config.title||'', //标题
 tid: config.title||'pop_title_', //标题id
 cid: config.cid||'pop_cont_', //主内容id
 hid: config.hid||'pop_head_', //拖动id
 clid: config.clid||'pop_close_', //关闭id
 src: config.src||'', //iframe地址
 fcon: config.fcon||'', //底部内容
 follow: !!config.follow||false, //跟随
 move: !!config.move||false , //移动
 sSpeed: config.sSpeed||5, //淡进
 cSpeed: config.cSpeed||0, //关闭速度
 callBack: config.callBack|| new function(){} //结束回调函数
 };
 var _temdId=Math.floor(Math.random()*10000000000);
 Snda.Layer.Hash[_temdId+'']=_json.cid+_temdId;
 var _div=document.createElement('div');
 _div.id='pop_container_'+_temdId;
 _div.style.display='none';
 _div.$sndaId=_temdId;
 _div.$cSpeed=_json.cSpeed;
 _div.$callBack=_json.callBack;
 if(_json.src.indexOf('?')>0) _json.src=_json.src+'&rand='+_temdId;
 else _json.src=_json.src+'?rand='+_temdId;
 _div.innerHTML=Snda.Layer.Config.bg.Format(_temdId)+Snda.Layer.Config.con.Format(_temdId,_json.src,_json.fcon,_json.cid,_json.hid,_json.clid,_json.title);
 document.body.appendChild(_div);
 var _close=document.getElementById(_json.clid+_temdId);
 if(_close){//绑定关闭
 Snda.Utility.Event.addEventHandler(_close,'click',Snda.Layer.Close,false);
 _close.$sndaId=_temdId;
 };
 Snda.Layer.BeMiddle(_temdId);//设置居中
 if(_json.follow) Snda.Layer.Follow();//设置跟随
 if(_json.move){//设置拖动
 var _m=document.getElementById(_json.cid+_temdId);
 var _h=document.getElementById(_json.hid+_temdId);
 Snda.Layer.Drag(_h,_m,0,0);
 };
 Snda.Utility.fadeIn(_div,100,_json.sSpeed);
 },
 Close:function(evt){//关闭
 var num;
 var _elem= Snda.Utility.Event.getCurrentElem(evt);
 if(!_elem.$sndaId) return false;
 else num=_elem.$sndaId;
 if(!Snda.Layer.Hash[num+'']) return false;
 var _o=document.getElementById('pop_container_'+num);
 var _con=document.getElementById(Snda.Layer.Hash[num+'']);
 var callBack=function(){
 Snda.Utility.removeNode(_o);
 _o.$callBack();
 };
 delete Snda.Layer.Hash[num+''];
 if(_o && _con) Snda.Utility.fadeOut(_con,_o.$cSpeed,true,callBack);
 Snda.Utility.cancelBubble(evt)
 },
 Follow:function(){//跟随
 var scollEvent=function(){
 var _winWidth = Snda.Utility.Postion.windowWidth();
 var _winHeight = Snda.Utility.Postion.windowHeight();
 for(var o in Snda.Layer.Hash){ 
 if(!o) continue;
 var _div=document.getElementById(Snda.Layer.Hash[o+'']);
 (function(w,h,sX,sY){
 _div && Snda.Utility.setX(_div,sX + (_winWidth-w)/2).setY(_div,sY +(_winHeight-h)/2);
 })(Snda.Utility.getStyle( _div , 'width').replace('px','')>>0, 
 Snda.Utility.getStyle( _div , 'height').replace('px','')>>0,
 Snda.Utility.Postion.scrollX(),
 Snda.Utility.Postion.scrollY());
 };
 };
 Snda.Utility.Event.addEventHandler(window,'scroll',scollEvent,false);
 Snda.Utility.Event.addEventHandler(window,'resize',scollEvent,false);
 Snda.Utility.Event.addEventHandler(window,'load',scollEvent,false);
 },
 BeMiddle:function(id){//居中
 var _div=document.getElementById(Snda.Layer.Hash[id+'']);
 var _width = Snda.Utility.getStyle( _div , 'width' );
 var _height = Snda.Utility.getStyle( _div , 'height');
 _div.style.left =( Snda.Utility.Postion.windowWidth()/2 - (_width.replace('px','')>>0)/2 + Snda.Utility.Postion.scrollX()) + 'px';
 _div.style.top =( Snda.Utility.Postion.windowHeight()/2 - (_height.replace('px','')>>0)/2 + Snda.Utility.Postion.scrollY()) + 'px';
 Snda.Layer.zIndex+=1;
 _div.style.zIndex= Snda.Layer.zIndex;
 },
 Drag:function(o,root,minX,minY,opacity){//移动
 !o.$Root&&(o.$Root=root||o);
 opacity = opacity||0.3;
 var x,y,_cloneItem = ['height','width','left','top'];
 var DragEvent={
 mousedown:function(evt){//拖动开始
 evt = evt || window.event;
 x = evt.layerX || evt.offsetX;
 y = evt.layerY || evt.offsetY;
 document.body.appendChild(_clone);
 Snda.Utility.Event.addEventHandler(document,'mousemove',DragEvent.move,false);
 Snda.Utility.Event.addEventHandler(document,'mouseup',DragEvent.end,false);
 Snda.Utility.hide(root);
 return false;
 },
 clone:function(e,opacity){//克隆对象样式
 var _div = document.createElement('div');
 _div.$handle = o;
 _div.$root = root;
 _div.className = 'clone';
 _div.style.filter = 'alpha(opacity='+(opacity * 100)+')';
 _div.style.opacity = opacity;
 for(var i=0;i<_cloneItem.length;i+=1) _div.style[_cloneItem[i]]=Snda.Utility.getStyle(e,_cloneItem[i]);
 return _div;
 },
 end:function(evt){//结束拖动
 evt = evt || window.event;
 _clone.$temp && Snda.Utility.setX(_clone.$root,_clone.$temp.left).setY(_clone.$root,_clone.$temp.top);
 Snda.Utility.Event.removeEventHandler(document,'mousemove',DragEvent.move,false);
 Snda.Utility.removeNode(_clone).show(root);
 },
 compare:function(){//比较
 if(_clone.$minX != null) _clone.$temp.left = Math.max(_clone.$temp.left , _clone.$minX) + Snda.Utility.Postion.scrollX();
 if(_clone.$minY != null) _clone.$temp.top = Math.max(_clone.$temp.top , _clone.$minY) + Snda.Utility.Postion.scrollY(); 
 },
 move:function(evt){//移动
 evt = evt|| window.event;
 (function(left,top){
 _clone.$temp = {left:left,top:top};
 DragEvent.compare();
 Snda.Utility.setX(_clone,_clone.$temp.left).setY(_clone,_clone.$temp.top);
 })(evt.clientX- x ,evt.clientY- y )
 },
 zIndex:function(){//多窗体样式
 }
 };
 var _clone = DragEvent.clone(o.$Root,opacity);//克隆
 _clone.$minX	= typeof minX != 'undefined' ? minX : null;
 _clone.$minY	= typeof minY != 'undefined' ? minY : null;
 Snda.Utility.Event.addEventHandler(o,'mousedown',DragEvent.mousedown,false);
 }
 };
 Snda.QiDian={
 Tools:{
 Layer:{
 GoTo:function(name){
 var _name=_title='';
 switch(name.toLowerCase()){
 case 'reg': _name='/Pop/Login/RegDomain.aspx',_title='注册'; break;
 case 'login': _name='/Pop/Login/LoginDomain.aspx',_title='登录'; break;
 default: return false;
 };
 for(var i in Snda.Layer.Hash){
 document.getElementById('pop_frame_'+i).src=_name+'?rand='+i;
 document.getElementById('pop_title_'+i).innerHTML=_title;
 };
 },
 Close:function(){
 location.href=location.href;
 }
 }
 }
 };
})();
function ShowLoginDiv(callBack){
 Snda.Layer.Show({
 title:'登录',
 src:'/Pop/Login/LoginDomain.aspx',
 follow:true,move:true,cSpeed:5,
 callBack:callBack
 });
};
function eventBind(elem, eventName, handler,bool){//事件绑定
 if(elem.addEventListener) elem.addEventListener(eventName, handler, bool); //FF方法
 else if (elem.attachEvent) elem.attachEvent("on" + eventName, handler); //IE方法
 else elem["on" + eventName] = handler; //其他未知浏览器
};
function Snda_Tools_scrollY(){//拖动条移动y轴距离
 var de=document.documentElement;
 return self.pageYOffset||
 (de&&de.scrollTop)||
 document.body.scrollTop;
};
function Snda_Tools_scrollX(){//拖动条移动x轴距离
 var de=document.documentElement;
 return self.pageXOffset||
 (de&&de.scrollLeft)||
 document.body.scrollLeft;
};
function ChangeTabColor(td1, div1, td2, div2){
 $(td1).bgColor = '#F7F7F7';
 $(td2).bgColor = '#BDCAD1';
 $(div1).style.display = '';
 $(div2).style.display = 'none';
};
function CheckHasNewChapter(bookId, type, isvip){
 var callBack=function(){
 var result = arguments[0];
 if (result.value.indexOf('该书无对应更新') > -1){
 }else{
 if (type == "publicLastUpdate") $("publicLastUpdate").innerHTML = result.value;
 if (type == "VIPLastUpdate") $("VIPLastUpdate").innerHTML = result.value;
 };
 };
 try{
 MyAjax.CheckHasNewChapterInTenMin(bookId,type, isvip,callBack);
 }catch (e) {
 alert(e.message);
 };
 };
 function ChangeBookTab(span1, div1, span2, div2, bookId, isvip){ //切换两个Tab
 $(div1).style.display = '';
 $(div2).style.display = 'none';
 $(span1).className = 'SelSPAN';
 $(span2).className = 'NoSelSPAN';
 CheckHasNewChapter(bookId, div1, isvip);
 };
 function ChangeTwoTab(span1, div1, span2, div2){//切换两个Tab
 $(div1).style.display = '';
 $(div2).style.display = 'none';
 $(span1).className = 'SelSPAN';
 $(span2).className = 'NoSelSPAN';
 }; 
 function ChangeThreeTab(td1, div1, td2, div2, td3, div3){//切换三个Tab
 $(td1).style.background = 'url(/images/Global/bg_tag_02_on.gif)';
 $(td1).className = 'on';
 $(div1).style.display = '';
 $(td2).style.background = 'url(/images/Global/bg_tag_02.gif)';
 $(td2).className = 'off';
 $(div2).style.display = 'none';
 $(td3).style.background = 'url(/images/Global/bg_tag_02.gif)';
 $(td3).className = 'off';
 $(div3).style.display = 'none';
 };
 function ChangeTab(div1, div2, div3){ //切换Tab for 榜单
 $(div1).style.display = '';
 $(div2).style.display = 'none';
 $(div3).style.display = 'none';
 };
 function CopyInBoard(share_input){
 $(share_input).select();
 window.clipboardData.setData('text', $(share_input).value)
 alert('网址复制完成，您可以通过QQ、MSN、邮件等方式发送给您的好友，共同分享阅读的快乐！');
 };
 function AddBookCase(bookId){//加入书架
 if (!checkLoginByCookie()){
 ShowLoginDiv();
 return false;
 };
 MyAjax.AddBookCase(bookId, ShowServerMessage);
};
function CommendBook(bookId){//推荐本书
 if (!checkLoginByCookie()){
 ShowLoginDiv();
 return false;
 };
 MyAjax.RecomBook(bookId, ShowServerMessage);
};
function AddUpdateAwake(bookId){//添加手机提醒
 if (confirm('亲爱的起点用户，感谢您使用更新提醒服务！\r当小说有新章节更新时，我们将通过短信提醒您！\r\r每提醒一条短信将从您的起点帐号中扣除10起点币。\r您确认使用更新提醒服务吗？'))
 {
 if (!checkLoginByCookie()){
 ShowLoginDiv();
 return false;
 };
 MyAjax.AddUpdateAwake(bookId, ShowServerMessage);
 return false;
 };
};
function VoteMonthTicket(bookId, type){//投月票
 var callBackClose=function(){//关闭回调事件
 $("votemonthticket_" + type).href = "javascript:void(0)";
 $("votemonthticket_" + type).onclick = function(){
 VoteMonthTicket(bookId, type);
 return false;
 };
 if (type == 1) $("votemonthticket_" + type).innerHTML = "投月票";
	 else $("votemonthticket_" + type).innerHTML = "VIP作品月度评选投票";
 };
 
 if (!checkLoginByCookie()){
 alert("请登录后再投票");
 callBackClose();
 //ShowLoginDiv();
 return false;
 };
 if (typeof IsMonthBook != 'undefined' && IsMonthBook == true){
 var callBack=function(){//ajax回调事件
 var result = arguments[0];
	 if (result.value.indexOf('登录') > -1) ShowLoginDiv();
	 else{
	 var value = result.value.replace("\n", "");
	 try{ eval(value); }catch(e){};
	 callBackClose();
	 };
 };
 $("votemonthticket_" + type).onclick = null;
 $("votemonthticket_" + type).removeAttribute("href");
 $("votemonthticket_" + type).innerHTML = "<img src='/Images/indicator_medium.gif' width='10' height='10' border='0'/>";
 MyAjax.MMMonthlyVote(bookId, showAjaxMessage);
 callBackClose();
 return false;
 };
 Snda.Layer.Show({title:'我要投月票',src:'/BookReader/DivMonthVoteTipping.aspx?bookId=' + bookId,follow:true,move:true,callBack:callBackClose});
 //MyAjax.MonthVote(bookId,callBack);
 callBackClose();
 return false;
};
var surveyId;
var nextyear = new Date();
function SubmitSurvey(bookId, type, orderTable){//提交调查
 var arg = result = '';
 nextyear.setMinutes(nextyear.getMinutes() + 30, 0, 0, 0);
 var ret = GetCookie('sur');
 if (type == 'E') {
 result = GetEditorSurveySelectedResult();
 if (result == ''){
 alert('你还没有选择调查或选项不完整！');
 return;
 };
 surveyId = '-1';
 if (CheckIsSubmitSurvey(ret, bookId)){
 alert('距离上一次投票不足30分钟,不能重新投票');
 return;
 };
 arg = type + "$" + result;
 MyAjax.SubmitSurvey(bookId, arg, SurveyMessage);
 }else{
 result = GetAuthorSurveySelectedResult(orderTable);
 if (result == ''){
 alert('你还没有选择调查！');
 return;
 };
 var i = result.indexOf(',');
 surveyId = result.substring(0, i);
 ret = GetCookie('sur');
 if (CheckIsSubmitSurvey(ret, surveyId)){
 alert('距离上一次投票不足30分钟,不能重新投票');
 return;
 };
 arg = type + "$" + result;
 MyAjax.SubmitSurvey(bookId, arg, SurveyMessage);
 };
};
function scrollTips(){
 var client = document.documentElement.clientHeight > 0 ? document.documentElement : document.body;
 var width = client.clientWidth;
 var height = client.clientHeight;
 if (document.all){
 var scrollY = document.body.scrollTop || document.documentElement.scrollTop;
 var scrollX = document.body.scrollLeft || document.documentElement.scrollLeft;
 $("DivTipping").style.left = (width + scrollX - $("DivTipping").offsetWidth - 300) + "px";
 $("DivTipping").style.top = (height + scrollY - $("DivTipping").offsetHeight - 100) + "px";
 }else{
 $("DivTipping").style.left = (width - $("DivTipping").offsetWidth - 300) + "px";
 $("DivTipping").style.top = (height - $("DivTipping").offsetHeight - 100) + "px";
 };
};
function CheckIsSubmitSurvey(sur, surveyId){//判断是否参加过调查
 if (sur == null) return false;
 else{
 if (sur.indexOf(surveyId) > -1) return true;
 else return false;
 };
};
function GetAuthorSurveySelectedResult(orderTable){
 var i;
 var table = $(orderTable);
 var rowLen = table.rows.length;
 var result = '';
 var surveyItemValue = '';
 var checkedValue = '';
 var hasChecked = 0;
 for ( i = 0; i < rowLen; i++){
 var cellLen = table.rows[i].cells.length;
 for (var j = 0; j < cellLen; j++){
 var cell = table.rows[i].cells[j];
 var inputLen = cell.getElementsByTagName('input').length;
 if (inputLen > 0){
 for (var k = 0; k < inputLen; k++){
 var input = cell.getElementsByTagName('input')[k];
 surveyItemValue = input.value;
 if (input.checked){
 checkedValue = checkedValue + '1';
 hasChecked = 1;
 }else{
 checkedValue = checkedValue + '0';
 };
 };
 };
 };
 };
 result = surveyItemValue + ',' + checkedValue;
 if (hasChecked == 0) return '';
 else return result;
};
function showAjaxMessage(res){
 if (res && res.value) alert(res.value);
};
function ShowServerMessage(result){//显示服务器返回的信息
 if (result.value.indexOf('登录') > -1){
 ShowLoginDiv();
 }else{
 var value = result.value.replace("\n", "");
 try {eval(value); }catch(e){};
 };
};
function SurveyMessage(result){
 if (result.value.indexOf('登录') > -1) ShowLoginDiv();
 else{
 var value = result.value.replace("\n", "");
 try {eval(value); }catch(e){};
 if (result.value.indexOf('失败') == -1){
 var ret = GetCookie('sur');
 if (ret == null) SetCookie('sur', surveyId, nextyear);
 else SetCookie('sur', ret + ',' + surveyId, nextyear);
 };
 };
};
function iframeFitHeight(iframeId){
 var frm = $(iframeId);
 if (frm == null) return;
 try{
 var oWin = frm.name ? window.frames[frm.name] : frm.contentWindow;
 frm.style.height = oWin.document.body.scrollHeight + "px";
 }catch (e) { }
};
function closeAd(){
 $('fullAD').style.display = $('closeDiv').style.display = 'none';
}
function startmarquee(lh, speed, delay){
 var t;
 var oHeight = 97; /** div的高度 **/
 var p = false;
 var o = $("show");
 var preTop = 0;
 o.scrollTop = 0;
 function start(){
 t = setInterval(scrolling, speed);
 o.scrollTop += 1;
 };
 function scrolling(){
 if (o.scrollTop % lh != 0 && o.scrollTop % (o.scrollHeight - oHeight - 1) != 0){
 preTop = o.scrollTop;
 o.scrollTop += 1;
 if (preTop >= o.scrollHeight || preTop >= o.scrollTop){
 o.scrollTop = 0;
 }
 }else{
 clearInterval(t);
 setTimeout(start, delay);
 }
 };
 setTimeout(start, delay);
};
function ShowRequisiton() {//展现副版主申请层
 if (!IsLogin) alert("你还没有登录，请登录！");
 else MyAjax.CheckForumRequisition(bookId, ShowRequisitionTip);
};
function ShowRequisitionTip(result){
 var value = result.value;
 if (value == "") {
 var builder = new StringBuilder();
 builder.append("<table border='0' cellpadding='0' cellspacing='0'>");
 builder.append("<tr class='TitleTR'>");
 builder.append("<td align='left'>");
 builder.append("</td>");
 builder.append("<td align='right'>");
 builder.append("<span title='关闭' onclick='HideShowRequisitionTipMask();'>×</span>");
 builder.append("</td>");
 builder.append("</tr>");
 builder.append("<tr>");
 builder.append("<td colspan='2'>");
 builder.append("<iframe src='Tips/AdminRequisition.aspx?forumid="+bookId+"' width='380' height='318' name='RequisitionFrame' ");
 builder.append("id='RequisitionFrame' frameborder='0' scrolling='no'></iframe>");
 builder.append("</td>");
 builder.append("</tr>");
 builder.append("</table>");
 $("DivMasks").style.height = document.body.scrollHeight;
 $("DivMasks").style.width = document.body.scrollWidth;
 $("DivMasks").style.display = 'block';
 $("divRequisition").style.display = "block";
 $("divRequisition").innerHTML = builder.toString();
 
 ScrollDiv();
 eventBind(window, 'scroll', ScrollDiv, false);
 eventBind(window, 'resize', ScrollDiv, false);
 eventBind(window, 'load', ScrollDiv, false);
 
 }else {
 if (value.indexOf('个人实名信息审核') > -1) {
 value = value.replace(/换行/g, "\\r");
 try {eval(value); } catch(e){};
 }else alert(value);
 };
};
function HideShowRequisitionTipMask() {
 document.getElementById("DivMasks").style.display = "none";
 document.getElementById("divRequisition").style.display = "none";
};
function HideSHowMessage(value) {
 document.getElementById("DivMasks").style.display = "none";
 document.getElementById("divRequisition").style.display = "none";
 alert(value);
};
function ShowTippingDiv(){ 
 Snda.Layer.Show({title:'我要打赏',src:'/BookReader/DivAuthorTippingNew.aspx?bookId=' + bookId + "&authorId=" + authorId + "&authorName=" + authorName,follow:true,move:true,callBack:function(){}});
 return false;
 var _b=document.getElementById('DivMasks');
 var _div=document.getElementById('DivNewMask');
 var close=function(evt){
 setStyle('none');
 evt = evt ||window.event; 
 var elem = evt.srcElement || evt.target; 
 elem.blur();
 return false;
 };
 var setStyle=function(s){
 _b.style.display=_div.style.display=s||'';
 };
 setStyle('');
 var _o=document.getElementById('DivNewClose');
 var _frame=document.getElementById('pop_content');
 _frame.src='/BookReader/DivAuthorTippingNew.aspx?bookId=' + bookId + "&authorId=" + authorId + "&authorName=" + authorName;
 eventBind(_o, 'click', close);
 return false;
};
ShowTippingDiv.close=function(evt){
 var _b=document.getElementById('DivMasks');
 var _div=document.getElementById('DivNewMask');
 _b.style.display=_div.style.display='none';
 return false;
};

function Init2(){
 var ret = GetCookie('apr');
 if (ret != null && ret.length > 0){
 var bookIds = ret.split(',');
 var hasBook = false;
 for (var i = 0; i < bookIds.length; i++) {
 if (bookIds[i] == bookId){
 hasBook = true;
 break;
 };
 };
 if (hasBook){
 $('divSubmitAppraise').style.display = 'none';
 $('divAppraiseOk').style.display = "";
 };
 };
};
function ClickBook(){
 var readedBook = GetCookie("bc");
 if (readedBook == null || readedBook == "") MyAjax.AddBookClick(bookId, AddClickBack);
 else{
 var bookArray = readedBook.split(',');
 var isAddedClick = false;
 if (bookArray.length > 0){
 for (var i = 0; i < bookArray.length; i++){
 if (bookArray[i] == bookId){
 isAddedClick = true;
 break;
 };
 };
 if (isAddedClick == false) MyAjax.AddBookClick(bookId, AddClickBack);
 };
 };
};
function AddClickBack(res){
 return;
};
function CheckCaihongJingling() {
 $("spanCaihongjingling").innerHTML ="<div class='bookBorder'><img src='/images/icon1.jpg' width='208' height='100' border='0' onclick='ShowCaiHongJingLing();' style='cursor:pointer'></div></div>";
};
function DoScrollDiv() {
 isscrolling = true;
 if (tnScrollTop != toScrollTop || tnScrollLeft != toScrollLeft) {
 if (eAddMark != null) {
 eAddMark.style.top = (tnScrollTop + document.documentElement.clientHeight - 130) + "px";
 eAddMark.style.left = (tnScrollLeft + document.documentElement.clientWidth - 130) + "px";
 };
 if (eDivLogin) {
 eDivLogin.style.top = (tnScrollTop + (document.documentElement.clientHeight - eDivLogin.clientHeight) / 2) + "px";
 eDivLogin.style.left = (tnScrollLeft + (document.documentElement.clientWidth - eDivLogin.clientWidth) / 2) + "px";
 };
 if (eDivRequisition) {
 eDivRequisition.style.top = (tnScrollTop + (document.documentElement.clientHeight - eDivRequisition.clientHeight) / 2) + "px";
 eDivRequisition.style.left = (tnScrollLeft + (document.documentElement.clientWidth - eDivRequisition.clientWidth) / 2) + "px";
 };
 eDivMask.style.height = document.body.clientHeight + "px";
 toScrollTop = tnScrollTop;
 toScrollLeft = tnScrollLeft;
 };
 isscrolling = false;
};
function ScrollDiv() {
 tnScrollTop = document.documentElement.scrollTop + document.body.scrollTop;
 tnScrollLeft = document.documentElement.scrollLeft + document.body.scrollLeft;
 if (isscrolling) setTimeout('ScrollDiv()', 1000);
 else setTimeout('DoScrollDiv()', 400);
};
function Is4HourInterval(adId) {//广告显示时间间隔是否超过4小时
 if (GetCookie(adId) == null) {
 SetCookie(adId, '1', (new Date()).AddDays(4 / 24));
 return true;
 }else return false;
};