function history_back(event) {
  event.stopPropagation();
  event.preventDefault();
  history.back();
}

$(window).bind('load', function() {
  var links = $('a[href]');
  links.each(function (index, value) {
    var protocol = jQuery.url.setUrl($(value).attr('href')).attr('protocol') || 'http';
    if (protocol=='http' && (value.rel=='external' || value.href.indexOf('http://' + window.location.host,0)==-1)) {
      value.target = '_blank';
      value.rel='';
    }
  });
  var backs = $('a[rel=back]');
  if (backs) {
    backs.each(function(index, back) {back.bind('click', history_back)});
  }
  $('a[rel=lightbox]').lightBox({
    overlayBgColor: '#000',
    overlayOpacity: 0.4,
    imageLoading: '/images/lightbox/loading.gif',
    imageBtnClose: '/images/lightbox/fr/closelabel.gif',
    imageBtnPrev: '/images/lightbox/precedent.png',
    imageBtnNext: '/images/lightbox/suivant.png',
    imageBlank: '/images/lightbox/lightbox-blank.gif',
    txtOf: '/'
   });
});

