(function($) {
    var cache = [];
    // Arguments are image paths relative to the current page.
        $.preLoadImages = function() {
        var args_len = arguments.length;
        for (var i = args_len; i--;) {
          var cacheImage = document.createElement('img');
          cacheImage.src = arguments[i];
          cache.push(cacheImage);
        }
    }
	jQuery.noConflict();
    $("document").ready(function() {
		/* jQuery logica voor EVENEMENTEN pagina's */
		$('.eventsElement .eventDate, .eventDate').each(function(index) {
			var myDate = new Date($(this).html());
			var curr_date = myDate.getDate();
			var curr_day = myDate.getDay();
			var curr_month = myDate.getMonth();
			var curr_year = myDate.getFullYear();
	
			curr_day +='';
			curr_day = curr_day.replace("0", "zondag, ");
			curr_day = curr_day.replace("1", "maandag, ");
			curr_day = curr_day.replace("2", "dinsdag, ");
			curr_day = curr_day.replace("3", "woensdag, ");
			curr_day = curr_day.replace("4", "donderdag, ");
			curr_day = curr_day.replace("5", "vrijdag, ");
			curr_day = curr_day.replace("6", "zaterdag, ");
	
			curr_month +='';
			curr_month = curr_month.replace(/10/, "november");
			curr_month = curr_month.replace(/11/, "december");
			curr_month = curr_month.replace(/0/, "januari");
			curr_month = curr_month.replace(/1/, "februari");
			curr_month = curr_month.replace(/2/, "maart");
			curr_month = curr_month.replace(/3/, "april");
			curr_month = curr_month.replace(/4/, "mei");
			curr_month = curr_month.replace(/5/, "juni");
			curr_month = curr_month.replace(/6/, "juli");
			curr_month = curr_month.replace(/7/, "augustus");
			curr_month = curr_month.replace(/8/, "september");
			curr_month = curr_month.replace(/9/, "oktober");
	
			$(this).html(curr_day + curr_date + " " + curr_month + " " + curr_year);
		
		});
		$('.blogsElement .postDate').each(function(index) {
			var myDate = new Date($(this).html());
			var curr_date = myDate.getDate();
			var curr_day = myDate.getDay();
			var curr_month = myDate.getMonth();
			var curr_year = myDate.getFullYear();

			curr_day +='';
			curr_day = curr_day.replace("0", "zondag, ");
			curr_day = curr_day.replace("1", "maandag, ");
			curr_day = curr_day.replace("2", "dinsdag, ");
			curr_day = curr_day.replace("3", "woensdag, ");
			curr_day = curr_day.replace("4", "donderdag, ");
			curr_day = curr_day.replace("5", "vrijdag, ");
			curr_day = curr_day.replace("6", "zaterdag, ");
	
			curr_month +='';
			curr_month = curr_month.replace(/10/, "november");
			curr_month = curr_month.replace(/11/, "december");
			curr_month = curr_month.replace(/0/, "januari");
			curr_month = curr_month.replace(/1/, "februari");
			curr_month = curr_month.replace(/2/, "maart");
			curr_month = curr_month.replace(/3/, "april");
			curr_month = curr_month.replace(/4/, "mei");
			curr_month = curr_month.replace(/5/, "juni");
			curr_month = curr_month.replace(/6/, "juli");
			curr_month = curr_month.replace(/7/, "augustus");
			curr_month = curr_month.replace(/8/, "september");
			curr_month = curr_month.replace(/9/, "oktober");
	
			$(this).html(curr_day + curr_date + " " + curr_month + " " + curr_year);
		
		});
        /* hide second addressfield in contact form */
		var hideSecondAddress = $('div.fieldContent p.fieldRow:nth-child(2)');
		if (hideSecondAddress) { hideSecondAddress.hide(); }
		
    });

})(jQuery)
