$.ajaxSetup({error: failure})

function logged_out(){
$.get(uf('who_is_logged'), function(logged_user) {
	if(''!=logged_user){
		location='logged_in.html'
	}else{
		// fragment is ready
		$('#logged_info').show()
	}
})
}

function logged_in(){
$.get(uf('who_is_logged'), function(logged_user) {
	if(''!=logged_user){
		$('#who_is_logged').text(logged_user)
		// fragment is ready
		$('#logged_info').show()
	}else{
		location='logged_out.html'
	}
})
}

function failure(){
	alert('operation failed. please retry.')
}

function logout(){
	$.get(uf('ajax')+'?action=logout', logged_in)
}

// url filename
function uf(filename){
	return filename+'.php' // you can change this when back-end is not PHP-based
}

function login_submit(){
	$('#message').text( 'Loading...' )
	$.post(uf('ajax')+'?action=login', $('#login').serialize(),
	function(data) {
		$('#message').text( data.message.text )
		if(data.message.status=='login successful') location = 'logged_in.html'
	})
}

function retrieve_password(){
	$.post(uf('ajax')+'?action=retrieve_password', $('#login').serialize(),
	function(data) {
		$('#message').text( data.message )
	})
}

function register_submit(){
	$.post(uf('ajax')+'?action=register', $('#register').serialize(),
	function(data) {
		$('#message').text( data.message )
	})
}

@@ -45,35 +45,32 @@
 ed_out()%7B%0A$.get(
-uf(
 'who_is_logged')
@@ -59,34 +59,37 @@
 t('who_is_logged
+.php
 '
-)
 , function(logge
@@ -243,19 +243,16 @@
 %7B%0A$.get(
-uf(
 'who_is_
@@ -257,18 +257,21 @@
 s_logged
+.php
 '
-)
 , functi
@@ -537,28 +537,25 @@
 %0A%09$.get(
-uf(
 'ajax
-')+'
+.php
 ?action=
@@ -581,128 +581,8 @@
 %0A%7D%0A%0A
-// url filename%0Afunction uf(filename)%7B%0A%09return filename+'.php' // you can change this when back-end is not PHP-based%0A%7D%0A%0A
 func
@@ -642,36 +642,33 @@
 ' )%0A%09$.post(
-uf(
 'ajax
-')+'
+.php
 ?action=logi
@@ -871,36 +871,33 @@
 ()%7B%0A%09$.post(
-uf(
 'ajax
-')+'
+.php
 ?action=retr
@@ -1039,20 +1039,17 @@
 ost(
-uf(
 'ajax
-')+'
+.php
 ?act

remove use of uf()