function getObjectRef(n, d) {

  //based off MM_findObj v4.01
  //n: String
  //d: Document (for netscape4 recursion)

  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=getObjectRef(n,d.layers[i].document);
	
  if(!x && d.getElementById) 
  	x=d.getElementById(n); 
	
  return x;
}

function dump(obj, area) {
    strMessage = "";
    for(a in obj)
        if(typeof(area) == "undefined")
            strMessage += a + ': ' + obj[a] + '\n';
        else
            strMessage += '<b>' + a + '</b>' + ': ' + obj[a] + '<br>';
    if(typeof(area) != "undefined"){
        aobj = getObjectRef(area);
        aobj.innerHTML = strMessage;
    } else
        alert(strMessage);
}

function highlight(area) {
    obj = getObjectRef(area).style;
    obj.backgroundColor = highlightColor;
    obj.fontWeight = "bold";
}

function unhighlight(area) {
    obj = getObjectRef(area).style;
    obj.backgroundColor = "";
    obj.fontWeight = "normal";
}

function printSection() {

    if(section == 1) 
        parent.frames["content"].location = entireURL.replace("Content","Print");
    else 
        parent.frames["content"].location = getObjectRef("section" + section).href.replace("Content","Print");

}

function changeSection(newSection) {

    // highlight.
    if(newSection != 1) highlight("lsection" + newSection);
    if(section != 1) unhighlight("lsection" + section);
    
    obj = getObjectRef("prevLink").style;
    if(newSection > 2) 
        obj.display = "";
    else
        obj.display = "none";
    
    obj = getObjectRef("nextLink").style;
    if(newSection < totalSections && newSection != 1) 
        obj.display = "";
    else
        obj.display = "none";
    
    section = newSection;
    
    // redirect frame
    if(section == 1) 
        parent.frames["content"].location = entireURL;
    else 
        parent.frames["content"].location = getObjectRef("section" + section).href;

}
