function GetParentIDS($tid,&$dsql)
{
	global $_Cs;
	$GLOBALS['pTypeArrays'][] = $tid;

	if(!is_array($_Cs)){ require_once(dirname(__FILE__)."/../data/cache/inc_catalog_base.php"); }

	if(!isset($_Cs[$tid]) || $_Cs[$tid][0]==0){
		return $GLOBALS['pTypeArrays'];
	}
	else{
		return GetParentIDS($_Cs[$tid][0],$dsql);
	}
}
 function GetMyTagT($typeid,$tagname,$tablename){
 	if($tagname=="") return "";
 	if(trim($typeid)=="") $typeid=0;
 	if($this->TypeID > 0 && $typeid==0) $typeid = $this->TypeID;
 	$row = "";
   $pids = Array();
   if($typeid > 0) $pids = GetParentIDS($typeid,$this->dsql);
 	$idsql = " typeid='0' ";
 	foreach($pids as $v){ $idsql .= " Or typeid='$v' "; }
   $row = $this->dsql->GetOne(" Select * From $tablename where tagname like '$tagname' And ($idsql) order by typeid desc ");
 	if(!is_array($row)){ return ""; }
 	else{
 		$nowtime = time();
 		if($row['timeset']==1 && ($nowtime<$row['starttime'] || $nowtime>$row['endtime']) )
 		{ $body = $row['expbody']; }
 		else{ $body = $row['normbody']; }
 	}
 	return $body;
 }