<?xml version="1.0" encoding="ISO-8859-1"?>
<public:component xmlns:public="urn:HTMLComponent" lightweight="true">

<!-- event handlers -->
<public:attach event="onmouseover" handler="fnOnMouseOver" />
<public:attach event="onmouseout" handler="fnOnMouseOut" />
<public:attach event="onmousedown" handler="fnOnMouseDown" />
<public:attach event="onmouseup" handler="fnOnMouseUp" />
<public:attach event="onpropertychange" handler="fnOnPropertyChange" />

<public:property name="hoversrc" />
<public:property name="pressedsrc" />

<script type="text/javascript">
//<![CDATA[

//------------------------------------------------------------------------
//  Copyright 2000 Microsoft Corporation.  All Rights Reserved.
//
//  File:         imageRollover_js.htc
//
//  Description:  The image rollover behavior provides and easy, 
//                declarative method to apply image rollover effects 
//                without the use of script.  
//
//  Note:         hoversrc and pressedsrc attribute names must be all lowercase!
//------------------------------------------------------------------------


//------------------------------------------------------------------------
// Set up global variables
//------------------------------------------------------------------------

// Mozilla treats attributes and properties differently
// so element.attribute doesn't work
if (typeof(hoversrc) == "undefined") {
   var hoversrc = element.getAttribute("hoversrc");
}
if (typeof(pressedsrc) == "undefined") {
   var pressedsrc = element.getAttribute("pressedsrc");
}
var originalsrc = element.src;
var state = "normal";
var cacheRollover;
var cacheClicked;


//------------------------------------------------------------------------
// Cache images needed for effects
//------------------------------------------------------------------------

if (hoversrc)
{
  cacheRollover = new Image();
  cacheRollover.src = hoversrc;
}

if (pressedsrc)
{
  cacheClicked = new Image();
  cacheClicked.src = pressedsrc;
}

//------------------------------------------------------------------------
//
//  Function:  fnOnMouseOver()
//
//  Synopsis:  When the mouse is over the image, change the src to
//             the hoversrc image (if specified).
//
//------------------------------------------------------------------------

function fnOnMouseOver()
{
  state = "hover";
  if (hoversrc)
  {
    element.src = hoversrc;
  }
}

//------------------------------------------------------------------------
//
//  Function:  fnOnMouseOut()
//
//  Synopsis:  When the mouse moves off the image, the image src back to
//             the original image.
//
//------------------------------------------------------------------------

function fnOnMouseOut()
{
  state = "normal";
  element.src = originalsrc;
}

//------------------------------------------------------------------------
//
//  Function:  fnOnMouseDown()
//
//  Synopsis:  When the image is clicked, set the src to the pressedsrc
//             image (if specified).
//
//------------------------------------------------------------------------

function fnOnMouseDown()
{
  state = "clicked";

  if (pressedsrc)
  {
    element.src = pressedsrc;
  }
}

//------------------------------------------------------------------------
//
//  Function:  fnOnMouseUp()
//
//  Synopsis:  When the mouse button is released, set the src back to 
//             the hoversrc image (if specified).
//
//------------------------------------------------------------------------

function fnOnMouseUp()
{
  state = "hover";

  if (hoversrc)
  {
    element.src = hoversrc;
  }
  else
  {
    element.src = originalsrc;
  }
}

//------------------------------------------------------------------------
//
//  Function:  fnOnPropertyChange()
//
//  Synopsis:  The hoversrc or pressedsrc properties are changed while
//             their image is being displayed, update the src.  Update
//             the originalsrc global variable when the src property is
//             changed.
//
//------------------------------------------------------------------------

function fnOnPropertyChange()
{
  if ((window.event.src == "pressedsrc") && (state == "normal"))
  {
    originalsrc = element.src;
  }

  if ((window.event.propertyName == "hoversrc") && (state == "hover"))
  {
    element.src = hoversrc;
  }

  if ((window.event.propertyName == "pressedsrc") && (state == "clicked"))
  {
    element.src = pressedsrc;
  }
}

//]]>
</script>
</public:component>