    //<![CDATA[
    google.load('search', '1.0', {"language" : 'de'});
    function OnLoad() {
      new RawSearchControl();
    }

    /**
     * The RawSearchControl demonstrates how to use Searcher Objects
     * outside of the standard GSearchControl. This includes calling
     * searcher .execute() methods, reacting to search completions,
     * and if you had previously disabled html generation, how to generate
     * an html representation of the result.
     */
    function RawSearchControl() {
      // latch on to key portions of the document      
      this.searcherform = document.getElementById("searcher");
      this.results = document.getElementById("results");
      this.cursor = document.getElementById("cursor");
      this.searchform = document.getElementById("searchform");

      // create map of searchers as well as note the active searcher
      this.activeSearcher = "web";
      this.searchers = new Array();

      // create and wire up an instance of GwebSearch and one of
      // GlocalSearch. Note, we disable html generation. We are doing
      // this so that we can demonstrate how to manually create it if
      // needed. Note that we register to handle search completion notifications
      // when searches complete, they are called in the context of this instance
      // of RawSearchControl and they are passed the searcher that just completed

      // wire up a raw GwebSearch searcher
      var searcher = new google.search.WebSearch();
      //searcher.setNoHtmlGeneration();
      searcher.setSearchCompleteCallback(this,
                                         RawSearchControl.prototype.searchComplete,
                                         [searcher]
                                         );  
	  /**
	   * Additional function für 2B
       */                                       
	  searcher.setSiteRestriction("zweibrueder.com");	
	  searcher.setQueryAddition("-.xls -.pdf");	// filtert xls- und pdf-Dateien
      searcher.setResultSetSize(GSearch.LARGE_RESULTSET);  
      //searcher.setNoResultsString(GSearch.NO_RESULTS_DEFAULT_STRING);      
      
      this.searchers["web"] = searcher;
		
      // now, create a search form and wire up a submit and clear handler
      this.searchForm = new google.search.SearchForm(false, this.searchform);
      this.searchForm.setOnSubmitCallback(this,
                                          RawSearchControl.prototype.onSubmit);
      this.searchForm.setOnClearCallback(this,
                                          RawSearchControl.prototype.onClear);
    }

    /**
     * figure out which searcher is active by looking at the radio
     * button array
     */
    RawSearchControl.prototype.computeActiveSearcher = function() {
      for (var i=0; i<this.searcherform["searcherType"].length; i++) {
        if (this.searcherform["searcherType"][i].checked) {
          this.activeSearcher = this.searcherform["searcherType"][i].value;
          return;
        }
      }
    }

    /**
     * onSubmit - called when the search form is "submitted" meaning that
     * someone pressed the search button or hit enter. The form is passed
     * as an argument
     */
    RawSearchControl.prototype.onSubmit = function(form) {      
      /**
       * Additional function für 2B
       */
	  this.clearResults();
      	if (document.getElementById("main") == null) {      		
	  		document.getElementById("main1").style.display = "inline";
      	} else {
	  		document.getElementById("main").style.display = "inline";
      	}
	  
      this.computeActiveSearcher();
      if (form.input.value) {
        // if there is an expression in the form, call the active searchers
        // .execute method
        
		  /**
		   * Additional function für 2B
		   */
        this.searchers[this.activeSearcher].setLinkTarget(GSearch.LINK_TARGET_SELF);        
        
        this.searchers[this.activeSearcher].execute(form.input.value);
      } 
      // always indicate that we handled the submit event
      return false;
    }

    /**
     * onClear - called when someone clicks on the clear button (the little x)
     */
    RawSearchControl.prototype.onClear = function(form) {
      this.clearResults();
    }

    /**
     * searchComplete - called when a search completed. Note the searcher
     * that is completing is passes as an arg because thats what we arranged
     * when we called setSearchCompleteCallback
     */
    RawSearchControl.prototype.searchComplete = function(searcher) {

      // always clear old from the page
      this.clearResults();
      
	  /**
	   * Additional function für 2B
       */
      if (searcher.results.length > 0) {
      	if (document.getElementById("main") == null) {      		
      		document.getElementById("main1").style.display = "none";
      	} else {
      		document.getElementById("main").style.display = "none";
      	}
      } else {
      	if (document.getElementById("main") == null) {
      		document.getElementById("main1").style.display = "inline";
      	}else {
      		document.getElementById("main").style.display = "inline";
      	}
      }
	

      // if the searcher has results then process them
      if (searcher.results && searcher.results.length > 0) {		
		
        // now manually generate the html that we disabled
        // initially and display it
        var upto = ((searcher.cursor.currentPageIndex + 1) * searcher.results.length);
        var from = upto - searcher.results.length + 1;
        if (searcher.cursor.estimatedResultCount <= 1) {
	        var div_txt = "Ihr Suchergebnis:<hr>";
	    } else {
	        var div_txt = "Ihre Suchergebnisse (" + from + " bis " + upto + " von " + searcher.cursor.estimatedResultCount + "):<hr>";
	    }
        var div = createDiv(div_txt, "header");
        this.results.appendChild(div);
        for (var i=0; i<searcher.results.length; i++) {
          var result = searcher.results[i];
          searcher.createResultHtml(result);
          if (result.html) {
            div = result.html.cloneNode(true);
          } else {
            div = createDiv("** failure to create html **");
          }
          this.results.appendChild(div);
        }

        // now, see if we have a cursor, and if so, create the 
        // cursor control
        if (searcher.cursor) {
        	if (searcher.cursor.pages.length > 1){
			  var cursorNode = createDiv('<hr>Ergebnis-Seiten: ', "gsc-cursor");
			  for (var i=0; i<searcher.cursor.pages.length; i++) {
				var className = "gsc-cursor-page";
				if (i == searcher.cursor.currentPageIndex) {
				  className = className + " gsc-cursor-current-page";
				}
				var pageNode = createDiv(searcher.cursor.pages[i].label, className);
				pageNode.onclick = methodClosure(this, this.gotoPage, 
												 [searcher, i]); 
				cursorNode.appendChild(pageNode);
			  }
			  this.cursor.appendChild(cursorNode);
			  if (searcher.cursor.estimatedResultCount > 32) {
				  var more = createLink(searcher.cursor.moreResultsUrl,
										GSearch.strings["more-results"] + "&nbsp;&raquo;",
										GSearch.LINK_TARGET_BLANK,
										"gsc-trailing-more-results");
				  this.cursor.appendChild(more);
			  }
			}
        }
      }
    }

    RawSearchControl.prototype.gotoPage = function(searcher, page) {
      searcher.gotoPage(page);
    }

    /**
     * clearResults - clear out any old search results
     */
    RawSearchControl.prototype.clearResults = function() {
      removeChildren(this.results);
      removeChildren(this.cursor);
    }

    /**
     * Static DOM Helper Functions
     */
    function removeChildren(parent) {
      while (parent.firstChild) {
        parent.removeChild(parent.firstChild);
      }
    }
    function createDiv(opt_text, opt_className) {
      var el = document.createElement("div");
      if (opt_text) {
        el.innerHTML = opt_text;
      }
      if (opt_className) { el.className = opt_className; }
      return el;
    }

    function methodClosure(object, method, opt_argArray) {
      return function() {
        return method.apply(object, opt_argArray);
      }
    }

    function createLink(href, opt_text, opt_target, opt_className, opt_divwrap) {
      var el = document.createElement("a");
      el.href = href;
      if (opt_text) {
        el.innerHTML = opt_text;
      }
      if (opt_className) {
        el.className = opt_className;
      }
      if (opt_target) {
        el.target = opt_target;
      }
      if (opt_divwrap) {
        var div = this.createDiv(null, opt_className);
        div.appendChild(el);
        el = div;
      }
      return el;
    }

    // register to be called at OnLoad when the page loads
    google.setOnLoadCallback(OnLoad, true);
    //]]>
    
    function font_color(){
    	/*	Textfarbe für die Google-Suchergebnisse */
    	if(document.bgColor=='#000000'){
    		document.getElementById('results').style.color = '#FFFFFF';
    	} else {
    		document.getElementById('results').style.color = '#000000';
    	}
    	
    	/* Positions des Google-Suchfelds je nach Browser setzen */
    	if(navigator.appName!='Microsoft Internet Explorer'){
    		if (document.getElementById('zb_search')!=null) {
    			document.getElementById('zb_search').style.paddingLeft = "51px";
    		}
    	}
    	
    }