var NS4 = false;
var IE4 = false;
var DOM = false;

popUpDim = new Array()
popUpDim['sample'] = ['leftOffset','top','width','height']
popUpDim['pressreleases'] = [35,100,490,490]
popUpDim['corner'] = [35,100,490,510]
popUpDim['news'] = [35,100,490,490]
popUpDim['newsrelease'] = [35,100,490,490]
popUpDim['articles'] = [35,100,490,490]
popUpDim['article'] = [35,100,490,490]
popUpDim['schedule'] = [35,100,550,490]
popUpDim['jobs'] = [100,25,650,550]
popUpDim['jobdetail'] = [25,75,750,550]
popUpDim['jobdescriptions'] = [5,25,650,550]
popUpDim['emailsubscription'] = [420,25,280,490]
popUpDim['olmsubscription'] = [420,25,280,490]
popUpDim['contactform'] = [420,25,400,490]
popUpDim['directions'] = [420,100,490,490]
popUpDim['contactformaux'] = [420,25,280,490]
popUpDim['values'] = [203,53,255,444]
popUpDim['culture'] = [223,73,255,444]
popUpDim['ourteam'] = [35,100,690,690]
popUpDim['factsheet'] = [243,93,255,420]
popUpDim['emailpolicy'] = [35,100,490,490]
popUpDim['privacy'] = [35,100,490,490]
popUpDim['terms'] = [35,100,490,490]
popUpDim['sitemap'] = [35,100,257,500]
popUpDim['staff'] = [35,100,511,490]
popUpDim['clientlist'] = [35,100,490,490]
popUpDim['membership'] = [35,100,490,490]
popUpDim['casestudy'] = [35,100,500,490]
popUpDim['contactmap'] = [35,100,295,294]
popUpDim['contract'] = [35,100,490,490]

popUpFile = new Array()
popUpFile['jobdescriptions'] = "jobs/job_description_base.htm"
popUpFile['newsrelease'] = "ournews/news_base.htm"
popUpFile['article'] = "ournews/articles_base.htm"
popUpFile['contactformaux'] = "contact/contact_base.htm"

if (document.getElementById) {
		DOM = true;
		doc = "document.getElementById('"
		sty = "').style";
}
if (document.layers) {
		NS4 = true;
		doc = "document['";
		sty = "']";
}
if (document.all && !DOM) {
		IE4 = true;
		doc = "document.all['";
		sty = "'].style";
}

function leaveon(i) {
	document.images[i].src = eval(i + "on.src");
}

function turnon(i,whichLayer) {
	if (i != currentpage) {
		if (NS4 && whichLayer) {
			menuLyr = eval(doc + whichLayer + sty);
			menuLyr.document[i].src = eval(i + "over.src");
		} else {
			document.images[i].src = eval(i + "over.src");
		}
	}
}

function turnoff(i,whichLayer) {
	if (i != currentpage) {
		if (NS4 && whichLayer) {
			menuLyr = eval(doc + whichLayer + sty);
			menuLyr.document[i].src = eval(i + "off.src");
		} else {
			document.images[i].src = eval(i + "off.src");
		}
	}
}

function openView(file,windowName,home) {
	leftPoint = measureScreen()
	leftPoint = leftPoint + popUpDim[windowName][0]
	if (windowName == 'jobdescriptions' || windowName == 'newsrelease' || windowName == 'article' || windowName == 'olmrelease' || windowName == 'casestudy' || windowName == 'contactformaux' || windowName == 'bios') {
		url = file
		file = popUpFile[windowName]
		if (!home) file = "../" + file;
		theWindowName = windowName;
		delay = 1500;
		hesitate = setTimeout('loadSubPage(url,theWindowName)',delay);
	}
	features = "left=" + leftPoint + ",top=" + popUpDim[windowName][1] + ",width=" + popUpDim[windowName][2] + ",height=" + popUpDim[windowName][3] + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no";
	eval("newWindow" + windowName + "= window.open( file, windowName, features)")
	eval("newWindow" + windowName + ".focus()");
}

function loadSubPage(url,windowName) {
	eval('newWindow' + windowName + '.top.content.location = url;')
	eval("newWindow" + windowName + ".focus()");
}

function measureScreen() {
	leftPoint = (screen.width < 710) ? 35 : Math.round((screen.width - 710) / 2);
	return leftPoint
}

function measureWindow() {
	if (document.layers) thewidth = innerWidth - 16
	if (document.all) thewidth = document.body.clientWidth 
	if (document.getElementById && !document.all) thewidth = innerWidth - 20
	referencepoint = Math.round((thewidth - 710) / 2)
	if (thewidth < 710) referencepoint = 0
	return referencepoint
}


function setUpLayers(layername,offset,hide) {
	leftPoint = measureWindow()
	menuLyr = eval(doc + layername + sty);
	menuLyr.left = leftPoint + offset
	if (!hide) {
		menuLyr.visibility = "visible"
	} else {
		menuLyr.visibility = "hidden"
	}
}

function turnPage(newPage) {
	if (newPage != pageMarker) {
		oldPageLayer = eval(doc + pageMarker + sty)
		newPageLayer = eval(doc + newPage + sty)
		oldPageLayer.visibility = "hidden"
		newPageLayer.visibility = "visible"
		pageMarker = newPage
	}
}

function hideLayer(theLayer) {
	layerToHide = eval(doc + theLayer + sty)
	layerToHide.visibility = "hidden"
}
		
function showLayer(theLayer) {
	layerToShow = eval(doc + theLayer + sty)
	layerToShow.visibility = "visible"
}

dateObj = new Date()
theMonth = dateObj.getMonth()
theDate = dateObj.getDate()
theDay = dateObj.getDay()
dayArray = [-1,0,1,2,3,4,5,6]
monthArray = ['January','February','March','April','May','June','July','August','September','October','November','December']
daysInMonthArray = [31,28,31,30,31,30,31,31,31,31,30,31]
theDate = theDate - dayArray[theDay]
if ( theDate < 1 ) {
	 theMonth = theMonth - 1
	 theDate = daysInMonthArray[theMonth] - dayArray[theDay - 1]
}
dateString = "Week of " + monthArray[theMonth] + " " + theDate + ", 2001"