<?php
include("includes/site_info.php");

$WUserID = $_SESSION['Sess_UserId'];
$WUsername = $_SESSION['Sess_UserName'];

include("includes/header_noright.php");

?>

<script type="text/javascript">
jQuery.noConflict();

jQuery(document).ready(function(){
	 jQuery(".moreCat").click(function(){
	 	var id = jQuery(this).attr("id");
	 	jQuery(this).parent().hide();
		jQuery(this).parents("span.main").height(140+jQuery('#show'+id).height());
		jQuery('#show'+id ).slideDown("slow");
	 });
});

  </script>
 <table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="5" class="white_back_t_xb">
				<tr>
					<td><div class="light_orang_h">
							<div style="background-color:#FF0000; width:10px; height:10px; float:left; margin-top:3px; margin-right:5px;"><img src="images/spacer.gif" width="10" height="10" /></div>
							Browse by Title</div>
						<div class="dot_line"><img src="images/spacer.gif" width="1" height="1" /></div>
						<div class="solid_line"><img src="images/spacer.gif" width="1" height="1" /></div></td>
				</tr>
				<tr>
					<td><div class="aToz"><?php
for ($i = 65; $i < 91; $i++) {
    printf('<a href="%swauhhHotList.php?letter=%s">%s</a> | ',
    $PHP_SELF, chr($i), chr($i));
}
    printf('<a href="%swauhhHotList.php?letter=%s">%s</a> | ',
    $PHP_SELF, chr(64), chr(64));
?></div></td>
				</tr>
				<tr>
					<td><div class="light_orang_h">
							<div style="background-color:#0000FF; width:10px; height:10px; float:left; margin-top:3px; margin-right:5px;"><img src="images/spacer.gif" width="10" height="10" /></div>
							Categories</div>
						<div class="dot_line"><img src="images/spacer.gif" width="1" height="1" /></div>
						<div class="solid_line"><img src="images/spacer.gif" width="1" height="1" /></div></td>
				</tr>
				<tr>
					<td><div class="mainCatAll">
					<?php
					$sql=mysql_query("select dataID, dataName from market_category_data where catID=1 and parent=0 and dataID not in (1,84,85) order by dataName asc");
					$clear = 0;
					while($row=mysql_fetch_array($sql))
					{
					$id=$row['dataID'];
					$data=$row['dataName'];
					$countQuery=mysql_query("select mainCat from market_Post where approve=1 and expDate > now() and subCat=$id");
					$countTotal = mysql_num_rows($countQuery);
					if ($clear%5==0) {
						echo "<span class=\"main clear\">";
					} else {
						echo "<span class=\"main\">";
					}
					echo "<a href=\"wauhhHotdesc.php?catID=1&dataID=$id\">".$data."&nbsp;<span class=\"orange_12\">($countTotal)</span></a>";
					$sql2=mysql_query("select dataID, dataName from market_category_data where catID=1 and parent=$id order by dataName asc");
					$sql2Total = mysql_num_rows($sql2);
					$j=0;
					while($row2=mysql_fetch_array($sql2))
					{
					$j++;
					$id2=$row2['dataID'];
					$data2=$row2['dataName'];
					if ($j==6) {
						echo "<p><a href=\"javascript:;\" class=\"moreCat\" id=\"$idn$id2\"><strong>More</strong></a></p><div id=\"show$idn$id2\" class='none'>";
					}
					$countQuery2=mysql_query("select mainCat from market_Post where approve=1 and expDate > now() and subCatsub=$id2");
					$countTotal2 = mysql_num_rows($countQuery2);
					echo "<p><a href=\"wauhhHotdesc.php?catID=1&dataID=$id&SubdataID=$id2\">".$data2."&nbsp;<span class=\"orange_12\">($countTotal2)</span></a></p>";
					if (($j==$sql2Total) &&($j>5)) {
						echo "</div> </p>";
					}
					}
					echo "</span>";
					$clear++;
					}
					?>
					<?php
					$countQuery=mysql_query("select mainCat from market_Post where approve=1 and expDate > now() and subCat in (1,84,85)");
					$countTotal = mysql_num_rows($countQuery);
					echo "<span class=\"main\"> Others <span class=\"orange_12\">($countTotal)</span>";
					$sql2=mysql_query("select dataID, dataName from market_category_data where catID=1 and parent=0 and dataID in (1,84,85) order by dataName asc");
					$sql2Total = mysql_num_rows($sql2);
					while($row2=mysql_fetch_array($sql2))
					{
					$id2=$row2['dataID'];
					$data2=$row2['dataName'];
					$countQuery=mysql_query("select mainCat from market_Post where approve=1 and expDate > now() and subCat=$id2");
					$countTotal = mysql_num_rows($countQuery);
					echo "<p><a href=\"wauhhHotdesc.php?catID=1&dataID=$id2\">".$data2."&nbsp;<span class=\"orange_12\">($countTotal)</span></a></p>";
					}
					echo "</span>";
					?>
					<?php
					$sql=mysql_query("select catID, catName from market_category where catID!=1");
					$clear++;
					while($row=mysql_fetch_array($sql))
					{
					$id=$row['catID'];
					$data=$row['catName'];
					$countQuery=mysql_query("select mainCat from market_Post where approve=1 and expDate > now() and mainCat=$id");
					$countTotal = mysql_num_rows($countQuery);
					if ($clear%5==0) {
						echo "<span class=\"main clear\">";
					} else {
						echo "<span class=\"main\">";
					}
					echo "<a href=\"wauhhHotdesc.php?catID=$id\">".$data."&nbsp;<span class=\"orange_12\">($countTotal)</span></a>";
					$sql2=mysql_query("select dataID, dataName from market_category_data where catID=$id and parent=0 order by dataName asc");
					$sql2Total = mysql_num_rows($sql2);
					$j=0;
					while($row2=mysql_fetch_array($sql2))
					{
					$j++;
					$id2=$row2['dataID'];
					$data2=$row2['dataName'];
					if ($j==6) {
						echo "<p><a href=\"javascript:;\" class=\"moreCat\" id=\"$idn$id2\"><strong>More</strong></a></p><div id=\"show$idn$id2\" class='none'>";
					}
					$countQuery2=mysql_query("select mainCat from market_Post where approve=1 and expDate > now() and subCat=$id2");
					$countTotal2 = mysql_num_rows($countQuery2);
					echo "<p><a href=\"wauhhHotdesc.php?catID=$id&dataID=$id2\">".$data2."&nbsp;<span class=\"orange_12\">($countTotal2)</span></a></p>";
					if (($j==$sql2Total) &&($j>5)) {
						echo "</div>";
					}
					}
					echo "</span>";
					$clear++;
					}
					?>
					</div></td>
				</tr>
				<tr>
					<td>&nbsp;</td>
				</tr>
			</table></td>
	</tr>
</table>
<?php include("includes/footer_noright.php"); ?>
