var frontpage_spot_before_icon = "<table cellspacing=\"0\" cellpadding=\"0\"  style=\"border: 1px solid #c3c09e;\" height=\"153\" width=\"166\"  class=\"spotTable\"><tr><td valign=\"top\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"5\"></td><td><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td height=\"6\"></td></tr><tr><td height=\"14\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><img src=\"";
var frontpage_spot_before_title = "\" width=\"14\" height=\"14\"></td><td width=\"9\"></td><td><span class=\"spotHeader\">";
var frontpage_spot_before_content = "</span></td></tr></table></td></tr><tr><td height=\"2\"></td></tr><tr><td Height=\"1\"><img src=\"images/bg/iti_spot_line.gif\" height=\"1\" width=\"159\"></td></tr><tr><td height=\"6\"></td></tr>";
var frontpage_spot_content_table = "<tr><td><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"24\"></td><td height=\"100\" valign=\"top\"><span class=\"spotText\">";
var frontpage_spot_before_link = "</span><br>";
var frontpage_spot_after_link = "</td><td width=\"5\"></td></tr></table></td></tr>";
var frontpage_spot_finish = "<tr><td></td></tr></table></td></tr></table></td></tr></table>";
var right_spot_before_icon = "<table cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"260\" bgcolor=\"#FFFFFF\" valign=\"top\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"4\"></td><td><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td height=\"6\"></td></tr><tr><td height=\"14\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><img src=\"";
var right_spot_before_title = "\" width=\"14\" height=\"14\"></td><td width=\"9\"></td><td><span class=\"spotHeader\">";
var right_spot_before_content = "</span></td></tr></table></td></tr><tr><td height=\"2\"></td></tr><tr><td><img src=\"images/bg/iti_spot_line.gif\" width=\"256\" height=\"1\"></td></tr>";
var right_spot_spacer_row = "<tr><td height=\"6\"></td></tr>";
var right_spot_finish = "</table></td></tr></table></td></tr><tr><td><img src=\"images/bg/iti_spot_line.gif\" height=\"5\"></td></tr></table>";
function getSpotHTML(type, title, icon, link_text, link_url, content) {
	var html = "";
	if (type == 1) {
		// frontpage, small spot
		html = frontpage_spot_before_icon + icon + frontpage_spot_before_title + title + frontpage_spot_before_content + frontpage_spot_content_table + content;
		if (null != link_text && null != link_url) {
			html += "<br><a href=\"" + link_url + "\" class=\"spotLink\">" + link_text + "</a>" + frontpage_spot_after_link;
		}
		html += frontpage_spot_finish;
	} else if (type == 2) {
		html = right_spot_before_icon + icon + right_spot_before_title + title + right_spot_before_content + right_spot_spacer_row + content + right_spot_finish;
	} else {
		html = right_spot_before_icon + icon + right_spot_before_title + title + right_spot_before_content + content + right_spot_finish;
	}
	return html;
}
function noDocumentsFound(name) {
	var view = document.getElementById('$$ViewBody_EmptyView');
	var no_documents = true;
	if (view.style.visibility == 'hidden') {
		no_documents = false;
	}
	if (no_documents == true) {
		if (name == "htmlAllReferences") {
			view.innerHTML = "No references found...";
		}
	}
}
function displayPrinterFriendly(url) {
	window.open(url, "webcm_printer_friendly", "height=300,width=600,resizable=yes,scrollbars=yes");
}
function displayEmailFriend(url) {
	window.open(url, "webcm_email_friend", "height=300,width=450,resizable=no,scrollbars=no");
}
function displaySitemapEntry(primary_menuitem, secondary_menuitems, menuitem_structure) {
	document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"150\"><tr><td width=\"5\"></td><td valign=\"top\"><span class=\"spotHeader\" style=\"color: #76ADC0\">");
	document.write(primary_menuitem);
	document.write("</span></td></tr><tr><td valign=\"top\" colspan=\"2\"><img src=\"blank_space.gif\" height=\"4\"></td></tr><tr><td valign=\"top\" bgcolor=\"#76ADC0\" colspan=\"2\"><img src=\"blank_space.gif\" height=\"1\"></td></tr><tr><td valign=\"top\" colspan=\"2\"><img src=\"blank_space.gif\" height=\"4\"></td></tr><tr><td width=\"5\"></td><td valign=\"top\">");
	document.write(secondary_menuitems);
	document.write("</td></tr></table>");
}
function selectMenuItem(key) {
	try {
		// see if we can find the object on the page
		var obj = document.getElementById(key + "_LINK");
		if (obj) {
			// change the CSS class of item
			obj.className = obj.className + "_active";
			// expand the menu
			showMenuItems(key);
		}
	} catch (exception) {
		window.status = "Error in routine 'selectMenuItem': " + exception.message;
	}
}
function showPrimaryMenu() {
	try {
		for (var i=0; i<webcm_sitemap.length; i++) {
			var m = webcm_sitemap[i];
			var m_html = '<a href="' + m.getURL() + '" class="primarymenulink" id="';
			m_html += m.getKey() + '_LINK">';
			m_html += m.getName() + '</a>';
			document.write(m_html);
		}
	} catch (exception) {
	}
}
function showSecondaryMenu(key_arg, use_cookies) {
	try {
		var function_name = null;
		var curdoc = new CurrentDocument(key_arg);
		curdoc.getMenuItemTitle();
		var keys = new Array();
		var value = "";
		while ( null != (value = curdoc.backtrackHierarchy()) ) {
			keys[keys.length] = value;
		}
		// get the main menu function
		function_name = keys[keys.length - 1];
		
		// run the main secondary menu function
		try {
			eval("x" + function_name + "()");
		} catch (exception) {
		}
		// expand menu if applicable
		for (var i=0; i<keys.length; i++) {
			selectMenuItem(keys[i]);
		}
	} catch (exception) {
		window.status = "Error in routine 'showSecondaryMenu': " + exception.message;
	}
}
