

var addthis_config = {
	services_compact: 'linkedin, email, facebook, twitter, more'
}


$(document).ready(function() {                      
    
    $.ajaxSetup ({
		cache: false
	});
	
    // Cufon
	Cufon.replace('h2');
	Cufon.replace('h3');
	Cufon.replace('h4');
	Cufon.replace('.cufon');
	Cufon.replace('.styledFS01 legend');
	
	// jsEnabled class for body
    $(document.body).addClass('jsEnabled');
    
    // Alle links met rel="external" in een nieuw venster openen
    $("a[rel=external]").each(function(i){
        this.target="_blank";
    });
    $(".nieuwsImportTekst a").each(function(i){
        this.target="_blank";
    });
    
    // Font size veranderen
    $("a.changeFontSize").click(function(){
		Website.changeFontSize($(this));
		return false;
    });
    
    // links maken van container boxes
    $("div.parentLink").each(function(){
		
		var elUrl = $(this).find('a:first');
		
		$(this).css('cursor','pointer');
		$(this).attr('title', elUrl.attr('title'));
		
		$(this).click(function(){
			window.location = Website.Config.sBaseUrl + elUrl.attr('href');
		});
		
    });
    
    
    Website.initFormCheckFields();
    
});


Website.changeFontSize = function(e) {
	
	sCss = e.attr('rel');
	$('link#fontSizeCss').attr('href', sCss);
	
	$.cookie('fontsize', sCss, {expires: 365, path: '/'});
	
	$("a.changeFontSize").each(function(){
		$(this).removeClass('active');
    });
    
    e.addClass('active');
    e.blur();
	
};


/**
* Form Check Fields
**/
var aCheckFields;
var iCheckFields;

Website.initFormCheckFields = function() {
	
	// Form check fields
	aCheckFields = $('.swisFormCheck');
	iCheckFields = aCheckFields.length;
	
	if(iCheckFields > 0) {
		$.get(Website.Config.sBaseUrl +'default/index/get-default-form-check-value', null,
		this.fillFormCheckFields);
	}
	
};

Website.fillFormCheckFields = function(sFormCheckValue) {
	
	while (iCheckFields--) {
		if (aCheckFields[iCheckFields].value == '') {
			aCheckFields[iCheckFields].value = sFormCheckValue;
		}
	}
	
};
