focus();

//Browswerweiche
var xy = navigator.appVersion;
xz = xy.substring(0,4);
if (navigator.appName=="Netscape" && xz>=4) {
browser="ns";
}
if (navigator.appName=="Microsoft Internet Explorer" && xz>=4) {
browser="ie";
}

schalter = true;
function checkboxes(form,prefix,amount){
  for (i=0;i<amount;i++){ 
  cb = prefix+i;
    if (form.elements[cb]){
    form.elements[cb].checked = schalter
    }
  }
  if(schalter == true){schalter = false; }
  else {schalter = true;}
}


function choose(){
var args = choose.arguments;
var formName = args[0]; var type     = args[1];
var field    = args[2]; var newValue = args[3]; 
var dir      = args[4]; var thumb    = args[5];
var path ="";
if (dir){ path = dir.substring(3)+'/';} 
  if (field){
      if (opener.document.forms[formName]){
         if (type == 'bilder'){
         bildname = 'bild_'+field;
           if(opener.document.images[bildname]){
           opener.document.images[bildname].src = dir+thumb;
           }
         }
      opener.document.forms[formName].elements[field].value = path+newValue;
      }
      else{
      alert("Formular nicht gefunden!");
      }
  self.close();
  }
}

function popUp(){
var args = popUp.arguments;
var url = args[0]; var w = args[1]; var h = args[2];
var scrollbars = args[3]; var winName = args[4]; 
if (scrollbars){ scrb = ", scrollbars=yes"; }
else{ scrb=""; }
dimensions =", height="+h+", width="+w;
win = window.open(url,winName,"left=10,top=10,status=yes"+scrb+", resizable=yes, location=no,menubar=no"+dimensions);
win.focus();
}
function jumpMenu(Obj){
window.location.href = Obj.options[Obj.selectedIndex].value;
}

function tdColor(td,color){
//td.style.cursor = 'hand'; 
td.style.backgroundColor = color;
}

function tdClick(url){
//document.location.href = url;
}


function confirmation(url,text){
//alert('ahhlo');
check = confirm(text);
if(check == true) document.location.href = url; /* +"&edit_id="+id; */
}

function deleteConfirmAlt(url,id){
check = confirm("Eintrag "+id+" löschen?");
if(check == true) document.location.href = url+"&edit_id="+id;
}

function clear(field,shim){
//alert('ahhlo');
check = confirm('Dateiverknuepfung loeschen?\n(Um die Datei selbst zu loeschen, begeben Sie sich bitte in die Dateiverwaltung)');
 if(check == true) {
  document.forms[0].elements[field].value = '';
  bildname = 'bild_'+field;
  if (shim){
  alert('do');
    document.images[bildname].src = shim;
  }
 }
}

