﻿    var currentMenuId=1;
    function showmenu(menuid) {
        if (document.getElementById("submenu" + currentMenuId) == null)
            currentMenuId = 2;
        if (document.getElementById("submenu" + menuid) == null)
            menuid = 2;
        document.getElementById("submenu"+currentMenuId).style.display="none";       
        document.getElementById("mainmenu"+currentMenuId).className="";
        document.getElementById("submenu"+menuid).style.display="block";
        document.getElementById("mainmenu"+menuid).className="current";   
        var ptop=0;
        if(menuid==1)
           ptop=6;
        for (var i = 1; i < menuid; i++) {
           if (document.getElementById("mainmenu" + i)!=undefined)
             ptop+=parseInt(document.getElementById("mainmenu"+i).style.height);
        }
        document.getElementById("submenu"+menuid).style.paddingTop=ptop+"px";
        currentMenuId=menuid;
  }
  function showtab(tabid)
  { 
        document.getElementById("tab"+tabid).className="current";  
  }
 function JustifyHeight()
 {
     var winHeight=$(window).height();
     //$("#bgtop").height()-$("bglefttop").height()-$("bgleftbottom").height()-76
     //80  55 13 

     if(winHeight>568)
     {
        $("#bgleftmain").height(winHeight-160);
        $("#bgcontentFrame").height(winHeight-88);                 
     }
     else
     {
        $("#bgleftmain").height(410);
        $("#bgcontentFrame").height(481);
     }
 }
 function JustifyFrameHeight(iframe)
 {
     if(iframe.src!="")
     {
         var ifrmdom=$(window.frames["bgcontentFrame"].document);   
         var winHeight=$(window).height();
         if(winHeight>568)
         {
              $(ifrmdom).find("#infoform").height(winHeight-121);
              $(ifrmdom).find("#infolist").height(winHeight-202);
              $(ifrmdom).find("#tvwInfo").height(winHeight-160);
         }
         else
         {
              $(ifrmdom).find("#infoform").height(448);
              $(ifrmdom).find("#infolist").height(368);
              $(ifrmdom).find("#tvwInfo").height(410);
         }
     }
  }
 function showFrame(url)
    {
    //随机数是为了刷新
       document.getElementById("bgcontentFrame").src=url+"&rnd="+Math.random();
    }
 function userlogout(url)
    {
       if (confirm("你确认要注销吗？")) {
            $.post("/ashx/UserLogout.ashx", {}, function(data) {
              if(url=="")
                  window.close();
              else
                   location.href = url;
            });
        }
    }
 function openwin(url,isClose) { 
        if(isClose)
        {
              window.opener=null;
              window.close();
        }
        var sWidth = parseInt(window.screen.availWidth);
        var sHeight=parseInt(window.screen.availHeight);
        var sFeatures="dialogHeight:"+sHeight+"px;dialogWidth:"+sWidth+"px;center:1;status:0;title:0;scroll:0;resizable:1;"
        //window.showModelessDialog(url,"",sFeatures);
         //写成一行
       window.open (url, "", sFeatures);
    }
function batchHandler(handle)
 {
           if(handle.toString().indexOf("Delete",0)>0)
               return confirm("你是否确认要删除?");
           else
               return true;
 }
function deleteConfirm() {
       return confirm("你是否确认要删除，不可恢复?");
 }  
function ResetConfirm()
{
      return confirm("你是否确认要将点击率清零?");
}
