// JavaScript Document
function setProLeftClass(url)
{
	$.post(url+"ajax/getList.php?act=product", {},function (data, textStatus){
					//返回的 data 可以是 xmlDoc, jsonObj, html, text, 等等.
					this; // 在这里this指向的是Ajax请求的选项配置信息
					var html = '';

					for ( var i=0; i<data.length; i++ )
					{
						 html += '<li onclick="setMu(\'left_'+data[i].cid+'\')"><span><a href="';
						 if ( data[i].sonArr.length > 0 )
						 {
							 html += 'javascript:void(0);'
						 }
						 else
						 {
							 html += 'display.php?pid='+data[i].cid;
						 }
						 html += '">'+data[i].classname+'</a></span>';
						 if ( data[i].sonArr.length > 0 )
						 {
							 html += '<ul id="left_'+data[i].cid+'"';
							 if ( oldid == 'left_'+data[i].cid )
							 html += 'style="display:block"';
							 else
							 html += 'style="display:none"';

							 html += '>';
							 var sonArr = data[i].sonArr;
							for ( var j=0; j<sonArr.length; j++ )
							{
							 	html += '<li ><a href="display.php?cid='+sonArr[j].cid+'">'+sonArr[j].classname+'</a></li>';
							}
							html += '</ul>';
						 }
						 html += '</li>';
					}
					oldid = '';
					document.getElementById('siderBarshop').innerHTML = html;
			}, "json");
}
function setSearchProClass(url,did)
{
	document.getElementById('pro_Value').value = '..请选择..';
	document.getElementById('pid').value = '0';
	document.getElementById('pro_Cid').innerHTML = '';
	$.post(url+"ajax/getList.php?act=search", {did:did},function (data, textStatus) {
					//返回的 data 可以是 xmlDoc, jsonObj, html, text, 等等.
					this; // 在这里this指向的是Ajax请求的选项配置信息
					var html = '';

					for ( var i=0; i<data.length; i++ )
					{
						html += '<li onclick="changePValue(\''+data[i].classname+'\','+data[i].cid+');" onmouseover="this.style.background=\'#e8e8e8\'" onmouseout="this.style.background=\'#ffffff\'">'+data[i].classname+'</li>';
					}

					document.getElementById('pro_Cid').innerHTML = html;
			}, "json");
}