$(document).ready(function () {

  Cufon.replace('h1', { fontFamily: 'Univers LT Std' });

  $(".showMeMore").toggle(function () {
    $('#box_performance').slideDown();
    $(this).html('<span class="icon"> &lt;</span> Close');
  }, function () {
    $('#box_performance').slideUp();
    $(this).html('View all <span class="icon"> &gt;</span>');
  });

  $('#performancefigures ul a').append(' <span class="icon"> &gt;</span>');

});




// Video
jQuery.timer = function (time, func, callback) {
  var a = { timer: setTimeout(func, time), callback: null }
  if (typeof (callback) == 'function') { a.callback = callback; }
  return a;
};

jQuery.clearTimer = function (a) {
  clearTimeout(a.timer);
  if (typeof (a.callback) == 'function') { a.callback(); };
  return this;
};

$(document).ready(function () {
  var myTimer = {};

  $("#flashbanner").hide();
  $("#watchvideo").click(function () {
    $("#banner h2").animate({ "top": "+=500px" }, 1000);

    myTimer = $.timer(500, function () {
      $("#banner").animate({ height: "420px" }, 1000)
    });

    myTimer = $.timer(1000, function () {
      $("#flashbanner").show(500);
      $("#flashbanner").append('<script type="text/javascript" src="/scripts/fmovideo.js"></script><div id="FMOVideo">&nbsp;</div>');
    });

  });


  $("#closevideo").click(function () {
    $("#flashbanner").hide(500);

    myTimer = $.timer(500, function () {
      $("#flashbanner #FMOVideo").remove();
      $("#banner").animate({ height: "150px" }, 1000)
    });

    myTimer = $.timer(800, function () {
      $("#banner h2").animate({ "top": "-=500px" }, 1000);
    });

    //IE8: stop video:
    //movie = getFlashMovie("FMOVideo"); alert(movie);
    //movie = null;
  });
});

$(function () {
  function setClass(className) { $("." + className).css("background", "red"); }
});

