<%@ Page Title="" Language="C#" MasterPageFile="~/site_base.master" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="index" %>

<script runat="server">
    String version = WebAppVersion.GetWebAppVersion();
    bool withModules = true; 
</script>

<%@ Import Namespace="System.Threading" %>
<%@ Import Namespace="System.Globalization" %>
<script runat="server">
string siteLang = "EN"; 
protected override void InitializeCulture()
{
    HttpCookie lang = Request.Cookies["siteLanguage"]; 
    
    siteLang = (lang != null) ? lang.Value : siteLang;
    UICulture = siteLang ;
    Culture = siteLang ;

    Thread.CurrentThread.CurrentCulture = 
        CultureInfo.CreateSpecificCulture(siteLang);
    Thread.CurrentThread.CurrentUICulture = new 
        CultureInfo(siteLang);
    base.InitializeCulture();
}
</script>

<asp:Content ID="head" ContentPlaceHolderID="baseHead" Runat="Server">

    <title>IHBox</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <!--getting all assets from a CDN-->
    <!--<script src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js"></script>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min.js"></script>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0-rc.3/handlebars.js"></script>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.0/js/bootstrap.min.js"></script>
    <link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.0/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.0/css/bootstrap-responsive.css" rel="stylesheet" type="text/css" />-->

    <!--working with local copies -->
    
    <% 
        bool debug = true;
    %>

    <!-- industrial dashboard css & js -->
    <script src="<%
        
        if (debug == true){
            Response.Write(ResolveUrl(VirtualPathUtility.GetDirectory(Request.ApplicationPath) + "IndustrialDashboard/Scripts/IndustrialDashboard-debug.js?v=" + version)); 
        } else {
            Response.Write(ResolveUrl(VirtualPathUtility.GetDirectory(Request.ApplicationPath) + "IndustrialDashboard/Scripts/IndustrialDashboard.js?v=" + version)); 
        }
        
        %>" type="text/javascript"></script> 

    <link type="text/css" href="<%= ResolveUrl(VirtualPathUtility.GetDirectory(Request.ApplicationPath) + "IndustrialDashboard/Styles/IndustrialDashboard.css?v=" + version) %>" rel="stylesheet" />

    <%--jquery--%>
    <script src="<%= ResolveUrl("~/assets/libs/jam/jquery/dist/jquery.js") %>"></script>

    <!-- nprogress bar for ajax loading feedback -->
    <link href="<%= ResolveUrl("~/assets/libs/js/nprogress/nprogress.css") %>" rel="stylesheet" />
    <script src="<%= ResolveUrl("~/assets/libs/js/nprogress/nprogress.js") %>"></script>

    <script>
        <%    
            string locale_data = getJedLocaleData(siteLang); //all code is on the index.aspx.cs file
            Response.Write("var jed_locale_data =" + locale_data + ";");

            string custom_modules = getCustomModulesPaths();
            Response.Write("var custom_modules_paths = " + custom_modules + ";");
            
            string custom_configs = getCustomConfigsPaths();
            Response.Write("var custom_configs_paths = " + custom_configs + ";"); 
        %>
    </script>

    <!--bootstrap-->
    <link href="<%= ResolveUrl("~/assets/bootstrap/css/custom-bootstrap.min.css") %>" rel="stylesheet" />
    <%--<link href="<%= ResolveUrl("~/assets/bootstrap-3.2.0/css/bootstrap.min.css") %>" rel="stylesheet" />--%>
    <link href="<%= ResolveUrl("~/assets/css/font-awesome/css/font-awesome.css") %>" rel="stylesheet" />
    <link href="<%= ResolveUrl("~/assets/css/font-awesome-4.2.0/css/font-awesome.css") %>" rel="stylesheet" />
    <link href="<%= ResolveUrl("~/assets/css/font-awesome-animation-0.0.7/css/font-awesome-animation.css") %>" rel="stylesheet" />
    <link href="<%= ResolveUrl("~/assets/css/fontello/css/fontello.css") %>" rel="stylesheet" />

    <!--rule for body padding, between normal css and responsive css to
    fix and show content properly and also consider the responsive change from fixed
    to relative (nav-top fixed)-->
    <style type="text/css">
        body {
            padding-top: 53px;
            /*padding-top: 93px;*/
            /*padding-bottom: 40px;*/
        }

        /* Large desktop */
        @media (min-width: 1250px) { 
            #header .btn, #header .nav li > a, #header .nav span{
                font-size:18px !important; 
            }
        }
 
        /* Portrait tablet to landscape and desktop */
        @media (max-width: 1250px) { 
            #header .btn, #header .nav li > a, #header .nav span{
                font-size:14px !important; 
            }
        }

    </style>

    <link href="<%= ResolveUrl("~/assets/bootstrap/css/bootstrap-responsive.css") %>" rel="stylesheet" />
    <link href="<%= ResolveUrl("~/assets/css/index-ui.css?v=" + version) %>" rel="stylesheet" />
    <link href="<%= ResolveUrl("~/assets/css/index-ui.custom.css?v=" + version) %>" rel="stylesheet" />
    <%--<link href="<%= ResolveUrl("~/assets/css/index-ui-flat.css") %>" rel="stylesheet" />--%>
    <%--<link href="<%= ResolveUrl("~/assets/css/index-ui-flat2.css") %>" rel="stylesheet" />--%>
    
    <style type="text/css">
        @media (max-width: 979px) {
            body {
                padding-top: 53px;
            }
        }

        #configuration_error_icon {
            float: right;
            margin-top: -25px;
            margin-right: 15px;
            height: 12px;
            width: 12px;
            background-color: #FF0000;
            -moz-border-radius: 43px;
            -webkit-border-radius: 43px;
            border-radius: 43px;
            color: #FFFFFF;
            font-size: 10px;
            line-height: 12px;
            text-align: center;
            display:none;
        }

        .block-poster {
            width:100%;
            height:100%;
            background-color:transparent;
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            z-index: 1040;
        }
        .block-poster.with-opacity {
            background-color:#f7f7f7;
            opacity:0.7;
        }

        .blinking-on {
            color: #FFFF00; 
        }
    </style>

    <%--<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Raleway:600,400,500,300,100,700" type="text/css">--%>
    <link href="<%= ResolveUrl("~/assets/css/index-ui-template.css?v=" + version) %>" rel="stylesheet" />
    <link href="<%= ResolveUrl("~/assets/css/animate.css") %>" rel="stylesheet" />

    <script type="text/javascript">
        var _Includer = new window.Includer({
            Widgets: [
                'SecurityLogin'
            ]
            , ExternalWidgets: [
            ]
            , XML: { Available: false }
            , Theme: "ABGPortal"
        });
    </script>

</asp:Content>
<asp:Content ID="body" ContentPlaceHolderID="baseBody" Runat="Server">

    <% 
        if (Session["MenuData"] == null){
            Session["MenuData"] = WebApp.GetMenu(); 
        }
        WebApp.MenuData menuData = (WebApp.MenuData)Session["MenuData"]; 
    %>
    <%--<script data-main="<%= ResolveUrl("~/app/config")%>" src="<%= ResolveUrl("~/assets/libs/js/require.js") %>"></script>--%>

    <script src="<%= ResolveUrl("~/assets/libs/js/require.js") %>"></script>

    <div class="no-connection-poster no-text-select hide">
        <div style="z-index:1500" class="block-poster with-opacity">
        </div>
        <div style="z-index:1510" class="block-poster">
            <div style="margin-top:5%;font-family:Arial;">
                <div class="row-fluid">
                    <div class="row-fluid">
                        <div class="span12 text-center">
                            <img src="<%= ResolveUrl("~/assets/img/connection_icon.png") %>" />
                        </div>
                    </div>
                    <div class="row-fluid" style="margin-top:10px;">
                        <div class="span12 text-center">
                            <h1><asp:Localize runat="server" meta:resourcekey="network_error_title" /></h1>
                        </div>
                    </div>
                </div>
                <div class="row-fluid text-center muted">
                    <h4>
                        <asp:Localize runat="server" meta:resourcekey="network_error_subtitle" />
                        <img style="margin-top:-5px;margin-left:10px;" src="<%= ResolveUrl("~/assets/img/ajax-loader.gif") %>" />
                    </h4>
                </div>
            </div>
        </div>
    </div>
    
    <div id="top_messages_bar_container">
        <!--here goes the top messages bar -->
    </div>

    <header id="tz-header-wrapper" class="big-blue-header navbar-fixed-top" style="position: fixed; top: 0px;">
        <div style="position:relative; top:0; height:40px; background:#ee4c4c; width:100%;text-align:center;" class="update-available hide">
            <span style="color:#fff; line-height:40px;"><asp:Localize ID="Localize4" runat="server" meta:resourcekey="new_version_available" /> <a style="color:#fff;text-decoration:underline;" href="javascript: window.location.reload(true);"><asp:Localize ID="Localize5" runat="server" meta:resourcekey="new_version_available_click_here" /></a></span>
        </div>
        <div style="position:relative; top:0; height:40px; background:#ffd800; width:100%;text-align:center;" class="zoomed-browser-notice hide">
            <span style="color:#000; line-height:40px;"><asp:Localize ID="Localize6" runat="server" meta:resourcekey="zoomed_browser_notice" /></span>
            <button style="margin-top:11px;margin-right:30px;opacity:0.7;" class="close dismiss-zoomed-browser-notice" aria-hidden="true">&times;</button>
        </div>
        <div style="position:relative; top:0; height:40px; background:#0094ff; width:100%;text-align:center;color:#FFFFFF;" class="menu-changed-notice hide">
            <span style="color:#fff; line-height:40px;"><asp:Localize ID="Localize7" runat="server" meta:resourcekey="menu_changed_notice" /> <a style="color:#fff;text-decoration:underline;" href="javascript: window.location.reload(true);"><asp:Localize ID="Localize8" runat="server" meta:resourcekey="menu_changed_notice_click_to_refresh" /></a></span>
            <button style="margin-top:11px;margin-right:30px;opacity:0.7;" class="close dismiss-menu-changed-notice" aria-hidden="true">&times;</button>
        </div>
        <div class="container-fluid" style="max-width:none;">
            <div class="row-fluid" id="header">
                <div class="span12">
                    <div id="tz-menu" class="pull-left">
                        <!-- MAIN NAVIGATION -->
                        <nav id="plazart-mainnav" class="wrap plazart-mainnav navbar-collapse-fixed-top">
                            <div class="container navbar">
                                <div class="navbar-inner">
                                    <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                                        <i class="fw fw-icon-reorder"></i>
                                    </button>
                                    <div class="nav-collapse collapse always-show">
                                        <div class="plazart-megamenu animate slide" data-duration="400">
                                        <% if (withModules) { %>
                                            <% foreach(WebApp.MenuItem mi in menuData.GetGroupItems("navbar_left_with_modules")){ %>
                                            <ul class="nav navbar-nav level0">
                                                <li class="current <% = (mi.Properties.HasProperty("classes")) ? mi.Properties.GetPropertyValue("classes") : "" %>" data-id="101" data-level="1">
                                                    <% if (mi.Children.Count == 0){ %>
                                                    <a href="<% = mi.URL %>" style="padding: 17px 25px; line-height: 17px;">
                                                        <% if (mi.Properties.HasProperty("icon")){ %>
                                                            <i style="margin-right: 5px;" class="<% = mi.Properties.GetPropertyValue("icon") %>"></i>
                                                        <% } %>
                                                        <% if (mi.Properties.HasProperty("localize-key")){ %>
                                                            <% = Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(mi.Properties.GetLocalizePropertyValue("localize-key")), "") %>
                                                        <% }else{ %>
                                                            <% = mi.Name %>
                                                        <% } %>
                                                    </a>
                                                    <% }else{ %>
                                                    <a class="dropdown-toggle" style="padding: 17px 20px; line-height: 17px;font-size: 18px; font-weight: normal;" data-toggle="dropdown">
                                                        <% if (mi.Properties.HasProperty("icon")){ %>
                                                            <i style="margin-right: 5px;" class="<% = mi.Properties.GetPropertyValue("icon") %>"></i>
                                                        <% } %>
                                                        <% if (mi.Properties.HasProperty("localize-key")){ %>
                                                            <% = Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(mi.Properties.GetLocalizePropertyValue("localize-key")), "") %>
                                                        <% }else{ %>
                                                            <% = mi.Name %>
                                                        <% } %>
                                                        <span class="caret"></span>
                                                    </a>
                                                    <ul style="min-width:190px;color: rgb(0, 0, 0);" class="dropdown-menu">
                                                        <% foreach(WebApp.MenuItem child in mi.Children){ %>
                                                            <% if (child.Children.Count == 0){ %>
                                                        <li class="text-center <% = (child.Properties.HasProperty("classes")) ? child.Properties.GetPropertyValue("classes") : "" %>">
                                                            <a href="<% = child.URL%>"><% = (child.Properties.HasProperty("localize-key")) ? Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(child.Properties.GetLocalizePropertyValue("localize-key")), "") : child.Name%></a>
                                                        </li>
                                                            <% } else { %>
                                                        <li class="text-center dropdown-submenu">
                                                            <a class="dropdown-toggle" style="font-size:18px; font-weight: normal;" data-toggle="dropdown">
                                                                <% if (child.Properties.HasProperty("localize-key")) { %>
                                                                    <% = Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(child.Properties.GetLocalizePropertyValue("localize-key")), "") %>
                                                                <% } else { %>
                                                                    <% = child.Name%>
                                                                <% } %>
                                                            </a>
                                                            <ul style="min-width:190px;color: rgb(0, 0, 0);" class="dropdown-menu">
                                                            <% foreach (WebApp.MenuItem child2 in child.Children)
                                                                { %>
                                                                <li class="text-center">
                                                                    <a href="<% = child2.URL%>"><% = (child2.Properties.HasProperty("localize-key")) ? Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(child2.Properties.GetLocalizePropertyValue("localize-key")), "") : child2.Name%></a>
                                                                </li>
                                                            <% } %>
                                                            </ul>
                                                        </li>
                                                            <% } %>
                                                        <% } %>
                                                    </ul>                                                        
                                                    <% } %>
                                                </li>
                                            </ul>
                                            <% } %>
                                        <% } else { %>
                                            <% foreach (WebApp.MenuItem mi in menuData.GetGroupItems("navbar_left_no_modules")) { %>
                                            <ul class="nav navbar-nav level0">
                                                <li class="current <% = (mi.Properties.HasProperty("classes")) ? mi.Properties.GetPropertyValue("classes") : "" %>" data-id="101" data-level="1">
                                                    <% if (mi.Children.Count == 0){ %>
                                                    <a href="<% = mi.URL %>" style="padding: 17px 25px; line-height: 17px;">
                                                        <% if (mi.Properties.HasProperty("icon")){ %>
                                                            <i style="line-height:0px;" class="<% = mi.Properties.GetPropertyValue("icon") %>"></i>
                                                        <% } %>
                                                        <% if (mi.Properties.HasProperty("localize-key")){ %>
                                                            <% = Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(mi.Properties.GetLocalizePropertyValue("localize-key")), "") %>
                                                        <% }else{ %>
                                                            <% = mi.Name %>
                                                        <% } %>
                                                    </a>
                                                    <% } else { %>
                                                    <a class="dropdown-toggle" style="padding: 17px 25px; line-height: 17px;font-size: 18px; font-weight: normal;" data-toggle="dropdown">
                                                        <% if (mi.Properties.HasProperty("icon")){ %>
                                                            <i style="margin-right: 5px;" class="<% = mi.Properties.GetPropertyValue("icon") %>"></i>
                                                        <% } %>
                                                        <% if (mi.Properties.HasProperty("localize-key")){ %>
                                                            <% = Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(mi.Properties.GetLocalizePropertyValue("localize-key")), "") %>
                                                        <% }else{ %>
                                                            <% = mi.Name %>
                                                        <% } %>
                                                        <span class="caret"></span>
                                                    </a>
                                                    <ul style="min-width:190px;color: rgb(0, 0, 0);" class="dropdown-menu">
                                                        <% foreach(WebApp.MenuItem child in mi.Children){ %>
                                                            <% if (child.Children.Count == 0){ %>
                                                        <li class="text-center <% = (child.Properties.HasProperty("classes")) ? child.Properties.GetPropertyValue("classes") : "" %>">
                                                            <a href="<% = child.URL%>"><% = (child.Properties.HasProperty("localize-key")) ? Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(child.Properties.GetLocalizePropertyValue("localize-key")), "") : child.Name%></a>
                                                        </li>
                                                            <% }
                                                                else
                                                                { %>
                                                        <li class="text-center dropdown-submenu">
                                                            <a class="dropdown-toggle" style="font-size:18px; font-weight: normal;" data-toggle="dropdown">
                                                                <% if (child.Properties.HasProperty("localize-key"))
                                                                    { %>
                                                                    <% =Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(child.Properties.GetLocalizePropertyValue("localize-key")), "")%>
                                                                <% }
                                                                    else
                                                                    { %>
                                                                    <% = child.Name%>
                                                                <% } %>
                                                            </a>
                                                            <ul style="min-width:190px;color: rgb(0, 0, 0);" class="dropdown-menu">
                                                            <% foreach (WebApp.MenuItem child2 in child.Children)
                                                                { %>
                                                                <li class="text-center">
                                                                    <a href="<% = child2.URL%>"><% = (child2.Properties.HasProperty("localize-key")) ? Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(child2.Properties.GetLocalizePropertyValue("localize-key")), "") : child2.Name%></a>
                                                                </li>
                                                            <% } %>
                                                            </ul>
                                                        </li>
                                                            <% } %>
                                                        <% } %>
                                                    </ul>                                                        
                                                    <% } %>
                                                </li>
                                            </ul>
                                            <% } %>
                                            <% foreach (WebApp.MenuItem mi in menuData.GetGroupItems("navbar_left")) { %>
                                            <ul class="nav navbar-nav level0">
                                                <li class="<% = (mi.Properties.HasProperty("classes")) ? mi.Properties.GetPropertyValue("classes") : ""%>" data-id="101" data-level="1">
                                                    <% if (mi.Children.Count == 0){ %>
                                                    <a href="<% = mi.URL %>" style="padding: 17px 25px; line-height: 17px;">
                                                        <% if (mi.Properties.HasProperty("icon")){ %>
                                                            <i style="margin-right: 5px;" class="<% = mi.Properties.GetPropertyValue("icon") %>"></i>
                                                        <% } %>
                                                        <% if (mi.Properties.HasProperty("localize-key")){ %>
                                                            <% =Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(mi.Properties.GetLocalizePropertyValue("localize-key")), "") %>
                                                        <% }else{ %>
                                                            <% = mi.Name %>
                                                        <% } %>
                                                    </a>
                                                    <% } else { %>
                                                    <a class="dropdown-toggle" style="padding: 17px 25px; line-height: 17px;font-size: 18px;font-weight: normal;cursor:pointer;" data-toggle="dropdown">
                                                        <% if (mi.Properties.HasProperty("icon")) { %>
                                                            <i style="margin-right: 5px;" class="<% = mi.Properties.GetPropertyValue("icon") %>"></i>
                                                        <% } %>
                                                        <% if (mi.Properties.HasProperty("localize-key")) { %>
                                                            <% =Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(mi.Properties.GetLocalizePropertyValue("localize-key")), "")%>
                                                        <% } else { %>
                                                            <% = mi.Name%>
                                                        <% } %>
                                                        <span class="caret"></span>
                                                    </a>
                                                    <ul style="min-width:190px;color: rgb(0, 0, 0);" class="dropdown-menu">
                                                        <% foreach(WebApp.MenuItem child in mi.Children) { %>
                                                            <% if (child.Children.Count == 0) { %>
                                                        <li class="text-center <% = (child.Properties.HasProperty("classes")) ? child.Properties.GetPropertyValue("classes") : "" %>">
                                                            <a href="<% = child.URL%>">
                                                                <% = child.Name%>
                                                            </a>
                                                        </li>
                                                            <% } else { %>
                                                        <li class="text-center dropdown-submenu">
                                                            <a class="dropdown-toggle" style="font-size:18px; font-weight: normal;" data-toggle="dropdown">
                                                                <% if (child.Properties.HasProperty("localize-key")) { %>
                                                                    <% =Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(child.Properties.GetLocalizePropertyValue("localize-key")), "")%>
                                                                <% } else { %>
                                                                    <% = child.Name%>
                                                                <% } %>
                                                            </a>
                                                            <ul style="min-width:190px;color: rgb(0, 0, 0);" class="dropdown-menu">
                                                                <% foreach (WebApp.MenuItem child2 in child.Children) { %>
                                                                <li class="text-center">
                                                                    <a href="<% = child2.URL%>">
                                                                    <% = (child2.Properties.HasProperty("localize-key")) ? Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(child2.Properties.GetLocalizePropertyValue("localize-key")), "") : child2.Name%>
                                                                    </a>
                                                                </li>
                                                                <% } %>
                                                            </ul>
                                                        </li>
                                                            <% } %>
                                                        <% } %>
                                                    </ul>  
                                                    <% } %>
                                                </li>
                                            </ul>
                                            <% } %>
                                        <% } %>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </nav>
                        <!-- //MAIN NAVIGATION -->
                    </div>
                    <div class="pull-right">
                        <!-- MAIN NAVIGATION -->
                        <nav class="wrap plazart-mainnav navbar-collapse-fixed-top">
                            <div class="container navbar">
                                <div class="navbar-inner">
                                    <div class="nav-collapse collapse always-show">
                                        <div class="plazart-megamenu animate slide pull-right" data-duration="400">
                                            <div class="nav" style="color:#fff !important; width:200px; height:51px;display:none !important " id="ladlePositionView_holder">
                                               <!-- here goes the countdown delay--->
                                            </div>

                                            <% if (withModules) { %>
                                                <% foreach(WebApp.MenuItem mi in menuData.GetGroupItems("navbar_right_with_modules")){ %>
                                            <ul class="nav navbar-nav level0">
                                                <li class="current <% = (mi.Properties.HasProperty("classes")) ? mi.Properties.GetPropertyValue("classes") : "" %>" data-id="101" data-level="1">
                                                    <% if (mi.Children.Count == 0){ %>
                                                    <a href="<% = mi.URL %>" style="padding: 17px 25px; line-height: 17px;">
                                                        <% if (mi.Properties.HasProperty("icon")){ %>
                                                            <i style="margin-right: 5px;" class="<% = mi.Properties.GetPropertyValue("icon") %>"></i>
                                                        <% } %>
                                                        <% if (mi.Properties.HasProperty("localize-key")){ %>
                                                            <% =Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(mi.Properties.GetLocalizePropertyValue("localize-key")), "") %>
                                                        <% }else{ %>
                                                            <% = mi.Name %>
                                                        <% } %>
                                                    </a>
                                                    <% }else{ %>
                                                    <a class="dropdown-toggle" style="padding: 17px 25px; line-height: 17px;font-size: 18px; font-weight: normal;" data-toggle="dropdown">
                                                        <% if (mi.Properties.HasProperty("icon")){ %>
                                                            <i style="margin-right: 5px;" class="<% = mi.Properties.GetPropertyValue("icon") %>"></i>
                                                        <% } %>
                                                        <% if (mi.Properties.HasProperty("localize-key")){ %>
                                                            <% =Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(mi.Properties.GetLocalizePropertyValue("localize-key")), "") %>
                                                        <% }else{ %>
                                                            <% = mi.Name %>
                                                        <% } %>
                                                        <span class="caret"></span>
                                                    </a>
                                                    <ul style="min-width:190px;color: rgb(0, 0, 0);" class="dropdown-menu">
                                                        <% foreach(WebApp.MenuItem child in mi.Children){ %>
                                                            <% if (child.Children.Count == 0){ %>
                                                        <li class="text-center <% = (child.Properties.HasProperty("classes")) ? child.Properties.GetPropertyValue("classes") : "" %>">
                                                            <a href="<% = child.URL%>"><% = child.Name%></a>
                                                        </li>
                                                            <% } else { %>
                                                        <li class="text-center dropdown-submenu">
                                                            <a class="dropdown-toggle" style="font-size:18px; font-weight: normal;" data-toggle="dropdown">
                                                                <% if (child.Properties.HasProperty("localize-key")) { %>
                                                                    <% =Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(child.Properties.GetLocalizePropertyValue("localize-key")), "")%>
                                                                <% } else { %>
                                                                    <% = child.Name%>
                                                                <% } %>
                                                            </a>
                                                            <ul style="min-width:190px;color: rgb(0, 0, 0);" class="dropdown-menu">
                                                            <% foreach (WebApp.MenuItem child2 in child.Children)
                                                                { %>
                                                                <li class="text-center">
                                                                    <a href="<% = child2.URL%>"><% = child2.Name%></a>
                                                                </li>
                                                            <% } %>
                                                            </ul>
                                                        </li>
                                                            <% } %>
                                                        <% } %>
                                                    </ul>                                                        
                                                    <% } %>
                                                </li>
                                            </ul>
                                                <% } %>
                                            <% } else { %>
                                                <% foreach (WebApp.MenuItem mi in menuData.GetGroupItems("navbar_right_no_modules")) { %>
                                            <ul class="nav navbar-nav level0">
                                                <li class="current <% = (mi.Properties.HasProperty("classes")) ? mi.Properties.GetPropertyValue("classes") : "" %>" data-id="101" data-level="1">
                                                    <% if (mi.Children.Count == 0){ %>
                                                    <a href="<% = mi.URL %>" style="padding: 17px 25px; line-height: 17px;">
                                                        <% if (mi.Properties.HasProperty("icon")){ %>
                                                            <i style="line-height:0px;" class="<% = mi.Properties.GetPropertyValue("icon") %>"></i>
                                                        <% } %>
                                                        <% if (mi.Properties.HasProperty("localize-key")){ %>
                                                            <% =Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(mi.Properties.GetLocalizePropertyValue("localize-key")), "") %>
                                                        <% }else{ %>
                                                            <% = mi.Name %>
                                                        <% } %>
                                                    </a>
                                                    <% } else { %>
                                                    <a class="dropdown-toggle" style="padding: 17px 25px; line-height: 17px;font-size: 18px; font-weight: normal;" data-toggle="dropdown">
                                                        <% if (mi.Properties.HasProperty("icon")){ %>
                                                            <i style="margin-right: 5px;" class="<% = mi.Properties.GetPropertyValue("icon") %>"></i>
                                                        <% } %>
                                                        <% if (mi.Properties.HasProperty("localize-key")){ %>
                                                            <% =Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(mi.Properties.GetLocalizePropertyValue("localize-key")), "") %>
                                                        <% }else{ %>
                                                            <% = mi.Name %>
                                                        <% } %>
                                                        <span class="caret"></span>
                                                    </a>
                                                    <ul style="min-width:190px;color: rgb(0, 0, 0);" class="dropdown-menu">
                                                        <% foreach(WebApp.MenuItem child in mi.Children){ %>
                                                            <% if (child.Children.Count == 0){ %>
                                                        <li class="text-center <% = (child.Properties.HasProperty("classes")) ? child.Properties.GetPropertyValue("classes") : "" %>">
                                                            <a href="<% = child.URL%>"><% = child.Name%></a>
                                                        </li>
                                                            <% }
                                                                else
                                                                { %>
                                                        <li class="text-center dropdown-submenu">
                                                            <a class="dropdown-toggle" style="font-size:18px; font-weight: normal;" data-toggle="dropdown">
                                                                <% if (child.Properties.HasProperty("localize-key"))
                                                                    { %>
                                                                    <% =Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(child.Properties.GetLocalizePropertyValue("localize-key")), "")%>
                                                                <% }
                                                                    else
                                                                    { %>
                                                                    <% = child.Name%>
                                                                <% } %>
                                                            </a>
                                                            <ul style="min-width:190px;color: rgb(0, 0, 0);" class="dropdown-menu">
                                                            <% foreach (WebApp.MenuItem child2 in child.Children)
                                                                { %>
                                                                <li class="text-center">
                                                                    <a href="<% = child2.URL%>"><% = child2.Name%></a>
                                                                </li>
                                                            <% } %>
                                                            </ul>
                                                        </li>
                                                            <% } %>
                                                        <% } %>
                                                    </ul>                                                        
                                                    <% } %>
                                                </li>
                                            </ul>
                                                <% } %>
                                                <% foreach (WebApp.MenuItem mi in menuData.GetGroupItems("navbar_right")) { %>
                                            <ul class="nav navbar-nav level0">
                                                <li class="<% = (mi.Properties.HasProperty("classes")) ? mi.Properties.GetPropertyValue("classes") : ""%>" data-id="101" data-level="1">
                                                    <% if (mi.Children.Count == 0){ %>
                                                    <a href="<% = mi.URL %>" style="padding: 17px 25px; line-height: 17px;">
                                                        <% if (mi.Properties.HasProperty("icon")){ %>
                                                            <i style="margin-right: 5px;" class="<% = mi.Properties.GetPropertyValue("icon") %>"></i>
                                                        <% } %>
                                                        <% if (mi.Properties.HasProperty("localize-key")){ %>
                                                            <% =Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(mi.Properties.GetLocalizePropertyValue("localize-key")), "") %>
                                                        <% }else{ %>
                                                            <% = mi.Name %>
                                                        <% } %>
                                                    </a>
                                                    <% } else { %>
                                                    <a class="dropdown-toggle" style="padding: 17px 25px; line-height: 17px;font-size: 18px;font-weight: normal;cursor:pointer;" data-toggle="dropdown">
                                                        <% if (mi.Properties.HasProperty("icon")) { %>
                                                            <i style="margin-right: 5px;" class="<% = mi.Properties.GetPropertyValue("icon") %>"></i>
                                                        <% } %>
                                                        <% if (mi.Properties.HasProperty("localize-key")) { %>
                                                            <% =Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(mi.Properties.GetLocalizePropertyValue("localize-key")), "")%>
                                                        <% } else { %>
                                                            <% = mi.Name%>
                                                        <% } %>
                                                        <span class="caret"></span>
                                                    </a>
                                                    <ul style="min-width:190px;color: rgb(0, 0, 0);" class="dropdown-menu">
                                                        <% foreach(WebApp.MenuItem child in mi.Children) { %>
                                                            <% if (child.Children.Count == 0) { %>
                                                        <li class="text-center <% = (child.Properties.HasProperty("classes")) ? child.Properties.GetPropertyValue("classes") : "" %>">
                                                            <a href="<% = child.URL%>">
                                                                <% = child.Name%>
                                                            </a>
                                                        </li>
                                                            <% } else { %>
                                                        <li class="text-center dropdown-submenu">
                                                            <a class="dropdown-toggle" style="font-size:18px; font-weight: normal;" data-toggle="dropdown">
                                                                <% if (child.Properties.HasProperty("localize-key")) { %>
                                                                    <% =Helpers.Common.Helper.NullableObjectToTrimedString(GetLocalResourceObject(child.Properties.GetLocalizePropertyValue("localize-key")), "")%>
                                                                <% } else { %>
                                                                    <% = child.Name%>
                                                                <% } %>
                                                            </a>
                                                            <ul style="min-width:190px;color: rgb(0, 0, 0);" class="dropdown-menu">
                                                                <% foreach (WebApp.MenuItem child2 in child.Children) { %>
                                                                <li class="text-center">
                                                                    <a href="<% = child2.URL%>">
                                                                    <% = child2.Name%>
                                                                    </a>
                                                                </li>
                                                                <% } %>
                                                            </ul>
                                                        </li>
                                                            <% } %>
                                                        <% } %>
                                                    </ul>  
                                                    <% } %>
                                                </li>
                                            </ul>
                                                <% } %>
                                            <% } %>
                                            <div class="nav" id="loginView_holder">
                                                <!-- here goes the sign-in form or the user logged view --->
                                            </div>
                                            <div class="nav" style="color: #fff !important; width:100px; height:51px;" id="clockView_holder">
                                            <!-- here goes the app clock --->
                                            </div>
                                            <ul class="nav navbar-nav level0">
                                                <li class="current" data-id="101" data-level="1">
                                                    <a class="dropdown-toggle" style="padding: 17px 5px;font-size: 18px; font-weight: normal;line-height:1;" data-toggle="dropdown">
                                                        <i style="margin-right:2px;" class="fa fa-language"></i>
                                                        <!-- ES -->
                                                        <span class="caret"></span>
                                                    </a>
                                                    <ul style="min-width:50px; width:50px;margin-left:5px;color: rgb(0, 0, 0);" class="dropdown-menu">
                                                        <li style="padding:2px 2px;" class="text-center"><a data-bypass="true" style="padding:5px 5px;" href="<%= ResolveUrl("~/setLanguage.aspx?lang=ES") %>">ES</a></li>
                                                        <li style="padding:2px 2px;" class="text-center"><a data-bypass="true" style="padding:5px 5px;" href="<%= ResolveUrl("~/setLanguage.aspx?lang=EN") %>">EN</a></li>
                                                        <li style="padding:2px 2px;" class="text-center"><a data-bypass="true" style="padding:5px 5px;" href="<%= ResolveUrl("~/setLanguage.aspx?lang=PT") %>">PT</a></li>
                                                    </ul>
                                                </li>
                                            </ul>
                                            <ul class="nav navbar-nav level0">
                                                <li style="visibility:hidden;" id="configuration_icon">
                                                    <a href="!/ih/configuration" style="padding: 17px 25px; line-height: 17px;">
                                                        <i style="line-height:0px;" class="fw-icon-cog fw-icon-large configuration-icon"></i>
                                                    </a>
                                                    <div id="configuration_error_icon">
                                                        <i  class="fa fa-remove"></i>
                                                    </div>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </nav>
                        <!-- //MAIN NAVIGATION -->
                    </div>
                </div>
            </div>
        </div>
    </header>

    <%--<div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container-fluid">
                <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="brand hidden-desktop screen-title-text"></a>
                <div class="nav-collapse collapse">
                    <div class="hidden-tablet hidden-phone" style="width:100%;height:0;text-align:center;">
                        <span id="top_nav_spinner" class="top-nav-spinner hide-spinner animated"></span>
                        <h4 id="screen_title" class="screen-title hide-title animated"></h4>
                    </div>
                    <div id="menu_holder">
                        <!-- here goes the menu, according to the user logged shows more or less options --->
                        <a class="brand"><asp:Localize ID="Localize5" runat="server" meta:resourcekey="brand_title" /></a>
                    </div>
                    <ul style="display:none !important;" class="nav visible-desktop hide">
                        <li class="dropdown visible-desktop">
                            <a id="drop1" class="dropdown-toggle" data-toggle="dropdown" style="cursor:pointer;">
                            <asp:Localize runat="server" meta:resourcekey="change_language" /><b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu" role="menu" aria-labelledby="drop1" id="items-container-desktop">
                                <li><a data-bypass="" href="<%= ResolveUrl("~/setLanguage.aspx?lang=ES") %>"><asp:Localize runat="server" meta:resourcekey="change_es" /></a></li>
                                <li><a data-bypass="" href="<%= ResolveUrl("~/setLanguage.aspx?lang=EN") %>"><asp:Localize runat="server" meta:resourcekey="change_en" /></a></li>
                                <li><a data-bypass="" href="<%= ResolveUrl("~/setLanguage.aspx?lang=FR") %>"><asp:Localize runat="server" meta:resourcekey="change_fr" /></a></li>
                            </ul>
                        </li>
                    </ul>
                    <div class="nav pull-right">
                        <div class="nav" id="loginView_holder">
                            <!-- here goes the sign-in form or the user logged view --->
                        </div>
                        <div class="nav span1" id="clockView_holder">
                            <!-- here goes the app clock --->
                        </div>
                        <ul style="width:120px;" class="nav span2">
                            <!-- cog configuration icon -->
                            <li style="visibility:hidden;" id="configuration_icon"><a href="!/ih/configuration"><i class="fw-icon-cog fw-icon-large"></i><span style="margin-left:5px;"></span></a></li>
                        </ul>
                    </div>
                </div><!--/.nav-collapse -->
            </div>
        </div>
    </div>--%>

    <div id="loading" style="display:block;" class="loading-big-wrapper">
        <div class="loading-inner-wrapper">
            <h4><asp:Localize ID="Localize1" runat="server" meta:resourcekey="loading_text" /></h4>
            <div class="system-progress-bar progress progress-striped active">
                <div class="bar" style="width: 100%;"></div>
            </div>
            <div id="timeout_connection_error" style="display:none;" class="timeout-connection-error">
                <h5>
                    <asp:Localize ID="Localize2" runat="server" meta:resourcekey="timeout_slow_connection_message" />
                    <a href="javascript:location.reload()"><asp:Localize ID="Localize3" runat="server" meta:resourcekey="reload_action" /></a>
                </h5>
            </div>
        </div>
    </div>

    <script>
        //adding timeout error timeout for slow connections
        setTimeout(function () {
            if (document.getElementById('loading').style.display == "block") {
                document.getElementById('timeout_connection_error').style.display = "block";
            }
        }, 10000);
    </script>

    <div id="content_container" class="content-container hide-subnavbar">
        <!-- rowfluid that acts as a subnavbar with 59px height -->
        <div class="row-fluid fixed-subnavbar">
            <div class="span12 offset0 subnavbar-span-offset" id="subnavbar_holder">
            </div>
        </div>
        <div class="container-fluid content-inner-container">
            <div id="content" class="row-fluid content">
            </div>
        </div> <!-- /container-fluid -->
    </div>

    <!-- loading scripts via link and script tags cause the includer was taking too much, also sometimes we would get
        an error that a script could not be loaded. this is temporary solution until we find a better way to load these -->

    <link href="<%= ResolveUrl(VirtualPathUtility.GetDirectory(Request.ApplicationPath) + "IndustrialDashboard/Widgets/IndustrialContainer/Styles/IndustrialContainer.css?v=" + version)%>" rel="stylesheet" />
    <link href="<%= ResolveUrl(VirtualPathUtility.GetDirectory(Request.ApplicationPath) + "IndustrialDashboard/ForeignFiles/JSColor/Styles/jscolor.css?v=" + version)%>" rel="stylesheet" />
    <link href="<%= ResolveUrl(VirtualPathUtility.GetDirectory(Request.ApplicationPath) + "IndustrialDashboard/Widgets/IndustrialGrid/Styles/IndustrialGrid.css?v=" + version)%>" rel="stylesheet" />
    <link href="<%= ResolveUrl(VirtualPathUtility.GetDirectory(Request.ApplicationPath) + "IndustrialDashboard/Widgets/IndustrialChart/Styles/IndustrialChart.css?v=" + version)%>" rel="stylesheet" />

    <script src="<%= ResolveUrl(VirtualPathUtility.GetDirectory(Request.ApplicationPath) + "IndustrialDashboard/ForeignFiles/canvas/Scripts/excanvas.js?v=" + version)%>"></script>
    <script src="<%= ResolveUrl(VirtualPathUtility.GetDirectory(Request.ApplicationPath) + "IndustrialDashboard/ForeignFiles/canvas/Scripts/dateformat.js?v=" + version)%>"></script>
    <script src="<%= ResolveUrl(VirtualPathUtility.GetDirectory(Request.ApplicationPath) + "IndustrialDashboard/ForeignFiles/canvas/Scripts/canvastext.js?v=" + version)%>"></script>
    <script src="<%= ResolveUrl(VirtualPathUtility.GetDirectory(Request.ApplicationPath) + "IndustrialDashboard/Addons/Export/Scripts/export.js?v=" + version)%>"></script>
    <script src="<%= ResolveUrl(VirtualPathUtility.GetDirectory(Request.ApplicationPath) + "IndustrialDashboard/Widgets/DropDownSelect/Scripts/dropdownselect.js?v=" + version)%>"></script>
    <script src="<%= ResolveUrl(VirtualPathUtility.GetDirectory(Request.ApplicationPath) + "IndustrialDashboard/Widgets/IndustrialContainer/Scripts/IndustrialContainer.js?v=" + version)%>"></script>
    <script src="<%= ResolveUrl(VirtualPathUtility.GetDirectory(Request.ApplicationPath) + "IndustrialDashboard/ForeignFiles/JSColor/Scripts/jscolor.js?v=" + version)%>"></script>
    <script src="<%= ResolveUrl(VirtualPathUtility.GetDirectory(Request.ApplicationPath) + "IndustrialDashboard/Widgets/IndustrialGrid/Scripts/IndustrialGrid.js?v=" + version)%>"></script>
    <script src="<%= ResolveUrl(VirtualPathUtility.GetDirectory(Request.ApplicationPath) + "IndustrialDashboard/Widgets/IndustrialChart/Scripts/IndustrialChart.js?v=" + version)%>"></script>

    <script>
        Core.DOM.Ready(function () {
            //this is the FIRST thing that get executed in the app, the DOM Ready is called by the includer after
            //it's done loading everything it needs.

            var configPath = "<%= ResolveUrl("~/app/")%>";

            window.webapp_version = "<% = version%>";

            //settings the baseURL for the requirejs
            require.config({
                baseUrl: configPath,
                urlArgs: "<% = version %>",
            });

            //calling the config.js file thats in /app/config.js
            //this will reconfigure requirejs and also call the require.config.js (JAM) as a dependency

            require(['require-config'], function () {
            });
        });
    </script>

</asp:Content>

