var clipTop = 0;
var clipWidth = 425;
var clipBottom = 320;
var topper = 60;
var lyrheight = 0;
var time,amount,theTime,theHeight,DHTML;

function init()
{
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	if (document.getElementById('example')){var x = new getObj('example'); clipWidth = 425;}
	if (document.getElementById('example2')){var y = new getObj('example2'); clipWidth = 660;}

	if(document.layers && document.getElementById('example')){
	    {
		    lyrheight = x.style.clip.bottom;
		    lyrheight += 10;
		    x.style.clip.top = clipTop;
		    x.style.clip.left = 0;
		    x.style.clip.right = clipWidth;
		    x.style.clip.bottom = clipBottom;
	    }	
	}
	
	else if(document.layers && document.getElementById('example2')){
	    	   
	    {   
		    lyrheight = y.style.clip.bottom;
		    lyrheight += 10;
		    y.style.clip.top = clipTop;
		    y.style.clip.left = 0;
		    y.style.clip.right = clipWidth;
		    y.style.clip.bottom = clipBottom;    		
	    }	    
	 }	
	
	else if (document.getElementById || document.all)
	{
	    if(document.getElementById('example')){
		    lyrheight = x.obj.offsetHeight;
		    lyrheight += 10;
		    var clipstring = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'px,0)';
		    x.style.clip = clipstring;
		}
		else if(document.getElementById('example2')){
		    lyrheight = y.obj.offsetHeight;
		    lyrheight += 10;
		    var clipstring = 'rect('+clipTop+'px,'+clipWidth+'px,'+clipBottom+'px,0)';
		    y.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;
	if(document.getElementById('example')){
	    var f = new getObj('example');
	}
	else if(document.getElementById('example2')){
	    var f = new getObj('example2');
	}
	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];
  }
}
