function DoLogout()
{
    //document.getElementById("Loading").innerHTML = "<center>LOADING...</center>";
    //document.getElementById("Loading").innerHTML = GetStr(1000);
    
    // hook up a method that gets the response
    proxies.ProxyService.Logout.func = LogoutCallback;
     
    // now call the server
    proxies.ProxyService.Logout();
    s_sendPageName("Logout:Success","Logout");
}

function LogoutCallback(response)
{
    //document.getElementById("Loading").innerHTML = "";
    try{ RefreshCartOut();} catch(e){}
    try{ ShowCheckout(false); } catch(e){}
    try{ RefreshShareVideoOut();}catch(e){} 
//   
//    //end
//    try{
//        if(top.location.pathname=="/MyAccount.aspx")
//          GetMyAccount();
//        }catch(e){}
//        
//        try{
//        if(top.location.pathname.toLowerCase()=="/expressvu/home.aspx")
//          top.location.href="/index.htm";
//        }catch(e){}
//        
//         try{
//        if(top.location.pathname.toLowerCase()=="/expressvu/nhl.aspx")
//          top.location.href="/index.htm";
//        }catch(e){}
//        
//         try{
//        if(top.location.pathname.toLowerCase()=="/expressvu/player.aspx")
//          top.location.href="/index.htm";
//        }catch(e){}
//        
//     try{
//        if(top.location.pathname=="/index.htm" || top.location.pathname=="/")
//        {
//          if(!proxies.ProxyService.IsExpreessvuLogin())
//          {
//              document.getElementById('divIsExVu').style.display="none";
//              document.getElementById('divNotExVu').style.display="";
//             document.getElementById('imgNhlLogo').href="/ExpressVu/Reg.aspx";
//          }
//          else
//          {
//              document.getElementById('divNotExVu').style.display="none";
//              document.getElementById('divIsExVu').style.display="";
//              
//               document.getElementById('imgNhlLogo').href="/ExpressVu/Home.aspx";
//              
//          }
//        }
//        }catch(e){}
        
    try{ 
     var objects = document.getElementsByTagName("a");
           for( var i = 0; i < objects.length; i++)
           {     
            if( objects[i].getAttribute("CartIdUrl") == "aCartIdUrl" )
              objects[i].href="javascript:closeTheCart();";
             else
               continue; 
           }
       } catch(e){}
       
        try{
        if(top.location.pathname.indexOf('/MyAccount/')!=-1)
         top.location.href="/index.htm";
        }catch(e){}
        
   
        
           
   // ShowMyPanel();
    
     //jay
    top.location.href="/";
//    if (document.location.href.toLowerCase().indexOf('shoppingcart.aspx') > 0)
//        top.location.href = 'Default.aspx';
        try{
            if(isActorsDetail!=null&&isActorsDetail==true)//if is MediaPage.aspx page
                  RefreshActorsDetail();//BBM-Widget
        }catch(e){}
        

        
        
        try{
            if(isCelebrityContest!=null&&isCelebrityContest==true)//if is MediaPage.aspx page
                  RefreshCelebrityContest();//BBM-Widget
        }catch(e){}
        
        try{
            if(isCelebrityContestB!=null&&isCelebrityContestB==true)//if is MediaPage.aspx page
                  RefreshCelebrityContestB();//BBM-Widget
        }catch(e){}
        
         try{
            if(isCelebrityContestC!=null&&isCelebrityContestC==true)//if is MediaPage.aspx page
                  RefreshCelebrityContestC();//BBM-Widget
        }catch(e){}
          

       try{
            if(isCelebrityContestD!=null&&isCelebrityContestD==true)//if is MediaPage.aspx page
                  RefreshCelebrityContestD();//BBM-Widget
        }catch(e){}
          
          
          try{
            if(isEChatSupportDetail!=null&&isEChatSupportDetail==true)//if is MediaPage.aspx page
                  RefreshEChatSupport();//BBM-Widget
        }catch(e){}
          
          try{
            if(isChatError!=null&&isChatError==true)
                  RefreshChatError();
        }catch(e){}
          
          
        try{
        if(isDetail!=null&&isDetail==true)//if is MediaPage.aspx page
          RefreshWidget();//BBM-Widget
        }catch(e){}
}
function RefreshCartOut()
{
    if(document.getElementById("tbShoppingCart"))
    {
        GetShoppingCart1('1');
    }
    else
    {
        return;
    }
}

// Paul liu
// Refresh  Share Video
function RefreshShareVideoOut()
{
    if(document.getElementById(tbLogged))
    {
        document.getElementById(tbLogged).style.display="none";
        document.getElementById(tbNonLogged).style.display="block";
    }
    else
    {
        return;
    }
    return;
}
