<?php 
$enabled = $this->_getEnableReview();
$type = $this->_getSidebarType();
$position = $this->_getPositionReview();
if(($enabled==1) && ($type==2) && ($position==2)){
?>
	<!--<link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('mw_epr/css/slider.css')?>" />-->
	<script src="<?php echo $this->getSkinUrl('mw_epr/js/jquery/jquery.cycle.all.2.72.js') ?>" type="text/javascript"></script>
	<?php 
	$reviews = $this->getRecentReview();
	if($reviews){?>
	<div class="erp-block erp-block-compare">
		<div class="erp-block-title">
			<strong>
				<span>
					<a href="<?php echo Mage::getBaseUrl().'/enhancedproductreview/index/index'?>">
					<?php echo Mage::helper('enhancedproductreview')->__('Recent Reviews');?>
					</a>
				</span>
			</strong>
		</div>
		<div class="erp-block-content" >
			<div id="epr_slider_box" >
				<?php foreach($reviews as $review){?>
				<?php $p_review = Mage::getModel('catalog/product')->load($review->getEntityPkValue()); ?>
					
					<div class="epr_slider_item">
						<div class="epr_slider_item_pimage">
							<a href="<?php echo $p_review->getProductUrl() ?>" title="<?php echo $this->htmlEscape($p_review->getName()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($p_review,'image')->resize(80,80); ?>" alt="magento themes"></a>
						</div>
						<div class="epr_slider_item_info">
							<div class="epr_slider_item_pname">
								<a href="<?php echo $p_review->getProductUrl() ?>" title="<?php echo $this->htmlEscape($p_review->getName()) ?>"><?php echo $this->htmlEscape($p_review->getName()) ?></a>
							</div>
							<div>
								<div class="epr_rating-box">
				                	<div class="epr_rating" style="width: <?php echo $this->__getPercentRate($review); ?>%;"></div>
				                </div>
				            </div>
						</div>
						<div class="epr_slider_clear"></div>
						<div>
							<div class="epr_slider_item_title"><?php echo $review->getTitle(); ?></div>
							<div><?php echo $review->getDetail(); ?></div>
						  	<div class="epr_slider_item_nickname"><?php echo $review->getNickname();?></div>
						</div>
					</div>
					
				<?php }?>
			</div>
			<div class="epr_slider_viewall">
					<a href="<?php echo Mage::getBaseUrl().'reviews'?>">
					<?php echo Mage::helper('enhancedproductreview')->__('View All');?>
					</a>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		var $j = jQuery.noConflict(); 
		$j(document).ready(function(){
			$j('#epr_slider_box').cycle({ 
			    fx:     'scrollUp', 
			    timeout: 3000, 
			    delay:  -1000 
			});
		});
	</script>
	<?php } ?>
<?php }?>