<?php
/**
 * @package Flatnux_module_textandphotos
 * @author Alessandro Vernassa <speleoalex@gmail.com>
 * @copyright Copyright (c) 2012
 * @license http://opensource.org/licenses/gpl-license.php GNU General Public License
 * 
 */
defined('_FNEXEC') or die('Restricted access');
global $_FN;
$pathscript = "modules/events/lightbox_jquery/";
echo "
    <script type=\"text/javascript\">
  if (typeof jQuery == 'undefined') {  
      document.write('<scr'+'ipt type=\"text/javascript\" src=\"$pathscript/jquery.min.js\"><'+'/script>');
  }
</script>";
$_FN['section_header_footer'] .= "
  <link rel=\"stylesheet\" href=\"$pathscript/colorbox.css\" type=\"text/css\" media=\"screen\" />
  <script src=\"$pathscript/colorbox/jquery.colorbox-min.js\" type=\"text/javascript\"></script>
  <script type=\"text/javascript\">
		wide = ($(window).width()-20)+'px';
		high = ($(window).height()-20)+'px';
    $(document).ready(function(){
			$(\"a[rel='jqlightbox']\").colorbox({
        maxWidth:wide,
        maxHeight:high,
        title:function(){
          var titl = $(this).attr('title');
          var url = $(this).attr('href');
          var desc = $(this).attr('data-desc');
          return '<span title=\"' + desc + '\">' +titl + '</span>' + '&nbsp;&nbsp;&nbsp;<a href=\"" . $_FN["siteurl"] . "index.php?mod={$_FN['mod']}&downloadfile=' + url + '" . "\"><img src=\"$pathscript/download-icon.png\" title=\"" . FN_Translate("download") . "\" alt=\"" . FN_Translate("download") . "\" /></a>';
        },
        current: '{current} di {total}',
        onComplete: function(){
          var el = $('.cboxPhoto');
          var desc = $(this).attr('data-desc');
          el.attr('title',desc);
        }
      });
		});
  </script>
  ";
?>
