//----------------------------------------------------------------
// You're welcome to use these for your own but please give credit
//                        ashley pond v
//----------------------------------------------------------------
function eraseMe (elemID) {
   document.getElementById(elemID).style.visibility='hidden';
}
//----------------------------------------------------------------
function collapseMe (myself) {
   myself.style.visibility='hidden';
   myself.style.display='none';
}
//----------------------------------------------------------------
function restoreMe (elemID) {
   document.getElementById(elemID).style.visibility='visible';
   document.getElementById(elemID).style.color='#001';
}
//----------------------------------------------------------------
function switchColor (elemID) {
  var rgbColor = '';
  for ( i = 1; i < 4; i++ ) {
     rgbColor +=  Math.floor(Math.random() * (250+1));
     if ( i != 3 ) rgbColor += ',';
  }
  document.getElementById(elemID).style.color="rgb("+rgbColor+")";
}
//----------------------------------------------------------------
// -->> apv, please retain this credit ---------------------------
function fadeMe ( elemID, InOut, Intrvl, Step ) {
  var word = document.getElementById(elemID);
  if ( ! InOut.match(/^in|out$/) ) {
    InOut = word.isOut ? 'in' : 'out';
  }
  if ( (InOut === 'in') && word.isIn ) return false;
//  if ( (InOut === 'in') && !word.hasRun ) return false;
  if ( (InOut === 'out') && word.isOut ) return false;
  if ( word.isRunning ) return false;
  word.inout = InOut;
  word.isRunning = 1;
  Intrvl = Intrvl > 0 ? Intrvl : 50;
  word.Step = Step > 0 ? Step : 10;
  word.rgb = ( word.inout === 'in' ) ? 255 : 0;
  word.style.visibility = 'visible';
  word.lastInterval = setInterval("Fade('" + elemID + "')", Intrvl);
}
function Fade (elemID) {
  word = document.getElementById(elemID);
  if ( word.inout === 'out' ) {
    if ( word.rgb > 255 ) {
       word.style.visibility = 'hidden';
       clearInterval(word.lastInterval);
       word.isRunning = 0;
       word.isOut = 1;
       word.hasRun = 1;
       word.isIn = 0;
       return true;
       }
    word.rgb += word.Step;
  } else {
    if ( word.rgb < 0 ) {
      word.style.color = "rgb(0,0,0)";
      clearInterval(word.lastInterval);
      word.isRunning = 0;
      word.isOut = 0;
      word.isIn = 1;
      return true;
      }
      word.rgb -= word.Step;
  }
  var newColor = "rgb("+word.rgb+','+word.rgb+','+word.rgb+")";
  word.style.color = newColor;
}
//----------------------------------------------------------------
function fisherYates ( myArray ) {
  var i = myArray.length;
  while ( --i ) {
     var j = Math.floor( Math.random() * ( i + 1 ) );
     var tempi = myArray[i];
     var tempj = myArray[j];
     myArray[i] = tempj;
     myArray[j] = tempi;
   }
}