<!--
function new_window(theURL,winName,features,myWidth,myHeight,isCenter) {
  if(window.screen)if(isCenter)if(isCenter == 'true') {
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

function changeImages() {
  if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
    grafik = changeImages.arguments[i];
    quelle = changeImages.arguments[i+1]; }
  document.getElementsByName(grafik)[0].src = quelle;
  }
}

function update_problem_neu()
{
var service = document.forms.stoer.service;
var problem = document.forms.stoer.problem;
problem.options.length = 0; // DropDown Menü entleeren

  if (service.options[service.selectedIndex].value == "Abfall / Recycling / Reinigung")
  {
    problem.options[0] = new Option("bitte wählen");
    problem.options[0].value = "bitte wählen";
    problem.options[1] = new Option("Abfallbehälter leeren");
    problem.options[2] = new Option("Fensterreinigung erforderlich");
    problem.options[3] = new Option("mangelhafte Reinigung");
    problem.options[4] = new Option("Papierhandtücher fehlen");
    problem.options[5] = new Option("Recyclingbehälter leeren");
    problem.options[6] = new Option("Reinigungsturnus nicht eingehalten");
    problem.options[7] = new Option("Seife im WC fehlt");
    problem.options[8] = new Option("Sondermüll entsorgen");
    problem.options[9] = new Option("Sonderreinigung erforderlich");
    problem.options[10] = new Option("WC-Papier fehlt");
    problem.options[11] = new Option("sonstiges");
  }
  
  else if (service.options[service.selectedIndex].value == "Aufzüge")
  {
    problem.options[0] = new Option("bitte wählen");
    problem.options[0].value = "bitte wählen";
    problem.options[1] = new Option("Aufzug defekt");
    problem.options[2] = new Option("Tür schließt nicht");
    problem.options[3] = new Option("sonstiges");
  }

  else if (service.options[service.selectedIndex].value == "Außenanlagen")
  {
    problem.options[0] = new Option("bitte wählen");
    problem.options[0].value = "bitte wählen";
    problem.options[1] = new Option("sonstiges");
    problem.options[1].selected = true;
    
  }

  else if (service.options[service.selectedIndex].value == "Elektr./Telefon/Gefahrenmeldeanlagen")
  {
    problem.options[0] = new Option("bitte wählen");
    problem.options[0].value = "bitte wählen";
    problem.options[1] = new Option("Anschlussdose defekt");
    problem.options[2] = new Option("Beleuchtung defekt");
    problem.options[3] = new Option("defekte Abdeckung des Handmelders");
    problem.options[4] = new Option("Feuerlöscher fehlt");
    problem.options[5] = new Option("Feuerschutztüren geschlossen");
    problem.options[6] = new Option("Gebäude stromlos");
    problem.options[7] = new Option("neuer Telefonanschluss erforderlich");
    problem.options[8] = new Option("Notausgangstüren piepen");
    problem.options[9] = new Option("Raum stromlos");
    problem.options[10] = new Option("Sprinkler verliert Flüssigkeit");
    problem.options[11] = new Option("Steckdose defekt");
    problem.options[12] = new Option("Telefonanschluss defekt");
    problem.options[13] = new Option("Telefongerät defekt");
    problem.options[14] = new Option("sonstiges");
  }

  else if (service.options[service.selectedIndex].value == "Heizung / Lüftung / Klima / Sanitär")
  {
    problem.options[0] = new Option("bitte wählen");
    problem.options[0].value = "bitte wählen";
    problem.options[1] = new Option("Ausfall der Heizung im Gebäude");
    problem.options[2] = new Option("Ausfall der Heizung im Raum");
    problem.options[3] = new Option("Ausfall der Kühlung im Gebäude");
    problem.options[4] = new Option("Ausfall der Kühlung im Raum");
    problem.options[5] = new Option("Druckabfall / zu geringer Durchfluss");
    problem.options[6] = new Option("Fußbodenentwässerung läuft nicht ab");
    problem.options[7] = new Option("Grundleitung verstopft");
    problem.options[8] = new Option("Mangelnde Belüftung");
    problem.options[9] = new Option("Mischbatterie lässt sich nicht abstellen");
    problem.options[10] = new Option("störende Zugluft");
    problem.options[11] = new Option("störender Geruch");
    problem.options[12] = new Option("Temperatur zu hoch");
    problem.options[13] = new Option("Temperatur zu niedrig");
    problem.options[14] = new Option("Unidentifizierbares Geräusch");
    problem.options[15] = new Option("Waschbecken läuft nicht ab");
    problem.options[16] = new Option("WC läuft nicht ab");
    problem.options[17] = new Option("WC läuft permanent");
    problem.options[18] = new Option("sonstiges");
  }

  else if (service.options[service.selectedIndex].value == "Türen / Fenster")
  {
    problem.options[0] = new Option("bitte wählen");
    problem.options[0].value = "bitte wählen";
    problem.options[1] = new Option("defekt");
    problem.options[2] = new Option("öffnet nicht");
    problem.options[3] = new Option("schließt nicht");
    problem.options[4] = new Option("Scheibe gesprungen / defekt");
    problem.options[5] = new Option("sonstiges");
  }
  
  else if (service.options[service.selectedIndex].value == "Türen / Schloss / Schlüssel")
  {
    problem.options[0] = new Option("bitte wählen");
    problem.options[0].value = "bitte wählen";
    problem.options[1] = new Option("Automatiktür defekt");
    problem.options[2] = new Option("schließt nicht");
    problem.options[3] = new Option("Schloss defekt");
    problem.options[4] = new Option("Schlüssel defekt");
    problem.options[5] = new Option("Schlüssel verloren");
    problem.options[6] = new Option("Schlüsselduplikat erforderlich");
    problem.options[7] = new Option("Türgriff fehlt");
    problem.options[8] = new Option("Türgriff lose");
    problem.options[9] = new Option("sonstiges");
  }

  else if (service.options[service.selectedIndex].value == "Sonstiges")
  {
    problem.options[0] = new Option("bitte wählen");
    problem.options[0].value = "bitte wählen";
    problem.options[1] = new Option("DI-Wasser ausgefallen");
    problem.options[2] = new Option("Druckluftversorgung ausgefallen");
    problem.options[3] = new Option("Sondergase ausgefallen");
    problem.options[4] = new Option("Stickstoffversorgung ausgefallen");
    problem.options[5] = new Option("sonstiges");
  }
}

function update_spez()
{
var spez = document.forms.stoer.spez;
var problem = document.forms.stoer.problem;
problem.options.length = 0; // DropDown Menü entleeren

  if (spez.options[spez.selectedIndex].value == "Hardware")
  {
    problem.disabled = false;
    problem.options[0] = new Option("Auswählen...");
    problem.options[1] = new Option("Drucker");
    problem.options[2] = new Option("Maus");
    problem.options[3] = new Option("Monitor");
    problem.options[4] = new Option("PC");
    problem.options[5] = new Option("Scanner");
    problem.options[6] = new Option("Tastatur");
    problem.options[7] = new Option("Sonstiges");
  }
  
  else if (spez.options[spez.selectedIndex].value == "Software")
  {
    problem.disabled = false;
    problem.options[0] = new Option("Auswählen...");
    problem.options[1] = new Option("Access");
    problem.options[2] = new Option("Betriebssystem");
    problem.options[3] = new Option("Excel");
    problem.options[4] = new Option("MS-Office Allgemein");
    problem.options[5] = new Option("Organice Pi");
    problem.options[6] = new Option("Outlook");
    problem.options[7] = new Option("SAP");
    problem.options[8] = new Option("Word");
    problem.options[9] = new Option("Sonstiges");
  }

  else if (spez.options[spez.selectedIndex].value == "" || spez.options[spez.selectedIndex].value == "Netzwerk")
  {
    problem.disabled = true;
    problem.options[0] = new Option("Auswählen...");
  }
}


function update_fall()
{
var fall = document.forms.stoer.fall;

  if (fall.options[fall.selectedIndex].value == "angebot" || fall.options[fall.selectedIndex].value == "service") {
    document.getElementById("problem").style.display = "none";
  } else {
    document.getElementById("problem").style.display = "block";
  }
  
  if (fall.options[fall.selectedIndex].value == "angebot") {
	document.getElementById("kalender").firstChild.innerHTML = "Gew&uuml;nschter Angebotstermin:";
	document.getElementById("fertig").style.display = "block";
  } else {
	document.getElementById("kalender").firstChild.innerHTML = "Dringlichkeit:";
	document.getElementById("fertig").style.display = "none";
  }  
}

function datum_pruefen(date) {
  if(date != "") {
    var regex = /^([0-3]\d)\-([0-3]\d)\-(\d{4})$/;
    if(!regex.exec(date)) {
       alert("Bitte geben Sie ein gültiges Datum ein im Format dd-mm-yyyy.")
       document.stoer.prior.focus();
       return false;
    }
    var tmp = new Date(RegExp.$3,RegExp.$2,0);
    if(tmp.getDate() < RegExp.$1 || RegExp.$2 > 12) {
       alert("Bitte geben Sie ein gültiges Datum ein im Format dd-mm-yyyy.")
       document.stoer.prior.focus();
       return false;
    }
    var termin = new Date(RegExp.$3,(RegExp.$2-1),RegExp.$1);
    var heute = new Date();
    heute.setDate(heute.getDate()-1);
    if(termin <= heute) {
       alert("Bitte wählen Sie ein Datum in der Zukunft aus.");
       document.stoer.prior.focus();
       return false;
    }
    return true;
  }
}

function datum_pruefen_punkt(date) {
  if(date != "") {
    var regex = /^([0-3]\d)\.([0-3]\d)\.(\d{4})$/;
    if(!regex.exec(date)) {
       alert("Bitte geben Sie ein gültiges Datum ein im Format dd.mm.yyyy.")
       document.stoer.prior.focus();
       return false;
    }
    var tmp = new Date(RegExp.$3,RegExp.$2,0);
    if(tmp.getDate() < RegExp.$1 || RegExp.$2 > 12) {
       alert("Bitte geben Sie ein gültiges Datum ein im Format dd.mm.yyyy.")
       document.stoer.prior.focus();
       return false;
    }
    var termin = new Date(RegExp.$3,(RegExp.$2-1),RegExp.$1);
    var heute = new Date();
    heute.setDate(heute.getDate()-1);
    if(termin <= heute) {
       alert("Bitte wählen Sie ein Datum in der Zukunft aus.");
       document.stoer.prior.focus();
       return false;
    }
    return true;
  }
}

function eingabe_pruefen(){

// Eingabe &uuml;berpr&uuml;fen Seite St&ouml;rung

 var mail = document.stoer.email.value;
 
 if (document.stoer.fall.value == ""){
  alert("Bitte wählen Sie die Art Ihrer Mitteilung aus.")
  document.stoer.fall.focus();
  return false;
 }

 else if (document.stoer.prior.value == ""){
  alert("Bitte wählen Sie die Dringlichkeit aus.")
  document.stoer.prior.focus();
  return false;
 }
 
 else if (!datum_pruefen(document.stoer.prior.value)) {
  return false;
 }

 else if (document.stoer.service.value == ""){
  alert("Bitte wählen Sie einen Service aus.")
  document.stoer.service.focus();
  return false;
 }

 else if ((document.stoer.fall.value == "stoerung" || document.stoer.fall.value == "maengel") && document.stoer.problem.value == "bitte wählen")
 {
   alert("Bitte wählen Sie ein Problem aus.");
   document.stoer.problem.focus();
   return false;
 }

 else if (document.stoer.name.value.length < 3){
  alert("Bitte geben Sie Ihren Namen ein.");
  document.stoer.name.focus();
  return false;
 }
 
 else if (document.stoer.tel.value.length < 3){
  alert("Bitte geben Sie Ihre Telefonnummer ein.");
  document.stoer.tel.focus();
  return false;
 }
 
 else if (document.stoer.firma.value.length < 3){
  alert("Bitte geben Sie den Namen Ihrer Firma ein.");
  document.stoer.firma.focus();
  return false;
 }

 else if (mail.length < 10 || mail.indexOf ('@',0) == -1 || mail.indexOf ('.',0) == -1){
  alert("Bitte geben Sie eine gültige E-Mail-Adresse ein.")
  document.stoer.email.select();
  return false;
 }

 else if (document.stoer.AID.value == ""){
  alert("Bitte wählen Sie eine Adresse aus.")
  document.stoer.AID.focus();
  return false;
 }

else

 return true;

}

function eingabe_pruefen_punkt(){

// Eingabe &uuml;berpr&uuml;fen Seite St&ouml;rung

 var mail = document.stoer.email.value;
 
 if (document.stoer.fall.value == ""){
  alert("Bitte wählen Sie die Art Ihrer Mitteilung aus.")
  document.stoer.fall.focus();
  return false;
 }

 else if (document.stoer.prior.value == ""){
  alert("Bitte wählen Sie die Dringlichkeit aus.")
  document.stoer.prior.focus();
  return false;
 }
 
 else if (!datum_pruefen_punkt(document.stoer.prior.value)) {
  return false;
 }

 else if (document.stoer.service.value == ""){
  alert("Bitte wählen Sie einen Service aus.")
  document.stoer.service.focus();
  return false;
 }

 else if ((document.stoer.fall.value == "stoerung" || document.stoer.fall.value == "maengel") && document.stoer.problem.value == "bitte wählen")
 {
   alert("Bitte wählen Sie ein Problem aus.");
   document.stoer.problem.focus();
   return false;
 }

 else if (document.stoer.name.value.length < 3){
  alert("Bitte geben Sie Ihren Namen ein.");
  document.stoer.name.focus();
  return false;
 }
 
 else if (document.stoer.tel.value.length < 3){
  alert("Bitte geben Sie Ihre Telefonnummer ein.");
  document.stoer.tel.focus();
  return false;
 }
 
 else if (document.stoer.firma.value.length < 3){
  alert("Bitte geben Sie den Namen Ihrer Firma ein.");
  document.stoer.firma.focus();
  return false;
 }

 else if (mail.length < 10 || mail.indexOf ('@',0) == -1 || mail.indexOf ('.',0) == -1){
  alert("Bitte geben Sie eine gültige E-Mail-Adresse ein.")
  document.stoer.email.select();
  return false;
 }

 else if (document.stoer.AID.value == ""){
  alert("Bitte wählen Sie eine Adresse aus.")
  document.stoer.AID.focus();
  return false;
 }

else

 return true;

}

function edv_pruefen(){

// Eingabe überprüfen Seite EDV-Support HelpDesk
 var mail = document.stoer.email.value;

 if (document.stoer.firma.value == ""){
  alert("Bitte wählen Sie Ihre Firma aus.");
  document.stoer.firma.focus();
  return false;
 }

 else if (document.stoer.name.value.length < 3){
  alert("Bitte geben Sie Ihren Namen ein.");
  document.stoer.name.focus();
  return false;
 }
 
 else if (document.stoer.tel.value.length < 3){
  alert("Bitte geben Sie Ihre Telefonnummer ein.");
  document.stoer.tel.focus();
  return false;
 }
 
  else if (mail.length < 10 || mail.indexOf ('@',0) == -1 || mail.indexOf ('.',0) == -1){
  alert("Bitte geben Sie eine gültige E-Mail-Adresse ein.")
  document.stoer.email.select();
  return false;
 }

else if (document.stoer.fall.value == ""){
  alert("Bitte wählen Sie die Art Ihrer Anforderung aus.")
  document.stoer.fall.focus();
  return false;
 }

 else if (document.stoer.spez.value == ""){
  alert("Bitte wählen Sie die Spezifikation aus.")
  document.stoer.spez.focus();
  return false;
 }

 else if (document.stoer.prior.value == "")
 {
   alert("Bitte wählen Sie die Dringlichkeit aus.");
   document.stoer.prior.focus();
   return false;
 }

 
else

 return true;

}



function post_pruefen(){
  var email = document.post.email.value;

  if (document.post.name.value == ""){
    alert("Bitte geben Sie Ihren Namen oder den Namen Ihrer Firma ein.")
    document.post.name.focus();
    return false;
  }

  else if (document.post.telefon.value == ""){
    alert("Bitte geben Sie Ihre Telefonnummer ein.")
    document.post.telefon.focus();
    return false;
  }

 else if (email.length < 10 || email.indexOf ('@',0) == -1 || email.indexOf ('.',0) == -1){
  alert("Bitte geben Sie eine gültige E-Mail-Adresse ein.")
  document.post.email.select();
  return false;
 }

  else

    return true;

  }

function newImage(arg) {
  if (document.images) {
    rslt = new Image();
    rslt.src = arg;
    return rslt;
  }
}

var preloadFlag = false;
function preloadImages() {
  if (document.images) {
    for (var i=0; i<preloadImages.arguments.length; i++) {
      rslt = newImage(preloadImages.arguments[i]);
    }
    preloadFlag = true;
  }
}

function set_tel() {
  var name = document.forms.stoer.name;
  var tel = document.forms.stoer.tel;

  if (name.options[name.selectedIndex].value == "Herr Grobert")
  {
    tel.value = "0174 / 1601743";
  }
  else if (name.options[name.selectedIndex].value == "Herr Kott")
  {
    tel.value = "0172 / 3965276";
  }
  else if (name.options[name.selectedIndex].value == "Herr Splinter")
  {
    tel.value = "0172 / 1724674";
  }
  else if (name.options[name.selectedIndex].value == "Herr Umbreit")
  {
    tel.value = "0174  / 3031363";
  }
  else if (name.options[name.selectedIndex].value == "Herr Schlaubitz")
  {
    tel.value = "030 / 63921930";
  }
}
//-->

