var _oldImage;

function ItemOver(img, which, page, language)
{
    var ipath = '/portals/_default/skins/tricor/images/';
    var suffix = language != '' ? which + '-' + language  : which;
    
    // if we are hovering over a different item
    if (_oldImage != img)
    {
        // put the old one in the "off" state
        if (_oldImage != undefined)
        {
            if (img.nodeName.toString().toLowerCase() != 'img')
                _oldImage.style.background = _oldImage.style.background.replace( 'ON', 'OFF' );
            else
                _oldImage.src = _oldImage.src.toString().replace( 'ON', 'OFF' );
        }

        var imgBG = document.getElementById('splash_bg_image');
		imgBG.style.background = 'url(' + ipath + 'home_billboard-' + suffix + '.jpg)';

        // Change the background of the advert.
		if ( img.nodeName.toString().toLowerCase() != 'img' )
		{
		    img.style.background = 'url(' + ipath + 'home_button-' + which + '-ON.gif)';
		    img.style.backgroundRepeat = "no-repeat";
		}
		else
		    img.src = ipath + 'home_button-' + which + '-ON.gif';
        
        // set the link based on the item
        var lnkMoreInfo = $get( "lnkMoreInfo" );
        lnkMoreInfo.href = page;

        // set the old image to the current image for review next roll-over.
        _oldImage = img;
    }
}
