<!--
//
var image = new Array();
image[0] = document.createElement('img');
image[0].setAttribute('src',"http://www.sopedestrian.com/images/transparent.gif");
for (var i = 0; i < galleryarray.length-1; i++){
  image[i+1] = document.createElement('img');
  image[i+1].setAttribute('src',"http://www.sopedestrian.com/tgimages/"+galleryarray[i+1]);

  var piclabel = galleryarray[i+1];
  piclabel = piclabel.replace(" - ",", ");
  piclabel = piclabel.replace(".jpg","");
  image[i+1].setAttribute('label', "cssheader=[tgtoolhd] cssbody=[tgtoolbd] header=[] body=["+piclabel+"]");

};

//////////////////////////////////////////////////////////////////////
//global variables
slide = new Array();
position = new Array();

function makeTransparent(num) {
  document.getElementById("tglarge").style.opacity = num / 1000;
}

function enlargeImg(x) {
  found = 0;
  while (x != position[found]) {found++;}
  document.getElementById("tgtable").style.display = "none";
  document.getElementById("tglarge").style.display = "block";

  makeTransparent(0.0);
  for (var i = 1; i <= 100; i++) {
    setTimeout("makeTransparent("+i+");",Math.round((i * i) / 20));
  }

  var tglargelabel = document.getElementById("tglargelabel2");
  var label = document.createTextNode(image[slide[found]].name);
  tglargelabel.appendChild(label);

  document.images["test"].src=image[slide[found]].src;
}

function reduceImg() {
  document.getElementById("tglarge").style.display = "none";
  document.getElementById("tgtable").style.display = "block";

  var tglargelabel = document.getElementById("tglargelabel2");
  tglargelabel.removeChild(tglargelabel.firstChild);
}

function randOrd() {
  return (Math.round(Math.random())-0.5);}
	
function animateadd(num1,num2) {
  document.images["slide"+num1].src=image[num2].src;
  var floatinglabel = image[num2].getAttribute('label');
  document.images["slide"+num1].setAttribute('title', floatinglabel);
}

function tinyGalleryMain(){
  if (!document.images)
    return
    
  step = 10;	
  for (var i = 0; i < 5; i++) {position[i] = i+1;}
  for (var j = 0; j < galleryarray.length; j++) {slide[j] = j+1;}

  position.sort( randOrd ); slide.sort( randOrd );

  for (var k = 0; k < 5; k++) {
    to1 = setTimeout("animateadd(position["+k+"],slide["+k+"]);",(k+1) * step);}

}

tinyGalleryMain();
//-->
