<table width="800" border="0" cellpadding="0" cellspacing="0" class="tpBg">
          <tr>
            <td width="223" height="2" rowspan="2" align="right" valign="bottom">			  </td>
            <td width="577" height="104" valign="bottom" align="left"><table height="20" border="0" cellpadding="0" cellspacing="0" class="mnu">
              <tr>
                <td width="10" align="center" valign="middle" class="sep"></td>
				
				<?php
			  $parent_tabsql="select * from cmspages where `type`='tabs' and parent_id=0";
			  $parent_result=mysql_query($parent_tabsql);
			  $td=0;
			  $colsp=0;
			  $parent_tab_count=mysql_num_rows($parent_result);
			   while($parent_tab_row=mysql_fetch_array($parent_result)){
			   $td++;
			   $colsp=$colsp+2;
			   
			   ?>                
                <td width="0" height="5" align="center" valign="bottom"  class="sep"><div id="menuh-container">
                    <div id="menuh">
                      <ul style="width:auto;" >
                        <li style="width:auto;" ><a href="pages.php?p=<?php echo $parent_tab_row['page_id'];?>&tab=<?php echo $parent_tab_row['page_name'];?>" class="top_parent"><?php echo $parent_tab_row['page_name'];?></a>
						
						
						
						 
						
						<?php 
						 $tabsql="select * from cmspages where `type`='tabs' and parent_id=".$parent_tab_row['page_id']."";
			  $results=mysql_query($tabsql);
			  $numtab=mysql_num_rows($results);
			  if($numtab>0)
			  {?>
			  <ul><?php }
			   while($child_tab_row=mysql_fetch_array($results)){
			   
			   
			   $sqlcount_child="select * from cmspages where `type`='tabs' and parent_id=".$child_tab_row['page_id']."";
			   $count_result=mysql_query($sqlcount_child);
			   $count_chil=mysql_num_rows($count_result);
			   if($count_chil>0){$arrow_class='parent';}
			   
			 
			   
			   
			   
			   ?>
			 <li><a href="pages.php?p=<?php echo $child_tab_row['page_id'];?>" style="width:147px;text-align:left;" class="<?php echo $arrow_class; ?>"><?php echo $child_tab_row['page_name'];?></a>
			 
			 
			     <ul>
				 
				 <?php
				 
				   $sql_subchild="select * from cmspages where `type`='tabs' and parent_id=".$child_tab_row['page_id']."";
			   $subchild_result=mysql_query($sqlcount_child);
				  while($sub_child_tab_row=mysql_fetch_array($subchild_result))
						{
				 
				 ?>
				<li><a href="pages.php?p=<?php echo $sub_child_tab_row['page_id'];?>" style="width:167px;text-align:left;"><?php echo $sub_child_tab_row['page_name'];?></a></li>
				
				<?php }?>
				</ul>
			 
			 </li>
			 
						 
							<?php }
							if($numtab>0)
			  { ?>
						  </ul><?php }?>
                        </li>
                      </ul>
                    </div>
                  <!-- end the menuh-container div -->
                  </div>
                <!-- end the menuh div -->                </td>
                <td width="2" height="5" align="center" valign="middle"  class="sep"><?php if($parent_tab_count!=$td){?>|<?php }else {?><?php }?></td>
                <?php }
				
				
				?>
                <!--  <td align="center" valign="middle"><a href="#" class="mnu">HOME</a></td>
                <td width="10" align="center" valign="middle" class="sep">|</td>
                <td align="center" valign="middle"><a href="#" class="mnu">ABOUT</a></td>
                <td width="10" align="center" valign="middle" class="sep">|</td>
                <td align="center" valign="middle"><a href="#" class="mnu">GALLERY</a></td>
                <td width="10" align="center" valign="middle" class="sep">|</td>
                <td align="center" valign="middle"><a href="#" class="mnu">LOCATION</a></td>
                <td width="10" align="center" valign="middle" class="sep">|</td>
                <td align="center" valign="middle"><a href="#" class="mnu">DESCRIPTION</a></td>
                <td width="10" align="center" valign="middle" class="sep">|</td>
                <td align="center" valign="middle"><a href="#" class="mnu">TRANSPORT</a></td>
                <td width="10" align="center" valign="middle" class="sep">|</td>
                <td align="center" valign="middle"><a href="#" class="mnu">ENQUIRE</a></td>-->
                <td width="20" align="center"></td>
              </tr>
			   
		    </table></td>
          </tr>
          <tr>
            <td align="right" valign="bottom" height="24"></td>
          </tr>
        </table>
		
		<?php //echo $_SERVER['HTTP_HOST']; 
//echo $_SERVER['REQUEST_URI'];


if(!strstr($_SERVER['REQUEST_URI'],'pages.php')&&!strstr($_SERVER['REQUEST_URI'],'gallery.php')&& !strstr($_SERVER['REQUEST_URI'],'location.php'))
{?>

<table width="800" border="0" cellspacing="0" cellpadding="0">
            <tr height="300">
              <td>
			  
			  <?php  $sql_banner="select * from tbl_banner where status=1 Order By sort_order ASC";
			   $banner_result=mysql_query($sql_banner);
			   $countimg=mysql_num_rows($banner_result);
			   $zindex=$countimg+2;
			   if($countimg >7){$dis_margin=(($countimg*27)-($countimg));}
			   elseif($countimg <6){$dis_margin=(($countimg*27)+($countimg));}
			   elseif($countimg >11){$dis_margin=(($countimg*27)-($countimg-100));}
			   else{$dis_margin=($countimg*27);}
			    $totcount=$countimg;
			   $ul=0;
			   $bannerimg='';
			   $buttons='';
			   $diccription='';
			   $img_num=0;
			   $button_id='';
			   ?>
				
			  
			  <div id="slider" class="grid_16">
    <div class="grid_10 alpha">
	<?php   while($banner_row=mysql_fetch_array($banner_result))
						{   $img_num++; 
						   $countimg--;
					$bannerimg.='<li style="z-index: '.$zindex.'; position: absolute; display: list-item;"><a href="'.$banner_row['img_url'].'"><img src="uploads/banner/'.$banner_row['img_name'].'" alt="first image" width="800" height="3000px"></a></li>';
						
						if($img_num==1){$button_id='id="button_selected"';};
						
						$buttons.='<li '.$button_id.'  class="slide_'.($img_num-1).'" >'.$img_num.'</li>';
						
						$diccription.='<li style="z-index: '.$zindex.'; position: absolute; display: list-item; list-style:none;"><h2></h2><p style="margin-left:'.$dis_margin.'px; margin-top:20px;color:#FFFFFF;">	&nbsp;&nbsp;| &nbsp;&nbsp;'.$banner_row['discription'].'</p></li>';
						
						  }  ?>
	
  <ul class="innerfade" style="position: relative; height: 130px;list-style:none;" id="portfolio">
	  
	  <?php echo $bannerimg;?>
  </ul>
      <ul id="slide_nav">
      	<!--<li id="button_selected" class="slide_0" >1</li>-->
		<?php echo $buttons;?>
      	<!--<li class="slide_1">2</li>
      	<li class="slide_2">3</li>
      	<li class="slide_3">4</li>
      	<li class="slide_4">5</li>-->
		
      </ul>
   
	 <SCRIPT language="JavaScript">



	 var ScreenWidth=screen.width;
//alert(ScreenWidth);
	 var fnlwdth=(ScreenWidth-1024);
	 var mrgwith=(fnlwdth/2)+100;
	// alert(fnlwdth);
	// alert(mrgwith);
	document.getElementById('slide_nav').style.marginLeft=mrgwith+'px';
	
	</script>
    </div> <!--<ul id="slide_control">
    	<li id="first_button" class="first_button"></li>
        <li id="prev_button" class="prev_button"></li>
        <li id="pause_button" class="pause_button"><span style="display: none;"> pause</span></li>
        <li id="next_button" class="next_button"></li>
        <li id="last_button" class="first_button"></li>
      </ul>-->
    <ul id="portfolio-desc" class="grid_<?php echo $totcount;?> alpha omega">
    		<?php echo $diccription;?>
	      <!--	<li style="z-index: 5; position: absolute; display: list-item; list-style:none;"><h2></h2><p style="margin-left:170px; margin-top:20px;color:#FFFFFF;">	LOREN IPSUM DOLOR SIT AMET 1 Goes here</p></li>
	      	<li style="z-index: 4; position: absolute; display: none; list-style:none;"><h2></h2><p style="margin-left:170px; margin-top:20px;color:#FFFFFF;">LOREN IPSUM DOLOR SIT AMET</p></li>
	      	<li style="z-index: 3; position: absolute; display: none; list-style:none;"><h2></h2><p style="margin-left:170px; margin-top:20px;color:#FFFFFF;">LOREN IPSUM DOLOR SIT AMET</p></li>
	      	<li style="z-index: 2; position: absolute; display: none; list-style:none;"><h2></h2><p style="margin-left:170px; margin-top:20px;color:#FFFFFF;">LOREN IPSUM DOLOR SIT AMET</p></li>
	      	<li style="z-index: 1; position: absolute; display: none; list-style:none;"><h2></h2><p style="margin-left:170px; margin-top:20px;color:#FFFFFF;">LOREN IPSUM DOLOR SIT AMET</p></li>-->
	</ul>
	
	 
	<div class="clear"> &nbsp; </div>
  </div></td>
            </tr>
            <tr>
              <td><table width="800" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td height="8" colspan="2" bgcolor="#333333"></td>
                </tr>
                <tr>
                  <td width="23" class="hNmbr"><img src="images/crnr.jpg" width="23" height="36" /></td>
                  <td width="777" class="hNmbr"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td align="center"><a href="#" class="nmb"></a></td>
                        <td align="center"><a href="#" class="nmb"></a></td>
                        <td align="center"><a href="#" class="nmb"></a><a href="#" class="nmb"></a></td>
                        <td align="center"><a href="#" class="nmb"></a></td>
                        <td align="center"><a href="#" class="nmb"></a></td>
                        <td align="center"><a href="#" class="nmb"></a></td>
                        <td width="30" align="center"> </td>
                        <td align="left"></td>
                    </tr>
          </table></td>
                </tr>
                </table></td>
            </tr>
        </table>
<?php }

?>
          