function clear_field (obj) 
{
//zpracovava prihlasovaci formular, vycisti obsah pole od defaultni hodnoty a zmeni typ pole hesla	

	  obj.value = "";
  	if (obj.name == "login_psw")
  	{
      var _parent = obj.parentNode;


     var nameobj = document.getElementById("ln");
   
      // we remove the element from the DOM (optional as seen below...)
     _parent.removeChild( obj );
     
     var emptystring = String();

     // property is read-only so we replace the element
     
     if ( obj.type == 'text' ) 
      {
       _parent.innerHTML = emptystring.concat('<div class="club_referer"><a href="./club.php"><img src="images/club_nadpiska.gif" width="200" height="110"/></a></div><input type="text" id="ln" name="login_name" maxlength="100" value="', nameobj.value, '" class="login_field" onfocus="clear_field(this);" onblur="restore_field(this);"/><input type="password" name="login_psw" maxlength="100" value="" class="login_field" onfocus="clear_field(this);" onblur="restore_field(this);"/><input type="submit" name="login_send" value="Přihlásit" id="login_button" class="send_button_w"/><a href="./club.php?style=registrace"><div id="prihlaseniOdkazy"><a id="prihlaseniOdkaz" href="./club.php?style=registrace">Nová registrace</a><br/><a href="./forgotpsw.php">Zapomněli jste heslo?</a></div>');
      } 
    else 
      {
         _parent.innerHTML = emptystring.concat('<div class="club_referer"><a href="./club.php"> <img src="images/club_nadpiska.gif" width="200" height="110"/></a></div><input type="text" id="ln" name="login_name" maxlength="100" value="', nameobj.value, '" class="login_field" onfocus="clear_field(this);" onblur="restore_field(this);"/><input type="text" name="login_psw" maxlength="100" value="Heslo" class="login_field" onfocus="clear_field(this);" onblur="restore_field(this);"/><input type="submit" name="login_send" value="Přihlásit" id="login_button" class="send_button_w"/><a href="./club.php?style=registrace"><div id="prihlaseniOdkazy"><a id="prihlaseniOdkaz" href="./club.php?style=registrace">Nová registrace</a><br/><a href="./forgotpsw.php">Zapomněli jste heslo?</a></div>');
      }
    _parent.login_psw.focus();
    obj = null;
  	}
  	else
  	  obj.value = "@";    

}
 
function restore_field (obj) {
//zpracovava prihlasovaci formular, po odchodu v pripade prazdneho pole vrati defaultni hodnoty a vrati typ pole hesla
  if ((obj.value == "") && (obj.name == "login_name"))
	  obj.value = "Jméno";
  if ((obj.value == "") && (obj.name == "login_psw"))
  {
	  obj.value = "Heslo";
      var _parent = obj.parentNode;

      // we remove the element from the DOM (optional as seen below...)
      
     var nameobj = document.getElementById("ln");
    
     _parent.removeChild( obj );
     
     var emptystring = String();
     
     // property is read-only so we replace the element
     if ( obj.type == 'text' ) 
      {
       _parent.innerHTML = emptystring.concat('<div class="club_referer"><a href="./club.php"> <img src="images/club_nadpiska.gif" width="200" height="110"/></a></div><input type="text" id="ln" name="login_name" maxlength="100" value="', nameobj.value, '" class="login_field" onfocus="clear_field(this);" onblur="restore_field(this);"/><input type="password" name="login_psw" maxlength="100" value="" class="login_field" onfocus="clear_field(this);" onblur="restore_field(this);"/><input type="submit" name="login_send" value="Přihlásit" id="login_button" class="send_button_w"/><a href="./club.php?style=registrace"><div id="prihlaseniOdkazy"><a id="prihlaseniOdkaz" href="./club.php?style=registrace">Nová registrace</a><br/><a href="./forgotpsw.php">Zapomněli jste heslo?</a></div>');
      } 
    else 
      {
      _parent.innerHTML = emptystring.concat('<div class="club_referer"><a href="./club.php"> <img src="images/club_nadpiska.gif" width="200" height="110"/></a></div><input type="text" id="ln" name="login_name" maxlength="100" value="', nameobj.value, '" class="login_field" onfocus="clear_field(this);" onblur="restore_field(this);"/><input type="text" name="login_psw" maxlength="100" value="Heslo" class="login_field" onfocus="clear_field(this);" onblur="restore_field(this);"/><input type="submit" name="login_send" value="Přihlásit" id="login_button" class="send_button_w"/><a href="./club.php?style=registrace"><div id="prihlaseniOdkazy"><a id="prihlaseniOdkaz" href="./club.php?style=registrace">Nová registrace</a><br/><a href="./forgotpsw.php">Zapomněli jste heslo?</a></div>');
      }
    obj = null;
  }
}

function switch_picture_on (obj) {
	if (obj.src.search("_h") == -1)
  	obj.src = obj.src.substr(0, obj.src.length - 4) + "_h.gif";
}

function switch_picture_off (obj) {
	if (obj.src.search("_h") != -1)
  	 obj.src = obj.src.substr(0, obj.src.length - 6) + ".gif";
}
