var navSlider2;
var navAccordion;
var selNav;

var path = location.pathname;
path = path.slice(0,path.lastIndexOf('/',path.length-(/\/$/.test(path)?2:0))+(0?0:1))

switch (path) {
	case "#":	selNav = 0;	break;
	case "#":	selNav = 1;	break;
	case "#":	selNav = 2;	break;
	case "#":	selNav = 3;	break;
	case "#":	selNav = 4;	break;
	default:	selNav = -1;break;
}

window.addEvent('domready', function()
{
	navAccordion = new Accordion('a.navItem', 'div.navItem',
	{
		show: -1,
		alwaysHide: true,
		name: "navAcc",
		duration:200
	}, $('previewSlice'));

	//Fix for collapsing columns issue
	//for (var i=0; i < 4; i++) $('navItem' + i).style.display = "block";

	navAccordion.display(selNav);
});

/*
------------------------------------------------
PVII Equal CSS Columns scripts -Version 2
Copyright (c) 2005 Project Seven Development
www.projectseven.com
Version: 2.1.0
------------------------------------------------
*/
//v2.1.0 by PVII-www.projectseven.com

function P7_colH2()
{ 
	var i,oh,h=0,tg,el,np,dA=document.p7eqc,an=document.p7eqa;
	if(dA&&dA.length)
	{
		for(i=1;i<dA.length;i+=2) {dA[i+1].style.paddingBottom='';}
		for(i=1;i<dA.length;i+=2) 
		{
			oh=dA[i].offsetHeight;
			h=(oh>h)?oh:h;
		}
		for(i=1;i<dA.length;i+=2)
		{
			oh=dA[i].offsetHeight;
			if(oh<h)
			{
				np=h-oh;
				if(!an&&dA[0]==1)
				{
					P7_eqA2(dA[i+1].id,0,np);
				}
				else
				{
					dA[i+1].style.paddingBottom=np+"px";
				}
			}
		}
		document.p7eqa=1;
		document.p7eqth=document.body.offsetHeight;
		document.p7eqtw=document.body.offsetWidth;
	}
}

//v2.1.0 by PVII-www.projectseven.com
function P7_eqT2()
{
	if(document.p7eqth!=document.body.offsetHeight||document.p7eqtw!=document.body.offsetWidth){P7_colH2();}
}

//v2.1.0 by PVII-www.projectseven.com
function P7_equalCols2()
{ 
	var c,e,el;
	if(document.getElementById)
	{
		document.p7eqc=new Array();
		document.p7eqc[0]=arguments[0];
		for(i=1;i<arguments.length;i+=2)
		{
			el=null;
			c=document.getElementById(arguments[i]);
			if(c)
			{
				e=c.getElementsByTagName(arguments[i+1]);
				if(e)
				{
					el=e[e.length-1];
					if(!el.id)
					{
						el.id="p7eq"+i;
					}
				}
			}
			if(c&&el)
			{
				document.p7eqc[document.p7eqc.length]=c;document.p7eqc[document.p7eqc.length]=el;
				
			}
		}
		setInterval("P7_eqT2()",10);
	}
}

//v2.1.0 by PVII-www.projectseven.com
function P7_eqA2(el,p,pt)
{ 
	var sp=10,inc=20,g=document.getElementById(el);
	np=(p>=pt)?pt:p;
	g.style.paddingBottom=np+"px";
	if(np<pt)
	{
		np+=inc;
		setTimeout("P7_eqA2('"+el+"',"+np+","+pt+")",sp);
	}
}

//CODE FOR SHOWING PHOTO FRAME  TABLE
<!-- Copyright 2006,2007 Bontrager Connection, LLC
// http://bontragerconnection.com/ and http://willmaster.com/
// Version: July 28, 2007
var cX = 0; var cY = 0; var rX = 0; var rY = 0; var t = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
	rX = self.pageXOffset;
	rY = self.pageYOffset;
	}
else if(document.documentElement && document.documentElement.scrollTop) {
	rX = document.documentElement.scrollLeft;
	rY = document.documentElement.scrollTop;
	}
else if(document.body) {
	rX = document.body.scrollLeft;
	rY = document.body.scrollTop;
	}
if(document.all) {
	cX += rX; 
	cY += rY;
	}
//d.style.left = (cX+10) + "px";
//d.style.top = (cY+10) + "px";
d.style.left = "219px";
d.style.top = "121px";
}
//function HideContent(d) {
//if(d.length < 1) { return; }
//document.getElementById(d).style.display = "none";
//}
//function ShowContent(d) {
//if(d.length < 1) { return; }
//var dd = document.getElementById(d);
//AssignPosition(dd);
//dd.style.display = "block";
//}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}
//-->

//CODE FOR CAREERS DISPLAY

/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  Copyright 2001-3 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

// set these variables equal to the original top and left of layers
var orig_x=110;  // layers' left
var orig_y=65;	// layers' top

// onresize for ns4
var origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

var cur_lyr;	// holds id of currently visible layer
function swapLayers(id) {
  if (cur_lyr) hideLayer(cur_lyr);
  shiftLayerTo( id, orig_x, orig_y + getScrollY() );
  showLayer(id);
  cur_lyr = id;
	
	//Including function that expands the side nav
	expand_col();
}

function showLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.display = "block";
  //if (lyr && lyr.css) lyr.css.visibility = "visible";
}

function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.display = "none";
  //if (lyr && lyr.css) lyr.css.visibility = "hidden";
}

function shiftLayerTo(id,x,y) {
  var px = document.layers? 0: "px";
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) {
    lyr.css.top = y + px;
    lyr.css.left = x + px;
  }
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

// credit to http://www.13thparallel.org for the following function
// returns amount of vertical scroll
function getScrollY() {
	var sy = 0;
	if (document.documentElement && document.documentElement.scrollTop)
		sy = document.documentElement.scrollTop;
	else if (document.body && document.body.scrollTop) 
		sy = document.body.scrollTop; 
	else if (window.pageYOffset)
		sy = window.pageYOffset;
	else if (window.scrollY)
		sy = window.scrollY;
	return sy;
}
//-->
