<!--
/**
 * DHTML dropdown menu script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
 
 var bName = navigator.appName;
 var bVer = parseInt(navigator.appVersion);
 var NS6 = (bName == "Netscape" && bVer >= 5);
 var NS4 = (bName == "Netscape" && bVer >= 4 && bVer < 5);
 var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
 var NS3 = (bName == "Netscape" && bVer < 4);
 var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);
 window.onerror = null;
 var menuActive = 0
 var menuOn = 0
 var onLayer
 var timeOn = null // LAYER SWITCHING CODE
 var timeOn2 = null // LAYER SWITCHING CODE
 if (NS4 || IE4 || NS6) {
	 if (navigator.appName == "Netscape" && !document.getElementById){
	 layerStyleRef="layer.";
	 layerRef="document.layers";
	 styleSwitch="";
	 layerVis="show";
	 layerHid="hide";
	 }
	 else if (!document.all && document.getElementById) {
	 layerStyleRef="layer.style.";
	 layerRef="document.getElementById";
	 styleSwitch=".style";
	 layerVis="visible";
	 layerHid="hidden";
	 }
	 else {
	 layerStyleRef="layer.style.";
	 layerRef="document.all";
	 styleSwitch=".style";
	 layerVis="visible";
	 layerHid="hidden";
	 }
 }
// SHOW MENU
function shLayer(layerName){
 img = getImage("first");
 x = getImagePageLeft(img);
 y = getImagePageTop(img);
 menuTop = y + 19 ; // LAYER TOP POSITION
 parentsL = x + 0 ; // 'about' LAYER LEFT POSITION
 parents_safer_subL = x + 133 ; // 'about' LAYER LEFT POSITION
 //parents_community_subL = x + 131 ; // 'about' LAYER LEFT POSITION
 childrenL = x + 132 ;  // 'products' LAYER LEFT POSITION
 educatorsL = x + 271 ;  // 'pro_services' LAYER LEFT POSITION
 educators_aids_subL = x + 425 ; // 'about' LAYER LEFT POSITION
 firefightersL = x + 425 ;  // 'ffutions' LAYER LEFT POSITION
if (NS4 || IE4 || NS6) {
 if (timeOn != null || timeOn2 != null) {
	 if (timeOn != null) clearTimeout(timeOn)
	 if (timeOn2 != null) clearTimeout(timeOn2)
	 hideLayer(onLayer)
 } 
 if (NS4 || IE4) {
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerVis+'"');
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.top="'+menuTop+'"');
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.left="'+eval(layerName+'L')+'"');
 } 
 if (NS6) {
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="'+layerVis+'"');
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.top="'+menuTop+'"');
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.left="'+eval(layerName+'L')+'"');
 } 
 onLayer = layerName
 }
}// HIDE MENU

function shSubLayer(layerName){
 img = getImage("first");
 x = getImagePageLeft(img);
 y = getImagePageTop(img);
 menuTop = y + 59 ; // LAYER TOP POSITION
 parents_community_subL = x + 133 ; // 'about' LAYER LEFT POSITION
if (NS4 || IE4 || NS6) {
 if (timeOn != null || timeOn2 != null) {
	 if (timeOn != null) clearTimeout(timeOn)
	 if (timeOn2 != null) clearTimeout(timeOn2)
	 hideLayer(onLayer)
 } 
 if (NS4 || IE4) {
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerVis+'"');
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.top="'+menuTop+'"');
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.left="'+eval(layerName+'L')+'"');
 } 
 if (NS6) {
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="'+layerVis+'"');
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.top="'+menuTop+'"');
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.left="'+eval(layerName+'L')+'"');
 } 
 onLayer = layerName
 }
}// HIDE MENU

function shSubLayer2(layerName){
 img = getImage("first");
 x = getImagePageLeft(img);
 y = getImagePageTop(img);
 menuTop = y + 99 ; // LAYER TOP POSITION
 educators_community_subL = x + 424 ; // 'about' LAYER LEFT POSITION
if (NS4 || IE4 || NS6) {
 if (timeOn != null || timeOn2 != null) {
	 if (timeOn != null) clearTimeout(timeOn)
	 if (timeOn2 != null) clearTimeout(timeOn2)
	 hideLayer(onLayer)
 } 
 if (NS4 || IE4) {
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerVis+'"');
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.top="'+menuTop+'"');
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.left="'+eval(layerName+'L')+'"');
 } 
 if (NS6) {
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="'+layerVis+'"');
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.top="'+menuTop+'"');
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.left="'+eval(layerName+'L')+'"');
 } 
 onLayer = layerName
 }
}// HIDE MENU

function hideLayer(layerName){
 if (menuActive == 0) {
 if (NS4 || IE4) {
 eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerHid+'"');
 }
 if (NS6) {
 eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="'+layerHid+'"');
 }
 }
}// TIMER FOR BUTTON MOUSE OUT
function btnTimer() {
 timeOn = setTimeout("btnOut()",1)
}// BUTTON MOUSE OUT
function btnOut(layerName) {
 if (menuActive == 0) {
 hideLayer(onLayer)
 }
}// MENU MOUSE OVER 
function menuOver(itemName) {
 clearTimeout(timeOn)
 clearTimeout(timeOn2)
 menuActive = 1
}// MENU MOUSE OUT 
function menuOut(itemName) {
 menuActive = 0 
 timeOn = setTimeout("hideLayer(onLayer)", 400)
 if(onLayer.indexOf('parents') > -1)  {
	 timeOn2 = setTimeout("hideLayer('parents')", 400) 
 }
 if(onLayer.indexOf('educators') > -1)  {
	 timeOn2 = setTimeout("hideLayer('educators')", 400) 
 } 
 }// SET BACKGROUND COLOR 
function setBgColor(layer, color) {
  if (NS6){
    eval('document.getElementById("'+layer+'").style.backgroundColor="'+color+'"');
  }
  else if (NS4){
    eval('window.document.layers["'+layer+'"].document.bgColor="'+color+'"');
	eval('window.document.layers["'+layer+'"].saveColor="'+color+'"');
  }
  else if (IE4){
    eval('document.all.'+layer+'.style.backgroundColor="'+color+'"');
  }
}

// SET BACKGROUND image 
function setBgImage(layer, image) {
  if (NS6){
    eval('document.getElementById("'+layer+'").style.backgroundImage="'+image+'"');
  }
  else if (NS4){
    eval('window.document.layers["'+layer+'"].document.background="'+image+'"');
	eval('window.document.layers["'+layer+'"].saveImage="'+image+'"');
  }
  else if (IE4){
    eval('document.all.'+layer+'.style.backgroundImage="'+image+'"');
  }
}


function getImage(name) {
  if (NS4 || NS6) {
    return findImage(name, document);
  }
  if (IE4 || NS6)
    return eval('document.all.' + name);
  return null;
}

function findImage(name, doc) {
  var i, img;
  for (i = 0; i < doc.images.length; i++)
    if (doc.images[i].name == name)
      return doc.images[i];
  for (i = 0; i < doc.layers.length; i++)
    if ((img = findImage(name, doc.layers[i].document)) != null) {
      img.container = doc.layers[i];
      return img;
    }
  return null;
}

function getImagePageLeft(img) {
  var x, obj;
  if (NS4 || NS6) {
    if (img.container != null)
      return img.container.pageX + img.x - 1;
    else
      return img.x - 1;
  }
  if (IE4) {
    x = 0;
    obj = img;
    while (obj.offsetParent != null) {
      x += obj.offsetLeft;
      obj = obj.offsetParent;
    }
    x += obj.offsetLeft;
    return x;
  }
  return -1;
}

function getImagePageTop(img) {
  var y, obj;
  if (NS4 || NS6) {
    if (img.container != null)
      return img.container.pageY + img.y;
    else
      return img.y;
  }
  if (IE4) {
    y = 0;
    obj = img;
    while (obj.offsetParent != null) {
      y += obj.offsetTop;
      obj = obj.offsetParent;
    }
    y += obj.offsetTop;
    return y;
  }
  return -1;
}

function linkTo(url){
location.href = url;
}
// -->

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		more_info_over = newImage("http://grafx.qa.dli.com/corp/images/buttons/more_info_over.gif");
		preloadFlag = true;
	}

}
