var N4=false;
var IE=false;
var W3C=false;
var fr="";

// browserbestimmung
function checkBrowser () {
/*fr=window.location.search;
if (!top.moben&&fr!="?-1"){
 top.location.href="index.html";
 }
 */
   if (document.getElementById)
    W3C=true;
  else if (document.all)
    IE=true;
  else if (document.layers)
    N4=true;

}


function dhtml_DivImage (url,name,id) {       //erwartet Bildquelle,Bildname,DivId
 if (N4){
document.layers[id].document.images[name].src=url;

}
 else {
  if (IE)
  document.images[name].src=url
  else {
   if (W3C)
   document.getElementById(name).src=url
  }
 }
 return true
}



function dhtml_obj(id) {
  if (N4)
    return document.layers[id];
  else if (IE)
    return document.all[id];
  else if (W3C)
    return document.getElementById(id);
}

function dhtml_style(id) {
  if (N4)
    return dhtml_obj(id);
  else if (IE || W3C)
    return dhtml_obj(id).style;
}

function dhtml_hide(id) {
        dhtml_style(id).visibility = "hidden";
    return
}

function dhtml_show(id) {
          dhtml_style(id).visibility = "visible";
    return
}

function dhtml_bcol(id,farbe) {
if (N4)
   dhtml_obj(id).bgColor=farbe;
  else if (IE || W3C)
   dhtml_obj(id).style.backgroundColor=farbe;
 return
}

function dhtml_col(id,farbe) {
if (N4)
   dhtml_obj(id).color=farbe;
  else if (IE || W3C)
   dhtml_obj(id).style.color=farbe;
 return
}

function dhtml_bimg(id,url) {
if (N4)
   dhtml_obj(id).background.src=url;
  else if (IE || W3C)
   dhtml_obj(id).style.backgroundImage = 'url(' + url+ ')';
 return
}

function dhtml_write(id,text) {
if (N4)
   with (dhtml_obj(id)){
    document.write (text);
    document.close();
    }
  else if (IE || W3C)
   dhtml_obj(id).innerHTML = text;
 return
}

function dhtml_getX(id) {
    if (N4 || W3C)
      return parseInt(dhtml_style(id).left);
    else if (IE)
      return dhtml_style(id).posLeft;
}

function dhtml_getY(id) {
    if (N4 || W3C)
      return parseInt(dhtml_style(id).top);
    else if(IE)
      return dhtml_style(id).posTop;
}

function dhtml_setX(id, n) {
    if (N4)
      dhtml_style(id).left = n;
    else if (IE)
      dhtml_style(id).posLeft = n;
    else if (W3C)
      dhtml_style(id).left = n + "px";
}
function dhtml_setY(id, n) {
    if (N4)
      dhtml_style(id).top = n;
    else if (IE)
      dhtml_style(id).posTop = n;
    else if (W3C)
      dhtml_style(id).top = n + "px";
}

function dhtml_moveTo(id, x, y) {
    dhtml_setX(id, x);
    dhtml_setY(id, y);
}

function dhtml_moveBy(id, deltaX, deltaY) {
    var x = parseInt(dhtml_getX(id));
    var y = parseInt(dhtml_getY(id));
    x += deltaX;
    y += deltaY;
    dhtml_setX(id, x);
    dhtml_setY(id, y);
}
function dhtml_w_breite() {
  if (window.innerWidth)  //N4
    return window.innerWidth;
  else if (document.body) //IE-W3C
    return document.body.clientWidth;
}
function dhtml_w_hoehe() {
  if (window.innerHeight)
    return window.innerHeight;
  else if (document.body)
    return document.body.clientHeight;
}
function dhtml_div_breite(id) {
  if (N4)
    return dhtml_obj(id).document.width;
  else if (IE || W3C)
    return dhtml_obj(id).offsetWidth;
}
function dhtml_div_hoehe(id) {
  if (N4)
    return dhtml_obj(id).document.height;
  else if (IE || W3C)
    return dhtml_obj(id).offsetHeight;
}

function dhtml_zIndex (id,z) {
    dhtml_style(id).zIndex=z;
return
}

function dhtml_clip (id,newY1,newX1,newX2,newY2) {
obj=dhtml_style(id);
if(N4) {
     obj.clip.top =newY1;
     obj.clip.right =newX2;
     obj.clip.bottom =newY2;
     obj.clip.left =newX1;
    }
   if(IE||W3C) //W3C Dom
     {
      obj.clip='rect('+ newY1 + 'px '+ newX2 + 'px '+ newY2 +'px '+ newX1 +'px)';
     }

return
}

Bilder=new Array();
function ladeBildVorE()
  {
  var i = 0;
  while (i < arguments.length)
    {
    Bilder[i] = new Image();
    Bilder[i].src = arguments[i];
    i += 1;

    }
   }

function dhtml_hidescroll () {
if (W3C||IE)// Browser, die das W3C-DOM Level 1 unterstützen (IE 5, NS 6)
   {
    document.body.height = dhtml_w_hoehe();
    }

else if (N4)//Version für den NS 4
   {
   document.height      = dhtml_w_hoehe();
   }

return
}

function wopen(url,fname)
 {
  if(!win)
  {
  var win=window.open(url,fname,'width=700,height=550,left=100,top=130');

  }
 win.focus();
 }
 
function pruefe()
{
if(document.forms[0].Name.value=="" || document.forms[0].Ort.value=="" || document.forms[0].PLZ.value=="" )
{
 var fehler=true;
}
 if(fehler==true)
 {
 alert("Bitte füllen Sie folgende Felder aus: \n Name \n Plz\n Ort ");
 return false;
 }
}
