//--------------------------------------------------------------------------------------------
//switch to http if running in https and we are not in the asset-performance folder
//switch to https if running in http and we are in the asset-performance folder
//--------------------------------------------------------------------------------------------
var thisPagesURLpath = document.location.href.toLowerCase();
var thisPagesProtocol = document.location.protocol.toLowerCase();
var switchToHttpsPath = "";
var switchToHttpPath = "";

if (thisPagesURLpath.indexOf("home.asp") != -1) {
	//alert("don't run");	//don't run this code on the home.asp
}
else if ((thisPagesURLpath.indexOf("/asset-performance") != -1) 
	|| (thisPagesURLpath.indexOf("/asset%2dperformance") != -1)
	|| (thisPagesURLpath.indexOf("/assetandperformance") != -1) 
	|| (thisPagesURLpath.indexOf("/commissionrecapture") != -1) ) {
	if(thisPagesProtocol.indexOf("http:") != -1 ) {
		switchToHttpsPath = "https://" + self.location.hostname + self.location.pathname;
		//alert("Now switching to SSL\n" + switchToHttpsPath);
		top.location.href=switchToHttpsPath;
	}
	else {
		//alert("already https");	// already https
	}
}	
else if(thisPagesProtocol.indexOf("https:") != -1 ) {
	switchToHttpPath = "http://" + self.location.hostname + self.location.pathname;
	//alert("Now switching to HTTP\n" + switchToHttpPath);
	top.location.href=switchToHttpPath;
}

//--------------------------------------------------------------------------------------------
// Sniff Browser Type to see if we have version 4 or better in Netscape or IE
//--------------------------------------------------------------------------------------------
var isNav
var isIE
var isIE4
var isIE5
var isIE6 	// pjwNS6andIE6   added this line 
var isNS6 	// pjwNS6andIE6   added this line
var isMAC
isNS6 = false; 	// pjwNS6andIE6   added this line

isMAC = navigator.userAgent.indexOf("Mac");

if (parseInt(navigator.appVersion) >= 4) 
{
	
    if (navigator.appName == "Netscape") 
	{
		var tail = navigator.appVersion.indexOf(' ')
		var version = parseFloat(navigator.appVersion.substring(0,tail))
		
		if (version < 4.05) //then this is a bad version of the stand alone Navigator
		{
			gotoUpgradeBrowserPage();
		}
		if (version >= 4.05 && version <= 4.08) //then this is a GOOD version of stand alone navigator
		{
			isNav = true;
		}
		if (version > 4.08 && version < 4.5) //then this is a bad version of Communicator
		{
			gotoUpgradeBrowserPage();
		} 
		
		// pjwNS6andIE6   added the following "if ..." 
		if (version >= 5) //then this is NS 6.0
		{
			isIE = true;
			isIE5 = true;
			isNS6 = true;
		} 
		
		
		if (version >= 4.5) //then this is a GOOD version of Communicator
		{
			isNav = true;
		}	
    }
    else 
	{
        isIE = true;
                
        if (navigator.appVersion.indexOf("MSIE 5") == -1)
		{
			isIE4 = true;
		}
		
		// pjwNS6andIE6   added the following "if ..." 
		if (version > 5) //then this is IE 6.0 so tell it it's ie5
		{
			isIE = true;
			isIE5 = true;
			isIE6 = true;
			//alert('I am IE6');
		} 
		
		//2006-10-16: Added because the menus stay open in IE7 
		//navigator.appVersion: 4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)
		if (navigator.appVersion.indexOf("MSIE 7") != -1)
		{
			// manage as IE6
			isIE6 = true;
		}		
		
		
		if (navigator.appVersion.indexOf("MSIE 5") != -1)
		{
			isIE5 = true;
			//alert('I am IE5');
		}
	}
}
else 
{
	gotoUpgradeBrowserPage();
}

function gotoUpgradeBrowserPage()
{
	top.location.href="/public/upgradeBrowser.htm"
}

//--------------------------------------------------------------------------------------------
// Function to SHOW the sub-menu when it is moused-over on the north nav bar
//--------------------------------------------------------------------------------------------
var openedMenu = 0
function showMenu(menuNumber) {

				if (isMAC > -1) { 
				   	return(0); }
				
				// pjwNS6andIE6   added the following "if (isNS6 || isIE6) { ..." statement
				if (isNS6 || isIE6) {
					if (isNS6) {
						// because Netscape 6.0 leaves the menus open unless you exit by moving the mouse
						// up and off the menu or past one of the bordering columns surrounding the menu,
						// then we must close any opened menus before we open a new one
						if (openedMenu != 0) {
							var hide = "document.getElementById(\"" + "ieLayer" + openedMenu + "\").style.visibility=\"hidden\"";
							eval (hide);
							}
						}
					
					var show = "document.getElementById(\"" + "ieLayer" + menuNumber + "\").style.visibility=\"visible\"";
					eval (show);
					openedMenu = menuNumber
                    }
					
				else if (isNav) {
						var show = "document." + "nsLayer" + menuNumber + ".visibility=\"visible\"";
                        eval (show);
                        }
                else {
				
						if (isIE4) 
							{
							//because IE4 leaves the menus open unless you exit by moving the mouse
							//up and off the menu or past one of the bordering columns surrounding the menu,
							//then we must close any opened menus before we open a new one
							if (openedMenu != 0)
								{
								var hide = "document.all." + "ieLayer" + openedMenu + ".style.visibility=\"hidden\"";
								eval (hide);
								window.event.cancelBubble=true
								}
							}
						var show = "document.all." + "ieLayer" + menuNumber + ".style.visibility=\"visible\"";
						eval (show);
						window.event.cancelBubble=true
						openedMenu = menuNumber
					} 
				return(0); // added this line to fix a problem in Netscape 4.05 
                }
                
//--------------------------------------------------------------------------------------------
// Function to HIDE the sub-menu when it is moused-out on the north nav bar
//--------------------------------------------------------------------------------------------
function hideMenu(menuNumber) {

				// pjwNS6andIE6   added the following "if (isNS6 || isIE6) { ..." statement
				if (isNS6 || isIE6) {
						var hide = "document.getElementById(\"" + "ieLayer" + menuNumber + "\").style.visibility=\"hidden\"";
                        eval (hide);
						   }

                else if (isNav) {
						var hide = "document." + "nsLayer" + menuNumber + ".visibility=\"hide\"";
                        eval (hide);
						   }
               
                else if (isIE5 || isIE4){
						var hide = "document.all." + "ieLayer" + menuNumber + ".style.visibility=\"hidden\"";
                        eval (hide);
                        }
                }
                

//--------------------------------------------------------------------------------------------
// Function to HIDE or SHOW the QuickGuide menu when the tab is clicked and when page is loaded
//--------------------------------------------------------------------------------------------
var hideShow
function HideOrShowQuickGuide() 
{
	
	//now, hide or show the menu when user clicks the toggle switch and/or depending
	//on the value in the cookie when the page loads
        if (j % 2)
		{
		//alert(' j = ' + j + ' and j % 2 = ' + (j % 2));
				// pjwNS6andIE6   added the following "if (isNS6 || isIE6) ..." statement
				if (isNS6 || isIE6) 
					{
						document.getElementById("ieQuickGuideMenu").style.visibility="visible";
                    	hideShow="show";
					}
                else if (isNav) 
					{
                        document.nsQuickGuideMenu.visibility="visible";
                        hideShow="show";
					}
				else 
					{
                        document.all.ieQuickGuideMenu.style.visibility="visible";
                        hideShow="show";
					}
        }
        else 
        {
        //alert(' j = ' + j + ' and j % 2 = ' + (j % 2));
				// pjwNS6andIE6   added the following "if (isNS6 || isIE6) ..." statement
				if (isNS6 || isIE6) 
					{
						document.getElementById("ieQuickGuideMenu").style.visibility="hidden";
                    	hideShow="hide";
					}
                else if (isNav)
					{
                        document.nsQuickGuideMenu.visibility="hidden";
                        hideShow="hide";
					}
				else
					{
                        document.all.ieQuickGuideMenu.style.visibility="hidden";
                        hideShow="hide";
					}
        }               
        
		//write the value of i to the QuickGuide cookie to track if QuickGuide is Opened or Closed
		//across pages. 
		var today = new Date();
		var expire = new Date();
		expire.setTime(today.getTime() + 1000*60*60*24*365);
		document.cookie = "hideOrShow=" + hideShow + ";expires="+expire.toGMTString()+";Path=/";

		j += 1;
        if (j > 2) j = 1;
}
//--------------------------------------------------------------------------------------------
// Function to jump to a new page from Drop-List
//--------------------------------------------------------------------------------------------

//this function loads the new page into the existing browser window
function dropAndGo(theSelectList)
{
var selectValue, arrSplitForm, windowTarget
selectValue = theSelectList[theSelectList.selectedIndex].value
arrSplitForm = selectValue.split("###");
windowTarget = arrSplitForm[1]


if (theSelectList[theSelectList.selectedIndex].value == '###')
			window.parent.self.status=" Goes Nowhere";
if (windowTarget=='blank')
	{
	popUpWithToolbar(arrSplitForm[0])
	}
if (windowTarget=='top')
	{
	top.location.href=(arrSplitForm[0]);
	}
if (windowTarget=='newEx')
	{
	popUp(arrSplitForm[0],arrSplitForm[2],arrSplitForm[3])
	}
if (windowTarget=='newIn')
	{
	popUp(arrSplitForm[0],arrSplitForm[2],arrSplitForm[3])
	}
if (windowTarget=='WebCast') {
		popUpWebcast(arrSplitForm[0],arrSplitForm[2],arrSplitForm[3],arrSplitForm[4],arrSplitForm[5])
	}
}

//------------------------------------------------------------
//this function pops the new page open in a new browser window
function dropAndPop(form)
{
var page = form.page.options[form.page.selectedIndex].value;
window.open(page);  //redirect 
}

//------------------------------------------------------------
function writeTOPrintWin()
{
	printWin.window.document.write("<html><head><title>Printer Friendly Version</title><LINK rel='stylesheet' type='text/css' href='/InvestmentManagement/navigation/style.css'/></head><body>");
	printWin.window.document.write(document.printForm.stuffToPrint.value);
	printWin.window.document.write("<br><br><img align='top' src='/images/blackline.gif ' width='100%' height='1'><br><br><Div align='left'><table cellpadding='0', cellspacing='0', width='100%'><tr><td align='left'  class='disclaimer' >Copyright &#169; Frank Russell Company 2001. All rights reserved.</td><td align='right'><img src='/images/russell_logo.gif' border='0'></td></tr></table></div></body></html>");
	printWin.window.document.close();
}

//--------------------------------------------------------------------------------------------
// Open Printer Friendly Page
//--------------------------------------------------------------------------------------------
function openPrintPage(url,winWidth,winHeight) {
var winWidth
var winHeight
if (winWidth == '' || winWidth == null || winWidth == 'undefined')
{
	winWidth = parseInt(660);
	winHeight = parseInt(450);
}
if (winWidth != '' && winWidth != null && winWidth != 'undefined')
{
	winWidth = parseInt(winWidth);
	winHeight = parseInt(winHeight);
}

winWidth = winWidth + 17  // this is to account for room in the scrollbar for IE

if (url == '' || url =='undefined')
	{
	printWin = window.open('', null,' menu=0,menubar=1,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,copyhistory=0,top=100,left=115,width=' + winWidth + ',height=' + winHeight);
	printWin.window.document.open();
	//Some Netscape browsers need us to wait a second before writing content into the new window
	setTimeout("writeTOPrintWin()",1000)
	}
else
	{
	printWin = window.open(url, null,' menu=0,menubar=1,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,copyhistory=0,top=100,left=115,width=' + winWidth + ',height=' + winHeight);
	}

}

//--------------------------------------------------------------------------------------------
// PopUp a PowerPoint Player  
//--------------------------------------------------------------------------------------------
function launchPPplayer(startFile, pWidth, pHeight)
{ 
var winWidth
var winHeight
if (pHeight == "")
	{
	winHeight = 480;
	}
	else
	{
	winHeight = parseInt(pHeight);
	}
	
	if (pWidth == "")
	{
	winWidth = 740;
	}
	else
	{
	winWidth = parseInt(pWidth);
	}

	var URLstring = escape(startFile)  
	mediaWindow = window.open(URLstring ,'ppplayer','menu=0,menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=0,copyhistory=0,top=20,left=20,width=' + winWidth + ',height=' + winHeight);
}

//--------------------------------------------------------------------------------------------
// PopUp a Window 
//--------------------------------------------------------------------------------------------
var winWidth
var winHeight

function popUp(url, winWidth, winHeight){

winHeight = parseInt(winHeight);
winWidth = parseInt(winWidth);

winWidth = winWidth + 17  // this is to acount for room in the scrollbar for IE
			
popUpWindow = window.open(url, null,' menu=0,menubar=1,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,copyhistory=0,top=120,left=115,width=' + winWidth + ',height=' + winHeight);
popUpWindow.focus();
} 

//--------------------------------------------------------------------------------------------
// PopUp a Window With Everything 
//--------------------------------------------------------------------------------------------
function popUpWithToolbar(url){
		
popUpWindow = window.open(url, null,' menu=1,menubar=1,toolbar=1,location=0,directories=1,status=1,scrollbars=1,resizable=1,copyhistory=1,top=120,left=115');
popUpWindow.focus();
} 

//--------------------------------------------------------------------------------------------
// PopUp a Window With Everything 
//--------------------------------------------------------------------------------------------
function popUpWithNothing(url, winWidth, winHeight){
		
popUpWindow = window.open(url, null,' menu=0,menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=0,copyhistory=0,top=120,left=115,width=' + winWidth + ',height=' + winHeight);
popUpWindow.focus();
} 

//--------------------------------------------------------------------------------------------
// PopUp a Document Manager Window 
//--------------------------------------------------------------------------------------------
function popUpDocManager(url){

var winWidth
var winHeight
var sliced

winHeight = parseInt(480);
winWidth = parseInt(680);

winWidth = winWidth + 17  // this is to account for room in the scrollbar for IE
sliced = url.slice(0, 7)

	if (sliced == "http://") {
		window.open(url, null,' menu=1,menubar=1,toolbar=1,location=1,directories=0,status=0,scrollbars=1,resizable=1,copyhistory=0,top=60,left=75,width=' + winWidth + ',height=' + winHeight);
	}else{
		location.href=url;
	}

}

//--------------------------------------------------------------------------------------------
// Date Stamp Function
//--------------------------------------------------------------------------------------------
function dateStamp()
{
today = new Date()
mm=today.getMonth()+1;
if(mm==1) date="January";
	if(mm==2) date="February";
	if(mm==3) date="March";
	if(mm==4) date="April";
	if(mm==5) date="May";
	if(mm==6) date="June";
	if(mm==7) date="July";
	if(mm==8) date="August";
	if(mm==9) date="September";
	if(mm==10) date="October";
	if(mm==11) date="November";
	if(mm==12) date="December";

yy=today.getFullYear();

if (yy <= 99)
	{
	yy = yy + 1900;
	}
document.write(date," ",today.getDate(),", ",yy);
}

//--------------------------------------------------------------------------------------------
// Add Frames (for Home page)
//--------------------------------------------------------------------------------------------
function addHomePageFrames()
{
	var numFrames = top.frames.length;
	//alert(numFrames);

	if (numFrames == 0) top.location.href= 'default.asp'

}

//------------------------------------------------------------
// Start search page function
//------------------------------------------------------------
function searchValidateNewSearch() {
	if (document.forms[0].query.value.length > 0) {
		return true;
	} else {
		document.forms[0].query.focus();
		return false;
	}
}

//------------------------------------------------------------
function searchSyncInput(passedVal) {
	document.forms[0].txtquery.value = passedVal;
	document.forms[0].txtquerybot.value = passedVal;
}

//------------------------------------------------------------
function searchQueryCriteriaChanged() {
	var df = document.forms[0];
	
	if (df.txtquery.value.toLowerCase() != df.query.value.toLowerCase() ||
		df.txtquerybot.value.toLowerCase() != df.query.value.toLowerCase()) {
		
		if (df.txtquery.value != df.query.value) {
			df.txtquerybot.value = df.txtquery.value;
			df.query.value = df.txtquery.value;
		}
		
		if (df.txtquerybot.value != df.query.value) {
			df.txtquery.value = df.txtquerybot.value;
			df.query.value = df.txtquerybot.value;
		}
		
		return true;
	} else {
		return false;
	}
}

//------------------------------------------------------------
function searchValidate() {
	if (searchQueryCriteriaChanged()) {
		document.forms[0].page.value = 0;
	}
	return true;
}

//------------------------------------------------------------
function searchViewResultsPage(passedVal) {
	document.forms[0].page.value = passedVal;
	if (searchQueryCriteriaChanged()) {
		document.forms[0].page.value = 0;
	}
	document.forms[0].submit();
}

//------------------------------------------------------------
function searchShowDocSummaries(passedVal) {
	document.forms[0].showDocSummaries.value = passedVal;
	searchValidate();
	document.forms[0].submit();
}

/*------------------------------------------------------------
	validate that a value has been entered in the query textbox 10/11/2005 */
function validate(passedVal) {
	//alert("passedVal.query.value=" +passedVal.query.value);
	if (passedVal.query.value != "") {
		return true;
	}
	else {
		return false;
	}
}

//------------------------------------------------------------
// End search page function
//------------------------------------------------------------

//--------------------------------------------------------------------------------------------
// PopUp a WebCastWindow
//--------------------------------------------------------------------------------------------
function popUpWebcast(url, winWidth, winHeight, winTop, winLeft){

	var winWidth = (winWidth.length > 0) ? winWidth : 740;
	var winHeight = (winHeight.length > 0) ? winHeight : 495;
	var winTop = (winTop.length > 0) ? winTop : 33;
	var winLeft = (winLeft.length > 0) ? winLeft : 50;
	popUpWindow = window.open(url, null,' menu=0,menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=1,copyhistory=0,top=' + winTop + ',left='+ winLeft + ',width=' + winWidth + ',height=' + winHeight);
}
//--------------------------------------------------------------------------------------------
// PopUp a Window enabling Save Target As for PDF documents.
// In order to work, put the call of the function in the onclick:
// <a href="File.pdf" onclick="return ClickPopUp('File.pdf', 600, 400)">File</a>
//--------------------------------------------------------------------------------------------
function ClickPopUp(url, winWidth, winHeight){
popUp(url, winWidth, winHeight);
return false;
}
//--------------------------------------------------------------------------------------------
// PopUp a Window enabling Save Target As for PDF documents.
// In order to work, put the call of the function in the onclick:
// <a href="File.pdf" onclick="return ClickPopUpWebCast('File.pdf', winWidth, winHeight, winTop, winLeft)">File</a>
//--------------------------------------------------------------------------------------------
function ClickPopUpWebCast(url, winWidth, winHeight, winTop, winLeft){
popUpWebcast(url, winWidth, winHeight, winTop, winLeft);
return false;
}
//--------------------------------------------------------------------------------------------
// Open new window with confirm (call to this)
//--------------------------------------------------------------------------------------------
function clickleaveSite(d) {
	leaveSite(d);
	return false;
}



//------------------------------------------------------------
// START modifications for WebTrends
//------------------------------------------------------------
//<!-- START OF SmartSource Data Collector TAG -->
//<!-- Copyright (c) 1996-2005 WebTrends Inc.  All rights reserved. -->
//<!-- V8.0 -->
//<!-- $DateTime: 2006/04/07 16:45:14 $ -->
var gImages=new Array;
var gIndex=0;
var DCS=new Object();
var WT=new Object();
var DCSext=new Object();
var gQP=new Array();
var gI18n=false;
var dcsADDR = "";
var dcsID = "";
if (window.RegExp){
	var RE={"%09":/\t/g,"%20":/ /g,"%23":/\#/g,"%26":/\&/g,"%2B":/\+/g,"%3F":/\?/g,"%5C":/\\/g,"%22":/\"/g,"%7F":/\x7F/g,"%A0":/\xA0/g};
	var I18NRE={"%25":/\%/g};
}

// Add customizations here

function dcsVar(){
	var dCurrent=new Date();
	WT.tz=dCurrent.getTimezoneOffset()/60*-1;
	if (WT.tz==0){
		WT.tz="0";
	}
	WT.bh=dCurrent.getHours();
	WT.ul=navigator.appName=="Netscape"?navigator.language:navigator.userLanguage;
	if (typeof(screen)=="object"){
		WT.cd=navigator.appName=="Netscape"?screen.pixelDepth:screen.colorDepth;
		WT.sr=screen.width+"x"+screen.height;
	}
	if (typeof(navigator.javaEnabled())=="boolean"){
		WT.jo=navigator.javaEnabled()?"Yes":"No";
	}
	if (document.title){
		WT.ti=gI18n?dcsEscape(dcsEncode(document.title),I18NRE):document.title;
	}
	WT.js="Yes";
	WT.jv=dcsJV();
	if (document.body&&document.body.addBehavior){
		document.body.addBehavior("#default#clientCaps");
		if (document.body.connectionType){
			WT.ct=document.body.connectionType;
		}
		document.body.addBehavior("#default#homePage");
		WT.hp=document.body.isHomePage(location.href)?"1":"0";
	}
	if (parseInt(navigator.appVersion)>3){
		if ((navigator.appName=="Microsoft Internet Explorer")&&document.body){
			WT.bs=document.body.offsetWidth+"x"+document.body.offsetHeight;
		}
		else if (navigator.appName=="Netscape"){
			WT.bs=window.innerWidth+"x"+window.innerHeight;
		}
	}
	WT.fi="No";
	if (window.ActiveXObject){
		for(var i=10;i>0;i--){
			try{
				var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
				WT.fi="Yes";
				WT.fv=i+".0";
				break;
			}
			catch(e){
			}
		}
	}
	else if (navigator.plugins&&navigator.plugins.length){
		for (var i=0;i<navigator.plugins.length;i++){
			if (navigator.plugins[i].name.indexOf('Shockwave Flash')!=-1){
				WT.fi="Yes";
				WT.fv=navigator.plugins[i].description.split(" ")[2];
				break;
			}
		}
	}
	if (gI18n){
		WT.em=(typeof(encodeURIComponent)=="function")?"uri":"esc";
		if (typeof(document.defaultCharset)=="string"){
			WT.le=document.defaultCharset;
		} 
		else if (typeof(document.characterSet)=="string"){
			WT.le=document.characterSet;
		}
	}
	WT.tv="8.0.0";
	WT.sp="@@SPLITVALUE@@";
	DCS.dcsdat=dCurrent.getTime();
	DCS.dcssip=window.location.hostname;
	DCS.dcsuri=window.location.pathname;
	if (window.location.search){
		DCS.dcsqry=window.location.search;
		if (gQP.length>0){
			for (var i=0;i<gQP.length;i++){
				var pos=DCS.dcsqry.indexOf(gQP[i]);
				if (pos!=-1){
					var front=DCS.dcsqry.substring(0,pos);
					var end=DCS.dcsqry.substring(pos+gQP[i].length,DCS.dcsqry.length);
					DCS.dcsqry=front+end;
				}
			}
		}
	}
	if ((window.document.referrer!="")&&(window.document.referrer!="-")){
		if (!(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)<4)){
			DCS.dcsref=gI18n?dcsEscape(window.document.referrer, I18NRE):window.document.referrer;
		}
	}
}

function dcsA(N,V){
	return "&"+N+"="+dcsEscape(V, RE);
}

function dcsEscape(S, REL){
	if (typeof(REL)!="undefined"){
		var retStr = new String(S);
		for (R in REL){
			retStr = retStr.replace(REL[R],R);
		}
		return retStr;
	}
	else{
		return escape(S);
	}
}

function dcsEncode(S){
	return (typeof(encodeURIComponent)=="function")?encodeURIComponent(S):escape(S);
}

function dcsCreateImage(dcsSrc){
	if (document.images){
		gImages[gIndex]=new Image;
		if ((typeof(gHref)!="undefined")&&(gHref.length>0)){
			gImages[gIndex].onload=gImages[gIndex].onerror=dcsLoadHref;
		}
		gImages[gIndex].src=dcsSrc;
		gIndex++;
	}
	else{
		document.write('<IMG ALT="" BORDER="0" NAME="DCSIMG" WIDTH="1" HEIGHT="1" SRC="'+dcsSrc+'">');
	}
}

function dcsMeta(){
	var elems;
	if (document.all){
		elems=document.all.tags("meta");
	}
	else if (document.documentElement){
		elems=document.getElementsByTagName("meta");
	}
	if (typeof(elems)!="undefined"){
		for (var i=1;i<=elems.length;i++){
			var meta=elems.item(i-1);
			if (meta.name){
				if (meta.name.indexOf('WT.')==0){
					WT[meta.name.substring(3)]=(gI18n&&(meta.name.indexOf('WT.ti')==0))?dcsEscape(dcsEncode(meta.content),I18NRE):meta.content;
				}
				else if (meta.name.indexOf('DCSext.')==0){
					DCSext[meta.name.substring(7)]=meta.content;
				}
				else if (meta.name.indexOf('DCS.')==0){
					DCS[meta.name.substring(4)]=(gI18n&&(meta.name.indexOf('DCS.dcsref')==0))?dcsEscape(meta.content,I18NRE):meta.content;
				}
			}
		}
	}
}

function dcsTag(){
	if (document.cookie.indexOf("WTLOPTOUT=")!=-1){
		return;
	}
	var P="http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://"+dcsADDR+(dcsID==""?'':'/'+dcsID)+"/dcs.gif?";
	for (N in DCS){
		if (DCS[N]) {
			P+=dcsA(N,DCS[N]);
		}
	}
	for (N in WT){
		if (WT[N]) {
			P+=dcsA("WT."+N,WT[N]);
		}
	}
	for (N in DCSext){
		if (DCSext[N]) {
			P+=dcsA(N,DCSext[N]);
		}
	}
	if (P.length>2048&&navigator.userAgent.indexOf('MSIE')>=0){
		P=P.substring(0,2040)+"&WT.tu=1";
	}
	dcsCreateImage(P);
}

function dcsJV(){
	var agt=navigator.userAgent.toLowerCase();
	var major=parseInt(navigator.appVersion);
	var mac=(agt.indexOf("mac")!=-1);
	var nn=((agt.indexOf("mozilla")!=-1)&&(agt.indexOf("compatible")==-1));
	var nn4=(nn&&(major==4));
	var nn6up=(nn&&(major>=5));
	var ie=((agt.indexOf("msie")!=-1)&&(agt.indexOf("opera")==-1));
	var ie4=(ie&&(major==4)&&(agt.indexOf("msie 4")!=-1));
	var ie5up=(ie&&!ie4);
	var op=(agt.indexOf("opera")!=-1);
	var op5=(agt.indexOf("opera 5")!=-1||agt.indexOf("opera/5")!=-1);
	var op6=(agt.indexOf("opera 6")!=-1||agt.indexOf("opera/6")!=-1);
	var op7up=(op&&!op5&&!op6);
	var jv="1.1";
	if (nn6up||op7up){
		jv="1.5";
	}
	else if ((mac&&ie5up)||op6){
		jv="1.4";
	}
	else if (ie5up||nn4||op5){
		jv="1.3";
	}
	else if (ie4){
		jv="1.2";
	}
	return jv;
}

function dcsFunc(func){
	if (typeof(window[func])=="function"){
		window[func]();
	}
}

function dcsMultiTrack(){
	for (var i=0;i<arguments.length;i++){
		if (arguments[i].indexOf('WT.')==0){
			WT[arguments[i].substring(3)]=arguments[i+1];i++;
		}
		if (arguments[i].indexOf('DCS.')==0){
			DCS[arguments[i].substring(4)]=arguments[i+1];i++;
		}
		if (arguments[i].indexOf('DCSext.')==0){
			DCSext[arguments[i].substring(7)]=arguments[i+1];i++;
		}
	}
	var dCurrent=new Date();
	DCS.dcsdat=dCurrent.getTime();
	dcsTag();
}

function LogDocSSDC(path)
{
	dcsMultiTrack("DCS.dcsuri", path);
}

function MoveToDocSSDC(path)
{
	LogDocSSDC(path);
	window.location = path;
}

function PopUpDocSSDC(path)
{
	LogDocSSDC(path);
	popUpWindow = window.open(path, null,' menu=0,menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,copyhistory=0,top=120,left=115,width=817,height=600');
}

dcsADDR = "ssdc.russell.com";
dcsID = "dcstbiher19o4a2y378ywnvbu_7t6q";

dcsVar();
dcsMeta();

if (typeof(authuser) != "undefined")
{
	DCS.dcsaut = authuser.replace("%2E",".");
}

dcsFunc("dcsAdv");
dcsTag();

//------------------------------------------------------------
// END modifications for WebTrends
//------------------------------------------------------------

/*********************************************************************
   Behaviour v1.1 by Ben Nolan, June 2005. Based largely on the work
   of Simon Willison (see comments by Simon below).
   The following code is Copyright (C) Simon Willison 2004.
*********************************************************************/   

var Behaviour = {
	list : new Array,
	
	register : function(sheet){
		Behaviour.list.push(sheet);
	},
	
	start : function(){
		Behaviour.addLoadEvent(function(){
			Behaviour.apply();
		});
	},
	
	apply : function(){
		for (h=0;sheet=Behaviour.list[h];h++){
			for (selector in sheet){
				list = document.getElementsBySelector(selector);
				
				if (!list){
					continue;
				}

				for (i=0;element=list[i];i++){
					sheet[selector](element);
				}
			}
		}
	},
	
	addLoadEvent : function(func){
		var oldonload = window.onload;
		
		if (typeof window.onload != 'function') {
			window.onload = func;
		} else {
			window.onload = function() {
				oldonload();
				func();
			}
		}
	}
}

Behaviour.start();

function getAllChildren(e) {
  // Returns all children of element. Workaround required for IE5/Windows. Ugh.
  return e.all ? e.all : e.getElementsByTagName('*');
}

document.getElementsBySelector = function(selector) {
  // Attempt to fail gracefully in lesser browsers
  if (!document.getElementsByTagName) {
    return new Array();
  }
  // Split selector in to tokens
  var tokens = selector.split(' ');
  var currentContext = new Array(document);
  for (var i = 0; i < tokens.length; i++) {
    token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');;
    if (token.indexOf('#') > -1) {
      // Token is an ID selector
      var bits = token.split('#');
      var tagName = bits[0];
      var id = bits[1];
      var element = document.getElementById(id);
      if (tagName && element.nodeName.toLowerCase() != tagName) {
        // tag with that ID not found, return false
        return new Array();
      }
      // Set currentContext to contain just this element
      currentContext = new Array(element);
      continue; // Skip to next token
    }
    if (token.indexOf('.') > -1) {
      // Token contains a class selector
      var bits = token.split('.');
      var tagName = bits[0];
      var className = bits[1];
      if (!tagName) {
        tagName = '*';
      }
      // Get elements matching tag, filter them for class selector
      var found = new Array;
      var foundCount = 0;
      for (var h = 0; h < currentContext.length; h++) {
        var elements;
        if (tagName == '*') {
            elements = getAllChildren(currentContext[h]);
        } else {
            elements = currentContext[h].getElementsByTagName(tagName);
        }
        for (var j = 0; j < elements.length; j++) {
          found[foundCount++] = elements[j];
        }
      }
      currentContext = new Array;
      var currentContextIndex = 0;
      for (var k = 0; k < found.length; k++) {
        if (found[k].className && found[k].className.match(new RegExp('\\b'+className+'\\b'))) {
          currentContext[currentContextIndex++] = found[k];
        }
      }
      continue; // Skip to next token
    }
    // Code to deal with attribute selectors
    if (token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)) {
      var tagName = RegExp.$1;
      var attrName = RegExp.$2;
      var attrOperator = RegExp.$3;
      var attrValue = RegExp.$4;
      if (!tagName) {
        tagName = '*';
      }
      // Grab all of the tagName elements within current context
      var found = new Array;
      var foundCount = 0;
      for (var h = 0; h < currentContext.length; h++) {
        var elements;
        if (tagName == '*') {
            elements = getAllChildren(currentContext[h]);
        } else {
            elements = currentContext[h].getElementsByTagName(tagName);
        }
        for (var j = 0; j < elements.length; j++) {
          found[foundCount++] = elements[j];
        }
      }
      currentContext = new Array;
      var currentContextIndex = 0;
      var checkFunction; // This function will be used to filter the elements
      switch (attrOperator) {
        case '=': // Equality
          checkFunction = function(e) { return (e.getAttribute(attrName) == attrValue); };
          break;
        case '~': // Match one of space seperated words 
          checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b'))); };
          break;
        case '|': // Match start with value followed by optional hyphen
          checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?'))); };
          break;
        case '^': // Match starts with value
          checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) == 0); };
          break;
        case '$': // Match ends with value - fails with "Warning" in Opera 7
          checkFunction = function(e) { return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length); };
          break;
        case '*': // Match ends with value
          checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) > -1); };
          break;
        default :
          // Just test for existence of attribute
          checkFunction = function(e) { return e.getAttribute(attrName); };
      }
      currentContext = new Array;
      var currentContextIndex = 0;
      for (var k = 0; k < found.length; k++) {
        if (checkFunction(found[k])) {
          currentContext[currentContextIndex++] = found[k];
        }
      }
      // alert('Attribute Selector: '+tagName+' '+attrName+' '+attrOperator+' '+attrValue);
      continue; // Skip to next token
    }
    
    if (!currentContext[0]){
    	return;
    }
    
    // If we get here, token is JUST an element (not a class or ID selector)
    tagName = token;
    var found = new Array;
    var foundCount = 0;
    for (var h = 0; h < currentContext.length; h++) {
      var elements = currentContext[h].getElementsByTagName(tagName);
      for (var j = 0; j < elements.length; j++) {
        found[foundCount++] = elements[j];
      }
    }
    currentContext = found;
  }
  return currentContext;
}

/*********************************************************************
*********************************************************************/

//------------------------------------------------------------
// Rules added to the Behavior Engine
//------------------------------------------------------------

var myrules = {
		'a' : function(element){
			element.onclick = function(){
				ProcessLink(this);
				
			}
		}
	};
	
Behaviour.register(myrules);

//------------------------------------------------------------
// Validation function that calls the WebTrends Logging when 
// the extension is one of the specified.
//------------------------------------------------------------

function ProcessLink(el)
{
	var link = el.href;
	var extensions = new Array("xml", "pdf", "ppt", "xls", "swf", "mpg", "mp3", "mp4", "doc", "wav");
	var extpos = link.lastIndexOf(".");

	// The link opens a file
	if (extpos != -1)
	{
		var jspos = link.toLowerCase().indexOf("javascript:");
		
		var ext = link.substring(extpos+1, extpos+4);

		// The link calls a javascript function
		if (jspos != -1)
		{
			var jslink = "";
			var firstPos = link.indexOf("'");
			var secondPos = link.lastIndexOf("'");


			if (firstPos != -1 && secondPos != -1)
			{
				jslink = link.substring(firstPos+1, secondPos);
			}
			
			link = jslink;
		}

		if (IsValid(link) && Contains(extensions, ext))
			LogDocSSDC(link);
	}
}

function IsValid(link)
{
	var valid = true;

	// The link is empty
	if (link == "")
	{
		valid = false;
	}
	// The link has a comma
	else if (link.indexOf(",") != -1)
	{
		valid = false;
	}
	// The link has a parenthesis
	else if (link.indexOf("(") != -1 || link.indexOf(")") != -1)
	{
		valid = false;
	}
	// The link has a bad extension (wrong pos)
	else if (link.lastIndexOf(".") != (link.length - 4))
	{
		valid = false;
	}

	return valid;
}

function Contains(array, str)
{
	for (var i=0; i < array.length; i++)
	{
		if (array[i] == str.toLowerCase())
		{
			return true;
		}
	}

	return false;
}

//------------------------------------------------------------
// End WebTrends reporting engine components
//------------------------------------------------------------

//------------------------------------------------------------
// Omniture Include Script
//------------------------------------------------------------

document.write(unescape("%3Cscript src='/common/js/omnitureCode.js' type='text/javascript'%3E%3C/script%3E"));

//------------------------------------------------------------
// End Omniture Include Script
//------------------------------------------------------------
