/** PTNovelSearch-v4.1.2 LPPL License By http://www.ptcms.com/ */
 ;var loading=null;$(".pt-ellipsis-white").click(function(){var t,a,e=$(this).parents(".pt-stick-item").data("is-star");e?(t="/template/kxmobileno1/images/rank_collect.png",a="取消星标"):(t="/template/kxmobileno1/images/stick.png",a="设为星标"),$(".pt-mask-mark .pt-star .pt-stick-icon").attr("src",t),$(".pt-mask-mark .pt-star span").text(a),$(".pt-mask-mark").show().data("novel-id",$(this).parents(".pt-stick-item").data("novel-id")).data("is-star",e),$(".pt-tabbar").hide()}),$(".pt-mask-mark-shade").click(function(){$(".pt-mask-mark").hide(),$(".pt-tabbar").show()}),$(".pt-star").click(function(){var t=$(this),a=t.parents(".pt-mask-mark").data("novel-id"),e=t.parents(".pt-mask-mark").data("is-star");$.ajax(e?__DEL_MARK_STAR:__ADD_MARK_STAR,{type:"post",dataType:"json",data:{novelid:a,action:e?"del":"add"},beforeSend:function(){null==loading&&(loading=layer.open({type:2}))},complete:function(){null!=loading&&(layer.close(loading),loading=null)},success:function(t){t.code?layer.open({content:t.msg,skin:"msg",time:2,end:function(){t.data.redirect&&(window.location.href=t.data.redirect)}}):(e?$(".pt-stick .pt-stick-item[data-novel-id="+a+"]").prependTo(".pt-read .pt-stick-cont").data("is-star",0):$(".pt-read .pt-stick-item[data-novel-id="+a+"]").prependTo(".pt-stick .pt-stick-cont").data("is-star",1),$(".pt-stick .pt-stick-item").length?$(".pt-stick").removeClass("none"):$(".pt-stick").addClass("none"),$(".pt-read .pt-stick-item").length?$(".pt-read").removeClass("none"):$(".pt-read").addClass("none"),$(".pt-mask-mark").hide(),$(".pt-tabbar").show(),layer.open({content:"操作成功！",skin:"msg",time:2}))},error:function(){layer.open({content:"操作失败，请刷新页面后重试！",skin:"msg",time:2})}})}),$(".pt-remove").click(function(){var t=$(this),a=t.parents(".pt-mask-mark").data("novel-id");$.ajax(__DEL_MARK,{type:"post",dataType:"json",data:{novelid:a},beforeSend:function(){null==loading&&(loading=layer.open({type:2}))},complete:function(){null!=loading&&(layer.close(loading),loading=null)},success:function(t){t.code?($(".pt-stick-item[data-novel-id="+a+"]").remove(),layer.open({content:t.msg,skin:"msg",time:2,end:function(){t.data.redirect&&(window.location.href=t.data.redirect)}})):($(".pt-stick .pt-stick-item[data-novel-id="+a+"]").remove(),$(".pt-mask-mark").hide(),$(".pt-tabbar").show(),layer.open({content:"操作成功！",skin:"msg",time:2}))},error:function(){layer.open({content:"操作失败，请刷新页面后重试！",skin:"msg",time:2})}})}),$(".pt-stick-item img").click(function(){$(this).data("url")&&(location.href=$(this).data("url"))}),$(".pt-ellipsis").on("click",function(){"read"===$(this).data("order")?$(".pt-tip .pt-order").html('<a href="'+__ORDER_ADD+'" class="block color1 text-center">添加时间</a>'):$(".pt-tip .pt-order").html('<a href="'+__ORDER_READ+'" class="block color1 text-center">最近阅读</a>')});