objekt = {
    register: function() {
		$('.rechnerStartClass').each(function () {
			switch($(this).attr('id')) {
				case 'rechnerID':
                    $('#'+$(this).attr('id')).validate({
						rules: {
							zipcode: {
								required: true,
								minlength: 5,
								remote: {
									url: 'http://www.wechsel-den-stromanbieter.de/ajax.php',
									data: {
										module: 'validate',
										action: 'zipcode',
										type: 'jqvalidate'
									}
								}
							},
							totalconsumption: {
								required: true
							}
						},
						messages: {
							zipcode: 'Ung&uuml;ltige Postleitzahl',
							totalconsumption: 'Gasverbrauch fehlt'
						},
						errorElement: 'em',
						invalidHandler: function(form, validator) {
							var errors = validator.numberOfInvalids();
							if (errors == 0) {
								$('#rechnerID').errors('margin-top', '10px');
							} else {
								$('#rechnerID').css('margin-top', '0');
							}
						}
					});
					break;
			}
		});
	}
}

$(function() {
	objekt.register();
});
