function resizeScrollDiv() {
    //document.getElementById("content").style.height = document.body.clientHeight - 112;
    //document.getElementById("content").style.width = document.body.clientWidth - 126;
}

function changeTab(tabId) {
    document.getElementById(tabId).style.visibility="visible";
    document.getElementById(tabId).zindex=100;
    
    for(i = 1; i <= 7; i++) {
        if(i != tabId) {
            document.getElementById(i).style.visibility="hidden";
            document.getElementById(tabId).zindex=10;
        }
    }
}

function showConfirm(clockId, pageId, groupId) {
    var return_value = confirm('Weet u zeker dat u deze klok wilt verwijderen?');
    
    if (return_value == true) {
        location.href="admin.php?actie=deleteClock&clockId=" + clockId + "&pageId=" + pageId + "&groupId=" + groupId;
    } else {
    }
}

function checkBoxes() {
    
}

function checkForm() {
    if(document.addclockform.groupid.value == '' || document.addclockform.description_nl.value == '' || 
       document.addclockform.description_en.value == '') {
        alert('Vul a.u.b alle tektsvelden in!');
    } else {
        document.addclockform.submit();
    }
}

function checkContactForm() {
    if(document.contactform.name.value == '' || document.contactform.email.value == '' || 
        document.contactform.question.value == '') {
        alert('Vul a.u.b alle tektsvelden in!');
    } else {
        document.contactform.submit();
    }
}




function enlargeThumb(pad, tekst) {
   // ************************************************************************
   // Vergroot een thumbnail naar een html pagina met het plaatje.
   // De grote wordt bepaald aan de grote van het plaatje.
   // ************************************************************************

    //genereer HTML
    page = "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>" +
           "<html lang='en'>" +
           "<head>" +
           "<SCRIPT LANGUAGE=\"JavaScript\">" +
           "var scrl = \""+ tekst +"\";" +
           "function scrlsts() {"+
           "scrl = scrl.substring(1, scrl.length) + scrl.substring(0, 1);"+
           " document.title = scrl;"+
           " setTimeout(\"scrlsts()\", 300);"+
           " }"+
           "</script>"+
           "<meta http-equiv='content-type' content='text/html;charset=iso-8859-1'>" +
           "<title>Schreurs</title>" +
           "<link rel=stylesheet type=text/css href=../css/southwest_style1.css>" +
           "</head>" +
           "<script src='script/thumbnail.js' language='JavaScript' type='text/javascript'></script>" +
           "<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' class='main' scrolling='auto' onLoad='javascript:moveWindow(); onLoad=scrlsts()'>" +
           "<a href='' onclick='window.close()'><img id='afbeelding' src='" + pad + "' border='0' align='top' alt='klik om venster te sluiten'></a>" +
           "</body></html>";

    //Laat alles zien
    if (window.libsWin) {
        libsWin.close();
    }

    libsWin = window.open("","foto","width=100,height=100,resize=yes");
    libsWin.document.write(page);
    libsWin.document.close();
    libsWin.document.focus();
}

function moveWindow() {
   // ************************************************************************
   // Zoekt uit wat het midden van het scherm is voor de popup en zet daar
   // de popup neer.
   // ************************************************************************

    afbld = document.getElementById('afbeelding');

    var BrowserHeight = afbld.height;
    var BrowserWidth  = afbld.width;

    var winleft = (screen.width - BrowserWidth) / 2;
    var winUp = (screen.height - BrowserHeight) / 2;

    //fix als het te groot wordt
    if (winleft < 0) { winleft = 0 };
    if (winUp < 0) { winUp = 0 };

    if (BrowserWidth > screen.width) { BrowserWidth = (screen.width - 10); scrollb = "yes";}
    if (BrowserHeight > screen.height) { BrowserHeight = (screen.height - 50); scrollb = "yes";}

   //Move
    window.resizeTo(BrowserWidth, BrowserHeight);
    self.moveTo(winleft,winUp);
}


