//Validacao de campo obrigatorio.

	var message = "";
			
            function checkObrigatorio(field) {
                var isValid = true;
                var focusField = null;
                var i = 0;

                    if (field.type == 'text' ||
                        field.type == 'textarea' ||
                        field.type == 'file' ||
                        field.type == 'select-one' ||
                        field.type == 'radio' ||
                        field.type == 'password') {
                        
                        var value = '';
					// get field's value
					if (field.type == "select-one") {
						var si = field.selectedIndex;
						if (si >= 0) {
							value = field.options[si].value;
						}
					} else {
						value = field.value;
					}
                        
                        if (trim(value).length == 0) {
                        
	                        if (i == 0) {
	                            focusField = field;
	                        }
	                        isValid = false;
                        }
                    }

                return isValid;
            }
            
            // Trim whitespace from left and right sides of s.
            function trim(s) {
                return s.replace( /^\s*/, "" ).replace( /\s*$/, "" );
            }
