function toggle(list){
var listElementStyle=document.getElementById(list).style;
if (listElementStyle.display=="none"){
listElementStyle.display="block";
}else{
listElementStyle.display="none";
}
}

sfHover = function() {
	var sfEls = document.getElementById("nav").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);

resourcesNavHover = function() {
	var sfEls = document.getElementById("resourcesNav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" resourcesNavHover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" resourcesNavHover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", resourcesNavHover);
//-----------============<<<<PUBLIC_HTML/JS/JS_LIB.JS>>>==========-----------//
//%%%%%%%%%%%%%%%2004 Copyright Advance Mentoring Inc. 2004%%%%%%%%%%%%%%%%%%//
//--------------------------------Section 1----------------------------------//
//---------------------------New Window Functions----------------------------//
//NOTE: DONT TRY AND USE OPENEXTERNAL.JS FOR ANY OTHER NEW                   // 
//WINDOWS OTHER THAN THISE WHICH APPEAR IN SECTION A	                     //

            //------------Section A----------------//
//Start-------------func: flashdemostart------------------------------------//
//OPEN NEW WINDOW CENTERED
//<a href="http://www.advancementoring.com/corporate/flashdemo.htm" onclick="flashdemostart(this.href,'flashdemostart','640','480','','','no','no');return false;">flash demo</a>
//contruction <a href='URL' onClick="this.href,'functionname','width','height','','','scrollbars','resizable');return false;">TEXT</a>
function flashdemostart(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
//End----------------func: flashdemostart------------------------------------//
//Start--------------func: spot----------------------------------------------//
//works great for opening precision windows, that is windows which must have specific height, width, and positioning
//<a href="http://www.advancementoring.com/corporate/flashdemo.htm" onclick="spot(this.href,'flashdemostart','640','480','50','50','no','no');return false;">flash demo</a>
//contruction <a href='URL' onClick="this.href,'functionname','width','height','top(pixels)','left(pixels)','scrollbars','resizable');return false;">TEXT</a>
function spot(mypage, myname, w, h, t, l, scroll) {
winprops = 'height='+h+',width='+w+',top='+t+',left='+l+',scrollbars='+scroll+',resizable,status'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
//End----------------func: spot----------------------------------------------//

            //------------Section B----------------//
//Start---------------------Michaels swiped func-----------------------------//
//NOTE: This is a legacy function.  DO NOT use it when creating new pages!
//opens the window sometimes, when it does, it is very slow
function MDM_openWindow(theURL,winName,features) {
	var _W=window.open(theURL,winName,features);
	_W.focus();
	_W.moveTo(50,50);
}

//End-----------------------Michaels swiped func-----------------------------//
//Start-----------------------func: onlyurl----------------------------------//
//use only when target=_blank is not acceptable
var newwindow;
function onlyurl(url)
{
	newwindow=window.open(url,'newview','height=800,width=600,left=50,top=100,scrollbars=yes,resizable=no');
	if (window.focus) {newwindow.focus()}
}
//End-------------------------func: onlyurl----------------------------------//
//Start-----------------------func: deepclean---------------------------------//
var newwindow;
function deepclean(url,name)
{
	newwindow=window.open(url,name,'height=800,width=600,left=50,top=100,scrollbars=yes,resizable=no');
	if (window.focus) {newwindow.focus()}
}
//End-------------------------func: deepclean---------------------------------//
//Start-----------------------func: full--------------------------------------//
var newwindow;
function full(url,name)
{
	newwindow=window.open(url,name,'height=800,width=600,left=100,top=100,scrollbars=yes,resizable=yes,copyhistory=yes,directories=yes,menubar=yes,status=yes,location=yes,toolbar=yes');
	if (window.focus) {newwindow.focus()}
}
//End-------------------------func: full--------------------------------------//

//%%%%%%%%%%%%%%%2004 Copyright Advance Mentoring Inc. 2004%%%%%%%%%%%%%%%%%%//
//--------------------------------Section 2----------------------------------//
//---------------------------Validation Functions----------------------------//
//NOTE: Functions in section A are legacy functions from original software.
					//------------Section A----------------//
// ACTIVE = This function is still in use
//If the function is active, the file where used is listed after
// DEAD = This function is no longer necessary and should be removed

// ----------------------Validate_FrmReports --------------------Start //
//DEAD
function Validate_FrmReports() {


  if (document.FrmReports.lstPeriod.selectedIndex == 0) 
   {
       	alert("Please enter a value for the \"Period\" field.");
       	document.FrmReports.lstPeriod.focus();
       	return (false);
   }     

  if (document.FrmReports.lstYear.selectedIndex == 0) 
   {
       	alert("Please enter a value for the \"Year\" field.");
       	document.FrmReports.lstYear.focus();
       	return (false);
   }     

   document.FrmReports.hdnyear.value=document.FrmReports.lstYear.value;
   document.FrmReports.hdnperiod.value=document.FrmReports.lstPeriod.value;

  return (true);
 }
// ----------------------Validate_FrmReports --------------------End //
// ----------------------Validate_FrmPersonal --------------------Start //
//DEAD
//Deleted 07/31/04 By Lucas
//Reason:  Legacy from original software.  No Longer Used.
// ----------------------Validate_FrmPersonal --------------------End //

// ----------------------Validate_FrmSendMail --------------------Start //
//ACTIVE
function Validate_FrmSendMail() {

  if (document.FrmSendMail.txtSubject.value.length < 2)
  {
    alert("Please enter at least 2 characters in the  \"Subject\" field.");
    document.FrmSendMail.txtSubject.focus();
    return (false);
  }

  if (document.FrmSendMail.txtMessage.value.length < 20)
  {
    alert("Please enter at least 20 characters in the \"Message\" field.");
    document.FrmSendMail.txtMessage.focus();
    return (false);
  }
 
  return (true);
 }
// ----------------------Validate_FrmSendMail --------------------End // 

// ----------------------Validate_FrmLogin --------------------Start //
//ACTIVE -    login.php 
 function Validate_FrmLogin() {
 

   if (document.FrmLogin.txtHandle.value.length < 6)
   {
     alert("Please enter at least 6 characters in the \"Handle\" field.");
     document.FrmLogin.txtHandle.focus();
     return (false);
   }
 
   if (document.FrmLogin.txtHandle.value.length > 25)
   {
     alert("Please enter at most 25 characters in the \"Handle\" field.");
     document.FrmLogin.txtHandle.focus();
     return (false);
   }
 
   if (document.FrmLogin.txtPassword.value.length < 5)
   {
     alert("Please enter at least 6 characters in the \"Password\" field.");
     document.FrmLogin.txtPassword.focus();
     return (false);
   }
   
   if (document.FrmLogin.txtPassword.value.length > 10)
   {
     alert("Please enter at most 10 characters in the \"Password\" field.");
     document.FrmLogin.txtPassword.focus();
     return (false);
   }
   
   return (true);
 }
// ----------------------Validate_FrmLogin --------------------End //
// ----------------------Validate_FrmRegister --------------------Start //
//DEAD -  originally used in register.php. currently done on serverside
//NOTE: change server side valifation on register.php to JS client side
//Deleted 07/31/04 By Lucas
//Reason:  Legacy from original software.  No Longer Used.
// ----------------------Validate_FrmRegister --------------------End //
// ----------------------Validate_FrmAffiliate --------------------Start //
//DEAD
//Deleted 07/31/04 By Lucas
//Reason:  Legacy from original software.  Was and has never been used.
// ----------------------Validate_FrmAffiliate --------------------End  // 
// ----------------------Validate_FrmAdvert --------------------Start  // 
//DEAD
//Deleted 07/31/04 By Lucas\
//Reason:  No longer used. 
// ----------------------Validate_FrmAdvert --------------------End  // 

//%%%%%%%%%%%%%%%2004 Copyright Advance Mentoring Inc. 2004%%%%%%%%%%%%%%%%%%//
//--------------------------------Section 3----------------------------------//
//---------------------------Alert Functions---------------------------------//

					//------------Section A----------------//
// ----------------------delete_alerts -------------------------Start  // 
function delete_alert() {
	if (window.confirm("This will remove you from the system, including any profiles, mail and hotlist. Are you sure?")) {
		return true;
	} else {
		return false;
	}
}
function delete_alert2() {
	if (window.confirm("This will remove your profile from the system. Are you sure?")) {
		return true;
	} else {
		return false;
	}
}
function delete_alert3() {
	if (window.confirm("This will remove the profile from the system. Are you sure?")) {
		return true;
	} else {
		return false;
	}
}
function delete_alert4() {
	if (window.confirm("This will remove the member from the system. Are you sure?")) {
		return true;
	} else {
		return false;
	}
}
function skip_alert() {
	if (window.confirm("Do you wish to skip this part of the profile?")) {
		return true;
	} else {
		return false;
	}
}
// ----------------------delete_alerts ----------------------------------End // 

//--------------------------------Section 4----------------------------------//
// ****************************Macromedia Functions ********************Start// 
//---------------------------Div Layers Function ---------------------- Start//
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//---------------------------Div Layers Function ------------------------- End//
//--------------------------Rollover Effects Functions ------------------Start//
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];}}
}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 MM_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}//--------------------------Rollover Effects Functions ------------------End//
// ****************************Macromedia Functions **********************End// 

//%%%%%%%%%%%%%%%2004 Copyright Advance Mentoring Inc. 2004%%%%%%%%%%%%%%%%%%//
//--------------------------------Section 5----------------------------------//
//-----------------------------Miscellaneous---------------------------------//
function selected(oRow){ oRow.style.backgroundColor='#FFFFE6'; } 

function deselected(oRow){ oRow.style.backgroundColor='#CCCCCC'; } 

//---------------------------Stop Function ----------------------------------//
//if JS Error, then break.
//<BODY onload="stoperrors()">
//Eventually, integrate error reporting for JS based on this function
function stopErrors() {
return true;
}
window.onerror = stopErrors;

//---------------------------Tool Tip Function ----------------------------------//
var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

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

function ddrivetip(thetext, thecolor, thewidth){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.y+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip
