$(document).ready(function () {

    $(".tooltipsource").each(function(){
      $(this).qtip({
        content: {
          text: $(this).html(),
          prerender: true
        },
        style: {
          width: 247,
          padding: 0,
          background: 'transparent',
          border: 0
        },
        position: {
            corner: {
               target: 'topMiddle',
               tooltip: 'bottomMiddle'
            },
            adjust: {
              y: 0,
              x: -1
            }
         },
         api: {
            onShow: function(){
              $("ul li a[rel=t-"+ $(this).attr("id") + "]").parent().addClass("active");
            },
            onHide: function(){
              $("ul li a[rel=t-"+ $(this).attr("id") + "]").parent().removeClass("active");
            }
          }
      });
    });
    $("ul.tooltiptrigger li").hover(
      function () {
        var sRel = $(this).find("a").attr("rel");
        var iId = sRel.substring(2);
        $(this).addClass("active");
        $(".qtip[qtip="+ iId +"]").fadeIn();
      }, 
      function () {
        var sRel = $(this).find("a").attr("rel");
        var iId = sRel.substring(2);
        $(this).removeClass("active");
        $(".qtip[qtip="+ iId +"]").hide();
      }
    );
  
  $("#trifix-campaign .list-view .item-image").click(function() {
    var iILayerHeight = $(this).parent().find(".video-layer").height();
    $(this).parent().css( "height", iILayerHeight );
    $(this).parent().find(".video-layer").show();
    return false;
  });
  $("#trifix-campaign .list-view .video-layer a").click(function() {
    $(this).parent().hide();
    $(this).parent().parent().css( "height", "auto" );
    return false;
    
    }); 

  });
