(function($) {
	$(function(event) {
		$('#ddlCategory').change(function(event) {
			if (this.value == 0) {
				$('#categorySelected').hide();
				$('#cancelComplain').show();
			} else {
				$('#categorySelected').show();
				$('#cancelComplain').hide();
			}
			$('#content').find('.reason').hide();
			$('#content').find('#reason'+this.value).show();
		});
		
		if($('#categoryId').val()) {
			$("#ddlCategory").find("option[@value='"+$('#categoryId').val()+"']").attr("selected", "selected");
			if ($('#categoryId').val() == 0) {
				$('#categorySelected').hide();
				$('#cancelComplain').show();
			} else {
				$('#categorySelected').show();
				$('#cancelComplain').hide();
			}
			$('#content').find('.reason').hide();
			$('#content').find('#reason'+$('#categoryId').val()).show();
			$('#content').find(".subcategory[@value='"+$('#subcategoryId').val()+"']").attr("checked", "checked");
		}
		
	});
})(jQuery);