//01/15/07
var Lastbutton=0;       // last visited button number
var Thisbutton = 0;     // this button number
var ButtonFile= 'goodform.gifs/buttongifs.etc',
SelectGif = 'gfbluedot.gif',
VisitedGif= 'gforangedot.gif',
VisibleColor  = "#fe7013",
InvisibleColor= "white",
LaunchMsg="Launch website",
LaunchTarget = '_self',
LaunchUrl = '';
// mainline stuff; set bluedot objects' onclick function
for (i=1;i <= 20; i++)
{ if ( ! (obj = document.getElementById('thbimages'+i) ) ) break;
   if (iname[i] ) obj.onmouseover = function(){SetImg(this)}  ;
}
// set subimage selection objects' onclick function
for (i=1;i <= 3; i++)
  { //document.getElementById('imgsub'+i).onclick=function(){SetSubImg(this)};
}
//set next / previous arrows onclick function
document.getElementById('imgprev').onclick=function(){ArrowImg(this)};
document.getElementById('imgnext').onclick=function(){ArrowImg(this)};

// functions
function SetImg(obj)
{ Thisbutton = obj.name.substring(9);
  if (Thisbutton >= iname.length ) return;
//  if (Lastbutton)
//    document.getElementById("gfbluedot"+Lastbutton).src=
//       ButtonFile+"/"+SelectGif;     // set last visited back to blue
//  Lastbutton = Thisbutton;
//  obj.src = ButtonFile+"/"+VisitedGif;// set visited to orange  
  
  DoImgUrl(iname[Thisbutton][0]);
 
  var image_multiples = iname[Thisbutton].length ; // how many of the litte buggers are there?
  if (image_multiples == 1) image_multiples = 0;
//  for (i=1;i <= 3; i++)
//  {  nextobj = document.getElementById("imgsub"+i)
//     if ( i > image_multiples )
//	nextobj.style.color=InvisibleColor; //invisible
//	 else
//		nextobj.style.color=VisibleColor; // visible
//  }
  return;
}

function DoImgUrl(imgurl)
{ var imgs = imgurl.split(';') ;         // split: imagename;url
  document.getElementById('placeholder').src=ImageFile+'/'+imgs[0];
  if(!(obj = document.getElementById('gflaunch'))) return;
  obj.value = ''; obj.style.width = 0;
  if ( (LaunchUrl=imgs[1]) ) 
  { obj.value = LaunchMsg; obj.style.width = 120; obj.style.color=VisibleColor;
  } 
}

function SetSubImg(obj)
{ var nindex = obj.name.substring(6);
  DoImgUrl( iname[Thisbutton][nindex-1] );
}

function ArrowImg(obj)
{ var arrowid = obj.name;
  if(Thisbutton==1 && arrowid=='imgprev')return;
  if(Thisbutton==iname.length-1 && arrowid=='imgnext')return;
  if(arrowid=='imgprev') Thisbutton--;else Thisbutton++; 
  SetImg(document.getElementById('thbimages'+Thisbutton));
}

function Launch(obj)
{ window.open(LaunchUrl,'',LaunchTarget);
}
SetImg(document.getElementById("thbimages1"))

// end
