/* ---- moving pic script --------------- modified 26 January 2006 ------ */
/* ------ copyright (c) 2006 Graf Web Design - Australia ------- */

// ===  set up for moving image global variables =========
var cntMoves=0;                         // No. moves counter
var nextTalent=0;                        //  pointer to talent array 
var posn="";                               // shortcut to moving image object
mouseoverActive=false;               // flags mouseover activity
// ------------------------------------------
var number_of_moves=2;             // <<<<<<< SET number of moves before image change here <<<<<<<<<<
var moves_interval=700;              // <<<<<<< SET millisecond interval between moves here <<<<<<<<<<
// ========================
//
// set-up moving image
function start_it()
 { posn=document.getElementById("tPic");     // short-cut to img object
   rand();                                                       // initial start position & start counter
 } 
//
// random position within frame 134w x 156h. Pic size 100 x 136.
 function rand()
  { posn.style.top=Math.random()*19;
    posn.style.left=Math.random()*33;
    if(mouseoverActive==false)                        // checks for mouseover
       { // change talent pics
            cntMoves++
         // check if change of image needed
            if(cntMoves>number_of_moves)
              { posn.src="images/"+talent[nextTalent];           // change talent pic
                imageSrc[0]=talent[nextTalent];                     // update mouseover store
                nextTalent++;
                nextTalent=(nextTalent>2)? 0 : nextTalent;     // keep track of talent pic index
                cntMoves=0;                                                // reset moves counter
              } 
        } 
// 
   setTimeout("rand()",moves_interval)                     // interval between moves
  }
//
// --------------------------
var talent=["move_1.jpg","move_3.jpg","move_2.jpg"]           // vary talent pics
//
var imageSrc=["move_2.jpg","camera2.jpg"];  // set up hover images. Stores current image in imageSrc[0].
//
// mouse in-out toggle
 function tog(num) 
  {  posn.src="images/"+imageSrc[num]; 
     mouseoverActive=(num==1)? true : false;
  }
// -------------------- 
