﻿
//Switch page by page-name
function GoToPage(Page)
{
    switch (Page)
    {
        case 'Default':
            window.location = "Default.aspx";
            break;
        case 'Bezetting':
            window.location = "Bezetting.aspx?type=1";
            break;
        case 'BezettingVerpleeghuis':
            window.location = "Bezetting.aspx?type=2";
            break;
        case 'Inloggen':
            window.location = "Mutaties.aspx";
            break;
        case 'Deelnemers':
            window.location = "Deelnemers.aspx";
            break;
        case 'Contact':
            window.location = "Contact.aspx";
            break;
        default:
            window.location = "Default.aspx";
            break;
    }
}

function NavbarLoader() {
    var bgcolor = "#F36600";
    var color = "#4184D4";

    switch (document.title)
    {
        case 'Tijdelijkeopname.nl • Home':
            document.getElementById("Home").style.backgroundColor = bgcolor;
            document.getElementById("Home").style.color = color;
            break;
        case 'Tijdelijkeopname.nl • Bezetting verzorgingshuizen':
            document.getElementById("BezettingVerzorging").style.backgroundColor = bgcolor;
            document.getElementById("BezettingVerzorging").style.color = color;
            break;
        case 'Tijdelijkeopname.nl • Bezetting verpleeghuizen':
            document.getElementById("BezettingVerpleeg").style.backgroundColor = bgcolor;
            document.getElementById("BezettingVerpleeg").style.color = color;
            break;
        case 'Tijdelijkeopname.nl • Inloggen':
            document.getElementById("Inloggen").style.backgroundColor = bgcolor;
            document.getElementById("Inloggen").style.color = color;
            break;
        case 'Tijdelijkeopname.nl • Aanmelden':
            document.getElementById("Inloggen").style.backgroundColor = bgcolor;
            document.getElementById("Inloggen").style.color = color;
            break;
        case 'Tijdelijkeopname.nl • Deelnemers':
            document.getElementById("Deelnemers").style.backgroundColor = bgcolor;
            document.getElementById("Deelnemers").style.color = color;
            break;
        case 'Tijdelijkeopname.nl • Contact':
            document.getElementById("Contact").style.backgroundColor = bgcolor;
            document.getElementById("Contact").style.color = color;
            break;
    }
}

function ShowContactForm()
{
    var div = document.getElementById('contactform');
    var link = document.getElementById('btnShowForm');

    if (div.style.display == 'none')
    {
        div.style.display = 'block';
    }
    else
    {
        div.style.display = 'none';
    }
}

function CheckLength(text, long)
{
    var maxlength = new Number(long); // Change number to your max length.
    
    if (text.value.length > maxlength)
    {
        text.value = text.value.substring(0, maxlength);

        alert(" Maximaal " + long + " karakters toegestaan!");
    }
}

