/*
   Copyright 2009-2011 United States Government. 

   This software is licensed under the GNU General Public License
   version 2 (see the file LICENSE for details)
*/

$(document).ready(function(){

	/*$("input#investmentName").change(function(){
		if($("input#selectbuscid").val().length > 0){
			$("input#selectbuscid").val('');
		}
	})*/

	$('input#investmentName').result(function(event, data, formatted) {
		$('input#selectbuscid').val(data[1]);
   	});
	
	$("input#investmentName").autocomplete("/investment/autosuggestbyratings", {
		width: 260,
		selectFirst: true,
	    extraParams: {
	       q: "/investment/autosuggestbyratings",
	       limit: '',
	       search: function () { return $("input#investmentName").val() }
	     }
	});
})
