// JavaScript Document /* encoding utf8 (ěščřžýáíé) */

	function valid_vaha(){
		var vaha = document.getElementById('vaha');
		if(vaha.value == '' || vaha.value == '0'){
			return window.confirm('Nebyla zadána váha! Přesto pokračovat?');
		}
		return true;
	}

  function show(img) {
    var elem = document.getElementById('postup');
    if(elem.style.display == "block"){
			elem.style.display = "none";
			img.src = "img/more.gif";
		}else{
			elem.style.display = "block";
			img.src = "img/less.gif";
		}
  }

  function unselect(opt){
  	var tmp = opt.selected;
		var select = document.getElementById('doplnky');
		for( i=0; i < select.length; i++)
			if(opt.value == select.options[i].value)
    		select.options[i].selected = tmp;
	}

  function validator(formular) {

  var jmeno = formular.jmeno.value; var na;
  var ulice = formular.ulice.value; var ad;
  var telefon = formular.telefon.value; var tel;
  var email = formular.email.value; var em;


    if(jmeno != "" && ulice!="" && telefon!="" && email!="@") {
      return true;
    }
    else {
      if(jmeno == "") na = "Vyplnte prosim jmeno.\n"; else na = "";
      if(ulice == "") ad = "Vyplnte prosim adresu.\n"; else ad = "";
      if(telefon == "") tel = "Vyplnte prosim telefon.\n"; else tel = "";
      if(email == "@") em = "Vyplnte prosim email.\n"; else em = "";
      alert(na + ad + tel + em);
      return false;
    }

  }

  function view_image(path){
		var window1 = window.open("","window1","height=320,width=320");
		window1.document.write("<html><meta http-equiv='content-type' content='text/html; charset=utf-8'><title>Náhled obrázku: '"+path+"' </title><script charset='utf-8' src='function.js' type='text/javascript' ></script><body onclick='window.close()' onload='resize_window(this);' style='margin:0px'><img id='nahled' src='"+path+"' alt='"+path+"' title='Náhled' /></body></html>");
		window1.document.close();
		return false;
	}

	function resize_window(okno){
		var ImgObj = okno.document.getElementById('nahled');
		var h = ImgObj.height;
		var w = ImgObj.width;
		okno.resizeTo(w+20,h+60);
	}

