function lookup(search_new) {
	if(search_new.length == 0) {
		// Hide the suggestion box.
		$('#suggestions').hide();
	} else {
	
		var s = $("#state_new");
		var valor = s.val();
		
		$.post("string_search.php", {mysearchString: ""+search_new+"", state: ""+valor+""}, function(data){
			if(data.length >0) {
				
				if(data == "--@$112"){
				
				}else{
			
				//$('#inline1').left();
				
				var p = $("#inline1");
				var offset = p.offset();
				
				var p2 = $("#search_new");
				var offset2 = p2.offset();
				
				
				//alert(offset.left );

				$('#suggestions').css({
						position:'absolute',
						left: offset.left + 245 ,
						top: offset.top + 30
				});
				
				
				$('#suggestions').show();
				$('#autoSuggestionsList').html(data);
				$($("#parentDiv > div")[0]).height();
				
				}
				
			}else{
				
				fillAllFieldsPop();
			
			}
		});
	}
} //end

// if user clicks a suggestion, fill the text box.
function fill(thisValue) {
	$('#search_new').val(thisValue);
	setTimeout("$('#suggestions').hide();", 200);
}


$(window).resize(function(){

	var p = $("#inline1");
				var offset = p.offset();
				
				//alert(offset.left );

				$('#suggestions').css({
						position:'absolute',
						left: offset.left + 245 ,
						top: offset.top + 30
				});



});

function htmlentities (string, quote_style, charset, double_encode) {
    var hash_map = {},
        symbol = '',
        entity = '',
        self = this;
    string += '';
    double_encode = !!double_encode || double_encode == null;
 
    if (false === (hash_map = this.get_html_translation_table('HTML_ENTITIES', quote_style))) {
        return false;
    }
    hash_map["'"] = '&#039;';
    
    if (double_encode) {
        for (symbol in hash_map) {
            entity = hash_map[symbol];
            string = string.split(symbol).join(entity);
        }
    } else {
        string = string.replace(/([\s\S]*?)(&(?:#\d+|#x[\da-f]+|[a-z][\da-z]*);|$)/g, function (ignore, text, entity) {
            return self.htmlentities(text, quote_style, charset) + entity;
        });
    }
 
    return string;
}
