<!--
function checkInt(value) 
{
  if(parseInt(value) != value) return false;
  else return true;
}
function checkDate(value) 
{
  if(value == "") return false;
  var dt = value.split(".");
  if(dt.length != 3) return false;
  var dx = new Date(dt[2], dt[1]-1, dt[0]);
  if(dx.getDate() != dt[0]) return false;
  if(dx.getMonth()+1 != dt[1]) return false;
  return true;
}
function porovnani(spl,zad) 
{
  var splat = spl.split(".");
  var zadan = zad.split(".");
  if(splat[2]<zadan[2]) return false;
  	else
		if (splat[2]>zadan[2]) return true;
			else
				if (splat[1]<zadan[1]) return false;
					else
						if (splat[1]>zadan[1]) return true;
							else
								if (splat[0]>zadan[0]) return true;
									else return false;

}
 
function Kontrola ()
{
//kontrola čísla faktury
   if (document.formular.cislo.value == "")
   {
      document.formular.cislo.focus();
      alert ("Nezadali jste číslo faktury");
      return false;
   }
   if(checkInt(document.formular.cislo.value) == false) {
    alert("Číslo faktury musí být celé číslo!!");
    return false;
  }
   if((document.formular.cislo.value < 1) || (document.formular.cislo.value > 9999999999)) {
    alert("Ale notak takovéhlo číslo faktury ???");
    return false;
  }
//konec kontroly čísla faktury
//kontrola vyplněnosti firmy (zákazníka)  
   if (document.formular.firma.value == "")
   {
      document.formular.firma.focus();
      alert ("Nezadali jste jméno zákazníka (Firma) !");
      return false;
   }
   if (document.formular.jednatel.value == "")
   {
      document.formular.jednatel.focus();
      alert ("Nezadali jste jméno jednatele firmy !");
      return false;
   }
   if (document.formular.adresa.value == "")
   {
      document.formular.adresa.focus();
      alert ("Nezadali jste adresu jednatele firmy !");
      return false;
   }
   if (document.formular.tel.value == "")
   {
      document.formular.tel.focus();
      alert ("Nezadali jste zelefon na jednatele firmy !");
      return false;
   }
   if (document.formular.majl.value == "")
   {
      document.formular.majl.focus();
      alert ("Nezadali jste e-mailovou adresu jednatele firmy !");
      return false;
   }
 
// konec kontroly vyplněnosti firmy
//kontrola datumu 
  if(checkDate(document.formular.zadano.value) == false) {
    alert("Chybně vyplněn termín zadání (dd.mm.yyyy) !");
    return false;
  }   
  if(checkDate(document.formular.splatnost.value) == false) {
    alert("chybně vyplněn termín splatnosti (dd.mm.yyyy) !");
    return false;
  } 
  if (document.formular.predano.value != ""){
	  if(checkDate(document.formular.predano.value) == false) {
		alert("chybně vyplněn termín předání (dd.mm.yyyy) !");
		return false;
	  }
  }
  if (document.formular.datum_domeny.value != ""){
	  if(checkDate(document.formular.datum_domeny.value) == false) {
		alert("chybně vyplněn termín zaregistrování domény (dd.mm.yyyy) !");
		return false;
	  }
  }
  
  if(porovnani(document.formular.splatnost.value,document.formular.zadano.value) == false) {
    alert("Datum splatnosti měnší či shodný z datem zadání? Nesmysl!");
    return false;
  } }
// -->
<!-- script na vyskakovací okno --!>
function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function overlay(curobj, subobjstr, opt_position){
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) 
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
subobj.style.left=xpos+"px"
subobj.style.top=ypos+"px"
return false
}
else
return true
}

function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}

