﻿// JScript 文件

if(typeof(JavaScript)=="undefined")
{
    var JavaScript = new Object();
};

//创建命名空间的方法


JavaScript.createNameSpace = function(NameSpace)
{
    var NameSpaceArray = NameSpace.split(".");
    for(var i=0;i<NameSpaceArray.length;i++)
    {
        var s = "";
        for(var j=0;j<=i;j++)
        {
            s = s + "."+NameSpaceArray[j];
        }
        if(s.length>0){
            s = s.substring(1,s.length);
            var js = "if(typeof("+s+")=='undefined') "+s+" = new Object();";
            eval(js);           
        }
    }
};


//*******************************************************************************
JavaScript.createNameSpace("JavaScript.Public");
    JavaScript.Public.Split = function(str,dv)
    {
	    var temp=str;
	    var items=new Array();
	    var i=0;
	    while(temp.indexOf(dv)!=-1)
	    {
		    var foot = temp.indexOf(dv);
		    items[i]=temp.substr(0,foot);
		    temp=temp.substr(parseInt(foot)+dv.length);
		    i++;
	    }
	    if(str!="")items[i]=temp;
	    return items;
    }

    JavaScript.Public.SubStringleft = function(lefts) 
    {
      
     return false; 
    }
    
    //校验是否Decimal数字(整数)
    JavaScript.Public.CheckDecimal = function(strDecimal) 
    {
        var patrn=/^-?[0-9]{0,20}.?[0-9]{1,20}$/; 
        if (!patrn.exec(strDecimal)) return false ;
        else return true ;
    }
    
    //校验是否整数)
    JavaScript.Public.CheckInteger = function(strDecimal) 
    {
        var patrn=/^-?[0-9]{0,20}$/; 
        if (!patrn.exec(strDecimal)) return false ;
        else return true ;
    }
    
    //隐藏显示层


    JavaScript.Public.AutoHide = function(div) 
    {
        var oDiv=document.getElementById(div);

        if(oDiv.style.display=="none")
        {
            oDiv.style.display="";
        }
        else
        {
            oDiv.style.display="none";
        }
    }
    
    //换文字


    JavaScript.Public.AutoText = function(oDiv,text1,text2) 
    {
        var html=oDiv.innerHTML;
        if(html==text1)html=text2;
        else html=text1;
        oDiv.innerHTML=html;
    }
    
    /*得到网页元素相对于body的x方向绝对坐标*/
    JavaScript.Public.getElementX = function(ElementId)
    {
        var w3c=(document.getElementById)? true:false;
        var agt=navigator.userAgent.toLowerCase();
        var ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) && (agt.indexOf("omniweb") == -1));
        var ie5=(w3c && ie)? true : false;
        var ns6=(w3c && (navigator.appName=="Netscape"))? true: false;
        var op8=(navigator.userAgent.toLowerCase().indexOf("opera")==-1)? false:true;

        var o = document.getElementById(ElementId)?document.getElementById(ElementId):ElementId;
        var nLt=0;
        var nTp=0;
        var offsetParent = o;
        while (offsetParent!=null && offsetParent!=document.body)
        {
            nLt+=offsetParent.offsetLeft;
            nTp+=offsetParent.offsetTop;
            if(!ns6)
            {
            parseInt(offsetParent.currentStyle.borderLeftWidth)>0?nLt+=parseInt(offsetParent.currentStyle.borderLeftWidth):"";
            parseInt(offsetParent.currentStyle.borderTopWidth)>0?nTp+=parseInt(offsetParent.currentStyle.borderTopWidth):"";
            }
            offsetParent=offsetParent.offsetParent;
        }
        return nLt;
    };

    /*得到网页元素相对于body的y方向绝对坐标*/
    JavaScript.Public.getElementY = function(ElementId)
    {
        var w3c=(document.getElementById)? true:false;
        var agt=navigator.userAgent.toLowerCase();
        var ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) && (agt.indexOf("omniweb") == -1));
        var ie5=(w3c && ie)? true : false;
        var ns6=(w3c && (navigator.appName=="Netscape"))? true: false;
        var op8=(navigator.userAgent.toLowerCase().indexOf("opera")==-1)? false:true;

        var o = document.getElementById(ElementId)?document.getElementById(ElementId):ElementId;
        var nLt=0;
        var nTp=0;
        var offsetParent = o;
        while (offsetParent!=null && offsetParent!=document.body)
        {
            nLt+=offsetParent.offsetLeft;
            nTp+=offsetParent.offsetTop;
            if(!ns6)
            {
            parseInt(offsetParent.currentStyle.borderLeftWidth)>0?nLt+=parseInt(offsetParent.currentStyle.borderLeftWidth):"";
            parseInt(offsetParent.currentStyle.borderTopWidth)>0?nTp+=parseInt(offsetParent.currentStyle.borderTopWidth):"";
            }
            offsetParent=offsetParent.offsetParent;
        }
        return nTp;
    };
//*******************************************************************************   
JavaScript.createNameSpace("JavaScript.Public.Window");

JavaScript.Public.Window.showSystemDialog = function(dialogId,contentInnerHtml,xPos,yPos,height,autoCloseTime)
{
    dateString = (new Date()).toString();
    if(dialogId=="")
        dialogId = "DialogId_" + dateString;    
    var innerHtml = "";
    
    var objDialog = document.getElementById(dialogId);
    if (!objDialog)
        objDialog = document.createElement("div");
    
    //innerHtml += '<div style="position:absolute; width:277px; height:187px; left:0px; top:0px; font-size:1px; background-repeat:no-repeat; z-index:0;"></div>';
    //innerHtml += '<div style="position:absolute; width:240px; height:133px; left:8px; top:7px; z-index:1; overflow:auto;">';
    //innerHtml += '<div style="width:12px; height:12px; z-index:2;"><img src="/UplifeWeb/Images/Public/close.jpg" style="cursor:pointer;" alt=""  onclick="document.getElementById(\''+dialogId+'\').style.display=\'none\';" /></div>';
    //innerHtml += '<!--内容 开始-->';
    innerHtml += contentInnerHtml;
    //innerHtml += '<!--内容 结束-->';
    //innerHtml += '</div>';
    
    
    objDialog.id = dialogId;
    var oS = objDialog.style;
    oS.display = "block";
    var top=parseInt(yPos)-parseInt(height)
    oS.top = top  + "px";
    oS.left = xPos  + "px";
    oS.margin = "0px";
    oS.padding = "0px";
    oS.width = "277px";
    oS.height = "187px";
    //oS.filter = "alpha(opacity="+alphaOpacity+")";
    //oS.opacity = alphaOpacity/100;
    //oS.MozOpacity = alphaOpacity/100;
    oS.position = "absolute";
    oS.zIndex = "999";

    objDialog.innerHTML = innerHtml;
    document.body.appendChild(objDialog); 
    
    if(autoCloseTime!=-1)
    {
        window.setTimeout("document.getElementById('"+dialogId+"').style.display='none';",autoCloseTime);
    }
    return dialogId;    
}

/*显示层对话框*/
JavaScript.Public.Window.showDialog = function(DialogInerHtml,ow,oh,w,h)
{
    var t_DiglogX,t_DiglogY,t_DiglogW,t_DiglogH;
    
    var objDialog = document.getElementById(JavaScript.Public.Window.DialogDivId);
    if (!objDialog)
        objDialog = document.createElement("div");
    t_DiglogW = ow;
    t_DiglogH = oh;
    
    /*JavaScript.Common.Window.DialogLoc(); */       
    var dde = document.documentElement;
    if (window.innerWidth)
    {
        var ww = window.innerWidth;
        var wh = window.innerHeight;
        var bgX = window.pageXOffset;
        var bgY = window.pageYOffset;
    }
    else
    {
        var ww = dde.offsetWidth;
        var wh = dde.offsetHeight;
        var bgX = dde.scrollLeft;
        var bgY = dde.scrollTop;
    }
    t_DiglogX = (bgX + ((ww - t_DiglogW)/2));
    t_DiglogY = (bgY + ((wh - t_DiglogH)/2));
    
    objDialog.id = JavaScript.Public.Window.DialogDivId;
    var oS = objDialog.style;
    oS.display = "block";
    oS.top = t_DiglogY + "px";
    oS.left = t_DiglogX + "px";
    oS.margin = "0px";
    oS.padding = "0px";
    oS.width = w + "px";
    oS.height = h + "px";
    oS.position = "absolute";
    oS.zIndex = "10000";

    objDialog.innerHTML = DialogInerHtml;
    document.body.appendChild(objDialog);  
};

/*显示进度条框*/

JavaScript.Public.Window.SmsDivId="NewSmsDivId";
JavaScript.Public.Window.showNewSms = function(count)
{
    var html="<div style=\"display:block;\"><table style=\"width:100%;text-align:center;width:120px; height:54px; background-image: url(/IMAGES/system/smsinfo.gif);\"><tr><td><a style=\"color:red;\" target=\"_blank\" href=\"http://www.uplife.com.cn/member/message/list.aspx\">您有"+count+"条新消息</a></td></tr></table></div>";
    var divsms=document.getElementById(JavaScript.Public.Window.SmsDivId);
    var autoCloseTime=5000;
    divsms.innerHTML=html;
    window.setTimeout("document.getElementById('"+JavaScript.Public.Window.SmsDivId+"').style.display='none';",autoCloseTime);
};
/*隐藏层对话框*/
JavaScript.Public.Window.hideNewSms = function()
{
    /*JavaScript.Common.Window.hideMask();*/
    var objDialog = document.getElementById(JavaScript.Public.Window.SmsDivId);
    if (objDialog) objDialog.style.display = "none";
};

JavaScript.Public.Window.showProcessBar = function()
{
    JavaScript.Public.Window.showDialog("<div id=\"UPlife_ProcessBar_DivId\" style=\"width:300px; height:60px; border:solid 1px #ff9900; background-color:#ffffff; \"><div style=\"margin-top:20px; text-align:center; font-weight:bold;\">请求正在处理中...</div></div>",300,60,124,20);
//    var oS = document.getElementById("UPlife_ProcessBar_DivId").style;
//    oS.filter = "alpha(opacity=60)";
//    oS.opacity = 60/100;
//    oS.MozOpacity = 60/100;
};
/*隐藏层对话框*/
JavaScript.Public.Window.hideDialog = function()
{
    /*JavaScript.Common.Window.hideMask();*/
//    var objDialog = document.getElementById(JavaScript.Public.Window.DialogDivId);
//    if (objDialog) objDialog.style.display = "none";
};
    
//*******************************************************************************
JavaScript.createNameSpace("JavaScript.Data");
/*
** 数据处理
**/
JavaScript.Data.HttpRequest = function()
{
    //发送请求的对象
    this.XmlHttp = this.GetHttpObject();
    this.FormDataArray = new Array();
    this.FormData = "";
    this.Url = "";
    this.Method = "";
    this.Async = true;
    this.User = "";
    this.Password = "";
};

JavaScript.Data.HttpRequest.prototype.StrCode = function(str){if(encodeURIComponent) return encodeURIComponent(str);if(escape) return escape(str);}

JavaScript.Data.HttpRequest.prototype.addFormData = function(key,value,isencode)
{
    if(this.FormDataArray.length==0)
    {
        if(isencode)
            this.FormData = key + "=" + value;
        else
            this.FormData = key + "=" + this.StrCode(value);
    }
    else
    {
        if(isencode)
            this.FormData += "&" + key + "=" + this.StrCode(value);
        else
            this.FormData += "&" + key + "=" + value;
    }

    this.FormDataArray[this.FormDataArray.length] = new Array();

    this.FormDataArray[this.FormDataArray.length-1][0] = key;
    if(isencode)
        this.FormDataArray[this.FormDataArray.length-1][1] = this.StrCode(value);
    else
        this.FormDataArray[this.FormDataArray.length-1][1] = value;
};

JavaScript.Data.HttpRequest.prototype.removeFormData = function(key)
{
    var FormDataTemp = "";
    var FormDataArrayTemp = new Array();
    
    for(var i=0;i<this.FormDataArray.length;i++)
    {
        if(this.FormDataArray[i][0]!=key)
        {
            if(i==0)
                FormDataTemp = this.FormDataArray[i][0] + "=" +this.FormDataArray[i][1];
            else
                FormDataTemp += "&" + this.FormDataArray[i][0] + "=" +this.FormDataArray[i][1];
                
            FormDataArrayTemp[FormDataArrayTemp.length] = new Array();
            FormDataArrayTemp[FormDataArrayTemp.length-1][0] = this.FormDataArray[i][0];
            FormDataArrayTemp[FormDataArrayTemp.length-1][1] = this.FormDataArray[i][1];
        }
    }
    this.FormData = FormDataTemp;
    this.FormDataArray = FormDataArrayTemp;
};

JavaScript.Data.HttpRequest.prototype.clearFormData = function()
{
    this.FormDataArray.length = 0;
    this.FormData = "";
};

JavaScript.Data.HttpRequest.prototype.GetHttpObject = function()
{
    var xmlhttp;
     
    if (window.XMLHttpRequest)
    {
	    // 在非Microsoft浏览器中创建XMLHttpRequest对象
	    xmlhttp = new XMLHttpRequest();
    }
    else if (window.ActiveXObject)
    {
	    //通过MS ActiveX创建XMLHttpRequest
	    try
	    {
	    // 尝试按新版InternetExplorer方法创建
	    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	    }
	    catch (e1)
	    {
	        // 创建请求的ActiveX对象失败
	        try
	        {
		        // 尝试按老版InternetExplorer方法创建
		        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	        }
	        catch (e2)
	        {
		        // 不能通过ActiveX创建XMLHttpRequest
	        }
	    }
    }
    return xmlhttp;
};
 
JavaScript.Data.HttpRequest.prototype.DoCallBack = function()
{
  if( this.XmlHttp )
  {
    if( this.XmlHttp.readyState == 4 || this.XmlHttp.readyState == 0 )
    {
    try{
      var oThis = this;
      this.XmlHttp.open(oThis.Method, oThis.Url);
      this.XmlHttp.onreadystatechange = function(){ oThis.ReadyStateChange(); };
      this.XmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	  this.XmlHttp.send(this.FormData);
      }
      catch(e){
        //alert(e);
      }
    }
  }
};
 
JavaScript.Data.HttpRequest.prototype.AbortCallBack = function()
{
  if( this.XmlHttp )
    this.XmlHttp.abort();
};
 
JavaScript.Data.HttpRequest.prototype.OnLoading = function()
{
  // Loading
};
 
JavaScript.Data.HttpRequest.prototype.OnLoaded = function()
{
  // Loaded
};
 
JavaScript.Data.HttpRequest.prototype.OnInteractive = function()
{
  // Interactive
};
 
JavaScript.Data.HttpRequest.prototype.OnComplete = function(responseText, responseXml)
{
  // Complete
};
 
JavaScript.Data.HttpRequest.prototype.OnAbort = function()
{
  // Abort
};
 
JavaScript.Data.HttpRequest.prototype.OnError = function(status, statusText)
{
  // Error
};
 
JavaScript.Data.HttpRequest.prototype.ReadyStateChange = function()
{
  if( this.XmlHttp.readyState == 1 )
  {
    this.OnLoading();
  }
  else if( this.XmlHttp.readyState == 2 )
  {
    this.OnLoaded();
  }
  else if( this.XmlHttp.readyState == 3 )
  {
    this.OnInteractive();
  }
  else if( this.XmlHttp.readyState == 4 )
  {
   if( this.XmlHttp.status == 0 )
      this.OnAbort();
    else if( this.XmlHttp.status == 200 && this.XmlHttp.statusText == "OK" )
      this.OnComplete(this.XmlHttp.responseText, this.XmlHttp.responseXML);
    else
      this.OnError(this.XmlHttp.status, this.XmlHttp.statusText, this.XmlHttp.responseText);   
  }
};

JavaScript.Data.HttpResponse = function()
{
    //接受数据的对象


    
    this.TextData="";
    this.SFlagItems="@PBJUD^**--";//数据行分隔符号


    this.SFlagItem="^%$^^^";//数据列分隔符号        
};

JavaScript.Data.HttpResponse.prototype.GetTextData = function(_Name)
{
    var oItems=new Array();
    oItems=JavaScript.Public.Split(this.TextData,this.SFlagItems);
    
    for(var i=0;i<oItems.length;i++)
    {
        var oItem=JavaScript.Public.Split(oItems[i],this.SFlagItem);
        if(oItem.length>0)
        {
            if(oItem[0]==_Name)return oItem[1];
        }
    }
}  

/*----------------------------------------------------------------------------以下内容为分页使用    LYT  创建于200-08-24------------------*/
JavaScript.createNameSpace("JavaScript.Common");
/*
** xmlhttp对象
**/
JavaScript.Common.HttpRequest = function()
{
    //发送请求的对象
    this.XmlHttp = this.GetHttpObject();
    this.FormDataArray = new Array();
    this.FormData = "";
    this.Url = "";
    this.Method = "";
    this.Async = true;
    this.User = "";
    this.Password = "";
};

JavaScript.Common.HttpRequest.prototype.StrCode = function(str){if(encodeURIComponent) return encodeURIComponent(str);if(escape) return escape(str);}

JavaScript.Common.HttpRequest.prototype.addFormData = function(key,value,isencode)
{
    if(this.FormDataArray.length==0)
    {
        if(isencode)
            this.FormData = key + "=" + value;
        else
            this.FormData = key + "=" + this.StrCode(value);
    }
    else
    {
        if(isencode)
            this.FormData += "&" + key + "=" + this.StrCode(value);
        else
            this.FormData += "&" + key + "=" + value;
    }

    this.FormDataArray[this.FormDataArray.length] = new Array();

    this.FormDataArray[this.FormDataArray.length-1][0] = key;
    if(isencode)
        this.FormDataArray[this.FormDataArray.length-1][1] = this.StrCode(value);
    else
        this.FormDataArray[this.FormDataArray.length-1][1] = value;
};

JavaScript.Common.HttpRequest.prototype.removeFormData = function(key)
{
    var FormDataTemp = "";
    var FormDataArrayTemp = new Array();
    
    for(var i=0;i<this.FormDataArray.length;i++)
    {
        if(this.FormDataArray[i][0]!=key)
        {
            if(i==0)
                FormDataTemp = this.FormDataArray[i][0] + "=" +this.FormDataArray[i][1];
            else
                FormDataTemp += "&" + this.FormDataArray[i][0] + "=" +this.FormDataArray[i][1];
                
            FormDataArrayTemp[FormDataArrayTemp.length] = new Array();
            FormDataArrayTemp[FormDataArrayTemp.length-1][0] = this.FormDataArray[i][0];
            FormDataArrayTemp[FormDataArrayTemp.length-1][1] = this.FormDataArray[i][1];
        }
    }
    this.FormData = FormDataTemp;
    this.FormDataArray = FormDataArrayTemp;
};

JavaScript.Common.HttpRequest.prototype.clearFormData = function()
{
    this.FormDataArray.length = 0;
    this.FormData = "";
};

JavaScript.Common.HttpRequest.prototype.GetHttpObject = function()
{
    var xmlhttp;
     
    if (window.XMLHttpRequest)
    {
	    // 在非Microsoft浏览器中创建XMLHttpRequest对象
	    xmlhttp = new XMLHttpRequest();
    }
    else if (window.ActiveXObject)
    {
	    //通过MS ActiveX创建XMLHttpRequest
	    try
	    {
	    // 尝试按新版InternetExplorer方法创建
	    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	    }
	    catch (e1)
	    {
	        // 创建请求的ActiveX对象失败
	        try
	        {
		        // 尝试按老版InternetExplorer方法创建
		        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	        }
	        catch (e2)
	        {
		        // 不能通过ActiveX创建XMLHttpRequest
	        }
	    }
    }
    return xmlhttp;
};
 
JavaScript.Common.HttpRequest.prototype.DoCallBack = function()
{ 
  if( this.XmlHttp )
  {
    if( this.XmlHttp.readyState == 4 || this.XmlHttp.readyState == 0 )
    {
    try{
      var oThis = this;
      this.XmlHttp.open(oThis.Method, oThis.Url);
      this.XmlHttp.onreadystatechange = function(){ oThis.ReadyStateChange(); };
      this.XmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	  this.XmlHttp.send(this.FormData);
      }
      catch(e){
        //alert(e);
      }
    }
  }
};
 
JavaScript.Common.HttpRequest.prototype.AbortCallBack = function()
{
  if( this.XmlHttp )
    this.XmlHttp.abort();
};
 
JavaScript.Common.HttpRequest.prototype.OnLoading = function()
{
  // Loading
  //alert('1');
};
 
JavaScript.Common.HttpRequest.prototype.OnLoaded = function()
{
  // Loaded
  //alert('2');
};
 
JavaScript.Common.HttpRequest.prototype.OnInteractive = function()
{
  // Interactive
};
 
JavaScript.Common.HttpRequest.prototype.OnComplete = function(responseText, responseXml)
{
alert(responseText);
  // Complete
};
 
JavaScript.Common.HttpRequest.prototype.OnAbort = function()
{
  // Abort
};
 
JavaScript.Common.HttpRequest.prototype.OnError = function(status, statusText)
{
  // Error
};
 
JavaScript.Common.HttpRequest.prototype.ReadyStateChange = function()
{
  if( this.XmlHttp.readyState == 1 )
  {
    this.OnLoading();
  }
  else if( this.XmlHttp.readyState == 2 )
  {
   this.OnLoaded();
  }
  else if( this.XmlHttp.readyState == 3 )
  {
   this.OnInteractive();
  }
  else if( this.XmlHttp.readyState == 4 )
  {
   if( this.XmlHttp.status == 0 )
      this.OnAbort();
    else if( this.XmlHttp.status == 200 && this.XmlHttp.statusText == "OK" )
        this.OnComplete(this.XmlHttp.responseText, this.XmlHttp.responseXML);
    else
      this.OnError(this.XmlHttp.status, this.XmlHttp.statusText, this.XmlHttp.responseText);   
  }
};

/*构造分页页码的类*/
JavaScript.Common.Pager = function()
{
    this.CurrentPageIndex = 1;/*当前页码*/
    this.PageSize = 5;/*每页显示的记录数*/
    this.RecordCount = 0;/*总记录数*/
    this.HalfOfCenterButtonCount = 2;/*页码中部按钮数的半数*/
    this.InstanceNameString = null;/*当前实例对象名字符串*/
    this.PageCount = 0;/*总页数*/
    this.LeftLinkButtonVisible = true; /*是否显示最左端的按钮*/
    this.CenterLinkButtonVisible = true; /*是否显示中间的按钮*/
    this.RightLinkButtonVisible = true; /*是否显示最右端的按钮*/
    this.LinkButtonCssClass = "BlogGray"; /*链接的样式*/
};

/*构造分页页码的类-------点击页码按钮事件对应的处理函数*/
JavaScript.Common.Pager.prototype.OnPagerNumberButtonClick = function(PageIndex)
{
    
};

JavaScript.Common.Pager.prototype.clickPagerNumberButton = function(PageIndex)
{
    this.CurrentPageIndex = PageIndex;
    if(PageIndex <1)
        this.CurrentPageIndex = 1;
    if(PageIndex >this.PageCount)
        this.CurrentPageIndex = this.PageCount;

    this.OnPagerNumberButtonClick(this.CurrentPageIndex);
}

/*构造分页页码的类-------拼出当前的页码Html*/
JavaScript.Common.Pager.prototype.getPagerHtml = function()
{
    var ReturnHtml = "";
    if(this.RecordCount>0)
    {
        this.PageCount = parseInt(this.RecordCount/this.PageSize);

        if(this.RecordCount%this.PageSize!=0)
        {
            this.PageCount++;
        }
        

        ReturnHtml = '&nbsp;&nbsp;&nbsp;&nbsp;<font color = #068A10>当前第<font color = #FF9219> '+this.CurrentPageIndex+'</font> 页 &nbsp; 共 <font color = #FF9219>'+this.PageCount+'</font> 页 &nbsp;</font>';
        /*首页*/
        ReturnHtml = ReturnHtml+ '<a href="javascript:" onclick="this.blur();'+this.InstanceNameString+'.clickPagerNumberButton('+(1)+');return false;" class="' + this.LinkButtonCssClass + '" style="padding:1px 4px 1px 4px; text-decoration:none;">首页</a>&nbsp;&nbsp;' ;
        /*上一页*/
        ReturnHtml = ReturnHtml+ '<a href="javascript:" onclick="this.blur();'+this.InstanceNameString+'.clickPagerNumberButton('+(this.CurrentPageIndex-1)+');return false;" class="' + this.LinkButtonCssClass + '" style="padding:1px 4px 1px 4px; text-decoration:none;">上一页</a>&nbsp;&nbsp;' ;
        /*下一页*/
        ReturnHtml = ReturnHtml + '<a href="javascript:" onclick="this.blur();'+this.InstanceNameString+'.clickPagerNumberButton('+(this.CurrentPageIndex+1)+');return false;" class="' + this.LinkButtonCssClass + '" style="padding:1px 4px 1px 4px; text-decoration:none;">下一页</a>&nbsp;&nbsp;';
        /*末页*/
        ReturnHtml = ReturnHtml + '<a href="javascript:" onclick="this.blur();'+this.InstanceNameString+'.clickPagerNumberButton('+(this.PageCount)+');return false;" class="' + this.LinkButtonCssClass + '" style="padding:1px 4px 1px 4px; text-decoration:none;">末页</a> &nbsp;';
    } 
    
    return ReturnHtml;
};

/*得到网页元素相对于body的x方向绝对坐标*/
JavaScript.Common.getElementX = function(ElementId)
{
    var w3c=(document.getElementById)? true:false;
    var agt=navigator.userAgent.toLowerCase();
    var ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) && (agt.indexOf("omniweb") == -1));
    var ie5=(w3c && ie)? true : false;
    var ns6=(w3c && (navigator.appName=="Netscape"))? true: false;
    var op8=(navigator.userAgent.toLowerCase().indexOf("opera")==-1)? false:true;

    var o = document.getElementById(ElementId)?document.getElementById(ElementId):ElementId;
    var nLt=0;
    var nTp=0;
    var offsetParent = o;
    while (offsetParent!=null && offsetParent!=document.body)
    {
        nLt+=offsetParent.offsetLeft;
        nTp+=offsetParent.offsetTop;
        if(!ns6)
        {
        parseInt(offsetParent.currentStyle.borderLeftWidth)>0?nLt+=parseInt(offsetParent.currentStyle.borderLeftWidth):"";
        parseInt(offsetParent.currentStyle.borderTopWidth)>0?nTp+=parseInt(offsetParent.currentStyle.borderTopWidth):"";
        }
        offsetParent=offsetParent.offsetParent;
    }
    return nLt;
};

/*得到网页元素相对于body的y方向绝对坐标*/
JavaScript.Common.getElementY = function(ElementId)
{
    var w3c=(document.getElementById)? true:false;
    var agt=navigator.userAgent.toLowerCase();
    var ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) && (agt.indexOf("omniweb") == -1));
    var ie5=(w3c && ie)? true : false;
    var ns6=(w3c && (navigator.appName=="Netscape"))? true: false;
    var op8=(navigator.userAgent.toLowerCase().indexOf("opera")==-1)? false:true;

    var o = document.getElementById(ElementId)?document.getElementById(ElementId):ElementId;
    var nLt=0;
    var nTp=0;
    var offsetParent = o;
    while (offsetParent!=null && offsetParent!=document.body)
    {
        nLt+=offsetParent.offsetLeft;
        nTp+=offsetParent.offsetTop;
        if(!ns6)
        {
        parseInt(offsetParent.currentStyle.borderLeftWidth)>0?nLt+=parseInt(offsetParent.currentStyle.borderLeftWidth):"";
        parseInt(offsetParent.currentStyle.borderTopWidth)>0?nTp+=parseInt(offsetParent.currentStyle.borderTopWidth):"";
        }
        offsetParent=offsetParent.offsetParent;
    }
    return nTp;
};

/*可折叠的菜单控制类*/
/*ThisMenuObjName:初始化的对象的对象名字符串*/
/*MenuType:菜单组类型0=无关联收放菜单,1=有关联收放菜单项*/
/*MenuOpenClass:展开的菜单项标题的样式*/
/*MenuCloseClass:收起的菜单项标题的样式*/
JavaScript.Common.NavigationMenu = function(ThisMenuObjName,MenuType,MenuOpenClass,MenuCloseClass)
{
    this.ThisMenuObjName = ThisMenuObjName;
    this.MenuItem = new Array();    
    this.MenuType = MenuType;
    this.MenuOpenClass = MenuOpenClass;
    this.MenuCloseClass = MenuCloseClass;
    
    /*私有变量*/
    this._MenuItem = new Array();
    
    this.addMenuItem = function(ItemName,ItemTitleDiv,ItemContainerDiv,ItemContentDiv)
    {
        this.MenuItem[ItemName] = new Array();
        this.MenuItem[ItemName]["ItemName"] = ItemName;
        this.MenuItem[ItemName]["ItemTitleDiv"] = ItemTitleDiv;
        this.MenuItem[ItemName]["ItemContainerDiv"] = ItemContainerDiv;
        this.MenuItem[ItemName]["ItemContentDiv"] = ItemContentDiv;
        this.MenuItem[ItemName]["Stop"] = true;
        
        this._MenuItem[this._MenuItem.length] = this.MenuItem[ItemName];
    }
    
    this.clickMenuItem = function(MenuItemIndex)
    {
        if(!this.MenuItem[MenuItemIndex]["Stop"]) return;

        this.MenuItem[MenuItemIndex]["Stop"] = false;
        if(document.getElementById(this.MenuItem[MenuItemIndex]["ItemContainerDiv"]).offsetHeight==0)
        {
            if(this.MenuType==1)
            {
                for(var i=0;i<this._MenuItem.length;i++)
                {                    
                    if(this._MenuItem[i]["ItemName"]!=MenuItemIndex)
                    {
                        this.closeMenuItem(this,this._MenuItem[i]["ItemName"]);
                        document.getElementById(this._MenuItem[i]["ItemTitleDiv"]).className = this.MenuCloseClass;
                    }
                }
            }
            document.getElementById(this.MenuItem[MenuItemIndex]["ItemContainerDiv"]).style.display = "block";
            this.openMenuItem(this,MenuItemIndex);
            document.getElementById(this.MenuItem[MenuItemIndex]["ItemTitleDiv"]).className = this.MenuOpenClass;
        }
        else
        {
            this.closeMenuItem(this,MenuItemIndex);
            document.getElementById(this.MenuItem[MenuItemIndex]["ItemTitleDiv"]).className = this.MenuCloseClass;
        }
    }
    
    this.openMenuItem = function(oThis,MenuItemIndex)
    {
        var stepHeight = 10;
        ItemContainerDiv_offsetHeight = document.getElementById(oThis.MenuItem[MenuItemIndex]["ItemContentDiv"]).offsetHeight - document.getElementById(oThis.MenuItem[MenuItemIndex]["ItemContainerDiv"]).offsetHeight
        if(ItemContainerDiv_offsetHeight/3>10)
            stepHeight = ItemContainerDiv_offsetHeight/3;
            
        if(document.getElementById(oThis.MenuItem[MenuItemIndex]["ItemContainerDiv"]).offsetHeight + stepHeight < document.getElementById(oThis.MenuItem[MenuItemIndex]["ItemContentDiv"]).offsetHeight)
        {
            document.getElementById(oThis.MenuItem[MenuItemIndex]["ItemContainerDiv"]).style.height = document.getElementById(oThis.MenuItem[MenuItemIndex]["ItemContainerDiv"]).offsetHeight + stepHeight + "px";
            var s1= oThis.ThisMenuObjName+".openMenuItem("+oThis.ThisMenuObjName+",'"+MenuItemIndex+"')";
            window.setTimeout("eval("+s1+")",1);
        }
        else
        {
            document.getElementById(oThis.MenuItem[MenuItemIndex]["ItemContainerDiv"]).style.height = document.getElementById(oThis.MenuItem[MenuItemIndex]["ItemContentDiv"]).offsetHeight + "px";
            
            oThis.MenuItem[MenuItemIndex]["Stop"] = true;
        }
    }
    
    this.closeMenuItem = function(oThis,MenuItemIndex)
    {
        var stepHeight = 10;
        ItemContainerDiv_offsetHeight = document.getElementById(oThis.MenuItem[MenuItemIndex]["ItemContainerDiv"]).offsetHeight
        if(ItemContainerDiv_offsetHeight/3>10)
            stepHeight = ItemContainerDiv_offsetHeight/3;
            
        if(document.getElementById(oThis.MenuItem[MenuItemIndex]["ItemContainerDiv"]).offsetHeight - stepHeight > 0)
        {
            document.getElementById(oThis.MenuItem[MenuItemIndex]["ItemContainerDiv"]).style.height = document.getElementById(oThis.MenuItem[MenuItemIndex]["ItemContainerDiv"]).offsetHeight - stepHeight + "px";
            var s1 = oThis.ThisMenuObjName+".closeMenuItem("+oThis.ThisMenuObjName+",'"+MenuItemIndex+"')";
            window.setTimeout("eval("+s1+")",1);
        }
        else
        {
            document.getElementById(oThis.MenuItem[MenuItemIndex]["ItemContainerDiv"]).style.height = "0px";
            document.getElementById(oThis.MenuItem[MenuItemIndex]["ItemContainerDiv"]).style.display = "none";
            
            oThis.MenuItem[MenuItemIndex]["Stop"] = true;
        }
    }
};

//----------------------------------------------------------------------
JavaScript.createNameSpace("JavaScript.Common.Window.Document.Body");

JavaScript.Common.Window.Document.Body.onloadListeners = new Array();

JavaScript.Common.Window.Document.Body.addOnloadListener = function(listener)
{
    JavaScript.Common.Window.Document.Body.onloadListeners[JavaScript.Common.Window.Document.Body.onloadListeners.length] = listener;
};

JavaScript.Common.Window.Document.Body.onload = function()
{
    for(var i=0;i<JavaScript.Common.Window.Document.Body.onloadListeners.length;i++)
    {
        eval(JavaScript.Common.Window.Document.Body.onloadListeners[i]);
    }
};

//----------------------------------------------------------------------
/*页面效果命名空间*/
JavaScript.createNameSpace("JavaScript.Common.Window");

/*------------------LYT  2007-12-17 增加  ----------------------*/
JavaScript.Common.Window.showSystemDialog = function(dialogId,contentInnerHtml,xPos,yPos,alphaOpacity,autoCloseTime)
{
    dateString = (new Date()).toString();
    if(dialogId=="")
        dialogId = "DialogId_" + dateString;    
    var innerHtml = "";
    
    var objDialog = document.getElementById(dialogId);
    if (!objDialog)
        objDialog = document.createElement("div");
    
    innerHtml += '<div style="position:absolute; width:277px; height:187px; left:0px; top:0px; background-image:url(/images/system/panel2.gif); font-size:1px; background-repeat:no-repeat; z-index:0;"></div>';
    innerHtml += '<div style="position:absolute; width:240px; height:133px; left:8px; top:7px; z-index:1; overflow:auto;">';
    innerHtml += '<!--内容 开始-->';
    innerHtml += contentInnerHtml;
    innerHtml += '<!--内容 结束-->';
    innerHtml += '</div>';
    innerHtml += '<div style="position:absolute; width:12px; height:12px; left:248px; top:10px; z-index:2;"><img src="/images/system/close.jpg" style="cursor:pointer;" alt=""  onclick="document.getElementById(\''+dialogId+'\').style.display=\'none\';" /></div>';
   
    
    objDialog.id = dialogId;
    var oS = objDialog.style;
    oS.display = "block";
    oS.top = yPos - 187 + "px";
    oS.left = xPos - 130 + "px";
    oS.margin = "0px";
    oS.padding = "0px";
    oS.width = "277px";
    oS.height = "187px";
    oS.filter = "alpha(opacity="+alphaOpacity+")";
    oS.opacity = alphaOpacity/100;
    oS.MozOpacity = alphaOpacity/100;
    oS.position = "absolute";
    oS.zIndex = "8000";

    objDialog.innerHTML = innerHtml;
    document.body.appendChild(objDialog); 
    
    if(autoCloseTime!=-1)
    {
        window.setTimeout("document.getElementById('"+dialogId+"').style.display='none';",autoCloseTime);
    }
    
    return dialogId;    
}

/*获得网页中的flash影片对象，movieName为flash标记的id或者是name*/
JavaScript.Common.Window.getMovie = function(movieName)
{
    if (navigator.appName.indexOf("Microsoft") != -1)
    {
        return window[movieName];
    }
    else 
    {
        return document[movieName];
    }
};


/*显示flash提示*/
JavaScript.Common.Window.showFlashAlertDialog = function(dialogId,SystemInfoText,xPos,yPos,alphaOpacity,autoCloseTime)
{    
    if(autoCloseTime!=-1)
    {
        //window.setTimeout("document.getElementById('"+dialogId+"').style.display='none';",autoCloseTime);
    }   

    try
    {
        JavaScript.Common.Window.getMovie("FlashMovieSystemInfo").showSystemInfo(SystemInfoText,"dddd");
    }
    catch(e)
    {
        alert(e);
    }
};

JavaScript.Common.Window.closeFlashAlertDialog =function(DialogId)
{
    document.getElemenyById(DialogId).style.display = "none";
};
/*------------------LYT  2007-12-17 增加 完毕  ----------------------*/

/*页面阴影的层divID*/
JavaScript.Common.Window.MaskDivId = "UPlife_Window_MaskDivId";

/*层对话框的divID*/
JavaScript.Common.Window.DialogDivId = "UPlife_Window_DialogDivId";

/*浏览器类*/
JavaScript.Common.Window.Browser = function(){var ua, s, i;this.isIE = false;this.isNS = false;this.isOP = false;this.isSF = false;ua = navigator.userAgent.toLowerCase();s = "opera";if ((i = ua.indexOf(s)) >= 0){this.isOP = true;return;}s = "msie";if ((i = ua.indexOf(s)) >= 0) {this.isIE = true;return;}s = "netscape6/";if ((i = ua.indexOf(s)) >= 0) {this.isNS = true;return;}s = "gecko";if ((i = ua.indexOf(s)) >= 0) {this.isNS = true;return;}s = "safari";if ((i = ua.indexOf(s)) >= 0) {this.isSF = true;return;}};

/*显示层对话框*/
JavaScript.Common.Window.showDialog = function(DialogInerHtml,ow,oh,w,h)
{
    var t_DiglogX,t_DiglogY,t_DiglogW,t_DiglogH;
    
    var objDialog = document.getElementById(JavaScript.Common.Window.DialogDivId);
    if (!objDialog)
        objDialog = document.createElement("div");
    t_DiglogW = ow;
    t_DiglogH = oh;
    
    /*JavaScript.Common.Window.DialogLoc(); */       
    var dde = document.documentElement;
    if (window.innerWidth)
    {
        var ww = window.innerWidth;
        var wh = window.innerHeight;
        var bgX = window.pageXOffset;
        var bgY = window.pageYOffset;
    }
    else
    {
        var ww = dde.offsetWidth;
        var wh = dde.offsetHeight;
        var bgX = dde.scrollLeft;
        var bgY = dde.scrollTop;
    }
    t_DiglogX = (bgX + ((ww - t_DiglogW)/2));
    t_DiglogY = (bgY + ((wh - t_DiglogH)/2));
    
    objDialog.id = JavaScript.Common.Window.DialogDivId;
    var oS = objDialog.style;
    oS.display = "block";
    oS.top = t_DiglogY + "px";
    oS.left = t_DiglogX + "px";
    oS.margin = "0px";
    oS.padding = "0px";
    oS.width = w + "px";
    oS.height = h + "px";
    oS.position = "absolute";
    oS.zIndex = "10000";

    objDialog.innerHTML = DialogInerHtml;
    document.body.appendChild(objDialog); 
};

/*显示层对话框----------------------------------------------------------------------object版-------------------------------------------*/
JavaScript.Common.Window.showDialog2 = function(DialogInerHtml,ow,oh,w,h)
{
    var t_DiglogX,t_DiglogY,t_DiglogW,t_DiglogH;
    
//    var objDialog = document.getElementById(JavaScript.Common.Window.DialogDivId);
//    if (!objDialog)
//        objDialog = document.createElement("div");
    var objDialog = document.getElementById(DialogInerHtml);
    t_DiglogW = ow;
    t_DiglogH = oh;
    
    /*JavaScript.Common.Window.DialogLoc(); */       
    var dde = document.documentElement;
    if (window.innerWidth)
    {
        var ww = window.innerWidth;
        var wh = window.innerHeight;
        var bgX = window.pageXOffset;
        var bgY = window.pageYOffset;
    }
    else
    {
        var ww = dde.offsetWidth;
        var wh = dde.offsetHeight;
        var bgX = dde.scrollLeft;
        var bgY = dde.scrollTop;
    }
    t_DiglogX = (bgX + ((ww - t_DiglogW)/2));
    t_DiglogY = (bgY + ((wh - t_DiglogH)/2));
    
    objDialog.id = JavaScript.Common.Window.DialogDivId;
    var oS = objDialog.style;
    oS.display = "block";
    oS.top = t_DiglogY + "px";
    oS.left = t_DiglogX + "px";
    oS.margin = "0px";
    oS.padding = "0px";
    oS.width = w + "px";
    oS.height = h + "px";
    oS.position = "absolute";
    oS.zIndex = "10000";

    objDialog.innerHTML = DialogInerHtml;
    //document.body.appendChild(objDialog); 
};
/*显示层对话框----------------------------------------------------------------------object版-------------------------------------------*/


/*显示进度条框*/
JavaScript.Common.Window.showProcessBar = function()
{
    JavaScript.Common.Window.showDialog("<div id=\""+JavaScript.Common.Window.DialogDivId+"\" style=\"width:300px; height:60px; border:solid 1px #ff9900; background-color:#ffffff; \"><div style=\"margin-top:20px; text-align:center; font-weight:bold;\">请求正在处理中...</div></div>",300,60,124,20);
   
    var oS = document.getElementById(JavaScript.Common.Window.DialogDivId).style;
    oS.filter = "alpha(opacity=60)";
    oS.opacity = 60/100;
    oS.MozOpacity = 60/100;
};
/*隐藏层对话框*/
JavaScript.Common.Window.hideDialog = function()
{
    /*JavaScript.Common.Window.hideMask();*/
    var objDialog = document.getElementById(JavaScript.Common.Window.DialogDivId);
    if (objDialog) objDialog.style.display = "none";
};

/*显示页面阴影*/
/*MaskBackgroundImage=页面阴影的背景图片*/
JavaScript.Common.Window.showMask = function(MaskBackgroundImage)
{
    var browser = new JavaScript.Common.Window.Browser();
    var objScreen = document.getElementById?document.getElementById(JavaScript.Common.Window.MaskDivId):null;
    if(!objScreen)
        var objScreen = document.createElement("div");

    var oS = objScreen.style;
    objScreen.id = JavaScript.Common.Window.MaskDivId;
    oS.display = "block";
    oS.top = oS.left = oS.margin = oS.padding = "0px";
    if (document.body.clientHeight)	
    {
        var wh = document.body.clientHeight + "px";
    }
    else if (window.innerHeight)
    {
        var wh = window.innerHeight + "px";
    }
    else
    {
    var wh = "100%";
    }
    oS.width = "100%";
    oS.height = wh;
    oS.position = "absolute";
    oS.zIndex = "9999";
    if ((!browser.isSF) && (!browser.isOP))
    {
        oS.background = "#181818"; 
    }
    else
    {
        oS.background = "#F0F0F0";  
    }
    if(MaskBackgroundImage!=null)
        oS.backgroundImage = "url("+MaskBackgroundImage+")";
    oS.filter = "alpha(opacity=40)";
    oS.opacity = 40/100;
    oS.MozOpacity = 40/100;
    document.body.appendChild(objScreen);
    var allselect = document.getElementsByTagName?document.getElementsByTagName("select"):new Array();
    for (var i=0; i<allselect.length; i++)
    {
        //if(allselect[i].name!="tbSelYear"&&allselect[i].name!="tbSelMonth")
        //allselect[i].style.visibility = "hidden";
    }
};

/*隐藏页面阴影*/
JavaScript.Common.Window.hideMask = function()
{
    var objScreen = document.getElementById(JavaScript.Common.Window.MaskDivId);
    if (objScreen) objScreen.style.display = "none";
    var allselect = document.getElementsByTagName?document.getElementsByTagName("select"):new Array();
    for (var i=0; i<allselect.length; i++)
    {
        //if(allselect[i].name!="tbSelYear"&&allselect[i].name!="tbSelMonth"&&allselect[i].name!="tbSelMonth")
        //allselect[i].style.visibility = "visible";
    }
};

/*隐藏页面阴影与层对话框*/
JavaScript.Common.Window.hideMaskAndDialog = function()
{
    JavaScript.Common.Window.hideDialog();
    JavaScript.Common.Window.hideMask();
};

/*通用的有框的对话框显示*/
/*DialogTitle=对话框的标题*/
/*DialogContentSummaryInerHtml=对话框的内容摘要*/
/*DialogContentInerHtml=对话框的内容*/
/*ow=对话框的宽*/
/*oh=对话框的高*/
JavaScript.Common.Window.showCommonDialog = function(DialogTitle,DialogContentSummaryInerHtml,DialogContentInerHtml,ow,oh,w,h)
{
    var DialogInerHtml = "";
    DialogInerHtml += '    <div id="UPlife_CommonDialog_DivId" style="width:'+ow+'px; height:'+oh+'px; border:solid 3px #006600; background-color:#f8f8f8; z-index:10;">';
    DialogInerHtml += '        <div style="width:'+(ow-4)+'px; height:25px; margin:2px; background-color:#B5E76A;">';
    DialogInerHtml += '            <div id="UPlife_CommonDialog_DivControlPoint" style="width:'+(ow-26)+'px; height:20px; text-align:left; margin:4px 0px 0px 2px; float:left; font-size:13px; font-weight:bold; color:#006600; cursor:move;">';
    DialogInerHtml += '                <img src="/images/BookBlog/logo_icon.gif" alt="" style="vertical-align:bottom;" />&nbsp;'+DialogTitle;
    DialogInerHtml += '            </div>';
    DialogInerHtml += '            <div style="margin:5px 2px 0px 0px; float:right;"><img src="/images/BookBlog/close.gif" alt="关闭" style="cursor:pointer;" onclick="javascript:JavaScript.Common.Window.hideMaskAndDialog();" /></div>';
    DialogInerHtml += '        </div>';
    DialogInerHtml += '        <div style="width:'+(ow-6)+'px; height:'+(oh-34)+'px; border:solid #cccccc 1px; margin:2px; text-align:center; vertical-align:middle;">';
    if(DialogContentSummaryInerHtml.length>0)
    {
        DialogInerHtml += '             <div style="height:25px;padding:5px;text-align:left; font-size:12px;">';
        DialogInerHtml += '                 '+DialogContentSummaryInerHtml;
        DialogInerHtml += '             </div>';
    }
    DialogInerHtml += '             <div>'+DialogContentInerHtml+'</div>';
    DialogInerHtml += '        </div>';
    DialogInerHtml += '    </div>';
    JavaScript.Common.Window.showDialog(DialogInerHtml,ow,oh,w,h);
    
    //var oS = document.getElementById("UPlife_CommonDialog_DivId").style;
    //oS.filter = "alpha(opacity=100)";
    //oS.opacity = 80/100;
    //oS.MozOpacity = 80/100;
    
    JavaScript.Utility.DragAndMoveDiv(JavaScript.Common.Window.DialogDivId,"UPlife_CommonDialog_DivControlPoint");
};
/*----------------------------------------------------  2007-11-07 增加登陆框 ----------------------------------------------------------------------------------------    */
/*显示需要登录或注册的层对话框*/
/*DialogTitle=对话框的标题*/
/*DialogContentSummaryInerHtml=对话框的内容摘要*/
/*ReturnUrl=登录成功后返回的地址*/
JavaScript.Common.Window.showRequireLoginDialog = function(DialogTitle,DialogContentSummaryInerHtml,ReturnUrl)
{
    JavaScript.Common.Window.showCommonDialog(DialogTitle,DialogContentSummaryInerHtml,"<br /><br /><input type=\"button\" value=\"登录优派\" onclick=\"JavaScript.Common.Window.showLoginDialog('登录优派','请输入您的用户名和密码');\" />&nbsp;&nbsp;<input type=\"button\" value=\"注册会员\" onclick=\"javascript:window.location.href='/member/register.aspx';\" />&nbsp;&nbsp;<input type=\"button\" value=\"取消\" onclick=\"javascript:JavaScript.Common.Window.hideMaskAndDialog();\" />",300,200,300,100);
};

JavaScript.Common.Window.showLoginDialog = function(DialogTitle,DialogContentSummaryInerHtml)
{
    var InnerHTML = '';
    InnerHTML += '<div style="margin-top:10px; width:280px;">';
    InnerHTML += '<div style="padding-left:56px;height:30px; float:left;">email：<input id="JavaScript_Common_Window_showLoginDialog_MemberEmailOrMemberName" type="text" style="width: 160px" /></div>';
    InnerHTML += '<div style="padding-left:63px; height:30px; float:left;">密码：<input id="JavaScript_Common_Window_showLoginDialog_MemberPassword" type="password" style="width: 100px" />&nbsp;<a href="/Module/UserInfo/findpassword.aspx" class="MainGreen" style="font-size:12px;">忘记密码</a></div>';
    InnerHTML += '<div style="padding-left:105px; height:30px; float:left;"><input id="JavaScript_Common_Window_showLoginDialog_IsAutoLogin" type="checkbox" /><label for="JavaScript_Common_Window_showLoginDialog_IsAutoLogin" style="font-size:12px;">记住我</label>&nbsp;&nbsp;&nbsp;<input id="JavaScript_Common_Window_showLoginDialog_IsHideLogin" type="checkbox" /><label for="JavaScript_Common_Window_showLoginDialog_IsHideLogin" style="font-size:12px;">隐身登录</label></div>';
    InnerHTML += '<div style="padding-left:110px; height:30px; float:left;"><input type="button" value="登录优派" onclick="JavaScript.Common.Member.Login.checkMemberLogin(document.getElementById(\'JavaScript_Common_Window_showLoginDialog_MemberEmailOrMemberName\').value,document.getElementById(\'JavaScript_Common_Window_showLoginDialog_MemberPassword\').value,document.getElementById(\'JavaScript_Common_Window_showLoginDialog_IsAutoLogin\').checked,document.getElementById(\'JavaScript_Common_Window_showLoginDialog_IsHideLogin\').checked);" /></div>';
    InnerHTML += '</div>';
    JavaScript.Common.Window.showCommonDialog(DialogTitle,DialogContentSummaryInerHtml,InnerHTML,308,208,308,208);
};

JavaScript.createNameSpace("JavaScript.Common.Member.Login"); 

JavaScript.Common.Member.Login.checkMemberLogin = function(MemberEmailOrMemberName,MemberPassword,IsAutoLogin,IsHideLogin)
{
    if(MemberEmailOrMemberName.length!=0&&MemberPassword.length!=0)
    {
        var xmlhttp_checkMemberLogin = new JavaScript.Common.HttpRequest();
        xmlhttp_checkMemberLogin.Method = "POST";
        xmlhttp_checkMemberLogin.Url = "../../alogin/login.aspx?AjaxAction=checkMemberLogin";
        xmlhttp_checkMemberLogin.addFormData("MemberEmail",MemberEmailOrMemberName);
        xmlhttp_checkMemberLogin.addFormData("MemberPassword",MemberPassword);
        IsAutoLogin = IsAutoLogin?"1":"0";
        IsHideLogin = IsHideLogin?"1":"0";
        xmlhttp_checkMemberLogin.addFormData("IsAutoLogin",IsAutoLogin);
        xmlhttp_checkMemberLogin.addFormData("IsHideLogin",IsHideLogin);
        
        xmlhttp_checkMemberLogin.OnComplete = JavaScript.Common.Member.Login.checkMemberLogin_Complete;
        xmlhttp_checkMemberLogin.OnError = JavaScript.Common.Member.Login.checkMemberLogin_Error;
        xmlhttp_checkMemberLogin.DoCallBack();
    }
    else
    {
        window.alert("请输入您的注册email和密码");
    }
};

JavaScript.Common.Member.Login.checkMemberLogin_Complete = function(responseText, responseXML)
{
    var s1 = responseText.split("|#%+==+%#|");
    switch(s1[0])
    {
        case "登录成功":
        {
            try
            {
                JavaScript.Module.BookBlog.getMemberLoginInfoForTop(s1[1]);/*此函数在主页中,如果改名,这里也要改*/
            }
            catch(e)
            {}
            JavaScript.Common.Window.hideDialog();
            JavaScript.Common.Window.hideMask();
            break;
        }
//        case "用户在线":
//        {
//            JavaScript.Common.Window.hideDialog();
//            JavaScript.Common.Window.hideMask();
//            window.alert("您在别的地方登录或刚离开，请休息1分钟再登录");
//            break;
//        }
        case "登录失败":
        {
            window.alert("用户名与密码不匹配");
            break;
        }
        default:
        {
            JavaScript.Common.Window.hideDialog();
            JavaScript.Common.Window.hideMask();
            window.alert("发生登录异常，请休息一下再试");
            break;
        }
    }
};

JavaScript.Common.Member.Login.checkMemberLogin_Error = function(status, statusText, responseText)
{
    JavaScript.Common.Window.hideDialog();
    JavaScript.Common.Window.hideMask();
};
/*----------------------------------------------------  2007-11-07 增加登陆框完毕 ----------------------------------------------------------------------------------------    */

JavaScript.createNameSpace("JavaScript.Utility");



/*------------------------------------------  2007-12-17 增加 验证函数  -----------------------------------------*/
JavaScript.Utility.checkEmail = function(email)
{
    var myReg = /^[_a-z0-9.-]+@([_a-z0-9]+\.)+[a-z0-9]{2,3}$/;
    if(myReg.test(email)) return true;
    return false;
};

JavaScript.Utility.checkEmail2 = function(email)
{
    var myReg = /^[_a-z0-9]+@([_a-z0-9]+\.)+[a-z0-9]{2,3}$/;
    if(myReg.test(email)) return true;
    return false;
};

JavaScript.Utility.checkFileExtensionName = function(FileName,RightExtensionName)
{
    var pointLastIndex = FileName.lastIndexOf(".");
	var FileExtensionName=FileName.substring(pointLastIndex,FileName.length);
	FileExtensionName=FileExtensionName.toLowerCase();	
	var RightExtensionNameArray = RightExtensionName.toLowerCase().split("|");	
	for(var i=0;i<RightExtensionNameArray.length;i++)
	{
		if(RightExtensionNameArray[i] == FileExtensionName)
			return true;
	}
	return false;
};



/*处理cookie值的函数*/
JavaScript.Utility.Cookie = function()
{
	this.cookie=document.cookie;
	this.getCookie=function(name)
	{
		var value=null;
		var cookies=this.cookie.split(";");
		var a_cookie;
		for(var i=0;i<cookies.length;i++)
		{
			a_cookie=cookies[i].split("=");
			if(a_cookie[0].replace(" ","")==name)
			{
				value=a_cookie[1];
				break;
			}
		}
		return value;
	}
};

JavaScript.Utility.HtmlEncode = function(text){var re = {'<':'&lt;','>':'&gt;','&':'&amp;','"':'&quot;'};for (i in re) text = text.replace(new RegExp(i,'g'), re[i]);return text;};
JavaScript.Utility.HtmlDecode = function(text){var re = {'&lt;':'<','&gt;':'>','&amp;':'&','&quot;':'"'};for (i in re) text = text.replace(new RegExp(i,'g'), re[i]);return text;};


/*从inputHtml中取出文本部分*/
JavaScript.Utility.getTextFromHtml = function(inputHtml,len)
{
   var re;   
   try {              
   
   re = /<.+?>/g;   
   inputHtml = inputHtml.replace(re, "");
   inputHtml = inputHtml.replace("&nbsp;", "");
   inputHtml = inputHtml.replace("\t", "");
   inputHtml = inputHtml.replace("\r\n", "");
   inputHtml = inputHtml.replace("\t", "");
   inputHtml = inputHtml.replace(" ", ""); 
 
    var length = inputHtml.length;
    if(len<=length&&len!=0)
        inputHtml=inputHtml.substr(0,len);
    return inputHtml; 
    }
    catch(e) {
    return inputHtml;
    }
               
};

JavaScript.Utility.Target = function(ObjectNameString,TextBoxId,TagString,TagCssClass)
{
    this.ObjectNameString = ObjectNameString;
    this.TextBoxId = TextBoxId;
    this.TagString = TagString;
    this.TagCssClass = TagCssClass;
    
    this.addTarget = function(TagText)
    {
        CurrentTagTextArray = document.getElementById(this.TextBoxId).value.split(" ");
        for(var i=0;i<CurrentTagTextArray.length;i++)
        {
            if(TagText==CurrentTagTextArray[i])
            {
                alert("您已选择过此标签");
                return;
            }        
        }
        
        if(document.getElementById(this.TextBoxId).value=="")
            document.getElementById(this.TextBoxId).value += TagText;
        else
            document.getElementById(this.TextBoxId).value += " " + TagText;
    }
    this.getInnerHtmlForSelecting = function()
    {
        var innerHtml = "";
        CurrentTagTextArray = this.TagString.split(" ");
        for(var i=0;i<CurrentTagTextArray.length;i++)
        {
            innerHtml += "<a href=\"javascript:" + this.ObjectNameString + ".addTarget('" + CurrentTagTextArray[i] + "');\" class=\"" + this.TagCssClass + "\">" + CurrentTagTextArray[i] + "</a>&nbsp;&nbsp;";
        }
        return innerHtml;
    }
};
/*------------------------------------------  2007-12-17 增加 验证函数完毕  -----------------------------------------*/

JavaScript.Utility.DragAndMoveDiv = function(Container,ControlPoint)
{   
    var oContainer = document.getElementById(Container);
    var oControlPoint = document.getElementById(ControlPoint);
    
    
    oContainer.firstChild.onmousedown=function(){return false;};
      
    oControlPoint.onmousedown=function(a){  
     
        var d=document;if(!a)a=window.event;   
        var x=a.layerX?a.layerX:a.offsetX,y=a.layerY?a.layerY:a.offsetY;  
        
         
        if(oControlPoint.setCapture)   
            oControlPoint.setCapture();   
        else if(window.captureEvents)   
            window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);   
  
        d.onmousemove=function(a){   
            if(!a)a=window.event;   
            if(!a.pageX)a.pageX=a.clientX;   
            if(!a.pageY)a.pageY=a.clientY;   
            var tx=a.pageX-x,ty=a.pageY-y;   
            
   
            oContainer.style.left=tx+"px";
            oContainer.style.top=ty+"px";   
        };   
  
        d.onmouseup=function(){   
            if(oControlPoint.releaseCapture)   
                oControlPoint.releaseCapture();   
            else if(window.captureEvents)   
                window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);   
            d.onmousemove=null;   
            d.onmouseup=null;   
        };   
    };   
};

JavaScript.Utility.ShowCustomDiv = function(Container,ControlPoint,top,left,showMask)
{   
    JavaScript.Utility.DragAndMoveDiv(Container,ControlPoint);
    document.getElementById(Container).style.zIndex = "10000";
    document.getElementById(Container).style.display='';
    document.getElementById(Container).style.top=top;
    document.getElementById(Container).style.left=left;
    if(showMask==1)JavaScript.Common.Window.showMask("../images/BookBlog/dark_bg.gif"); 
};

JavaScript.Utility.HideCustomDiv = function(Container)
{   
    document.getElementById(Container).style.display='none';
    JavaScript.Common.Window.hideMask();
};

/*--------------------------------------------------------------------------------------- LYT -------------------------------------------------------*/

/*-----------------------------------------------  LYT 增加 2007-12-17 -------------------------------------------------------*/
/*一些菜单操作的相关脚本*/
JavaScript.createNameSpace("JavaScript.Common.Menu");


JavaScript.Common.Menu.showPopMenu = function(menu_container,menu_content,speed,length)
{
    if(typeof(window.MenuState)=="undefined") window.MenuState = 0;
    if(window.MenuState !=0) return;
    document.getElementById(menu_container).style.display='block';
    
    var length2 = length;
    var speed2 = speed;
//    length2 = length / speed + 1;
//    if(length2<5) length2 = 5;
//    speed2 = speed + 1;
    
    
    
    if(document.getElementById(menu_content).offsetWidth<document.getElementById(menu_content).offsetHeight)
    {
        alert(document.getElementById(menu_container).offsetWidth + length);
        alert(document.getElementById(menu_content).offsetWidth);
        if(document.getElementById(menu_container).offsetWidth + length<document.getElementById(menu_content).offsetWidth)
        {
            document.getElementById(menu_container).style.width = document.getElementById(menu_container).offsetWidth + length + "px";
        }
        else
        {
            document.getElementById(menu_container).style.width = document.getElementById(menu_content).offsetWidth + "px";
        }
        
        if(document.getElementById(menu_container).offsetHeight + length<document.getElementById(menu_content).offsetHeight)
        {
            document.getElementById(menu_container).style.height = document.getElementById(menu_container).offsetHeight + length + "px";
            window.setTimeout("JavaScript.Common.Menu.showPopMenu('"+menu_container+"','"+menu_content+"',"+speed2+","+length2+")",speed2);
        }
        else
        {
            document.getElementById(menu_container).style.height = document.getElementById(menu_content).offsetHeight + "px";
            window.MenuState = 1;
        }
    }
    else
    {
        if(document.getElementById(menu_container).offsetHeight + length<document.getElementById(menu_content).offsetHeight)
        {
            document.getElementById(menu_container).style.height = document.getElementById(menu_container).offsetHeight + length + "px";
        }
        else
        {
            document.getElementById(menu_container).style.height = document.getElementById(menu_content).offsetHeight + "px";
        }
        
        if(document.getElementById(menu_container).offsetWidth  + length <document.getElementById(menu_content).offsetWidth)
        {
            document.getElementById(menu_container).style.width = document.getElementById(menu_container).offsetWidth + length + "px";
            window.setTimeout("JavaScript.Common.Menu.showPopMenu('"+menu_container+"','"+menu_content+"',"+speed2+","+length2+")",speed2);
        }
        else
        {
            document.getElementById(menu_container).style.width = document.getElementById(menu_content).offsetWidth + "px";
            window.MenuState = 1;
        }
    }
   
    window.MenuTimeOutHandler = null;
    
    var allselect = document.getElementsByTagName?document.getElementsByTagName("select"):new Array();
    for (var i=0; i<allselect.length; i++)
        allselect[i].style.visibility = "hidden";
}

JavaScript.Common.Menu.hidePopMenu = function(menu_container)
{
    if(window.MenuState!=1)
    {
        return;
    }
    window.MenuTimeOutHandler = window.setTimeout("JavaScript.Common.Menu.doHidePopMenu('"+menu_container+"')",100);
}

JavaScript.Common.Menu.doHidePopMenu = function(menu_container)
{
    document.getElementById(menu_container).style.width = "0px";
    document.getElementById(menu_container).style.height = "0px";
    document.getElementById(menu_container).style.display = 'none';
    window.MenuState = 0;
    
    var allselect = document.getElementsByTagName?document.getElementsByTagName("select"):new Array();
    for (var i=0; i<allselect.length; i++)
        allselect[i].style.visibility = "visible";
}

JavaScript.Common.Menu.clearHidePopMenu = function(menu_container)
{
    window.clearTimeout(window.MenuTimeOutHandler);
}













