/**********************************************
	Search Customer
**********************************************/
var clientid="";
function selectClient(value) {
	clientid = value;
	$('confirm_client_button').show();
	return false;
}

var keyword;
function searchRecord() {
	keyword=$F('keyword');
	clearTimeout(intStartCheck);
	
	if (keyword != '') {
		intStartCheck = setTimeout("getClientList()",500);
	}
}

function getClientList() {
	$('confirm_client_button').hide();
	if (typeof keyword == 'undefined') {
		keyword = '';
	}
	var params = 'keyword=' + keyword;	
	var url = 'ajax/processing/ajax.get-clients.php';
	new Ajax.Updater(
			'search_result', 
			url, 
			{method: 'post', parameters: params, onLoading: $('loadingClientSearch').show(), onComplete: getClientListResponse}
			);
}

function getClientListResponse() {
	$('loadingClientSearch').hide();	
}