var checkEnquete = function() {
	var errors = new Array();
	
	// vraag 1
	if($('#v1').val() == '') {
		errors.push('v1');
	}
	
	for(i=2;i<5;i++) {
		if($('input[name="v' + i + '"]:checked').length == 0) {
			errors.push('v' + i);	
		}
	}
	
	if($('#v5').val() == '') {
		errors.push('v5');
	}
	
	if($('#v6').val() == '') {
		errors.push('v6');
	}
	
	for(i=7;i<11;i++) {
		if($('input[name="v' + i + '"]:checked').length == 0) {
			errors.push('v' + i);	
		}
	}
	
	if($('#v11').val() == '' && $('#v10_1:checked').length == 1) {
		errors.push('v11');
	}
	
	for(i=12;i<13;i++) {
		if($('input[name="v' + i + '"]:checked').length == 0) {
			errors.push('v' + i);	
		}
	}
	
	
	if(errors.length > 0) {
		$().scrollTo($('.q' + errors[0]), 500 );
		
		$('h3').removeClass('formError');
		for(i=0;i<errors.length;i++) {
			$('.q' + errors[i]).addClass('formError');	
		}
		
		return false;
	} else {
		return true;	
	}
};

var checkV10 = function() {
	if($('#v10_1:checked').length == 1) {
		$('#v11x').removeClass('invisible');
	} else {
		$('#v11x').addClass('invisible');	
	}
};

Array.prototype.removeItems = function(itemsToRemove) {
    if(!/Array/.test(itemsToRemove.constructor)) {
        itemsToRemove = [ itemsToRemove ];
    }

    var j;
    for(i=0;i<itemsToRemove.length;i++) {
        j = 0;
        while (j < this.length) {
            if (this[j] == itemsToRemove[i]) {
                this.splice(j, 1);
            } else {
                j++;
            }
        }
    }
};
