function SetImageProfile(IMG) { document.profile.src= IMG;}
function SetImageLesson(IMG) { document.lesson.src= IMG;}
function SetImageRecipe(IMG) { document.recipe.src= IMG;}
function SetImageLink(IMG) { document.link.src= IMG;}
function SetImageAccess(IMG) { document.access.src= IMG;}
function SetImageTop(IMG) { document.top.src= IMG;}

function SetImage(IMG,kind){
  switch(kind){
    case "profile": document.profile.src = IMG; break;
    case "lesson":  document.lesson.src = IMG; break;
    case "recipe":  document.recipe.src = IMG; break;
    case "link"  :  document.link.src = IMG; break;
    case "access":  document.access = IMG; break;
    case "top"   :  document.top.src = IMG; break;
    default      :  break;
  }
  return;
}

function SetOpening(IMG,num) {
  switch(num){
   case 1: document.open1.src=IMG;
           break;
   case 2: document.open2.src=IMG;
           break;
   case 3: document.open3.src=IMG;
           break;
   case 4: document.open4.src=IMG;
           break;
   case 5: document.open5.src=IMG;
           break;
   case 6: document.open6.src=IMG;
           break;
   case 7: document.open7.src=IMG;
           break;
   case 8: document.open8.src=IMG;
           break;
   case 9: document.open9.src=IMG;
           break;
   default:break;
  }
  return;
}


var inithal = 0;
function SubWinOpen(win_kind,pg){
  var sub_win,WW,WH,HUW,HSH;

  sub_win=window.open(pg,win_kind,"width=500,height=500,toolbar=no,menubar=no,status=no,resizable=yes");
/*  if(inithal == 0){
    WW = sub_win.outerWidth/2;
    WH = sub_win.outerHeight/2;
    HUW = (screen.availWidth/2)-WW;
    HSH = (screen.availHeight/2)-WH;
    sub_win.moveTo(HUW,HSH);
  }else   inithal = 1;
*/
  sub_win.focus();
}

lessonimg_array = new Array("image/shokuzei2-1.jpg","image/setumei.jpg","./image/make2.jpg","./image/make3.jpg","./image/make4.jpg","image/make5.jpg","image/make6-2.jpg","image/ringo.jpg","./image/fish_tomato.jpg","./image/dishes.jpg","image/kanban.jpg");
var lessonnum=lessonimg_array.length,j=0;

var i=0;

document.pre_image = new Image;
topimg_array = new Array("image/cordon2.jpg","image/shokuzai3.jpg","image/temoto10.jpg","./image/temoto7.jpg","./image/temoto9.jpg","image/sake_marine.jpg","image/avogad.jpg","image/ebi.jpg","image/meat.jpg","image/ringo.jpg","image/chizu.jpg","image/sishoku.jpg","image/kanban.jpg");
var topnum=topimg_array.length, i=0;
function changeImageTop()
  {
    document.pre_image.src = topimg_array[i+1];
    document.top_photo.src = topimg_array[i];
    if(i>=topnum-1) { /*i=0*/;return -1;}
    else {i++; return 0;}
}

function changeImageLesson()
  {
    document.lesson_photo.src = lessonimg_array[i];
    j++;
    if(j>=lessonnum)  j=0;
    timerID=setTimeout("changeImageLesson()","2000");
}

function stopImage()
  {
  clearTimeout(timerID);
}