<style>

/* TABLAS */
	
#tablas_switch{
	width:100%;
	height:auto;
	overflow:hidden;
	border:0px solid #000;
	position:relative;
	z-index:0;
	}


#menu_tabs{
	max-width:100%;
	height:auto;
	overflow:hidden;
	background:#6d829b;
	}
	
#menu_tabs li{
	font-family: 'Ubuntu', sans-serif !important;
	font-size:12px !important;
	list-style:none;
	width:100%;
	height:auto;
	margin-right:1px;
	background:#253c48;
	text-align:center;
	color:#CCC !important;
	cursor:pointer;
	float:left;
	opacity: 0.5;
	position:relative;
	bottom:-5px;
	filter: alpha(opacity=50); /* For IE8 and earlier */
	}
	
	
div.main{
	z-index:10;
}

#contenido_tabs{
	max-width:100%;
	height:auto;
	margin:auto;
	overflow:hidden;
	border-top:2px solid #ffbfc8;
	border-bottom:2px solid #ffbfc8;
	background:#f7f9fa;
}
	
	
.contab{
	position:relative;
	left:0;
	z-index:0;
	max-width:100%;
	height:auto;
	display:none;
	}
	
.tabla_tab div.btn_tab img{
	margin:0 5px 0 0}

	
	div.tabon{
			z-index:20;
			}
		

.active{
	display:block;
		opacity: 1.0 !important;
		filter: alpha(opacity=100) !important; /* For IE8 and earlier */
	}

#menu_tabs li.active{
	
border-bottom:0px solid #159fed;
border-top:1px solid #ffbfc8;
	font-size:12px !important;
	background:url('{$TEMPLATE_URL}/img/tab_btn_bg.png') top center no-repeat #e5455a;
	color:#fff !important;
		bottom:0px;

	
	}
	

</style>

<?php

			$query = "SELECT * FROM tablas_contenido WHERE tablas_contenido.cat = '".PAG_ID."' AND tablas_contenido.status = '1' ORDER BY tablas_contenido.menu ASC";
			$array = $engine->DB->QueryToArray($query);

?>


<div id="tablas_switch">

                                <ul id="menu_tabs">
										<? $i=0; foreach ($array as $tab): ?>
                                                    <li class="tab<?=$i?>"><?=$tab['menu_tit']?></li>
                                        <? $i++; endforeach; ?>        
                                </ul>
                                
                             
 
 								<div id="contenido_tabs">
									<? $i=0; 
                                        
                                        foreach ($array as $tab):
                                        
                                        if($tab['modulo']!=''){
                                                                        if($tab['modulo_tipo']=='full'){
                                                                            
                                                                                $modulos = $tab['modulo'];
                                                                                $modulist = explode(',', $modulos);	
                                                                                
                                                                                $i=$i;
                                                                                $tpl->assign("CONTENIDO", $tpl->fetch('string:'.$tab['contenido'.$cont_mobile]));
                                                                                
                                                                                foreach($modulist as $load_mod_cont){
                                                                                    $mod_format = preg_replace('/.php/', '', $load_mod_cont);
                                                                                    $mod_format = strtoupper($mod_format);
                                                                                    
                                                                                    $tpl->assign($mod_format, $tpl->fetch('string:'.$load_mod_cont));
                                                                                    $html.= modulo_html(MODULOS_DIR.'/'.$load_mod_cont);
                                                                                }
                                                                                
                                                                                    $contenido_ = $html;																		
                                                                                
                                                                        }
                                                                        else
                                                                        {
                                                                                load_mod($tab['modulo']);
                                                                                $contenido_ = $tab['contenido'.$cont_mobile];
                                                                        };
                                                                }else{
                                                                    $contenido_ = $tab['contenido'.$cont_mobile];
                                                                };
                            
                                        $contenido_ = $contenido_;
                                        
                                        $tpl->assign("TAB_CONTENIDO", $tpl->fetch('string:'.$contenido_));
    
                                    ?>
                                    
                                            <div class="contab" id="tab<?=$i?>">
                                                <div>
                                                        <?=$contenido_?>
                                                </div>
                                            </div>
                                    
                                    <? $i++; endforeach; ?>            
                       			</div>
</div>  


{literal}	
                    <script>
					
					var listItems = $('#menu_tabs li');
					var count = listItems.length;
					var menu_width = $('#menu_tabs').width();
					var menu_width = menu_width-count;
					var width =	menu_width/count;
					
					$('#menu_tabs li').css("width", width).css("padding", "7px 0")
					
					
					
					$(document).ready(function(){
							$('li.tab0').addClass('active');
							$("#tab0").addClass('active');
						});
						
                        
                        $('#menu_tabs li').click(function(){
							
							var tabclass = $(this).attr('class');	
							var tabid = tabclass.split('active')
													
							$('#contenido_tabs div').removeClass('active');
							$('#menu_tabs li').removeClass('active');							
							
							$('.contab').hide();
                            
							$('#'+ tabid[0]).addClass('active');
							$(this).addClass('active');	
 						 
						 	$('#'+ tabid[0]).show();
						 })
							
							
                    
                    </script>
{/literal}