var rElPrev  = null;
var rElPrev2 = null;
var gPrev = null;
function showDiv(divObj,cext) { // support for files converted from dynnews.js
	showdiv(divObj,cext);
}
function showdiv(divObj,cext) {
	if (divObj == 'all') {
		displayDivs('none',cext);
		displayDivs('block',cext);
		rElPrev = 'all';
	} else {
		var mEl = document.getElementById(divObj);
		if (cext == '2') { avunculus = rElPrev2; } else { avunculus = rElPrev; }
		if (cext == 'keep') { avunculus = null; gPrev = mEl; }
		else if (gPrev && gPrev != mEl) { gPrev.style.display = "none"; }
		if (mEl) {
			if (avunculus == 'all') {
				displayDivs('none',cext);
			} else if (avunculus != null && mEl != avunculus) {
				var gOncle = avunculus.parentElement ? avunculus.parentElement.firstChild : avunculus.parentNode.firstChild;
				gOncle.className = '';
				avunculus.style.display = "none";
			}
			var gPere = mEl.parentElement ? mEl.parentElement.firstChild : mEl.parentNode.firstChild;
			if (mEl.style.display == "none" || mEl.style.display == "") {
				mEl.style.display = "block";
				if (mEl != gPrev) { gPere.className = 'articleTitle'; }
			} else if (mEl.style.display == "block" && mEl != gPrev) {
				mEl.style.display = "none";
				gPere.className = '';
			}
			if (cext == '2') { rElPrev2 = mEl; } else if (cext != 'keep') { rElPrev = mEl; }
		} else {
			if (cext == '2') { rElPrev2 = null; } else if (cext != 'keep') { rElPrev = null; }
		}
	}
	setTimeout('window.scrollBy(0,-40)',200);
	window.focus();
}
function displayDivs(setting,cext) {
	var blobs = document.getElementsByTagName('div');
	var thisName = cext ? 'highlander'+cext : 'highlander';
	if (blobs) { // just in case gEBTN isn't available
		for (var i=0,len=blobs.length;i<len;i++) {
			if (blobs[i].className == thisName) {
				blobs[i].style.display = setting;
			}
		}
	}
}
function fold(toSrc) {
	if (toSrc.parentElement) {
		divObj = toSrc.parentElement.parentElement;
	} else {
		divObj = toSrc.parentNode.parentNode;
	}

	divObj.style.display = "none";
	rElPrev = null;
}
function customDiv(isTab) {
	displayDivs('none');
	rElPrev = null;
	whichDivO = document.location.hash ? document.location.hash : '';
	whichDiv = whichDivO.replace('#','');
	if (whichDiv) {
		if (isTab) {
			chgTab2(whichDiv,document.getElementById(whichDiv+'Tab'));
		} else {
			showdiv(whichDiv);
		}
	}
	window.focus();
}
// combine with tabbed interface - use chgTab('divname',this)
var lTab = null;
function chgTab(dobj,obj) {
	obj.className = "pActive";
	if (lTab != obj && lTab != null) {
		lTab.className = "";
	}
	lTab = obj;
	showdiv(dobj);
}
var oobj = null;
function chgTab2(dobj,obj) {
	obj.className = "pActive";
	if (lTab != obj && lTab != null) {
		lTab.className = "";
	}
	lTab = obj;
	nobj = document.getElementById(dobj);
	nobj.style.display = "block";
	if (oobj) { if(oobj!=nobj) { oobj.style.display = "none"; } }
	oobj = nobj;
	if (document.getElementById('unselected')) { document.getElementById('unselected').style.display = "none"; }
}
function customTab(prefTab) {
	if (!document.location.hash) { document.location.hash = prefTab; }
	var TH = document.location.hash;
	if (TH != 'investor' && TH != ' adviser' && TH != 'forms'){ document.location.hash = prefTab; }
	customDiv(1);
	document.location.hash = '';
	window.scrollTo(0,0);
}
function checkLocation() {
	var newId = getCurId();
	if (curId != newId) {
		curId = newId;
		whichDiv = newId;
		wEl = document.getElementById(whichDiv);
		if (wEl.style.display == "none" || wEl.style.display == "") { showdiv(whichDiv); }
		document.location = document.location;
		window.focus();
	}
	setTimeout(checkLocation, 50);
}
function getCurId() {
	var wHash = window.location.hash;
	if(!wHash || wHash == "#") return 0;
	return wHash.replace("#",'');
}
var curId = getCurId();
setTimeout(checkLocation, 50);