/* Funktionen fuer Reiseland Brandenburg -> BB-Navigator */
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 vcard(ortid,objektid) // id = Objekt-ID (INT), objekttyp = Objekttyp (STRING | INT, ortid = leer oder Ortid (INT)
{

        dhost = "http://landkarte-brandenburg.de/";
//        dhost = 'http://' + location.host + '/';

        var popname = "vcard";

        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;
        }

        if(!objektid)
        {
         objid = "";
        } else
        {
         objid = objektid;
        }

//        window.open(dhost+"vcard.php?ortid="+ortid+"&id="+objid,popname,'location=no,scrollbars=yes,resizable=no,top='+posy+',left='+posx+',width='+w+',height='+h+'');
        vc = window.open(dhost+"indexVcard.php?ortid="+ortid+"&id="+objid,popname,'location=no,scrollbars=yes,resizable=no,top='+posy+',left='+posx+',width='+w+',height='+h+'');
        vc.focus();
}

function tmbPop(p,w,h) // p = url, w = breite, h = höhe
{

        dhost = "http://landkarte-brandenburg.de/";
//        dhost = "http://"+ location.host +"/";
        var popname = "info";

        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;
        }

        tPop = window.open(dhost+p,popname,'location=no,scrollbars=yes,resizable=no,top='+posy+',left='+posx+',width='+w+',height='+h+'');
        tPop.focus();
}

function notizblock(id,typ) // p = url, w = breite, h = höhe
{

//        dhost = "http://"+ location.host;
        dhost = "http://www.landkarte-brandenburg.de/";
        w = 1;
        h = 1;
        p = '/notiz.php?id='+id+'&typ='+typ;

        var popname = "notizblock";

        if(!w) {
        var w = 1;
        }
        if(!h) {
        var h = 1;
        }

        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;
        }

        nPop = window.open(dhost+p,popname,'location=no,scrollbars=no,resizable=no,top='+posy+',left='+posx+',width='+w+',height='+h+'');
        nPop.blur();
}

function changeNoteImg(image) {

//         alert(document.images[image].src = '/images/notiert.gif');
         if(location.host != 'landkarte-brandenburg.de' || location.host != 'www.landkarte-brandenburg.de') {
            dhost = "http://www.landkarte-brandenburg.de";
         } else {
            dhost = "";
         }
         document.images[image].src = dhost +'/images/notiert_text.gif';
         document.images[image].alt = 'Bereits notiert';
}

function changeNote(T) {
       alert(T);
       document.write(document.images[T].src);
}

function changeNoteSignal(image) {

//         alert(top.window.rubriken.document.images[0].name);
         var fr = top.window.rubriken.document;

         fr.images[image].src = '/images/notiert_blue.gif';
         fr.images[image].alt = 'Notierte Informationen anzeigen';
}

function notes() {

//        dhost = "http://"+ location.host +"/";
        dhost = "http://www.landkarte-brandenburg.de";
        w = 670;
        h = 400;
        p = '/notizblock.php';
        posy = 100;
        posx = 100;

        var popname = "notizblockansehen";

        if(!w) {
        var w = 1;
        }
        if(!h) {
        var h = 1;
        }

        tPop = window.open(dhost+p,popname,'location=no,scrollbars=yes,resizable=yes,top='+posy+',left='+posx+',width='+w+',height='+h+'');
        tPop.focus();

}