// Hey emacs this is -*- Java -*- Script
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 1998-2001 by Technische Universität München (TUM)
//
// Diese Seite ist Bestandteil des Projekts 
// 
//       INTEGRATION IN DER INGENIEUR-ANALYSIS
// 
// des Zentrums Mathematik und des Medienzentrums der TUM.
// 
// Kontaktadresse: integration@mathematik.tu-muenchen.de
//
///////////////////////////////////////////////////////////////////////////
//
// Author: Dominik Eberlein (eberlein@mathematik.tu-muenchen.de)
//

// general def's
last = new Array(30);
cur_img = Array(30);
img_names = new Array(100);
img_path = "../../../../images/";

var nav_img = img_path+'pic_off.gif';
var nav_on_img = img_path+'pic_on.gif';

img_names['anim_t12_1_0'] = img_path+'ch2/t/t12_1a.gif';
img_names['anim_t12_1_1'] = img_path+'ch2/t/t12_1b.gif';
img_names['anim_t12_1_2'] = img_path+'ch2/t/t12_1c.gif';
img_names['anim_t12_1_3'] = img_path+'ch2/t/t12_1d.gif';
img_names['anim_t12_1_4'] = img_path+'ch2/t/t12_1e.gif';
last['anim_t12_1'] = 5;
cur_img['anim_t12_1'] = 0;

img_names['anim_t13_2a_0'] = img_path+'ch2/t/t13_2a.gif';
img_names['anim_t13_2a_1'] = img_path+'ch2/t/t13_2b.gif';
img_names['anim_t13_2a_2'] = img_path+'ch2/t/t13_2c.gif';
img_names['anim_t13_2a_3'] = img_path+'ch2/t/t13_2d.gif';
img_names['anim_t13_2a_4'] = img_path+'ch2/t/t13_2e.gif';
last['anim_t13_2a'] = 5;
cur_img['anim_t13_2a'] = 0;

function prev_img(anim_name) {
  if (cur_img[anim_name] == 0) {
    return;
  }
  
  set_img(anim_name, cur_img[anim_name]-1);
}

function next_img(anim_name) {
  if (cur_img[anim_name] == last[anim_name]-1) {
    return;
  }
  
  set_img(anim_name, cur_img[anim_name]+1);
}

function set_img(anim_name, img_number) {
  for (i=0; i<last[anim_name]; i++) {
    document.images[anim_name+'_n'+i].src=nav_img;
  }

  document.images[anim_name].src=img_names[anim_name+'_'+img_number];
  document.images[anim_name+'_n'+img_number].src=nav_on_img;  
  cur_img[anim_name] = img_number;
}
