

function getList(){
	var query = location.query();
		if(query.cat && query.scat){
			var xml = 'xml/' + query.cat + '/' + query.scat +'.xml';
			var menu = $('.menulist');
			$('img',menu).each(function(){
				var img = $(this);

				if (img.attr('src').match(query.scat)) {
					img.attr('src',img.attr('src').replace('_off', ''));
				}
			})

			$.get(xml,function(response){
				var item = $(response).find('product');
				var list = $('#prodlist')
				var pagenate = $('.pagenate',list)
				var lo = new Array();
				item.each(function(){
					if(eval($('list',this).text())) lo.push(this);
				})
				
				var sum = lo.length;
												
				if (lo.length > 48) {
					var p = lo.length / 48.0
					var page = (query.page) ? parseInt(query.page) -1  : 0
					var start = page * 48;
					var end = start + 48 
					lo = lo.slice(start,end)
					$(lo).each(function(){
						$('ul',list).append('<li><a href="product/detail_temp.html'+location.search +'&product='+$(this).attr('id')+'"> \
						<img src="img/product/list/'+$(this).attr('id')+'.jpg" alt="" width="214" height="214" /></a></li>')
					})
					var s = ""
					for(var i=0; i<p;i++){
						if(page==i){
							s += '<img src="img/page'+(i+1)+'_current.gif" alt="'+(i+1)+'" width="26" height="28" />';
						} else {
							s += '<a href="'+ location.pathname + location.search + '&page=' + (i+1) +'" title="'+(i+1)+'ページ目へ"><img src="img/page'+(i+1)+'.gif" alt="'+(i+1)+'" width="26" height="28" /></a>';
						}
					}
					pagenate.append(s);
				} else {
					$(lo).each(function(){
						$('ul',list).append('<li><a href="product/detail_temp.html'+location.search +'&product='+$(this).attr('id')+'"> \
						<img src="img/product/list/'+$(this).attr('id')+'.jpg" alt="" width="214" height="214" /></a></li>')
					})
					pagenate.append('<img src="img/page1_current.gif" alt="1" width="26" height="28" />')
				}
				$('.number',list).text(sum)
			})
		}
}

function getListSub(){
	var query = location.query();
		if(query.cat && query.scat){
			var xml = 'xml/' + query.cat + '/' + query.scat +'/' + query.mid + '.xml';
			var menu = $('.menulist');
			$('img',menu).each(function(){
				var img = $(this);
				if (img.attr('src').match(query.mid)) {
					img.attr('src',img.attr('src').replace('_off', ''));
				}
			})
			$.get(xml,function(response){
				var item = $(response).find('product');
				var list = $('#prodlist')
				var pagenate = $('.pagenate',list)
				var lo = new Array();
				item.each(function(){
					if(eval($('list',this).text())) lo.push(this);
				})
				
				var sum = lo.length;
												
				if (lo.length > 48) {
					var p = lo.length / 48.0
					var page = (query.page) ? parseInt(query.page) -1  : 0
					var start = page * 48;
					var end = start + 48 
					lo = lo.slice(start,end)
					$(lo).each(function(){
						$('ul',list).append('<li><a href="product/detail_temp.html'+location.search +'&product='+$(this).attr('id')+'"> \
						<img src="img/product/list/'+$(this).attr('id')+'.jpg" alt="" width="214" height="214" /></a></li>')
					})
					var s = ""
					for(var i=0; i<p;i++){
						if(page==i){
							s += '<img src="img/page'+(i+1)+'_current.gif" alt="'+(i+1)+'" width="26" height="28" />';
						} else {
							s += '<a href="'+ location.pathname + location.search + '&page=' + (i+1) +'" title="'+(i+1)+'ページ目へ"><img src="img/page'+(i+1)+'.gif" alt="'+(i+1)+'" width="26" height="28" /></a>';
						}
					}
					pagenate.append(s);
				} else {
					$(lo).each(function(){
						$('ul',list).append('<li><a href="product/detail_temp.html'+location.search +'&product='+$(this).attr('id')+'"> \
						<img src="img/product/list/'+$(this).attr('id')+'.jpg" alt="" width="214" height="214" /></a></li>')
					})
					pagenate.append('<img src="img/page1_current.gif" alt="1" width="26" height="28" />')

				}
				$('.number',list).text(sum)
			})
		}
}