// JavaScript Document

var menuItemAtivo = "";
var menuImagemAtivo = "";

$(document).ready(function(){
    
    $('#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');
    });
    
    VerificarMenuAtivo();

});

function OpenPage(pURL)
{
    document.location.href = pURL;
}

function VerificarMenuAtivo() {
    if (menuImagemAtivo != null && menuItemAtivo.length > 0) {
        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();
 });
