/*
 * setupTips
 * =========
 *
 * Setup the help tips that are accessed by clicking question marks on
 * the pages.
 *
 */
function setupTips() {

    // Set the global qTip style for help boxes
    $.fn.qtip.styles.helpstyle = {
      tip: 'leftMiddle',
      name: 'cream',
      border: {
        width: 1,
        radius: 5
      }
    };

    /*
     * Here are the help tooltips
     */
 // For the funding body selector
    $("#fundingTip").qtip({
       content: 'There are two types of UK funding body for HECToR applications: a) partner research councils (EPSRC, BBSRC, NERC); and b) non-partner research councils (AHRC, ESRC, MRC, STFC). The two types have different notional costs when filling in the HECToR Application Form.',
       position: {
         corner: {
              target: 'rightMiddle',
              tooltip: 'leftMiddle'
          }
       },
       style: 'helpstyle',
       show: 'mousedown',
       hide: 'unfocus'
    });
    // For the phase selector
    $("#phaseTip").qtip({
       content: 'The HECToR hardware will change throughout the lifetime of the service - these are referred to as "phases". For more information on the hardware please see <a href="http://www.hector.ac.uk/abouthector/">the about HECToR page</a>.',
       position: {
         corner: {
              target: 'rightMiddle',
              tooltip: 'leftMiddle'
          }
       },
       style: 'helpstyle',
       show: 'mousedown',
       hide: 'unfocus'
    });

    // For the parallel processes
    $("#prosTip").qtip({
       content: 'If your code uses MPI then you can use the maximum number of cores specified in the HECToR queue configuration. If your code is only based on OpenMP then you can only use a maximum that corresponds to the maximum number of cores on a node. You should specify a whole number of processes here.',
       position: {
         corner: {
              target: 'rightMiddle',
              tooltip: 'leftMiddle'
          }
       },
       style: 'helpstyle',
       show: 'mousedown',
       hide: 'unfocus'
    });

    // For the number of processes per node
    $("#nodeTip").qtip({
       content: 'For most uses you will use the maximum number of parallel processes on a node. If you require more memory per process than the default available, you can underpopulate a node.',
       position: {
         corner: {
              target: 'rightMiddle',
              tooltip: 'leftMiddle'
          }
       },
       style: 'helpstyle',
       show: 'mousedown',
       hide: 'unfocus'
    });

    // For the job time
    $("#timeTip").qtip({
       content: 'Currently the longest time for a single job on HECToR is 12 hours. You can put fractions of hours into this field.',
       position: {
         corner: {
              target: 'rightMiddle',
              tooltip: 'leftMiddle'
          }
       },
       style: 'helpstyle',
       show: 'mousedown',
       hide: 'unfocus'
    });

    // For the number of jobs of this type
    $("#njobTip").qtip({
       content: 'This field is only used to calculate the total kAUs and cost for jobs of this type. It also determines the percentages of jobs of this type. You should enter a whole number of jobs here.',
       position: {
         corner: {
              target: 'rightMiddle',
              tooltip: 'leftMiddle'
          }
       },
       style: 'helpstyle',
       show: 'mousedown',
       hide: 'unfocus'
    });
    
 // For the number of jobs of this type
    $("#ausTip").qtip({
       content: 'The number of kAUs is based on the number of nodes your job uses as this is the smallest amount of resource that can be reserved.',
       position: {
         corner: {
              target: 'rightMiddle',
              tooltip: 'leftMiddle'
          }
       },
       style: 'helpstyle',
       show: 'mousedown',
       hide: 'unfocus'
    });
}

