<?php // no direct access
defined('_JEXEC') or die('Restricted access');
JHTML::_( 'behavior.modal' );
error_reporting('E_ALL');
$col= 1 ;
$pwidth= ' width'.floor ( 100 / $products_per_row );
if ($products_per_row > 1) { $float= "floatleft";}
else {$float="center";}
?>
<div class="vmgroup<?php echo $params->get( 'moduleclass_sfx' ) ?>">
<?php if ($headerText) { ?>
	<div class="vmheader"><?php echo $headerText ?></div>
<?php }
if ($display_style =="div") {

?>

<?php 
$last = count($products)-1;
?>

<div class="list_carousel responsive layout2">
<ul id="slider<?php echo $params->get( 'class_sfx' ) ?>" class="vmproduct">
 <li>
  <?php foreach ($products as $product) :
   $discont = $product->prices[discountAmount];
  $discont = abs($discont);
    foreach ($product->categoryItem as $key=>$prod_cat) {
			$virtuemart_category_id=$prod_cat['virtuemart_category_id'];
			}

  ?>

    <div class="product-box hover spacer <?php if ($discont>0) { echo 'disc';} ?> ">
        <input type="hidden" class="quick_ids" name="virtuemart_product_id" value="<?php echo $product->virtuemart_product_id ?>"/> 

      <?php if (($product->prices['override'] == -1 || $product->prices['override'] == 1) && ($product->prices['product_price_publish_down'] > 0)){
	  $data = $product->prices['product_price_publish_down'];
	$data = explode(' ', $data);
	$time = explode(':', $data[1]);
	$data = explode('-', $data[0]);
	//var_dump($data);
	 $year = $data[0];
	 $month = $data[1];
	 $data = $data[2];
	//var_dump($time);
		?>
		<div class="count_holder_small">
		<div class="count_info"><?php echo JText::_('DR_LIMITED')?></div>
		<div id="CountSmallFeatured<?php echo $product->virtuemart_product_id.$params->get( 'class_sfx' ); ?>" class="count_border">
		 <script type="text/javascript">
		jQuery(function () {    
			jQuery('#CountSmallFeatured<?php echo $product->virtuemart_product_id.$params->get( 'class_sfx' ); ?>').countdown({
				until: new Date(<?php echo $year; ?>, <?php echo $month; ?> - 1, <?php echo $data; ?>), 
				labels: ['Years', 'Months', 'Weeks', '<?php echo JText::_('DR_DAYS')?>', '<?php echo JText::_('DR_HOURS')?>', '<?php echo JText::_('DR_MINUTES')?>', '<?php echo JText::_('DR_SECONDS')?>'],
				compact: false});
		});
		 </script>
		 </div>
		 </div>
	  <?php } ?>

 <?php if ($show_img) { ?>
    <div class="browseImage ">
		<?php
        $stockhandle = VmConfig::get ('stockhandle', 'none');
        if (($stockhandle == 'disableit' or $stockhandle == 'disableadd') and (($product->product_in_stock - $product->product_ordered) < 1) || 
                (($product->product_in_stock - $product->product_ordered) < $product->min_order_level ))  { ?>
                <div class="discount sold"><?php echo JText::_('DR_SOLD');?></div>
         <?php } ?>   

     <?php if (($product->prices['override'] == -1 || $product->prices['override'] == 1) && ($product->prices['product_price_publish_down'] > 0)){ ?>
    <div class="discount limited"><?php echo JText::_('DR_LIMITED_OFFER');?></div>
      <?php } elseif($discont >0 && $product->product_sales < 20 ) { ?>
     <div class="discount"><?php echo JText::_('DR_SALE');?></div>
		<?php } elseif ($product->product_sales > 20) {?>
          <div class="hit"><?php echo JText::_('DR_HOT');?></div>
          <?php } ?>
			<div class="img-wrapper">
			   <?php
                        $image = $product->images[0]->displayMediaThumb('class="browseProductImage featuredProductImageFirst" id="Img_to_Js_'.$product->virtuemart_product_id.'" border="0"',false) ;
                        if(!empty($product->images[1])){
                         $image2 = $product->images[1]->displayMediaThumb('class="browseProductImage featuredProductImageSecond" border="0"',false) ;
                        } else {$image2= $product->images[0]->displayMediaThumb('class="browseProductImage featuredProductImageSecond" border="0"',false) ;}
                        echo JHTML::_('link', JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$virtuemart_category_id),'<div class="front">'.$image.'</div><div class="back">'.$image2.'</div>');
                ?>
              </div>
            
    
    
	</div>        
    <div class="slide-hover">
    	<div class="wrapper">
			  <?php if ($show_title) { ?>
                    <div class="Title">
                    <?php echo JHTML::link(JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$virtuemart_category_id), shopFunctionsF::limitStringByWord($product->product_name,'40','...'), array('title' => $product->product_name)); ?>
                    </div>
            <?php } ?>	
                 <?php if ($show_category) { ?>
                    <div class="Categories">
                    <?php echo JHTML::link(JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id='.$virtuemart_category_id), shopFunctionsF::limitStringByWord($product->category_name,'40','...'), array('title' => $product->category_name)); ?>
                    </div>
            <?php } ?>	

			<?php if ($show_ratings) { ?>
				 <?php
				  $showRating = $ratingModel->showRating($product->virtuemart_product_id);
										 if ($showRating=='true'){
                $rating = $ratingModel->getRatingByProduct($product->virtuemart_product_id);
                if( !empty($rating)) {
                    $r = $rating->rating;
                } else {
                    $r = 0;
                }
                $maxrating = VmConfig::get('vm_maximum_rating_scale',5);
								$ratingwidth = ( $r * 100 ) / $maxrating;//I don't use round as percetntage with works perfect, as for me
					?>
                                                
                        <span class="vote">
                            <span title="" class="vmicon ratingbox" style="display:inline-block;">
                                <span class="stars-orange" style="width:<?php echo $ratingwidth;?>%">
                                </span>
                            </span>
                        </span>
           		 <?php } } ?>								
			<?php } ?>
            <?php if ($show_price) { ?>	
              <?php if ((!empty($product->prices['salesPrice'])) && !$product->images[0]->file_is_downloadable) { ?>
        <div class="Price">
        <?php
				 if ($product->prices['basePriceWithTax']>0 && $discont >0) 
                    echo '<span class="WithoutTax">' . $currency->createPriceDiv('basePriceWithTax','',$product->prices,true) . '</span>';
                if ($product->prices['salesPrice']>0)
                    echo '<span class="sales">' . $currency->createPriceDiv('salesPrice','',$product->prices,true) . '</span>';
              
        ?>			
        </div>
	<?php } else {
									if ($product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) ) { ?>
									<div class="call-a-question">
                                     	<a class="call modal"  rel="{handler: 'iframe', size: {x: 460, y: 550}}" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=askquestion&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$virtuemart_category_id.'&tmpl=component'); ?>" ><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ASKPRICE') ?></a>
                                    </div>
									<?php } } ?> 
    <?php } ?> 
		</div>
         
		<?php if ($show_desc) { ?>
			<div class="description">
				<?php echo shopFunctionsF::limitStringByWord($product->product_s_desc, $row, '...') ?>
			</div>
		<?php } ?>	
		
            <div class="wrapper-slide">
			<?php if ($show_addtocart) echo mod_virtuemart_product::addtocart($product);?>
             <?php if(is_file(JPATH_BASE.DS."components/com_wishlists/template/wishlists.tpl.php")){  ?>
                 <div class="wishlist list_wishlists<?php echo $product->virtuemart_product_id;?>">
                    <?php require(JPATH_BASE.DS."components/com_wishlists/template/wishlists.tpl.php"); ?>
                 </div>
               <?php } ?>       
                 <?php if(is_file(JPATH_BASE.DS."components/com_comparelist/template/comparelist.tpl.php")){  ?>
                 <div class="jClever compare_cat list_compare<?php echo $product->virtuemart_product_id;?>">
                    <?php require(JPATH_BASE.DS."components/com_comparelist/template/comparelist.tpl.php"); ?>
                 </div>
               <?php } ?>       
			<?php if ($show_det) { ?>
			<div class="Details">
				<?php echo JHTML::link(JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$virtuemart_category_id), JText::_('DR_DETAILS')); ?><?php ?> 
			</div>
			<?php } ?>
			</div>
    	</div>
    </div>
     
    
    
		<?php
            if ($col == $products_per_row && $products_per_row && $last) {
                echo "</li><li>";
                $col= 1 ;
            } else {
                $col++;
            }
			$last--;
            endforeach; ?>
	</li>
</ul>
<div class="clearfix"></div>
				<a id="prev<?php echo $params->get( 'class_sfx' ) ?>" class="list_prev" href="#"><span>&lt;</span></a>
				<a id="next<?php echo $params->get( 'class_sfx' ) ?>" class="list_next" href="#"><span>&gt;</span></a>
</div>
<script type="text/javascript">
	jQuery(document).ready(function($) {
		 $(function() {
    	$('.list_carousel div.product-box').each(function() {        
        var tip = $(this).find('div.count_holder_small');

        $(this).hover(
            function() { tip.appendTo('body'); },
            function() { tip.appendTo(this); }
        ).mousemove(function(e) {
            var x = e.pageX + 60,
                y = e.pageY - 50,
                w = tip.width(),
                h = tip.height(),
                dx = $(window).width() - (x + w),
                dy = $(window).height() - (y + h);

            if ( dx < 50 ) x = e.pageX - w - 60;
            if ( dy < 50 ) y = e.pageY - h + 130;

            tip.css({ left: x, top: y });
        	});         
    	});

		});

	});
</script>

<?php
} else { 
?>
<?php 
$last = count($products)-1;
?>

<div class="list_carousel responsive layout">
<ul id="slider<?php echo $params->get( 'class_sfx' ) ?>" class="vmproduct">
 <li>
  <?php foreach ($products as $product) : 
  $discont = $product->prices[discountAmount];
  $discont = abs($discont);
    foreach ($product->categoryItem as $key=>$prod_cat) {
			$virtuemart_category_id=$prod_cat['virtuemart_category_id'];
			}

  ?>

  <div class="prod-row">
      <input type="hidden" class="quick_ids" name="virtuemart_product_id" value="<?php echo $product->virtuemart_product_id ?>"/> 

  <?php if (($product->prices['override'] == -1 || $product->prices['override'] == 1) && ($product->prices['product_price_publish_down'] > 0)){
	 $data = $product->prices['product_price_publish_down'];
	$data = explode(' ', $data);
	$time = explode(':', $data[1]);
	$data = explode('-', $data[0]);
	//var_dump($data);
	 $year = $data[0];
	 $month = $data[1];
	 $data = $data[2];
	//var_dump($time);
		?>
		<div class="count_holder_small">
		<div class="count_info"><?php echo JText::_('DR_LIMITED')?></div>
		<div id="CountSmallFeatured<?php echo $product->virtuemart_product_id.$params->get( 'class_sfx' ); ?>" class="count_border">
		 <script type="text/javascript">
		jQuery(function () {    
			jQuery('#CountSmallFeatured<?php echo $product->virtuemart_product_id.$params->get( 'class_sfx' ); ?>').countdown({
				until: new Date(<?php echo $year; ?>, <?php echo $month; ?> - 1, <?php echo $data; ?>), 
				labels: ['Years', 'Months', 'Weeks', '<?php echo JText::_('DR_DAYS')?>', '<?php echo JText::_('DR_HOURS')?>', '<?php echo JText::_('DR_MINUTES')?>', '<?php echo JText::_('DR_SECONDS')?>'],
				compact: false});
		});
		 </script>
		 </div>
		 </div>
	  <?php } ?>
 <div class="product-box front_w spacer <?php if ($discont>0) { echo 'disc';} ?> ">
 <?php if ($show_img) { ?>
    <div class="browseImage ">
    <?php
        $stockhandle = VmConfig::get ('stockhandle', 'none');
        if (($stockhandle == 'disableit' or $stockhandle == 'disableadd') and (($product->product_in_stock - $product->product_ordered) < 1) || 
                (($product->product_in_stock - $product->product_ordered) < $product->min_order_level ))  { ?>
                <div class="discount sold"><?php echo JText::_('DR_SOLD');?></div>
         <?php } ?>   
     <?php if (($product->prices['override'] == -1 || $product->prices['override'] == 1) && ($product->prices['product_price_publish_down'] > 0)){ ?>
    <div class="discount limited"><?php echo JText::_('DR_LIMITED_OFFER');?></div>
      <?php } elseif($discont >0 && $product->product_sales < 20 ) { ?>
     <div class="discount"><?php echo JText::_('DR_SALE');?></div>
		<?php } elseif ($product->product_sales > 20) {?>
          <div class="hit"><?php echo JText::_('DR_HOT');?></div>
          <?php } ?>
			<?php
			if (!empty($product->images[0]) )
					$image = $product->images[0]->displayMediaThumb('class="browseProductImage featuredProductImage" id="Img_to_Js_'.$product->virtuemart_product_id.'" border="0"',false) ;
				else $image = '';
					echo JHTML::_('link', JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$virtuemart_category_id),$image);
			?>
	</div>
   <?php } ?> 
   <?php if ($show_title) { ?>
            <div class="Title">
            <?php echo JHTML::link(JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$virtuemart_category_id), shopFunctionsF::limitStringByWord($product->product_name,'40','...'), array('title' => $product->product_name)); ?>
        	</div>
	<?php } ?>	
    <?php if ($show_category) { ?>
                    <div class="Categories">
                    <?php echo JHTML::link(JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id='.$virtuemart_category_id), shopFunctionsF::limitStringByWord($product->category_name,'40','...'), array('title' => $product->category_name)); ?>
                    </div>
            <?php } ?>	
    <?php if ($show_price) { ?>	
     <?php if ((!empty($product->prices['salesPrice'])) && !$product->images[0]->file_is_downloadable) { ?>
        <div class="Price">
        <?php
				 
				 if ($product->prices['basePriceWithTax']>0 && $discont >0) 
                    echo '<span class="WithoutTax">' . $currency->createPriceDiv('basePriceWithTax','',$product->prices,true) . '</span>';
            	   if ($product->prices['salesPrice']>0)
                    echo '<span class="sales">' . $currency->createPriceDiv('salesPrice','',$product->prices,true) . '</span>';
               
                if ($discont>0) 
                echo '<span class="discount">' . $currency->createPriceDiv('discountAmount','',$product->prices,true) . '</span>';
        ?>			
        </div>
	<?php }  else {
									if ($product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) ) { ?>
									<div class="call-a-question">
                                     	<a class="call modal"  rel="{handler: 'iframe', size: {x: 460, y: 550}}" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=askquestion&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$virtuemart_category_id.'&tmpl=component'); ?>" ><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ASKPRICE') ?></a>
                                    </div>
									<?php } } ?>  
    <?php } ?> 
    </div>
    
    <div class="product-box hover hover back_w  spacer <?php if ($discont>0) { echo 'disc';} ?> ">
 <?php if ($show_img) { ?>
    <div class="browseImage ">
    <?php
        $stockhandle = VmConfig::get ('stockhandle', 'none');
        if (($stockhandle == 'disableit' or $stockhandle == 'disableadd') and (($product->product_in_stock - $product->product_ordered) < 1) || 
                (($product->product_in_stock - $product->product_ordered) < $product->min_order_level ))  { ?>
                <div class="discount sold"><?php echo JText::_('DR_SOLD');?></div>
         <?php } ?>   
      <?php if (($product->prices['override'] == -1 || $product->prices['override'] == 1) && ($product->product_price_publish_down > 0)){ ?>
    <div class="discount limited"><?php echo JText::_('DR_LIMITED_OFFER');?></div>
      <?php } elseif($discont >0 && $product->product_sales < 20 ) { ?>
     <div class="discount"><?php echo JText::_('DR_SALE');?></div>
		<?php } elseif ($product->product_sales > 20) {?>
          <div class="hit"><?php echo JText::_('DR_HOT');?></div>
          <?php } ?>
			<?php
			if (!empty($product->images[1]) )
					$image = $product->images[1]->displayMediaThumb('class="browseProductImage featuredProductImage" border="0"',false) ;
				else $image =  $product->images[0]->displayMediaThumb('class="browseProductImage featuredProductImage" border="0"',false) ;
					echo JHTML::_('link', JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$virtuemart_category_id),$image);
			?>
            
    
    
	</div>        
    <div class="slide-hover">
    	<div class="wrapper">
			  <?php if ($show_title) { ?>
                    <div class="Title">
                    <?php echo JHTML::link(JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$virtuemart_category_id), shopFunctionsF::limitStringByWord($product->product_name,'40','...'), array('title' => $product->product_name)); ?>
                    </div>
            <?php } ?>	
            <?php if ($show_category) { ?>
                    <div class="Categories">
                    <?php echo JHTML::link(JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id='.$virtuemart_category_id), shopFunctionsF::limitStringByWord($product->category_name,'40','...'), array('title' => $product->category_name)); ?>
                    </div>
            <?php } ?>	
			<?php if ($show_ratings) { ?>
				 <?php
				  $showRating = $ratingModel->showRating($product->virtuemart_product_id);
					if ($showRating=='true'){
                $rating = $ratingModel->getRatingByProduct($product->virtuemart_product_id);
                if( !empty($rating)) {
                    $r = $rating->rating;
                } else {
                    $r = 0;
                }
                $maxrating = VmConfig::get('vm_maximum_rating_scale',5);
								$ratingwidth = ( $r * 100 ) / $maxrating;//I don't use round as percetntage with works perfect, as for me
					?>
                                                
                        <span class="vote">
                            <span title="" class="vmicon ratingbox" style="display:inline-block;">
                                <span class="stars-orange" style="width:<?php echo $ratingwidth;?>%">
                                </span>
                            </span>
                        </span>
           		 <?php } } ?>								
			<?php } ?>
            <?php if ($show_price) { ?>	
              <?php if ((!empty($product->prices['salesPrice'])) && !$product->images[0]->file_is_downloadable) { ?>
        <div class="Price">
        <?php
				 if ($product->prices['basePriceWithTax']>0 && $discont >0) 
                    echo '<span class="WithoutTax">' . $currency->createPriceDiv('basePriceWithTax','',$product->prices,true) . '</span>';
                if ($product->prices['salesPrice']>0)
                    echo '<span class="sales">' . $currency->createPriceDiv('salesPrice','',$product->prices,true) . '</span>';
               
                if ($discont>0) 
                echo '<span class="discount">' . $currency->createPriceDiv('discountAmount','',$product->prices,true) . '</span>';
        ?>			
        </div>
	<?php } else {
									if ($product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) ) { ?>
									<div class="call-a-question">
                                     	<a class="call modal"  rel="{handler: 'iframe', size: {x: 460, y: 550}}" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=askquestion&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$virtuemart_category_id.'&tmpl=component'); ?>" ><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ASKPRICE') ?></a>
                                    </div>
									<?php } } ?>
    <?php } ?> 
		</div>
         
		<?php if ($show_desc) { ?>
			<div class="description">
				<?php echo shopFunctionsF::limitStringByWord($product->product_s_desc, $row, '...') ?>
			</div>
		<?php } ?>	
		
            <div class="wrapper-slide">
			<?php if ($show_addtocart) echo mod_virtuemart_product::addtocart($product);?>
              <?php if(is_file(JPATH_BASE.DS."components/com_wishlists/template/wishlists.tpl.php")){  ?>
                            		 <div class="wishlist list_wishlists<?php echo $product->virtuemart_product_id;?>">
										<?php require(JPATH_BASE.DS."components/com_wishlists/template/wishlists.tpl.php"); ?>
                                     </div>
                           		   <?php } ?>       
                                     <?php if(is_file(JPATH_BASE.DS."components/com_comparelist/template/comparelist.tpl.php")){  ?>
                            		 <div class="jClever compare_cat list_compare<?php echo $product->virtuemart_product_id;?>">
										<?php require(JPATH_BASE.DS."components/com_comparelist/template/comparelist.tpl.php"); ?>
                                     </div>
                           		   <?php } ?>       
								   <?php if ($show_det) { ?>
			<div class="Details">
				<?php echo JHTML::link(JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$virtuemart_category_id), JText::_('DR_DETAILS')); ?><?php ?> 
			</div>
			<?php } ?>
			</div>
    	</div>
    </div>
     </div>
    
    
		<?php
            if ($col == $products_per_row && $products_per_row && $last) {
                echo "</li><li>";
                $col= 1 ;
            } else {
                $col++;
            }
			$last--;
            endforeach; ?>
	</li>
</ul>
<div class="clearfix"></div>
				<a id="prev<?php echo $params->get( 'class_sfx' ) ?>" class="list_prev" href="#"><span>&lt;</span></a>
				<a id="next<?php echo $params->get( 'class_sfx' ) ?>" class="list_next" href="#"><span>&gt;</span></a>
</div>

<script type="text/javascript">
	jQuery(document).ready(function($) {
		 $(function() {
    	$('.list_carousel div.prod-row').each(function() {        
        var tip = $(this).find('div.count_holder_small');

        $(this).hover(
            function() { tip.appendTo('body'); },
            function() { tip.appendTo(this); }
        ).mousemove(function(e) {
            var x = e.pageX + 60,
                y = e.pageY - 50,
                w = tip.width(),
                h = tip.height(),
                dx = $(window).width() - (x + w),
                dy = $(window).height() - (y + h);

            if ( dx < 50 ) x = e.pageX - w - 60;
            if ( dy < 50 ) y = e.pageY - h + 130;

            tip.css({ left: x, top: y });
        	});         
    	});

		});

	});
</script>

<?php } ?>
<script type="text/javascript" src="<?php echo JURI::base()?>modules/mod_virtuemart_product/js/iview.pack.js"></script>
<script type="text/javascript">
var isIE8 = jQuery.browser.msie && + jQuery.browser.version === 8;
if (isIE8 ) {
	function sliderInit2() {							   	
			jQuery('#slider<?php echo $params->get( 'class_sfx' ) ?>').carouFredSel({
					auto: false,
					circular: false,
                    infinite: false,
					prev: '#prev<?php echo $params->get( 'class_sfx' ) ?>',
					next: '#next<?php echo $params->get( 'class_sfx' ) ?>',
					mousewheel: false,
					height: null,
					swipe: {
						onMouse: false,
						onTouch: false
					},				   
					responsive: true,
					width: '100%',
					scroll: 1,
					items: {
						width: 320,
						height: null,	//	optionally resize item-height
						visible: {
							min: 1,
							max: 4
						}
					}
				});
		}
} else {
function sliderInit<?php echo $params->get( 'class_sfx' ) ?>() {
	if (notAnimate =='1'){
	jQuery('#slider<?php echo $params->get( 'class_sfx' ) ?>.vmproduct .prod-row').addClass('display-none');
	jQuery('#slider<?php echo $params->get( 'class_sfx' ) ?>.vmproduct .prod-row').viewportChecker({
		classToAdd: 'display-block animated zoomIn', // Class to add to the elements when they are visible
		offset: 50 // The offset of the elements (let them appear earlier or later)
	});
	}
	jQuery('#slider<?php echo $params->get( 'class_sfx' ) ?>').carouFredSel({
					auto :{play:true, timeoutDuration:5*2000}, 
					circular: false,
                    infinite: false,
					prev: '#prev<?php echo $params->get( 'class_sfx' ) ?>',
					next: '#next<?php echo $params->get( 'class_sfx' ) ?>',
					mousewheel: false,
					swipe: {
						onMouse: false,
						onTouch: false
					},				   
					responsive: true,
					width: '100%',
					height: null,
					scroll: 1,
					items: {
						width: 320,
						height: null,	//	optionally resize item-height
						visible: {
							min: 1,
							max: 4
						}
					}
				});
				
			}
}
jQuery(function(){
	jQuery('.list_carousel').addClass('loader');
	jQuery(window).load(function() {
		jQuery('.list_carousel').removeClass('loader'); // remove the loader when window gets loaded.
		jQuery('#slider<?php echo $params->get( 'class_sfx' ) ?>').show();
	sliderInit<?php echo $params->get( 'class_sfx' ) ?>();
	});
});

</script>
<script type="text/javascript">
jQuery(function () {	
	jQuery('#slider<?php echo $params->get( 'class_sfx' ) ?>.vmproduct .hasTooltips , #slider<?php echo $params->get( 'class_sfx' ) ?>.vmproduct .add_wishlist, #slider<?php echo $params->get( 'class_sfx' ) ?>.vmproduct .add_compare').tooltip('hide');

});
</script>

<?php	if ($footerText) : ?>
	<div class="vmfooter <?php echo $params->get( 'moduleclass_sfx' ) ?>">
		 <?php echo $footerText ?>
	</div>
<?php endif; ?>
</div>
