	function findPosX (obj){
		var curleft = 0;
		if (obj.offsetParent)
		{
			while (obj.offsetParent)
			{
				curleft += obj.offsetLeft
				obj = obj.offsetParent;
			}
		}
		else if (obj.x)
			curleft += obj.x;
		return curleft;
	}
	function findPosY (obj){
		var curtop = 0;
		if (obj.offsetParent)
		{
			while (obj.offsetParent)
			{
				curtop += obj.offsetTop
				obj = obj.offsetParent;
			}
		}
		else if (obj.y)
			curtop += obj.y;
		return curtop;
	}

function displayConfirmBox(akcja, nazwa, url, ClickDiv)
{
	//new Effect.Appear('confirm_box');
	$('confirm_box').style.display = 'inline';
	//$('confirm_box').style.top = document.body.scrollTop+myHeight-400+'px';
	if(ClickDiv != null)
	{	$('confirm_box').style.top = findPosY($(ClickDiv)) + 'px';	}
	$('ajax_box_msg').innerHTML = 'Czy na pewno chcesz '+akcja+' '+nazwa+' ?<br />	<form method="POST" action="'+url+'"><input type="hidden" name="is_confirmed" value="1"><input type="submit" value="TAK">  <input type="button" onclick="new Effect.SwitchOff(\'confirm_box\'); " value="Anuluj" /></form>';

}

function radioVal(el, radioGroup)
{
	var res = $(el).getInputs('radio', radioGroup).find(function(re) {return re.checked;});
	if(res != null) {
		return $F(res);
	} 
	else {
		return "";
	}	
}

function findPosX(obj){
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
	curleft += obj.x;
	return curleft;
}

function findPosY(obj){
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
	curtop += obj.y;
	return curtop;
}

function zaznacz_wszystkie(thisForm)
{
	for (i = 0; i < thisForm.zaznacz_id.length; i++)
	{
		thisForm.zaznacz_id[i].checked=true
	}
}

function odznacz_wszystkie(thisForm)
{
	for (i = 0; i < thisForm.zaznacz_id.length; i++)
	{
		thisForm.zaznacz_id[i].checked=false
	}
} 

function implodeOptions(thisForm)
{
	var ideki = '';
	for (i = 0; i < thisForm.zaznacz_id.length; i++)
	{
		if(thisForm.zaznacz_id[i].checked == true)
		{
			ideki += thisForm.zaznacz_id[i].value+',';
		}
	}
	return ideki;
}

// centruje i uwzglednia przewiniecie okna w dol
function wycentrujPrzesun (obj, ww, hh) {
		var przesuniecie = document.documentElement.scrollTop || document.body.scrollTop;
		oszer =  ww;
		owys = hh;
		if (navigator.appName.indexOf('Explorer') != 0) bwys = document.body.clientHeight;
		else bwys = document.documentElement.clientHeight;
		//wspY = Math.round(bwys/2) - Math.round(owys/2);
		wspY = 50;
		wspX = Math.round(document.body.clientWidth/2) - Math.round(oszer/2);
		with (document.getElementById(obj).style) {
			left = wspX + 'px';
			top = wspY + przesuniecie + 'px';
			zIndex = '999';
		}
}
		
function getPageSizeWithScroll () {
	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
  	}
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
	return arrayPageSizeWithScroll;
}

function pelnyEkran (obj) {
	if (document.all) bwys = document.body.clientHeight;
	else bwys = document.documentElement.clientHeight;
	pagesize = getPageSizeWithScroll();
	bwys = pagesize[1];
	bszer = document.body.clientWidth;		
	with (document.getElementById(obj).style) {
		width = bszer + 'px';
		height = bwys + 'px';
		top = '0px';
		left = '0px';
		zIndex = '998';
		display = 'block'
	}	
}

function podswietlKomunikat()
{
	//new Effect.Highlight('info',{endcolor:'#B3DCDF', restorecolor: '#B3DCDF',duration: 2.0});	
	//new Effect.Shake('info', {duration: 4.0});	
	new Effect.Pulsate('info',{ duration: 2.0, pulses: 3});	
}

function podswietlPole(aPola)
{
	items = aPola.split(',');
	new Effect.multiple(items, Effect.Highlight, {endcolor:'#FF999B', duration: 1.0});
}

function rozwinFormularz()
{
	form = $('zaloz_form').getElementsByTagName('p');
	new Effect.multiple(form, Effect.Opacity, { from: 0, to: 1 });

}

function step1()
{
	new Effect.Pulsate('step1_list', {duration: 1.0,pulses: 2});
	//new Effect.Shake('step1_list', {duration: 1.0,pulses: 2});
	setTimeout('step2()', 2000);
}

function step2()
{
	new Effect.Pulsate('step2_list', {duration: 1.0,pulses: 2});
	//new Effect.Shake('step2_list', {duration: 1.0,pulses: 2});
	setTimeout('step3()', 2000);
}

function step3()
{
	new Effect.Pulsate('step3_list', {duration: 1.0,pulses: 2});
	//new Effect.Shake('step3_list', {duration: 1.0,pulses: 2});
	setTimeout('step1()', 3000);
}
