function checkLogin(aValue)
{
  new Ajax.Request('../special/checklogin.php' , {
    method: 'post',
    parameters: {userId: aValue},
    onCreate: $('notice').update('<span style="color: blue;">Pr&uuml;fe Eingabe...</span>'),
    onSuccess: function(transport){
      var response = transport.responseText;
      $('notice').update(response);
    }
  });
}

function confirmVersionDelete(itemId , projectId)
{
  var r=confirm("Version wirklich entfernen?")
  if (r==true)
  {
    window.location.href="proofitem_process.php?delete=" + itemId + "&projectId=" + projectId;
  }
}

function confirmProjectDelete(aLink)
{
  var r=confirm("Projekt wirklich entfernen? Alle Daten werden UNWIDERRUFLICH entfernt!")
  if (r==true)
  {
    window.location.href=aLink;
  }
}

function confirmWorkerDelete(aLink)
{
  var r=confirm("Bearbeiter wirklich entfernen?")
  if (r==true)
  {
    window.location.href=aLink;
  }
}

function confirmDelete(aLink , aMessage)
{
  var r=confirm(aMessage)
  if (r==true)
  {
    window.location.href=aLink;
  }
}

function confirmProjectClose(projectId)
{
  var r=confirm("Projekt wirklich schliessen? Alle Dateien werden irreversibel entfernt!")
  if (r==true)
  {
    window.location.href="proofproject_process.php?close=" + projectId;
  }
}

function confirmCustomerDelete(customerId)
{
  var r=confirm("Kunden wirklich entfernen? Bitte auf Abhaengigkeiten zu Projekten achten!!")
  if (r==true)
  {
    window.location.href="proofcustomer_process.php?delete=" + customerId;
  }
}

function popCustomerWindow()
{
  mywindow = window.open('../admin/proofcustomer.php?popped=1' , 'Kundenverwaltung' , "width=800 , height=600, resizable=yes, scrollbars=yes, menubar=no,status=no,toolbar=no");
}

function checkForFillout(element , submitId)
{
  if($(element).innerHTML == '')
  {
    $(element).innerHTML='Pflichtfeld, bitte etwas eingeben!';
    $(submitId).disabled=true;
  }
  else
    $(submitId).disabled=false;
}
    
function validateEmail(aValue)
{
  if(aValue == '' || !aValue)
  {
    $('notice').update('E-Mail-Adresse bitte ausf&uuml;llen!');
  }
  else
    $('notice').update('');

}  

function checkForWorkerFillout()
{
  if($('aussendienst').value == '0' || $('grafik').value == '0')
  {
    $('submit').hide();
    $('projectfillout').update('<font color="red"><center>Bitte zuerst Bearbeiter ausw&auml;hlen!</center></font>');
  }
  else
  {
    $('submit').show();
    $('projectfillout').update('');
  }
}
