1. Manuel Alejandro
  2. Sistema de Control de Actividades del POA

Commits

Manuel Alejandro  committed 31e45b2

Agregado .hgignore y se eliminaron scripts no necesarios

  • Participants
  • Parent commits b5949e4
  • Branches default

Comments (0)

Files changed (16)

File .hgignore

View file
+syntax:glob
+kernelActividades/application/config/database.php

File kernelActividades/application/controllers/home.php

View file
 		parent::Controller();    
 	}
 	
-    /*******************************************************************************/
-    /* Método encargado de cargar la vista homeView.php y pasarle el html correcto */
-    /*******************************************************************************/     
+    /**********************************************************************/
+    /* Método encargado de cargar la vista homeView.php y pasarle el html */
+    /**********************************************************************/
 	function index() {
         $data = array('html' => $this->htmlForHomeView());
 		$this->load->view('homeView', $data);
 	}
     
+    /*****************************************************/
+    /* Método encargado de construir el menú desde la BD */
+    /*****************************************************/
+    function displayMenu($parent=0){
+        $query = $this->db->query("SELECT o.id, o.nombre, hijos.count, o.menu_icon, o.href FROM opciones_menu o LEFT OUTER JOIN (SELECT parent, COUNT(*) count FROM opciones_menu GROUP BY parent) hijos ON(o.id = hijos.parent) INNER JOIN menu ON (menu.opcion_id = o.id) WHERE o.parent = ".$parent." AND menu.usuario_id = ".$this->session->userdata('id_usuario')." ORDER BY o.order");
+	    $list = ($parent == 0) ? "<ul id='m3nu'>" : "<ul id='$parent'>";
+	    foreach($query->result() as $row) {
+	        if ($row->count > 0) {
+                $list .= ($row->href != '') ? "<li id='".$row->id."'><a href='".$row->href."'>" : "<li id='".$row->id."'><a>";
+                $list .= ($row->menu_icon != "") ? "<span class='ui-icon ".$row->menu_icon." wijmo-wijmenu-icon-left'></span><span class='wijmo-wijmenu-text'>".$row->nombre."</span></a>" : $row->nombre."</a>";
+	            $list .= $this->displayMenu($row->id);
+	            $list .= "</li>";
+	        } elseif ($row->count == 0) {
+                $list .= ($row->href != '') ? "<li id='".$row->id."'><a href='".$row->href."'>" : "<li id='".$row->id."'><a>";
+                $list .= ($row->menu_icon != "") ? "<span class='ui-icon ".$row->menu_icon." wijmo-wijmenu-icon-left'></span><span class='wijmo-wijmenu-text'>".$row->nombre."</span></a></li>" : $row->nombre."</a></li>";
+            } else;
+	    }
+	    $list .= "</ul>";
+        return $list;
+    }
+    
+    /********************************************************************/
+    /* Método encargado de cargar el contenido para la pestaña [Inicio] */
+    /********************************************************************/
+    function optionInicio($flag=0){
+        $html = "<p style='text-align: center;'>
+                <img src=";
+        $html .= "'".base_url()."kernelActividades/application/views/images/logo-4-theme.png' />";
+        $html .= "<h1 align='center' class='ui-state-highlight ui-corner-all'>Sistema de Control de Actividades del POA</h1>
+                 </p>      
+                 <p style='text-align: justify;'>
+                 <b><i><center>[Descripción en construcción]</center></i></b>
+                 </p>";
+        $row = $this->atajo->getRow("SELECT * FROM opciones_menu o INNER JOIN menu ON(menu.opcion_id = o.id) WHERE o.order='0' AND o.parent = 0 AND menu.usuario_id = ".$this->session->userdata('id_usuario'));
+        if(count($row) == 0) $html .= "<div class='ui-state-error ui-corner-all'><b><i><center>[ESTE USUARIO NO TIENE ASIGNADO NINGÚN MÓDULO, NO PODRÁ REALIZAR NINGUNA OPERACIÓN.]</center></i></b></p></div>";
+        if($flag == 0) echo $html;
+        else return $html;
+    }
+    
+    /********************************************************************/
+    /* Método encargado de obtener la pestaña para cada opción del menú */
+    /********************************************************************/
+    function getTabForOption(){
+        //$textoItem = $this->input->post('textoItem');
+        $idItem = $this->input->post('idItem');
+        //        $textoItem = str_replace('_', " ", $textoItem);        
+        $row = array();
+        //        $row = $this->atajo->getRow("SELECT o.url_tab_content, o.id, o.nombre, o.tab_index, o.href FROM opciones_menu o INNER JOIN menu ON (menu.opcion_id = o.id) WHERE menu.usuario_id=".$this->session->userdata('id_usuario')." AND o.nombre='$textoItem'");
+        $row = $this->atajo->getRow("SELECT o.id, o.nombre, hijos.hijos, o.tab_index, o.href, o.url_tab_content FROM opciones_menu o LEFT OUTER JOIN (SELECT parent, COUNT(*) hijos FROM opciones_menu GROUP BY parent) hijos ON(o.id = hijos.parent) INNER JOIN menu ON (menu.opcion_id = o.id) WHERE menu.usuario_id = ".$this->session->userdata('id_usuario')." AND o.id = $idItem ORDER BY o.order");
+        echo json_encode($row);
+    }
     /********************************************************/
     /* Método encargado de cargar el html para homeView.php */
     /********************************************************/
     function htmlForHomeView(){
-        $row = $this->atajo->getRow("SELECT * FROM opciones_menu o INNER JOIN menu ON(menu.opcion_id = o.id) WHERE o.order='0' AND o.parent = 0 AND menu.usuario_id = ".$this->session->userdata('id_usuario'));
+        $row = $this->atajo->getRow("SELECT o.id, o.nombre FROM opciones_menu o INNER JOIN menu ON(menu.opcion_id = o.id) WHERE o.order='0' AND o.parent = 0 AND menu.usuario_id = ".$this->session->userdata('id_usuario'));
         $html = <<<EOF
             <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
             <head>
             <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
             <title>Sistema de Control del Plan de Inversión</title>
             <meta name="author" content="Manuel Alejandro Marquez Ortiz">
             <meta name="generator" content="Emacs http://www.gnu.org/software/emacs/">  
 EOF;
-        $html .= link_tag('kernelActividades/application/views/scripts/jquery-ui/css/pepper-grinder/jquery-ui-1.8.16.custom.css'); 
-        $html .= link_tag('kernelActividades/application/views/scripts/jqGrid/css/ui.jqgrid.css');
-        $html .= link_tag('kernelActividades/application/views/scripts/fg-menu/fg.menu.css'); 
-        $html .= link_tag('kernelActividades/application/views/scripts/style-home.css'); 
-        $html .= "
-                <script src='".base_url()."kernelActividades/application/views/scripts/jquery.js'                                   type='text/javascript'></script>
-                <script src='".base_url()."kernelActividades/application/views/scripts/jquery-ui/js/jquery-ui-1.8.16.custom.min.js' type='text/javascript'></script>
-                <script src='".base_url()."kernelActividades/application/views/scripts/jquery-ui/js/jquery.ui.datepicker-es.js'     type='text/javascript'></script>
-                <script src='".base_url()."kernelActividades/application/views/scripts/jqGrid/js/i18n/grid.locale-es.js'            type='text/javascript'></script>
-                <script src='".base_url()."kernelActividades/application/views/scripts/jqGrid/js/jquery.jqGrid.min.js'              type='text/javascript'></script>
-                <script src='".base_url()."kernelActividades/application/views/scripts/fg-menu/fg.menu.js'                          type='text/javascript'></script>
-                <script src='".base_url()."kernelActividades/application/views/scripts/jmenu.js'                                    type='text/javascript'></script>
-                <script src='".base_url()."kernelActividades/application/views/scripts/home.js'                                     type='text/javascript'></script>
-                </head>
-                <body>";
-        $html .= " <div class='ui-widget-content-cabecera ui-corner-all'><center><img src='/actividades/kernelActividades/application/views/images/cabecera.png' /><center></div>";
-        $html .= <<<EOF
-            <a tabindex="0" href="#search-engines" class="fg-button fg-button-icon-right ui-widget ui-state-default ui-corner-all" id="flyout" style="position: absolute; top: 110px; left: 20px;" ><span class="ui-icon ui-icon-triangle-1-s"></span>Menú Principal</a>
-            <button id="logout" style="position: absolute; top: 102px; right: 40px;" >Cerrar Sesión</button>
-            <!--Divs para las pestañas-->
-            <div id="tabs" style="top:43px;">
-            <ul>
-EOF;
-        $html .= (count($row) > 0) ? "<li><a href='#tab-".$row['tab_id']."'>".$row['nombre'] : "<li><a href='#tab-0'>Inicio";
-        $html .= <<<EOF
-            </a><span class="ui-icon ui-icon-close">Cerrar Tab</span></li>  
-            </ul>
-EOF;
-        $html .= (count($row) > 0) ? "<div id='tab-".$row['tab_id']."'>" : "<div id='tab-0'>";
-        $html .= <<<EOF
-            <p style="text-align: center;">
-            <img src=
-EOF;
-        $html .= "'".base_url()."kernelActividades/application/views/images/logo-4-theme.png' />";
-        $html .= <<<EOF
-            <h1 align="center" class='ui-state-highlight ui-corner-all'>Sistema de Control de Actividades del POA</h1>
-            </p>      
-            <p style="text-align: justify;">
-            <b><i><center>[Descripción en construcción]</center></i></b>
-            </p>
-            <center>
-EOF;
-        if(count($row) == 0)
-            $html .= "<div class='ui-state-error ui-corner-all'><b><i><center>[ESTE USUARIO NO TIENE ASIGNADO NINGÚN MÓDULO, NO PODRÁ REALIZAR NINGUNA OPERACIÓN.]</center></i></b></p></div>";
-        
-        $html .= <<<EOF
-            </center>
-            </div>              
-            </div>  
-            <br />
-            <br />
-            <br />
-            <div class='ui-widget-content ui-corner-all' style='font-size: small; position:0px;'>
-            <i><center class="ui-state-error ui-corner-all">Software desarrollado con tecnologías libres por la Unidad de Control de Gestión de la Gobernación del Estado Mérida.</center></i>
-EOF;
-        $html .= "<center><img src='".base_url()."kernelActividades/application/views/images/buttongnugpl.png'/><img src='".
-            base_url()."kernelActividades/application/views/images/php-power-micro.png'/><img src='".
-            base_url()."kernelActividades/application/views/images/postgresql.png'/><img src='".
-            base_url()."kernelActividades/application/views/images/jquery-icon.png'/><img src='".
-            base_url()."kernelActividades/application/views/images/apache.png'/><img src='".
-            base_url()."kernelActividades/application/views/images/firefox.png'/><img src='".
-            base_url()."kernelActividades/application/views/images/gimp.png'/></center>";
-        $html .= <<<EOF
-            </div>
-            </body>
-            </html>
-EOF;
-       
+        $html .= link_tag('kernelActividades/application/external/jquery-ui-1.8.17.custom/css/pepper-grinder/jquery-ui-1.8.17.custom.css'); 
+        $html .= link_tag('kernelActividades/application/external/wijmo-open-2.0/css/jquery.wijmo-open.2.0.0.css');
+        $html .= link_tag('kernelActividades/application/views/scripts/style-home.css');
+        $html .= "<script src='".base_url()."kernelActividades/application/external/jquery-ui-1.8.17.custom/js/jquery-1.7.1.min.js' type='text/javascript'></script>
+                 <script src='".base_url()."kernelActividades/application/external/jquery-ui-1.8.17.custom/js/jquery-ui-1.8.17.custom.min.js' type='text/javascript'></script>
+                 <script src='".base_url()."kernelActividades/application/external/wijmo-open-2.0/js/jquery.wijmo-open.all.2.0.0.min.js' type='text/javascript'></script>
+                 <script src='".base_url()."kernelActividades/application/views/scripts/home.js' type='text/javascript'></script>
+                 </head>
+                 <body>
+                 <div class='ui-widget-content ui-corner-all' style='margin-bottom:20px;'>
+                 <center><img src='/actividades/kernelActividades/application/views/images/cabecera.png' /><center>
+                 </div>";
+        $html .= $this->displayMenu();
+        $html .= "<!--Divs para las pestañas-->
+                 <div id='tabs' style='margin-top:1px;'>
+                 <ul>";
+        $html .= (count($row) > 0) ? "<li><a href='#tab-".$row['id']."'>".$row['nombre'] : "<li><a href='#tab-inicio'>Inicio";
+        $html .= "</a><span class='ui-icon ui-icon-close'>Cerrar Pestaña</span></li></ul>";
+        $html .= (count($row) > 0) ? "<div id='tab-".$row['id']."'>" : "<div id='tab-inicio'>";
+        $html .= $this->optionInicio(1);
+        $html .= "</div>
+                 </div>  
+                 <br />
+                 <div class='ui-widget-content ui-corner-all' style='font-size: small; position:0px;'>
+                 <i><center class='ui-state-highlight ui-corner-all'>
+                 Software desarrollado con tecnologías libres por la Unidad de Control de Gestión de la Gobernación del Estado Mérida.</center></i>
+                 <center><img src='".base_url()."kernelActividades/application/views/images/buttongnugpl.png'/><img src='".
+                 base_url()."kernelActividades/application/views/images/php-power-micro.png'/><img src='".
+                 base_url()."kernelActividades/application/views/images/postgresql.png'/><img src='".
+                 base_url()."kernelActividades/application/views/images/jquery-icon.png'/><img src='".
+                 base_url()."kernelActividades/application/views/images/apache.png'/><img src='".
+                 base_url()."kernelActividades/application/views/images/firefox.png'/><img src='".
+                 base_url()."kernelActividades/application/views/images/gimp.png'/></center>
+                 </div>
+                 </body>
+                 </html>";
         return $html;
     }
 

File kernelActividades/application/controllers/login.php

View file
     /****************************************************/ 
     function logout(){
         $this->atajo->logout();
-        $this->load->view('loginView');
+        //$this->load->view('loginView');
+        redirect('login');
     }
 }
 ?>

File kernelActividades/application/controllers/options_menu.php

-<?php
-
-/********************************************************************************************************************/
-/* Controller creado para que haga todo el trabajo de automatización de las opciones del menú por nivel de usuario. */
-/********************************************************************************************************************/
-
-class Options_menu extends Controller{    
-
-    /***************************/
-    /* Constructor de la clase */
-    /***************************/
-    function __construct(){
-        parent::Controller();
-    }
-    
-    /*******************************************************************************************************************************************************/
-    /* Método encargado de darle al script <application/views/scripts/fg-menu/fg.menu.js> los datos necesarios para que carge la pestaña correspondiente   */
-    /*******************************************************************************************************************************************************/
-    function getTabForOption($textoItem){
-        $textoItem = str_replace('_', " ", $textoItem);        
-        $row = $this->atajo->getRow("SELECT o.url_tab_content, o.tab_id, o.nombre FROM opciones_menu o INNER JOIN menu ON (menu.opcion_id = o.id) WHERE menu.usuario_id=".$this->session->userdata('id_usuario')." AND o.nombre='$textoItem'");
-        $tabForOption = (count($row) > 0) ? $row['url_tab_content'].'-'.$row['tab_id'] : $tabForOption = 'false';
-        echo $tabForOption;
-    }
-    
-    /******************************************************************************************************/
-    /* Este método hace el trabajo de mostrar los hijos de cada menú padre de acuerdo al usuario logeado. */
-    /******************************************************************************************************/
-    function displayChildren($parent){
-        $query = $this->db->query("SELECT o.id, o.nombre, hijos.count FROM opciones_menu o LEFT OUTER JOIN (SELECT parent, COUNT(*) count FROM opciones_menu GROUP BY parent) hijos ON(o.id = hijos.parent) INNER JOIN menu ON (menu.opcion_id = o.id) WHERE o.parent = 0".$parent." AND menu.usuario_id = ".$this->session->userdata('id_usuario')." ORDER BY o.order");
-	    $list = <<<EOF
-            <ul>
-EOF;
-	    foreach($query->result() as $row) {
-	        if ($row->count > 0) {
-	            $list .= <<<EOF
-                    <li><a href="#">$row->nombre</a>
-EOF;
-	            $list .= $this->displayChildren($row->id);
-	            $list .= <<<EOF
-                    </li>
-EOF;
-	        } elseif ($row->count == 0) {
-	            $list .= <<<EOF
-                    <li><a href="#">$row->nombre</a></li>
-EOF;
-	        } else;
-	    }
-	    $list .= <<<EOF
-            </ul>
-EOF;
-        return $list;
-    }
-
-    /****************************************************************/
-    /* Método encargado de agregar el html para el menú del usuario */
-    /****************************************************************/
-    function getOptionsForMenuByLevel(){
-        $html = <<<EOF
-            <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
-            <html lang="en">
-            <head>
-            <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-            <title>menu</title>
-            <meta name="generator" content="Emacs http://www.gnu.org/software/emacs/">
-            <meta name="author" content="Manuel Alejandro Marquez Ortiz">
-            <!-- Date: 2011-10-26 -->
-            </head>
-            <body>
-EOF;
-        $html .= $this->displayChildren(0);
-        $html .= <<<EOF
-            </body>
-            </html>
-EOF;
-        echo $html;
-    }
-
-    /*******************************************************************************/
-    /* Método encargado de enviar el contenido html de la opción <Inicio> del menú */
-    /*******************************************************************************/
-    function optionInicio(){
-        $html = <<<EOF
-            <p style="text-align: center;">
-            <img src=
-EOF;
-        $html .= "'".base_url()."kernelActividades/application/views/images/logo-4-theme.png' />";
-        $html .= <<<EOF
-            <h1 align="center" class='ui-state-highlight ui-corner-all'>Sistema de Control de Actividades del POA</h1>
-            </p>      
-            <p style="text-align: justify;">
-            <b><i><center>[Descripción en construcción]</center></i></b>
-            </p>
-            <center>
-EOF;
-        $row = $this->atajo->getRow("SELECT * FROM opciones_menu o INNER JOIN menu ON(menu.opcion_id = o.id) WHERE o.order='0' AND o.parent = 0 AND menu.usuario_id = ".$this->session->userdata('id_usuario'));
-        if(count($row) == 0)
-            $html .= "<div class='ui-state-error ui-corner-all'><b><i><center>[ESTE USUARIO NO TIENE ASIGNADO NINGÚN MÓDULO, NO PODRÁ REALIZAR NINGUNA OPERACIÓN.]</center></i></b></p></div>";
-        $html .= "</center>";
-        echo $html;
-    }
-
-}
-?>

File kernelActividades/application/views/images/cabecera.png

Old
Old image
New
New image

File kernelActividades/application/views/scripts/fg-menu/fg.menu.css

-/* Styles for jQuery menu widget
-Author:	Maggie Wachs, maggie@filamentgroup.com
-Date:		September 2008
-*/
-
-
-/* REQUIRED STYLES - the menus will only render correctly with these rules */	
-
-.fg-menu-container { position: absolute; top:0; left:-999px; padding: .4em;  overflow: hidden; }
-.fg-menu-container.fg-menu-flyout { overflow: visible; }
-
-.fg-menu, .fg-menu ul { list-style-type:none; padding: 0; margin:0; }
-
-.fg-menu { position:relative; }
-.fg-menu-flyout .fg-menu { position:static; }
-
-.fg-menu ul { position:absolute; top:0; }
-.fg-menu ul ul { top:-1px; }
-
-.fg-menu-container.fg-menu-ipod .fg-menu-content, 
-.fg-menu-container.fg-menu-ipod .fg-menu-content ul { background: none !important; }
-
-.fg-menu.fg-menu-scroll,
-.fg-menu ul.fg-menu-scroll { overflow: scroll;  overflow-x: hidden; }
-
-.fg-menu li { clear:both; float:left; width:100%; margin: 0; padding:0; border: 0; }	
-.fg-menu li li { font-size:1em; } /* inner li font size must be reset so that they don't blow up */
-
-.fg-menu-flyout ul ul { padding: .4em; }
-.fg-menu-flyout li { position:relative; }
-
-.fg-menu-scroll { overflow: scroll; overflow-x: hidden; }
-
-.fg-menu-breadcrumb { margin: 0; padding: 0; }
-
-.fg-menu-footer {  margin-top: .4em; padding: .4em; }
-.fg-menu-header {  margin-bottom: .4em; padding: .4em; }
-
-.fg-menu-breadcrumb li { float: left; list-style: none; margin: 0; padding: 0 .2em; font-size: .9em; opacity: .7; }
-.fg-menu-breadcrumb li.fg-menu-prev-list,
-.fg-menu-breadcrumb li.fg-menu-current-crumb { clear: left; float: none; opacity: 1; }
-.fg-menu-breadcrumb li.fg-menu-current-crumb { padding-top: .2em; }
-
-.fg-menu-breadcrumb a, 
-.fg-menu-breadcrumb span { float: left; }
-
-.fg-menu-footer a:link,
-.fg-menu-footer a:visited { float:left; width:100%; text-decoration: none; }
-.fg-menu-footer a:hover,
-.fg-menu-footer a:active {  }
-
-.fg-menu-footer a span { float:left; cursor: pointer; }
-
-.fg-menu-breadcrumb .fg-menu-prev-list a:link,
-.fg-menu-breadcrumb .fg-menu-prev-list a:visited,
-.fg-menu-breadcrumb .fg-menu-prev-list a:hover,
-.fg-menu-breadcrumb .fg-menu-prev-list a:active { background-image: none; text-decoration:none; }
-	
-.fg-menu-breadcrumb .fg-menu-prev-list a { float: left; padding-right: .4em; }
-.fg-menu-breadcrumb .fg-menu-prev-list a .ui-icon { float: left; }
-	
-.fg-menu-breadcrumb .fg-menu-current-crumb a:link,
-.fg-menu-breadcrumb .fg-menu-current-crumb a:visited,
-.fg-menu-breadcrumb .fg-menu-current-crumb a:hover,
-.fg-menu-breadcrumb .fg-menu-current-crumb a:active { display:block; background-image:none; font-size:1.3em; text-decoration:none; }
-
-
-
-/* REQUIRED LINK STYLES: links are "display:block" by default; if the menu options are split into 
-	selectable node links and 'next' links, the script floats the node links left and floats the 'next' links to the right	*/
-
-.fg-menu a:link,
-.fg-menu a:visited,
-.fg-menu a:hover,
-.fg-menu a:active { float:left; width:92%; padding:.3em 3%; text-decoration:none; outline: 0 !important; }
-
-.fg-menu a { border: 1px dashed transparent; }
-
-.fg-menu a.ui-state-default:link,
-.fg-menu a.ui-state-default:visited,
-.fg-menu a.ui-state-default:hover,
-.fg-menu a.ui-state-default:active,
-.fg-menu a.ui-state-hover:link,
-.fg-menu a.ui-state-hover:visited,
-.fg-menu a.ui-state-hover:hover,
-.fg-menu a.ui-state-hover:active,
- .fg-menu a.ui-state-active:link,
- .fg-menu a.ui-state-active:visited,
- .fg-menu a.ui-state-active:hover,
-.fg-menu a.ui-state-active:active { border-style: solid; font-weight: normal; }
-
-.fg-menu a span { display:block; cursor:pointer; }
-
-
- /* SUGGESTED STYLES - for use with jQuery UI Themeroller CSS */	
- 
-.fg-menu-indicator span { float:left; }
-.fg-menu-indicator span.ui-icon { float:right; }
-
-.fg-menu-content.ui-widget-content, 
-.fg-menu-content ul.ui-widget-content { border:0; }
-
-
-/* ICONS AND DIVIDERS */
-
-.fg-menu.fg-menu-has-icons a:link,
-.fg-menu.fg-menu-has-icons a:visited,
-.fg-menu.fg-menu-has-icons a:hover,
-.fg-menu.fg-menu-has-icons a:active { padding-left:20px; }
-
-.fg-menu .horizontal-divider hr, .fg-menu .horizontal-divider span { padding:0; margin:5px .6em; }
-.fg-menu .horizontal-divider hr { border:0; height:1px; }
-.fg-menu .horizontal-divider span { font-size:.9em; text-transform: uppercase; padding-left:.2em; }
-

File kernelActividades/application/views/scripts/fg-menu/fg.menu.js

-/*-------------------------------------------------------------------- 
-Scripts for creating and manipulating custom menus based on standard <ul> markup
-Version: 3.0, 03.31.2009
-
-By: Maggie Costello Wachs (maggie@filamentgroup.com) and Scott Jehl (scott@filamentgroup.com)
-	http://www.filamentgroup.com
-	* reference articles: http://www.filamentgroup.com/lab/jquery_ipod_style_drilldown_menu/
-		
-Copyright (c) 2009 Filament Group
-Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses.
---------------------------------------------------------------------*/
-
-
-var allUIMenus = [];
-
-$.fn.menu = function(options){
-	var caller = this;
-	var options = options;
-	var m = new Menu(caller, options);	
-	allUIMenus.push(m);
-	
-	$(this)
-	.mousedown(function(){
-		if (!m.menuOpen) { m.showLoading(); };
-	})	
-	.click(function(){
-		if (m.menuOpen == false) { m.showMenu(); }
-		else { m.kill(); };
-		return false;
-	});	
-};
-
-
-function Menu(caller, options){
-  var textoItem = '';
-    integration(textoItem);  
-  
-	var menu = this;
-	var caller = $(caller);
-	var container = $('<div class="fg-menu-container ui-widget ui-widget-content ui-corner-all">'+options.content+'</div>');
-	
-	this.menuOpen = false;
-	this.menuExists = false;
-	
-	var options = jQuery.extend({
-		content: null,
-		width: 180, // width of menu container, must be set or passed in to calculate widths of child menus
-		maxHeight: 180, // max height of menu (if a drilldown: height does not include breadcrumb)
-		positionOpts: {
-			posX: 'left', 
-			posY: 'bottom',
-			offsetX: 0,
-			offsetY: 0,
-			directionH: 'right',
-			directionV: 'down', 
-			detectH: true, // do horizontal collision detection  
-			detectV: false, // do vertical collision detection
-			linkToFront: false
-		},
-		showSpeed: 200, // show/hide speed in milliseconds
-		callerOnState: 'ui-state-active', // class to change the appearance of the link/button when the menu is showing
-		loadingState: 'ui-state-loading', // class added to the link/button while the menu is created
-		linkHover: 'ui-state-hover', // class for menu option hover state
-		linkHoverSecondary: 'li-hover', // alternate class, may be used for multi-level menus		
-	// ----- multi-level menu defaults -----
-		crossSpeed: 200, // cross-fade speed for multi-level menus
-		crumbDefaultText: 'Choose an option:',
-		backLink: true, // in the ipod-style menu: instead of breadcrumbs, show only a 'back' link
-		backLinkText: 'Back',
-		flyOut: false, // multi-level menus are ipod-style by default; this parameter overrides to make a flyout instead
-		flyOutOnState: 'ui-state-default',
-		nextMenuLink: 'ui-icon-triangle-1-e', // class to style the link (specifically, a span within the link) used in the multi-level menu to show the next level
-		topLinkText: 'All',
-		nextCrumbLink: 'ui-icon-carat-1-e'	
-	}, options);
-	
-	var killAllMenus = function(){
-		$.each(allUIMenus, function(i){
-			if (allUIMenus[i].menuOpen) { allUIMenus[i].kill(); };	
-		});
-	};
-	
-	this.kill = function(){
-		caller
-			.removeClass(options.loadingState)
-			.removeClass('fg-menu-open')
-			.removeClass(options.callerOnState);	
-		container.find('li').removeClass(options.linkHoverSecondary).find('a').removeClass(options.linkHover);		
-		if (options.flyOutOnState) { container.find('li a').removeClass(options.flyOutOnState); };	
-		if (options.callerOnState) { 	caller.removeClass(options.callerOnState); };			
-		if (container.is('.fg-menu-ipod')) { menu.resetDrilldownMenu(); };
-		if (container.is('.fg-menu-flyout')) { menu.resetFlyoutMenu(); };	
-		container.parent().hide();	
-		menu.menuOpen = false;
-		$(document).unbind('click', killAllMenus);
-		$(document).unbind('keydown');
-	};
-	
-	this.showLoading = function(){
-		caller.addClass(options.loadingState);
-	};
-
-	this.showMenu = function(){
-		killAllMenus();
-		if (!menu.menuExists) { menu.create() };
-		caller
-			.addClass('fg-menu-open')
-			.addClass(options.callerOnState);
-		container.parent().show().click(function(){ menu.kill(); return false; });
-		container.hide().slideDown(options.showSpeed).find('.fg-menu:eq(0)');
-		menu.menuOpen = true;
-		caller.removeClass(options.loadingState);
-		$(document).click(killAllMenus);
-		
-		// assign key events
-		$(document).keydown(function(event){
-			var e;
-			if (event.which !="") { e = event.which; }
-			else if (event.charCode != "") { e = event.charCode; }
-			else if (event.keyCode != "") { e = event.keyCode; }
-			
-			var menuType = ($(event.target).parents('div').is('.fg-menu-flyout')) ? 'flyout' : 'ipod' ;
-			
-			switch(e) {
-				case 37: // left arrow 
-					if (menuType == 'flyout') {
-						$(event.target).trigger('mouseout');
-						if ($('.'+options.flyOutOnState).size() > 0) { $('.'+options.flyOutOnState).trigger('mouseover'); };
-					};
-					
-					if (menuType == 'ipod') {
-						$(event.target).trigger('mouseout');
-						if ($('.fg-menu-footer').find('a').size() > 0) { $('.fg-menu-footer').find('a').trigger('click'); };
-						if ($('.fg-menu-header').find('a').size() > 0) { $('.fg-menu-current-crumb').prev().find('a').trigger('click'); };
-						if ($('.fg-menu-current').prev().is('.fg-menu-indicator')) {
-							$('.fg-menu-current').prev().trigger('mouseover');							
-						};						
-					};
-					return false;
-					break;
-					
-				case 38: // up arrow 
-					if ($(event.target).is('.' + options.linkHover)) {	
-						var prevLink = $(event.target).parent().prev().find('a:eq(0)');						
-						if (prevLink.size() > 0) {
-							$(event.target).trigger('mouseout');
-							prevLink.trigger('mouseover');
-						};						
-					}
-					else { container.find('a:eq(0)').trigger('mouseover'); }
-					return false;
-					break;
-					
-				case 39: // right arrow 
-					if ($(event.target).is('.fg-menu-indicator')) {						
-						if (menuType == 'flyout') {
-							$(event.target).next().find('a:eq(0)').trigger('mouseover');
-						}
-						else if (menuType == 'ipod') {
-							$(event.target).trigger('click');						
-							setTimeout(function(){
-								$(event.target).next().find('a:eq(0)').trigger('mouseover');
-							}, options.crossSpeed);
-						};				
-					}; 
-					return false;
-					break;
-					
-				case 40: // down arrow 
-					if ($(event.target).is('.' + options.linkHover)) {
-						var nextLink = $(event.target).parent().next().find('a:eq(0)');						
-						if (nextLink.size() > 0) {							
-							$(event.target).trigger('mouseout');
-							nextLink.trigger('mouseover');
-						};				
-					}
-					else { container.find('a:eq(0)').trigger('mouseover'); }		
-					return false;						
-					break;
-					
-				case 27: // escape
-					killAllMenus();
-					break;
-					
-				case 13: // enter
-					if ($(event.target).is('.fg-menu-indicator') && menuType == 'ipod') {							
-						$(event.target).trigger('click');						
-						setTimeout(function(){
-							$(event.target).next().find('a:eq(0)').trigger('mouseover');
-						}, options.crossSpeed);					
-					}; 
-					break;
-			};			
-		});
-	};
-	
-	this.create = function(){	
-		container.css({ width: options.width }).appendTo('body').find('ul:first').not('.fg-menu-breadcrumb').addClass('fg-menu');
-		container.find('ul, li a').addClass('ui-corner-all');
-		
-		// aria roles & attributes
-		container.find('ul').attr('role', 'menu').eq(0).attr('aria-activedescendant','active-menuitem').attr('aria-labelledby', caller.attr('id'));
-		container.find('li').attr('role', 'menuitem');
-		container.find('li:has(ul)').attr('aria-haspopup', 'true').find('ul').attr('aria-expanded', 'false');
-		container.find('a').attr('tabindex', '-1');
-		
-		// when there are multiple levels of hierarchy, create flyout or drilldown menu
-		if (container.find('ul').size() > 1) {
-			if (options.flyOut) { menu.flyout(container, options); }
-			else { menu.drilldown(container, options); }	
-		}
-		else {
-			container.find('a').click(function(){
-				menu.chooseItem(this);
-				return false;
-			});
-		};	
-		
-		if (options.linkHover) {
-			var allLinks = container.find('.fg-menu li a');
-			allLinks.hover(
-				function(){
-					var menuitem = $(this);
-					$('.'+options.linkHover).removeClass(options.linkHover).blur().parent().removeAttr('id');
-					$(this).addClass(options.linkHover).focus().parent().attr('id','active-menuitem');
-				},
-				function(){
-					$(this).removeClass(options.linkHover).blur().parent().removeAttr('id');
-				}
-			);
-		};
-		
-		if (options.linkHoverSecondary) {
-			container.find('.fg-menu li').hover(
-				function(){
-					$(this).siblings('li').removeClass(options.linkHoverSecondary);
-					if (options.flyOutOnState) { $(this).siblings('li').find('a').removeClass(options.flyOutOnState); }
-					$(this).addClass(options.linkHoverSecondary);
-				},
-				function(){ $(this).removeClass(options.linkHoverSecondary); }
-			);
-		};	
-		
-		menu.setPosition(container, caller, options);
-		menu.menuExists = true;
-	};
-	
-	this.chooseItem = function(item){	  
-		menu.kill();
-		// edit this for your own custom function/callback:
-		$('#menuSelection').text($(item).text());
-		var textoItem = $(item).text();
-		integration(textoItem);
-		location.href = $(item).attr('href');
-	};
-	
-    function integration(textoItem){
-        if(textoItem == ''){
-            var $tabs = $('#tabs').tabs({
-                selected:0,	
-                add: function(event, ui) {            
-                    $tabs.tabs('select', '#' + ui.panel.id);          
-                },
-                fx: { opacity: 'toggle', duration: 'fast' }
-            });
-            
-            // close icon: removing the tab on click        
-            $('#tabs span.ui-icon-close').live('click', function() {
-                var index = $('li',$tabs).index($(this).parent());  
-                $tabs.tabs('remove', index);
-            });
-            $tabs.find(".ui-tabs-nav").sortable({axis:'x'});
-        }
-        else{
-            $.ajax({
-		type: 'POST',
-		processData:false,
-		async:false,
-		url: 'options_menu/getTabForOption/'+textoItem,		  
-		success:  function(resultado){			  
-                    return tabForOption=resultado;        
-                }
-            });
-            if(tabForOption != 'false'){
-                tabForOptionArray = tabForOption.split('-');
-                var $tabs = $('#tabs').tabs({
-                    tabTemplate: '<li><a href="#{href}">#{label}</a><span class="ui-icon ui-icon-close">Cerrar Tab</span></li>',
-                    add: function(event, ui){
-	                $.post(tabForOptionArray[0],{},function(contenido){
-		            var tabContenido = contenido; 
-		            $(ui.panel).append(tabContenido);
-		            $tabs.tabs('select', '#' + ui.panel.id);                       
-	                });           
-                    }         
-                });                                                              
-                
-                if ($('#tab-'+tabForOptionArray[1]).text() == ''){
-                    var tab_title = textoItem;
-                    $tabs.tabs('add', '#tab-'+tabForOptionArray[1], tab_title);  
-                }
-                else
-                    $tabs.tabs('select', '#tab-'+tabForOptionArray[1]);                                    
-            }
-        }
-    }
-};
-
-
-
-Menu.prototype.flyout = function(container, options) {
-	var menu = this;
-	
-	this.resetFlyoutMenu = function(){
-		var allLists = container.find('ul ul');
-		allLists.removeClass('ui-widget-content').hide();	
-	};
-	
-	container.addClass('fg-menu-flyout').find('li:has(ul)').each(function(){
-		var linkWidth = container.width();
-		var showTimer, hideTimer;
-		var allSubLists = $(this).find('ul');		
-		
-		allSubLists.css({ left: linkWidth, width: linkWidth }).hide();
-			
-		$(this).find('a:eq(0)').addClass('fg-menu-indicator').html('<span>' + $(this).find('a:eq(0)').text() + '</span><span class="ui-icon '+options.nextMenuLink+'"></span>').hover(
-			function(){
-				clearTimeout(hideTimer);
-				var subList = $(this).next();
-				if (!fitVertical(subList, $(this).offset().top)) { subList.css({ top: 'auto', bottom: 0 }); };
-				if (!fitHorizontal(subList, $(this).offset().left + 100)) { subList.css({ left: 'auto', right: linkWidth, 'z-index': 999 }); };
-				showTimer = setTimeout(function(){
-					subList.addClass('ui-widget-content').show(options.showSpeed).attr('aria-expanded', 'true');	
-				}, 300);	
-			},
-			function(){
-				clearTimeout(showTimer);
-				var subList = $(this).next();
-				hideTimer = setTimeout(function(){
-					subList.removeClass('ui-widget-content').hide(options.showSpeed).attr('aria-expanded', 'false');
-				}, 400);	
-			}
-		);
-
-		$(this).find('ul a').hover(
-			function(){
-				clearTimeout(hideTimer);
-				if ($(this).parents('ul').prev().is('a.fg-menu-indicator')) {
-					$(this).parents('ul').prev().addClass(options.flyOutOnState);
-				}
-			},
-			function(){
-				hideTimer = setTimeout(function(){
-					allSubLists.hide(options.showSpeed);
-					container.find(options.flyOutOnState).removeClass(options.flyOutOnState);
-				}, 500);	
-			}
-		);	
-	});
-	
-	container.find('a').click(function(){
-		menu.chooseItem(this);
-		return false;
-	});
-};
-
-
-Menu.prototype.drilldown = function(container, options) {
-	var menu = this;	
-	var topList = container.find('.fg-menu');	
-	var breadcrumb = $('<ul class="fg-menu-breadcrumb ui-widget-header ui-corner-all ui-helper-clearfix"></ul>');
-	var crumbDefaultHeader = $('<li class="fg-menu-breadcrumb-text">'+options.crumbDefaultText+'</li>');
-	var firstCrumbText = (options.backLink) ? options.backLinkText : options.topLinkText;
-	var firstCrumbClass = (options.backLink) ? 'fg-menu-prev-list' : 'fg-menu-all-lists';
-	var firstCrumbLinkClass = (options.backLink) ? 'ui-state-default ui-corner-all' : '';
-	var firstCrumbIcon = (options.backLink) ? '<span class="ui-icon ui-icon-triangle-1-w"></span>' : '';
-	var firstCrumb = $('<li class="'+firstCrumbClass+'"><a href="#" class="'+firstCrumbLinkClass+'">'+firstCrumbIcon+firstCrumbText+'</a></li>');
-	
-	container.addClass('fg-menu-ipod');
-	
-	if (options.backLink) { breadcrumb.addClass('fg-menu-footer').appendTo(container).hide(); }
-	else { breadcrumb.addClass('fg-menu-header').prependTo(container); };
-	breadcrumb.append(crumbDefaultHeader);
-	
-	var checkMenuHeight = function(el){
-		if (el.height() > options.maxHeight) { el.addClass('fg-menu-scroll') };	
-		el.css({ height: options.maxHeight });
-	};
-	
-	var resetChildMenu = function(el){ el.removeClass('fg-menu-scroll').removeClass('fg-menu-current').height('auto'); };
-	
-	this.resetDrilldownMenu = function(){
-		$('.fg-menu-current').removeClass('fg-menu-current');
-		topList.animate({ left: 0 }, options.crossSpeed, function(){
-			$(this).find('ul').each(function(){
-				$(this).hide();
-				resetChildMenu($(this));				
-			});
-			topList.addClass('fg-menu-current');			
-		});		
-		$('.fg-menu-all-lists').find('span').remove();	
-		breadcrumb.empty().append(crumbDefaultHeader);		
-		$('.fg-menu-footer').empty().hide();	
-		checkMenuHeight(topList);		
-	};
-	
-	topList
-		.addClass('fg-menu-content fg-menu-current ui-widget-content ui-helper-clearfix')
-		.css({ width: container.width() })
-		.find('ul')
-			.css({ width: container.width(), left: container.width() })
-			.addClass('ui-widget-content')
-			.hide();		
-	checkMenuHeight(topList);	
-	
-	topList.find('a').each(function(){
-		// if the link opens a child menu:
-		if ($(this).next().is('ul')) {
-			$(this)
-				.addClass('fg-menu-indicator')
-				.each(function(){ $(this).html('<span>' + $(this).text() + '</span><span class="ui-icon '+options.nextMenuLink+'"></span>'); })
-				.click(function(){ // ----- show the next menu			
-					var nextList = $(this).next();
-		    		var parentUl = $(this).parents('ul:eq(0)');   		
-		    		var parentLeft = (parentUl.is('.fg-menu-content')) ? 0 : parseFloat(topList.css('left'));    		
-		    		var nextLeftVal = Math.round(parentLeft - parseFloat(container.width()));
-		    		var footer = $('.fg-menu-footer');
-		    		
-		    		// show next menu   		
-		    		resetChildMenu(parentUl);
-		    		checkMenuHeight(nextList);
-					topList.animate({ left: nextLeftVal }, options.crossSpeed);						
-		    		nextList.show().addClass('fg-menu-current').attr('aria-expanded', 'true');    
-		    		
-		    		var setPrevMenu = function(backlink){
-		    			var b = backlink;
-		    			var c = $('.fg-menu-current');
-			    		var prevList = c.parents('ul:eq(0)');
-			    		c.hide().attr('aria-expanded', 'false');
-		    			resetChildMenu(c);
-		    			checkMenuHeight(prevList);
-			    		prevList.addClass('fg-menu-current').attr('aria-expanded', 'true');
-			    		if (prevList.hasClass('fg-menu-content')) { b.remove(); footer.hide(); };
-		    		};		
-		
-					// initialize "back" link
-					if (options.backLink) {
-						if (footer.find('a').size() == 0) {
-							footer.show();
-							$('<a href="#"><span class="ui-icon ui-icon-triangle-1-w"></span> <span>Back</span></a>')
-								.appendTo(footer)
-								.click(function(){ // ----- show the previous menu
-									var b = $(this);
-						    		var prevLeftVal = parseFloat(topList.css('left')) + container.width();		    						    		
-						    		topList.animate({ left: prevLeftVal },  options.crossSpeed, function(){
-						    			setPrevMenu(b);
-						    		});			
-									return false;
-								});
-						}
-					}
-					// or initialize top breadcrumb
-		    		else { 
-		    			if (breadcrumb.find('li').size() == 1){				
-							breadcrumb.empty().append(firstCrumb);
-							firstCrumb.find('a').click(function(){
-								menu.resetDrilldownMenu();
-								return false;
-							});
-						}
-						$('.fg-menu-current-crumb').removeClass('fg-menu-current-crumb');
-						var crumbText = $(this).find('span:eq(0)').text();
-						var newCrumb = $('<li class="fg-menu-current-crumb"><a href="javascript://" class="fg-menu-crumb">'+crumbText+'</a></li>');	
-						newCrumb
-							.appendTo(breadcrumb)
-							.find('a').click(function(){
-								if ($(this).parent().is('.fg-menu-current-crumb')){
-									menu.chooseItem(this);
-								}
-								else {
-									var newLeftVal = - ($('.fg-menu-current').parents('ul').size() - 1) * 180;
-									topList.animate({ left: newLeftVal }, options.crossSpeed, function(){
-										setPrevMenu();
-									});
-								
-									// make this the current crumb, delete all breadcrumbs after this one, and navigate to the relevant menu
-									$(this).parent().addClass('fg-menu-current-crumb').find('span').remove();
-									$(this).parent().nextAll().remove();									
-								};
-								return false;
-							});
-						newCrumb.prev().append(' <span class="ui-icon '+options.nextCrumbLink+'"></span>');
-		    		};			
-		    		return false;    		
-    			});
-		}
-		// if the link is a leaf node (doesn't open a child menu)
-		else {
-			$(this).click(function(){
-				menu.chooseItem(this);
-				return false;
-			});
-		};
-	});
-};
-
-
-/* Menu.prototype.setPosition parameters (defaults noted with *):
-	referrer = the link (or other element) used to show the overlaid object 
-	settings = can override the defaults:
-		- posX/Y: where the top left corner of the object should be positioned in relation to its referrer.
-				X: left*, center, right
-				Y: top, center, bottom*
-		- offsetX/Y: the number of pixels to be offset from the x or y position.  Can be a positive or negative number.
-		- directionH/V: where the entire menu should appear in relation to its referrer.
-				Horizontal: left*, right
-				Vertical: up, down*
-		- detectH/V: detect the viewport horizontally / vertically
-		- linkToFront: copy the menu link and place it on top of the menu (visual effect to make it look like it overlaps the object) */
-
-Menu.prototype.setPosition = function(widget, caller, options) { 
-	var el = widget;
-	var referrer = caller;
-	var dims = {
-		refX: referrer.offset().left,
-		refY: referrer.offset().top,
-		refW: referrer.getTotalWidth(),
-		refH: referrer.getTotalHeight()
-	};	
-	var options = options;
-	var xVal, yVal;
-	
-	var helper = $('<div class="positionHelper"></div>');
-	helper.css({ position: 'absolute', left: dims.refX, top: dims.refY, width: dims.refW, height: dims.refH });
-	el.wrap(helper);
-	
-	// get X pos
-	switch(options.positionOpts.posX) {
-		case 'left': 	xVal = 0; 
-			break;				
-		case 'center': xVal = dims.refW / 2;
-			break;				
-		case 'right': xVal = dims.refW;
-			break;
-	};
-	
-	// get Y pos
-	switch(options.positionOpts.posY) {
-		case 'top': 	yVal = 0;
-			break;				
-		case 'center': yVal = dims.refH / 2;
-			break;				
-		case 'bottom': yVal = dims.refH;
-			break;
-	};
-	
-	// add the offsets (zero by default)
-	xVal += options.positionOpts.offsetX;
-	yVal += options.positionOpts.offsetY;
-	
-	// position the object vertically
-	if (options.positionOpts.directionV == 'up') {
-		el.css({ top: 'auto', bottom: yVal });
-		if (options.positionOpts.detectV && !fitVertical(el)) {
-			el.css({ bottom: 'auto', top: yVal });
-		}
-	} 
-	else {
-		el.css({ bottom: 'auto', top: yVal });
-		if (options.positionOpts.detectV && !fitVertical(el)) {
-			el.css({ top: 'auto', bottom: yVal });
-		}
-	};
-	
-	// and horizontally
-	if (options.positionOpts.directionH == 'left') {
-		el.css({ left: 'auto', right: xVal });
-		if (options.positionOpts.detectH && !fitHorizontal(el)) {
-			el.css({ right: 'auto', left: xVal });
-		}
-	} 
-	else {
-		el.css({ right: 'auto', left: xVal });
-		if (options.positionOpts.detectH && !fitHorizontal(el)) {
-			el.css({ left: 'auto', right: xVal });
-		}
-	};
-	
-	// if specified, clone the referring element and position it so that it appears on top of the menu
-	if (options.positionOpts.linkToFront) {
-		referrer.clone().addClass('linkClone').css({
-			position: 'absolute', 
-			top: 0, 
-			right: 'auto', 
-			bottom: 'auto', 
-			left: 0, 
-			width: referrer.width(), 
-			height: referrer.height()
-		}).insertAfter(el);
-	};
-};
-
-
-/* Utilities to sort and find viewport dimensions */
-
-function sortBigToSmall(a, b) { return b - a; };
-
-jQuery.fn.getTotalWidth = function(){
-	return $(this).width() + parseInt($(this).css('paddingRight')) + parseInt($(this).css('paddingLeft')) + parseInt($(this).css('borderRightWidth')) + parseInt($(this).css('borderLeftWidth'));
-};
-
-jQuery.fn.getTotalHeight = function(){
-	return $(this).height() + parseInt($(this).css('paddingTop')) + parseInt($(this).css('paddingBottom')) + parseInt($(this).css('borderTopWidth')) + parseInt($(this).css('borderBottomWidth'));
-};
-
-function getScrollTop(){
-	return self.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
-};
-
-function getScrollLeft(){
-	return self.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft;
-};
-
-function getWindowHeight(){
-	var de = document.documentElement;
-	return self.innerHeight || (de && de.clientHeight) || document.body.clientHeight;
-};
-
-function getWindowWidth(){
-	var de = document.documentElement;
-	return self.innerWidth || (de && de.clientWidth) || document.body.clientWidth;
-};
-
-/* Utilities to test whether an element will fit in the viewport
-	Parameters:
-	el = element to position, required
-	leftOffset / topOffset = optional parameter if the offset cannot be calculated (i.e., if the object is in the DOM but is set to display: 'none') */
-	
-function fitHorizontal(el, leftOffset){
-	var leftVal = parseInt(leftOffset) || $(el).offset().left;
-	return (leftVal + $(el).width() <= getWindowWidth() + getScrollLeft() && leftVal - getScrollLeft() >= 0);
-};
-
-function fitVertical(el, topOffset){
-	var topVal = parseInt(topOffset) || $(el).offset().top;
-	return (topVal + $(el).height() <= getWindowHeight() + getScrollTop() && topVal - getScrollTop() >= 0);
-};
-
-/*-------------------------------------------------------------------- 
- * javascript method: "pxToEm"
- * by:
-   Scott Jehl (scott@filamentgroup.com) 
-   Maggie Wachs (maggie@filamentgroup.com)
-   http://www.filamentgroup.com
- *
- * Copyright (c) 2008 Filament Group
- * Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses.
- *
- * Description: Extends the native Number and String objects with pxToEm method. pxToEm converts a pixel value to ems depending on inherited font size.  
- * Article: http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/
- * Demo: http://www.filamentgroup.com/examples/pxToEm/	 	
- *							
- * Options:  	 								
- 		scope: string or jQuery selector for font-size scoping
- 		reverse: Boolean, true reverses the conversion to em-px
- * Dependencies: jQuery library						  
- * Usage Example: myPixelValue.pxToEm(); or myPixelValue.pxToEm({'scope':'#navigation', reverse: true});
- *
- * Version: 2.0, 08.01.2008 
- * Changelog:
- *		08.02.2007 initial Version 1.0
- *		08.01.2008 - fixed font-size calculation for IE
---------------------------------------------------------------------*/
-
-Number.prototype.pxToEm = String.prototype.pxToEm = function(settings){
-	//set defaults
-	settings = jQuery.extend({
-		scope: 'body',
-		reverse: false
-	}, settings);
-	
-	var pxVal = (this == '') ? 0 : parseFloat(this);
-	var scopeVal;
-	var getWindowWidth = function(){
-		var de = document.documentElement;
-		return self.innerWidth || (de && de.clientWidth) || document.body.clientWidth;
-	};	
-	
-	/* When a percentage-based font-size is set on the body, IE returns that percent of the window width as the font-size. 
-		For example, if the body font-size is 62.5% and the window width is 1000px, IE will return 625px as the font-size. 	
-		When this happens, we calculate the correct body font-size (%) and multiply it by 16 (the standard browser font size) 
-		to get an accurate em value. */
-				
-	if (settings.scope == 'body' && $.browser.msie && (parseFloat($('body').css('font-size')) / getWindowWidth()).toFixed(1) > 0.0) {
-		var calcFontSize = function(){		
-			return (parseFloat($('body').css('font-size'))/getWindowWidth()).toFixed(3) * 16;
-		};
-		scopeVal = calcFontSize();
-	}
-	else { scopeVal = parseFloat(jQuery(settings.scope).css("font-size")); };
-			
-	var result = (settings.reverse == true) ? (pxVal * scopeVal).toFixed(2) + 'px' : (pxVal / scopeVal).toFixed(2) + 'em';
-	return result;
-};

File kernelActividades/application/views/scripts/fg-menu/fg.menu.js~

-/*-------------------------------------------------------------------- 
-Scripts for creating and manipulating custom menus based on standard <ul> markup
-Version: 3.0, 03.31.2009
-
-By: Maggie Costello Wachs (maggie@filamentgroup.com) and Scott Jehl (scott@filamentgroup.com)
-	http://www.filamentgroup.com
-	* reference articles: http://www.filamentgroup.com/lab/jquery_ipod_style_drilldown_menu/
-		
-Copyright (c) 2009 Filament Group
-Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses.
---------------------------------------------------------------------*/
-
-
-var allUIMenus = [];
-
-$.fn.menu = function(options){
-	var caller = this;
-	var options = options;
-	var m = new Menu(caller, options);	
-	allUIMenus.push(m);
-	
-	$(this)
-	.mousedown(function(){
-		if (!m.menuOpen) { m.showLoading(); };
-	})	
-	.click(function(){
-		if (m.menuOpen == false) { m.showMenu(); }
-		else { m.kill(); };
-		return false;
-	});	
-};
-
-
-function Menu(caller, options){
-  var textoItem = '';
-  integration(textoItem);  
-  
-	var menu = this;
-	var caller = $(caller);
-	var container = $('<div class="fg-menu-container ui-widget ui-widget-content ui-corner-all">'+options.content+'</div>');
-	
-	this.menuOpen = false;
-	this.menuExists = false;
-	
-	var options = jQuery.extend({
-		content: null,
-		width: 180, // width of menu container, must be set or passed in to calculate widths of child menus
-		maxHeight: 180, // max height of menu (if a drilldown: height does not include breadcrumb)
-		positionOpts: {
-			posX: 'left', 
-			posY: 'bottom',
-			offsetX: 0,
-			offsetY: 0,
-			directionH: 'right',
-			directionV: 'down', 
-			detectH: true, // do horizontal collision detection  
-			detectV: false, // do vertical collision detection
-			linkToFront: false
-		},
-		showSpeed: 200, // show/hide speed in milliseconds
-		callerOnState: 'ui-state-active', // class to change the appearance of the link/button when the menu is showing
-		loadingState: 'ui-state-loading', // class added to the link/button while the menu is created
-		linkHover: 'ui-state-hover', // class for menu option hover state
-		linkHoverSecondary: 'li-hover', // alternate class, may be used for multi-level menus		
-	// ----- multi-level menu defaults -----
-		crossSpeed: 200, // cross-fade speed for multi-level menus
-		crumbDefaultText: 'Choose an option:',
-		backLink: true, // in the ipod-style menu: instead of breadcrumbs, show only a 'back' link
-		backLinkText: 'Back',
-		flyOut: false, // multi-level menus are ipod-style by default; this parameter overrides to make a flyout instead
-		flyOutOnState: 'ui-state-default',
-		nextMenuLink: 'ui-icon-triangle-1-e', // class to style the link (specifically, a span within the link) used in the multi-level menu to show the next level
-		topLinkText: 'All',
-		nextCrumbLink: 'ui-icon-carat-1-e'	
-	}, options);
-	
-	var killAllMenus = function(){
-		$.each(allUIMenus, function(i){
-			if (allUIMenus[i].menuOpen) { allUIMenus[i].kill(); };	
-		});
-	};
-	
-	this.kill = function(){
-		caller
-			.removeClass(options.loadingState)
-			.removeClass('fg-menu-open')
-			.removeClass(options.callerOnState);	
-		container.find('li').removeClass(options.linkHoverSecondary).find('a').removeClass(options.linkHover);		
-		if (options.flyOutOnState) { container.find('li a').removeClass(options.flyOutOnState); };	
-		if (options.callerOnState) { 	caller.removeClass(options.callerOnState); };			
-		if (container.is('.fg-menu-ipod')) { menu.resetDrilldownMenu(); };
-		if (container.is('.fg-menu-flyout')) { menu.resetFlyoutMenu(); };	
-		container.parent().hide();	
-		menu.menuOpen = false;
-		$(document).unbind('click', killAllMenus);
-		$(document).unbind('keydown');
-	};
-	
-	this.showLoading = function(){
-		caller.addClass(options.loadingState);
-	};
-
-	this.showMenu = function(){
-		killAllMenus();
-		if (!menu.menuExists) { menu.create() };
-		caller
-			.addClass('fg-menu-open')
-			.addClass(options.callerOnState);
-		container.parent().show().click(function(){ menu.kill(); return false; });
-		container.hide().slideDown(options.showSpeed).find('.fg-menu:eq(0)');
-		menu.menuOpen = true;
-		caller.removeClass(options.loadingState);
-		$(document).click(killAllMenus);
-		
-		// assign key events
-		$(document).keydown(function(event){
-			var e;
-			if (event.which !="") { e = event.which; }
-			else if (event.charCode != "") { e = event.charCode; }
-			else if (event.keyCode != "") { e = event.keyCode; }
-			
-			var menuType = ($(event.target).parents('div').is('.fg-menu-flyout')) ? 'flyout' : 'ipod' ;
-			
-			switch(e) {
-				case 37: // left arrow 
-					if (menuType == 'flyout') {
-						$(event.target).trigger('mouseout');
-						if ($('.'+options.flyOutOnState).size() > 0) { $('.'+options.flyOutOnState).trigger('mouseover'); };
-					};
-					
-					if (menuType == 'ipod') {
-						$(event.target).trigger('mouseout');
-						if ($('.fg-menu-footer').find('a').size() > 0) { $('.fg-menu-footer').find('a').trigger('click'); };
-						if ($('.fg-menu-header').find('a').size() > 0) { $('.fg-menu-current-crumb').prev().find('a').trigger('click'); };
-						if ($('.fg-menu-current').prev().is('.fg-menu-indicator')) {
-							$('.fg-menu-current').prev().trigger('mouseover');							
-						};						
-					};
-					return false;
-					break;
-					
-				case 38: // up arrow 
-					if ($(event.target).is('.' + options.linkHover)) {	
-						var prevLink = $(event.target).parent().prev().find('a:eq(0)');						
-						if (prevLink.size() > 0) {
-							$(event.target).trigger('mouseout');
-							prevLink.trigger('mouseover');
-						};						
-					}
-					else { container.find('a:eq(0)').trigger('mouseover'); }
-					return false;
-					break;
-					
-				case 39: // right arrow 
-					if ($(event.target).is('.fg-menu-indicator')) {						
-						if (menuType == 'flyout') {
-							$(event.target).next().find('a:eq(0)').trigger('mouseover');
-						}
-						else if (menuType == 'ipod') {
-							$(event.target).trigger('click');						
-							setTimeout(function(){
-								$(event.target).next().find('a:eq(0)').trigger('mouseover');
-							}, options.crossSpeed);
-						};				
-					}; 
-					return false;
-					break;
-					
-				case 40: // down arrow 
-					if ($(event.target).is('.' + options.linkHover)) {
-						var nextLink = $(event.target).parent().next().find('a:eq(0)');						
-						if (nextLink.size() > 0) {							
-							$(event.target).trigger('mouseout');
-							nextLink.trigger('mouseover');
-						};				
-					}
-					else { container.find('a:eq(0)').trigger('mouseover'); }		
-					return false;						
-					break;
-					
-				case 27: // escape
-					killAllMenus();
-					break;
-					
-				case 13: // enter
-					if ($(event.target).is('.fg-menu-indicator') && menuType == 'ipod') {							
-						$(event.target).trigger('click');						
-						setTimeout(function(){
-							$(event.target).next().find('a:eq(0)').trigger('mouseover');
-						}, options.crossSpeed);					
-					}; 
-					break;
-			};			
-		});
-	};
-	
-	this.create = function(){	
-		container.css({ width: options.width }).appendTo('body').find('ul:first').not('.fg-menu-breadcrumb').addClass('fg-menu');
-		container.find('ul, li a').addClass('ui-corner-all');
-		
-		// aria roles & attributes
-		container.find('ul').attr('role', 'menu').eq(0).attr('aria-activedescendant','active-menuitem').attr('aria-labelledby', caller.attr('id'));
-		container.find('li').attr('role', 'menuitem');
-		container.find('li:has(ul)').attr('aria-haspopup', 'true').find('ul').attr('aria-expanded', 'false');
-		container.find('a').attr('tabindex', '-1');
-		
-		// when there are multiple levels of hierarchy, create flyout or drilldown menu
-		if (container.find('ul').size() > 1) {
-			if (options.flyOut) { menu.flyout(container, options); }
-			else { menu.drilldown(container, options); }	
-		}
-		else {
-			container.find('a').click(function(){
-				menu.chooseItem(this);
-				return false;
-			});
-		};	
-		
-		if (options.linkHover) {
-			var allLinks = container.find('.fg-menu li a');
-			allLinks.hover(
-				function(){
-					var menuitem = $(this);
-					$('.'+options.linkHover).removeClass(options.linkHover).blur().parent().removeAttr('id');
-					$(this).addClass(options.linkHover).focus().parent().attr('id','active-menuitem');
-				},
-				function(){
-					$(this).removeClass(options.linkHover).blur().parent().removeAttr('id');
-				}
-			);
-		};
-		
-		if (options.linkHoverSecondary) {
-			container.find('.fg-menu li').hover(
-				function(){
-					$(this).siblings('li').removeClass(options.linkHoverSecondary);
-					if (options.flyOutOnState) { $(this).siblings('li').find('a').removeClass(options.flyOutOnState); }
-					$(this).addClass(options.linkHoverSecondary);
-				},
-				function(){ $(this).removeClass(options.linkHoverSecondary); }
-			);
-		};	
-		
-		menu.setPosition(container, caller, options);
-		menu.menuExists = true;
-	};
-	
-	this.chooseItem = function(item){	  
-		menu.kill();
-		// edit this for your own custom function/callback:
-		$('#menuSelection').text($(item).text());
-		var textoItem = $(item).text();
-		integration(textoItem);
-		location.href = $(item).attr('href');
-	};
-	
-	function integration(textoItem){
-      
-      var tabActiva = [$('#tab-1').text(), $('#tab-2').text(), $('#tab-3').text(), $('#tab-4').text(), $('#tab-5').text(), $('#tab-6').text(),
-      $('#tab-7').text(), $('#tab-8').text(), $('#tab-9').text(), $('#tab-10').text(), $('#tab-11').text(), $('#tab-12').text(), 
-      $('#tab-13').text(), $('#tab-14').text()]; 
-      
-      switch (textoItem){
-              
-      case '':
-        var $tabs = $('#tabs').tabs({
-          selected:0,	
-          add: function(event, ui) {            
-          $tabs.tabs('select', '#' + ui.panel.id);          
-          },
-          fx: { opacity: 'toggle', duration: 'fast' }
-        });
-        
-        // close icon: removing the tab on click        
-        $('#tabs span.ui-icon-close').live('click', function() {
-          var index = $('li',$tabs).index($(this).parent());  
-          $tabs.tabs('remove', index);
-        });
-        $tabs.find(".ui-tabs-nav").sortable({axis:'x'});
-        break;
-        
-      case 'Inicio':
-        var $tabs = $('#tabs').tabs({         
-         tabTemplate: '<li><a href="#{href}">#{label}</a><span class="ui-icon ui-icon-close">Cerrar Tab</span></li>',
-         add: function(event, ui) {           
-           var tabContenido = "<strong>En construcción </strong><img src='/Obra/kernelObra/application/views/images/underConstruction.png'   />"; 
-           $(ui.panel).append(tabContenido);                                
-           $tabs.tabs('select', '#' + ui.panel.id);                       
-         }         
-         });                                                                       
-         
-         if (tabActiva[0] == ''){
-          var tab_title = 'Inicio';
-          $tabs.tabs('add', '#tab-1', tab_title, 0);
-            
-         }
-         else
-          $tabs.tabs('select', '#tab-1');                                    
-         break;
-                
-        
-      case 'Obras':         
-         var $tabs = $('#tabs').tabs({
-         tabTemplate: '<li><a href="#{href}">#{label}</a><span class="ui-icon ui-icon-close">Cerrar Tab</span></li>',
-         add: function(event, ui){
-	   $.post('obras/getContenidoForTab',{},function(contenido){
-		var tabContenido = contenido; 
-		$(ui.panel).append(tabContenido);
-		$tabs.tabs('select', '#' + ui.panel.id);                       
-	   });           
-         }         
-         });                                                              
-         
-         if (tabActiva[1] == ''){
-          var tab_title = 'Obras';
-          $tabs.tabs('add', '#tab-2', tab_title);  
-         }
-         else
-          $tabs.tabs('select', '#tab-2');                                    
-         break;
-         
-      case 'Ejecución Presupuestaria':
-        var $tabs = $('#tabs').tabs({
-        tabTemplate: '<li><a href="#{href}">#{label}</a> <span class="ui-icon ui-icon-close">Cerrar Tab</span></li>',
-        add: function(event, ui) {
-	  $.post('ejecucion_presupuestaria/getContenidoForTab',{},function(contenido){
-		var tabContenido = contenido; 
-		$(ui.panel).append(tabContenido);
-		$tabs.tabs('select', '#' + ui.panel.id);                       
-	  });          
-        }
-        });
-        if (tabActiva[2] == ''){
-          var tab_title = 'Ejecución Presupuestaria';
-          $tabs.tabs('add', '#tab-3', tab_title);  
-         }
-         else
-          $tabs.tabs('select', '#tab-3');
-         break;
-         
-      case 'Ejecución Contable - Financiera':
-        var $tabs = $('#tabs').tabs({
-        tabTemplate: '<li><a href="#{href}">#{label}</a> <span class="ui-icon ui-icon-close">Cerrar Tab</span></li>',
-        add: function(event, ui) {
-	  $.post('ejecucion_financiera/getContenidoForTab',{},function(contenido){
-		var tabContenido = contenido; 
-		$(ui.panel).append(tabContenido);
-		$tabs.tabs('select', '#' + ui.panel.id);                       
-	  });          
-        }
-        });
-        if (tabActiva[3] == ''){
-          var tab_title = 'Ejecución Contable - Financiera';
-          $tabs.tabs('add', '#tab-4', tab_title);  
-         }
-         else
-          $tabs.tabs('select', '#tab-4');
-         break;
-         
-      case 'Ejecución Física':
-        var $tabs = $('#tabs').tabs({
-        tabTemplate: '<li><a href="#{href}">#{label}</a> <span class="ui-icon ui-icon-close">Cerrar Tab</span></li>',
-        add: function(event, ui) {
-	  $.post('ejecucion_fisica/getContenidoForTab',{},function(contenido){
-		var tabContenido = contenido; 
-		$(ui.panel).append(tabContenido);
-		$tabs.tabs('select', '#' + ui.panel.id);                       
-	  });	          
-        }
-        });
-        if (tabActiva[4] == ''){
-          var tab_title = 'Ejecución Física';
-          $tabs.tabs('add', '#tab-5', tab_title);  
-         }
-         else
-          $tabs.tabs('select', '#tab-5');
-         break;               
-         
-      case 'Empresas Contratistas':
-        var $tabs = $('#tabs').tabs({
-        tabTemplate: '<li><a href="#{href}">#{label}</a> <span class="ui-icon ui-icon-close">Cerrar Tab</span></li>',
-        add: function(event, ui) {
-          var tabContenido = "<script src='/Obra/kernelObra/application/views/empresas/grid.js' type='text/javascript'></script><table id='empresas'></table><div id='pager_empresas'></div><table id='empresasDetail'></table><div id='pager_empresas_detail'></div>";
-          $(ui.panel).append(tabContenido);
-          $tabs.tabs('select', '#' + ui.panel.id);
-        }
-        });
-        if (tabActiva[5] == ''){
-          var tab_title = 'Empresas Contratistas';
-          $tabs.tabs('add', '#tab-6', tab_title);  
-         }
-         else
-          $tabs.tabs('select', '#tab-6');
-         break;
-      
-      case 'Maestros de Obras':
-        var $tabs = $('#tabs').tabs({
-        tabTemplate: '<li><a href="#{href}">#{label}</a> <span class="ui-icon ui-icon-close">Cerrar Tab</span></li>',
-        add: function(event, ui) {
-          var tabContenido = "<script src='/Obra/kernelObra/application/views/maestro/grid.js' type='text/javascript'></script><table id='maestro'></table><div id='pager_maestro'></div><table id='maestroDetail'></table><div id='pager_maestro_detail'></div>";
-          $(ui.panel).append(tabContenido);
-          $tabs.tabs('select', '#' + ui.panel.id);
-        }
-        });
-        if (tabActiva[6] == ''){
-          var tab_title = 'Maestros de Obras';
-          $tabs.tabs('add', '#tab-7', tab_title);  
-         }
-         else
-          $tabs.tabs('select', '#tab-7');
-         break;
-	
-      case 'Inspecciones':
-        var $tabs = $('#tabs').tabs({
-        tabTemplate: '<li><a href="#{href}">#{label}</a> <span class="ui-icon ui-icon-close">Cerrar Tab</span></li>',
-        add: function(event, ui) {
-          var tabContenido = "<script src='/Obra/kernelObra/application/views/inspector/grid.js' type='text/javascript'></script><table id='inspector'></table><div id='pager_inspector'></div><table id='inspectorDetail'></table><div id='pager_inspector_detail'></div>";
-          $(ui.panel).append(tabContenido);
-          $tabs.tabs('select', '#' + ui.panel.id);
-        }
-        });
-        if (tabActiva[7] == ''){
-          var tab_title = 'Inspecciones';
-          $tabs.tabs('add', '#tab-8', tab_title);  
-         }
-         else
-          $tabs.tabs('select', '#tab-8');
-         break;
-         
-      case 'Jefaturas a Cargo':
-        var $tabs = $('#tabs').tabs({
-        tabTemplate: '<li><a href="#{href}">#{label}</a> <span class="ui-icon ui-icon-close">Cerrar Tab</span></li>',
-        add: function(event, ui) {
-          var tabContenido = "<script src='/Obra/kernelObra/application/views/jefatura/grid.js' type='text/javascript'></script><table id='jefatura'></table><div id='pager_jefatura'></div><table id='jefaturaDetail'></table><div id='pager_jefatura_detail'></div>";
-          $(ui.panel).append(tabContenido);
-          $tabs.tabs('select', '#' + ui.panel.id);
-        }
-        });
-        if (tabActiva[8] == ''){
-          var tab_title = 'Jefaturas a Cargo';
-          $tabs.tabs('add', '#tab-9', tab_title);  
-         }
-         else
-          $tabs.tabs('select', '#tab-9');
-         break;
-         
-      case 'Actas':
-        var $tabs = $('#tabs').tabs({
-        tabTemplate: '<li><a href="#{href}">#{label}</a> <span class="ui-icon ui-icon-close">Cerrar Tab</span></li>',
-        add: function(event, ui) {
-          var tabContenido = "<script src='/Obra/kernelObra/application/views/actas/grid.js' type='text/javascript'></script><table id='actas'></table><div id='pager_actas'></div>";
-          $(ui.panel).append(tabContenido);
-          $tabs.tabs('select', '#' + ui.panel.id);
-        }
-        });
-        if (tabActiva[9] == ''){
-          var tab_title = 'Actas';
-          $tabs.tabs('add', '#tab-10', tab_title);  
-         }
-         else
-          $tabs.tabs('select', '#tab-10');
-         break;
-         
-      case 'Global Acumulado':
-        var $tabs = $('#tabs').tabs({
-        tabTemplate: '<li><a href="#{href}">#{label}</a> <span class="ui-icon ui-icon-close">Cerrar Tab</span></li>',
-        add: function(event, ui) {
-          var tabContenido = "<script src='/Obra/kernelObra/application/views/global/grid.js' type='text/javascript'></script><table id='global'></table><div id='pager_global'></div>";
-          $(ui.panel).append(tabContenido);
-          $tabs.tabs('select', '#' + ui.panel.id);
-        }
-        });
-        if (tabActiva[10] == ''){
-          var tab_title = 'Global Acumulado';
-          $tabs.tabs('add', '#tab-11', tab_title);  
-         }
-         else
-          $tabs.tabs('select', '#tab-11');
-         break;
-         
-      case 'Impacto Social - Ambiental':
-        var $tabs = $('#tabs').tabs({
-        tabTemplate: '<li><a href="#{href}">#{label}</a> <span class="ui-icon ui-icon-close">Cerrar Tab</span></li>',
-        add: function(event, ui) {
-          var tabContenido = "<script src='/Obra/kernelObra/application/views/social/grid.js' type='text/javascript'></script><table id='social'></table><div id='pager_social'></div>";
-          $(ui.panel).append(tabContenido);
-          $tabs.tabs('select', '#' + ui.panel.id);
-        }
-        });
-        if (tabActiva[11] == ''){
-          var tab_title = 'Impacto Social';
-          $tabs.tabs('add', '#tab-12', tab_title);  
-         }
-         else
-          $tabs.tabs('select', '#tab-12');
-         break;
-         
-      case 'Registro de Incidencias':
-        var $tabs = $('#tabs').tabs({
-        tabTemplate: '<li><a href="#{href}">#{label}</a> <span class="ui-icon ui-icon-close">Cerrar Tab</span></li>',
-        add: function(event, ui) {
-          var tabContenido = "<script src='/Obra/kernelObra/application/views/incidencias/grid.js' type='text/javascript'></script><table id='incidencias'></table><div id='pager_incidencias'></div>";
-          $(ui.panel).append(tabContenido);
-          $tabs.tabs('select', '#' + ui.panel.id);
-        }
-        });
-        if (tabActiva[12] == ''){
-          var tab_title = 'Registro de Incidencias';
-          $tabs.tabs('add', '#tab-13', tab_title);  
-        }
-         else
-          $tabs.tabs('select', '#tab-13');
-         break;
-	
-	case 'Consejos Comunales':
-		var $tabs = $('#tabs').tabs({
-			tabTemplate: '<li><a href="#{href}">#{label}</a> <span class="ui-icon ui-icon-close">Cerrar Tab</span></li>',
-			add: function(event, ui) {
-			  $.post('consejos_comunales/getContenidoForTab',{},function(contenido){
-		            var tabContenido = contenido; 
-		            $(ui.panel).append(tabContenido);
-		            $tabs.tabs('select', '#' + ui.panel.id);                       
-	                  });			
-			}
-		});
-		if (tabActiva[13] == ''){
-		var tab_title = 'Consejos Comunales';
-		$tabs.tabs('add', '#tab-14', tab_title);  
-		}
-		else
-		$tabs.tabs('select', '#tab-14');
-		break;
-	
-        };      
-    };
-};
-
-
-
-Menu.prototype.flyout = function(container, options) {
-	var menu = this;
-	
-	this.resetFlyoutMenu = function(){
-		var allLists = container.find('ul ul');
-		allLists.removeClass('ui-widget-content').hide();	
-	};
-	
-	container.addClass('fg-menu-flyout').find('li:has(ul)').each(function(){
-		var linkWidth = container.width();
-		var showTimer, hideTimer;
-		var allSubLists = $(this).find('ul');		
-		
-		allSubLists.css({ left: linkWidth, width: linkWidth }).hide();
-			
-		$(this).find('a:eq(0)').addClass('fg-menu-indicator').html('<span>' + $(this).find('a:eq(0)').text() + '</span><span class="ui-icon '+options.nextMenuLink+'"></span>').hover(
-			function(){
-				clearTimeout(hideTimer);
-				var subList = $(this).next();
-				if (!fitVertical(subList, $(this).offset().top)) { subList.css({ top: 'auto', bottom: 0 }); };
-				if (!fitHorizontal(subList, $(this).offset().left + 100)) { subList.css({ left: 'auto', right: linkWidth, 'z-index': 999 }); };
-				showTimer = setTimeout(function(){
-					subList.addClass('ui-widget-content').show(options.showSpeed).attr('aria-expanded', 'true');	
-				}, 300);	
-			},
-			function(){
-				clearTimeout(showTimer);
-				var subList = $(this).next();
-				hideTimer = setTimeout(function(){
-					subList.removeClass('ui-widget-content').hide(options.showSpeed).attr('aria-expanded', 'false');
-				}, 400);	
-			}
-		);
-
-		$(this).find('ul a').hover(
-			function(){
-				clearTimeout(hideTimer);
-				if ($(this).parents('ul').prev().is('a.fg-menu-indicator')) {
-					$(this).parents('ul').prev().addClass(options.flyOutOnState);
-				}
-			},
-			function(){
-				hideTimer = setTimeout(function(){
-					allSubLists.hide(options.showSpeed);
-					container.find(options.flyOutOnState).removeClass(options.flyOutOnState);
-				}, 500);	
-			}
-		);	
-	});
-	
-	container.find('a').click(function(){
-		menu.chooseItem(this);
-		return false;
-	});
-};
-
-
-Menu.prototype.drilldown = function(container, options) {
-	var menu = this;	
-	var topList = container.find('.fg-menu');	
-	var breadcrumb = $('<ul class="fg-menu-breadcrumb ui-widget-header ui-corner-all ui-helper-clearfix"></ul>');
-	var crumbDefaultHeader = $('<li class="fg-menu-breadcrumb-text">'+options.crumbDefaultText+'</li>');
-	var firstCrumbText = (options.backLink) ? options.backLinkText : options.topLinkText;
-	var firstCrumbClass = (options.backLink) ? 'fg-menu-prev-list' : 'fg-menu-all-lists';
-	var firstCrumbLinkClass = (options.backLink) ? 'ui-state-default ui-corner-all' : '';
-	var firstCrumbIcon = (options.backLink) ? '<span class="ui-icon ui-icon-triangle-1-w"></span>' : '';
-	var firstCrumb = $('<li class="'+firstCrumbClass+'"><a href="#" class="'+firstCrumbLinkClass+'">'+firstCrumbIcon+firstCrumbText+'</a></li>');
-	
-	container.addClass('fg-menu-ipod');
-	
-	if (options.backLink) { breadcrumb.addClass('fg-menu-footer').appendTo(container).hide(); }
-	else { breadcrumb.addClass('fg-menu-header').prependTo(container); };
-	breadcrumb.append(crumbDefaultHeader);
-	
-	var checkMenuHeight = function(el){
-		if (el.height() > options.maxHeight) { el.addClass('fg-menu-scroll') };	
-		el.css({ height: options.maxHeight });
-	};
-	
-	var resetChildMenu = function(el){ el.removeClass('fg-menu-scroll').removeClass('fg-menu-current').height('auto'); };
-	
-	this.resetDrilldownMenu = function(){
-		$('.fg-menu-current').removeClass('fg-menu-current');
-		topList.animate({ left: 0 }, options.crossSpeed, function(){
-			$(this).find('ul').each(function(){
-				$(this).hide();
-				resetChildMenu($(this));				
-			});
-			topList.addClass('fg-menu-current');			
-		});		
-		$('.fg-menu-all-lists').find('span').remove();	
-		breadcrumb.empty().append(crumbDefaultHeader);		
-		$('.fg-menu-footer').empty().hide();	
-		checkMenuHeight(topList);		
-	};
-	
-	topList
-		.addClas