
//start


window.onerror = null;
 var bName = navigator.appName;
 var bVer = parseFloat(navigator.appVersion);
 var NS4 = (bName == "Netscape" && bVer >= 4);
 // var NS4 = (document.images);
 
 // http://wsabstract.com/javatutors/NS6update.shtml
 var NS6 = (!document.all && document.getElementById);
 if(NS6){
 	
 }
 var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
 var menuActive = 0
 var onLayer
 var timeOn = null
 if (NS4 || IE4 || NS6) {
  if (NS6){
   
   LayerRef="document.layers";
   StyleSwitch="";
   LayerOn="visible";
   LayerOff="hidden";
  } 
  if (NS4){
  
   LayerOn="visible";
   LayerOff="hidden";
  } 
  // this is for IE 4+ only
  else {
 
   LayerRef="document.all";
   StyleSwitch=".style";
   LayerOn="visible";
   LayerOff="hidden";
  }
 }
 
function Layer(LayerName){
var img,x,y,Top
 img=getImage("Image3");
 x=GetLeft(img);
 y=GetTop(img);
 Top=y+58;
 agencieSM=x+116;
serviceSM=x+183;
 contactSM=x+245;

 
if (NS4 || IE4 || NS6) {
 if (timeOn != null) {
 clearTimeout(timeOn)
 hideLayer(onLayer)
 }
 
	
	if (NS6){
		
		
		eval("document.getElementById('" + LayerName + "').style.visibility='" + LayerOn + "'");
		
 
	 	// document.getElementById(LayerName).style.top ="Top";
	 	eval("document.getElementById('" + LayerName + "').style.top ='" + Top + "'");
	
	 	// document.getElementById(LayerName).style.left = eval(LayerName+'M');
	 	eval("document.getElementById('" + LayerName + "').style.left='" + eval(LayerName+"M") + "'");
		
		onLayer = LayerName
	}
	if (IE4){
		
		// document.all.LayerName.style.visibility="visible";
 		eval("document.all." + LayerName + ".style.visibility='" + LayerOn + "'");
 
	 	// document.all.LayerName.style.top ="Top";
	 	eval("document.all." + LayerName + ".style.top ='" + Top + "'");
	
	 	// document.all.LayerName.style.left = eval(LayerName+'M');
	 	eval("document.all." + LayerName + ".style.left='" + eval(LayerName+"M") + "'");
	 	onLayer = LayerName
	}
	else{
		
		
		eval("document." + LayerName + ".visibility='" + LayerOn + "'");
		eval("document." + LayerName + ".top='" + Top + "'");
		eval("document." + LayerName + ".left='" + eval(LayerName+"M") + "'");
		onLayer = LayerName

	}
 }
}

function hideLayer(LayerName){
 if (menuActive == 0) {
 	
 	// turn off layers in netscape 6 upwards
 	if (NS6) {
 		eval("document.getElementById('" + LayerName + "').style.visibility='" + LayerOff + "'");
 	}
 	// turn off layers in netscape 4.x and IE.x
 	else{
 		eval(LayerRef+'["'+LayerName+'"]'+StyleSwitch+'.visibility="'+LayerOff+'"');
 	}	
 }
}


function LayerTimeout() {
 timeOn = setTimeout("btnOut()",600)
}

function btnOut(LayerName) {
 if (menuActive == 0) {
 hideLayer(onLayer)
 }
}

function menuOver(itemName) {
 clearTimeout(timeOn)
 menuActive = 1
}

function menuOut(itemName) {
 menuActive = 0 
 timeOn = setTimeout("hideLayer(onLayer)", 600)
}

function setBgColor(layer, color) {
  if (NS6){
  	// alert(color);
  	// alert("Background NS6");
    // document.getElementById(id).style.backgroundColor=color;

	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+'"');
  }
}

function getImage(name) {
  if (NS4 || NS6) {
    return findImage(name, document);
  }
  if (IE4)
    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 GetLeft(img) {
  var x, obj;
  if (NS4 || NS6) {
    if (img.container != null)
      return img.container.pageX + img.x;
    else
      return img.x;
  }
  if (IE4) {
    x = 0;
    obj = img;
    while (obj.offsetParent != null) {
      x += obj.offsetLeft;
      obj = obj.offsetParent;
    }
    x += obj.offsetLeft;
    return x;
  }
  return -1;
}

function GetTop(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;
}
//end