﻿// JScript File
var g_strDays=new Array("zondag ","maandag ","dinsdag ","woensdag ","donderdag ","vrijdag ","zaterdag ");
var g_strMonths=new Array(" ","januari ","februari ","maart ","april ","mei ","juni ","juli ","augustus ","september ","oktober ","november ","december ");

function PrintPage()
{
document.print();
}

function SubmitSearch()
{
    document.Search.submit();
}

function SubmitDateSelect()
{
    document.DateSelect.submit();
}

function SubmitCollecte()
{
    document.Collecte.submit();
}

function SubmitZiekte(p_strText)
{
    if(document.getElementById('SearchQ').value != p_strText)
        if(document.getElementById('SearchQ').value != '')
            document.ZiektenForm.submit();
}

function SubmitAlfabet(p_chrChar)
{
    document.getElementById('Alfabet').value = p_chrChar;
    document.AlfabetForm.submit();
    return false;
}

function CheckHouseForm()
{
    var l_strFormValues = new Array();
    l_strFormValues[0] = new Array('Name','U bent uw naam vergeten in te vullen','text');
    l_strFormValues[1] = new Array('Address','U bent uw adres vergeten in te vullen','text');
    l_strFormValues[2] = new Array('PostCode','U bent uw postcode vergeten in te vullen','text');
    l_strFormValues[3] = new Array('City','U bent uw plaatsnaam vergeten in te vullen','text');
    l_strFormValues[4] = new Array('Phone','U bent uw telefoon nummer vergeten in te vullen','text');
    l_strFormValues[5] = new Array('Email','U bent uw e-mail adres vergeten in te vullen','text');
    l_strFormValues[6] = new Array('Email','Door u ingevulde e-mail adres is niet correct','email');
    l_strFormValues[7] = new Array('BankNr','Bank-/ gironummer moet numeriek zijn!','int');
    l_strFormValues[8] = new Array('Patient','U bent de naam van de patiënt vergeten in te vullen','text');
    l_strFormValues[9] = new Array('Birth','U bent geboorte datum vergeten in te vullen','datetext');
    l_strFormValues[10] = new Array('Birth','Door u ingevulde datum is niet correct','date');
    l_strFormValues[11] = new Array('Diagnosis_Handicap','U bent de diagnose/handicap vergeten in te vullen','text');
   
    var l_blnCheck = false;
    var l_intCounter = 0;
    while(l_intCounter < l_strFormValues.length)
    {
        l_blnCheck = CheckElement(l_strFormValues[l_intCounter], '');
        if(!l_blnCheck)
            return l_blnCheck;
        l_intCounter++;
    }
    var l_strFormValues = new Array();
    l_strFormValues[0] = new Array('Name','U bent uw naam vergeten in te vullen','text');
    l_strFormValues[1] = new Array('Birth','U bent geboorte datum vergeten in te vullen','datetext');
    l_strFormValues[2] = new Array('Birth','Door u ingevulde datum is niet correct','date');
    l_intCounter = 0;
    var l_intSubCounter = 0;
    var l_blnBlock = true;
    var l_objElement = document.getElementById('Gast_0');
    if(l_objElement.style.display == 'none')
        l_blnBlock = false;
    while(l_blnBlock)
    {
        l_intCounter++;
        //alert('test-'+l_intCounter);
        while(l_intSubCounter < 3)
        {
            //alert(l_strFormValues[l_intSubCounter][0]+'_'+l_intCounter);
            l_blnCheck = CheckElement(l_strFormValues[l_intSubCounter], '_'+l_intCounter);
            if(!l_blnCheck)
                return l_blnCheck;
            l_intSubCounter++;
        }
        l_intSubCounter = 0;
        
        l_objElement = document.getElementById('Gast_' + l_intCounter);
        if(l_objElement)
        {
            if(l_objElement.style.display == 'none')
                l_blnBlock = false;
        }
        else
        {
            l_blnBlock = false;
        }
    }
}

function CheckElement(p_strValues, p_strExt)
{
    var l_objElement = document.getElementById(p_strValues[0] + p_strExt);
    if(l_objElement)
    {
        switch(p_strValues[2])
        {
            case 'text':
                if(l_objElement.value == '')
                {
                    l_objElement.style.backgroundColor='#f86601';
                    l_objElement.focus();
                    alert(p_strValues[1]);
                    return false;
                }
                else
                {
                    l_objElement.style.backgroundColor='#FFFFFF';
                    return true;
                }
                break;
            case 'email':
                if(EmailCheck(p_strValues[0]))
                {
                    l_objElement.style.backgroundColor='#f86601';
                    l_objElement.focus();
                    alert(p_strValues[1]);
                    return false;
                }
                else
                {
                    l_objElement.style.backgroundColor='#FFFFFF';
                    return true;
                }
                break;
            case 'datetext':
                if(l_objElement.value == '' || l_objElement.value == 'dd-mm-jjjj')
                {
                    l_objElement.style.backgroundColor='#f86601';
                    l_objElement.focus();
                    alert(p_strValues[1]);
                    return false;
                }
                else
                {
                    l_objElement.style.backgroundColor='#FFFFFF';
                    return true;
                }
                break;
            case 'date':
                if(!IsDatum(p_strValues[0] + p_strExt))
                {
                    l_objElement.style.backgroundColor='#f86601';
                    l_objElement.focus();
                    alert(p_strValues[1]);
                    return false;
                }
                else
                {
                    l_objElement.style.backgroundColor='#FFFFFF';
                    return true;
                }
                break;
            case 'int': 
                if(!IsInt(l_objElement))
                {
                    l_objElement.style.backgroundColor='#f86601';
                    l_objElement.focus();
                    alert(p_strValues[1]);
                    return false;
                }
                else
                {
                    l_objElement.style.backgroundColor='#FFFFFF';
                    return true;
                }
                break;
        }
    }
}

function IsInt(p_objElement)
{
    var l_intCounter = 0;
    var l_intCounted = 0;
    var l_strValue = p_objElement.value;
    var l_blnNumeric = true;
    var l_strNumbers = '0123456789';
    if(l_strValue.length < 1)
        l_blnNumeric = false;
    while(l_intCounter < l_strValue.length)
    {
        if(l_strNumbers.indexOf(l_strValue.substring(l_intCounter, l_intCounter+1)) == -1)
            l_blnNumeric = false;
        l_intCounter++;
    }
    return l_blnNumeric;
}

function CheckSendMail()
{
    if(document.getElementById('FromName'))
    {
        if(document.getElementById('FromName').value == '')
        {
            document.getElementById('FromName').style.backgroundColor='#f86601';
            document.getElementById('FromName').focus();
            alert('U bent uw naam vergeten in te vullen');
            return false;
        }
        else
        {
            document.getElementById('FromName').style.backgroundColor='#FFFFFF';
        }
    }

    if(document.getElementById('FromEmail'))
    {
        if(document.getElementById('FromEmail').value == '')
        {
            document.getElementById('FromEmail').style.backgroundColor='#f86601';
            document.getElementById('FromEmail').focus();
            alert('U bent uw e-mail adres vergeten in te vullen');
            return false;
        }
        else if(EmailCheck('FromEmail'))
        {
            document.getElementById('FromEmail').style.backgroundColor='#f86601';
            document.getElementById('FromEmail').focus();
            alert('U heeft incorrecte e-mail adres ingevuld');
            return false;
        }
        else
        {
            document.getElementById('FromEmail').style.backgroundColor='#FFFFFF';
        }
    }

    if(document.getElementById('ToName'))
    {
        if(document.getElementById('ToName').value == '')
        {
            document.getElementById('ToName').style.backgroundColor='#f86601';
            document.getElementById('ToName').focus();
            alert('U bent de naam van de ontvanger vergeten in te vullen');
            return false;
        }
        else
        {
            document.getElementById('ToName').style.backgroundColor='#FFFFFF';
        }
    }

    if(document.getElementById('ToEmail'))
    {
        if(document.getElementById('ToEmail').value == '')
        {
            document.getElementById('ToEmail').style.backgroundColor='#f86601';
            document.getElementById('ToEmail').focus();
            alert('U bent de e-mail adres van de ontvanger vergeten in te vullen');
            return false;
        }
        else if(EmailCheck('ToEmail'))
        {
            document.getElementById('ToEmail').style.backgroundColor='#f86601';
            document.getElementById('ToEmail').focus();
            alert('U heeft incorrecte e-mail adres van de ontvanger ingevuld');
            return false;
        }
        else
        {
            document.getElementById('FromEmail').style.backgroundColor='#FFFFFF';
        }
    }
}

function CheckCollecte()
{
    if(document.getElementById('Type'))
    {
        if(document.Collecte.Type[0].checked == false && document.Collecte.Type[1].checked == false)
        {
            alert('U bent type vergeten aan te geven');
            return false;
        }
    }
    
    if(document.getElementById('Voorletters'))
    { 
        if(document.getElementById('Voorletters').value == '')
        {
            document.getElementById('Voorletters').style.backgroundColor='#f86601';
            document.getElementById('Voorletters').focus();
            alert('U bent uw voorletters vergeten in te vullen');
            return false;
        }
        else
        {
            document.getElementById('Voorletters').style.backgroundColor='#FFFFFF';
        }
    }
    
    if(document.getElementById('Sinds'))
    { 
        if(document.getElementById('Sinds').value == '')
        {
            document.getElementById('Sinds').style.backgroundColor='#f86601';
            document.getElementById('Sinds').focus();
            alert('U bent vergeten in te vullen sinds u zich inzet voor het Prinses Beatrix Fonds');
            return false;
        }
        else
        {
            document.getElementById('Sinds').style.backgroundColor='#FFFFFF';
        }
    }

    if(document.getElementById('Achternaam'))
    {
        if(document.getElementById('Achternaam').value == '')
        {
            document.getElementById('Achternaam').style.backgroundColor='#f86601';
            document.getElementById('Achternaam').focus();
            alert('U bent uw achternaam vergeten in te vullen');
            return false;
        }
        else
        {
            document.getElementById('Achternaam').style.backgroundColor='#FFFFFF';
        }
    }
    
    if(document.getElementById('Naam'))
    {
        if(document.getElementById('Naam').value == '')
        {
            document.getElementById('Naam').style.backgroundColor='#f86601';
            document.getElementById('Naam').focus();
            alert('U bent uw naam vergeten in te vullen');
            return false;
        }
        else
        {
            document.getElementById('Naam').style.backgroundColor='#FFFFFF';
        }
    }
    
    if(document.getElementById('Adres'))
    { 
       if(document.getElementById('Adres').value == '')
        {
            document.getElementById('Adres').style.backgroundColor='#f86601';
            document.getElementById('Adres').focus();
            alert('U bent uw adres vergeten in te vullen');
            return false;
        }
        else
        {
            document.getElementById('Adres').style.backgroundColor='#FFFFFF';
        }
    }
    
    if(document.getElementById('Postcode'))
    {
        if(document.getElementById('Postcode').value == '')
        {
            document.getElementById('Postcode').style.backgroundColor='#f86601';
            document.getElementById('Postcode').focus();
            alert('U bent uw postcode vergeten in te vullen');
            return false;
        }
        else
        {
            document.getElementById('Postcode').style.backgroundColor='#FFFFFF';
        } 
    }
    
    if(document.getElementById('Plaats'))
    {
        if(document.getElementById('Plaats').value == '')
        {
            document.getElementById('Plaats').style.backgroundColor='#f86601';
            document.getElementById('Plaats').focus();
            alert('U bent uw plaats vergeten in te vullen');
            return false;
        }
        else
        {
            document.getElementById('Plaats').style.backgroundColor='#FFFFFF';
        }
    }

    if(document.getElementById('Dag'))
    {
        if(document.getElementById('Dag').value == '')
        {
            document.getElementById('Dag').style.backgroundColor='#f86601';
            document.getElementById('Dag').focus();
            alert('U bent uw geboortedag vergeten in te vullen');
            return false;
        }
        else
        {
            document.getElementById('Dag').style.backgroundColor='#FFFFFF';
        }
    }

    if(document.getElementById('Maand'))
    {
        if(document.getElementById('Maand').value == '')
        {
            document.getElementById('Maand').style.backgroundColor='#f86601';
            document.getElementById('Maand').focus();
            alert('U bent uw geboortemaand vergeten in te vullen');
            return false;
        }
        else
        {
            document.getElementById('Maand').style.backgroundColor='#FFFFFF';
        }
    }

    if(document.getElementById('Jaar'))
    {
        if(document.getElementById('Jaar').value == '')
        {
            document.getElementById('Jaar').style.backgroundColor='#f86601';
            document.getElementById('Jaar').focus();
            alert('U bent uw geboortejaar vergeten in te vullen');
            return false;
        }
        else
        {
            document.getElementById('Jaar').style.backgroundColor='#FFFFFF';
        }
    }

    if(document.getElementById('Telefoonnummer'))
    {
        if(document.getElementById('Telefoonnummer').value == '')
        {
            document.getElementById('Telefoonnummer').style.backgroundColor='#f86601';
            document.getElementById('Telefoonnummer').focus();
            alert('U bent uw telefoonnummer vergeten in te vullen');
            return false;
        }
        else
        {
            document.getElementById('Telefoonnummer').style.backgroundColor='#FFFFFF';
        } 
    }
    
    if(document.getElementById('EmailCollecte'))
    {
        if(document.getElementById('EmailCollecte').value == '')
        {
            document.getElementById('EmailCollecte').style.backgroundColor='#f86601';
            document.getElementById('EmailCollecte').focus();
            alert('U bent uw e-mailadres vergeten in te vullen');
            return false;
        }
        else
        {
            if(EmailCheck('EmailCollecte'))
            {
                document.getElementById('EmailCollecte').style.backgroundColor='#f86601';
                document.getElementById('EmailCollecte').focus();
                alert('U heeft incorrecte e-mail ingevuld');
                return false;
            }
            else
            {
                document.getElementById('EmailCollecte').style.backgroundColor='#FFFFFF';
            } 
        }
    }
}

function CheckForm(p_strType, p_intId)
{
    if(document.getElementById('Name' + p_strType + p_intId))
    {
        if(document.getElementById('Name' + p_strType + p_intId).value == '')
        {
            alert('U bent vergeten uw naam in te vullen');
            document.getElementById('Name' + p_strType + p_intId).focus();
            document.getElementById('Name' + p_strType + p_intId).style.backgroundColor = '#f86601';
            return false;
        }
        else
        {
            document.getElementById('Name' + p_strType + p_intId).style.backgroundColor = 'White';
        }
    }
    
    if(document.getElementById('Body' + p_strType + p_intId))
    {
        if(document.getElementById('Body' + p_strType + p_intId).value == '')
        {
            alert('U bent vergeten uw reactie in te vullen');
            document.getElementById('Body' + p_strType + p_intId).focus();
            document.getElementById('Body' + p_strType + p_intId).style.backgroundColor = '#f86601';
            return false;
        }
        else
        {
            document.getElementById('Body' + p_strType + p_intId).style.backgroundColor = 'White';
        }
    }
}

function Close(p_strId)
{
    if(document.getElementById(p_strId))
    {
        if(document.getElementById(p_strId).style.display == 'none')
            document.getElementById(p_strId).style.display = 'block';
        else
            document.getElementById(p_strId).style.display = 'none';
    }
}

function OpenDiv(p_strPre, p_intId)
{
    CloseDiv(p_strPre);
    CloseDiv('HuisSelect_');
    document.getElementById(p_strPre + p_intId).style.display = 'block';
    return false;
}

function CloseDiv(p_strPre)
{
    var l_intCounter = 0;
    while(document.getElementById(p_strPre + l_intCounter))
    {
        document.getElementById(p_strPre + l_intCounter).style.display = 'none';
        l_intCounter++;
    }
}

function SetFontSize(p_strStyle)
{
    document.getElementById('StyleSheet').value = p_strStyle
    document.FontSize.submit();
}

var bo_ns_id = 0;

function startIeFix()
{
    if(isIE())
        document.write('<noscript id="bo_ns_id_' + bo_ns_id + '">');
}


function endIeFix()
{
    if(isIE())
    {
        var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);
        var theNoScript = theObject.innerHTML;
        document.write(theNoScript);
    }
}

function isIE()
{
    var strBrowser = navigator.userAgent.toLowerCase();

    if(strBrowser.indexOf("msie") > -1 && strBrowser.indexOf("mac") < 0)
        return true;
    else
        return false;
}

function MakeVisible(p_strId)
{
    document.getElementById(p_strId).style.display = 'block';
}

function ClearIf(p_objElement, p_strText)
{
    if(p_objElement.value == p_strText)
        p_objElement.value = '';
}

function FillIf(p_objElement, p_strText)
{
    if(p_objElement.value == '')
        p_objElement.value = p_strText;
}

function StartFadeImg(p_strId, p_intOpac)
{
    var l_objImg = document.getElementById('Img_' + p_strId + '_0');
    
    l_objImg.style.filter = 'alpha(opacity=' + p_intOpac + ')';
    l_objImg.style.opacity = p_intOpac/100;
    p_intOpac = p_intOpac + 5;
    
    if(p_intOpac < 101)
    {
        setTimeout("StartFadeImg('" + p_strId + "'," +p_intOpac+ ")",70);
    }
    else if(document.getElementById('Img_' + p_strId + '_1'))
    {
        var l_intStart = 0;
        var l_intNext = 0;
        if(document.getElementById('Img_' + p_strId + '_1'))
       { 
            l_intNext = 1;
            setTimeout("FadeImg('" + p_strId + "'," + l_intStart + "," + l_intNext + ",0)", 5000);
       } 
    }
}

function FadeImg(p_strId, p_intStart, p_intNext, p_intOpac)
{
    var l_objCurrentImg = document.getElementById('Img_' + p_strId + '_' + p_intStart);
    var l_objNextImg = document.getElementById('Img_' + p_strId + '_' + p_intNext);
    var l_intCurrentOpac = 100 - p_intOpac;
    
    l_objCurrentImg.style.filter = 'alpha(opacity=' + l_intCurrentOpac + ')';
    l_objCurrentImg.style.opacity = l_intCurrentOpac/100;
    l_objNextImg.style.filter = 'alpha(opacity=' + p_intOpac + ')';
    l_objNextImg.style.opacity = p_intOpac/100;

    p_intOpac = p_intOpac + 5;

    if(p_intOpac < 101)
    {
        setTimeout("FadeImg('" + p_strId + "'," + p_intStart + "," + p_intNext + "," + p_intOpac + ")", 70);
    }
    else
    {
        p_intStart = p_intNext;
        if(document.getElementById('Img_' + p_strId + '_' + (p_intNext + 1)))
            p_intNext = p_intNext +1;
        else
            p_intNext = 0;
        setTimeout("FadeImg('" + p_strId + "'," + p_intStart + "," + p_intNext + ",0)", 5000);
    }
}

function ShowHousePopup(p_strId, p_intWidth, p_intHeight)
{
    if(g_strStart[p_strId][0] != '' && g_strEnd[p_strId][0] != '')
        ShowPopup('ReserveHouse', p_intWidth, p_intHeight);
}

function ShowPopup(p_strId, p_intWidth, p_intHeight)
{
    var arrayPageSize = getPageSize();
    var arrayPageScroll = getPageScroll();
    var PopupTop = arrayPageScroll + ((arrayPageSize[3] - p_intHeight) / 2);
    var PopupLeft = ((arrayPageSize[0] - p_intWidth) / 2);
    var l_objPopup = document.getElementById(p_strId);
    l_objPopup.style.top = (PopupTop < 0) ? "0px" : PopupTop + "px";
    l_objPopup.style.left = (PopupLeft < 0) ? "0px" : PopupLeft + "px";
    var l_objOverlay = document.getElementById('Overlay');

    l_objOverlay.style.height = (g_intPageHeight + 'px');
    l_objOverlay.style.display = 'block';
    l_objPopup.style.display = 'block';
    if(p_strId == 'Login')
        document.getElementById('LoginName').focus();
    return false;
}

function ChechEmail(p_strId)
{
if(document.getElementById(p_strId))
    return true;
else
    return false;
}

function EmailCheck(p_strId)
{
    if (/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i.test(document.getElementById(p_strId).value))
        return false;
    else
        return true
}

function IsDatum(p_strId)
{
    var l_strDate = document.getElementById(p_strId).value;
    var l_objRegExp = new RegExp("^(\\d{1,2})[/-](\\d{1,2})[/-](\\d{4})$");
    var l_objDate;
    var l_intDay;
    var l_intMonth;
    var l_intYear;
    var l_blnOutput = true;
    if(l_objRegExp.test(l_strDate))
    {
        var l_intDaysInMonth = new Array (31,0,31,30,31,30,31,31,30,31,30,31);
        
        l_objRegExp.exec(l_strDate);
        l_intYear =  new Number(RegExp.$3);
        l_intDaysInMonth[1]= ((l_intYear%4==0)&&((l_intYear%100!=0)||(l_intYear%400==0)))?29:28;
        l_intDay =  new Number(RegExp.$1);
        l_intMonth =  new Number(RegExp.$2);
        
        if(l_intYear < 1900)
            l_blnOutput = false;
        if(l_intMonth > 12)
            l_blnOutput = false;
        if(l_intDay > l_intDaysInMonth[l_intMonth-1])
            l_blnOutput = false;

    }
    else
    {
        l_blnOutput = false;
    }
    if(l_blnOutput)
        if(document.getElementById(p_strId+'_Sub'))
            document.getElementById(p_strId+'_Sub').value = l_intMonth+'-'+l_intDay+'-'+l_intYear;
    
    return l_blnOutput;
}

function IsDate(p_strValue, p_strLanguageFormat)
{
    var l_objRegExp;
    var l_intDay;
    var l_intMonth;
    var l_intYear;
    var l_intDaysInMonth;
    var l_Valid;
    var l_objDate;

    l_Valid = true;
    l_objRegExp = new RegExp("^(\\d{1,2})[/-](\\d{1,2})[/-](\\d{4})$");
//    if (!l_objRegExp.test(p_strValue))
//    {

//        l_objRegExp = new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$");
//        if (!l_objRegExp.test(p_strValue))
//            return false;
//    }
    if (l_objRegExp.test(p_strValue))
    {
        l_objRegExp.exec(p_strValue);
        switch (p_strLanguageFormat)
        {
            case "English":
            {
                l_intDay = new Number(RegExp.$2);
                l_intMonth = new Number(RegExp.$1);
                break;
            }
            case "Dutch":
            {
                l_intDay = new Number(RegExp.$1);
                l_intMonth = new Number(RegExp.$2);
                break;
            }
        }
        l_intYear =  new Number(RegExp.$3);
        l_intYear += ((l_intYear < 100)?((l_intYear >= 50)?1900:2000):0);
        l_intDaysInMonth = new Array (31,0,31,30,31,30,31,31,30,31,30,31);
        l_intDaysInMonth[1]= ((l_intYear%4==0)&&((l_intYear%100!=0)||(l_intYear%400==0)))?29:28;
        l_Valid = ((l_intMonth < 1) || (l_intMonth > 12) || 
        (l_intDay < 1) || (l_intDay > l_intDaysInMonth[l_intMonth - 1]) || 
        (l_intYear < 0))?false:true;
        if (l_Valid)
        {
            l_objDate = new Date(l_intYear, (l_intMonth - 1), l_intDay);
            l_Valid = isNaN(l_objDate)?false:true;
        }      
        return l_Valid;
    }
    else
    {
        return false;
    }
} 

function NewLetterSubmit(p_strId)
{
    var l_strFormValues = new Array(p_strId,'Door u ingevulde e-mail adres is niet correct','email');
    var l_objElement = document.getElementById(l_strFormValues[0]);
    if(EmailCheck(l_strFormValues[0]))
    {
        l_objElement.focus();
        alert(l_strFormValues[1]);
        return false;
    }
    else
    {
        document.NewsLetter.submit();
    }        
}

//var g_objStart = null;
//var g_strSelectedDayId = new Array();
//var g_datStart = new Date();
//var g_strStart = new Array();
//var g_objEnd = null;
//var g_strEndId = new Array();
//var g_datEnd = new Date();
//var g_strEnd = new Array();
//var g_datUnAvailable = new Array();
//var g_strHouses = new Array();

//function DayHover(p_objDiv, p_strPosition, p_intHuisId)
//{
//    //p_objDiv.style.backgroundPosition = p_strPosition;
//}

//function DayUnHover(p_objDiv, p_strPosition, p_intHuisId)
//{

//    //p_objDiv.style.backgroundPosition = p_strPosition;
//}

//function SetArrays(p_intHuisId)
//{
//    var l_intCounter = 0;
//    while(l_intCounter < p_intHuisId)
//    {
//        g_strStart[l_intCounter] = new Array('',0,0,0,0,0);
//        g_strEnd[l_intCounter] = new Array('',0,0,0,0,0);
//        g_strSelectedDayId[l_intCounter] = new Array();
//        g_datUnAvailable[l_intCounter] = new Array();
//        l_intCounter++;
//    }
//}

//function SetHouse(p_intCounter, p_intId, p_strName)
//{
//    g_strHouses[p_intCounter] = new Array(p_intId, p_strName);
//}

//function SetUnAvailableDate(p_intHuisId, p_intDateId, p_datStart, p_datEnd)
//{
//    g_datUnAvailable[p_intHuisId][p_intDateId] = new Array(p_datStart, p_datEnd);
//}

//function IsAvailable(p_intHuisId)
//{
//    var l_blnOutput = true;
//    var l_intCounter = 0;
//    var l_strStart =  g_strStart[p_intHuisId];
//    var l_strEnd =  g_strEnd[p_intHuisId];
//    if(l_strStart[2] > l_strEnd[2])
//    {
//        var l_strTemp = l_strEnd;
//        l_strEnd = l_strStart;
//        l_strStart = l_strTemp;
//    }
//    while(l_intCounter < g_datUnAvailable[p_intHuisId].length)
//    {
//        if(g_datUnAvailable[p_intHuisId][l_intCounter][0] >= l_strStart[2] && g_datUnAvailable[p_intHuisId][l_intCounter][0] < l_strEnd[2])
//            l_blnOutput = false;
//        l_intCounter++;
//    }
//    if(!l_blnOutput)
//    {
//        g_strEnd[p_intHuisId] = new Array('',0,0,0,0,0);
//        alert('Door u gemaakte selectie is niet mogelijk!');
//    } 
//}

//function DaySelect(p_objDiv, p_intHuisId, p_intDayId, p_intYear, p_intMonth, p_intDay)
//{
//    var l_strId = p_objDiv.getAttribute('id');
//    var l_strPosition = p_objDiv.getAttribute('position');
//    var l_datDate = new Date();
//    l_datDate.setFullYear(p_intYear,p_intMonth-1,p_intDay, 00,00,00);

//    if(l_strId == g_strStart[p_intHuisId][0])
//    {
//        DeleteDates(p_intHuisId);
//        g_strStart[p_intHuisId] = new Array('',0,0,0,0,0);
//    }
//    else if(l_strId == g_strEnd[p_intHuisId][0])
//    {
//        DeleteDates(p_intHuisId);
//        g_strEnd[p_intHuisId] = new Array('',0,0,0,0,0);
//    }
//    else
//    {
//        if(g_strStart[p_intHuisId][0] == '')
//        {
//            g_strStart[p_intHuisId][0] = l_strId;
//            g_strStart[p_intHuisId][1] = p_intHuisId;
//            g_strStart[p_intHuisId][2] = p_intDayId;
//            g_strStart[p_intHuisId][3] = p_intYear;
//            g_strStart[p_intHuisId][4] = p_intMonth;
//            g_strStart[p_intHuisId][5] = p_intDay;
//        }
//        else if(g_strEnd[p_intHuisId][0] == '')
//        {
//            g_strEnd[p_intHuisId][0] = l_strId;
//            g_strEnd[p_intHuisId][1] = p_intHuisId;
//            g_strEnd[p_intHuisId][2] = p_intDayId;
//            g_strEnd[p_intHuisId][3] = p_intYear;
//            g_strEnd[p_intHuisId][4] = p_intMonth;
//            g_strEnd[p_intHuisId][5] = p_intDay;
//            IsAvailable(p_intHuisId);
//        }
//    }
//    
//    SetDates(p_intHuisId);
//    SetSelectedDates(p_intHuisId);
//}

//function DeleteDates(p_intHuisId)
//{
//    var l_intCounter = 0;
//    while(l_intCounter < g_strSelectedDayId[p_intHuisId].length)
//    {
//        document.getElementById(g_strSelectedDayId[p_intHuisId][l_intCounter][0]).style.backgroundPosition = g_strSelectedDayId[p_intHuisId][l_intCounter][1];
//        l_intCounter++;
//    }
//}

//function SetDates(p_intHuisId)
//{
//    if(g_strEnd[p_intHuisId][0] != '' && g_strStart[p_intHuisId][0] != '')
//    {
//        if(g_strEnd[p_intHuisId][2] < g_strStart[p_intHuisId][2])
//        {
//            var l_strDates = g_strStart[p_intHuisId];
//            g_strStart[p_intHuisId] = g_strEnd[p_intHuisId];
//            g_strEnd[p_intHuisId] = l_strDates;
//        }
//        document.getElementById('ReserveBtn_'+p_intHuisId).style.width = '115px';
//    }
//    else if(g_strEnd[p_intHuisId][0] != '' && g_strStart[p_intHuisId][0] == '')
//    {
//        g_strStart[p_intHuisId] = g_strEnd[p_intHuisId];
//        g_strEnd[p_intHuisId] = new Array('',0,0,0,0,0);
//    }
//}

//function SetSelectedDates(p_intHuisId)
//{
//    var l_intCounter = 0;
//    var l_intCounter2 = 0;
//    var l_strId = '';
//    var l_intStart = l_strId[2];
//    var l_objDay = '';
//    if(g_strStart[p_intHuisId][0] != '' && g_strEnd[p_intHuisId][0] != '')
//    {
//        l_strId = g_strEnd[p_intHuisId][0].split('_');
//        l_intCounter2 = g_strStart[p_intHuisId][2];
//        g_strSelectedDayId[p_intHuisId] = new Array();
//        
//        while(l_intCounter2 < g_strEnd[p_intHuisId][2])
//        {
//            l_objDay = document.getElementById('Day_'+p_intHuisId+'_'+l_intCounter2);
//            g_strSelectedDayId[p_intHuisId][l_intCounter] = new Array();
//            g_strSelectedDayId[p_intHuisId][l_intCounter][0] = l_objDay.getAttribute('id');
//            g_strSelectedDayId[p_intHuisId][l_intCounter][1] = l_objDay.getAttribute('position');
//            if(l_intCounter2 == g_strStart[p_intHuisId][2])
//                l_objDay.style.backgroundPosition= GetSelectedStyle(g_strSelectedDayId[p_intHuisId][l_intCounter][1], 0, true);
//            else
//                l_objDay.style.backgroundPosition= GetSelectedStyle(g_strSelectedDayId[p_intHuisId][l_intCounter][1], 1, true);
//            l_intCounter++;
//            l_intCounter2++;
//        }
//        l_objDay = document.getElementById('Day_'+p_intHuisId+'_'+l_intCounter2);
//        g_strSelectedDayId[p_intHuisId][l_intCounter] = new Array();
//        g_strSelectedDayId[p_intHuisId][l_intCounter][0] = l_objDay.getAttribute('id');
//        g_strSelectedDayId[p_intHuisId][l_intCounter][1] = l_objDay.getAttribute('position');
//        l_objDay.style.backgroundPosition= GetSelectedStyle(g_strSelectedDayId[p_intHuisId][l_intCounter][1], 2, true);
//    }
//    else if(g_strStart[p_intHuisId][0] != '')
//    {
//        l_strId = g_strStart[p_intHuisId][0].split('_');
//        l_intCounter2 = g_strStart[p_intHuisId][2];
//        l_objDay = document.getElementById('Day_'+p_intHuisId+'_'+l_intCounter2)
//        g_strSelectedDayId[p_intHuisId] = new Array();
//        g_strSelectedDayId[p_intHuisId][l_intCounter] = new Array();
//        g_strSelectedDayId[p_intHuisId][l_intCounter][0] = l_objDay.getAttribute('id');
//        g_strSelectedDayId[p_intHuisId][l_intCounter][1] = l_objDay.getAttribute('position');
//        
//        l_objDay.style.backgroundPosition= GetSelectedStyle(g_strSelectedDayId[p_intHuisId][l_intCounter][1], 0, false);
//    }
//}

//function HouseChange()
//{
//    CloseDiv('Huis_');
//    if(document.getElementById('HouseForm'))
//        document.getElementById('HouseForm').style.display = 'none';
//    if(document.getElementById('HuizenSelect'))
//    {
//        var l_intValue = document.getElementById('HuizenSelect').value;
//        document.getElementById('Huis_' + l_intValue).style.display = 'block';
//    }
//}

//function ShowHouseForm(p_intId)
//{
//    if(g_strStart[p_intId][0] != '' && g_strEnd[p_intId][0] != '')
//    {
//        document.getElementById('House').value = g_strHouses[p_intId][1];
//        document.getElementById('House2').value = g_strHouses[p_intId][1];
//        document.getElementById('HouseFrom').value = g_strStart[p_intId][4] + '-' + g_strStart[p_intId][3] + '-' + g_strStart[p_intId][5];
//        document.getElementById('HouseTill').value = g_strEnd[p_intId][4] + '-' + g_strEnd[p_intId][3] + '-' + g_strEnd[p_intId][5];
//        document.getElementById('HouseFrom2').value = g_strStart[p_intId][3] + '-' + g_strStart[p_intId][4] + '-' + g_strStart[p_intId][5];
//        document.getElementById('HouseTill2').value = g_strEnd[p_intId][3] + '-' + g_strEnd[p_intId][4] + '-' + g_strEnd[p_intId][5];
//        CloseDiv('Huis_');
//        document.getElementById('HouseForm').style.display = 'block';
//    }
//    else
//    {
//        alert('U moet eerste een selectie maken van de gewenste periode');
//    }
//}

//function ShowExtraGasten()
//{
//    ShowExtraGasten2();
//    document.getElementById('FooterContainer').style.bottom = '2px';
//}

//function ShowExtraGasten2()
//{
//    var l_intValue = document.getElementById('AantalGasten').value;
//    var l_intCounter = 0;
//    var l_objGuest = document.getElementById('Gast_' + l_intCounter);
//    while(l_objGuest)
//    {
//        if(l_intCounter < l_intValue)
//            l_objGuest.style.display = 'block';
//        else
//            l_objGuest.style.display = 'none';
//        l_intCounter++;
//        l_objGuest = document.getElementById('Gast_' + l_intCounter);
//    }
//    //alert(0%3);
//}

//function GetSelectedStyle(p_intStyle, p_intSwitch, p_blnAlphaOmega)
//{
//    switch(p_intSwitch)
//    {
//        case 0:
//            switch(p_blnAlphaOmega)
//            {
//                case true:
//                    switch(p_intStyle)
//                    {
//                    case '-69px -48px':
//                        return '-276px -144px';
//                        break;
//                    case '-0px -48px':
//                        return '-276px -48px';
//                        break;
//                    case '-138px -48px':
//                        return '-207px -144px';
//                        break;
//                    }
//                    break;
//                default:
//                    switch(p_intStyle)
//                    {
//                    case '-69px -48px':
//                        return '-276px -144px';
//                        break;
//                    case '-0px -48px':
//                        return '-345px -0px';
//                        break;
//                    case '-138px -48px':
//                        return '-207px -144px';
//                        break;
//                    }
//                    break;
//            }
//            break;
//        case 1:
//            switch(p_intStyle)
//            {
//                default:
//                    return '-345px -0px';
//                    break;
//            }
//            break;
//        case 2:
//            switch(p_intStyle)
//            {
//                case '-138px -48px':
//                    return '-207px -144px';
//                    break;
//                default:
//                    return '-207px -48px';
//                    break;
//            }
//            break;
//    }
//}