// Investment DropDown Filter
function filterDropDown(){
	if(!document.getElementById) return;
	if(!document.getElementById('filterDropDown')) return;
	var sel = document.getElementById('filterDropDown');
	sel.onchange = function(){
		var selInd = this.options[this.selectedIndex].value;
		var list = document.getElementsByTagName('li');
		if(selInd==""){
			for(i=0;i<list.length;i++){
				if(list[i].parentNode.className == "first" || list[i].parentNode.className == "second"){
					var space = list[i].className.indexOf(" ");
					if(space!=-1){
						var ind = list[i].className.substring(3,space);
					} else {
						var ind = list[i].className.substring(3);
					}
					list[i].className = "";
					list[i].className = "ind"+ind+" unfiltered";
				}
			}
		} else {
			for(i=0;i<list.length;i++){
				if(list[i].parentNode.className == "first" || list[i].parentNode.className == "second"){
					var space = list[i].className.indexOf(" ");
					if(space!=-1){
						var ind = list[i].className.substring(3,space);
					} else {
						var ind = list[i].className.substring(3);
					}
					if(selInd==ind){
						list[i].className = "";
						list[i].className = "ind"+selInd+" filteredOn";
					} else {
						list[i].className = "";
						list[i].className = "ind"+ind+" filteredOff";
					}
					//alert(list[i].className)
				}
			}
		}
	}
}
addLoadEvent(filterDropDown);

// Investment Strategy Popup  ***Discontinued
/*function investPopup(){
	if(!document.getElementById) return;
	if(!document.getElementById('investPopup')) return;
	var link = document.getElementById('investPopup');
	link.onclick = function(){
		//var placeholder = document.getElementById('investPopupDiv');
		var container = document.getElementById('container');
		var placeholder = document.createElement('div');
		placeholder.setAttribute('id','investPopupDiv');
		container.appendChild(placeholder);
		var a = document.createElement('a');
		a.setAttribute('href','javascript:closePopup()')
		a.setAttribute('id','investPopupA')
		a.setAttribute('onclick','javascript:closePopup()')
		var graphic = document.createElement('img');
		graphic.setAttribute('src','images/investmentStrategy.png');
		graphic.setAttribute('width','738');
		graphic.setAttribute('height','372');
		graphic.setAttribute('title','Our Investment Strategy');
		a.appendChild(graphic);
		placeholder.appendChild(a);
		return false;
	}
}
//addLoadEvent(investPopup);

function closePopup(){
	if(!document.getElementById('investPopupDiv')) return;
	var container = document.getElementById('container');
	var div = document.getElementById('investPopupDiv');
	container.removeChild(div);
}*/




// Adds functions to onload event
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

// Insert After
function insertAfter(newElement,targetElement) {
  var parent = targetElement.parentNode;
  if (parent.lastChild == targetElement) {
    parent.appendChild(newElement);
  } else {
    parent.insertBefore(newElement,targetElement.nextSibling);
  }
}