<?php
/**
  @licence GPL 2005-2010  The osCSS developers - osCSS Open Source E-commerce
  @subpackage plugin lazyload
  @package osCSS-2 <www http://www.oscss.org>
  @author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
  @encode UTF-8
*/

/**
  Definition des scripts du plugins
*/
function lazyload_scripts(){
  global $page;
  $dir_ws_here=$page->getPathTemplate().'includes/plugins/generic/lazyload/';
  $scripts=array('jquery'=> array(
                    'type'=>'framework',
                    'file'=>"ext/jquery/jquery.min.js",
                    'pages'=>''
                                ),
                'lazyload'=>array(
                    'type'=>'script',
		    'place'=>'footer',
                    'file'=>array(
                                  $dir_ws_here."lib/jquery.lazyload.js"
                                ),
                    'sort'=> 6
                              ),
               );
  return $scripts;
}

function lazyload_init_scripts(){
  $scripts=array(
                 'exec_lazyload'=>array(
                                     'type'=>'function',
                                     'code_exe'=>'lazyload_exec'
                                    )
                );
  return $scripts;
}

function lazyload_exec(){
  $s ='<script type="text/javascript">//<!--'."\n"
         .'$(function() {'."\n"
            .'$("img").lazyload({'."\n"
              .'effect : "fadeIn", '."\n"
            .'});'."\n"
//           .' '."\n"
        .'});'."\n"


      .'// --></script>';


  return $s;
}
?>