/* Supplemental functions and menu definitions for use with AI_menu.js and Allston Initiative site */
var home_url = "http://www.allston.harvard.edu/"
//var home_url = "http://localhost:8500/allston/"
function mmLoadMenus() {
  if (window.AI_menu_1) return;
  window.AI_menu_1 = new Menu("intro",130,18,"Helvetica",12,"#000000","#FFFFFF","#b9cfe5","#1d738e","left","middle",3,0,500,-5,7,true,false,true,5,true,true);
   AI_menu_1.addMenuItem("What&rsquo;s New","location='" + home_url + "news/whatsnew.htm'");
 // AI_menu_1.addMenuItem("President&rsquo;s Message","location='" + home_url + "news/pres_msg.htm'");
  AI_menu_1.addMenuItem("Press Clips","location='" + home_url + "news/news_clips.cfm'");
  AI_menu_1.addMenuItem("Science Project","location='"+ home_url + "projects/projects.htm#science'");
  //AI_menu_1.addMenuItem("HUAM Arts Center","location='"+ home_url + "projects/projects.htm#arts'");
  //AI_menu_1.addMenuItem("Maps","location='" + home_url + "maps/map_index.htm'");
   AI_menu_1.fontWeight="normal";
   AI_menu_1.hideOnMouseOut=true;
   AI_menu_1.bgColor='#b9cfe5';
   AI_menu_1.menuBorder=1;
   AI_menu_1.menuLiteBgColor='#FFFFFF';
   AI_menu_1.menuBorderBgColor='#777777';
   
 
  window.AI_menu_2 = new Menu("background",150,18,"Helvetica",12,"#000000","#FFFFFF","#efe7bf","#958622","left","middle",3,0,500,-5,7,true,false,true,5,true,true);
  AI_menu_2.addMenuItem("Planning Background","location='" + home_url + "background/background.htm'");
  AI_menu_2.addMenuItem("Historical Background","location='" + home_url + "background/history.htm'");
  AI_menu_2.addMenuItem("Institutional Master Plan","location='" + home_url + "imp/imp.htm'");
  //AI_menu_2.addMenuItem("Planning Context","location='" + home_url + "background/context.htm'");
  AI_menu_2.addMenuItem("Economic Impact","location='" + home_url + "background/impact.htm'");
  //AI_menu_2.addMenuItem("Maps","location='" + home_url + "maps/map_index.htm'");
  AI_menu_2.addMenuItem("Photo Tour","location='" + home_url + "tour/photo_tour.htm'");
  AI_menu_2.addMenuItem("Allston Images","location='" + home_url + "gallery/gallery.htm'");
  
  AI_menu_2.fontWeight="normal";
   AI_menu_2.hideOnMouseOut=true;
   AI_menu_2.bgColor='#efe7bf';
   AI_menu_2.menuBorder=1;
   AI_menu_2.menuLiteBgColor='#FFFFFF';
   AI_menu_2.menuBorderBgColor='#777777';

 window.AI_menu_3 = new Menu("process",140,18,"Helvetica",12,"#000000","#FFFFFF","#dec8da","#8f4574","left","middle",3,0,500,-5,7,true,false,true,5,true,true);
  AI_menu_3.addMenuItem("Community","location='" + home_url + "community/meetings.htm'");
  AI_menu_3.addMenuItem("Allston Task Force", "location='" + home_url + "community/impmeetings.htm'"); 
  
  //AI_menu_3.addMenuItem("NANSP Presentations","location='" + home_url + "presentations/nansp_presentations.htm'");
  //AI_menu_3.addMenuItem("NANSP","location='" + home_url + "community/nansp.htm'");
   AI_menu_3.fontWeight="normal";
   AI_menu_3.hideOnMouseOut=true;
   AI_menu_3.bgColor='#dec8da';
   AI_menu_3.menuBorder=1;
   AI_menu_3.menuLiteBgColor='#FFFFFF';
   AI_menu_3.menuBorderBgColor='#777777';
   
   window.AI_menu_4 = new Menu("construction",145,18,"Helvetica",12,"#000000","#FFFFFF","#cad0b7","#5d7042","left","middle",3,0,500,-5,7,true,false,true,5,true,true);
  AI_menu_4.addMenuItem("Construction Mitigation","location='http://www.allstonconstruction.harvard.edu'");
  
   AI_menu_4.fontWeight="normal";
   AI_menu_4.hideOnMouseOut=true;
   AI_menu_4.bgColor='#cad0b7';
   AI_menu_4.menuBorder=1;
   AI_menu_4.menuLiteBgColor='#FFFFFF';
   AI_menu_4.menuBorderBgColor='#777777';
   
  window.AI_menu_5 = new Menu("vision",130,18,"Helvetica",12,"#000000","#FFFFFF","#cbc4b2","#a64628","left","middle",3,0,500,-5,7,true,false,true,5,true,true);
  AI_menu_5.addMenuItem("Envisioning Allston","location='" + home_url + "vision/vision.htm'");
  AI_menu_5.addMenuItem("Task Force Reports","location='" + home_url + "vision/tfintro.htm'");
  /*AI_menu_5.addMenuItem("Allston Priorities","location='" + home_url + "vision/priorities.htm'");*/
  AI_menu_5.addMenuItem("CRP Interim Report","location='" + home_url + "vision/crp.htm'");
  //AI_menu_5.addMenuItem("Allston Room Exhibit","location='" + home_url + "allston_room/harvard_content.html'");
  AI_menu_5.fontWeight="normal";
   AI_menu_5.hideOnMouseOut=true;
   AI_menu_5.bgColor='#cbc4b2';
   AI_menu_5.menuBorder=1;
   AI_menu_5.menuLiteBgColor='#FFFFFF';
   AI_menu_5.menuBorderBgColor='#777777';
   AI_menu_5.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 AI_swapImgRestore() { //v3.0
  var i,x,a=document.AI_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function AI_swapImage() { //v3.0
  var i,j=0,x,a=AI_swapImage.arguments; document.AI_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=AI_findObj(a[i]))!=null){document.AI_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function AI_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.AI_p) d.AI_p=new Array();
    var i,j=d.AI_p.length,a=AI_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.AI_p[j]=new Image; d.AI_p[j++].src=a[i];}}
}

function AI_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=AI_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}