<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: 			*/
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | Copyright (c) 2004-2010 ARMIA INC                                    |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts VistaCart                     |
// +----------------------------------------------------------------------+
// | Authors: Jipson<jipson.thomas@armiasystems.com>             		  |
// +----------------------------------------------------------------------+
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?php echo $title_for_layout?></title>
<?php
if(isset($style)){
	echo $html->css($style); 
}else{
	echo $html->css("style"); 
}
?> 
<?php
   	echo $javascript->link('multilevelmenu.js');		
?>
<link rel="icon" href="<?php echo $this->webroot . 'favicon.ico'; ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->webroot . 'favicon.ico'; ?>" type="image/x-icon" />
<?php echo $scripts_for_layout ?> 
<?php if (isset($meta_description) && !empty($meta_description)) { ?>
    <meta name="description" content="<?php echo $meta_description; ?>" />
<?php } ?>
<?php if (isset($meta_keywords) && !empty($meta_keywords)) { ?>
    <meta name="keywords" content="<?php echo $meta_keywords; ?>" />
<?php } ?>
<script language="javascript" type="text/javascript">
function sub(){
	document.src.submit();
}
</script>
</head>
<body onload="MM_preloadImages('images/featured_items1.gif')">
<center>

	<div align="left" id="layout">
	asdsadsad
	  <div align="left" id="header">
		<!--header area start -->
				
				<div align="left" id="logo"><span class="logo"><a href="<?php echo $html->url('/index.php');?>"><?php echo $html->image('/img/SiteLogo_disp.gif', array('width' => 48, 'height' => 46, 'border' => 0));?><?php echo $cnfg["site_name"]; ?></a></span></div>
				<div align="right">
				  
				  <div align="right">
                    <!--login area start -->
                    <div align="left"><br />
                      <br />
					
                    </div>
                    <!--login area end -->
</div></div>
				
		<!--header area end -->
	  </div>
	  <div align="right" id="links_container"> <!--links area start -->
		
				<div align="center" class="links">
				  <?php if($session->check('Userlog') == false)
				{ ?>
						<a href="<?php echo $html->url('/index.php');?>" id="links_active">Home</a>
						<a href="<?php echo $html->url('/users/register');?>">Sign Up </a>
						<a href="<?php echo $html->url('/users/login');?>">Login</a>
						<a href="<?php echo FULL_BASE_URL .$cnfg["sitebasefolder"]."/Helps/userhelp";?>" target="_blank">Help</a>
			            <a href="<?php echo $html->url('/carts/show');?>"><?php echo $html->image('/img/cart.gif', array('width' => 40, 'height' => 23, 'border' => 0));?></a> </div>
		  		<?php }else{ 
				  
				?>
						<a href="<?php echo $html->url('/index.php');?>" id="links_active">Home</a>
						<a href="<?php echo $html->url('/users/myaccount');?>">My Account</a>
						<a href="<?php echo $html->url('/users/logout');?>">Logout</a>
						<a href="<?php echo FULL_BASE_URL .$cnfg["sitebasefolder"]."/Helps/userhelp";?>" target="_blank">Help</a>
			            <a href="<?php echo $html->url('/carts/show');?>"><?php echo $html->image('/img/cart.gif', array('width' => 40, 'height' => 23, 'border' => 0));?></a> </div>
				<?php } ?>
				<!--links area end -->
      </div>
	  <div id="mainbody">
		  
		
		<div align="left" id="banner_container1">
		<!--banner area start -->
				
				<div align="left" id="banner1"></div>
				
  		        <div align="left">
  		          <!--banner area end -->
                </div>
		</div>
		<div align="left" class="main_body">
		<!--mainbody area start -->
		
				<div align="left" id="body_left_area">
				<!--body left area start -->
								
				<div align="left" id="categories">
				<!--categories area start -->
				
						<div align="center" class="subheading">
						  <div align="left">Categories</div>
						</div>
						<div align="left" id="" class="sidebarmenu">
						<?php
							function generate_menu($parent,$menu_array,$siteurl)
							{
							 
									$has_childs = false;
									$pk	=	0;
									
									foreach($menu_array as $key => $value)
									{
										$parray[$pk]	=	$value['parent'];
										$pk++;
									}
									
									foreach($menu_array as $key => $value)
									{
											if ($value['parent'] == $parent)
											{      
													//if this is the first child print '<ul>'   
													if ($has_childs === false)
													{                        
							
															$has_childs = true;
															echo '<ul  id="sidebarmenu1">';
													}
													
													if(in_array($key,$parray)){
														echo '<li><a href="#" onclick="return false;">' . $value['name'] . '</a>';
													}
													else
													{
														echo '<li><a href="'.$siteurl.'/categories/show_cat/' . $value['name'] . '/">' . $value['name'] . '</a>';
													}
													generate_menu($key,$menu_array,$siteurl);                      
													echo '</li>';
											}
									}
									if ($has_childs === true) echo '</ul>';
							}
							//generate menu starting with parent categories (that have a 0 parent)			
							if(empty($menu_array)===false)				
							generate_menu(1,$menu_array,$cnfg["sitebasefolder"]);
							?>						
					</div>
				<!--categories area end -->
				</div>
				
				<!--body left area end -->
		  </div>
				<div class="bodyright" >
				<?php echo $content_for_layout ?> 
				</div>
		</div>
		<div align="left" class="float_clear">
		<?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?>
		</div>
		
		
		
	  </div>
	   <div align="left" class="copyright_area">
		<!--copyright area start -->
		
				<div align="left" id="copyright_lft">
				
				</div>
				<div align="right" id="copyright_rgt">Powered by&nbsp;<a href="http://www.iScripts.com/vistacart" target="_blank">iScripts Vistacart</a>. A premium product from <a href="http://www.iScripts.com" target="_blank">iScripts.com</a> </div>
		
		        <!--copyright area start -->
		</div>
	  
	</div>
	
	
</center>
</body>
</html>
