function CmfuAjax() { this.xml=false; this.GetXmlHttp=function() { /*@cc_on @*/ /*@if (@_jscript_version >= 5) try { this.xml = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { this.xml = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e2) { this.xml = false; } } @end @*/ if (!this.xml && typeof XMLHttpRequest != 'undefined') { this.xml = new XMLHttpRequest(); } } this.GetXmlHttp(); var xmlHttp = this.xml; var ajax=this; var callBack=null; this.updatePage=function() { if (xmlHttp.readyState == 4) { // alert("ResponseText: "+xmlHttp.responseText); // try{ //alert("text="+xmlHttp.responseText); var response = eval('('+xmlHttp.responseText+')'); if(callBack!=null && typeof callBack == "function") { callBack(response); } // }catch(e) // { // alert("error£º"+e); // } } } this.toQueryString=function(json) { var query=""; if(json!=null) { for(var param in json) { query+=param+"="+escape(json[param])+"&" } } return query; } this.invoke=function(opName,params,pageCallBack,method) { if(xmlHttp) { // var query="opName="+opName+"&"; var query=""; query+=this.toQueryString(params); query=query.substring(0,query.length-1); callBack= pageCallBack; if(method!=null &&method.toUpperCase()=="GET") { var url = "/ajax.aspx?opName="+opName+"&"+query; xmlHttp.onreadystatechange = ajax.updatePage; xmlHttp.open("GET", url, true); xmlHttp.setRequestHeader("CMFUAJAX-Ver","ver1.0"); xmlHttp.send(null); }else{ var url =""; if(opName!=null &&(opName.toLowerCase()=="addreview" || opName.toLowerCase()=="addforumreview" || opName.toLowerCase()=="addclubreview"||opName.toLowerCase()=="addclubspecialreview")) { url= "/ajax2.aspx?opName="+opName; } else if(opName!=null && (opName.toLowerCase()=="vote0714"||opName.toLowerCase()=="voteauthor"||opName.toLowerCase()=="voteauthorname")) { //url= "/ploy/20080714/VoteService.aspx?opName="+opName; url= "/ply/20080924/VoteService.aspx?opName="+opName; } else { url= "/ajax.aspx?opName="+opName; } // xmlHttp.setRequestHeader("Content-Length",query); xmlHttp.onreadystatechange =ajax.updatePage; //new CallClient(this); //this.updatePage; xmlHttp.open("POST", url, true); xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlHttp.setRequestHeader("CMFUAJAX-Ver","ver1.0"); xmlHttp.send(query); } } } } var MyAjax={ AddReview: function(bookId, content, postType, validCode) { new CmfuAjax().invoke("AddReview", {"bookId":bookId, "content":content, "postType":postType, "validCode":validCode}, arguments[4]); }, AddClubReview: function(validCode, content, clubId) { new CmfuAjax().invoke("AddClubReview", {"validCode":validCode, "content":content, "clubId":clubId}, arguments[3]); }, AddClubSpecialReview: function(validCode, content, clubSpecialID,fromNickName) { new CmfuAjax().invoke("AddClubSpecialReview", {"validCode":validCode, "content":content, "clubSpecialID":clubSpecialID,"fromNickName":fromNickName}, arguments[4]); }, AddForumReview: function(bookId, title, content, postType, validCode) { new CmfuAjax().invoke("AddForumReview", {"bookId":bookId,"title":title, "content":content, "postType":postType, "validCode":validCode}, arguments[5]); }, MonthVote: function(bookId) { new CmfuAjax().invoke("MonthVote", {"bookId":bookId},arguments[1]); }, AddBookMark: function(bookId, chapterId) { new CmfuAjax().invoke("AddBookMark", {"bookId":bookId, "chapterId":chapterId}, arguments[2]); }, RecomBook: function(bookId) { new CmfuAjax().invoke("RecomBook", {"bookId":bookId}, arguments[1]); }, IsLogin: function() { new CmfuAjax().invoke("IsLogin", {}, arguments[0]); }, GetLoginId: function() { new CmfuAjax().invoke("GetLoginId", {},arguments[0]); }, DoVipDiscount: function() { new CmfuAjax().invoke("DoVipDiscount", {},arguments[0]); }, RegisterUser: function(ptId, password1, email, validcode) { new CmfuAjax().invoke("RegisterUser", {"ptId":ptId, "password1":password1, "email":email, "validcode":validcode}, arguments[4]); }, // LoginUser: function(ptId, password) { // invoke("LoginUser", {"ptId":ptId, "password":password}, arguments[2]); // }, LoginUser: function(ptId, password, token, challenge, saveCookie) { new CmfuAjax().invoke("LoginUser", {"ptId":ptId, "password":password, "token":token, "challenge":challenge, "saveCookie":saveCookie}, arguments[5]); }, AddBookClick: function(bookId) { new CmfuAjax().invoke("AddBookClick", {"bookId":bookId},arguments[1]); }, SetRecentReadBookCookie: function(bookId) { new CmfuAjax().invoke("SetRecentReadBookCookie", {"bookId":bookId}); }, AddUpdateAwake: function(strBookId) { new CmfuAjax().invoke("AddUpdateAwake", {"strBookId":strBookId},arguments[1]); }, LoadSmartCommendBooks: function(result) { new CmfuAjax().invoke("LoadSmartCommendBooks", {"result":result}, arguments[1]); }, AddBookCase: function(bookId) { new CmfuAjax().invoke("AddBookCase", {"bookId":bookId}, arguments[1]); }, SubmitSurvey: function(strBookId, args) { new CmfuAjax().invoke("SubmitSurvey", {"strBookId":strBookId, "args":args}, arguments[2]); }, AppraiseBook: function(bookId, userId, score) { new CmfuAjax().invoke("AppraiseBook", {"bookId":bookId, "userId":userId, "score":score},arguments[3]); }, LoginUserWithInfo:function(ptId, password, token, challenge, saveCookie) { new CmfuAjax().invoke("LoginUserWithInfo", {"ptId":ptId, "password":password, "token":token, "challenge":challenge, "saveCookie":saveCookie}, arguments[5]); }, CheckLoginWithInfo:function(){ new CmfuAjax().invoke("CheckLoginWithInfo", {}, arguments[0]); }, VoteRcmAlbum:function(rcmId){ new CmfuAjax().invoke("VoteRcmAlbum",{"rcmId":rcmId}, arguments[1]); }, SignOut:function(){ new CmfuAjax().invoke("SignOut", {}, arguments[0]); }, SelectVipDeliverBook:function (bookId){ new CmfuAjax().invoke("SelectVipDeliverBook",{"bookId":bookId},arguments[1]); }, //MM PKvoatge MMPKVote:function (pkId){ new CmfuAjax().invoke("MMPKVote",{"pkId":pkId}, arguments[1]); }, //MM monthlyVote MMMonthlyVote:function(bookId){ new CmfuAjax().invoke("MMMonthlyVote",{"bookId":bookId}, arguments[1]); }, //auto pay AutoPayBook:function(bookId){ new CmfuAjax().invoke("AutoPayBook",{"bookId":bookId}, arguments[1]); }, //add to club ApplyIntoClub:function(clubId){ new CmfuAjax().invoke("ApplyIntoClub",{"clubId":clubId}, arguments[1]); }, //add club to favorite AddClub2Favorite:function(clubId){ new CmfuAjax().invoke("AddClub2Favorite",{"clubId":clubId}, arguments[1]); }, //sspace static GetSpaceStatistic:function(){ new CmfuAjax().invoke("GetSpaceStatistic",{},arguments[0]); }, //get space online person num GetSpaceOnlinecnt:function(){ new CmfuAjax().invoke("GetSpaceOnlinecnt",{},arguments[0]); }, //get space online person num GetSpaceOnlinecnt:function(){ new CmfuAjax().invoke("GetSpaceOnlinecnt",{},arguments[0]); }, //clubindex use CanUserCreateClub:function(){ new CmfuAjax().invoke("CanUserCreateClub",{},arguments[0]); }, AddFriend:function(friendNickName){ new CmfuAjax().invoke("AddFriend",{"friendNickName":friendNickName},arguments[1]); }, IsFavoriteBook:function(bookId,userId){ new CmfuAjax().invoke("IsFavoriteBook",{"bookId":bookId,"userId":userId},arguments[2]); } , DeleteLeaveMsg:function(msgId){ new CmfuAjax().invoke("DeleteLeaveMsg",{"msgId":msgId},arguments[1]); }, AddReviewSupport:function(reviewId){ new CmfuAjax().invoke("AddReviewSupport",{"reviewId":reviewId},arguments[1]); }, CheckPtId:function(ptId){ new CmfuAjax().invoke("CheckPtId",{"ptId":ptId},arguments[1]); }, BindRcmReview:function(bookId){ new CmfuAjax().invoke("BindRcmReview",{"bookId":bookId},arguments[1]); }, BindBehindData:function(type){ new CmfuAjax().invoke("BindBehindData",{"type":type, "bookId":bookId},arguments[2]); }, GetUserTicketInfor:function(){ new CmfuAjax().invoke("GetUserTicketInfor",{},arguments[0]); }, VoteReqUpTicket:function(bookId,type,count){//Ͷ¸üÐÂÆ± new CmfuAjax().invoke("VoteReqUpTicket",{"bookId":bookId,"type":type,"count":count},arguments[3]); }, ReadChapterPop:function(bookId){//ÔĶÁÒ³µ¯³ö new CmfuAjax().invoke("ReadChapterPop", {"bookId":bookId},arguments[1]); }, GetBookLabel:function(bookId,pageIndex,pageSize){// new CmfuAjax().invoke("GetBookLabel",{"bookId":bookId,"pageIndex":pageIndex,"pageSize":pageSize},arguments[3]); }, GetUserLabel:function(){ new CmfuAjax().invoke("GetUserLabel",{},arguments[0]); }, SubmitLabel:function(bookId,newLabel){// new CmfuAjax().invoke("SubmitLabel",{"bookId":bookId,"newLabel":newLabel},arguments[2]); }, GetUserType:function(){ new CmfuAjax().invoke("GetUserType",{},arguments[0]); }, RcmAlbumClick:function(rcmAlbumId){ new CmfuAjax().invoke("RcmAlbumClick",{"rcmAlbumId":rcmAlbumId},arguments[1]); }, Vote0714Thread:function(threadIds) { new CmfuAjax().invoke("vote0714",{"threadIds":threadIds},arguments[1]); }, VoteAuthor:function(names) { new CmfuAjax().invoke("voteauthor",{"names":names},arguments[1]); }, VoteAuthorName:function(name) { new CmfuAjax().invoke("voteauthorname",{"name":name},arguments[1]); }, VoteMMFlash:function(authorId) { new CmfuAjax().invoke("VoteMMFlash",{"authorId":authorId},arguments[1]); }, PostMessage:function(validateCode,content,authorId,replyType) { new CmfuAjax().invoke("PostMessage",{"validateCode":validateCode,"content":content,"authorId":authorId,"replyType":replyType},arguments[4]); }, SJGVote:function(bookList) { new CmfuAjax().invoke("SJGVote",{"bookList":bookList},arguments[1]); } }