﻿//依赖JQUERY
    $(function(){
        //自动检测登陆情况
        var head_memberid =readcookies("ceb_MemberId");
        //alert(head_memberid);
        if(parseInt(head_memberid) > 0)
        {
            $("#head_dv_loginpre").hide();
            $("#head_dv_loginend").show();
            $.ajax({
                type: "GET",
                url: "/action/memberaction.ashx?action=login_auto_head&memberid="+head_memberid+"&t="+new Date().getTime(),
                success: function(msg){
                    if(msg!=null&&msg!=""){                   
                      $("#head_dv_loginend").html(msg);
                      $("#head_dv_loading").hide();                      
                      $("#head_dv_loginend").show();
                    }
                    else
                    {                       
                       $("#head_dv_loading").hide();
                       $("#head_dv_loginpre").show();  
                    }
                },
                error:function(msg){
                   alert(msg);
                }
            });
        }
        else
        {
            $("#head_dv_loading").hide();
            $("#head_dv_loginend").hide();
            $("#head_dv_loginpre").show();            
        }
    })
    
    
//退出登陆
function head_exit()
{
   var chk=confirm("您确定要退出用户中心并注销登陆身份吗？");
   if(chk==true){
     location.href='/portal/logout.aspx?t='+new Date().getTime();
   }
}


//热键方法
function pressEvent(btnID)
{
  if(event.keyCode==13)   
  { 
      event.keyCode=9;
      event.returnValue = false;
      document.getElementById(btnID).click();
      return false;   
  }  
}


function changeResultCode(obj,result)
{
  obj.src = "/action/getcode.ashx?result="+result+"&t=" + Math.random();
}
