// 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
img_on = new Array(10);
img_off = new Array(10);
formula_on = new Array(10);
formula_off = new Array(10);

img_flag = new Array(10);
img_fixed = new Array(10);

img_path = "../../../../images/";
formula_path = "../../../../images/formulas/";

var anim_name = 'anim_t12_2';
var formula_name = 'formula_t12_2';

img_on['anim_t12_2_1']  = img_path+'ch2/t/t12_2ba.gif';
img_off['anim_t12_2_1'] = img_path+'ch2/t/t12_2aa.gif';
img_on['anim_t12_2_2']  = img_path+'ch2/t/t12_2bb.gif';
img_off['anim_t12_2_2'] = img_path+'ch2/t/t12_2ab.gif';
img_on['anim_t12_2_3']  = img_path+'ch2/t/t12_2bc.gif';
img_off['anim_t12_2_3'] = img_path+'ch2/t/t12_2ac.gif';

formula_on['anim_t12_2_0']  = formula_path+'t/t12_2ba.gif';
formula_off['anim_t12_2_0'] = formula_path+'t/t12_2aa.gif';
formula_on['anim_t12_2_1']  = formula_path+'t/t12_2bb.gif';
formula_off['anim_t12_2_1'] = formula_path+'t/t12_2ab.gif';
formula_on['anim_t12_2_2']  = formula_path+'t/t12_2bc.gif';
formula_off['anim_t12_2_2'] = formula_path+'t/t12_2ac.gif';
formula_on['anim_t12_2_3']  = formula_path+'t/t12_2bd.gif';
formula_off['anim_t12_2_3'] = formula_path+'t/t12_2ad.gif';

img_flag['anim_t12_2_1'] = 0;
img_flag['anim_t12_2_2'] = 0;
img_flag['anim_t12_2_3'] = 0;

img_fixed['anim_t12_2_1'] = 0;
img_fixed['anim_t12_2_2'] = 0;
img_fixed['anim_t12_2_3'] = 0;

function set1_img(number, on) {
  if (on == 1) {
    document.images[anim_name+'_'+number].src = img_on[anim_name+'_'+number];
    document.images[formula_name+'_'+number].src = formula_on[anim_name+'_'+number];
  }
  else {
    if (img_fixed[anim_name+'_'+number] == 1) {
      return;
    }
    document.images[anim_name+'_'+number].src = img_off[anim_name+'_'+number];
    document.images[formula_name+'_'+number].src = formula_off[anim_name+'_'+number];    
  }
}

function fix_img(number) {
  if (img_fixed[anim_name+'_'+number] == 1) {
    img_fixed[anim_name+'_'+number] = 0;
    document.images[anim_name+'_'+number].src = img_off[anim_name+'_'+number];
    document.images[formula_name+'_'+number].src = formula_off[anim_name+'_'+number];    
    document.images[formula_name+'_0'].src = formula_off[anim_name+'_0'];    
  }
  else {
    img_fixed[anim_name+'_'+number] = 1;
    if ((img_fixed[anim_name+'_1'] == img_fixed[anim_name+'_2']) && (img_fixed[anim_name+'_2'] == img_fixed[anim_name+'_3'])) {
      document.images[formula_name+'_0'].src = formula_on[anim_name+'_0'];    
    }
  }
}
