<?php 
defined('_JEXEC') or die;
$document = JFactory::getDocument();
$document->addStyleSheet(JURI::root(true).'/modules/mod_parallax/css/parallax.css');
$document->addScript(JURI::root(true).'/modules/mod_parallax/js/jquery.parallax.js');
//$document->addScript(JURI::root(true).'/modules/mod_parallax/js/smoothing-scroll.js');
//print_r($params->get('selector'));
?>
<script type="text/javascript">

jQuery(document).ready(function() { 
  if (jQuery('html').hasClass('desktop')) {
	  var bgrotation = '<?php echo $params->get('backgroundratio');?>';
	  var selector = '<?php echo $params->get('selector');?>';
	  jQuery(selector).children('.container').wrap('<div class="stellar-block" data-stellar-background-ratio="'+bgrotation+'"></div>');

  }
});
</script>
<script type="text/javascript">
jQuery(document).ready(function() { 
  if (jQuery('html').hasClass('desktop')) {
	  jQuery.stellar({
		horizontalScrolling: false,
		verticalScrolling: false,
		horizontalOffset:<?php echo $params->get('horizontalOffset');?>,
		verticalOffset: <?php echo $params->get('verticalOffset');?>
	  });

  }
  jQuery(function () {
      //jQuery.srSmoothscroll({
       // step: 105,
        //speed: 100,
       //ease: 'linear'
      //});
    }); 
});
</script>
<style>
<?php echo $params->get('selector');?> .stellar-block {
  background-image: url(<?php if($params->get('mod_image')!=null){echo JURI::root(true).'/'.$params->get('mod_image');}?>);
  background-position: 50% 100%;
}
@media only (min-width: 320px) and (max-width: 767px) { 
  <?php echo $params->get('selector');?>  {
    background-image: url(<?php if($params->get('mod_image')!=null){echo JURI::root(true).'/'.$params->get('mod_image');}?>);
 	background-position: 50% 50%;
	 background-attachment: scroll!important;
  }
}
</style>
