<!--
/* Copyright 2007 by xNet Publishing.  All Rights Reserved.  The use of this code can only be done with the explicit written consent of xNet Publishing. */
function XExpand(expandID, fadeID, buttonID, showClass, hideClass, closedHeight, openedHeight, millisec) { 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 
	var height = (getElement(expandID).style.height) ? getElement(expandID).style.height : "0px";
	if (height == (openedHeight+"px")) {
		hideShow = "hide";
	} else if (height == (closedHeight+"px")) {
		hideShow = "show";
	} else {
		hideShow = false;
	}
    if(hideShow == "hide") {
		XExpand_changeHeight(closedHeight,expandID);
		if (fadeID.length > 0) {
		    XExpand_changeOpac("100", fadeID);
		}
        for(i = 100; i >= 0; i--) { 
			if ((fadeID.length > 0) && (i >= 50)) {
				o = (2*i-100);
				setTimeout("XExpand_changeOpac(" + o + ",'" + fadeID + "');",(timer * speed)); 
			}
            //h = parseInt(parseInt(closedHeight)+(parseInt(openedHeight)-parseInt(closedHeight))*i/100);
            //setTimeout("XExpand_changeHeight(" + h + ",'" + expandID + "');",(timer * speed)); 
            timer++; 
        }
		//setTimeout("getElement('"+buttonID+"').className = '"+showClass+"';", millisec);
		getElement(buttonID).className = showClass;
    } else if (hideShow == "show") {
		XExpand_changeHeight(openedHeight,expandID);
		if (fadeID.length > 0) {
			XExpand_changeOpac("0", fadeID);
		}
        for(i = 0; i <= 100; i++) {
			if ((fadeID.length > 0) && (i >= 50)) {
				o = (2*i-100);
				setTimeout("XExpand_changeOpac(" + o + ",'" + fadeID + "');",(timer * speed)); 
			}
			//h = parseInt(parseInt(closedHeight)+(parseInt(openedHeight)-parseInt(closedHeight))*i/100);
            //setTimeout("XExpand_changeHeight(" + h + ",'" + expandID + "');",(timer * speed)); 
            timer++; 
        }
		setTimeout("getElement('"+buttonID+"').className = '"+hideClass+"';", millisec);
		getElement(buttonID).className = hideClass;
    } 
} 
function XExpand_changeOpac(opacity, fadeID) { 
    fadeObj = getElement(fadeID); 
    fadeObj.style.opacity = (opacity / 100); 
    fadeObj.style.MozOpacity = (opacity / 100); 
    fadeObj.style.KhtmlOpacity = (opacity / 100); 
    fadeObj.style.filter = "alpha(opacity=" + opacity + ")"; 
} 
function XExpand_changeHeight(newheight, expandID) { 
    expandObj = getElement(expandID); 
    expandObj.style.height = newheight+"px";
}
-->