function validateSupportForm(form)
{
    var strAlertMessageArr = getFormErrors(form);
    if (typeof form.messagetype != 'undefined' &&  form.messagetype.value == 0) {
         strAlertMessageArr.push(lang("Select a valid ticket type."));
    }

    customFields.validateCustomFields(strAlertMessageArr);
    
    if ( form.subject.value == '' ) {
        strAlertMessageArr.push(lang("Please enter a valid subject."));
    }

    if ( form.message.value == '' ) {
        strAlertMessageArr.push(lang("Please enter a valid message."));
    }

    if(typeof form.file_0 != 'undefined' && form.file_0.value !=""){
        var fileName=form.file_0.value;
        var fileNameArr=(form.file_0.value).split(".");
        var fileExtn="";
        if(fileNameArr.length>1){
            fileExtn=fileNameArr[fileNameArr.length-1];
        }
        var allowedExtn=0;
        var extns=(form.validExtns.value).split(",");
        for(i=0;i<extns.length;i++){
          if(toLowerCase(extns[i])==toLowerCase(fileExtn)){
            allowedExtn=1;
            break;
          }
        }
        if(form.validExtns.value == '*') {
            allowedExtn=1;
        }
        if(allowedExtn==0){
            strAlertMessageArr.push(lang("File "+fileName+" upload failed."));
            strAlertMessageArr.push(lang("Allowed extensions are "+form.validExtns.value));
        }
    }
    if (strAlertMessageArr.length > 0) {
        alert(strAlertMessageArr.join("\n"));
        return false;
    }
    return true;
}
