/**** DATABASE FUNCTIONS *****/
/* works with tab.js **/
/* Constants to move to jquery.bm_database*/
var LOGIN_URL = "php/login.php";
var LOGEVENT_URL = "php/logEvent.php";



/************ FUNCTIONS WHICH INVOLVE DATABASE COMMUNICATION ***************/

function logEvent(piWhichEvent)
{
	try
	{
		var sParams = "?event="+piWhichEvent+"&user_key="+$.bm_login.current_user_key+"&login_name="+document.getElementById("username");
		httpRequest.open("GET", LOGEVENT_URL+sParams, true);
		httpRequest.onreadystatechange = logEventHttpResponse;
		httpRequest.send(null)	
	} catch(err)
	{
		errorHandler("logEvent",err);
		$.bm_login.login_in_process = false;
	}
}
function logEventHttpResponse()
{
	try
	{
		if (httpRequest.readyState == 4) 
		{
			var sResults = httpRequest.responseText;
			var e;
			//alert("LOG EVENT RESULTS "+sResults);
		}
	} catch(err)
	{
		errorHandler("logEventHttpResponse",err);
	}
}



/****** END OF DATABASE FUNCTIONS **************/

