google.load("search", "1");
// the cse class encapsulates a left and right search control
// both controls are driven by a shared search form
function cse() {
    var sFormDiv = document.getElementById("searchForm");
    var sResDiv = document.getElementById("searchControl");

    // create search control
    this.resControl = new GSearchControl();
    // create a custom search form
    this.searchForm = new GSearchForm(true, sFormDiv);

    // bind clear and submit functions
    this.searchForm.setOnSubmitCallback(this, cse.prototype.onSubmit);
    this.searchForm.setOnClearCallback(this, cse.prototype.onClear);

    // set up for large result sets
    this.resControl.setResultSetSize(GSearch.LARGE_RESULTSET);
    this.resControl.setLinkTarget(GSearch.LINK_TARGET_SELF);

    var searcher;
    var options;

    // configure search control
    searcher = new google.search.WebSearch();
    options = new GsearcherOptions();
    searcher.setSiteRestriction("muzyka-tech.pl");
    searcher.setUserDefinedLabel("Wyniki wyszukiwania");
    options.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);
    this.resControl.addSearcher(searcher, options);

    // draw the result control
    this.resControl.draw(sResDiv);
}
// when the form fires a submit, grab its
// value and call the left and right control
cse.prototype.onSubmit = function(form) {
    var q = form.input.value;
    if (q && q!= "") {
        this.resControl.execute(q);
        content = document.getElementById('page_content');
        content.innerHTML = '';
    }
    return false;
}
// when the form fires a clear, call the left and right control
cse.prototype.onClear = function(form) {
    this.resControl.clearAllResults();
    form.input.value = "";
    return false;
}
function OnLoad() {
    new cse();
}
google.setOnLoadCallback(OnLoad);