var LAMBRINDIS = {
	homePhotoMenu : function(){
		var menuItems = $$('.menuItem .movable');
		menuItems.each(function(item, index){
			if(index != 4){
				item.tween = new Fx.Tween(item,{
					link : 'cancel',
					duration: 500,
					transition: 'expo:out'
				});
				item.tween.start('top',0);
				item.idx = index;
				item.addEvents({
					'mouseenter': function(){
						this.tween.start('top',-182);
					},
					'mouseleave': function(){
						this.tween.start('top',0);
					}
				});
			}
		});		
	},
	newsBox : function(){
		var box = $('newsBox');
		if(box){
			var links = box.getElements('a.lnk');
			if(links.length>0){
				

				var movable = box.getElement('.movable');
				box.yMove = 83;
				box.currentPosition = 0;
				box.maxPos = links.length -1;
				box.tween = new Fx.Tween(movable,{
					link : 'cancel',
					duration: 800,
					transition: 'expo:out'
				});
				box.tween.start('top', 0);
				function loopMe(){
					if(box.currentPosition < box.maxPos){
						box.currentPosition++;
					}
					else{
						box.currentPosition = 0;
					}
					box.tween.start('top', -box.currentPosition*box.yMove);
				}
				links.each(function(item, index){
					item.addEvents({
						'mouseenter': function(){
							$clear(box.interval);
						},
						'mouseleave': function(){
							loopMe();
							box.interval = loopMe.periodical(4000);
						}
					});
				});
				box.interval = loopMe.periodical(4000);
			}
		}
	}
}

window.addEvent('domready', function(){
	LAMBRINDIS.homePhotoMenu();
	LAMBRINDIS.newsBox();
});