// =====================================================================================================================
// File: hrblink.js - Copyright (c) 2001 Henk Reints, www.chello.nl/~h.reints
// Usage:
//	<head>
//	<script src=hrblink.htm></script>
//	</head>
//	<body>
//	<script>
//		HRblink (500, "This text blinks with 500 millisec intervals.")
//	</script>
//	</body>
// ---------------------------------------------------------------------------------------------------------------------
HRblinkIE4 = (navigator.appName == "Microsoft Internet Explorer") && (1*navigator.appVersion.split(' ')[0] >= 4)
HRblinkCount = 0	// init counter of blinking objects
// ---------------------------------------------------------------------------------------------------------------------
// Next function creates a <span> object with blinking text using dynamic HTML
// (only if IE4+, otherwise it uses the <blink> tag).
// The ID of the span = "HRblinkItem" + the value of HRblinkCount as a sequence number.
// (blinkCount will automatically be incremented for the next call).
//
// The function should be called with 2 or more arguments:
//   time = the duration in milliseconds between visibility switches;
//   text = an item to be displayed as text
//   all (optional) extra arguments are treated as text as well.
// ---------------------------------------------------------------------------------------------------------------------
function HRblink (time, text)
{	if (!HRblinkIE4)	{document.write ('<blink>') }
	else			{document.write ('<span id="HRblinkItem' + HRblinkCount + '"' + ' style="visibility:hidden">') }
	for (var i = 1; i < arguments.length; i++) {document.write (arguments[i] ) }
	if (!HRblinkIE4)	{document.write ('</blink>') }
	else			{document.write ('</span>'); HRblinkEngine (HRblinkCount, time); HRblinkCount++}
}
// ---------------------------------------------------------------------------------------------------------------------
// Next function is the actual blink engine;
// it toggles the visibility attribute and then reschedules
// itself to run again after the given amount of time.
// ---------------------------------------------------------------------------------------------------------------------
function HRblinkEngine (i, time)
{	with (document.all['HRblinkItem'+i].style)
	{	if (visibility == 'visible')	{visibility = 'hidden' }
		else				{visibility = 'visible'}
	}
	setTimeout ('HRblinkEngine(' + i + ',' + time + ')', time)
}
// =====================================================================================================================
// end of file hrblink.js - Copyright (c) 2001 Henk Reints, www.chello.nl/~h.reints
