/* Funktionen fuer Drogennotdienst Umformtechnik */
function getWinWidth() {

  if (document.layers)
    return(window.innerWidth);
  else if (document.all)
    return(document.body.clientWidth);
  else
    return(null);
}

function getWinHeight() {

  if (document.layers)
    return(window.innerHeight);
  else if (document.all)
    return(document.body.clientHeight);
  else
    return(null);
}

function popVVG(p,w,h,t,l) // p = Seite, w = breite, h=höhe t = Titel der Seite l= link
{

        var dhost = "http://" + location.host;
//        alert(l);

        var popname = "dndda";

        if(!w) {
        var w = 436;
        }
        if(!h) {
        var h = 380;
        }

        var ww = getWinWidth();
        var wh = getWinHeight();

        if(ww > w) {
        var posx = (ww - w) / 2 ;
        } else {
        var posx = 10;
        }

        if(ww > w) {
        var posy = (wh - h) / 2 ;
        } else {
        var posy = 10;
        }
//        alert(dhost+p);
       window.open(dhost+""+p+"?Thema="+t+"&Link="+dhost+l,popname,'location=no,scrollbars=yes,resizable=yes,top='+posy+',left='+posx+',width='+w+',height='+h+'');

}

function nPop(p,w,h) // p = url, w = breite, h = höhe Bsp.: <a href='javascript:('seite','breite','hoehe')'>Text</a>
{

//        dhost = "http://landkarte-brandenburg.de/";
        dhost = "http://www.vvg-befestigungstechnik.com";
        var popname = "bla";

        if(!w) {
        var w = 400;
        }
        if(!h) {
        var h = 380;
        }

        var ww = getWinWidth();
        var wh = getWinHeight();

        if(ww > w) {
        var posx = (ww - w) / 2 ;
        } else {
        var posx = 10;
        }

        if(ww > w) {
        var posy = (wh - h) / 2 ;
        } else {
        var posy = 10;
        }
//        alert(dhost+p);
        tPop = window.open(dhost + p,popname,'location=no,scrollbars=yes,resizable=no,top='+posy+',left='+posx+',width='+w+',height='+h+'');
        tPop.focus();
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function popHONSEL(p,w,h) // p = Seite, w = breite, h=höhe
{

        if(location.host == "honsel.web") {
        var dhost = "http://" + location.host + "/cgi-bin/";
        } else {
        var dhost = "http://" + location.host;
        }

        var popname = "popname";

        if(!w) {
        var w = 436;
        }
        if(!h) {
        var h = 380;
        }

        var ww = getWinWidth();
        var wh = getWinHeight();

        if(ww > w) {
        var posx = (ww - w) / 2 ;
        } else {
        var posx = 10;
        }

        if(ww > w) {
        var posy = (wh - h) / 2 ;
        } else {
        var posy = 10;
        }

        window.open(dhost+"/"+p,popname,'location=no,scrollbars=yes,resizable=no,top='+posy+',left='+posx+',width='+w+',height='+h+'');

}
