    function showLogin(){
        var canvas = document.getElementById('canvas');   
        var lform = document.getElementById('loginForm');
        
        lform.style.display='block';
        canvas.style.display='block';  

        var  width = window.innerWidth?window.innerWidth:document.documentElement.clientWidth;
        var  height = window.innerHeight?window.innerHeight:document.documentElement.clientHeight;
 
        var  fullheight = document.body.scrollHeight;
        var  f_width  =   lform.clientWidth?lform.clientWidth:lform.offsetWidth;
        var  f_height  =  lform.clientHeight?lform.clientHeight:lform.offsetHeight;

        canvas.style.height=fullheight+'px'; 
        lform.style.left=(width - f_width)/2+'px';
        lform.style.top=(height - f_height )/2+'px';  
        $("input[name=login_name]")[0].focus();
        $("input[name=login_password]").keypress( function (e) { if(e.which == 13) submitLogin()});	
    }
    
    function hideLogin(){
        var canvas = document.getElementById('canvas');   
        var lform = document.getElementById('loginForm');
        
        lform.style.display='none';
        canvas.style.display='none';      
    }
    function submitLogin(){
    	$('#login_submit')[0].click();
    	return false;
    }
    function submitRestore(){
    	var form=$('FORM.restore_form')[0];
    	 
    	$.ajax({
    		   type: "POST",
    		   url: form.action,
    		   data: {submit_lost:1, lostname:$('INPUT[name=lostname]')[0].value},
    		   success: function(msg){
    			   $('#restore_msg').text(msg);
    		   }
    		 });
    	
    	return false;
    }