function CreateBookmark() { 
	title = document.title;   
	url = location.href;

	if (window.sidebar) { //Firefox Bookmark		
		window.sidebar.addPanel(title, url, "");
	} 
	else if (window.external) { //IE Favorite		
		window.external.AddFavorite(url, title); 
	}	
	else if (window.opera && window.print) { //Opera Hotlist		
		return true; 
	} 
}

function MakeBookmarkLink() {
	//check if is an older browser or browser with javascript disabled
	if (!document.getElementById || !document.createTextNode) return null;

	//find the element with ID=createBookmark
	//this could be modified to insert multiple links on a page if the
	//function had an input parameter (e.g. szInput), then the next line would be:
	//var m_element = document.getElementById(szInput);
	var m_element = document.getElementById('createBookmark');
	if (!m_element) return null;
	//alert('here");

	var m_linkText = "";
	var m_isSupported = true;

	if (window.sidebar) {  
		m_linkText = "Bookmark Page";
		m_isSupported = true;
	} 
	else if (window.external) {  
		m_linkText = "Add to Favorites";
		m_isSupported = true;
	} 
	else if (window.opera && window.print) {
		m_linkText = "Add Bookmark";
		m_isSupported = true;
	}
	else {
		m_linkText = "Press Ctrl-D (Cmd-D in Safari) to bookmark this page";
		m_isSupported = false;
	}

	if (m_isSupported) {
		var m_anchor = document.createElement('a');
		m_anchor.href = "javascript:CreateBookmark();";
	
		m_anchor.appendChild(document.createTextNode(m_linkText));

		m_element.appendChild(m_anchor);
	}
	else {
		var m_textnode = document.createTextNode(m_linkText);
		m_element.appendChild(m_textnode);
	}
}

function initMenu() {
	//store the current location
	this.loc = location.href;

	//grab the collection of <a> objects from the menu
	var m_menu = document.getElementById('vertmenu');
	var m_aArray = m_menu.getElementsByTagName('a');

	for (var i = 0; i < m_aArray.length; i++) {
		if (this.loc.indexOf(m_aArray[i].href, 0) != -1) {
			//matches the current location, make link active
			m_aArray[i].className = "activestate";
		}
	}
}

initMenu();