$(function() {
  // create markup
  $('#description').append('<h2></h2><p></p>');
});

function showDescription(id) {
  var selected = data[parseInt(id)];
  var $desc = $('#description');
  var $title = $('h2', $desc).text(selected.title);
  $('p', $desc).text(selected.description);

  if (selected.ico != '') {
    $('<img>').attr({
      src: tpl + 'images/ico/' + selected.ico,
      alt: ''
    }).prependTo($title);  
  }
}

function removeDescription() {
  $('#description').html('<h2></h2><p></p>');
}

