
//==============================================================//
//  TO ADD AN ITEM TO THE LEFT NAV AREA FIND THE COMMENT BELOW  //
//==============================================================//

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 (
	"/images/n1-insurance-on.gif",
	"/images/n1-products-on.gif",
	"/images/n1-hospital-on.gif",
	"/images/n1-employee-on.gif",
	"/images/r-insurance.gif",
	"/images/r-products.gif",
	"/images/r-hospital.gif",
	"/images/r-employee.gif")

arImageList = new Array ();
	for (counter in arImageSrc) {
		arImageList[counter] = new Image();
		arImageList[counter].src = arImageSrc[counter];
	}

function msover1(img1,ref1) {
	if (roll == 'true') {
		document.images[img1].src = ref1;
		}
	}
        
function msout1(img1,ref1) {
	if (roll == 'true') {
		document.images[img1].src = ref1;
		}
	}

function msover2(img1,ref1,img2,ref2) {
	if (roll == 'true') {
		document.images[img1].src = ref1;
		document.images[img2].src = ref2;
		}
	}
        
function msout2(img1,ref1,img2,ref2) {
	if (roll == 'true') {
		document.images[img1].src = ref1;
		document.images[img2].src = ref2;
		}
	}

var navvar = new Array(
	"insurance/default",
	"products/default",
	"hospital/default",
	"employee/default",
	"home",
	"about/default",
	"news/default",
	"contact/default",
	"toolkit/default",
	"sitemap/default")

var altvar = new Array(
	"insurance",
	"medical products/pharma",
	"hospital",
	"employee benefits",
	"home",
	"about us",
	"news room",
	"contact us",
	"researcher's toolkit",
	"site map")

var urlvar = document.location + "";
//mpsencik 7/10/2003 - modified to get folder name instead of first portion of file name for namevar
if (urlvar.search("-") == -1) {
	if (urlvar.indexOf("/",urlvar.search(".com")+5)==-1){
		var namevar = "home";
	}
	else {
		var namevar = urlvar.substring(urlvar.search(".com")+5,urlvar.indexOf("/",urlvar.search(".com")+5));
		//var namevar = urlvar.substring((urlvar.lastIndexOf("/") + 1),urlvar.lastIndexOf("."));
	}
	var subvar = urlvar.substring((urlvar.lastIndexOf("/") + 1),urlvar.lastIndexOf("."));
	var pagevar = "";
}
else {
	var namevar = urlvar.substring((urlvar.lastIndexOf("/") + 1),urlvar.lastIndexOf("-"));
	if (urlvar.search("_") == -1) {
		var subvar = urlvar.substring((urlvar.lastIndexOf("-") + 1),urlvar.lastIndexOf("."));
		var pagevar = "";
	}
	else {
		var subvar = urlvar.substring((urlvar.lastIndexOf("-") + 1),urlvar.lastIndexOf("_"));
		var pagevar = urlvar.substring((urlvar.lastIndexOf("_") + 1),urlvar.lastIndexOf("."));
	}
}

var printvar = urlvar.substring(0,urlvar.lastIndexOf("#")) + "?mode=print";
var photovar = "<img src='/images/p-" + namevar + ".jpg' width=223 height=191><br>";

var titlevar="";
for (i=0; i<10; i++) {
	var navvar_x = navvar[i].substring(0,navvar[i].indexOf("/"));
	if (navvar_x == namevar) {
	titlevar = altvar[i];
	}

}

var titletagvar = "<title>DSS Research: A Full Service Health Care Marketing Research and Consulting Firm | " + titlevar + "</title>"

function printmode() {
window.open(printvar,'_blank','menubar=1,width=500,height=550,toolbar=1,scrollbars=1,resizable=1,screenX=50,left=50,screenY=50,top=50');
return false;
}

//===========================================================//
//                 BEGIN LEFT NAV ADDITION                   //
//===========================================================//
//  ADD THE 2nd PART OF THE NEW FILE NAME TO THE linkurlvar  //
// ADD THE NEW PAGE'S TOPIC TO THE altvar TO THE linktextvar //
//===========================================================//


/*
10/14/2004 - M Psencik
The following three lines have been remarked out, because they are likely not being used anymore.
After enough time has passed and this is confirm (due to lack of errors) they should be removed.
*/
//var linkurlvar="";
//var linktextvar="";
//var nSidebar=0;

function BuildSideMenu(sCurrent)
	{
	/*
	sCurrent (optional) is the menu number (specified in the menu.js file) of the menu item that should be highlighted
	Example:
		BuildSideMenu(".2b");	This will highlight the menu item whose number is ".2b"
		or
		BuildSideMenu();		This will highligh the current menu item
	*/
	var sM="";
	var x=0;
	var aRow=new Array();
	var sX="";
	var sArrow="";
	var sStyle="";
	var sMouse="";
	var sSeparator="<tr><td colspan=2 background='/images/d-3.gif'><img src='/images/spacer.gif' width=1 height=1></td></tr>";
	
	//if sCurrent is not passed in find it by comparing the location to the url in the array
	if(!sCurrent)
		{
		var sLoc = document.location + "";
		var sPath = sLoc.substring(sLoc.indexOf("/",sLoc.search(".com")));	
		sPath=sPath.toLowerCase();
		for(x=0;x<aMenu.length;x++)
			{
			aRow=aMenu[x].split("|");
			aRow[2]=trim(aRow[2]);
			if(aRow[2]==sPath){sCurrent=trim(aRow[0]);}
			}
		}
		
	sM+='<div style="padding:5px;">'
	sM+="<span class=subnavtitle>inside this section:</span><br>";
	sM+="<img src='/images/spacer.gif' width=1 height=10><br>";
	sM+="<table width='100%' cellspacing=0 cellpadding=3 border=0>";
	for(x=0;x<aMenu.length;x++)
		{
		aRow=aMenu[x].split("|");
		
		//Remove Trailing spaces
		aRow[0]=trim(aRow[0]);
		aRow[1]=trim(aRow[1]);
		aRow[2]=trim(aRow[2]);
		
		//initialize style, right icon and mouseover script
		sStyle="";
		sArrow="";
		sMouse='onmouseover="Highlight(this)" onmouseout="Highlight(this)"';
		if(aRow[0]==sCurrent)	//set the style and right icon for the current item
			{
			sStyle+="background-color:lightgrey;";
			sArrow="&nbsp;&#187;&nbsp;";
			sMouse="";
			}
			
		sX=aRow[0];	//put the hieracy ID in a variable so we can modify it without modifing the array
		if(sX.length>1){sX=sX.substring(0,sX.length-1);} //Remove the righ most character from the heirachy ID for comparing to sCurrent			
		if(sX.length==1)	//this is a top level item
			{
			sM+=sSeparator;	//Show separator between all top level items
			sStyle+="font-weight:bold;";	//set top level items to bold
			}
		if(sX.length==1||sX==sCurrent.substring(0,sX.length))
			{
			sM+='<tr style="'+sStyle+'" '+sMouse+' onclick="top.window.location=\''+aRow[2]+'\'">'
			sM+='<td>'+MenuSpace(aRow[0].length-1)+aRow[1]+'</td>'
			sM+='<td>'+sArrow+'</td>'
			sM+='</tr>'
			}
		}
		sM+=sSeparator;
		sM+='</table>'
		sM+='</div>'
	document.write(sM);
	}
function Highlight(oRow)
	{
	var sColor="white";
	if(oRow.style.backgroundColor==sColor){sColor="";}
	oRow.style.backgroundColor=sColor;
	}
function MenuSpace(nLevel)
	{
	var sOut="";
	if(nLevel>1){sOut='<img src="/images/spacer.gif" height="1" width="'+(nLevel-1)*8+'">';}
	return sOut;
	}
function trim(sX) 
	{ 
	var rX = /^\s*|\s*$/gi;
	sX=sX.replace(rX,'')
	return sX;
	} 
function BuildSubtitle(sA,sB)
	{
	/* 
	sA (optional) is the left portion of the subtitle (I.E. The Parent Menu Item)
	sB (optional) is the right portion of the subtitle (I.E. The current page)
	If one (sA or sB) is specified, they must both be specified
	If neither is specified the next menu item will be used
	*/
	//if sA and sB are not passed in, find them by comparing the location to the url in the array
	if(!sA&&!sB)
		{
		var x=0;
		var sLoc = document.location + "";
		var sPath = sLoc.substring(sLoc.indexOf("/",sLoc.search(".com")));	
		var sCurrent="";
		sPath=sPath.toLowerCase();

		//The print mode feature uses a query string so remove any query string args 
		//so the path will match the path specified in the menu
		if(sPath.indexOf("?")>0){sPath=sPath.substring(0,sPath.indexOf("?"));}

		while(x<aMenu.length)
			{
			aRow=aMenu[x].split("|");
			aRow[2]=trim(aRow[2]);
			if(aRow[2]==sPath)
				{
				sB=trim(aRow[1]);
				sCurrent=trim(aRow[0]);
				break;
				}
			x++;
			}
		if(sCurrent!="")
			{
			x=0;
			while(x<aMenu.length)
				{
				aRow=aMenu[x].split("|");
				aRow[0]=trim(aRow[0]);
				if(sCurrent.substring(0,2)==aRow[0])
					{
					sA=trim(aRow[1]);
					break;
					}
				x++;
				}
			}
		}
	if(sA="undefined"){sA="";}
	if(sB="undefined"){sB="";}
	var sX="";
	sX="<span class=pagetitle>"+sA+"</span>";

	if(sB!="")
		{
		if(document.title.indexOf(":")<=0){document.title="DSS Research: " + sB;}
		if(sA!=""){sB=": "+sB;}
		sX=sX+"<span class=pagesubtitle>"+sB+"</span>";
		}
	else
	    {
	    if(document.title.indexOf(":")<=0){document.title="DSS Research: " + sA;}
	    }
	document.write(sX);
	sX="";
	}
function BuildNextTopic(sTitle, sLocation)
	{
	/* 
	sTitle (optional) is the descriptive title on the next topic
	sLocation (optional) is the location (url) of the page for the next topic
	If one (sTitle or sLocation) is specified, they must both be specified
	If neither is specified the next menu item will be used	
	Example: 
		BuildNextTopic("The Page Title","xyz.asp");	This option will display "The Page Title" and link to "xyz.asp"
		or 
		BuildNextTopic();							This option will display the name of the next menu item and link to the same

	7/1/2005 - M. Psencik -----------------------------------------------------
	Added wrapper to hide the next topic section if the page requires that the user be logged in and he/she is not.
	The presence of an element with id=security_login indicates that the user needs to login
	*/
	
	if(!document.getElementById("security_login"))
		{
		var aRow = new Array();
		var x=0;
		var sM="";

		//if sTitle and sLocation are not passed in use the next item in the menu
		if(!sLocation)
			{
			var sLoc = document.location + "";
			var sPath = sLoc.substring(sLoc.indexOf("/",sLoc.search(".com")));
			sPath=sPath.toLowerCase();
			while(x<aMenu.length)
				{
				aRow=aMenu[x].split("|");
				x++;
				aRow[2]=trim(aRow[2]);
				if(aRow[2]==sPath)
					{
					//if this is the last page in the array move back to the first
					if(x>=aMenu.length){x=0;}
					aRow=aMenu[x].split("|");
					sLocation=trim(aRow[2]);
					sTitle=trim(aRow[1]);
					break;
					}
				}
			}
		if(sLocation)
			{
			sM+="<table width='100%' cellspacing=0 cellpadding=0>";
			sM+="<tr><td background='/images/d-3.gif'><em><img src='/images/spacer.gif' width=1 height=7></em></td></tr>";
			sM+="<tr>";
			sM+="<td align=right style='padding: 5px;'>Next Topic: &nbsp; <a href='"+sLocation+"' style='color: #006699;'>"+sTitle+"</a> &nbsp;&#187;</td>";
			sM+="</tr>";
			sM+="<tr><td><em><img src='/images/spacer.gif' width=1 height=20></em></td></tr>";
			sM+="</table>";
			}
		document.write(sM);
		sM="";
		}
	}

