// Title: Tigra Form Validator
// URL: http://www.softcomplex.com/products/tigra_form_validator/
// Version: 1.3
// Date: 08/25/2005 (mm/dd/yyyy)
// Notes: This script is free. Visit official site for further details.


// form fields description structure
var a_fields = {
//	'title': {
//		'l': 'Title',  // label
//		'r': false,    // required
//		'f': 'alpha',  // format (see below)
//		't': 't_title',// id of the element to highlight if input not validated
		
//		'm': null,     // must match specified form field
//		'mn': 2,       // minimum length
//		'mx': 10       // maximum length
//	},
	'egn':{'l':'EGN','r':true,'f':'unsigned','t':'t_egn','mx':10},
	'password':{'l':'Password','r':true,'t':'t_password','mn':6},
	'password_conf':{'l':'Password confirmation','r':true,'t':'t_password_conf','m':'password','mn':6},
	'prog_type_id':{'l':'Program Type','r':true,'t':'t_prog_type_id'},
	'year_req':{'l':'Year of requested participation','r':true,'t':'t_year_req'},
	'prog_len_id':{'l':'Program length','r':true,'t':'t_prog_len_id'},
	'package_id':{'l':'Packages','r':true,'t':'t_package_id'},
	'date_avail':{'l':'Date available','r':true,'f':'date','t':'t_date_avail'},
	'last_name':{'l':'Last Name','r':true,'f':'alpha','t':'t_last_name'},
	'first_name':{'l':'First Name','r':true,'f':'alpha','t':'t_first_name'},
	'middle_name':{'l':'Middle Name','f':true,'f':'alpha','t':'t_middle_name'},
	'num_street':{'l':'Number and Street','r':true,'t':'t_num_street'},
	'city':{'l':'City','r':true,'f':'alpha','t':'t_city'},
	'state_id':{'l':'State/Province','r':true,'t':'t_state_id'},
	'post_code':{'l':'Postal Code','r':true,'f':'unsigned','t':'t_post_code'},
	'country_id':{'l':'Country','r':true,'t':'t_country_id'},
	'email_address':{'l':'Email Address','r':true,'f':'email','t':'t_email_address'},
	'phone_number':{'l':'Phone Number','r':true,'f':'phone','t':'t_phone_number'},
	'birth_date':{'l':'Date of birth','r':true,'f':'date','t':'t_birth_date'},
	'birth_city':{'l':'City of birth','r':true,'f':'alpha','t':'t_birth_city'},
	'country_birth_id':{'l':'Country of birth','r':true,'t':'t_country_birth_id'},
	'city_citizenship':{'l':'City of Citizenship','r':true,'f':'alpha','t':'t_city_citizenship'},
	'residence_country_id':{'l':'Country of Permanent Legal Residence','r':true,'t':'t_residence_country_id'},
	'primary_lang':{'l':'Primary Language','r':true,'f':'alpha','t':'t_primary_lang'},
	'gender':{'l':'Gender','r':true,'t':'t_gender'},
	'placement_option_id':{'l':'Placement option','r':true,'t':'t_placement_option_id'},
	'post_sec_institute':{'l':'Post Secondary Institution','r':true,'t':'t_post_sec_institute'},
	'field_study':{'l':'Field of Study/Major','r':true,'t':'t_field_study'},
	'year_in_school':{'l':'Year in School','r':true,'f':'unsigned','t':'t_year_in_school'},
	'lenght_study':{'l':'Length of Program ','r':true,'f':'unsigned','t':'t_lenght_study'},
	'degree_id':{'l':'Degree','r':true,'t':'t_degree_id'},
	'date_est_grad':{'l':'Est. Graduation Date','r':true,'f':'date','t':'t_date_est_grad'},
	'sec_institute':{'l':'Secondary Institution','r':true,'t':'t_sec_institute'},
	'years_attend_start':{'l':'Year of attendance - from','r':true,'t':'t_years_attend'},
	'years_attend_end':{'l':'Year of attendance - to','r':true,'t':'t_years_attend'},
	'driving_license':{'l':'Driving License','r':true,'t':'t_driving_license'},
	'swim':{'l':'Do you swim?','r':true,'t':'t_swim'},
	'us_visa_issued':{'l':'Have you ever been issued a U.S. visa?','r':true,'t':'t_us_visa_issued'},
	'us_visa_refused':{'l':'Have you ever been refused a U.S. visa?','r':true,'t':'t_us_visa_refused'},
	'how_found_polycontact_id':{'l':'How did you hear about Polycontact?','r':true,'t':'t_how_found_polycontact_id'},
	'why_choose_polycontact':{'l':'Why did you choose Polycontact?','r':true,'f':'alpha','t':'t_why_choose_polycontact'},
	'partners_id':{'l':'Where did you get information about the programs?','r':true,'t':'t_partners_id'},
//	'c_code':{'l':'Security image','r':true,'t':'t_captch_code'},
//	'inp_captch_code':{'l':'Security code','r':true,'t':'t_captch_code','m':'c_code'},
	'i_agree':{'l':'I Agree','r':true,'t':'t_i_agree'}
}

o_config = {
	'to_disable' : ['Submit', 'Reset', 'Cancel'],
	'alert' : 1
}

// validator constructor call
 var v = new validator('application_form', a_fields, o_config);
