﻿//得到RootPath
function getRootPath(){
      var strFullPath = window.document.URL;
      var arr = new Array();
      arr = strFullPath.split("/");
      var prePath = arr[0].toString() + "//" + arr[2].toString();
      var v = arr[3].toString().toUpperCase();
      var postPath = (v == "MYBOOK" || v == "WEB") ? ("/" + arr[3].toString()) : "";
      return(prePath + postPath);
}
 //根据权限号码检查当前用户是否有权限(0:没有权限,1:有权限,2:(异常)系统出错,3:系统超时)
function isHavePurviewByCode(code)
{
    var n = "0";
    if(AjaxMethod.userIsOnLogin().value == "0")
    {
       // showPanel(null, "系统超时,请重新登录！",300,"确定",function(){showLogin();return true});
      // var vClick = "onclick=\"closeSdPanel('boxs');showLogin();\"";
       alert("系统超时,请重新登录!");
       window.location.href = "UserLogin.aspx";
       //showAlertPanel("系统超时,请重新登录!<p><input type=\"button\" class=\"btout\" value=\"确定\" " + vClick + " />",400,100,"boxs",200);  
        n = "3";
    }
    else
    {
        n = AjaxMethod.isHavePurviewByCode(code).value;
    }
    return n;
}


//MyAccount左边菜单打开超链接方法且控制公司用户访问
function getRightPage(url)
{
    if(AjaxMethod.userIsOnLogin().value == "0")
    {
        //showLogin();
        window.location.href = getRootPath() + "/MyAccount/UserLogin.aspx";
    }
    else
    {
        if(AjaxMethod.getUserType().value == "2" || AjaxMethod.getUserType().value == "1")
        {
            navigate(url);
        }
        else
        {
           // var yClick = "location.href='" + getRootPath() + "/MyAccount/CorpManage.aspx'";
           // var nClick = "closeSdPanel('boxs')";
           // showAlertPanel("该操作需要填写公司信息，是否现在填写公司信息？<p></p><input type=button class=btout onclick=" + yClick + " value=是 />&nbsp;&nbsp;<input type=button class=btout onclick=" + nClick + " value=否 />",300,100,'boxs',200);
           
           if(confirm('该操作需要填写公司信息，是否现在填写公司信息？')) {
                window.location.href = getRootPath() + "/MyAccount/CorpManage.aspx";
                //alert( window.location.href);
            } 
        }
    }
}
//检测当前用户是否为公司用户来限制一般会员不能打开的网页


function checkIsCompanyUser()
{
    if(AjaxMethod.userIsOnLogin().value == "0")
    {
        // showAlertPanel('系统超时,请重新登录!<p><input type=\"button\" class=\"btout\" value=\"确认\" onclick=\"closeSdPanel(\'boxs\'); showLogin();\" />',400,100,'boxs',200);
        showLogin();
    }
    else
    {
        if(AjaxMethod.getUserType().value == "0")
        {
            //var yClick = "location.href='" + getRootPath() + "/MyAccount/CorpManage.aspx'";
            //var nClick = "closeSdPanel('boxs')";
            //showAlertPanel("该操作需要填写公司信息，是否现在填写公司信息？<p></p><input type=button class=btout onclick=" + yClick + " value=是 />&nbsp;&nbsp;<input type=button class=btout onclick=" + nClick + " value=否 />",300,100,'boxs',200);

            if(confirm('该操作需要填写公司信息，是否现在填写公司信息？')) {
                window.location.href = getRootPath() + "/MyAccount/CorpManage.aspx";
            } 
        }
    }
}

//关层出
function showSaasHelp(){
window.scrollTo(0,0);
     var bo = document.getElementsByTagName('body')[0];
     var ht = document.getElementsByTagName('html')[0];
     var boht = document.getElementById('boxs');
     var str = "";     
     
bo.scroll="no";  bo.style.height='100%';
bo.style.overflow='hidden';
ht.style.height='100%'; 


str +='<div id="boxbg"></div><div class="boxinfo"><div class="boxcenter2" style="height:560px;width=800px;">';
str +='<div class="index_pop_title">SaaS应用知识<div class="index_pop_closeBt" onclick="closeSdPanel();"></div></div>';
str +='<div class="index_pop_content">';
str +='<h2 class="index_pop_subtitle">SaaS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;一种通过互联网提供软件的模式</h2>';
str +='<div class="index_pop_content_out">';
str +='<ul class="index_pop_content_left_Ul">';
str +='<li id="popli1" onclick="checkStyle(1);"><div id="popico1"></div><div class="index_pop_content_left_liText">什么是SaaS?</div></li>';
str +='<li id="popli2" onclick="checkStyle(2);"><div id="popico2"></div><div class="index_pop_content_left_liText">与SaaS相关的八大术语</div></li>';
str +='<li id="popli3" onclick="checkStyle(3);"><div id="popico3"></div><div class="index_pop_content_left_liText">为什么需要SaaS?</div></li>';
str +='<li id="popli4" onclick="checkStyle(4);"><div id="popico4"></div><div class="index_pop_content_left_liText">SaaS的分类</div></li>';
str +='<li id="popli5" onclick="checkStyle(5);"><div id="popico5"></div><div class="index_pop_content_left_liText">SaaS服务的优势在哪里?</div></li>';
str +='<li id="popli6" onclick="checkStyle(6);"><div id="popico6"></div><div class="index_pop_content_left_liText">账本网在线软件产品特点</div></li>';
str +='<li id="popli7" onclick="checkStyle(7);"><div id="popico7"></div><div class="index_pop_content_left_liText">账本网保障系统的安全措施</div></li>';
str +='<li id="popli8" onclick="checkStyle(8);"><div id="popico8"></div><div class="index_pop_content_left_liText">账本网保证数据不丢失的措施</div></li>';
str +='<li id="popli9" onclick="checkStyle(9);"><div id="popico9"></div><div class="index_pop_content_left_liText">账本网保证数据不泄密措施</div></li>';
str +='<li id="popli10" onclick="checkStyle(10);"><div id="popico10"></div><div class="index_pop_content_left_liText">账本网网络架构图</div></li>';
str +='<li id="popli11" onclick="checkStyle(11);"><div id="popico11"></div><div class="index_pop_content_left_liText">账本网保证运行效率的措施</div></li>';
str +='</ul>';



str +='<iframe id="popframe" scrolling="no" border="0" frameborder="0"></iframe>';

boht.innerHTML = str;  
}
function showFirstHelp(){
window.scrollTo(0,0);
     var bo = document.getElementsByTagName('body')[0];
     var ht = document.getElementsByTagName('html')[0];
     var boht = document.getElementById('boxs');
     var str = "";     
bo.scroll="no";  bo.style.height='100%';
bo.style.overflow='hidden';
ht.style.height='100%';  
str +='<div id="boxbg"></div><div class="boxinfo"><div class="boxcenter2" style="height:560px;width=800px;">';
str +='<div class="index_pop_title">第一次使用<div class="index_pop_closeBt" onclick="closeSdPanel();"></div></div>';
str +='<div class="index_pop_content">';
str +='<h2 class="index_pop_subtitle">如何注册成为会员？</h2>';
str +='<div class="index_pop_content_out">';


str +='<ul class="index_pop_content_left_Ul">';
str +='<li id="popli1" onclick="checkfirstStyle(1);"><div id="popico1"></div><div class="index_pop_content_left_liText">免费试用</div></li>';
str +='<li id="popli2" onclick="checkfirstStyle(2);"><div id="popico2"></div><div class="index_pop_content_left_liText">注册会员</div></li>';
str +='<li id="popli3" onclick="checkfirstStyle(3);"><div id="popico3"></div><div class="index_pop_content_left_liText">体验卡的开通</div></li>';
str +='<li id="popli4" onclick="checkfirstStyle(4);"><div id="popico4"></div><div class="index_pop_content_left_liText">在线购买</div></li>';
str +='</ul>';
str +='<iframe id="popframe" scrolling="no" border="0" frameborder="0"></iframe>';
str +='</div></div></div></div>';
boht.innerHTML = str;  
}
function showClassHelp(){
window.scrollTo(0,0);
     var bo = document.getElementsByTagName('body')[0];
     var ht = document.getElementsByTagName('html')[0];
     var boht = document.getElementById('boxs');
     var str = "";     
bo.scroll="no";  bo.style.height='100%';
bo.style.overflow='hidden';
ht.style.height='100%';  
str +='<div id="boxbg"></div><div class="boxinfo"><div class="boxcenter2" style="height:560px;width=800px;">';
str +='<div class="index_pop_title">在线应用小课堂<div class="index_pop_closeBt" onclick="closeSdPanel();"></div></div>';
str +='<div class="index_pop_content">';
str +='<h2 class="index_pop_subtitle">小课堂学习</h2>';
str +='<div class="index_pop_content_out">';
str +='<ul class="index_pop_content_left_Ul">';
str +='<li id="popli1" onclick="checkclassStyle(1);"><div id="popico1"></div><div class="index_pop_content_left_liText">什么是采购管理？</div></li>';
str +='<li id="popli2" onclick="checkclassStyle(2);"><div id="popico2"></div><div class="index_pop_content_left_liText">为什么要重视库存管理优化?</div></li>';
str +='<li id="popli3" onclick="checkclassStyle(3);"><div id="popico3"></div><div class="index_pop_content_left_liText">连锁经营应该注意什么？</div></li>';
str +='<li id="popli4" onclick="checkclassStyle(4);"><div id="popico4"></div><div class="index_pop_content_left_liText">账本网的数据安全吗？</div></li>';
str +='<li id="popli5" onclick="checkclassStyle(5);"><div id="popico5"></div><div class="index_pop_content_left_liText">在哪里录入货品资料？</div></li>';
str +='<li id="popli6" onclick="checkclassStyle(6);"><div id="popico6"></div><div class="index_pop_content_left_liText">没有结帐，怎么看利润？</div></li>';
str +='<li id="popli7" onclick="checkclassStyle(7);"><div id="popico7"></div><div class="index_pop_content_left_liText">报表的穿透查询功能</div></li>';
str +='<li id="popli8" onclick="checkclassStyle(8);"><div id="popico8"></div><div class="index_pop_content_left_liText">现款销售如何收款？</div></li>';
str +='<li id="popli9" onclick="checkclassStyle(9);"><div id="popico9"></div><div class="index_pop_content_left_liText">货品怎么实现科学管理？</div></li>';
str +='<li id="popli10" onclick="checkclassStyle(10);"><div id="popico10"></div><div class="index_pop_content_left_liText">可否实现负库存出库？</div></li>';
str +='<li id="popli11" onclick="checkclassStyle(11);"><div id="popico11"></div><div class="index_pop_content_left_liText">销售管理可否实现冲抵业务？</div></li>';
str +='</ul>';
str +='<iframe id="popframe" scrolling="no" border="0" frameborder="0"></iframe>';
str +='</div></div></div></div>';
boht.innerHTML = str;  
}
function showMoreHelp(){
window.scrollTo(0,0);
     var bo = document.getElementsByTagName('body')[0];
     var ht = document.getElementsByTagName('html')[0];
     var boht = document.getElementById('boxs');
     var str = "";     
bo.scroll="no";  bo.style.height='100%';
bo.style.overflow='hidden';
ht.style.height='100%';  
str +='<div id="boxbg"></div><div class="boxinfo"><div class="boxcenter2" style="height:560px;width=800px;">';
str +='<div class="index_pop_title">账本网增值服务<div class="index_pop_closeBt" onclick="closeSdPanel();"></div></div>';
str +='<div class="index_pop_content">';
str +='<h2 class="index_pop_subtitle">账本网增值服务</h2>';
str +='<div class="index_pop_content_out">';
str +='<ul class="index_pop_content_left_Ul">';
str +='<li id="popli1" onclick="checkmoreStyle(1);"><div id="popico1"></div><div class="index_pop_content_left_liText">数字证书锁</div></li>';
str +='<li id="popli2" onclick="checkmoreStyle(2);"><div id="popico2"></div><div class="index_pop_content_left_liText">电话服务</div></li>';
str +='<li id="popli3" onclick="checkmoreStyle(3);"><div id="popico3"></div><div class="index_pop_content_left_liText">即时买卖</div></li>';
str +='<li id="popli4" onclick="checkmoreStyle(4);"><div id="popico4"></div><div class="index_pop_content_left_liText">增加用户数</div></li>';
str +='</ul>';
str +='<iframe id="popframe" scrolling="no" border="0" frameborder="0"></iframe>';
str +='</div></div></div></div>';
boht.innerHTML = str;  
}

//在线购买程序开始**********************************************
var sdpanel;
var aid = 0;
function buyApp(appid)
{
    aid = appid;
    //检测是否登陆

    var isok = true;
    var url = "";
    var myLeft = (screen.width-409)/2;
    var myTop = (screen.height-420)/2;
     var frame = "<iframe  src=\"javascript:false\"  style=\"position:absolute;visibility:inherit;top:0px;left:0px;width:100%;height:100%;z-index:-1;filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';\"></iframe>";    
   
    if(appid == 6)
    {
        isok = false;
        showTestSystemAffiche("抱歉，该服务将于2009年上半年启用。" + frame,true,"auto","auto",true);
        return;
    }
//   if(appid == 1 || appid>=7)
//    {
//         if(AjaxMethod.userIsOnLogin().value == "0")
//         {
//            showLogin();
//            return;
//         }

        var ifarm = "<div id='d_zz2'><iframe name='I1' id='iframe1' src='"+getRootPath()+"/OrderOnline/SelectApp.aspx?appid="+appid+"' scrolling='no' width='768' height='480' align='center' border='0' frameborder='0'>浏览器不支持嵌入式框架，或被配置为不显示嵌入式框架。</iframe></div>";
        showSdPanel("在线购买",ifarm,768,480,'boxs'); 
//    }
//    else if(appid == 6)
//    {
//        isok = false;
//        showTestSystemAffiche("抱歉，该服务将于2009年上半年启用。" + frame,true,"auto","auto",true);
//    }
//    else
//    {
//        isok = false;
//        showTestSystemAffiche("抱歉，该服务将于2008年10月启用。"  + frame,true,"auto","auto",true);
//    }
}
function hidePanelGoBuy()
{
    closeSdPanel();
//    buyApp(aid);
}
function sleep(numberMillis) {
    var now = new Date();
    var exitTime = now.getTime() + numberMillis;
    while (true) {
        now = new Date();
        if (now.getTime() > exitTime)
            return;
    }
}
//在线购买程序结束**********************************************

//打开注删窗口开始**********************************************

//function register() { 
//    var ifarm = "<div id='d_zz2'><iframe name='I1' id='iframe1' src='"+getRootPath()+"/MyAccount/UserAgreement.aspx' scrolling='no' width='898' height='497' align='center' border='0' frameborder='0'>浏览器不支持嵌入式框架，或被配置为不显示嵌入式框架。</iframe></div>";
//    sdpanel = showPanelNoBt(null,ifarm,910);
//}
//function DivBtWindowCloss()
//{
//    sdpanel.hide();
//    if(top.iframe1.div)
//    {
//        top.iframe1.div.style.display = "none";
//    }
//}
//打开注删窗口结束**********************************************

//打开试用
function openTestSystem(appid)
{
    var isok = true;
    var url = "";
    var myLeft = (screen.width-409)/2;
    var myTop = (screen.height-420)/2;

//    if(appid == 1)
//    {
//        isok = true;
//        url = "http://121.14.38.175:82/Taste.aspx?app=1"
//    }
//    else if(appid == 6)
//    {
//        isok = false;
//        showTestSystemAffiche("抱歉，该服务将于2009年上半年启用。",true,"auto","auto",myLeft,myTop,false);
//    }
//    else
//    {
//        isok = false;
//        showTestSystemAffiche("抱歉，该服务将于2008年10月启用。",true,"auto","auto",myLeft,myTop,false);
//    }
    if(appid == 6)
    {
        isok = false;
        showTestSystemAffiche("抱歉，该服务将于2009年上半年启用。",true,"auto","auto",myLeft,myTop,false);
    }
    else
    {
        isok = true;
        url = "http://www.mybook.cn/starLogin/taste.aspx?app=" + appid
    }
    if(isok)
    {
        if(CheckActiveX())
        {
            window.open(url);
        }
        else
        {
        //打开数字证书提示窗口
            showDataLetter();
        }
    }
}

function showTestSystemAffiche(msg,view,width,height,left,top,buy)
{
   var str = "";
    str += '<div id="TestSystemAffiche">';
    str += '<table width="409" border="0" align="left" cellpadding="0" cellspacing="0">';
      str += '<tr>';
        str += '<td height="33" background="'+getRootPath()+'/images/bannerrr.jpg"><table width="393" border="0" cellpadding="0" cellspacing="0">';
          str += '<tr>';
            str += '<td width="372"  style="font-size:14px; color:#FFFFFF">&nbsp;&nbsp;账本网</td>';
            str += '<td width="21"><img src="'+getRootPath()+'/images/cc.jpg" onclick="hideTestSystemAffiche()" /></td>';
          str += '</tr>';
        str += '</table></td>';
      str += '</tr>';
      str += '<tr>';
        str += '<td height="142" background="'+getRootPath()+'/images/bannerrr1.jpg"><table width="364" border="0" align="center" cellpadding="0" cellspacing="0">';
          str += '<tr>';
            str += '<td width="130" rowspan="2" align="center"><img src="'+getRootPath()+'/images/bannerrr3.jpg" /></td>';
            str += '<td width="279" height="33" align="center" valign="bottom" style=" font-size:14px; color:#000000">'+msg+'</td>';
          str += '</tr>';
          if(buy==false)
          {
              str += '<tr>';
                str += '<td height="28" align="right"><a href="#" onclick="openTestSystem(1);hideTestSystemAffiche()" style="font-size:14px">免费试用进销存管理 </a>&nbsp;&nbsp;&nbsp;&nbsp;</td>';
              str += '</tr>';
          }
          else
          {
              str += '<tr>';
                str += '<td height="28" align="right"><a href="#" style="font-size:14px"> </a>&nbsp;</td>';
              str += '</tr>';
          }
          str += '<tr>';
            str += '<td height="39" colspan="2" align="center"><a href="#" onclick="hideTestSystemAffiche()"><img src="'+getRootPath()+'/images/bannerrr4.jpg"></a></td>';
            str += '</tr>';
        str += '</table></td>';
      str += '</tr>';
      str += '<tr>';
        str += '<td><img src="'+getRootPath()+'/images/bannerrr2.jpg" /></td>';
      str += '</tr>';
    str += '</table>';
    str +='</div>';
 
    
    document.all("boxs").innerHTML = str;
}
function hideTestSystemAffiche()
{
    document.all("TestSystemAffiche").style.display = "none";
}

 function CheckActiveX()
 {
     try{
            new ActiveXObject("ADORecordsetSerializer.RecordsetSerializer2");            
            return true;
        }
        catch(e){
           return false;
        }
    return false;
 } 
 //安装数字证书

 function setupActiveX()
 {
    var boht = document.getElementById('setupActiveX');
    //AjaxMethod.SetActiveXString();
    //document.all.loadCab.src = "cab.aspx";
    //boht.innerHTML = '<OBJECT style="display:none;" TYPE="application/x-oleobject" CODEBASE="'+getRootPath()+'/账本网数字证书.exe"></OBJECT>';
    //var v = '<OBJECT style="display:none;" TYPE="application/x-oleobject" CODEBASE="star.CAB"></OBJECT>';
    //document.write( t + v);
    window.open(getRootPath()+"/账本网数字证书.exe");
 }
 
function ShowCode(item)
{
  var date = new Date();
  var Num = date.getMinutes() + date.getSeconds() + date.getMilliseconds();
  item.src = getRootPath() + '/Tools/ValidateCode.aspx?AC=' + Num;
}

function showDataLetter()
{
     window.scrollTo(0,0);
     var bo = document.getElementsByTagName('body')[0];
     var ht = document.getElementsByTagName('html')[0];
     var boht = document.getElementById('boxs');
     var str = "";    
      var myLeft = (screen.width-562)/2;
      var myTop = (screen.height-450)/2;
      bo.scroll="no";  bo.style.height='100%';
      bo.style.overflow='hidden';
      ht.style.height='100%';  
      str += '<div id="boxbg" ></div><div class="boxinfo"><div class="boxcenter" style="height:201px;width:361px;top:'+myTop+'px;left:'+myLeft+'px">';
      str += '<table width="409" border="0" cellspacing="0" cellpadding="0">';
      str += '<tr>';
      str += '<td height="34" background="'+getRootPath()+'/images/ccild-01.jpg"><table border="0" align="right" cellpadding="0" cellspacing="0">';
      str += '<tr>';
      str += '<td><a href="javascript:closeSdPanel()"><img src="'+getRootPath()+'/images/ccild.jpg" width="23" height="22" /></a></td>';
      str += '<td width="10">　</td>';
      str += '</tr>';
      str += '</table></td>';
      str += '</tr>';
      str += '<tr>';
      str += '<td height="180" background="'+getRootPath()+'/images/ccild-02.jpg"><table border="0" align="center" cellpadding="0" cellspacing="0">';
      str += '<tr>';
      str += '<td><img src="'+getRootPath()+'/images/ccild-04.jpg" width="343" height="53" /></td>';
      str += '</tr>';
      str += '<tr>';
      str += '<td height="49"><table width="278" border="0" align="center" cellpadding="0" cellspacing="0">';
      str += '<tr>';
      str += '<td width="274" height="50" style="FONT-SIZE: 12px; COLOR: #000000; LINE-HEIGHT: 22px; FONT-FAMILY: "宋体" ;">&nbsp;&nbsp;&nbsp;&nbsp;为了您的数据安全，首次使用账本网在线软件请注册数字证书。</td>'
      str += '</tr>';
      str += '</table></td>';
      str += '</tr>';
//      str += '<tr>';
//      str += '<td height="30" align="center" style="FONT-SIZE: 12px; COLOR: #043cc3; LINE-HEIGHT: 22px; FONT-FAMILY: "宋体" ;">注：注册后重启浏览器即可生效</td>';
//      str += '</tr>';
      str += '<tr>';
      str += '<td height="50" align="right"><table border="0"><tr><td><a href="javascript:setupActiveX();closeSdPanel()"><img src="'+getRootPath()+'/images/ccild-05.jpg" width="71" height="30" /></a></td><td>&nbsp;&nbsp;<a href="'+getRootPath()+"/账本网数字证书.exe"+'">直接下载数字证书文件</a></td></tr></table></td>';
      str += '</tr>';
      str += '</table></td>';
      str += '</tr>';
      str += '<tr>';
      str += '<td><img src="'+getRootPath()+'/images/ccild-03.jpg" width="409" height="6" /></td>';
      str += '</tr>';
      str += '</table></div></div>';
      boht.innerHTML = str;  
}

/*-------------------------------------------*/

//弹出登陆框
function showLogin()
{
    var ifarm = "<div id='d_zz2' style='Z-INDEX:1000;POSITION:absolute' ><iframe name='I1' id='iframe1' src='"+getRootPath()+"/UserLogin.aspx' scrolling='no' width='361' height='176' align='center' border='0' frameborder='0'>浏览器不支持嵌入式框架，或被配置为不显示嵌入式框架。</iframe></div>"; 
//    var sdpanel = showPanelNoBt(null,ifarm,218);
//    return sdpanel;
    loginForm(ifarm);
}

function loginForm(content) 
{
     window.scrollTo(0,0);
     var bo = document.getElementsByTagName('body')[0];
     var ht = document.getElementsByTagName('html')[0];
     var boht = document.getElementById('boxs');
     var str = "";    
     boht.innerHTML = '';
     bo.style.height='auto';
     bo.style.overflow='auto';
     ht.style.height='auto'; 
     if(content != "")
     {   
          var myLeft = (screen.width-562)/2;
    	  var myTop = (screen.height-450)/2;
          bo.scroll="no";  bo.style.height='100%';
          bo.style.overflow='hidden';
          ht.style.height='100%';  
          str += '<div class="boxinfo"><div class="boxcenter" style="height:201px;width:361px;position:absolute;top:'+myTop+'px;left:'+myLeft+'px">';
          str += '<table width="362" height="221" border="0" cellpadding="0" cellspacing="0">';
          str += '<tr>';
          str += '<td height="44" valign="top" background="'+getRootPath()+'/images/star_03.jpg"><table border="0" align="right" cellpadding="0" cellspacing="0">';
          str += '<tr>';
          str += '<td height="3" colspan="2">   </td>';
          str += '</tr>';
          str += '<tr>';
          str += '<td height="26" width="35"><a href="javascript:closeSdPanel(\'boxs\')"><img src="'+getRootPath()+'/images/star_0714.jpg" border="0" /></a>&nbsp;</td>';
          str += '<td>　</td>';
          str += '</tr>';
          str += '</table></td>';
          str += '</tr>';
          str += '<tr>';
          str += '<td height="177" valign="top" background="'+getRootPath()+'/images/star_07.jpg">'+content+'</td>';
          str += '</tr>';
          str += '</table></td>';
          str += '</tr>';
          str += '</table></div></div>';
          //str +='<div id="boxs"></div>';
          boht.innerHTML = str;  
     }
}

/*-------------------------------------------*/

/*弹出层
* title:标题
* content:内容
* w:层宽度
* h:层高度
* boxs:要关闭的弹出层的ID
* v:点击关闭按钮实现在的方法，如"close();"
*/
function showSdPanel(title,content,frameW,frameH,boxs,pos,v)
{     
    window.scrollTo(0,0);    
     var myLeft = (screen.Width-frameW-28)/2;
     //var myTop = !pos ? 30 : (frameH/2 + 30);  
     var myTop = !pos ? 30 : pos;     
     var bo = document.getElementsByTagName('body')[0];
     var ht = document.getElementsByTagName('html')[0];
     var boht = eval("document.getElementById('" + boxs +"')");
     var str = "";    
     boht.innerHTML = '';
     bo.style.height='auto';     
     bo.style.overflow='auto';
     ht.style.height='auto'; 
     if(title != "" && content != "")
     {   
          bo.scroll="no";  bo.style.height='100%';
          bo.style.overflow='hidden';
          ht.style.height='100%';  
          str +='<div style="z-index:999">';                 
          str +='<div id="boxbg"></div>';          
          str +='<div class="winPopOut" style="left:'+myLeft+'px; top:'+myTop+'px;">';
          str +='<div class="winPoptitle" style="width:'+(frameW+10)+'px;>';//标题部分开始         
          str +='<table width="'+frameW+'" border="0" cellspacing="0" cellpadding="0">';
          str +='<tr>';
          str +='<td width="60%" valign="middle" align="left"><span class="winPoptitleText">'+title+'</span></td>';
          var f = "closeSdPanel(\"" + boxs + "\",\"" + v + "\")";
          str +='<td align="right" valign="middle"><div  class="winPopclose" onclick=' + f +'></div></td>';
          str +='</tr>';
          str +='</table>';
          str +='</div>';//标题部分结束
          str +='<div class="winPopContentOut" style="width:'+(frameW+18)+'px;height:'+(frameH+14)+'px">';
          str +='<div class="winPopleftLine" style="height:'+(frameH+10)+'px;"></div>';
          str +='<div class="winPopContent" style="width:'+frameW+'px;height:'+frameH+'px">'+content+'</div>';//置入框架文件
          str +='<div class="winPoprightLine" style="height:'+(frameH+10)+'px"></div>';          
          str +='<div class="winPopbottomLine" style="width:'+(frameW+18)+'px;"></div>';
          str +='</div>';
          str +='</div>'; 
          str +='</div>';     
          boht.innerHTML = str;  
     }
}

//温馨提示（适合简单的页面提示）
function showAlertPanel(content,w,h,boxs,pos,v)
{
    w = 300;
    h = 100;
    var str = "";
    str = '<table style="margin-top:' + (h/2-30) +'px;" cellpadding="0" cellspacing="0" width="100%">' + 
          '      <tr><td align="center" valign="middle">' + content + '</td></tr>' + 
          '</table>';
    str += "<iframe  src=\"javascript:false\"  style=\"position:absolute;visibility:inherit;top:0px;left:0px;width:100%;height:100%;z-index:-1;filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';\"></iframe>";
          
//    pos = pos ? pos : (h/2 + 120);
    showSdPanel("温馨提示",str,w,h,boxs,pos,v); 
}

function showAlertPanelwh(content,w,h,boxs,pos,v,title)
{
    var str = "";
    str = '<table  cellpadding="0" cellspacing="0" width="100%">' + 
          '      <tr><td align="center" valign="top">' + content + '</td></tr>' + 
          '</table>';
    str += "<iframe  src=\"javascript:false\"  style=\"position:absolute;visibility:inherit;top:0px;left:0px;width:100%;height:100%;z-index:-1;filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';\"></iframe>";
    if(title == null || title == "")
    {
        showSdPanel("温馨提示",str,w,h,boxs,pos,v); 
    }
    else
    {
        showSdPanel(title,str,w,h,boxs,pos,v); 
    }
}

//弹出层内容以iframe嵌套的形式
function showFramePanel(title,url,w,h,boxs,pos,v)
{
   var ifarm = "<div id='d_zz2'><iframe name='I1' id='iframe1' src='"+url+"' scrolling='no' width='"+w+"' height='"+h+"' align='center' border='0' frameborder='0'>浏览器不支持嵌入式框架，或被配置为不显示嵌入式框架。</iframe></div>";
   showSdPanel(title,ifarm,w,h,boxs,pos,v);
 
}


//关闭弹出层
function closeSdPanel(boxs,method)
{
     if(method && method != "undefined") { 
        eval(method); 
     } else {
         window.scrollTo(0,0);
         var bo = document.getElementsByTagName('body')[0];
         var ht = document.getElementsByTagName('html')[0];
         if(!boxs) { boxs = 'boxs'; }
         var boht = eval("document.getElementById('" + boxs +"')");
         var str = "";    
         boht.innerHTML = '';
         bo.style.height='auto';
         bo.style.overflow='auto';
         ht.style.height='auto'; 
         bo.scroll="yes";
         if(document.all("UserNum1") != null)
         {
            document.all("UserNum1").style.display = "";
         }
     }
}

/*-------------------------------------------*/

//在线购买,卡数不够时点击重新购买的方法
function closeSpanAndGoSelectApp()
{
    top.I1.location.href = getRootPath() + "/OrderOnline/SelectApp.aspx";
    //closeSdPanel("boxs2");
}
//获取Cookie
function GetCookie(sName)
{
    var aCookie = document.cookie.split("; ");
    for (var i=0; i < aCookie.length; i++)
    {
        var aCrumb = aCookie[i].split("=");
        if (sName == aCrumb[0])
        return unescape(aCrumb[1]);
    }
    //return null;
}
//设置Cookie
function SetCookie(sName, sValue)
{
    date = new Date();
    date.setHours(date.getHours()+1);
    document.cookie = sName + "=" + escape(sValue) + "; expires=" + date.toGMTString();
}
