

var images = new Array() ;
var parents = new Array() ;
var images_hover = new Array() ;

images_hover[0] = document.createElement('img');
images_hover[0].width = 91 ;
images_hover[0].height = 90;
images_hover[0].src = home_path +'images/page/fhsolutions-hover.png' ;
images_hover[0].alt = 'funeral home solutions' ;
images_hover[0].border = 0 ;


images_hover[1] = document.createElement('img');
images_hover[1].width = 84 ;
images_hover[1].height = 90;
images_hover[1].src = home_path +'images/page/sbsolutions-hover.png' ;
images_hover[1].alt = 'business solutions' ;
images_hover[1].border = 0 ;

images_hover[2] = document.createElement('img');
images_hover[2].width = 93 ;
images_hover[2].height = 90;
images_hover[2].src = home_path +'images/page/vod-hover.png' ;
images_hover[2].alt = 'videos of distinction' ;
images_hover[2].border = 0 ;

images_hover[3] = document.createElement('img');
images_hover[3].width = 83 ;
images_hover[3].height = 90;
images_hover[3].src = home_path +'images/page/printing-hover.png' ;
images_hover[3].alt = 'printing services' ;
images_hover[3].border = 0 ;

images_hover[4] = document.createElement('img');
images_hover[4].width = 112 ;
images_hover[4].height = 23;
images_hover[4].src = home_path +'images/page/contact-us-hover.png' ;
images_hover[4].alt = 'contact us' ;
images_hover[4].border = 0 ;

var highlighted_img = -1 ;

function highlight(index)
{
  if (!parents[index].highlighted)
  {
    parents[index].removeChild(images[index]) ;
    parents[index].appendChild(images_hover[index]) ;  
    parents[index].highlighted = true ;
  }

  // not sure why, but if you move the mouse too fast in firefox
  // the mouseout event won't fire. The following doesn't prevent
  // this, but it will at least prevent
  // more than one button from being highlighted:
  for (var i=0 ; i < parents.length ; i++)
    if (i != index)
      unhighlight(i) ;
}

function unhighlight(index)
{
  if (parents[index].highlighted)
  {
    parents[index].removeChild(images_hover[index]) ;
    parents[index].appendChild(images[index]) ;  
    parents[index].highlighted = false ;
  }
}


var contact_image ;
var contact_parent ;


function show_mail()
{
  contact_parent.highlighted
  contact_parent.removeChild(contact_image);
  contact_parent.appendChild(contact_image_hover);  
}

function hide_mail()
{
  contact_parent.removeChild(contact_image_hover);
  contact_parent.appendChild(contact_image);  
}

var old_onload = window.onload ;

window.onload = function()
{
  if (old_onload) old_onload() ;
  
  images[0] = getObj('fhsolutions_image') ;
  images[1] = getObj('sbsolutions_image') ;
  images[2] = getObj('vod_image') ;
  images[3] = getObj('printing_image') ;
  images[4] = getObj('contact_image') ;

  for ( var i=0 ; i < images.length ; i++ )
  {
    parents[i] = images[i].parentNode ;
  }
}


