var animateContent = function(isProjectOpen,element,intSize,endSize)
{
	var attributes = { height: {from:intSize, to: endSize, unit: 'em' }	}; 

	var removeElement = function() { 
		var el = this.getEl(); 				
		el.parentNode.removeChild(el);		
	};  

	var myAnim = new YAHOO.util.Anim(element, attributes,1,YAHOO.util.Easing.easeOut ); //YAHOO.util.Easing.easeOut
	
	if (isProjectOpen)
		{
			myAnim.onComplete.subscribe(removeElement);						
		}
	myAnim.animate();				
}


function animateNavSection(element,intSize,endSize,element2,intSize2,endSize2)
{
	tweenInProgress = true;
	
	var attributes = { 
		 height: {from:intSize, to: endSize, unit: 'em' } 
	}; 
	
	var enableTween = function()
	{
		tweenInProgress = false;
	} 
	var myAnim = new YAHOO.util.Anim(element, attributes,1,YAHOO.util.Easing.easeOut ); //YAHOO.util.Easing.easeOut
	
	if (element2)
		{	var reanimate = function()
			{
				animateNavSection(element2,intSize2,endSize2);
				selectedProjectElement = null;				
			}
			myAnim.onComplete.subscribe(reanimate);
		}
	else{			
			expandedSelction = element;				
		}
	
	myAnim.onComplete.subscribe(enableTween);
	myAnim.animate();
}


function fadePics(element1, end1)
{
	tweenInProgress = true;
	
	var removeElement = function() { 
		
		tweenInProgress = false;
		
		var el = this.getEl(); 				
		el.parentNode.removeChild(el);		
	}; 
	
	var attributes = { opacity: { to:end1 } }; 
	
	var myAnim = new YAHOO.util.Anim(element1, attributes,1.5, YAHOO.util.Easing.easeOut ); //YAHOO.util.Easing.easeOut
	
	myAnim.onComplete.subscribe(removeElement);
	
	myAnim.animate();
}

function thumbnailFade(element1, end1)
{
	var attributes = { opacity: { to:end1 } }; 
	
	var myAnim = new YAHOO.util.Anim(element1, attributes, .5, YAHOO.util.Easing.easeOut ); //YAHOO.util.Easing.easeOut
	
	myAnim.animate();
}

function fadeOutPreloader()
{
	//hide bar
	document.getElementById("bar").style.display = "none";
	
	//setup redirect
	var redirect = function()
	{
		window.location = "rf3/index.php";
	}
	
	var attributes = { opacity: { to:0 }, marginTop:{to:700}};
	
	
	var myAnim = new YAHOO.util.Anim("preloader", attributes, 2, YAHOO.util.Easing.easeOut ); //YAHOO.util.Easing.easeOut
	
	myAnim.animate();
	
	myAnim.onComplete.subscribe(redirect);
	
};