<?php
//  @copyright	Copyright (C) 2008 - 2009 IceTheme. All Rights Reserved
//  @license	Copyrighted Commercial Software 
//  @author     IceTheme (icetheme.com)

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

// Include PHP files to the template
include_once(JPATH_ROOT . "/templates/" . $this->template . '/icetools/default.php');
include_once(JPATH_ROOT . "/templates/" . $this->template . '/icetools/switcher.php');

// Remove this files from the head of the template
	unset($this->_scripts[$this->baseurl . '/media/system/js/mootools.js']);
	unset($this->_scripts[$this->baseurl . '/media/system/js/caption.js']);
 
// Add this files on the head of the template 
	if($gzip == "true") :
   $this->_scripts = array_merge(array($template_baseurl . '/js/javascript.php' => 'text/javascript'), $this->_scripts);
 	else:
	$this->_scripts = array_merge(array($template_baseurl . '/js/ice-menu.js' => 'text/javascript'), $this->_scripts);
	$this->_scripts = array_merge(array($template_baseurl . '/js/mootools-compat-core.js' => 'text/javascript'), $this->_scripts);
	$this->_scripts = array_merge(array($template_baseurl . '/js/mootools-1.2-more.js' => 'text/javascript'), $this->_scripts);
	$this->_scripts = array_merge(array($template_baseurl . '/js/mootools-1.2.1-core-nc.js' => 'text/javascript'), $this->_scripts);
	endif;
	
?>

<!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" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" >

<head>

<jdoc:include type="head" />

<?php
// Include CSS variables 
include_once(JPATH_ROOT . "/templates/" . $this->template . '/css_vars.php');

// Include JavaScript variables 
include_once(JPATH_ROOT . "/templates/" . $this->template . '/js_vars.php');
?> 
  
</head>

<body class="<?php echo $FontSize; ?>">

<!-- Accessibility -->
<ol id="accessibility">
    <li><a href="#nav">Skip to Menu</a></li>
    <li><a href="#mainwrapper">Skip to Content</a></li>
    <li><a href="#footer" >Skip to Footer></a></li>
</ol>
<!-- Accessibility -->



<div class="wrapper_full" id="go_top" >
    
    <!-- Header --> 	
    <div id="header">
    
    	
       <!-- Header Top --> 
        <div id="header-top">
        
          <div class="wrapper">	
            
          		 <div id="header-top_c">
                   
          
            		<div id="header-top_l">
            			<div id="header-top_r">
                          <div class="padding">
                        
                    	<?php if ($this->params->get('rssmodule')) { ?>
                            <div id="rss-module" class="floatright">  
                                 <a title="<?php echo JText::_("RSS");?>" href="index.php?format=feed&type=rss"><span><?php echo JText::_("RSS");?></span></a>
                            </div>
                            <?php } ?>
                            
                        
                            <?php if($this->params->get('FontSwitcher')) { ?>
                             <div id="fontswitcher">
                                <ul>
                                    <li class="smallfont"><a href="<?php echo $mainurl; ?>FontSize=font-small" title="<?php echo JText::_("SMALL_FONT");?>"></a></li>
                                    <li class="normalfont"><a href="<?php echo $mainurl; ?>FontSize=font-medium" title="<?php echo JText::_("NORMAL_FONT");?>"></a></li>
                                    <li class="largefont"><a href="<?php echo $mainurl; ?>FontSize=font-large" title="<?php echo JText::_("LARGE_FONT");?>"></a></li>
                                </ul>
                             </div>
                             <?php } ?>  
                             
                               <?php if ($this->countModules('topmenu')) { ?>
                            <div class="floatright">
                                <jdoc:include type="modules" name="topmenu" />    
                            </div>    
                            <?php } ?>
                            
                         
                          </div>
 				 	   </div>
            		</div> 
                 
                 
                 </div> 
                 
 		 	</div>
                                
        </div><!-- / Header Top --> 
        
               
   		<!-- / Header Inside --> 
        <div id="header_inside">
       
            <div class="wrapper">
                       
				<?php if ($this->countModules('logo')) { ?>
                <div class="floatleft" id="logo">
                    <jdoc:include type="modules" name="logo" /> 
                </div>
                <?php } ?>
                 
                
				<?php if ($this->countModules('search')) { ?>
                <div id="searchmod" class="floatright iesearch" >
                    <jdoc:include type="modules" name="search" />    
                </div>    
                <?php } ?>
                
                 <?php if ($this->countModules('banner')) { ?>
                <div id="bannertop" class="floatright">
                    <jdoc:include type="modules" name="banner" style="icemodule" /> 
                </div>
                <?php } ?>

        	</div>
  
        </div><!-- / Header Inside --> 
        
            
	 </div><!--  / Header -->		

	<?php if ($this->countModules('mainmenu + vm_cart')) { ?>
    <div id="main-nav_wrap">
        <div id="main-nav">
            
            <jdoc:include type="modules" name="mainmenu" /> 
            
            <?php if ($this->countModules('vm_cart')) { ?>	
            		
			<?php
					if (isset($_SESSION['cart'])) $cart = $_SESSION['cart'];
					$total = 0;
					if (isset($cart)) {
						foreach($cart as $key => $item) {
							$total += $item['quantity'];
						}
					};
					if ($total > 0) $totalString = '(<strong>'.$total.'</strong> Items)';
					else $totalString = "(<strong>0</strong> Items)"; 
					
					// if ($total > 0) $hideCart = '';
					// else $hideCart = "style=\"display:none\""; 
					
					if ($total > 0) $cart = "class=\"vm_cart-full\"";
					else $cart = "";
							?>
                            
                     <div id="vm_cart" <?php echo $cart;?> >
						<a href="javascript:void(0)" id="cart-button" ><?php echo JText::_('CART').' '.$totalString; ?></a>
            		</div>
                    

                 
					
					
					<div id="ice_cart" <?php echo $hideCart;?> >								
                           
                    	<div id="cart-panel">

							<jdoc:include type="modules" name="vm_cart" style="icemodule" /> 
                            			
						</div>
                        
                    </div>
                    

            <?php } ?> 
            
            
               
        </div>        
    </div>
    <?php } ?> 
                
                
	<!-- Content --> 
    <div id="content_gradient_t">
    
		<div id="content_gradient_b">
                      
		<div id="content_t"></div>
            
        	<div id="content_shadow">
                    
            	<div id="content" class="clearfix">
                        
                	<div class="wrapper">
                    
                    	<div class="padding">
                   
                  			<div id="content_inside"> 
             
                          		<div id="content_inside_ie7">
                                    
                                  <jdoc:include type="message" />
							                                     
								<?php if ($this->countModules('breadcrumb')) { ?>
                                  <div id="breadcrumbs" class="clearfix">
                                    <jdoc:include type="modules" name="breadcrumb" />
                                </div>  
                                <?php } ?>
													
                        
                        					
									<?php if ($this->countModules('promo1 + promo2 + promo3 + promo4 + iceslideshow')) { ?>
                              		 <!-- Promo --> 	
                                    <div id="promo">
                                          
									   <?php if ($this->countModules('iceslideshow')) { ?>
                                       <jdoc:include type="modules"  name="iceslideshow" style="icemodule" /> 
                                        <span class="clearfix">&nbsp;</span>
                                        <?php } ?> 
                                         
                                        <?php if ($this->countModules('promo1')) { ?>
                                        <div class="<?php echo $promomodulewidth; ?> <?php echo $promomodsep1; ?> floatleft">
                                            <jdoc:include type="modules" name="promo1" style="block"  />
                                        </div>
                                        <?php } ?>
                                        <?php if ($this->countModules('promo2')) { ?>
                                        <div class="<?php echo $promomodulewidth; ?> <?php echo $promomodsep2; ?> floatleft">
                                            <jdoc:include type="modules" name="promo2" style="block"  />
                                        </div>
                                        <?php } ?>
                                        <?php if ($this->countModules('promo3')) { ?>
                                        <div class="<?php echo $promomodulewidth; ?> <?php echo $promomodsep3; ?> floatleft">
                                            <jdoc:include type="modules" name="promo3" style="block"  />
                                        </div>
                                        <?php } ?>
                                        <?php if ($this->countModules('promo4')) { ?>
                                        <div class="<?php echo $promomodulewidth; ?> floatleft">
                                             <jdoc:include type="modules" name="promo4" style="block"  />
                                        </div>
                                        <?php } ?>
                                        
                                    
                                    </div><!-- Promo -->     
                                    <?php } ?>  
                                    
                                    
                                         
	
                	<!-- Columns Container -->    
                    <div id="columns-container">
                            
                    	<div id="outer-column-container">
                            
                        	<div id="inner-column-container" class="clearfix">
                        
                            	<div id="source-order-container">
                                        
                                        <!-- Middle Column -->   
                                        <div id="middle-column">
                                                            
                                            <div class="inside">
                                
                                                 <?php if ($this->countModules('user1 + user2 + user3')) { ?>
                                                <div id="usertopmods">    
                                                    
                                                    <?php if ($this->countModules('user1')) { ?>
                                                    <div class="<?php echo $usertopmodwidth; ?> <?php echo $usetopmodsep1; ?> floatleft">
                                                        <jdoc:include type="modules" name="user1" style="usermodule"  />
                                                    </div>
                                                    <?php } ?>
                                                    
                                                    <?php if ($this->countModules('user2')) { ?>
                                                    <div class="<?php echo $usertopmodwidth; ?> <?php echo $usetopmodsep2; ?> floatleft">																		 													<jdoc:include type="modules" name="user2" style="usermodule"  />
                                                    </div>
                                                    <?php } ?>
                                                     
                                                    <?php if ($this->countModules('user3')) { ?>
                                                    <div class="<?php echo $usertopmodwidth; ?> floatleft">
                                                        <jdoc:include type="modules" name="user3" style="usermodule"  />
                                                    </div>
                                                    <?php } ?>
                            
                                                 </div> 
                                                 <?php } ?>
                         
                                                
                                                 <?php if ($this->countModules('inset1 + inset2 + inset3')) { ?>
                                                 <div class="floatleft" style="width:69%">
                                                 <?php } ?>
                                                    
                                                 	<jdoc:include type="component" />
                                                 
												 <?php if ($this->countModules('inset1 + inset2 + inset3')) { ?>   
                                    			 </div>
                                                 <?php } ?>
                                                 
                                                 
												 <?php if ($this->countModules('inset1 + inset2 + inset3')) { ?>   
                                                  <div class="insetmods floatright" style="width:29%">
                                                  
                                                   <?php if ($this->countModules('inset1')) { ?>
                                                    <div>
                                                        <jdoc:include type="modules" name="inset1" style="block"  />
                                                    </div>
                                                    <?php } ?>
                                                    
                                                    <?php if ($this->countModules('inset2')) { ?>
                                                    <div>
                                                        <jdoc:include type="modules" name="inset2" style="block"  />
                                                    </div>
                                                    <?php } ?>
                                                    
                                                    <?php if ($this->countModules('inset3')) { ?>
                                                    <div>
                                                        <jdoc:include type="modules" name="inset3" style="block"  />
                                                    </div>
                                                    <?php } ?>
                                                    
                                                    
                                                </div>
                                                <span class="clearfix">&nbsp;</span>
                                                <?php } ?>
                                                
                                                
                                                
                                                 
                                                 <?php if ($this->countModules('user4 + user5 + user6')) { ?>
                                                 <div id="userbottommods">    
                                                    
                                                    <?php if ($this->countModules('user4')) { ?>
                                                    <div class="<?php echo $userbottomodwidth; ?> <?php echo $userbotmodsep1; ?> floatleft">
                                                        <jdoc:include type="modules" name="user4" style="usermodule"  />
                                                    </div>
                                                    <?php } ?>
                                                    
                                                    <?php if ($this->countModules('user5')) { ?>
                                                    <div class="<?php echo $userbottomodwidth; ?> <?php echo $userbotmodsep2; ?> floatleft">
                                                        <jdoc:include type="modules" name="user5" style="usermodule"  />
                                                    </div>
                                                    <?php } ?>
                                                    
                                                    <?php if ($this->countModules('user6')) { ?>
                                                    <div class="<?php echo $userbottomodwidth; ?> <?php echo $userbotmodsep3; ?> floatleft">
                                                        <jdoc:include type="modules" name="user6" style="usermodule"  />
                                                    </div>
                                                    <?php } ?>
                                                                   
                                                 </div>            
                                                 <?php } ?>
                                                 
                                                 
                                                   <?php if ($this->countModules('icecarousel')) { ?>
                                                      <jdoc:include type="modules" name="icecarousel" style="icemodule"  />
                                                      <span class="clearfix">&nbsp;</span>
                                                    <?php } ?>
                              
                                                 
                                            </div>
                                                    
                                        </div><!-- Middle Column -->
                         
    
                                        <?php if ($this->countModules('left')) { ?>
                                        <div id="left-column">
                                                     
                                            <div class="inside">
                                                   <jdoc:include type="modules" name="left" style="colmodule"  />
                                            </div>    
                                                         
                                        </div>
                            
                                        <div class="clear-columns"></div>
                                        <?php } ?>
                     
                                    </div><!-- Source Order Container -->	
    
    
                                    <?php if ($this->countModules('right + othermenu + vm_categories')) { ?>
                                    <div id="right-column">
                                                        
                                        <div class="inside">
                                              <?php if ($this->countModules('othermenu')) { ?>
                                                      
                                                  <div class="col-module col-module-style1">
		
                                                        <div><div><div><div>
                                                        <div class="col-module_fix">                                      
           
                                                                    
                                                            <?php if($this->params->get('othermenu_title')) { ?>
                                                              <h3>
                                                                <span class="col-module_header_r">
                                                                <span class="col-module_header_l">
                                                                <span class="col-module_header_arrow">
                                                                	 <?php echo $othermenu_title ?>
                                                                      </span>
                                                                    </span>
                                                                    </span>  
                                                                </h3>
                                                        		<?php } ?>
                                                            
                                                      <div class="col-module_content">
                                                       <div id="othermenu_wrap" style="height:<?php echo $othermenu_height ?>px">
                                                            
                                                            	<jdoc:include type="modules" name="othermenu" />
                                                            </div>    
                                                  		</div>
                                                        
                                                       </div></div></div></div>  
                                                        </div>
                                                    </div>
                                               	   <?php } ?>
                                                   
                                                      
                                              <jdoc:include type="modules" name="right" style="colmodule"  />
                                                   
                                                   
                                        </div>
                                                        
                                     </div>
                                     
                                     <div class="clear-columns"></div>
                                     <?php } ?>
                                     
                                                                                        
                                </div>
                                         
                            </div>
                                    
                        </div>
                        <!-- Columns Container -->    
                    	
                        
                        <?php if ($this->countModules('bottom1 + bottom2 + bottom3 + bottom4')) { ?>
                        <!-- Bottom -->
                        <div id="bottom">
            
                                <?php if ($this->countModules('bottom1')) { ?>
                                    <div class="<?php echo $botmodwidth; ?> <?php echo $botmodsep1; ?> floatleft">
                                        <jdoc:include type="modules" name="bottom1" style="block"  />
                                    </div>
                                <?php } ?>
                                <?php if ($this->countModules('bottom2')) { ?>
                                    <div class="<?php echo $botmodwidth; ?> <?php echo $botmodsep2; ?> floatleft">
                                        <jdoc:include type="modules" name="bottom2" style="block"  />
                                    </div>
                                <?php } ?>
                                <?php if ($this->countModules('bottom3')) { ?>
                                    <div class="<?php echo $botmodwidth; ?> <?php echo $botmodsep3; ?> floatleft">
                                        <jdoc:include type="modules" name="bottom3" style="block"  />
                                    </div>
                                <?php } ?>
                                <?php if ($this->countModules('bottom4')) { ?>
                                    <div class="<?php echo $botmodwidth; ?> floatleft">
                                        <jdoc:include type="modules" name="bottom4" style="block"  />
                                    </div>
                                <?php } ?>
                                 
                        </div><!-- Bottom -->
                        <?php } ?>    
                        
                        </div> 
                                                    
					 </div> 
            		
                   </div> 
                
               </div> 
                          
           	</div>
            
        </div>   
       
       
    <div id="content_b"></div>
            
         
    </div> 
              
    </div> 
           
                             
	  <!-- Footer -->     
      <div id="footer">
            
         <div id="footer_t">
    
            
            <div class="wrapper">
            
                <div class="padding">
           	
					
					<?php if ($this->countModules('footermenu')) { ?>
                    <div id="footermenu">
            			<jdoc:include type="modules" name="footermenu" />
                    </div>
                    <?php } ?>
                    
                    <?php if ($this->countModules('footer1')) { ?>
                    <div class="<?php echo $footermodulewidth; ?> <?php echo $footermodsep1; ?> floatleft">
                        <jdoc:include type="modules" name="footer1" style="block_footer"  />
                    </div>
                    <?php } ?>
                    <?php if ($this->countModules('footer2')) { ?>
                    <div class="<?php echo $footermodulewidth; ?> <?php echo $footermodsep2; ?> floatleft">
                        <jdoc:include type="modules" name="footer2" style="block_footer"  />
                    </div>
                    <?php } ?>
                    <?php if ($this->countModules('footer3')) { ?>
                    <div class="<?php echo $footermodulewidth; ?> <?php echo $footermodsep3; ?> floatleft">
                        <jdoc:include type="modules" name="footer3" style="block_footer"  />
                    </div>
                    <?php } ?>
                    <?php if ($this->countModules('footer4')) { ?>
                    <div class="<?php echo $footermodulewidth; ?> floatleft">
                        <jdoc:include type="modules" name="footer4" style="block_footer"  />
                    </div>
                    <?php } ?>
                
 				</div>  
            
            </div>      
                
                   
                   <?php if ($this->countModules('footer') or $this->params->get('icelogo + gotop')) : ?>
                    <!-- Copyright -->  
                    <div id="copyright">
        
                      <div class="wrapper">
                      
                         <div class="padding">                         
                        
                             <jdoc:include type="modules" name="footer" />
                                           
                            <?php if($this->params->get('icelogo')) { ?>
                                 <p id="icelogo"><a href="http://www.icetheme.com"><img src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/images/icetheme.png"  alt="<?php echo JText::_("ICETHEMECOPY");?>" class="png" /></a></p>
                            <?php } ?>
                            
                            <?php if($this->params->get('gotop')) { ?>
                                 <div id="gotop"><p><a href="#go_top"><span><?php echo JText::_("GO_TOP");?></span></a></p></div>
                            <?php } ?>
                 
                        </div>
                        
                    </div>
                          
                 </div><!-- Copyright -->
             	<?php endif; ?>   
         
         </div>       
          
	</div><!-- Footer -->  
    
    
     
                    
</div><!-- Wrapper Full -->                  

<jdoc:include type="modules" name="debug" />

<?php if ($this->countModules('vm_cart')) { ?>
<div id="cart_overlay" style="visibility: hidden;">
 <img src="modules/mod_ice_vmcart/css/loader.gif" alt="loading" />  
 </div> 
 <?php } ?>           
</body>
</html>
