/* Supplemental functions and menu definitions for use with map_menu.js and Harvard Map site */
var home_url = "http://upo-srv1.harvard.edu/maps/mapserver/"

function mmLoadMenus() {
  if (window.map_menu_1) return;
  //args for Menu: (label, mw, mh, fnt, fs, fclr, fhclr, bg, bgh, halgn, valgn, pad, space, to, sx, sy, srel, opq, vert, idt, aw, ah)
  window.map_menu_1 = new Menu("jump",200,18,"Helvetica",12,"#9e1c20","#FFFFFF","#e70000","#9e1c20","left","middle",0,0,500,-5,7,true,false,true,5,true,true);
   map_menu_1.addMenuItem("Harvard Yard","location='javascript:zoomToCoords(759885,2961755,7)'");
map_menu_1.addMenuItem("Longwood Medical Area","location='javascript:zoomToCoords(763320,2947850,7)'");
 map_menu_1.addMenuItem("The Quad","location='javascript:zoomToCoords(757600,2964350,7)'");
 map_menu_1.addMenuItem("------------------------","location='#'");
   map_menu_1.addMenuItem("Business School","location='javascript:zoomToCoords(758310,2958770,7)'");
 map_menu_1.addMenuItem("Divinity School","location='javascript:zoomToCoords(760740,2963720,7)'");
 map_menu_1.addMenuItem("Kennedy School","location='javascript:zoomToCoords(758295,2960590,7)'");
 map_menu_1.addMenuItem("Law School","location='javascript:zoomToCoords(759150,2963000,7)'");
 map_menu_1.addMenuItem("Medical School","location='javascript:zoomToCoords(763320,2947850,7)'");
 map_menu_1.addMenuItem("School of Dental Medicine","location='javascript:zoomToCoords(763780,2947800,7)'");
 map_menu_1.addMenuItem("School of Design","location='javascript:zoomToCoords(760500,2962240,7)'");
 map_menu_1.addMenuItem("School of Education","location='javascript:zoomToCoords(758250,2962000,7)'");
 map_menu_1.addMenuItem("School of Eng &amp; Appl Sciences","location='javascript:zoomToCoords(759620,2963080,7)'");
 map_menu_1.addMenuItem("School of Public Health","location='javascript:zoomToCoords(763700,2947530,7)'");
   map_menu_1.fontWeight="bold";
   map_menu_1.hideOnMouseOut=true;
   map_menu_1.bgColor='#b9cfe5';
   map_menu_1.menuBorder=1;
   map_menu_1.menuLiteBgColor='#FFFFFF';
   map_menu_1.menuBorderBgColor='#777777';
   // put at end of all menu defs
   map_menu_1.writeMenus();  

} // mmLoadMenus()

function preload(list, path) {
	if (document.images) {
		var preloadImages = list.split(",");
		var images = new Array();
		for (i=0; i < preloadImages.length; i++) {
			if (preloadImages[i] != "") {
				images[i] = new Image();
				images[i].src = path + preloadImages[i]+ "_on.gif";
			}
		}
	}
} 
function map_swapImgRestore() { //v3.0
  var i,x,a=document.map_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function map_swapImage() { //v3.0
  var i,j=0,x,a=map_swapImage.arguments; document.map_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=map_findObj(a[i]))!=null){document.map_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function map_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.map_p) d.map_p=new Array();
    var i,j=d.map_p.length,a=map_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.map_p[j]=new Image; d.map_p[j++].src=a[i];}}
}

function map_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=map_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
