
 currency = 0;

 exchRate = 1;
 lang = 0;
 // SWEDISH ; ENGLISH ; SPANISH ; PORTUGUESE ; POLISH ; DANISH ; GERMAN ; FRENCH ; SOUMI
 langTrans = new Array(
   new Array(
     new Array("Ståplats", "Terraces", "Tribunas", "Arquiban.", "Stoj¹ce", "ff", "gg", "hh"),
     new Array("Sittplats", "Sitting", "Plateas", "Cadeiras", "Siedz¹ce", "ff", "gg", "hh"),
     new Array("VIP-bås", "VIP", "VIP", "VIP", "VIPów", "ff", "gg", "hh"),
     new Array("Summa", "Sum", "Total", "Total", "W sumie", "ff", "gg", "hh"),
     new Array("Restaurang", "Restaurant", "Restaurante", "Restaurante", "Restauracja", "ff", "gg", "hh"),
     new Array("Korvkiosk", "Hotdog Stand", "Puesto de hotdogs", "Barraca de Hot Dog", "Budka z Hot Dogami", "ff", "gg", "hh"),
     new Array("Snabbmatställe", "Fastfood", "Comida rápida", "Fast food", "Bar szybkiej obs³ugi", "ff", "gg", "hh"),
     new Array("Pub", "Pub", "Pub", "Bar", "Pub", "ff", "gg", "hh"),
     new Array("Souvenirshop", "Souvenir Shop", "Tienda del club", "Loja de souvenir", "Sklep z pami¹tkami", "ff", "gg", "hh"),
     new Array("Hotell", "Hotel", "Hotel", "Hotel", "Hotel", "ff", "gg", "hh"),
     new Array("Läkarmottagning", "Clinic", "Clínica", "Clínica", "Klinika", "ff", "gg", "hh"),
     new Array("Summa", "Sum", "Total", "Total", "W sumie", "ff", "gg", "hh"),
     new Array("Totalt", "Total", "Total", "Total", "W sumie", "ff", "gg", "hh")
   ),
   new Array(
     new Array("Publik", "Spectators", "Espectado.", "Público", "Widzowie", "ff", "gg", "hh"),
     new Array("Stadion", "Stadium", "Estadio", "Estádio", "Stadion", "ff", "gg", "hh"),
     new Array("Inkomst", "Income", "Ingresos", "Receitas", "Przychód", "ff", "gg", "hh"),
     new Array("Vecko-kostnad", "Weekly Upkeep", "Gastos", "Despensas", "Utrzyman.", "ff", "gg", "hh"),
     new Array("Max (Full)", "Max (Full)", "Max (Full)", "Max (Full)", "Max (Full)", "ff", "gg", "hh"),
     new Array("Inkomst", "Income", "Ingresos", "Receitas", "Przychód", "ff", "gg", "hh"),
     new Array("Ny Stadion", "New Stadium", "Nueva Estadio", "Nova Estádio", "now¹ Stadion", "ff", "gg", "hh"),
     new Array("Inkomst", "Income", "Ingresos", "Receitas", "Przychód", "ff", "gg", "hh"),
     new Array("Vecko-kostnad", "Weekly Upkeep", "Gastos", "Despensas", "Utrzyman.", "ff", "gg", "hh"),
     new Array("Bygg", "Build", "Construir", "Construir", "Buduj", "ff", "gg", "hh"),
     new Array("Kostnad", "Cost", "Costo", "Custo", "Koszty", "ff", "gg", "hh")
   )
 );

 langTips = new Array(
   new Array( "Enter the normal number of spectators you get on a league game here.",
              "Enter the current capacity and number of facilities of your stadium here.",
              "Here you see how much income you get for each induvidual spectator/facility type and also sumations by type and stadium total.\n\nHolding your mouse over the value, you'll see how many paying customers you utilize.",
              "This is how much your stadium cost each week in upkeep.",
              "Here you see the maximum of each type your current spectators suport (that atleast break even with the upkeep). In italic text (in parentisis) you see how many buildings you fill to generate optimal income. This is the recommended max, even if the teoretical is higher.\n\nHolding your mouse over the number of facilities you'll see the exact number of suported buildings with decimals.",
              "This is the income a maximum extended stadium generate. By induvidual type, group and total.\n\nHolding your mouse over the value, you'll see how many paying customers you utilize.",
              "Enter the size of your goal stadium.",
              "The income for you new stadium. By induvidual type, group and total.\n\nHolding your mouse over the value, you'll see how many paying customers you utilize.",
              "This is how much your new stadium will cost each week in upkeep.",
              "Enter how much of each type you wnt to build.",
              "Here you see the buildingcost (or demolishing payback) for you desired stadium changes." )
 );

//     \__.-==============================-.__/


 PROCMALL = new Array(
   /// Spectator Normalization values
   new Array(0.75, 0.23, 0.02),
   /// Distributon of spectators using facilities
   new Array(
     new Array(0.10, 0.30, 0.60), new Array(0.40, 0.30, 0.10), new Array(0.30, 0.40, 0.10),
     new Array(0.40, 0.20, 0.20), new Array(0.25, 0.20, 0.10),  new Array(0.02, 0.04, 0.10),
     new Array(0.00, 0.00, 0.00)
   ),
   ///        LIG   TRM    KLI    CUP POCUP  FRCUP  : Gametype spectator multiplier
   new Array(1.00, 0.05, 0.005, 0.075, 1.00, 0.005),
   /// Cupincome home/away from spectators & facilities
   new Array( new Array(0.50, 1.00), new Array(0.50, 0.00) )
 );

 REALCAP    = new Array(
  new Array(1, 1, 1), new Array(125, 150, 200, 300, 200, 60, 3)
 );

 BUILDCOST  = new Array(
  new Array( new Array(100, 300, 1500), new Array(400000, 20000, 300000, 300000, 50000, 850000, 250000) ),  // SEK
  new Array( new Array( 11,  33,  166), new Array( 44000,  2200,  33000,  33000,  5500,  94000,  28000) ),  // EUR ?
  new Array( new Array( 11,  33,  166), new Array( 51500,  2500,  38500,  38500,  6500, 109000,  32000) ),  // USD ??
  new Array( new Array(  8,  23,  115), new Array( 31000,  1500,  23000,  23000,  3800,  65000,  19000) )   // GBP ?
 );

 WEEKCOST   = new Array(
  new Array( new Array( 10, 50, 100), new Array(750, 500, 1000, 1000, 1250, 1500, 10000) ), // SEK
  new Array( new Array(1.5,  6,  12), new Array( 81,  55,  108,  108,  135,  163,  1100) ), // EUR ?
  new Array( new Array(1.5,  6,  12), new Array( 96,  64,  128,  128,  160,  192,  1282) ), // USD ??
  new Array( new Array(  1,  4,   8), new Array( 57,  38,   76,   76,   96,  115,   764) )  // GBP ??
 );

 MAXEARN    = new Array(
  new Array( new Array(100, 150, 750), new Array(14375, 5250, 12000, 15000, 12000, 24000, 0) ), // SEK
  new Array( new Array( 11,  17,  82), new Array( 1575,  570,  1320,  1650,  1320,  2640, 0) ), // EUR ??
  new Array( new Array( 11,  17,  82), new Array( 1850,  562,  1297,  1621,  1297,  2594, 0) ), // USD ??
  new Array( new Array(  8,  12,  57), new Array( 1080,  402,   920,  1125,   920,  1800, 0) )  // GBP ??
 );

 REALPRICE  = new Array(
  new Array( new Array(100, 150, 750), new Array(  115,   35,   60,   50,   60, 400, 0) ), // SEK
  new Array( new Array( 11,  17,  82), new Array(12.60, 3.80, 6.60, 5.50, 6,60,  44, 0) ), // EUR ??
  new Array( new Array( 11,  17,  82), new Array(14.80, 3.89, 6.49, 5.40, 6,49,  43, 0) ), // USD ??
  new Array( new Array(  8,  12,  57), new Array( 8.64, 2.68, 4.60, 3.75, 4.60,  30, 0) )  // GBP ??
 );


//     \__.-==============================-.__/
//                     LANGUAGE


 function changeLanguage(idx) {
   lang = idx;
   lth = new Array("Type", "Head");
   for (i=0 ; i<2 ; i++) {
     for (j=0 ; j<langTrans[i].length ; j++) {
       if (i == 0 && j <= 15)
         document.getElementById("l"+i+"-"+j).innerHTML = langTrans[i][j][lang]+":";
       else if (j <= 10)
         document.getElementById("l"+i+"-"+j).innerHTML = langTrans[i][j][lang];
     }
   }
   return;
 }

 function changeCurrency(v) {
   exchIdx = v - 1;
   exchRate = exchange_rates[exchIdx][3];

   calc("max");
   calc("sta");
   calc("new");
   calc("bld");
   for ( ui=0 ; ui<5 ; ui++ )
     show(vHName[ui]);

//   if (idx < REALPRICE.length)
//     currency = idx;
//   else
//     currency = 0;
   return;
 }


//     \__.-==============================-.__/
//                    SPECTATORS


 function specNorm(tot) {
   retArr = new Array();
   restArr = new Array();
   ptot = 0;
   for (spi=0; spi<3; spi++) {
     retArr[spi] = parseInt(tot*PROCMALL[0][spi]+PROCMALL[0][spi]-(1-Math.abs(spi-1))*0.001);
     restArr[spi] = (tot*PROCMALL[0][spi]) - parseInt(tot*PROCMALL[0][spi]);
     ptot += retArr[spi];
   }
   retArr[spi] = ptot;
   if (tot > ptot) {
     if ( restArr[1] >= 0.56 )
       retArr[1] += 1;
     else
       retArr[0] += 1;
   } else if (tot < ptot) {
     alert("Spectator Error: 'normalization', "+tot +"/"+ ptot +" ; "+ retArr);
   }
   return retArr;
 }

 function getMaxSpectators(sArr) {
   mi = maxValueIdx( new Array( (sArr[0]/PROCMALL[0][0]), (sArr[1]/PROCMALL[0][1]), (sArr[2]/PROCMALL[0][2]) ) );
   mx = parseInt(sArr[mi]/PROCMALL[0][mi]);
   nArr = specNorm( mx );
   while ( sArr[0] > nArr[0] || sArr[1] > nArr[1] || sArr[2] > nArr[2] ) {
     mx += 1;
     nArr = specNorm( mx );
   }
   return nArr;
 }

 function getCustomers(spectators) {
   customers = new Array( spectators, new Array(0,0,0,0,0,0,0) );
   for (ci=0 ; ci<customers[1].length ; ci++) {
     for (cj=0 ; cj<PROCMALL[1][ci].length ; cj++) {
       customers[1][ci] += parseInt(spectators[cj]*PROCMALL[1][ci][cj]);
     }
   }
   return customers;
 }

 function getMaxFacilities(sArr) {
   // MAX, FULL, EXACT
   retArr = new Array( new Array(0,0,0,0,0,0,0), new Array(0,0,0,0,0,0,0), new Array(0,0,0,0,0,0,0) );
   maxcust = getCustomers(sArr);
   for ( fi=0 ; fi<maxcust[1].length ; fi++ ) {
     retArr[0][fi] = retArr[1][fi] = parseInt( retArr[2][fi] = maxcust[1][fi]/REALCAP[1][fi] );
     if ( (maxcust[1][fi]-(retArr[0][fi]*REALCAP[1][fi]))*REALPRICE[currency][1][fi] >= (WEEKCOST[currency][1][fi]*2) ) {
       retArr[0][fi] += 1;
     }
   }
   return retArr;
 }


//     \__.-==============================-.__/
//                      UPDATE


//     \__.-==============================-.__/
//                   GETSET VALUE


 function getValue(type,id,nr) {
   if ( type >= 1 ) {
     if ( type == 1 || type == 3 )
       v = document.getElementById(""+id+""+nr).innerHTML;
     else if ( type == 2 )
       v = document.getElementById(""+id+""+nr).title;
     v = v.replace(/\./g,"");
   } else {
     v = eval( "document.v2."+id+""+nr+".value" );
   }
   if ( (v.toString()).indexOf("(") >= 0 || (v.toString()).indexOf("<I>") >= 0 ) {
     if ( type == 3 ) {
       v = v.toString().substr(
                          maxValue( new Array( (v.toString()).indexOf("(")+1, (v.toString()).indexOf("<I>")+3 ) ),
                          minValue( new Array( (v.toString()).indexOf(")"), (v.toString()).indexOf("</I>") ) )
                              );
     }
     else
       v = v.toString().substr(0,(v.toString()).indexOf("("));
   }
   eval("v = 0 + parseInt(v)");
   return parseInt( v );
 }

 function setValues(type,id,nr,v) {
   for (vi=0 ; vi<v.length ; vi++) {
     if (type >= 1 && type <= 3) {
       out = "";
       vv = Math.abs(parseInt(v[vi]));
       for ( z=parseInt((vv.toString().length-1)/3) ; z>=0; z--) {
         o = parseInt( vv / Math.pow(10,(z*3)) );
         if (out != "") {
           out = out +".";
           if (o < 10)
             out = out +"00"+ o;
           else if (o < 100)
             out = out +"0"+ o;
           else
             out = out +""+ o;
         }
         else
           out = out +""+ o;
         vv -= o * Math.pow(10,(z*3));
       }
       if (vv != v[vi] && (v[vi].toString()).indexOf(".") > 0) {
         out = out +","+ v[vi].toString().substr(1+(v[vi].toString()).indexOf("."));
       }
       if (v[vi] < 0)
         out = "-"+ out;
       if (type == 2)
         cangeTitle(""+id+""+(nr+vi),out);
       else if (type == 3) {
         out = getValue(1,id,(nr+vi)) +"(<I>"+ out +"</I>)";
         document.getElementById(""+id+""+(nr+vi)).innerHTML = out;
       }
       else
         document.getElementById(""+id+""+(nr+vi)).innerHTML = out;
     } else {
//       if (id == "trn" || id == "fri") {
//         alert("Trn: "+ id +", "+ nr +", "+ vi +", "+ v[vi] +", "+ v.length +": "+ v);
//       }
       if (type == 4)
         cangeTitle(""+id+""+(nr+vi),v[vi]);
       else
         eval( "document.v2."+id+""+(nr+vi)+".value = "+v[vi] );
     }
   }
 }

 function cangeTitle(aname,newtitle) {
   document.getElementById(aname).title = newtitle;
   return;
 }


//     \__.-==============================-.__/
//                       CALC


 function minValue(minArr) {
   retValue = minArr[0];
   for (mivi=1; mivi<minArr.length; mivi++) {
     if (minArr[mivi] < retValue)
       retValue = minArr[mivi];
   }
   return parseInt(retValue);
 }

 function maxValue(maxArr) {
   retValue = 0;
   for (mxvi=0; mxvi<maxArr.length; mxvi++) {
     if (maxArr[mxvi] > retValue)
       retValue = maxArr[mxvi];
   }
   return parseInt(retValue);
 }

 function maxValueIdx(maxArr) {
   retValue = 0;
   for (mxvi=1; mxvi<maxArr.length; mxvi++) {
     if (maxArr[mxvi] > maxArr[retValue])
       retValue = mxvi;
   }
   return retValue;
 }


//     \__.-==============================-.__/
//                       ????


 function updThis(inp,v) {
   id = inp.substr(0,3);
   nr = inp.substr(3);
   idx = 0;
   if (id != "spe")
     idx = id2nr(id);

   if ( !(parseInt(v) < 0 || parseInt(v) > 0) )
     v = 0;
   vHolder[idx][0][nr] = parseInt(v);
   if (nr == 3) {
     specArr = specNorm(vHolder[idx][0][3]);
     for (i=0 ; i<3 ; i++) {
       vHolder[idx][0][i] = specArr[i];
     }
   } else if (nr < 3) {
     vHolder[idx][0][3] = (vHolder[idx][0][0]+vHolder[idx][0][1]+vHolder[idx][0][2]);
   } else if (nr >= 0) {
     vHolder[idx][0][nr] = parseInt(v);
   }

   if ( id == "spe" || id == "sta" || id == "new" || id == "bld" || id == "max" ) {
     if (id == "spe") {
       set("max");
       set("gme");
       calc("max");
//       calc("gme");
       calc("sta");
     } else if (id == "sta") {
       set("bld");
       set("new");
       calc("sta");
     } else if (id == "new") {
       set("bld");
     } else if (id == "bld") {
       set("new");
     }
     calc("new");
     calc("bld");

     for ( ui=0 ; ui<5 ; ui++ )
       show(vHName[ui]);
   }
 }

 function set(id) {
   if (id == "max" || id == "ful") {
     maxArr = getMaxSpectators(vHolder[0][0]);
     for ( j=0 ; j<=3 ; j++ )
       vHolder[4][0][j] = vHolder[5][0][j] = maxArr[j];
     facArr = getMaxFacilities(vHolder[4][0]);  // MAX, FULL, EXACT
     for ( j=0 ; j<=6 ; j++ ) {
       vHolder[4][0][4+j] = facArr[0][j];
       vHolder[5][0][4+j] = facArr[1][j];
       vHolder[4][5][4+j] = vHolder[5][5][4+j] = facArr[2][j];  // Set ALT
     }
   } else if (id == "new") {
     for ( i=0 ; i<10 ; i++ )
       vHolder[2][0][i] = parseInt(vHolder[1][0][i]) + parseInt(vHolder[3][0][i]);
   } else if (id == "bld") {
     for ( i=0 ; i<10 ; i++ )
       vHolder[3][0][i] = vHolder[2][0][i] - vHolder[1][0][i];
   } else if (id == "gme") {
     for ( i=0 ; i<=3 ; i++ ) {
       specArr = specNorm( parseInt(vHolder[0][0][3]*PROCMALL[2][1+i]) );
       for ( j=0 ; j<=3 ; j++ )
         vHolder[6+i][0][j] = specArr[j];
     }
   }
 }

 function calc(id) {
   idx = id2nr(id);

   // SET INCOME, EXPENSES, CUSTOMERS & PAYING CUSTOMERS

   custArr = getCustomers(vHolder[idx][0]);
   for ( i=1 ; i<=4 ; i++ )
     vHolder[idx][i][3] = vHolder[idx][i][11] = vHolder[idx][i][12] = 0;
   for ( i=0 ; i<3 ; i++ ) {
     if (idx == 1 || idx == 2) {
       vHolder[idx][4][3] = ( vHolder[idx][3][3] += ( vHolder[idx][4][i] = ( vHolder[idx][3][i] = minValue(new Array(vHolder[0][0][i],vHolder[idx][0][i])) ) ) );
     }
     else
       vHolder[idx][4][3] = ( vHolder[idx][3][3] += ( vHolder[idx][4][i] = ( vHolder[idx][3][i] = custArr[0][i] ) ) );
     vHolder[idx][1][3] += ( vHolder[idx][1][i] = parseInt(vHolder[idx][4][i] * REALPRICE[0][0][i] * exchRate) );
     if (idx == 3)
       if (vHolder[idx][0][i] < 0)       // Negative value = demolish stadium
         vHolder[idx][2][3] += ( vHolder[idx][2][i] = parseInt(vHolder[idx][0][i] * -BUILDCOST[0][0][i] * 0.25 * exchRate) );
       else
         vHolder[idx][2][3] += ( vHolder[idx][2][i] = parseInt(vHolder[idx][0][i] * -BUILDCOST[0][0][i] * exchRate) );
     else
       vHolder[idx][2][3] += ( vHolder[idx][2][i] = parseInt(vHolder[idx][0][i] * -WEEKCOST[0][0][i] * exchRate) );
     if (idx == 4)
       for ( j=1 ; j<=4 ; j++ )
         vHolder[idx+1][j][3] += ( vHolder[idx+1][j][i] = vHolder[idx][j][i] );
   }
   if (idx == 1)
     custArr = getCustomers(vHolder[idx][3]);
   for ( i=0 ; i<=6 ; i++ ) {
     vHolder[idx][4][11] += vHolder[idx][4][i+4] = minValue( new Array( (vHolder[idx][3][i+4] = custArr[1][i]), (vHolder[idx][0][i+4]*REALCAP[1][i]) ) );
     vHolder[idx][3][11] += vHolder[idx][3][i+4];
     vHolder[idx][1][11] += vHolder[idx][1][i+4] = parseInt(vHolder[idx][4][i+4] * REALPRICE[0][1][i] * exchRate);
     if (idx == 3)
       if (vHolder[idx][0][i+4] < 0)       // Negative value = demolish stadium
         vHolder[idx][2][11] += vHolder[idx][2][i+4] = parseInt(vHolder[idx][0][i+4] * -BUILDCOST[0][1][i] * 0.25 * exchRate);
       else
         vHolder[idx][2][11] += vHolder[idx][2][i+4] = parseInt(vHolder[idx][0][i+4] * -BUILDCOST[0][1][i] * exchRate);
     else
       vHolder[idx][2][11] += vHolder[idx][2][i+4] = parseInt(vHolder[idx][0][i+4] * -WEEKCOST[0][1][i] * exchRate);
     if (idx == 4) {
       vHolder[idx+1][4][11] += vHolder[idx+1][4][i+4] = minValue( new Array( (vHolder[idx+1][3][i+4] = custArr[1][i]), (vHolder[idx+1][0][i+4]*REALCAP[1][i]) ) );
       vHolder[idx+1][3][11] += vHolder[idx+1][3][i+4];
       vHolder[idx+1][1][11] += vHolder[idx+1][1][i+4] = parseInt(vHolder[idx+1][4][i+4] * REALPRICE[0][1][i] * exchRate);
       if (idx == 3)
         if (vHolder[idx+1][0][i+4] < 0)       // Negative value = demolish stadium
           vHolder[idx+1][2][11] += vHolder[idx+1][2][i+4] = parseInt(vHolder[idx+1][0][i+4] * -BUILDCOST[0][1][i] * 0.25 * exchRate);
         else
           vHolder[idx+1][2][11] += vHolder[idx+1][2][i+4] = parseInt(vHolder[idx+1][0][i+4] * -BUILDCOST[0][1][i] * exchRate);
       else
         vHolder[idx+1][2][11] += vHolder[idx+1][2][i+4] = parseInt(vHolder[idx+1][0][i+4] * -WEEKCOST[0][1][i] * exchRate);
     }
   }
   for ( i=1 ; i<=4 ; i++ ) {
     vHolder[idx][i][12] = vHolder[idx][i][3] + vHolder[idx][i][11];
     if (idx == 4)
       vHolder[idx+1][i][12] = vHolder[idx+1][i][3] + vHolder[idx+1][i][11];
   }
 }

 function show(id) {
   idx = 0;
   if (id != "spe")
     idx = id2nr(id);
   id = vHName[idx];

//   alert(id+"("+vHName[idx]+"): "+vHolder[idx][0]+"\n"+vHolder[idx][1]+"\n"+vHolder[idx][2]+"\n"+vHolder[idx][3]+"\n"+vHolder[idx][4]+"\n"+vHolder[idx][5]);

   showArr = new Array();
   for (si=0 ; si<=2 ; si++) {
     showArr[si] = new Array(new Array(),new Array(),new Array(),new Array());
     for (sj=0 ; sj<3 ; sj++)
       showArr[si][0][sj] = vHolder[idx][si][sj];        // Spectators
     if (idx != 3 || si > 0)
       showArr[si][0][sj] = vHolder[idx][si][sj];        // Spectators Sum
     for (sj=0 ; sj<=6 ; sj++) {
       showArr[si][1][sj] = vHolder[idx][si][sj+4];      // Facilities
       if (si == 0 && idx == 4) {
         showArr[si][2][sj] = vHolder[idx+1][si][sj+4];  // Alt. Facilities
         showArr[si][3][sj] = vHolder[idx][5][sj+4];     // Facilities Title
       } else if (si == 1) {
         showArr[si][3][sj] = vHolder[idx][4][sj+4];     // Facilities Title
       }
     }
     if (si > 0) {
       showArr[si][1][sj+0] = vHolder[idx][si][sj+4+0];  // Facilities Sum
       showArr[si][1][sj+1] = vHolder[idx][si][sj+4+1];  // Total Sum
     }

     if ( si == 0 && idx != 4 && idx != 5 ) {
       setValues(0,id,0,showArr[si][0]);                 // Set Spectator INPUT
       if (idx != 0)
         setValues(0,id,4,showArr[si][1]);               // Set Facilities INPUT
       else if (idx == 0) {
         xArr = new Array();
         for (sj=0 ; sj<4 ; sj++) {
           xArr[sj] = new Array( );
           xArr[sj][0] = vHolder[6+sj][0][3];
///           setValues(0,vHName[6+sj],0,xArr[sj]);         // Set Extra Games INPUT
         }
       }
     } else if ( idx != 0 ) {
       if ( !(si == 1 && idx == 3) && !(si == 2 && (idx == 4 || idx == 5)) ) {
         setValues(1,id+divName[si],0,showArr[si][0]);   // Set Spectator DIV
         setValues(1,id+divName[si],4,showArr[si][1]);   // Set Facilities DIV
         if (si == 0 && idx == 4) {
           setValues(3,id+divName[si],4,showArr[si][2]); // Set Alt.Facilities DIV
           setValues(2,id+divName[si],4,showArr[si][3]); // Set Exa.Facilities Title
         }
         if (si == 1)
           setValues(2,id+divName[si],4,showArr[si][3]); // Set Fac.Customers Title
       }
     }
   }
 }

 function id2nr(id) {
   if (id == "max" || id == "ful")
     idx = 4;
   else if (id == "bld")
     idx = 3;
   else if (id == "new")
     idx = 2;
   else
     idx = 1;
   return idx;
 }

//     \__.-==============================-.__/
//                     ACTIVATE

 vHolder = new Array();
 vHName = new Array();
 divName = new Array("","In","Out");

 function doOnLoad() {
   setValues(4,"l1-",0,langTips[0]);
   vHName = new Array( "spe", "sta", "new", "bld", "max", "ful", "trn", "fri", "cup", "poc" );
   // I(10): SPE, STA, NEW, BLD, MAX, FULL  ,  TRN, FRI, GRP , CUP
   // J (3): NR, IN, OUT, CUST, PAY, ALT
   // K(13): STAND, SIT, VIP, SUM  ,  RE, HD, FF, PU, SS, HO, CL, SUM  ,  TOT
   for ( i=0 ; i<10 ; i++ ) {
     vHolder[i] = new Array();
     for ( j=0 ; j<6 ; j++ ) {
       vHolder[i][j] = new Array();
       for ( k=0 ; k<13 ; k++ ) {
         vHolder[i][j][k] = 0;
       }
     }
   }

   changeLanguage(0);
   document.getElementById("frmdiv").style.visibility = "visible";
 }

