function clear_field (obj) {
//zpracovava prihlasovaci formular, vycisti obsah pole od defaultni hodnoty a zmeni typ pole hesla	
	if ((obj.value == "Jméno") || (obj.value == "Heslo"))
	{
	  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="./pictures/spacer.gif" height="57" width="119" border="0" /></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="image" src="./pictures/login_button.gif" alt="PŘIHLÁSIT SE" name="login_send" class="login_button"/><a href="./club.php?style=registrace"><img src="./pictures/txt_register.gif" alt="REGISTRACE" border="0" width="49" height="9" class="login_text1"/></a><a href="./forgotpsw.php"><img src="./pictures/txt_forgot_psw.gif" alt="ZAPOMELI JSTE HESLO?" border="0" width="97" height="10" class="login_text1"/></a>');
    } else {
       _parent.innerHTML = emptystring.concat('<div class="club_referer"><a href="./club.php"><img src="./pictures/spacer.gif" height="57" width="119" border="0" /></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="image" src="./pictures/login_button.gif" alt="PŘIHLÁSIT SE" name="login_send" class="login_button"/><a href="./club.php?style=registrace"><img src="./pictures/txt_register.gif" alt="REGISTRACE" border="0" width="49" height="9" class="login_text1"/></a><a href="./forgotpsw.php"><img src="./pictures/txt_forgot_psw.gif" alt="ZAPOMELI JSTE HESLO?" border="0" width="97" height="10" class="login_text1"/></a>');
    }
    _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="./pictures/spacer.gif" height="57" width="119" border="0" /></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="image" src="./pictures/login_button.gif" alt="PŘIHLÁSIT SE" name="login_send" class="login_button"/><a href="./club.php?style=registrace"><img src="./pictures/txt_register.gif" alt="REGISTRACE" border="0" width="49" height="9" class="login_text1"/></a><a href="./forgotpsw.php"><img src="./pictures/txt_forgot_psw.gif" alt="ZAPOMELI JSTE HESLO?" border="0" width="97" height="10" class="login_text1"/></a>');
    } else {
       _parent.innerHTML = emptystring.concat('<div class="club_referer"><a href="./club.php"><img src="./pictures/spacer.gif" height="57" width="119" border="0" /></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="image" src="./pictures/login_button.gif" alt="PŘIHLÁSIT SE" name="login_send" class="login_button"/><a href="./club.php?style=registrace"><img src="./pictures/txt_register.gif" alt="REGISTRACE" border="0" width="49" height="9" class="login_text1"/></a><a href="./forgotpsw.php"><img src="./pictures/txt_forgot_psw.gif" alt="ZAPOMELI JSTE HESLO?" border="0" width="97" height="10" class="login_text1"/></a>');
    }
    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";
}
