try {
var _xnext_included;
if (!_xnext_included) {
_xnext_included = true;

if(!document.body) {
    throw "The tag <body> is missing";
}

var ecwidContextPath = "";
	window.Ecwid = {MessageBundles:{}};

if(!window.ecwid_use_custom_loading_indicator) {
    var indicator111 = '<table style="z-index:1000000;zoom:1;cursor:wait;';
    if (document.compatMode == "BackCompat" && /MSIE .+Win/.test(navigator.userAgent) || /MSIE (5\.5|6).+Win/.test(navigator.userAgent)) {
    	var left111 = document.body.scrollLeft ? document.body.scrollLeft : document.documentElement.scrollLeft;
    	var width111 = (window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));
    	var top111 = document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop;
    	var height111 = (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
    	
    	indicator111 += 'position:absolute;left:'+left111+'px;width:'+width111+'px;top:'+top111+'px;height:'+height111+'px';
    } else {
    	indicator111 += 'position:fixed;left:0px;width:100%;top:0px;height:100%';
    }
    indicator111 += '" id="ecwid_loading_indicator"><tr><td style="text-align:center;vertical-align:middle">';
    indicator111 += '<img src="http://wac.211a.edgecastcdn.net/80211A/ecwid/5.0-6099/icons/loadingAnimation.gif" />';
    indicator111 += '</td></tr></table>';
    if (window.ecwid_script_defer) {
      if (!document.getElementById("ecwid_loading_indicator")) {
	      var ecwid_indicator = document.createElement("div");
	      ecwid_indicator.innerHTML = indicator111;
	      document.body.appendChild(ecwid_indicator);
      }
    } else document.write(indicator111);
}

if (window.top != window && document.referrer) {
	var hash_position = document.referrer.lastIndexOf('#ecwid:');
	if (hash_position != -1) {
		var hash = document.referrer.substr(hash_position);
		var loc = window.location.href;
		if (loc.indexOf('#') == -1) window.location.replace(loc + hash);
		else {
			if (loc.substr(loc.indexOf('#')) != hash) window.location.replace(loc.substr(0, loc.indexOf('#')) + hash);
		}
	}
}

var css_selectors_prefix = null;
var ecwid_nocssrewrite;
if(!ecwid_nocssrewrite) {
    var html_id = null;
    var html_tag = document.getElementsByTagName("html");
    if(html_tag && html_tag.length) {
        html_tag = html_tag[0];
        if(!html_tag.id) html_tag.id = "ecwid_html";
        html_id = html_tag.id;
    }

    var body_id = null;
    var body_tag = document.getElementsByTagName("body");
    if(body_tag && body_tag.length) {
        body_tag = body_tag[0];
        if(!body_tag.id) body_tag.id = "ecwid_body";
        body_id = body_tag.id;
    }

    if(html_id || body_id) {
        css_selectors_prefix = "";
        if(html_id) {
            css_selectors_prefix += "html%23"+html_id;
        }
        if(html_id && body_id) css_selectors_prefix += "%20";
        if(body_id) {
            css_selectors_prefix += "body%23"+body_id;
        }
    }
}

window.ecwid_script_base='http://wac.211a.edgecastcdn.net/80211A/ecwid/5.0-6099/';window.ecwid_url='http://app.ecwid.com/';window.ecwid_static='http://wac.211a.edgecastcdn.net/80211A/ecwid/';

ru_cdev_xnext_frontend_Main=function(){var M='',lc='\n-',ob='" for "gwt:onLoadErrorFn"',mb='" for "gwt:onPropertyErrorFn"',$b='"<script src=\\"',X='"><\/script>',Z='#',kc=');',cc='-\n',mc='-><\/scr',Zb='.cache.js',_b='.cache.js\\"><\/scr" + "ipt>"',_='/',Cb='009C54D7B7F7192FFECFA4784B537203',Db='00ABA96430DFD336168E3BE4BBE134AA',Eb='34515C34EBD6C88B1FE4B4FF40F0AE3D',Fb='874FFF826364224218BB9D2A66DA7D2F',Gb='8932301BACE411FD235B06A19AD59702',Ib=':',gb='::',ac='<scr',W='<script id="',Xb='<script language="javascript" src="',jb='=',$='?',lb='Bad handler "',zb='Cross-site hosted mode not yet implemented. See issue ',Pb='DOMContentLoaded',Hb='E37FF4222C674AEF30C49FB8FD4A9347',Jb='css?ownerid=64035&h=115361721&en'+(document.documentMode==7?'&IE8-like-IE7':'')+(css_selectors_prefix? '&id-selector='+css_selectors_prefix:''),Y='SCRIPT',U='__gwt_marker_ru.cdev.xnext.frontend.Main',ab='base',V='baseUrl',Q='begin',P='bootstrap',cb='clear.cache.gif',ib='content',jc='document.write(',T='end',fc='evtGroup: "loadExternalRefs", millis:(new Date()).getTime(),',hc='evtGroup: "moduleStartup", millis:(new Date()).getTime(),',Rb='functions.js',Yb='functions.js"><\/script>',wb='gecko',xb='gecko1_8',R='gwt.hybrid',nb='gwt:onLoadErrorFn',kb='gwt:onPropertyErrorFn',hb='gwt:property',Ob='head',Nb='href',Ab='http://code.google.com/p/google-web-toolkit/issues/detail?id=2079',vb='ie6',ub='ie8',bb='img',nc='ipt>',bc='ipt><!-',Kb='link',Qb='loadExternalRefs',db='meta',ec='moduleName:"ru.cdev.xnext.frontend.Main", sessionId:window.__gwtStatsSessionId, subSystem:"startup",',S='moduleStartup',tb='msie',eb='name',qb='opera',Lb='rel',N='ru.cdev.xnext.frontend.Main',fb='ru.cdev.xnext.frontend.Main::',sb='safari',Sb='script',Bb='selectingPermutation',Tb='src',O='startup',Mb='stylesheet',Wb='text/javascript',Vb='type',gc='type: "end"});',ic='type: "moduleRequested"});',yb='unknown',pb='user.agent',Ub='utf-8',rb='webkit',dc='window.__gwtStatsEvent && window.__gwtStatsEvent({';var k=window,l=document,m=k.__gwtStatsEvent?function(a){return k.__gwtStatsEvent(a)}:null,n=k.__gwtStatsSessionId?k.__gwtStatsSessionId:null,o,p,q=M,r={},s=[],t=[],u=[],v=0,w,x;m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:P,millis:(new Date).getTime(),type:Q});if(!k.__gwt_stylesLoaded){k.__gwt_stylesLoaded={}}if(!k.__gwt_scriptsLoaded){k.__gwt_scriptsLoaded={}}function y(){try{return k.external&&(k.external.gwtOnLoad&&k.location.search.indexOf(R)==-1)}catch(a){return false}}
function z(){if(o&&p){o(w,N,q,v);m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:S,millis:(new Date).getTime(),type:T})}}
function A(){if(window.ecwid_script_base){q=window.ecwid_script_base;return}var e,f=U,g;if(r[V]){q=r[V];return}l.write(W+f+X);g=l.getElementById(f);e=g&&g.previousSibling;while(e&&e.tagName!=Y){e=e.previousSibling}function h(a){var b=a.lastIndexOf(Z);if(b==-1){b=a.length}var c=a.indexOf($);if(c==-1){c=a.length}var d=a.lastIndexOf(_,Math.min(c,b));return d>=0?a.substring(0,d+1):M}
;if(e&&e.src){q=h(e.src)}if(q==M){var i=l.getElementsByTagName(ab);if(i.length>0){q=i[i.length-1].href}else{q=h(l.location.href)}}else if(q.match(/^\w+:\/\//)){}else{var j=l.createElement(bb);j.src=q+cb;q=h(j.src)}if(g){g.parentNode.removeChild(g)}}
function B(){var b=document.getElementsByTagName(db);for(var c=0,d=b.length;c<d;++c){var e=b[c],f=e.getAttribute(eb),g;if(f){f=f.replace(fb,M);if(f.indexOf(gb)>=0){continue}if(f==hb){g=e.getAttribute(ib);if(g){var h,i=g.indexOf(jb);if(i>=0){f=g.substring(0,i);h=g.substring(i+1)}else{f=g;h=M}r[f]=h}}else if(f==kb){g=e.getAttribute(ib);if(g){try{x=eval(g)}catch(a){alert(lb+g+mb)}}}else if(f==nb){g=e.getAttribute(ib);if(g){try{w=eval(g)}catch(a){alert(lb+g+ob)}}}}}}
function E(a,b){var c=u;for(var d=0,e=a.length-1;d<e;++d){c=c[a[d]]||(c[a[d]]=[])}c[a[e]]=b}
function F(a){var b=t[a](),c=s[a];if(b in c){return b}var d=[];for(var e in c){d[c[e]]=e}if(x){x(a,d,b)}throw null}
t[pb]=function(){var b=navigator.userAgent.toLowerCase();var c=function(a){return parseInt(a[1])*1000+parseInt(a[2])};if(b.indexOf(qb)!=-1){return qb}else if(b.indexOf(rb)!=-1){return sb}else if(b.indexOf(tb)!=-1){if(document.documentMode>=8){return ub}else{var d=/msie ([0-9]+)\.([0-9]+)/.exec(b);if(d&&d.length==3){var e=c(d);if(e>=6000){return vb}}}}else if(b.indexOf(wb)!=-1){var d=/rv:([0-9]+)\.([0-9]+)/.exec(b);if(d&&d.length==3){if(c(d)>=1008)return xb}return wb}return yb};s[pb]={gecko:0,gecko1_8:1,ie6:2,ie8:3,opera:4,safari:5};ru_cdev_xnext_frontend_Main.onScriptLoad=function(a){ru_cdev_xnext_frontend_Main.onScriptLoad=null;o=a;z()};if(y()){alert(zb+Ab);return}B();A();m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:P,millis:(new Date).getTime(),type:Bb});var G;try{E([qb],Cb);E([wb],Db);E([xb],Eb);E([vb],Fb);E([sb],Gb);E([ub],Hb);G=u[F(pb)];var H=G.indexOf(Ib);if(H!=-1){v=Number(G.substring(H+1));G=G.substring(0,H)}}catch(a){return}var I;function J(){if(!p){p=true;if(!__gwt_stylesLoaded[Jb]){var a=l.createElement(Kb);__gwt_stylesLoaded[Jb]=a;a.setAttribute(Lb,Mb);a.setAttribute(Nb,q+Jb);l.getElementsByTagName(Ob)[0].appendChild(a)}z();if(l.removeEventListener){l.removeEventListener(Pb,J,false)}if(I){clearInterval(I)}}}
if(window.ecwid_script_defer)J();else{if(l.addEventListener){l.addEventListener(Pb,function(){J()},false)}var I=setInterval(function(){if(/loaded|complete/.test(l.readyState)){J()}},50)}m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:P,millis:(new Date).getTime(),type:T});m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:Qb,millis:(new Date).getTime(),type:Q});if(!__gwt_scriptsLoaded[Rb]){__gwt_scriptsLoaded[Rb]=true;if(window.ecwid_script_defer){var K=document.createElement(Sb);K.setAttribute(Tb,q+Rb);K.charset=Ub;K.setAttribute(Vb,Wb);document.body.appendChild(K)}else document.write(Xb+q+Yb)}if(window.ecwid_script_defer){var K=document.createElement(Sb);K.setAttribute(Tb,q+G+Zb);K.charset=Ub;K.setAttribute(Vb,Wb);document.body.appendChild(K)}else{var L=$b+q+G+_b;l.write(ac+bc+cc+dc+ec+fc+gc+dc+ec+hc+ic+jc+L+kc+lc+mc+nc)}}
ru_cdev_xnext_frontend_Main();



var ecwid_iframe_html = "<iframe src=\"javascript:''\" id=\"__gwt_historyFrame\" style=\"position:absolute;top:0;left:0;width:0;height:0;border:0\"></iframe>";
if (window.ecwid_script_defer) {
    var ecwid_iframe = document.createElement("div");
    ecwid_iframe.innerHTML = ecwid_iframe_html;
    document.body.appendChild(ecwid_iframe);
} else document.write(ecwid_iframe_html);

window.xnext_global_config="//OK[3,92,91,90,1,17,0,0,0,0,0,9,0,7,0,0,0,89,88,58,87,86,85,84,83,82,81,80,79,78,77,76,75,54,74,73,53,52,72,71,70,69,68,67,66,65,27,2,50,0,0,64,63,62,61,9,11,4,2,50,0,0,60,59,9,58,57,56,55,54,53,52,11,51,10,2,50,3,4,1,0,0,4,49,0,784809194,1,0.0,1,48,1,4,47,0,0,0,46,0,45,0.0,0.0,0.0,0.0,0,44,1,4,43,0.0,1000.0,1,30,42,1,4,41,40,1,39,38,100,-19,30,37,36,0,30,0,1,29,-19,30,32,35,0,30,0,1,29,9,33,0,0,34,0,30,0,1,29,10,33,30,32,31,0,30,0,1,29,4,4,28,17,1,27,26,25,24,0,9,23,7,17,0,0,0,0,22,0,0,0,32,0,1,21,0,20,46,19,0,0,0,18,17,16,15,2,4,14,100,1,13,12,80,80,1,1,64035,0,11,10,0,0,9,8,7,6,0,0,0,5,0,0,4,3,1,2,1,[\"ru.cdev.xnext.frontend.client.Config/3895436767\",\"[Ljava.lang.String;/2600011424\",\"en\",\"java.util.ArrayList/3821976829\",\"css?ownerid=64035&115362673\",\"251458316228\",\"ru.cdev.xnext.client.Person/3174583622\",\"Los Angeles\",\"US\",\"90026\",\"CA\",\"ru.cdev.xnext.client.StoreConfiguration/3353775613\",\"ru.cdev.nodeservice.client.AccountType/585005807\",\"ru.cdev.xnext.client.StoreCheckoutList/3763686911\",\"ru.cdev.xnext.client.order.StoreCheckout/4070515583\",\"ru.cdev.xnext.client.order.PaypalCheckout/3458041818\",\"Book Gallery\",\"ru.cdev.xnext.client.Currency/4292171452\",\"EEE, MMM d, ''yy\",\"ru.cdev.xnext.client.CategoryViewOrder/3740796068\",\"history@bookgallery.com\",\"http://app.ecwid.com/image/139495?ownerid=64035\",\"Durham\",\"919-596-2497\",\"27709-2317\",\"NC\",\"P O Box 12317\\n\",\"ru.cdev.xnext.client.payment.PaymentMethodList/196724984\",\"ru.cdev.xnext.client.payment.PaymentMethod/3139059238\",\"\",\"Check\",\"<p>Checks drawn on a U.S. bank only, please. Mail payment to</p>\\n<p>Book Gallery</p>\\n<p>P O Box 12317</p>\\n<p>Durham, NC 27709-2317</p>\",\"ru.cdev.xnext.client.payment.PaymentProcessor/841053865\",\"Business check\",\"Personal check\",\"Phone ordering\",\"<p>For direct payments via MasterCard, VISA, or American Express, please telephone us at</p>\\n<p>(919) 596-2497</p>\\n<p>from 10 a.m. to 6 p.m. Eastern USA time. You may leave a message if we are unavailable to answer your call, and we will return your call promptly. Be sure to leave your name, telephone number, best time to reach you, and the book(s) about which you are inquiring.</p>\\n<p>&nbsp;</p>\",\"4.2\",\"5.0\",\"ru.cdev.xnext.client.order.ShippingAndTaxSettings/3214905530\",\"ru.cdev.xnext.client.order.ShippingSettings/3673425643\",\"ru.cdev.xnext.client.order.ShippingMethod/71295725\",\"Free shipping\",\"ru.cdev.xnext.client.order.ShippingRule/979306630\",\"ru.cdev.xnext.client.order.TheWorld/2554300926\",\"N/A\",\"ru.cdev.xnext.client.order.TaxSettings/1955934467\",\"ru.cdev.xnext.client.order.TaxCfg/2448558747\",\"sales tax\",\"ru.cdev.xnext.client.order.Zone/3791012462\",\"AU\",\"FR\",\"DE\",\"IE\",\"JP\",\"MX\",\"NZ\",\"GB\",\"1\",\"USA\",\"UM\",\"VI\",\"2\",\"US & Canada\",\"AT\",\"BE\",\"BG\",\"CY\",\"CZ\",\"DK\",\"EE\",\"FI\",\"GR\",\"HU\",\"IT\",\"LV\",\"LT\",\"LU\",\"MT\",\"NL\",\"PL\",\"PT\",\"RO\",\"SK\",\"SI\",\"ES\",\"SE\",\"3\",\"EU\",\"hh:mm a\",\"http://www.bookgallery.com/\",\"ru.cdev.xnext.client.Weight$Unit/703232908\"],0,5]";
window.xnext_ownerId=64035;
window.Ecwid.MessageBundles['ru.cdev.xnext.client']={};window.Ecwid.demo=false;



function xAddWidget(widgetType, arg) {
	var i=1;
	var id;
	do {
		id = widgetType+"-"+i++;
	} while (document.getElementById(id));
	var stylePrefix = "style=";
	var style = "";
	for (var i=0; i<arg.length; i++) {
		if (arg[i].substr(0,stylePrefix.length) == stylePrefix) {
			var str = arg[i].substr(stylePrefix.length);
			str = str.replace(/^ +\'?/,"").replace(/\'? +$/,"");
			if (str.substring(0,1)=="'") str = str.substring(1);
			if (str.substring(str.length-1)=="'") str = str.substring(0, str.length-1);
			style += str;
		}
	}
	var html = "<div id='"+id+"'";
    if(style) {
        html += " style='"+style+"'";
    }
	html += "></div>";
	if (window.ecwid_script_defer) {
	    var element = document.createElement("div");
	    element.innerHTML = html;
	    document.body.appendChild(element);
	} else document.write(html);
	var l = 0;
	if (!window._xnext_initialization_scripts) {
		window._xnext_initialization_scripts = [];
	} else {
		l = window._xnext_initialization_scripts.length;
	}
	window._xnext_initialization_scripts[l] = {widgetType:widgetType, id:id, arg:arg};
}

function xProductBrowser() {
	xAddWidget("ProductBrowser", arguments);
}
function xAddToBag() {
    xAddWidget("AddToBag", arguments);
}
function xProductThumbnail() {
    xAddWidget("ProductThumbnail", arguments);
}
function xLoginForm() {
	xAddWidget("LoginForm", arguments);
}
function xMinicart() {
	xAddWidget("Minicart", arguments);
}
function xCategories() {
	xAddWidget("Categories", arguments);
}
function xVCategories() {
	xAddWidget("VCategories", arguments);
}
function xSearchPanel() {
	xAddWidget("SearchPanel", arguments);
}
function xGadget() {
	xAddWidget("Gadget", arguments);
}
function xFriendConnect(siteId) {
	Ecwid.gfcSiteId = siteId;
}
function xAffiliate(id) { Ecwid.affiliateId = id; }
if (/MSIE .+Win/.test(navigator.userAgent)) {
  var clientHeight = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
} else {
  var clientHeight = window.innerHeight-20;
}
document.body.style.minHeight = clientHeight+"px";

}
} catch (e) {
    function xReportError(msg) {
    	var html = "<table style='width:100%'><tr><td align='center'><div style='background-color:white;text-align:left;width: 300px;border: 5px #8080ff solid; padding: 20px'><img style='border:none;float:left;margin:0 20px 5px 0' src='http://my.ecwid.com/icons/msg_error.gif'>"+msg+"</div></td></tr></table>";
    	if (window.ecwid_script_defer) {
    	    var element = document.createElement("div");
    	    element.innerHTML = html;
    	    document.body.appendChild(element);
    	} else document.write(html);
    }

	var commonError = "The store cannot be loaded in your browser because of some JavaScript errors, sorry.<br/>" +
			"If you open this site using a mobile device, you can visit our <a href='http://app.ecwid.com/jsp/64035/catalog'>mobile store</a> " +
			"which is designed specially for them and doesn't use JavaScript.<br/><br/>" +
			"Below here's the exact error occurred. Please report it to the <a href='http://www.ecwid.com/bt'>issue tracker</a>.<br/><br/>";

	var bodyTagError = "This document doesn't contain the required " +
			"<a href='http://www.htmldog.com/reference/htmltags/body/'>&lt;body&gt; and &lt;/body&gt;</a> "+
            "tags. Thus your Ecwid store cannot be loaded. " +
            "Please add these tags and refresh the page. This message will disappear and you will see your store.";

	var isWindowsMobile2005 = /(msie 4).*(windows ce)/i.test(navigator.userAgent);

    if (!document.body && !isWindowsMobile2005)  {
        xReportError(bodyTagError);
	} else {
		xReportError(commonError + e.message);
	}

	throw e;
}
