﻿/*************      FUNÇÕES JAVASCRIPT    *********/

function CallContentTransition(targetElement) {
    var $targetList = $(targetElement.find('ul'));
    var $transition = $($targetList).attr('class').toLowerCase();

    if ($transition.match('slm_transitions_ticker')) {
        $('.tooltip-target').ezpz_tooltip({ contentPosition: "belowRightFollow", stayOnContent: true });

    }
    else if ($transition.match('slm_transitions_defaultcarousel') && targetElement.find('img').length > 0) {
        $($targetList.parent()).carousel({ pagination: true, autoSlide: true, btnsPosition: "inside", loop: true, delayAutoSlide: 2000, autoSlideInterval: 5000 });
        if (targetElement.find('.carousel-pagination a').length == 1)
            targetElement.find('.carousel-pagination p').hide();
    }
    var countLItens = 0;
    $("#slm_tab_container .menu > li").each(function () {
        countLItens++;
        $(this).click(function (e) {
            // alterar pra Permitir 2 tab sections

            $(this).parent().find("li").removeClass("active");
            $(this).addClass("active");
            $("div.slm_tab_content").hide();
            $("div.slm_tab_content." + $(this).attr('id')).show();
            return false;
        });
    });
    if (countLItens < 3)
        $("#slm_tab_container").width(350);
    else $("#slm_tab_container").width(130 * countLItens);

    targetElement.find('#EmbeddedContent').each(function () { if ($(this).attr('src').length > 0) { $(this).html('<iframe frameborder=0 scrolling=no src=' + $(this).attr('src') + '?Agencia=' + $(this).attr('Agencia') + '></iframe>'); } });

}


