<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */

  // load viewer library
  $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
  $dirsToCheck = array('','../','../../','../../../');
  foreach ($dirsToCheck as $dir)      { if (@include_once("$dir$libraryPath")) { break; }}
  if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
    
  // load records
  list($adsRecords, $adsMetaData) = getRecords(array(
    'tableName'   => 'ads',
  ));
  $adsRecord = @$adsRecords[0]; // get first record
?>
<?php	function renderItem($item,$selectedId,$numberOfSpace) 
		{				
			$result = "<div id='d" . $item['category_id'] . "'>";				
			for($i = 0; $i < $numberOfSpace; $i++) 
			{			
				$result.="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";		
			}				
			
			if($selectedId == $item['category_id']) 
			{			
				$result .= "<a id='l" . $item['category_id'] . "' class='linkcat_hightLight' href=\"index.php?cid=" . $item['category_id'] . "\" >";
			} 
			else 
			{			
				$result .= "<a id='l" . $item['category_id'] . "' class='linkcat' href=\"index.php?cid=" . $item['category_id'] . "\" >";
			}		
			
			$result .= $item['title'];		
			$result .= "</a>";				
			$numberOfSpace++;				
			if($item["subCategories"] != null && count($item["subCategories"]) != 0) 
			{	
				
				$categories_result = $item["subCategories"];	
				
				$result .= "<script>$('#d".$item['category_id']."').mouseleave(function() { return effectMenuOut(". $item['category_id'] .") });</script>";
				$result .= "<script>$('#d".$item['category_id']."').mouseenter(function() { return effectMenuOver(". $item['category_id'] .") });</script><div class='" . $item['category_id'] . "' style='display:none'>";
				

				foreach($categories_result as $subKey => $subItem)
				{				
					if($subItem['category_id'] == $selectedId) {
						$result .= "<script>$('.".$item['category_id']."').css('display','');$('#d".$item['category_id']."').unbind('mouseleave').unbind('mouseenter');;</script>";
					} 
						
					$result .= renderItem($subItem,$selectedId,$numberOfSpace);			
				}			
				$result .= "</div>";					
			}				
			
			$result .= "</div>";								
			
			return $result;	
		}


		?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy for Linux (vers 6 November 2007), see www.w3.org" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="title" content="" /><meta http-equiv="Pragma" content="cache" /><meta name="ROBOTS" content="All" /><meta http-equiv="Content-Language" content="en" /><meta name="description" content="" /><meta name="abstract" content="" /><meta name="keywords" content="" /><meta name="author" content="" /><meta name="publisher" content="" /><meta name="copyright" content="" /><meta http-equiv="Reply-to" content="" /><meta name="creation" content="" /><meta name="expires" content="" /><meta name="designer" content="" /><title>Kids'Bazaar-Shop</title>

	<link rel="stylesheet" type="text/css" href="css/style2.css" />
	<link rel="stylesheet" type="text/css" href="css/gallery.css" /> 
	<link rel="stylesheet" type="text/css" href="css/store.css" />
	<link rel="stylesheet" type="text/css" href="css/style.css" />
	
	
	
	<link href="images/slides/style.css" rel="stylesheet" type="text/css" media="screen">
	<script type="text/javascript" src="images/slides/jquery_002.js"></script>
	<script type="text/javascript" src="images/slides/jquery.js"></script>
	<script type="text/javascript" src="images/slides/scripts.js"></script>
	<link rel="stylesheet" href="css/lytebox.css" type="text/css"/>

<script type="text/javascript" src="js/lytebox.js"></script>

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-3393169-48']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
	
	<style>
html {
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
</style>
<script type="text/javascript">
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>

<script>
	function effectMenu(id) {
		var object = $("."+id);
		if(object.css("display") == "none")
			$("."+id).slideDown();
		else
			$("."+id).slideUp();
		return false;
	}
	
	function effectMenuOver(id) {
		
			var object = $("."+id);
			if(object.css("display") == "none")
				$("."+id).slideDown();
			return false;
		
	}
	
	function effectMenuOut(id) {
		
			var object = $("."+id);
			if(object.css("display") != "none")
				$("."+id).slideUp();
			return false;
		
	}
	</script>
	
	

<style>
	.submenu {
		display: none;
	}
	
</style>
</head>
<body>
<?php include("/home/kid50080/public_html/kidsbazaar.com.au/includes/ads.inc-shop.php"); ?>
<div class="content">		
<div class="content_top">
</div>
	<div class="content_middle">	<div style="float: right; padding: 15px 0 0 830px; z-index:1; position:absolute;">
		<form action="search.php" method="GET">
			<input type="text" style="padding: 1px; border: 1px solid gray; color: gray; width: 123px;" name="txtKeyword" value="Input keywords" onclick="this.select()">
			<input type="submit" value="Search"  src="images/search.png" >
		</form>
	</div>
	          <nav id="nav">
			<ul>
   			  <li><a href="../../index.php">home</a></li>
   			  <li><a href="../../about-us.php">about us</a></li>
   			  <li><a href="../../faq.php">faq</a></li>
   			  <li><a href="../../consigning.php">consigning</a></li>
   			  <li><a href="index.php">shop</a></li>
   			  <li><a href="../../contact-us.php">contact us</a></li>
            </ul>
    	  </nav>
	<table class="boxestb" border="0">			<tr>				<td class="boxestd" width="230px">					<div class="categories_top">					</div>					<div class="categories_middle">						<!--<a class="linkcat" href="#">Boys</a><br/>						<a class="linkcat" href="#">Girls</a><br/>						<a class="linkcat" href="#">Shoes</a><br/>						<a class="linkcat" href="#">Toys</a><br/>						<a class="linkcat" href="#">Accessories</a><br/>						<a class="linkcat" href="#">Babies</a><br/>-->													<?php 								$temp = 0;							?>							<?php foreach($categories_result as $key => $item){?>																<?php echo(renderItem($item,$selected_cid,0)) ?>														<?php } ?>												<p class="allproductsp"><a class="linkprod" href="index.php">All Products...</a></p>					</div>					<div class="categories_bottom">					</div>					<br/>									</td>				<td class="boxestd" width="564px">										<?php include_once ($ROOT . "$main_template"); ?>				</td>				<td class="boxestd">					<div class="yourbasket">						<!--<p class="basketext">Your Basket:</p>-->						<br/>						<p class="bstext">You have <?php echo($count_cart); ?> items in your basket</p>						<center><input type="image" alt="View cart" src="images/viewcart.png" onclick="location.href='cart.php'"/></center>					</div><br/>					<div class="newgifts">						
	<marquee direction="up" height="100%" SCROLLAMOUNT="3" onmouseover="this.stop()" onmouseout="this.start()">
	<?php foreach($result_topP as $key => $item) {?>
	<a style="text-decoration: none" href="items.php?cid=<?php echo $selected_cid; ?>&id=<?php echo $item['product_id'];?>">
		<p class="titlenewgift"><?php echo($item["name"]) ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		$<?php 
			if($item['sale_price'] == 0.00) {
				echo $item['regular_price'];
			} else {
				echo $item['sale_price'];
			}
		?>
		</p></a>								<a style="text-decoration: none" href="items.php?cid=<?php echo $selected_cid; ?>&id=<?php echo $item['product_id'];?>"><img class="imgnav" src="<?php echo $item['default_photo'];?>" alt="<?php echo($item["name"]) ?>" width="105px" border="0" /></a>								<a style="text-decoration: none" href="items.php?cid=<?php echo $selected_cid; ?>&id=<?php echo $item['product_id'];?>"><p class="newdetails">details</p></a>								</br></br></br>							<?php } ?>						</marquee>					</div>				</td>			</tr>		</table>	</div>	<div class="content_bottom">	</div><?php include("../../includes/footer.inc.php"); ?></div>
        </body></html>