function CDEShadow(pElementID, pColor, pDistance, pDegrees, pSteps, pStartOpacity, pEndOpacity) {
	if (!pElementID) return;
	var mElement = document.getElementById(pElementID);
	var mWidth = mElement.offsetWidth;
	var mHeight = mElement.offsetHeight;
	var mBackgroundImage = "";
	var mBackgroundColor = "";
	var mElementZIndex = 0;
	if (!mWidth) return;
	if (!mHeight) return;
	if (isNaN(pDistance)) return;
	if (isNaN(pDegrees)) return;
	if (isNaN(pSteps)) return;
	if (isNaN(pStartOpacity)) return;
	if (isNaN(pEndOpacity)) return;
	// check to see if there is a background image
	if (document.all) {
		if (mElement.currentStyle)
			var mBackgroundImage = mElement.currentStyle["backgroundImage"];
		else if (window.getComputedStyle)
			var mBackgroundImage = document.defaultView.getComputedStyle(mElement, null).getPropertyValue("backgroundImage");
	} else {
		if (mElement.currentStyle)
			var mBackgroundImage = mElement.currentStyle["background-image"];
		else if (window.getComputedStyle)
			var mBackgroundImage = document.defaultView.getComputedStyle(mElement, null).getPropertyValue("background-image");
	}
	// check to see if there is a background color
	if (document.all) {
		if (mElement.currentStyle)
			var mBackgroundColor = mElement.currentStyle["backgroundColor"];
		else if (window.getComputedStyle)
			var mBackgroundColor = document.defaultView.getComputedStyle(mElement, null).getPropertyValue("backgroundColor");
	} else {
		if (mElement.currentStyle)
			var mBackgroundColor = mElement.currentStyle["background-color"];
		else if (window.getComputedStyle)
			var mBackgroundColor = document.defaultView.getComputedStyle(mElement, null).getPropertyValue("background-color");
	}
	if (mBackgroundColor == "" || mBackgroundColor == "transparent") {
		if (mBackgroundImage == "" || mBackgroundImage == "none") {
			mElement.style.backgroundColor = "white";
		}
	}
	if (document.all) {
		if (mElement.currentStyle)
			mElementZIndex = mElement.currentStyle["zIndex"];
		else if (window.getComputedStyle)
			mElementZIndex = document.defaultView.getComputedStyle(mElement, null).getPropertyValue("zIndex");
	} else {
		if (mElement.currentStyle)
			mElementZIndex = mElement.currentStyle["z-index"];
		else if (window.getComputedStyle)
			mElementZIndex = document.defaultView.getComputedStyle(mElement, null).getPropertyValue("z-index");
	}
	var mHighest = Math.max(pStartOpacity, pEndOpacity);
	var mLowest = Math.min(pStartOpacity, pEndOpacity);
	var mOpacity = pStartOpacity;
	var opacityInterval = (mHighest - mLowest) / pSteps;
	var mPI = Math.PI;
	var mRadians = pDegrees * (mPI / 180);
	var startX = mElement.offsetLeft;
	var startY = mElement.offsetTop;
	var xStep = Math.round(Math.sin(mRadians));
	var yStep = Math.round(Math.cos(mRadians));
	var pDistanceX = pDistance;
	var pDistanceY = pDistance;
	if (pDegrees > 90 && pDegrees <= 180) {
		pDistanceY = -pDistanceY;
	}
	if (pDegrees > 180 && pDegrees <= 270) {
		pDistanceX = -pDistanceX;
		pDistanceY = -pDistanceY;
	}
	if (pDegrees > 270 && pDegrees <= 360) {
		pDistanceX = -pDistanceX;
	}
	var mLeft = startX + pDistanceX;
	var mTop = startY + pDistanceY;
	var mCounter = 0;
	var mZIndex = mElementZIndex - (pSteps + 10);
	this._aryShadowList = new Array();
	for (var i=pDistance; i< (pDistance + pSteps); i++) {
		var mUserAgent = navigator.userAgent.toLowerCase();
		if (mUserAgent.indexOf('mac') != -1 && mUserAgent.indexOf('firefox') != -1) {
			if (i == pDistance) {
				var oShadowDiv = document.createElement("div");
				oShadowDiv.style.position = "absolute";
				oShadowDiv.style.zIndex = mZIndex + i;
				mLeft = mLeft + xStep;
				mTop = mTop + yStep;
				oShadowDiv.style.left = mLeft + "px";
				oShadowDiv.style.top = mTop + "px";
				oShadowDiv.style.width = mWidth + "px";
				oShadowDiv.style.height = mHeight + "px";
				oShadowDiv.style.background = "url(/images/shadow.png) repeat-y top left";
				
				mElement.parentNode.insertBefore(oShadowDiv, mElement);
				if (mHighest == pStartOpacity) {
					mOpacity = mOpacity - opacityInterval;
				} else {
					mOpacity = mOpacity + opacityInterval;
				}
				this._aryShadowList.push(oShadowDiv);
				mCounter = mCounter + 1;
			}
		} else {
			var oShadowDiv = document.createElement("div");
			oShadowDiv.style.position = "absolute";
			oShadowDiv.style.zIndex = mZIndex + i;
			mLeft = mLeft + xStep;
			mTop = mTop + yStep;
			oShadowDiv.style.left = mLeft + "px";
			oShadowDiv.style.top = mTop + "px";
			oShadowDiv.style.width = mWidth + "px";
			oShadowDiv.style.height = mHeight + "px";
			oShadowDiv.style.backgroundColor = pColor;
			oShadowDiv.style.opacity = mOpacity / 100;
			oShadowDiv.style.filter = 'alpha(opacity=' + mOpacity + ')';
			
			mElement.parentNode.insertBefore(oShadowDiv, mElement);
			if (mHighest == pStartOpacity) {
				mOpacity = mOpacity - opacityInterval;
			} else {
				mOpacity = mOpacity + opacityInterval;
			}
			this._aryShadowList.push(oShadowDiv);
			mCounter = mCounter + 1;
		}
		
	}
	this._shadowsHostElement = mElement.parentNode;
	this._numShadows = pSteps;
}

CDEShadow.prototype.removeShadows = function() {
	for (var i=0; i<this._numShadows; i++) {
		if (this._aryShadowList[i]) {
			//document.getElementById(this._aryShadowList[i]).style.display = "none";
			this._shadowsHostElement.removeChild(this._aryShadowList[i]);
		}
	}
}

