// LILLY ENDOWMENT, INC.
//Scripts and Includes files

// -----------------------------------------------------------------------------
// Include for copyright notice and address

function printFooter() {
  //document.write("<hr width='100%' size='1' align='center'>");
  document.write("<div align='left'><font size='-2'>Copyright 2012, Lilly Endowment Inc. &nbsp; &nbsp;</font><a href='privacy.html' class='privacy'><font size='-2'>Privacy Statement</font></a>&nbsp; <a href='termsofuse.html' class='privacy'><font size='-2'>Terms of Use</font></a></div>");
}


// -----------------------------------------------------------------------------
// DHTML Mouse Over / Image RollOver effects
// -----------------------------------------------------------------------------

function createRollOver(n,s,d) {
// --- Find image object ---
	var p;
	var i;
	var 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.images.length;i++){
		x=d.images[i][n];
	}

	for(i=0;!x&&d.layers&&i<d.layers.length;i++){
		x=createRollOver(n,s,d.layers[i].document); 
		return x;
	}

// --- Find file name and extension ---
	imgName = (x.src.slice(0,x.src.lastIndexOf("_")+1)); // Setting the filename without extension
	imgExt 	= (x.src.slice(x.src.lastIndexOf("."),x.src.length)); // setting extension

// --- Call the rollover object ---
	eval("R_"+n+" = new rollOver(x,imgName,imgExt,s)");
}

// --------------------------------------------------------
// Generate the rollover object
// --------------------------------------------------------

function rollOver(img,imgName,imgExt,status){
	this.file		= img;
	this.normal		= new Image();
	this.normal.src = imgName+'normal'+imgExt;
	this.over		= new Image();
	this.over.src 	= imgName+'over'+imgExt;
	this.click		= new Image();
	this.click.src	= imgName+'click'+imgExt;
	this.text		= status;
}

// --------------------------------------------------------
// Function called onMouseOver, onMouseOut, onClick 
// --------------------------------------------------------

function swap(obj,action){	
	if (document.images && clicked != eval("R_"+obj)) {
		if(clicked != eval("R_"+obj)){
			eval("R_"+obj+".file.src = R_"+obj+"."+action+".src");
		}

// --- Test for any button being clicked
		if(action=="click"){
// --- Setting the previous clicked's source to normal state
			if(clicked)clicked.file.src = clicked.normal.src;
// --- Setting the current clicked image
			clicked = eval("R_"+obj);
// --- Setting the status bar if any
		} else if(action=="over" && eval("R_"+obj+".text")){
			window.status = eval("R_"+obj+".text");
		} else {
			window.status = "";
		}
	}
}
// --- Holds the object of the currently clicked image. Empty by default.
var clicked = null;

// -----------------------------------------------------------------------------
// Status Text for Links

function write_it(status_text) {
	window.status=status_text;
}


