var hfile;
var isDefault;

//png code
	    var objMyImage = null;
	    var objMyImage2 = null;

	    function init_png(currentPage) {
	        var path = "../";
	        if((currentPage=="default")||(currentPage=="Default")||(currentPage=="")){
		        var path = "";
		        document.getElementById("col_middle").style.width = 726 + 'px';
		        document.getElementById("col_middle").style.paddingTop = 0 + 'px';
		        document.getElementById("content_container").style.background = "url(images/top/bg.jpg) repeat-x #76764B";
		        objMyImage = new OpacityObject('content_bg',path + 'images/top/bg_rim_home','crop');
		    }
		    else{
		        objMyImage = new OpacityObject('content_bg',path + 'images/top/bg_rim','scale');
		         if(document.getElementById('silhouette')){
		            objMyImage2 = new OpacityObject('silhouette',path + 'images/top/crowd_silhouette','crop');
		            objMyImage2.setBackground();
		        }
		    }
		    objMyImage.setBackground();
		   
	    }
	    
/*
===================================================
XHTML/CSS/DHTML Semantically correct drop down menu 
===================================================
Author: Sam Hampton-Smith
Site: http://www.hampton-smith.com
Modified 04/10/04 SPD
Credits: Inspiration/Code borrowed from Dave Lindquist (http://www.gazingus.org)
Menu hide functionality was aided by some code I found on http://www.jessett.com/
Modified 4/15/04 SPD
edited timer (in milliseconds) to 800 in line 150 (well, line 177 as of this exact second).
*/

	var currentMenu = null;
	var mytimer = false;
	//var mytimer = null;
	var timerOn = false;
	var agt=navigator.userAgent.toLowerCase();
	var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);
	var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var IE4up  = (is_ie && (is_major >= 4));
	//var IE4up = document.all && window.external ? true : false;
	//var IE4up = navigator.userAgent.indexOf("Microsoft") != -1;
	
	var Opera = window.opera ? true : false;
	// netscape browsers
	var NN  = (navigator.userAgent.indexOf("Netscape") != -1) && !Opera;
	var is_nn6 = (navigator.product == 'Gecko') && (!window.find)?true:false;
	var is_nn7 = (navigator.product == 'Gecko') && (window.find)?true:false;

	var Moz = (navigator.userAgent.indexOf("Mozilla") != -1) && !NN;
	var is_mac = navigator.userAgent.indexOf("Mac") != -1;
	
	if (!document.getElementById)
		document.getElementById = function() { return null; }
	
	function stopTime() {
		//alert("stoptime");
		if (mytimer) {
		//alert("stoptime");
			//clearInterval(mytimer);
		 	 clearTimeout(mytimer);
			 mytimer = false;
			 //mytimer = null;
			 timerOn = false;
		}
	}
	
	function initialiseMenu(menu, starter, root) {
		killMenu(menu.id, root.id); //neccessary for back button to hold highlight correctly IE MAC
		var leftstarter = false;
	
		if (menu == null || starter == null) return;
			currentMenu = menu;
	
		starter.onmouseover = function() {
			if (currentMenu) {
				//alert(this.parentNode.parentNode.id + ' ' + currentMenu.id);
				if (this.parentNode.parentNode!=currentMenu) {
					currentMenu.style.visibility = "hidden";
					//alert(currentMenu.id);
				}
				if (this.parentNode.parentNode==root) {
					tempCurrentMenu = currentMenu
					while (tempCurrentMenu.parentNode.parentNode!=root) {
						tempCurrentMenu.parentNode.parentNode.style.visibility = "hidden";
						tempCurrentMenu = tempCurrentMenu.parentNode.parentNode;
					}
				}
				currentMenu = null;
				this.showMenu();
	        	}
		}
	
		menu.onmouseover = function() {
			if (currentMenu) {
				currentMenu = null;
				this.showMenu();
	        	}
		}	
		starter.onclick = function() { //fixes strange dropdown state in IE on PC (active)
			//document.getElementById('searchBox').document.getElementById('BasicSearchBox').focus();
			//document.getElementById('BasicSearchBox').focus();
			window.focus();
			//window.self.focus();
		}
		starter.showMenu = function() {
		//alert("starter_show");
			if (IE4up) {
				if (is_mac){
					if (this.parentNode.parentNode==root) {
						menu.style.left = this.offsetLeft-4 + "px";
						menu.style.top = this.offsetTop+29 + "px";
						//menu.style.top = this.offsetTop + this.offsetHeight + "px";
					}
					else {
						menu.style.left = this.offsetLeft + this.offsetWidth + "px";
						menu.style.top = this.offsetTop+29 + "px";
					}
				}
				else{
					if (this.parentNode.parentNode==root) {
						menu.style.left = this.offsetLeft+0 + "px";
						menu.style.top = this.offsetTop-1 + this.offsetHeight + "px";
					}
					else {
						menu.style.left = this.offsetLeft+0 + this.offsetWidth + "px";
						menu.style.top = this.offsetTop-1 + "px";
					}
				}
			}
			else if (Opera) {
				if (this.parentNode.parentNode==root) {
					menu.style.left = this.offsetLeft+0 + "px";
					menu.style.top = this.offsetHeight-8 + "px";
				}
				else {
				 	menu.style.left = this.offsetWidth+0 + "px";
				 	menu.style.top = this.offsetTop-8 + "px"; //menu.style.top - menu.style.offsetHeight + "px";
				}

			}
			else if (Moz) {
			//alert("moz");
				if (this.parentNode.parentNode==root) {
					menu.style.left = this.offsetLeft+0 + "px";
					menu.style.top = this.offsetHeight+4 + "px";
				}
				else {
				 	menu.style.left = this.offsetWidth + "px";
				 	menu.style.top = this.offsetTop+4 + "px";
				}

			}
			else if (NN) {
				if (is_mac){
				//alert("macNet");
					if (this.parentNode.parentNode==root) {
							menu.style.left = this.offsetLeft+0 + "px";
							menu.style.top = this.offsetHeight+4 + "px";
						}
						else {
							menu.style.left = this.offsetWidth + "px";
							menu.style.top = this.offsetTop+4 + "px";
						}
					}
				else if (is_nn7){
				//alert("net7");
					if (this.parentNode.parentNode==root) {
						menu.style.left = this.offsetLeft+0 + "px";
						menu.style.top = this.offsetHeight+4 + "px";
					}
					else {
						menu.style.left = this.offsetWidth + "px";
						menu.style.top = this.offsetTop+4 + "px";
					}
				}
				else {
				//alert("net6");
					if (this.parentNode.parentNode==root) {
						menu.style.left = this.offsetLeft+7 + "px";
						menu.style.top = this.offsetHeight+4 + "px";
					}
					else {
						menu.style.left = this.offsetWidth + "px";
						menu.style.top = this.offsetTop+4 + "px";
					}
				}
			}
			else {
					if (this.parentNode.parentNode==root) {
						menu.style.left = this.offsetLeft + "px";
						menu.style.top = this.offsetHeight-2 + "px";
					}
					else {
						menu.style.left = this.offsetWidth + "px";
						menu.style.top = this.offsetTop-2 + "px";
					}
				}

			menu.style.visibility = "visible";
			currentMenu = menu;
		}
		
		menu.hideMenu = function()  {
		//alert("hide started");
			if (!timerOn) {
				//alert(this.id);
				//mytimer = setInterval("killMenu('" + this.id + "', '" + root.id + "');", 800);
				mytimer = setTimeout("killMenu('" + this.id + "', '" + root.id + "');", 800);
				timerOn = true;
				//alert("timer set to true");
				for (var x=0;x<menu.childNodes.length;x++) {
					if (menu.childNodes[x].nodeName=="LI") {
						if (menu.childNodes[x].getElementsByTagName("UL").length>0) {
							menuItem = menu.childNodes[x].getElementsByTagName("UL").item(0);
							menuItem.style.visibility = "hidden";
						}
					}
				}
			}
		}
		
		starter.onfocus	= function() { //after main nav is clicked?
			starter.onmouseover();
		}

		menu.showMenu = function() {
		//alert("show");
			menu.style.visibility = "visible";
			currentMenu = menu;
			stopTime();
		}

		menu.onmouseout = function(event) {
		//alert("onmouseout");
		timerOn = false;
			this.hideMenu();
		}

		starter.onmouseout = function() {
		//alert("starter.onmouseout");
			for (var x=0;x<menu.childNodes.length;x++) {
				if (menu.childNodes[x].nodeName=="LI") {
					if (menu.childNodes[x].getElementsByTagName("UL").length>0) {
						menuItem = menu.childNodes[x].getElementsByTagName("UL").item(0);
						menuItem.style.visibility = "hidden";
					}
				}
			}
			menu.style.visibility = "hidden";
			//menu.hideMenu();
		}
}

function getMenus(elementItem, root) {
	var selectedItem;
	var menuStarter;
	var menuItem;
	//alert("in getmenus");
	//alert(elementItem.childNodes.length);
	for (var x=0;x<elementItem.childNodes.length;x++) {
		//alert(elementItem.childNodes[x].nodeName);
		if (elementItem.childNodes[x].nodeName=="LI") {
			//alert("Yes!");
			if (elementItem.childNodes[x].getElementsByTagName("UL").length>0) {
				//alert("Set up");
				menuStarter = elementItem.childNodes[x].getElementsByTagName("A").item(0);
				menuItem = elementItem.childNodes[x].getElementsByTagName("UL").item(0);
				getMenus(menuItem, root);
				initialiseMenu(menuItem, menuStarter, root);
			}
		}
	}
	//return true;
}

	function killMenu(menu, root) {
	//alert("killstarted");
		var menu = document.getElementById(menu);
		var root = document.getElementById(root);
		menu.style.visibility = "hidden";
		for (var x=0;x<menu.childNodes.length;x++) {
			if (menu.childNodes[x].nodeName=="LI") {
				if (menu.childNodes[x].getElementsByTagName("UL").length>0) {
					menuItem = menu.childNodes[x].getElementsByTagName("UL").item(0);
					menuItem.style.visibility = "hidden";
				}
			}
		}
		while (menu.parentNode.parentNode!=root) {
			menu.parentNode.parentNode.style.visibility = "hidden";
			menu = menu.parentNode.parentNode;
		}
		stopTime();
	}




/*#####################################################################################
Navigational code was inspired by scripts written by Chris Heilman icant.co.uk
Do not distribute any code in this file
######################################################################################*/
function navRender(){
    var findNav = document.getElementById("nav");
    var siren = "alert";
    var jsSiren = "jsAttach";
	var spawned = "hasSpawned";
	var revealSiren = "spawnReveal";
	var cloakSiren = "spawnCloak";
	var liveSiren = "live";

	if((!document.createTextNode) && (!document.getElementById)){
	    return; // don't bother running code if it can't handle
	}

	if(findNav){
		if(findNav.className==""){
		    findNav.className += jsSiren;
		}
		else{
		    findNav.className += +jsSiren;
		}
		
		var grabLI,initialUL,setNav,i,p,n;

		grabLI = findNav.getElementsByTagName("li");
		
		for(i=0;i<grabLI.length;i++){
			initialUL = grabLI[i].getElementsByTagName("ul")[0]
			if(initialUL){
			    if(grabLI[i].className == ""){
			        grabLI[i].className += spawned;
			    }
			    else{
			        grabLI[i].className += " "+spawned;
			    }
				setNav = true;
				
		        var temp = new Array();
		        temp = grabLI[i].className.split(' ');
		        for (n=0;n<temp.length; n++) {
		            if (temp[n] == liveSiren){
			            setNav = false;
		            }
		        }
		        
				if(setNav){
					for(p=0;p<initialUL.getElementsByTagName("li").length;p++){
						var tempInner = new Array();
		                tempInner = initialUL.getElementsByTagName("li")[p].className.split(' ');
		                for (n=0;n<tempInner.length; n++) {
		                    if (tempInner[n] == liveSiren){
			                    setNav = false;
			                    break;
		                    }
		                }
					}
				}
				if(setNav){
				    if(initialUL.className==""){
				        initialUL.className += cloakSiren;
				    }
				    else{
				        initialUL.className += " "+cloakSiren;
				    }
				} 
				else {
					grabLI[i].keepopen = 1;
					if(initialUL.className == ""){
					    initialUL.className += revealSiren;
					}
					else{
					    initialUL.className += " "+revealSiren;
					}
					grabLI[i].className = grabLI[i].className.replace(spawned,siren);
				}
			}
		}
	}
}


var currentMenu = null;
	var mytimer = false;
	//var mytimer = null;
	var timerOn = false;
	var agt=navigator.userAgent.toLowerCase();
	var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);
	var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var IE4up  = (is_ie && (is_major >= 4));
	//var IE4up = document.all && window.external ? true : false;
	//var IE4up = navigator.userAgent.indexOf("Microsoft") != -1;
	
	var Opera = window.opera ? true : false;
	// netscape browsers
	var NN  = (navigator.userAgent.indexOf("Netscape") != -1) && !Opera;
	var is_nn6 = (navigator.product == 'Gecko') && (!window.find)?true:false;
	var is_nn7 = (navigator.product == 'Gecko') && (window.find)?true:false;

	var Moz = (navigator.userAgent.indexOf("Mozilla") != -1) && !NN;
	var is_mac = navigator.userAgent.indexOf("Mac") != -1;
	
	if (!document.getElementById)
		document.getElementById = function() { return null; }
		
var outer; 
function init_new(){ 
    outer = document.getElementById('outer'); 
    resize(); 
} 
function resize(){ 
	if (is_mac){
		if (IE4up){
		var howTall = 0;
		var howTall = document.body.clientHeight;
		outer.style.height = howTall + 'px'; 
		}
	}
} 
function thatMac(){ //fix issue of nav blowing down causing unwanted space below footer
		document.getElementById('col_left').style.display='block';
} 
function redoMac(){  //refreashes page but fixes mac IE resizing probs
	if (is_mac){
		if (IE4up){
			window.location.reload();
		}
	}
}

window.onresize=redoMac; 


/*
	Lightbox JS: Fullsize Image Overlays 
	by Lokesh Dhakar - http://www.huddletogether.com

	For more information on this script, visit:
	http://huddletogether.com/projects/lightbox/

	Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
	(basically, do anything you want, just leave my name and link)
	
	Table of Contents
	-----------------
	Configuration
	
	Functions
	- getPageScroll()
	- getPageSize()
	- pause()
	- getKey()
	- listenKey()
	- showLightbox()
	- hideLightbox()
	- initLightbox()
	- addLoadEvent()
	
	Function Calls
	- addLoadEvent(initLightbox)

*/



//
// Configuration
//

// If you would like to use a custom loading image or close button reference them in the next two lines.
var loadingImage = 'images/loading.gif';		
var closeButton = 'images/close.gif';		





//
// getPageScroll()
// Returns array with x,y page scroll values.
// Core code from - quirksmode.org
//
function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}



//
// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
//
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}


//
// pause(numberMillis)
// Pauses code execution for specified time. Uses busy code, not good.
// Code from http://www.faqts.com/knowledge_base/view.phtml/aid/1602
//
function pause(numberMillis) {
	var now = new Date();
	var exitTime = now.getTime() + numberMillis;
	while (true) {
		now = new Date();
		if (now.getTime() > exitTime)
			return;
	}
}

//
// getKey(key)
// Gets keycode. If 'x' is pressed then it hides the lightbox.
//

function getKey(e){
	if (e == null) { // ie
		keycode = event.keyCode;
	} else { // mozilla
		keycode = e.which;
	}
	key = String.fromCharCode(keycode).toLowerCase();
	
	if(key == 'x'){ hideLightbox(); }
}


//
// listenKey()
//
function listenKey () {	document.onkeypress = getKey; }
	

//
// showLightbox()
// Preloads images. Pleaces new image in lightbox then centers and displays.
//
function showLightbox(objLink)
{
	// prep objects
	var objOverlay = document.getElementById('overlay');
	var objLightbox = document.getElementById('lightbox');
	var objCaption = document.getElementById('lightboxCaption');
	var objImage = document.getElementById('lightboxImage');
	var objLoadingImage = document.getElementById('loadingImage');
	var objLightboxDetails = document.getElementById('lightboxDetails');

	
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();

	// center loadingImage if it exists
	if (objLoadingImage) {
		objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - objLoadingImage.height) / 2) + 'px');
		objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px');
		objLoadingImage.style.display = 'block';
	}

	// set height of Overlay to take up whole page and show
	objOverlay.style.height = (arrayPageSize[1] + 'px');
	objOverlay.style.display = 'block';

	// preload image
	imgPreload = new Image();

	imgPreload.onload=function(){
		objImage.src = objLink.href;

		// center lightbox and make sure that the top and left values are not negative
		// and the image placed outside the viewport
		var lightboxTop = arrayPageScroll[1] + ((arrayPageSize[3] - 35 - imgPreload.height) / 2);
		var lightboxLeft = ((arrayPageSize[0] - 20 - imgPreload.width) / 2);
		
		objLightbox.style.top = (lightboxTop < 0) ? "0px" : lightboxTop + "px";
		objLightbox.style.left = (lightboxLeft < 0) ? "0px" : lightboxLeft + "px";


		objLightboxDetails.style.width = imgPreload.width + 'px';
		
		if(objLink.getAttribute('title')){
			objCaption.style.display = 'block';
			//objCaption.style.width = imgPreload.width + 'px';
			objCaption.innerHTML = objLink.getAttribute('title');
		} else {
			objCaption.style.display = 'none';
		}
		
		// A small pause between the image loading and displaying is required with IE,
		// this prevents the previous image displaying for a short burst causing flicker.
		if (navigator.appVersion.indexOf("MSIE")!=-1){
			pause(250);
		} 

		if (objLoadingImage) {	objLoadingImage.style.display = 'none'; }

		// Hide select boxes as they will 'peek' through the image in IE
		selects = document.getElementsByTagName("select");
        for (i = 0; i != selects.length; i++) {
                selects[i].style.visibility = "hidden";
        }

	
		objLightbox.style.display = 'block';

		// After image is loaded, update the overlay height as the new image might have
		// increased the overall page height.
		arrayPageSize = getPageSize();
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		
		// Check for 'x' keypress
		listenKey();

		return false;
	}

	imgPreload.src = objLink.href;
	
}





//
// hideLightbox()
//
function hideLightbox()
{
	// get objects
	objOverlay = document.getElementById('overlay');
	objLightbox = document.getElementById('lightbox');

	// hide lightbox and overlay
	objOverlay.style.display = 'none';
	objLightbox.style.display = 'none';

	// make select boxes visible
	selects = document.getElementsByTagName("select");
    for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "visible";
	}

	// disable keypress listener
	document.onkeypress = '';
}




//
// initLightbox()
// Function runs on window load, going through link tags looking for rel="lightbox".
// These links receive onclick events that enable the lightbox display for their targets.
// The function also inserts html markup at the top of the page which will be used as a
// container for the overlay pattern and the inline image.
//
function initLightbox()
{
	
	if (!document.getElementsByTagName){ return; }
	var anchors = document.getElementsByTagName("a");

	// loop through all anchor tags
	for (var i=0; i<anchors.length; i++){
		var anchor = anchors[i];

		if (anchor.getAttribute("href") && (anchor.getAttribute("rel") == "lightbox")){
			anchor.onclick = function () {showLightbox(this); return false;}
		}
	}

	// the rest of this code inserts html at the top of the page that looks like this:
	//
	// <div id="overlay">
	//		<a href="#" onclick="hideLightbox(); return false;"><img id="loadingImage" /></a>
	//	</div>
	// <div id="lightbox">
	//		<a href="#" onclick="hideLightbox(); return false;" title="Click anywhere to close image">
	//			<img id="closeButton" />		
	//			<img id="lightboxImage" />
	//		</a>
	//		<div id="lightboxDetails">
	//			<div id="lightboxCaption"></div>
	//			<div id="keyboardMsg"></div>
	//		</div>
	// </div>
	
	var objBody = document.getElementsByTagName("body").item(0);
	
	// create overlay div and hardcode some functional styles (aesthetic styles are in CSS file)
	var objOverlay = document.createElement("div");
	objOverlay.setAttribute('id','overlay');
	objOverlay.onclick = function () {hideLightbox(); return false;}
	objOverlay.style.display = 'none';
	objOverlay.style.position = 'absolute';
	objOverlay.style.top = '0';
	objOverlay.style.left = '0';
	objOverlay.style.zIndex = '90';
 	objOverlay.style.width = '100%';
	objBody.insertBefore(objOverlay, objBody.firstChild);
	
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();

	// preload and create loader image
	var imgPreloader = new Image();
	
	// if loader image found, create link to hide lightbox and create loadingimage
	imgPreloader.onload=function(){

		var objLoadingImageLink = document.createElement("a");
		objLoadingImageLink.setAttribute('href','#');
		objLoadingImageLink.onclick = function () {hideLightbox(); return false;}
		objOverlay.appendChild(objLoadingImageLink);
		
		var objLoadingImage = document.createElement("img");
		objLoadingImage.src = loadingImage;
		objLoadingImage.setAttribute('id','loadingImage');
		objLoadingImage.style.position = 'absolute';
		objLoadingImage.style.zIndex = '150';
		objLoadingImageLink.appendChild(objLoadingImage);

		imgPreloader.onload=function(){};	//	clear onLoad, as IE will flip out w/animated gifs

		return false;
	}

	imgPreloader.src = loadingImage;

	// create lightbox div, same note about styles as above
	var objLightbox = document.createElement("div");
	objLightbox.setAttribute('id','lightbox');
	objLightbox.style.display = 'none';
	objLightbox.style.position = 'absolute';
	objLightbox.style.zIndex = '100';	
	objBody.insertBefore(objLightbox, objOverlay.nextSibling);
	
	// create link
	var objLink = document.createElement("a");
	objLink.setAttribute('href','#');
	objLink.setAttribute('title','Click to close');
	objLink.onclick = function () {hideLightbox(); return false;}
	objLightbox.appendChild(objLink);

	// preload and create close button image
	var imgPreloadCloseButton = new Image();

	// if close button image found, 
	imgPreloadCloseButton.onload=function(){

		var objCloseButton = document.createElement("img");
		objCloseButton.src = closeButton;
		objCloseButton.setAttribute('id','closeButton');
		objCloseButton.style.position = 'absolute';
		objCloseButton.style.zIndex = '200';
		objLink.appendChild(objCloseButton);

		return false;
	}

	imgPreloadCloseButton.src = closeButton;

	// create image
	var objImage = document.createElement("img");
	objImage.setAttribute('id','lightboxImage');
	objLink.appendChild(objImage);
	
	// create details div, a container for the caption and keyboard message
	var objLightboxDetails = document.createElement("div");
	objLightboxDetails.setAttribute('id','lightboxDetails');
	objLightbox.appendChild(objLightboxDetails);

	// create caption
	var objCaption = document.createElement("div");
	objCaption.setAttribute('id','lightboxCaption');
	objCaption.style.display = 'none';
	objLightboxDetails.appendChild(objCaption);

	// create keyboard message
	var objKeyboardMsg = document.createElement("div");
	objKeyboardMsg.setAttribute('id','keyboardMsg');
	objKeyboardMsg.innerHTML = 'Click <a href="#" onclick="hideLightbox(); return false;" style="font-size:12px;"><kbd>here</kbd></a> to return';
	//objKeyboardMsg.innerHTML = 'press <a href="#" onclick="hideLightbox(); return false;"><kbd>x</kbd></a> to close';
	objLightboxDetails.appendChild(objKeyboardMsg);


}




//
// addLoadEvent()
// Adds event to window.onload without overwriting currently assigned onload functions.
// Function found at Simon Willison's weblog - http://simon.incutio.com/
//
/*function addLoadEvent(func)
{	
	var oldonload = window.onload;
	if (typeof window.onload != 'function'){
    	window.onload = func;
	} else {
		window.onload = function(){
		oldonload();
		func();
		}
	}

}*/



//addLoadEvent(initLightbox);	// run initLightbox onLoad


/*######################################################
######################################################*/

function NewWindow(mypage, myname, w, h, scroll) 
	{
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		var winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable';
		var win = window.open(mypage, myname, winprops);
		if (parseInt(navigator.appVersion) >= 4) 
			win.window.focus();
	}



window.onload = function() {
		init_new();
		//var root = document.getElementById("menuList");
		//getMenus(root, root);
		
		//document.getElementById("menu2").style.visibility = "hidden";
		//document.getElementById('BasicSearchBox').focus(); //puts cursor in search field
		//document.getElementById('BasicSearchBox').hideFocus=true;
		
		var hURL=String(this.location.href);
	    hURL = hURL.split("/");
	    lvl =  hURL.length;
	    var Domain = hURL[2];		// get the current domain
	    var hfolder = hURL[lvl - 2];// get the file containing folder
	    var hfile = hURL[lvl - 1]; 	// get the file name
	    hfile = hfile.split(".")[0]; //removes extention from file name
		
		if(document.getElementById('content_bg')){ //if there is a png div on the current page, run the code for it
		    init_png(hfile);
		}
		
		if(hfile=="make_it_yours"){
		    document.getElementById('make_it_yours').innerHTML="<img src='../images/top/make_it_yours_over.png' alt='Make It Yours' />";
		}
		else if(hfile=="make_decisions"){
		    document.getElementById('make_decisions').innerHTML="<img src='../images/top/make_decisions_over.png' alt='Make Decisions' />";
		    document.getElementById('content_side_tile').style.background="url(../images/top/bg_make_decisions.gif) repeat-y"; //doesn't want to work in Firefox
		}
		else if(hfile=="make_it_real_world"){
		    document.getElementById('make_it_real_world').innerHTML="<img src='../images/top/make_it_in_world_over.png' alt='Make It In The Real World' />";
		    //document.getElementById('content').style.background="url(../images/top/bg_make_it_real_world.gif) repeat-y"; //doesn't want to work in Firefox
		    document.getElementById('content_side_tile').style.background="url(../images/top/bg_make_it_real_world.gif) repeat-y";
		}
		
		if((hfile==hfolder)&&(hfolder!="register_now")&&(hfolder!="directions")&&(hfolder!="education")){ //if the page is the main page for the section
		isDefault="notTanted";
		}
		if(hfile=="register_now_thanks"){
		    hfile="register_now";
		}
		
		if(document.getElementById('ctl00_' + hfolder)==null){}
		else{document.getElementById('ctl00_' + hfolder).style.color='#E5F02E';} //main menu highlight
        
        queryVar = this.location.href;
        var inq = queryVar.indexOf('?');
        queryVar = queryVar.substring(inq + 1);
        
        if(queryVar=="id=0"){ //make it happen
            hfile=hfile+"_happen";
        }
        else if(queryVar=="id=2"){//make it different
            hfile=hfile+"_diff";
        }
        
		if((hfile=="default")||(hfile=="Default")||(hfile=="")){}
		else if (isDefault=="tanted"){ //if it has left nav to highlight
		    if(document.getElementById(hfile)==null){}
		    else{document.getElementById(hfile).className='live';}
		}
        
		navRender();
		initLightbox(); //added functions to this JS file 'cause it was conflicting with the onload

		if(is_mac){
			setTimeout("thatMac()",200); //fix extra footer space on mac IE
			document.getElementById("clearfooter").style.height= 20 + 'px';//fixes safari footer
		}
		
		init(); //png rollovers
	}
