jQuery(function() {

	jQuery('select.browsebox').bind('change',function(){
		
		// Gets the needed values
		var selectedVal = jQuery("select option:selected").val();
		var searchVal = jQuery("#searchbox").val();
		
		// Creates a hidden field with the pointer value
		jQuery("<input />").attr("type","hidden").attr("name","tx_indexedsearch[pointer]").val(selectedVal).appendTo('#hpsearch');
  		
		// submits the form
		jQuery('#hpsearch').submit();
	});
});
