$j(document).ready(function()
{
	//"use strict";

	var passField = $j('#passNumber');
	passField.val('').focus();

	passField.focusout(function()
	{
		passNumber.focus();
	})

	passField.keyup(function()
	{
		var passNumber = passField.val();
		console.log(passNumber.length);
		console.log(passNumber.trim());
		if (passNumber.length ==8  && $j('#passNumber').attr('stop')!=1)  
		{ $j('#passNumber').attr('stop',1);
		  $j('#messageForm').html('<div id="gettingData" class="messageText">Получение данных</div>') ;
		  send_ajax_request({cmd:'work_order/getMOInfo',passNumber: passNumber.trim()});
		}
	});

});

function resetInput(timeout)
{	setTimeout(function()
	{	$j('#messageForm').html('') ;
		$j('#passNumber').val('').focus(); // .attr('disabled',false);
		$j('#passNumber').attr('stop',0);
		$j("#printForm").addClass("hidden");
	}, timeout);
}