

function hlasuj(odpoved,has) {

	location.href='./?action=hlasuj&odpoved='+odpoved+'&has='+has;
}

function openmap(pozice) {

	window.open('http://maps.google.com/?q='+pozice);
}

function preklapvyvoj(idprovider,idserver,typ) {

	document.getElementById('grvyvoj').src='/_data/clscripts/gr-vyvoj.php?&idserver='+idserver+'&idprovider='+idprovider+'&typ='+typ;

	document.getElementById('grvyvoj-d').className='';
	document.getElementById('grvyvoj-u').className='';
	document.getElementById('grvyvoj-p').className='';
	document.getElementById('grvyvoj-q').className='';

	document.getElementById('grvyvoj-'+typ).className='sel';
	}

function showfoto(xfoto) {

	foto=document.getElementById('fdetail');

	foto.src='/_data/img/'+xfoto+'.png';
	foto.style.width='auto';
	foto.style.height='auto';

	return false;
	}

function setk(k) {

	try {

		var tmp=document.getElementById('isel');
		tmp.value=k;

		window.setTimeout('setks('+k+')',20);
		}
	catch(e) {

		}
	}

function setks(k) {

	try {

		var tmp=document.getElementById('isel');
		tmp.form.submit();
		}
	catch(e) {

		}
	}

function load_script(url) {

	var head=document.getElementsByTagName('head').item(0);
	var old=document.getElementById('last_id');
	if (old)head.removeChild(old);
	script=document.createElement('script');
	script.src=url;
	script.type='text/javascript';
	script.defer=true;
	script.id='last_id'
	void(head.appendChild(script));
	}

var dhtmlie=document.all?true:false;

var dhtmlon=false;
try {

	if (window.ActiveXObject) var dhtmlreq=new ActiveXObject("Microsoft.XMLHTTP");
	else var dhtmlreq=new XMLHttpRequest();

	if (dhtmlreq) var dhtmlon=true;
	}
catch(e) {

	var dhtmlon=false;
	}

var dhtmlvyp=true;
var dhtmlvyptype='';
var dhtmlsubm=false;

function dhtmlvypocet() {

	if (!dhtmlvyp) return false;
	dhtmlvyp=false;

	var tmp='';

	try { tmp+='&p='+escape(document.getElementById('i-p').value); } catch(e) { }
	try { tmp+='&u='+escape(document.getElementById('i-u').value); } catch(e) { }
	try { tmp+='&l='+escape(document.getElementById('i-l').value); } catch(e) { }
	try { tmp+='&a='+escape(document.getElementById('i-a').value); } catch(e) { }
	try { tmp+='&r='+escape(document.getElementById('i-r').value); } catch(e) { }
	try { tmp+='&m='+escape(document.getElementById('i-m').value); } catch(e) { }
	try { tmp+='&pr='+escape(document.getElementById('i-pr').value); } catch(e) { }
/*
	load_script('/_data/clscripts/vypocet.php?type='+dhtmlvyptype+tmp);
*/
	dhtmlreq.open("GET",'/_data/clscripts/vypocet.php?type='+dhtmlvyptype+tmp,true);
	dhtmlreq.onreadystatechange=dhtmlvypocet_read;
	dhtmlreq.send(null);
	}

function dhtmlvypocet_updated() {

	try {
		document.getElementById('i-updated').style.display='none';
		}
	catch(e) {

		}
	}

function dhtmlvypocet_scrollto() {

	try {

		var tmp=document.getElementById('vyp');

		var otop=0;
		if (tmp.offsetParent) {
		
			otop=tmp.offsetTop;
			while (tmp=tmp.offsetParent)
				otop+=tmp.offsetTop;
			}

		otop-=10;
		if (otop<0) otop=0;
 		window.scrollTo(0,otop);
		}
	catch(e) {

		}
	}

function dhtmlvypocet_read() {

	if (dhtmlreq.readyState==4) {

		if(dhtmlreq.status==200) {

			try {
	
				document.getElementById('i-vypocet').innerHTML=dhtmlreq.responseText;
				}
			catch(e) {
				}

			if (dhtmlsubm) {

				dhtmlvypocet_scrollto();
				}
			else {

				try {
		
					document.getElementById('i-updated').style.display='block';
					window.setTimeout('dhtmlvypocet_updated()',3000);
					}
				catch(e) {
					}
				}

			dhtmlsubm=false;
			}
   	 else {

			}
		dhtmlvyp=true;
		}
	}

function dhtmlvypocet_submit() {

	if (!dhtmlon) return true;

	dhtmlsubm=true;
	dhtmlvyp=true;
	window.setTimeout('dhtmlvypocet()',1);

	return false;
	}

function dhtmlvypocet_delay() {

	if (!dhtmlon) return false;

	dhtmlvyp=true;
	dhtmlvypdel=false;

	window.setTimeout('dhtmlvypocet()',1);
	}

function dhtmlvypocet_config(vstup) {

	if (!dhtmlon) return false;
	dhtmlvyptype=vstup;
	
	}





