$(document).ready(function()
{
	$("a[rel='lightbox']").colorbox();
    
    $('.innerfade').innerfade({
		speed: 750,
		timeout: 5000,
		type: 'random'
	});
    
    $(".validateForm").validate({
        errorPlacement: function(error, element) {
			error.prependTo( element.parent().last() );
		},
		// set this class to error-labels to indicate valid fields
		error: function(label) {
		}
    });
    
    $(".clearInput").focus(function(srcc)
    {
        if ($(this).val() == this.defaultValue)
        {
            $(this).val("");
        }
    });
    
    $('#deel1').change(function(){
            $('.alt1').removeAttr('disabled');
            $('.'+$(this).val()+'1').attr('disabled','disabled');
    });
    
    $('#deel2').change(function(){
            $('.alt2').removeAttr('disabled');
            $('.'+$(this).val()+'2').attr('disabled','disabled');
    });

    $('#dieetwensen').click(function()
    {
        $('#wensen').toggle();
    });
    
    $(".clearInput").blur(function()
    {
        if ($(this).val() == "")
        {
            $(this).val(this.defaultValue);
        }
    });
    
    $( "#datepicker" ).datepicker();

    
    $('a').each(function(){
        if($(this).attr('href'))
        {
            if($(this).attr('href').indexOf("#") == 0)
            {
               $(this).attr('href',window.location+$(this).attr('href'));
            }
        }
    });
    
    $(".clearInput").blur();
    
    $('.andersNamelijk').change(function()
    {
        if ($(this).val() == 'anders')
        {
            $('.anders').show();
        }
        else
        {
            $('.anders').hide();
        }
    });
});

function reloadCaptcha()
{
	document.getElementById('captcha').src = document.getElementById('captcha').src+ '?' +new Date();
}
