function selectCategoryIndex(data) {
  
  if(!data['id']) {
		data['title'] = '';
	}
  
	$("#what").val(data['title']);
	$("#categoryid").val(data['id']);
	$("#what").effect('highlight', {color: data['color']}, 1100);

	if(!data['hasChildren']) {
//    $('html,body').animate({scrollTop: '230px'}, 400);
		return;
	}
	
	$.get('/index/loadcategories', data, function(data) {
		$('#subcategoriesdiv').html(data);
		
		$("#branchenkatalogauswahlid").hide();
		$("#wirueberunsdiv").hide();
		$("#subcategoriesdiv").show();
    
//    $('html,body').animate({scrollTop: '730px'}, 0);
		
		//alt: Dialog destroy
//		$container.find("a").bind("click", function(e) {
//			$container.dialog('destroy');
//			$container.remove();
//		});
		
//		$container.dialog({
//			bgiframe: true,
//			modal: true,
//			width: 500,
//			height: 'auto',
//			resizable: false,
//			buttons: {
//				Ok: function() {
//					$(this).remove();
//				}
//			}
//		});
	});
	
	return;
}


$(document).ready(function() {
	$("#what").bind('change', function() {
		$("#categoryid").val('0');
	});
	
//$('#backtobranchenkatalog').bind("click",backToBranchenCatalogFunction);
//	
//	function backToBranchenCatalogFunction()
//	{
//		alert("Klick");
//		
//	}
	
//	flowplayer("player", "/flash/flowplayer-3.1.2.swf", { clip: { autoPlay: false } });
});


