  var maker_in = "";
  var link_in = "";
  
  //******************************************************************************
  //*   エラー処理の登録                                                         *
  //*   errobj     : null ( 省略時処理 )   not null ( エラー処理・オブジェクト ) *
  //******************************************************************************         
  function ajxerr_mk( url, errobj ) { 
    if ( errobj == "" ) {                                //省略時処理
	  reqError = function()                     //ajax エラー処理
	             {
				   alert( url + ' Not Found');  //Not Found Message
	             }
	}
	else {
	  reqError = errobj;
	}
  }
  
  
  //**************************************************************************************
  //*   読み込み完了時処理の登録                                                         *
  //*   rcvobj     : 読み込み HTML 編集先                                                *
  //*   compedit   : null ( 省略時処理 )   1 ( 商品備考全表示 )                          *
  //**************************************************************************************         
  function ajxcmp_mk( rcvobj, compedit ) { 
    if ( compedit == "" ) {                               //省略時処理
	  htmlEdit = function( getText ) 
	             {
				   document.getElementById( rcvobj ).innerHTML = getText;
	             }
	}
	else {
	  htmlEdit = function ( getText ) 
	             {
				   compedit( getText, rcvobj );
				 } 
	}
  }

 //*************************************************************************************
  //*   html_file : 読込ファイル名称( パス付 )                                          *
  //*   objname   : 更新先オブジェクト ID                                               *
  //*   post_data : post データー ( p1=xxxx&p2=xxxx )                                  *
  //*   async     : true ( 同期 )  or  false ( 非同期 )                                 *
  //*   sts       : 0 ( ステータスバー非表示 ) 1 (ステータスバ非表示)                   *
  //*   comp      : null ( 省略時エラー処理 ) function名 ( エラー処理名 )               *
  //*   err       : null ( 省略時読み込み完了処理  ( 読み込み完了処理名 )   *
  //*************************************************************************************  
  function docget_mk( html_file, objname, post_parm, async, sts, comp, err ) { 
    var xmlhttp = false;
    var ie = 1;

    ajxerr_mk( html_file, err );                     //エラー処理オブジェクト生成
    ajxcmp_mk( objname, comp );                      //読み込み完了時処理オブジェクト生成
													  
      try {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");        //HTTP リクエスト・オブジェクト生成
      } catch (e) {
        try {
          xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");   //HTTP リクエスト・オブジェクト生成
        } catch (e) {
          xmlhttp = false;
        }
      }
      if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
        xmlhttp = new XMLHttpRequest();                      //HTTP リクエスト・オブジェクト生成
	    ie = 0;
      }


    if ( xmlhttp ) {                                        //HTTP リクエスト・オブジェクトあり
	  xmlhttp.open( 'POST', html_file, async );             //HTTP オープン
	  if ( ie == 1 ) {                                      //IE
	    xmlhttp.onreadystatechange = function() {
          if ( xmlhttp.readyState == 4 && xmlhttp.status == 200 ) {
		    htmlEdit( xmlhttp.responseText );               //読み込みデーター編集
          }
		  else {
		    if ( xmlhttp.readyState == 4 && xmlhttp.status == 404 ) {
		      reqError();
			}
		  }
        }
	  } 
	  else {                                                //IE 以外

	     xmlhttp.onload = function() {
          if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
		    htmlEdit( xmlhttp.responseText );               //読み込みデーター編集
          }
		  else {
		    if ( xmlhttp.readyState == 4 && xmlhttp.status == 404 ) {
		      reqError();
			}
		  }
        }
	  }

      xmlhttp.setRequestHeader('Content-Type' , 'application/x-www-form-urlencoded; charset=SJIS' );
      xmlhttp.send( post_parm );                            //HTTP 送信
    }
  }
 
  function maker_pop( k, trg1, trg2 ) {
    var obj = document.getElementById( 'inmk' );
	maker_in = document.getElementById( trg1 );
	link_in = document.getElementById( trg2 );
	
    if ( k == 1 ) {
	  obj.style.top = 50 + cury + "px";
	}
	else {
	  obj.style.top = 20 + cury + "px";
	}

	if ( obj.style.visibility != "visible" ) {
      docget( 'maker_touroku.php', 'inmk', '', true, '', '', '' );
      obj.style.left = -300 + curx + "px";
	  obj.style.visibility = "visible";
	}
  }
  
  function maker_set( k, v ) {
    if ( k == 1 ) {
	  maker_in.value = v;
	}
	else {
	  link_in.value = v;
    }
	if ( maker_in.value != "" && link_in.value != "" ) {
	  document.getElementById( 'inmk' ).style.visibility = 'hidden';
	}
  }
  
  function data_kousin( k, id, seq ) {                  //商品データー更新
  
    var parm = "";
    var p1  = 'sub_category' + seq;
    var p2  = 'new' + seq;
    var p3  = 'usel' + seq;
    var p4  = 'card' + seq;
    var p5  = 'sale' + seq;
    var p6  = 'sale_uq' + seq;
    var p7  = 'sale_max' + seq;
    var p8  = 'delete' + seq;
    var p9  = 'maker' + seq;
    var p10 = 'maker_link' + seq;
    var p11 = 'sname' + seq;
    var p12 = 'syouhin_link' + seq;
    var p13 = 'syukka' + seq;
    var p14 = 'cost' + seq;
    var p15 = 'price' + seq;
    var p16 = 'denryoku' + seq;
    var p17 = 'jan' + seq;
    var p18 = 'in_suuryou' + seq;
    var p19 = 'imgaddr' + seq;
    var p20 = 'imgaddr_b' + seq;
    var p21 = 'bikou' + seq;
	var p22 = 'kata' + seq;
	var p23 = 'tokki' + seq;
	var p24 = 'salepr' + seq;
	var p2f = 0;
	var p3f = 0;
	var p4f = 0;
	var p5f = 0;
	
	if ( document.getElementById( p9 ).value == "" ) {
	  alert( 'メーカーが未入力' );
	  return;
	}
	if ( document.getElementById( p11 ).value == "" ) {
	  alert( '商品名称が未入力' );
	  return;
	}
	if ( document.getElementById( p22 ).value == "" ) {
	  alert( '型番が未入力' );
	  return;
	}
	if ( document.getElementById( p14 ).value == "" ) {
	  alert( '仕入価格が未入力' );
	  return;
	}

    if ( document.getElementById( p2 ).checked == true ) { p2f = 1; }  
    if ( document.getElementById( p3 ).checked == true ) { p3f = 1; }  
    if ( document.getElementById( p4 ).checked == true ) { p4f = 1; }  
    if ( document.getElementById( p5 ).checked == true ) { p5f = 1; }  

    parm = "kind=" + k + "&id=" + id + 
	     "&sub_category=" +  document.getElementById( p1 ).value + 
         "&new=" + p2f +  
         "&u_select=" +  p3f +  
         "&card_flag=" +  p4f +  
		 "&sale_flag=" +  p5f +  
         "&sale_unit_max=" +  document.getElementById( p6 ).value +  
         "&sale_total_suuryou=" +  document.getElementById( p7 ).value +  
         "&valid=" +  document.getElementById( p8 ).value +  
         "&maker=" +  document.getElementById( p9 ).value +  
         "&maker_link=" +  document.getElementById( p10 ).value +  
         "&syouhin_name=" +  document.getElementById( p11 ).value +  
         "&syouhin_link=" +  document.getElementById( p12 ).value +  
         "&nouki=" +  document.getElementById( p13 ).value +  
         "&sikiri_kakaku=" +  document.getElementById( p14 ).value +  
         "&kakaku=" +  document.getElementById( p15 ).value +  
         "&watt=" +  document.getElementById( p16 ).value +  
         "&jancode=" +  document.getElementById( p17 ).value +  
         "&in_suuryou=" +  document.getElementById( p18 ).value +  
         "&imgaddr=" +  document.getElementById( p19 ).value +  
         "&imgaddr_b=" +  document.getElementById( p20 ).value +  
         "&bikou=" +  document.getElementById( p21 ).value +  
		 "&kata=" +  document.getElementById( p22 ).value + 
		 "&tokki=" +  document.getElementById( p23 ).value+
		 "&sale_pr=" + document.getElementById( p24 ).value; 

    docget_mk( 'syouhin_touroku_update.php', 'backrc', parm, true, '', '', '' );
	alert( '更新/追加 終了' );
  }

function selgen() {
  var item_buf = new Array();
  var line_ct = 0;
  var idx = 0;
  var sub_tot = 0;
  var seq = 0;
  var zeiritsu = 1.05 // 税率
  var edit_wk = "";

line_ct = GetCookie ("item_ct");

if ( line_ct > 0 ) {
  //item_buf = decodeURIComponent( GetCookie ("item_list") ).split(",");
  item_buf = GetCookie ("item_list").split(",");
  	edit_wk =  
     '<img src="/banner/pop_list_ttl.png" width="88" height="15" align="absmiddle" alt="商品選択一覧">&nbsp;&nbsp;&nbsp;<font style="color:#666666;">【取消】 - チェック : 取消し | 再チェック : 再選択</font><BR>'
    //+'<form name="estimate" method="post" action="https://www.game-f.co.jp/shopping/order.php" onSubmit="return order_check()">'
    +'<form name="estimate" method="post" action="https://www.game-f.co.jp/shopping/order.php" onSubmit="return order_check()">'
    +'<table cellSpacing=1 cellPadding=3 style="width:99%;border:1px solid #FFFFFF;background-color:#ACC1FF;font_size:100%;color:#666666;">'
	+'<tr align="center" bordercolor="#0099FF" bgcolor="#0099FF" style="font-size:12px;color:#FFFFFF;">'
	+'<td style="width:4%;">No.</td>' 
	+'<td nowrap style="width:6%;">取消</td>'
	+'<td style="width:39%;">商品名</td>'
	+'<td style="width:18%;">メーカー</td>'
	+'<td style="width:13%;">単価(税込)</td>'
	+'<td style="width:7%;">数量</td>'
	+'<td style="width:13%;">金額(税込)</td>'
	+'</tr>';

	for ( var i=1; i <= line_ct; i++ ) {
	  //var edit_wk = "";
	  var ktanka = "";
	  var ksuuryou = "";
	  var kamount = "";
	  var chft = "";
	  var hotrd = "";
		
      var kwk = Math.round(item_buf[idx+4] * 1.05);
      if ( kwk > 0 ) {
	    ktanka   = Addc( kwk +"" );
      }
      else {
         kwk = 0 - kwk;
         ktanka   = "-" + Addc( kwk +"" );
      }

      ksuuryou = Addc( item_buf[idx+5] );

      kwk = Math.round(item_buf[idx+6] * 1.05);
      if ( kwk > 0 ) {
	    kamount   = Addc( kwk +"" );
      }
      else {
        kwk = 0 - kwk;
        kamount   = "-" + Addc( kwk +"" );
      }


// 商品名がTinosの時Tinos名を認識する為、<start><end>タグが含まれてので、<font>タグに変換する
	   var wk_snm = item_buf[idx+3].replace(/<start>/gm,'<font color=#cc0000>');
	   wk_snm = wk_snm.replace(/<end>/gm,'</font>');

	   if ( item_buf[idx+1]  > 9029 )  { 
	     if ( item_buf[idx+1] < 9036 ) {  
	       ktanka = "*****";
		   kamount = "*****";
		 }
	   } 
	   
	   if (  item_buf[idx] == "true" ) { 
	     chft = "checked"; 
	   }
	   else {
	      chft = ""; 
	   }	

       if ( wk_snm.substr(0, 4) == 'Hot!' ) {
	     hotrd = ' readonly ';
		 hotsty = 'text-align:right;border:1px solid #FFFFFF;';
	   }
	   else {
	     hotrd = "";
		 hotsty = 'text-align:right;background-color:#FFFFDD;';
	   }
	   
      seq = seq + 1;
	  edit_wk = edit_wk + '<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF" style="font-size:12px;"><td align="right" valign="top" bordercolor="#F8F8F8" bgcolor="#F8F8F8" style="border:1px solid #FFFFFF;;">'+seq+'</td>'
               +'<td align="center" valign="top"><input  type="checkbox" name="can'+i+'"  '+chft+'  onClick="list_change(this.form);"></td>';                     //取消
	  edit_wk =  edit_wk 
	  +'<td valign="top">'+wk_snm+'<input type="hidden" name="snm'+i+'" value="'+item_buf[idx+3]+'"><input type="hidden" name="scd" value="'+item_buf[idx+1]+'"></td>'
  	  +'<td valign="top">'+item_buf[idx+2]+'<input type="hidden" name="mnm'+i+'" value="'+item_buf[idx+2]+'"></td>'
	  +'<td align="right" valign="top" nowrap><input type="text" name="ktanka" maxlength="10" size="10" value="\\'+ktanka+'" readonly style="border:1px solid #FFFFFF;color:#666666;text-align:right;"><input type="hidden" name="price'+i+'" value="'+item_buf[idx+4]+'"></td>';
      edit_wk =  edit_wk+'<td valign="top"><input style="'+hotsty+'" type="text" name="qty'+i+'" size="3" maxlength="3" value="'+ksuuryou +'" '+hotrd+' onChange="suuryou_change(this.form,this)"></td>';
	  edit_wk =  edit_wk+'<td align="right" valign="top" nowrap><input type="text" name="amt'+i+'" maxlength="10" size="10" value="\\'+kamount+'" readonly style="border:1px solid #FFFFFF;color:#666666;text-align:right;"></td></tr>';
	  //document.write(edit_wk);
  
	  sub_tot = sub_tot + eval( Math.round(item_buf[idx+6] * 1.05) );
	  idx = idx + CKCNUM;                                                            //クキー項目数を加算
	}
	  var wtot = "";
	  wtot = Addc( sub_tot+"" );

	edit_wk = edit_wk + '</table><table cellpadding="2" cellspacing="0" style="width:99%;background-color:#FFFFFF;">' 
	+'<td bordercolor="#006600" nowrap>'

    +'<input type="image" name="order" src="/banner/kounyuu.png" width="115" height="27" style="color:#555555;">　　'
    +'<img src="/banner/allcan.png" width="73" height="26"  onClick="all_del_cookie();' + "alert('全ての選択を取消ました');" + '" style="cursor:pointer;">'

    +'</td>'
	+'<td width="80" align="center"><span style="color:#666666;border-style:none;font-size:12px;font-weight:bold;">小計(税込)</span></td>'
	+'<td width="83" align="center" bordercolor="#ffffff"><input type="text" name="stot" maxlength="11" size="11" READONLY value="\\'+wtot+'" style="text-align:right;border-style:solid;border-color:#FFFFFF;color:#666666;font-weight:bold;"></td></tr></table>'
    +'<div style="color:#666666;text-align:left;">'
    +'<font color=0099FF>※選択済みのパソコンのオプションを変更する場合は、選択済みのパソコンのお取消操作をお願いします。</font><br>'
    +'【←戻る】をクリックされても商品選択情報は残っています( ブラウザーを閉じると消去されます )<br>'
    +'※ご購入手続きでも、ご注文の取り消しができます</div><br>'
    +'</form>';
}
else {                                                                          //選択商品なし
  edit_wk = '<div style="color:#009900;text-align:center;">現在、選択商品はございません。</div><br><br>';
}
edit_wk = edit_wk + '<div style="text-align:center;"><img src="/banner/cls.png" width="54" height="21" alt="閉じる" onClick="' + "document.getElementById('bask').style.visibility='hidden';"  + '"></div>';
var obj = document.getElementById( 'bask' );
obj.innerHTML = edit_wk;
obj.style.visibility='visible';
}


function selgen_usa() {
  var item_buf = new Array();
  var line_ct = 0;
  var idx = 0;
  var sub_tot = 0;
  var seq = 0;
  var zeiritsu = 1.05 // 税率
  var edit_wk = "";

line_ct = GetCookie("item_ct");

if ( line_ct > 0 ) {
  //item_buf = decodeURIComponent( GetCookie ("item_list") ).split(",");
  item_buf = GetCookie ("item_list").split(",");
  	edit_wk =  
     '<img src="/banner/pop_list_ttl.png" width="88" height="15" align="absmiddle" alt="商品選択一覧">&nbsp;&nbsp;&nbsp;<font style="color:#666666;">【取消】 - チェック : 取消し | 再チェック : 再選択</font><BR>'
    +'<form name="estimate" method="post" action="https://www.game-f.co.jp/USA_WEB/order.php" onSubmit="return order_check()">'
    +'<table cellSpacing=1 cellPadding=3 style="width:99%;border:1px solid #FFFFFF;background-color:#ACC1FF;color:#666666;">'
	+'<tr align="center" bordercolor="#0099FF" bgcolor="#0099FF" style="color:#FFFFFF;">'
	+'<td style="width:4%;">No.</td>' 
	+'<td nowrap style="width:6%;">取消</td>'
	+'<td style="width:39%;">商品名</td>'
	+'<td style="width:18%;">メーカー</td>'
	+'<td style="width:13%;">単価($)</td>'
	+'<td style="width:7%;">数量</td>'
	+'<td style="width:13%;">金額($)</td>'
	+'</tr>';

	for ( var i=1; i <= line_ct; i++ ) {
	  //var edit_wk = "";
	  var ktanka = "";
	  var ksuuryou = "";
	  var kamount = "";
	  var chft = "";
	  var hotrd = "";
	  var emsmk = "";

      var kwk = Math.round(item_buf[idx+4] * 1);
      if ( kwk > 0 ) {
	    ktanka   = Addc( kwk +"" );
      }
      else {
        kwk = 0 - kwk;
        ktanka   = "-" + Addc( kwk +"" );
      }

      ksuuryou = Addc( item_buf[idx+5] );

      kwk = Math.round(item_buf[idx+6] * 1);
      if ( kwk > 0 ) {
	    kamount   = Addc( kwk +"" );
      }
      else {
        kwk = 0 - kwk;
        kamount   = "-" + Addc( kwk +"" );
      }

// 商品名がTinosの時Tinos名を認識する為、<start><end>タグが含まれてので、<font>タグに変換する
	   var wk_snm = item_buf[idx+3].replace(/<start>/gm,'<font color=#cc0000>');
	   wk_snm = wk_snm.replace(/<end>/gm,'</font>');
	   	   
	   if ( item_buf[idx+13] == 1 ) {             //EMS 商品
	     wk_snm = '<img src="/banner/ems_buy_mk.png" alt="EMS 商品" width="31" height="14">' + wk_snm;
	   }

	   if ( item_buf[idx+1]  > 9029 )  { 
	     if ( item_buf[idx+1] < 9036 ) {  
	       ktanka = "*****";
		   kamount = "*****";
		 }
	   } 
	   
	   if (  item_buf[idx] == "true" ) { 
	     chft = "checked"; 
	   }
	   else {
	      chft = ""; 
	   }	

	  hotrd = "";
	  hotsty = 'text-align:right;background-color:#FFFFDD;';
	   
      seq = seq + 1;
	  edit_wk = edit_wk + '<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF"><td align="right" valign="top" bordercolor="#F8F8F8" bgcolor="#F8F8F8" style="border:1px solid #FFFFFF;;">'+seq+'</td>'
               +'<td align="center" valign="top"><input  type="checkbox" name="can'+i+'"  '+chft+'  onClick="list_change(this.form);"></td>';                     //取消
	  edit_wk =  edit_wk 
	  +'<td valign="top">'+wk_snm+'<input type="hidden" name="snm'+i+'" value="'+item_buf[idx+3]+'"><input type="hidden" name="scd" value="'+item_buf[idx+1]+'"></td>'
  	  +'<td valign="top">'+item_buf[idx+2]+'<input type="hidden" name="mnm'+i+'" value="'+item_buf[idx+2]+'"></td>'
	  +'<td align="right" valign="top" nowrap><input type="text" name="ktanka" maxlength="10" size="10" value="\$'+ktanka+'" readonly style="border:1px solid #FFFFFF;color:#666666;text-align:right;"><input type="hidden" name="price'+i+'" value="'+item_buf[idx+4]+'"></td>';
      edit_wk =  edit_wk+'<td valign="top"><input style="'+hotsty+'" type="text" name="qty'+i+'" size="3" maxlength="3" value="'+ksuuryou +'" '+hotrd+' onChange="suuryou_change(this.form,this)"></td>';
	  edit_wk =  edit_wk+'<td align="right" valign="top" nowrap><input type="text" name="amt'+i+'" maxlength="10" size="10" value="\$'+kamount+'" readonly style="border:1px solid #FFFFFF;color:#666666;text-align:right;"></td></tr>';
	  //document.write(edit_wk);
  
	  sub_tot = sub_tot + eval( Math.round(item_buf[idx+6]) );
	  idx = idx + CKCNUM;                                                            //クキー項目数を加算
	}
	  var wtot = "";
	  wtot = Addc( sub_tot+"" );

	edit_wk = edit_wk + '</table><table cellpadding="2" cellspacing="0" style="width:99%;background-color:#FFFFFF;">' 
	+'<td bordercolor="#006600" nowrap>'

    +'<input type="image" name="order" src="/banner/kounyuu.png" width="115" height="27" style="color:#555555;">　　'
    +'<img src="/banner/allcan.png" width="73" height="26"  onClick="all_del_cookie();' + "alert('全ての選択を取消ました');document.getElementById('bask').style.visibility='hidden';" + '" style="cursor:pointer;">'

    +'</td>'
	+'<td width="80" align="center"><span style="color:#666666;border-style:none;font-weight:bold;">小計</span></td>'
	+'<td width="83" align="center" bordercolor="#ffffff"><input type="text" name="stot" maxlength="11" size="11" READONLY value="\$'+wtot+'" style="text-align:right;border-style:solid;border-color:#FFFFFF;color:#666666;font-weight:bold;"></td></tr></table>'
    +'<div style="color:#666666;text-align:left;">'
    +'<font color=0099FF>※選択済みのパソコンのオプションを変更する場合は、選択済みのパソコンのお取消操作をお願いします。</font><br>'
    +'【←戻る】をクリックされても商品選択情報は残っています( ブラウザーを閉じると消去されます )<br>'
    +'※ご購入手続きでも、ご注文の取り消しができます</div><br>'
    +'</form>';
  }
  else {                                                                          //選択商品なし
   edit_wk = '<div style="color:#009900;text-align:center;">■現在、選択商品はございません。</div><br><br>';
  }
  edit_wk = edit_wk + '<div style="text-align:center;"><img src="/banner/cls.png" width="54" height="21" alt="閉じる" onClick="' + "document.getElementById('bask').style.visibility='hidden';"  + '"></div>';
  var obj = document.getElementById( 'bask' );
  obj.innerHTML = edit_wk;
  if ( obj.style.visibility == 'hidden' ) {
    obj.style.visibility = 'visible';
  }
}
