﻿/*
 * Copyright (c) 2009 iPow(www.ipow.cn)
 */
var userAgent=navigator.userAgent.toLowerCase(),is_opera=userAgent.indexOf("opera")!=-1&&opera.version(),is_moz=(navigator.product=="Gecko")&&userAgent.substr(userAgent.indexOf("firefox")+8,3),is_ie=(userAgent.indexOf("msie")!=-1&&!is_opera)&&userAgent.substr(userAgent.indexOf("msie")+5,3),isOrder=0;jQuery.fn.showWin=function(A){A=jQuery.extend({width:650,height:400,url:"",type:"url",objID:"",kind:"article"},A);return this.each(function(){$local=$(this);var H=A.objID,E=[],F=function(J){E=B(J);var G=parseInt(E.scrTop),C=0;if(!$("#"+H).is(":hidden")){var I=parseInt((E.offWidth-A.width)/2),F=parseInt((E.offHeight-A.height)/2)+parseInt(E.scrTop);$("#msgWin").animate({width:A.width,height:A.height,left:I,top:F},500,function(){D(J)})}else{$("#"+H).css({"left":E.offLeft,"top":E.offTop});if(E.offWidth>A.width)C=parseInt((E.offWidth-A.width)/2);if(E.offHeight>A.height)G=G+parseInt((E.offHeight-A.height)/2);$("#"+H).animate({opacity:"show",width:A.width,height:A.height,top:G,left:C},500);D(J)}},D=function(B){switch(A.type){case"url":G();break;case"ajax":var C=B.title;J(C);break;case"frame":C=B.title;I(C);break;case"msg":_msgdata();break;default:break}},G=function(){$("#"+H).load(A.url+"?tmp="+Math.random(),function(){$("#msgTitle").find("a.close").click(function(){C()})})},J=function(B){var D="<div id=\"msgTitle\">";if(A.kind!="msg"){D+="<h2>\u6807\u9898\uff1a"+B+"</h2>";$("#"+H).css("background-color","rgb(217, 234, 242)")}else{D+="<h2 style=\"width:150px;\">\u6e38\u5ba2\uff1a"+B+"</h2>";$("#"+H).css("background-color","#8192C4")}D+="<a href=\"javascript:;\" id=\"closeWin\" class=\"close\" title=\"\u5173\u95ed\"></a>\t\t\t</div>\t\t\t<div id=\"msgContainer\" style=\"display:none;height:"+parseInt(A.height-35)+"px\"></div>";$("#"+H).html(D);jQuery.ajax({type:"GET",url:A.url+"&tmp="+Math.random(),dataType:"json",success:function(D){if(D.Type=="OK"){switch(A.kind){case"article":$("#msgContainer").html(D.ArticleEntity.Content);break;case"msg":var B="<p class=\"guest\">\u7559\u8a00\uff1a"+D.BookEntity.Content+"</p>";B+="<p class=\"msgreplay\"><b>\u56de\u590d\uff1a</b>"+D.ReEntity.Content+"</p>";$("#msgContainer").html(B);break;case"pic":var C="<img src=\""+D.PicEntity.PicPath+D.PicEntity.PicName+"\" onload=\"if(this.width>700)this.style.width=700;\">";C+="<p>"+D.PicEntity.Remark+"</p>";$("#msgContainer").html(C);break;default:break}$("#msgContainer").fadeIn("slow")}}});$("#msgTitle").find("a.close").click(function(){C()})},I=function(D){var E="<div id=\"msgTitle\">\t\t\t<h2>\u6807\u9898\uff1a"+D+"</h2>\t\t\t<a href=\"javascript:;\" id=\"closeWin\" class=\"close\" title=\"\u5173\u95ed\"></a>\t\t\t</div>\t\t\t<div id=\"msgContainer\" style=\"height:"+parseInt(A.height-35)+"px\"></div>";$("#"+H).html(E);var B="<iframe width=\"100%\" frameborder=\"0\" scrolling=\"no\" height=\"100%\" src=\""+A.url+"?tmp="+Math.random()+"\"></iframe>";$("#msgContainer").append(B);$("#msgTitle").find("a.close").click(function(){C()})},C=function(){var B=0;if(E.offWidth>A.width)B=parseInt((E.offWidth-A.width)/2);var C=parseInt(E.offTop);$("#"+H).animate({opacity:"hide",width:0,height:0,left:E.offLeft,top:C},500,function(){$local.one("click",function(){F(this)})});$("#"+H).html("")},B=function(C){var A=[],D=$(C).offset();A.offLeft=D.left;A.offTop=D.top;A.offWidth=document.documentElement.clientWidth;A.offHeight=document.documentElement.clientHeight;var B;if(typeof window.pageYOffset!="undefined")B=window.pageYOffset;else if(typeof document.compatMode!="undefined"&&document.compatMode!="BackCompat")B=document.documentElement.scrollTop;else if(typeof document.body!="undefined")B=document.body.scrollTop;A.scrTop=B;return A};$local.one("click",function(){F(this)})})};jQuery.fn.pagination=function(A){A=jQuery.extend({itemsPerPage:2,animationSpeed:"normal",className:"div",prev:"Prev",next:"Next"},A);return this.each(function(){var G=1,B=0,C=false,H=$(this),I=function(B){G--;if(C||$(B).hasClass("disabled"))return;C=true;H.find(""+A.className+":gt("+(G*A.itemsPerPage-A.itemsPerPage-1)+")").each(function(A){jQuery(this).fadeIn("slow");C=false});F()},E=function(B){if(C||$(B).hasClass("disabled"))return;C=true;H.find(""+A.className+":lt("+(G*A.itemsPerPage)+")").each(function(A){jQuery(this).fadeOut("slow");C=false});G++;F()},D=function(){jQuery("#"+A.prev).bind("click",function(){I(this);return false});jQuery("#"+A.next).bind("click",function(){E(this);return false})},F=function(){if(B==1){jQuery("#"+A.pref).hide();jQuery("#"+A.next).hide()}else if(G==1){jQuery("#"+A.prev).hide();jQuery("#"+A.next).show()}else if(G==B){jQuery("#"+A.prev).show();jQuery("#"+A.next).hide()}else if(G<B){jQuery("#"+A.prev).show();jQuery("#"+A.next).show()}};if(jQuery(this).find(""+A.className+"").size()>=A.itemsPerPage){B=Math.ceil(jQuery(this).find(""+A.className+"").size()/A.itemsPerPage);D();F(this);G=1}})};function _statPrice(){var D=$.trim($("#txtAdult").val().replace("-","")),B=$.trim($("#txtHalf").val().replace("-","")),E=true,C=0;if(isInt(D)&&isInt(B)){var A=$.trim($("#txtComeTime").val());C=parseInt(D*117)+parseInt(B*65);$("#TicketPrices").text(C)}}function _statAllPrice(){var C=$.trim($("#txtFamily").val()),D=$.trim($("#txtOneself").val()),A=$.trim($("#txtHalf").val());if(isInt(C)&&isInt(D)&&isInt(A)){var B=parseInt(C*658)+parseInt(D*280)+parseInt(A*138);$("#TicketPrices").text(B)}}function checkInt(A){if(!isInt(A)){alert("\u7968\u7684\u5f20\u6570\u9519\u8bef\uff0c\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u5f20\u6570\uff01");return false}return true}function isInt(B){var A=/^-?\d+$/;if(B.search(A)!=0)return false;return true}function onlyDate(){var A=window.event.srcElement;if(event.keyCode<48||event.keyCode>57)return false;if(A.value.length>4&&A.value.indexOf("-")<1)A.value="";if(A.value.length==4||A.value.length==7)A.value=A.value+"-";if(A.value.length==10&&A.maxLength!=10)A.value=A.value+" ";if(A.value.length==13)A.value=A.value+":"}function goVipPay(C,K){var J=$.trim($("#txtFamily").val()),M=$.trim($("#txtOneself").val()),D=$.trim($("#txtHalf").val()),A=$.trim($("#txtUserName").val()),F=$.trim($("#txtCardNo").val()),B=$.trim($("#txtEmail").val()),G=$.trim($("#txtMobile").val()),I=$.trim($("#TicketPrices").text()),L=parseInt(J)+parseInt(M)+parseInt(D);if(!checkInt(J)){alert("\u5bb6\u5ead\u5361\u5f20\u6570\u9519\u8bef\uff0c\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u5f20\u6570\uff01");$("#txtFamily").focus();return false}if(!checkInt(M)){alert("\u4e2a\u4eba\u5361\u5f20\u6570\u9519\u8bef\uff0c\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u5f20\u6570\uff01");$("#txtOneself").select();return false}if(!checkInt(D)){alert("\u4e2a\u4eba\u5361\u5f20\u6570\u9519\u8bef\uff0c\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u5f20\u6570\uff01");$("#txtHalf").select();return false}if(parseInt(L)==0){alert("\u8bf7\u8f93\u5165\u60a8\u9700\u8981\u8d2d\u4e70\u7684\u5e74\u5361\u5f20\u6570\uff01");$("#adultTicket").select();return false}if(A==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u59d3\u540d\uff01");$("#txtUserName").select();return false}else if(A.length<2){alert("\u59d3\u540d\u81f3\u5c112\u4e2a\u5b57,\u6700\u591a10\u4e2a\u5b57\uff01");$("#txtUserName").focus();return false}if(F==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u8eab\u4efd\u8bc1\u53f7\u7801\uff01");$("#txtCardNo").focus();return false}else{var H=checkCardID(F);if(!H){$("#txtCardNo").select();return false}}if(B==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u7535\u5b50\u90ae\u7bb1\uff01");$("#txtEmail").focus();return false}else if(!isEmail(B)){alert("\u60a8\u7684\u7535\u5b50\u90ae\u7bb1\u683c\u5f0f\u9519\u8bef\uff01");$("#txtEmail").select();return false}if(G==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u624b\u673a\u53f7\u7801\uff01");$("#txtMobile").focus();return false}else if(!isMobile(G)){$("#txtMobile").select();return false}if(isOrder>0)return false;if(confirm("\u786e\u5b9a\u65e0\u8bef\u5417\uff1f")){isOrder=parseInt(isOrder+1);$("#btnOrder").val("\u6b63\u5728\u63d0\u4ea4\u6570\u636e\u2026\u2026");$("#btnOrder").attr("disabled","disabled");var E={pay_ClassID:5,pay_CredNo:F,pay_Cren:D,pay_Email:B,pay_Lren:M,pay_Mobile:G,pay_MunPrice:parseInt(I),pay_RTime:"",pay_Rtong:J,pay_Ticketer:A,pay_Ticketer:A,pay_Type:1};jQuery.ajax({type:"post",url:"/WebManage/Order/AddOrder.aspx",data:E,dataType:"json",success:function(A){if(A.Type=="OK"){isOrder=0;document.cookie="orderid="+A.ID;$("#msgStep").find("li").removeClass("current");$("#msgStep").find("li:eq("+parseInt(K-1)+")").addClass("current");$("#msgContent").animate({height:"toggle",opacity:"toggle"},"slow",function(){$("#msgContent").load(C+"?tmp="+Math.random(),function(){$(this).animate({height:"toggle",opacity:"toggle"},"slow")})})}}})}}function goTicketPay(E,L){var C=$.trim($("#txtAdult").val()),B=$.trim($("#txtHalf").val()),A=$.trim($("#txtUserName").val()),G=$.trim($("#txtCardNo").val()),D=$.trim($("#txtEmail").val()),H=$.trim($("#txtMobile").val()),K=$.trim($("#txtComeTime").val()),J=$.trim($("#TicketPrices").text()),M=parseInt(C)+parseInt(B);if(!checkInt(C)){alert("\u6210\u4eba\u7968\u5f20\u6570\u9519\u8bef\uff0c\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u5f20\u6570\uff01");$("#adultTicket").focus();return false}if(!checkInt(B)){alert("\u534a\u7968\u5f20\u6570\u9519\u8bef\uff0c\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u5f20\u6570\uff01");$("#halfTicket").select();return false}if(parseInt(M)==0){alert("\u8bf7\u8f93\u5165\u60a8\u9700\u8981\u8d2d\u4e70\u7684\u95e8\u7968\u5f20\u6570\uff01");$("#adultTicket").select();return false}if(A==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u59d3\u540d\uff01");$("#txtUserName").select();return false}else if(A.length<2){alert("\u59d3\u540d\u81f3\u5c112\u4e2a\u5b57,\u6700\u591a10\u4e2a\u5b57\uff01");$("#txtUserName").focus();return false}if(G==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u8eab\u4efd\u8bc1\u53f7\u7801\uff01");$("#txtCardNo").focus();return false}else{var I=checkCardID(G);if(!I){$("#txtCardNo").select();return false}}if(D==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u7535\u5b50\u90ae\u7bb1\uff01");$("#txtEmail").focus();return false}else if(!isEmail(D)){alert("\u60a8\u7684\u7535\u5b50\u90ae\u7bb1\u683c\u5f0f\u9519\u8bef\uff01");$("#txtEmail").select();return false}if(H==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u624b\u673a\u53f7\u7801\uff01");$("#txtMobile").focus();return false}else if(!isMobile(H)){$("#txtMobile").select();return false}if(K==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u5165\u56ed\u65f6\u95f4\uff01");$("#txtComeTime").focus();return false}if(isOrder>0)return false;if(confirm("\u786e\u5b9a\u8ba2\u8d2d\u95e8\u7968\u5417\uff1f")){isOrder=parseInt(isOrder+1);$("#btnOrder").val("\u6b63\u5728\u63d0\u4ea4\u6570\u636e\u2026\u2026");$("#btnOrder").attr("disabled","disabled");var F={pay_ClassID:3,pay_CredNo:G,pay_Cren:B,pay_Email:D,pay_Lren:0,pay_Mobile:H,pay_MunPrice:parseInt(J),pay_RTime:K,pay_Rtong:C,pay_Ticketer:A,pay_Ticketer:A,pay_Type:1};jQuery.ajax({type:"post",url:"/WebManage/Order/AddOrder.aspx",data:F,dataType:"json",success:function(A){if(A.Type=="OK"){isOrder=0;document.cookie="orderid="+A.ID;$("#msgStep").find("li").removeClass("current");$("#msgStep").find("li:eq("+parseInt(L-1)+")").addClass("current");$("#msgContent").animate({height:"toggle",opacity:"toggle"},"slow",function(){$("#msgContent").load(E+"?tmp="+Math.random(),function(){$(this).animate({height:"toggle",opacity:"toggle"},"slow")})})}}})}}function goPay(){var C=get_ipow_cookie("orderid");if(C!=""){$("#goOrder").val("\u6b63\u5728\u63d0\u4ea4\u6570\u636e\u2026\u2026");$("#goOrder").attr("disabled","disabled");var A=$.trim($("#PayType").val()),B="/WebManage/Pay/Ali/Default.aspx";switch(A){case"\u652f\u4ed8\u5b9d":B="/WebManage/Pay/Ali/Default.aspx";jQuery.ajax({type:"post",url:B,data:"ID="+escape(C)+"&tmp="+Math.random(),dataType:"json",success:function(A){if(A.Type=="OK"){deleteCookie("orderid");window.location.href=A.Url}}});deleteCookie("orderid");break;case"\u7f51\u94f6":B="/WebManage/Pay/ChinaBank/Send.aspx?ID="+escape(C)+"";deleteCookie("orderid");window.location.href=B;break;default:break}}}function get_ipow_cookie(C){var E="",A=document.cookie;if(A!=""){var B=A.split("; ");for(var F=0;F<B.length;F++){var D=B[F].split("=");if(C==D[0]){E=D[1];break}}}if(E!="undefined")return E;else return""}function deleteCookie(A){var B=new Date();B.setTime(B.getTime()-10000);document.cookie=A+"=''; expire="+B.toGMTString()}function doane(A){return false}function checkCardID(E){var G=new Array("\u9a8c\u8bc1\u901a\u8fc7","\u8eab\u4efd\u8bc1\u53f7\u7801\u4f4d\u6570\u4e0d\u5bf9!","\u8eab\u4efd\u8bc1\u53f7\u7801\u51fa\u751f\u65e5\u671f\u8d85\u51fa\u8303\u56f4\u6216\u542b\u6709\u975e\u6cd5\u5b57\u7b26!","\u8eab\u4efd\u8bc1\u53f7\u7801\u9519\u8bef!","\u8eab\u4efd\u8bc1\u53f7\u7801\u9519\u8bef!"),B={11:"\u5317\u4eac",12:"\u5929\u6d25",13:"\u6cb3\u5317",14:"\u5c71\u897f",15:"\u5185\u8499\u53e4",21:"\u8fbd\u5b81",22:"\u5409\u6797",23:"\u9ed1\u9f99\u6c5f",31:"\u4e0a\u6d77",32:"\u6c5f\u82cf",33:"\u6d59\u6c5f",34:"\u5b89\u5fbd",35:"\u798f\u5efa",36:"\u6c5f\u897f",37:"\u5c71\u4e1c",41:"\u6cb3\u5357",42:"\u6e56\u5317",43:"\u6e56\u5357",44:"\u5e7f\u4e1c",45:"\u5e7f\u897f",46:"\u6d77\u5357",50:"\u91cd\u5e86",51:"\u56db\u5ddd",52:"\u8d35\u5dde",53:"\u4e91\u5357",54:"\u897f\u85cf",61:"\u9655\u897f",62:"\u7518\u8083",63:"\u9752\u6d77",64:"\u5b81\u590f",65:"\u65b0\u7586",71:"\u53f0\u6e7e",81:"\u9999\u6e2f",82:"\u6fb3\u95e8",91:"\u56fd\u5916"},E,F,A,C,D,H=new Array();H=E.split("");if(B[parseInt(E.substr(0,2))]==null)return G[4];switch(E.length){case 15:if((parseInt(E.substr(6,2))+1900)%4==0||((parseInt(E.substr(6,2))+1900)%100==0&&(parseInt(E.substr(6,2))+1900)%4==0))ereg=/^[1-9][0-9]{5}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}$/;else ereg=/^[1-9][0-9]{5}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}$/;if(ereg.test(E))return true;else{alert(G[2]);return false}break;case 18:if(parseInt(E.substr(6,4))%4==0||(parseInt(E.substr(6,4))%100==0&&parseInt(E.substr(6,4))%4==0))ereg=/^[1-9][0-9]{5}19[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}[0-9Xx]$/;else ereg=/^[1-9][0-9]{5}19[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}[0-9Xx]$/;if(ereg.test(E)){C=(parseInt(H[0])+parseInt(H[10]))*7+(parseInt(H[1])+parseInt(H[11]))*9+(parseInt(H[2])+parseInt(H[12]))*10+(parseInt(H[3])+parseInt(H[13]))*5+(parseInt(H[4])+parseInt(H[14]))*8+(parseInt(H[5])+parseInt(H[15]))*4+(parseInt(H[6])+parseInt(H[16]))*2+parseInt(H[7])*1+parseInt(H[8])*6+parseInt(H[9])*3;F=C%11;D="F";A="10X98765432";D=A.substr(F,1);if(D==H[17])return true;else{alert(G[3]);return false}}else{alert(G[2]);return false}break;default:alert(G[1]);return false;break}}function isEmail(A){var B=/^[a-zA-Z0-9_\-]{1,}@[a-zA-Z0-9_\-]{1,}\.[a-zA-Z0-9_\-.]{1,}$/;if(!B.exec(A))return false;return true}function isMobile(B){if(B.length==0){alert("\u8bf7\u8f93\u5165\u624b\u673a\u53f7\u7801\uff01");return false}if(B.length!=11){alert("\u8bf7\u8f93\u5165\u6709\u6548\u7684\u624b\u673a\u53f7\u7801\uff01");return false}var A=/^(((13[0-9]{1})|159|153|158)+\d{8})$/;if(!A.test(B)){alert("\u8bf7\u8f93\u5165\u6709\u6548\u7684\u624b\u673a\u53f7\u7801\uff01");return false}return true}function transferFocus(){var A=event.keyCode;if(A==13)event.keyCode=9}function addDate(A){var C=new Date(),D=C.getFullYear()+"-"+(C.getMonth()+1)+"-"+C.getDate(),B=DateAdd("d",A);B=B.getFullYear()+"-"+(B.getMonth()+1)+"-"+B.getDate();return B}function DateAdd(C,A){var B=new Date();switch(C){case"s":return new Date(Date.parse(B)+(1000*A));case"n":return new Date(Date.parse(B)+(60000*A));case"h":return new Date(Date.parse(B)+(3600000*A));case"d":return new Date(Date.parse(B)+(86400000*A));case"w":return new Date(Date.parse(B)+((86400000*7)*A));case"q":return new Date(B.getFullYear(),(B.getMonth())+A*3,B.getDate(),B.getHours(),B.getMinutes(),B.getSeconds());case"m":return new Date(B.getFullYear(),(B.getMonth())+A,B.getDate(),B.getHours(),B.getMinutes(),B.getSeconds());case"y":return new Date((B.getFullYear()+A),B.getMonth(),B.getDate(),B.getHours(),B.getMinutes(),B.getSeconds())}}jQuery.fn.scrollDiv=function(){return this.each(function(){var A=$(this);A.slideDown("slow");var B=function(B){A.slideUp("slow")};A.find("a.close").bind("click",function(){B(this)})})};function addGuest(){var C=$.trim($("#txtUserName").val()),B=$.trim($("#txtMobile").val()),D=$.trim($("#txtEmail").val()),E=$.trim($("#txtFrom").val()),A=$.trim($("#txtContent").val());if(C==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u59d3\u540d:)");$("#txtUserName").focus();return false}if(B!="")if(!isMobile(B)){$("#txtMobile").select();return false}if(D==""){alert("\u8bf7\u8f93\u5165\u60a8\u7684\u7535\u5b50\u90ae\u7bb1:)");$("#txtEmail").focus();return false}else if(!isEmail(D)){alert("\u60a8\u7684\u7535\u5b50\u90ae\u7bb1\u683c\u5f0f\u9519\u8bef:)");$("#txtEmail").select();return false}if(E==""){alert("\u8bf7\u8f93\u5165\u60a8\u6765\u81ea\u54ea\u91cc:)");$("#txtFrom").focus();return false}if(A==""){alert("\u8bf7\u8f93\u5165\u60a8\u8981\u7559\u8a00\u7684\u5185\u5bb9:)");$("#txtContent").focus();return false}else if(A.length<3){alert("\u7559\u8a00\u5185\u5bb9\u81f3\u5c11\u4e24\u4e2a\u5b57:)");$("#txtContent").focus();return false}var F={UserName:C,Email:D,Telephone:B,Froms:E,Content:A};F=JSON.stringify(F);$.post("/WebManage/Common/CommAjax.aspx?temp="+Math.random(),{Comment:F,Type:"AddComm"},function(A){if(A=="strture"){alert("\u60a8\u7684\u7559\u8a00\u6211\u4eec\u5df2\u6536\u5230\uff0c\u7a0d\u540e\u56de\u590d\u4e2d,\u8c22\u8c22^_^");loadGuest(1);$("#msgWin").hide()}})}function showGuest(){var A="";$.getJSON("/WebManage/Common/CommAjax.aspx?temp="+Math.random(),{Type:"GetComm",PageIndex:1,PageSize:5},function(B){$.each(B.CommList,function(B,C){A+="<li><a title=\""+C.UserName+"\" onclick = \"showGuestM("+C.BookID+",this)\" id=\"Book"+C.BookID+"\" href=\"javascript:;\">"+C.Content.substring(0,10)+"</a></li>"});$("#guestInfo").html(A)})}function showGuestM(A,B){if(!isNaN(A))$(B).showWin({width:450,height:200,url:"/WebManage/Common/GetBooKAndReByID.aspx?BookID="+A+"",type:"ajax",objID:"msgWin",kind:"msg"})}function loadGuest(B){var A=2;$.getJSON("/WebManage/Common/CommAjax.aspx?temp="+Math.random(),{Type:"GetComm",PageIndex:B,PageSize:4},function(C){var D="";$.each(C.CommList,function(A,F){var B=F.AddTime;B=B.replace("/Date(","");B=B.replace("+0800)/","");D+="<div class=\"guestList\">";B=new Date(parseInt(B));B=B.getFullYear()+"-"+(B.getMonth()+1)+"-"+B.getDay();var E=String();D+="<h3>\u6e38\u5ba2\uff1a"+F.UserName+"</h3><em>\u53d1\u8868\u4e8e\uff1a"+B+"</em>";D+="<p  class=\"guest\">"+F.Content+"</p>";$.each(C.ReList,function(B,A){if(A.BookID==F.BookID){var C=A.AddTime;C=C.replace("/Date(","");C=C.replace("+0800)/","");C=new Date(parseInt(C));C=C.getFullYear()+"-"+(C.getMonth()+1)+"-"+C.getDay();D+="<p class=\"replay\">";D+="<b>\u56de\u590d\u4e8e"+C+"</b><br />";D+="&nbsp;&nbsp;"+A.Content.replace("\r\n","<br/>")+"</p>"}});D+="</div>"});var A="";A+="<span>\u7b2c"+C.PageIndex+"\u9875 \u5171"+C.TotalPage+"\u9875</span>";if(C.PageIndex==1){A="<span>\u9996\u9875</span>"+A;A="<span>\u4e0a\u4e00\u9875</span>"+A}else{A="<a href=\"javascript:void(0)\" onclick=\"loadGuest(1);\">\u9996\u9875</a>"+A;A="<a href=\"javascript:void(0)\" onclick=\"loadGuest("+(B-1)+");\">\u4e0a\u4e00\u9875</a>"+A}if(C.PageIndex==C.TotalPage){A="<span>\u4e0b\u4e00\u9875</span>"+A;A="<span>\u5c3e\u9875</span>"+A}else{A="<a href=\"javascript:void(0)\" onclick=\"loadGuest("+(B+1)+");\">\u4e0b\u4e00\u9875</a>"+A;A="<a href=\"javascript:void(0)\" onclick=\"loadGuest("+C.TotalPage+");\">\u5c3e\u9875</a>"+A}$("#pageTopList").html(A);$("#pageList").html(A);$("#ShowBook").html("");$("#ShowBook").html(D)})}function showmsg(J,D,G,E){var I="msgWin",F=[],H=function(){F=A();var H=parseInt(F.scrTop),B=0;if(!$("#"+I).is(":hidden")){var J=parseInt((F.offWidth-G)/2),D=parseInt((F.offHeight-E)/2)+parseInt(F.scrTop);$("#msgWin").animate({width:G,height:E,left:J,top:D},500,function(){C()})}else{$("#"+I).css({"left":F.offLeft,"top":F.offTop});if(F.offWidth>G)B=parseInt((F.offWidth-G)/2);if(F.offHeight>E)H=H+parseInt((F.offHeight-E)/2);$("#"+I).animate({opacity:"show",width:G,height:E,top:H,left:B},500);C()}},C=function(){K(D)},K=function(A){var C="<div id=\"msgTitle\">";C+="<h2>\u6807\u9898\uff1a"+A+"</h2>";$("#"+I).css("background-color","rgb(217, 234, 242)");C+="<a href=\"javascript:;\" id=\"closeWin\" class=\"close\" title=\"\u5173\u95ed\"></a>\t\t\t</div>\t\t\t<div id=\"msgContainer\" style=\"display:none;height:"+parseInt(E-35)+"px\"></div>";$("#"+I).html(C);jQuery.ajax({type:"GET",url:J+"&tmp="+Math.random(),dataType:"json",success:function(A){if(A.Type=="OK"){$("#msgContainer").html(A.ArticleEntity.Content);$("#msgContainer").fadeIn("slow")}}});$("#msgTitle").find("a.close").click(function(){B()})},B=function(){var A=0;if(F.offWidth>G)A=parseInt((F.offWidth-G)/2);var B=parseInt(F.offTop);$("#"+I).animate({opacity:"hide",width:0,height:0,left:F.offLeft,top:B},500);$("#"+I).html("")},A=function(){var A=[];A.offLeft=0;A.offTop=0;A.offWidth=document.documentElement.clientWidth;A.offHeight=document.documentElement.clientHeight;var B;if(typeof window.pageYOffset!="undefined")B=window.pageYOffset;else if(typeof document.compatMode!="undefined"&&document.compatMode!="BackCompat")B=document.documentElement.scrollTop;else if(typeof document.body!="undefined")B=document.body.scrollTop;A.scrTop=B;return A};H()}function in_array(B,A){var A=new String(A);A=A.toLowerCase();var B=new String(B);B=B.toLowerCase();return(","+B+",").indexOf(","+A+",")}function choosePay(A){var C=new Array("\u652f\u4ed8\u5b9d,\u7f51\u94f6"),B=$.trim($(A).attr("title"));if((in_array(C,B))>-1){$(A).parent().find("a").css("background-position","left top");$(A).css("background-position","-99px top");$("#PayType").val(B)}}