﻿/*
*author:吴增伟
*email:hdysj#126.com
*started at 2008-4-9
*@fileoverview 全站统一Ajax
*version:1.0
*/
var Config_Domain="cando360.com";
var Config_SiteDefault="http://www."+Config_Domain;
var Config_SiteEvent="http://event."+Config_Domain;
var Config_SiteEssay="http://essay."+Config_Domain;
var Config_SiteCritics="http://critics."+Config_Domain;
var Config_Sitebbs="http://bbs."+Config_Domain;
var Config_SiteMember="http://member."+Config_Domain;
var Config_SiteAlbum="http://album."+Config_Domain;
var Config_SiteSpecial="http://special."+Config_Domain;
var Config_SitePiao="http://piao."+Config_Domain;
var Config_SiteGroup="http://group."+Config_Domain;
var Config_SiteSpace="http://space."+Config_Domain;
var Config_Ajax=Config_SiteDefault+"/Ajax/";
var UserData={id:0,nickname:"",headerimg:"",userflag:0,msgcount:0,vipimg:""};

//优化setTimeout
var _st = window.setTimeout;
if(!window.setTimeout.constructor)
window.setTimeout = function(fRef, mDelay) {
    if(typeof fRef == 'function'){
        var argu = Array.prototype.slice.call(arguments,2);
        var f = (function(){ fRef.apply(null, argu); });
        return _st(f, mDelay);
    }
    return _st(fRef,mDelay);
};
//优化setInterval
var _int = window.setInterval;
if(!window.setInterval.constructor)
window.setInterval = function(fRef, mDelay) {
    if(typeof fRef == 'function'){
        var argu = Array.prototype.slice.call(arguments,2);
        var f = (function(){ fRef.apply(null, argu); });
        return _int(f, mDelay);
    }
    return _int(fRef,mDelay);
};
String.prototype.ReplaceHtml=function()
{
   var str=this.valueOf();
    var re=new RegExp("<(.[^><]*)>","ig");
    str=str.replace(re,"");
    return str;
};
String.prototype.RemoveUnsafeHtml=function()
{
    var RegScript=new RegExp("<script(.|\n)*?>(.|\n)*?<\/script>","ig");
    var RegIframe=new RegExp("<iframe(.|\n)*?>(.|\n)*?<\/iframe>","ig");
    var RegInput=new RegExp("<input(.|\n)*?>","ig"); 
    var RegForm=new RegExp("<form(.|\n)*?>(.|\n)*?<\/form>","ig");
    var RegStyle=new RegExp("<style(.|\n)*?>(.|\n)*?<\/style>","ig");
    var RegFrameset=new RegExp("<frameset(.|\n)*?>(.|\n)*?<\/frameset>","ig");
    var str=this.valueOf();
    str=str.replace(RegScript,"");
    str=str.replace(RegIframe,"");
    str=str.replace(RegInput,"");
    str=str.replace(RegForm,"");
    str=str.replace(RegStyle,"");
    str=str.replace(RegFrameset,"");
    return str;
};
String.prototype.trim = function()
{
    return this.replace(/(^\s*)|(\s*$)/g, "");
};
var Fid=function(obj)
{
    return document.getElementById(obj);
};
//是否空值
function Fempty(v){return((""==v||undefined==v||null==v)?true:false);};
//优化字符串
var StringBuffer=function()
{this._string=new Array;};
StringBuffer.prototype.append=function(str)
{
  this._string.push(str);
};
StringBuffer.prototype.toString=function()
{
  return this._string.join("");
};
//基类
var CandoSys={};

//显示/隐藏htmlselect控件
CandoSys.HtmlSelect=
{
    show:function()
    {
        $("select").each(function(){$(this).css("visibility","visible");});
    },
    hide:function()
    {
        $("select").each(function(){$(this).css("visibility","hidden");});
    }
    
};
CandoSys.Ajax=
{
    getscript:function(url,data,iscatch)
    {
       if(!Fempty(data))
       {
          if(url.indexOf("?")>0)
              {
                 url=url+"&"+data;
              }
              else
              {
                 url=url+"?"+data;
              }
       }
       if(!Fempty(iscatch))
       {
          if(iscatch==false)
          {
              if(url.indexOf("?")>0)
              {
                 url=url+"&r="+Math.random();
              }
              else
              {
                 url=url+"?r="+Math.random();
              }
          }
       }
       $.getScript(url,function()
       {
          if(typeof _CallBack!="undefined")
          {
             CandoSys.DisposeInfo(_CallBack);
          }
          else
          {
             CandoSys.PopWindow.error();
          }
       }
       );
    },
   ajax:function(method,url,data)
   {
      $.ajax({
        type:method,
        url:url,
        data:data,
        dataType:"text",
        success:function(json)
        {
           if(typeof json !="undefined")
           {
              _CallBack={SignInfo:json};
              CandoSys.DisposeInfo(_CallBack);
           }
           else
           {
              CandoSys.PopWindow.error();
           }
        },
        error:function()
        {
           CandoSys.PopWindow.error();
        }
      });
   },
   param:function(a)
   {
     var s = [];
		if ( a.constructor == Array || a.jquery )
			jQuery.each( a, function(){
				s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) );
			});
		else
			for ( var j in a )
				if ( a[j] && a[j].constructor == Array )
					jQuery.each( a[j], function(){
						s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) );
					});
				else
					s.push( encodeURIComponent(j) + "=" + encodeURIComponent( a[j] ) );
		return s.join("&").replace(/%20/g, "+");
   }
};
//弹出效果
CandoSys.PopWindow={
    careatePanl:function(title,noclose)
    {
       if(noclose)
       {
            CandoTemplate.WindowsPanl.PopWindowNoClose();
       }
       else
       {
            CandoTemplate.WindowsPanl.PopWindow();
       }
       
        $("#WindowBackGround").css("display","block");
        $("#WindowBackGround").width(document.body.clientWidth);
        $("#WindowBackGround").height(document.body.clientHeight);
        $("#Window_Msg_Container").css("display","block");
        $("#Window_Msg_Container").css("marginLeft","-225");
        $("#Window_Msg_Container").css("marginTop",-50+document.documentElement.scrollTop);
        $("#Window_Title").html(title);
        CandoSys.HtmlSelect.hide();
    },
    show:function(strform,title,width,noclose)
    {
       CandoSys.PopWindow.careatePanl(title,noclose);
//       if(UserData.id==0)
//       {
//          CandoSys.PopWindow.error(CandoSys.ErrInfo.notlogin);
//          return ;
//       }
       if(typeof width !="undefined")
       {
           $("#Window_Msg_Container").width(width);
           $("#Window_Msg_Container").css("marginLeft","-345");
           $("#Window_Msg_Container").css("marginTop",-150+document.documentElement.scrollTop);
       }
       else
       {
          $("#Window_Msg_Container").width(440);
       }
       $("#Window_Msg_Info").css("display","block");
       $("#Window_Msg_Info").html(strform);
    },
    hide:function()
    {
      $("#WindowBackGround").css("display","none");
      $("#Window_Msg_Container").css("display","none");
      $("#Window_Msg_Info").css("display","none");
      //$("#Window_Msg_Info").html("");
      $("#Window_Msg").css("display","none");
      //$("#Window_Msg").html("");
      CandoSys.HtmlSelect.show();
    },
    error:function(errinfo)
    {
       if(typeof errinfo=='undefined')
       {
           errinfo="系统忙,请稍候再操作！";
       }
       $("#Window_Msg_Info").css("display","none");
       $("#Window_Msg").css("display","block");
       $("#Window_Msg").html("<img src='http://www.cando360.com/images/msg/error.gif' alt=''/> "+errinfo);
       setTimeout("CandoSys.PopWindow.hide()",1500);
    },
    posting:function(msg)
    {
       if(typeof msg=='undefined')
       {
           msg="数据提交中,请稍候...";
       }
       $("#Window_Msg_Info").css("display","none");
       $("#Window_Msg").css("display","block");
       $("#Window_Msg").html("<img src='http://www.cando360.com/images/msg/LoadingLit.gif' alt=''/> "+msg);
    },
    loading:function(msg)
    {
       if(typeof msg=='undefined')
       {
           msg="数据加载中,请稍候...";
       }
       $("#Window_Msg_Info").css("display","none");
       $("#Window_Msg").css("display","block");
       $("#Window_Msg").html("<img src='http://www.cando360.com/images/msg/LoadingLit.gif' alt=''/> "+msg);
    },
    success:function(msg,callback)
    {
       if(typeof msg=='undefined')
       {
           msg="操作成功！";
       }
       $("#Window_Msg_Info").css("display","none");
       $("#Window_Msg").css("display","block");
       $("#Window_Msg").html("<img src='http://www.cando360.com/images/msg/LoadingLit.gif' alt=''/> "+msg);
       setTimeout("CandoSys.PopWindow.hide();"+callback,1500);
    },
    successref:function(msg)
    {
       if(typeof msg=='undefined')
       {
           msg="操作成功！";
       }
       $("#Window_Msg_Info").css("display","none");
       $("#Window_Msg").css("display","block");
       $("#Window_Msg").html("<img src='http://www.cando360.com/images/msg/LoadingLit.gif' alt=''/> "+msg);
       setTimeout("location.replace(location.href.replace(new RegExp('#\w+','ig'),''));",1500);
    }
};
//错误信息
CandoSys.ErrInfo={
    notlogin:"您还没有登陆,请登陆后再操作",
    busy:"服务器忙，请稍候再操作！",
    friend:"添加好友成功",
    friendrepeat:"您已经添加了此好友",
    friendself:"您不需要加自己为好友",
    extpost:"禁止外部提交",
    parameter:"参数错误",
    collection:"收藏成功",
    collectionrepeat:"您已经收藏了该信息",
    collectionself:"您不需要收藏自己发表的信息",
    pergradesuccess:"评分成功！",
    pergradeeditsuccess:"修改评分成功！",
    sharerepeat:"您已经对该信息分享过啦！",
    sharesuccess:"分享成功！",
    emailsuccess:"发送邮件成功！",
    msgsuccess:"发送信息成功！",
    msgerror:"发送信息失败！",
    msgself:"不能给自己发送信息",
    canfansvotesuccess:"投票成功",
    canfansvoteself:"不能给自己投票",
    canfansvoterepeat:"今日您已给该宽友投票，请不要重复操作",
    essayvotesuccess:"推荐成功",
    essayvoterepeat:"不能重复推荐",
    essayvoteself:"不能给自己的剧评/随笔推荐",
    discussSuccess:"话题发表成功",
    discussError:"话题发表错误",
    activityEndError:"报名已结束"
};
//消息处理
CandoSys.DisposeInfo=function(_callback)
{
   if(typeof _callback!="undefined")
   {
       switch(_callback.SignInfo)
       {
          case "NotLogin":
              CandoSys.PopWindow.error(CandoSys.ErrInfo.notlogin);
              break;
          case "FriendSuccess":
              CandoSys.PopWindow.success(CandoSys.ErrInfo.friend);
              break;
          case "FriendRepeat":
              CandoSys.PopWindow.error(CandoSys.ErrInfo.friendrepeat);
              break;
          case "FriendSelf":
              CandoSys.PopWindow.error(CandoSys.ErrInfo.friendself);
              break;
          case "CanfansVoteSuccess":
              CandoSys.PopWindow.success(CandoSys.ErrInfo.canfansvotesuccess);
              break;
          case "CanfansVoteRepeat":
              CandoSys.PopWindow.error(CandoSys.ErrInfo.canfansvoterepeat);
              break;
          case "CanfansVoteSelf":
              CandoSys.PopWindow.error(CandoSys.ErrInfo.canfansvoteself);
              break;
          case "EssayVoteSuccess":
              CandoSys.PopWindow.success(CandoSys.ErrInfo.essayvotesuccess);
              CandoSys.Vote.essaysuc();
              break;
          case "EssayVoteRepeat":
              CandoSys.PopWindow.error(CandoSys.ErrInfo.essayvoterepeat);
              break;
          case "EssayVoteSelf":
              CandoSys.PopWindow.error(CandoSys.ErrInfo.essayvoteself);
              break;
          case "CollectionSuccess":
              CandoSys.PopWindow.success(CandoSys.ErrInfo.collection);
              break;
          case "CollectionRepeat":
              CandoSys.PopWindow.error(CandoSys.ErrInfo.collectionrepeat);
              break;
          case "ShareSuccess":
              CandoSys.PopWindow.success(CandoSys.ErrInfo.sharesuccess);
              break;
          case "EmailSuccess":
              CandoSys.PopWindow.success(CandoSys.ErrInfo.emailsuccess);
              break;
          case "ShareRepeat":
              CandoSys.PopWindow.error(CandoSys.ErrInfo.sharerepeat);
              break;
          case "ShareTooMuch":
              CandoSys.PopWindow.error("请不要对同一内容分享得太频繁。");
              break;
          case "MsgSuccess":
              CandoSys.PopWindow.success(CandoSys.ErrInfo.msgsuccess);
              break;
          case "MsgError":
              CandoSys.PopWindow.error(CandoSys.ErrInfo.msgerror);
              break;
          case "MsgSelf":
              CandoSys.PopWindow.error(CandoSys.ErrInfo.msgself);
              break;
          case "CommentSuccess":
              CandoSys.PopWindow.success("留言成功",CandoSys.Comment.myComment());
              break;  
          case "DiscussSuccess":
              CandoSys.PopWindow.successref(CandoSys.ErrInfo.discussSuccess);
              break;  
          case "DiscussError":
              CandoSys.PopWindow.error(CandoSys.ErrInfo.discussError);
              break;
          case "ActivitySignSelf":
              CandoSys.PopWindow.error("自己发布的活动不需要报名");
              break;  
          case "ActivitySignCount":
              CandoSys.PopWindow.error("报名人数已满，无法报名");
              break;  
          case "ActivitySignEditSuccess":
              CandoSys.PopWindow.successref("修改报名成功");
              break;  
          case "ActivitySignSuccess":
              CandoSys.PopWindow.successref("报名成功");
              break;  
          case "ActivitySignDelSuccess":
              CandoSys.PopWindow.successref("报名删除成功");
              break;  
          case "ActivityInterestsSelf":
              CandoSys.PopWindow.error("自己发布的活动不需要报名");
              break; 
          case "ActivityInfoDateSignError":
              CandoSys.PopWindow.error("您填写的参加活动日期不在活动进行时间内，请您重新填写报名信息");
              break;    
          case "ActivityInterestsSuccess":
              CandoSys.PopWindow.successref("成功");
              break;  
          case "ActivityGuardhouseSuccess":
              CandoSys.PopWindow.successref("您现在正在宽度小黑屋中静养，无法参加活动。");
              break;
          case "ActivityGuardhouseMobileSuccess":
              CandoSys.PopWindow.successref("您填写的手机号现在正在宽度小黑屋中静养，无法参加活动，请您换个常用手机号再次报名。");
              break;
          case "CollectionSelf":
              CandoSys.PopWindow.error(CandoSys.ErrInfo.collectionself);
              break;
          case "PerGradeSuccess":
              CandoSys.PopWindow.success(CandoSys.ErrInfo.pergradesuccess);
              CandoSys.Performance.Grade.myvote(_callback.star,_callback.action,_callback.starmark,_callback.actionmark);
              //CandoSys.Performance.Grade.reloadpage();
              break;
          case "PerGradeEditSuccess":
              CandoSys.PopWindow.success(CandoSys.ErrInfo.pergradesuccess);
              CandoSys.Performance.Grade.myvote(_callback.star,_callback.action,_callback.starmark,_callback.actionmark);
              //CandoSys.Performance.Grade.reloadpage();
              break;
          case "LoginInSuccess":
          case "LoginOutSuccess":
               var strUrlLoginInSuccess = location.href;
               if(strUrlLoginInSuccess.indexOf("#") > 0)
               {
                   strUrlLoginInSuccess = strUrlLoginInSuccess.substring(0, strUrlLoginInSuccess.indexOf("#"));
               }
               location.replace(strUrlLoginInSuccess);
               break;
          case "LoginUserFlagInError":
               alert("因业务发展和业务定位需要，宽度网从2008-11-10日起正式取消团体帐号登录和注册，团体之前已经录入的信息全部保留，不会丢失。即日起，团体可以以个人身份注册帐号，发布宽度网许可范围内的相关信息，特此通知，请知悉！");
               break;
          case "LoginInError":
               alert("用户名或密码错误！");
               break;
          case "LoginedSuccess":
               CandoSys.UserLogin.setuserdata();
               CandoSys.UserLogin.setloginpanl();
               break;
          case "CatchError":
              CandoSys.PopWindow.error(CandoSys.ErrInfo.busy);
              break;
          case "Par":
              CandoSys.PopWindow.error(CandoSys.ErrInfo.parameter);
              break;
          case "activityEndError":
              CandoSys.PopWindow.error(CandoSys.ErrInfo.activityEndError);
              break;
          case "DeleteSuccess":
              CandoSys.PopWindow.success("删除成功");
              if(typeof HideData != "undefined")
              {
                  HideData(_callback.id);
              }
              break;
          case "UpMessage":
              CandoSys.PopWindow.success("成功！");
              break;
          case "DownMessage":
              CandoSys.PopWindow.success("成功！");
              break;
          case "GuessServerError":
              CandoSys.PopWindow.error("服务器忙！");
              break;
          case "GuessQualityError":
              CandoSys.PopWindow.error("您已经评价过，请不要重复操作！");
              break;
          case "NotesAddSuccess":
              CandoSys.PopWindow.success("留言成功");
              break;
          case "NotesAddError":
              CandoSys.PopWindow.error("留言失败，服务器超时");
              break;
       }
   }
   else
   {
       CandoSys.PopWindow.error(CandoSys.ErrInfo.catcherror);
   }
};
CandoSys.Channel=
{
   number:
   {
      /*2：分享剧评/随笔,4：分享资讯,6：分享活动,10：分享相册(空相册不显示分享按钮),11：分享图片,15：分享专题,17：分享话题,18：分享演出*/
      topic:17,
      infomation:4,
      essay:2,
      album:10,
      photo:11,
      special:15,
      performance:18,
      activity:6
   },
   name:
   {
      essay:"剧评/随笔",
      performance:"演出",
      activity:"活动",
      album:"相册",
      photo:"海报",
      infomation:"资讯",
      special:"专题",
      topic:"话题",
      ticket:"票务"
   },
   getname:function(channel)
   {
       var cname="";
       switch(parseInt(channel))
       {
           case 17:
               cname=CandoSys.Channel.name.topic;
               break;
           case 4:
               cname=CandoSys.Channel.name.infomation;
               break;
           case 2:
               cname=CandoSys.Channel.name.essay;
               break;
           case 10:
               cname=CandoSys.Channel.name.album;
               break;
           case 11:
               cname=CandoSys.Channel.name.photo;
               break;
           case 15:
               cname=CandoSys.Channel.name.special;
               break;
           case 18:
               cname=CandoSys.Channel.name.performance;
               break;
           case 6:
               cname=CandoSys.Channel.name.activity;
               break;
       }
       return cname;
   }
};
//好友操作
CandoSys.Friend={
    add:function(id,nickname)
    {
        CandoSys.PopWindow.show("","加为好友");
        CandoSys.PopWindow.posting();
        CandoSys.Ajax.getscript(Config_Ajax+"AddFriend.aspx","friendid="+id+"&friendnickname="+escape(nickname),false);
    }
};
//演出基类
CandoSys.Performance={};
CandoSys.Performance.Grade=
{
    domark:function(obj,star)
    {
       $("#"+obj+">img").each(function(i){if(i<star){this.src='/images/activity/new_starFull.gif';}else{this.src='/images/activity/new_starEmpty.gif';}});
       $("#"+obj+">label").html(CandoSys.Performance.Grade.grade.arr[star-1]);
       CandoSys.Performance.Grade.grade.star=star;
    },
    markout:function(obj)
    {
       $("#"+obj+">img").each(function(){this.src='/images/activity/new_starEmpty.gif';});
       $("#"+obj+">label").html(""); 
    },
    popanl:function(star,type)
    {
       CandoSys.PopWindow.show(CandoTemplate.Performance.Grade(),"作品评分");
       CandoSys.Performance.Grade.domark("divgrade",star);
       if(typeof type !="undefined")
       {
         CandoSys.Performance.Grade.grade.type=type;
       }
       if(typeof star !="undefined")
       {
          CandoSys.Performance.Grade.grade.star=star;
       }
    },
    post:function(type,sortid,content)
    {
      if(typeof type !="undefined")
      {
        CandoSys.Performance.Grade.grade.type=type;
      }
      if(CandoSys.Performance.Grade.grade.star==0)
      {
         alert("请您评分");
         return;
      }
      CandoSys.PopWindow.posting("正在提交评分，请勿刷新...");
      CandoSys.Ajax.getscript(Config_Ajax+"PerformanceGrade.aspx","star="+CandoSys.Performance.Grade.grade.star+"&type="+CandoSys.Performance.Grade.grade.type+"&activityid="+Page_PerformanceID+"&worksid="+Page_WorksID+"&sortid="+sortid+"&content="+escape(content),false);
    },
    myvote:function(starArr,actionArr,starmark,actionmark,myid)
    {
       var starRead=parseInt($("#starread").text())+actionArr[0];
       var starThink=parseInt($("#starthink").text())+actionArr[1];
       var starTxt1=parseInt($("#startxt1").text())+starArr[0];
       var starTxt2=parseInt($("#startxt2").text())+starArr[1];
       var starTxt3=parseInt($("#startxt3").text())+starArr[2];
       var starTxt4=parseInt($("#startxt4").text())+starArr[3];
       var starTxt5=parseInt($("#startxt5").text())+starArr[4];
       var starvotecount=starRead+starThink;
       if(isNaN(starvotecount)) starvotecount=0;
       if(starvotecount==0)
       {
           piont1="0%";
           piont2="0%";
           piont3="0%";
           piont4="0%";
           piont5="0%";
       }
       else
       {
           piont1=((starTxt1/starvotecount)*100).toString().substring(0,4)+"%";
           piont2=((starTxt2/starvotecount)*100).toString().substring(0,4)+"%";
           piont3=((starTxt3/starvotecount)*100).toString().substring(0,4)+"%";
           piont4=((starTxt4/starvotecount)*100).toString().substring(0,4)+"%";
           piont5=((starTxt5/starvotecount)*100).toString().substring(0,4)+"%";
       }
       $("#starimg1").css("width",piont1);
       $("#starimg2").css("width",piont2);
       $("#starimg3").css("width",piont3);
       $("#starimg4").css("width",piont4);
       $("#starimg5").css("width",piont5);
       $("#startxt1").text(starTxt1);
       $("#startxt2").text(starTxt2);
       $("#startxt3").text(starTxt3);
       $("#startxt4").text(starTxt4);
       $("#startxt5").text(starTxt5);
       $("#starread").text(starRead);
       $("#starthink").text(starThink);
       $("#MyVotePanl_Link").attr("src","/images/activity/update.gif");
       $("#MyVotePanl_Link").attr("class","imgGrade");
       $("#MyVotePanl_Link").bind("click",function(){CandoSys.Performance.Grade.popanl(starmark,actionmark);return false;});
       var userstr=new StringBuffer();
       userstr.append("<li class=\"user_list\">");
       userstr.append("<a href=\""+Config_SiteSpace+"/"+UserData.id+"\" target=\"_blank\"><img src=\""+UserData.headerimg.replace("headimg/little","headimg")+"\" /></a><br />");
       userstr.append("<a href=\""+Config_SiteSpace+"/"+UserData.id+"\" target=\"_blank\" class=\"link_blue\">"+UserData.nickname+"</a></li>");
       var seelength=$("#PageWorksSee>li").length;
       var tinklength=$("#PageWorksThink>li").length;
      
       if(_CallBack.SignInfo=='PerGradeSuccess')
       {
           if(CandoSys.Performance.Grade.grade.type==0)
           {
               if(seelength==21)
               {
                   $("#PageWorksSee>li").eq(20).css("display","none");
               }
               $("#PageWorksSee").prepend(userstr.toString());
           }
           else
           {
               if(tinklength==21)
               {
                   $("#PageWorksThink>li").eq(20).css("display","none");
               }
               $("#PageWorksThink").prepend(userstr.toString());
           }
       }
       else
       {
           $.getScript(Config_Ajax+"GetGrade.aspx?activityid="+Page_PerformanceID+"&worksid="+Page_WorksID+"&r="+Math.random(),
           function()
           {
              if(typeof _CallBack!="undefined")
              {
                 if(_CallBack.SignInfo=='Success')
                 {
                     $("#PageWorksSee").html(_CallBack.See);
                     $("#PageWorksThink").html(_CallBack.Think);
                 }
              }
           }
           );
       }
    },
    init:function(starArr,actionArr)
    {
       var starRead=parseInt(actionArr[0]);
       var starThink=parseInt(actionArr[1]);
       var starTxt1=parseInt(starArr[0]);
       var starTxt2=parseInt(starArr[1]);
       var starTxt3=parseInt(starArr[2]);
       var starTxt4=parseInt(starArr[3]);
       var starTxt5=parseInt(starArr[4]);
       var starvotecount=starRead+starThink;
       if(isNaN(starvotecount)) starvotecount=0;
       if(starvotecount==0)
       {
           piont1="0%";
           piont2="0%";
           piont3="0%";
           piont4="0%";
           piont5="0%";
       }
       else
       {
           piont1=((starTxt1/starvotecount)*100).toString().substring(0,4)+"%";
           piont2=((starTxt2/starvotecount)*100).toString().substring(0,4)+"%";
           piont3=((starTxt3/starvotecount)*100).toString().substring(0,4)+"%";
           piont4=((starTxt4/starvotecount)*100).toString().substring(0,4)+"%";
           piont5=((starTxt5/starvotecount)*100).toString().substring(0,4)+"%";
       }
       $("#starimg1").css("width",piont1);
       $("#starimg2").css("width",piont2);
       $("#starimg3").css("width",piont3);
       $("#starimg4").css("width",piont4);
       $("#starimg5").css("width",piont5);
       $("#startxt1").text(starTxt1);
       $("#startxt2").text(starTxt2);
       $("#startxt3").text(starTxt3);
       $("#startxt4").text(starTxt4);
       $("#startxt5").text(starTxt5);
       $("#starread").text(starRead);
       $("#starthink").text(starThink);
    },
    reloadpage:function()
    {
        window.top.location.reload();
    },
    grade:{arr:["很差","较差","还行","推荐","力荐"],type:0,star:0}
};
//演出讨论
CandoSys.Performance.Discuss=
{
     init:function(worksid,activityid,sortid)
     {
        CandoSys.PopWindow.show(CandoTemplate.Discuss(worksid,activityid,sortid),"发表话题");
     },
     add:function(worksid,activityid,sortid,title,content)
     {
         CandoSys.PopWindow.posting("正在提交话题，请勿刷新...");
         CandoSys.Ajax.ajax("post",Config_Ajax+"DiscussAdd.aspx","worksid="+worksid+"&activityid="+activityid+"&sortid="+sortid+"&title="+escape(title)+"&content="+escape(content));
     }
};
//发表剧评
CandoSys.Performance.ReView=function()
{
     CandoSys.PopWindow.show(CandoTemplate.ReView(),'发表剧评',650);
};

//增加游戏www里
CandoSys.Performance.ReGuessView=function()
{
     CandoSys.PopWindow.show(CandoTemplate.ReGuessView(),'创建题目',650);
};
//空间基类
CandoSys.Space={};
//增加游戏空间里
CandoSys.Space.ReGuessView=function()
{
     CandoSys.PopWindow.show(CandoTemplate.ReSpaceGuessView(),'创建题目',650);
};

//游戏基类
CandoSys.Game={};
CandoSys.Game.Guess={
    GuessQuality:function(userid,guessid,type)
    {
        CandoSys.PopWindow.show("","顶踩数据提交中...");
        CandoSys.PopWindow.posting();
        $.getScript(Config_SiteDefault+"/Ajax/guessquality.aspx?uid="+userid+"&gid="+guessid+"&t="+type, 
        function()
       {
          if(typeof _CallBack!="undefined")
          {
             if(_CallBack.SignInfo=='UpMessage')
             {
                document.getElementById("lblUpNum").innerText=parseInt(document.getElementById("lblUpNum").innerText)+1;
             }
             if(_CallBack.SignInfo=='DownMessage')
             {
                document.getElementById("lblDownNum").innerText=parseInt(document.getElementById("lblDownNum").innerText)+1;
             }
             CandoSys.DisposeInfo(_CallBack);
          }
           CandoSys.DisposeInfo(_CallBack);
       }
           );
    }  
};






CandoSys.Group=
{
    //增加圈子
    CreateGroup:function()
    {
         CandoSys.PopWindow.show(CandoTemplate.CreateGroup(),'创建圈子',650);
    },
    //从空间来增加圈子
    SpaceCreateGroup:function()
    {
         CandoSys.PopWindow.show(CandoTemplate.SpaceCreateGroup(),'创建圈子',650);
    },
    //圈子隐藏提示信息
    HiddenGroup:function(groupid)
    {
         CandoSys.PopWindow.show(CandoTemplate.HiddenGroup(groupid),'私密圈子提示信息',350,true);
    },
    SendMsg:function(usersid,groupid)
    {
     CandoSys.PopWindow.show(CandoTemplate.SendMsg(usersid,groupid),'发站内信息',650);
    },
    //做文明观众话题留言
    Notes:function(topicid,userid)
    {
        CandoSys.PopWindow.show(CandoTemplate.Notes(topicid,userid),'发表留言');
    },
    NotesAdd:function(topicid,userid,content)
    {
        CandoSys.PopWindow.posting("正在提交留言，请勿刷新...");
        CandoSys.Ajax.getscript(Config_Ajax+"NotesAdd.aspx","topicid="+topicid+"&userid="+userid+"&content="+escape(content),false);
        window.top.location.reload();
    }
};
//分享基类
CandoSys.Share=
{
   init:function(channel,infoid,authorid,title,url,json)
   {
       CandoSys.Share.sharevalue[0]=channel;
       CandoSys.Share.sharevalue[1]=infoid;
       CandoSys.Share.sharevalue[2]=authorid;
       CandoSys.Share.sharevalue[3]=title;
       CandoSys.Share.sharevalue[4]=url;
       CandoSys.Share.sharevalue[5]=json;
       CandoSys.PopWindow.show(CandoTemplate.Share(),"分享给我的好友");
   },
   post:function()
   {
       CandoSys.PopWindow.posting();
       CandoSys.Ajax.getscript(Config_Ajax+"Share.aspx","channel="+CandoSys.Share.sharevalue[0]+"&infoid="+CandoSys.Share.sharevalue[1]+"&authorid="+CandoSys.Share.sharevalue[2]+"&title="+encodeURIComponent(CandoSys.Share.sharevalue[3])+"&url="+encodeURIComponent(CandoSys.Share.sharevalue[4])+"&des="+encodeURIComponent($("#Share_Txt_Des").val().ReplaceHtml())+"&"+CandoSys.Ajax.param(CandoSys.Share.sharevalue[5]),false);
   },
   sharevalue:[0,0,0,"","",{}]
};
//收藏
CandoSys.Share.Collection=
{
    add:function(channel,infoid,authorid,title,url,photo)
    {
        if(authorid==UserData.id)
        {
           CandoSys.PopWindow.error(CandoSys.ErrInfo.collectionself);
           return;
        }
        CandoSys.PopWindow.posting();
        CandoSys.Ajax.getscript(Config_Ajax+"Collection.aspx","infoid="+infoid+"&channel="+channel+"&authorid="+authorid+"&title="+encodeURIComponent(title)+"&url="+encodeURIComponent(url)+"&photo="+photo,false);
    }
    
};
//发送邮件
CandoSys.Share.Email=
{
    send:function(address,channel,title,url)
    {
        if(Fempty(address))
        {
           address=$("#Share_Txt_Email").val();
        }
        CandoSys.PopWindow.posting();
        $.getScript(Config_Ajax+"SendEmail.aspx?address="+encodeURIComponent(address)+"&title="+ encodeURIComponent(title)+"&channel="+encodeURIComponent(channel)+"&url="+encodeURIComponent(url)+"&r="+Math.random(),function()
            {
               CandoSys.DisposeInfo(_CallBack);
            });
    }
};
CandoSys.Invite=
{
    sendMail:function(toEmail)
    {
        CandoSys.PopWindow.show("","发送邮件");
        CandoSys.PopWindow.posting();
        CandoSys.Ajax.getscript(Config_Ajax+"InviteMail.aspx","Email="+escape(toEmail),false);
    },
    sendSpreadMail:function(toEmail,SpreadInfoType,SpreadInfoId)
    {
        CandoSys.PopWindow.show("","发送邮件");
        CandoSys.PopWindow.posting();
        CandoSys.Ajax.getscript(Config_Ajax+"SpreadMail.aspx","Email="+escape(toEmail)+"&Type="+SpreadInfoType+"&Id="+SpreadInfoId,false);
    },
    sendGroupMail:function(toEmail,GroupId)
    {
        CandoSys.PopWindow.show("","发送邮件");
        CandoSys.PopWindow.posting();
        CandoSys.Ajax.getscript(Config_Ajax+"GroupMail.aspx","Action=Mail&Email="+escape(toEmail)+"&GroupId="+GroupId,false);
    },
    sendGroupMessage:function(UserId,GroupId)
    {
        CandoSys.PopWindow.show("","发送站内短信");
        CandoSys.PopWindow.posting();
        CandoSys.Ajax.getscript(Config_Ajax+"GroupMail.aspx","Action=Msg&UserId="+UserId+"&GroupId="+GroupId,false);
    }
}
//上传文件类型
CandoSys.UploadFile=
{
     activity:function(id)
     {
         CandoSys.UploadFile.catchvalue[0]=id;
         CandoSys.PopWindow.show(CandoTemplate.UploadFile.Activity(),"上传图片");
     },
     catchvalue:[0]
};
//消息处理
CandoSys.Message=
{
    init:function(acceptid,acceptname)
    {
       CandoSys.PopWindow.show(CandoTemplate.Message.send(acceptid,acceptname),"发送信息给好友");
       if(Fempty(acceptid))
       {
          CandoSys.PopWindow.error("没有初始化消息接受者信息");
       }
    },
    send:function(acceptid,title,content)
    {
        CandoSys.PopWindow.posting();
        CandoSys.Ajax.getscript(Config_Ajax+"SendMsg.aspx","acceptid="+acceptid+"&title="+encodeURIComponent(title)+"&content="+encodeURIComponent(content)+"&r="+Math.random(),false)
    }
};
//投票
CandoSys.Vote={
   essay:function(essayid,authorid)
   {
      CandoSys.PopWindow.show("","剧评/随笔推荐");
      if(Fempty(essayid))
      {
         CandoSys.PopWindow.error("无法确定剧评/随笔信息");
         return;
      }
      if(!Fempty(authorid))
      {
          if(authorid==UserData.id)
          {
              CandoSys.PopWindow.error(CandoSys.ErrInfo.essayvoteself);
              return false;
          }
      }
      CandoSys.PopWindow.posting();
      CandoSys.Ajax.getscript(Config_Ajax+"EssayVote.aspx","essayid="+essayid+"&authorid="+authorid,false);
   },
   essaysuc:function()
   {//该方法是修改投票数量
        if(Fid("EssayVoteCount"))
        {
             Fid("EssayVoteCount").innerText=parseInt(Fid("EssayVoteCount").innerText)+1;
        }
   },
   canfans:function(userid)
   {
      CandoSys.PopWindow.show("","宽友投票");
      if(Fempty(userid))
      {
         CandoSys.PopWindow.error("无法确定投票人信息");
         return;
      }
      if(userid==UserData.id)
      {
          CandoSys.PopWindow.error(CandoSys.ErrInfo.canfansvoteself);
          return;
      }
      CandoSys.PopWindow.posting();
      CandoSys.Ajax.getscript(Config_Ajax+"CanfansVote.aspx","userid="+userid,false);
   }
};
//回复
CandoSys.Comment=
{
   add:function(channel,infoid,content)
   {
      content=content.RemoveUnsafeHtml();
       CandoSys.Comment.catchvalue[0]=content;
       CandoSys.PopWindow.show();
       CandoSys.PopWindow.posting();
       CandoSys.Ajax.getscript(Config_Ajax+"comment.aspx","channel="+channel+"&infoid="+infoid+"&content="+encodeURIComponent(content),false);
   },
   myComment:function()
   {
      var template="";
      if(Fid("CommentTemp"))
      {
          template=Fid("CommentTemp").innerHTML;
          template=template.replace(/\$UserSpaceUrl\$/ig,Config_SiteSpace+"/"+_CallBack.UserId);
          template=template.replace(/\$UserHeaderImg\$/ig,_CallBack.HeaderImg.replace("headimg/little","headimg"));
          template=template.replace(/\$UserNickName\$/ig,_CallBack.NickName);
          template=template.replace(/\$Remark\$/ig,CandoSys.Comment.catchvalue[0].replace(/\n/ig,"<br/>"));
          template=template.replace(/\$Date\$/ig,_CallBack.Date);
          $("#CommentContainer").append(template);
      }
      if(Fid("CommentCount"))
      {
          var _commentcount=Fid("CommentCount").innerText;
          Fid("CommentCount").innerText=parseInt(_commentcount)+1;
      }
      CandoSys.Comment.catchvalue[1]=_CallBack.Date;
   },
   check:function(obj)
   {
       if($.trim($("#"+obj).val())=="")
       {
           alert("请输入留言内容");
           return false;
       }
       if($("#"+obj).val().length>200)
       {
          alert("留言内容不能超过200个字");
           return false;
       }
//       if(CandoSys.Comment.catchvalue[1]!="")
//       {
//            var redate=/^(\d{4})-(\d{1,2})-(\d{1,2})\s(\d{1,2}):(\d{1,2}):(\d{1,2})/;
//            var odate=CandoSys.Comment.catchvalue[1].match(redate);
//            var date=new Date();
//            if(date.getSeconds()odate[6])
//            {
//              alert("您留言的速度太快了");
//              return false;
//            }
//       }
       return true;
   },
   catchvalue:["",""]
};
//登录
CandoSys.UserLogin=
{
     init:function()
     {
          CandoSys.Ajax.getscript(Config_Ajax+"GetUserLogin.aspx","",false);
     },
     login:function(u,p)
     {
          CandoSys.Ajax.getscript(Config_Ajax+"UserLoginIn.aspx","U="+u+"&P="+p,false);
     },
     logout:function()
     {
          CandoSys.Ajax.getscript(Config_Ajax+"UserLoginOut.aspx","",false);
     },
     setuserdata:function()
     {
       UserData.id=_CallBack.id;
       UserData.headerimg=_CallBack.headerimg;
       UserData.nickname=_CallBack.nickname;
       UserData.msgcount=_CallBack.msgcount;
       UserData.userflag=_CallBack.userflag; 
       UserData.vipimg=_CallBack.vipimg;  
     },
     setloginpanl:function()
     {
         if(parseInt(UserData.id)==0)
         {
             $("#GlobalUserLogined").css("display","none");
             $("#GlobalUserLogin").css("display","block");
         }
         else
         {
             $("#GlobalUserLogined_MyHeaderImg").attr("src",UserData.headerimg.replace("headimg/little","headimg"));
             //$("#GlobalUserLogined_MyHeaderImg").attr("src",UserData.vipimg);
             $("#GlobalUserLogined_MyNickName").text(UserData.nickname);
             $("#GlobalUserLogined_MyMsgCount").text(UserData.msgcount);
             $("#GlobalUserLogined_MySpace").attr("href",Config_SiteSpace+"/"+UserData.id);
            
             if(parseInt(UserData.userflag)==0)
             {
                $("#GlobalUserLogined_Person").css("display","block");
                $("#GlobalUserLogined_Group").css("display","none");
             }
             else
             {
                $("#GlobalUserLogined_Person").css("display","none");
                $("#GlobalUserLogined_Group").css("display","block");
             }
             $("#GlobalUserLogin").css("display","none");
             $("#GlobalUserLogined").css("display","block");
             if(UserData.vipimg=="")
             {
                $("#GlobalUserLogined_VipImg").css("display","none");
            }
            else
            {
                $("#GlobalUserLogined_VipImg").css("display","inline-block");
                $("#GlobalUserLogined_VipImg").attr("src",UserData.vipimg);
            }
         }
     }
};
CandoSys.Activity={};
CandoSys.Activity.Sign=
{
    cache:{activityid:0,signcount:"",mobile:"",content:""},
    init:function(activityid,signcount,mobile,content)
    {
        CandoSys.Activity.Sign.cache.activityid=activityid;
        CandoSys.Activity.Sign.cache.signcount=signcount;
        CandoSys.Activity.Sign.cache.mobile=mobile;
        CandoSys.Activity.Sign.cache.content=content;
        CandoSys.PopWindow.show(CandoTemplate.ActivitySign(),"活动报名");
        $("#Sign_Txt_Count").val(CandoSys.Activity.Sign.cache.signcount);
        $("#Sign_Txt_Mobile").val(CandoSys.Activity.Sign.cache.mobile);
        $("#Sign_Txt_Content").val(CandoSys.Activity.Sign.cache.content);
        if(signcount!="")
        {
            $("#SignBtnDel").attr("value","删除");
            $("#SignBtnDel").bind("click",function(){CandoSys.Activity.Sign.del();});
        }
    },
    add:function()
    {
       CandoSys.PopWindow.posting("报名提交中，请稍候...");
       CandoSys.Ajax.getscript(Config_Ajax+"ActivitySign.aspx","activityid="+CandoSys.Activity.Sign.cache.activityid+"&signcount="+CandoSys.Activity.Sign.cache.signcount+"&mobile="+CandoSys.Activity.Sign.cache.mobile+"&content="+encodeURIComponent(CandoSys.Activity.Sign.cache.content),false);
    },
    del:function()
    {
       CandoSys.PopWindow.posting("报名删除中，请稍候...");
       CandoSys.Ajax.getscript(Config_Ajax+"ActivitySign.aspx","activityid="+CandoSys.Activity.Sign.cache.activityid+"&del=1",false);
    }
};
CandoSys.Activity.Interests=
{
    cache:{activityid:0,authorid:0,mark:1,sex:0,realname:"",mobile:"",mannumber:1,content:"",infodate:""},
    init:function(activityid,authorid,mark,sex,realname,mobile,mannumber,content,infodate)
    {
       if(typeof mark=="undefined")
       {
          mark=1;
       }
       if(typeof sex=="undefined")
       {
          sex=1;
       }
       if(typeof mannumber=="undefined")
       {
          mannumber=1;
       }
       if(typeof infodate=="undefined")
       {
           infodate="1980-01-01";
       }
       CandoSys.Activity.Interests.cache.activityid=activityid;
       CandoSys.Activity.Interests.cache.authorid=authorid;
       CandoSys.Activity.Interests.cache.mark=mark;
       CandoSys.Activity.Interests.cache.sex=sex;
       CandoSys.Activity.Interests.cache.realname=realname;
       CandoSys.Activity.Interests.cache.mobile=mobile;
       CandoSys.Activity.Interests.cache.mannumber=mannumber;
       CandoSys.Activity.Interests.cache.content=content;
       CandoSys.Activity.Interests.cache.infodate=infodate;
        
       if(parseInt(mark)==1)
       {
          CandoSys.PopWindow.show("","活动");
          CandoSys.Activity.Interests.add();
       }
       else
       {
           CandoSys.PopWindow.show(CandoTemplate.ActivityInterests(),"活动报名");
           if(parseInt(sex)==1)
           {
             document.getElementsByName("Interests_Radio_Sex")[0].checked=true;
           }
           else
           {
              document.getElementsByName("Interests_Radio_Sex")[1].checked=true;
           }
         
              $("#Interests_Txt_RealName").val(CandoSys.Activity.Interests.cache.realname);
              $("#Interests_Txt_Mobile").val(CandoSys.Activity.Interests.cache.mobile);
              $("#Interests_Txt_manNum").val(CandoSys.Activity.Interests.cache.mannumber);
              $("#Interests_Txt_Content").val(CandoSys.Activity.Interests.cache.content);
              $("#Interests_Txt_InfoDate").val(CandoSys.Activity.Interests.cache.infodate);   
       }
    },
    add:function()
    {
       CandoSys.PopWindow.posting("提交中，请稍候...");
       CandoSys.Ajax.getscript(Config_Ajax+"ActivityInterests.aspx","activityid="+CandoSys.Activity.Interests.cache.activityid+"&authorid="+CandoSys.Activity.Interests.cache.authorid+"&mark="+CandoSys.Activity.Interests.cache.mark+"&sex="+CandoSys.Activity.Interests.cache.sex+"&mobile="+CandoSys.Activity.Interests.cache.mobile+"&realname="+encodeURIComponent(CandoSys.Activity.Interests.cache.realname)+"&mannumber="+CandoSys.Activity.Interests.cache.mannumber+"&content="+encodeURIComponent(CandoSys.Activity.Interests.cache.content)+"&infodate="+encodeURIComponent(CandoSys.Activity.Interests.cache.infodate),false);
    }
};
//CandoSys.Activity.Interests=
//{
//    cache:{activityid:0,authorid:0,mark:1,sex:0,realname:"",mobile:"",mannumber:1,content:""},
//    init:function(activityid,authorid,mark,sex,realname,mobile,mannumber,content)
//    {
//       if(typeof mark=="undefined")
//       {
//          mark=1;
//       }
//       if(typeof sex=="undefined")
//       {
//          sex=1;
//       }
//       if(typeof mannumber=="undefined")
//       {
//          mannumber=1;
//       }
//       CandoSys.Activity.Interests.cache.activityid=activityid;
//       CandoSys.Activity.Interests.cache.authorid=authorid;
//       CandoSys.Activity.Interests.cache.mark=mark;
//       CandoSys.Activity.Interests.cache.sex=sex;
//       CandoSys.Activity.Interests.cache.realname=realname;
//       CandoSys.Activity.Interests.cache.mobile=mobile;
//       CandoSys.Activity.Interests.cache.mannumber=mannumber;
//       CandoSys.Activity.Interests.cache.content=content;
//       
//        
//       if(parseInt(mark)==1)
//       {
//          CandoSys.PopWindow.show("","活动");
//          CandoSys.Activity.Interests.add();
//       }
//       else
//       {
//           CandoSys.PopWindow.show(CandoTemplate.ActivityInterests(),"活动报名");
//           if(parseInt(sex)==1)
//           {
//             document.getElementsByName("Interests_Radio_Sex")[0].checked=true;
//           }
//           else
//           {
//              document.getElementsByName("Interests_Radio_Sex")[1].checked=true;
//           }
//         
//              $("#Interests_Txt_RealName").val(CandoSys.Activity.Interests.cache.realname);
//              $("#Interests_Txt_Mobile").val(CandoSys.Activity.Interests.cache.mobile);
//              $("#Interests_Txt_manNum").val(CandoSys.Activity.Interests.cache.mannumber);
//              $("#Interests_Txt_Content").val(CandoSys.Activity.Interests.cache.content);  
//       }
//    },
//    add:function()
//    {
//       CandoSys.PopWindow.posting("提交中，请稍候...");
//       CandoSys.Ajax.getscript(Config_Ajax+"ActivityInterests.aspx","activityid="+CandoSys.Activity.Interests.cache.activityid+"&authorid="+CandoSys.Activity.Interests.cache.authorid+"&mark="+CandoSys.Activity.Interests.cache.mark+"&sex="+CandoSys.Activity.Interests.cache.sex+"&mobile="+CandoSys.Activity.Interests.cache.mobile+"&realname="+encodeURIComponent(CandoSys.Activity.Interests.cache.realname)+"&mannumber="+CandoSys.Activity.Interests.cache.mannumber+"&content="+encodeURIComponent(CandoSys.Activity.Interests.cache.content),false);
//    }
//};
CandoSys.Delete=
{
    init:function(channel,mainId,replyId)
    {
       CandoSys.PopWindow.show("","删除内容");
       CandoSys.PopWindow.posting("删除中，请稍候...");
       CandoSys.Ajax.getscript(Config_Ajax+"DeleteData.aspx","channel="+channel+"&mid=" + mainId + "&id="+replyId,false);
    }
};
CandoSys.Voucher=
{
    //搜索代金卷编号
    SearchVoucherNoByUid:function()
    {
        var voucherNo = $("#searchVoucherNo").val();
        if(voucherNo!="")
        {
            Fid("divVoucherNo").style.display="none";
            Fid("divVoucherNo").innerHTML="";
            return;
        }
        $.getScript(Config_Ajax+"/GetVoucherNo.aspx",
             function()
             {
                if(typeof _CallBack!="undefined")
                {
                    if(_CallBack.SignInfo!="<ul></ul>")
                    {
                        Fid("divVoucherNo").style.display="";
                        Fid("spanuser").style.position="relative";
                        Fid("divVoucherNo").innerHTML=_CallBack.SignInfo;
                    }
                    else
                    {
                       Fid("divVoucherNo").style.display="none";
                       Fid("divVoucherNo").className="";
                       Fid("spanuser").style.position="";
                    }
                }
             }
        );
    },
    //设置代金卷编号
    SetVoucherNo:function(voucherNo)
    {
        Fid("searchVoucherNo").value = voucherNo; 
        Fid("divVoucherNo").style.display="none";
        Fid("spanuser").style.position="";
    },
    //焦点失去后不显示
    SetBlurVoucher:function()
    {
        Fid("divVoucherNo").style.display="none";
        Fid("spanuser").style.position="";
    },
    //验证代金券编号
    ValidataVoucherNo:function(oid)
    {
        var voucherNo = $("#searchVoucherNo").val();
        if(voucherNo=="")
        {
            Fid("divValidation").style.display="none";
            Fid("divValidation").innerHTML="请输入代金券编号进行验证。";
            return;
        }
        else
        {
            Fid("divValidation").style.display="none";
            Fid("divValidation").innerHTML="验证中，请稍候。。。";
        }
        $.getScript(Config_Ajax+"/ValidataVoucherNo.aspx?voucherNo=" + voucherNo + "&oid=" + oid,
             function()
             {
                if(typeof _CallBack!="undefined")
                {
                    if(_CallBack.SignInfo!="<ul></ul>")
                    {
                        Fid("divValidation").style.display="";
                        Fid("divValidation").innerHTML=_CallBack.SignInfo;
                    }
                    else
                    {
                       Fid("divValidation").style.display="";
                       Fid("divValidation").innerHTML="验证错误，请检查输入。";
                    }
                }
             }
        );
    },
    //兑换代金券
    ChangeVoucherNo:function(oid,uid,UserAmount)
    {
        $.getScript(Config_Ajax+"ChangeVoucher.aspx?oid=" + oid + "&userid=" + uid + "&UserAmount=" + UserAmount,
            function()
            {
                if(typeof _CallBack!="undefined")
                {
                    if(_CallBack.SignInfo != "")
                    {
                        Fid("hdVoucherNo").value = _CallBack.SignInfo;
                        Fid("spMain").innerHTML = "您已经成功兑换了金额<span class=bold>" + UserAmount + "</span>元的代金券：" + _CallBack.SignInfo + "。请您点击下一步！";
                    }
                }
            }
        );
    }
};