// Copyright 1999 InsideDHTML.com, LLC
// For more information, see www.siteexperts.com

function doOver() {
  // Destination is the window - update status
  if (this.dest==window) {
    window.status = this.overValue
    return true
  }
  // Destination is the input element - update value
  else if ((this.dest.type!=null) && ((this.dest.type=="text") 
    || (this.dest.type=="textarea")))
    this.dest.value = this.overValue
  // Destination is an image - update src
  else if (this.dest.src!=null) 
    this.dest.src = this.overValue
  return true
}

function doOut() {
  // Destination is the window, clear status
  if (this.dest==window)
    window.status=""
  // Destination is the input element, set default value
  else if (this.dest.type!=null)
    this.dest.value=this.dest.defaultValue
  // Destination is an image, reset original image
  else if (this.dest.src)
    this.dest.src = this.dest.osrc
}

function OverEffect(src,dest,overValue) {
  // Assign onmouseover handler
  src.onmouseover = doOver
  // Assign onmouseout handler
  src.onmouseout = doOut
  // Store the destination element on the src
  src.dest = dest
  // Store the overValue on the src
  src.overValue= overValue
  // If an image, start downloading
  if (dest.src!=null) {
    dest.osrc = dest.src
    var i = new Image()
    i.src = src.overValue
  }
}

function InitOverEffect(src,dest,overValue) {
  // Setup over effect
  OverEffect(src,dest,overValue)
  // Make sure first rollover is applied
  return src.onmouseover()
}

function toggleButton(inButton)
{
	if(inButton.className == "buttonMain")
		inButton.className = "buttonOver";
	else
		inButton.className = "buttonMain";
}
