
//==================================================
function zobrazit_(Jmeno) {	
//window.status = "++"+document.getElementById(Jmeno).style.display + "++";
if(document.getElementById(Jmeno).style.display  == "none") {
  document.getElementById(Jmeno).style.display = "";
 } else {
   document.getElementById(Jmeno).style.display = "none";
 }
}
//=======================================================================
function doClear(theText) {
	 if (theText.value == theText.defaultValue) {
	    theText.value = ""
   }
}
//=======================================================================
function zobrazit(id){
  if (document.getElementById(id).style.display == "") {
     document.getElementById(id).style.display = "none";
  }else {
     document.getElementById(id).style.display = "";
     }
}
//=======================================================================
function Err(Text) {
   window.alert(Text)
 }
function checkEmail(Text) {
  if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(Text)) {
      return (true)
  }
 return (false)
}
// --------------------------------
function add_Favorite(){
 var wdt        = window.document.title;
 var cookieDate = new Date;

 cookieDate.setTime (cookieDate.getTime()+ 360 * 24 * 60 * 60 * 1000);

 if(window.sidebar) {
     window.sidebar.addPanel(wdt,"http://www.mojekopretina.cz","");
     document.cookie = "add_Favorite=1;expires=" + cookieDate.toGMTString();
  } else {
     if(window.external) {
         window.external.AddFavorite("http://www.mojekopretina.cz",wdt);
         document.cookie = "add_Favorite=1;expires=" + cookieDate.toGMTString();
     } else {
         if(window.opera&&window.print) {
           alert("Pro ulo\u017een\xed www.mojekopretina.cz do obl\xedben\xfdch stiskn\u011bte CTRL + D!");
         }
    }
  }
}
// --------------------------------
function set_home_page() {
 var cookieDate = new Date;
 cookieDate.setTime (cookieDate.getTime()+ 360 * 24 * 60 * 60 * 1000);

 if(navigator.appName != "Netscape") {
    document.body.style.behavior = "url(#default#homepage)";
    document.body.setHomePage ("http://www.oldrichov.cz");
    document.cookie              = "set_home_page=1;expires=" + cookieDate.toGMTString();
 }
}
//===========================================================
function nastav_box(id, color, text){
 // alert("-"+id);
   document.getElementById(id).style.background  = color;
   document.getElementById('must_'+id).innerHTML = text;
}
//===========================================================
function test_box(Id, Text_){

// alert(document.getElementById(Id).value + " - " + Id);

  if (document.getElementById(Id).value == ""){
  Text += '\n ' + Text_; 
     window.setTimeout("nastav_box('"+Id+"','#FEDFDD', '!')", Time__);
     Time__ += Time;
     if (Focus == '') Focus = Id;
  } else { nastav_box(Id, '#FFFFFF', "OK"); }
}
Text   = "";
// ========================================================================
function test_registrace(){
  Time   = 400;
  Time__ = 0;
  Focus  = '';
  err    = 0;
 Text   = "";  

 test_box('Jmeno',    'Je nutné vyplnit položku Jméno.');

 test_box('Ulice',      'Je nutné vyplnit položku Adresa - Ulice.');
 test_box('Mesto',      'Je nutné vyplnit položku Adresa - Město.');
 test_box('Psc',        'Je nutné vyplnit položku Adresa - PSČ.');
 test_box('Stat',       'Je nutné vyplnit položku Adresa - Stat.');

 test_box('Email',   'Je nutné vyplnit položku kontaktní Email.');
 test_box('Kusu',    'Je nutné vyplnit položku - Počet kusů.');

 test_box('kontrola', 'Je nutné vyplnit položku Opište text z obrázku .'); 

 
  if (Text > "") {
    window.setTimeout("window.alert(Text)", 50);
    document.getElementById(Focus).focus();
   // document.getElementById('must_nadpis').innerText = "Je nutné řádně vyplnit kontaktní údaje"; 
   } else { 
    //document.getElementById('must_nadpis').innerText = "Kontaktní údaje OK" ;
    window.setTimeout("document.Form.submit()", 50); 
  }
}
// ========================================================================
function id_disabled(Id, butt){
  //alert(document.getElementById(Id).checked);
  if (document.getElementById(Id).checked){
    document.getElementById(butt).disabled = "";
    }else{
    document.getElementById(butt).disabled = "disabled";
  }
}

// ========================================================================
function test_registrace_exek(){
  Time   = 80;
  Time__ = 0;
  Focus  = '';
  err    = 0;
  Text   = "";
   
  test_box('jmeno',    'Je nutné vyplnit položku Jméno.');
  test_box('prijmeni', 'Je nutné vyplnit položku Přijmení.');
  test_box('rc',       'Je nutné vyplnit položku rodné číslo.');
  test_box('telefon',  'Je nutné vyplnit položku telefonní číslo.');
//  test_box('telefon_2','Je nutné vyplnit položku telefonní číslo 2.');
  test_box('Pozadovana_castka','Je nutné vyplnit položku požadovaná částka.');
  test_box('Max_splatka','Je nutné vyplnit položku maximální splátka.');
 test_box('Doba_splaceni','Je nutné vyplnit položku doba splácení.');

 test_box('kontrola', 'Je nutné vyplnit položku Opište text z obrázku .'); 

 
  if (Text > "") {
    window.setTimeout("window.alert(Text)", Time__);
    document.getElementById(Focus).focus();
   // document.getElementById('must_nadpis').innerText = "Je nutné řádně vyplnit kontaktní údaje"; 
   } else { 
    //document.getElementById('must_nadpis').innerText = "Kontaktní údaje OK" ;
    window.setTimeout("document.Form.submit()", 50); 
  }
}





