// JavaScript Document
function errorHighlight(element,mode){
	var effect = new Fx.Morph(element);
	if(mode){
		effect.start({
			'background-color':['#f7d3d3']
		});
	} else {
		effect.start({
			'background-color':['#FFF']
		})
	}
}

function fadeElement(element,direction){
	if(direction == 'in'){
		var currentOpacity = document.getElementById(element).style.opacity;
		if(currentOpacity == 0){
		document.getElementById(element).style.display = 'inline-block';
		document.getElementById(element).style.opacity = 0;
		new Fx.Tween(element, {
			duration: 400
		}).start('opacity',0,1);
		}
	}
	if(direction == 'out'){
		new Fx.Tween(element, {
			duration: 400,
			onComplete: function(){
				document.getElementById(element).style.display = 'none';
			}
		}).start('opacity',1,0);
	}		
}

function boxChange(element,height,width){
	$(element).morph({height: height, width: width});
}