window.onerror = catcherror
window.onresize = startMenus

function catcherror() {
	return true
}

var blnIsLoaded = false

var strLastMenu = "divfirm"

//this function added by AP, used for practice page mouseover
function showGroupsAreasAll(strMenu, strTR, strBullet, strLink) {
	//alert('on : ' + strMenu)
	var objTR
	objTR = document.all[strTR]
	objTR.bgColor = "#000000"
	
	var objAnchor;
	objAnchor = document.all[strLink];
	objAnchor.style.color = "#ffffff";
	
	var objBullet
	objBullet = document.all[strBullet]
	objBullet.style.visibility = "visible"
		
	var objLayer
	if (strMenu != "divpractice"){
		hideMenu("divpractice")
	}
	
	//hideMenu(strLastMenu)
	if (document.all) {
		objLayer = document.all[strMenu]
	}
	else if (document.getElementById) {
		objLayer = document.getElementById(strMenu)
	}
	else if (document.layers) {
		objLayer = getLayer(strMenu)
	}
	
	// show
	if (document.all || document.getElementById) {
		//if (document.all)
		objLayer.style.visibility = "hidden"
	}
	strLastMenu = strMenu
}

function showGroupsAreas(strMenu, strTR, strBullet, strLink){
	//alert("hello")
	var objTR
	objTR = document.all[strTR]
	objTR.bgColor = "#009900"
	
	var objAnchor;
	objAnchor = document.all[strLink];
	objAnchor.style.color = "#ffffff";
		
	var objBullet = new Image(8,9); 
	objBullet = document.all[strBullet]
	objBullet.src = "/img/arrow.gif"
	objBullet.style.visibility = "visible"
	
	if (strMenu != '')
	{
		if (document.all) {
			objLayer = document.all[strMenu]
		}
		else if (document.getElementById) {
			objLayer = document.getElementById(strMenu)
		}
		else if (document.layers) {
			objLayer = getLayer(strMenu)
		}
	
		if (document.all || document.getElementById) {
			//if (document.all)
			objLayer.style.visibility = "visible"
		}
	}

}

function hideGroupsAreasAll(strMenu, strTR, strBullet, strLink) {
	var objTR
	objTR = document.all[strTR]
	objTR.bgColor = "#ffffff"

	var objAnchor;
	objAnchor = document.all[strLink];
	objAnchor.style.color = "#7B0325";
		
	var objBullet
	objBullet = document.all[strBullet]
	objBullet.src = "/img/arrow.gif"
	objBullet.style.visibility = "visible"

	document.all[strMenu].style.visibility = "hidden"
}

//this function added by AP, used for practice page mouseover
function hideGroupsAreas(strMenu, strTR, strBullet, strLink) {
	//alert('off : ' + strMenu)
	var objTR
	objTR = document.all[strTR]
	objTR.bgColor = "#ffffff"
	
	var objAnchor;
	objAnchor = document.all[strLink];
	objAnchor.style.color = "#7B0325";
	
	var objBullet
	objBullet = document.all[strBullet]
	objBullet.src = "/img/arrow.gif"
	objBullet.style.visibility = "visible"
	
	var objLayer
	var isIn = false
	var i = 0
	if(strMenu == "divpractice"){
		objtest = document.getElementById("divtest")
		objtest.style.visibility = "hidden"
	}
	if (strMenu == "")
		strMenu = strLastMenu

	if (document.all) {
		objLayer = document.all[strMenu]
	}
	else if (document.getElementById) {
		objLayer = document.getElementById(strMenu)
	}
	else if (document.layers) {
		objLayer = getLayer(strMenu)
	}
	// hide
	if (document.all) {
		//alert(window.event.toElement)
		while (!isIn && i < document.all[strMenu].all.length) {
			//alert(document.all[strMenu].all[i])
			if (window.event.toElement == document.all[strMenu].all[i])
				isIn = true
				break;
			i++
		}
		if (!isIn) {
			document.all[strMenu].style.visibility = "hidden"
		}
	}
	else if (document.getElementById) {
		objLayer.style.visibility = "hidden"
	}
	else if (document.layers) {
		if (parseFloat(navigator.appVersion) >= 4.08) {
			objLayer.visibility = "hide"
		}
	}
}

function showMenu(strMenu) {
	var objLayer
	var objtest
	
	//if (strMenu != "divpractice"){
	//	hideMenu("divpractice")
	//}
	
	hideMenu(strLastMenu)

	if (document.all) {
		objLayer = document.all[strMenu]
		objtest = document.all['divtest']
	}
	else if (document.getElementById) {
		objLayer = document.getElementById(strMenu)
		objtest = document.getElementById("divtest")
	}
	else if (document.layers) {
		objLayer = getLayer(strMenu)
	}
	
	// show
	if (document.all || document.getElementById) {
		//if (document.all)
			//if(strMenu == "divpractice"){
				//objLayer.style.width = 200
				//objLayer.style.height = 150
				//alert(objLayer.clientHeight)
				//if(objLayer.clientHeight > 150) {
			//		objLayer.style.height = 150
			//		objLayer.style.overflow = "scroll"
			//		objtest.style.visibility = "visible"
				
				//}
			//}
			objLayer.style.visibility = "visible"
	}
	else if (document.layers) {
		if (parseFloat(navigator.appVersion) >= 4.08) {
			// move to position relative to image
			objImage = getImage("l_" + strMenu.substring(3, strMenu.length))
			intTop = getImagePageTop(objImage)
			intLeft = getImagePageLeft(objImage)
			objLayer.top = intTop + 36
			objLayer.left = intLeft
			//objLayer.clip.height = 100
			//objLayer.overflow = "show"
			// show
			objLayer.visibility = "show"
		}
	}

	strLastMenu = strMenu
}



function hideMenu(strMenu) {
		var objLayer
		var isIn = false
		var i = 0
		var objtest
		
		if (strMenu == "")
			strMenu = strLastMenu
	
		if (document.all) {
			objLayer = document.all[strMenu]
			objtest = document.all['divtest']
		}
		else if (document.getElementById) {
			objLayer = document.getElementById(strMenu)
			objtest = document.getElementById("divtest")
		}
		else if (document.layers) {
			objLayer = getLayer(strMenu)
		}
		
		//if(strMenu == "divpractice"){
			
		//	objtest.style.visibility = "hidden"
		//}
		// hide
		if (document.all) {
			while (!isIn && i < document.all[strMenu].all.length) {
				if (window.event.toElement == document.all[strMenu].all[i])
					isIn = true
				i++
			}
			if (!isIn) {
				document.all[strMenu].style.visibility = "hidden"
			}
		}
		else if (document.getElementById) {
			objLayer.style.visibility = "hidden"
		}
		else if (document.layers) {
			if (parseFloat(navigator.appVersion) >= 4.08) {
				objLayer.visibility = "hide"
			}
		}
}



function startMenus() {
	// set that the document is loaded
	blnIsLoaded = true

	// position menu hiders for netscape 4
	if (document.layers) {
		if (parseFloat(navigator.appVersion) >= 4.08) {
			var objImage = getImage('l_profile')
			var intTop = getImagePageTop(objImage)
			var intLeft = getImagePageLeft(objImage)
			
			document.leftHide.left = intLeft - 10
			document.leftHide.top = intTop
			
			document.topHide.left = intLeft - 10
			document.topHide.top = intTop - 10
			
			document.rightHide.left = intLeft + 240
			document.rightHide.top = intTop
		}
	}
	if (document.getElementById && navigator.appName == "Netscape") {
		document.onclick = handler
	}
}
function handler(e) {
	var objElement
	var blnIsIn = false
	
	objElement = e.target
	
	while(objElement.parentNode && !blnIsIn) {
		if (objElement.id != null && objElement.id != "" && objElement.id.substring(0, 3) == "div")
			blnIsIn = true
		objElement = objElement.parentNode
	}
	
	if (blnIsIn != true)
		hideMenu('')
}

/*if (document.images) {
l_home_i = new Image(); l_home_i.src = "/image/l_home.gif";
lo_home_i = new Image(); lo_home_i.src = "/image/lo_home.gif";
l_profile_i = new Image(); l_profile_i.src = "/image/l_profile.gif";
lo_profile_i = new Image(); lo_profile_i.src = "/image/lo_profile.gif";
l_solutions_i = new Image(); l_solutions_i.src = "/image/l_solutions.gif";
lo_solutions_i = new Image(); lo_solutions_i.src = "/image/lo_solutions.gif";
l_careers_i = new Image(); l_careers_i.src = "/image/l_careers.gif";
lo_careers_i = new Image(); lo_careers_i.src = "/image/lo_careers.gif";
l_contact_i = new Image(); l_contact_i.src = "/image/l_contact.gif";
lo_contact_i = new Image(); lo_contact_i.src = "/image/lo_contact.gif";

l_h4 = new Image(); l_h4.src = "/image/l_h4.gif";
lo_h4 = new Image(); lo_h4.src = "/image/lo_h4.gif";
l_one = new Image(); l_one.src = "/image/l_one.gif";
lo_one = new Image(); lo_one.src = "/image/lo_one.gif";
l_tour = new Image(); l_tour.src = "/image/l_tour.gif";
lo_tour = new Image(); lo_tour.src = "/image/lo_tour.gif";
}*/

/* Function that swaps images. */

function change(id, newSrc) {
    var theImage = FWFindImage(document, id, 0);
    if (theImage) {
        theImage.src = newSrc;
    }
}

/* Functions that track and set toggle group button states. */

function FWFindImage(doc, name, j) {
    var theImage = false;
    if (doc.images) {
        theImage = doc.images[name];
    }
    if (theImage) {
        return theImage;
    }
    if (doc.layers) {
        for (j = 0; j < doc.layers.length; j++) {
            theImage = FWFindImage(doc.layers[j].document, name, 0);
            if (theImage) {
                return (theImage);
            }
        }
    }
    return (false);
}






/******************************************************************************
* dhtmllib.js                                                                 *
*                                                                             *
* Copyright 1999 by Mike Hall.                                                *
* Web address: http://www.brainjar.com                                        *
* Last update: February 26, 2000.                                             *
*                                                                             *
* Provides basic functions for DHTML positioned elements which will work on   *
* both Netscape Communicator and Internet Explorer browsers (version 4.0 and  *
* up).                                                                        *
******************************************************************************/

// Determine browser.

var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 &&
                parseFloat(navigator.appVersion) >= 4) ? 1 : 0;
var isMinIE4 = (document.all) ? 1 : 0;
var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.") >= 0) ? 1 : 0;


//-----------------------------------------------------------------------------
// Layer utilities.
//-----------------------------------------------------------------------------

function getLayer(name) {

  if (document.layers)
    return findLayer(name, document);
  if (isMinIE4)
    return eval('document.all.' + name);
  return null;
}

function findLayer(name, doc) {

  var i, layer;

  for (i = 0; i < doc.layers.length; i++) {
    layer = doc.layers[i];
    if (layer.name == name)
      return layer;
    if (layer.document.layers.length > 0)
      if ((layer = findLayer(name, layer.document)) != null)
        return layer;
  }
  return null;
}

//-----------------------------------------------------------------------------
// Image utilities.
//-----------------------------------------------------------------------------

function getImage(name) {

  if (document.layers) {
    return findImage(name, document);
  }
  if (isMinIE4)
    return eval('document.all.' + name);
  return null;
}

function findImage(name, doc) {

  var i, image;

  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 ((image = findImage(name, doc.layers[i].document)) != null) {
      image.container = doc.layers[i];
      return image;
    }
  return null;
}

function getImagePageLeft(image) {

  var x, obj;

  if (document.layers) {
    if (image.container != null)
      return image.container.pageX + image.x;
    else
      return image.x;
  }
  if (isMinIE4) {
    x = 0;
    obj = image;
    while (obj.offsetParent != null) {
      x += obj.offsetLeft;
      obj = obj.offsetParent;
    }
    x += obj.offsetLeft;
    return x;
  }
  return -1;
}

function getImagePageTop(image) {

  var y, obj;

  if (document.layers) {
    if (image.container != null)
      return image.container.pageY + image.y;
    else
      return image.y;
  }
  if (isMinIE4) {
    y = 0;
    obj = image;
    while (obj.offsetParent != null) {
      y += obj.offsetTop;
      obj = obj.offsetParent;
    }
    y += obj.offsetTop;
    return y;
  }
  return -1;
}