var Logicms = 
{

	indicatorId : 'indicator',
	
		/*********************
		 * POKAZ INDICATOR *
		 *********************/
	
	showIndicator: function(msg)
	{
		var indicator = $(Logicms.indicatorId);
    
        var indicator_msg = $('indicator_msg');
		
        indicator_msg.innerHTML = 'Proszę czekać - trwa '+msg+'...';

		win_center = Logicms.winSize();
		pg_offset = Logicms.scrollSize();
		indicator.style.left = (win_center[0]/2-75+pg_offset[0])+'px';
		indicator.style.top = (win_center[1]/2-50+pg_offset[1])+'px';
        if(indicator.style.visibility = 'hidden')
          indicator.style.visibility = 'visible';
		Element.show(indicator);
		
	}, // showIndicator()
	
	
		/*********************
		 * SCHOWAJ INDICATOR *
		 *********************/
	hideIndicator : function ()
	{
		if($(Logicms.indicatorId))
		{
			Element.hide($(Logicms.indicatorId));
		}
	}, // hideIndicator()
	
	//------------------------------------

	winSize : function () {
		var x,y;
		// wszystko poza IE
		if (window.innerHeight) {
			x = window.innerWidth;
			y = window.innerHeight;
		}
		// IE 6 Strict Mode
		else if (document.documentElement && document.documentElement.clientHeight) {
			x = document.documentElement.clientWidth;
			y = document.documentElement.clientHeight;
		}
		// pozostale IE
		else if (document.body) {
			x = document.body.clientWidth;
			y = document.body.clientHeight;
		}
		return new Array (x, y);
	},

	scrollSize : function  () {
		var x,y;
		// wszystko poza IE
		if (self.pageYOffset || self.pageXOffset) {
			x = self.pageXOffset;
			y = self.pageYOffset;
		}
		// IE 6 Strict
		else if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft)) {
			x = document.documentElement.scrollLeft;
			y = document.documentElement.scrollTop;
		}
		// pozostale IE
		else if (document.body) {
			x = document.body.scrollLeft;
			y = document.body.scrollTop;
		}
		return new Array (x, y);
	},	
		
	viewSize : function  ()
	{
		var x,y;
		// wszystko poza IE
		if (self.innerHeight) {
			x = self.innerWidth;
			y = self.innerHeight;
		}
		// IE 6 Strict Mode
		else if (document.documentElement && document.documentElement.clientHeight) {
			x = document.documentElement.clientWidth;
			y = document.documentElement.clientHeight;
		}
		// pozostale IE
		else if (document.body) {
			x = document.body.clientWidth;
			y = document.body.clientHeight;
		}
		return new Array (x, y);
	},

	popUp : function(url, name, left, top, width, height, scrollbars) 
	{
	    window.open(url, name, "left="+left+",top="+top+",width="+width+",height="+height+",scrollbars="+scrollbars);
	    return false;		
	},
  
    toggleForm : function(element_id)
    {
      if (Element.visible(element_id))
        {
          new Effect.BlindUp(element_id, {});
        }
        else
        {
          new Effect.BlindDown(element_id, {});
        }
        setTimeout('scrollbar = new Control.ScrollBar("read_content","scrollbar_track");scrollbar.recalculateLayout()', 1000);
        return false;
    },
	
	printContent : function(url)
	{
		var h=700;
		var w=818;
		window.open(url, "printable_window", "scrollbars=1, left=100, top=100, width="+w+", height="+h);
	}

} // end Logicms