

<?php
if (!defined('IN_CONTEXT')) die('access violation error!');
$cols = $p_cols;

?>
<script type="text/javascript" language="javascript">
<!--
	function updatecartstate(response) {
		var o_result = _eval_json(response);
		if (!o_result) {
			return addprodfailed(response);
		}
		
		if (o_result.result == "ERROR") {
			alert(o_result.errmsg);
			return false;
		} else if (o_result.result == "OK") {
			$("#disp_n_prds").html(o_result.n_prds);
			alert("<?php _e('The product has been added to cart!'); ?>");
			return true;
		} else {
			return on_failure(response);
		}
	}
	
	function addprodfailed(response) {
		alert("<?php _e('Request failed!'); ?>");
		return false;
	}
	
	function add2cart(p_id) {
		var p_num = document.getElementById("prod_num_" + p_id).value;
		_ajax_request("mod_cart", "addtocart", 
			{ p_id: p_id, p_num: p_num }, updatecartstate, addprodfailed);
	}
//-->
</script>

		<div class="newprod">
				<div class="newprod_top"></div>
				<div class="newprod_con">

            
			
<?php
$n_prd = sizeof($products);
if ($n_prd > 0){
?>

		<?php
		for ($i = 0; $i < $n_prd; $i++) {
		?>

            <div class="newprod_list">
				<div class="newprod_pic"><a href="<?php echo $products[$i]->feature_img; ?>" class="thickbox" title="<?php echo $products[$i]->name;?>"><img border="0" src="<?php echo $products[$i]->feature_smallimg;?>" class="prodthumb" name="picautozoom" /></a></div>
                <div class="newprod_name"><a href="index.php?<?php echo Html::xuriquery('mod_product', 'view', array('p_id' => $products[$i]->id)); ?>" ><?php echo $products[$i]->name;?></a></div>
                <?php if(1<2){?><div class="newprod_price">￥<?php echo $products[$i]->price;?></div><?php }?>
				<div class="newprod_intr"><?php echo Toolkit::substr_MB($products[$i]->introduction, 0, 20);?>...</div>
                <div class="blankbar1"></div>
            </div>
            

		<?php } ?>

<?php } ?>

	
			</div>
				<div class="list_bot"></div>
			</div>
			<div class="blankbar"></div>