
	function showType(formField, list, sector, check)
	{
		if (sector=='' || sector!=check)
		{
			formField.type.length = 0;
			document.getElementById(list).style.display = 'none';
		}
		else
		{
			formField.type.length = 0;
			formField.type[0] = new Option('Type', '');
			for (var i=1; i<jobTypes[sector].length; i++)
		  	{
				formField.type[i] = new Option(jobTypes[sector][i].name, jobTypes[sector][i].index);
			}										 
			document.getElementById(list).style.display = '';
		}
	}
	
	var newImage, imageList, preloadCount, preloadInterval;
	var preloadCount = 0;
	imageList = new Array();
	
	function addPreloadImage(url)
	{
		imageList[imageList.length] = url;
	}
	
	function startPreloading()
	{ 
		if(imageList.length != 0)
		{
			newImage = new Image;
			newImage.src = imageList[0]
			preloadInterval = setInterval('preloadCheck()', 1000);
		}
	}
	
	function preloadCheck()
	{
		if (newImage.complete)
		{
			preloadCount += 1;
			if (preloadCount < imageList.length)
			{
				newImage.src = imageList[preloadCount];
				clearInterval(preloadInterval);
				preloadInterval = setInterval('preloadCheck()', 1000);
			}
			else
			{
				clearInterval(preloadInterval);
			}
		}
	}
	
	function imageSwap(key, url)
	{
		eval('document.' + key + '.src = \'' + url + '\'');
	}

	function mailto(recipient)
	{
		document.location.href = 'mailto:' + recipient + '@deployment.com?subject=Website Enquiry';
	}
	
	function goTo(url)
	{
		document.location.href = url;
	}

	function openWindow(url, width, height, sizeable)
	{
		if (sizeable==null) sizeable=true;
		if (sizeable) sizeable = ',resizable,scrollbars'
		else sizeable = '';
		if (!width) width=screen.availWidth*.8;
		if (!height) height=screen.availHeight*.8;
		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;
			}
		}
	}