// CHECKBOX PLACE
place=new Array(10);
hl = place.length;
for (qh = 1; qh <= hl; qh++)
	place[qh]=new Array(5);

function ocenplace(id, name) {
	if(place[name][id] != true) {
		document.getElementById('img' + name + '0').src = 'grafika/oceny/1_off.png';
		for (x = 1; x <= id; x++) {
			srcgraph_on = 'grafika/oceny/'+x+'_on.png';	
			document.getElementById('img' + name + x).src = srcgraph_on; //change the image
        	place[name][x] = true; //change the value for this ocenplace in the array
		}
	}
    else {
		for (x = 5; x > id; x--) {
			srcgraph_off = 'grafika/oceny/'+x+'_off.png';
			document.getElementById('img' + name + x).src = srcgraph_off;
			place[name][x] = false;
		}
	}
	if (id == 0) {
		document.getElementById('img' + name + id).src = 'grafika/oceny/1_on.png';
		for (x = 5; x > id; x--) {
			srcgraph_off = 'grafika/oceny/'+x+'_off.png';	
			document.getElementById('img' + name + x).src = srcgraph_off;
			place[name][x] = false;
		}
	}	
	document.getElementById('inp' + name).value = id; //change the field value
}

// CHECKBOX POLEĈ
polec=new Array(9);
pl = polec.length;
for (qp = 1; qp <= pl; qp++)
	polec[qp]=new Array(5);

function polecplace(id, name) {
	if(polec[name][id] != true) {
		document.getElementById('imgp' + name + '0').src = 'grafika/oceny/1_off.png';
		for (x = 1; x <= id; x++) {
			srcgraph_on = 'grafika/oceny/'+x+'_on.png';	
			document.getElementById('imgp' + name + x).src = srcgraph_on; //change the image
        	polec[name][x] = true; //change the value for this ocenpolec in the array
		}
	}
    else {
		for (x = 5; x > id; x--) {
			srcgraph_off = 'grafika/oceny/'+x+'_off.png';
			document.getElementById('imgp' + name + x).src = srcgraph_off;
			polec[name][x] = false;
		}
	}
	if (id == 0) {
		document.getElementById('imgp' + name + id).src = 'grafika/oceny/1_on.png';
		for (x = 5; x > id; x--) {
			srcgraph_off = 'grafika/oceny/'+x+'_off.png';	
			document.getElementById('imgp' + name + x).src = srcgraph_off;
			polec[name][x] = false;
		}
	}	
	document.getElementById('inpp' + name).value = id; //change the field value
}