Cufon.replace('h1');
Cufon.replace('h2');
Cufon.replace('h3');
Cufon.replace('.menu');
Cufon.replace('#catmenu');
Cufon.replace('.headline');
Cufon.replace('.nieuwsbrief');
Cufon.replace('.citaat');
Cufon.replace('.bannerslogan');
Cufon.replace('DBBanner_text_list');
Cufon.replace('#slideshow p');

$(document).ready(function() {
    $("img").each(function() {
    if ($(this).attr("longDesc") !== undefined) {
        $(this).attr("title", $(this).attr("longDesc").value);
        }
    });

    $("input.sf_searchText").click(function() {
        value = $(this).val();
        $(this).attr("value", "");
    });


    $("input.sf_searchText").blur(function() {
        if ($(this).val() == "") {
            $(this).val(value);
        }
    });


    var slider_DB_timeout = 4000;
    var $htmlSlider = '';

    if ($('img.imgslider').length >= 2) {
        //$('div.SliderDiv').height = $divMinHeight;

        //Add a Div to the parent element of the images
        $('.imgslider').parent().parent().append("<div class='SliderDiv'></div>");
        //$('#rightFloating').append("<div class='SliderDiv'></div>");
        //Then move the images into that div we just created
        $('.imgslider').parent().children().appendTo('.SliderDiv');
        //Resize the div we created to match the largest image in the slider

        setInterval("sliderNewsStart()", slider_DB_timeout);
        sliderNewsStart();
    }

});
		
function sliderNewsStart() {
        var $active = $('.SliderDiv img.active');
        if ($active.length == 0)  {
        	$active = $('.imgslider:last'); 
        	$active.addClass('active');
        }	
    	var $next = $active.next().length ? $active.next() 
    	: $('.imgslider:first');
    
    	$active.addClass('last-active');
    	$active.removeClass('active');
    	$next.css({ opacity: 0.0 })
    	.addClass('active')
    	.animate({ opacity: 1.0 }, 1000, function() {
        	$active.removeClass('active last-active');
    	});
}

function getParameterByName(name) {   
	name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");   
	var regexS = "[\\?&]" + name + "=([^&#]*)";   
	var regex = new RegExp(regexS);   
	var results = regex.exec(window.location.href);   
	if(results == null)     
		return "";   
	else     
		return decodeURIComponent(results[1].replace(/\+/g, " ")); 
} 
