/*
  -------------------------------------------------------------------------
	                Mouse Over Button JavaScript 
                           Version 2.0
                    Part of the JavaScript Coder software
					
	Copyright 2003 JavaScript-coder.com. All rights reserved.
    This javascript code is installed as part of JavaScript Coder software.
	You may adapt this script for your Web pages, provided these opening credit
    lines (down to the lower dividing line) are kept intact.
    You may not reprint or redistribute this code without permission from 
    JavaScript-Coder.com.
	
	JavaScript Coder
	It precisely codes what you imagine!
	Grab your copy here:
		http://www.javascript-coder.com/
    -------------------------------------------------------------------------  
*/
function MOverButton(anchname,imagename,statusstring)
{
   this.imgobj  = document.images[imagename];
   var i=0;
   this.anchobj = null;
   //This is for IE. IE is not giving the object by name; document.anchors[aname]
   for(i=0;i < document.anchors.length;i++)
   {
	   if(document.anchors[i].name == anchname)
	   {
	   	this.anchobj = document.anchors[i];
	   }
   }
   if(!this.imgobj)
   {
	   alert('BUG: could not get image object');
	   return;
   }
   if(!this.anchobj)
   {
	   alert('BUG: Could not open the Anchor object');
	   return;   
   }
   this.normalimage = null;
   this.activeimage = null;
   this.clickimage  = null;
   this.strstatus   = statusstring;
   
   this.SetNormalImage = set_normal_image;
   this.SetActiveImage = set_active_image;
   this.SetClickImage  = set_click_image;

   this.anchobj.onmouseover = mover_anchorobject;
   this.anchobj.onmouseout  = mout_anchorobject;
   this.anchobj.onmousedown = mdown_anchorobject;
   this.anchobj.onmouseup   = mover_anchorobject;
   
   this.anchobj.parentobj = this;
}

function mover_anchorobject()
{
	if(this.parentobj.activeimage != null)
	{
		this.parentobj.imgobj.src    = this.parentobj.activeimage.src;
		this.parentobj.imgobj.width  = this.parentobj.activeimage.width;
		this.parentobj.imgobj.height = this.parentobj.activeimage.height;
	}
	if(this.parentobj.strstatus.length > 0)
	{
		window.status = this.parentobj.strstatus;
	}
	return true;
}
function mout_anchorobject()
{
	this.parentobj.imgobj.src    = this.parentobj.normalimage.src;
	this.parentobj.imgobj.width  = this.parentobj.normalimage.width;
	this.parentobj.imgobj.height = this.parentobj.normalimage.height;	
	if(this.parentobj.strstatus.length > 0)
	{
		window.status = '';
	}
	return true;
}
function mdown_anchorobject()
{
	if(this.parentobj.clickimage != null)
	{
		this.parentobj.imgobj.src    = this.parentobj.clickimage.src;
		this.parentobj.imgobj.width  = this.parentobj.clickimage.width;
		this.parentobj.imgobj.height = this.parentobj.clickimage.height;		
	}
	return true;
}
function set_normal_image(filename,width,height)
{
	this.normalimage = new Image(width,height);
	this.normalimage.src = filename;
}
function set_active_image(filename,width,height)
{
	this.activeimage = new Image(width,height);
	this.activeimage.src = filename;
}
function set_click_image(filename,width,height)
{
	this.clickimage = new Image(width,height);
	this.clickimage.src = filename;
}

//This is for NS4; It is not calling the actual onmouseover by itself
function callmover(aname)
{
	return document.anchors[aname].onmouseover();
}
function callmout(aname)
{
	return document.anchors[aname].onmouseout();
}
function callmdown(aname)
{
	return document.anchors[aname].onmousedown();
}
function callmup(aname)
{
	return document.anchors[aname].onmouseup();
}
/*
	Copyright 2003 JavaScript-coder.com. All rights reserved.
*/