// ===========================================================================
function change_imag(url) {
    if (i = document.getElementById('r-logo'))
       i.src = url; 
}

//document.getElementById("Jmeno").focus();
//document.f.Jmeno.focus();
//==============================================================
function test_napiste(){

    Text = "";
    err  = 0;
    
    if (document.getElementById("Jmeno_").value == ""){err=1; Text+='\n Je nutné zadat pložku Jmeno.';}
    if (document.getElementById("Prijmeni").value == ""){err=1; Text+='\n Je nutné zadat pložku Prijmení.';}
    if (document.getElementById("Email").value == "") {err = 1; Text+='\n Je nutné zadat pložku Email.';}
    if (checkEmail(document.getElementById("Email").value)== false)  { err = 1; Text+='\n Je nutné správne zadat pložku Email.';}
    if (document.getElementById("Mesto").value == ""){err=1; Text+='\n Je nutné zadat pložku Mesto.';}

    if (err == 1){
       alert(Text)
     } else {
       document.f.submit()
     }
}

// ===========================================================================
function test_new_user(){

  Text = "";
  err  = 0;
  
  if ( document.getElementById("Jmeno_new_user").value == "" ){ err = 1; Text += '\n Je nutné zadat pložku Jméno \n(Můžete zadat i Vaši přezdívku).'; }
  if ( document.getElementById("Email_new_user").value == "" ){ err = 1; Text += '\n Je nutné zadat pložku Email.'; }
  if ( document.getElementById("Dic_").value == "" )          { err = 1; Text += '\n Je nutné zadat pložku Dič.'; }
  if ( document.getElementById("Ic_").value == "" )           { err = 1; Text += '\n Je nutné zadat pložku Ič.'; }
  
  if ( document.getElementById("Firma_popis").value == "" )   { err = 1; Text += '\n Je nutné zadat pložku Firma popis.'; }
  if ( document.getElementById("Mesto_").value == "" )        { err = 1; Text += '\n Je nutné zadat pložku Město.'; }
  if ( document.getElementById("Ulice_").value == "" )        { err = 1; Text += '\n Je nutné zadat pložku Ulice.'; }
  if ( document.getElementById("Psc_").value == "" )          { err = 1; Text += '\n Je nutné zadat pložku PSČ.'; }
  if ( document.getElementById("Email_").value == "" )        { err = 1; Text += '\n Je nutné zadat pložku Email.'; }
  if ( document.getElementById("Telefon_").value == "" )      { err = 1; Text += '\n Je nutné zadat pložku Telefon.'; }
  
  if (err == 1) {
     alert (Text);
  } else {
     document.For.submit();
   }
}

// ===========================================================================
function zobrazit(id){
if (document.getElementById(id).style.display == "") {
   document.getElementById(id).style.display = "none";
}else {
   document.getElementById(id).style.display = "";
   }
}
// ===========================================================================
function test_login(){

Text = "";
err  = 0;

if (document.getElementById("imapuser").value   == "") {err = 1; Text+='\n Je nutné zadat pložku Jmeno.'; }
if (document.getElementById("pass").value       == "") {err = 1; Text+='\n Je nutné zadat pložku Heslo.'; }

if (err == 1){
   Err(Text);
 } else {
  document.Fo.submit();
 }
}
// --------------------------------
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://citaty.web-service.cz","");
     document.cookie = "add_Favorite=1;expires=" + cookieDate.toGMTString();
  } else {
     if(window.external) {
         window.external.AddFavorite("http://citaty.web-service.cz",wdt);
         document.cookie = "add_Favorite=1;expires=" + cookieDate.toGMTString();
     } else {
         if(window.opera&&window.print) {
           alert("Pro ulo\u017een\xed citaty.web-service.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://citaty.web-service.cz");
  document.cookie = "set_home_page=1;expires=" + cookieDate.toGMTString();
 }
}
// ===========================================================================
function Err(Text){
window.alert(Text)
}
// ===========================================================================
function checkEmail(Text) {
  if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(Text)){
  //alert(Text);
  return (true)
  }
return (false)
}
// ===========================================================================
function test(){

Text = "";
err  = 0;

if (document.getElementById("Jmeno_").value == "")  { err = 1; Text += '\n Je nutné zadat pložku Jmeno.';}
if (document.getElementById("Prijmeni").value == ""){ err = 1; Text += '\n Je nutné zadat pložku Prijmení.';}
if (document.getElementById("Email").value == "")   { err = 1; Text += '\n Je nutné zadat pložku Email.';}

if (err == 1){
   Err(Text);
 } else {
   document.f.submit();
 }
}

function Image_rot(){
  document.getElementById('r-logo').src = Obrx[Obr_pol];
  Obr_pol ++;
  if (Obr_pol > Obrx.length) Obr_pol = 1;
  window.setTimeout("Image_rot()", 3500); 
}
