<!doctype html> 
<html lang="en"> 
<? 
session_start();
include("test.php");
include("opendb.php");
include("includes/function.php");
include("calstock.php");
$tbl1="stocksummary".$brcode.$user;
?>
<head>

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  
  <script>
  $(function() {
   
$('.query').livequery(function() {
    $(this).autocomplete({
 source: availableTags
   
    });
  });
 });



function autoComplete(tableID, oID) {

  $(function() {
 var availableTags = [
      "ActionScript",
      "AppleScript",
      "Asp",
      "BASIC",
      "C",
      "C++",
      "Clojure",
      "COBOL",
      "ColdFusion",
      "Erlang",
      "Fortran",
      "Groovy",
      "Haskell",
      "Java",
      "JavaScript",
      "Lisp",
      "Perl",
      "PHP",
      "Python",
      "Ruby",
      "Scala",
      "Scheme"
    ];



    function log( message ) {
      $( "<div/>" ).text( message ).prependTo( "#log" );
      $( "#log" ).attr( "scrollTop", 0 );
    }
    $( '#'+tableID+oID ).autocomplete({
      source:  availableTags,
      select: function( event, ui ) {
        log( ui.item ?
        "Selected: " + ui.item.value + " aka " + ui.item.id :
        "Nothing selected, input was " + this.value );
      }
    });
  });
}











/* $( "#tags" ).autocomplete({
      source: availableTags */

var cur=1;
//var partcode=[];
var partname=[];
var unitprice=[];
var qty=[];
var tot=[];
var typ=[];
var cnt=1;
var ut='unit';
function insRow(event)
{
//alert(cur);




var rowCount = document.getElementById('myTable').rows.length;
var rowcount1=parseFloat(rowCount)+parseFloat(1);
//alert(rowCount);
var x=document.getElementById('myTable').insertRow(rowCount);




var a=x.insertCell(0)
var y=x.insertCell(1)

a.innerHTML=cur;


y.innerHTML="<input type=text name=unit[] id=unit"+cur+" size=5 class='unit' value='' onFocus='autoComplete(ut,cur);'>";


  cur++; 










}// end function insrow









  </script>
</head>
<body>
 <table border=1 id="myTable" class='tble1' width=100%>
<th>No.<th>Parts 

 </table>
<input type="button" id='insrowbttn' onclick="insRow(event)" value=" Add Item ">




    
</body>
</html>
