var effects = {

	intervalID:null,
	mutex:false,

	tileOver:function(object){

		if(effects.mutex)
			return;

		effects.mutex = true;
		var i = 0;
	
		effects.intervalID = setInterval(function(){
			if(i<20){
				object.parentNode.style.backgroundPosition = '0 -'+(2*i)+'px';
				object.nextSibling.style.bottom = 15-(2*i)+'px';
				object.firstChild.style.display = 'none';
			} else if(i<30){
				object.parentNode.style.backgroundColor = '#FFF2EE';
				object.nextSibling.nextSibling.style.visibility = 'visible';
				object.nextSibling.nextSibling.style.opacity = (i-20)/10;
			}else{
				clearInterval(effects.intervalID);
				effects.intervalID = null;
			}
			i++;
		}, 10);
	},

	tileOut:function(object){
		object.parentNode.style.backgroundPosition = '';
		object.nextSibling.style.bottom = '';
		object.nextSibling.nextSibling.style.visibility = '';
		object.nextSibling.nextSibling.style.opacity = '';
		object.firstChild.style.display = '';
		object.parentNode.style.backgroundColor = '';
		effects.mutex = false;
		clearInterval(effects.intervalID);
		effects.intervalID = null;
	},

	tileFadeOut:function(object){
		
		var i = 0;
	
		var interval = setInterval(function(){
			if(i<20){
				object.style.opacity = 1-i/19;
				object.style.bottom = i+'px';
			}else{
				object.style.visibility = 'hidden';
				clearInterval(interval);
			}
			i++;
		}, 10);
	},

	tileFadeIn:function(object){

		var i = 0;

		var interval = setInterval(function(){
			if(i<20){
				object.style.visibility = 'visible';
				object.style.opacity = i/19;
				object.style.bottom = (19-i)+'px';
			}else{
				clearInterval(interval);
			}
			i++;
		}, 10);
	}
}


