		function dynsearch() {
		var sterm = document.getElementById('st_sterm').value;
		var num = document.getElementById('st_n').value;
		var ord = document.getElementById('st_o').value;
		var shop = document.getElementById('st_shop').value;
		var slimit = document.getElementById('st_limit').value;
		
			//we empty our results area
			jQuery("#actinetajaxresults").empty();
			//ajax spinner while we wait
			jQuery("#actinetajaxresults").html("<img style=\"margin:20px;\" src='"+shop+"actsql/res/ajax-loader.gif'>");
			//ajax request for json from ActSQL API


jQuery.getJSON("../actsql/feed.php?jsoncallback=?",
  { q: sterm, n: num },
  function(data) {
			jQuery("#actinetajaxresults").html('');
			//create an ul to hold our li
			jQuery("<ul id='resultslist'></ul>").appendTo("#actinetajaxresults");			
			//do this for each result
			jQuery.each(data, function(i,item){
			//you can edit this part. in this example its a linked list with the price in bold.
		      jQuery("<li id='prodresult"+item.ref+"' onclick=\"document.location='"+shop+item.url+"';\"></li>").appendTo("#resultslist")
		      
				var stimg = jQuery("<a href=\""+shop+item.url+"\"><img width=\"40\" height\"40\" src=\""+shop+item.image+"\" /></a>");
			    stimg.appendTo("#prodresult"+item.ref);
		
				slicename = item.title.slice(0,slimit)+'...';
			    jQuery("<p><a href=\""+shop+item.url+"\">"+slicename+"</a><span>&pound;"+item.price+"</span></p>").appendTo("#prodresult"+item.ref);	      
		      
		    });


  });

            
            jQuery("<div style=\"clear:both;\"></div>").appendTo("#actinetajaxresults");
            jQuery('#actinetajaxresults').show();
            jQuery('#actinetajaxresults').css("z-index","9999");

  		}

      jQuery(document).ready(function() {
      
		jQuery("#st_sterm")
		    .val(jQuery("#st_default").val())
		    .css("color", "#666")
		    .focus(function(){
		        jQuery(this).css("color", "black");
		        if (jQuery(this).val() == jQuery("#st_default").val()) {
		            jQuery(this).val("");
		        }
		    })
		    .blur(function(){
		        jQuery(this).css("color", "#666");
		        if (jQuery(this).val() == "") {
		            jQuery(this).val(jQuery("#st_default").val());
		        }
		    });      
      
      
        jQuery('#st_sterm').keyup(function() {
        if ( jQuery('#st_sterm').val().length >= 3) {
          if (window.nickTimeout) { window.clearTimeout(nickTimeout); } window.nickTimeout = window.setTimeout('dynsearch();', 500);
          } else { jQuery("#actinetajaxresults").hide(); jQuery("#actinetajaxresults").html(''); }
        });
      });


