/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.encoding.compression.lzw"],["require","dojox.encoding.bits"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.encoding.compression.lzw"]){_4._hasResource["dojox.encoding.compression.lzw"]=true;_4.provide("dojox.encoding.compression.lzw");_4.require("dojox.encoding.bits");_4.getObject("encoding.compression.lzw",true,_6);(function(){var _7=function(x){var w=1;for(var v=2;x>=v;v<<=1,++w){}return w;};_6.encoding.compression.lzw.Encoder=function(n){this.size=n;this.init();};_4.extend(_6.encoding.compression.lzw.Encoder,{init:function(){this.dict={};for(var i=0;i<this.size;++i){this.dict[String.fromCharCode(i)]=i;}this.width=_7(this.code=this.size);this.p="";},encode:function(_8,_9){var c=String.fromCharCode(_8),p=this.p+c,r=0;if(p in this.dict){this.p=p;return r;}_9.putBits(this.dict[this.p],this.width);if((this.code&(this.code+1))==0){_9.putBits(this.code++,r=this.width++);}this.dict[p]=this.code++;this.p=c;return r+this.width;},flush:function(_a){if(this.p.length==0){return 0;}_a.putBits(this.dict[this.p],this.width);this.p="";return this.width;}});_6.encoding.compression.lzw.Decoder=function(n){this.size=n;this.init();};_4.extend(_6.encoding.compression.lzw.Decoder,{init:function(){this.codes=new Array(this.size);for(var i=0;i<this.size;++i){this.codes[i]=String.fromCharCode(i);}this.width=_7(this.size);this.p=-1;},decode:function(_b){var c=_b.getBits(this.width),v;if(c<this.codes.length){v=this.codes[c];if(this.p>=0){this.codes.push(this.codes[this.p]+v.substr(0,1));}}else{if((c&(c+1))==0){this.codes.push("");++this.width;return "";}var x=this.codes[this.p];v=x+x.substr(0,1);this.codes.push(v);}this.p=c;return v;}});})();}}};});