// Pre-load section header graphics and navigation
		
pre = new Array("culture","ideas","talent","press","careers","contact","resources");
s = 0;
for (x = 0; x < pre.length; x++) { 
	thisNavOver = "nOver"+s+x;
	thisNavOver = new Image();
	thisNavOver.src = "/"+pre[s]+"/images/nav_"+pre[x]+"_over.jpg";

	thisNavOn = "nOn"+x;
	thisNavOn = new Image();
	thisNavOn.src = "/"+pre[s]+"/images/nav_"+pre[x]+"_on.jpg";

	thisHdr = "h"+x;
	thisHdr = new Image();
	thisHdr.src = "/"+pre[s]+"/images/hdr_section.jpg";

	s++;
	}

h8 = new Image();
h8.src ="/resources/images/hdr_tertiary.jpg";			

pb = new Image();
pb.src ="/resources/images/pop_bkd.gif";
		
var snavCurrent;

function setCurrent(id) {
	// Marks the subnav item as the current highlighted
	document.getElementById("sNav"+id).setAttribute("src","images/snav_"+id+"_on.gif");
		
	snavCurrent = id;
	}

function setCurrentTert(id) {
	// Marks the tertiary nav item as the current highlighted
	document.getElementById("tNav"+id).style.background = "url(/resources/images/bkd_tertnav.gif) center left";
	}

function navOver(id, path) {
	if(id != "<%=nav%>") {
		document.getElementById("nav"+id).setAttribute("src",path+"/nav_"+id+"_on.jpg");
		}
	}
	
function navOut(id, path) {
	if(id != "<%=nav%>") {
		document.getElementById("nav"+id).setAttribute("src",path+"nav_"+id+"_off.jpg");
		}
	}
	
function snavOver(id) {
	if(id != snavCurrent) {
		document.getElementById("sNav"+id).setAttribute("src","images/snav_"+id+"_on.gif");
		}
	}
	
function snavOut(id) {
	if(id != snavCurrent) {
		document.getElementById("sNav"+id).setAttribute("src","images/snav_"+id+"_off.gif");
		}
	}
	
function showPopUp(id, width, top, marginLeft) {
	// IE calculates positioning differently, so fix it.
	ua = navigator.userAgent.toLowerCase();
	if(ua.indexOf('msie') != -1) {
		marginLeft = (marginLeft-970);	
		}
		
	thisDiv = document.getElementById(id);
	thisDiv.style.width = width+"px";
	thisDiv.style.top = top+"px";
	thisDiv.style.margin = "0 0 0 "+marginLeft+"px";
	thisDiv.style.display = "block";
	}

function hidePopUp(id) {
	document.getElementById(id).style.display = "none";
	}

function showBio(bio) {
	hidePopUp('elaine');
	hidePopUp('robin');
	hidePopUp('gemma');
	hidePopUp('barb');
	showPopUp(bio, 545, 250, 145);
	}

function showGallery(slot) {
	var FO = { movie:"/ideas/images/gallery.swf", width:"676", height:"584", majorversion:"8", build:"0", xi:"true",wmode:"transparent",flashvars:"slot="+slot};
	UFO.create(FO, "galleryFlash");
	showPopUp('gallery',804,490,76);
	}

function blowAudio() {
	x = 700;
	y = blowY;
	document.getElementById("audioPlayer").style.zIndex=200;
	new Effect.MoveBy("audioPlayer", y, x,{ duration: 2.5});
	}

function userFade(toAppear,toFade,del) {
	if(toFade != null) {
		document.getElementById(toFade).style.display="none";
		}
	if(del == null) {
		del = 0;
		}	
		
	new Effect.Appear(toAppear,{to: 1.0, from: 0.0, duration: 1.2, delay: del});
	}