function openMenu(event, name, id) {

  var el, x, y;

  // turn on roll-over image for button
 	if (document.images) {
 	 document[name].src = eval(name + "on.src");
	}
  
  el = document.getElementById(id);
  el.style.visibility = "visible";
}


function closeMenu(event, name) {

  var current, related;

  rolloff('services');
  
  if (window.event) {
    current = this;
    related = window.event.toElement;
  }
  else {
    current = event.currentTarget;
    related = event.relatedTarget;
  }

  if (current != related && !contains(current, related))
    current.style.visibility = "hidden";
}

function contains(a, b) {

  // Return true if node a contains node b.

  while (b.parentNode)
    if ((b = b.parentNode) == a)
      return true;
  return false;
}

function reposition(object,x,y) {
    if (document.layers && document.layers[object] != null) {
        document.layers[object].left += x;
        document.layers[object].top += y;
    }
    else if (document.all) {
        document.all[object].style.posLeft += x;
        document.all[object].style.posTop += y;
    }
    else if (document.getElementById) {
		dive1=document.getElementById(object);
		dive1.style.left += x;
        dive1.style.top += y;
    }
}

function closeMenu2(event, name, object) {

  // turn off roll-over image for button
 	if (document.images) {
 	 document[name].src = eval(name + "off.src");
	}
  
    if (document.layers && document.layers[object] != null)
        document.layers[object].visibility = 'hidden';
    else if (document.all)
        document.all[object].style.visibility = 'hidden';
    else if (document.getElementById)
        document.getElementById(object).style.visibility = 'hidden';
}

if (document.images) {

//for main nav menu
homeon = new Image();
homeon.src = "images/home_on.gif";
homeoff = new Image();
homeoff.src = "images/home_off.gif";

serviceson = new Image();
serviceson.src = "images/services_home_on.gif";
servicesoff = new Image();
servicesoff.src = "images/services_home_off.gif";

about_uson = new Image();
about_uson.src = "images/about_home_on.gif";
about_usoff = new Image();
about_usoff.src = "images/about_home_off.gif";

newson = new Image();
newson.src = "images/news_home_on.gif";
newsoff = new Image();
newsoff.src = "images/news_home_off.gif";

clientson = new Image();
clientson.src = "images/clients_home_on.gif";
clientsoff = new Image();
clientsoff.src = "images/clients_home_off.gif";

partnerson = new Image();
partnerson.src = "images/partners_home_on.gif";
partnersoff = new Image();
partnersoff.src = "images/partners_home_off.gif";

newsletteron = new Image();
newsletteron.src = "images/newsletter_home_on.gif";
newsletteroff = new Image();
newsletteroff.src = "images/newsletter_home_off.gif";

//reporton = new Image();
//reporton.src = "images/report_home_on.gif";
//reportoff = new Image();
//reportoff.src = "images/report_home_off.gif";

contact_uson = new Image();
contact_uson.src = "images/contact_home_on.gif";
contact_usoff = new Image();
contact_usoff.src = "images/contact_home_off.gif";

//for about us sub menu
mitchellon = new Image();
mitchellon.src = "images/sub_mitchell_on.gif";
mitchelloff = new Image();
mitchelloff.src = "images/sub_mitchell_off.gif";

edwardson = new Image();
edwardson.src = "images/sub_edwards_on.gif";
edwardsoff = new Image();
edwardsoff.src = "images/sub_edwards_off.gif";

corryon = new Image();
corryon.src = "images/sub_corry_on.gif";
corryoff = new Image();
corryoff.src = "images/sub_corry_off.gif";

callahanon = new Image();
callahanon.src = "images/sub_callahan_on.gif";
callahanoff = new Image();
callahanoff.src = "images/sub_callahan_off.gif";

parkeron = new Image();
parkeron.src = "images/sub_parker_on.gif";
parkeroff = new Image();
parkeroff.src = "images/sub_parker_off.gif";

tsimalon = new Image();
tsimalon.src = "images/sub_tsimal_on.gif";
tsimaloff = new Image();
tsimaloff.src = "images/sub_tsimal_off.gif";

sherlockon = new Image();
sherlockon.src = "images/sub_sherlock_on.gif";
sherlockoff = new Image();
sherlockoff.src = "images/sub_sherlock_off.gif";

ghanon = new Image();
ghanon.src = "images/sub_ghan_on.gif";
ghanoff = new Image();
ghanoff.src = "images/sub_ghan_off.gif";

clineon = new Image();
clineon.src = "images/sub_cline_on.gif";
clineoff = new Image();
clineoff.src = "images/sub_cline_off.gif";

friedmanon = new Image();
friedmanon.src = "images/sub_friedman_on.gif";
friedmanoff = new Image();
friedmanoff.src = "images/sub_friedman_off.gif";

daleon = new Image();
daleon.src = "images/sub_dale_on.gif";
daleoff = new Image();
daleoff.src = "images/sub_dale_off.gif";

levitanon = new Image();
levitanon.src = "images/sub_levitan_on.gif";
levitanoff = new Image();
levitanoff.src = "images/sub_levitan_off.gif";

vorndranon = new Image();
vorndranon.src = "images/sub_vorndran_on.gif";
vorndranoff = new Image();
vorndranoff.src = "images/sub_vorndran_off.gif";

//for services sub menu
bankingon = new Image();
bankingon.src = "images/sub_banking_on.gif";
bankingoff = new Image();
bankingoff.src = "images/sub_banking_off.gif";

business_planon = new Image();
business_planon.src = "images/sub_busplan_on.gif";
business_planoff = new Image();
business_planoff.src = "images/sub_busplan_off.gif";

researchon = new Image();
researchon.src = "images/sub_research_on.gif";
researchoff = new Image();
researchoff.src = "images/sub_research_off.gif";

ventureon = new Image();
ventureon.src = "images/sub_venture_on.gif";
ventureoff = new Image();
ventureoff.src = "images/sub_venture_off.gif";

}

function rollon(name) {
  if (document.images) {
    document[name].src = eval(name + "on.src");
  }
}

function rolloff(name) {
  if (document.images) {
    document[name].src = eval(name + "off.src");
  }
}