/**
 * thumbnailsjs - JavaScript interface to retrieve thumbnails from PageGlimpse.com
 * http://925html.com/code/webpage-thumbnails/
 * 
 * Copyright (c) 2009 Eric Ferraiuolo - http://eric.ferraiuolo.name
 * MIT License - http://www.opensource.org/licenses/mit-license.php
 */

(function(){var a=function(b){if(!(this instanceof arguments.callee)){return new arguments.callee(b);}this.devkey=b.devkey||null;this.size=b.size||"small";this.root=b.root===false?false:true;this.nothumb=b.nothumb||null;};a.BASE_URL="http://images.pageglimpse.com/v1/thumbnails";a.prototype={get:function(b,f){var e=Object.prototype.toString.call(b)==="[object Array]",d,c;if(this.devkey&&b){d=e?b:[b];for(c=0;c<d.length;c++){this._loadImg(d[c],this._createSrcUrl(d[c]),f);}}return this;},_createSrcUrl:function(b){var c=["?","devkey=",this.devkey,"&","url=",b,"&","size=",this.size,"&","root=",(this.root?"yes":"no"),"&","nothumb=",(this.nothumb?this.nothumb:"")].join("");return a.BASE_URL+c;},_loadImg:function(c,d,f){var b=new Image(),e=b.naturalWidth?"naturalWidth":"width";b.src=d;if(f){if(b.complete){f(c,b[e]?b:null);}else{b.onload=function(){f(c,b);};b.onerror=function(){f.call(c,null);};}}}};window.Thumbnails=a;})();
