﻿// JScript 文件

var CheckLogin=function(){
    try{        
        var divLogin=document.getElementById('div_head_login');
        var myAjax=new Ajax.Request('http://price.jagol.com/CheckLogin.aspx',{
            method:'post',
            onFailure:function(res){},
            onComplete:function(res){},
            onSuccess:function(res){                         
                var u=eval(res.responseText.toString())[0]; 
                if(u.IsLogin){ 
                    var str='你好，<a href="http://user.jagol.com/" target="_self" class="cBlue">'+u.CompName+'</a> <a href="http://user.jagol.com/exit.aspx?refurl='+window.location.href+'">退出登陆</a>  | <a href="http://user.jagol.com/post_offer.aspx" target="_self" class="cBlack">发布信息<img src="/images/ico_mf.gif" alt="ico_mf" width="23" height="12" /></a> | <a href="http://user.jagol.com/" target="_self" class="cBlue">我的办公室</a> | <a href="http://china.jagol.com/product.html" target="_self" class="cBlack">价格通</a></div>';          
                    divLogin.innerHTML=str;                      
                }
            }
        });
    }catch(e){    
    }
}
Event.observe(window, 'load', CheckLogin, false);