	function tickerBox (trackId,size,direction,tag,duration,wait) {

		var ticker_children = $(trackId).getChildren(tag);
		var array_length = parseInt(ticker_children.length)-1;
		var firstBorn = ticker_children[0];
		var lastBorn = ticker_children[array_length];
		
		// only animate if the items are bigger than the container
		if (direction=='h') {
			var containerSize = $(trackId).getParent().getStyle('width');
		} else {
			var containerSize = $(trackId).getParent().getStyle('height');
		}
		containerSize = containerSize.replace("px", "");
		containerSize = parseInt(containerSize);
		//alert('dir:' + direction + '\n container size:' + containerSize + '\n track size: ' + array_length*size + '(' + (array_length+1) + 'x' + size + ')');
		if (containerSize>0 && (array_length+1)*size<=containerSize) {
			//alert(array_length + ' = ' +containerSize + ' | ' + (array_length+1)*size);
			return false;
		}
		
		// animate the transition
		var myEffect = new Fx.Morph(firstBorn, {duration: duration});
		if (direction=='h') {
			myEffect.start({
				'opacity': [1, 0],
				'margin-left': [0, -size]
			});
		} else {
			myEffect.start({
				'opacity': [1, 0],
				'margin-top': [0, -size]
			});
		}
		
		// clone the element to the end
		(function() {
			var cloneBorn = firstBorn.clone().injectAfter(lastBorn);
			cloneBorn.setStyle('opacity',1);
			if (direction=='h') {
				cloneBorn.setStyle('margin-left',0);
			} else {
				cloneBorn.setStyle('margin-top',0);
			}
			firstBorn.dispose();
		}).delay(duration);
		
		// set off again 
		(function() {tickerBox(trackId,size,direction,tag,duration,wait)}).delay(wait);
	}
	
	
	function tickerBoxInit (trackId,size,direction,tag,duration,wait,initialWait) {
	
		if (!direction) {
			var direction = 'v';
		}
		if (!tag) {
			var tag = 'a';
		}
		if (!duration) {
			var duration = 600;
		}
		if (!wait) {
			var wait = 4000;
		}
		if (!initialWait) {
			var initialWait = wait;
		}
		(function() {tickerBox(trackId,size,direction,tag,duration,wait)}).delay(initialWait);
	
	}
