function form_clear_text(obj,def) {
  if (obj.value == def)
    obj.value = ""
}
function form_insert_text(obj,def) {
  if (obj.value == "")
    obj.value = def
}
function form_clear_password(obj,def) {
  if (obj.value == def) {
    obj.value = ""
    obj.setAttribute('type','password');
  }
}
function form_insert_password(obj,def) {
  if (obj.value == "") {
    obj.value = def
    obj.setAttribute('type','text');
  }
}
function showslots() {
	document.getElementById('slots').style.display = 'block'
	document.getElementById('exceed').style.display = 'none'
}
function showex() {
	document.getElementById('slots').style.display = 'none'
	document.getElementById('exceed').style.display = 'block'
}
function editfield(mainid, value) {
	document.getElementById(mainid+'1').innerHTML = '<input type="text" name="'+mainid+'" value="'+value+'" />'
	document.getElementById(mainid+'2').innerHTML = '<a href="#" onclick="abortfield(\''+mainid+'\',\''+value+'\')"><img src="icon/cross.png" alt="cross" title="abbrechen" /></a>'
	document.getElementById(mainid+'2').innerHTML += '<a href="#" onclick="submitform(\'editform\')"><img src="icon/tick.png" alt="tick" title="speichern" /></a>'
}
function abortfield(mainid, value) {
	document.getElementById(mainid+'1').innerHTML = value
	document.getElementById(mainid+'2').innerHTML = '<a href="#" onclick="editfield(\''+mainid+'\',\''+value+'\')"><img src="icon/pencil.png" alt="pencil" title="bearbeiten" /></a>'
}
function submitform(formid) {
	document.getElementById(formid).submit();
	unloader();
	return false;
}
