//Contents for ABOUT US
var aboutus=new Array()
aboutus[0]='<a href="/about-us/">Overview</a>'
aboutus[1]='<a href="/about-us/our-research.php">Our Research</a>'
aboutus[2]='<a href="/about-us/our-process.php">Our Process</a>'
aboutus[3]='<a href="/about-us/our-team.php">Our Team</a>'


//Contents for TRAINING CERTIFICATION
var trainingcertification=new Array()
trainingcertification[0]='<a href="/training-certification/">Overview</a>'
trainingcertification[1]='<a href="/training-certification/professional-advisors.php">Training for Professional Advisors</a>'
trainingcertification[2]='<a href="/training-certification/institutions.php">Training for Institutions</a>'
trainingcertification[3]='<a href="/training-certification/limited-use-licenses.php">Limited-Use Licenses</a>'


//Contents for SPEAKING
var speaking=new Array()
speaking[0]='<a href="/speaking/">Overview</a>'
speaking[1]='<a href="/speaking/advisor-sponsored-events.php">Advisor-Sponsored Events</a>'
speaking[2]='<a href="/speaking/organization-events.php">Organization Events</a>'
speaking[3]='<a href="/speaking/industry-events.php">Industry Events</a>'
speaking[4]='<a href="/speaking/family-briefings.php">Family Briefings</a>'


//Contents for MEMBERS
var members=new Array()
members[0]='<a href="/members/">Overview</a>'


//Contents for Learning Center
var learningcenter=new Array()
learningcenter[0]='<a href="/learning/success.php">Family Success Stories</a>'
learningcenter[1]='<a href="/learning/checklist.php">Wealth Transition Checklist</a>'
learningcenter[2]='<a href="/learning/testimonials.php">Testimonials</a>'
learningcenter[3]='<a href="/learning/research.php">Articles & Research</a>'
learningcenter[4]='<a href="/learning/books.php">Books</a>'
learningcenter[5]='<a href="/learning/glossary.php">Glossary Of Terms</a>'


var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left") + 6
dropmenuobj.y=getposOffset(obj, "top") - 3
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

// Form entry support routines

// On focus, if entry hint is set, clear it. Set undimmed text color
function handleEditFocus( inputField, altName ) {

//	alert( "In handleEditFocus, got [" + inputField.name + " : " + inputField.value + "], set [" + altName + "]" );
	if ( inputField.value == altName  ) {
		inputField.value = '';
	}
	inputField.style.color='#000000';
}


// On blur (loosing focus), if blank, set entry hint and dimmed color
function handleEditBlur( inputField, altName ) {

//	alert( "In handleEditBlur, this value is [" + inputField.value + "], alternate is [" + altName + "]" );
	if ( inputField.value == '' ) {
		inputField.value = altName;
		inputField.style.color = '#808080';
	}
}

// On submit, display loading message
function showLoading( displayField ) {

//	alert( "In handleEditBlur, this value is [" + inputField.value + "], alternate is [" + altName + "]" );
	document.getElementById( displayField ).innerHTML = "<b>Uploading data, please be patient...</b>";
}

// JavaScript Document

function loadLogin() {
	
//	alert( 'In loadLogin' );
/**/
	var xmlhttp = false;
	
	// Check if we are using IE.
	try {
		// If the javascript version is greater than 5.
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		// If not, then use the older active x object.
		try {
			// If we are using IE.
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			// Else we must be using a non-IE browser.
			if ( typeof XMLHttpRequest != 'undefined' )
				xmlhttp = new XMLHttpRequest();
			else
				xmlhttp = false;
		}
	}
	if ( xmlhttp ) {
		var target = document.getElementById( 'siteLogin' );
		if ( target ) {
			var serverPage = "/login.php";
		
			xmlhttp.open("GET", serverPage);
			xmlhttp.onreadystatechange = function() {
				if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
//					alert( 'In loadLogin with response: ' + xmlhttp.responseText );
					target.innerHTML = xmlhttp.responseText;
				}
			}
			xmlhttp.send(null);
		}
	}

}

