var strURLRoot = "http://www.grebbeberg.nl/dordt/";
var strImgFilename = "";
var strVidFilename = "";
var strImgDescr = "";
var strVidDescr = "";
var menuImg = new Array();
var menuImgHL = new Array();
var bGotoTop = 0;
var CDROM_NO = '1';
var x;
var intCurrentFontSize = 10;

function killFraming() {
   window.location.href = strURLRoot + 'index.html';
   alert('Beste beheerder van deze website,\nHet op uw eigen website opnemen van content van onze website (www.dordtopenstad.nl) is zonder overleg niet toegestaan.\nWij vragen hiervoor uw begrip. Heeft u nog vragen, dan kunt u contact met ons opnemen (info@dordtopenstad.nl)');
} /* end killFraming */

menuImg[1] = new Image(57, 19);
menuImg[2] = new Image(57, 19);
menuImg[3] = new Image(57, 19);
menuImg[1].src = strURLRoot + 'gfx/b_terug.gif';
menuImg[2].src = strURLRoot + 'gfx/b_zoeken.gif';
menuImg[3].src = strURLRoot + 'gfx/b_help.gif';

menuImgHL[1] = new Image(57, 19);
menuImgHL[2] = new Image(57, 19);
menuImgHL[3] = new Image(57, 19);
menuImgHL[1].src = strURLRoot + 'gfx/b_terugh.gif';
menuImgHL[2].src = strURLRoot + 'gfx/b_zoekenh.gif';
menuImgHL[3].src = strURLRoot + 'gfx/b_helph.gif';

function goBack() {
    history.back(-1);
    if (bGotoTop < 0)
        history.back(-1);

} /* end goBack */

function openImage(strImagename, bLandscape) {
    var strDimensions
    strImgFilename = strImagename;
    if (bLandscape == true)
        strDimensions = "width=790,height=550,scrollbars=1";
    else
        strDimensions = "width=535,height=550,scrollbars=1";
    x = window.open('dispimg.html', 'ViewImage', strDimensions);
} /* end openImage */

function openImageWithDescr(strImagename, bLandscape, strDescr) {
    var strDimensions
    strImgFilename = strImagename;
    strImgDescr = strDescr;
    if (bLandscape == true)
        strDimensions = "width=790,height=550,scrollbars=1";
    else
        strDimensions = "width=535,height=550,scrollbars=1";
    x = window.open('dispimg.html', 'ViewImage', strDimensions);
} /* end openImageWithDescr */

function openURL(strURL) {
    x = window.open(strURL, 'External', "");
} /* end openURL */

function openWindow(strURL) {
    x = window.open(strURL, 'popup', "width=790,height=550,scrollbars=1");
} /* end openWindow */

function menuHL(intItem) {
    eval('document.menu' + intItem.toString() + '.src = menuImgHL[intItem].src;');
} /* end menuHL */

function menuUnHL(intItem) {
    eval('document.menu' + intItem.toString() + '.src = menuImg[intItem].src;');
} /* end menuUnHL */

function createFoot() {
    document.write('<TABLE CELLSPACING=0 CELLPADDING=0 WIDTH=720 BORDER=0><TR><TD ALIGN=RIGHT><A HREF="#pagtop"><IMG vspace="2" onclick="bGotoTop = -1;" SRC="' + strURLRoot + 'gfx/top.gif" BORDER=0></A></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD ALIGN=CENTER>' +
                   '<TABLE CELLSPACING=2 CELLPADDING=2 BORDER=0><TR><TD ALIGN=CENTER>' +
                   '<FONT COLOR="#FFFFFF">heeft u vragen, suggesties of opmerkingen? plaats deze in onze <A HREF="/forum/forum.php"><FONT COLOR="#FFFFFF"><U>discussiegroep</U></FONT></A>!' +
                   '<P></FONT></TD></TR></TABLE></TD></TR></TABLE>');
} /* end createFoot */

function createHead() {
    document.write('<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD ALIGN=CENTER><A NAME="pagtop">' +
                   '<TABLE BORDER=0 style="border: 2px solid #dddddd;" WIDTH=770 CELLSPACING=0 CELLPADDING=0 BGCOLOR="#C8A46E">');
} /* end createHead */

function createBanner1(strType) {
    var strFilename = '';
    var strSearchPath = strURLRoot + 'search_site.php';

    if (strType == 'WELKOM') {
        strFilename = 'main1ro_1.jpg';
    } else if (strType == 'STADINDESTRIJD') {
        strFilename = 'main1ro_2.jpg';
    } else if (strType == 'HETEILAND') {
        strFilename = 'main1ro_3.jpg';
    } else if (strType == 'VERLIESLIJSTINDEX') {
        strFilename = 'main1ro_4.jpg';
    } else if (strType == 'VERLIESNL') {
        strFilename = 'main1ro_4.jpg';
    } else if (strType == 'VERLIESDU') {
        strFilename = 'main1ro_4.jpg';
    }
    if (strFilename.length > 0) {
        buildBanner('main1lb.jpg', 'main1rb.jpg', 'b_bib_topr.gif', 'main1lo.jpg', strFilename, 'b_bib_bottomr.gif', 'b_terug.gif', true, 'javascript:goBack();', false, 'b_zoeken.gif', true, strSearchPath, false, 'b_help.gif', false, (strURLRoot + 'help.htm'), false, '', false, '', false)
    }
} /* end createBanner1 */

function createBanner2(strType) {
    var strFilename = '';
    var strSearchPath = strURLRoot + 'search_site.php';

    if (strType == 'DORDTFOTOIDX') {
        strFilename = 'main1ro_1.jpg';
    } else if (strType == 'DORDTFOTO') {
        strFilename = 'main1ro_1.jpg';
    }
    if (strFilename.length > 0) {
        buildBanner('main2lb.jpg', 'main2rb.jpg', 'b_bib_topr.gif', 'main1lo.jpg', strFilename, 'b_bib_bottomr.gif', 'b_terug.gif', true, 'javascript:goBack();', false, 'b_zoeken.gif', true, strSearchPath, false, 'b_help.gif', false, (strURLRoot + 'help.htm'), false, '', false, '', false)
    }
} /* end createBanner2 */

function createBanner3(strType) {
    var strFilename = '';
    var strSearchPath = strURLRoot + 'search_site.php';

    if (strType == 'DORDT_MAPS') {
        strFilename = 'main1ro_1.jpg';
    }
    if (strFilename.length > 0) {
        buildBanner('main3lb.jpg', 'main3rb.jpg', 'b_bib_topr.gif', 'main1lo.jpg', strFilename, 'b_bib_bottomr.gif', 'b_terug.gif', true, 'javascript:goBack();', false, 'b_zoeken.gif', true, strSearchPath, false, 'b_help.gif', false, (strURLRoot + 'help.htm'), false, '', false, '', false)
    }
} /* end createBanner3 */

function createBanner4(strType) {
    var strFilename = '';
    var strSearchPath = strURLRoot + 'search_site.php';

    if (strType == 'FORUM') {
        strFilename = 'main1ro_1.jpg';
    }
    if (strFilename.length > 0) {
        buildBanner('main4lb.jpg', 'main4rb.jpg', 'b_bib_topr.gif', 'main1lo.jpg', strFilename, 'b_bib_bottomr.gif', 'b_terug.gif', true, 'javascript:goBack();', false, 'b_zoeken.gif', true, strSearchPath, false, 'b_help.gif', false, (strURLRoot + 'help.htm'), false, '', false, '', false)
    }
} /* end createBanner4 */

function createBanner5(strType) {
    var strFilename = '';
    var strSearchPath = strURLRoot + 'search_site.php';

    if (strType == 'ZOEKEN') {
        strFilename = 'main1ro_1.jpg';
    }
    if (strFilename.length > 0) {
        buildBanner('main5lb.jpg', 'main5rb.jpg', 'b_bib_topr.gif', 'main1lo.jpg', strFilename, 'b_bib_bottomr.gif', 'b_terug.gif', true, 'javascript:goBack();', false, 'b_zoeken.gif', true, strSearchPath, false, 'b_help.gif', false, (strURLRoot + 'help.htm'), false, '', false, '', false)
    }
} /* end createBanner5 */

function buildBanner(strImgA, strImgB, strImgC, strImgD, strImgE, strImgF, strMenuA, bMenuAEnabled, strMenuAAction, bMenuAActive, strMenuB, bMenuBEnabled, strMenuBAction, bMenuBActive, strMenuC, bMenuCEnabled, strMenuCAction, bMenuCActive, strMenuD, bMenuDEnabled, strMenuDAction, bMenuDActive) {
    var iMissCount = 0;
    var strOut = '<TR><TD BGCOLOR="#000000" style="border-bottom: 1px solid #dddddd;"><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD ROWSPAN=4><IMG SRC="' + strURLRoot + 'gfx/' + strImgA + '" WIDTH=400 HEIGHT=63 BORDER=0></TD>' +
                 '<TD ROWSPAN=4><IMG SRC="' + strURLRoot + 'gfx/' + strImgB + '" WIDTH=308 HEIGHT=63 BORDER=0></TD><TD><IMG SRC="' + strURLRoot + 'gfx/' + strImgC + '" WIDTH=60 HEIGHT=5 BORDER=0></TD></TR>'
    if (bMenuAEnabled) {
        if (bMenuAActive) {
            strOut = strOut + '<TR><TD><IMG NAME="menu1" SRC="' + strURLRoot + 'gfx/' + strMenuA + '" WIDTH=60 HEIGHT=18 BORDER=0></TD></TR>'
        }
        else {
            strOut = strOut + '<TR><TD><A HREF="' + strMenuAAction + '" onmouseover="menuHL(1);" onmouseout="menuUnHL(1);"><IMG NAME="menu1" SRC="' + strURLRoot + 'gfx/' + strMenuA + '" WIDTH=60 HEIGHT=18 BORDER=0></A></TD></TR>'
        }
    }
    else {
        iMissCount++;
    }
    if (bMenuBEnabled) {
        if (bMenuBActive) {
            strOut = strOut + '<TR><TD><IMG NAME="menu2" SRC="' + strURLRoot + 'gfx/' + strMenuB + '" WIDTH=60 HEIGHT=17 BORDER=0></TD></TR>'
        }
        else {
            strOut = strOut + '<TR><TD><A HREF="' + strMenuBAction + '" onmouseover="menuHL(2);" onmouseout="menuUnHL(2);"><IMG NAME="menu2" SRC="' + strURLRoot + 'gfx/' + strMenuB + '" WIDTH=60 HEIGHT=17 BORDER=0></A></TD></TR>'
        }

    }
    else {
        iMissCount++;
    }

    if (bMenuCEnabled) {
        if (bMenuCActive) {
            strOut = strOut + '<TR><TD><IMG NAME="menu3" SRC="' + strURLRoot + 'gfx/' + strMenuC + '" WIDTH=60 HEIGHT=23 BORDER=0></TD></TR>'
        }
        else {
            strOut = strOut + '<TR><TD><A HREF="' + strMenuCAction + '" onmouseover="menuHL(3);" onmouseout="menuUnHL(3);"><IMG NAME="menu3" SRC="' + strURLRoot + 'gfx/' + strMenuC + '" WIDTH=60 HEIGHT=23 BORDER=0></A></TD></TR>'
        }
    }
    else {
        iMissCount++;
    }

    for (var i = 0; i < iMissCount; i++)
            strOut = strOut + '<TR><TD><IMG SRC="' + strURLRoot + 'gfx/empty.gif" WIDTH=60 HEIGHT=15 BORDER=0></TD></TR>';

    strOut = strOut + '<TR><TD><IMG SRC="' + strURLRoot + 'gfx/' + strImgD + '" WIDTH=400 HEIGHT=20 BORDER=0></TD><TD><IMG SRC="' + strURLRoot + 'gfx/' + strImgE + '" WIDTH=308 HEIGHT=20 BORDER=0></TD><TD>' +
         '<A HREF="javascript:void();" onclick="return lowerFontSize()"><IMG SRC="' + strURLRoot + 'gfx/smallaa.gif" WIDTH=32 HEIGHT=20 BORDER=0 ALT="Maak lettertype kleiner, u kunt meerdere malen klikken."></A>' +
         '<A HREF="javascript:void();" onclick="return raiseFontSize()"><IMG SRC="' + strURLRoot + 'gfx/largeaa.gif" WIDTH=28 HEIGHT=20 BORDER=0 ALT="Maak lettertype groter, u kunt meerdere malen klikken."></A>' +
         '</TD></TR></TABLE></TD></TR><TR><TD>';
         //<IMG SRC="' + strURLRoot + 'gfx/' + strImgF + '" WIDTH=60 HEIGHT=20 BORDER=0>
    document.write(strOut);
} /* end buildBanner */

function openPopup(strUrl) {
    x = window.open(strUrl, 'PopupWin', 'SCROLLBARS=1,WIDTH=480,HEIGHT=350');
} /* end openPopup */

function raiseFontSize() {
   if (intCurrentFontSize < 20) {
      intCurrentFontSize++;
      scanChildNodes(document.body);
   }
   window.focus();
   return(false);
} /* end raiseFontSize */

function openImageRS(strImagename, bLandscape) {
    var strDimensions
    strImgFilename = strImagename;
    if (bLandscape == true)
        strDimensions = "width=790,height=575,scrollbars=1";
    else
        strDimensions = "width=535,height=550,scrollbars=1";
    x = window.open('dispimg.html', 'ViewImage', strDimensions);
} /* end openImageRS */

function lowerFontSize() {
   if (intCurrentFontSize > 10) {
      intCurrentFontSize--;
      scanChildNodes(document.body);
   }
   window.focus();
   return(false);
} /* end lowerFontSize */

function scanChildNodes(ref) {
   var oNodeList = ref.children;
   if (oNodeList) {
      for (var i = 0; i < oNodeList.length; i++) {
         if (String(oNodeList.item(i).tagName).toUpperCase() == "TD") {
            eval('oNodeList.item(i).style.fontSize = "' + intCurrentFontSize.toString() + 'pt"');
         }
         scanChildNodes(oNodeList.item(i));
      }
   }
} /* end scanChildNodes */