function processForm(form) {
	if (form=='')
		form = document.getElementById('mainform');

	if (this.checkForm)
		if (!checkForm(form))
			return false;

	if (form.action=='')
		form.action = document.location;
	if (form._action.value=='')
		form._action.value='send_form';

//	form.submit();
//	return false;
}

function processSendContentForm(form_code) {
	document.getElementById('form_code').value = form_code;
	document.getElementById('_action').value = 'send_form';
	document.getElementById('mainform').action = document.location;
	//return processForm(f);
}

function processSearch(lang) {
	form = document.getElementById('mainform');
	form.action = '/index.php?p=search&lang='+lang;
	form._action.value = 'search';
	form.method = 'post';
}

function createWindow(url, w, h, scroll) {
	if (w==null)
		w = 630;
	if (h==null)
		h = 500;
  window.open(url, '', 'width='+w+', height='+h+', toolbar=no,status=yes,resizable=no,scrollabars=no');
/*
	toolbar[=yes|no]|[=1|0]
	location[=yes|no]|[=1|0]
	directories[=yes|no]|[=1|0]
	status[=yes|no]|[=1|0]
	menubar[=yes|no]|[=1|0]
	scrollbars[=yes|no]|[=1|0]
	resizable[=yes|no]|[=1|0]
	width=pixels
	height=pixels
*/
}


function FP_swapImg() {//v1.0
 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
 n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
 elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}
function FP_swapImgRestore() {//v1.0
 var doc=document,i; if(doc.$imgSwaps) { for(i=0;i<doc.$imgSwaps.length;i++) {
  var elm=doc.$imgSwaps[i]; if(elm) { elm.src=elm.$src; elm.$src=null; } } 
  doc.$imgSwaps=null; }
}

function FP_preloadImgs() {//v1.0
 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}

function en_test_it() {

total = 0;

if(document.mainform.q1[1].checked)
{total = total+1;}

if(document.mainform.q2[3].checked)
{total = total+1}

if(document.mainform.q3[1].checked)
{total = total+1}

if(document.mainform.q4[1].checked)
{total = total+1}

if(document.mainform.q5[1].checked)
{total = total+1}

if(document.mainform.q6[1].checked)
{total = total+1}

if(document.mainform.q7[3].checked)
{total = total+1}

if(document.mainform.q8[1].checked)
{total = total+1}

if(document.mainform.q9[2].checked)
{total = total+1}

if(document.mainform.q10[1].checked)
{total = total+1}

if(document.mainform.q11[3].checked)
{total = total+1;}

if(document.mainform.q12[1].checked)
{total = total+1}

if(document.mainform.q13[2].checked)
{total = total+1}

if(document.mainform.q14[2].checked)
{total = total+1}

if(document.mainform.q15[2].checked)
{total = total+1}

if(document.mainform.q16[3].checked)
{total = total+1}

if(document.mainform.q17[0].checked)
{total = total+1}

if(document.mainform.q18[0].checked)
{total = total+1}

if(document.mainform.q19[1].checked)
{total = total+1}

if(document.mainform.q20[0].checked)
{total = total+1}

if(document.mainform.q21[3].checked)
{total = total+1;}

if(document.mainform.q22[2].checked)
{total = total+1}

if(document.mainform.q23[0].checked)
{total = total+1}

if(document.mainform.q24[0].checked)
{total = total+1}

if(document.mainform.q25[3].checked)
{total = total+1}

if(document.mainform.q26[1].checked)
{total = total+1}

if(document.mainform.q27[1].checked)
{total = total+1}

if(document.mainform.q28[1].checked)
{total = total+1}

if(document.mainform.q29[1].checked)
{total = total+1}

if(document.mainform.q30[2].checked)
{total = total+1}

if(document.mainform.q31[3].checked)
{total = total+1;}

if(document.mainform.q32[0].checked)
{total = total+1}

if(document.mainform.q33[1].checked)
{total = total+1}

if(document.mainform.q34[3].checked)
{total = total+1}

if(document.mainform.q35[3].checked)
{total = total+1}

if(document.mainform.q36[1].checked)
{total = total+1}

if(document.mainform.q37[2].checked)
{total = total+1}

if(document.mainform.q38[3].checked)
{total = total+1}

if(document.mainform.q39[3].checked)
{total = total+1}

if(document.mainform.q40[2].checked)
{total = total+1}

if(document.mainform.q41[2].checked)
{total = total+1;}

if(document.mainform.q42[2].checked)
{total = total+1}

if(document.mainform.q43[1].checked)
{total = total+1}

if(document.mainform.q44[1].checked)
{total = total+1}

if(document.mainform.q45[2].checked)
{total = total+1}

if(document.mainform.q46[0].checked)
{total = total+1}

if(document.mainform.q47[1].checked)
{total = total+1}

if(document.mainform.q48[0].checked)
{total = total+1}

if(document.mainform.q49[2].checked)
{total = total+1}

if(document.mainform.q50[1].checked)
{total = total+1}

if (total<=0) { vysledek = 'Bohužel, žádná z Vašich odpovědí nebyla správná.'; } 
else if (total<=10) { vysledek = 'Elementary/začátečník.'; }
else if (total<=20) { vysledek = 'Pre-intermediate/mírně pokročilý (předpoklad ke složení KET).'; }
else if (total<=30) { vysledek = 'Intermediate/ středně pokročilý (předpoklad ke složení PET).'; }
else if (total<=40) { vysledek = 'Upper-intermediate/pokročilý (předpoklad ke složení státní zkoušky nebo FCE).'; }
else { vysledek = 'Advanced/velmi pokročilý (předpoklad ke složení CAE).'; }

vysledek = '<h2>Hodnocení</h2><p><strong>' + vysledek + '</strong><br /><br />Získaná informace je pouze orientační, pro přesnější a důkladnější posouzení vaší jazykové úrovně je nutné zvolit komplexnější metody testování (IELTS apod.).</p>';
document.getElementById('quiz_result').innerHTML = vysledek;
}

function de_test_it() {

total = 0;

if(document.mainform.q1[0].checked)
{total = total+1;}

if(document.mainform.q2[1].checked)
{total = total+1}

if(document.mainform.q3[0].checked)
{total = total+1}

if(document.mainform.q4[2].checked)
{total = total+1}

if(document.mainform.q5[1].checked)
{total = total+1}

if(document.mainform.q6[2].checked)
{total = total+1}

if(document.mainform.q7[0].checked)
{total = total+1}

if(document.mainform.q8[2].checked)
{total = total+1}

if(document.mainform.q9[0].checked)
{total = total+1}

if(document.mainform.q10[0].checked)
{total = total+1}

if(document.mainform.q11[2].checked)
{total = total+1;}

if(document.mainform.q12[1].checked)
{total = total+1}

if(document.mainform.q13[0].checked)
{total = total+1}

if(document.mainform.q14[1].checked)
{total = total+1}

if(document.mainform.q15[2].checked)
{total = total+1}

if(document.mainform.q16[0].checked)
{total = total+1}

if(document.mainform.q17[0].checked)
{total = total+1}

if(document.mainform.q18[2].checked)
{total = total+1}

if(document.mainform.q19[2].checked)
{total = total+1}

if(document.mainform.q20[1].checked)
{total = total+1}

if(document.mainform.q21[1].checked)
{total = total+1;}

if(document.mainform.q22[0].checked)
{total = total+1}

if(document.mainform.q23[2].checked)
{total = total+1}

if(document.mainform.q24[0].checked)
{total = total+1}

if(document.mainform.q25[2].checked)
{total = total+1}

if(document.mainform.q26[1].checked)
{total = total+1}

if(document.mainform.q27[1].checked)
{total = total+1}

if(document.mainform.q28[2].checked)
{total = total+1}

if(document.mainform.q29[0].checked)
{total = total+1}

if(document.mainform.q30[0].checked)
{total = total+1}

if(document.mainform.q31[2].checked)
{total = total+1;}

if(document.mainform.q32[2].checked)
{total = total+1}

if(document.mainform.q33[1].checked)
{total = total+1}

if(document.mainform.q34[0].checked)
{total = total+1}

if(document.mainform.q35[1].checked)
{total = total+1}

if(document.mainform.q36[2].checked)
{total = total+1}

if(document.mainform.q37[0].checked)
{total = total+1}

if(document.mainform.q38[0].checked)
{total = total+1}

if(document.mainform.q39[1].checked)
{total = total+1}

if(document.mainform.q40[0].checked)
{total = total+1}

if(document.mainform.q41[2].checked)
{total = total+1;}

if(document.mainform.q42[2].checked)
{total = total+1}

if(document.mainform.q43[2].checked)
{total = total+1}

if(document.mainform.q44[1].checked)
{total = total+1}

if(document.mainform.q45[2].checked)
{total = total+1}

if(document.mainform.q46[0].checked)
{total = total+1}

if(document.mainform.q47[0].checked)
{total = total+1}

if(document.mainform.q48[1].checked)
{total = total+1}

if(document.mainform.q49[0].checked)
{total = total+1}

if(document.mainform.q50[0].checked)
{total = total+1}

if (total<=0) { vysledek = 'Bohužel, žádná z Vašich odpovědí nebyla správná.'; } 
else if (total<=16) { vysledek = 'Začátečník'; }
else if (total<=33) { vysledek = 'Mírně pokročilý'; }
else { vysledek = 'Pokročilý'; }

vysledek = '<h2>Hodnocení</h2><p><strong>' + vysledek + '</strong><br /><br />Získaná informace je pouze orientační, pro přesnější a důkladnější posouzení vaší jazykové úrovně je nutné zvolit komplexnější metody testování (IELTS apod.).</p>';
document.getElementById('quiz_result').innerHTML = vysledek;
}

function fr_test_it() {

total = 0;

if(document.mainform.q1[1].checked)
{total = total+1;}

if(document.mainform.q2[3].checked)
{total = total+1}

if(document.mainform.q3[1].checked)
{total = total+1}

if(document.mainform.q4[1].checked)
{total = total+1}

if(document.mainform.q5[1].checked)
{total = total+1}

if(document.mainform.q6[1].checked)
{total = total+1}

if(document.mainform.q7[3].checked)
{total = total+1}

if(document.mainform.q8[1].checked)
{total = total+1}

if(document.mainform.q9[2].checked)
{total = total+1}

if(document.mainform.q10[1].checked)
{total = total+1}

if(document.mainform.q11[3].checked)
{total = total+1;}

if(document.mainform.q12[1].checked)
{total = total+1}

if(document.mainform.q13[2].checked)
{total = total+1}

if(document.mainform.q14[2].checked)
{total = total+1}

if(document.mainform.q15[2].checked)
{total = total+1}

if(document.mainform.q16[3].checked)
{total = total+1}

if(document.mainform.q17[0].checked)
{total = total+1}

if(document.mainform.q18[0].checked)
{total = total+1}

if(document.mainform.q19[1].checked)
{total = total+1}

if(document.mainform.q20[0].checked)
{total = total+1}

if(document.mainform.q21[3].checked)
{total = total+1;}

if(document.mainform.q22[2].checked)
{total = total+1}

if(document.mainform.q23[0].checked)
{total = total+1}

if(document.mainform.q24[0].checked)
{total = total+1}

if(document.mainform.q25[3].checked)
{total = total+1}

if(document.mainform.q26[1].checked)
{total = total+1}

if(document.mainform.q27[1].checked)
{total = total+1}

if(document.mainform.q28[1].checked)
{total = total+1}

if(document.mainform.q29[1].checked)
{total = total+1}

if(document.mainform.q30[2].checked)
{total = total+1}

if(document.mainform.q31[3].checked)
{total = total+1;}

if(document.mainform.q32[0].checked)
{total = total+1}

if(document.mainform.q33[1].checked)
{total = total+1}

if(document.mainform.q34[3].checked)
{total = total+1}

if(document.mainform.q35[3].checked)
{total = total+1}

if(document.mainform.q36[1].checked)
{total = total+1}

if(document.mainform.q37[2].checked)
{total = total+1}

if(document.mainform.q38[3].checked)
{total = total+1}

if(document.mainform.q39[3].checked)
{total = total+1}

if(document.mainform.q40[2].checked)
{total = total+1}

if(document.mainform.q41[2].checked)
{total = total+1;}

if(document.mainform.q42[2].checked)
{total = total+1}

if(document.mainform.q43[1].checked)
{total = total+1}

if(document.mainform.q44[1].checked)
{total = total+1}

if(document.mainform.q45[2].checked)
{total = total+1}

if(document.mainform.q46[0].checked)
{total = total+1}

if(document.mainform.q47[1].checked)
{total = total+1}

if(document.mainform.q48[0].checked)
{total = total+1}

if(document.mainform.q49[2].checked)
{total = total+1}

if(document.mainform.q50[1].checked)
{total = total+1}

if (total<=0) { vysledek = 'Bohužel, žádná z Vašich odpovědí nebyla správná.'; } 
else if (total<=10) { vysledek = 'Začátečník'; }
else if (total<=20) { vysledek = 'Mírně pokročilý'; }
else if (total<=30) { vysledek = 'Středně pokročilý'; }
else if (total<=40) { vysledek = 'Pokročilý'; }
else { vysledek = 'Velmi pokročilý'; }

vysledek = '<h2>Hodnocení</h2><p><strong>' + vysledek + '</strong><br /><br />Získaná informace je pouze orientační, pro přesnější a důkladnější posouzení vaší jazykové úrovně je nutné zvolit komplexnější metody testování (IELTS apod.).</p>';
document.getElementById('quiz_result').innerHTML = vysledek;
}

function es_test_it() {

total = 0;

if(document.mainform.q1[1].checked)
{total = total+1;}

if(document.mainform.q2[3].checked)
{total = total+1}

if(document.mainform.q3[1].checked)
{total = total+1}

if(document.mainform.q4[1].checked)
{total = total+1}

if(document.mainform.q5[1].checked)
{total = total+1}

if(document.mainform.q6[1].checked)
{total = total+1}

if(document.mainform.q7[3].checked)
{total = total+1}

if(document.mainform.q8[1].checked)
{total = total+1}

if(document.mainform.q9[2].checked)
{total = total+1}

if(document.mainform.q10[1].checked)
{total = total+1}

if(document.mainform.q11[3].checked)
{total = total+1;}

if(document.mainform.q12[1].checked)
{total = total+1}

if(document.mainform.q13[2].checked)
{total = total+1}

if(document.mainform.q14[2].checked)
{total = total+1}

if(document.mainform.q15[2].checked)
{total = total+1}

if(document.mainform.q16[3].checked)
{total = total+1}

if(document.mainform.q17[0].checked)
{total = total+1}

if(document.mainform.q18[0].checked)
{total = total+1}

if(document.mainform.q19[1].checked)
{total = total+1}

if(document.mainform.q20[0].checked)
{total = total+1}

if(document.mainform.q21[3].checked)
{total = total+1;}

if(document.mainform.q22[2].checked)
{total = total+1}

if(document.mainform.q23[0].checked)
{total = total+1}

if(document.mainform.q24[0].checked)
{total = total+1}

if(document.mainform.q25[3].checked)
{total = total+1}

if(document.mainform.q26[1].checked)
{total = total+1}

if(document.mainform.q27[1].checked)
{total = total+1}

if(document.mainform.q28[1].checked)
{total = total+1}

if(document.mainform.q29[1].checked)
{total = total+1}

if(document.mainform.q30[2].checked)
{total = total+1}

if(document.mainform.q31[3].checked)
{total = total+1;}

if(document.mainform.q32[0].checked)
{total = total+1}

if(document.mainform.q33[1].checked)
{total = total+1}

if(document.mainform.q34[3].checked)
{total = total+1}

if(document.mainform.q35[3].checked)
{total = total+1}

if(document.mainform.q36[1].checked)
{total = total+1}

if(document.mainform.q37[2].checked)
{total = total+1}

if(document.mainform.q38[3].checked)
{total = total+1}

if(document.mainform.q39[3].checked)
{total = total+1}

if(document.mainform.q40[2].checked)
{total = total+1}

if(document.mainform.q41[2].checked)
{total = total+1;}

if(document.mainform.q42[2].checked)
{total = total+1}

if(document.mainform.q43[1].checked)
{total = total+1}

if(document.mainform.q44[1].checked)
{total = total+1}

if(document.mainform.q45[2].checked)
{total = total+1}

if(document.mainform.q46[0].checked)
{total = total+1}

if(document.mainform.q47[1].checked)
{total = total+1}

if(document.mainform.q48[0].checked)
{total = total+1}

if(document.mainform.q49[2].checked)
{total = total+1}

if(document.mainform.q50[1].checked)
{total = total+1}

if (total<=0) { vysledek = 'Bohužel, žádná z Vašich odpovědí nebyla správná.'; } 
else if (total<=10) { vysledek = 'Začátečník'; }
else if (total<=20) { vysledek = 'Mírně pokročilý'; }
else if (total<=30) { vysledek = 'Středně pokročilý'; }
else if (total<=40) { vysledek = 'Pokročilý'; }
else { vysledek = 'Velmi pokročilý'; }

vysledek = '<h2>Hodnocení</h2><p><strong>' + vysledek + '</strong><br /><br />Získaná informace je pouze orientační, pro přesnější a důkladnější posouzení vaší jazykové úrovně je nutné zvolit komplexnější metody testování (IELTS apod.).</p>';
document.getElementById('quiz_result').innerHTML = vysledek;
}
