
//==================================================
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://shop.prohorses.cz","");
     document.cookie = "add_Favorite=1;expires=" + cookieDate.toGMTString();
  } else {
     if(window.external) {
         window.external.AddFavorite("http://shop.prohorses.cz.cz",wdt);
         document.cookie = "add_Favorite=1;expires=" + cookieDate.toGMTString();
     } else {
         if(window.opera&&window.print) {
           alert("Pro ulo\u017een\xed shop.prohorses.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://shop.prohorses.cz");
    document.cookie              = "set_home_page=1;expires=" + cookieDate.toGMTString();
 }
}

//===========================================================
function nastav_box(id, color, text){
   document.getElementById(id).style.background = color;
   document.getElementById('must_'+id).innerText = text;
}
function test(){
  Time   = 400;
  Time__ = 0;
  Focus  = '';
  Text   = "";
  err    = 0;
  
  if (document.getElementById("jmeno").value    == ""){ 
     Text += '\n Je nutné vyplnit pložku jméno.';
     window.setTimeout("nastav_box('jmeno','#FEDFDD', '!')", Time__);
     if (Focus == '') Focus = 'jmeno';
    } else { 
    nastav_box('jmeno', '#FFFFFF', "OK"); 
    }


  if (document.getElementById("prijmeni").value == ""){ 
     Text += '\n Je nutné vyplnit pložku přijmení.';
     window.setTimeout("nastav_box('prijmeni','#FEDFDD', '!')", Time__);
     Time__ += Time;
     if (Focus == '') Focus = 'prijmeni';
  } else { nastav_box('prijmeni', '#FFFFFF', "OK"); }

  if (document.getElementById("mesto").value    == ""){ 
     Text += '\n Je nutné vyplnit pložku město.';
     window.setTimeout("nastav_box('mesto','#FEDFDD', '!')", Time__);
     Time__ += Time;
     if (Focus == '') Focus = 'mesto';
  } else { nastav_box('mesto', '#FFFFFF', "OK"); }
  
  if (document.getElementById("ulice").value    == ""){ 
     Text += '\n Je nutné vyplnit pložku ulice.';
     window.setTimeout("nastav_box('ulice','#FEDFDD', '!')", Time__);
     Time__ += Time;
  } else { nastav_box('ulice', '#FFFFFF', "OK"); }
  
  if (document.getElementById("psc").value      == ""){ 
     Text += '\n Je nutné vyplnit pložku Psč.';
     window.setTimeout("nastav_box('psc','#FEDFDD', '!')", Time__);
     Time__ += Time;
     if (Focus == '') Focus = 'psc';
     } else { nastav_box('psc', '#FFFFFF', "OK"); }

  if (document.getElementById("telefon").value      == ""){ 
     Text += '\n Je nutné vyplnit pložku telefon.';
     window.setTimeout("nastav_box('telefon','#FEDFDD', '!')", Time__);
     Time__ += Time;
     if (Focus == '') Focus = 'telefon';
     } else { nastav_box('telefon', '#FFFFFF', "OK"); } 
     
  if (document.getElementById("email").value      == ""){ 
     Text += '\n Je nutné vyplnit pložku telefon.';
     window.setTimeout("nastav_box('email','#FEDFDD', '!')", Time__);
     Time__ += Time;
     if (Focus == '') Focus = 'email';
     } else { nastav_box('email', '#FFFFFF', "OK"); }
  
  if (Text > "") {
    window.setTimeout("window.alert(Text)", Time__);
    document.getElementById('jmeno').focus();
    document.getElementById('must_nadpis').innerText = "Je nutné řádně vyplnit kontaktní údaje"; 
   } else { 
    document.getElementById('must_nadpis').innerText = "Kontaktní údaje OK" ;
    window.setTimeout("document.Forms.submit()", 500); 
  }
}
// ========================================================================
function test_login(){
  Time   = 400;
  Time__ = 0;
  Focus  = '';
  Text   = "";
  err    = 0;
  
  if (document.getElementById("name").value    == ""){ 
     Text += '\n Je nutné vyplnit pložku Login.';
     window.setTimeout("nastav_box('name','#FEDFDD', '!')", Time__);
     if (Focus == '') Focus = 'name';
    } else { 
    nastav_box('name', '#FFFFFF', "OK"); 
    }

Id = 'heslo';
  if (document.getElementById(Id).value == ""){ 
     Text += '\n Je nutné vyplnit pložku Heslo.';
     window.setTimeout("nastav_box('"+Id+"','#FEDFDD', '!')", Time__);
     Time__ += Time;
     if (Focus == '') Focus = Id;
  } else { nastav_box(Id, '#FFFFFF', "OK"); }

Id = 'kontrola';
  if (document.getElementById(Id).value == ""){ 
     Text += '\n Je nutné opsat znaky z obrázku.';
     window.setTimeout("nastav_box('"+Id+"','#FEDFDD', '!')", Time__);
     Time__ += Time;
     if (Focus == '') Focus = Id;
  } else { nastav_box(Id, '#FFFFFF', "OK"); }
 

  
  if (Text > "") {
    window.setTimeout("window.alert(Text)", Time__);
    document.getElementById('name').focus();
    document.getElementById('must_nadpis').innerText = "Je nutné řádně vyplnit kontaktní údaje"; 
   } else { 
    //document.getElementById('must_nadpis').innerText = "Kontaktní údaje OK" ;
    window.setTimeout("document.Forms.submit()", 500); 
  }
}


// ========================================================================
function test_registrace(){
  Time   = 400;
  Time__ = 0;
  Focus  = '';
  Text   = "";
  err    = 0;
  

Id = 'jmeno';
  if (document.getElementById(Id).value == ""){ 
     Text += '\n Je nutné vyplnit položku Jméno.';
     window.setTimeout("nastav_box('"+Id+"','#FEDFDD', '!')", Time__);
     Time__ += Time;
     if (Focus == '') Focus = Id;
  } else { nastav_box(Id, '#FFFFFF', "OK"); }

Id = 'prijmeni';
  if (document.getElementById(Id).value == ""){ 
     Text += '\n Je nutné vyplnit položku Přijmení.';
     window.setTimeout("nastav_box('"+Id+"','#FEDFDD', '!')", Time__);
     Time__ += Time;
     if (Focus == '') Focus = Id;
  } else { nastav_box(Id, '#FFFFFF', "OK"); }
 
Id = 'mesto';
  if (document.getElementById(Id).value == ""){ 
     Text += '\n Je nutné vyplnit položku Město.';
     window.setTimeout("nastav_box('"+Id+"','#FEDFDD', '!')", Time__);
     Time__ += Time;
     if (Focus == '') Focus = Id;
  } else { nastav_box(Id, '#FFFFFF', "OK"); }

Id = 'ulice';
  if (document.getElementById(Id).value == ""){ 
     Text += '\n Je nutné vyplnit položku Ulice.';
     window.setTimeout("nastav_box('"+Id+"','#FEDFDD', '!')", Time__);
     Time__ += Time;
     if (Focus == '') Focus = Id;
  } else { nastav_box(Id, '#FFFFFF', "OK"); } 

Id = 'psc';
  if (document.getElementById(Id).value == ""){ 
     Text += '\n Je nutné vyplnit položku Psč.';
     window.setTimeout("nastav_box('"+Id+"','#FEDFDD', '!')", Time__);
     Time__ += Time;
     if (Focus == '') Focus = Id;
  } else { nastav_box(Id, '#FFFFFF', "OK"); } 

Id = 'telefon';
  if (document.getElementById(Id).value == ""){ 
     Text += '\n Je nutné vyplnit položku Telefon.';
     window.setTimeout("nastav_box('"+Id+"','#FEDFDD', '!')", Time__);
     Time__ += Time;
     if (Focus == '') Focus = Id;
  } else { nastav_box(Id, '#FFFFFF', "OK"); } 

Id = 'email';
  if (document.getElementById(Id).value == ""){ 
     Text += '\n Je nutné vyplnit položku email.';
     window.setTimeout("nastav_box('"+Id+"','#FEDFDD', '!')", Time__);
     Time__ += Time;
     if (Focus == '') Focus = Id;
  } else { nastav_box(Id, '#FFFFFF', "OK"); } 

Id = 'login';
  if (document.getElementById(Id).value == ""){ 
     Text += '\n Je nutné vyplnit položku Login.';
     window.setTimeout("nastav_box('"+Id+"','#FEDFDD', '!')", Time__);
     Time__ += Time;
     if (Focus == '') Focus = Id;
  } else { nastav_box(Id, '#FFFFFF', "OK"); } 
 
   
 Id = 'heslo1';
  if (document.getElementById(Id).value == ""){ 
     Text += '\n Je nutné vyplnit položku Heslo.';
     window.setTimeout("nastav_box('"+Id+"','#FEDFDD', '!')", Time__);
     Time__ += Time;
     if (Focus == '') Focus = Id;
  } else { nastav_box(Id, '#FFFFFF', "OK"); } 
 
  Id = 'heslo2';
  if (document.getElementById(Id).value == ""){ 
     Text += '\n Je nutné vyplnit položku Heslo znovu';
     window.setTimeout("nastav_box('"+Id+"','#FEDFDD', '!')", Time__);
     Time__ += Time;
     if (Focus == '') Focus = Id;
  } else { nastav_box(Id, '#FFFFFF', "OK"); } 
 
 
  
  if (Text > "") {
    window.setTimeout("window.alert(Text)", Time__);
    //document.getElementById('name').focus();
   // document.getElementById('must_nadpis').innerText = "Je nutné řádně vyplnit kontaktní údaje"; 
   } else { 
    //document.getElementById('must_nadpis').innerText = "Kontaktní údaje OK" ;
    window.setTimeout("document.Forms.submit()", 500); 
  }
}