function getSite(sitename) {
	$('content').fade({ 
		duration: 1.5,
		queue: 'front' 
	});
	new Ajax.Request('./index.php?s='+sitename, {
		onComplete: function(transport) {
			if (200 == transport.status) {
				if (transport.responseText != '') {
					$('content').innerHTML = transport.responseText;
					$('content').appear({
						duration: 2.0,
						queue: 'end' 
					});
					
					if ($('itemList') != null) {
						var width = 0;
						var nodes  = $A($('itemList').getElementsByTagName('div')).map(Element.extend);
						for (i=0;i<nodes.length;i++) {
							width += nodes[i].getWidth();
						}
						$('itemList').style.width = width + 'px';
					}
				}
			}
		}
	});
}

var itemCount = 0;
function move(count) {
	var direction = (itemCount > 0 && count == -1) ? 635 : -635;
	var nodes  = $A($('itemList').getElementsByTagName('div')).map(Element.extend);
	var maxItemCount = nodes.length;
	
	new Effect.Move('itemList', {
   		x: direction, 
   		transition: Effect.Transitions.spring,
   		queue: 'end'
	});
	
	itemCount += count;
	
	if (itemCount > 0) {
		$('moveLeft').show();
	} else {
		$('moveLeft').hide();
	}
	
	if (itemCount == (maxItemCount -1)) {
		$('moveRight').hide();
	} else {
		$('moveRight').show();
	}
}