/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
Ext.apply(Ext.form.VTypes, {
    passwordStrength : function(val) {
        var patt=new RegExp(passwordRegex);
        if(patt.test(val)){
            return true;
        }else{
            return false;
        }
    },
    passwordStrengthText : textStore['passwordFormat1'],

    password : function(val, field) {
        if (field.initialPassField) {
            var pass = Ext.getCmp(field.initialPassField);
            return (val == pass.getValue());
        }
        return true;
    },
    passwordText : textStore['passwordNotMatch'],

    postalCode : function(val, field) {
        var patt=new RegExp('([\\W]+)|(.{11,})');
        if(patt.test(val)){
            return false;
        }else{
            return true;
        }
    },
    postalCodeText : textStore['postalCodeFormat'],

    phoneNumber : function(val, field) {
        var patt=new RegExp('[^0-9\\*]+');
        if(patt.test(val)){
            return false;
        }else{
            return true;
        }
    },
    phoneNumberText : textStore['phoneNumberFormat'],
    address : function(val, field) {
        var patt=new RegExp('([^0-9a-zA-Z\\s\\-]+)');
        if(patt.test(val)){
            return false;
        }else{
            return true;
        }
    },
    addressText : textStore['addressFormat'],

    city : function(val, field) {
        var patt=new RegExp('([^0-9a-zA-Z\\s\\-]+)');
        if(patt.test(val)){
            return false;
        }else{
            return true;
        }
    },
    cityText : textStore['cityFormat'],

    userName : function(val, field) {
        var patt=new RegExp("([^a-zA-Z\\s\\']+)");
        if(patt.test(val)){
            return false;
        }else{
            return true;
        }
    },
    userNameText : textStore['userNameFormat'],

    orgName : function(val, field) {
        var patt=new RegExp('([^0-9a-zA-Z\\s\\-]+)');
        if(patt.test(val)){
            return false;
        }else{
            return true;
        }
    },
    orgNameText : textStore['orgNameFormat'],

    orgGeoDiv : function(val, field) {
        var patt=new RegExp('([^0-9a-zA-Z\\s\\-]+)');
        if(patt.test(val)){
            return false;
        }else{
            return true;
        }
    },
    orgGeoDivText : textStore['orgGeoDivFormat'],

    jobTitle : function(val, field) {
        var patt=new RegExp('([^0-9a-zA-Z\\s\\-]+)');
        if(patt.test(val)){
            return false;
        }else{
            return true;
        }
    },
    jobTitleText : textStore['jobTitleFormat'],

    departmentName : function(val, field) {
        var patt=new RegExp('([^0-9a-zA-Z\\s\\-]+)');
        if(patt.test(val)){
            return false;
        }else{
            return true;
        }
    },
    departmentNameText : textStore['departmentNameFormat'],

    dollarAmount : function(val, field) {
        var patt=new RegExp('[^0-9\\$\\.]+');
        if(patt.test(val)){
            return false;
        }else{
            return true;
        }
    },
    dollarAmountText : textStore['dollarAmount']
});

