// Copyright (c) 2008 Yahoo! Inc. All rights reserved.
// Licensed under the Yahoo! Search BOSS Terms of Use
// (http://info.yahoo.com/legal/us/yahoo/search/bosstos/bosstos-2317.html)

/**
 * Create 2 very similar autocomplete controls and search buttons for the splash page and the result page.
 */
var myDataSource = YQL.datasource(
        "use 'http://www.4hoursearch.com/yql/suggest.xml' as suggest;" +
        "select * from suggest where query=@query", 
        ["query.results.s", "k"], {diagnostics:false});

var config = {animVert:true, scriptCallbackParam: "query", minQueryLength:3, typeAhead:false, autoHightlight: false};
var myAutoComp = new YAHOO.widget.AutoComplete("myInput", "myContainer", myDataSource, config);
var myAutoComp2 = new YAHOO.widget.AutoComplete("myInput2", "myContainer2", myDataSource, config);

// Submit buttons
new YAHOO.widget.Button(
        "searchbutton", {
    type: "submit",
    label: "Search"
});
new YAHOO.widget.Button(
        "searchbutton2", {
    type: "submit",
    label: "Search"
});
