//行数の変数
var $MTcount=0;
//バスケットcgiへのパス
//var BasketCgi = "\"/cgibin/pcart/cart.cgi\"";
var BasketCgi = "\"/cgibin/pcart/work.cgi\"";

//バスケット画像へのパス
var BasketImage = "\"/mainimages/clball16.jpg\"";
//新入荷画像へのパス
var NRecieveImage = "\"/mainimages/nrecieve.gif\"";
//新入荷対象となる日付期間
var NRecieve = 7;


//◎////////////////////////////////////////////////////////////////////20020328
//	テーブルの中にバスケットを組み込む関数							//
//	「縦積み」最大6アイテム
//	呼び出し元HTMLで横2 縦1のテーブルを作成する。					//
//	さらに、左(右)側に画像を指定する。								//
//																	//
//　ここでは画像ではないほうを作成									//
//																	//
//	1行に商品名、定価、売価、割引率、バスケット,					//
// 	最大6行															//	
//	AllTitle:セット商品名,AllDate:セット商品更新日					//
//	TClass:商品名のスタイルシート=実行元で指定						//
//	AllPrice:セット価格:PClass:価格表示のスタイルシート				//
//	BClass:バスケット表示のスタイルシート							//
//	PTitle:バラ売り商品名,PDate:バラ更新日,PPrice:バラ売り価格		//
//	バラ売りはPTitle=""の時点で、最少３段で表示終了					//
//////////////////////////////////////////////////////////////////////
function MakeTable6HBasket(
					PTitle0,PDate0,PPrice0,SPrice0,ProdLink0,SendCost0,SendFlag0,
					PTitle1,PDate1,PPrice1,SPrice1,ProdLink1,SendCost1,SendFlag1,
					PTitle2,PDate2,PPrice2,SPrice2,ProdLink2,SendCost2,SendFlag2,
					PTitle3,PDate3,PPrice3,SPrice3,ProdLink3,SendCost3,SendFlag3,
					PTitle4,PDate4,PPrice4,SPrice4,ProdLink4,SendCost4,SendFlag4,
					PTitle5,PDate5,PPrice5,SPrice5,ProdLink5,SendCost5,SendFlag5,
					PTitle6,PDate6,PPrice6,SPrice6,ProdLink6,SendCost6,SendFlag6,
					PTitle7,PDate7,PPrice7,SPrice7,ProdLink7,SendCost7,SendFlag7,
					TClass,PClass,BClass,
					Comment,CClass
					){
TClass = (TClass == null) ? "" : " class = \"" + TClass + "\" ";
PClass = (PClass == null) ? "" : " class = \"" + PClass + "\" ";
BClass = (BClass == null) ? "" : " class = \"" + BClass + "\" ";
if (Comment == null) {Comment = "\"&nbsp;\""} ;
CClass = (CClass == null) ? "" : " class = \"" + CClass + "\" ";


PTitle = new Array(PTitle0,PTitle1,PTitle2,PTitle3,PTitle4,PTitle5,PTitle6,PTitle7);
PDate =  new Array( PDate0, PDate1, PDate2, PDate3, PDate4, PDate5, PDate6, PDate7);
PPrice = new Array(PPrice0,PPrice1,PPrice2,PPrice3,PPrice4,PPrice5,PPrice6,PPrice7);
SPrice = new Array(SPrice0,SPrice1,SPrice2,SPrice3,SPrice4,SPrice5,SPrice6,SPrice7);
SCost = new Array(SendCost0,SendCost1,SendCost2,SendCost3,SendCost4,SendCost5,SendCost6,SendCost7);
SFlag = new Array(SendFlag0,SendFlag1,SendFlag2,SendFlag3,SendFlag4,SendFlag5,SendFlag6,SendFlag7);
PLink = new Array(ProdLink0,ProdLink1,ProdLink2,ProdLink3,ProdLink4,ProdLink5,ProdLink6,ProdLink7);



////テーブル<table>定義
document.write(
	'<table width=\"500\" border=\"1\" bordercolor = "#0000ff"' +
	 'bgcolor = \"#ffffff\" cellpadding=\"0\" height=\"100\" cellspacing=\"0\">'
);


////バラ売りの部分
document.write("</tr>"); 
for (i=0; i<8; i++){
	//商品名表示がなければスペースを代入
	PTitle[i] += "";  //文字列として確定
	switch(PTitle[i])
	{
	case "":
	case null:
	case "undefined":
		PTitle[i] = "\&nbsp";
	default: 
		break;
	}

// iの値で、バラ商品スペースを最低いくつ(i)表示するか決定する.
if (i >= 1 && PTitle[i] == "\&nbsp") {break;};


PDispTitle = DisplayTitle(PTitle[i],PDate[i],SPrice[i],PLink[i]);
YPrice = DisplayPrice(PPrice[i]);

document.write("<tr>");
FormTdInput = 
"<tr height = \"1\"><td height = \"1\" width = \"180\" " + TClass + ">" + PDispTitle + "</td>" +
"<td height = \"1\" width = \"90\" " + PClass + " align = \"right\"  >定価:" + YPrice +"</td>" 

YPrice = DisplayPrice(SPrice[i]);

FormTdInput +=
"<td height = \"1\" width = \"90\" " + PClass + " align = \"right\" >売価:" + YPrice + "</td>" 
	
var Rate = 100 - Math.floor(SPrice[i] * 100 / PPrice[i]);
if (Rate > 0 ) {Rate += "%OFF";} else {Rate = "&nbsp"};
 
FormTdInput +=
"<td height = \"1\" width = \"50\" " + PClass + " align = \"right\" >" + Rate + "</td>" 
//window.alert(i + " " + PTitle[i] + " " + SPrice[i]);

if (SPrice[i].slice(-1) == "T0" ) {SPrice[i] = SPrice[i].substring(0,SPrice[i].length-2)};
if (SPrice[i].slice(-2) == "T1" ) {SPrice[i] = SPrice[i].substring(0,SPrice[i].length-2)};
if (SPrice[i].slice(-2) == "T2" ) {SPrice[i] = SPrice[i].substring(0,SPrice[i].length-2)};

strBasket = MakeBasket(SPrice[i])

strBasket = strBasket.replace(/<!___form_input___>/gi,FormTdInput);
strBasket = strBasket.replace(/___BWidth___/gi,"60");
strBasket = strBasket.replace(/___BHeight___/gi,"1");
strBasket = strBasket.replace(/___BClass___/gi,BClass);
strBasket = strBasket.replace(/___Title___/gi,PTitle[i]);
strBasket = strBasket.replace(/___Price___/gi,SPrice[i]);
strBasket = strBasket.replace(/___SendCost___/gi,SCost[i]);
strBasket = strBasket.replace(/___SendFlag___/gi,SFlag[i]);
document.write(strBasket);

document.write("</td></tr>");
};

document.write('<tr><td colspan = "5" ' + CClass + '>' + Comment + '</td></tr>');



////テーブル定義終了
document.write('</table>');
};



//◎////////////////////////////////////////////////////////////////////
//	テーブルの中にバスケットを組み込む関数							//
//	「画像の横に設置」
//　テーブルは画像を含めない部分=右側を作成							//
//	呼び出し側HTMLで、横2,縦1のテーブルを記述し、左(右)のエリアに
//	画像を指定する													//
//	最上段に商品名、定価、売価、バスケット							//
//	AllTitle:商品名,	AllDate:セット商品更新日					//
//	TClass:商品名のスタイルシート=実行元で指定						//
//	StdPrice:定価,AllPrice:売価:PClass:売価のスタイルシート			//
//	BClass:バスケット表示のスタイルシート							//
//	2段目にコメント、改行は<BR>を入れる必要あり
//////////////////////////////////////////////////////////////////////
function MakeTableSideBasket(AllTitle,AllDate,TClass,StdPrice,AllPrice,PClass,ProdLink,SendCost,SendFlag,
							BClass,Comment,CClass
					){
TClass = (TClass == null) ? "" : " class = \"" + TClass + "\" ";
PClass = (PClass == null) ? "" : " class = \"" + PClass + "\" ";
BClass = (BClass == null) ? "" : " class = \"" + BClass + "\" ";
CClass = (CClass == null) ? "" : " class = \"" + CClass + "\" ";


////テーブル<table>定義
document.write(
	'<table width=\"500\" border=\"1\" bordercolor = "#0000ff"' +
	 'bgcolor = \"#ffffff\" cellpadding=\"0\" height=\"100\" cellspacing=\"0\">'
);

////1行目



AllDispTitle = DisplayTitle(AllTitle,AllDate,AllPrice,ProdLink);

YPrice = DisplayPrice(StdPrice);
FormTdInput = "<tr height = \"1\"><td height = \"1\" width = \"140\" " + TClass +  ">" + AllDispTitle + "</td>"+
"<td height = \"1\" width = \"90\" " + PClass + " align = \"right\" >定価:" + YPrice + "</td>" 
//window.alert(SendCost);

YPrice = DisplayPrice(AllPrice);

FormTdInput +=
"<td height = \"1\" width = \"90\" " + PClass + " align = \"right\" >売価:" + YPrice + "</td>" 

var Rate = 100 - Math.floor(AllPrice * 100 / StdPrice);
if (Rate > 0 ) {Rate += "%OFF";} else {Rate = "&nbsp"};
 
FormTdInput +=
"<td height = \"1\" width = \"50\" " + PClass + " align = \"right\" >" + Rate + "</td>" 

if (AllPrice.slice(-1) == "T0" ) {AllPrice = AllPrice.substring(0,AllPrice.length-2)};
if (AllPrice.slice(-2) == "T1" ) {AllPrice = AllPrice.substring(0,AllPrice.length-2)};
if (AllPrice.slice(-2) == "T2" ) {AllPrice = AllPrice.substring(0,AllPrice.length-2)};

strBasket = MakeBasket(AllPrice);

strBasket = strBasket.replace(/<!___form_input___>/ig,FormTdInput);
strBasket = strBasket.replace(/___BWidth___/gi,"60");
strBasket = strBasket.replace(/___BHeight___/gi,"1");
strBasket = strBasket.replace(/___BClass___/gi,BClass);
strBasket = strBasket.replace(/___Title___/gi,AllTitle);
strBasket = strBasket.replace(/___Price___/gi,AllPrice);
strBasket = strBasket.replace(/___SendCost___/gi,SendCost);
strBasket = strBasket.replace(/___SendFlag___/gi,SendFlag);

document.write(strBasket);
document.write('<tr><td colspan = "5" ' + CClass + '>' + Comment + '</td></tr>');
document.write('</table>');
};




///◎///////////////////////////////////////////////////////////////////
//	テーブルの中にバスケットを組み込む関数							//
//	2*6積み
//　<table>定義タグは元のHTMLファイルで生成							//
//	HTMLファイルでは、画像、セット商品名、バラの順					//
//																	//
//	バラは2列*3段に商品名、価格、登録日(8桁数値)					//
//	AllTitle:セット商品名,AllDate セット登録日						//
//	TClass:商品名のスタイルシート=実行元で指定						//
//	AllPrice:セット価格:PClass:価格表示のスタイルシート				//
//	BClass:バスケット表示のスタイルシート							//
//	PTitle:バラ売り商品名,PPrice:バラ売り価格,Pdateバラ登録日(8桁数値)//
//	バラ売りはPTitle=""の時点で、表示終了							//
//////////////////////////////////////////////////////////////////////
function MakeWideBasketUpperPictDate(AllTitle,AllDate,TClass,AllPrice,PClass,AProdLink,ASendCost,ASendFlag,BClass,
					PTitle0,PDate0,PPrice0,ProdLInk0,SendCost0,SendFlag0,
					PTitle1,PDate1,PPrice1,ProdLInk1,SendCost1,SendFlag1,
					PTitle2,PDate2,PPrice2,ProdLInk2,SendCost2,SendFlag2,
					PTitle3,PDate3,PPrice3,ProdLInk3,SendCost3,SendFlag3,
					PTitle4,PDate4,PPrice4,ProdLInk4,SendCost4,SendFlag4,
					PTitle5,PDate5,PPrice5,ProdLInk5,SendCost5,SendFlag5
					){

//スタイルシート指定があるか
TClass = (TClass == null) ? "" : " class = \"" + TClass + "\" ";
PClass = (PClass == null) ? "" : " class = \"" + PClass + "\" ";
BClass = (BClass == null) ? "" : " class = \"" + BClass + "\" ";


PTitle = new Array(PTitle0,PTitle1,PTitle2,PTitle3,PTitle4,PTitle5);
PDate = new Array(PDate0,PDate1,PDate2,PDate3,PDate4,PDate5);
PPrice = new Array(PPrice0,PPrice1,PPrice2,PPrice3,PPrice4,PPrice5);
SCost = new Array(SendCost0,SendCost1,SendCost2,SendCost3,SendCost4,SendCost5);
SFlag = new Array(SendFlag0,SendFlag1,SendFlag2,SendFlag3,SendFlag4,SendFlag5);



//1段目,セット商品部分 180,60,80,180,60,80
document.write("<tr height = \"20\">");

AllDispTitle = DisplayTitle(AllTitle,AllDate,AllPrice,AProdLink);

YPrice = DisplayPrice(AllPrice);

FormTdInput = 
"<td colspan=\"4\" width = \"460\" height=\"20\" " + TClass + ">" + AllDispTitle  + "</td>" +
"<td width = \"80\" " + PClass + " align =\"right\" >" + YPrice + "</td>" 

if (AllPrice.slice(-1) == "T0" ) {AllPrice = AllPrice.substring(0,AllPrice.length-2)};
if (AllPrice.slice(-2) == "T1" ) {AllPrice = AllPrice.substring(0,AllPrice.length-2)};
if (AllPrice.slice(-2) == "T2" ) {AllPrice = AllPrice.substring(0,AllPrice.length-2)};


strBasket = MakeBasket(AllPrice);
strBasket = strBasket.replace(/<!___form_input___>/ig,FormTdInput);
strBasket = strBasket.replace(/___BWidth___/gi,"80");
strBasket = strBasket.replace(/___BHeight___/gi,"20");
strBasket = strBasket.replace(/___BClass___/gi,BClass);
strBasket = strBasket.replace(/___Title___/gi,AllTitle);
strBasket = strBasket.replace(/___Price___/gi,AllPrice);
strBasket = strBasket.replace(/___SendCost___/gi,ASendCost);
strBasket = strBasket.replace(/___SendFlag___/gi,ASendFlag);

document.write(strBasket);
document.write("</td>");




//バラ売りの部分
var PDispTitle;

	for (i=0; i<6; i++){
	PTitle += ""; //明示的に文字列にする 
		switch(PTitle[i])
		{
		case "":
		case null:
		case "undefined":
			PTitle[i] = "\&nbsp";
		default: 
		break;
		}

//i=明細の表示カウンタ 4なら最低4行表示
	if (i >= 2 && PTitle[i] == "\&nbsp") {break;};
	//window.alert("[" + PPrice[i] + "]")
	
	PDispTitle = DisplayTitle(PTitle[i],PDate[i],PPrice[i],ProdLink[i]);

	//window.alert (i % 2);
	if ((i % 2) == 0){document.write("<TR>")};

	YPrice = DisplayPrice(PPrice[i]);

	FormTdInput = 
	"<td width = \"160\" " + TClass + ">" + PDispTitle + "</td>" +
	"<td width=\"80\" align = \"right\" " + PClass + "  >"+ YPrice +"</td>" 
	
	if (PPrice[i].slice(-1) == "T0" ) {PPrice[i] = PPrice[i].substring(0,PPrice[i].length-2)};
	if (PPrice[i].slice(-2) == "T1" ) {PPrice[i] = PPrice[i].substring(0,PPrice[i].length-2)};
	if (PPrice[i].slice(-2) == "T2" ) {PPrice[i] = PPrice[i].substring(0,PPrice[i].length-2)};
	
	strBasket = MakeBasket(PPrice[i])
	strBasket = strBasket.replace(/<!___form_input___>/gi,FormTdInput);
	strBasket = strBasket.replace(/___BWidth___/gi,"80");
	strBasket = strBasket.replace(/___BHeight___/gi,"20");
	strBasket = strBasket.replace(/___BClass___/gi,BClass);
	strBasket = strBasket.replace(/___Title___/gi,PTitle[i]);
	strBasket = strBasket.replace(/___Price___/gi,PPrice[i]);
	strBasket = strBasket.replace(/___SendCost___/gi,SCost[i]);
	strBasket = strBasket.replace(/___SendFlag___/gi,SFlag[i]);

	document.write(strBasket);

	document.write("</td>");
	if ((i % 2) == 1) {document.write("</tr>")}; 


	};
};




///◎///////////////////////////////////////////////////////////////////
//	テーブルの中にバスケットを組み込む関数							//
//	<tr><td>商品名</td></tr>										//
//	<tr><td>コメント</td></tr>										//
//<form><td>売価|バスケット</td></form>を設定						//
//																	//
//	Title:商品名; 	TWidth:商品名  TDの幅:初期値350					//
//	TClass:商品名のスタイル指定:スタイル定義は、実行側で行う		//
//	Price:売価:初期値0;												//
//	PWidth:価格TDの幅:初期値150										//
//	PClass:価格のスタイル指定										//
//	BClass:バスケットのスタイル指定 BHeight:全体の高さ:初期値20		//
//////////////////////////////////////////////////////////////////////
function Make3TRBasket(Title,TDate,TComment,TWidth,TClass, 
			AllPrice,PWidth,PClass,ProdLink,SendCost, SendFlag,
			BWidth,BClass,BHeight){

TComment = ( TComment == null ||  TComment  == "") ? "\&nbsp" :TComment;
TWidth = (TWidth  == null || TWidth  == "") ? 200 :TWidth;
TClass = (TClass  == null || TClass  == "") ? "" : " class = \"" + TClass + "\" ";
AllPrice  = (AllPrice   == null || AllPrice   == "") ? 0 : AllPrice;
SendCost  = (SendCost   == null || SendCost   == "") ? 0 : SendCost;
SendFlag  = (SendFlag   == null || SendFlag   == "") ? 0 : SendFlag;
PWidth = (PWidth  == null || PWidth  == "") ? 50 : PWidth;
PClass = (PClass  == null || PClass  == "") ? "": " class = \"" + PClass + "\" ";
BWidth = (BWidth == null || BWidth == "") ? 150 :BWidth
BClass = (BClass  == null || BClass  == "") ? "": " class = \"" + BClass + "\" ";
BHeight= (BHeight == null || BHeight == "") ? 20 : BHeight;

AllTitle = DisplayTitle(Title,TDate,AllPrice,ProdLink);

YPrice = DisplayPrice(AllPrice);

//この関数では、<tr><form><td></td></form></tr>を定義する
//<table>,,,,,</table>は実行側で定義

/*debug用 document.write(
'<table width=\"500\" border=\"1\" + bgcolor = \"#000000\" cellpadding=\"0\" height=\"180\" cellspacing=\"0\">'
);*/
	document.write("<tr>");
	document.write("<td colspan = 2 width = " + TWidth + " height = " + BHeight + TClass +">" + AllTitle + "</td>");
	document.write("</tr>");

	document.write("<tr>");
	document.write("<td colspan = 2 width = " + TWidth + " height = " + BHeight + TClass +">" + TComment + "</td>");
	document.write("</tr>");

	document.write("<tr>");
	FormTdInput = 
	"<td width = " + PWidth + " height = " + BHeight + PClass + " align = right>"+ YPrice +"</td>" 
	
if (AllPrice.slice(-1) == "T0" ) {AllPrice = AllPrice.substring(0,AllPrice.length-2)};
if (AllPrice.slice(-2) == "T1" ) {AllPrice = AllPrice.substring(0,AllPrice.length-2)};
if (AllPrice.slice(-2) == "T2" ) {AllPrice = AllPrice.substring(0,AllPrice.length-2)};


	strBasket = MakeBasket(AllPrice);
	strBasket = strBasket.replace(/<!___form_input___>/ig,FormTdInput);

	strBasket = strBasket.replace(/___BWidth___/gi,BWidth);
	strBasket = strBasket.replace(/___BHeight___/gi,BHeight);
	strBasket = strBasket.replace(/___BClass___/gi,BClass);
	strBasket = strBasket.replace(/___Title___/gi,Title);
	strBasket = strBasket.replace(/___Price___/gi,AllPrice);

	strBasket = strBasket.replace(/___SendCost___/gi,SendCost);
	strBasket = strBasket.replace(/___SendFlag___/gi,SendFlag);

//	window.alert(strBasket);
	document.write(strBasket);	
	document.write("</tr>");
	

};

///◎///////////////////////////////////////////////////////////////////
//	テーブルの中にバスケットを組み込む関数							//
//	一行
//<tr><form>														//
//	<td>商品名/ランク（コメント）/売価/バスケット</td>				//
//</form></tr>を設定												//
//																	//
//	Title:商品名; 	TWidth:商品名TDの幅:初期値600					//
//	TClass:商品名のスタイル指定:スタイル定義は、実行側で行う		//
//	Rank:商品ランク;RWidth:商品ランクの幅:初期値100					//
//	RClass:商品ランクのスタイル指定;上同							//
//	Price:売価:初期値0;PWidth:価格TDの幅:初期値150					//
//	BClass:価格のスタイル指定										//
//	Bclass:バスケットのスタイル指定 BHeight:全体の高さ:初期値20		//
//////////////////////////////////////////////////////////////////////
function Make1TRRankBasket(Title,TDate,TWidth,TClass,
								StdPrice,RWidth,RClass,
								AllPrice,PWidth,PClass,ProdLink,SendCost,SendFlag,
								BWidth,BClass,BHeight){

//各受取変数の初期値を設定する
TWidth = (TWidth == null || TWidth == "") ? 600 :TWidth;
TClass = (TClass == null || TWidth == "") ? "" : " class = \"" + TClass + "\" ";

StdPrice   = ( StdPrice == null  ||   StdPrice == "") ? 0 : StdPrice;
RWidth = (RWidth == null || RWidth == "") ? 100 : RWidth;
RClass = (RClass == null || RClass == "") ? "" : " class = \"" + RClass + "\" ";

AllPrice  = (AllPrice == null  ||  AllPrice == "") ? 0 : AllPrice;
PWidth = (PWidth == null || PWidth == "") ? 100 : PWidth;
PClass = (PClass == null || PClass == "") ? "": " class = \"" + PClass + "\" ";

SendCost  = (SendCost == null  ||  SendCost == "") ? 0 : SendCost;
SendFlag  = (SendFlag == null  ||  SendFlag == "") ? 0 : SendFlag;

BWidth = (BWidth == null || BWidth == "") ? 120 :BWidth
BClass = (BClass == null || BClass == "") ? "": " class = \"" + BClass + "\" ";
BHeight= (BHeight == null || BHeight == "") ? 20 : BHeight;

AllTitle = DisplayTitle(Title,TDate,AllPrice,ProdLink);

//この関数では、<tr><form><td></td></form></tr>を定義する
//<table>,,,,,</table>は実行側で定義

//debug用
/*document.write(
'<table width=\"500\" border=\"1\" + bgcolor = \"#000000\" cellpadding=\"0\" height=\"180\" cellspacing=\"0\">'
);*/

var YsPrice = DisplayPrice(StdPrice);
var YaPrice = DisplayPrice(AllPrice);
var Rate = 100 - Math.floor(AllPrice * 100 / StdPrice);
if (Rate > 0 ) {Rate += "%OFF";} else {Rate = "&nbsp"};

	document.write("<tr>");
	FormTdInput = 
	"<td width = " + TWidth + " height = " + BHeight + TClass +">" + AllTitle + "</td>" +
	"<td align = \"right\" width = " + RWidth + " height = " + BHeight + RClass +">" + YsPrice + "</td>" +
	"<td align = \"right\" width = " + PWidth + " height = " + BHeight + PClass + " align = \"right\">"+ YaPrice +"</td>" +
	"<td align = \"right\" width = \"50\" height = " + BHeight + PClass + " align = \"right\">"+ Rate +"</td>" 

	if (AllPrice.slice(-2) == "T0" ) {AllPrice = AllPrice.substring(0,AllPrice.length-2)};
	if (AllPrice.slice(-2) == "T1" ) {AllPrice = AllPrice.substring(0,AllPrice.length-2)};
	if (AllPrice.slice(-2) == "T2" ) {AllPrice = AllPrice.substring(0,AllPrice.length-2)};

//window.alert(SendCost);
	strBasket = MakeBasket(AllPrice);
	strBasket = strBasket.split("<!___form_input___>");
	strBasket = strBasket.join(FormTdInput);
	strBasket = strBasket.split("___BWidth___");
	strBasket = strBasket.join(BWidth);
	strBasket = strBasket.split("___BHeight___");
	strBasket = strBasket.join(BHeight);
	strBasket = strBasket.split("___BClass___");
	strBasket = strBasket.join(BClass);
	strBasket = strBasket.split("___Title___");
	strBasket = strBasket.join(Title);
	strBasket = strBasket.split("___Price___");
	strBasket = strBasket.join(AllPrice);
	strBasket = strBasket.split("___SendCost___");
	strBasket = strBasket.join(SendCost);
	strBasket = strBasket.split("___SendFlag___");
	strBasket = strBasket.join(SendFlag);



	document.write(strBasket);
	
	document.write("</tr>");
	

};






/////////////////////////////////////////////////////////////////////
//
//<td>バスケット内容</td>の部分のフィールドの文字列を作成する関数
//Priceの内容によって、バスケットを作成する、しないを決定
//
//定義上は、見やすくするため、<form></form>部分を作成している
//<!___form_input___>はformからinputまでの置換用プレースフォルダ
//====バスケットには関係なく、テーブル表示内容
//
///////////////////////////////////////////////////////////////////
function MakeBasket(Price){

	//バスケット定義
	//下の価格表示関数と合わせて考える
	//S=SOLD OUT,T=TEL/EMAIL,C=COMING SOON,OUT=生産終了の場合はバスケットを表示しない

	//開始部分
	switch(Price)
	{
		case "undefined":
		case null:
		case "S":
		case "C":
		case "OUT":
		case "NS":
			FormMiddle = "";break;
		case "T":
		default :
			FormMiddle = "<form method=post action=" + BasketCgi + ">";
			break;
	};

	//これを呼び出し関数側で置換する
	FormMiddle += "<!___form_input___>";

	FormMiddle += "<td width = ___BWidth___  height = ___BHeight___ ___BClass___ align = \"right\" valign = \"middle\">";
	
	//中間
	switch(Price)
	{	
		case "undefined":
		case null:
		case "S":
		case "C":
		case "OUT":
		case "NS":FormMiddle += "\&nbsp";break;
		case "T":
		default:

		FormMiddle += 
		"<input type=hidden name=\"ACTION\" value=\"register\">" +
//		"<INPUT TYPE=hidden NAME=\"goods_code\" VALUE=\"A101\">" +
		"<input type=hidden name=\"goods\" value= ___Title___>" +
		"<input type=hidden name=\"out_unit\" value= ___Price___>" +
		"<input type=hidden name=\"sendcost\" value= ___SendCost___>" +
		"<input type=hidden name=\"sendflag\" value=___SendFlag___>" +
		"<input align = \"right\" type=text name=\"amount\" value=\"1\" size=1>個" +
		"<a href=\"JavaScript:if (document.forms[" + $MTcount + "].amount.value == 0)" +
		"{alert(\'希望数が0です\')} else {document.forms[" + $MTcount + "].submit()}\" " +
		"onMouseMove = \"status =\' ___Title___ \'\" " +
		"Onmouseout =\"status = \'その他の商品はメールにて\'\" >" +
		"<img src=" + BasketImage + " width = \"25\" height = \"25\" border=\"0\"></a>";
		++$MTcount;break;
	};

	//最後
	switch(Price)
	{
		case "undefined":
		case null:
		case "S":
		case "C":
		case "OUT":
		case "NS":FormMiddle += "</td>";break;
		case "T":
		default:
		FormMiddle  += "</td></form>";
		break;
	};


return FormMiddle;
};




//////////////////////////////////
// 価格表示部分を設定する関数
/////////////////////////////////
function DisplayPrice(Price){

switch(Price)
	{
		case "undefined":YPrice = "\&nbsp";break;
		case "S":YPrice = "SOLD OUT";break;
		case "T":YPrice = "TEL/EMAIL";break;
		case "C":YPrice = "Coming soon";break;
		case "O":YPrice = "Open";break
		case "OUT":YPrice = "生産終了";break;
		case "NS":YPrice = "取扱い無";break;
		default :
		if (Price.slice(-1) == "T") 
			{YPrice = "TEL/BASKET";
			}
		else if (Price.slice(-2) == "T0")
			{YPrice = "<s>0%off</s>";
			}
		else if (Price.slice(-2) == "T1")
			{YPrice = "<s>10%off</s>";
			}
		else if (Price.slice(-2) == "T2")
			{YPrice = "<s>20%off</s>";
			}
		else {
			YPrice = "\\" + 
			((Math.floor(Price/1000) == 0) ? "" :Math.floor(Price/1000) + ",") 
	  		+ (((Price % 1000) == 0) ? "000": ("00" + Price % 1000).substr(("00" + Price % 1000).length-3,3)   );}; 
		break;
	};

return YPrice;

};

/////////////////////////////////////
//	商品登録からNRecieve日以内なら、
//	商品タイトルに「新入荷」をつける
//	リンクアドレスの処理
//
/////////////////////////////////////
function DisplayTitle(DTitle,DDate,DPrice,DLink){

if (DTitle == "\&nbsp") {DispTitle = "&nbsp";}
	else {if ( DDate == 0 | DPrice == "S" | DPrice == "T") {DispTitle = DTitle;}
	else {
	var Dd = new Date();
	var Ny = parseInt(DDate.substring(0,4));
	var Nm = parseInt(DDate.substring(4,6))-1;
	var Nn = parseInt(DDate.substring(6,8));
	var Nd = new Date(Ny,Nm,Nn);
	var Pt = Math.ceil((Dd.getTime()-Nd.getTime())/(24*60*60*1000));

	var DispTitle = (Pt > NRecieve) ? DTitle : 
	DTitle + "<img src = " + NRecieveImage + ">";
	}};

if (DLink != "" & DLink != "undefined") {
DispTitle = " <a href=\"" + DLink + "\" target=\"_blank\">" + DTitle + "</a>";
};
//window.alert(DispTitle);
return DispTitle;
};
