function mmLoadMenus(dd_info, dd_bio, dd_directions, dd_catalog, dd_picture) {
	if (window.mm_menu_main) return;
	window.mm_menu_main = new Menu("root",96,16,"Arial, Helvetica, sans-serif",11,"#ffffff","#ffffff","#71a4d8","#999999","left","middle",3,0,100,-5,7,true,true,true,0,true,true);
	
	if (dd_info) {mm_menu_main.addMenuItem("Info&nbsp;Page","location='?addpage=info'");}
	if (dd_bio) {mm_menu_main.addMenuItem("Bio&nbsp;Page","location='?addpage=bio'");}
	if (dd_directions) {mm_menu_main.addMenuItem("Directions&nbsp;Page","location='?addpage=directions'");}
	if (dd_catalog) {mm_menu_main.addMenuItem("Catalog&nbsp;Page","location='?addpage=catalog'");}
	if (dd_picture) {mm_menu_main.addMenuItem("Picture&nbsp;Page","location='?addpage=picture'");}
	
	mm_menu_main.hideOnMouseOut=true;
	mm_menu_main.menuBorder=1;
	mm_menu_main.menuLiteBgColor='#ffffff';
	mm_menu_main.menuBorderBgColor='#71a4d8';
	mm_menu_main.bgColor='#ffffff';

	mm_menu_main.writeMenus();
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function getParent(el) {
     if (document.all)
         while (el.parentElement != null)
                if (el.tagName == 'TR') return el;
                else el = el.parentElement;
     else if (document.getElementById) {
         if (el.nodeType == 1 && el.tagName.toLowerCase() == 'tr') return el;
         else return getParent(el.parentNode);
   }
}

function setParentTR(e, CSSattr, CSSvalue, CSSvalue2) {
     var el = (e && e.srcElement) ? e.srcElement : (e && e.target) ? e.target : null;
     if (el) {
         var which = el.checked;
         var parentTR = getParent(el);
         parentTR.style[CSSattr] = (which) ? CSSvalue : CSSvalue2;
   }
}

function setBgColor(e, id, color1, color2) {
	var el = (e && e.srcElement) ? e.srcElement : (e && e.target) ? e.target : null;
	var which = el.checked;
	var color = (which) ? color1 : color2;

	
	if (document.layers)
		document[id].bgColor = color == 'transparent' ? null : color;
	else if (document.all)
		document.all[id].style.backgroundColor = color;
	else if (document.getElementById)
		document.getElementById(id).style.backgroundColor = color;
}

function openNewWin(url){
	window.open(url,'viewmem','width=1000,height=600,menubar=no,status=no,toolbar=no,resizable=yes,scrollbars=yes');
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function expandEditor(id, mode) {
    var height_change;
    var min_height = 66;
    
    if ( mode == 'expand' ) {
        height_change = 32;
    } else if ( mode == 'contract' )  {
        height_change = -32;
    }

    var element = document.getElementById( id );
    var element_height = document.getElementById( id + '_height' );

    if ( element && element_height ) {
        var new_height;
        if (element_height)
            new_height = parseInt(element_height.value) + height_change;
        else
            new_height = parseInt(element.style.height) + height_change;
        if ( new_height >= min_height ) {
            if (element_height)
                element_height.value = new_height;
            element.style.height = new_height + 'px';
        } else {
            if (element_height)
                element_height.value = min_height;
            element.style.height = min_height + 'px';
        }
    }
    
    return false;
}

function set_event (main, sub, myForm) {
	// if the form is not passed in, use the "hidden" form 
	if(!myForm) {
		myForm = document.hidden;
	} 
	myForm.MAIN_EVENT.value=main;
	myForm.SUB_EVENT.value=sub;
	myForm.submit();
}
