function ajax_post(){
	var pars   ="action=login&email=" + $F('email') + "&r1=" + $F('r1');
	var myajax = new Ajax.Request("login.php",{method:'post',parameters: pars,onLoading:show_loading,onComplete:show_result});
    return false;
}

function show_loading(){
     $('loadp').innerHTML = "<img src='images/ajax.gif'>";
}

function show_result(response){
        var r_text = response.responseText;
        $('loadp').innerHTML  = r_text;
}

function ajax_logout(){
    var myajax = new Ajax.Request("login.php",{method:'post',parameters: "action=logout",onLoading:show_loading,onComplete:show_result});
	return false;
}

function view(id){
   document.getElementById(id).value = '';
}

function ajax_out(){
    var myajax = new Ajax.Request("login.php",{method:'post',parameters: "action=logout2",onLoading:show_loading,onComplete:show_result2});
	return false;
}
function show_result2(response){
     window.location.href="index.php";
}
function del(url){
    if(confirm("Sure you want to delete?")){
	   window.location.href = url;
	}
}