function modulewindow ( module)	{
	a=window.open( module,'modulewin','width=760,Height=450');
	a.focus();
	return false;
}

function highlight_menu()	{
	var curLocation = document.location;
	var DocLinks = document.getElementsByTagName('a');
	for (var i = 0; i < DocLinks.length; i++)	{
		if (DocLinks[i].href == curLocation  )	{
			if (DocLinks[i].parentNode.parentNode.parentNode.className == 'leftmenu')	{
//				alert (DocLinks[i].href);
				DocLinks[i].id = 'cur_page';
//				alert (DocLinks[i].href + ' - ' + DocLinks[i].id);
			}
		}
	}
}

/////////////////////////////////////////////////////////
// Functions to highlight section of document when linked
/////////////////////////////////////////////////////////


var id_list = new Array();
/* Adapted from http://www.codeave.com/javascript/code.asp?u_log=7046 */


// Function to highlight single section of file 
function highlight_block(id){
//	alert('highlight_block('+id+')');
	//loop over id list and turn off existing highlights
	for (var i = 0; i < id_list.length; i++) {
		var referenced_block = document.getElementById(id_list[i]);
			if(referenced_block) {
				referenced_block.className=referenced_block.className.replace(new RegExp(" current\\b"), "");
			}
	}
	// change class to highlight current block
		var referenced_block = document.getElementById(id);
			if(referenced_block) {
				referenced_block.className+=" current";
			}
//		alert ('referenced_block.className:'+referenced_block.className);
}




// Loop over all links in #contentmenu and modify the self-referenced links to highlight referenced id
// The document must not use a # in links that do not refer to the current document

function initialize_content_links()	{
//	alert('initialize_content_links');
 if (document.getElementById('contentmenu')) {
  var ContentLinks = document.getElementById('contentmenu').getElementsByTagName('a');
	for (var i = 0; i < ContentLinks.length; i++)	{
		var is_input = ContentLinks[i].href.indexOf('#'); 
		if (is_input != -1)	{
//				alert(ContentLinks[i].href);
				var is_input = ContentLinks[i].href.indexOf('#'); 
				var link_id = ContentLinks[i].href.substring(is_input+1, ContentLinks[i].href.length);
				id_list = id_list.concat(link_id);
//				alert(link_id);
// Function attached to link that highlights referenced block in document
				ContentLinks[i].onclick = function()	{
					var is_input = this.href.indexOf('#'); 
					var link_id = this.href.substring(is_input+1, this.href.length);
					highlight_block(link_id);
				}
		}
	}
//	Highlight initial block
	if(document.location.hash) {
		var show_id = document.location.hash.substring(1, document.location.hash.length);
//		alert('highlight initial block: ' + show_id);
		highlight_block(show_id);
	}
  }
}

/////////////////////////////////
// Add Window onload events
if ( typeof window.addEventListener != "undefined" ) { //mozilla, not needed
    window.addEventListener( "load", initialize_content_links, false ); // required for opera
    window.addEventListener( "load", highlight_menu, false ); // required for opera
} else if ( typeof window.attachEvent != "undefined" ) { // modern ie
    window.attachEvent( "onload", initialize_content_links );
    window.attachEvent( "onload", highlight_menu );
}
else {
window.onload = function()	{ // other
	initialize_speaker_links();
	highlight_menu();
	}
}