function openPopup( url, width, height, name, features ) {

    function addFeature( features, name, value ) {
        if( value == null || value == "" ) {
            return features;
        }
        if( features != "" ) {
            features += ",";
        }
        return features + name + "=" + value;
    }

    if( name == null || name == "" ) {
        name = "popupWindow";
    }
    if( features == null || features == "") {
        features = "";
        features = addFeature( features, "scrollbars", "yes" );
        features = addFeature( features, "resizable", "yes" );
        if( name == "popupWindow" ) {
            features = addFeature( features, "location", "yes" );
            features = addFeature( features, "menubar", "yes" );
            features = addFeature( features, "toolbar", "yes" );
            features = addFeature( features, "status", "yes" );
        }
    }
    if( name == "viewlarger" ) {
        if( width == null || width == "" ) {
            width = 850;
        }
        if( height == null || height == "" ) {
            height = 700;
        }
    }
    if( name == "popupWindow" ) {
        if( width == null || width == "" ) {
            width = 800;
        }
        if( height == null || height == "" ) {
            height = 600;
        }
    }
    if( name == "viewbig" ) {
        if( width == null || width == "" ) {
            width = 800;
        }
        if( height == null || height == "" ) {
            height = 700;
        }
    }
    if( name == "kontakt" ) {
        if( width == null || width == "" ) {
            width = 605;
        }
        if( height == null || height == "" ) {
            height = 700;
        }
    }
    if( name == "viewbig1024" ) {
        if( width == null || width == "" ) {
            width = 1070;
        }
        if( height == null || height == "" ) {
            height = 820;
        }
    }
    if( name == "email" ) {
        if( width == null || width == "" ) {
            width = 700;
        }
        if( height == null || height == "" ) {
            height = 700;
        }
    }
    features = addFeature( features, "width", width );
    features = addFeature( features, "height", height );
    var popupWindow = window.open( url, name, features );
    popupWindow.focus();

    return false;
}



var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")



function hidestatus(){
window.status=''
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEDOWN | Event.MOUSEUP | Event.MOUSEMOVE | Event.MOUSEDRAG | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmousedown=hidestatus
document.onmouseup=hidestatus
document.onmousemove=hidestatus
document.onmousedrag=hidestatus
document.onmouseout=hidestatus


window.defaultStatus = " ";



function chkFormular()
    {
     if(document.Formular.Name________________________.value == "")
      {
       alert("*-Felder sind Pflichtfelder!");
       document.Formular.Name________________________.focus();
       return false;
      }
        if(document.Formular.Vorname_____________________.value == "")
      {
       alert("*-Felder sind Pflichtfelder!");
       document.Formular.Vorname_____________________.focus();
       return false;
      }
      if(document.Formular.Strasse_____________________.value == "")
      {
       alert("*-Felder sind Pflichtfelder!");
       document.Formular.Strasse_____________________.focus();
       return false;
      }
      if(document.Formular.PLZ_________________________.value == "")
      {
       alert("*-Felder sind Pflichtfelder!");
       document.Formular.PLZ_________________________.focus();
       return false;
      }

      if(document.Formular.Ort_________________________.value == "")
      {
       alert("*-Felder sind Pflichtfelder!");
       document.Formular.Ort_________________________.focus();
       return false;
      }
      if(document.Formular.Telefon_____________________.value == "")
      {
       alert("*-Felder sind Pflichtfelder!");
       document.Formular.Telefon_____________________.focus();
       return false;
      }
      if(document.Formular.Email_______________________.value == "")
      {
       alert("*-Felder sind Pflichtfelder!");
       document.Formular.Email_______________________.focus();
       return false;
      }
      if(document.Formular.Email_______________________.value.indexOf('@') == -1)
      {
       alert("Keine E-Mail Adresse!");
       document.Formular.Email_______________________.focus();
       return false;
       }
       var chkZ = 1;
       for(i=0;i<document.Formular.PLZ_________________________.value.length;++i)
       if(document.Formular.PLZ_________________________.value.charAt(i) < "0"
       || document.Formular.PLZ_________________________.value.charAt(i) > "9")
       chkZ = -1;
       if(chkZ == -1)
       {
       alert("Keine gültige Postleitzahl!");
       document.Formular.PLZ_________________________.focus();
       return false;
      }
    }



var popup_window = null;
function popup(status,url) {
if(status != 0) {
if(popup != null) popup.focus();
else {
var popup = open(url, "Popup", "width=300,height=220");
popup_window = popup;
}
} else {
if(popup_window != null) popup_window.close();
}
}

