Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Search as user Types var

Comprar cialis online
Comprar Viagra (Sildenafil 50/100mg) en linea sin receta
var imageSearch;

function addPaginationLinks() {
  // The cursor object has all things to do with pagination
  var cursor = imageSearch.cursor;
  var curPage = cursor.currentPageIndex; // check what page the app is on
  var pagesDiv = document.createElement('div');
  for (var i = 0; i < cursor.pages.length; i++) {
    var page = cursor.pages[i];
    if (curPage == i) { // if we are on the curPage, then don't make a link
      var label = document.createTextNode(' ' + page.label + ' ');
      pagesDiv.appendChild(label);
    } else {
      // If we aren't on the current page, then we want a link to this page.
      // So we create a link that calls the gotoPage() method on the searcher.
      var link = document.createElement('a');
      link.href = 'javascript:imageSearch.gotoPage('+i+');';
      link.innerHTML = page.label;
      link.style.marginRight = '2px';
      pagesDiv.appendChild(link);
    }
  }

  var contentDiv = document.getElementById('content');
  contentDiv.appendChild(pagesDiv);
}

function searchComplete() {
  // Check that we got results
  if (imageSearch.results && imageSearch.results.length > 0) {
    // Grab our content div, clear it.
    var contentDiv = document.getElementById('content');
    contentDiv.innerHTML = '';

    // Loop through our results, printing them to the page.
    var results = imageSearch.results;
    for (var i = 0; i < results.length; i++) {
      // For each result write it's title and image to the screen
      var result = results[i];
      var imgContainer = document.createElement('div');

      var title = document.createElement('div');
      // We use titleNoFormatting so that no HTML tags are left in the title
      title.innerHTML = result.titleNoFormatting;

      var newImg = document.createElement('img');
      // There is also a result.url property which has the escaped version
      newImg.src = result.tbUrl;

      imgContainer.appendChild(title);
      imgContainer.appendChild(newImg);

      // Put our title + image in the content
      contentDiv.appendChild(imgContainer);
    }

    // Now add the paging links so the user can see more results.
    addPaginationLinks(imageSearch);
  }
}

function OnLoad() {
  // Our ImageSearch instance.
  imageSearch = new google.search.ImageSearch();

  // Restrict to extra large images only
  imageSearch.setRestriction(google.search.ImageSearch.RESTRICT_IMAGESIZE,
                             google.search.ImageSearch.IMAGESIZE_MEDIUM);

  // Here we set a callback so that anytime a search is executed, it will call
  // the searchComplete function and pass it our ImageSearch searcher.
  // When a search completes, our ImageSearch object is automatically
  // populated with the results.
  imageSearch.setSearchCompleteCallback(this, searchComplete, null);

  // Find me a beautiful car.
  imageSearch.execute("Subaru STI");
}
google.setOnLoadCallback(OnLoad);
Comprar Levitra generico sin receta
Comprar Viagra generico

Search Result Placement

salud masculina informacion disfuncion erectil
erektile dysfunktion
google.load('search', '1');

function OnLoad() {

  // create a search control
  var searchControl = new google.search.SearchControl();

  // web search, open, alternate root
  var options = new google.search.SearcherOptions();
  options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
  options.setRoot(document.getElementById("somewhere_else"));
  searchControl.addSearcher(new google.search.WebSearch(), options);

  searchControl.addSearcher(new google.search.LocalSearch());
  searchControl.addSearcher(new google.search.BlogSearch());

  // tell the searcher to draw itself and tell it where to attach
  searchControl.draw(document.getElementById("search_control"));

  // execute an inital search
  searchControl.execute("Ferrari Enzo");
}
google.setOnLoadCallback(OnLoad);
erektile dysfunktion
Comprar Cialis Generico en Espana

Digitürk Lig TV Dünyası

Digitürk Lig TV Dünyası fırsatlarıyla herkesi şaşırtıyor. Yeni Lig TV Dünyası fırsat paketinde aylık sadece 12.99 TL'den başlayan fiyatlarla sadece taraftarı olduğunuz futbol takımının tüm maçlarını digitürk farkının oluşturduğu heyacanlı ve kesintisiz bir şekilde izleyebilirsiniz. Digitürk'ün bu Lig TV kampanyası son zamanların ilgi gören Digitürk Lig TV Kampanyalarından bir tanesi olmuştur. Bu ve benzeri Lig TV Kampanyalarını her zaman web sitemizden digitürk yayın akışını takip edebilirsiniz. Şuan bulunan Lig TV Kampanyalarınıda web sitemizde bulabilirsiniz.

News Edition Restrictions

Comprar cialis online
Comprar Viagra (Sildenafil 50/100mg) en linea sin receta
google.load('search', '1');

function OnLoad() {
  // Create a search control
  var searchControl = new google.search.SearchControl();

  // Create a NewsSearcher
  var newsSearch = new google.search.NewsSearch();
  var extendedArgs = google.search.Search.RESTRICT_EXTENDED_ARGS;

  // Restrict to the UK news edition.
  newsSearch.setRestriction(extendedArgs, {'ned':'uk'});

  // Add the searcher to the SearchControl
  searchControl.addSearcher(newsSearch);

  // tell the searcher to draw itself and tell it where to attach
  searchControl.draw(document.getElementById("content"));

  // A good sport
  searchControl.execute('Football');
}

google.setOnLoadCallback(OnLoad);
Comprar Levitra generico sin receta
Comprar Viagra generico

Geo Restrictions

erektile dysfunktion therapie
helden der liebe
google.load('search', '1');

function OnLoad() {
  // Create a search control
  var searchControl = new google.search.SearchControl();

  // Create an ImageSearch
  var patentSearch = new google.search.PatentSearch();

  // Restrict by issued patents
  patentSearch.setRestriction(google.search.PatentSearch.RESTRICT_TYPE,
                              google.search.PatentSearch.TYPE_ISSUED_PATENTS);

  // Add the searcher to the SearchControl
  searchControl.addSearcher(patentSearch);

  // tell the searcher to draw itself and tell it where to attach
  searchControl.draw(document.getElementById("content"));

  // Search!
  searchControl.execute('Boeing');
}

google.setOnLoadCallback(OnLoad);
google.load('search', '1');

function OnLoad() {
  // Create a search control
  var searchControl = new google.search.SearchControl();

  // Create a NewsSearcher
  var newsSearch = new google.search.NewsSearch();
levitra deutschland
Comprar Cialis Generico en Espana

Set Language Restriction

salud masculina informacion disfuncion erectil
Comprar Viagra sin receta en Espana
google.load('search', '1');

function OnLoad() {
  // Create a search control
  var searchControl = new google.search.SearchControl();

  // Create a WebSearcher
  var webSearch = new google.search.WebSearch();

  // Set the Google locale language to France
  var extendedArgs = google.search.Search.RESTRICT_EXTENDED_ARGS;
  webSearch.setRestriction(extendedArgs, {gl: 'fr'});

  // Add the searcher to the SearchControl
  searchControl.addSearcher(webSearch);

  // tell the searcher to draw itself and tell it where to attach
  searchControl.draw(document.getElementById("content"));

  // Scooby doo in German!
  searchControl.execute('scooby doo');
}

google.setOnLoadCallback(OnLoad);
function OnLoad() {
  // Create a search control
  var searchControl = new google.search.SearchControl();

  // Create a WebSearcher
  var webSearch = new google.search.WebSearch();

erektile dysfunktion
erektile dysfunktion

jQueryUI + MooTools

salud masculina informacion disfuncion erectil
google.load("jquery", "1");
google.load("jqueryui", "1");

function OnLoad(){
  $('#content').html('<div id="draggable-handle-div" style="width:100px;border:1px solid #999;">' +
                     '<div style="background-color:#999">dragme</div>content</div>');
  $("#draggable-handle-div").draggable({
    "handle": "div"
  });
}

google.setOnLoadCallback(OnLoad);
google.load("mootools", "1.2.1");

var content;
var isRed = false;

// This function is called every 1000 miliseconds and it just tweens the color
// of the text.
function tweenColor() {
  var myFx = new Fx.Tween(content);
  if (!isRed) {
    myFx.start('color', '#f00');
    isRed = true;
  } else {
    myFx.start('color', '#000');
    isRed = false;
  }

}

function OnLoad(){
  content = document.getElementById('content');
  content.innerHTML = '<h1>Tweening</h1>';
  // call tweenColor every 1000 miliseconds
  window.setInterval(tweenColor, 1000);
}

google.setOnLoadCallback(OnLoad);
impotenz

Prototype Scriptaculous 2

erektile dysfunktion
erektile dysfunktion therapie
function OnLoad() {
  // Create a search control
  var searchControl = new google.search.SearchControl();

  // Add in a full set of searchers
  var localSearch = new google.search.LocalSearch();
  searchControl.addSearcher(localSearch);

  // Set the Local Search center point
  localSearch.setCenterPoint("New York, NY");

  // tell the searcher to draw itself and tell it where to attach
  searchControl.draw(document.getElementById("content"));

  // execute an inital search
  searchControl.execute("Museum");
}

google.setOnLoadCallback(OnLoad);
function initialize() {
  var mapDiv = document.getElementById('map-canvas');
  var map = new google.maps.Map(mapDiv, {
    center: new google.maps.LatLng(37.4419, -122.1419),
    zoom: 13,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  });
}
Comprar Viagra sin receta en Espana
erektile dysfunktion