/* 和顔専用 Java Script FILE *******************************************

  functions index
  1. Preload Image
     (1)ini_preload_image_header() <-- common
     (2)ini_preload_image_index()  <-- only "index.html"
     (3)ini_preload_image_shop()   <-- only "shop_index.html"

  2. Change Images
     (1)set_image_src([image name], [event object])

  3. 

************************************************************************* */


// Initialize Parameter ----------------------------------------------------------------//

// イメージオブジェクトを格納する配列 
PreImages     = new Array();

// 定型文字列の配列 
index_name     = new Array("none", "naniwa", "momotani", "bake_squid", "mail_order", "order");

// -- loaded flag --
/* ページ内の要素が全て読み込まれているか否かを判定 initialize 関数の処理終了後、flag が true となる */
flag_page_loaded = false;

// End of Initialize Parameter ----------------------------------------------------------//




// Preload Image (Initialize) -----------------------------------------------------------//

// preload to header button images
function ini_preload_image() {
  image_pass    = "./images/top/";
  image_headers = "picture_squid_comment_";
  for(counter_one = 0; counter_one < index_name.length; counter_one++) {
      ImageName = image_headers+index_name[counter_one];
      PreImages[index_name[counter_one]] = new Image();
      PreImages[index_name[counter_one]].src = image_pass+ImageName+".gif";
  }
  flag_page_loaded = true;
}



// End of Preload Image (Initialize) ----------------------------------------------------//


// Change Images ------------------------------------------------------------------------//

function set_image_src(ImID, ImName, event) {
  if(flag_page_loaded) {
    if(event.type=="mouseover") {
      document.images[ImID].src = PreImages[ImName].src;
    } else {
      document.images[ImID].src = PreImages[ImName].src;
    }
  }
}

// End of Change Images -----------------------------------------------------------------//




// Window Open --------------------------------------------------------------------------//

function open_window() {
  subwin = window.open("shop_item_shop_w.html", "subwin", "width=540,height=500");
  subwin.focus();
}


// End of Window Open -------------------------------------------------------------------//



