// init.js
var X = 0; var Y = 1; var CX = 2; var CY = 3; var W = 4; var H = 5;
Sbody = new Array(0, 0, Math.round(BWidth/2), Math.round(BHeight/2), BWidth, BHeight);

// basic functions
function setbodystyle(stylesArray) {
  var i = 0;
  while (i < stylesArray.length) {
    if (stylesArray[i][0] && stylesArray[i][1]) {
	  eval('document.getElementsByTagName(\'body\')[0].style.' + stylesArray[i][0] + " = '" + stylesArray[i][1] + "';");
	  i++;
    }
  }
}
function setstyle(id, stylesArray) {
  var i = 0; while (i < stylesArray.length) {
    if (document.getElementById(id) && stylesArray[i][0] && stylesArray[i][1])
    eval('document.getElementById('+"'"+id+"'"+').style.' + stylesArray[i][0] + " = '" + stylesArray[i][1] + "';"); i++;
  }
}
var SiteID = 'TBotton0';
function setBotton(myBotton){
  setstyle(SiteID, [['backgroundColor', BgGray]]);
  SiteID = myBotton;
}
function overBotton(myBotton){
  //setstyle(myBotton, [['cursor', 'pointer']]);
  switch(myBotton) {
    case 'TBotton0':
      setstyle(myBotton, [['backgroundColor', '#FFFFFF']]);
    break;
	case 'TBotton1':
      setstyle(myBotton, [['backgroundColor', '#FFF99E']]);
    break;
	case 'TBotton2':
      setstyle(myBotton, [['backgroundColor', '#FEC879']]);
    break;
	case 'TBotton3':
      setstyle(myBotton, [['backgroundColor', '#A6D2FF']]);
    break;
	case 'TBotton4':
      setstyle(myBotton, [['backgroundColor', '#949594']]);
    break;
	case 'TBotton5':
      setstyle(myBotton, [['backgroundColor', '#C1FFDA']]);
    break;
  }
}
function outBotton(myBotton){
  if(myBotton != SiteID) setstyle(myBotton, [['backgroundColor', BgGray]]);
}