errorImageFile = 'gfx/error.gif';
errorImage = new Image();
errorImage.src = errorImageFile;

showSubMenu = function(id)
{
	$(id).style.display = 'block';
}

loginFormUser = function(update, loginId, passwordId)
{
	//return true; // zakomentowac jak logowanie ma isc po ajaxie
	var href = "index.php5?order=login";
	var updateCeil = (update == undefined) ? "loginInfoPanel" : update;
	var loginHref = "login.php5?order=login";
	var login = $((loginId == undefined) ? 'login' : loginId).getValue();
	var password = $((passwordId == undefined) ? 'password' : passwordId).getValue();
	
	var data = "login="+login+"&password="+password;

	
	new Ajax.Request(loginHref, {
		method: "post",
		asynchronous: true,
		postBody: data,
		onComplete: function(transport)
		{
			//alert(transport.responseText);
			if (transport.responseText == "true")
			{
				document.location.href=href
			}
			else
			{
				setTimeout(function() {
										$('login').enable();
										$('password').enable();
										$('login').value = "";
										$('password').value = "";
										$('loginButton').enable();
										$(updateCeil).update("Wprowadź ponownie dane");
									  }, 2500);
				$(updateCeil).update("<img src="+ errorImageFile +" style=\"float: left; margin-right: 4px;\" alt=\"\"><b>Niepoprawny login lub hasło</b>");
			}
		},
		
		onLoading: function() 
		{
			
			
			$('login').disable();
			$('password').disable();
			$('login').disable();
			$(updateCeil).update("Proszę czekać, trwa weryfikacja");
		}
			
	});
}



updateCell = function(page, m, data)
	{
		pBody = "";
		if (m == undefined || m == "" || m == null)
		{
			m="get";
		}
		
		if (m == "post")
		{
			data.each(function(h)
			{
				pBody += h.key + "=" + h.value + "&";
			});
		}
		
		new Ajax.Request(page, {
			method: m,
			
			postBody: pBody,
			
			asynchronous: ajaxAsynchronousLocalPanel,
			
			onCreate: function(transport) {
	      		
	      	},
			//requestHeaders: ['Content-Type', 'text/html', 'Cache-Control', 'no-cache, must-revalidate'],
			
			onLoading: function() 
			{
				
			},
			
			onComplete: function(transport)
			{
				
			}
			
			/*
			onSuccess: function(transport) 
			{
					new Effect.Move('localPanel', {duration: effectDuration, x: stopX , y: stopY, mode: 'absolute' });
			}
			*/
		});
	}	
	
	
	
<!--

function displayWindow(url, width, height, left) {

        var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no,left=' + left);
				Win.focus();

}

function changeFrame() {
  return true;
  var myFrame = document.getElementById('koba_pliki');
  var myDoc = myFrame.contentWindow ? myFrame.contentWindow : myFrame.contentDocument;
  myDoc.document.body.style.fontFamily = 'verdana, sans-sefif';
  
}

function loading()
{
	$('load').style.left = ((document.body.offsetWidth-500)/2)+'px';		
	$('load').style.display = 'block';				
}
//-->	
