
	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 imageSwap(key, url)
	{
		eval('document.' + key + '.src = \'' + url + '\'');
	}

	function swapSky(key, mouseOn)
	{
		if (!mouseOn) eval('document.' + key + '.src = \'/images/services/' + key + '.gif\'');
		else eval('document.' + key + '.src = \'/images/services/' + key + 'Light.gif\'');
	}

	function mailto(recipient)
	{
		document.location.href = 'mailto:' + recipient + '@tekpersonnel.co.uk?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;
			}
		}
	}