var processContactFormErrors = function(form, error, field)
{
    var field = $(field); 
    
    if (!field.attr('id'))
    {
        field.attr('id', field.attr('name').replace(/[\[\]]/g, '_'));
    }
    
    if (field.attr('type') == 'hidden'
        || field.attr('type') == 'checkbox'
        || field.attr('type') == 'radio')
    {
        return false;
    }       
    
    // Voeg de afbeelding toe achter het veld
    field.addClass('errored');
    $(field).attr('rel', error['value']);
    $(field).css('background', 'url(/images/icon_error.png) #ffe7e7 no-repeat right 3px');
    
    $(field).bt({
        contentSelector : "$(this).attr('rel')",
        strokeWidth: 1,
        fill: '#00519C',
        strokeStyle: '#00162B',
        width : $(field).width() + 10,
        cssStyles: {color: '#ffffff', fontSize: '0.8em'},
        cornerRadius : 5,
        spikeGirth: 15,
        spikeLength: 10,
        killTitle : false,
        positions: ['top', 'bottom']
    });
};

var toggleMapPage = function(page)
{
    var navOne = $('div.imageCarrousel').eq(0);
    var navTwo = $('div.imageCarrousel').eq(1);

    if (page == '_level0.zoomin')
    {
        navOne.animate({opacity: 0}, 300, function() {
            $(this).hide();
            navTwo.show().animate({opacity: 1}, 300);
        });
    }
    else if (page == '_level0.zoomout')
    {
        navTwo.animate({opacity: 0}, 300, function() {
            $(this).hide();
            navOne.show().animate({opacity: 1}, 300);
        });
    }
}


$(document).ready(function(){
    Cufon.replace('h1');
    Cufon.replace('span.carrousel');
    
    $(document).pngFix();
})
