<!--
// function for dropdown menus that go to destination onChange 
// and onKeydown - works for IE & NC & their clones + Opera
var srcObj;
function jumpMenu(root, obj, e){ 
     var keyCode="", type="";
     if(window.event) {
        keyCode = window.event.keyCode;
        type = window.event.type;
     } else if (e) {
        keyCode = e.which;
        type = e.type;
     }
     if (type.toLowerCase() == "keydown" && keyCode != 13) {
            srcObj = obj;
            setTimeout("srcObj = null;", 1000);
            return false;
     }
     if (srcObj != null) {
           srcObj = null;
           return false;
     }
     var selectedURL = obj.options[obj.selectedIndex].value;
     eval("window.location='" + selectedURL.replace(root,ssUrlPrefix) + "'");

     return true;
}

function jumpMenuOld(obj, e){ 
     var keyCode="", type="";
     if(window.event) {
        keyCode = window.event.keyCode;
        type = window.event.type;
     } else if (e) {
        keyCode = e.which;
        type = e.type;
     }
     if (type.toLowerCase() == "keydown" && keyCode != 13) {
            srcObj = obj;
            setTimeout("srcObj = null;", 1000);
            return false;
     }
     if (srcObj != null) {
           srcObj = null;
           return false;
     }
     var selectedURL = obj.options[obj.selectedIndex].value;
     eval("window.location='" + selectedURL + "'");

     return true;
}

function locButton(root, url) {
	eval("window.location='" + url.replace(root,ssUrlPrefix) + "'");
}



//Dreamweaver function for opening new windows with editor customized features
function openBrWindow(anchor,winName,features) {
  window.open(anchor.href,winName,features);
  return false;
}

function CreateFlashObject (divID, url, width, height)
{
    var d = document.getElementById(divID);
    d.innerHTML = 
        "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" " +
        "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,20,0\" " +
        "width=\"" + width + "\" " +
        "height=\"" + height + "\">\n" +

        "<param name=\"movie\" value=\"" + url + "\">\n" +
        "<param name=\"quality\" value=\"high\">\n" +

        "<embed src=\"" + url + "\" quality=\"high\" " +
        "pluginspage=\"http://www.macromedia.com/go/getflashplayer\" " +
        "type=\"application/x-shockwave-flash\" " +
        "width=\"" + width + "\" " +
        "height=\"" + height + "\">\n" +
        "</embed>\n" +
        "</object>\n";
}

function CreateFlashObjectBase (divID, url, width, height, baseurl, winmode)
{
    var d = document.getElementById(divID);
    d.innerHTML = 
        "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" " +
        "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,20,0\" " +
        "width=\"" + width + "\" " +
        "height=\"" + height + "\">\n" +

        "<param name=\"movie\" value=\"" + url + "\">\n" +
        "<param name=\"quality\" value=\"high\">\n" +
		"<param name=\"base\" value=\"" + baseurl + "\">\n" +
		"<param name=\"wmode\" value=\"" + winmode + "\">\n" +

        "<embed src=\"" + url + "\" quality=\"high\" " +
        "pluginspage=\"http://www.macromedia.com/go/getflashplayer\" " +
        "type=\"application/x-shockwave-flash\" " +
        "width=\"" + width + "\" " +
		"base=\"" + baseurl + "\" " +
		"wmode=\"" + winmode + "\" " +
        "height=\"" + height + "\">\n" +
        "</embed>\n" +
        "</object>\n";
}

function displayFlashContent (divID, url, width, height)
{
    var d = document.getElementById(divID);
    d.innerHTML = 
        "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" " +
        "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,20,0\" " +
        "width=\"" + width + "\" " +
        "height=\"" + height + "\">\n" +

        "<param name=\"movie\" value=\"" + url + "\">\n" +
        "<param name=\"quality\" value=\"high\">\n" +

        "<embed src=\"" + url + "\" quality=\"high\" " +
        "pluginspage=\"http://www.macromedia.com/go/getflashplayer\" " +
        "type=\"application/x-shockwave-flash\" " +
        "width=\"" + width + "\" " +
        "height=\"" + height + "\">\n" +
        "</embed>\n" +
        "</object>\n";
}

//Prevents user from submitting form prematurely with enter key
function init(){
	if (navigator.appName.indexOf("Microsoft") >= 0){
		var inputTags = document.all.tags("input");
		for (i=0; i < inputTags.length; i++){
			if (inputTags[i].type.toUpperCase() != "SUBMIT"){
				inputTags[i].onkeydown = function() {
					if (window.event.keyCode == 13) {
						return false;
					}
				};
			}
		}
	}
}

//Clears text for form fields that still contain the defaults of the form
function clearText(thefield) {
  if (thefield.defaultValue == thefield.value) {
    thefield.value = "";
  }
}

//Clears branch locator forms of default text before submitting to MapPoint
function prepForm(f) {
  for(i=0; i<f.elements.length; i++){
    if(f.elements[i].type != 'hidden'){
      clearText(f.elements[i]);
    }
  }
  return true;
}

//Toggles ID display and hidden
function SwitchMenu(obj){
  if(document.getElementById){
    var el = document.getElementById(obj);
    if(el.style.display != "block"){
      el.style.display = "block";
    }else{
      el.style.display = "none";
    }
  }
}

//Toggles Financial focus tabs
function show(id) {
	document.getElementById(id).style.display = "inline";
}
function hide(id){
	document.getElementById(id).style.display = "none";
}

//Dreamweaver function to preload images that will be swapped
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];}}
}

//Dreamweaver function to restore images on event (like mouseOut)
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

//Dreamweaver function to swap images on event (like mouseOver)
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//Dreamweaver function for finding an object
function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function getParam(name)
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

//Onload Function Event Building
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function regShowContent() {
  var regFlag = getParam('reg');
  if (regFlag == 1) {
    var sheets = document.styleSheets;
    for (var i = 0; i < sheets.length ; i++) {
      if (sheets[i].media == "print") {
        sheets[i].disabled = true;
      }
    }
  }
}

addLoadEvent(regShowContent);

$(function(){
    $("a.glossary").click(function(){
            window.open(this.href,'glossary','scrollbars=yes,resizable=yes,width=300,height=400');
            return false;
    });
	$("a.disclaimer").click(function(){
	        window.open(this.href,'disclaimer','scrollbars=yes,resizable=yes,width=500,height=250');
	        return false;
	});
	$("a.symbolLookup").click(function(){
	        window.open(this.href,'symbolLookup','menubar=yes,scrollbars=yes,resizable=yes,width=350,height=175');
	        return false;
	});
	
	$.getScript("/javascript/accountlink_down.js", function(){
		if (accountLink == 0) {
			$('a[href^=https://accountlink.edwardjones.com]').attr("href",ssUrlPrefix + "en_US/products/online_services/accountlink/accountlink_down/index.html")
		}
	});

	
	$(".tabHead.static > ul li").click( function() {
		var i = $(".tabHead.static > ul li").index(this);
		$(this).addClass("selected").siblings().removeClass("selected");
		$(".tabBody.static > div").eq(i).addClass("selected").siblings().removeClass("selected");
	});
	$(".tabHead.static > ul li a").click(function(event) {
		event.preventDefault();
	});
	$(".tabBody").children("div.tbdy").equalHeights(325);
	
	var regFlag = getParam('reg');
    if (regFlag == 1) {
		$(".tabBody > div").addClass("selected");
	}
	
	$("div.newsInsights > p:nth-child(even):not(:has(.articleBtn))").addClass("greyBack");
	$("table.dataTable tr:nth-child(even)").addClass("greyBack");

	
	$(".toggleForms").click(function (event) {
		event.preventDefault();
		var myForm = $(this).attr("href");
		var regexS = "\#(.*$)";
		var regex = new RegExp( regexS );
		var selector = regex.exec( myForm );
		$(selector[0]).show().siblings("form").hide();
		$(this).addClass("selected").siblings(".toggleForms").removeClass("selected");
	});
	$("#addressForm, #lastnameForm").submit(function() {
		$("input[type=text]").each(function() {
			var currentValue = $(this).val();
			if (currentValue === this.defaultValue)
				$(this).val("");
		});
	});
	$("#addressForm input[type=text],#lastnameForm input[type=text],form.getQuote input[type=text]").focus(function () {
		var currentValue = $(this).val();
		if (currentValue === this.defaultValue)
			$(this).val("");
	});
});
//-->
