function ajax_post(){
	var pars   ="action=login&email=" + $F('emailInput');
	var myajax = new Ajax.Request("login.php",{method:'post',parameters: pars,onLoading:show_loading,onComplete:show_result});
    return false;
}

function show_loading(){
     $('ajax_img').src = "images/ajax.gif";
}

function show_result(response){
        var r_text = response.responseText;
        $('emailInput').value  = r_text;
        $('emailInput').style.color = "red";
		$('ajax_img').src = "images/desc/btnSearch.gif";
}

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 = '';
   document.getElementById(id).style.color = 'black';
}

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;
	}
}
