var hideselectrule = -1;
var jms_processing = new Array();

function jsm_ukaz(me) {
    var menuul=me.firstChild;
    while (menuul) {
	if (menuul.nodeName=="DIV") { 
	    menuul.style.visibility='visible'; 
	}
	menuul = menuul.nextSibling;
    }

    if (document.styleSheets[0].addRule && (hideselectrule == -1) ) {
      document.styleSheets[0].addRule("select", "visibility : hidden;");
      hideselectrule = document.styleSheets[0].rules.length - 1;
    }

}

function jsm_schovej(me) {
    var menuul=me.firstChild;
    while (menuul) {
	if (menuul.nodeName=="DIV") { 
	  menuul.style.visibility='hidden';
	}
	menuul = menuul.nextSibling;
    }

    if (document.styleSheets[0].removeRule && (hideselectrule != -1) ) {
      document.styleSheets[0].removeRule(hideselectrule);
      hideselectrule = -1;
    }

}



function is_radio_checked (radio_array){ 
  var i; 
  for (i = 0; i < radio_array . length; ++ i) 
    if (radio_array [i] . checked) return true; 
  return false; 
}

function is_form_ok(){
  if( document.soutez_form.jmeno.value == "" ||
      document.soutez_form.prijmeni.value == "" ||
      document.soutez_form.email.value == "" ||
      document.soutez_form.telefon.value == "" ||

      /* pro textareu */	
      ( typeof document.soutez_form.odpoved.value != "undefined"  && document.soutez_form.odpoved.value == "" ) ||

      /* pro radio */	
      ( typeof document.soutez_form.odpoved.length != "undefined" && !is_radio_checked( document.soutez_form.odpoved))
    ) return false;

  return true;
}


// pro testovani formularu pri soutezeni
function TestCZ(){

 if ( !is_form_ok()){
  alert( "Vyplňte prosím červeně označené údaje");
  return( false);
 }
return( true);
}

// pro testovani formularu pri soutezeni

function TestEN() {

 if ( !is_form_ok()){
  alert( "Fill in at least red-marked fields, please");
  return( false);
 }
return( true);
}

// zobrazeni obrazku
function ShowImage(name,width, height) {
	 window.open("./image.html?"+name,"",
"toolbar=no,scrollbars=no,location=no,status=no,width="+width+",height="+height+",resizable=0,screenX=50,screenY=50");
}


// zobrazeni kalendare

function ShowCalendar(url, nameOfVarForm, nameOfVarDay, nameOfVarMonth, nameOfVarYear, nameOfVarMonthYear) {
  window.open(url,"", "toolbar=no,scrollbars=no,location=no,status=no,width=190,height=215,resizable=0,screenX=50,screenY=50");
  window.nameOfVarForm      = nameOfVarForm;
  window.nameOfVarDay       = nameOfVarDay;
  window.nameOfVarMonth     = nameOfVarMonth;
  window.nameOfVarYear      = nameOfVarYear;	
  window.nameOfVarMonthYear = nameOfVarMonthYear;
};			