function regData(id, r, t) {
	if ((id.value == t) && (!r))
		id.value = '';
	if ((id.value == '') && r)
		id.value = t;
}
function checkLogonForm(id) {
	if (id.elements[0].value == 'podaj login' || id.elements[0].value == '' || id.elements[1].value == 'podaj hasło' || id.elements[1].value == '') {
		window.alert('Wypełnij prawidłowo formularz');
		return false;
	}
	return true;
}
function checkSearchForm(id) {
	if (id.elements[0].value == 'wpisz frazę, której chcesz szukać...' || id.elements[0].value == '') {
		window.alert('Wypełnij prawidłowo formularz');
		return false;
	}
	return true;
}
function setFontSize(ids, size) {
	for (var i = 0; i < ids.length; i++)
		document.getElementById(ids[i]).style.fontSize = size;
}
function printPage(link) {
	var print = window.open(link, 'printWindow', 'toolbar=no,menubar=yes,location=no,personalbar=no,scrollbars=yes,directories=no,status=no,resizable=yes,width=800,height=600');
	print.focus();
}
function showCommentForm(id) {
	document.getElementById('dodaj_komentarz').style.display = 'block';
	setTimeout('document.location = "' + id.href + '";', 1);
	return false;
}
function getXPosition(id) {
	var i = 0;
	if (id.offsetParent) {
		while (id.offsetParent) {
			if (id.style.position != 'absolute')
				i += id.offsetLeft;
			id = id.offsetParent;
		}
	} else if (id.x)
		i += id.x;
	return i;
}
function getYPosition(id) {
	var i = 0;
	if (id.offsetParent) {
		while (id.offsetParent) {
			if (id.style.position != 'absolute')
				i += id.offsetTop;
			id = id.offsetParent;
		}
	} else if (id.y)
		i += id.y;
	return i;
}
var ttXpos = 0, ttYpos = 0;
var ttXadd = 10, ttYadd = -10;
var ttDisplay = 0, ttHoldIt = 0;
var ttTimerID = 0;
var toolTipContainer;
function setToolTip(text, id) {
	if (id && navigator.appName.indexOf('Opera') != -1)
		return false;
	toolTipContainer = document.getElementById('toolTipBox');
	var plusX = 0, plusY = 0;
	if (navigator.appName.indexOf('Explorer') != -1 || navigator.appName.indexOf('Opera') != -1 || navigator.userAgent.indexOf('Safari') != -1) {
		if (document.documentElement && document.documentElement.scrollTop) {
			plusX = document.documentElement.scrollLeft;
			plusY = document.documentElement.scrollTop;
		} else {
			plusX = document.body.scrollLeft;
			plusY = document.body.scrollTop;
		}
	}
	document.getElementById('toolTipContainer').innerHTML = text;
	if (id && navigator.appName.indexOf('Netscape') == -1) {
		toolTipContainer.style.left = ttXpos - 210 - ttXadd + getXPosition(document.getElementById(id)) + 'px';
		toolTipContainer.style.top = ttYpos + ttYadd + getYPosition(document.getElementById(id)) + 'px';
	} else {
		toolTipContainer.style.left = ttXpos - 210 - ttXadd + plusX + 'px';
		toolTipContainer.style.top = ttYpos + ttYadd + plusY + 'px';
	}
	holdToolTip();
}
function holdToolTip() {
    ttHoldIt = 1;
    swapToolTip('true');
    ttHoldIt = 0;
}
function swapToolTip(stat, id) {
	if (id && navigator.appName.indexOf('Opera') != -1)
		return false;
	if (ttHoldIt != 1) {
		if (stat != 'default') {
			if (stat == 'true')
				showToolTip(true);
			else if (stat == 'false')
				showToolTip(false);
		} else {
			if (ttDisplay)
				ttTimerID = setTimeout('showToolTip(false);', 500);
			else
				showToolTip(true);
		}
	} else {
		if (ttTimerID) {
			clearTimeout(ttTimerID);
			ttTimerID = 0;
		}
		showToolTip(true);
	}
}
function showToolTip(stat) {
	if (!stat) {
		toolTipContainer.style.visibility = 'hidden';
		ttDisplay = 0;
	} else {
		toolTipContainer.style.visibility = 'visible';
		ttDisplay = 1;
	}
}
function mouseMove(e) {
	if ((typeof event) != 'undefined') {
		ttXpos = event.x;
		ttYpos = event.y;
	} else {
		ttXpos = e.pageX;
		ttYpos = e.pageY;
	}
}
document.onmousemove = mouseMove;
