Ext.ns('GWS');

Ext.BLANK_IMAGE_URL = '/include/libraries/ext2/resources/images/default/s.gif';
Ext.form.Field.prototype.msgTarget = 'side';
Ext.form.TextField.prototype.minLengthText = 'The minimum length for this field is {0}.';
Ext.form.TextField.prototype.maxLengthText = 'The maximum length for this field is {0}.';
Ext.form.TextField.prototype.blankText = 'This field is required.';
Ext.MessageBox.minWidth = 350;

Ext.apply(Ext.form.VTypes, {
	'emailText' : 'This field should be an e-mail address in the format user@domain.com.',
	'urlText' : 'This field should be a url in the format http:/'+'/www.domain.com.',

	'num' : function(v) { var num = /^[0-9]+$/; return num.test(v); },
	'numText' : 'This field should only contain numbers.',
	'numMask' : /[0-9]/i,

	'num_dec' : function(v) { var num_dec = /^[0-9\.]+$/; return num_dec.test(v); },
	'num_decText' : 'This field should only contain numbers and a decimal point.',
	'num_decMask' : /[0-9\.]/i,

	'num_dec_dash' : function(v) { var num_dec_dash = /^[0-9\.-]+$/; return num_dec_dash.test(v); },
	'num_dec_dashText' : 'This field should only contain numbers, a negative sign, and a decimal point.',
	'num_dec_dashMask' : /[0-9\.-]/i,

	'num_dash' : function(v) { var num_dash = /^[0-9-]+$/; return num_dash.test(v); },
	'num_dashText' : 'This field should only contain numbers and dashes.',
	'num_dashMask' : /[0-9-]/i,

	'alpha' : function(v) { var alpha = /^[a-zA-Z]+$/; return alpha.test(v); },
	'alphaText' : 'This field should only contain letters.',
	'alphaMask' : /[a-zA-Z]/i,

	'alpha_num' : function(v) { var alpha_num = /^[a-zA-Z0-9]+$/; return alpha_num.test(v); },
	'alpha_numText' : 'This field should only contain letters and numbers.',
	'alpha_numMask' : /[a-zA-Z0-9]/i,

	'alpha_num_char' : function(v) { var alpha_num_char = /^[a-zA-Z0-9 \.'-\\\/@#&\?!\$:_=]+$/; return alpha_num_char.test(v); },
	'alpha_num_charText' : 'This field should only contain letters, numbers and the following characters: .\'-\\/@&?!$:_=',
	'alpha_num_charMask' : /[a-zA-Z0-9 \.'-\\\/@#&\?!\$:_=]/i,

	'alpha_num_char_ent' : function(v) { var alpha_num_char_ent = /^[a-zA-Z0-9 \.'-\\\/@#&\?!\$:_=\,\"\r\n\t]+$/; return alpha_num_char_ent.test(v); },
	'alpha_num_char_entText' : 'This field should only contain letters, numbers, tabs, new lines, and the following characters: .\'-\\/@&?!$:_=',
	'alpha_num_char_entMask' : /[a-zA-Z0-9 \.'-\\\/@#&\?!\$:_=\,\"\r\n\t]/i,

	'alpha_num_char_json' : function(v) { var alpha_num_char_json = /^[a-zA-Z0-9 \.'-\\\/@#&\?!\$:_=\,\"\{\}\[\]]+$/; return alpha_num_char_json.test(v); },
	'alpha_num_char_jsonText' : 'This field should only contain letters, numbers, and the following characters: .\'-\\/@&?!$:_=',
	'alpha_num_char_jsonMask' : /[a-zA-Z0-9 \.'-\\\/@#&\?!\$:_=\,\"\{\}\[\]]/i
});

Ext.onReady(function()
{
	Ext.QuickTips.init();
});
