<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>My Google AJAX Search API Application</title>
    <script src="http://www.google.com/jsapi?key=ABQIAAAAadK4QC_stKG_N-fgpmjS2xTJRn4Cq_CiYs1U8_g8QesL0ENVrBTJ8kJX8pqD45noCmxHZ3f6S9yV0A" type="text/javascript"></script>
    <script src="http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=ABQIAAAAadK4QC_stKG_N-fgpmjS2xTJRn4Cq_CiYs1U8_g8QesL0ENVrBTJ8kJX8pqD45noCmxHZ3f6S9yV0A" type="text/javascript"></script>
    <script language="Javascript" type="text/javascript">
        //<![CDATA[
        google.load("search", "1");

        function OnLoad() {
            // Create a search control
            var searchControl = new google.search.SearchControl();

            // Add in local search
            var localSearch = new google.search.LocalSearch();
            var options = new google.search.SearcherOptions();
            options.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);
            searchControl.addSearcher(localSearch, options);

            // Set the Local Search center point
            //localSearch.setCenterPoint("Chennai,India");
            //43.738270 - 79.665528 11.016215$76.971362
            //localSearch.setCenterPoint(new GLatLng(10.964608,78.056113));
            localSearch.setCenterPoint('Sundarapuram,Coimbatore');

            // Tell the searcher to draw itself and tell it where to attach
            searchControl.draw(document.getElementById("searchcontrol"));

            // Execute an inital search
            searchControl.execute("Hospital");

            // Declare function for using results
            searchControl.setSearchCompleteCallback(this, gotResults);

        }

        function gotResults(sc, searcher) {
            var resultcontent = '';
            var resultdiv = document.getElementById('searchresults');

            for (i = 0; i < searcher.results.length; i++) {
                var result = searcher.results[i];
                resultcontent += '<p>' + result.title + '<br />' + result.streetAddress + '</p>' + result.city;
            }
            resultdiv.innerHTML = resultcontent;
        }

        google.setOnLoadCallback(OnLoad);

        //]]>
    </script>
    <style>
        .localexample {
            width: 40%;
            height: 100%;
            float: left;
        }

            .localexample strong {
                display: block;
                border-bottom: 1px dotted #ccc;
                margin-bottom: 20px;
            }

        #googleversion {
            margin-right: 50px;
        }

        #myversion {
        }
    </style>
    <script src="../js/wow.min.js"></script>
</head>
<body>
    <div id="googleversion" class="localexample">
        <strong>Auto-generated by Google</strong>
        <div id="searchcontrol" style="display: none;">Loading...</div>
    </div>
    <div id="myversion" class="localexample">
        <strong>Created programmatically</strong>
        <div id="searchresults"></div>
    </div>
</body>
</html>
