/*
  function to place photo of fencing master into the page and change text + background
*/

var master = {

photo:new Image(), textStyle:null, shift:0,

read:function()
{
  this.photo.src = "images/jph_thumb.jpg";
},

start:function()
{
  document.getElementById('masterImage').src = this.photo.src;
  document.getElementById('masterImage').style.visibility = 'visible';

  this.textStyle = document.getElementById('masterText').style;

  this.moveVertical();
},

moveVertical:function()
{
  this.shift++;  

  this.textStyle.clip = 'rect(0px 455px ' + this.shift + 'px 0px)';

  if(this.shift == 80)
  {
    setTimeout("master.moveHorizontal()",1000);

    this.shift = 0;
  }
  else
    setTimeout("master.moveVertical()",50);
},

moveHorizontal:function()
{
  this.shift++;  

  this.textStyle.clip = 'rect(0px ' + (455 - this.shift) + 'px 80px '+ this.shift + 'px)';

  if(this.shift == 228)
  {
    setTimeout("master.moveVertical()",1000);

    this.shift = 0;
  }
  else
    setTimeout("master.moveHorizontal()",30);
}
}

master.read();
