var cache_mouseover_images = new Array();

var buttons= new Array("Home","About","NewsEvents","Sale","Competition","Training","Contact","hold_news");

var news_xtra= new Array();

var intTimer=null;

function LoadMouseOverImages() 
{
	var j = 1;	

	for (var i = 0; i < buttons.length; i++)
	{
		j=buttons[i];
		cache_mouseover_images[j] = new Array();
		cache_mouseover_images[j][0] = new Image();	cache_mouseover_images[j][0].src = "images/buttons/" + j + "1.gif";
		cache_mouseover_images[j][1] = new Image();	cache_mouseover_images[j][1].src = "images/buttons/" + j + "0.gif";
	}

	if (news_xtra.length>0)
	{
		for (var i = 0; i < news_xtra.length; i++)
		{
			j=news_xtra[i];
			cache_mouseover_images[j] = new Array();
			cache_mouseover_images[j][0] = new Image();	cache_mouseover_images[j][0].src = "images/news/" + j + ".jpg";
			cache_mouseover_images[j][1] = new Image();	cache_mouseover_images[j][1].src = "images/news/" + j + ".jpg";
		}
	}
}

function SI(img,j,on) 
{
	//alert(img+","+j+","+on);
	if (typeof(img)=='string')
	{
		img= document.getElementById(img);
	}

	if (!img) return;
	if (!img.src) return;
	if (!cache_mouseover_images[j]) return;

	img.src = cache_mouseover_images[j][on].src;

	// check the browser supports width and height properties on cached images
	// and if so, change the image holder to those dimensions
		if (cache_mouseover_images[j][on].width)
		{
			if (cache_mouseover_images[j][on].height)
			{
				img.style.width = cache_mouseover_images[j][on].width + "px";
				img.style.height = cache_mouseover_images[j][on].height + "px";
			}
		}
}