function suggest(inputString, inputFrom){
	
	var position = jQuery(inputFrom).offset();
	
	if (inputFrom == '#additional') {
		var top = position.top + 5;
	} else {
		var top = position.top + 11;
	}
	
	jQuery('#suggestions').css({"left": position.left});
	jQuery('#suggestions').css({"top": top});

	if(inputString.length == 0) {
		jQuery('#suggestions').fadeOut();
	} else {
	jQuery(inputFrom).addClass('load');
		jQuery.post("http://www.crocstockimages.com/templates/autosuggest.php", {queryString: ""+inputString+"", fillName: ""+inputFrom+""}, function(data){
			if(data.length >0) {
				jQuery('#suggestions').fadeIn();
				jQuery('#suggestionsList').html(data);
				jQuery(inputFrom).removeClass('load');
			}
		});
	}
}

function fillsearchfield(thisValue) {
	//alert(thisValue);
	if (thisValue == null) { } else {
		jQuery('#searchfield').val('"'+thisValue+'"');
		setTimeout("jQuery('#suggestions').fadeOut();", 600)
	}
}

function filladditional(thisValue) {
	//alert(thisValue);
	if (thisValue == null) { } else {
		jQuery('#additional').val(thisValue);
		setTimeout("jQuery('#suggestions').fadeOut();", 600)
	}
}

function filladv_searchfield(thisValue) {
	//alert(thisValue);
	if (thisValue == null) { } else {
		jQuery('#adv_searchfield').val('"'+thisValue+'"');
		setTimeout("jQuery('#suggestions').fadeOut();", 600)
	}
}
