//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
//
//　■共通処理クラス
//　依存関係：commonlib.js
//
//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//クラス生成
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
clsSearch = new Object();
clsSearch = function(){

  //*******************************************************
  //動作フラグ
  //*******************************************************
  this.blnDebug = 0;
  
  //*******************************************************
  //コンストラクタ
  //*******************************************************

  //*******************************************************
  //プロパティ
  //*******************************************************
  this.strPageID = "";

  //*******************************************************
  //初期処理
  //*******************************************************
  this.init = function(){
    //画面ID取得
    this.strPageID = document.body.id;

    //検索画面
    if (this.strPageID == "search"){
      this.search_init();
    }

  }
  
  //*******************************************************
  //検索画面　初期処理
  //*******************************************************
  this.search_init = function(){
    
    //実行ボタン動作セット
    com.addEvent(document.getElementById('btnSearch'), "click", function(){
      document.forms['frmSearch'].submit();
    });

    //リセットボタン動作セット
    com.addEvent(document.getElementById('btnReset'), "click", function(){
      document.forms['frmSearch'].reset();
      return false;
    });

  }
  
  //*******************************************************
  //該当情報なし、戻る
  //*******************************************************
  this.nodata = function(){
    
    //処理区分更新
    document.getElementById('proc').value = "";
    
    //送信
    document.forms['frmSearch'].submit();
  }
  
  //*******************************************************
  //ページ切り替え
  //*******************************************************
  this.pageing = function(vintPageNum){
    //ページ番号設定
    document.getElementById('page').value = vintPageNum;
    
    //送信
    document.forms['frmSearch'].submit();
  }
  
  //*******************************************************
  //Amazon送信
  //*******************************************************
  this.amazon = function(){
    //購入リスト削除
    com.setcookie("buylist", "");
    
    //別ウィンドウ起動
    document.forms['frmAmazon'].target = "_blank";
    
    //送信
    document.forms['frmAmazon'].submit();
  }
  //*******************************************************

}

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//インスタンス生成
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
com.addEvent(window, "load", function(){
  searchbook = new clsSearch;
  searchbook.init();
});