
<?php
if (isset($_REQUEST['remove_tag'])) {
    $file=$_REQUEST['remove_tag'];
    if (is_file('tags/' . $file))
	$do = unlink('tags/'.$file);   
   }
?>

<div style=" display: inline-block;float:right;position:relative; top:100px; right:10px;  "> 
<div align="right" style="width:10px;"> 


<style scoped>
/*General Label Style*/
 


ul.labels{
 font-family: Verdana,Arial,Helvetica,sans-serif;
 font-weight: 100;
 line-height: 13px;
}
ul.labels li{
 display: inline;
 color: #CCCCCC;
 float: right;
 margin: 0px 2px 2px 0px;
 height: 13px;
 line-height: 13px;

}
 
ul.labels li span{
 background: url(/_static/label_front.gif) no-repeat center left;
 font-size: 11px;
 font-weight: normal;
 white-space: nowrap;
 padding: 0px 3px;
 color: white;
  vertical-align: top; */
 float: right; 
}
 
a.xbut{
 padding: 1px 4px 0px 11px;
 padding-top  /*\**/: 0px\9; /*Hack for IE*/
 background: url(/_static/labelx.gif) no-repeat center right;
 cursor: pointer;
 border-left: 1px dotted white;
 outline: none;
 margin-right: 0px;

}
a.xbut:hover{
 background: url(/_static/labelx_hover.gif) no-repeat center right;
}

a {
    text-decoration: none;
}

a:visited {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}


/*Colored Label Attributes*/
ul.labels li.class_0{
 background-color: #000 ;
}

ul.labels li.class_1{
 background-color: #F1A9E7;
}
ul.labels li.class_2{
 background-color: #99CCFF;
}
ul.labels li.class_3{
 background-color: #3019FF;
}
ul.labels li.class_4{
 background-color: #CCCC66;
}
ul.labels li.class_5{
 background-color: #37B700;
}
ul.labels li.class_6{
 background-color: #C5AD98;
}
ul.labels li.class_7{
 background-color: #CEA6CE;
}
ul.labels li.class_8{
 background-color: #8FCDB6;
}
ul.labels li.class_9{
 background-color: #EE998A ;
}
ul.labels li.class_10{
 background-color: #FF9E28 ;
}
ul.labels li.class_11{
 background-color: #B6FF00 ;
}
ul.labels li.class_12{
 background-color: #21007F ;
}
ul.labels li.class_13{
 background-color: #00CC00 ;
}
ul.labels li.class_14{
 background-color: #B24700 ;
}
ul.labels li.class_15{
 background-color: #80C8FE ;
}
ul.labels li.class_16{
 background-color: #8E006B ;
}
ul.labels li.class_17{
 background-color: #8E0D6B ;
}


</style>
<form name="tags">
<ul class="labels">
<?php

$dirFiles = array();
$thelist="";
     
 if ($handle = opendir("tags/")) {
   while (false !== ($file = readdir($handle)))
      {
          if ($file != "." && $file != ".." && $file != "index.php")
          {
	      $dirFiles[] = $file;
          }
       }
  closedir($handle);
  }

    sort($dirFiles);
    foreach($dirFiles as $file)
    {
	$class = ord($file[0]) % 18;
	$title = file_get_contents("tags/".$file);
	$thelist .= '<li class="class_'.$class.'"><a href="/utils/close_shots?diagn_0=tags&value_0='.$file.'" title="'.$title.'"><span>'.$file."</span></a><a href=\"?remove_tag=".$file."\" class='xbut'></a></li>\n";
    }

  echo $thelist;

?>
</ul>
</form>
</div> 
</div> 

