		function resizeImageContainer(imgObject)
		{
			Element.hide('bigImage');
			$('bigImage').update('<img src="'+imgObject.src+'" alt="" />');
			screenHeight = Element.getHeight($('mainBody'));;
			screenWidth = Element.getWidth($('mainBody'));
			panelHeight = Element.getHeight('bigImage'); 
			panelWidth = Element.getWidth('bigImage');
			relativePos = Position.page($('mainBody'));
			//stopY = Math.round(((screenHeight-panelHeight) / 2) + (-relativePos[1])/2);
			stopY = Math.round(((screenHeight-panelHeight) / 2) + (-relativePos[1]));
			stopX = Math.round((screenWidth-panelWidth) / 2);
			if (stopX < 0 ) stopX = 0;
			if (stopY < 0 ) stopY = 0;
			new Effect.Move('bigImage', {duration: 0.4, x: stopX , y: stopY, mode: 'absolute' });		 		
			//new Effet.Grow('bigImage', {direction: 'center', duration: 0.4});
			new Effect.Appear('bigImage', {duration: 0.4});
		}
	
		showBigReference = function(srcImage)
		{
				myImgRef = new Image();
		
				myImgRef.onload = function()
				{
					resizeImageContainer(myImgRef);
				}
				myImgRef.src = 'img/referencje/'+srcImage;
		}

		showBigZycie = function(srcImage)
		{
				myImgRef = new Image();
		
				myImgRef.onload = function()
				{
					resizeImageContainer(myImgRef);
				}
				myImgRef.src = 'img/zycie/'+srcImage;
		}

		slide = function(obj)
		{
			if ( $(obj).visible() )
			{
				new Effect.SlideUp(obj, {duration: 0.3});
			}	
			else
			{
				new Effect.SlideDown(obj, {duration: 0.3});
			}
		}
		
		var mailWindow = null;
		
		kontaktMailWindow = function()
		{
			var _strona 	= $('strona').getValue();
			var _tresc		= $('tekst').getValue();
			var _mailto 	= $('email').getValue();
			var _telefon	= $('telefon').getValue();
			var _adres		= $('adres').getValue();
			
			var h = $H({ strona: _strona, tresc: _tresc, mailto: _mailto, telefon: _telefon, adres: _adres });
			
			if ( mailWindow == null || mailWindow.closed )
				mailWindow = window.open('load.php?src=send', 'Kontakt', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=300');
			else
			{
				mailWindow.close();
				mailWindow = window.open('load.php?src=send', 'Kontakt', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=300');
			}	
				
			mailWindow.dane = h;
			
			//alert( mailWindow.dane.toQueryString() );
		}
		
		wycenaMailWindow = function()
		{
			if ( mailWindow == null || mailWindow.closed )
				mailWindow = window.open('load.php?src=wycena', 'Wycena', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=450,height=600');
			else
			{
				mailWindow.close();
				mailWindow = window.open('load.php?src=wycena', 'Wycena', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=450,height=600');
			}
		}
