$(document).ready(function () {
    $(".hideMe").hide();

    $(".knop").mouseenter(function () {
        var drop = $(this);
        var t = setTimeout(function () {
            $(drop).children().first().next().stop(true, true);
            $(drop).children().first().next().slideDown("fast");
        }, 50);
    });

    $(".knop").mouseleave(function () {
        var drop = $(this);
        var t = setTimeout(function () {
            $(drop).children().first().next().stop(true, true);
            $(drop).children().first().next().slideUp("fast");
        }, 50);
    });

    $("#blockAfspraak").click(function () {
        document.location.href = '/extra/afspraak.aspx';
    });

    $("#blockCadeau").click(function () {
        document.location.href = '/extra/cadeau-idee.aspx';
    });

    $(".knop").click(function () {
        document.location.href = $(this).children().first().attr('href');
    });

    $("#RouteButton").click(function () {
        window.open('http://www.google.com/maps?saddr=' + $("#RoutePostcode").val() + '&daddr=5388GX&hl=nl');
    });

    $("#RoutePostcode").keypress(function (event) {
        if (event.which == 13) {
            event.preventDefault();
            window.open('http://www.google.com/maps?saddr=' + $("#RoutePostcode").val() + '&daddr=5388GX&hl=nl');
        }
    });
});

//Onderstaande functie voor het disablen van data's in een jQuery calendar
///* create an array of days which need to be disabled */
//var disabledDays = ["2-21-2010","2-24-2010","2-27-2010","2-28-2010","3-3-2010","3-17-2010","4-2-2010","4-3-2010","4-4-2010","4-5-2010"];

///* utility functions */
//function nationalDays(date) {
// var m = date.getMonth(), d = date.getDate(), y = date.getFullYear();
// //console.log('Checking (raw): ' + m + '-' + d + '-' + y);
// for (i = 0; i < disabledDays.length; i++) {
// if($.inArray((m+1) + '-' + d + '-' + y,disabledDays) != -1 || new Date() > date) {
// //console.log('bad: ' + (m+1) + '-' + d + '-' + y + ' / ' + disabledDays[i]);
// return [false];
// }
// }
// //console.log('good: ' + (m+1) + '-' + d + '-' + y);
// return [true];
//}
//function noWeekendsOrHolidays(date) {
// var noWeekend = jQuery.datepicker.noWeekends(date);
// return noWeekend[0] ? nationalDays(date) : noWeekend;
//}

///* create datepicker */
//jQuery(document).ready(function() {
// jQuery('#date').datepicker({
// minDate: new Date(2010, 0, 1),
// maxDate: new Date(2010, 5, 31),
// dateFormat: 'DD, MM, d, yy',
// constrainInput: true,
// beforeShowDay: noWeekendsOrHolidays
// });
//});
