function contactFormSubmit(sFormId) {
	var oForm = document.getElementById(sFormId);
	var i, oElement, oLabel, res;
	var bSubmit = true;
	
	for ( i in oForm.elements ) {
		oElement = oForm.elements[i];
		if ( ! oElement ) continue;
		
		switch ( oElement.type ) {
			case 'text' :
			case 'textarea' :
			case 'select' :
				oLabel = oElement.previousSibling;
				if ( ! oElement.getAttribute('validPattern') ) continue;
				pValidPattern = oElement.getAttribute('validPattern');
			break;
			default:
				continue;
			break;
		}
		
		eval('res = oElement.value.search('+ pValidPattern +');');
		if ( res == -1 ) {
			oLabel.className = "invalid";
			bSubmit = false;
		} else {
			oLabel.className = "";
		}
	}
	
	if ( bSubmit ) oForm.submit();
}
