// Admin Popup Begin
function popup (url) {
 fenster=window.open(url, "popup", "width=800,height=600,status=yes,scrollbars=yes,resizable=yes");
 fenster.focus();
 return false;
}
// Admin Popup End

//AUTORESIZE POPUP BEGIN
var flag = false;
  
function open_IMG(quelle) {
  if(typeof obj == 'undefined') {
    obj = new Image();
    obj.onload = function() { write_Popup(this); }
    obj.onerror = function() { alert(this.src + " konnte nicht geladen werden."); }
  }
  obj.src = quelle;
  return flag;
}

function write_Popup(bObj) {
  var w = bObj.width + 50;
  var h = bObj.height + 130;
  var title = bObj.src.substring(bObj.src.lastIndexOf("/")+1, bObj.src.length);
  var pWin = window.open("","Detailansicht","left=0,top=0,width="+w+",height="+h+",menubar=no,status=no,scrollbars=yes");
  if(typeof pWin == 'undefined' || pWin == null) {
    alert("Ihr Browser erlaubt das Oeffnen von Popup-Fenstern nicht.");
  }
  else {
    pWin.resizeTo(w, h);
    pWin.document.open("text/html");
    pWin.document.write("<html><head><title>"+title+"<\/title><\/head><body style='background-color:white'>");
    pWin.document.write("<div style='text-align:center'>");
    pWin.document.write("<img src='"+bObj.src+"' width='"+bObj.width+"' height='"+bObj.height+"'><br><br>");
    pWin.document.write("<input type='button' name='close' value='Zatvori' onClick='self.close();'>");
    pWin.document.write("<\/div><\/body><\/html>");
    pWin.document.close();
    pWin.focus();
  }
}
//AUTORESIZE POPUP END