<!--<?php
require($this->getSegmentFile('info.nav'));
print <<<EOT
-->
		<div class="S_boxA mb10 bgB">
<!--
EOT;
require($this->getSegmentFile('info.dianpu'));
print <<<EOT
-->
			<div class="S_goodBox">
				<h2 class="S_h2"><div class="S_ico S_goods">商品推荐</div></h2>
				<div class="S_ulA cc">
					<div class="S_ico S_pre fl mr10" id="pro">上一页</div>
					<div class="S_ico S_next fr" id="next">下一页</div>
					<ul id = "recommendProducts">
<!--
EOT;
foreach($_viewer->products as $product){
print <<<EOT
-->
						<li  style="display: none;"><a href="{$_viewer->baseName}&c=product&a=detail&id={$_viewer->dianpuinfo->dianpuid}&productid={$product[productid]}" title="{$product[title]}"><img width="90" height="90" class="B_img" src="{$product[photopath]}"><p>{$product[title]}</p></a></li>
<!--
EOT;
}print <<<EOT
-->					
					</ul>
				</div>
			</div>
			<div class="S_tplcontent" id="dianpuContent"></div>
		</div>
<!--
EOT;
if($_viewer->groupinfo['configinfo']['comments']){
	require($this->getSegmentFile('info.comment'));
}
$_viewer->dianpuinfo->bulletin = $_viewer->dianpuinfo->bulletin ? $_viewer->dianpuinfo->bulletin : '暂无任何公告';
print <<<EOT
-->
	</div>
	<div id="S_sideBar">
		<div class="S_boxC mb10 S_notice">
			<h2 class="S_ico S_h4">店铺公告</h2>
			<div class="p10">{$_viewer->dianpuinfo->bulletin}</div>
		</div>
		<div class="S_boxC mb10">
			<h2 class="S_ico S_h4">怎么去</h2>
			<div class="p5"><iframe height="300px" scrolling="no" width="100%" style="border: 0pt none ; display: '';" src="{$_viewer->baseUrl}&a=showmap&id={$_viewer->dianpuinfo->dianpuid}" frameborder="0" ></iframe></div>
		</div>
		<div class="S_boxC mb10">
			<h2 class="S_ico S_h4">浏览记录</h2>
			<div class="B_dlC">
<!--
EOT;
if(!is_array($_viewer->browse) || empty($_viewer->browse)){
print <<<EOT
-->
			暂无任何浏览历史
<!--
EOT;
} else {
foreach($_viewer->browse as $key => $value){
print <<<EOT
-->
				<dl class="cc mb10">
					<dt class="fl mr10"><a href="{$_viewer->baseUrl}&id={$value[dianpuid]}"><img src="{$value[logo]}" class="B_img fl" width="44" height="44" /></a></dt>
					<dd><div class="mb5"><a href="{$_viewer->baseUrl}&id={$value[dianpuid]}">{$value[title]}</a></div><p class="gray">主营：{$value[category]}</p></dd>
				</dl>
<!--
EOT;
}}print <<<EOT
-->
			</div>
		</div>
<!--
EOT;
list($htmlAdvert,$arrayAdvert) = pwAdvert('Mode.Dianpu.Info.Right1'); 
if($htmlAdvert){print <<<EOT
-->
			<div class="mb10 cc S_bannerA">{$htmlAdvert}</div>
<!--
EOT;
}print <<<EOT
-->
	</div>
</div>
<script type="text/javascript">
function getDianpuContent(url){
	if (!url) return false;
	DP.post(url,'',function(){
		var obj = getObj('dianpuContent');
		if(!obj) return false;
		obj.innerHTML = ajax.runscript(ajax.request.responseText);
	});
	return false;
}
getDianpuContent('{$_viewer->baseUrl}&a=content&id={$_viewer->dianpuid}');

function getRecommendProducts(page,maxcount,message) {
	var pageCount = 6;
	if(page <= 0 || page > Math.ceil(maxcount/pageCount)) {
		//if (message ) DP.tips('confirm', message);
		return;
	}
	var ul = getObj('recommendProducts');
	var lis = ul.getElementsByTagName('li');
	var start = (page - 1) * pageCount;
	for (var i=0; i<lis.length; i++) {
		if(i>=start && i <start+pageCount){
			lis[i].style.display = "inline";
		} else {
			lis[i].style.display = "none";
		}
	}
	var proPage = page - 1;
	var nextPage = page + 1;
	var pro = getObj('pro');
	var next = getObj('next');
	pro.onclick = function(){getRecommendProducts(proPage,maxcount,'已经是第一页')};
	next.onclick = function(){getRecommendProducts(nextPage,maxcount,'已经是最后一页')};
}
getRecommendProducts(1,'{$_viewer->proCount}');
</script>
<!--
EOT;
?>-->