function LayerMenu(x,y,width,numBlocks,name,closeDelay) {
	this.name = (name!=null)? name : "layerMenu"
	this.x = x
	this.y = y
	this.w = width
	this.numBlocks = numBlocks
	this.closeDelay = (closeDelay!=null)? closeDelay : 250
	this.bgColor = '#ffffff'
	this.menuTimer
	this.xMin = 0
	this.yMin = 0
	this.xCenterOffSet = 0
	this.yCenterOffSet = 0
	this.obj = this.name + "Object"
	eval(this.obj + "=this")
	this.buildStyleSheets = dynamicallyCreateStyleSheets
	this.activate = MenuActivate
	this.getXpos = getXposition
	this.getYpos = getYposition
	this.showHoverColor = showHoverState
	this.hideHoverColor = hideHoverState
	this.showLayer = showLinkLayers
	this.hideLayer = hideLinkLayers
	this.timeMenuClose = setTimeToClose
	this.clearTimeMenuClose = clearTimeToClose
	this.positionLayers = positionLayers
}

function MenuActivate() {
	// Create blocks Array
	this.blocks = new Array()
	// Initialize totalHeightOfLayers To 0
	totalHeightOfLayers = 0
	
	for (var i=0;i<this.numBlocks;i++) {
		this.blocks[i] = new Object()
		this.blocks[i].open = false
		
		// Create New Dynlayer Object For Each layerMenuLink
		this.blocks[i].link = new DynLayer(this.name+"Link"+i)
		// Get Height Of Each layerMenuLink
		this.blocks[i].linkHeight = this.blocks[i].link.getContentHeight()
		// Calculate Total Height Of All Links
		totalHeightOfLayers += this.blocks[i].linkHeight
		// Calculate The Postion For Each layerMenuLink
		if (i == 0) {
			this.blocks[i].nextLink = this.y
		} else {
			this.blocks[i].nextLink = this.blocks[i-1].nextLink + this.blocks[i-1].linkHeight
		} // End If
		// Move Each layerMenuLink And layerMenuLinkContent Into Position
		if (i == 0) {
			this.blocks[i].link.moveTo(this.x,this.y)
		} else {
			this.blocks[i].link.moveTo(this.x,this.blocks[i].nextLink)
		} // End If
		
	} // End For Loop
	// Add totalHeightOfLayers To layerMenuBuffer To Deal With IE On Mac Problems
	// Commented out on 5/11/04
	//if (is.ie) document.all.layerMenuBuffer.style.height = totalHeightOfLayers

} // End MenuActivate

function dynamicallyCreateStyleSheets() {
	// Initialize Style Sheets
	this.css=""
	
	for (var i=0;i<this.numBlocks;i++) {
		// Create Style Sheets For Div Tags
		this.css += css(this.name+"Link"+i,null,null,this.w)
		this.css += css(this.name+"LinkContent"+i,null,null,this.w)
		//alert(this.css)
	} // End For
} // End dynamicallyCreateStyleSheets

function showHoverState(i) {
	this.blocks[i].link.css.backgroundColor = "#14BDC8";
} // END showHoverState

function hideHoverState(i) {
	this.blocks[i].link.css.backgroundColor = "#FFFF99";
} // END hideHoverState

function showLinkLayers() {
	for (var i=0;i<this.numBlocks;i++) {
		// Show Each layerMenuLink After They Are Moved Into Place
		this.blocks[i].link.show()
	} // END FOR
} // END showLinkLayers

function hideLinkLayers() {
	for (var i=0;i<this.numBlocks;i++) {
		// Hide Each layerMenuLink
		this.blocks[i].link.hide()	
	} // END FOR
} // END hideLinkLayers
	
function positionLayers() {
	for (var i=0;i<this.numBlocks;i++) {
		// Hide Each layerMenuLink
		if (is.ns) {
			xpos = (window.innerWidth-16)/2 + this.xCenterOffSet;
		} else {
			xpos = (document.body.offsetWidth-20)/2 + this.xCenterOffSet;
		} // END IF
		
		if (xpos < this.xMin) {
		// Stops layers from moving off the screen
			xpos = this.xMin
		} // END IF
		
		this.blocks[i].link.moveTo(xpos,this.blocks[i].link.y);	
		
	} // END FOR
} // END moveLayersOffCenter

function setTimeToClose() {
	this.menuTimer = setTimeout(this.obj+".hideLayer()", this.closeDelay);
} // setTimeToClose

function clearTimeToClose() {
	clearTimeout(this.menuTimer);
} // clearTimeToClose

function getXposition(i) {
	return this.blocks[i].link.x;
} // END getXposition

function getYposition(i) {
	return this.blocks[i].link.y;
} // END getYposition
