/*function showDesc(contentToShow) {		document.getElementById(".morelink").style.display = "none";    document.getElementById(".moredesc").style.display = "none";    document.getElementById(contentToShow).style.display = "inline";        return false;} function hideDesc() {showDesc(".morelink");}*/function findmeprevioussibling(node) {	if (!node || !node.previousSibling) // firstChild		return null;	if (node.previousSibling.nodeType == 1)		return node.previousSibling;	else		return findmeprevioussibling(node.previousSibling);};function findMyIndex(node,start){	if (!node || !node.previousSibling) // firstChild		return start;	if (node.previousSibling.nodeType == 1 && node.className.indexOf("fulldesclink")>=0)		return start+1;	else		return findMyIndex(node.previousSibling,start+1);	}// added new functions belowfunction addEvent(obj, evType, fn){  if (obj.addEventListener){    obj.addEventListener(evType, fn, false);    return true;  } else if (obj.attachEvent){   var r = obj.attachEvent("on"+evType, fn);    return r;  } else {    return false;  } }//addEvent(window, 'load', hideDesc);(function() {	var animationFrameDelay = 10;	var animationLength = 1000;		function $(id) {		return document.getElementById(id);	}		function $(className,callback){		if(className.indexOf(".")==0){			className=className.substring(1,className.length);		}		aElm=document.getElementsByTagName('*');		for(var i=0; i<aElm.length; i++) {			if(hasClass(aElm[i],className)) {				callback(aElm[i]);			}		}	}			function array_contains(array, val) {		for (var i = 0, len = array.length; i < len; i++) {			if (array[i] === val) {				return true;			}		}		return false;	};	function getEvent(evt) {		return evt ? evt : event;	}	function preventDefault(evt) {		evt = getEvent(evt);		if (evt.preventDefault) {			evt.preventDefault();		} else if (typeof evt.returnValue !== "undefined") {			evt.returnValue = false;		}	}		function getAncestorWithClass(node, tagName, cssClass) {		tagName = tagName.toLowerCase();		while (node && node.tagName) {			if (node.tagName.toLowerCase() == tagName && hasClass(node, cssClass)) {				return node;			}			node = node.parentNode;		}		return null;	}	function getDescendantsWithClass(node, tagName, cssClass) {		var els = node.getElementsByTagName(tagName);		var descendants = [];		for (var i = 0, len = els.length; i < len; i++) {			descendants[descendants.length] = els[i];		}		return descendants;	}	function addClass(el, cssClass) {		if (!hasClass(el, cssClass)) {			if (el.className) {				el.className += " " + cssClass;			} else {				el.className = cssClass;			}		}	}		function hasClass(el, cssClass) {		if (el.className) {			var classNames = el.className.split(" ");			return array_contains(classNames, cssClass);		}		return false;	}		function removeClass(el, cssClass) {		if (hasClass(el, cssClass)) {			// Rebuild the className property			var existingClasses = el.className.split(" ");			var newClasses = new Array();			for (var i = 0, len = existingClasses.length; i < len; i++) {				if (existingClasses[i] != cssClass) {					newClasses[newClasses.length] = existingClasses[i];				}			}			el.className = newClasses.join(" ");		}	}	/* ---------------------------------------------------------------------- */	var animationTimer = new Array();	var animations = [];	/**	 * Animation function is passed a number between 0 and 1 representing	 * how far through the allotted time the animation is. The function	 * must return a boolean that represents whether the animation is	 * complete	 */	function Animation(el, animationFunction, len) {		this.el=el;		this.animationFunction = animationFunction;		this.frameDelay = animationFrameDelay;		this.len = len;		this.framesShown = 0;		this.startTime = new Date();		this.finished = false;		this.cancelled = false;	}		Animation.prototype.cancel = function(el) {		if(el==this.el)	this.cancelled = true;	};		Animation.doFrame = function() {		for (var i = 0, len = animations.length; i < len; i++) {			if (!animations[i].cancelled) {				var currentTime = new Date();				var elapsedMilliseconds = currentTime.getTime() - animations[i].startTime.getTime();				var animationProgress = Math.min(1, elapsedMilliseconds / animations[i].len);				animations[i].finished = animations[i].animationFunction(animationProgress);				animations[i].framesShown++;			}		}		// Reassemble the animations array, keeping only those that aren't finished		var tempAnimations = [];		for (i = 0, len = animations.length; i < len; i++) {			if (!animations[i].finished && !animations[i].cancelled) {				tempAnimations[tempAnimations.length] = animations[i];			}		}		animations = tempAnimations;		// Check if all animations are done and stop the timer if so		if (animations.length == 0) {			clearInterval(animationTimer[findMyIndex(this.el,0)]);			animationTimer[findMyIndex(this.el,0)] = null;		}	};		function createAnimation(el,animationFunction, len) {		var animation = new Animation(el,animationFunction, len);		animations[animations.length] = animation;		// Start the animation timer if none are going		if (animations.length == 1) {			// Do a frame immediately			Animation.doFrame();					// Set the timer			animationTimer[findMyIndex(el,0)] = setInterval(Animation.doFrame, animationFrameDelay);		}		return animation;	}		/* ---------------------------------------------------------------------- */	var contentAnimation = new Array();		function appearContent(contentNode) {		var linkNode = contentNode;		contentNode = findmeprevioussibling(contentNode.parentNode);		if (contentAnimation[findMyIndex(linkNode,0)]) {			contentAnimation[findMyIndex(linkNode,0)].cancel(linkNode);		}		var contentInner = getDescendantsWithClass(contentNode, "div", "curtaininner")[0];		contentNode.style.display = "block";		contentInner.style.display = "block";		var expandedHeight = contentNode.offsetHeight;		var height = 0;		var animationDistance = expandedHeight;		var expand = function(t) {			height = Math.floor(animationDistance * t * (2 - t));			contentNode.style.height = "" + height + "px";			contentInner.style.marginTop = "" + (height - expandedHeight) + "px";					if (height < expandedHeight) {				return false;			} else {				contentAnimation[findMyIndex(linkNode,0)] = null;				contentNode.style.height = "auto";				return true;			}		};		contentAnimation[findMyIndex(linkNode,0)] = createAnimation(linkNode,expand, animationLength);		linkNode.style.display="none";		linkNode.nextSibling.style.display="inline";	}	function disappearContent(contentNode) {		var linkNode = contentNode;		contentNode = findmeprevioussibling(contentNode.parentNode);				if (contentAnimation[findMyIndex(linkNode,0)]) {			contentAnimation[findMyIndex(linkNode,0)].cancel(linkNode);		}		var contentInner  = getDescendantsWithClass(contentNode, "div", "curtaininner")[0];;		if(contentInner){			var expandedHeight = contentNode.offsetHeight;			var height = 0;			var animationDistance = expandedHeight;			var expand = function(t) {				height = Math.floor(animationDistance * (1 - t) * (1 - t));				contentNode.style.height = "" + height + "px";				contentInner.style.marginTop = "" + (height - expandedHeight) + "px";							if (height > 0) {					return false;				} else {					contentAnimation[findMyIndex(linkNode,0)] = null;					contentNode.style.display = "none";					contentNode.style.height = "auto";					contentInner.style.marginTop = "0";										linkNode.style.display="none";					findmeprevioussibling(linkNode).style.display="inline";					return true;				}			};			contentAnimation[findMyIndex(linkNode,0)] = createAnimation(linkNode, expand, animationLength);		}	}		function contentExpanded(el){		return findmeprevioussibling(el.parentNode).style.display!="none";	}		function toggleContent(el) {		if (contentExpanded(el)) {			disappearContent(el);		} else {			appearContent(el);		}	}		function moreLinkClickHandler(evt) {		var targ;		if (evt.target) targ = evt.target;		else if (evt.srcElement) targ = evt.srcElement;		toggleContent(targ);		preventDefault(evt);	}		var hide=function(el){		el.style.display="none";	};	var show=function(el){		el.style.display="inline";	};	var addClickHandler=function(el){		addEvent(el, "click", moreLinkClickHandler);	};	function windowLoadHandler() {		// Set up click event on 'More' link		$(".fulldesclink",addClickHandler);		$(".moredesc",addClickHandler);		$(".morelink",show);		$(".moredesc",hide);	}	addEvent(window, "load", windowLoadHandler);})();
