function checkChecked(obj) {
	var maxchecked = 3;
	var chkcount = 0;
	var els = obj.form.elements;
	for(var i=0; i<els.length; i++) {
		if(els[i].tagName.toLowerCase() == 'input') {
			var typ = els[i].type.toLowerCase();
			if(typ == 'checkbox') {
				if(els[i].checked) {
					chkcount++;
				}
				if(chkcount > maxchecked) {
					obj.checked = false;
					alert('Możesz wybrać maksymalnie ' + maxchecked + ' kategorie.');
					break;
				}
			}
		}
	}
}


function color(tableRow, highLight) {
	if(highLight) {
		tableRow.style.backgroundColor = '#ffffdf';
	} else {
		tableRow.style.backgroundColor = '#ffffff';
	}
}

function link(url) {
	document.location.href = url;
}
