/* a cross fade animation using the motion tween library opacity function */var frames ; var frameIndex = 0 ; var fadeDuration = 2; var pauseBetweenFrames = 3; function getElementsByClass(searchClass,node,tag) {	var classElements = new Array();	if ( node == null )		node = document;	if ( tag == null )		tag = '*';	var els = node.getElementsByTagName(tag);	var elsLen = els.length;	var pattern = new RegExp("(^|\\\\s)"+searchClass+"(\\\\s|$)");	for (i = 0, j = 0; i < elsLen; i++) {		if ( pattern.test(els[i].className) ) {			classElements[j] = els[i];			j++;		}	}	// alert ("the number of elements in the class is " + classElements.length) ; 	return classElements;}function initAnimation() {	//alert("initting animation") ;	/* THIS FUNCTION IS CALLED ON LOAD */	/* ADD HOVER EFFECT ON LOAD IN IE6 */	if (document.all&&document.getElementById) 	{			navRoot = document.getElementById("mainmenu");		for (i=0; i<navRoot.childNodes.length; i++) 		{			node = navRoot.childNodes[i];			if (node.nodeName=="LI") 			{				node.onmouseover=function() 				{					this.className+=" over";				}				node.onmouseout=function() 				{					this.className=this.className.replace(" over", "");				}							 }		 }	}		// END HOVER IE6 	frames = getElementsByClass('fader', null, 'img')  ;	crossFadeBetweenItems();}	function crossFadeBetweenItems() {	//alert("cross fading animation") ;			var seq = new Sequence() ;		//stepArray = new Array; 	// fade in the new item	var teletype = document.getElementById("teletype");	var dummy = document.getElementById("dummy");		/* construct a pause to be used */	var pause = new Tween(dummy.style,'width',Tween.regularEaseIn,10,20,pauseBetweenFrames,'px') ;	//alert("number of frames is "+frames.length) ;	for (i= 0 ; i < frames.length; i++) {		var item = frames[ i ] ;		var step = new Parallel() ;		step.addChild( new OpacityTween(item,Tween.regularEaseOut,0,100,fadeDuration)    ) ;		step.addChild( new TextTween(teletype.firstChild, 'nodeValue', item.title, Tween.regularEaseIn, 2)  );		seq.addChild(step) ;		seq.addChild(pause) ;	}	seq.start() ;}