function login_process()
{
	var l = xajax.$('logins').value;
	var p = xajax.$('password').value;
	var i = xajax.$('login_error_msg');
	
	i.innerHTML = "Trwa proces logowania...";
	
	if(l != "" && p != "")
	{
		xajax_login(l, MD5(p));
	}
	else
		i.innerHTML = "Proszę wypełnić obydwa pola formularza";	
}

function check(wotForm, wotState) 
{
	for (i=0; i<wotForm.elements.length; i++) 
	{
		if (wotForm.elements[i].id.indexOf("delete_") == 0) 
			 wotForm.elements[i].checked = wotState ;
	}
}

if(xajax)
{
	function setOverDiv()
	{

		if (window.innerWidth)
		{
			var w = window.innerWidth;
			var h = window.innerHeight;
			var ph = document.height;
			var t = window.pageYOffset;
			
			if(ph == 0)
				ph = h;
		}
		else if (document.all)
		{
			var w = document.body.clientWidth;
			var h = document.body.clientHeight;
			var ph = h = document.body.scrollHeight;
			var t = document.body.scrollTop;
		}
		
		var div = document.getElementById('overDiv');
		div.style.width = w + "px";
		div.style.height = ph + "px";

		var div = document.getElementById("loading");
		div.style.position = "absolute";
		div.style.top = (((h/2)+t) - 110) + "px";
		div.style.left = ((w/2) - 150) + "px";
	}

	function hiddenBox()
	{
		var overDiv = document.getElementById('overDiv');
		var busy = document.getElementById('loading'); 
		overDiv.style.display = "none"; 
		busy.style.display = "none"; 
	}

	function showBox()
	{
		setOverDiv();
		var overDiv = document.getElementById('overDiv');
		var busy = document.getElementById('loading'); 
		overDiv.style.display = "block"; 
		busy.style.display = "block";
	} 
	
//	xajax.doneLoadingFunction = hiddenBox;
//	xajax.loadingFunction = showBox;
}

function markBlock(obj, bg_color, border_color)
{
	obj.style.background = bg_color;
	obj.style.border = '1px solid '+border_color;
}

function unmarkBlock(obj, bg_color, border_color)
{
	obj.style.background = bg_color;
	obj.style.border = '1px solid'+border_color;
}

function potwierdz(question) 
{
	question = (question == null) ? "Czy kontynuować?" : question;
	var answer = window.confirm(question);
	
	if (answer)
		return true
	else
		return false;
}  

function show_flash(id) 
{
	document.getElementById(id).outerHTML = document.getElementById(id).outerHTML;
}
