// JavaScript Document

var menuItemAtivo = "";
var menuImagemAtivo = "";

$(document).ready(function () {
    //png

    var all = $(".top_menu_servicos").children("li").children("a");
    var allSub = $(".top_menu_servicos").children("li").children("ul");


    all.mouseover(function () {
        allSub.each(function () { $(this).css("display", "none") });
        all.each(function () { $(this).parents("li").removeClass("current"); });
        $(this).parents("li").addClass("current");
        $(this).parent(".current").children("ul").slideDown("normal", function () {
           $(this).css("display", "");
        });

    });

    $('#submenuLink1').mouseover(function () {
        $(this).attr('class', 'redFont submenu_cursor');
    });

    $('#submenuLink1').mouseout(function () {
        $(this).attr('class', 'submenu_cursor');
    });

    $('#submenuLink2').mouseover(function () {
        $(this).attr('class', 'redFont submenu_cursor');
    });

    $('#submenuLink2').mouseout(function () {
        $(this).attr('class', 'submenu_cursor');
    });

    $('#submenuLink3').mouseover(function () {
        $(this).attr('class', 'redFont submenu_cursor');
    });

    $('#submenuLink3').mouseout(function () {
        $(this).attr('class', 'submenu_cursor');
    });

    $('#submenuLink4').mouseover(function () {
        $(this).attr('class', 'redFont submenu_cursor');
    });

    $('#submenuLink4').mouseout(function () {
        $(this).attr('class', 'submenu_cursor');
    });

    $('#submenuLink5').mouseover(function () {
        $(this).attr('class', 'redFont submenu_cursor');
    });

    $('#submenuLink5').mouseout(function () {
        $(this).attr('class', 'submenu_cursor');
    });

    $('#submenuLink6').mouseover(function () {
        $(this).attr('class', 'redFont submenu_cursor');
    });

    $('#submenuLink6').mouseout(function () {
        $(this).attr('class', 'submenu_cursor');
    });
	
    //VerificarMenuAtivo();

});

function OpenPage(pURL) {
    document.location.href = pURL;
}

function VerificarMenuAtivo() {
    //    objControl = '#' + menuItemAtivo;
    //    $(objControl).attr('src',menuImagemAtivo);
}

function MenuChange(sControlName, sFileName) {
    objControl = '#' + sControlName;
    $(objControl).attr('src', sFileName);

    VerificarMenuAtivo();
}

function mostraAeroportos() {
    newwindow = window.open('pop_aeroportos.html', 'janela', 'height=400,width=560,scrollbars=1');
    if (window.focus) { newwindow.focus() }
    return false;
}

function ChamarModal(pContainerName, pFileName) {

    var sContainerName = '#' + pContainerName;

    $(sContainerName).load(pFileName);
    $.blockUI({
        message: jQuery(sContainerName),
        css: {
            top: (jQuery(window).height() - 334) / 2 + 'px',
            left: (jQuery(window).width() - 556) / 2 + 'px',
            width: '556',
            border: 'none',
            background: 'none',
            cursor: 'default'
        }
    });
}

function chamaLoading() {
    $('#chamaPopLoading').load('aeroporto_loading.html');
    $.blockUI({
        message: jQuery('#chamaPopLoading'),
        css: {
            top: (jQuery(window).height() - 302) / 2 + 'px',
            left: (jQuery(window).width() - 500) / 2 + 'px',
            width: '500',
            border: 'none',
            background: 'none',
            cursor: 'default'
        }
    });
}


function ModalInfo() {
    $('#chamaPopModal').load('selecionar_voo_info.html');
    $.blockUI({
        message: jQuery('#chamaPopModal'),
        css: {
            top: (jQuery(window).height() - 118) / 2 + 'px',
            left: (jQuery(window).width() - 664) / 2 + 'px',
            width: '664',
            border: 'none',
            background: 'none',
            cursor: 'default'
        }
    });
}

function ModalInfo2() {
    $('#chamaPopModal').load('selecionar_voo_info2.html');
    $.blockUI({
        message: jQuery('#chamaPopModal'),
        css: {
            top: (jQuery(window).height() - 118) / 2 + 'px',
            left: (jQuery(window).width() - 664) / 2 + 'px',
            width: '664',
            border: 'none',
            background: 'none',
            cursor: 'default'
        }
    });
}

function comprarDuvidas() {
    $('#chamaPopModal').load('compra_oqueeisso.html');
    $.blockUI({
        message: jQuery('#chamaPopModal'),
        css: {
            top: (jQuery(window).height() - 259) / 2 + 'px',
            left: (jQuery(window).width() - 394) / 2 + 'px',
            width: '394',
            border: 'none',
            background: 'none',
            cursor: 'default'
        }
    });
}




function fecharModal() {
    $.unblockUI();
    $('#chamaPopModal').html('');
}

$(function () {
    $('#submenu_viagens').hide();
});

