foreach ($aData as $value) {
         //if ($count < $maxsize)
         //{
         //if ($value != "")
         //{
         $aItem = explode(":", $value);
         //$tempTag[tag_name] = utf8_decode($aItem[0]);
         $tempTag["tag_name"] = $aItem[0];
         $tempTag["tag_count"] = $aItem[1];
         $tags[] = $tempTag;
         //}
         //}
         //$count++;
     }
     // instantiate a cloud
     $cloud = new cloud_tag();
     // the class already has defaults, but let's override them for fun
     $cloud->set_label('tag');
     // css classes will be cloud1, cloud2, etc.
     $cloud->set_tagsizes(7);
     // 7 font sizes will be used
     $newtags = $cloud->make_cloud($tags);
     // make a tag cloud
     $res = "";
     foreach ($newtags as $atag) {
         $escapedName = str_replace("'", "&#39;", $atag["tag_name"]);
         $res .= "<a href='javascript:void(0);' class='" . $atag["tag_class"] . "' title='" . $escapedName . "' onClick='setSearchCrit(\"" . $escapedName . "\");'>" . str_replace(" ", "&nbsp;", $atag["tag_name"]) . "</a>&nbsp;&nbsp;&nbsp; ";
     }
 }
 if ($action == "gettext") {
     $id = getRequestParam("id");
function displayCloud($data)
{
    $tags = array();
    $aData = explode("|", $data);
    foreach ($aData as $value) {
        $aItem = explode(":", $value);
        //$tempTag[tag_name] = utf8_decode($aItem[0]);
        $tempTag["tag_name"] = $aItem[0];
        $tempTag["tag_count"] = $aItem[1];
        $tags[] = $tempTag;
    }
    // instantiate a cloud
    $cloud = new cloud_tag();
    // the class already has defaults, but let's override them for fun
    $cloud->set_label('tag');
    // css classes will be cloud1, cloud2, etc.
    $cloud->set_tagsizes(7);
    // 7 font sizes will be used
    $newtags = $cloud->make_cloud($tags);
    // make a tag cloud
    $res = "";
    foreach ($newtags as $atag) {
        $escapedName = str_replace("'", "&acute;", $atag["tag_name"]);
        $res .= "<a href='javascript:void(0);' class='" . $atag["tag_class"] . "' title='" . $escapedName . "' onClick='setSearchCrit(\"" . $escapedName . "\");'>" . str_replace(" ", "&nbsp;", $atag["tag_name"]) . "</a>&nbsp;&nbsp;&nbsp; ";
    }
    return $res;
}