$(document).ready(function(){
    $.ajax({
       type: "GET",
       url: "/member/ajaxloginstate.php",
       data: "",
       success: function(data){
         $("#loading").html(data);
       }
   }); 
    $(".backtotop").click(function(){
        $('html,body').animate({scrollTop:$('#main').offset().top}, 800);
    });
     $(".freecall,.services").click(function(){
        if(navigator.userAgent.toLowerCase().indexOf('opera') != -1 && window.event.preventDefault) {
            window.event.preventDefault();
        }
       this.newWindow = window.open('http://services.speakingsaver.com/client.php?locale=zh-cn&amp;style=simplicity&amp;url='+escape(document.location.href)+'&amp;referrer='+escape(document.referrer), 'webim', 'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=0');
        this.newWindow.focus();
        this.newWindow.opener=window;return false;
     });
     
     $(".refreshvalidate").click(function(){
        $("#validateimg").attr("src",$("#validateimg").attr("src") + '?' + Math.random());
        return false;
    });
});