dojo.require("dojo.parser");
dojo.require('dojo.fx');

resizeObject = new Array();

function initResizeObjects(winWidth, winHeight) {
// parameters are ID, top, left, width, height, visibility

  resizeObject[0] = new makeResizeObject('foot_right',  winHeight-10, 150, winWidth-150, 40, 0, 'visible');
  resizeObject[1] = new makeResizeObject('foot_left',  winHeight-10, 0, 150, 40, 0, 'visible');
  resizeObject[2] = new makeResizeObject('main', 110, 160, winWidth - 140, winHeight - 130, 'visible');
  resizeObject[3] = new makeResizeObject('head_right', 0, 286, winWidth - 290, 90,  'visible');
  resizeObject[4] = new makeResizeObject('menu_bg', winHeight - 292, 0, 150, 0, 'visible');
  resizeObject[5] = new makeResizeObject('menu_gray', 0, 0, 150, winHeight-150, 'visible');
  resizeObject[5] = new makeResizeObject('flags', winHeight, winWidth-80, 100, 30, 'visible');
//  resizeObject[5] = new makeResizeObject('footwords',  winHeight, 150, winWidth-150, 40, 0, 'visible');
}
function init() {
  winWidth = Zbrowse.width() - 20 - ((Zflag.IE)?0:15) ;
  winHeight= Zbrowse.height() - 40;
  initResizeObjects(winWidth, winHeight);
  for (m=0;m<resizeObject.length;m++){resizeObject[m].setAllProps();}

  ctop = 0;
  cleft = 0;
  currentX= (-598);
  currentY=(-722);
  if (!loaded) { 
	setUpEvents(); 
  }
  
  notYetInit=0;
}

dojo.addOnLoad (function() {
  init();
  quotes();
  setInterval('quotes()',15000);
});

function getResizeObj(id) {
  for (m=0;m<resizeObject.length;m++){
    if (resizeObject[m].ID == id){
      return m;
    }
  }
  return false;
}

function setUpEvents() {
  if (Zflag.NS) {
	window.captureEvents(Event.MOUSEMOVE);
	window.onMouseMove = moveHandler;
  } else if (Zflag.IE) {
	document.onmousemove=moveHandler;
  } else if (Zflag.gecko && !Zflag.opera) {
	document.addEventListener("mousemove", moveHandler, true);
  }
  loaded=true;
}

function moveHandler(e) {
	if (!loaded) return false;
	Xpos = (Zflag.IE)?event.x:e.pageX;
	Ypos = (Zflag.IE)?event.y:e.pageY;
	}

function quotes() {
  comeBack = function() {
    dojo.byId('quotations').innerHTML = joepil[Math.ceil(8*Math.random())];
	dojo.fadeIn({node : 'quotations', duration: 3000}).play();
  };
  dojo.fadeOut({node : 'quotations', duration: 3000}).play();
  setTimeout("comeBack()",3500);
}

joepil = Array();
joepil[1]="&quot;Everything should be smooth, like a cat. To avoid excess strain on the heart and lungs ... natural movements ... with the emphasis on doing and being.&quot;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp; <em>J. H. Pilates</em>";
joepil[2]="&quot;That way you can concentrate on movement. You must always do it slowly and smoothly. Then your whole body is in it.&quot;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp; <em>J. H. Pilates</em>";
joepil[3]="&quot;Not only is health a normal condition, but it is our duty not only to  attain it but to maintain it.&quot;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp; <em>J. H. Pilates</em>";
joepil[4]="&quot;It is the mind itself which builds the body.&quot;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp; <em>J. H. Pilates</em>";
joepil[5]="&quot;The mind, when housed in a healthful body, posesses a glorious sense of power.&quot; ... J. H. Pilates</em>";
joepil[6]="&quot;Physical fitness is the first requisite of happiness.&quot;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp; <em>J. H. Pilates</em>";
joepil[7]="&quot;A few well-designed movements, properly performed in a balanced sequence, are worth hours of doing sloppy calisthenics or forced contortion.&quot;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp; <em>J. H. Pilates</em>";
joepil[8]="&quot;Moving through life in harmony with all around and all within is the achievement of well being.&quot;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp; <em>J. H. Pilates</em>";


Xpos=0; Ypos=0;
loaded=false;
Kdelay = 10;
currentLight='1';
winpopped=0;
notYetInit=1;
onresize = init;


