				<?php if(!isset($structure_only)):?>
				</div>
            </div>
        </div>
        <div class="footer">
            <div>
				Todos los derechos reservados <a href="http://xypnos.com.sv" target="_blank">Xypnos</a> &copy; 2012-<?php echo date("Y");?>
			</div>
		</div>
		<?php endif;?>
    </div>
	<audio preload="auto" id="player" autobuffer> 
	  <source src="<?php echo base_url();?>assets/sounds/alert.mp3" />
	</audio>
</div>
<script>
	$("#usuario_ventas_comisiones").click(function(e){
		e.preventDefault();
		Custombox.open({
			target:'<?php echo base_url("reportes/opciones");?>?form=comisiones', 
			effect: 'fadein',
			complete:function(){
				$(".modal-body input:text").first().focus();
			}
		});
	})

getAlertsMiracle15();
var title_page = document.title;
var alert_sound = document.getElementById('player');

setInterval(function(){
	getAlertsMiracle15();
}, 30000);

function getAlertsMiracle15(){
	$.get('<?php echo base_url();?>home/get_alerts')
	.done(function(result){                
		if(result > 0){
			$(".alerts-container-miracle").css("display","inline-block");
			$(".label-alerts-counter").text(result);
			document.title = title_page + " ("+result+")";
			/* alert_sound.play();
			toastr.options = {
			  "closeButton": true,
			  "progressBar": true,
			  "positionClass": "toast-top-right"
			}
			toastr.error("Tiene "+result+" notificaciones en el Sistema que deberia Revisar <a style='color:#FFF;font-weight:bold;' class='' onclick='getAlertsModal();' data-ref='none' href='javascript:void(0);'>[Ver Detalles]</a>");
			Push.create('Alertas Miracle', {
                body: 'Tiene alertas de Inventario que deberia revisar',
                vibrate: [200, 100, 200, 100, 200, 100, 200]
            });	 */
		}else{
			$(".alerts-container-miracle").css("display","none");
		}
	});
}

function getAlertsModal(){
	Custombox.open({
		target:'<?php echo base_url("home/notificaciones");?>?mode=create&ref=none', 
		effect: 'fadein',
		overlayClose:true,
		complete:function(){
			
		}
	});
}
</script>

<!-- Mainly scripts -->
<script src="<?php echo base_url();?>assets/js/bootstrap.js"></script>
<script src="<?php echo base_url();?>assets/js/push.min.js"></script>
<script src="<?php echo base_url();?>assets/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="<?php echo base_url();?>assets/plugins/slimscroll/jquery.slimscroll.min.js"></script>

<!-- Custom and plugin javascript -->
<script src="<?php echo base_url();?>assets/js/inspinia.js"></script>
<script src="<?php echo base_url();?>assets/js/miracle.js"></script>
<script src="<?php echo base_url();?>assets/plugins/pace/pace.min.js"></script>

<script src="<?php echo base_url();?>assets/plugins/custombox/js/custombox.min.js"></script>
<script src="<?php echo base_url();?>assets/plugins/toastr/toastr.min.js"></script>
<script src="<?php echo base_url();?>assets/plugins/sweetalert/js/sweetalert.min.js"></script>
<script src="<?php echo base_url();?>assets/plugins/jquery_hotkeys/js/jquery.hotkeys.js"></script>

<?php 
	if(isset($plugins) && count($plugins) > 0):
		foreach($plugins as $plugin):
			$plugin = (object) $plugin;
			if(isset($plugin->js)):
				foreach($plugin->js as $jsplugin):
?>
<script src="<?php echo base_url("assets/plugins")."/".$plugin->nombre."/js/".$jsplugin.".js"; ?>"></script>
<?php
				endforeach;
			endif;
		endforeach;
	endif;
?>

<?php if(isset($jsfiles) && count($jsfiles)>0): foreach($jsfiles as $jsfile):?>
<script src="<?php echo base_url("assets/js")."/".$jsfile.".js?v=070820240844"; ?>"></script>
<?php endforeach; endif;?>
</body>

</html>