openedNav="none";
function swapImages(img_name, img_src){
	if (document.images){
		document[img_name].src = img_src;
    }
}
function changeImages(img_name, img_src){
	swapImages(img_name, img_src);
}
/**********************************************************************
 subnav rollovers
 **********************************************************************/
 function subnavOv(img_name){
	if(img_name!=selectNav){
		subnavOv2(img_name);
	}
}
function subnavUp(img_name){
	if(img_name!=selectNav){
		subnavUp2(img_name);
	}
}
function subnavOv2(img_name){
	swapImages(img_name, 'images/subnav/'+img_name+'_o.gif');
}
function subnavUp2(img_name){
	swapImages(img_name, 'images/subnav/'+img_name+'_u.gif');
}
function setSubNav(img_name){
	selectNav=img_name;
	subnavOv2(img_name);
}
/**********************************************************************
 popup window function
 **********************************************************************/
function openPopup(name, windowLoc, height, width, scroll){
	var winl = (screen.width - width) / 2;
	var wint = (screen.height - height) / 2;
	if(scroll==undefined)scroll='no';
	var winProps = 'toolbar=no,statusbar=no,location=no,scrollbars='+scroll+',resizable=yes,width='+width+',height='+height+',top='+wint+',left='+winl;
	window.open(windowLoc, name, winProps);
}
/**********************************************************************
 insert flash
 **********************************************************************/
function includeFlash(movieName, width, height, bgcolor, vars){
//includeFlash('flash/mymovie', '765', '363', '#FFFFFF', 'image1');
	var nocache=new Date().getTime();
	if(vars){
		urlvars=("?"+vars+"&nc="+nocache);
	}else{
		urlvars=("?nc="+nocache);
	}
	document.write ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
		+'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+width+'" HEIGHT="'+height+'" id='+movieName+' ALIGN="">'
		+'<PARAM NAME=movie VALUE="'+movieName+'.swf'+urlvars+'"><PARAM NAME=FlashVars VALUE="movieid='+nocache+'" />'
		+'<PARAM NAME=salign VALUE="LT"><PARAM NAME=quality VALUE=high><PARAM NAME=scale VALUE=noscale><PARAM NAME=bgcolor VALUE='+bgcolor+'>'
		+'<EMBED src="'+movieName+'.swf'+urlvars+'" ' 
		+'FlashVars="movieid='+nocache+'" quality=high scale=noscale bgcolor='+bgcolor+'  WIDTH="'+width+'" HEIGHT="'+height+'" NAME='+movieName+' SALIGN="LT"'
		+'TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>')
}

/**********************************************************************
 insert date (page footer)
 **********************************************************************/
today = new Date;
weekDayName = new Array ("Sun","Mon","Tues","Wed","Thurs","Fri","Sat")
monthName = new Array ("Jan","Feb","Mar","Apr","May","June","July","Aug","Sep","Oct","Nov","Dec")
function printDate(){
	document.write("" + weekDayName[today.getDay()]+ ", " + monthName[today.getMonth()] + " " + today.getDate()+ "")
}

/**********************************************************************
 insert random BW photo of a person on green BG
 **********************************************************************/
function BWpeopleOnGreen(){
	var numOfPhotos = 15;
	var randNum = Math.ceil(Math.random()*numOfPhotos);
	document.write('<img src="images/photos/BW-onGrn/photo'+randNum+'.jpg">')
}

/**********************************************************************
 insert random color photo of a person on gray BG
 **********************************************************************/
/*function clrpeopleOnGray(){
	var numOfPhotos = 34;
	var randNum = Math.ceil(Math.random()*numOfPhotos);
	document.write('<img src="images/photos/CLR-onGry/photo'+randNum+'.jpg">')
}*/
function clrpeopleOnGray(){
	var numOfPhotos = 4;
	var randNum = Math.ceil(Math.random()*numOfPhotos);
	document.write('<img src="images/photos/BW-onGry/photo'+randNum+'.jpg">')
}
/**********************************************************************
 insert random color photo of materials
 **********************************************************************/
function insertRawPhoto(){
	var numOfPhotos = 17;
	var randNum = Math.ceil(Math.random()*numOfPhotos);
	document.write('<img src="images/photos/raw/photo'+randNum+'.jpg">')
}
function insertPackagingPhoto(){
	var numOfPhotos = 6;
	var randNum = Math.ceil(Math.random()*numOfPhotos);
	document.write('<img src="images/photos/packaging/photo'+randNum+'.jpg">')
}
function insertSustainPhoto(){
	var numOfPhotos = 5;
	var randNum = Math.ceil(Math.random()*numOfPhotos);
	document.write('<img src="images/photos/sustain/photo'+randNum+'.jpg">')
}
function insertPackagEngin(){
	var numOfPhotos = 3;
	var randNum = Math.ceil(Math.random()*numOfPhotos);
	document.write('<img src="images/photos/packag-engin/photo'+randNum+'.jpg">')
}
function insertIndirectPhoto(){
	var numOfPhotos = 9;
	var randNum = Math.ceil(Math.random()*numOfPhotos);
	document.write('<img src="images/photos/indirect/photo'+randNum+'.jpg">')
}
function insertTechPhoto(){
	var numOfPhotos = 7;
	var randNum = Math.ceil(Math.random()*numOfPhotos);
	document.write('<img src="images/photos/technology/photo'+randNum+'.jpg">')
}
function insertMaterialPhoto(){
	var numOfCategories = 4;
	var randNum = Math.ceil(Math.random()* numOfCategories);
	switch(randNum){
	case 1:
		insertTechPhoto();
		break;
	case 2:
		insertIndirectPhoto();
		break;
	case 3:
		insertPackagingPhoto();
		break;
	case 4:
		insertRawPhoto();
		break;
	}
}
