// JavaScript Document
function check_browser(){
	
	
	
	if(navigator.userAgent.indexOf("Opera") != -1){ // 文字列に「Opera」が含まれている場合
	
		the_browser = "Opera";
	
	}
	else if(navigator.userAgent.indexOf("MSIE") != -1){ // 文字列に「MSIE」が含まれている場合
	
		the_browser = "MSIE";
	
	}
	else if(navigator.userAgent.indexOf("Firefox") != -1){ // 文字列に「Firefox」が含まれている場合
	
		the_browser = "Firefox";
	
	}
	else if(navigator.userAgent.indexOf("Netscape") != -1){ // 文字列に「Netscape」が含まれている場合
	
		the_browser = "Netscape";
	
	}
	else if(navigator.userAgent.indexOf("Safari") != -1){ // 文字列に「Safari」が含まれている場合
	
		the_browser = "Safari";
	
	}
	else{
	
		the_browser = "unknown";
	
	}
	
	
	return the_browser;
}




function expence_info(){
	
	var div = new Element('div', {align: "center"});
	var table = new Element('table', {border:"2", style:"color:#FFF;"});
	var tobody = new Element('tbody');
	var tr01 = new Element('tr');
	var td0101 = new Element('td', {colspan:"2"}).update("商品代および送料以外に必要な費用は以下のいずれか");
	var tr02 = new Element('tr');
	var th0201 = new Element('th').update('銀行振込手数料<br>(三菱東京UFJ銀行)<br>(第三銀行)<br>(東海労働金庫)');
	var td0202 = new Element('td').update('同行内の手数料200円台から<br>他行扱いの通常額800円台<br>にかけてのいずれか');
	var tr03 = new Element('tr');
	var th0301 = new Element('th').update('代引き手数料<br>(佐川急便)');
	var td0302 = new Element('td').update('1万円未満：' + sagawa_daibiki_1000 + '円<br>3万円未満：' + sagawa_daibiki_10000 + '円<br>10万円未満：' + sagawa_daibiki_50000 + '円<br>30万円未満：' + sagawa_daibiki_20000 + '円<br>50万円未満：' + sagawa_daibiki_40000 + '円<br>');
	var tr04 = new Element('tr');
	var td0401 = new Element('th').update('クレジットカード決済');
	var td0402 = new Element('td').update('総額の5%');
	
	
	var input = new Element('input', {type:"button", value:"閉じる"});
	
	if(the_browser == "MSIE"){
		input.setAttribute("onclick", new Function( "close_block();"));
	}else{
		input.setAttribute("onclick", "close_block()");
	}
	
	
	tr04.appendChild(td0401);
	tr04.appendChild(td0402);
	
	tr03.appendChild(th0301);
	tr03.appendChild(td0302);
	
	tr02.appendChild(th0201);
	tr02.appendChild(td0202);
	
	tr01.appendChild(td0101);
	
	tobody.appendChild(tr01);
	tobody.appendChild(tr02);
	tobody.appendChild(tr03);
	tobody.appendChild(tr04);
	
	table.appendChild(tobody);
	
	div.appendChild(input);
	div.appendChild(table);
	
	
	block_message_element(div);
	
	
}




function taxation(price){
	var the_rate = taxrate/100;
	
	return Math.floor(price*the_rate);
}


function view_cart(){
	
	
	
	//$('notice').update(cart_summary);
	
	$('category_button_area').style.display = "none";
	
	$('display_area').style.display = "none";
	
	
	Effect.Appear('category_button_area_cart_display');
	
	
	$('small_group_button_area').style.display = "none";
	
	display_products(cart_summary);
	
	$('cart_button_area').update();
	
	var input01 = new Element('input', {type: "button", name: "back_to_prod_view", value: "買い物に戻る"});
	var the_form = new Element('form', {action:"index.php", method: "POST", name: "order",style:"margin:0px"});
	var input_act = new Element('input', {type: "hidden", name: "act", value: "order_it"});
	
	var the_div = new Element('div' , {align: "center", style: "padding:15px 5px 5px; background-color:#333; width:140px;"});
	
	var the_order_button = new Element('input' , {
									   type: "submit", 
									   name: "order_button",
									   value: "発注する"
									   
									   });
	if(the_browser == "MSIE"){
		input01.setAttribute("onclick", new Function( "return_to_shopping();"   ));
	}else{
		input01.setAttribute("onclick", "return_to_shopping()");
	}
	
	
	var br = new Element('br');
	var span = new Element('span',{style:"font-size:12; color:#FFF;"}).update("↓設定は発注前に↓");
	
	var form = new Element('form',{action:"receiver_input_form.php", name:"receiver_match_form", method:"post", style:"margin:2px 0px;"});
	var input_hidden = new Element('input', {type:"hidden", name:"act", value:"goto_receiver_match_form"});
	var input_image = new Element('input',{type:"image", src:"css/gift_setting_button.gif", width:"150"});
	
	
    if(the_browser == "MSIE"){
		input_image.setAttribute("onclick", new Function( "document.receiver_match_form.submit();" ));
	}else{
		input_image.setAttribute("onclick", "document.receiver_match_form.submit()");
	}               
           
                   
					
					
	
	
						
	the_form.appendChild(input_act);
	
	the_div.appendChild(the_order_button);
	the_div.appendChild(br);
	the_div.appendChild(span);
	
	the_form.appendChild(the_div);
	
	
	cart_button_area.appendChild(input01);
	cart_button_area.appendChild(the_form);
	
	form.appendChild(input_hidden);
	form.appendChild(input_image);
	cart_button_area.appendChild(form);

}





function message_for_ie_user(){
	
	

	if(the_browser == "MSIE"){
		
		the_version_info = navigator.appVersion;
		
		var b_position = the_version_info.indexOf("MSIE");   
		var e_position = the_version_info.indexOf(";", b_position);   
		
		
		var the_version = the_version_info.slice(b_position+5,e_position );
		
		//alert(b_position+","+e_position+","+the_version);
		
		
			
		
		

		if(the_version < 7){
		
			var close_button = new Element('input', {type:"button", value:"閉じる"});
		
			if(the_browser == "MSIE"){
				close_button.setAttribute("onclick", new Function( "close_block();"));
			}else{
				close_button.setAttribute("onclick", "close_block()");
			}
				
				
			var close_button01 = new Element('input', {type:"button", value:"閉じる"});
					
			if(the_browser == "MSIE"){
				close_button01.setAttribute("onclick", new Function( "close_block();"));
			}else{
				close_button01.setAttribute("onclick", "close_block()");
			}
			
			
			
			
			var the_div = new Element('div');
			
			
			the_div.appendChild(close_button);
			
			var the_table = new Element("table");
			var the_tbody = new Element("tbody");
			
			var the_tr01 = new Element("tr");
			var the_td = new Element("td", {colspan:"3"});
			
			var the_tr02 = new Element("tr");
			var the_td01 = new Element("td", {align:"center", style:"color:#FFF;"});
			var the_td02 = new Element("td", {align:"center", style:"color:#FFF;"});
			var the_td03 = new Element("td", {align:"center", style:"color:#FFF;"});
			
			var ie_link = new Element("a",{href:"http://o.jp.msn.com/ie8/", name:"IE8",target:"_blank"});
			var chrome_link = new Element("a",{href:"http://www.google.com/chrome?hl=ja", name:"chrome",target:"_blank"});
			var firefox_link = new Element("a",{href:"http://mozilla.jp/firefox/download/", name:"firefox",target:"_blank"});
			
			var ie_img = new Element("img",{border:"0", src:"./logo/IE8-Get_240x108_2.jpg", height:"100px", alt:"IE8"});
			var chrome_img = new Element("img",{border:"0", src:"./logo/chrome-logo.png", height:"100px", alt:"chrome"});
			var firefox_img = new Element("img",{border:"0", src:"./logo/080728_firefox.jpg", height:"100px", alt:"firefox"});
			
			var ie_div = new Element('div').update("Internet Explorer 8");
			var chrome_div = new Element('div').update("Google Chrome");
			var firefox_div = new Element('div').update("firefox");
			
			ie_link.appendChild(ie_img);
			chrome_link.appendChild(chrome_img);
			firefox_link.appendChild(firefox_img);
			
			the_td01.appendChild(ie_link);
			the_td02.appendChild(chrome_link);
			the_td03.appendChild(firefox_link);
			
			the_td01.appendChild(ie_div);
			the_td02.appendChild(chrome_div);
			the_td03.appendChild(firefox_div);
			
			the_tr02.appendChild(the_td01);
			the_tr02.appendChild(the_td02);
			the_tr02.appendChild(the_td03);
			
			var message = "お使いのブラウザはIE6ないしはそれより古く、<br>多くの問題が報告されております。<br>弊社のページ実行にエラーが生じる可能性があり、動作確認はいたしておりません。<br>是非この機会に最新のブラウザにアップグレードしていただくことをお勧めいたします。";
			
			var the_span = new Element('span', {style:"color:#FFF"}).update(message);
			
			
			the_td.appendChild(the_span);
			the_tr01.appendChild(the_td);
			
			the_tbody.appendChild(the_tr01);
			the_tbody.appendChild(the_tr02);
			
			the_table.appendChild(the_tbody);
			
			
			the_div.appendChild(the_table);
			the_div.appendChild(close_button01);
			
			
			block_message_element(the_div);
			
			
			//alert("IEバージョン6以下"+the_version);
			
		}
		
		if(the_version == 7){
			
			var height = 60;
			var left = 100;
			var close_button = new Element('input', {type:"button", value:"閉"});
			
			if(the_browser == "MSIE"){
				close_button.setAttribute("onclick", new Function( "close_tab_message("+height+","+left+");"));
			}else{
				close_button.setAttribute("onclick", "close_tab_message("+height+","+left+")");
			}
		
			
			var the_div = new Element('div');
			
			
			
			
			var the_table = new Element("table", { border:0, cellpadding:0, cellspacing:0});
			var the_tbody = new Element("tbody");
			
			var the_tr01 = new Element("tr");
			var the_td = new Element("td", {colspan:"4"});
			
			var the_tr02 = new Element("tr");
			var the_td01 = new Element("td", {align:"center", style:"color:#FFF;"});
			var the_td02 = new Element("td", {align:"center", style:"color:#FFF;"});
			var the_td03 = new Element("td", {align:"center", style:"color:#FFF;"});
			var the_td04 = new Element("td", {align:"center", style:"color:#FFF;"});
			
			var ie_link = new Element("a",{href:"http://o.jp.msn.com/ie8/", name:"IE8",target:"_blank"});
			var chrome_link = new Element("a",{href:"http://www.google.com/chrome?hl=ja", name:"chrome",target:"_blank"});
			var firefox_link = new Element("a",{href:"http://mozilla.jp/firefox/download/", name:"firefox",target:"_blank"});
			
			var ie_img = new Element("img",{border:"0", src:"./logo/IE8-Get_240x108_2.jpg", alt:"IE8"});
			var chrome_img = new Element("img",{border:"0", src:"./logo/chrome-logo.png", alt:"chrome"});
			var firefox_img = new Element("img",{border:"0", src:"./logo/080728_firefox.jpg", alt:"firefox"});
			
			ie_img.style.height = 20+"px";
			chrome_img.style.height = 20+"px";
			firefox_img.style.height = 20+"px";
			
			ie_img.style.width = 20+"px";
			chrome_img.style.width = 20+"px";
			firefox_img.style.width = 20+"px";
			
			
			var ie_div = new Element('div', {style:"font-size:9px;"}).update("Internet Explorer 8");
			var chrome_div = new Element('div',{style:"font-size:9px;"}).update("Google Chrome");
			var firefox_div = new Element('div',{style:"font-size:9px;"}).update("firefox");
			
			ie_link.appendChild(ie_img);
			chrome_link.appendChild(chrome_img);
			firefox_link.appendChild(firefox_img);
			
			the_td01.appendChild(ie_link);
			the_td02.appendChild(chrome_link);
			the_td03.appendChild(firefox_link);
			
			the_td01.appendChild(ie_div);
			the_td02.appendChild(chrome_div);
			the_td03.appendChild(firefox_div);
			
			the_td04.appendChild(close_button);
			
			
			
			the_tr02.appendChild(the_td01);
			the_tr02.appendChild(the_td02);
			the_tr02.appendChild(the_td03);
			the_tr02.appendChild(the_td04);
			
			
			
			var message = "お使いのブラウザIE7はバージョンが古く弊社のページ表示が乱れる可能性があります。より信頼性の高い製品に乗り換えることををお勧めいたします。";
				//alert("IEバージョン7");
			var the_span = new Element('span', {style:"font-size:9px; color:#FFF;"}).update(message);
		
		
			the_td.appendChild(the_span);
			the_tr01.appendChild(the_td);
				
			the_tbody.appendChild(the_tr01);
			the_tbody.appendChild(the_tr02);
				
			the_table.appendChild(the_tbody);
				
				
			the_div.appendChild(the_table);
			
			//the_div.appendChild(close_button);
			
			//setTimeout(tag_message(the_div,350,left,height),1250);
			
			
			
			tag_message(the_div,350,left,height);
		}
		
		/*
		if(the_version < 8){
			
			the_td.appendChild(the_span);
			the_tr01.appendChild(the_td);
			
			the_tbody.appendChild(the_tr01);
			the_tbody.appendChild(the_tr02);
			
			the_table.appendChild(the_tbody);
			
			
			the_div.appendChild(the_table);
			the_div.appendChild(close_button01);
			
			
			block_message_element(the_div)
			
			//alert("IEバージョン8以上");
		}
		*/
		
		
	}


	
}function return_to_shopping(){
	
	
	
	
	$('cart_button_area').update();
	
	
	var input01 = new Element('input', {type: "button", name: "cart", value: "カート内チェック"});

	
	if(the_browser == "MSIE"){
		input01.setAttribute("onclick", new Function( "view_cart();"   ));
	}else{
		input01.setAttribute("onclick", "view_cart()");
	}
	
	var the_text = new Element('div', {style:"padding:5px; width:140px; background:#333; font-size:12; color:#FFF; text-align:center;"}).update("↑発注はここから↑<br>↑確認後に　　　↑");
	
	
	var input02 = new Element('input', {type: "button", name: "expence_info", value: "その他の費用"});

	
	if(the_browser == "MSIE"){
		input02.setAttribute("onclick", new Function( "expence_info();"   ));
	}else{
		input02.setAttribute("onclick", "expence_info()");
	}
	
	
	
	var form = new Element('form',{action:"receiver_input_form.php", name:"receiver_match_form", method:"post", style:"margin:2px 0px;"});
	var input_hidden = new Element('input', {type:"hidden", name:"act", value:"goto_receiver_match_form"});
	var input_image = new Element('input',{type:"image", src:"css/gift_setting_button.gif", width:"150"});
	
	
    if(the_browser == "MSIE"){
		input_image.setAttribute("onclick", new Function( "document.receiver_match_form.submit();" ));
	}else{
		input_image.setAttribute("onclick", "document.receiver_match_form.submit()");
	} 
	
	
	
	cart_button_area.appendChild(input01);
	cart_button_area.appendChild(the_text);
	
	form.appendChild(input_hidden);
	form.appendChild(input_image);
	cart_button_area.appendChild(form);
	
	
	
	
	cart_button_area.appendChild(input02);
	
	
	
	
	change_category(current_category_id);
	
	$('category_button_area_cart_display').style.display = "none";
	Effect.Appear('category_button_area');
	
	
	
	
}



function to_group_system(){
		location.href='group_system.php';
	}
	
	
function isNumber( _str,isInt,max,min ){
        var str,num;
        str = String(_str);
        if( isNaN( str ) )return false;
        num = eval( str );
        if( isInt==null )return true;
        else if( isInt )if( num!=parseInt(num) )return false;
        if( max==null )return true;
        max = String(max).toLowerCase();
        if( max!="false" || max=="0" )if( num>eval(max) )return false;
        if( min==null )return true;
        min = String(min).toLowerCase();
        if( min!="false" || min=="0" )if( num<eval(min) )return false;
        return true;
	}
	
function back_to_special_select(){
	
	location.href = "http://www.kobaz.jp/gift/special_selict/";
	
}


function shipping_dialog(prod_id){
	
	
	z_index++;
	
	
	var the_parameter = "current_category_id=" + current_category_id + "&";
	
	the_parameter += "prod_id=" + prod_id + "&";

	the_parameter += "size=" + all_products[current_category_id][prod_id].size + "&";
	the_parameter += "weight=" + all_products[current_category_id][prod_id].weight + "&";
	the_parameter += "experation_view_type=" + all_products[current_category_id][prod_id].experation_view_type + "&";
	the_parameter += "cool_check=" + all_products[current_category_id][prod_id].cool_check;
	
	
	
	
	
	
	new Ajax.Request("/ajax/shipping.php", {
					method: "post",
					parameters: the_parameter,
					onCreate: function (){
						
						
						
						create_loading();
						
					},
					onSuccess: function(transport) {
						
						
						Element.remove("w_block");
						
						block_message(transport.responseText);
	
					}
	});

}

function enlarge_image(prod_id){
	
	
	file_name = all_products[current_category_id][prod_id].products_id + ".php";
	
	
	location.href = "http://www.kobaz.jp/products_pages/" + file_name + "?current_category_id=" + current_category_id;
	

}

function enlarge_image_old(prod_id){
	
	//$('notice').update(the_parameter);
	
	z_index++;
	
	
	var the_parameter = "current_category_id=" + current_category_id + "&";
	
	
	the_parameter += "prod_id=" + prod_id;
	
	
	
	//$('notice').update(the_parameter);
	
	
	new Ajax.Request("/ajax/enlarge_prod_image.php", {
					method: "post",
					parameters: the_parameter,
					onCreate: function (){
						
						
						
						create_loading();
						
					},
					onSuccess: function(transport) {
						
						
						Element.remove("w_block");
						
						block_message(transport.responseText);
	
					}
	});

}



function yes_empty(){
	
	Element.remove("block");
	Element.remove("message_table");
	
	new Ajax.Request("/ajax/empty_cart.php", {
					method: "post",
					//parameters: the_parameter,
					onCreate: function (){
	
						create_loading();
						
					},
					onSuccess: function(transport) {
						
						Element.remove("w_block");
						
						//$('notice').update(transport.responseText);
						
						
						
						cart_summary = new Array();
						count = 0;
						cart_amount_total = 0;
						car_total = 0;
						
						
						//$('notice').update(current_small_group_key);
						
						return_to_shopping();
						
						/*
						view_products = all_products[current_category_id];
						change_small_group(current_small_group_key)
						*/
					
						var update_test_element = new Element('font', {size:"2"}).update(count + "種" + cart_amount_total + "個");
						var the_br = new Element('br');
						var the_span = new Element('span').update(car_total + "円");
						
						
						$('inside_cart').update();
						$('inside_cart').appendChild(update_test_element);
						$('inside_cart').appendChild(the_br);
						$('inside_cart').appendChild(the_span);
					
					}
	});
	
	
}

function buy_up(prod_id){
	$('buy_amount_'+prod_id).value = parseInt($('buy_amount_'+prod_id).value) + 1;
	
	buy(prod_id);
	
}
function buy_down(prod_id){
	
	if($('buy_amount_'+prod_id).value > 0){
		$('buy_amount_'+prod_id).value = parseInt($('buy_amount_'+prod_id).value) - 1;
	}
	
	
	buy(prod_id);
	
}

function buy(prod_id){
	
	
	z_index++;
	
	
	var the_parameter = "current_category_id=" + current_category_id + "&";
	
	
	the_parameter += "prod_id=" + prod_id + "&";
	
	the_parameter += "amount=" + $('buy_amount_'+prod_id).value;
	
	
	
	
	//$('notice').update(the_parameter);
	
	
	new Ajax.Request("/ajax/buy.php", {
					method: "post",
					parameters: the_parameter,
					onCreate: function (){
						
						
						
						create_loading();
						
					},
					onSuccess: function(transport) {
						Element.remove("w_block");
						
						
						cart_summary = transport.responseText.evalJSON();
						
						//$('notice').update(transport.responseText);
						
						var test = "";
						
						count = 0;
						car_total = 0;
						cart_amount_total = 0;
						for( var i in cart_summary){
							if(cart_summary[i]['amount'] > 0){
								
									car_total = cart_summary[i]['amount']*taxation(cart_summary[i]['sale_price']) + car_total;
									cart_amount_total = cart_summary[i]['amount'] + cart_amount_total;
									
									if(	$("buy_button_td_" + i) != null){
									
										
										
										var innter_td22_div = new Element('div');
										
										the_result_div = create_buy_box_with_preset_amount(i);
										
										innter_td22_div.appendChild(the_result_div);
										
										$("buy_button_td_" + i).update(innter_td22_div);
									}
							
							}
							count++;
						}
						
					
						var update_test_element = new Element('font', {size:"2"}).update(count + "種" + cart_amount_total + "個");
						var the_br = new Element('br');
						var the_span = new Element('span').update(car_total + "円");
						
						
						$('inside_cart').update();
						$('inside_cart').appendChild(update_test_element);
						$('inside_cart').appendChild(the_br);
						$('inside_cart').appendChild(the_span);
						
						
						
					}
	});
	
	
}

function change_category(category_id){

	current_category_id = category_id;
	
	z_index++;
	
	
	
	var the_parameter = "category_id=" + current_category_id;
	
	
	new Ajax.Request("/ajax/change_category.php", {
					method: "post",
					parameters: the_parameter,
					onCreate: function (){
						
						
						
						create_loading();
						
					},
					onSuccess: function(transport) {
						
						
						
						$("display_area").style.display = "none";
						
						
						
						Element.remove("w_block");
						
						
						
						the_result = transport.responseText.evalJSON();
						
						all_products = the_result[0];
						small_groups = the_result[1];
						
						
						
						
	
						var view_products = new Array;
						
						view_products = all_products[current_category_id];
						
						//$('notice').update(view_products);
						display_products(view_products);
						//$('notice').update('test');
						
						
						$("display_area").innerHTML = $(current_category_id).innerHTML
						
						Effect.Appear("display_area");
	
						display_group_button("999");
	
					}
	});

}



function to_group_sale_exp(){
		
		if ($("block") != null){
			
			close_block();
		}
		
		//block_message_div(group_sale_exp);
		
		
		var win_check = "no";
		if (navigator.platform.indexOf("Win") != -1) {
			win_check = "yes";
		}
		
		
	
		if(win_check == "no"){
			
		
		
			var the_embed = new Element("embed", {
													src:"/mov/group_sale.mov", 
													
													width:"640", 
													height:"500",
													autoplay:"true",
													controller:"true",
													pluginspage:"http://www.apple.com/quicktime/download/"
													
										});
			
			
			$('group_sale_exp_video').update();
			
			$('group_sale_exp_video').appendChild(the_embed);
			
			block_message_div(group_sale_exp);
		}else{
		
			new Ajax.Request("/mov/group_sale_exp.php", {
							method: "post",
	
							onCreate: function (){
								
								create_loading();
								
							},
							onSuccess: function(transport) {
								
								Element.remove("w_block");
	
								block_message(transport.responseText);
	
			
							}
			});
		
		}
		
	
		
	}
	
	function to_top_exp(){
		var win_check = "no";
		if (navigator.platform.indexOf("Win") != -1) {
			win_check = "yes";
		}
		
		
		if ($("block") != null){
			
			close_block();
		}
		if(win_check == "no"){
			
		
		
			var the_embed = new Element("embed", {
													src:"/mov/group_system.mov", 
													
													width:"640", 
													height:"500",
													autoplay:"true",
													controller:"true",
													pluginspage:"http://www.apple.com/quicktime/download/"
													
										});
			
			
			$('kodengaeshi_exp_video').update();
			
			$('kodengaeshi_exp_video').appendChild(the_embed);
			
			block_message_div(kodengaeshi_exp);
		}else{
		
			new Ajax.Request("/mov/group_system_exp.php", {
							method: "post",
	
							onCreate: function (){
								
								create_loading();
								
							},
							onSuccess: function(transport) {
								
								Element.remove("w_block");
	
								block_message(transport.responseText);
	
			
							}
			});
		
		}
		
		
	}
	
	function to_kiakebun_exp(){
		
		if ($("block") != null){
			
			close_block();
		}
		
		//block_message_div(kiakebun_exp);
		
		
		var win_check = "no";
		if (navigator.platform.indexOf("Win") != -1) {
			win_check = "yes";
		}
		
		
	
		if(win_check == "no"){
			
		
		
			var the_embed = new Element("embed", {
													src:"/mov/kiakebun.mov", 
													
													width:"640", 
													height:"500",
													autoplay:"true",
													controller:"true",
													pluginspage:"http://www.apple.com/quicktime/download/"
													
										});
			
			
			$('kiakebun_exp_video').update();
			
			$('kiakebun_exp_video').appendChild(the_embed);
			
			block_message_div(kiakebun_exp);
		}else{
		
			new Ajax.Request("/mov/kiakebun_exp.php", {
							method: "post",
	
							onCreate: function (){
								
								create_loading();
								
							},
							onSuccess: function(transport) {
								
								Element.remove("w_block");
	
								block_message(transport.responseText);
	
			
							}
			});
		
		}
		
	}

function group_exp(){
		
		var win_check = "no";
		if (navigator.platform.indexOf("Win") != -1) {
			win_check = "yes";
		}
		
		
		
		
		
		
	
		
		if(win_check == "yes"){
			
			new Ajax.Request("test2.php", {
							method: "post",
	
							onCreate: function (){
								
								create_loading();
								
							},
							onSuccess: function(transport) {
								
								Element.remove("w_block");
	
								block_message(transport.responseText);
	
			
							}
			});
		
			
	
		}else{
			var the_div = new Element('div');
			
			var close_button = new Element('input', {type:"button", value:"閉じる"});
			
			if(the_browser == "MSIE"){
				close_button.setAttribute("onclick", new Function( "close_block();"));
			}else{
				close_button.setAttribute("onclick", "close_block()");
			}
			
			
			var close_button01 = new Element('input', {type:"button", value:"閉じる"});
				
			if(the_browser == "MSIE"){
				close_button01.setAttribute("onclick", new Function( "close_block();"));
			}else{
				close_button01.setAttribute("onclick", "close_block()");
			}
				
			
			the_div.appendChild(close_button01);
				
			var the_text = new Element("span").update("<br>グループ処理画面は、グループ内の複数の送り先に対して同じ商品を送付する、<br>香典返しや企業のお中元お歳暮のようなケースに威力を発揮する<br>弊社独自の特別レイアウトです。<br>");
				
			the_div.appendChild(the_text);
			
		
		
			var the_embed = new Element("embed", {
													src:"/mov/shop_exp.mov", 
													
													width:"640", 
													height:"500",
													autoplay:"true",
													controller:"true",
													pluginspage:"http://www.apple.com/quicktime/download/"
													
										});
			
			
			
			
			the_div.appendChild(the_embed);
			
			var br = new Element("span").update("<br>");
		
			the_div.appendChild(br);
			
			the_div.appendChild(close_button);
			
			block_message_element(the_div);
		}
		
		
		
		
		
		
	
	
	
	//**********　　　表示の整形********　　　　2009/10/24
	}
	
function price_range_set_toggle_action(){
										
										Effect.toggle('price_range_set_area', 'appear');
	
	
										$('price_range_set_area_toggle').update();
										
										if($('price_range_set_area').style.display == "none"){
											var the_image = new Element('img', {src:"css/tiriangle_arrow/arrow_v.gif", width:"10", height:"10", alt:"arrow"});
											$('price_range_set_area_toggle').style.borderBottom = "";
										}else{
											var the_image = new Element('img', {src:"css/tiriangle_arrow/arrow.gif", width:"10", height:"10", alt:"arrow"});
											$('price_range_set_area_toggle').style.borderBottom = "thin solid #000";
										}
										
										var the_text = new Element('span',{style:"font-size:11; padding-left:3px;"}).update("価格帯の絞り込み");
										$('price_range_set_area_toggle').appendChild(the_image);
										$('price_range_set_area_toggle').appendChild(the_text);
										
									}
									
									function sort_toggle_action(){
										
										Effect.toggle('sort_area', 'appear');
										
										
	
	
										$('sort_area_toggle').update();
										
										if($('sort_area').style.display == "none"){
											var the_image = new Element('img', {src:"css/tiriangle_arrow/arrow_v.gif", width:"10", height:"10", alt:"arrow"});
											
											$('sort_area_toggle').style.borderBottom = "";
											
										}else{
											var the_image = new Element('img', {src:"css/tiriangle_arrow/arrow.gif", width:"10", height:"10", alt:"arrow"});
											$('sort_area_toggle').style.borderBottom = "thin solid #000";
										}
										
										var the_text = new Element('span',{style:"font-size:11; padding-left:3px;"}).update("商品の並べ替え");
										$('sort_area_toggle').appendChild(the_image);
										$('sort_area_toggle').appendChild(the_text);
										
										
										
									}
									
function create_select_products_array_price(view_products){
										
										var form = $('price_select_form');
										
										
										var checked = form.getInputs('radio','original_or_sale_price').find(function(radio) { return radio.checked; }).value;
										
										var prices = form.getInputs('text');
										
										var min_price = prices[0].value;
										var max_price = prices[1].value;
										
										
										var sale_price_array = new Array();
										
										var orginal_price_array = new Array();
										
										for(var i in view_products){
											
											if(min_price > 0){
												if(parseInt(view_products[i]['sale_price']) < min_price){
													sale_price_array.push(i);
													
												}
											}
											
											
											if(max_price > 0){
												if(parseInt(view_products[i]['sale_price']) > max_price){
													sale_price_array.push(i);
												
												}
											}
											
										
										
										
										
										
											if(view_products[i]['original_price']){
												if(min_price > 0){
													if(parseInt(view_products[i]['original_price']) < min_price){
														orginal_price_array.push(i);
													}
												}
												
												
												if(max_price > 0){
													if(parseInt(view_products[i]['original_price']) > max_price){
														orginal_price_array.push(i);
													}
												}
											
											}else{
											
												orginal_price_array.push(i);
											
											}
											
											
										}
										
										
										
										
										var the_result = new Object();
										
										if(checked == "sale_price"){
										
										
											for(var i in view_products){
												
												if(sale_price_array.indexOf(i) < 0){
													the_result[i] = view_products[i];
												}
												
												
											}
											
											
										}else{
										
											for(var i in view_products){
												
												if(orginal_price_array.indexOf(i) < 0){
													the_result[i] = view_products[i];
												}
											
											}
											
										}
										
										
										
										return the_result;
									}
									
									
									
									
									
									
									function price_select_excite(){
										
										//**********   小区分
										if(!current_small_group_key){
											current_small_group_key = "999";
										}
										
										var view_products = change_products_list(current_small_group_key,all_products[current_category_id]);
										//**********   小区分
										
										
										
										view_products = create_select_products_array_price(view_products);
								
										select_flag = "selected";
										
										
										
										
										
										
										//********   sort
										if(sorted_flag){
											view_products = sort_part(view_products,sorted_flag);
										}
										//********   sort
										
										
										
										display_products(view_products);
										
										
										
										
										Effect.Appear("price_select_cancel_button");
										
									}
									
									function price_select_cancel(){
										
										select_flag = "";
										
										$('max_price').value = "";
										$('min_price').value = "";
										
										
										//**********   小区分
										if(!current_small_group_key){
											current_small_group_key = "999";
										}
										
								
										var view_products = change_products_list(current_small_group_key,all_products[current_category_id]);
										//**********   小区分
										
										
										
										
										//********   sort
										if(sorted_flag){
											view_products = sort_part(view_products,sorted_flag);
										}
										//********   sort
										
										
										display_products(view_products);
										
										
										$('price_select_cancel_button').style.display = "none";
										
									}
									
									
									function sort_part(view_products,type){
										
										var the_sort_key = "";
										
										if(type == "sold_price_ac" || type == "sold_price_dec"){
											the_sort_key = "sale_price";
										}
										
										if(type == "rate_ac" || type == "rate_dec"){
											the_sort_key = "rate";
										}
										
										
										
										var view_products_for_sort = new Array();
										for( var i in view_products ){
											
											if(view_products[i]['products_id']){
												
												view_products_for_sort.push({key:i,val:view_products[i],sort_kay:view_products[i][the_sort_key]});
												
												;
											}
										}
										
										view_products_for_sort.sort(function(a, b) {return a.sort_kay - b.sort_kay});
										
										if(type == "rate_dec" || type == "sold_price_dec"){
											view_products_for_sort.reverse();
											
										}

										
										
										
										var view_products_for_display = new Object();
										
										for(var i = 0; i < view_products_for_sort.length; i++){
											
											view_products_for_display[view_products_for_sort[i]['key']] = view_products_for_sort[i]['val'];
											
										}
										
										
														
										
										return view_products_for_display;
										
									}
									
									function prod_sort(type){
										
										sorted_flag = type;
										
										
										var view_products = new Object();
										
										
										if(select_flag == "selected"){
											
											view_products = create_select_products_array_price(all_products[current_category_id]);
											
										}else{
											
											view_products = all_products[current_category_id];
										}
										
										
										
										if(!current_small_group_key){
											current_small_group_key = "999";
										}
										
								
										view_products = change_products_list(current_small_group_key,view_products);
									
										
										view_products = sort_part(view_products,type);
										
										
										display_products(view_products);
										
										
										$('sort_result_type').update();
										var sort_result_type_display = "";
										
										if(type == "sold_price_dec"){
											sort_result_type_display = "売値・高い順：表示中";
										}
										if(type == "sold_price_ac"){
											sort_result_type_display = "売値・安い順：表示中";
										}
										if(type == "rate_dec"){
											sort_result_type_display = "割引率・高い順：表示中";
										}
										if(type == "rate_ac"){
											sort_result_type_display = "割引率・低い順：表示中";
										}
										
										
										$('sort_result_type').update(sort_result_type_display);
										Effect.Appear("sort_result_type");
										
										Effect.Appear("sort_cancel");
										
									}
									
									function sort_cancel(){
										
										sorted_flag = "";
										
										
										var view_products = new Object();
										
										//$('notice').update('test');
										
										
										if(select_flag == "selected"){
											
											view_products = create_select_products_array_price(all_products[current_category_id]);
											
										}else{
											
											view_products = all_products[current_category_id];
										}
										
										
										
										if(!current_small_group_key){
											current_small_group_key = "999";
										}
										
								
										view_products = change_products_list(current_small_group_key,view_products);
									
										
										
										display_products(view_products);
										
										
										$('sort_cancel').style.display = "none";
										
										$('sort_result_type').style.display = "none";
										
										
										
										
									}
									


function create_buy_box_with_preset_amount(record_id){
	
					var the_result_div = new Element('div');

					var input_up = new Element('input', { type:"button", value:" ↑ ", style:"display:block;"});
					var input_down = new Element('input', { type:"button", value:" ↓ "});
					
					var input_amount = new Element('input', {
													id:"buy_amount_"+record_id,
													type: "text", size:"3",
													name:"amount",
													value:cart_summary[record_id]['amount']
													});
					
					var input_submit = new Element('input', {type: "button", value:"変更",style:"display:block;"});
					var span_text = new Element('span').update("個<br>");
					
					if(the_browser == "MSIE"){
						//the_image.setAttribute("test", "test");
						input_submit.setAttribute("onclick", new Function( "buy('" + record_id + "');"   ));
					}else{
						input_submit.setAttribute("onclick", "buy('" + record_id + "')");
					}
					
					if(the_browser == "MSIE"){
						//the_image.setAttribute("test", "test");
						input_up.setAttribute("onclick", new Function( "buy_up('" + record_id + "');"   ));
					}else{
						input_up.setAttribute("onclick", "buy_up('" + record_id + "')");
					}
					
					if(the_browser == "MSIE"){
						//the_image.setAttribute("test", "test");
						input_down.setAttribute("onclick", new Function( "buy_down('" + record_id + "');"   ));
					}else{
						input_down.setAttribute("onclick", "buy_down('" + record_id + "')");
					}
					//$('notice').update("ここ");
					the_result_div.appendChild(input_up);
					the_result_div.appendChild(input_amount);
					the_result_div.appendChild(span_text);
					the_result_div.appendChild(input_submit);
					the_result_div.appendChild(input_down);
					
					return the_result_div;
}
function display_products(the_view_products){
	
	var diplay_order = new Array;
	var raw = 0;
	var col = 0;
	
	for(var i in the_view_products){
	
		if(the_view_products[i].products_id){
			
			if (raw in diplay_order){
				
				diplay_order[raw][col] = the_view_products[i];
				
				diplay_order[raw][col].record_id = i;
		
				col++;
				
			}else{
				diplay_order[raw] = new Array;
		
				diplay_order[raw][col] = the_view_products[i];
				
				diplay_order[raw][col].record_id = i;
				
				
				col++;
				
			}
			
			if(col == 4){
				raw ++;	
				col = 0;
			}
		}
			
	}
	
	
	
	
	raw = 0;
	col = 2;
	
	
	
	
	
	var the_table01 = new Element('table', {border: "0",  cellpadding: "0", cellspacing: "0"});
	var the_tbody01 = new Element('tbody');
	
	for( raw = 0 ; raw < diplay_order.length; raw++){
		
		
		
		var the_tr = new Element('tr');
		
		for( col= 0 ; col <  diplay_order[raw].length; col++){
			
			var the_td = new Element('td', { align: "center"});
			var innter_table = new Element('table', { border: "0",  cellpadding: "0", cellspacing: "0", width: "200px", height:"200px"});
			var innter_tbody = new Element('tbody');
			
			var inner_tr1 = new Element('tr');
			var innter_td11 = new Element('td', {
										  valign: "middle", 
										  height: "10px",  
										  width: "100%", 
										  align: "center", 
										  colspan: "2",
										  background: "/utilities/category_back/category_back_r2_c2.gif"
										  });
			
			var inner_tr1_1 = new Element('tr');
			var innter_td11_1 = new Element('td', {
										  valign: "middle", 
										  height: "10px",  
										  width: "100%", 
										  align: "center", 
										  colspan: "2",
										  style:"font-size:9px;"
										  }).update(diplay_order[raw][col].maker + diplay_order[raw][col].name + diplay_order[raw][col].code);
			
			
			
			inner_tr1_1.appendChild(innter_td11_1);
			
			
			
			var innter_tr2 = new Element('tr');
			var innter_td21 = new Element('td', {align: "center", height: "93px"});
			var the_draggable = new Element('div', { id: "draggable_product_" + diplay_order[raw][col].record_id });
			
			
			
			var the_image = new Element('input', {
										
										type: "image",
										name: "prod_view" + diplay_order[raw][col].record_id, 
										height: "75px",
										width: "100px",
										src: "/pix/thumbnails_100pix/" + diplay_order[raw][col].pix,
										title:"画像拡大"
										});
			
			
			
		
			/*
			*/
			if(the_browser == "MSIE"){
				//the_image.setAttribute("test", "test");
				the_image.setAttribute("onclick", new Function( "enlarge_image('" + diplay_order[raw][col].record_id + "');"   ));
			}else{
				the_image.setAttribute("onclick", "enlarge_image('" + diplay_order[raw][col].record_id + "')");
			}
			
			
			
			
			
			
			
			
			var innter_td22 = new Element('td', {align: "center", id:"buy_button_td_" + diplay_order[raw][col].record_id});
			var shipping = new Element('input', {type: 'button' ,title:"送料計算を表示する", value: "送料"});
			
			
			
			
			
			if(the_browser == "MSIE"){
				shipping.setAttribute("onclick", new Function( "shipping_dialog('" + diplay_order[raw][col].record_id + "');"   ));
			}else{
				shipping.setAttribute("onclick","shipping_dialog('" + diplay_order[raw][col].record_id + "')");
			}
			
			
			
			var inner_tr3 = new Element('tr');
			
			var innner_td31 = new Element('td', {align: "center", colspan: "2"});
			
			var the_text = "";
			if(current_category_id == "webct21" || current_category_id == "webct22"){
				
				if(diplay_order[raw][col].rate > 0){
					var the_text01 = new Element('font', { style: "font-size:14px;"}).update("定価:"+ taxation(diplay_order[raw][col].original_price) + "円 ");
				}else{
					var the_text01 = new Element('font', { style: "font-size:14px;"}).update("定価:オープン");
				}
				
				innner_td31.appendChild(the_text01);
		
			}
			var the_text02 = new Element('font', {style: "font-size:14px;", color: "#FF0000"}).update("売値:"+ taxation(diplay_order[raw][col].sale_price) + "円");
			
			innner_td31.appendChild(the_text02);
			
			
			var inner_tr4 = new Element('tr');
			var innner_td41 = new Element('td', {align: "center", colspan: "2"});
			
			var the_text = "";
			if(current_category_id == "webct21" || current_category_id == "webct22"){
				
				if(diplay_order[raw][col].rate > 0){
					var the_text11 = new Element('font', { style: "font-size:14px;",color: "#FF0000"}).update("割引:"+diplay_order[raw][col].rate + "%off ");
				}else{
					var the_text11 = new Element('font', { style: "font-size:14px;",color: "#FF0000"});
				}
				
				innner_td41.appendChild(the_text11);
		
			}
			
			if(diplay_order[raw][col].stock_view_type == "yes"){
				var the_text12 = new Element('span', { style: "cursor:pointer; font-size:14px;", title:"随時入庫とは"}).update("随時入庫");
				
				if(the_browser == "MSIE"){
					the_text12.setAttribute("onclick", new Function( "block_message_div('exp_always');"   ));
				}else{
					the_text12.setAttribute("onclick","block_message_div('exp_always')");
				}
				
				
				innner_td41.appendChild(the_text12);
			}else{
				var the_text12 = new Element('span', { style: "cursor:pointer; font-size:14px;", title:"在庫商品とは"}).update("在庫:" + diplay_order[raw][col].stock_amount + "個");
				
				if(the_browser == "MSIE"){
					the_text12.setAttribute("onclick", new Function( "block_message_div('exp_limited');"   ));
				}else{
					the_text12.setAttribute("onclick","block_message_div('exp_limited')");
				}
				
				
				
				innner_td41.appendChild(the_text12);
			}
			
			if(current_category_id == "webct22"){
				
				var the_text13 = new Element('font', { style: "font-size:14px;",color: "#FF0000"}).update("<br>1ケース"+diplay_order[raw][col].amount_in_a_box + "個入り");
				innner_td41.appendChild(the_text13);
		
			}
			
			var inner_tr5 = new Element('tr');
			var innner_td51 = new Element('td', {align: "center", colspan: "2"});
			innner_td51.appendChild(shipping);
			
			inner_tr5.appendChild(innner_td51);
			
			
			
			inner_tr4.appendChild(innner_td41);
			inner_tr3.appendChild(innner_td31);
			
		
			var innter_td22_div = new Element('div');
			
			if(diplay_order[raw][col].stock_amount < 1 && diplay_order[raw][col].stock_view_type != "yes"){
				
				var innter_td22_content = new Element('font', {size:"2", color:"#FF0000"}).update("完売");
				innter_td22_div.appendChild(innter_td22_content);
				
			}else{
				
				
				if(cart_summary[diplay_order[raw][col].record_id] == undefined){
				
				
					var input_amount = new Element('input', {id:"buy_amount_"+diplay_order[raw][col].record_id, type: "text", size:"3", name:"amount"});
					var input_submit = new Element('input', {type: "button",title:"カート内に入れる作業", value:"購入"});
					var span_text = new Element('span').update("個<br>");
					
					if(the_browser == "MSIE"){
						//the_image.setAttribute("test", "test");
						input_submit.setAttribute("onclick", new Function( "buy('" + diplay_order[raw][col].record_id + "');"   ));
					}else{
						input_submit.setAttribute("onclick", "buy('" + diplay_order[raw][col].record_id + "')");
					}
					
					innter_td22_div.appendChild(input_amount);
					innter_td22_div.appendChild(span_text);
					innter_td22_div.appendChild(input_submit);
					
				}else{
				
					var the_resutl_div = new Element('div');
					the_resutl_div = create_buy_box_with_preset_amount(
															
															diplay_order[raw][col].record_id
															);
					
					innter_td22_div.appendChild(the_resutl_div);
				}
				
				
				
			}
			
			innter_td22.appendChild(innter_td22_div);
		
		
			//innter_td22.appendChild(shipping);
			
			
			the_draggable.appendChild(the_image);
			
			
			
			innter_td21.appendChild(the_draggable);
			
			innter_tr2.appendChild(innter_td21);
			innter_tr2.appendChild(innter_td22);
			
			inner_tr1.appendChild(innter_td11);
			
			innter_tbody.appendChild(inner_tr1);
			
			innter_tbody.appendChild(inner_tr1_1);
			
			
			innter_tbody.appendChild(innter_tr2);
			innter_tbody.appendChild(inner_tr3);
			innter_tbody.appendChild(inner_tr4);
			innter_tbody.appendChild(inner_tr5);
			
			innter_table.appendChild(innter_tbody);
			the_td.appendChild(innter_table);
			
			the_tr.appendChild(the_td);
			
			//text += diplay_order[raw][col].record_id + ",";
		
		}
			
	
		
		the_tbody01.appendChild(the_tr);
		
	}
	
	
	
	
	
	
	
	the_table01.appendChild(the_tbody01);
	
	
	$('products_list_area_inner_area').update();
	//
	
	$('products_list_area_inner_area').update(the_table01);
	
	
	
	$('products_list_area').style.display = "none";
	

	Effect.Appear('products_list_area');
	
	/*
	
	var test = "";
	for(var i in all_products[current_category_id]){
		
		test += all_products[current_category_id][i]['name']+"<br>";
		
	}
	
	$('notice').update(test);
	
	*/
}

function display_group_button(the_key){
	
	//alert(the_key);
	
	


	
	current_small_group = new Object;
											//Effect.DropOut('small_group_button_area');
	
	
	//$('small_group_button_area').style.display = "none";
	
	
	
	if(the_key != "999"){
		//current_small_group.category = small_groups[the_key].category;
		current_small_group.name = small_groups[the_key];
		current_small_group.the_key = the_key;
	}else{
		//current_small_group.category = "";
		current_small_group.name = "";
		current_small_group.the_key = the_key;
	}
											
	$('small_group_button_area_inner_area').update();
											
						//$('notice').update(small_groups[1]);					
	for(var i in small_groups){
											
		if( i != current_small_group.the_key){
			
				if(isNumber(i)){
					
					var the_button = new Element("input", {
												 id: "small_group_button_id_" + i ,
												type: "button",
												name: "small_group_button_" + i ,
												//onclick: "change_small_group('" + i + "')",
												value: small_groups[i]
											 });
					
					
					
					
					if(the_browser == "MSIE"){
						the_button.setAttribute("onclick",new Function("change_small_group('"+i+"');"));
					}else{
						the_button.setAttribute("onclick","change_small_group('" + i + "')");
					}
					
					
					
					
					$('small_group_button_area_inner_area').appendChild(the_button);
				}
	
		}
												
											
												
	}
											
											
	if(the_key != "999"){
		var cancel = new Element("input", {
										type: "button",
										name: "cancel",
										
										value: "グループキャンセル"
								});
										
										
		if(the_browser == "MSIE"){
			cancel.setAttribute("onclick",new Function("change_small_group('999');"));
		}else{
			cancel.setAttribute("onclick","change_small_group('999')");
		}
			
			
		$('small_group_button_area_inner_area').appendChild(cancel);
	}
	
	
	$('small_group_button_area').style.display = "none";
	Effect.Appear('small_group_button_area');
											
											
	//   鳥秀牛肉特別処理									
	if(current_category_id == "webct29"){
		$("display_area").style.display = "none";
		
		
		if(current_small_group.name == "焼き肉用"){
		
			$("display_area").innerHTML = $("yakiniku_exp").innerHTML
		}
		if(current_small_group.name == "すき焼き用"){
			$("display_area").innerHTML = $("sukiyaki_exp").innerHTML
		
		}
		if(current_small_group.name == ""){
			
			$("display_area").innerHTML = $(current_category_id).innerHTML
			
		}
		
		Effect.Appear("display_area");
	}
	
	if(current_category_id == "webct21"){
		$("display_area").style.display = "none";
		
			$("display_area").innerHTML = $(current_category_id).innerHTML
			
		if(current_small_group.name == "龍馬が愛した素麺"){
		
			$("display_area").innerHTML = $("ryoma_somen").innerHTML
		}
		
		
		
		Effect.Appear("display_area");
	}
							
	
										
}


function change_products_list(the_key,view_products){
											
											//$('notice').update(current_category_id);
											//var test = "";
											
											if(the_key != "999"){
												var selected_products = new Object;
											
												for(var i in view_products){
													
													if(view_products[i].record_id){
														if(view_products[i].small_group == current_small_group.name){
															//selected_products.push(view_products[i]);
															selected_products[view_products[i].record_id] = new Array();
															selected_products[view_products[i].record_id] = view_products[i];
															//test += view_products[i].record_id +"<br>";
															
														}
													}
												}
												
												
												
												view_products = selected_products;　　//*********ここだ
												//view_products = all_products[current_category_id];
											}else{
												view_products = all_products[current_category_id];
											}
											
											
											
												var test = new Array();
												var test_view = ""
												for(var i in view_products){
													test.push(i);
													test_view += i+"<br>";
													
												}
												
												
												
											//$('notice').update(current_category_id + "<br><br>" + test_view);
											
											return view_products;
											
										}
										
										
										
										
function change_small_group(the_key){
	
		current_small_group_key = the_key;
		display_group_button(the_key);
		
		
			
		var view_products = new Object();
		
		//*********    価格絞り込み
		if(select_flag == "selected"){
			
			view_products = create_select_products_array_price(all_products[current_category_id]);
			
		}else{
			
			view_products = all_products[current_category_id];
		}
		//*********    価格絞り込み
		
										
		view_products = change_products_list(the_key,view_products);
		
		//********   sort
		if(sorted_flag){
			view_products = sort_part(view_products,sorted_flag);
		}
		//********   sort
		
		display_products(view_products);
	
				
}//function change_small_group(the_key){
										