// NB: Requires ajaxutils.js
G_page_strAppAbsoluteURL = "";
function ajaxLoginFunction(strAppAbsoluteURL)
{
	G_page_strAppAbsoluteURL = strAppAbsoluteURL;
	var account_ref = document.getElementById('loginbox_account_ref').value;
	var password = document.getElementById('loginbox_password').value;
	var queryString = "?account_ref=" + escape(account_ref) + "&password=" + escape(password);
  ajax_getResponse(strAppAbsoluteURL + "/inc/class_page_rs.php" + queryString, ajaxLoginFunction_callback);
}
function ajaxLoginFunction_callback(strCode)
{
  if (strCode != "[OKAY]")
  	alert(strCode);
  else
  {
    // The remote page has started a session for the user. Reload whatever page we happen to be on - it
    // will behave differently now the user is logged in (the login box will not be rendered, plus
    // the particular page may now allow users to order etc.)
  	window.location.reload();
    // Now the idea is to go to products page regardless of where user was when they logged on:
//    window.location.href = G_page_strAppAbsoluteURL + "/products/products_main.php";
  }
}

function clearme(searchBox)
{
	document.getElementById(searchBox).value = ""
}



