function hideHumanValidationFields() {
	$('#hvalidation').prev().hide();
    $('#hvalidation').hide();
}

function setDivHeight()
{
    $("#content").height($(window).height()-285);
}

function banner(){
    $('#bannerStep1').fadeIn().delay(6000).fadeOut('slow', banner).delay(6000); 
}

$(document).ready(function() {
    banner();
    $('#bannerStep1').css('margin-top', ($('#banner').height() - $('#bannerStep1').height())/2);
    $('#bannerStep2').css('margin-top', ($('#banner').height() - $('#bannerStep2').height())/2);

    $("#content").css('min-height', $("#content").height()+33);

    hideHumanValidationFields();
    setDivHeight();

    $(window).resize(function(){
        setDivHeight();
    });

    $("a[rel~=external]").each(function(i){
        this.target="_blank";
    });	    

    $(".cmsContentContainer a").filter(function(){
        if($(this).attr('href').match(/\.(jpe?g|png|gif)/i)) {
            $(this).fancybox();
        }
    });    

    if($('.obmt').length > 0) {
        $('.obmt').attr('href', 'mailto:'+$('.obmt').attr('href').replace('|','@').replace(':','.')).text($('.obmt').text().replace('|','@').replace(':','.'));	
    }

    $('..cmsContentContainer img').each(function() {
        if($(this).css('float') == 'left') {
            $(this).addClass('imageLeft');
        } else if($(this).css('float') == 'right') {
            $(this).addClass('imageRight');
        }
    });  
});

