// JavaScript Document

function toggleMonth(id) {
	jQuery("#monthdiv" + id.toString()).toggle(200);
	curimg = jQuery("#img" + id.toString()).attr('src');
	if(curimg.indexOf('minus') > 0) {
		jQuery("#img" + id.toString()).attr('src', 'images/ico_plus.gif');
	} else {
		jQuery("#img" + id.toString()).attr('src', 'images/ico_minus.gif');
	}
}

function submitNewsLetterForm() {
	var oForm = $("#newsletter").get(0);
	var sError = "";
	if($("#name").get(0).value.length == 0) sError += "Gelieve uw naam in te vullen\n";
	if($("#drudik-drudik").get(0).value.length == 0) sError += "Gelieve een geldig E-mailadres in te vullen\n";
	if(sError.length > 0) {
		alert(sError);
	} else {
		oForm.submit();
	}
}

function slidePhoto(id, dir) {
	var total = 0;
	jQuery("#" + id + " > a > img").each(function(index) { total = total + 1; });
	jQuery("#" + id + " > a > img").each(function(index) {
		if(dir == 'next' && (total-index) > 3 && jQuery(this).css('display') != 'none') {
			jQuery(this).css('display', 'none');
			return false;
		}
		if(dir == 'prev' && jQuery(this).css('display') != 'none') {
			if(index > 0) {
				jQuery("#" + id + " > a > img:eq(" + (index-1) + ")").each(function(index) {
					jQuery(this).css('display', '');
					return false;
				});
			}
			return false;
		}
	});
}

function showNewsArchive() {
	jQuery("#newsarchivelink").hide();
	jQuery("#newsarchive").show();
}
