// $Id$

/**
 * @file
 * Module JS
 */

(function ($) {
  $().ready(function () {
    
    /**
     * Add Scrolling Anchors
     */
    $(".toc a").click(function() {
      
      //how far from the screen top do you want the item to land after scrolling
      var distanceFromTop = 50;
      var speed = 500;
      
      //get the name of the anchor
      var anchor = $(this).attr('href').split('#');
      
      //get the y point of the element to scroll to
      var destination = $('div.faqs-wrapper.' + anchor[1]).offset().top;
      
      //do the scrolling
      $("html:not(:animated),body:not(:animated)")
      .animate(
        {
          scrollTop: destination - distanceFromTop
        },
        {
          duration: speed,
          easing: "swing"
        }
      );
      return false;
    });
  });
})(jQuery);

/**
 * Open an url in a popup window
 *
 * @param string URL
 * @param int width
 * @param int height
 * 
 **/
function popUp(URL, width, height) {
  day = new Date();
  id = day.getTime();
  window.open(URL, id, "status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=0,height=" + height + ",width=" + width);
}



;

