//
// Confidential and Proprietary for Stellent, Inc.
//
// This computer program contains valuable, confidential, and
// proprietary information.  Disclosure, use, or reproduction
// without the written authorization of Stellent is prohibited.
// This unpublished work by Stellent is protected by the laws
// of the United States and other countries.  If publication
// of this computer program should occur, the following notice
// shall apply:
//
// Copyright (c) 2006-2006 Stellent, Inc.
// All rights reserved.
//
// $Id: classic_layout.js 60937 2008-02-14 00:25:41Z swhite $
//


//////////////////////////////////////////////////////////////////
// Template: CLASSIC_LAYOUT_JS
// Class: javascript:layout:Classic
// Location: images/stellent/layout.js
//////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////
// WARNING: This file is generated by a Content Server template 
// and is then published to the weblayout directory. Any 
// changes made to the weblayout copy will be automatically 
// overwritten by the Content Server.
//////////////////////////////////////////////////////////////////

var src_Space = httpSkinRoot + "tree_space.gif";

var arrowRightImageWidth = "11";
var arrowRightImageHeight = "11";
var arrowDownImageWidth = "11";
var arrowDownImageHeight = "11";

var menuA_arrowDownImage = httpSkinRoot + "menuA_ArrowDown.gif";
var menuA_arrowDownOverImage = httpSkinRoot + "menuA_ArrowDown_over.gif";
var menuA_arrowRightImage = httpSkinRoot + "menuA_ArrowRight.gif";
var menuA_arrowRightOverImage = httpSkinRoot + "menuA_ArrowRight_over.gif";

/* Controls implementation details. */
var itemOnClickEventDoesNothing = true;

function layoutInitialize()
{
	loadNavshell();
}

function generateNavigation()
{
}

function buildTopLevelItems(idList, XMLRoot, navBuilder)
{
	var nodeCopy;
	for (var i=0; i<idList.length; i++)
	{
		if (navBuilder.getNodeById(idList[i]))
		{
			var node = navBuilder.getNodeById(idList[i]);
			if (its.ie || its.safari)
			{
				nodeCopy = node.cloneNode(true);
			}
			else
			{
				nodeCopy = XMLRoot.ownerDocument.importNode(node, true);
			}
			XMLRoot.appendChild(nodeCopy);
		}
	}
}

/* pageHeadingMenu DISPLAY CODE ***************************************************************************/
/***************************************************************************************************/

function pageHeadingMenu_MenuItem_OpeningHtml(node, nodeLocation)
{
	var menuId;
	if (typeof(this.id) != "undefined" && this.id.length > 0)
	{
		menuId = this.id + "_" + nodeLocation;
	}
	else
	{
		menuId = "pageHeadingMenu_" + nodeLocation;
	}

	if (node.tagName == "navtree") // Top-level horizontal menu listing
	{
		this.htmlString +=
			'<table border="0" cellpadding="0" cellspacing="0">\n' +
			'<tr>\n';
	}
	else 
	{
		prefix = "Sub";
		if (node.parentNode.tagName == "navtree") // First-tier child menus
			prefix = "Top";
		
		this.htmlString +=
			'<div id="' + menuId + '_menu" class="menuA_'+prefix+'ChildCollectionContainer" style="display:none">\n' +
			'	<div class="menuA_'+prefix+'ChildCollectionOutline">\n' +
			'		<table class="menuA_'+prefix+'ChildListTable" border="0" cellpadding="0" cellspacing="0">\n' +
			'		<tr><td><img src="' + src_Space + '" width="1" height="2"></td></tr>\n';
	}
}


function pageHeadingMenu_MenuItem_CoreHtml(node, nodeLocation)
{
	var labelString;
	var linkTarget = node.getAttribute("target");
	var label = node.getAttribute("label");
	var url = node.getAttribute("url");
	var menuId;
	if (typeof(this.id) != "undefined" && this.id.length > 0)
	{
		menuId = this.id + "_" + nodeLocation;
	}
	else
	{
		menuId = "pageHeadingMenu_" + nodeLocation;
	}

	if (node.parentNode.tagName == "navtree") // Top-level menu items
	{
		if (node.tagName == "item")
		{
			/* Generate target attribute code for the <a> tag if a target attribute exists in the XML. */
			if (linkTarget == null || linkTarget == "")
				linkTarget = "_self";

			this.htmlString +=
				'<td id="' + menuId + '" class="headMenu_TopLinkItem" nowrap onclick="linkItem_onclick(event, this)" onmouseover="linkItem_mouseover(this)" onmouseout="linkItem_mouseout(this)">\n' +
				'	<a class="menuA_TopLinkText" href="'+url+'" target="'+linkTarget+'">' + label + '</a>\n' +
				'</td>\n';
		}

		else if (node.tagName == "collection")
		{
			this.htmlString +=
				'<td id="' + menuId + '" onclick="topCollectionItem_onclick(event, this, \''+menuId+'_menu\', \'vertical\')" onmouseover="topCollectionItem_mouseover(event, this)" onmouseout="topCollectionItem_mouseout(event, this)">\n' +
				'	<table id="' + menuId + '_itemTable" class="headMenu_TopCollectionItemTable" border="0" cellpadding="0" cellspacing="0">\n' +
				'		<tr>\n' +
				'			<td id="' + menuId + '_arrowCell" class="menuA_TopCollectionItemArrowCell">\n' +
				'				<img id="' + menuId + '_arrowImg" src="' + menuA_arrowDownImage + '" width="' + arrowDownImageWidth + '" height="' + arrowDownImageHeight + '"></td>\n' +
				'			<td id="' + menuId + '_labelCell" class="menuA_TopCollectionItem" nowrap>\n' +
				'				' + label + '</td>\n' +
				'		</tr>\n' +
				'	</table>\n';
		}
	}
	else // Child menu items
	{
		if (node.tagName == "item")
		{
			/* Generate target attribute code for the <a> tag if a target attribute exists in the XML. */
			if (linkTarget == null || linkTarget == "")
				linkTarget = "_self";

			this.htmlString +=
				'<tr>\n' +
				'	<td id="' + menuId + '" class="menuA_ChildLinkItem" nowrap onclick="linkItem_onclick(event, this)" onmouseover="linkItem_mouseover(this)" onmouseout="linkItem_mouseout(this)">\n' +
				'	<a class="menuA_ChildLinkText" href="'+url+'" target="'+linkTarget+'">' + label + '</a>\n' +
				'	</td>\n' +
				'</tr>\n';
		}

		else if (node.tagName == "collection")
		{
			this.htmlString +=
				'<tr>\n' +
				'	<td id="' + menuId + '" onclick="childCollectionItem_onclick(event, this, \''+menuId+'_menu\')" onmouseover="childCollectionItem_mouseover(event, this)" onmouseout="childCollectionItem_mouseout(event, this)">\n' +
				'		<table id="' + menuId + '_itemTable" class="menuA_ChildCollectionItemTable" style="width:100%" border="0" cellpadding="0" cellspacing="0">\n' +
				'			<tr>\n' +
				'				<td id="' + menuId + '_labelCell" class="menuA_ChildCollectionItem" nowrap>\n' +
				'					' + label + '</td>\n' +
				'				<td id="' + menuId + '_arrowCell" class="menuA_ChildCollectionItemArrowCell">\n' +
				'					<img id="' + menuId + '_arrowImg" src="' + menuA_arrowRightImage + '" width="' + arrowRightImageWidth + '" height="' + arrowRightImageHeight + '"></td>\n' +
				'			</tr>\n' +
				'		</table>\n';
		}
	}
}


function pageHeadingMenu_MenuItem_ClosingHtml(node, nodeLocation)
{
	if (node.tagName == "navtree") // Top-level horizontal menu listing
	{
		this.htmlString +=
			'	</tr>\n' +
			'</table>\n';
	}

	else 
	{
		this.htmlString +=
			'				<tr>\n' +
			'					<td>\n' +
			'						<img src="' + src_Space + '" width="1" height="2"></td>\n' +
			'				</tr>\n' +
			'			</table>\n' +
			'		</div>\n' +
			'	 </div>\n' +
			'</td>\n'; // Closing tag for parent cell
		
		if (node.parentNode.tagName != "navtree")
			this.htmlString += '</tr>\n';
	}
}


function pageAdditionalMenu_MenuItem_OpeningHtml(node, nodeLocation)
{
	var menuId;
	if (typeof(this.id) != "undefined" && this.id.length > 0)
	{
		menuId = this.id + "_" + nodeLocation;
	}
	else
	{
		menuId = "pageAdditionalMenu_" + nodeLocation;
	}

	if (node.tagName == "navtree") // Top-level horizontal menu listing
	{
		this.htmlString +=
			'<table border="0" cellpadding="0" cellspacing="0">\n' +
			'<tr>\n';
	}
	else 
	{
		prefix = "Sub";
		if (node.parentNode.tagName == "navtree") // First-tier child menus
			prefix = "Top";
		
		this.htmlString +=
			'<div id="' + menuId + '_menu" class="menuA_'+prefix+'ChildCollectionContainer" style="display:none">\n' +
			'	<div class="menuA_'+prefix+'ChildCollectionOutline">\n' +
			'		<table class="menuA_'+prefix+'ChildListTable" border="0" cellpadding="0" cellspacing="0">\n' +
			'		<tr><td><img src="' + src_Space + '" width="1" height="2"></td></tr>\n';
	}
}


function pageAdditionalMenu_MenuItem_CoreHtml(node, nodeLocation)
{
	var labelString;
	var linkTarget = node.getAttribute("target");
	var label = node.getAttribute("label");
	var url = node.getAttribute("url");
	var menuId;
	if (typeof(this.id) != "undefined" && this.id.length > 0)
	{
		menuId = this.id + "_" + nodeLocation;
	}
	else
	{
		menuId = "pageAdditionalMenu_" + nodeLocation;
	}

	if (node.parentNode.tagName == "navtree") // Top-level menu items
	{
		if (node.tagName == "item")
		{
			/* Generate target attribute code for the <a> tag if a target attribute exists in the XML. */
			if (linkTarget == null || linkTarget == "")
				linkTarget = "_self";

			this.htmlString +=
				'<td id="' + menuId + '" class="listMenu_TopLinkItem" nowrap onclick="linkItem_onclick(event, this)" onmouseover="linkItem_mouseover(this)" onmouseout="linkItem_mouseout(this)">\n' +
				'	<a class="menuA_TopLinkText" href="'+url+'" target="'+linkTarget+'">' + label + '</a>\n' +
				'</td>\n';
		}

		else if (node.tagName == "collection")
		{
			this.htmlString +=
				'<td id="' + menuId + '" onclick="topCollectionItem_onclick(event, this, \''+menuId+'_menu\', \'vertical\')" onmouseover="topCollectionItem_mouseover(event, this)" onmouseout="topCollectionItem_mouseout(event, this)">\n' +
				'	<table id="' + menuId + '_itemTable" class="listMenu_TopCollectionItemTable" border="0" cellpadding="0" cellspacing="0">\n' +
				'		<tr>\n' +
				'			<td id="' + menuId + '_arrowCell" class="menuA_TopCollectionItemArrowCell">\n' +
				'				<img id="' + menuId + '_arrowImg" src="' + menuA_arrowDownImage + '" width="' + arrowDownImageWidth + '" height="' + arrowDownImageHeight + '"></td>\n' +
				'			<td id="' + menuId + '_labelCell" class="menuA_TopCollectionItem" nowrap>\n' +
				'				' + label + '</td>\n' +
				'		</tr>\n' +
				'	</table>\n';
		}
	}
	else // Child menu items
	{
		if (node.tagName == "item")
		{
			/* Generate target attribute code for the <a> tag if a target attribute exists in the XML. */
			if (linkTarget == null || linkTarget == "")
				linkTarget = "_self";

			this.htmlString +=
				'<tr>\n' +
				'	<td id="' + menuId + '" class="menuA_ChildLinkItem" nowrap onclick="linkItem_onclick(event, this)" onmouseover="linkItem_mouseover(this)" onmouseout="linkItem_mouseout(this)">\n' +
				'	<a class="menuA_ChildLinkText" href="'+url+'" target="'+linkTarget+'">' + label + '</a>\n' +
				'	</td>\n' +
				'</tr>\n';
		}

		else if (node.tagName == "collection")
		{
			this.htmlString +=
				'<tr>\n' +
				'	<td id="' + menuId + '" onclick="childCollectionItem_onclick(event, this, \''+menuId+'_menu\')" onmouseover="childCollectionItem_mouseover(event, this)" onmouseout="childCollectionItem_mouseout(event, this)">\n' +
				'		<table id="' + menuId + '_itemTable" class="menuA_ChildCollectionItemTable" style="width:100%" border="0" cellpadding="0" cellspacing="0">\n' +
				'			<tr>\n' +
				'				<td id="' + menuId + '_labelCell" class="menuA_ChildCollectionItem" nowrap>\n' +
				'					' + label + '</td>\n' +
				'				<td id="' + menuId + '_arrowCell" class="menuA_ChildCollectionItemArrowCell">\n' +
				'					<img id="' + menuId + '_arrowImg" src="' + menuA_arrowRightImage + '" width="' + arrowRightImageWidth + '" height="' + arrowRightImageHeight + '"></td>\n' +
				'			</tr>\n' +
				'		</table>\n';
		}
	}
}


function pageAdditionalMenu_MenuItem_ClosingHtml(node, nodeLocation)
{
	if (node.tagName == "navtree") // Top-level horizontal menu listing
	{
		this.htmlString +=
			'	</tr>\n' +
			'</table>\n';
	}

	else 
	{
		this.htmlString +=
			'				<tr>\n' +
			'					<td>\n' +
			'						<img src="' + src_Space + '" width="1" height="2"></td>\n' +
			'				</tr>\n' +
			'			</table>\n' +
			'		</div>\n' +
			'	 </div>\n' +
			'</td>\n'; // Closing tag for parent cell
		
		if (node.parentNode.tagName != "navtree")
			this.htmlString += '</tr>\n';
	}
}


/* Set global click event handler that's used to close menus when a user clicks anywhere
	outside of the menu objects (needed for Netscape only). */
document.onclick = resetMenus;



