﻿/*Session Ajax 跳转*/    

    var gotoUrl,gotoPage;
    
    function go2(toUrl,toPage)
    {        
        //向人才跳转（首先判断人才中是否已经登陆）
        //alert(IsLogin);
//        if(IsLogin)
//        {
//            gotoUrl=toUrl;
//            gotoPage=toPage;
//            var Cbo = new CallBackObject();
//            Cbo.OnComplete = Cbo_Complete;
//            Cbo.OnError = Cbo_Error;
//            Cbo.DoCallGet(toUrl+"AjaxSession.aspx");
//        }
//        else
//        {
//            location.href=toUrl+toPage;
//        }
	location.href="/Go2Aspx.aspx?m="+toUrl+"&tourl="+toPage;
    }  
    
    
    function Cbo_Error(status, statusText, responseText)
    {
        alert(responseText);
    }    
    
    function Cbo_Complete(responseText, responseXML)
    {        
        //用户在人才是否登陆        MsgShow("正在为您自动登陆！",0);
        if(responseText=="true")
        {
            //如果登陆后直接跳转不转Session
            location.href=gotoUrl+gotoPage;
        }
        else
        {
            //人才Session登陆
            //SetSession();
            location.href="/Go2Aspx.aspx?m="+gotoUrl+"&tourl="+gotoPage;
        }
    }
    
    function SetSession()
    {
        //将Session初始化        var Cbo = new CallBackObject();
        Cbo.OnComplete = Cbo_SetSession;
        Cbo.OnError = Cbo_Error;
        Cbo.DoCallGet("/hr/AjaxSession.aspx?prm=loging");
    }
    
    function Cbo_SetSession(responseText, responseXML)
    {
        //转换session
        if(responseText=="ok")
            location.href="/";
        else if(responseText=="erro")
            alert("初始错误！");
        else
        {            
            var Cbo = new CallBackObject();
            Cbo.OnComplete = Cbo_GoSession;
            Cbo.OnError = Cbo_Error;
            Cbo.DoCallGet("/AjaxSession.aspx?prm=sessioncom&skey="+responseText);
        }            
    }
    
    function Cbo_GoSession(responseText, responseXML)
    {
        //转换完成跳转
        location.href="/";       
    }    
   
    function MsgShow(msgString,sTime)
    {          
    //显示提示信息
        document.getElementById("div_Msg").style.display="block";		        
        document.getElementById("div_Msg").innerHTML=msgString;
        if(sTime!=0)
        {
            window.setTimeout("DivHid();",sTime);
        }
    }

    function DivHid()
    {//隐藏提示框        
        document.getElementById("div_Msg").style.display="none";    
    }
   
document.write("<div id='div_Msg' style='position: absolute; padding: 12px; width: 400px; height: 40px;border: #000000 1px solid ;  background-color: White; text-align: justify; display:none; 264px; top: 240px;'><div align='center'></div></div>");
