/*
	rollover maker simplifier thingy.

	o.x.e. for haptek 20020418

	usage:

	in yer html, include this script up near the top.
	then, when you want a rollover image,
	bust out a script which just calls the function
	hap_RO_ADD(imgoff, imgon, href, w, h)
	imgoff = image for the off, or unactivated state
	imgon  = guess!
	href   = href for the image. defaults to javascript:;
	w      = width
	h      = height

	h, w, and href are optional, but if you don't include href, you can't include w or h, see.

	using this function can be as easy as
	<-s-c-r-i-p-t>hap_RO_Add("imgon.gif", "imgoff.gif");<-/-s-c-r-i-p-t>
*/

var	hap_RO_Array	=	new	Array();

function	hap_RO_Add(imgoff, imgon, href, w, h)
	{
	var num				=	hap_RO_Array.length;
	var ro				=	new	Object();
	ro.imgoff			=	new	Image();
	ro.imgon			=	new	Image();
	ro.imgoff.src		=	imgoff;
	ro.imgon .src		=	imgon;
	ro.name				=	"hap_RO_"+num;
	hap_RO_Array[num]	=	ro;

	if (typeof(href) != "undefined" && href != "")
		document.write	("<a href=\""+href+"\" ");
	else
		document.write	("<a href=\"javascript:;\"");
	document.write		("onMouseOver=hap_RO_Over("+num+"); ");
	document.write		("onMouseOut=hap_RO_Out("+num+"); ");
	document.write		(">");
	document.write		("<img name= \""+ro.name+"\" src=\""+ro.imgoff.src+"\"  border=0 ");
	if (typeof(w) != "undefined")
		document.write	("width="+w+" ");
	if (typeof(h) != "undefined")
		document.write	("height="+h+" ");
	document.write		("></a>");
	}

function	hap_RO_Over(num)
	{
	var ro			=	hap_RO_Array[num];
	eval("document."+ro.name).src	=	ro.imgon.src;
	}

function	hap_RO_Out(num)
	{
	var ro			=	hap_RO_Array[num];
	eval("document."+ro.name).src	=	ro.imgoff.src;
	}

