function trace (s) {
	if (!document.getElementById('debug')) {
		var o = document.createElement('pre');
		o.id = 'debug';
		o.style.color = 'black';
		o.style.fontSize = '10pt';
		o.style.position = 'absolute';
		o.style.top = '0px';
		o.style.right = '0px';
		o.style.textAlign = 'left';
		document.getElementsByTagName('body')[0].appendChild(o);
	}
	if (typeof console == 'undefined') {
		document.getElementById('debug').innerHTML += s + '<br />';
	}
	else {
		console.log(s);
	}
}

Event.observe(window, 'load', function (evt) {
	init();
});


function init () {
	// prep menu for ie
	//if (/msie/gi.test(navigator.userAgent.toLowerCase())) {
	if (new RegExp('msie', 'gi').test(navigator.userAgent.toLowerCase())) {
		var uls = document.getElementsByTagName('ul');
		for (var i = 0; i < uls.length; i++) {
			if (uls[i].parentNode.id.match(/^nb[\d+]$/)) {
				uls[i].style.visibility = 'hidden';
				uls[i].style.display = 'block';
				var w = uls[i].offsetWidth - 2;
				var as = uls[i].getElementsByTagName('a');
				for (var j = 0; j < as.length; j++) {
					as[j].style.width = w + 'px';
				}
				uls[i].style.visibility = 'visible';
				uls[i].style.display = ''

				var li = uls[i].parentNode;
				li.onmouseover = function () {
					this.getElementsByTagName('ul')[0].style.display = 'block';
				}
				li.onmouseout = function () {
					this.getElementsByTagName('ul')[0].style.display = '';
				}
			}
		}
	}
	// prep menu for webkit/safari (hide's flash movie on mouse over)
	if ($('splashFlash') && (/webkit/gi.test(navigator.userAgent.toLowerCase()) || /safari/gi.test(navigator.userAgent.toLowerCase()))) {
		var uls = document.getElementsByTagName('ul');
		for (var i = 0; i < uls.length; i++) {
			if (uls[i].parentNode.id.match(/^nb[\d+]$/)) {
				var li = uls[i].parentNode;
				li.onmouseover = function () {
					$('splashFlash').style.visibility = 'hidden';
				}
				li.onmouseout = function () {
					$('splashFlash').style.visibility = 'visible';
				}
			}
		}
		$('splashImage').style.background = 'url(flash/noanim/' + flashFile.image + ')';
	}
	Scroller.init();


	// prepare the submit forms
	$A(document.getElementsByTagName('form')).each(function (form) {
		if (form.action && form.action.match(/form_complete\.php/)) {
			new AjaxForm(form);
		}
	});

	return;
}
var AjaxForm = Class.create();
AjaxForm.prototype = {
	initialize: function (form) {
		this.form = $(form);
		this.inputs = [].concat(
			$A(this.form.getElementsByTagName('input')),
			$A(this.form.getElementsByTagName('textfield')),
			$A(this.form.getElementsByTagName('select'))
		);
		this.eventSubmit = this.submit.bindAsEventListener(this);
		this.submitFunction = null;
		if (this.form.onsubmit) {
			this.form.submitFunction = this.form.onsubmit;
			this.form.onsubmit = null;
		}
		this.form.observe('submit', this.eventSubmit);
	},
	submit: function (evt) {
		Event.stop(evt);
		if (this.form.submitFunction) {
			if (!this.form.submitFunction()) {
				return;
			}
		};
		var params = Form.serialize(this.form);
		var af = this;
		var ajax = new Ajax.Request(
			af.form.action, {
				method: af.form.method.toLowerCase(),
				parameters: params,
				onSuccess:	function (oXML) {
					af.returned();
				},
				onFailure:	function () {
					af.error();
				}
			}
		);
	},
	returned:	function (formObj) {
		appendedInputs = []; // front page nasty hack
		this.form.reset();
		var s = '<div class="thankyou"><p>Thank you for taking the time to fill out the form, we will be in touch shortly.</p><a class="popupClose" href="javascript:;" onclick="Popup.hide()">Close</a></div>';
		Popup.display(s);
	},
	error:		function (formObj, oXML) {
		alert('An error occurred while submitting the form.\n\nPlease try again.');
	}
}


//var Popup = Class.create();
Popup = {
	// moo.fx version,
	bodyPadding: 20,
	overlay: 'overlay',
	outerCont: 'popouter',
	innerCont: 'popinner',
	intrans:	false,
	fadeDuration:	300, // milliseconds
	resizeDuration:	200, // milliseconds
	created:	false,
	content:	null,
	iframe: null, // required to block out windowed controls in IE, see http://dotnetjunkies.com/WebLog/jking/archive/2003/07/21/488.aspx
	isIE: /MSIE/gi.test(navigator.userAgent),
	ieIE7: /MSIE\s7/gi.test(navigator.userAgent),
	create:	function () {
		var overlay = document.createElement('div');
		overlay.setAttribute('id', Popup.overlay);
		overlay = $(overlay);
		overlay.onclick = function (event) {
			Popup.hide();
		}
		overlay.setStyle({
			position: 'absolute',
			left: '0px',
			top: '0px',
			width: '100%',
			height: '100%',
			display: 'none',
			zIndex: '1000'
		});

		var outer = document.createElement('div');
		outer.setAttribute('id', Popup.outerCont);
		outer = $(outer);
		outer.onclick = function (event) {
			Popup.hide();
		}
		outer.setStyle({
			position: 'absolute',
			top: '30px',
			width: '100%',
			textAlign: 'center',
			left: '0px',
			display: 'none',
			zIndex: '1000'
		});

		var inner = document.createElement('div');
		inner.setAttribute('id', Popup.innerCont);
		inner = $(inner);
		inner.onclick = function (event) {
			Popup.cancelBubble(event);
		}
		inner.setStyle({
			marginRight: 'auto',
			marginLeft: 'auto',
			textAlign: 'left'
		});

		var sizes = Popup.getSizes();
		overlay.style.height = sizes.page.height + 'px';
		//if (/msie/gi.test(navigator.userAgent.toLowerCase())) {
		if (Popup.isIE) {
			overlay.style.width = sizes.page.width + 'px';
		}
		outer.appendChild(inner);


		if (Popup.isIE && !Popup.isIE7) {
			// create the iframe
			var iframe = document.createElement('iframe');
			iframe = $(iframe);
			iframe.setStyle({
				position: 'absolute',
				left: '0px',
				top: '0px',
				width: overlay.style.width,
				height: overlay.style.height,
				visibility: 'visible',
				display: 'none',
				background: '#fff',
				opacity: '0'
			});
			document.getElementsByTagName('body')[0].appendChild(iframe);
			Popup.iframe = iframe;
		}

		document.getElementsByTagName('body')[0].appendChild(overlay);
		document.getElementsByTagName('body')[0].appendChild(outer);

		Popup.overlay = document.getElementById(Popup.overlay);
		Popup.outerCont = document.getElementById(Popup.outerCont);
		Popup.innerCont = document.getElementById(Popup.innerCont);

		Popup.created = true;

		Event.observe(window, 'resize', function (evt) {
			setTimeout('Popup.resized()', 10); 
		});
	},
	resized: function () {
		Popup.overlay.setStyle({display: 'none'});
		if (Popup.iframe) {
			Popup.iframe.setStyle({display: 'none'});
		}

		var sizes = Popup.getSizes();

		Popup.overlay.style.height = sizes.page.height + 'px';
		//if (/msie/gi.test(navigator.userAgent.toLowerCase())) {
		if (Popup.isIE) {
			Popup.overlay.style.width = sizes.page.width + 'px';
		}
		if (Popup.iframe) {
			Popup.iframe.setStyle({
				width: Popup.overlay.style.width,
				height: Popup.overlay.style.height,
				display: ''
			});
		}
		Popup.overlay.setStyle({display: ''});
	},
	fadeInContent: function () {
		var content = Popup.innerCont.getElementsByTagName('div')[0];
		content = $(content);
		content.setStyle({
			position: '',
			visibility: 'visible',
			opacity: '0'
		});
	},
	showContent: function() {
		// resize the box

		var content = document.createElement('div');
		content = $(content);
		content.setStyle({
			position: 'absolute',
			visibility: 'hidden'
		});

		if (Popup.href) {
			var str = Popup.oXML.responseText;
			//var m = /<body.*?>([\s\S]*)<\/body>/mgi.exec(str);
			var m = new RegExp('<body.*?>([\\s\\S]*)</body>', 'mgi').exec(str);
			str = m ? m[1] : '<p style="margin: 0px; padding: 20px">An error has occured</p>';
			var path = (window.location.href.indexOf('/digitaldictation/') != -1) ? '../' : '';
			str = str.replace(/images\//, path + 'images/');
			content.innerHTML = Popup.options.contentLoaded(str);
		}
		else {
			if (typeof(Popup.implant) == 'string') {
				content.innerHTML = Popup.implant;
			}
			else {
				content.appendChild(Popup.implant);
			}
		}

		// append the content to the document and get it's size
		document.getElementsByTagName('body')[0].appendChild(content);

		var oldDims = Popup.getDimensions(Popup.innerCont);
		var newDims = Popup.getDimensions(content);

		// remove the content from the document
		document.getElementsByTagName('body')[0].removeChild(content);

		// change the boxes height
		var heightFx = new Fx.Style(Popup.innerCont, 'height', {
			duration: Popup.resizeDuration,
			onComplete: function () {
				var widthFx = new Fx.Style(Popup.innerCont, 'width', {
					duration: Popup.resizeDuration,
					onComplete: function () {
						content.setStyle({
							position: '',
							visibility: 'hidden',
							width: newDims.width + 'px',
							height: newDims.height + 'px'
						});
						// append the content
						Popup.innerCont.appendChild(content);
						
						if (typeof Popup.options.onContentAppend != 'undefined' && Popup.options.onContentAppend) {
							Popup.options.onContentAppend();
						}

						var fadeFx = new Fx.Style(content, 'opacity', {
							duration: Popup.fadeDuration,
							onComplete: function () {
								if (Popup.isIE && !Popup.isIE7) {
									//Popup.content.style.filter = null;
								}
								Popup.intrans = false;
							}
						});
						fadeFx.custom(0, 1);
					}
				});
				widthFx.custom(oldDims.width, newDims.width);
			}
		});
		Popup.delContent();
		heightFx.custom(oldDims.height, newDims.height);
	},
	showLoading: function () {
	    var con = Popup.xhcon();
	    if (!con) {
			return;
		}

		// show the loading gif
		//var img = document.createElement('img');
		//img = $(img);
		//img.setStyle({margin: '30px'});
		//img.setAttribute('src', Popup.path + 'images/loading.gif');
		Popup.delContent();
		Popup.innerCont.setStyle({
			width: '150px',
			height: '150px',
			//background: '#fff'
			background: Popup.options.innerBackground
		});
		//Popup.innerCont.appendChild(img);
		Popup.outerCont.setStyle({visibility: 'visible', display: 'block'});

		if (Popup.href) {
			con.connect(Popup.href, 'GET', Math.random(), function (oXML) {
				Popup.oXML = oXML;
				setTimeout('Popup.showContent()', 0);
			});
		}
		else {
			Popup.showContent();
		}
	},
	showOverlay: function () {
		Popup.overlay.setStyle({
			display: 'block',
			visibility: 'hidden',
			background: Popup.options.overlayBackground
		});
		var overlayFx = new Fx.Style(Popup.overlay, 'opacity', {
			duration: Popup.fadeDuration,
			onComplete: function () {
				Popup.showLoading();
				//overlayFx.custom(Popup.options.opacity, 0);
			}
		});
		overlayFx.custom(0, Popup.options.opacity);
	},
	show:	function () {
		if (!Popup.created) {
			Popup.create();
		}

		if (Popup.intrans) {
			return false;
		}

		var path = (window.location.href.indexOf('/html/') != -1) ? '../' : '';
		Popup.path = path;

		Popup.intrans = true;
		if (Popup.iframe) {
			Popup.iframe.setStyle({
				display: 'block'
			});
		}
		Popup.showOverlay();
	},
	hide:		function () {
		if (Popup.intrans) {
			return;
		}

		Popup.intrans = true;
		var overlayFx = new Fx.Style(Popup.overlay, 'opacity', {
			duration: Popup.fadeDuration,
			onComplete: function () {
				if (Popup.iframe) {
					Popup.iframe.setStyle({
						display: 'none'
					});
				}
				Popup.intrans = false;
			}
		});
		var contentFx = new Fx.Style(Popup.innerCont, 'opacity', {
			duration: Popup.fadeDuration,
			onComplete: function () {
				Popup.outerCont.setStyle({display: 'none'});
				Popup.innerCont.setStyle({visibility: 'visible', opacity: '1'});
				overlayFx.custom(Popup.options.opacity, 0);
			}
		});
		Popup.delContent();
		contentFx.custom(1, 0);
		return false;
	},
	delContent:	function () {
		Popup.innerCont.innerHTML = '';
	},
	display: function (o, options) {
		// move to the top of the page
		window.scrollTo(0, 0);

		Popup.implant = o;
		Popup.oXML = null;
		Popup.href = null;
		Popup.options = Object.extend({
			innerBackground: '#fff',
			overlayBackground: '#fff',
			opacity: 0.7,
			contentLoaded: function (s) { return s; }
		}, options || {});
		Popup.show();
	},
	load:	function (href, options) {
		// move to the top of the page
		window.scrollTo(0, 0);		

		Popup.implant = null;
		Popup.oXML = null;
		Popup.href = href;
		Popup.options = Object.extend({
			innerBackground: '#fff',
			overlayBackground: '#fff',
			opacity: 0.7,
			contentLoaded: function (s) { return s; }
		}, options || {});
		Popup.show();
	},
	/*
	resized:	function () {
		//if (Popup.created && /msie/gi.test(navigator.userAgent.toLowerCase())) {
		//if (Popup.created && new RegExp('msie', 'gi').test(navigator.userAgent.toLowerCase())) {
		if (Popup.isIE) {
			var sizes = Popup.getSizes();
			overlay.style.height = sizes.page.height + 'px';
			overlay.style.width = sizes.page.width + 'px';
		}
	},
	*/
	cancelBubble:	function (eObj) {
		if (!eObj) var eObj = window.event;
		if (!eObj) return;
		eObj.cancelBubble = true;
		if (eObj.stopPropagation) {
			eObj.stopPropagation();
		}
	},
	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;
		}
		*/
		else {
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		}
		
		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 }};
	},
	getDimensions: function(element) {
		if (!element) {
			return false;
		}
		if (element.style.display != 'none') {
			return {width: element.offsetWidth, height: element.offsetHeight};
		}

		// All *Width and *Height properties give 0 on elements with display none,
		// so enable the element temporarily
		var els = element.style;
		var originalVisibility = els.visibility;
		var originalPosition = els.position;
		els.visibility = 'hidden';
		els.position = 'absolute';
		els.display = '';
		var originalWidth = element.clientWidth;
		var originalHeight = element.clientHeight;
		els.display = 'none';
		els.position = originalPosition;
		els.visibility = originalVisibility;
		return {width: originalWidth, height: originalHeight};
	},
	xhcon:		function () {
		var xmlhttp, bComplete = false;
		try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
		catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
		catch (e) { try { xmlhttp = new XMLHttpRequest(); }
		catch (e) { xmlhttp = false; }}}
		if (!xmlhttp) {
			return null;
		}
		this.connect = function(sURL, sMethod, sVars, fnDone) {
			if (!xmlhttp) {
				return false;
			}
			bComplete = false;
			sMethod = sMethod.toUpperCase();
	
			try {
				if (sMethod == "GET") {
					xmlhttp.open(sMethod, sURL+"?"+sVars, true);
					sVars = "";
				}
				else {
					xmlhttp.open(sMethod, sURL, true);
					xmlhttp.setRequestHeader("Method", "POST "+sURL+" HTTP/1.1");
					xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				}
				xmlhttp.onreadystatechange = function() {
					if (xmlhttp.readyState == 4 && !bComplete) {
						bComplete = true;
						fnDone(xmlhttp);
					}
				};
				xmlhttp.send(sVars);
			}
			catch(z) { return false; }
			return true;
		};
		return this;
	}
}



var flashFile = {image: '10.jpg', title: 'pioneers'};
function getFlashFile() {
	var files = [
		{image: '10.jpg', title: 'pioneers'},
		{image: '1.jpg', title: 'control'},
		{image: '2.jpg', title: 'leading edge'},
		{image: '3.jpg', title: 'productivity'},
		{image: '4.jpg', title: 'support'},
		{image: '5.jpg', title: 'security'},
		{image: '6.jpg', title: 'teamwork'},
		{image: '7.jpg', title: 'advanced\ntechnology'},
		{image: '8.jpg', title: 'peace of mind'},
		{image: '9.jpg', title: 'mobility'}
	];

	if (Cookie.get('splash')) {
		flashFile = files[Math.floor(Math.random() * files.length)];
		return flashFile;
	}
	else {
		flashFile = files[0];
		Cookie.set('splash', true);
	}

	return flashFile; 
}


Cookie = {
	get:	function (name) {
	    var dc = document.cookie;
	    var prefix = name + "=";
	    var begin = dc.indexOf("; " + prefix);
	    if (begin == -1) {
	        begin = dc.indexOf(prefix);
	        if (begin != 0) return null;
	    } else {
	        begin += 2;
	    }
	    var end = document.cookie.indexOf(";", begin);
	    if (end == -1) {
	        end = dc.length;
	    }
	    return unescape(dc.substring(begin + prefix.length, end));
	},
	set:	function (name, value, expires, path, domain, secure) {
	    document.cookie= name + "=" + escape(value) +
	        ((expires) ? "; expires=" + expires.toGMTString() : "") +
	        ((path) ? "; path=" + path : "") +
	        ((domain) ? "; domain=" + domain : "") +
	        ((secure) ? "; secure" : "");
	},
	del:	function (name, path, domain) {
	    if (getCookie(name)) {
	        document.cookie = name + "=" +
	            ((path) ? "; path=" + path : "") +
	            ((domain) ? "; domain=" + domain : "") +
	            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
	    }
	}
}


var appendedInputs = new Array();
function inputAppend(o) {
	for (var i = 0; i < appendedInputs.length; i++) {
		if (appendedInputs[i] == o) {
			return;
		}
	}
	appendedInputs.push(o);
	o.value += ': ';
	// move the caret to the end
	if (document.selection) {
		// IE
		o.focus();
		var oSel = document.selection.createRange();
		oSel.moveStart ('character', -o.value.length);
		oSel.moveEnd ('character', -o.value.length);
		oSel.moveStart ('character', o.value.length);
		oSel.moveEnd ('character', o.value.length);
		oSel.select();
	}
	else if (o.selectionStart || o.selectionStart == '0') {
		o.selectionStart = o.value.length;
		o.selectionEnd = o.value.length;
		o.focus();
	}
}

function virtualTour(url) {
	var path = (window.location.href.indexOf('/digitaldictation/') != -1) ? '../' : '';
	url = path + url;
	Popup.load(url, {
		contentLoaded: function (str) {
			if (path == '../') {
				str = str.replace(new RegExp('uploads', 'gi'), '../uploads');
			}
			return str;
		}
	});
	return false;
}

function playGame() {
	var path = '';
	if (window.location.href.indexOf('/digitaldictation/') != -1 || window.location.href.indexOf('/healthcare/') != -1) {
		path = '../';
	}
	Popup.load(path + 'game2.html', {
		//innerBackground: '#fff',
		//overlayBackground: '#3f3f3f',
		//opacity: 1,
		contentLoaded: function (str) {
			if (path == '../') {
				str = str.replace(new RegExp('game\.swf', 'gi'), '../game.swf');
			}
			return str;
		}
	});
	return;
}

function showInPopup(file, options) {
	var path = '';
	if (window.location.href.indexOf('/digitaldictation/') != -1 || window.location.href.indexOf('/healthcare/') != -1) {
		path = '../';
	}
	Popup.load(path + file, options);
}


function page_open() {
	var select = 'select_region';
	var page = '';
	if (!$(select) || !(demo = $(select).value)) {
		return;
	}
	location.href = $(select).value;
}

function demo_open() {
	var select = 'select_demo';
	var demo = '';
	if (!$(select) || !(demo = $(select).value)) {
		return;
	}
	location.href = $(select).value;
}

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

SubmitForm = function (id) {
	var frm = $(id);
	if (!frm) return;

	var btn = document.createElement('input');
	btn.type = 'submit';
	btn.name = 'submit';
	btn.value = 'submit';
	btn.style.position = 'absolute';
	btn.style.left = '-3000px';
	$(frm).appendChild(btn);
	$(btn).click();
}

FormSubmitter = {
	forms:		['formApply'],
	url:		'submit_form.php',
	init:		function () {
		var f = FormSubmitter;
		for (var i = 0; i < f.forms.length; i++) {
			f.forms[i] = $(f.forms[i]);
			if (f.forms[i]) {
				f.forms[i].onsubmit = function () {
					FormSubmitter.submitted(this);
					return false;
				}
			}
		}
	},
	reset:		function () {
		var f = FormSubmitter;
		for (var i = 0; i < f.forms.length; i++) {
			f.forms[i] = $(f.forms[i]);
			if (f.forms[i]) {
				$(f.forms[i].id + 'submitted').style.display = 'none';
				$(f.forms[i].id + 'returned').style.display = 'none';
				//f.forms[i].style.display = 'block';
				Effect.Appear(f.forms[i], {duration: 0.1});
			}
		}
	},
	submit:		function (id) {
		FormSubmitter.submitted($(id));
	},
	submitted:	function (formObj, params) {
		//alert('heh');
		//$(formObj.id + 'submitted').style.display = 'block';
		//trace(FormSubmitter.serialize(formObj));

		var params = FormSubmitter.serialize(formObj) + '&ajax=true';

	    var con = FormSubmitter.xhcon();
	    if (!con) return;

		function conComplete(oXML) {
			CaseStudies.processXML(oXML);
		}
		con.connect(
			FormSubmitter.url,
			'POST',
			params,
			function (oXML) {
				FormSubmitter.returned(formObj);
			}
		);
	},
	returned:	function (formObj) {
		$(formObj.id + 'Form').style.display = 'none';
		$(formObj.id + 'Submitted').style.display = 'block';
		//$(formObj).reset();
	},
	serialize:	function (formObj) {
		var frm = $(formObj);
		var fields = new Array();
		var inputs = frm.getElementsByTagName('input');
		for (var i = 0; i < inputs.length; i++) {
			switch (inputs[i].type.toLowerCase()) {
				case 'checkbox':
				case 'radio':
					if (inputs[i].checked) {
						fields.push([inputs[i].name, inputs[i].value]);
					}
					break;
				default:
					fields.push([inputs[i].name, inputs[i].value]);
					break;
			}
		}
	
		var inputs = frm.getElementsByTagName('textarea');
		for (var i = 0; i < inputs.length; i++) {
			fields.push([inputs[i].name, inputs[i].value]);
		}
	
		var inputs = frm.getElementsByTagName('select');
		for (var i = 0; i < inputs.length; i++) {
			fields.push([inputs[i].name, inputs[i].value]);
		}
	
		var encodedFields = new Array();
		for (var i = 0; i < fields.length; i++) {
			var name = encodeURIComponent(fields[i][0]);
			if (name.length > 0) {
				encodedFields.push(name + '=' + encodeURIComponent(fields[i][1]));
			}
		}
		return encodedFields.join('&');
	},
	xhcon:		function () {
		var xmlhttp, bComplete = false;
		try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
		catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
		catch (e) { try { xmlhttp = new XMLHttpRequest(); }
		catch (e) { xmlhttp = false; }}}
		if (!xmlhttp) return null;
		this.connect = function(sURL, sMethod, sVars, fnDone) {
			if (!xmlhttp) return false;
			bComplete = false;
			sMethod = sMethod.toUpperCase();
	
			try {
				if (sMethod == "GET") {
					xmlhttp.open(sMethod, sURL+"?"+sVars, true);
					sVars = "";
				}
				else {
					xmlhttp.open(sMethod, sURL, true);
					xmlhttp.setRequestHeader("Method", "POST "+sURL+" HTTP/1.1");
					xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				}
				xmlhttp.onreadystatechange = function() {
					if (xmlhttp.readyState == 4 && !bComplete) {
						bComplete = true;
						fnDone(xmlhttp);
					}
				};
				xmlhttp.send(sVars);
			}
			catch(z) { return false; }
			return true;
		};
		return this;
	}
}

Clients = {
	ids: ['ausClients', 'usaClients', 'belClients', 'holClients', 'scotClients', 'northClients', 'irelandClients', 'walesClients', 'midlandsClients', 'eastClients', 'londonClients', 'southClients', 'channelClients'], 
	show:	function (id) {
		for (var i = 0; i < Clients.ids.length; i++) {
			if (id != Clients.ids[i]) {
				$(Clients.ids[i]).style.display = 'none';
			}
			else {
				$(Clients.ids[i]).style.display = 'block';
			}
		}
	}
}

Scroller = {
	id:		'newsScroll',
	distance:	1,
	speed:		20, // lower is faster
	timer:		null,
	init:	function () {
		var s = Scroller;
		s.id = $(s.id);
		if (!s.id) {
			return;
		}

		var childCount = s.id.childNodes.length;
		var childrenWidth = 0;
		for (var i = 0; i < childCount; i++) {
			if (s.id.childNodes[i].offsetWidth) {
				childrenWidth += s.id.childNodes[i].offsetWidth;
			}
		}
		var width = 0;
		do {
			// add the children again
			for (var i = 0; i < childCount; i++) {
				s.id.appendChild(s.id.childNodes[i].cloneNode(true));
			}
			width += childrenWidth;
		}
		while (width < (s.id.parentNode.offsetWidth + childrenWidth))

		var as = s.id.getElementsByTagName('a');
		for (var i = 0; i < as.length; i++) {
			as[i].onmouseover = function () { Scroller.pause() };
			as[i].onmouseout = function () { Scroller.play() };
		}
		s.id.style.left = '0px';
		Scroller.play();
	},
	play:	function () {
		if (Scroller.timer) {
			clearTimeout(Scroller.timer);
		}
		Scroller.timer = setTimeout('Scroller.move()', Scroller.speed);
	},
	pause:	function () {
		if (Scroller.timer) {
			clearTimeout(Scroller.timer);
		}
	},
	move:	function () {
		var s = Scroller;
		var left = parseInt(s.id.style.left) - s.distance;
		var nodes = new Array();
		var domupdate = false;
		for (var i = 0; i < s.id.childNodes.length; i++) {
			var w = s.id.childNodes[i].offsetWidth;
			if (!w) {
				nodes[nodes.length] = s.id.childNodes[i];
			}
			if (w) {
				if ((left + w) < 0) {
					left += w;
					nodes[nodes.length] = s.id.childNodes[i];
					domupdate = true;
				}
				else {
					break;
				}
			}
		}

		if (domupdate) {
			for (var i = 0; i < nodes.length; i++) {
				s.id.removeChild(nodes[i]);
				s.id.appendChild(nodes[i]);
			}
		}
		Scroller.id.style.left = left + 'px';
		Scroller.timer = setTimeout('Scroller.move()', Scroller.speed);
	}
}




/*
function getDimensions (element) {
	element = $(element);
	if (element.style.display != 'none') {
		return {width: element.offsetWidth, height: element.offsetHeight};
	}
	// All *Width and *Height properties give 0 on elements with display none,
	// so enable the element temporarily
	var els = element.style;
	var originalVisibility = els.visibility;
	var originalPosition = els.position;
	els.visibility = 'hidden';
	els.position = 'absolute';
	els.display = '';
	var originalWidth = element.clientWidth;
	var originalHeight = element.clientHeight;
	els.display = 'none';
	els.position = originalPosition;
	els.visibility = originalVisibility;
	return {width: originalWidth, height: originalHeight};
}

function $t(str) {
	return document.createTextNode(str);
}

function $(element) {
	if (typeof element == 'string' && element.length > 0) {
		element = document.getElementById(element);
	}
	return element;
}
*/


/************************************************
*                                               *
*            Date object                        *
*                                               *
************************************************/

// format is used in a similar way to http://uk.php.net/date
// restricted chars must be escaped with a '\', however in javascript
// when writing the string the '\' itself must be escaped
// E.g. var str = new Date().format('\\Year: Y'); -> Year: 2005
//      var str = new Date().format('\Year: Y');  -> 2005ear: 2005
// note only the 1 '\' in the second example
Date.prototype.format = function (str) {
	this.procProps();
	var pos = 0;
	var buff = '';
	var esc = false;
	while (pos < str.length) {
		var c = str.charAt(pos);
		if (c == '\\' && !esc) {
			esc = true;
		}
		else if (this.isReservedChar(c) && !esc) {
			buff += eval('this.' + c);
		}
		else {
			buff += c;
			esc = false;
		}
		pos++;
	}
	return buff;
}
Date.prototype.isReservedChar = function (c) {
	for (var i = 0; i < this.reservedChars.length; i++) {
		if (this.reservedChars[i] == c) {
			return true;
		}
	}
	return false;
}
Date.prototype.strPad = function (strIn, padLength) {
	var strPad = '0';
	var strIn = new String(strIn);
	var j = strIn.length;
	for (var i = j; i < padLength; i++) {
		strIn = strPad + strIn;
	}
	return strIn;
}
Date.prototype.procProps = function () {
	// see http://uk.php.net/date for a list of the properties
	// D - A textual representation of a day, three letters (Sun through Sat)
	// l (lowercase 'L') - A full textual representation of the day of the week (Sunday through Saturday)
	// d - Day of the month, 2 digits with leading zeros (01 to 31)
	// j - Day of the month without leading zeros (1 to 31)
	// F - A full textual representation of a month, such as January or March (January through December)
	// m - Numeric representation of a month, with leading zeros (01 through 12)
	// M - A short textual representation of a month, three letters (	Jan through Dec)
	// Y - A full numeric representation of a year, 4 digits (Examples: 1999 or 2003)
	// y - A two digit representation of a year (Examples: 99 or 03)
	// H - 24-hour format of an hour with leading zeros (00 through 23)
	// i - Minutes with leading zeros (00 to 59)
	// s - Seconds, with leading zeros (00 through 59)
	// S - English ordinal suffix for the day of the month, 2 characters (st, nd, rd & th)
	this.reservedChars = ['D', 'l', 'd', 'j', 'F', 'm', 'M', 'Y', 'y', 'H', 'i', 's', 'S'];
	if (isNaN(this.getDate()) || isNaN(this.getMonth()) || isNaN(this.getFullYear())) { 
		this.setFullYear(1900, 0, 1);
	}
	var shortDays = new Array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
	var longDays = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
	var monthNames = new Array ('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
	var shortMonthNames = new Array ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
	this.D = shortDays[this.getDay()];
	this.l = longDays[this.getDay()];
	this.d = this.strPad(this.getDate(), 2);
	this.j = this.getDate();
	this.F = monthNames[this.getMonth()];
	this.m = this.strPad(this.getMonth() + 1, 2);
	this.M = shortMonthNames[this.getMonth()];
	this.Y = this.getFullYear();
	this.y = (this.getYear() > 100) ? this.strPad(this.getYear() - 100, 2) : this.strPad(this.getYear(), 2);
	this.i = this.strPad(this.getMinutes(), 2);
	this.H = this.strPad(this.getHours(), 2);
	this.s = this.strPad(this.getSeconds(), 2);
	switch (this.getDate()) {
		case 1:	this.S = 'st';	break;
		case 2:	this.S = 'nd';	break;
		case 3:	this.S = 'rd';	break;
		case 21: this.S = 'st';	break;
		case 22: this.S = 'nd';	break;
		case 23: this.S = 'rd'; break;
		case 31: this.S = 'st'; break;
		default: this.S = 'th'; break;
	}
}

/*
* cssjs
* written by Christian Heilmann (http://icant.co.uk)
* eases the dynamic application of CSS classes via DOM
* parameters: action a, object o and class names c1 and c2 (c2 optional)
* actions: swap exchanges c1 and c2 in object o
*			add adds class c1 to object o
*			remove removes class c1 from object o
*			check tests if class c1 is applied to object o
* example:	cssjs('swap',document.getElementById('foo'),'bar','baz');
*/
function cssjs (a, o, c1, c2) {
	o = $(o);
	if (!o) {
		return false;
	}
	switch (a){
		case 'swap':
			o.className = !cssjs('check', o, c1) ? o.className.replace(c2, c1) : o.className.replace(c1, c2);
			break;
		case 'add':
			if (!cssjs('check', o, c1)) {
				o.className += o.className ? ' ' + c1 : c1;
			}
			break;
		case'remove':
			var rep = o.className.match(' ' + c1) ? ' ' + c1 : c1;
			o.className = o.className.replace(rep, '');
			break;
		case 'check':
			return new RegExp('\\b' + c1 + '\\b').test(o.className)
			break;
	}
}

function showDate(){
	var d = new Date()
	var monthname=new Array("JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC")
	document.write(d.getDate() + " " + monthname[d.getMonth()] + " " + d.getFullYear())
}

function Is (){   // convert all characters to lowercase to simplify testing
    var agt=navigator.useragent.tolowercase();

    // *** browser version ***
    // note: On IE5, these return 4, so use is.ie5up to detect IE5
    // or is.ie6up to detect IE6.

    this.major = parseint(navigator.appversion);
    this.minor = parsefloat(navigator.appversion);

    // note: opera and webtv spoof navigator.  we do strict client detection.
    // if you want to allow spoofing, take out the tests for opera and webtv.
    this.moz     = ((agt.indexof('mozilla') != -1) && (agt.indexof('spoofer')==-1)&& (agt.indexof('compatible') == -1) && (agt.indexof('opera')==-1) && (agt.indexof('webtv')==-1) && (agt.indexof('hotjava')==-1));
    this.moz2    = (this.moz && (this.major == 2));
    this.moz3    = (this.moz && (this.major == 3));
    this.moz4    = (this.moz && (this.major == 4));
    this.moz4up  = (this.moz && (this.major >= 4));
    this.moz5    = (this.moz && (this.major == 5));
    this.moz5up  = (this.moz && (this.major >= 5));
    this.gecko   = (agt.indexOf('gecko') != -1);

    this.nav2    = this.moz2;
    this.nav3    = this.moz3;
    this.nav4    = this.moz4;
    this.nav4up  = (this.nav4 || ((this.major >= 4) && (agt.indexOf("netscape") != -1)));
    this.nav     = (this.nav2 || this.nav3 || this.nav4);
    this.nav6    = (this.moz && (this.major == 5) && (agt.indexOf("netscape6/6") != -1));
    this.nav6up  = (this.moz && (this.major >= 5) && (agt.indexOf("netscape") != -1));
    this.nav7    = (this.moz && (this.major == 5) && (agt.indexOf("netscape/7") != -1));
    this.nav7up  = (this.nav6up && !this.nav6);
    this.navonly = (this.nav && ((agt.indexOf(";nav") != -1) || (agt.indexOf("; nav") != -1)) );

    this.mozilla  = (this.moz && this.gecko);
    this.mozilla1 = (this.moz && this.gecko && (agt.indexOf("rv:1") != -1));

    this.ie      = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    this.ie3     = (this.ie && (this.major < 4));
    this.ie4     = (this.ie && (this.major == 4) && (agt.indexof("msie 4") != -1) );
    this.ie4up   = (this.ie && (this.major >= 4));
    this.ie5     = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0") != -1) );
    this.ie5_5   = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.5") != -1));
    this.ie5up   = (this.ie && !this.ie3 && !this.ie4);
    this.ie5_5up = (this.ie && !this.ie3 && !this.ie4 && !this.ie5);
    this.ie6     = (this.ie && (this.major == 4) && (agt.indexOf("msie 6.") != -1) );
    this.ie6up   = (this.ie && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie5_5);
    this.ie7     = (this.ie && (this.major == 4) && (agt.indexOf("msie 7.") != -1) );
    this.ie7up   = (this.ie && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie5_5 && !this.ie6);

    this.msn    = (this.ie4up && (agt.indexOf("msn") != -1));
    this.msn2_5 = (this.msn && (agt.indexOf("msn 2.5") != -1));
    this.msn2_6 = (this.msn && (agt.indexOf("msn 2.6") != -1));

    this.aol      = (agt.indexOf("aol") != -1);
    this.aol3     = (this.aol && this.ie3);
    this.aol4ie3  = (this.aol && this.ie3);
    this.aol4ie4  = (this.aol && this.ie4);
    this.aol4     = (this.aol4ie3 || this.aol4ie4);
    this.aol5     = (agt.indexOf("aol 5") != -1);
    this.aol6     = (agt.indexOf("aol 6") != -1);
    this.aol7     = ((agt.indexOf("aol 7") != -1) || agt.indexOf("aol/7") != -1);
    this.aol8     = ((agt.indexOf("aol 8") != -1) || agt.indexOf("aol/8") != -1);

    this.opera = (agt.indexOf("opera") != -1);
    this.opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
    this.opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
    this.opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
    this.opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
    this.opera5up = (this.opera && !this.opera2 && !this.opera3 && !this.opera4);
    this.opera6 = (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1);
    this.opera6up = (this.opera6 || this.opera5up);

    this.webtv = (agt.indexOf("webtv") != -1); 

    this.TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
    this.AOLTV = this.TVNavigator;

    this.hotjava = (agt.indexOf("hotjava") != -1);
    this.hotjava3 = (this.hotjava && (this.major == 3));
    this.hotjava3up = (this.hotjava && (this.major >= 3));

    // *** JAVASCRIPT VERSION CHECK ***
    if (this.nav2 || this.ie3) this.js = 1.0;
    else if (this.nav3) this.js = 1.1;
    else if (this.opera5up) this.js = 1.3;
    else if (this.opera) this.js = 1.1;
    else if ((this.nav4 && (this.minor <= 4.05)) || this.ie4) this.js = 1.2;
    else if ((this.nav4 && (this.minor > 4.05)) || this.ie5) this.js = 1.3;
    else if (this.hotjava3up) this.js = 1.4;
    else if (this.nav6 || this.gecko) this.js = 1.5;
    // NOTE: In the future, update this code when newer versions of JS
    // are released. For now, we try to provide some upward compatibility
    // so that future versions of Nav and IE will show they are at
    // *least* JS 1.x capable. Always check for JS version compatibility
    // with > or >=.
    else if (this.nav6up) this.js = 1.5;
    // note ie5up on mac is 1.4
    else if (this.ie5up) this.js = 1.3

    // HACK: no idea for other browsers; always check for JS version with > or >=
    else this.js = 0.0;

    // *** PLATFORM ***
    this.win   = ( (agt.indexOf("win") != -1) || (agt.indexOf("16bit") != -1) );
    // NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
    //        Win32, so you can't distinguish between Win95 and WinNT.
    this.win95 = ((agt.indexOf("win95") != -1) || (agt.indexOf("windows 95") != -1));

    // is this a 16 bit compiled version?
    this.win16 = ((agt.indexOf("win16") != -1) || (agt.indexOf("16bit") != -1) || (agt.indexOf("windows 3.1") != -1) || (agt.indexOf("windows 16-bit") != -1) );  

    this.win31 = ((agt.indexOf("windows 3.1") != -1) || (agt.indexOf("win16") != -1) || (agt.indexOf("windows 16-bit") != -1));

    // NOTE: Reliable detection of Win98 may not be possible. It appears that:
    //       - On Nav 4.x and before you'll get plain "Windows" in userAgent.
    //       - On Mercury client, the 32-bit version will return "Win98", but
    //         the 16-bit version running on Win98 will still return "Win95".
    this.win98 = ((agt.indexOf("win98") != -1) || (agt.indexOf("windows 98") != -1));
    this.winnt = ((agt.indexOf("winnt") != -1) || (agt.indexOf("windows nt") != -1));
    this.win32 = (this.win95 || this.winnt || this.win98 || ((this.major >= 4) && (navigator.platform == "Win32")) || (agt.indexOf("win32") != -1) || (agt.indexOf("32bit") != -1));

    this.winme = ((agt.indexOf("win 9x 4.90") != -1));
    this.win2k = ((agt.indexOf("windows nt 5.0") != -1));
    this.winxp = ((agt.indexOf("windows nt 5.1") != -1));
    this.windotnet = ((agt.indexOf("windows nt 5.2") != -1));

    this.os2   = ((agt.indexOf("os/2") != -1) || (navigator.appVersion.indexOf("OS/2") != -1) || (agt.indexOf("ibm-webexplorer") != -1));

    this.mac    = (agt.indexOf("mac") != -1);
    // hack ie5 js version for mac
    if (this.mac && this.ie5up) this.js = 1.4;
    this.mac68k = (this.mac && ((agt.indexOf("68k") != -1) || (agt.indexOf("68000") != -1)));
    this.macppc = (this.mac && ((agt.indexOf("ppc") != -1) || (agt.indexOf("powerpc") != -1)));
    // macos detection not a real science, too little info in ua
    this.macos  = (this.mac && ((agt.indexOf("mac os") != -1) || (agt.indexOf("macos") != -1) ||
                                this.ie));
    this.macos8 = (this.macos && ((agt.indexOf("os 8") != -1) || (agt.indexOf("os8") != -1)));
    // ie5.13 reports as ie5.12 on os x
    this.macos9 = ((this.mac && (this.ie5 && (agt.indexOf("msie 5.13") != -1))) ||(this.macos && ((agt.indexOf("os 9") != -1) || (agt.indexOf("os9") != -1))));
    this.macosx = (this.macos && ((agt.indexOf("os x") != -1) || (agt.indexOf("osx") != -1)));

    this.sun   = (agt.indexOf("sunos") != -1);
    this.sun4  = (agt.indexOf("sunos 4") != -1);
    this.sun5  = (agt.indexOf("sunos 5") != -1);
    this.suni86= (this.sun && (agt.indexOf("i86") != -1));
    this.irix  = (agt.indexOf("irix") != -1);    // SGI
    this.irix5 = (agt.indexOf("irix 5") != -1);
    this.irix6 = ((agt.indexOf("irix 6") != -1) || (agt.indexOf("irix6") != -1));
    this.hpux  = (agt.indexOf("hp-ux") != -1);
    this.hpux9 = (this.hpux && (agt.indexOf("09.") != -1));
    this.hpux10= (this.hpux && (agt.indexOf("10.") != -1));
    this.aix   = (agt.indexOf("aix") != -1);      // IBM
    this.aix1  = (agt.indexOf("aix 1") != -1);    
    this.aix2  = (agt.indexOf("aix 2") != -1);    
    this.aix3  = (agt.indexOf("aix 3") != -1);    
    this.aix4  = (agt.indexOf("aix 4") != -1);    
    this.linux = (agt.indexOf("inux") != -1);
    this.sco   = (agt.indexOf("sco") != -1) || (agt.indexOf("unix_sv") != -1);
    this.unixware = (agt.indexOf("unix_system_v") != -1); 
    this.mpras    = (agt.indexOf("ncr") != -1); 
    this.reliant  = (agt.indexOf("reliantunix") != -1);
    this.dec   = ((agt.indexOf("dec") != -1) || (agt.indexOf("osf1") != -1) || (agt.indexOf("dec_alpha") != -1) || (agt.indexOf("alphaserver") != -1) || (agt.indexOf("ultrix") != -1) || (agt.indexOf("alphastation") != -1)); 
    this.sinix = (agt.indexOf("sinix") != -1);
    this.freebsd = (agt.indexOf("freebsd") != -1);
    this.bsd = (agt.indexOf("bsd") != -1);
    // hack macos if not linux or bsd
    this.macos = (this.macos || (!this.linux && !this.bsd));
    this.unix  = ((agt.indexOf("x11") != -1) || this.sun || this.irix || this.hpux || this.sco ||this.unixware || this.mpras || this.reliant || this.dec || this.sinix || this.aix || this.linux || this.bsd || this.freebsd);
	this.vms   = ((agt.indexOf("vax") != -1) || (agt.indexOf("openvms") != -1));
}

function checkRegionForm() {
	var errorMsg;
	var badFields = new Array();
	
	if (document.getElementById('name').value == '') {
		badFields.push({id: 'name', name: 'name'});
	}
	if (document.getElementById('firm').value == '') {
		badFields.push({id: 'firm', name: 'firm'});
	}
	if (document.getElementById('email').value == '') {
		badFields.push({id: 'email', name: 'email'});
	}
	if (document.getElementById('telephone').value == '') {
		badFields.push({id: 'telephone', name: 'telephone'});
	}
	if (document.getElementById('city').value == '') {
		badFields.push({id: 'city', name: 'city'});
	}
	if (document.getElementById('county')) {
		if (document.getElementById('county').value == '') {
			badFields.push({id: 'county', name: 'county'});
		}
	}
	if (document.getElementById('state')) {
		if (document.getElementById('state').value == '') {
			badFields.push({id: 'state', name: 'state'});
		}
	}
	if (document.getElementById('country')) {
		if (document.getElementById('country').value == '') {
			badFields.push({id: 'country', name: 'country'});
		}
	}
	if (document.getElementById('province')) {
		if (document.getElementById('province').value == '') {
			badFields.push({id: 'province', name: 'province'});
		}
	}
	if (document.getElementById('zip').value == '') {
		badFields.push({id: 'zip', name: 'zip/postcode'});
	}
	
	var badFieldsLength = badFields.length;
	if (badFieldsLength > 0) {
		errorMsg = 'Please fill in the following fields:\n';
		for (i = 0; i < badFieldsLength; i++) {
			errorMsg += '- ' + badFields[i].name + '\n';
		}
		// damn FF bug 236791
		document.getElementById(badFields[0].id).setAttribute('autocomplete', 'off');
		document.getElementById(badFields[0].id).focus();
		document.getElementById(badFields[0].id).setAttribute('autocomplete', '');
		alert(errorMsg);
		return false;
	}
	else {
		return true;
	}
}
