// JavaScript Document



//MENU FUNCTIONS

menulength = 6;

//array to make the main menu
var MenuItems= new Array(menulength+1);
MenuItems[1]=new Array("home","Home Page","","index.html",102); 
MenuItems[2]=new Array("research","Research","y","research.html",107); 
MenuItems[3]=new Array("people","People","y","people.html",93); 
MenuItems[4]=new Array("publications","Publications","y","publications.html",125);  
MenuItems[5]=new Array("news","News","y","news.html",85);
MenuItems[6]=new Array("intranet","Intranet","","intranet.html",96);

//arrays to make the submenus

var researchSubMenu= new Array();
researchSubMenu[1]=new Array("research1","protacs.html","Small Molecule Control of Protein Function",130);
researchSubMenu[2]=new Array("research2","natural.html","Natural Product Mode of Action Studies",140);
researchSubMenu[3]=new Array("research3","research.html#diff","Cell Dedifferentiation and Tissue Regeneration",140);

var peopleSubMenu= new Array();
peopleSubMenu[1]=new Array("people","people.html","Members",60);
peopleSubMenu[2]=new Array("people","positions.html","Positions Open",90);

var publicationsSubMenu= new Array();
publicationsSubMenu[1]=new Array("publications","publications.html","1996-Present",60);
publicationsSubMenu[2]=new Array("publications","publications.html#1989","1989-1995",60);

var newsSubMenu= new Array();
newsSubMenu[1]=new Array("news","news.html","News",35);
newsSubMenu[2]=new Array("news","photo_gallery.html","Photo Gallery",78);

var intranetSubMenu= new Array();





//************************ DON'T CHANGE ANYTHING BELOW THIS LINE !!! *****************************
//************************************************************************************************
//************************************************************************************************




function MakeMainMenu(thepage,subpage) {
	
	document.write('<TABLE ID="Table_01" WIDTH=898 HEIGHT=32 BORDER=0 CELLPADDING=0 CELLSPACING=0><TR>');
	
	for (x=1; x<=menulength; x++) {
		
		if (thepage!=MenuItems[x][0]) {
		
			document.write('<TD><a href="' + MenuItems[x][3] + '" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'' + MenuItems[x][0] + '\',\'\',\'images/nav/' + MenuItems[x][0] + '-over.jpg\',1)"><img src="images/nav/' + MenuItems[x][0] + '.jpg" alt="' + MenuItems[x][1] + '" name="' + MenuItems[x][0] + '" width="' + MenuItems[x][4] + '" height="32" border="0"></a></TD>');
			
		} else {
		
			document.write('<TD><a href="' + MenuItems[x][3] + '" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'' + MenuItems[x][0] + '\',\'\',\'images/nav/' + MenuItems[x][0] + '-over.jpg\',1)"><img src="images/nav/' + MenuItems[x][0] + '-over.jpg" alt="' + MenuItems[x][1] + '" name="' + MenuItems[x][0] + '" width="' + MenuItems[x][4] + '" height="32" border="0"></a></TD>');
			
		}
		
		
	}
	
	document.write('<TD><IMG SRC="images/nav/menubar_07.jpg" WIDTH=290 HEIGHT=32 ALT=""></TD></TR></TABLE>');
	
}


function MakeIntranetMenu(thepage,subpage) {
	
	document.write('<TABLE ID="Table_01" WIDTH=898 HEIGHT=32 BORDER=0 CELLPADDING=0 CELLSPACING=0><TR>');
	
	for (x=1; x<=menulength; x++) {
		
		if (thepage!=MenuItems[x][0]) {
		
			document.write('<TD><a href="../' + MenuItems[x][3] + '" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'' + MenuItems[x][0] + '\',\'\',\'../images/nav/' + MenuItems[x][0] + '-over.jpg\',1)"><img src="../images/nav/' + MenuItems[x][0] + '.jpg" alt="' + MenuItems[x][1] + '" name="' + MenuItems[x][0] + '" width="' + MenuItems[x][4] + '" height="32" border="0"></a></TD>');
			
		} else {
		
			document.write('<TD><a href="../' + MenuItems[x][3] + '" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'' + MenuItems[x][0] + '\',\'\',\'../images/nav/' + MenuItems[x][0] + '-over.jpg\',1)"><img src="../images/nav/' + MenuItems[x][0] + '-over.jpg" alt="' + MenuItems[x][1] + '" name="' + MenuItems[x][0] + '" width="' + MenuItems[x][4] + '" height="32" border="0"></a></TD>');
			
		}
		
		
	}
	
	document.write('<TD><IMG SRC="../images/nav/menubar_07.jpg" WIDTH=290 HEIGHT=32 ALT=""></TD></TR></TABLE>');
	
}


function MakeSubMenu(thepage,subpage) {
	
	domenus="no";
	
	//RESEARCH SETTINGS
	if ((MenuItems[2][2]=="y")&&(thepage=="research")) {
		leftspacer = 155;
		domenus = "yes";
	}
	
	//PEOPLE SETTINGS
	if ((MenuItems[3][2]=="y")&&(thepage=="people")) {
		leftspacer = 255;
		domenus = "yes";
	}
	
	//PUBLICATIONS SETTINGS
	if ((MenuItems[4][2]=="y")&&(thepage=="publications")) {
		leftspacer = 365;
		domenus = "yes";
	}
	
	//NEWS SETTINGS
	if ((MenuItems[5][2]=="y")&&(thepage=="news")) {
		leftspacer = 470;
		domenus = "yes";
	}
	
	//INTRANET SETTINGS
	if ((MenuItems[6][2]=="y")&&(thepage=="intranet")) {
		leftspacer = 570;
		domenus = "yes";
	}
	
	thisArrayName = eval(thepage+"SubMenu");
	
	if (domenus=="yes") {
		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>');
		document.write('<td width="' + leftspacer + '" height="35">&nbsp;</td>');
		document.write('<td width="20" class="leftline">&nbsp;</td>');
	
			for (y=1; y<=(thisArrayName.length-1); y++) {
				document.write('<td class="submenu" valign="middle" width="'+thisArrayName[y][3]+'"><a href="'+thisArrayName[y][1]+'">'+thisArrayName[y][2]+'</a></td>');
				document.write('<td width="20" class="divider">&nbsp;</td>');
			}
		
		document.write('<td>&nbsp;</td></tr></table>');
	} else {
		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="35">&nbsp;</td></tr></table>');
	}
	
}




NumberOfFellows = 8;


// function to write flash obj passing query string vars
function writeFlash() {
	
	// appearance vars, these can be customized to your liking
	var width = '611'
	var height = '425'
	var src = 'homepage.swf'
	var rannumber = (Math.floor(Math.random()*10000)+1);
	//alert(rannumber);
	// queries -- type in the variables you want to send to flash here
	//var queries = '?text='+QueryString('year')+'&month='+QueryString('month')+'';
	var queries = '?NumberOfFellows='+NumberOfFellows+'&rand='+rannumber+''
	//alert(queries);
	// assemble flash obj
	var l1 = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'">'
	var l2 = '<param name="movie" value="'+src+queries+'" />'
	var l3 = '<param name="quality" value="high" /><param name="wmode" value="transparent" />'
	var l4 = '<embed src="'+src+queries+'" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed>'
	var l5 = '</object>'

	// write all lines
	
	var flashcount = 0;
	//CREATE TEST STRINGS TO TEST FOR FLASH VERSION 5 UP TO FLASH VERSION 20
	for (i = 6; i <= 20; i++) {
		flashstring = 'Flash ' + i;
		shockstring = 'ShockwaveFlash.ShockwaveFlash.' + i;
		if(WM_pluginDetect(flashstring, 'swf','application/x-shockwave-flash',shockstring)) {
			flashcount++;
		}
	}

	if(flashcount>0)  
	{ 
	//alert(src+queries);
		document.write(l1+l2+l3+l4+l5)
	} else {
		document.write('<i>You need to download and install the free Macromedia Flash browser plug-in to view the photo gallery. <a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Click here to download this plug-in.</a></i>');
	}
}













MM_preloadImages('images/nav/home-over.jpg','images/nav/research-over.jpg','images/nav/people-over.jpg','images/nav/publications-over.jpg','images/nav/news-over.jpg','images/nav/intranet-over.jpg');

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_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 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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}