function unselect_qall()
{
for (i=0; i<=10; i++) {unselect_all(i);}
n1row=n2row=n3row=n4row=n5row=n6row=n7row=n8row=n9row=n10row=false; //init rows
return true;
}


function unselect_all(row)
{
if (row==1)
{
nxobj0 = document.getElementById('n1_0');nxobj0.style.backgroundColor = '#C1E1FE'; nxobj0.style.color='#000066';
nxobj1 = document.getElementById('n1_1');nxobj1.style.borderColor='#C1E1FE';nxobj1.style.backgroundColor='#c1e1fe';
nxobj2 = document.getElementById('n1_2');nxobj2.style.borderColor='#C1E1FE';nxobj2.style.backgroundColor='#c1e1fe';
nxobj3 = document.getElementById('n1_3');nxobj3.style.borderColor='#C1E1FE';nxobj3.style.backgroundColor='#c1e1fe';
nxobj4 = document.getElementById('n1_4');nxobj4.style.borderColor='#C1E1FE';nxobj4.style.backgroundColor='#c1e1fe';
nxobj5 = document.getElementById('n1_5');nxobj5.style.borderColor='#C1E1FE';nxobj5.style.backgroundColor='#c1e1fe';
return true;
}

if (row==2)
{
nxobj0 = document.getElementById('n2_0');nxobj0.style.backgroundColor = '#C1E1FE'; nxobj0.style.color='#000066';
nxobj1 = document.getElementById('n2_1');nxobj1.style.borderColor='#C1E1FE';nxobj1.style.backgroundColor='#c1e1fe';
nxobj2 = document.getElementById('n2_2');nxobj2.style.borderColor='#C1E1FE';nxobj2.style.backgroundColor='#c1e1fe';
nxobj3 = document.getElementById('n2_3');nxobj3.style.borderColor='#C1E1FE';nxobj3.style.backgroundColor='#c1e1fe';
nxobj4 = document.getElementById('n2_4');nxobj4.style.borderColor='#C1E1FE';nxobj4.style.backgroundColor='#c1e1fe';
nxobj5 = document.getElementById('n2_5');nxobj5.style.borderColor='#C1E1FE';nxobj5.style.backgroundColor='#c1e1fe';
return true;
}

if (row==3)
{
nxobj0 = document.getElementById('n3_0');nxobj0.style.backgroundColor = '#C1E1FE'; nxobj0.style.color='#000066';
nxobj1 = document.getElementById('n3_1');nxobj1.style.borderColor='#C1E1FE';nxobj1.style.backgroundColor='#c1e1fe';
nxobj2 = document.getElementById('n3_2');nxobj2.style.borderColor='#C1E1FE';nxobj2.style.backgroundColor='#c1e1fe';
nxobj3 = document.getElementById('n3_3');nxobj3.style.borderColor='#C1E1FE';nxobj3.style.backgroundColor='#c1e1fe';
nxobj4 = document.getElementById('n3_4');nxobj4.style.borderColor='#C1E1FE';nxobj4.style.backgroundColor='#c1e1fe';
nxobj5 = document.getElementById('n3_5');nxobj5.style.borderColor='#C1E1FE';nxobj5.style.backgroundColor='#c1e1fe';
return true;
}
if (row==4)
{
nxobj0 = document.getElementById('n4_0');nxobj0.style.backgroundColor = '#C1E1FE'; nxobj0.style.color='#000066';
nxobj1 = document.getElementById('n4_1');nxobj1.style.borderColor='#C1E1FE';nxobj1.style.backgroundColor='#c1e1fe';
nxobj2 = document.getElementById('n4_2');nxobj2.style.borderColor='#C1E1FE';nxobj2.style.backgroundColor='#c1e1fe';
nxobj3 = document.getElementById('n4_3');nxobj3.style.borderColor='#C1E1FE';nxobj3.style.backgroundColor='#c1e1fe';
nxobj4 = document.getElementById('n4_4');nxobj4.style.borderColor='#C1E1FE';nxobj4.style.backgroundColor='#c1e1fe';
nxobj5 = document.getElementById('n4_5');nxobj5.style.borderColor='#C1E1FE';nxobj5.style.backgroundColor='#c1e1fe';
return true;
}
if (row==5)
{
nxobj0 = document.getElementById('n5_0');nxobj0.style.backgroundColor = '#C1E1FE'; nxobj0.style.color='#000066';
nxobj1 = document.getElementById('n5_1');nxobj1.style.borderColor='#C1E1FE';nxobj1.style.backgroundColor='#c1e1fe';
nxobj2 = document.getElementById('n5_2');nxobj2.style.borderColor='#C1E1FE';nxobj2.style.backgroundColor='#c1e1fe';
nxobj3 = document.getElementById('n5_3');nxobj3.style.borderColor='#C1E1FE';nxobj3.style.backgroundColor='#c1e1fe';
nxobj4 = document.getElementById('n5_4');nxobj4.style.borderColor='#C1E1FE';nxobj4.style.backgroundColor='#c1e1fe';
nxobj5 = document.getElementById('n5_5');nxobj5.style.borderColor='#C1E1FE';nxobj5.style.backgroundColor='#c1e1fe';
return true;
}

if (row==6)
{
nxobj0 = document.getElementById('n6_0');nxobj0.style.backgroundColor = '#C1E1FE'; nxobj0.style.color='#000066';
nxobj1 = document.getElementById('n6_1');nxobj1.style.borderColor='#C1E1FE';nxobj1.style.backgroundColor='#c1e1fe';
nxobj2 = document.getElementById('n6_2');nxobj2.style.borderColor='#C1E1FE';nxobj2.style.backgroundColor='#c1e1fe';
nxobj3 = document.getElementById('n6_3');nxobj3.style.borderColor='#C1E1FE';nxobj3.style.backgroundColor='#c1e1fe';
nxobj4 = document.getElementById('n6_4');nxobj4.style.borderColor='#C1E1FE';nxobj4.style.backgroundColor='#c1e1fe';
nxobj5 = document.getElementById('n6_5');nxobj5.style.borderColor='#C1E1FE';nxobj5.style.backgroundColor='#c1e1fe';
return true;
}

if (row==7)
{
nxobj0 = document.getElementById('n7_0');nxobj0.style.backgroundColor = '#C1E1FE'; nxobj0.style.color='#000066';
nxobj1 = document.getElementById('n7_1');nxobj1.style.borderColor='#C1E1FE';nxobj1.style.backgroundColor='#c1e1fe';
nxobj2 = document.getElementById('n7_2');nxobj2.style.borderColor='#C1E1FE';nxobj2.style.backgroundColor='#c1e1fe';
nxobj3 = document.getElementById('n7_3');nxobj3.style.borderColor='#C1E1FE';nxobj3.style.backgroundColor='#c1e1fe';
nxobj4 = document.getElementById('n7_4');nxobj4.style.borderColor='#C1E1FE';nxobj4.style.backgroundColor='#c1e1fe';
nxobj5 = document.getElementById('n7_5');nxobj5.style.borderColor='#C1E1FE';nxobj5.style.backgroundColor='#c1e1fe';
return true;
}

if (row==8)
{
nxobj0 = document.getElementById('n8_0');nxobj0.style.backgroundColor = '#C1E1FE'; nxobj0.style.color='#000066';
nxobj1 = document.getElementById('n8_1');nxobj1.style.borderColor='#C1E1FE';nxobj1.style.backgroundColor='#c1e1fe';
nxobj2 = document.getElementById('n8_2');nxobj2.style.borderColor='#C1E1FE';nxobj2.style.backgroundColor='#c1e1fe';
nxobj3 = document.getElementById('n8_3');nxobj3.style.borderColor='#C1E1FE';nxobj3.style.backgroundColor='#c1e1fe';
nxobj4 = document.getElementById('n8_4');nxobj4.style.borderColor='#C1E1FE';nxobj4.style.backgroundColor='#c1e1fe';
nxobj5 = document.getElementById('n8_5');nxobj5.style.borderColor='#C1E1FE';nxobj5.style.backgroundColor='#c1e1fe';
return true;
}

if (row==9)
{
nxobj0 = document.getElementById('n9_0');nxobj0.style.backgroundColor = '#C1E1FE'; nxobj0.style.color='#000066';
nxobj1 = document.getElementById('n9_1');nxobj1.style.borderColor='#C1E1FE';nxobj1.style.backgroundColor='#c1e1fe';
nxobj2 = document.getElementById('n9_2');nxobj2.style.borderColor='#C1E1FE';nxobj2.style.backgroundColor='#c1e1fe';
nxobj3 = document.getElementById('n9_3');nxobj3.style.borderColor='#C1E1FE';nxobj3.style.backgroundColor='#c1e1fe';
nxobj4 = document.getElementById('n9_4');nxobj4.style.borderColor='#C1E1FE';nxobj4.style.backgroundColor='#c1e1fe';
nxobj5 = document.getElementById('n9_5');nxobj5.style.borderColor='#C1E1FE';nxobj5.style.backgroundColor='#c1e1fe';
return true;
}

if (row==10)
{
nxobj0 = document.getElementById('n10_0');nxobj0.style.backgroundColor = '#C1E1FE'; nxobj0.style.color='#000066';
nxobj1 = document.getElementById('n10_1');nxobj1.style.borderColor='#C1E1FE';nxobj1.style.backgroundColor='#c1e1fe';
nxobj2 = document.getElementById('n10_2');nxobj2.style.borderColor='#C1E1FE';nxobj2.style.backgroundColor='#c1e1fe';
nxobj3 = document.getElementById('n10_3');nxobj3.style.borderColor='#C1E1FE';nxobj3.style.backgroundColor='#c1e1fe';
nxobj4 = document.getElementById('n10_4');nxobj4.style.borderColor='#C1E1FE';nxobj4.style.backgroundColor='#c1e1fe';
nxobj5 = document.getElementById('n10_5');nxobj5.style.borderColor='#C1E1FE';nxobj5.style.backgroundColor='#c1e1fe';
return true;
}

}


function check_nall()
{
chyb = 0;
fxobj1w = document.getElementById('n1_0');
fxobj2w = document.getElementById('n2_0');
fxobj3w = document.getElementById('n3_0');
fxobj4w = document.getElementById('n4_0');
fxobj5w = document.getElementById('n5_0');
fxobj6w = document.getElementById('n6_0');
fxobj7w = document.getElementById('n7_0');
fxobj8w = document.getElementById('n8_0');
fxobj9w = document.getElementById('n9_0');
fxobj10w = document.getElementById('n10_0');


if (!n1row) {fxobj1w.style.backgroundColor = 'red';fxobj1w.style.color='white';chyb++;} else { fxobj1w.style.backgroundColor = '#C1E1FE'; fxobj1w.style.color='#000066';}
if (!n2row) {fxobj2w.style.backgroundColor = 'red';fxobj2w.style.color='white';chyb++;} else { fxobj2w.style.backgroundColor = '#C1E1FE'; fxobj2w.style.color='#000066';}
if (!n3row) {fxobj3w.style.backgroundColor = 'red';fxobj3w.style.color='white';chyb++;} else { fxobj3w.style.backgroundColor = '#C1E1FE'; fxobj3w.style.color='#000066';}
if (!n4row) {fxobj4w.style.backgroundColor = 'red';fxobj4w.style.color='white';chyb++;} else { fxobj4w.style.backgroundColor = '#C1E1FE'; fxobj4w.style.color='#000066';}
if (!n5row) {fxobj5w.style.backgroundColor = 'red';fxobj5w.style.color='white';chyb++;} else { fxobj5w.style.backgroundColor = '#C1E1FE'; fxobj5w.style.color='#000066';}
if (!n6row) {fxobj6w.style.backgroundColor = 'red';fxobj6w.style.color='white';chyb++;} else { fxobj6w.style.backgroundColor = '#C1E1FE'; fxobj6w.style.color='#000066';}
if (!n7row) {fxobj7w.style.backgroundColor = 'red';fxobj7w.style.color='white';chyb++;} else { fxobj7w.style.backgroundColor = '#C1E1FE'; fxobj7w.style.color='#000066';}
if (!n8row) {fxobj8w.style.backgroundColor = 'red';fxobj8w.style.color='white';chyb++;} else { fxobj8w.style.backgroundColor = '#C1E1FE'; fxobj8w.style.color='#000066';}
if (!n9row) {fxobj9w.style.backgroundColor = 'red';fxobj9w.style.color='white';chyb++;} else { fxobj9w.style.backgroundColor = '#C1E1FE'; fxobj9w.style.color='#000066';}
if (!n10row) {fxobj10w.style.backgroundColor = 'red';fxobj10w.style.color='white';chyb++;} else { fxobj10w.style.backgroundColor = '#C1E1FE'; fxobj10w.style.color='#000066';}

if (chyb == 0) {alert('Výborně! Všechno správně!'); return true;} 
if (chyb == 1) {alert('Máte jednu chybku!'); return true;}
if (chyb == 2) {alert('Máte dvě chyby!'); return true;} 
if (chyb == 3) {alert('Máte tři chyby!'); return true;} 
if (chyb == 4) {alert('Máte čtyři chyby!'); return true;}
if (chyb == 10) {alert('Máte všechno špatně nebo jste ještě nezačali s vyplňováním.'); return true;} 
if (chyb >= 5) {alert('Máte ' + chyb + ' chyb'); return true;} 

return true;
}

function sel1(obj, row)
{
unselect_all(row);obj.style.borderColor='gray';obj.style.backgroundColor='#ffff00'; return false;
}

function sel2(obj, row, ev, ok)
{
if (ev == 9) {return true;} //tab nn, firefox
if (ev == 0) {unselect_all(row);obj.style.borderColor='gray';obj.style.backgroundColor='#ffff00';
if ((row == 1) && (ok)) {n1row=true;}if ((row == 1) && (!ok)) {n1row=false;}
if ((row == 2) && (ok)) {n2row=true;}if ((row == 2) && (!ok)) {n2row=false;}
if ((row == 3) && (ok)) {n3row=true;}if ((row == 3) && (!ok)) {n3row=false;}
if ((row == 4) && (ok)) {n4row=true;}if ((row == 4) && (!ok)) {n4row=false;}
if ((row == 5) && (ok)) {n5row=true;}if ((row == 5) && (!ok)) {n5row=false;}
if ((row == 6) && (ok)) {n6row=true;}if ((row == 6) && (!ok)) {n6row=false;}
if ((row == 7) && (ok)) {n7row=true;}if ((row == 7) && (!ok)) {n7row=false;}
if ((row == 8) && (ok)) {n8row=true;}if ((row == 8) && (!ok)) {n8row=false;}
if ((row == 9) && (ok)) {n9row=true;}if ((row == 9) && (!ok)) {n9row=false;}
if ((row == 10) && (ok)) {n10row=true;}if ((row == 10) && (!ok)) {n10row=false;}
return false;} //nn, firefox
if ((ev == 13) || (ev ==32)) {unselect_all(row);obj.style.borderColor='gray';obj.style.backgroundColor='#ffff00';
if ((row == 1) && (ok)) {n1row=true;}if ((row == 1) && (!ok)) {n1row=false;}
if ((row == 2) && (ok)) {n2row=true;}if ((row == 2) && (!ok)) {n2row=false;}
if ((row == 3) && (ok)) {n3row=true;}if ((row == 3) && (!ok)) {n3row=false;}
if ((row == 4) && (ok)) {n4row=true;}if ((row == 4) && (!ok)) {n4row=false;}
if ((row == 5) && (ok)) {n5row=true;}if ((row == 5) && (!ok)) {n5row=false;}
if ((row == 6) && (ok)) {n6row=true;}if ((row == 6) && (!ok)) {n6row=false;}
if ((row == 7) && (ok)) {n7row=true;}if ((row == 7) && (!ok)) {n7row=false;}
if ((row == 8) && (ok)) {n8row=true;}if ((row == 8) && (!ok)) {n8row=false;}
if ((row == 9) && (ok)) {n9row=true;}if ((row == 9) && (!ok)) {n9row=false;}
if ((row == 10) && (ok)) {n10row=true;}if ((row == 10) && (!ok)) {n10row=false;}
return false;}

}

