<!--

function init()
{
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var x = new getObj('text');
	if (document.layers)
	{
		lyrheight = x.style.clip.bottom;
		lyrheight += 20;
		x.style.clip.top = clipTop;
		x.style.clip.left = 0;
		x.style.clip.right = clipWidth;
		x.style.clip.bottom = clipBottom;
	}
	else if (document.getElementById || document.all)
	{
		lyrheight = x.obj.offsetHeight;
		var clipstring = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'px,0)';
		x.style.clip = clipstring;
	}
}

function scrollayer(layername,amt,tim)
{
	if (!DHTML) return;
	thelayer = new getObj(layername);
	if (!thelayer) return;
	amount = amt;
	theTime = tim;
	realscroll();
}

function stopScroll()
{
	if (time) clearTimeout(time);
}

function realscroll()
{
	if (!DHTML) return;
	clipTop += amount;
	clipBottom += amount;
	topper -= amount;
	if (clipTop < 0 || clipBottom > lyrheight)
	{
		clipTop -= amount;
		clipBottom -= amount;
		topper += amount;
		return;
	}
	if (document.getElementById || document.all)
	{
		clipstring = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'px,0)'
		thelayer.style.clip = clipstring;
		thelayer.style.top = topper + 'px';
	}
	else if (document.layers)
	{
		thelayer.style.clip.top = clipTop;
		thelayer.style.clip.bottom = clipBottom;
		thelayer.style.top = topper;
	}
	time = setTimeout('realscroll()',theTime);
}

function vis(val)
{
	if (!DHTML) return;
	var f = new getObj('text');
	f.style.visibility = val;
}

function getObj(name)
{
  if (document.getElementById)
  {
    this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
    this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

function imgCollection(name,glen,slen,path,ext){
if(!document.images) return;
this.name = name;
this.groups = new Array(glen);
this.filepath = path;
this.filetype = (ext) ? ext : ".gif";
  for(var i = 0; i < glen; i++){
  this.groups[i] = new Image();
  this.groups[i].src = path + name + "_" + i + this.filetype;
  this.groups[i].states = new Array(slen);
    for(var j = 0; j < slen; j++){
    this.groups[i].states[j] = new Image();
    this.groups[i].states[j].src = path + name + "_" + i + "_" + j + this.filetype;
    }
  }
}

function getObjByName(name,doc) {
if(!doc) doc = document;
if(doc[name]) return doc[name]; 
  for(var i=0;i < doc.layers.length;i++){
  var lyrdoc = doc.layers[i].document;
  if(lyrdoc[name]) return lyrdoc[name]; 
    if(lyrdoc.layers.length > 0) {
    var obj = getObjByName(name, lyrdoc);
    if(obj) return obj;
    }
  }
return 0;
} 

function swapImg() { 
if(!document.images) return;
var args = swapImg.arguments; 
  for(var i = 0; i < args.length; i+=2) {
  var imgSrc = (args[i + 1].indexOf('[') != -1) ? eval(args[i + 1] + '.src') : args[i + 1]; 
  if(getObjByName(args[i])) getObjByName(args[i]).src = imgSrc; 
  }
}

// -->
