
		<?php /** Begin Top **/ if ($page['top']) : ?>
		<div id="rt-top">
			<div class="rt-container">
				<div id="rt-top2">
					<?php print render($page['top']); ?>
					<div class="clear"></div>
				</div>
			</div>
		</div>
		<?php /** End Top **/ endif; ?>
		
		<div id="rt-header">
			<div class="rt-container">
				<div id="rt-header2">
					<div id="rt-header3">
						<div id="rt-header4">
							<div class="rt-grid-4 rt-alpha">
								<div class="rt-block">
									<a href="<?php echo check_url($front_page); ?>" id="rt-logo" class="png"></a>
								</div>
							</div>
							<div class="rt-grid-8 rt-omega">
								<?php /** Begin Menu **/ if($quasar_menutype != "none") : ?>
								
									<div class="_menu">
										<div class="rt-block">
											<div class="module-surround">
												<div class="module-content">
													<?php
														$tree = menu_tree_page_data('main-menu');  
														$main_menu = main_menu_tree_output($tree, 1);
													   	print $main_menu;	
													?>
												</div>
											</div>
											
										</div>
										
								    	<div class="clear"></div>
									
									</div>
									
								
								<?php /** End Menu **/ endif; ?>
							</div>
							
							<div class="clear"></div>
							<?php /** Begin Header **/ if ($page['header']) : ?>
							
								<?php print render($page['header']); ?>
								
							<?php /** End Header **/ endif; ?>
							<div class="clear"></div>
						</div>
					</div>
				</div>
			</div>
		</div>
		
		<?php /** Begin Showcase **/ if ($page['showcase']) : ?>
		<div id="rt-showcase">
			<div class="rt-container">
				<?php print render($page['showcase']); ?>
				<div class="clear"></div>
			</div>
		</div>
		<?php /** End Showcase **/ endif; ?>
		<?php /** Begin Feature **/ if ($page['feature']) : ?>
		<div id="rt-feature">
			<div class="rt-container">
				<?php print render($page['feature']); ?>
				<div class="clear"></div>
			</div>
		</div>
		<?php /** End Feature **/ endif; ?>
		<?php /** Begin Top Tab **/ if (theme_get_setting('top_tab_content') != "" ) : ?>
		<div id="rt-toptab">
			<div class="rt-container">
				<div class="rt-block">
					<div class="shadow">
						<div class="toptab">
							<span class="toptab2">
								<?php echo theme_get_setting('top_tab_content'); ?>
							</span>
						</div>
					</div>
				</div>
				
				<div class="clear"></div>
			</div>
		</div>
		<?php /** End Top Tab **/ endif; ?>
		<?php /** Begin Main Body **/ ?>
		<div id="rt-main-surround">
			<?php /** Begin Main Top **/ if ($page['maintop']) : ?>
			<div id="rt-maintop">
				<div class="rt-container">
					<?php print render($page['maintop']); ?>
					<div class="clear"></div>
				</div>
			</div>
			<?php /** End Main Top **/ endif; ?>
			<?php /** Begin Breadcrumbs **/ if (theme_get_setting('show_breadcrumb')) : ?>
			<div id="rt-breadcrumbs">
				<div class="rt-container">
					<?php print $breadcrumb; ?>
					<div class="clear"></div>
				</div>
			</div>
			<?php /** End Breadcrumbs **/ endif; ?>
			
			
			<?php /** Begin Main Body Columns **/ ?>
		    	
		    	<?php 
		    
		    		$maingrid = 12;
		    		$sidebar_count = 0;
		    		$gridClass = "";
		    		$sidegrid = "";
		    		$sidegrid2 = "";
		    		if($page['sidebar']) {$sidebar_count++;}
		    		if($page['sidebar2']) {$sidebar_count++;}
		    	
		    		
		    		if($sidebar_count == 0) {
		    			$gridClass = "mb12-sb0";
		    			$maingrid = "12";
		    		}
		    		elseif($sidebar_count==1) {
		    			$mbGrid = quasar_getMBgrid(1);
		    			$mbNumber = $mbGrid[3];
		    			$maingrid = $mbGrid[0];
		    			$sidegrid = $mbGrid[1];
		    			if($mbNumber >= 3) {
		    				$gridClass = "sa".$sidegrid."-sb"."-mb".$maingrid;
		    			}
		    			else {
		    				$gridClass = "mb".$maingrid."-sa".$sidegrid;
		    			}
		    		}	
		    		elseif($sidebar_count==2) {
		    			$mbGrid = quasar_getMBgrid(2);
		    			$mbNumber = $mbGrid[3];
		    			$maingrid = $mbGrid[0];
		    			$sidegrid = $mbGrid[1];
		    			$sidegrid2 = $mbGrid[2];
		    			if($mbNumber >= 2) {
		    				$gridClass = "sa".$sidegrid."-sb".$sidegrid2."-mb".$maingrid;
		    			}
		    			else {
		    				$gridClass = "mb".$maingrid."-sa".$sidegrid."-sb".$sidegrid2;
		    			}
		    		}
		    		
		    	    
		    	?>			
		    	
		    		<div id="rt-main" class="<?php echo $gridClass; ?>">
		    			
		    	    	<div class="rt-container">
		    	    		
		    	    		<?php if($page['sidebar'] AND (($sidebar_count==1 AND $mbNumber >= 3) OR ($sidebar_count==2 AND $mbNumber >= 2) )): ?>
		    	    			<div class="rt-grid-<?php print $sidegrid;?>">
		    						<div id="rt-sidebar-a">
		    							<?php print render($page['sidebar']); ?>
		    						</div>
		    					</div>
		    					<div class="rt-grid-<?php print $sidegrid2;?>">
		    						<div id="rt-sidebar-b">
		    							<?php print render($page['sidebar2']); ?>
		    						</div>
		    					</div>
		    	    		<?php endif; ?>
		    	    		
		    	    		<div class="rt-grid-<?php print $maingrid;?>">
		    	            	
		    	            	<?php if($page['contenttop']): ?>
		    	            	<div id="rt-content-top">
		    	            		<?php print render($page['contenttop']); ?>
		    	            		<div class="clear"></div>
		    	            	</div>
		    	            	<?php endif; ?>
		    	            	
		    	            	<div class="rt-block">
		    	               		
		    							<div class="rt-mainbody">
		    								
    										<div class="rt-joomla">
    											<!-- Begin Admin Tabs -->
												<?php if ($tabs): ?>
													<?php print render($tabs); ?>
												<?php endif; ?>
											  	<!-- End Admin Tabs -->
    										  	
    										  	<?php if ($messages AND !$is_front): ?>
    												<?php print $messages; ?><br />
    											<?php endif; ?>
    											
    											<!-- Print Section Heading -->
    											<?php if (arg(0) == 'admin' OR arg(1) == 'add' OR arg(0) == 'user') : ?>
    												<h2><?php print $title ?></h2>
    											<?php endif; ?>
    											
    											<?php if(theme_get_setting('show_home_content') OR !$is_front): ?>
    	                                        	<?php print render($page['content']); ?>
    	                                        <?php endif; ?>
    	                                    </div>
			    	                                
		    								  	
		    							</div>
		    						
		    					</div>
		    					<?php if($page['contentbottom']): ?>
		    	            	<div id="rt-content-bottom">
		    	            		<?php print render($page['contentbottom']); ?>
		    	            		<div class="clear"></div>
		    	            	</div>
		    	            	<?php endif; ?>
		    					<!-- content bottom here -->
		    				</div>
		    				
		    				<?php if($sidebar_count AND (($sidebar_count==1 AND $mbNumber < 3) OR ($sidebar_count==2 AND $mbNumber < 2) )): ?>
		    			
		    	    			<?php if($page['sidebar2']): ?>
		    	        			<div class="rt-grid-<?php print $sidegrid2;?>">
		    							<div id="rt-sidebar-b">
		    								<?php print render($page['sidebar2']); ?>
		    							</div>
		    						</div>
		    					<?php endif; ?>
		    	    			<div class="rt-grid-<?php print $sidegrid;?>">
		    						<div id="rt-sidebar-a">
		    							<?php print render($page['sidebar']); ?>
		    						</div>
		    					</div>
		    					
		    	    		<?php endif; ?>
		    				
		    			
		    		</div>	
		    		<div class="clear"></div>
		    </div>
		    
			<?php /** End Main Body Columns **/ ?>
			
			
			<?php /** Begin Main Bottom **/ if ($page['mainbottom']) : ?>
			<div id="rt-mainbottom">
				<div class="rt-container">
					<?php print render($page['mainbottom']); ?>
					<div class="clear"></div>
				</div>
			</div>
			<?php /** End Main Bottom **/ endif; ?>
		</div>
		<div class="clear"></div>
		<?php /** End Main Body **/ ?>
		<?php /** Begin Bottom Tab **/ if (theme_get_setting('bottom_tab_content') != "" and $page['bottom']) : ?>
		<div id="rt-bottomtab">
			<div class="rt-container">
				<div class="rt-block">
					<div class="bottomtab">
						<span class="bottomtab2">
							<?php echo theme_get_setting('bottom_tab_content'); ?>
						</span>
					</div>
				</div>
				
				<div class="clear"></div>
			</div>
		</div>
		<?php /** End Bottom Tab **/ endif; ?>
		<?php /** Begin Bottom **/ if ($page['bottom']) : ?>
		<div id="rt-bottom">
			<div class="rt-container">
				<?php print render($page['bottom']); ?>
				<div class="clear"></div>
			</div>
		</div>
		<?php /** End Bottom **/ endif; ?>
		<?php /** Begin Footer **/ if ($page['footer']) : ?>
		<div id="rt-footer">
			<div class="rt-container">
				<?php print render($page['footer']); ?>
				<div class="clear"></div>
			</div>
		</div>
		<?php /** End Footer **/ endif; ?>
		<?php /** Begin Copyright **/ if ($page['copyright']) : ?>
		<div id="rt-copyright">
			<div class="rt-container">
				<?php print render($page['copyright']); ?>
				<div class="clear"></div>
			</div>
		</div>
		<?php /** End Copyright **/ endif; ?>
		<?php /** Begin Debug **/ if ($page['debug']) : ?>
		<div id="rt-debug">
			<div class="rt-container">
				<?php print render($page['debug']); ?>
				<div class="clear"></div>
			</div>
		</div>
		<?php /** End Debug **/ endif; ?>
	
