
// This is used to control the Magic-Y menu
// Toggle Layer style for left property
function togLyr (el, status) { 
    var yale = (status == 1) ? "0" : "-999em";
    document.getElementById(el).style.left = yale;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// TOC
function toc(){   
	if(document.getElementById){      
	var nodecol=document.getElementById('main').childNodes;      
	var nodelng=nodecol.length;      
	var nodecnt='';      
	var toc='';      
	var nest=tocndx=0;      
	for(var i=1;i<nodelng;i++){         
		if(nodecol[i].tagName=='H3'){
			nest=parseInt(nodecol[i].tagName.substr(1)); 
			nodecnt=nodecol[i].innerHTML;
			for(var j=1;j<=nest;j++) toc+='<ul>';
			toc+='\n<li><a href="#jump'+i+'">'+ nodecnt.replace(/<\/?a[^>]*>/gi,"")+'</a></li>\n';
			for(var j=1;j<=nest;j++)  toc+='</ul>';
			nodecol[i].innerHTML= '<a name="jump'+i+'"></a>'+nodecnt;
			tocndx++;}}      if(tocndx>1){         document.getElementById('toc').innerHTML= '<div id="toccnt">\n'+toc+'\n</div>';
			document.getElementById('toc').className='mmhide_toc';}}}


// Open link in new sized window
// Example link for popFixed
/* <a href="http://www.yale.edu/" target="new" onclick="popFixed('');">Fixed Size Focused Page</a> */

function popFixed(file) {
        popup =
window.open(file,'new','width=900,height=600,menubar,toolbar,location,status,resizable,scrollbars,screenX=30,screenY=30');
        if (document.images) {popup.focus();}
}
