// Tweens the background-color of an element to the color provided. Based on Mootools
/*
var ColorTransitioner.prototype = new Class({
	initialize: function(element, newColor) {
		console.info('Inside the method');
		this.origColor = element.getStyle('background-color');
		this.newColor = (newColor == null ? '#000' : newColor);
		this.fx = new Fx.Tween(element);
	},
	start: function() {
		//Transitions the background color of the Element from its current color to newColor:
		this.fx.start('background-color', this.newColor);
	}
});*/

// Uncomment to automatically create the transitioner upon document load.
// document.observe('dom:loaded', function () { var portfolioBackColorTransitioner = new ColorTransitioner($('portfolio_background_container')); });

function fadeOutPortfolioBkgd(element, wrapper) { 
   this.newElementColor = '#000';  
   this.newBorderColor = '#131313';
   this.newWrapperColor = '#0f0f0f';
   this.fxDuration = 0.5; 
   
   this.elementFx = new Effect.Morph(element, { style: ('background: '+this.newElementColor+';'), duration: fxDuration });
   this.elementBorderFx = new Effect.Morph(element, { style: ('border-color: '+this.newBorderColor+';'), duration: fxDuration });
   this.wrapperFx = new Effect.Morph(wrapper, { style: ('background: '+this.newWrapperColor+';'), duration: fxDuration });
}

function fadeInPortfolioBkgd(element, wrapper) { 
   this.newElementColor = '#052c47';  
   this.newBorderColor = '#041724';
   this.newWrapperColor = '#002034'; 
   this.fxDuration = 0.5; 
   
   this.elementFx = new Effect.Morph(element, { style: ('background: '+this.newElementColor+';'), duration: fxDuration });
   this.elementBorderFx = new Effect.Morph(element, { style: ('border-color: '+this.newBorderColor+';'), duration: fxDuration });
   this.wrapperFx = new Effect.Morph(wrapper, { style: ('background: '+this.newWrapperColor+';'), duration: fxDuration });
   
   /*
   Deprecated Mootools syntax
   this.elementFx = new Fx.Style(element, 'background-color', {duration:500});
   this.elementBorderFx = new Fx.Style(element, 'border-color', {duration:500});
   this.wrapperFx = new Fx.Style(wrapper, 'background-color', {duration:500});  
   
   this.elementFx.start(this.newElementColor); 
	 this.elementBorderFx.start(this.newBorderColor); 
	 this.wrapperFx.start(this.newWrapperColor); 
	 */
}

//document.observe('dom:loaded', function () { 
//	fadeOutPortfolioBkgd($('portfolio_background_container'), $('portfolio_background_wrapper'));
//  fadeInPortfolioBkgd($('portfolio_background_container'), $('portfolio_background_wrapper'));
// });