$(document).ready(function(){
		
		 var options = { 
				beforeSubmit:function() {
					jQuery.facebox('<b>Please wait...</b><br>We are processing your data.');
					setInput(false);
				},
				success:function(data) {
					if(data!='200')
					{
						jQuery.facebox('You have to agree our Non-Disclosure Agreement.');
						closeFacebox(3000);
						setInput(true);
					}
					else
					{
						jQuery.facebox('<b>Please wait...</b><br>Going to Step 1.');
						document.location.href='/translator/jobs/step1';
					}
				}
			}; 
		
			$('#cancel').click(function(){
				document.location.href='/translator/jobs/index';
			});
			
			$('#formnda').validate({
				rules:{
					'agree':{
						required:true
					},
					'agree2':{
						required:true
					}
				},
				messages:{
					'agree':{
						required:''
					},
					'agree2':{
						required:''
					}
				},
			submitHandler: function() {
				$('#formnda').ajaxSubmit(options); 
			}
		});

		$('#submit').click(function(){
			$('#formnda').submit();
		});
});