var i = 0;
var pics = new Array();
function PreCache(names, ImgOne, ImgSec)
{
	pics[i]	 	= new Array(5);
	pics[i][0] 	= new Image();
	pics[i][0].src	= ImgOne;
	pics[i][1] 	= new Image();
	pics[i][1].src  = ImgSec;
	pics[i][2] = names;
	i++;
}

function on(name)
{
	for(x = 0; x < i ; x++)
	{
	if(document.images[pics[x][2]]!=null)
	if(name!=pics[x][2])
	{
	document.images[pics[x][2]].src=pics[x][0].src;
	}
	else
	{
	document.images[pics[x][2]].src=pics[x][1].src;
	}
	}
}

function off()
{
	for(x = 0; x < i; x++)
		{
		        if(document.images[pics[x][2]]!=null)
		        document.images[pics[x][2]].src=pics[x][0].src;
		}
}


PreCache("services", "img/services.jpg", "img/services_.jpg");
PreCache("contact", "img/contact.jpg", "img/contact_.jpg");
PreCache("about", "img/about.jpg", "img/about_.jpg");
