<!--
                        function remove_newlines(inputString) {
                                    rExp = /\r\n|\r/g;
                                    result = inputString.replace(rExp, " ");
                                    return result;
                        }
                        function trim_spaces(inputString) {
                                    if (typeof inputString != "string") {
                                                return inputString;
                                    }
                                    var retValue = inputString;
                                    var ch = retValue.substring(0, 1);
                                    while (ch == " ") { 
                                                retValue = retValue.substring(1, retValue.length);
                                                ch = retValue.substring(0, 1);
                                    }
                                    ch = retValue.substring(retValue.length-1, retValue.length);
                                    while (ch == " ") { 
                                                retValue = retValue.substring(0, retValue.length-1);
                                                ch = retValue.substring(retValue.length-1, retValue.length);
                                    }
                                    while (retValue.indexOf("  ") != -1) { 
                                                retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
                                    }
                                    return retValue; 
                        }
                        function remove_newlines_and_trim_spaces(inputString) {
                                    if (typeof inputString != "string") {
                                                rExp = /\r\n|\r/g;
                                                result = inputString.replace(rExp, " ");
                                                return result;
                                    }
                                    var retValue = inputString;
                                    var ch = retValue.substring(0, 1);
                                    while (ch == " ") { 
                                                retValue = retValue.substring(1, retValue.length);
                                                ch = retValue.substring(0, 1);
                                    }
                                    ch = retValue.substring(retValue.length-1, retValue.length);
                                    while (ch == " ") { 
                                                retValue = retValue.substring(0, retValue.length-1);
                                                ch = retValue.substring(retValue.length-1, retValue.length);
                                    }
                                    while (retValue.indexOf("  ") != -1) { 
                                                retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
                                    }
                                    rExp = /\r\n|\r/g;
                                    result = retValue.replace(rExp, " ");
                                    return result; 
                        }
                        function check_email(inputString)
                        {
                                    var filter=/^([\w-]+([\.\w-'])*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
                                    if (!filter.test(inputString)) {
                                                return false;
                                    }
                                    return true;
                        }
                        function check_digit(inputString) {
                                    isPrice = /^\d+\.{0,1}\d*$/;
                                    return isPrice.test(inputString);
                        }


                        function check_currency(inputString) {
                                    isCurrency = /^\$\d+\.{0,1}\d*$/;
                                    return isCurrency.test(inputString);
                        }
                        function check_word_only(inputString) {
                                    isAlphaNumeric = /^[A-Za-z0-9\ \-'\’\‘\/\.]*$/;
                                    return isAlphaNumeric.test(inputString);
                        }

                        function highlight(field, is_error) {
                                    style_name = "no_error";
                                    if (parseInt(is_error)==1) {
                                                style_name = "error";
                                    }
                                    field.setAttribute((document.all ? "className" : "class"),style_name); 
                                    return true;
                        }
  function validate_form() {
                                                                        var error_count = 0;
                                                                        var error_questions = "";
                                                                        var set_focus_field_id = "";
                                                             
                                                                                                if(document.getElementById("question_28")) {
                                                                                                            highlight(document.getElementById("question_28"), "0");
                                                                                                }
                                                            if(document.getElementById("question_28").value.length == 0) {
                                                                        highlight(document.getElementById("question_28"),"1");
                                                                        error_questions += "Answer can not be empty for First Name\n"; 
                                                                        temp = document.getElementById("question_28").name;
                                                                        if (set_focus_field_id.length == 0) {
                                                                                    set_focus_field_id = "question_28";       
                                                                        }
                                                                        error_count++;
                                                            }
                                                
                                                                        temp = document.getElementById("question_28").name;
                                                                        if(eval("check_word_only(document.main_form."+temp+".value)") == false) {
                                                                                    error_questions += "Invalid word for First Name\n";
                                                                                    if (set_focus_field_id.length == 0) {
                                                                                                set_focus_field_id = "question_28";       
                                                                                    }
                                                                                    highlight(document.getElementById("question_28"),"1");
                                                                                    error_count++;
                                                                        }
                                                             
                                                                                                if(document.getElementById("question_29")) {
                                                                                                            highlight(document.getElementById("question_29"), "0");
                                                                                                }
                                                            if(document.getElementById("question_29").value.length == 0) {
                                                                        highlight(document.getElementById("question_29"),"1");
                                                                        error_questions += "Answer can not be empty for Email Address\n"; 
                                                                        temp = document.getElementById("question_29").name;
                                                                        if (set_focus_field_id.length == 0) {
                                                                                    set_focus_field_id = "question_29";       
                                                                        }
                                                                        error_count++;
                                                            }
                                                
                                                                        temp = document.getElementById("question_29").name;
                                                                        if(document.getElementById("question_29").value.length>0  && eval("check_email(document.main_form."+temp+".value)") == false) {
                                                                                    error_questions += "Invalid email for Email Address\n"; 
                                                                                    if (set_focus_field_id.length == 0) {
                                                                                                set_focus_field_id = "question_29";       
                                                                                    }
                                                                                    highlight(document.getElementById("question_29"),"1");
                                                                                    error_count++;
                                                                        }
                                                            
                                                            temp = document.getElementById("question_29").name;
                                                            temp2 = eval("remove_newlines_and_trim_spaces(document.main_form."+temp+".value)");
                                                            temp3 = eval("document.main_form."+temp);
                                                            temp3.value = temp2;
                                                
                                    if (error_count > 0) {
                                                if (set_focus_field_id.length>0 && document.getElementById(set_focus_field_id)) {
                                                            eval(document.getElementById(set_focus_field_id).focus());
                                                }
                                                alert ("Please fill the form correctly\n\n"+error_questions);
                                                return false;
                                    }
                                                document.main_form.submit();
}//-->