
	var newImage, imageList, preloadCount;
	var preloadCount = 0;
	imageList = new Array();
	
	function addPreloadImage(url)
	{
		imageList[imageList.length] = url;
	}
	
	function startPreloading()
	{ 
		newImage = new Image;
		newImage.src = imageList[0]
		setInterval('preloadCheck()', 1000);
	}
	
	function preloadCheck()
	{
		if (newImage.complete)
		{
			preloadCount += 1;
			if (!preloadCount >= imageList.length)
			{
				newImage.src = imageList[preloadCount];
				setInterval('preloadCheck()', 1000);
			}
		}
	}
		
	function imageLoaded()
	{
		return newImage.complete;
	}	
	
	function changeClass(object, newClass)
	{
		object.className = newClass;
	}

	function mailto(name)
	{
		document.location.href = 'mailto:' + name + '@businesschange.uk.com?subject=Website Enquiry';
	}
	
	function goTo(url)
	{
		document.location.href = url;
	}

	function openWindow(url, width, height, sizeable)
	{
		if (sizeable) sizeable = ',resizable,scrollbars'
		else sizeable = '';
		var openWin = window.open(url,'_blank','width=' + width + ',height=' + height + ',screenX=' + ((screen.availWidth-width)/2) + ',left=' + ((screen.availWidth-width)/2) + ',screenY=' + ((screen.availHeight-height)/2) + ',top=' + ((screen.availHeight-height)/2) + sizeable);
		openWin.focus();
	}
	
//#-- VARIABLE TO TRACK IF CURRENT FORM FIELD IS A TEXT AREA - IF SO, microsoftKeyPress SHOULDN'T RUN
var textArea = false;
//#-- FUNCTION TO HANDLE KEYPRESSES IN IE BROWSERS
	function microsoftKeyPress() 
	{	
		if (!textArea)
		{
	  	  if (window.event.keyCode == 13)
			{
				submitForm();
				window.event.returnValue = false;
			}
		}
	}

	function showRow(row, show)
	{
	row = document.getElementById(row)
	if (show)
	{
		if (row.currentstyle)
		{
			try
			{
				row.style.display = 'block';
			}
			catch(e)
			{
				row.style.display = 'table-row';
			}
		}
		else
		{
			try
			{
				row.style.display = 'table-row';
			}
			catch(e)
			{
				row.style.display = 'block';
			}
		}
	}
	else
	{
			row.style.display = 'none';
	}
}

	function imageSwap(key, newURL)
	{
		eval('document.' + key + '.src=\'' + newURL + '\'');
	}
	
	function roundNumber(number) {
		var s = '' + Math.round(number * 100) / 100
  		var i = s.indexOf('.')
  		if (i < 0) return s + '.00'
  		var t = s.substring(0, i + 1) + s.substring(i + 1, i + 3)
  		if (i + 2 == s.length) t += '0'
  		return t
	}
	
	function menuMouseover(key, on)
	{
		if (on) imageSwap(key, '/images/menu/' + key.substr(0, key.length-4) + 'On.gif');
		else imageSwap(key, '/images/menu/' + key.substr(0, key.length-4) + '.gif');
	}
