/* -------------------------- */
/* LOGIN */
/* -------------------------- */
/* Required: var nocache is a random number to add to request. This value solve an Internet Explorer cache issue */
var nocache = 0;

function login()
{
	// Optional: Show a waiting message in the layer with ID ajax_response
	document.getElementById('login_response').innerHTML = "Loading..."
	
	// Required: verify that all fileds is not empty. Use encodeURI() to solve some issues about character encoding.
	var ume = encodeURI(document.getElementById('username').value);
	var pwd = encodeURI(document.getElementById('password').value);

	$("#login_response").load("http://www.skgbickenbach.de/lib/ajax_login.function.php", {username: ume, password: pwd}, loginReply());
}

function login_temp() 
{
	// Optional: Show a waiting message in the layer with ID ajax_response
	document.getElementById('login_response').innerHTML = "Loading..."
	
	// Required: verify that all fileds is not empty. Use encodeURI() to solve some issues about character encoding.
	var username = encodeURI(document.getElementById('username').value);
	var password = encodeURI(document.getElementById('password').value);
	
	// Set te random number to add to URL request
	nocache = Math.random();
	
	// Pass the login variables like URL variable
	http.open('get', 'login.php?username='+email+'&password='+psw+'&nocache = '+nocache);
	http.onreadystatechange = loginReply;
	http.send(null);
}

function loginReply() 
{
	//document.getElementById('login_response').innerHTML = 'Welcome '+ ume;	
	document.getElementById('login_form').style.display = 'none';
}
