// Global JavaScript Document

// Main Navigation Menu Dropdowns
sfHover = function() {
	var sfEls = document.getElementById("navMain").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent){
	window.attachEvent("onload", sfHover);
}

// Login Form
clearField = function(f,t,v) {
	if(t =="pw"){
		document.getElementById("loginPassword").innerHTML = "<input class=\"textfield\" name=\"password\" id=\"password\" type=\"password\" maxlength=\"36\" />";
		setTimeout('document.getElementById("password").focus();',250);	
	}else if(t=="pw2"){
		document.getElementById("setupPassword").innerHTML = "<input class=\"textfield\" name=\"advisorID\" id=\"advisorID\" type=\"password\" maxlength=\"36\" />";
		setTimeout('document.getElementById("advisorID").focus();',250);	
	}else{
		if(f.value==v){
			f.value="";
		}
	}
}

// TechKnowLinks

function closeTKL(whichDiv){
	document.getElementById(whichDiv).style.display = 'none';	
}

function hideNoTKL(){
	document.getElementById('tklwarning').style.display = 'none';	
}
function showNoTKL(e){
tklposx=0;tklposy=0;
var ev=(!e)?window.event:e;//Moz:IE
if (ev.pageX){tklposx=ev.pageX;tklposy=ev.pageY}//Mozilla or compatible
else if(ev.clientX){tklposx=ev.clientX;tklposy=ev.clientY}//IE or compatible
else{return false}//old browsers
tl = document.getElementById('tklwarning');
tl.style.position = 'absolute';
tl.style.zindex = '99999';
tl.style.display = 'block';
tlh = tl.offsetHeight;
tl.style.top=((tklposy-10)-tlh)+"px";
tl.style.left=(tklposx-30)+"px";}

var tklposx;var tklposy;

function showTKL(e,whichDiv){
tklposx=0;tklposy=0;
var ev=(!e)?window.event:e;//Moz:IE
if (ev.pageX){tklposx=ev.pageX;tklposy=ev.pageY}//Mozilla or compatible
else if(ev.clientX){tklposx=ev.clientX;tklposy=ev.clientY}//IE or compatible
else{return false}//old browsers
tl = document.getElementById(whichDiv);
tl.style.position = 'absolute';
tl.style.zindex = '999';
tl.style.display = 'block';
tlh = tl.offsetHeight;
tl.style.top=((tklposy-15)-tlh)+"px";
tl.style.left=(tklposx-85)+"px";
}