// JavaScript Document

var imageButton = new Object();

function imagebutton(src, oversrc, name)
{
	this.src=src;
	this.oversrc=oversrc;
	this.name=name;
	this.write=imagebutton_write;
}

function imagebutton_write()
{
	var thisform = 'document.forms[' + (document.forms.length - 1) + ']';
	imageButton[this.name] = new Object();
	imageButton[this.name].over = new Image();
	imageButton[this.name].over.src = this.oversrc;
	imageButton[this.name].out = new Image();
	imageButton[this.name].out.src = this.src;

	document.write
	(
		'<A onMouseOver="if (document.images)document.images[\'' + this.name + "'].src=imageButton['" + this.name + '\'].over.src"' + 
		' onMouseOut="if (document.images)document.images[\'' + this.name + "'].src=imageButton['" + this.name + '\'].out.src"' + 
		' HREF="javascript:'
	);

	if (this.sendfield)
	{
		if (! this.sendvalue)
			this.sendvalue = 1;
		document.write(thisform, ".elements['", this.sendfield, "'].value='", this.sendvalue, "';");
	}

	document.write(thisform + '.submit();void(0);"');
	if (this.msg)document.write(' onClick="return confirm(\'' , this.msg, '\')"');
	document.write('>');

	document.write('<IMG SRC="' + this.src + '" ALT="' + this.alt + '" BORDER=0 NAME="' + this.name + '"');
	if (this.height)document.write(' HEIGHT=' + this.height);
	if (this.width)document.write(' WIDTH='  + this.width);
	if (this.otheratts)document.write(' ' + this.otheratts);
	document.write('></A>');
	if (this.sendfield)
	{
		document.write('<INPUT TYPE=HIDDEN NAME="' + this.sendfield + '">');
		document.forms[document.forms.length - 1].elements[this.sendfield].value='';
	}
}