function initAnims() 
{
	function easeInOut(minValue,maxValue,totalSteps,actualStep,velocity) 
	{
		var delta = maxValue - minValue;
		var stepp = minValue+(Math.pow(((1 / totalSteps)*actualStep),velocity)*delta);
		return Math.ceil(stepp)
	}
	
	function doStyleChange(elem,startMargin,endMargin,steps,intervals,velocity) 
	{		
		if (elem.styleChangeAnim) 
			window.clearInterval(elem.styleChangeAnim);
		
		var actStep = 0;
		if( easeInOut )
		{
			elem.styleChangeAnim = window.setInterval(
				function() {
						elem.currentMargin = easeInOut(startMargin,endMargin,steps,actStep,velocity);
						elem.panel.style.marginTop = (elem.currentMargin+13)+"px";
						elem.shadow.style.marginTop = elem.currentMargin+"px";		
						actStep++;
						if (actStep > steps) window.clearInterval(elem.styleChangeAnim);	
		
				}
				,intervals)
		}
	
	}

	function marginChange() 
	{
		//this.panel.style.marginTop = '100px';
		if (!this.currentMargin) 
			this.currentMargin = 171;
		if( doStyleChange )
		{
			doStyleChange(this,this.currentMargin,this.endMargin,10,10,0.6);
		}
	}

	function marginRestore() 
	{
		//this.panel.style.marginTop = '185px';
		
		if (!this.currentMargin) return;
		if( doStyleChange )
		{
			doStyleChange(this,this.currentMargin,this.startMargin,10,10,0.8);
		}
	}
	
	if(document.getElementById('animation')){
		var animElements = document.getElementById('animation').getElementsByTagName('div');
		
		for(var i=0; i<animElements.length; i++) 
		{				
			if (animElements[i].className == "transparency") {
				animElements[i].onmouseover = marginChange;
				animElements[i].onmouseout = marginRestore;
				animElements[i].endMargin = 100;
				animElements[i].startMargin = 171;
				for(j=0; j<animElements[i].childNodes.length; j++){
					if (animElements[i].childNodes[j].className == 'panelContent')
						animElements[i].panel = animElements[i].childNodes[j];
				}
				for(j=0; j<animElements[i].childNodes.length; j++){
					if (animElements[i].childNodes[j].className == 'shadow')
						animElements[i].shadow = animElements[i].childNodes[j];
				}
			}
		}
		
	}
	
	if(document.getElementById('animateFeatures')){
		var animElements = document.getElementById('animateFeatures').getElementsByTagName('div');
		
		for(var i=0; i<animElements.length; i++) 
		{				
			if (animElements[i].className == "transparency") {
				animElements[i].onmouseover = marginChange;
				animElements[i].onmouseout = marginRestore;
				animElements[i].endMargin = 120;
				animElements[i].startMargin = 179;
				for(j=0; j<animElements[i].childNodes.length; j++){
					if (animElements[i].childNodes[j].className == 'panelContent')
						animElements[i].panel = animElements[i].childNodes[j];
				}
				for(j=0; j<animElements[i].childNodes.length; j++){
					if (animElements[i].childNodes[j].className == 'shadow')
						animElements[i].shadow = animElements[i].childNodes[j];
				}
			}
		}
		
	}

}


if (document.getElementById && document.getElementsByTagName) {
	if (window.addEventListener) window.addEventListener('load', initAnims, false);
	else if (window.attachEvent) window.attachEvent('onload', initAnims);
}