/* -----------------------------------------------------------------------------

	To add/remove links, change the listings in the arrays below

  - be careful to make sure each entry has the appropriate quote marks and commas:)

-----------------------------------------------------------------------------  */


var research_links = new Array('rlib_rp_main.html', 'Research Papers'
												,'rlib_rapporteurs_reports.html', 'Rapporteurs Reports'
												,'rlib_request_papers.html', 'Request Papers'
												,'rlib_links.html', 'Links'
												,'rlib_glossary.html', 'Glossary'
									);	// end research_links
						

	var people_links = new Array('http://ksghome.harvard.edu/~whogan/', 'William Hogan'
												,'brown.html', 'Ashley Brown'
												,'hepg_staff.html', 'HEPG Staff'
									) // end people_links
/* -----------------------------------------------------------------------------
end: link arrays
-----------------------------------------------------------------------------  */	

	
	/* -----------------------------------------------------------------------------
			Build the tables for each drop down section
	-----------------------------------------------------------------------------  */	
	function get_menu_div_links(links_array){
	
		var links_fmt = '<div style="border: 1px solid #b30007;width:120px;"><table width="120" cellpadding="0" cellspacing="0">';
		links_fmt += '<tr><!--start links for dropdowns --><td bgcolor="#FFFFFF">';

		var num_rows = (links_array.length) /2;
		//alert(num_rows);
		for(var idx=0; idx < num_rows; idx++){
			var lnk = links_array[idx*2];
			var label = links_array[(idx*2)+1];
			if (idx == (num_rows-1)){
				links_fmt += '<div class="dropdown_pad_noline"><a href="' + lnk + '" class="dropdowntext">' + label + '</a></div>';
			}else{
				links_fmt += '<div class="dropdown_pad"><a href="' + lnk + '" class="dropdowntext">' + label + '</a></div>';			
			}
		}	
		links_fmt += '</td></tr><!--end links for dropdowns --></table></div>';

		return links_fmt;
		
	}	// end get_menu_div_links

	/* -----------------------------------------------------------------------------
		 hard-coded div tags for the research section
	-----------------------------------------------------------------------------  */	
	var research_lib_div = '<!--start Research Library drop-down Menu-->';
	research_lib_div += '<div id="researchlib" style="position:absolute; left:151px; top:136px; width:120px; z-index:12; background-color: #FFFFFF; visibility: hidden;" onMouseOver="MM_showHideLayers(\'researchlib\',\'\',\'show\')" onMouseOut="MM_showHideLayers(\'researchlib\',\'\',\'hide\')">';
	research_lib_div += get_menu_div_links(research_links);
	research_lib_div += '</div><!--end Research Library drop-down Menu-->';
    
   	/* -----------------------------------------------------------------------------
		 hard-coded div tags for the people section
	-----------------------------------------------------------------------------  */	
    var people_div = '<!--start People drop-down Menu--><div id="people" style="position:absolute; left:262px; top:136px; width:120px; z-index:12; background-color: #FFFFFF; visibility: hidden; "onMouseOver="MM_showHideLayers(\'people\',\'\',\'show\')" onMouseOut="MM_showHideLayers(\'people\',\'\',\'hide\')">'
	people_div += get_menu_div_links(people_links);
	people_div += '</div><!--end People drop-down Menu-->';
    
    
   	/* -----------------------------------------------------------------------------
		 Dreamweaver functions to show/hide menus
	-----------------------------------------------------------------------------  */	
    
    function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
   // alert(people_div);

    
   	/* -----------------------------------------------------------------------------
			 Javascript for popup window
	-----------------------------------------------------------------------------  */	
	
   // start: javascript for pop-up window
function MM_openBrWindow(theURL,winName) { //v2.0
params='scrollbars=yes,resizable=yes,width=640,height=659';
  window.open(theURL,winName, params);
}
// end: javascript for pop-up window