var currentTitle = false;
function startto() {
	
	
	viewFx = new Fx.Style('viewid', 'opacity', {duration: 500,transition: Fx.Transitions.quartInOut});
	viewFx.custom.pass([0,1], viewFx).delay(0);
		
	if($('thumb0').title!='') {
		titleFx = $('viewtitle').effect('opacity', {duration: 500, transition: Fx.Transitions.linear});
		titleFx.custom.pass([0,.5], titleFx).delay(500);	
		currentTitle = true;
	} else currentTitle = false;
}
function switchto(img) {
	
	if(currentTitle) {
		titleFx = $('viewtitle').effect('opacity', {duration: 250, transition: Fx.Transitions.linear});
		titleFx.custom.pass([.5,0], titleFx).delay(0);
	}	
		setTimeout("$('viewtitle').innerHTML = '<h1>' + $('thumb" + img + "').title + '</h1>' + $('thumb" + img + "').alt;",300);
	
	
	viewFx = new Fx.Style('viewid', 'opacity', {duration: 500,transition: Fx.Transitions.quartInOut});
	viewFx.custom.pass([1,0], viewFx).delay(250);
	
	setTimeout("$('viewid').src = $('thumb"+img+"').lowsrc",650);
	
	
		
	viewFx = new Fx.Style('viewid', 'opacity', {duration: 500,transition: Fx.Transitions.quartInOut});
	viewFx.custom.pass([0,1], viewFx).delay(750);
		
	if($('thumb'+img).title!='') {
		titleFx = $('viewtitle').effect('opacity', {duration: 500, transition: Fx.Transitions.linear});
		titleFx.custom.pass([0,.5], titleFx).delay(1250);
		currentTitle = true;
	} else currentTitle = false;
}

			

var scrolling = 0;	// Controls whether the layer is scrolling or not
var yT = 5;	// Pixel position the top of the scrolling layer should be set to
var lT = 5;	// Initial position for the top of the layer
var yI = 15;	// Increment that the scrolling layer should move at
var yH = 0;	// Hight of scrollling layer
var object = null;	// Stores the generic DOM for the scrolling layer to access style properties
var speed = 50;


function startScroll(objectID,direction) {
	
	object = $(objectID);
	scrolling = 1;
	scroll(direction);
	speed = 80;
}

function scroll(direction) {
	if (scrolling == 1) {
		if(direction == 1)
		{
			yT = yT + yI;
			object.scrollTop = yT;
			if(object.scrollTop < yT)
			{
			  yT = object.scrollTop;
			  scolling = 0;
			}
	  }
		else
		{
			yT -= yI;
			object.scrollTop = yT;
			if(object.scrollTop > yT)
			{
			  yT = object.scrollTop;
			  scolling = 0;
			}
		}
		code2run = 'scroll('+ direction + ')';
		if(speed != 25) speed = speed - 5;
		
		setTimeout(code2run,speed);
	}
	return false;
}

function stopScroll() {
	scrolling = 0;
	return false;
}

function URB(objectID) {
	var object = document.getElementById(objectID);
	yH = 999999;
	object.scrollTop = yH;
}

function URT(objectID,frameName) {
	var object = document.getElementById(objectID);
	object.scrollTop = lT;
}