var navvar = new Array(
	"home",
	"who",
	"solutions",
	"clients",
	"leadership")

var altvar = new Array(
	"Home",
	"Who We Are",
	"Our Products and Solutions",
	"Our Clients and Results",
	"Thought Leadership")

var urlvar = document.location + "";
if (urlvar.search("-") == -1) {
	var namevar = urlvar.substring((urlvar.lastIndexOf("/") + 1),urlvar.lastIndexOf("."));
}
else {
	var namevar = urlvar.substring((urlvar.lastIndexOf("/") + 1),urlvar.lastIndexOf("-"));
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

   NS4 = (document.layers);
   NS6 =  ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 5))
   IE4 = (document.all);
  ver4 = (NS4 || IE4);
 MAC45 = (navigator.appVersion.indexOf("MSIE 4.5") != -1)
 isMac = (navigator.appVersion.indexOf("Mac") != -1);
 menuHeight=40;
 menuOffset=0;
 menuBarHeight=40;
var overmenu = false;
var openmenu = null;
var overcheck = null;
var loaded = false;

function stripCharsNotInBag (s, bag)

{   var i;
    var returnString = "";

    // Search through string's characters one by one.
    // If character is in bag, append to returnString.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) != -1) returnString += c;
    }

    return returnString;
}
 
 
function getRealLeft(img) {
// Find Position of Image File
	xPos = img.offsetLeft;
	tempEl = img.offsetParent;
  	while (tempEl != null) {
  		xPos += tempEl.offsetLeft;
  		tempEl = tempEl.offsetParent;
  	}
	return xPos;
}

function getRealTop(img) {
// Find Position of Image File
	yPos = img.offsetTop;
	tempEl = img.offsetParent;
	while (tempEl != null) {
  		yPos += tempEl.offsetTop;
  		tempEl = tempEl.offsetParent;
  	}
	if (MAC45) yPos=menuOffset;
	return yPos;
	}

function findloc (imgname)
// Find Position of Image File
{
var holdingImage = document.images[imgname];
var canvasLeft = (NS4) ? holdingImage.x : getRealLeft(holdingImage);
var canvasTop = (NS4) ? holdingImage.y : getRealTop(holdingImage);
var canvasWidth = holdingImage.width;
var canvasHeight = holdingImage.height;
return ([canvasLeft,canvasTop,canvasHeight]);
}

function showMenu(imgname) 
// Show Menu Layer
{	if (NS4 || loaded)
	{
		if (NS6) 
			menu=document.getElementById(imgname+"layer")
		else if (NS4)
			menu=eval("document.layers."+imgname+"layer")
		else
			menu=eval(imgname+"layer");
	}
	if (NS4) menu.visibility = "show"
	else menu.style.visibility = "visible"
	openmenu=imgname;
}

function hideMenu() 
// Hide Menu Layer
{
if (openmenu != null)
	{
		if (NS6) 
			menu=document.getElementById(openmenu+"layer")
		else if (NS4)
			menu=eval("document.layers."+openmenu+"layer")
		else
			menu=eval(openmenu+"layer");
	    if (NS4) menu.visibility = "hide"
	    else menu.style.visibility = "hidden"
		img_inact(openmenu)
	}
}

function popup (imgname)
// Pop Up Menu
{
	if (NS6) 
		menu=document.getElementById(imgname+"layer")
	else if (NS4)
		menu=eval("document.layers."+imgname+"layer")
	else
		menu=eval(imgname+"layer");
if (NS4)
{
	menu.top = findloc(imgname)[1] + 1 + menuBarHeight;
	menu.left = findloc(imgname)[0];
}
else if (NS6)
{
	menu.style.top = findloc(imgname)[1] + 1 + menuBarHeight;
	menu.style.left = findloc(imgname)[0];
}
else
{
	menu.style.pixelTop = findloc(imgname)[1] + 1 + menuBarHeight;
	menu.style.pixelLeft = findloc(imgname)[0];
}
showMenu(imgname);
}

function checkmenu (openmenu,check)
// Check to see if menu is open but not used, if so it is closed
{
if ((overmenu == 0) && (check == overcheck))
{
		if (NS6) 
			menu=document.getElementById(openmenu+"layer")
		else if (NS4)
			menu=eval("document.layers."+openmenu+"layer")
		else
			menu=eval(openmenu+"layer");
	    if (NS4) menu.visibility = "hide"
	    else menu.style.visibility = "hidden"
		img_inact(openmenu)
}
}

function menutimeout (openmenu)
// Set a .5 second timeout when the menu is not being used to close
{
overcheck=overcheck+1;
setTimeout("checkmenu(openmenu,"+overcheck+")",500);
}

function tocItem (name) {
this.on = new Image();
this.on.src = "http://www.epsilon.com/images/n-" + name + "-roll.gif"
this.off = new Image();
this.off.src = "http://www.epsilon.com/images/n-" + name + ".gif"
}

function toc_new (name) {
tocItem[name] = new tocItem(name);
}

function img_act (imgName)
// Show Image
{
if (document.images) 
	document[imgName].src = tocItem[imgName].on.src
}

function img_inact (imgName, openmenu)
// Hide Image
{
if (document.images) 
    document[imgName].src = tocItem[imgName].off.src;
}

function menuimg_act(imgName, openmenu, main) {
if (document.images) {
if ((openmenu == null) || (IE4) || (NS6))
	img_act(imgName)
else
	{
	image= eval("document.layers."+openmenu+"layer.document.images['"+imgName+"']");
	image.src = tocItem[imgName].on.src;
	}
}
overmenu=1;
}

function menuimg_inact(imgName, openmenu, main) {
if (document.images) {
if ((openmenu == null) || (IE4) || (main != null) || (NS6))
	img_inact(imgName)
else
	{
	image= eval("document.layers."+openmenu+"layer.document.images['"+imgName+"']");
	image.src = tocItem[imgName].off.src;
	}
}
menutimeout(openmenu);
overmenu=0;
}

if (document.images != null) {
toc_new('home');
toc_new('who');
toc_new('solutions');
toc_new('clients');
toc_new('leadership');
toc_new('homeon');
toc_new('whoon');
toc_new('solutionson');
toc_new('clientson');
toc_new('leadershipon');
}

browser_name = navigator.appName;
browser_version = parseFloat(navigator.appVersion); 

if (browser_name == "Netscape" && browser_version >= 3.0) {
	roll = 'true';
	}

else if (browser_name == "Microsoft Internet Explorer" && browser_version >= 4.0) {
	roll = 'true';
	}

else {
	roll = 'false';
    }

arImageSrc = new Array (
	"http://www.epsilon.com/images/n2-careers-roll.gif",
	"http://www.epsilon.com/images/n2-item1a-roll.gif",
	"http://www.epsilon.com/images/n2-item1b-roll.gif",
	"http://www.epsilon.com/images/n2-item2a-roll.gif",
	"http://www.epsilon.com/images/n2-item2b-roll.gif",
	"http://www.epsilon.com/images/n2-item3a-roll.gif",
	"http://www.epsilon.com/images/n2-item3b-roll.gif",
	"http://www.epsilon.com/images/n2-leadership-roll.gif",
	"http://www.epsilon.com/images/n2-list-roll.gif",
	"http://www.epsilon.com/images/n2-locations-roll.gif",
	"http://www.epsilon.com/images/n2-operating-roll.gif",
	"http://www.epsilon.com/images/n2-studies-roll.gif",
	"http://www.epsilon.com/images/n2-testimonials-roll.gif")

arImageList = new Array ();
	for (counter in arImageSrc) {
		arImageList[counter] = new Image();
		arImageList[counter].src = arImageSrc[counter];
	}

function msover(img1,ref1) {
	if (roll == 'true') {
		document.images[img1].src = ref1;
		}
	}
        
function msout(img1,ref1) {
	if (roll == 'true') {
		document.images[img1].src = ref1;
		}
	}
	
function ValidateInput(){
    if (document.contact.Contact_FName.value == "" || document.contact.Contact_LName.value == "")
	 {
	 alert('Please enter both first and last name');
	 return false;
	 }
	else if (document.contact.Contact_Company.value == "")
	   {
		alert('Please enter Company name');
		return false;
	   }
	else if (document.contact.Contact_Add1.value == "")
	   {
		alert('Please enter Address');
		return false;
	   }
	else if (document.contact.Contact_City.value == "")
	   {
		alert('Please enter City');
		return false;
	   }
	else if (document.contact.Contact_State.value == "")
	   {
		alert('Please enter State');
		return false;
	   }
	else if (document.contact.Contact_zip.value == "")
	   {
		alert('Please enter your zip code');
		return false;
	   }
	else if (document.contact.Contact_Phone.value == "")
	   {
		alert('Please enter a valid contact phone number');
		return false;
	   }
	else if (document.contact.Contact_Email.value == "")
	   {
		alert('Please enter a valid email address');
		return false;
	   }
	document.contact.submit();
	}
