<html>
<head>
<title>ASP.NET lookup module</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script src="../lookupMod.js"></script>
<script language="JavaScript">
var BOOK_NAME = "O'REILLY SQL Language Reference";
var KEYWORDS = new Array(
  "ALTER PROCEDURE",   "Command Reference",   "ALTER PROCEDURE",
  "ALTER TABLE",   "Command Reference",   "ALTER TABLE",
  "ALTER TRIGGER",   "Command Reference",   "ALTER TRIGGER",
  "ALTER VIEW",   "Command Reference",   "ALTER VIEW",
  "CALL",   "Command Reference",   "CALL",
  "CASE",   "Command Reference",   "CASE",
  "CAST",   "Command Reference",   "CAST",
  "CLOSE CURSOR",   "Command Reference",   "CLOSE CURSOR",
  "COMMIT TRANSACTION",   "Command Reference",   "COMMIT TRANSACTION",
  "CONCATENATION OPERATORS",   "Command Reference",   "CONCATENATION OPERATORS",
  "CONNECT",   "Command Reference",   "CONNECT",
  "CREATE DATABASE",   "Command Reference",   "CREATE DATABASE",
  "CREATE FUNCTION",   "Command Reference",   "CREATE FUNCTION",
  "CREATE INDEX",   "Command Reference",   "CREATE INDEX",
  "CREATE PROCEDURE",   "Command Reference",   "CREATE PROCEDURE",
  "CREATE ROLE",   "Command Reference",   "CREATE ROLE",
  "CREATE SCHEMA",   "Command Reference",   "CREATE SCHEMA",
  "CREATE TABLE",   "Command Reference",   "CREATE TABLE",
  "CREATE TRIGGER",   "Command Reference",   "CREATE TRIGGER",
  "CREATE VIEW",   "Command Reference",   "CREATE VIEW",
  "DECLARE CURSOR",   "Command Reference",   "DECLARE CURSOR",
  "DELETE",   "Command Reference",   "DELETE",
  "DISCONNECT",   "Command Reference",   "DISCONNECT",
  "DROP DATABASE",   "Command Reference",   "DROP DATABASE",
  "DROP FUNCTION",   "Command Reference",   "DROP FUNCTION",
  "DROP INDEX",   "Command Reference",   "DROP INDEX",
  "DROP PROCEDURE",   "Command Reference",   "DROP PROCEDURE",
  "DROP ROLE",   "Command Reference",   "DROP ROLE",
  "DROP TABLE",   "Command Reference",   "DROP TABLE",
  "DROP TRIGGER",   "Command Reference",   "DROP TRIGGER",
  "DROP VIEW",   "Command Reference",   "DROP VIEW",
  "FETCH",   "Command Reference",   "FETCH",
  "GRANT",   "Command Reference",   "GRANT",
  "INSERT",   "Command Reference",   "INSERT",
  "LIKE OPERATOR",   "Command Reference",   "LIKE OPERATOR",
  "OPEN",   "Command Reference",   "OPEN",
  "OPERATORS",   "Command Reference",   "OPERATORS",
  "RETURN",   "Command Reference",   "RETURN",
  "REVOKE",   "Command Reference",   "REVOKE",
  "ROLLBACK",   "Command Reference",   "ROLLBACK",
  "SAVEPOINT",   "Command Reference",   "SAVEPOINT",
  "SELECT",   "Command Reference",   "SELECT",
  "SET CONNECTION",   "Command Reference",   "SET CONNECTION",
  "SET ROLE",   "Command Reference",   "SET ROLE",
  "SET TIME ZONE",   "Command Reference",   "SET TIME ZONE",
  "SET TRANSACTION",   "Command Reference",   "SET TRANSACTION",
  "START TRANSACTION",   "Command Reference",   "START TRANSACTION",
  "TRUNCATE TABLE",   "Command Reference",   "TRUNCATE TABLE",
  "UPDATE",   "Command Reference",   "UPDATE",
  "AVG and SUM",   "Aggregate Functions",   "AVG and SUM",
  "COUNT",   "Aggregate Functions",   "COUNT",
  "MIN and MAX",   "Aggregate Functions",   "MIN and MAX",
  "BUILT IN ",   "Scalar Functions",   "BUILT IN",
  "NUMERIC",   "Scalar Functions",   "NUMERIC",
  "STRING",   "Scalar Functions",   "STRING",
  "MICROSOFT SQL SERVER",   "Vendor Functions",   "MICROSOFT",
  "MYSQL",   "Vendor Functions",   "MYSQL",
  "ORACLE",   "Vendor Functions",   "ORACLE",
  "POSTGRESQL",   "Vendor Functions",   "POSTGRESQL");

  function referenceLookup()
  {
    var sqlVal;
    var dom = dw.getDocumentDOM();
	
	if (dom){
    //To synchronize the design and code view
    dom.synchronizeDocument();

    var docEl = dom.documentElement;
    var wholeDoc = docEl.outerHTML;
    var theSel = dom.source.getSelection();
    var startPoint = searchBackwards(theSel[0],dom);
    var endPoint = searchForwards(theSel[1],dom,wholeDoc.length);
    var selTag = dom.offsetsToNode(theSel[0],theSel[1]);
    var keyword;
    var j;
    keyword = dom.source.getText(startPoint,endPoint);
    keyword = keyword.toUpperCase();

    var sqlVal = getTopic(keyword);
    }
	
	if (!sqlVal)
    {
      sqlVal = new Array("");
    }
    
	return sqlVal;
  }

  </script>
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
  </body>
  </html>


