jQuery(document).ready(function($){
	
	//$("#pledge-heroine").focus(function(){$(this).val('')});
	
	$("#pledge-heroine").autocomplete(
	"/wp-content/plugins/tp-pledge/heroines.ajax.php",
	{
		minChars: 0,
		width: 310,
		matchContains: "word",
		autoFill: false
	});
	
	/*jQuery("#pledge-heroine").autoSuggest(
			"/wp-content/plugins/tp-pledge/heroines.ajax.php",
			{
				selectedItemProp: "name",
				searchObjProps: "name",
				startText: "Start typing...",
				selectionLimit: 1,
				formatList: function(data, elem) {
					var new_elem = elem.html("<strong>"+data.name+"</strong>");
					return new_elem;
				},
				resultsComplete: function(){
					jQuery("span.heroine-info").hover(
            function(e) {
              //close last popup if open
              jQuery("#heroine-popup").remove();
              
              //trigger popup on this
              this.t = this.title;
              this.title = "";
              jQuery("body").append("<div id=\"heroine-popup\"><span class=\"heroine-close\">close</span>"+this.t+"</div>");
              jQuery("#heroine-popup").css("top",e.pageY+"px").css("left",e.pageX+"px");
              jQuery("#heroine-popup").fadeIn("slow");
              jQuery("span.heroine-close").click(
                function(e) {
                  jQuery("#heroine-popup").remove();
                  jQuery("input.pledge-heroine").focus();
                }
              );
              jQuery(document).keydown(
                function(e) {
                  jQuery("#heroine-popup").remove();
                }
              );
              
            },
            function(e) {
              this.title = this.t;
              this.t = "";
            }
          );
				}
			}
	);*/
});