//----------------------------------------------------------
//                      _       _
//  ___ ___ __ _ _ _ __| |_    (_)___
// (_-</ -_) _` | '_/ _| ' \ _ | (_-<
// /__/\___\__,_|_| \__|_||_(_)/ /__/
//                           |__/
//
//----------------------------------------------------------
// File      : search.js
// Author    : Richard Lewis
// Project   : /mnt/webdev/beautifulbalms/js/beautifulbalms/
// Syntax    : javascript
// Date      : Thu 13 Nov 2008
// Copyright : Richard Lewis 2008
//----------------------------------------------------------
// search.js -
//----------------------------------------------------------

function goSearch() {
    // search onload

    focusField();
    //googleSetup();
    yahooSetup();
}
//----------------------------------------------------------

function yahooSetup() {
    // setup yahoo

    getEle('yahoo').onsubmit = function(evt) {
        yahooSubmit(this, evt);
    }
}
//----------------------------------------------------------

function googleSetup() {
    // setup google

    getEle('google').onsubmit = function(evt) {
        googleSubmit(this, evt);
    }
}
//----------------------------------------------------------

function yahooSubmit() {
    // yahoo submit

    getEle('p').value += " site:www.beautifulbalms.com";

    return true;
}
//----------------------------------------------------------

function googleSubmit() {
    // google submit

    getEle('q').value += " site:www.beautifulbalms.com";

    return true;
}
//----------------------------------------------------------

function focusField() {
    // Focus First Form Field


    getEle('q').focus();
}
//----------------------------------------------------------

if (window.addEventListener)
    window.addEventListener("load", goSearch, false);

else if (window.attachEvent)
    window.attachEvent("onload", goSearch);
//----------------------------------------------------------
