  function odeslat(id){
    formular='formular' + id;
    if (document.forms[formular].delka.value==0){
      alert('Zvolte prosím délku lyže');
    }
    else{
      document.forms[formular].submit();
    }
  }
  
  function odeslat_obj(){
    odeslat=true;
    if(document.forms['formular-odeslat'].jmeno.value==''){
      alert('Vyplňte prosím jméno');
      odeslat=false;
    }
    if(document.forms['formular-odeslat'].prijmeni.value==''){
      alert('Vyplňte prosím příjmení');
      odeslat=false;
    }
    if(document.forms['formular-odeslat'].ulice.value==''){
      alert('Vyplňte prosím ulici');
      odeslat=false;
    }
    if(document.forms['formular-odeslat'].psc.value==''){
      alert('Vyplňte prosím poštovní směrovací číslo');
      odeslat=false;
    }
    re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}$/;
    
    if(!document.forms['formular-odeslat'].email.value.search(re) == 0){
      alert('Vyplňte prosím poštovní email');
      odeslat=false;
    }
    if(odeslat){
      document.forms['formular-odeslat'].submit();
    }
    
  }
  
  function rozbal(a){
    if (document.getElementById(a).style.display=='none'){
      document.getElementById(a).style.display='block';
    }
    else{
      document.getElementById(a).style.display='none';
    }
  }
  
  function max(n){
    document.getElementById('detaily' + n).style.display='block';
    document.getElementById('sd' + n).style.display='none';
    document.getElementById('sn' + n).style.display='block';   
  }
  
  function min(n){
    document.getElementById('detaily' + n).style.display='none';
    document.getElementById('sd' + n).style.display='block';
    document.getElementById('sn' + n).style.display='none';   
  }
  
function buildCal(m, y, cM, cH, cDW, cD, brdr){

var mn=['leden','únor','březen','duben','květen','červen','červenec','srpen','září','říjen','listopad','prosinec'];
var dim=[31,0,31,30,31,30,31,31,30,31,30,31];

var oD = new Date(y, m-1, 1); //DD replaced line to fix date bug when current day is 31st
oD.od=oD.getDay()+1; //DD replaced line to fix date bug when current day is 31st

var todaydate=new Date() //DD added
var scanfortoday=(y==todaydate.getFullYear() && m==todaydate.getMonth()+1)? todaydate.getDate() : 0 //DD added

dim[1]=(((oD.getFullYear()%100!=0)&&(oD.getFullYear()%4==0))||(oD.getFullYear()%400==0))?29:28;
var t='<div class="'+cM+'"><table class="'+cM+'" cols="7" cellpadding="0" border="'+brdr+'" cellspacing="0"><tr align="center">';
t+='<td colspan="7" align="center" class="'+cH+'">'+mn[m-1]+' - '+y+'</td></tr><tr align="center">';
for(s=0;s<7;s++)t+='<td class="'+cDW+'">'+"poútstčtpásone".substr(2*s,2)+'</td>';
t+='</tr><tr align="center">';
for(i=1;i<=42;i++){
  var x=((i-oD.od+1>=0)&&(i-oD.od+1<dim[m-1]))? i-oD.od+2 : '&nbsp;';
  if (x==scanfortoday) //DD added
    x='<span id="today">'+x+'</span>' //DD added
  t+='<td class="'+cD+'">'+x+'</td>';
  if(((i)%7==0)&&(i<36))t+='</tr><tr align="center">';
}
return t+='</tr></table></div>';
    
}
