$(document).ready(function( )
{
  addHoverPressedEvents($('#rescuecenter'));
  var rescueClick = false;
  $('#rescuecenter').mousedown(function(e)
  {
    if (e.button == 0) {
      rescueClick = true;
    }
  });
  $('#rescuecenter').mouseup(function(e)
  {
    if (rescueClick) {
      if (e.button == 0) {
        rescueClick = false;
        tuDispatcher.trigger("launch", "RescueCenter.exe");
      }
    }
  }).keydown(function(e)
  {
    if (e.keyCode == 13) {
      rescueClick = false;
      tuDispatcher.trigger("launch", "RescueCenter.exe");
    }
  });
});

function showTrial(text)
{
  $('#trial').show( );
  $('#trial td:first').html(text);

  var prefixname = 'images/trial/buy_button_', leftBorderHover = 27, rightBorderHover = 11;

  $('#trial .button').LayerButton({
    'groupID' : 'trial',
    'normal' : {
      'imageSource' : {
        'prefix' : prefixname,
        'suffix' : '.png'
      },
      'imageBorders' : {
        'right' : rightBorderHover,
        'left' : leftBorderHover
      }
    },
    'hover' : {
      'imageSource' : {
        'prefix' : prefixname + 'hover_',
        'suffix' : '.png'
      },
      'imageBorders' : {
        'right' : rightBorderHover,
        'left' : leftBorderHover
      }
    }
  });
}
