﻿function GetGoogleSearchControl() {

    var c = new GoogleSearchControl();
    return c;

}

function GoogleSearchControl() {

    //Set the methods:
    this.Search = GoogleSearchControl_Search;

}

function GoogleSearchControl_Search() {

    var text = document.getElementById("txtGoogleSearchControl_SearchBox").value;

    if (text.length == 0) {

        alert("Please enter a search word or phrase and try again.");
        document.getElementById("txtGoogleSearchControl_SearchBox").focus();
        return;

    }

    //Pass the querystring to the search results page, this is where the google search code soley resides now:
    document.location.href = "search-results.aspx?q=" + escape(text);

}
