	/** return number of pixels for the height page **/
	function getStageHeight(){
		if (self.innerWidth)
			{
				frameHeight = self.innerHeight;
			}
			else if (document.documentElement && document.documentElement.clientWidth)
			{
				frameHeight = document.documentElement.clientHeight;
			}
			else if (document.body)
			{
				frameHeight = document.body.clientHeight;
			}
			return frameHeight;
	}
	
	
	/** return number of fixels for the width page **/
	function getStageWidth(){
		if (self.innerWidth)
			{
				frameWidth = self.innerWidth;
			}
			else if (document.documentElement && document.documentElement.clientWidth)
			{
				frameWidth = document.documentElement.clientWidth;
			}
			else if (document.body)
			{
				frameWidth = document.body.clientWidth;
			}
			return frameWidth;
	}
	
	
	
		/**
	* function return center of actual screen
	*
	*/
	function screenCenter(sizex,sizey)
	{

		area_height = document.documentElement.clientHeight;
		area_width = document.documentElement.clientWidth;
		yscroll = document.documentElement.scrollTop;
		xscroll = document.documentElement.scrollLeft;
		
		
		_top = (area_height/2-sizey/2)+yscroll;
		_left = (area_width/2-sizex/2)+xscroll;
		
		return [_top,_left]; 
	
	}
	
	
	
function pageHeight()
	{

	if (typeof document.height != 'undefined') {
	return document.height;
	}
	else if (document.compatMode && document.compatMode != 'BackCompat') {
	return document.documentElement.scrollHeight;
	}
	else if (document.body && typeof document.body.scrollHeight !=
	'undefined') {
	return document.body.scrollHeight;
	}
}
	
	
	
function pageWidth()
	{

	if (typeof document.width != 'undefined') {
	return document.width;
	}
	else if (document.compatMode && document.compatMode != 'BackCompat') {
	return document.documentElement.scrollWidth;
	}
	else if (document.body && typeof document.body.scrollWidth !=
	'undefined') {
	return document.body.scrollWidth;
	}
}

	
	
	
	function addWpis()
	{
		formularz = document.getElementById('formularz');
		if(!formularz) 
		{
			alert('Cos się popsuło');
			return;
		}
		
		if(formularz.style.display == 'none' || formularz.style.display == '') formularz.style.display = 'block';
		else formularz.style.display = 'none';
	
	}
	
	
	function ksiega_detale(id)
	{
		linia = document.getElementById('linia_'+id);
		if(!linia) 
		{
			alert('Cos się popsuło');
			return;
		}
		
		if(linia.style.display == 'none') linia.style.display = 'block';
		else linia.style.display = 'none';
	
	}
	
	
