// Copyright Inipix AB 2005. All rights reserved.

// Ambedo specific
function sAmbedoEdit(q) { return new Res("http://www.ambedo.com/edit.php", "Edit your Ambedo tags", q); }
function sAmbedoLogout(q) { return new Res("http://www.ambedo.com/logout.php", "Logout from Ambedo", q); }
function sAmbedoLogin(q) { return new Res("http://www.ambedo.com/login.php", "Login on Ambedo", q); }
function sAmbedoHelp(q) { return new Res("http://www.ambedo.com/help.php", "Read Ambedo's help files", q); }
function sAmbedoAbout(q) { return new Res("http://www.ambedo.com/about.php", "Learn more about Ambedo", q); }
function sAmbedoBookmarklets(q) { return new Res("http://www.ambedo.com/bookmarklets.php", "Learn how to use Ambedo's bookmarklets.", q); }
function sAmbedoSearch(q) { return new Res("http://www.ambedo.com/directory.php?mode=free&q="+q, "Search Ambedo for tags on " + q, q); }
function sAmbedoDirectory(q) { return new Res("http://www.ambedo.com/directory.php", "Browse Ambedo's tag directory.", q); }
function sAmbedoSettings(q) { return new Res("http://www.ambedo.com/settings.php", "Change your Ambedo settings.", q); }
function sAmbedoStats(q) { return new Res("http://www.ambedo.com/stats.php", "Ambedo's usage stats.", q); }
function sAmbedoLatest(q) { return new Res("http://www.ambedo.com/latest.php", "Latest tags added to the directory.", q); }


// General search
function sGoogle(q) { return new Res("http://www.google.com/search?q="+escape(q), "", q); }
function sMSN(q) { return new Res("http://search.msn.com/results.aspx?FORM=MSNH&srch_type=0&q="+q, "", q); }
function sYahoo(q) { return new Res("http://search.yahoo.com/search?fr=FP-tab-web-t&toggle=1&ei=UTF-8&p="+q, "", q); }
function sAsk(q) { return new Res("http://web.ask.com/web?qsrc=0&o=0&q="+q, "", q); }
function sA9(q) { return new Res("http://a9.com/"+q, "", q); }
function sAOL(q) { return new Res("http://search.aol.com/aolcom/search?query="+q, "", q); }
function sAllTheWeb(q) { return new Res("http://www.alltheweb.com/search?cat=web&cs=utf8&q="+q, "", q); }
function sTeoma(q) { return new Res("http://s.teoma.com/search?q="+q, "", q); }
function sAltavista(q) { return new Res("http://www.altavista.com/web/results?q="+q, "", q); }
function sGigablast(q) { return new Res("http://www.gigablast.com/search?q=resor"+q, "", q); }
function sLookSmart(q) { return new Res("http://search.looksmart.com/p/search?tb=dir&qt="+q, "", q); }
function sLycos(q) { return new Res("http://search.lycos.com/default.asp?query="+q, "", q); }

function sMSNRSS(q) { l = new LiveRss("http://search.msn.com/results.aspx?q="+q+"&format=rss&FORM=RSRE", q); return l.run(); }


// Shopping
function sEbay(q) { return new Res("http://search.ebay.com/"+q, "", q); }
function sFroogle(q) { return new Res("http://froogle.google.com/froogle?tab=nf&hl=en&lr=&ie=UTF-8&sa=N&q="+q, "", q); }
function sMySimon(q) { return new Res("http://search.mysimon.com/search?qt="+q, "", q); }
function sShopping(q) { return new Res("http://www.shopping.com/xFS?KW="+q, "", q); }

// Mail tracking
function sUPS(q) { return new Res("http://wwwapps.ups.com/WebTracking/processInputRequest?sort_by=status&tracknums_displayed=1&TypeOfInquiryNumber=T&loc=en_US&track.x=0&track.y=0&InquiryNumber1="+q, "", q); }
function sFedEx(q) { return new Res("http://www.fedex.com/Tracking?ascend_header=1&clienttype=dotcomreg&cntry_code=se_english&language=english&tracknumbers="+q, "", q); }

// Helpers
function sURL(q) { return new Res("http://"+q, "Goto " + q, q); }
function sWWWURL(q) { return new Res("http://www."+q, "Goto www." + q, q); }
function sXTP(q) { return new Res(q, "Goto " + q, q); }
function sAsComDomain(q) { return new Res("http://www."+q+".com/", "Goto www." + q + ".com", q); }

// Blogs
function sFeedster(q) { return new Res("http://www.feedster.com/search.php?hl=en&ie=UTF-8&sort=date&q="+q, "", q); }
function sTechnorati(q) { return new Res("http://www.technorati.com/cosmos/search.html?rank=&url="+q, "", q); }
function sBloglines(q) { return new Res("http://www.bloglines.com/search?t=1&q="+q, "", q); }
function sDaypop(q) { return new Res("http://www.daypop.com/search?q="+q, "", q); }
function sBlogPulse(q) { return new Res("http://www.blogpulse.com/search?query="+q, "", q); }

// Tech
function sARIN(q) { return new Res("http://ws.arin.net/cgi-bin/whois.pl?queryinput="+q, "", q); }
function sRIPE(q) { return new Res("http://www.ripe.net/fcgi-bin/whois?form_type=simple&full_query_string=&searchtext="+q, "", q); }
function sDNSReport(q) { return new Res("http://www.dnsreport.com/tools/dnsreport.ch?domain="+q, "", q); }
function sWhois(q) { return new Res("http://www.whois.sc/"+q, "", q); }
function sAlexa(q) { return new Res("http://www.alexa.com/data/details/traffic_details?q=&url=http://"+q, "", q); }

// Media
function sIMDB(q) { return new Res("http://www.imdb.com/find?q="+q, "", q); }
function sAmazonISBN(q) { return new Res("http://www.amazon.com/exec/obidos/tg/detail/-/"+q, "Amazon for ISBN " + q, q); }
function sAmazon(q) { return new Res("http://www.amazon.com/exec/obidos/search-handle-url/field-keywords="+q+"&index=blended", "", q); }
function sSingingFish(q) { return new Res("http://search.singingfish.com/sfw/search?query="+q, "", q); }
function sYotoPhoto(q) { return new Res("http://yotophoto.com/images/"+q+"/1/", "", q); }

// Audio
function sPodscope(q) { return new Res("http://www.podscope.com/search.php?q="+q, "", q); }
function sPodcastAlley(q) { return new Res("http://www.podcastalley.com/search.php?searchterm="+q, "", q); }

// Coding
function sCPAN(q) { return new Res("http://search.cpan.org/search?mode=all&query="+q, "", q); }
function sSunJava(q) { return new Res("http://onesearch.sun.com/search/developers/index.jsp?col=searchall&qp=url%3A%2Fj2se%2F1.4.2%2F&qt="+q, "", q); }
function sPHP(q) { return new Res("http://www.php.net/manual-lookup.php?lang=en&pattern="+q, "", q); }
function sJdocs(q) { return new Res("http://www.jdocs.com/search.jsp?s="+q, "", q); }
function sMySQL(q) { return new Res("http://www.mysql.com/search/?q="+q, "", q); }

// Wikis
function sWikipedia(q) { return new Res("http://en.wikipedia.org/wiki/Special:Search?search="+q, "", q); }

// Images
function sGoogleImage(q) { return new Res("http://images.google.com/images?hl=en&q="+q, "Search Google Image for "+q, q); }
function sFlickr(q) { return new Res("http://www.flickr.com/photos/tags/"+q, "", q); }


// Groups
function sGoogleGroups(q) { return new Res("http://groups-beta.google.com/groups?hl=en&lr=&sa=N&tab=ig&q="+q, "Search Google Groups for "+q, q); }

// News
function sYahooNews(q) { return new Res("http://news.search.yahoo.com/news/search?c=&p="+q, "Search Yahoo News for "+q, q); }
function sGoogleNews(q) { return new Res("http://news.google.com/news?tab=gn&hl=en&lr=&q="+q, "Search Google News for "+q, q); }
function sTopix(q) { return new Res("http://www.topix.net/search/?q="+q, "", q); }

function sYahooNewsRSS(q) { l = new LiveRss("http://news.search.yahoo.com/news/rss?p="+q+"&c=&eo=UTF-8", q); return l.run(); }
function sGoogleNewsRSS(q) { l = new LiveRss("http://news.google.com/news?hl=en&lr=&q="+q+"&tab=wn&ie=UTF-8&output=rss", q); return l.run(); }


// Reference
function sReferenceDictionary(q) { return new Res("http://dictionary.reference.com/search?q="+q, "", q); }
function sReferenceThesaurus(q) { return new Res("http://thesaurus.reference.com/search?q="+q, "", q); }
function sGoogleScholar(q) { return new Res("http://scholar.google.com/scholar?q="+q, "", q); }
function sFindArticles(q) { return new Res("http://www.findarticles.com/p/search?qt="+q, "", q); }
function sFactbites(q) { return new Res("http://www.factbites.com/search.php?kp="+q, "", q); }
function sScirus(q) { return new Res("http://www.scirus.com/srsapp/search?q="+q, "", q); }

// Finance
function sYahooFinance(q) { return new Res("http://finance.yahoo.com/q?d=t&s="+q, "Search Yahoo Finance for "+q, q); }

//Weather
function sWUnderground(q) { return new Res("http://www.wunderground.com/cgi-bin/findweather/getForecast?query="+q, "", q); }

// Addresses etc
function sZipinfo(q) { return new Res("http://zipinfo.com/cgi-local/zipsrch.exe?zip="+q, "", q); }
function sZoomInfo(q) { return new Res("http://networking5.zoominfo.com/PeopleSearch/PersonQuery.asp?searchParameters="+q, "", q); }

// Time
function sTimeAndDate(q) { return new Res("http://www.timeanddate.com/search/results.html?query="+q, "", q); }

// Drink and food
function sWebtender(q) { return new Res("http://www.webtender.com/cgi-bin/search?show=15&verbose=on&name="+q, "", q); }
function sCooks(q) { return new Res("http://www.cooks.com/rec/search?q="+q, "", q); }

// Things
function sGizmodo(q) { return new Res("http://www.gizmodo.com/gadget/"+q, "", q); }
function sEngadget(q) { return new Res("http://www.engadget.com/search/?q="+q, "", q); }

// Taging
function sYubnub(q) { return new Res("http://www.yubnub.org/parser/parse?command="+q, "", q); }


// Domains
dec.r(sWWWURL, '^\\.([A-Za-z0-9\\.\\-]*\\.[A-Za-z0-9]{2,4})$');
dec.r(sURL, '^([A-Za-z0-9\\-\\.]*\\.?[A-Za-z0-9\\-\\.]*\\.[A-Za-z0-9]{2,4})$');
dec.r(sDNSReport, '^([A-Za-z0-9\\-\\.]*\\.?[A-Za-z0-9\\-\\.]*\\.[A-Za-z0-9]{2,4})$');
dec.r(sAlexa, '^([A-Za-z0-9\\-\\.]*\\.?[A-Za-z0-9\\-\\.]*\\.[A-Za-z0-9]{2,4})$');

// URLS
dec.r(sXTP, '^(http://.*)');
dec.r(sXTP, '^(https://.*)');
dec.r(sXTP, '^(ftp://.*)');

// IP
dec.r(sWhois, '^([A-Za-z0-9]*\\.?[A-Za-z0-9]*\\.[A-Za-z0-9]{2,3})$');
dec.r(sARIN, '^([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})$');
dec.r(sRIPE, '^([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})$');

// ISBN
dec.r(sAmazonISBN, '^([0-9X]{10,13})$');

// Mail tracking
dec.r(sUPS, '^[0-9Z]{18,18}$');
dec.r(sFedEx, '^[0-9]{20,20}$');
dec.r(sFedEx, '^[0-9]{15,15}$');
dec.r(sFedEx, '^[0-9]{12,12}$');

// Generic words
dec.r(sTechnorati, '^blog (.*)');
dec.r(sIMDB, '^movie (.*)');
dec.r(sIMDB, '^actor (.*)');
dec.r(sIMDB, '^director (.*)');
dec.r(sGoogleImage, '^image (.*)');
dec.r(sGoogleImage, '^picture (.*)');
dec.r(sGoogleImage, '^images (.*)');
dec.r(sGoogleImage, '^pictures (.*)');
dec.r(sTopix, '^news (.*)');
dec.r(sYahooFinance, '^stock (.*)');
dec.r(sGoogleGroups, '^newsgroup (.*)');
dec.r(sReferenceDictionary, '^dict (.*)');
dec.r(sReferenceDictionary, '^dictionary (.*)');
dec.r(sWUnderground, '^weather (.*)');
dec.r(sReferenceThesaurus, '^thesaurus (.*)');
dec.r(sZipinfo, '^zip (.*)');
dec.r(sTimeAndDate, '^time (.*)');
dec.r(sWebtender, '^drink (.*)');
dec.r(sCooks, '^recipe (.*)');

// Site specific
dec.r(sFeedster, '^feedster (.*)');
dec.r(sTechnorati, '^technorati (.*)');
dec.r(sBloglines, '^bloglines (.*)');
dec.r(sIMDB, '^imdb (.*)');
dec.r(sCPAN, '^cpan (.*)');
dec.r(sWikipedia, '^wikipedia (.*)');
dec.r(sSunJava, '^java (.*)');
dec.r(sGoogleImage, '^googleimage (.*)');
dec.r(sTopix, '^topix (.*)');
dec.r(sYahooNews, '^yahoonews (.*)');
dec.r(sGoogleNews, '^googlenews (.*)');
dec.r(sGoogleGroups, '^googlegroups (.*)');
dec.r(sYahooFinance, '^yahoofinance (.*)');
dec.r(sReferenceDictionary, '^referencedictionary (.*)');
dec.r(sReferenceThesaurus, '^referencethesaurus (.*)');
dec.r(sWUnderground, '^wunderground (.*)');
dec.r(sZipinfo, '^zipinfo (.*)');
dec.r(sTimeAndDate, '^timeanddate (.*)');
dec.r(sWebtender, '^webtender (.*)');
dec.r(sCooks, '^cooks (.*)');
dec.r(sFlickr, '^flickr (.*)');
dec.r(sBlogPulse, '^blogpulse (.*)');
dec.r(sDaypop, '^daypop (.*)');
dec.r(sEngadget, '^engadget (.*)');
dec.r(sFactbites, '^factbites (.*)');
dec.r(sFindArticles, '^findarticles (.*)');
dec.r(sGizmodo, '^gizmodo (.*)');
dec.r(sJdocs, '^jdocs (.*)');
dec.r(sMySQL, '^mysql (.*)');
dec.r(sPodcastAlley, '^podcastalley (.*)');
dec.r(sPodscope, '^podscope (.*)');
dec.r(sGoogleScholar, '^googlescholar (.*)');
dec.r(sScirus, '^scirus (.*)');
dec.r(sSingingFish, '^singingfish (.*)');
dec.r(sYotoPhoto, '^yotophoto (.*)');
dec.r(sZoomInfo, '^zoominfo (.*)');
dec.r(sPHP, '^php (.*)');

dec.r(sYahooNewsRSS, '^yahoonews (.*)$');
dec.r(sGoogleNewsRSS, '^googlenews (.*)$');


// Site specific general search
dec.r(sMSN, '^msn (.*)');
dec.r(sAsk, '^ask (.*)');
dec.r(sA9, '^a9 (.*)');
dec.r(sYahoo, '^yahoo (.*)');
dec.r(sAOL, '^aol (.*)');
dec.r(sAllTheWeb, '^alltheweb (.*)');
dec.r(sTeoma, '^teoma (.*)');
dec.r(sAltavista, '^altavista (.*)');
dec.r(sGigablast, '^gigablast (.*)');
dec.r(sLookSmart, '^looksmart (.*)');
dec.r(sLycos, '^lycos (.*)');

dec.r(sMSNRSS, '^msn (.*)');


// Shopping
dec.r(sEbay, '^ebay (.*)');
dec.r(sFroogle, '^froogle (.*)');
dec.r(sAmazon, '^amazon (.*)');
dec.r(sMySimon, '^mysimon (.*)');
dec.r(sShopping, '^shopping (.*)');

// Tagging
dec.r(sYubnub, '^yubnub (.*)');

// Ambedo
dec.r(sAmbedoEdit, '^edit');
dec.r(sAmbedoLogin, '^login');
dec.r(sAmbedoLogout, '^logout');
dec.r(sAmbedoHelp, '^help');
dec.r(sAmbedoAbout, '^about');
dec.r(sAmbedoBookmarklets, '^bookmarklets');
dec.r(sAmbedoSearch, '^search (.*)');
dec.r(sAmbedoDirectory, '^directory');
dec.r(sAmbedoSettings, '^settings');
dec.r(sAmbedoStats, '^stats');
dec.r(sAmbedoLatest, '^latest');

// Default
dec.r(sGoogle, '^(.*)$');

// Simple access to domains
dec.r(sAsComDomain, '^([A-Za-z0-9\\-]*)$');
