﻿
// Open a new window and search in transversal for the specified criteria
function AskFlybmiOpenWinSearch(nlpq, kb) {
    var mfWin = window.open("http://ask.flybmi.com/templates/flybmi/seo/resultspage?nlpq=" + nlpq + "&kb=" + kb, mfWin, "screenX=10,screenY=10,left=10,top=10,width=600,height=600,resizable");
    mfWin.focus();
}

// Open a new window with the specified url
function AskFlybmiOpenWinArticle(url) {
    var mfWin = window.open(url, mfWin, "screenX=10,screenY=10,left=10,top=10,width=600,height=600,resizable");
    mfWin.focus();
}

function AskFlybmiTrackUse(el, desc) {
   // Create the Omniture tracking object, use s_account that is defined in s_code.js
    var asks = s_gi(s_account);
   asks.tl(el, 'o', desc);
}

var Top5Loaded = false;

function GetTop5Questions() {

    if (!Top5Loaded) {
        var top5 = Src_Ascx_Controls_Transversal_TopFiveFAQ.LoadTop5().value;

        if (top5 != null)
            document.getElementById('faqDiv').innerHTML = top5;

        Top5Loaded = true;
    }
}

$(function() {
    $(".search", ".search_AskFlybmi").click(function(e) {
        var element = $(this);
        var searchText =  $(".textbox", ".search_AskFlybmi").val();
        AskFlybmiOpenWinSearch(searchText, '');
        AskFlybmiTrackUse(element, 'Transversal search from top navigation')
        e.preventDefault();
    });
});