var balMouseDown= false;

function balover( event, image_array, image )
    {
    if  ( balMouseDown )
	{
	balset( image_array, image );
	return;
	}

    if  ( ! image.src.match( ".*/ws-balset.gif" ) )
	{ image.src= "/pics/ws-balover.gif";	}
    }

function balout( image )
    {
    if  ( ! image.src.match( ".*/ws-balset.gif" ) )
	{ image.src= "/pics/ws-baltag.gif";	}
    }

function balset( image_array, image )
    {
    for ( var i= 0; i < image_array.length; i++ )
	{ image_array[i].src= "/pics/ws-baltag.gif";	}

    image.src= "/pics/ws-balset.gif";
    }

function baldown( event, image_array, image )
    {
    if  ( ! event )
	{ event= window.event; }

    balset( image_array, image );
    balMouseDown= true;

    if  ( document.addEventListener )
	{
	document.addEventListener( "mouseup", balup, true );
	document.addEventListener( "mousemove", balmove, true );
	event.stopPropagation();
	event.preventDefault();
	return;
	}

    if  ( document.attachEvent )
	{
	document.attachEvent( "onmouseup", balup );
	document.attachEvent( "onmousemove", balmove );
	event.cancelBubble= true;
	event.returnValue= false;
	return;
	}
    }

function balup( event )
    {
    if  ( ! event )
	{ event= window.event; }

    balMouseDown= false;

    if  ( document.removeEventListener )
	{
	document.removeEventListener( "mouseup", balup, true );
	document.removeEventListener( "mousemove", balmove, true );
	event.stopPropagation();
	event.preventDefault();
	return;
	}
    if  ( document.detachEvent )
	{
	document.detachEvent( "onmouseup", balup, true );
	document.detachEvent( "onmousemove", balmove, true );
	event.cancelBubble= true;
	event.returnValue= false;
	return;
	}
    }

function balmove( event )
    {
    if  ( ! event )
	{ event= window.event; }

    if  ( event.stopPropagation )
	{
	event.stopPropagation();
	event.preventDefault();
	}
    else{
	event.cancelBubble= true;
	event.returnValue= false;
	}
    }

