﻿function Go(url) {
    window.location.href = url;
    //document.location.reload();
}
function exibeTexto1() {
    $("#textoParte1").fadeIn(3000, function () {
        $("#textoParte1").fadeOut(3000);
        exibeTexto2();
    });
}
function exibeTexto2() {
    $("#textoParte2").fadeIn(3000, function () {
        $("#textoParte2").fadeOut(3000);
        exibeTexto3();
    });
}
function exibeTexto3() {
    $("#textoParte3").fadeIn(8000, function () {
        $("#textoParte3").fadeOut(3000);
        exibeTexto1();
    });
}
function horizontal(idMenu) {

    var navItems = document.getElementById("ulMenu").getElementsByTagName("li");

    for (var i = 0; i < navItems.length; i++) {
        if (navItems[i].className == "submenu") {
            if (navItems[i].getElementsByTagName('ul')[0] != null) {
                navItems[i].onmouseover = function () {
                    this.getElementsByTagName('div')[0].style.display = "block";
                    this.getElementsByTagName('ul')[0].style.display = "block";
                    this.getElementsByTagName('a')[0].style.color = "#d63e3e";
                }
                navItems[i].onmouseout = function () {
                    this.getElementsByTagName('div')[0].style.display = "none";
                    this.getElementsByTagName('ul')[0].style.display = "none";
                    this.getElementsByTagName('a')[0].style.color = "#000";
                }
            }
        }
    }
}

function marcaTodos() {
    $("input[type='checkbox'][grid='1']").attr("checked", "checked");

}
function desmarcaTodos() {
    $("input[type='checkbox'][grid='1']").attr("checked", "");
}

function verificaCheck() {
    if (confirma()) {
        if ($("input[type=checkbox][grid='1']").is(':checked')) {
            return true;
        } else {
            alert("Nenhum item selecionado.");
            return false;
        }
    } else {
        return false;
    }
}

function confirma() {
    var conf = window.confirm("Você deseja realmente realizar essa ação");
    return conf;
}
