
var s = document.getElementsByTagName('script')[0];

if (s.src.match(/applabs\.js(\?.*)?$/) && !/MSIE\s5.0/.test(navigator.userAgent)) {
	var path = s.src.replace(/applabs\.js(\?.*)?$/,'');
	//var scripts = ['AC_RunActiveContent', 'mootools', 'scripts'];
	var scripts = ['AC_RunActiveContent', 'mootools', 'scripts'];
	if (!/MSIE\s5.5/.test(navigator.userAgent)) {
		if((document.URL.indexOf("managementteam.html")>0) || (document.URL.indexOf("boardofdirectors.html")>0) || (document.URL.indexOf("ProjectExamples_731.html")>0) || (document.URL.indexOf("ID=227")>0) || (document.URL.indexOf("ID=222")>0) )
		{
			scripts[scripts.length] = 'multiAccordion2';
		}
		else {
			scripts[scripts.length] = 'multiAccordion';
		}
	}
	for (var i = 0; i < scripts.length; i++) {
		document.write('<script type="text/javascript" src="' + path + scripts[i] + '.js"></script>');
	}
}

function openlink(url) {
	if (url != '') {
		window.location = url;
	}
	return false;
}

function go (el) {
	var url = el.value;
	if (url == 'all') {
		BigWheel.show();
		el.selectedIndex = 0;
	}
	else if (url != '') {
		window.location = url;
	}
}

var clearedInputs = new Array();
function inputClear (id) {
	for (var i = 0; i < clearedInputs.length; i++) {
		if (clearedInputs[i] == id) {
			return;
		}
	}
	var o = document.getElementById(id);
	if (!o) {
		return;
	}
	o.value = '';
	clearedInputs[clearedInputs.length] = id;
}


BigDelivery = {
	created: false,
	xml: '',
	create: function () {
		if (BigDelivery.created) {
			return;
		}
		var body = document.getElementsByTagName('body')[0];
		var overlay = document.createElement('div');
		overlay.id = 'overlay';
		var sizes = BigDelivery.getSizes();
		overlay.style.height = sizes.page.height + 'px';
		if (/msie/gi.test(navigator.userAgent.toLowerCase())) {
			overlay.style.filter = 'alpha(opacity=75)';
			overlay.style.width = sizes.page.width + 'px';
		}
		/*
		overlay.onclick = function (event) {
			BigDelivery.hide();
		}
		*/

		var container = document.createElement('div');
		container.id = 'bigwheelcontainer';

		/*
		container.onclick = function (event) {
			BigDelivery.hide();
		}
		*/

		var flashholder = document.createElement('div');
		flashholder.id = 'flashholder';
		/*
		flashholder.onclick = function (event) {
			BigDelivery.cancelBubble(event);
		}
		*/
		flashholder.style.position = 'relative';
		flashholder.style.margin = '0px auto';
		flashholder.style.width = '760px';
		container.appendChild(flashholder);

		var path = '';
		if (new String(window.location.href).indexOf('/html/') != -1) {
			path = '../';
		}

		var str = '';
		str += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="760" height="525" id="bigchartFlash" align="middle">\n';
		str += '	<param name="allowScriptAccess" value="sameDomain" />\n';
		str += '	<param name="movie" value="' + path + 'flash/chart_cont.swf" />\n';
		str += '	<param name="quality" value="high" />\n';
		//str += '	<param name="wmode" value="transparent" />\n';
		str += '	<param name="bgcolor" value="#ffffff" />\n';
		str += '	<param name="FlashVars" value="path=' + path + 'flash/" />\n';
		str += '	<embed src="' + path + 'flash/chart_cont.swf" FlashVars="path=' + path + 'flash/" id="bigchartFlash" quality="high" bgcolor="#ffffff" width="760" height="525" name="container" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n';
		str += '</object>\n';

		flashholder.innerHTML = str;

		var closebtn = document.createElement('a');
		closebtn.href = '#';
		closebtn.onclick = function (event) {
			BigDelivery.hide();
			return false;
		}
		closebtn.appendChild(document.createTextNode('Close'));
		closebtn.className = 'close';
		flashholder.appendChild(closebtn);

		body.appendChild(overlay);
		body.appendChild(container);
		BigDelivery.overlay = overlay;
		BigDelivery.container = container;
		BigDelivery.created = true;
	},
	destroy: function() {
		if (!BigDelivery.created) {
			return;
		}
		var body = document.getElementsByTagName('body')[0];
		body.removeChild(BigDelivery.overlay);
		body.removeChild(BigDelivery.container);
		BigDelivery.created = false;
	},
	show: function () {
		BigDelivery.create();
	},
	hide: function () {
		BigDelivery.destroy();
	},
	getSizes: function () {
		var xScroll, yScroll;
		
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = document.body.scrollWidth;
			yScroll = window.innerHeight + window.scrollMaxY;
		}
		else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		}
		else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		
		var windowWidth, windowHeight;
		if (self.innerHeight) {	// all except Explorer
			windowWidth = self.innerWidth;
			windowHeight = self.innerHeight;
		}
		else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		}
		else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	
		
		// for small pages with total height less then height of the viewport
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		}
		else { 
			pageHeight = yScroll;
		}
	
		// for small pages with total width less then width of the viewport
		if(xScroll < windowWidth){	
			pageWidth = windowWidth;
		}
		else {
			pageWidth = xScroll;
		}
	
	
		return { page: {width: pageWidth, height: pageHeight}, window: {width: windowWidth, height: windowHeight }};
	},
	cancelBubble:	function (eObj) {
		if (!eObj) var eObj = window.event;
		if (!eObj) return;
		eObj.cancelBubble = true;
		if (eObj.stopPropagation) {
			eObj.stopPropagation();
		}
	}
}

BigWheel = {
	created: false,
	xml: '',
	create: function () {
		if (BigWheel.created) {
			return;
		}
		var body = document.getElementsByTagName('body')[0];
		var overlay = document.createElement('div');
		overlay.id = 'overlay';
		var sizes = BigWheel.getSizes();
		overlay.style.height = sizes.page.height + 'px';
		if (/msie/gi.test(navigator.userAgent.toLowerCase())) {
			overlay.style.filter = 'alpha(opacity=75)';
			overlay.style.width = sizes.page.width + 'px';
		}
		/*
		overlay.onclick = function (event) {
			BigWheel.hide();
		}
		*/

		var container = document.createElement('div');
		container.id = 'bigwheelcontainer';

		/*
		container.onclick = function (event) {
			BigWheel.hide();
		}
		*/

		var flashholder = document.createElement('div');
		flashholder.id = 'flashholder';
		/*
		flashholder.onclick = function (event) {
			BigWheel.cancelBubble(event);
		}
		*/
		flashholder.style.position = 'relative';
		flashholder.style.margin = '0px auto';
		flashholder.style.width = '760px';
		container.appendChild(flashholder);

		var path = '';
		if (new String(window.location.href).indexOf('/html/') != -1) {
			path = '../';
		}
		var flashVars = 'path=' + path + 'flash/';

		for (var i = 0; i < services.length; i++) {
			flashVars += '&pie' + (i + 1) + '=' + escape(services[i]);
		}

		var str = '';
		str += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="760" height="580" id="bigwheelFlash" align="middle">\n';
		str += '	<param name="allowScriptAccess" value="sameDomain" />\n';
		str += '	<param name="movie" value="' + path + 'flash/container.swf" />\n';
		str += '	<param name="quality" value="high" />\n';
		str += '	<param name="wmode" value="transparent" />\n';
		str += '	<param name="bgcolor" value="#ffffff" />\n';
		str += '	<param name="FlashVars" value="'+ flashVars + '" />\n';
		str += '	<embed src="' + path + 'flash/container.swf" FlashVars="'+ flashVars + '" id="bigwheelFlash" quality="high" wmode="transparent" bgcolor="#ffffff" width="760" height="580" name="container" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n';
		str += '</object>\n';

		flashholder.innerHTML = str;

		var closebtn = document.createElement('a');
		closebtn.href = '#';
		closebtn.onclick = function (event) {
			BigWheel.hide();
			return false;
		}
		closebtn.appendChild(document.createTextNode('Close x'));
		closebtn.className = 'close';
		flashholder.appendChild(closebtn);

		body.appendChild(overlay);
		body.appendChild(container);
		BigWheel.overlay = overlay;
		BigWheel.container = container;
		BigWheel.created = true;
	},
	destroy: function() {
		if (!BigWheel.created) {
			return;
		}
		var body = document.getElementsByTagName('body')[0];
		body.removeChild(BigWheel.overlay);
		body.removeChild(BigWheel.container);
		BigWheel.created = false;
	},
	show: function () {
		BigWheel.create();
	},
	hide: function () {
		//BigWheel.overlay.style.display = 'none';
		//BigWheel.container.style.display = 'none';
		BigWheel.destroy();
	},
	getSizes: function () {
		var xScroll, yScroll;
		
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = document.body.scrollWidth;
			yScroll = window.innerHeight + window.scrollMaxY;
		}
		else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		}
		else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		
		var windowWidth, windowHeight;
		if (self.innerHeight) {	// all except Explorer
			windowWidth = self.innerWidth;
			windowHeight = self.innerHeight;
		}
		else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		}
		else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	
		
		// for small pages with total height less then height of the viewport
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		}
		else { 
			pageHeight = yScroll;
		}
	
		// for small pages with total width less then width of the viewport
		if(xScroll < windowWidth){	
			pageWidth = windowWidth;
		}
		else {
			pageWidth = xScroll;
		}
	
	
		return { page: {width: pageWidth, height: pageHeight}, window: {width: windowWidth, height: windowHeight }};
	},
	cancelBubble:	function (eObj) {
		if (!eObj) var eObj = window.event;
		if (!eObj) return;
		eObj.cancelBubble = true;
		if (eObj.stopPropagation) {
			eObj.stopPropagation();
		}
	}
}

function checkApplicationForm() {
	var authorisedFileType = new Array('doc', 'txt', 'rtf', 'pdf');
	var isAuthorisedType = true;
	var errorMsg = '';
	var badFields = new Array();
	var CVFileName = document.getElementById('file').value;
	var i;

	var msg = 'We\'re sorry but if you cannot confirm you are looking for a permanent position and are eligible to work in this country by ticking the two boxes on the form, we cannot accept your application.';
	if (!document.getElementById('permanent_position').checked || !document.getElementById('eligible_to_work_in_the_country').checked) {
		alert(msg);
		return false;
	}

	if (document.getElementById('name').value == '') {
		badFields.push({id: 'name', name: 'Name'});
	}
	if (document.getElementById('address1').value == '') {
		badFields.push({id: 'address1', name: 'Address line 1'});
	}
	if (document.getElementById('town').value == '') {
		badFields.push({id: 'town', name: 'Town'});
	}
	if (document.getElementById('state').value == '') {
		badFields.push({id: 'state', name: 'State/County'});
	}
	if (document.getElementById('country').value == '') {
		badFields.push({id: 'country', name: 'Country'});
	}
	if (document.getElementById('postcode').value == '') {
		badFields.push({id: 'postcode', name: 'Postal/Zip Code'});
	}
	if (document.getElementById('email').value == '') {
		badFields.push({id: 'email', name: 'Email Address'});
	}
	if (document.getElementById('tel').value == '') {
		badFields.push({id: 'tel', name: 'Telephone'});
	}
	if (CVFileName == '') {
		badFields.push({id: 'file', name: 'CV'});
	}
	else {
		//check file type
		var ext = CVFileName.substr(CVFileName.lastIndexOf('.') + 1);
		ext = ext.toLowerCase();
		isAuthorisedType = false;
		var authorisedFileTypeStr = ''
		var authorisedFileTypeLength = authorisedFileType.length;
		for (i = 0; i < authorisedFileTypeLength; i++) {
			if (ext == authorisedFileType[i]) isAuthorisedType = true;
			if (authorisedFileTypeStr != '') authorisedFileTypeStr += ', ';
			authorisedFileTypeStr += authorisedFileType[i];
		}
	}
	
	var badFieldsLength = badFields.length;
	if (badFieldsLength > 0 || !isAuthorisedType) {
		if (badFieldsLength > 0) {
			errorMsg = 'The following fields are required:\n';
			for (i = 0; i < badFieldsLength; i++) {
				errorMsg += '- ' + badFields[i].name + '\n';
			}
			// damn FF bug 236791
			$(badFields[0].id).setAttribute('autocomplete', 'off');
			$(badFields[0].id).focus();
			$(badFields[0].id).setAttribute('autocomplete', '');
		}
		if (!isAuthorisedType) {
			errorMsg += 'This type of file is not authorised. Types allowed: ';
			errorMsg += authorisedFileTypeStr + '.';
			// damn FF bug 236791
			$('file').setAttribute('autocomplete', 'off');
			$('file').focus();
			$('file').setAttribute('autocomplete', '');
		}
		alert(errorMsg);
		return false;
	}
	else {
		document.vacancyForm.submit();
		return true;
	}
}

//check form for the brochure
function checkAppForm() {
	var errorMsg;
	var badFields = new Array();
	
	if (document.getElementById('name').value == '') {
		badFields.push({id: 'name', name: 'First Name'});
	}
	if (document.getElementById('lastname').value == '') {
		badFields.push({id: 'lastname', name: 'Last Name'});
	}
	if (document.getElementById('company').value == '') {
		badFields.push({id: 'company', name: 'Company'});
	}
	if (document.getElementById('jobTitle').value == '') {
		badFields.push({id: 'jobTitle', name: 'Job title'});
	}
	if (document.getElementById('address1').value == '') {
		badFields.push({id: 'address1', name: 'Address Line 1'});
	}
	if (document.getElementById('town').value == '') {
		badFields.push({id: 'town', name: 'Town'});
	}
	if (document.getElementById('state').value == '') {
		badFields.push({id: 'state', name: 'State/County'});
	}
	if (document.getElementById('country').value == '') {
		badFields.push({id: 'country', name: 'Country'});
	}
	if (document.getElementById('postcode').value == '') {
		badFields.push({id: 'postcode', name: 'Postal/Zip Code'});
	}
	if (document.getElementById('telephone').value == '') {
		badFields.push({id: 'telephone', name: 'Telephone'});
	}
	if (document.getElementById('email').value == '') {
		badFields.push({id: 'email', name: 'Email'});
	}
	//if (document.getElementById('testingRequirement').value == '') {
	//	badFields.push({id: 'testingRequirement', name: 'Does your company have a testing requirement?'});
	//}
	if (document.getElementById('prospectType').value == '') {
		badFields.push({id: 'prospectType', name: 'What describes you best?'});
	}
        if (document.getElementById('txtCaptcha').value == '') {
                badFields.push({id: 'txtCaptcha', name: 'CAPTCHA phase'});
        }


	var badFieldsLength = badFields.length;
	if (badFieldsLength > 0) {
		errorMsg = 'The following fields are required:\n';
		for (i = 0; i < badFieldsLength; i++) {
			errorMsg += '- ' + badFields[i].name + '\n';
		}
		// damn FF bug 236791
		$(badFields[0].id).setAttribute('autocomplete', 'off');
		$(badFields[0].id).focus();
		$(badFields[0].id).setAttribute('autocomplete', '');
		alert(errorMsg);
		return false;
	}
	else {
		document.appform.submit();
		return true;
	}
}

function checkSOAForm() {
	var errorMsg;
	var badFields = new Array();
	
	if (document.getElementById('name').value == '') {
		badFields.push({id: 'name', name: 'Name'});
	}
	if (document.getElementById('jobTitle').value == '') {
		badFields.push({id: 'jobTitle', name: 'Job title'});
	}
	if (document.getElementById('company').value == '') {
		badFields.push({id: 'company', name: 'Company'});
	}
	if (document.getElementById('email').value == '') {
		badFields.push({id: 'email', name: 'Email'});
	}
	if (document.getElementById('industrySector').value == '') {
		badFields.push({id: 'industrySector', name: 'Industry sector'});
	}
	if (document.getElementById('roleDescription').value == '') {
		badFields.push({id: 'roleDescription', name: 'Role description'});
	}
	if (!document.getElementById('SOAImplementationTime').checked
		&& !document.getElementById('SOAImplementationTime2').checked
		&& !document.getElementById('SOAImplementationTime3').checked
		&& !document.getElementById('SOAImplementationTime4').checked) {
		badFields.push({id: 'SOAImplementationTime', name: 'Implementation time'});
	}
	if (!document.getElementById('SOAUse').checked
		&& !document.getElementById('SOAUse2').checked
		&& !document.getElementById('SOAUse3').checked
		&& !document.getElementById('SOAUse4').checked) {
		badFields.push({id: 'SOAUse', name: 'Use of SOA'});
	}
	if (!document.getElementById('benefitsOutweightRisks').checked
		&& !document.getElementById('benefitsOutweightRisks2').checked
		&& !document.getElementById('benefitsOutweightRisks3').checked
		&& !document.getElementById('benefitsOutweightRisks4').checked) {
		badFields.push({id: 'benefitsOutweightRisks', name: 'Benefits over risks'});
	}
	if (!document.getElementById('qualityAndTestingVSTraditional').checked
		&& !document.getElementById('qualityAndTestingVSTraditional2').checked
		&& !document.getElementById('qualityAndTestingVSTraditional3').checked
		&& !document.getElementById('qualityAndTestingVSTraditional4').checked) {
		badFields.push({id: 'qualityAndTestingVSTraditional', name: 'Approach of quality and testing'});
	}
	if (!document.getElementById('contactMe').checked && !document.getElementById('contactMe2').checked) {
		badFields.push({id: 'contactMe', name: 'Contact to discuss'});
	}
	
	var badFieldsLength = badFields.length;
	if (badFieldsLength > 0) {
		errorMsg = 'Please complete the following fields to submit this form:\n';
		for (i = 0; i < badFieldsLength; i++) {
			errorMsg += '- ' + badFields[i].name + '\n';
		}
		// damn FF bug 236791
		$(badFields[0].id).setAttribute('autocomplete', 'off');
		$(badFields[0].id).focus();
		$(badFields[0].id).setAttribute('autocomplete', '');
		alert(errorMsg);
		return false;
	}
	else {
		document.soaForm.submit();
		return true;
	}
}

function checkTestingForm() {
	var errorMsg;
	var badFields = new Array();
	
	if (document.getElementById('name').value == '') {
		badFields.push({id: 'name', name: 'Name'});
	}
	if (document.getElementById('jobTitle').value == '') {
		badFields.push({id: 'jobTitle', name: 'Job title'});
	}
	if (document.getElementById('company').value == '') {
		badFields.push({id: 'company', name: 'Company'});
	}
	if (document.getElementById('email').value == '') {
		badFields.push({id: 'email', name: 'Email'});
	}
	if (document.getElementById('industrySector').value == '') {
		badFields.push({id: 'industrySector', name: 'Industry sector'});
	}
	if (document.getElementById('roleDescription').value == '') {
		badFields.push({id: 'roleDescription', name: 'Role description'});
	}
	if (!document.getElementById('ITOffshoring').checked
		&& !document.getElementById('ITOffshoring2').checked
		&& !document.getElementById('ITOffshoring3').checked
		&& !document.getElementById('ITOffshoring4').checked) {
		badFields.push({id: 'ITOffshoring', name: 'Offshoring activity'});
	}
	if (!document.getElementById('OffshoringChallenge').checked
		&& !document.getElementById('OffshoringChallenge2').checked
		&& !document.getElementById('OffshoringChallenge3').checked
		&& !document.getElementById('OffshoringChallenge4').checked) {
		badFields.push({id: 'OffshoringChallenge', name: 'Offshoring challanges'});
	}
	if (!document.getElementById('ValueInQuality').checked
		&& !document.getElementById('ValueInQuality2').checked
		&& !document.getElementById('ValueInQuality3').checked
		&& !document.getElementById('ValueInQuality4').checked) {
		badFields.push({id: 'ValueInQuality', name: 'Value in quality'});
	}
	if (!document.getElementById('OffshoringSuccessFactor').checked
		&& !document.getElementById('OffshoringSuccessFactor2').checked
		&& !document.getElementById('OffshoringSuccessFactor3').checked
		&& !document.getElementById('OffshoringSuccessFactor4').checked) {
		badFields.push({id: 'OffshoringSuccessFactor', name: 'Offshoring success factors'});
	}
	if (!document.getElementById('PersonalOffshoringExperience').checked
		&& !document.getElementById('PersonalOffshoringExperience2').checked
		&& !document.getElementById('PersonalOffshoringExperience3').checked
		&& !document.getElementById('PersonalOffshoringExperience4').checked) {
		badFields.push({id: 'PersonalOffshoringExperience', name: 'Personal offshoring experience'});
	}
	if (!document.getElementById('contactMe').checked && !document.getElementById('contactMe2').checked) {
		badFields.push({id: 'contactMe', name: 'Contact to discuss'});
	}
	
	var badFieldsLength = badFields.length;
	if (badFieldsLength > 0) {
		errorMsg = 'Please complete the following fields to submit this form:\n';
		for (i = 0; i < badFieldsLength; i++) {
			errorMsg += '- ' + badFields[i].name + '\n';
		}
		// damn FF bug 236791
		$(badFields[0].id).setAttribute('autocomplete', 'off');
		$(badFields[0].id).focus();
		$(badFields[0].id).setAttribute('autocomplete', '');
		alert(errorMsg);
		return false;
	}
	else {
		document.testingForm.submit();
		return true;
	}
}

function checkPerfWebForm() {
        var errorMsg;
        var badFields = new Array();

        if (document.getElementById('name').value == '') {
                badFields.push({id: 'name', name: 'Name'});
        }
        if (document.getElementById('jobTitle').value == '') {
                badFields.push({id: 'jobTitle', name: 'Job title'});
        }
        if (document.getElementById('company').value == '') {
                badFields.push({id: 'company', name: 'Company'});
        }
        if (document.getElementById('email').value == '') {
                badFields.push({id: 'email', name: 'Email'});
        }
        if (document.getElementById('industrySector').value == '') {
                badFields.push({id: 'industrySector', name: 'Industry sector'});
        }
        if (document.getElementById('roleDescription').value == '') {
                badFields.push({id: 'roleDescription', name: 'Role description'});
        }
        if (!document.getElementById('WebsiteImportance').checked
                && !document.getElementById('WebsiteImportance2').checked
                && !document.getElementById('WebsiteImportance3').checked
                && !document.getElementById('WebsiteImportance4').checked) {
                badFields.push({id: 'WebsiteImportance', name: 'Importance of website for business'});
        }
        if (!document.getElementById('FailureImpact').checked
                && !document.getElementById('FailureImpact2').checked
                && !document.getElementById('FailureImpact3').checked
                && !document.getElementById('FailureImpact4').checked) {
                badFields.push({id: 'FailureImpact', name: 'Impact of website failure'});
        }
        if (!document.getElementById('CustomerConcerns').checked
                && !document.getElementById('CustomerConcerns2').checked
                && !document.getElementById('CustomerConcerns3').checked
                && !document.getElementById('CustomerConcerns4').checked) {
                badFields.push({id: 'CustomerConcerns', name: 'Frustrating experience'});
        }
        if (!document.getElementById('SecurityTestingPractices').checked
                && !document.getElementById('SecurityTestingPractices2').checked
                && !document.getElementById('SecurityTestingPractices3').checked
		&& !document.getElementById('SecurityTestingPractices4').checked
                && !document.getElementById('SecurityTestingPractices5').checked) {
                badFields.push({id: 'SecurityTestingPractices', name: 'Security testing practices'});
        }
        if (!document.getElementById('PerformanceTestingPractices').checked
                && !document.getElementById('PerformanceTestingPractices2').checked
                && !document.getElementById('PerformanceTestingPractices3').checked
		&& !document.getElementById('PerformanceTestingPractices4').checked
                && !document.getElementById('PerformanceTestingPractices5').checked) {
                badFields.push({id: 'PerformanceTestingPractices', name: 'Performance testing practices'});
        }
        if (!document.getElementById('FunctionalTestingPractices').checked
                && !document.getElementById('FunctionalTestingPractices2').checked
                && !document.getElementById('FunctionalTestingPractices3').checked
		&& !document.getElementById('FunctionalTestingPractices4').checked
                && !document.getElementById('FunctionalTestingPractices5').checked) {
                badFields.push({id: 'FunctionalTestingPractices', name: 'Functional testing practices'});
        }
        if (!document.getElementById('UserTestingPractices').checked
                && !document.getElementById('UserTestingPractices2').checked
                && !document.getElementById('UserTestingPractices3').checked
		&& !document.getElementById('UserTestingPractices4').checked
                && !document.getElementById('UserTestingPractices5').checked) {
                badFields.push({id: 'UserTestingPractices', name: 'User testing practices'});
        }

        if (!document.getElementById('WebsitePreparedness').checked
                && !document.getElementById('WebsitePreparedness2').checked
                && !document.getElementById('WebsitePreparedness3').checked) {
                badFields.push({id: 'WebsitePreparedness', name: 'Preparedness of website'});
        }
        if (!document.getElementById('contactMe').checked && !document.getElementById('contactMe2').checked) {
                badFields.push({id: 'contactMe', name: 'Contact to discuss'});
        }

        var badFieldsLength = badFields.length;
        if (badFieldsLength > 0) {
                errorMsg = 'Please complete the following fields to submit this form:\n';
                for (i = 0; i < badFieldsLength; i++) {
                        errorMsg += '- ' + badFields[i].name + '\n';
                }
                // damn FF bug 236791
                $(badFields[0].id).setAttribute('autocomplete', 'off');
                $(badFields[0].id).focus();
                $(badFields[0].id).setAttribute('autocomplete', '');
                alert(errorMsg);
                return false;
        }
        else {
                document.soaForm.submit();
                return true;
        }
}

