<?php 
	$c = new Criteria();
	//$c->add( TblcategoryPeer::CG_PARENTID , -1);
	$cats = TblcategoryPeer::doselect( $c);
	foreach ($cats as $key => $cat) {
		$tree='';
		for( $i=0; $i<substr_count($cat->getCgFamily(), "/"); $i++) {
			$tree = '&nbsp;&nbsp;&nbsp;&nbsp'.$tree;
		}
		$cat->setCgName($tree.'+'.$cat->getCgName());
	}
	echo select_tag('tbldocument[doc_category]', objects_for_select(
			$cats,
			'getCgId',
			'getCgName',
			$tbldocument->getDocCategory()  // selected
		)
	)

?>