//--------------------------------------------------------------------------------------------
// /common/js/clientside.js -- site wide javascript - browser side execution
// mod history -- Feb 2001, inherited from Pandora suite of apps with some mods
//--------------------------------------------------------------------------------------------
function openNewWindow(d) {
	window.open(d);
}

//--------------------------------------------------------------------------------------------
// PopUp a Window 
//--------------------------------------------------------------------------------------------
function popUp(url, winWidth, winHeight){
	var winWidth;
	var winHeigh;

	winHeight = parseInt(winHeight);
	winWidth = parseInt(winWidth);

	winWidth = winWidth + 17
				
	popUpWindow = window.open(url, null,' menu=0,menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,copyhistory=0,top=60,left=0,width=' + winWidth + ',height=' + winHeight);
} 

//--------------------------------------------------------------------------------------------
// PopUp a Window With Everything 
//--------------------------------------------------------------------------------------------
function popUpWithToolbar(url){	
	popUpWindow = window.open(url, null,' menu=1,menubar=1,toolbar=1,location=1,directories=1,status=1,scrollbars=1,resizable=1,copyhistory=1,top=110,left=215');
} 

//--------------------------------------------------------------------------------------------
// 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);
}


// ---------------------------------------------------------------------------------------------------------------------
// The turnTickerOnOff function creates or deletes the EI_TickerTape cookie depending
// on whether the action passed to this function is to turn the ticker tape on of off.
// If the cookie is NOT present then the ticker tape will be displayed which is the default.
// If the cookie is present it means the ticker tape is not displayed.
// ---------------------------------------------------------------------------------------------------------------------
// 12/9/2004 ga Logicalis - reverse the cookie logic. A cookie now means show the StockTicker
// ---------------------------------------------------------------------------------------------------------------------

function turnTickerOnOff(theAction)
{
	//alert("window.parent.location=" + window.parent.location);

	if (typeof theAction == "undefined" || theAction == "") 	// valid values for theAction: "on" or "off"
		{theAction = "off";}

	if (document.cookie.indexOf("EI_TickerTape") != -1)
	{	// The EI_TickerTape cookie is there meaning the ticker tape was turned on
		if (theAction == "on")
		{	// Write the cookie to turn on the ticker tape
			var tickerexpdate = new Date ();  						// start with todays date
			tickerexpdate.setDate(tickerexpdate.getDate()+365); 		// set the expiration date to be this time next year
			document.cookie = "EI_TickerTape=true; path=; expires=" + tickerexpdate.toGMTString();
			//document.cookie = "EI_TickerTape=true; path=; expires=";
			top.south.main.location= "/asp/mainSet.asp"
			//window.parent.location.href="southSet.htm";
			//window.parent.location.href="/asp/mainSet.asp";
		}
		else
		{	// Delete the cookie because we want the ticker tape turned off
			var tickerexpdate = new Date ();  						// start with todays date
			tickerexpdate.setDate(tickerexpdate.getDate()-7); 		// set the expiration date to be in the past
			document.cookie = "EI_TickerTape=delete; path=; expires=" + tickerexpdate.toGMTString();
			top.south.main.location= "/asp/mainSet.asp"
			//window.parent.location.href="southSet.htm";
		}
	}
	else
	{
		if (theAction == "on")
		{	// Write the cookie to turn on the ticker tape
			var tickerexpdate = new Date ();  						// start with todays date
			tickerexpdate.setDate(tickerexpdate.getDate()+365); 		// set the expiration date to be this time next year
			document.cookie = "EI_TickerTape=true; path=; expires=" + tickerexpdate.toGMTString();
			//document.cookie = "EI_TickerTape=true; path=; expires=";
			top.south.main.location= "/asp/mainSet.asp"			
			//window.parent.location.href="southSet.htm";
		}
		else
		{	// Do nothing because the cookie is not there meaning the ticker tape is already turned off
		}
	 }
}


// ---------------------------------------------------------------------------------------------------------------------
// The turnTickerOnOff function creates or deletes the EI_TickerTape cookie depending
// on whether the action passed to this function is to turn the ticker tape on of off.
// If the cookie is NOT present then the ticker tape will be displayed which is the default.
// If the cookie is present it means the ticker tape is not displayed.
// ---------------------------------------------------------------------------------------------------------------------
function turnTickerOnOff_Orig(theAction)
{
	if (typeof theAction == "undefined" || theAction == "") 	// valid values for theAction: "on" or "off"
		{theAction = "on";}

	if (document.cookie.indexOf("EI_TickerTape") != -1)
	{	// The EI_TickerTape cookie is there meaning the ticker tape was turned off
		if (theAction == "off")
		{	// Do nothing because the ticker tape was already turned off
		}
		else
		{	// Delete the cookie because we want the ticker tape turned on
			var tickerexpdate = new Date ();  						// start with todays date
			tickerexpdate.setDate(tickerexpdate.getDate()-7); 		// set the expiration date to an old date to delete it
			document.cookie = "EI_TickerTape=delete; path=; expires=" + tickerexpdate.toGMTString();
			window.parent.parent.location.href="asp/mainSet.asp";
		}
	}
 	else
	{
		if (theAction == "off")
		{	// Write the cookie to turn off the ticker tape
			document.cookie = "EI_TickerTape=true; path=; expires=";
			window.parent.parent.location.href="asp/mainSet.asp";
		}
		else
		{	// Do nothing because the cookie is not there meaning the ticker tape is already turned on
		}
		}
}


// ---------------------------------------------------------------------------------------------------------------------
// The GoToResults function checks to see if the ResultsWin window has been opened (and is still open) and
// if it has then the focus is set to the ResultsWin window otherwise the window is just opened.
// ---------------------------------------------------------------------------------------------------------------------
	
function GoToResults(theInputString,theMode,theType,theFromArea) {
	var ResultsWin = null;
	theURL = null;

	if (theInputString == "[DoNothing]")
		{ } // do not open up a new window
	else {  // set focus to an existing window or open a new window

		if (typeof theFromArea == "undefined" || theFromArea == "") {			// valid values for theFromArea: home or menu
			theFromArea = "home";
			}

		if (theFromArea == "menu" && ResultsWin && ResultsWin.open && !ResultsWin.closed)
			{ } // do nothing
		else {
			if (typeof theInputString == "undefined" || theInputString == "") {		// theInputString contains either a ticker symbol or a company name to search for
				theInputString = "$rut";
				}
			if (typeof theMode == "undefined" || theMode == "") {					// valid values for theMode: quote, CompanyList or javachart
				theMode = "quote";
				}
			if (typeof theType == "undefined" || theType == "") {					// valid values for theType: stock or fund
				theType = "stock";
				}
			}

		if (theType == "fund")
			{theURL = "http://russell2.stockpoint.com/russell2/childquote.asp?findinputstring=" + theInputString + "&mode=" + theMode;}
		else
			{theURL = "http://russell2.stockpoint.com/russell2/childquote.asp?inputstring=" + theInputString + "&mode=" + theMode;}

		if (theFromArea == "menu" && ResultsWin && ResultsWin.open && !ResultsWin.closed)
				{ResultsWin.focus()}
		else
			{ResultsWin = window.open(theURL,"ResultsWindow","toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=616,height=430,left=152,top=75");
			ResultsWin.focus();}
		}
}


// ---------------------------------------------------------------------------------------------------------------------
// Reset the form each time the window gets focus
// ---------------------------------------------------------------------------------------------------------------------
function setup_Market_Update() {
	// document.pdaplist.pdapname.selectedIndex = 0;
	document.stocklist.mode[1].checked = true;
	document.stocklist.inputstring.value = "";
	document.pdaplist.pdapname.value = "";
	document.stocklist.inputstring.focus();
}


// ---------------------------------------------------------------------------------------------------------------------
// get_chart
// ---------------------------------------------------------------------------------------------------------------------
function get_chart(indexsymbol) {
	indexURL = null;
	if (indexsymbol == "") {
		indexsymbol = "$rua";
		}
	currDateTime = new Date();
	indexHours = currDateTime.getHours();
	indexMinutes = currDateTime.getMinutes();
	indexSeconds = currDateTime.getSeconds();
	indexMilliseconds = currDateTime.getMilliseconds();
	indexIgnore = indexHours + indexMinutes + indexSeconds + indexMilliseconds;
	indexURL="http://chart.neural.com/servlet/GIFChart?sym1=" + indexsymbol + "&dres=min&plottype=mountain&height=102&width=169&mode=0&dperiod=days&dcnt=1&texttype=1&csym1=CC6600&csym1a=FFCC66&cgvc=FF9900&cghc=FF9900&cbckl=000033&cbckg=000033&ctxtu=FFFFFF&ctxtl=FFFFFF&Ignore=89508653641&dispdate=2";
	document.chartlist.chartimage.src = indexURL;
}


// ---------------------------------------------------------------------------------------------------------------------
// Get the value of the radio button that was checked
// ---------------------------------------------------------------------------------------------------------------------
	function getRadioData() {
		theRadioValue = '';
		for(i = 0; i < document.stocklist.mode.length; ++i) {
			if(document.stocklist.mode[i].checked) {
				theRadioValue += document.stocklist.mode[i].value;
				return theRadioValue;
			}
		}
		return theRadioValue;
	}


// ---------------------------------------------------------------------------------------------------------------------
// Get the value of the Fund radio button that was checked
// ---------------------------------------------------------------------------------------------------------------------
	function getFundRadioData() {
		theFundRadioValue = '';
		for(i = 0; i < document.fundlist.mode.length; ++i) {
			if(document.fundlist.mode[i].checked) {
				theFundRadioValue += document.fundlist.mode[i].value;
				return theFundRadioValue;
			}
		}
		return theFundRadioValue;
	}

//--------------------------------------------------------------------------------------------
// 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);
		}

}
// ---------------------------------------------------------------------------------------------------------------------
// Validate the Russell Fund symbols
// ---------------------------------------------------------------------------------------------------------------------
function validate() {
	if (document.pdaplist.pdapname.value == "") {
		alert("Please enter a Russell Fund symbol to look up.");
		document.pdaplist.pdapname.focus();
		return false;
	}
	return true;
}

//--------------------------------------------------------------------------------------------
// Open new window with confirm
//--------------------------------------------------------------------------------------------
function leaveSite(d) {
	boolConfirmResponse = confirm("The links on this page may take you outside Russell Investment Group's website. The links may contain information concerning investments other than those offered by Russell Investment Group, its affiliates, subsidiaries, or distribution channels. Neither Russell Investment Group nor its affiliates are responsible for investment decisions made with respect to such investments or for the accuracy of completeness of information about such investments. The material available on this site has been produced by independent providers that are not affiliated with Russell Investment Group. Descriptions of, references to, or links to products or publications within any linked website does not imply endorsement of that product or publication by Russell Investment Group. Any opinions or recommendations expressed are solely those of the independent providers and are not the opinions or recommendations of Russell Investment Group, which is not responsible for any inaccuracies or errors.");

    if(boolConfirmResponse) 
		{
		window.open(d);
		}
}

//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="";
	}
	
	if (windowTarget=='blank') {
		popUpWithToolbar(arrSplitForm[0])
	}
	
	if (windowTarget=='top') {
		top.location.href=(arrSplitForm[0]);
	}
	
	if (windowTarget=='newEx') {
		leaveSite(arrSplitForm[0])
	}
	
	if (windowTarget=='newIn') {
		popUp(arrSplitForm[0],arrSplitForm[2],arrSplitForm[3])
	}

	if (windowTarget=='WebCast') {
		popUpWebcast(arrSplitForm[0],arrSplitForm[2],arrSplitForm[3],arrSplitForm[4],arrSplitForm[5])
	}
}

//--------------------------------------------------------------------------------------------
function leaveRcom(d) {
	
	boolConfirmResponse = confirm("You are now leaving Frank Russell Company's web site.  The following link may contain information concerning investments other than those offered by Frank Russell Company, its affiliates, subsidiaries, or distribution channels.  Neither Frank Russell Company nor its affiliates are responsible for investment decisions made with respect to such investments or for the accuracy or completeness of information about such investments.  The material available on this site has been produced by independent providers that are not affiliated with Frank Russell Company.  Descriptions of, references to, or links to products or publications within any linked web site does not imply endorsement of that product or publication by Frank Russell Company.  Any opinions or recommendations expressed are solely those of the independent providers and are not the opinions or recommendations of Frank Russell Company, which is not responsible for any inaccuracies or errors.");

    if(boolConfirmResponse) 
		{
		window.open(d);
		}
}

//--------------------------------------------------------------------------------------------
// Sniff Browser Type to see if we have version 4 or better in Netscape or IE
//--------------------------------------------------------------------------------------------
function browserCheck()
{
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
		{
			isNav = true;
			return(gotoUpgradeBrowserPage(""));
		}
		if (version >= 4.05 && version <= 4.08) //then this is a GOOD version of stand alone navigator
		{
			isNav = true;
			return(false);
		}
		if (version > 4.08 && version < 4.5) //then this is a bad version of Communicator
		{
			isNav = true;
			return(gotoUpgradeBrowserPage(""));
		} 
		// pjwNS6andIE6   replaced the following "if ..." 
		if (version >= 5) //then this is NS 6.0
		{
			isIE = true;
			isIE5 = true;
			isNS6 = true;
			isNav = true;
			//return(gotoUpgradeBrowserPage(""));
			return(false);
		} 
		if (version >= 4.5) //then this is a GOOD version of Communicator
		{
			isNav = true;
			return(false);
		}	
        }
        else 
	{
                isIE = true;
                
                if (navigator.appVersion.indexOf("MSIE 4") != -1)
		{
			isIE4 = true;
			return(false);
			
			//alert('i am IE4');
		}
		// pjwNS6andIE6   replaced the following "if ..." 
		if (version > 5) //then this is IE 6.0 so tell it it's ie5
		{
			isIE = true;
			isIE5 = true;
			isIE6 = true;
			return(false);
			//alert('I am IE6');
		} 
		if (navigator.appVersion.indexOf("MSIE 5") != -1)
		{
			isIE5 = true;
			return(false);
			//alert('i am IE5');
		}
		isIE5 = true;
		return(false);
		
	}
}
else 
{
	isIE5 = true;
	isIE = true;
	return(gotoUpgradeBrowserPage(""));
}
return(false); // added this line to fix a problem in Netscape 4.05 
}

function gotoUpgradeBrowserPage(sflag)
{
	if (document.cookie.indexOf("rocomcke") != -1 || document.cookie.indexOf("/iw-mount/") != -1) {
				return(false);						// we've been here
  } 
  var expdate = new Date ();  				    // start with todays date
    expdate.setDate(expdate.getDate()+52); 			// advance it 2 months
	document.cookie = "rocomcke=true; path=; expires=" + expdate.toGMTString();  
	top.location.href="/upgradeBrowser.asp?location=" + escape(location.pathname) + "?" + sflag
	return(true);
}
//--------------------------------------------------------------------------------------------
// PopUp a Media Player  
//--------------------------------------------------------------------------------------------
function launchPlayer(joeFile)
{ 
	var URLstring = "/common/media/mediaFrameSet.asp?joeFile=" + escape(joeFile)
	mediaWindow = window.open(URLstring ,null,'menu=0,menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=0,copyhistory=0,top=120,left=115,width=700,height=500');
}

// ---------------------------------------------------------------------------------------------------------------------
// The popUpSymbolLookup function checks to see if the ResultsWin window has been opened (and is still open) and 
// if it has then the focus is set to the ResultsWin window otherwise the window is just opened.
// ---------------------------------------------------------------------------------------------------------------------
function popUpSymbolLookup(theType){
	var theURL = null;
	var SymbolWin = null;
	
	if (theType == "[DoNothing]")
		{ } // do not open up a new window 
	else {  // set focus to an existing window or open a new window 
		
		if (theType.toUpperCase() == "RMF")
			{theURL = "/SymbolLookup.asp?LookupType=" + theType;
		}
		else {
			theURL = "/SymbolLookup.asp?LookupType=" + theType;
		}
		//alert("popUpSymbolLookup " + theURL);
		
		SymbolWin = window.open(theURL,"SymbolWindow","toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=650,height=430,left=100,top=50");
		SymbolWin.focus();
	}
}

//-->

//--------------------------------------------------------------------------------------------
// PopUp Feedback on Home Page
//--------------------------------------------------------------------------------------------
	function feedback() {
		var contentPage = '';
		var clientInfo = escape(parent.location.search.substring(1));
//alert(parent.frames[1].frames[1].location.href);		
		
		window.open("/asp/feedbackForm.asp?" + contentPage + "&" + clientInfo, "feedback", "width=400,height=500,menubar=0,top=90,left=380,resizable=1");
	}


//--------------------------------------------------------------------------------------------
// 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;
}

//------------------------------------------------------------
// Omniture Include Script
//------------------------------------------------------------

document.write(unescape("%3Cscript src='/common/js/omnitureCode.js' type='text/javascript'%3E%3C/script%3E"));

//------------------------------------------------------------
// End Omniture Include Script
//------------------------------------------------------------