//メイン画像切替
function thumbimg(imagedata,collection_no){
     document.mainimg.src = imagedata.src;
     document.getElementById("collection_description").innerHTML = description_html[collection_no];
     document.getElementById("recommend_img").innerHTML = "<ul>" + recommend_html[collection_no] + "</ul>"; 

}

//Recommend Itemデータ作成関数
function rec_item(rec_no){
return("<li><a href='/shop/products/detail.php?product_id=" + rec_no +"'><img src='/shop/upload/save_image/" + rec_no + "-1.jpg' width='68' height='102' border='0' /></a></li>");
}

//ページ切替処理関数
function paging(pageno){
  //データ表示
  for ( cnt2 = (pageno-1)*30 + 1 ; cnt2 <= (pageno-1)*30 + 30  ; cnt2++ ) {
      if (buy_flag[cnt2] == 1){buyicon="<img src='img/icon_buy.gif' width='20' height='8' alt='BUY' title='BUY' class='icon_buy' />";}else{buyicon=""}
      if (cnt2 <= numofimages){
        html_text = "<a href='javascript:void(0);' onclick='thumbimg(img_l[" + cnt2 +  "]," + cnt2 + ")'><img src='" + img_s[cnt2] + "' width='80' height='129' /></a>" ; 
        elementid = "collection_img" + (cnt2-(pageno-1)*30);
        document.getElementById(elementid).innerHTML = html_text + buyicon;
      } else {
        html_text = "&nbsp;" ; 
        elementid = "collection_img" + (cnt2-(pageno-1)*30);
        document.getElementById(elementid).innerHTML = html_text + buyicon;
      } 
  }
  //ページ切替ボタンの表示
  var obj_back=document.getElementById("back");
  var obj_next=document.getElementById("next");

  if(pageno >1){
    obj_back.className = "back";
    obj_back.innerHTML = "<p><a href='javascript:paging(" +(pageno - 1) + ");' title='BACK'>BACK</a></p>";
  }else{obj_back.className = "noback";}


  if(pageno <numofpages){
    obj_next.className = "next";
    obj_next.innerHTML = "<p><a href='javascript:paging(" +(pageno + 1) + ");' title='NEXT'>NEXT</a></p>";
  }else{obj_next.className = "nonext";}
}
