
counseling      = new Image();
counseling_on   = new Image();
education       = new Image();
education_on    = new Image();
professional    = new Image();
professional_on = new Image();
spiritual       = new Image();
spiritual_on    = new Image();
fun             = new Image();
fun_on          = new Image();
home            = new Image();
home_on         = new Image();
aboutus         = new Image();
aboutus_on      = new Image();
ptistaff        = new Image();
ptistaff_on     = new Image();
licensed        = new Image();
licensed_on     = new Image();
ptilocation     = new Image();
ptilocation_on  = new Image();
contactus       = new Image();
contactus_on    = new Image();
sitemap         = new Image();
sitemap_on      = new Image();

if (document.images) {
counseling.src      = "images/bcounseling.gif";
counseling_on.src    = "images/bcounseling_on.gif";
education.src       = "images/beducation.gif";
education_on.src     = "images/beducation_on.gif";
professional.src    = "images/bprofessional.gif";
professional_on.src  = "images/bprofessional_on.gif";
spiritual.src       = "images/bspiritual.gif";
spiritual_on.src     = "images/bspiritual_on.gif";
fun.src             = "images/bfun.gif";
fun_on.src           = "images/bfun_on.gif";
home.src            = "images/bhome.gif";
home_on.src          = "images/bhome_on.gif";
aboutus.src         = "images/baboutus.gif";
aboutus_on.src       = "images/baboutus_on.gif";
ptistaff.src        = "images/bptistaff.gif";
ptistaff_on.src      = "images/bptistaff_on.gif";
licensed.src        = "images/blicensed.gif";
licensed_on.src      = "images/blicensed_on.gif";
ptilocation.src     = "images/blocation.gif";
ptilocation_on.src   = "images/blocation_on.gif";
contactus.src       = "images/bcontactus.gif";
contactus_on.src     = "images/bcontactus_on.gif";
sitemap.src         = "images/bsitemap.gif";
sitemap_on.src       = "images/bsitemap_on.gif";
} else {
counseling.src      = ""
counseling_on.src    = ""
education.src       = ""
education_on.src     = ""
professional.src    = ""
professional_on.src  = ""
spiritual.src       = "";
spiritual_on.src     = "";
fun.src             = "";
fun_on.src           = "";
home.src            = "";
home_on.src          = "";
aboutus.src         = "";
aboutus_on.src       = "";
ptistaff.src        = "";
ptistaff_on.src      = "";
licensed.src        = "";
licensed_on.src      = "";
ptilocation.src     = "";
ptilocation_on.src   = "";
contactus.src       = "";
contactus_on.src     = "";
sitemap.src         = "";
sitemap_on.src       = "";
}

var d=document;

function openWin(page,wi,ht,line) {
  if (!line) { line = ""; }
  pageOut = page + ".php" + line;
  //alert(pageOut);
  window.open(pageOut,page,"width=" + wi + ",height=" + ht + ",scrollbars=yes");
}

var NS4 = false;
function browserCheck() {
  NS = (navigator.appName == "Netscape");
  IE = (navigator.appName == "Microsoft Internet Explorer");
  ver = (navigator.appVersion.charAt(0));
  if ((NS) && (ver == "4")) {
    NS4 = true;
  }
}

function preloadImages() {

  if (d.images) { 
    if(!d.p) { d.p=new Array(); }
    var i,j=d.p.length,a=preloadImages.arguments;
    for(i=0; i<a.length; i++) {
      if (a[i].indexOf("#")!=0) {
        d.p[j]=new Image;
        d.p[j++].src=a[i];
      }
    }
  }
}

function whichImg(n, d) {
  var p,i,x;
  if (!d) { 
    d=document; 
  }
/* commented out for now -- gcc
  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=whichImg(n,d.layers[i].document); 
  }
  if (!x && d.getElementById) { 
    x=d.getElementById(n); 
  }
  return x;
}

function showImg() {
  var i,j=0,x,a=showImg.arguments;

  document.sr=new Array;
  for(i=0;i<(a.length);i+=1) {
    if ((x=whichImg(a[i]))!=null) {
      document.sr[j++]=x;
      if (!x.oSrc) { 
        x.oSrc=x.background; 
      }
      x.background='images/subWhite.gif'; 
    }
  }
  //document.all['testArea'].innerHTML = "show - x.oSrc: " + x.oSrc + "<br>x.src: " + x.src;
}

function restoreImg() {
  //document.all['testArea'].innerHTML = "empty";
  var i,x,a=document.sr;
  for (i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) {
    x.background=x.oSrc;
  }
  //document.all['testArea'].innerHTML = "restore - x.oSrc: " + x.oSrc + "<br>x.src: " + x.src;
}

var timerID;
function displaySubMenus() {
if (NS4) {
  clearTimeout(timerID);
}
 var g,b,k,f,args=displaySubMenus.arguments;
 if (!document.p7setc) {
   items=new Array();
   document.p7setc=true;
 }
 for (k=0; k<items.length; k++) {
   if ((g=whichImg(items[k]))!=null) {
     b=(document.layers)?g:g.style;b.visibility="hidden";
   }
 }
 for (k=0; k<args.length; k++) {
   if((g=whichImg(args[k])) != null) {
     b=(document.layers)?g:g.style;b.visibility="visible";
     f=true;
     for (j=0;j<items.length;j++) {
       if (args[k]==items[j]) { f=false; }
     }
   if (f) { items[items.length++]=args[k]; }
   }
 }

}

function waitSubMenus() {
 if (NS4) {
   timerID = setTimeout(displaySubMenus, 1000);
 }
}