// click-click-find
// © Copyright 1994-2004 Actoid

ccf={
    // Author: Andreas Waidelich <post@andreas-waidelich.de>
    engines:[
    "http://a9.com/",
    "http://www.google.de/search?q=",
    "http://search.yahoo.com/search?p=",
    "http://www.altavista.com/web/results?q=",
    "http://alltheweb.com/search?q=",
    ],
    init:function(){
        ccf.addEvent(document,"dblclick",ccf.readSelection);
    }, // init
    readSelection:function(e){
        var text="";
        if(window.getSelection){
            text=window.getSelection();
        }
        if(document.selection){
            text=document.selection.createRange().text;
        }
        if(text==""){
            alert("Den Doppelklick auf ein Wort machen");
            }else{
            ccf.processQuery(text);
        }
    },// readSelection
    processQuery:function(query){
        W1 = window.open(this.engines[1]+query, "Suche","width=640, scrollbars=yes, resizable=yes");
        W1.focus();
    }, // processQuery
    addEvent:function(obj, evType, fn){
        /*
        adds an eventListener for browsers which support it.
        Written by Scott Andrew: www.scottandrew.com
        */
        if (obj.addEventListener){
            obj.addEventListener(evType, fn, true);
            return true;
            } else if (obj.attachEvent){
            var r = obj.attachEvent("on"+evType, fn);
            return r;
            } else {
            return false;
        } // if
    } // addEvent
} // ccf
