User:Ewatjen/monobook.js

document.write(' ');

var tabbedSC; function OnLoad { var dResults = document.createElement("div"); dResults.setAttribute("id", "search_control_tabbed"); dResults.setAttribute("class", "search-control"); var bodyContent = document.getElementById("bodyContent"); if (bodyContent.hasChildNodes) { var children = bodyContent.childNodes; var found = false; var foundi = 0; for (var i = 0; i < children.length && !found; i++) { found = "p" == children.item(i).nodeName || "P" == children.item(i).nodeName; foundi = i;       } if (found) { bodyContent.insertBefore(dResults, children.item(foundi)); }else{ bodyContent.insertBefore(dResults, children.item(0)); }   }else{ bodyContent.appendChild(dResults); }   var iQ = document.createElement("input"); iQ.setAttribute("name", "q"); iQ.setAttribute("type", "text"); iQ.setAttribute("style", "width:120px;border-color:gray"); var iSB = document.createElement("input"); iSB.setAttribute("name", "sa"); iSB.setAttribute("type", "submit"); iSB.setAttribute("value", "Search"); iSB.setAttribute("id", "gSearchButton"); var dClear = document.createElement("div"); dClear.setAttribute("class", "cse-clear-button"); dClear.setAttribute("title", "clear results"); dClear.setAttribute("onclick", "window.tabbedSC.clearAllResults"); dClear.appendChild(document.createTextNode("Clear")); var fSearch = document.createElement("form"); fSearch.setAttribute("id", "searchbox_cse"); fSearch.setAttribute("action", "javascript(return(false))"); fSearch.setAttribute("onsubmit", "window.tabbedSC.execute(this.q.value); return(false)"); fSearch.appendChild(iQ); fSearch.appendChild(iSB); fSearch.appendChild(dClear); var scriptB = document.createElement("script"); scriptB.setAttribute("type", "text/javascript"); scriptB.setAttribute("src", "http://www.google.com/coop/cse/brand?form=searchbox_cse"); var h = document.createElement("h5"); h.appendChild(document.createTextNode("Reference Search")); var d2 = document.createElement("div"); d2.setAttribute("style", "margin-bottom:3px; text-align:center;padding:0.5em 0.4em 0.4em;"); d2.setAttribute("class", "pBody"); d2.appendChild(fSearch); d2.appendChild(scriptB); var dSBox = document.createElement("div"); dSBox.setAttribute("id", "p-refSearch"); dSBox.setAttribute("class", "portlet"); dSBox.appendChild(h); dSBox.appendChild(d2); var columndiv = document.getElementById("column-one"); var i = columndiv.childNodes.length; var x = ((i - (i % 2)) / 2) + 3; if (x < 4) {x = 4;} if (x > i) {x = i;} columndiv.insertBefore(dSBox, columndiv.childNodes[x]);

var crefUrlEn = "eric.komarix.org/wikipedia_en_cref.xml"; var crefUrl = "eric.komarix.org/tools/makewikicse.py?url=" + encodeURIComponent(window.location.href); var moreResultsTemplateEn = "http://ewatjen.googlepages.com/wikiSearchEnglishIframe.html?cref=eric.komarix.org/wikipedia_en_cref.xml&cof=FORID%3A9%3BLC%3A%23002BB8%3BDIV%3A%23AAAAAA%3BVLC%3A%235A3696&client=google-coop-np&q=__QUERY__&hl=__HL__" var moreResultsTemplate = "http://ewatjen.googlepages.com/wikiSearchIframe.html?cref=eric.komarix.org/tools/makewikicse.py%3Furl%3Den.wikipedia.org%252Fwiki%252FWatergate_scandal&cof=FORID%3A9%3BLC%3A%23002BB8%3BDIV%3A%23AAAAAA%3BVLC%3A%235A3696&client=google-coop-np&q=__QUERY__&hl=__HL__" // create a tabbed mode search control tabbedSC = new GSearchControl;

// Site Restrict to CSE ID   var searcher = new GwebSearch; searcher.setSiteRestriction({crefUrl : crefUrl}, "internal", null); searcher.setUserDefinedLabel("Ref: Wikipedia"); tabbedSC.addSearcher(searcher); searcher = new GwebSearch; searcher.setSiteRestriction({crefUrl : crefUrl}, "external", null); searcher.setUserDefinedLabel("Ref: External Sources"); tabbedSC.addSearcher(searcher); searcher = new GwebSearch; searcher.setSiteRestriction({crefUrl : crefUrlEn}, null, null); searcher.setUserDefinedLabel("All Wikipedia"); tabbedSC.addSearcher(searcher); tabbedSC.setResultSetSize(GSearch.LARGE_RESULTSET); // draw in tabbed layout mode var drawOptions = new GdrawOptions; drawOptions.setDrawMode(GSearchControl.DRAW_MODE_TABBED); tabbedSC.draw(document.getElementById("search_control_tabbed"), drawOptions);

//tabbedSC.execute("tape"); } addOnloadHook( function {   GSearch.setOnLoadCallback(OnLoad); } );