		function changePage(page){
			var color = $("#color").val();
			var brand = $("#brand").val();
			var catalog = $("#catalog").val();
			var sex = $("#sex").val();
			var attarTemp = $("#attarTemp").val();
			var heightBegin = $("#heightBeginHidden").val();
			var heightEnd = $("#heightEndHidden").val();
			var season = $("#season").val();
			var sortHidden = $("#sortHidden").val();
			var priceHidden = $("#priceHidden").val();
			var sizeSort = $("#sizeSort").val();
			if(season!=undefined){
				season = encodeURI(season);
			}
			var params = {
				"productListInfo.colorId":color,
				"page":page,
				"productListInfo.brandId":brand,
				"productListInfo.catalogId":catalog,
				"productListInfo.sizeSort.id":sizeSort,
				"productListInfo.sex":sex,
				"productListInfo.heightBegin":heightBegin,
				"productListInfo.heightEnd":heightEnd,
				"productListInfo.sort":sortHidden,
				"productListInfo.attrTemplId":attarTemp,
				"productListInfo.priceHidden":priceHidden,
				"productListInfo.season":season
			};
			showLoading();
			$.getJSON("/json/jproduct_productListIndexAjax.htm",params,function(data){
				removeLoading();
				showProductList(data);
	        });
		}
		function callBackPage(page,jq){
			var color = $("#color").val();
			var brand = $("#brand").val();
			var catalog = $("#catalog").val();
			var sex = $("#sex").val();
			var attarTemp = $("#attarTemp").val();
			var heightBegin = $("#heightBeginHidden").val();
			var heightEnd = $("#heightEndHidden").val();
			var season = $("#season").val();
			var sortHidden = $("#sortHidden").val();
			var priceHidden = $("#priceHidden").val();
			var sizeSort = $("#sizeSort").val();
			if(season!=undefined){
				season = encodeURI(season);
			}
			var params = {
				"productListInfo.colorId":color,
				"page":page+1,
				"productListInfo.brandId":brand,
				"productListInfo.catalogId":catalog,
				"productListInfo.sizeSort.id":sizeSort,
				"productListInfo.sex":sex,
				"productListInfo.heightBegin":heightBegin,
				"productListInfo.heightEnd":heightEnd,
				"productListInfo.sort":sortHidden,
				"productListInfo.attrTemplId":attarTemp,
				"productListInfo.priceHidden":priceHidden,
				"productListInfo.season":season
			};
			showLoading();
			$.getJSON("/json/jproduct_productListIndexAjax.htm",params,function(data){
				removeLoading();
				showProductList(data);
	        });
		}
		function showProductList(data){
			var totalRecord = data.productListInfo.totalRecord;
			var currentPage = data.productListInfo.pager.currentPage;
			var pageSize = data.productListInfo.pager.pageSize;
			var totalPages = data.productListInfo.pager.totalPages;
			var page = data.page;
			var content = $("#content");
			content.html('');
			var attrTemplId = data.productListInfo.attrTemplId;
			var productName = data.productListInfo.productName;
			var sort = data.productListInfo.sort;
			var contentList = "";
			var productList="";
			var records = data.productListInfo.pager.records;
			if(records.length>0){
				for(var i=0; i < records.length; i++){
					var record = records[i];
					var attach = record['attach'];
					var product = record['product'];
					var pid = product['pid'];
					var pic_dir = "";
					if(attach != null){
						pic_dir = attach.pic_dir;
					}
					var name = product.name;
					var brand = product['product_brand'];
					var sku = record['sku'];
					var marketPrice = sku.market_price;
					var igoPrice = sku.igo_price;
					var brandName = brand.name;
					var subName="";
					if(name.length>=7){
						subName = name.substring(0,7)+"...";
					}
					if(name.length<7){
						subName = name;
					}
					productList+='<li><a href="http://www.igobb.com/item/item_show.htm?itemInfo.pid='+pid+'" target="_blank"><img src="http://www.igobb.com/picture/product/'+pic_dir+'"'+' alt="'+name+'" title="'+name+'" width="180" heigth="230"></img></a>'+
								'<br><a href="http://www.igobb.com/item/item_show.htm?itemInfo.pid='+pid+'" title="'+name+'" target="_blank">'+brandName+'&nbsp;'+subName+'</a><br>'+
								'<p><s class="jg">市场价:￥'+marketPrice+'</s>&nbsp;&nbsp;<span class="listfont">'+
								'现价:￥'+igoPrice+'</span></p></li>';
		    	}
				contentList = contentList+ '<ul>'+productList+'</ul>';
			}else{
				contentList = '对不起，暂时没有商品信息!';
			}
			content.html(contentList);	
			var numberUp = $("#numberUp");
			var numberDown = $("#numberDown");
			var up = '<div id="numberUp"><font  style="font-size: 12px" >共'+totalRecord+'款产品&nbsp;</font></div>';
			var wn = '<div id="numberDown"><font  style="font-size: 12px" >共'+totalRecord+'款产品&nbsp;</font></div>';
			numberUp.html(up);
			numberDown.html(wn);
			var pdown = $("#pdown");
			var pup = $("#pup");
			var pcontent = "";
			pdown.html("");
			pup.html("");
			if(currentPage != 1){
				pcontent += '<a href="javascript:void(0);" onclick="changePage('+(currentPage-1)+')"><上一页 </a> ';
			}
			var ne_half = 4;
			var upper_limit = totalPages-7;
			var start = currentPage>ne_half?Math.max(Math.min(currentPage-ne_half, upper_limit), 1):1;
			var end = currentPage>ne_half?Math.min(currentPage+ne_half, totalPages):Math.min(8, totalPages+1);
			for(var i=start;i<currentPage;i=i+1){
				pcontent += '<a href="javascript:void(0);" onclick="changePage('+i+')">'+i+'</a> ';
			}
			pcontent += '<a href="javascript:void(0);" onclick="changePage('+currentPage+')" style="color:red">['+currentPage+']</a> ';
			for(var j=currentPage+1;j<end;j=j+1){
				pcontent += '<a href="javascript:void(0);" onclick="changePage('+j+')">'+j+'</a> ';
			}
			if(currentPage != totalPages){
				pcontent += '<a href="javascript:void(0);" onclick="changePage('+(currentPage+1)+')">下一页></a> ';
			}
			pdown.html(pcontent);
			pup.html(pcontent);
		}
		
		// 身高结束
		 function heightEndCheck(){
			var condition = "";
				var heightBegin = $("#heightBeginHidden").val();
				var heightEnd = $("#heightEnd").val();
				var brand = $("#brand").val();
				var color = $("#color").val();
				var catalog = $("#catalog").val();
				var sex = $("#sex").val();
				var attarTemp = $("#attarTemp").val();
				var season = $("#season").val();
				var priceHidden = $("#priceHidden").val();
				var sizeSort = $("#sizeSort").val();
				$("#heightEndHidden").attr("value",heightEnd);
				if(season!=undefined){
					season = encodeURI(season);
				}
				var params = {
					"productListInfo.colorId":color,
					"productListInfo.brandId":brand,
					"productListInfo.catalogId":catalog,
					"productListInfo.sizeSort.id":sizeSort,
					"productListInfo.sex":sex,
					"page":1,
					"productListInfo.heightBegin":heightBegin,
					"productListInfo.attrTemplId":attarTemp,
					"productListInfo.heightEnd":heightEnd,
					"productListInfo.priceHidden":priceHidden,
					"productListInfo.season":season
				}
				showLoading();
				$.getJSON("/json/jproduct_productListIndexAjax.htm",params,function(data){
					removeLoading();
					showProductList(data);
		        });
			}
		 // 身高开始
			function heightBeginCheck(){
				var heightBegin = $("#heightBegin").val();
				var heightEnd = $("#heightEndHidden").val();
				var brand = $("#brand").val();
				var catalog = $("#catalog").val();
				var color = $("#color").val();
				var sex = $("#sex").val();
				var attarTemp = $("#attarTemp").val();
				var season = $("#season").val();
				var priceHidden = $("#priceHidden").val();
				var sizeSort = $("#sizeSort").val();
				$("#heightBeginHidden").attr("value",heightBegin);
				if(season!=undefined){
					season = encodeURI(season);
				}
				var params = {
					"productListInfo.colorId":color,
					"productListInfo.brandId":brand,
					"productListInfo.catalogId":catalog,
					"productListInfo.sizeSort.id":sizeSort,
					"productListInfo.sex":sex,
					"page":1,
					"productListInfo.heightBegin":heightBegin,
					"productListInfo.heightEnd":heightEnd,
					"productListInfo.attrTemplId":attarTemp,
					"productListInfo.priceHidden":priceHidden,
					"productListInfo.season":season
				};
				showLoading();
				$.getJSON("/json/jproduct_productListIndexAjax.htm",params,function(data){
					removeLoading();
					showProductList(data);
		        });
			}
			// 颜色
			function checkColor(id){
				var color = $("#color");
				var colorValue = color.val();
				var colorBox = $("#color_"+id);
				var aColor = $("#aColor_"+id);
				var ulColor = aColor.parent();
				var inputId = "color_"+id;
				for(var i=0;i<ulColor.children("a").children("input").length;i++){
					var a = $(ulColor.children("a").children("input").get(i));
					if(inputId==a.attr("id")){
						if(colorValue.indexOf(id)>=0){
							colorValue = colorValue.replace(colorValue.substr(colorValue.indexOf(id),2),"");
							color.attr("value",colorValue);
							colorBox.attr("checked","");
						}else{
							color.attr("value",id+";"+colorValue);
							colorBox.attr("checked","checked");
						}		
					}
				}
				var brand = $("#brand").val();
				var catalog = $("#catalog").val();
				var sex = $("#sex").val();
				var attarTemp = $("#attarTemp").val();
				var heightBegin = $("#heightBeginHidden").val();
				var heightEnd = $("#heightEndHidden").val();
				var season = $("#season").val();
				var priceHidden = $("#priceHidden").val();
				var sizeSort = $("#sizeSort").val();
				if(season!=undefined){
					season = encodeURI(season);
				}
				var params = {
					"productListInfo.colorId":color.val(),
					"productListInfo.brandId":brand,
					"productListInfo.catalogId":catalog,
					"productListInfo.sizeSort.id":sizeSort,
					"productListInfo.sex":sex,
					"page":1,
					"productListInfo.heightBegin":heightBegin,
					"productListInfo.heightEnd":heightEnd,
					"productListInfo.attrTemplId":attarTemp,
					"productListInfo.priceHidden":priceHidden,
					"productListInfo.season":season
				};
				showLoading();
				$.getJSON("/json/jproduct_productListIndexAjax.htm",params,function(data){
					removeLoading();
					showProductList(data);
		        });
			}
		// 品牌
		function checkBrand(id){
			var brandValue = $("#brand").val();
			var brandBox = $("#brand_"+id);
			var aBrand = $("#aBrand_"+id);
			var ulBrand =aBrand.parent();
			var inputId = "brand_"+id;
			var priceHidden = $("#priceHidden").val();
			for(var i=0;i<ulBrand.children("a").children("input").length;i++){
				var a = $(ulBrand.children("a").children("input").get(i));
				if(inputId == a.attr("id")){
					if(brandValue == ""){
						$("#brand").val(id);
						brandBox.attr("checked","checked");
					}else{
						var fl = false;
						var bva = brandValue.split(";");
						for(var m = 0,n = bva.length;m < n;m++){
							if((""+id) == bva[m]){
								fl = true;
								break;
							}
						}
						//取消
						if(fl){
							var bvstr = "";
							var bva = brandValue.split(";");
							for(var m = 0,n = bva.length;m < n;m++){
								if(id == bva[m]){
									continue;
								}else{
									if(bvstr == ""){
										bvstr = bva[m];
									}else{
										bvstr = bvstr + ";" + bva[m];
									}
								}
							}
							$("#brand").val(bvstr);
							brandBox.attr("checked","");
						}else{
							//选中
							brandValue = brandValue + ";" + id;
							$("#brand").val(brandValue);
							brandBox.attr("checked","checked");
						}
					}
				}
			}
			brandValue = $("#brand").val();
			
			var color = $("#color").val();
			var heightBegin = $("#heightBeginHidden").val();
			var heightEnd = $("#heightEndHidden").val();
			var catalog = $("#catalog").val();
			var sex = $("#sex").val();
			var attarTemp = $("#attarTemp").val();
			var season = $("#season").val();
			var sizeSort = $("#sizeSort").val();
			if(season!=undefined){
				season = encodeURI(season);
			}
			var params = {
				"productListInfo.colorId":color,
				"productListInfo.brandId":brandValue,
				"productListInfo.catalogId":catalog,
				"productListInfo.sizeSort.id":sizeSort,
				"productListInfo.sex":sex,
				"page":1,
				"productListInfo.heightBegin":heightBegin,
				"productListInfo.heightEnd":heightEnd,
				"productListInfo.attrTemplId":attarTemp,
				"productListInfo.priceHidden":priceHidden,
				"productListInfo.season":season
			};
			showLoading();
			$.getJSON("/json/jproduct_productListIndexAjax.htm",params,function(data){
				removeLoading();
				showProductList(data);
	        });
		}
		// 商品
		function checkCatalog(id,level){
			var catalog = $("#catalog");
			var catalogValue = catalog.val();
			var inputIdParent = $("#catalog_"+id);
			var inputId = "catalog_"+id;
			var spanId = "span_"+id;
			if(level==3){
				var levelTwo = $(inputIdParent.parent(".list_word"));
				var levelTwoParent = levelTwo.parent("div");
				var divs = levelTwoParent.children("div"); //catalogList
				for(var i=0;i<divs.length;i++){
					if($(divs.get(i)).attr("class")=="list_left_top2"){
						var divNode = $(divs.get(i));
						var spanNode = divNode.children("a").children("span");
						if(spanNode.attr("id")==spanId){
							if(id==catalogValue){
								catalog.attr("value","");
								spanNode.attr("class","");
							}else{
								catalog.attr("value",id);
								spanNode.attr("class","green");
							}
						}else{
							spanNode.attr("class","listfont");
						}
					}
					if($(divs.get(i)).attr("class")=="list_word"){
						var divNode = $(divs.get(i));
						var aNodes = divNode.children("a");
						for(var j=0;j<aNodes.length;j++){
							var aNode = $(aNodes.get(j));
							var spanNode = aNode.children("span");
							if(spanNode.attr("id")==spanId){
								if(id==catalogValue){
									catalog.attr("value","");
									spanNode.attr("class","");
								}else{
									catalog.attr("value",id);
									spanNode.attr("class","green");
								}
							}else{
								spanNode.attr("class","");
							}
						}
					}
				}					
			}
			if(level==2){
				var levelTwo = $(inputIdParent.parent(".list_left_top2"));
				var levelTwoParent = levelTwo.parent("div");
				var divs = levelTwoParent.children("div"); //catalogList
				for(var i=0;i<divs.length;i++){
					if($(divs.get(i)).attr("class")=="list_left_top2"){
						var divNode = $(divs.get(i));
						var spanNode = divNode.children("a").children("span");
						if(spanNode.attr("id")==spanId){
							if(id==catalogValue){
								catalog.attr("value","");
								spanNode.attr("class","listfont");
							}else{
								catalog.attr("value",id);
								spanNode.attr("class","green");
							}
						}else{
							spanNode.attr("class","listfont");
						}
					}
					if($(divs.get(i)).attr("class")=="list_word"){
						var divNode = $(divs.get(i));
						var spanNode = divNode.children("a").children("span");
						if(spanNode.attr("id")==spanId){
							if(id==catalogValue){
								catalog.attr("value","");
								spanNode.attr("class","");
							}else{
								catalog.attr("value",id);
								spanNode.attr("class","green");
							}
						}else{
							spanNode.attr("class","");
						}
					}
				}					
			}
			var attarTemp = $("#attarTemp").val();
			var brand = $("#brand").val();
			var color = $("#color").val();
			var sex = $("#sex").val();
			var attarTemp = $("#attarTemp").val();
			var heightBegin = $("#heightBeginHidden").val();
			var heightEnd = $("#heightEndHidden").val();
			var season = $("#season").val();
			var priceHidden = $("#priceHidden").val();
			var sizeSort = $("#sizeSort").val();
			if(season!=undefined){
				season = encodeURI(season);
			}
			var params = {
				"productListInfo.colorId":color,
				"productListInfo.brandId":brand,
				"page":1,
				"productListInfo.catalogId":catalog.val(),
				"productListInfo.sizeSort.id":sizeSort,
				"productListInfo.sex":sex,
				"productListInfo.heightBegin":heightBegin,
				"productListInfo.heightEnd":heightEnd,
				"productListInfo.attrTemplId":attarTemp,
				"productListInfo.priceHidden":priceHidden,
				"productListInfo.season":season
			};
			showLoading();
			$.getJSON("/json/jproduct_productListIndexAjax.htm",params,function(data){
				removeLoading();
				showProductList(data);
	        });	
		}
		// 季节
		function checkSeason(data){
			var seasonDiv = $("#seasonDiv")
			var aSeason = "season_"+data;
			var season = $("#season");
			var seasonValue = season.val();
			for(var i=0;i<seasonDiv.children("a").length;i++){
				var s = $(seasonDiv.children("a").get(i));
				if(aSeason==s.attr("id")){
					if(seasonValue==data){
						season.attr("value","");
						s.css("color","black").css("background-color","");
					}else{
						season.attr("value",data);
						s.css("color","#FFFFFF").css("background-color","#d50000");
					}
				}else{
					s.css("color","black").css("background-color","");
				}
			}
			if(season.val()!=undefined){
				season = encodeURI(season.val());
			}
			//var brand = $("#brand").val();
			var color = $("#color").val();
			//var sex = $("#sex").val();
			var attarTemp = $("#attarTemp").val();
			var catalog = $("#catalog").val();
			var heightBegin = $("#heightBeginHidden").val();
			var heightEnd = $("#heightEndHidden").val();
			var priceHidden = $("#priceHidden").val();
			var sizeSort = $("#sizeSort").val();
			var params = {
				"productListInfo.colorId":color,
				"productListInfo.brandId":brand,
				"page":1,
				"productListInfo.catalogId":catalog,
				"productListInfo.sizeSort.id":sizeSort,
				"productListInfo.sex":sex,
				"productListInfo.heightBegin":heightBegin,
				"productListInfo.heightEnd":heightEnd,
				"productListInfo.attrTemplId":attarTemp,
				"productListInfo.priceHidden":priceHidden,
				"productListInfo.season":season
			};
			showLoading();
			$.getJSON("/json/jproduct_productListIndexAjax.htm",params,function(data){
				removeLoading();
				showProductList(data);
	        });	
		}
		// 排序方式
		function checkListSort(position){
			var sortHidden = $("#sortHidden");
			if(position=='up'){
				var sort2 = $("#sort2").val();
				sortHidden.attr("value",sort2);
				$("#sort_"+sort2).attr("selected","selected");
				$("#sort2_"+sort2).attr("selected","selected");
			}else{
				var sort = $("#sort").val();
				sortHidden.attr("value",sort);
				$("#sort_"+sort).attr("selected","selected");
				$("#sort2_"+sort).attr("selected","selected");
			}
			var attarTemp = $("#attarTemp").val();
			var brand = $("#brand").val();
			var season = $("#season").val();
			var color = $("#color").val();
			var sex = $("#sex").val();
			var catalog = $("#catalog").val();
			var attarTemp = $("#attarTemp").val();
			var heightBegin = $("#heightBeginHidden").val();
			var heightEnd = $("#heightEndHidden").val();
			var priceHidden = $("#priceHidden").val();
			var sizeSort = $("#sizeSort").val();
			if(season!=undefined){
				season = encodeURI(season);
			}
			var params = {
				"productListInfo.colorId":color,
				"page":1,
				"productListInfo.brandId":brand,
				"productListInfo.catalogId":catalog,
				"productListInfo.sizeSort.id":sizeSort,
				"productListInfo.sex":sex,
				"productListInfo.heightBegin":heightBegin,
				"productListInfo.heightEnd":heightEnd,
				"productListInfo.attrTemplId":attarTemp,
				"productListInfo.sort":sortHidden.val(),
				"productListInfo.priceHidden":priceHidden,
				"productListInfo.season":season
			};
			showLoading();
			$.getJSON("/json/jproduct_productListIndexAjax.htm",params,function(data){
				removeLoading();
				showProductList(data);
	        });
		}
		// 性别
		function checkSex(id){
			var sexDiv = $("#sexDiv")
			var aSex = "sex_"+id;
			var sex = $("#sex");
			var sexValue = sex.val();
			for(var i=0;i<sexDiv.children("a").length;i++){
				var s = $(sexDiv.children("a").get(i));
				if(aSex==s.attr("id")){
					if(sexValue==id){
						sex.attr("value","");
						s.css("color","black").css("background-color","");
					}else{
						sex.attr("value",id);
						s.css("color","#FFFFFF").css("background-color","#d50000");
					}
				}else{
					s.css("color","black").css("background-color","");
				}
			}
			var season = $("#season").val();
			if(season!=undefined){
				season = encodeURI(season);
			}
			var brand = $("#brand").val();
			var color = $("#color").val();
			var sex = $("#sex").val();
			var attarTemp = $("#attarTemp").val();
			var catalog = $("#catalog").val();
			var heightBegin = $("#heightBeginHidden").val();
			var heightEnd = $("#heightEndHidden").val();
			var priceHidden = $("#priceHidden").val();
			var sizeSort = $("#sizeSort").val();
			var params = {
				"productListInfo.colorId":color,
				"productListInfo.brandId":brand,
				"page":1,
				"productListInfo.catalogId":catalog,
				"productListInfo.sizeSort.id":sizeSort,
				"productListInfo.sex":sex,
				"productListInfo.heightBegin":heightBegin,
				"productListInfo.heightEnd":heightEnd,
				"productListInfo.attrTemplId":attarTemp,
				"productListInfo.priceHidden":priceHidden,
				"productListInfo.season":season
			};
			showLoading();
			$.getJSON("/json/jproduct_productListIndexAjax.htm",params,function(data){
				removeLoading();
				showProductList(data);
	        });
		}
		// 其它分类
		function otherCatalog(id){
			if(id!=""){
				document.myform.action="/product/product_productList.htm?productListInfo.attrTemplId="+id;
				document.myform.method="post";
				document.myform.submit();
			}
		}
		
		function setMenuBySex(id){
			var params = {
				"page":1,
				"productListInfo.sex":id
			};
			showLoading();
			$.getJSON("/json/jproduct_productListIndexAjax.htm",params,function(data){
				removeLoading();
				showProductList(data);
	        });
		}
