    function stoperror(){return true;}
    //window.onerror=stoperror;

    var classExternal = /\bext\b/;
    function externalLinks() {
      for ( x = 0; x < document.links.length; x++ ) {
        if ( classExternal.exec(document.links[x].className) ) {
          document.links[x].target="_blank";
        }
      }
    }

  	function emailCloak() {
      if (document.getElementById) {
  			var alltags = document.all? document.all : document.getElementsByTagName("*");
  			for (i=0; i < alltags.length; i++) {
  			  if (alltags[i].className == "emailCloak") {
  			  	var oldText = alltags[i].firstChild;
  			  	var emailAddress = alltags[i].firstChild.nodeValue;
  			  	var user = emailAddress.substring(0, emailAddress.indexOf("("));
  			  	var website = emailAddress.substring(emailAddress.indexOf(")")+1, emailAddress.length);
  			  	var newText = user+"@"+website;
  			  	var a = document.createElement("a");
  			  	a.href = "mailto:"+newText;
  				var address = document.createTextNode(newText);
  				a.appendChild(address);
  				alltags[i].replaceChild(a,oldText);
  			  }
  			}
  		}
  	}


    function produktDetailUlozCenuZaRozmer(hodnota) {
      document.getElementById("cena_za_rozmer").value = hodnota;      
      produktDetailVypocitejCenu();
    }

    function produktDetailUlozPriplatek(hodnota) {
      document.getElementById("priplatek_za_barvu").value = hodnota;      
      produktDetailVypocitejCenu();
    }

    function produktDetailVypocitejCenu() {
      var cena_za_rozmer = (document.getElementById("cena_za_rozmer").value != "")
      ? parseInt(document.getElementById("cena_za_rozmer").value) : 0;
      var priplatek_za_barvu = (document.getElementById("priplatek_za_barvu").value != "")
      ? parseInt(document.getElementById("priplatek_za_barvu").value) : 0;
      document.getElementById("vysledna_cena").value = parseInt(cena_za_rozmer + (cena_za_rozmer / 100 * priplatek_za_barvu)) + " Kč"; 
    }
    
    



    function spustitPoNacteni() {
      externalLinks();
      emailCloak();
    }
    

