﻿// In Form init
function InitDropDownMenuScripts() 
{
    // Creates the menu
    $(document).ready(function() {

        // Use the each() method to gain access to each elements attributes
        $("div.menu-corona ul li a, div.menu-Institucional ul li a").each
        (
            function() 
            {
                if ($(this).parent("li").children("div").length > 0) 
                {
                    $(this).qtip
                    (
                        {
                            content: 
                            {
                                // Set the text to an image HTML string with the correct src URL to the loading image you want to use
                                text: $(this).parent("li").children("div").html(),
                                title: 
                                {
                                    button: 'close' // Show a close link in the title
                                }
                            },
                            position: 
                            {
                                corner: 
                                {
                                    target: 'bottomLeft', // Position the tooltip above the link
                                    tooltip: 'topLeft'
                                },
                                adjust: 
                                {
                                    screen: true // Keep the tooltip on-screen at all times
                                }
                            },
                            hide: {
                                fixed: true // Make it fixed so it can be hovered over
                            },

                            style: 
                            {
                                padding: 5,
                                background: '#3bb8e9',
                                color: '#fff',
                                textAlign: 'left',
                                width: { width: { min: 150} },
                                border: 
                                {
                                    width: 3,
                                    radius: 0,
                                    color: '#fff'
                                },
                                tip: false, // Apply a speech bubble tip to the tooltip at the designated tooltip corner
                                name: 'light' // Use the default light style
                            }
                        }
                    );
                }
            }
        );
    });
}

//initialize scripts
$(function() {
    InitDropDownMenuScripts();
});



