/*	PAX Validation demo
	
	The below javascript will add validators to the given form: 'valForm', and set
	the defined hints.
*/
//	Iinitialise form validation, once the DOM has loaded
pax.load.onloaded( function() {
	pax.validate.initValidation( 'valForm', {
        'firstName': {
            mask: [ 
                { mask: 'len', minLen: '2', maxLen: '20' } 
            ],
            hint: 'First name is not necessary, however it must be at least 2 chars, and no more than 20 chars, if entered' 
        },
        'lastName': {
            mask: 'notEmpty', 
            //	Note: we're using a hint object here
            hint: { message: 'You must specify a last name', x: -186, y: 24 } 
        },
        'email': { 
            mask: [
                { mask: 'email' },
                { mask: 'notEmpty' }
            ],
            hint: 'The email address is mandatory, and must be a valid email address' 
        },
        'country': { 
            mask: [
                { mask: 'notEmpty' }, 
                { mask: 'excludeSelect', exclude: [2] }
            ],
            hint: 'You must select a favourite rugby team. It can\'t be New Zealand ;o)' 
        },
        'postcode': { 
            mask: 'postcode', 
            hint: 'Australian post code (4 numbers)' 
        },
        'level': {	
            mask: 'notEmpty', 
            hint: { message: 'You must specify a level', offsetElement: pax.$('level3'), x: 108, y: 0 }
        }
    } );
} );
