// name = name des buttons 
function AddImages(name)
{
  width  = 480;
  height = 500;
  file   = "";
  id     = "";
  
  if(document.forms["markt"][name+"_id"].value=="") {
    file = "/imgupload/index.php?modul=markt&fieldname=" +name;
  } else {
    id = document.forms["markt"][name+"_id"].value;
    file = "/imgupload/index.php?fuseaction=view&modul=markt&fieldname=" +name + "&id=" +id;
  }
  var left = (screen.availWidth - width) / 2;
  var top = (screen.availHeight - height) / 2;
  NewWindow = open(""+file,"ImgUploader","HEIGHT="+height+",WIDTH="+width+",MENUBAR=no,SCROLLBARS=yes,TOOLBAR=no,LOCATION=no,STATUS=yes,left="+left+",top="+top);
  document.forms["markt"][name].value= "Fenster geöffnet";
}

function checkImg() {
  for(i=1;i<=3;i++) {
    if(document.forms["markt"]["bild"+i+"_id"].value!=""){
      document.forms["markt"]["bild"+i].value = " Bild anzeigen ";
    } else {
      document.forms["markt"]["bild"+i].value = " Bild auswählen ";
    }
  }
}

function showImg(id,height,width)
{
  file   = "index.php?fuseaction=viewimg&id=" +id;
  var left = (screen.availWidth - width) / 2;
  var top = (screen.availHeight - height) / 2;
  NewWindow = open(""+file,"ImgView"+id,"HEIGHT="+height+",WIDTH="+width+",MENUBAR=no,SCROLLBARS=no,TOOLBAR=no,LOCATION=no,STATUS=yes,left="+left+",top="+top);
}


