/*
	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
*/

//>>built
define("dojo/parser","require ./_base/kernel ./_base/lang ./_base/array ./_base/config ./dom ./_base/window ./_base/url ./aspect ./promise/all ./date/stamp ./Deferred ./has ./query ./on ./ready".split(" "),function(C,y,s,x,L,M,N,O,J,P,Q,D,E,K,R,S){function F(b){return eval("("+b+")")}function T(b){var a=b._nameCaseMap,d=b.prototype;if(!a||a._extendCnt<z){var a=b._nameCaseMap={},f;for(f in d)"_"!==f.charAt(0)&&(a[f.toLowerCase()]=f);a._extendCnt=z}return a}function G(b,a){a||(a=C);var d=a._dojoParserCtorMap||
(a._dojoParserCtorMap={}),f=b.join();if(!d[f]){for(var e=[],g=0,v=b.length;g<v;g++){var m=b[g];e[e.length]=d[m]=d[m]||s.getObject(m)||~m.indexOf("/")&&a(m)}g=e.shift();d[f]=e.length?g.createSubclass?g.createSubclass(e):g.extend.apply(g,e):g}return d[f]}new Date("X");var z=0;J.after(s,"extend",function(){z++},!0);var I={_clearCache:function(){z++;_ctorMap={}},_functionFromScript:function(b,a){var d="",f="",e=b.getAttribute(a+"args")||b.getAttribute("args"),g=b.getAttribute("with"),e=(e||"").split(/\s*,\s*/);
g&&g.length&&x.forEach(g.split(/\s*,\s*/),function(a){d+="with("+a+"){";f+="}"});return new Function(e,d+b.innerHTML+f)},instantiate:function(b,a,d){a=a||{};d=d||{};var f=(d.scope||y._scopeName)+"Type",e="data-"+(d.scope||y._scopeName)+"-",g=e+"type",v=e+"mixins",m=[];x.forEach(b,function(b){var d=f in a?a[f]:b.getAttribute(g)||b.getAttribute(f);if(d){var e=b.getAttribute(v),d=e?[d].concat(e.split(/\s*,\s*/)):[d];m.push({node:b,types:d})}});return this._instantiate(m,a,d)},_instantiate:function(b,
a,d,f){function e(b){!a._started&&!d.noStart&&x.forEach(b,function(a){"function"===typeof a.startup&&!a._started&&a.startup()});return b}b=x.map(b,function(b){var e=b.ctor||G(b.types,d.contextRequire);if(!e)throw Error("Unable to resolve constructor for: '"+b.types.join()+"'");return this.construct(e,b.node,a,d,b.scripts,b.inherited)},this);return f?P(b).then(e):e(b)},construct:function(b,a,d,f,e,g){function v(a){u&&s.setObject(u,a);for(l=0;l<w.length;l++)J[w[l].advice||"after"](a,w[l].method,s.hitch(a,
w[l].func),!0);for(l=0;l<H.length;l++)H[l].call(a);for(l=0;l<A.length;l++)a.watch(A[l].prop,A[l].func);for(l=0;l<B.length;l++)R(a,B[l].event,B[l].func);return a}var m=b&&b.prototype;f=f||{};var p={};f.defaults&&s.mixin(p,f.defaults);g&&s.mixin(p,g);var r;E("dom-attributes-explicit")?r=a.attributes:E("dom-attributes-specified-flag")?r=x.filter(a.attributes,function(a){return a.specified}):(g=(/^input$|^img$/i.test(a.nodeName)?a:a.cloneNode(!1)).outerHTML.replace(/=[^\s"']+|="[^"]*"|='[^']*'/g,"").replace(/^\s*<[a-zA-Z0-9]*\s*/,
"").replace(/\s*>.*$/,""),r=x.map(g.split(/\s+/),function(b){var d=b.toLowerCase();return{name:b,value:"LI"==a.nodeName&&"value"==b||"enctype"==d?a.getAttribute(d):a.getAttributeNode(d).value}}));var k=f.scope||y._scopeName;g="data-"+k+"-";var c={};"dojo"!==k&&(c[g+"props"]="data-dojo-props",c[g+"type"]="data-dojo-type",c[g+"mixins"]="data-dojo-mixins",c[k+"type"]="dojotype",c[g+"id"]="data-dojo-id");for(var l=0,h,k=[],u,q;h=r[l++];){var n=h.name,t=n.toLowerCase();h=h.value;switch(c[t]||t){case "data-dojo-type":case "dojotype":case "data-dojo-mixins":break;
case "data-dojo-props":q=h;break;case "data-dojo-id":case "jsid":u=h;break;case "data-dojo-attach-point":case "dojoattachpoint":p.dojoAttachPoint=h;break;case "data-dojo-attach-event":case "dojoattachevent":p.dojoAttachEvent=h;break;case "class":p["class"]=a.className;break;case "style":p.style=a.style&&a.style.cssText;break;default:if(n in m||(n=T(b)[t]||n),n in m)switch(typeof m[n]){case "string":p[n]=h;break;case "number":p[n]=h.length?Number(h):NaN;break;case "boolean":p[n]="false"!=h.toLowerCase();
break;case "function":""===h||-1!=h.search(/[^\w\.]+/i)?p[n]=new Function(h):p[n]=s.getObject(h,!1)||new Function(h);k.push(n);break;default:t=m[n],p[n]=t&&"length"in t?h?h.split(/\s*,\s*/):[]:t instanceof Date?""==h?new Date(""):"now"==h?new Date:Q.fromISOString(h):t instanceof O?y.baseUrl+h:F(h)}else p[n]=h}}for(r=0;r<k.length;r++)c=k[r].toLowerCase(),a.removeAttribute(c),a[c]=null;if(q)try{q=F.call(f.propsThis,"{"+q+"}"),s.mixin(p,q)}catch(z){throw Error(z.toString()+" in data-dojo-props\x3d'"+
q+"'");}s.mixin(p,d);e||(e=b&&(b._noScript||m._noScript)?[]:K("\x3e script[type^\x3d'dojo/']",a));var w=[],H=[],A=[],B=[];if(e)for(l=0;l<e.length;l++)c=e[l],a.removeChild(c),d=c.getAttribute(g+"event")||c.getAttribute("event"),f=c.getAttribute(g+"prop"),q=c.getAttribute(g+"method"),k=c.getAttribute(g+"advice"),r=c.getAttribute("type"),c=this._functionFromScript(c,g),d?"dojo/connect"==r?w.push({method:d,func:c}):"dojo/on"==r?B.push({event:d,func:c}):p[d]=c:"dojo/aspect"==r?w.push({method:q,advice:k,
func:c}):"dojo/watch"==r?A.push({prop:f,func:c}):H.push(c);b=(e=b.markupFactory||m.markupFactory)?e(p,a,b):new b(p,a);return b.then?b.then(v):v(b)},scan:function(b,a){function d(a){if(!a.inherited){a.inherited={};var b=a.node,e=d(a.parent),b={dir:b.getAttribute("dir")||e.dir,lang:b.getAttribute("lang")||e.lang,textDir:b.getAttribute(r)||e.textDir},c;for(c in b)b[c]&&(a.inherited[c]=b[c])}return a.inherited}var f=[],e=[],g={},s=(a.scope||y._scopeName)+"Type",m="data-"+(a.scope||y._scopeName)+"-",p=
m+"type",r=m+"textdir",m=m+"mixins",k=b.firstChild,c=a.inherited;if(!c){var l=function(a,b){return a.getAttribute&&a.getAttribute(b)||a.parentNode&&l(a.parentNode,b)},c={dir:l(b,"dir"),lang:l(b,"lang"),textDir:l(b,r)},h;for(h in c)c[h]||delete c[h]}for(var c={inherited:c},u,q;;)if(k)if(1!=k.nodeType)k=k.nextSibling;else if(u&&"script"==k.nodeName.toLowerCase())(n=k.getAttribute("type"))&&/^dojo\/\w/i.test(n)&&u.push(k),k=k.nextSibling;else if(q)k=k.nextSibling;else{var n=k.getAttribute(p)||k.getAttribute(s);
h=k.firstChild;if(!n&&(!h||3==h.nodeType&&!h.nextSibling))k=k.nextSibling;else{q=null;if(n){var t=k.getAttribute(m);u=t?[n].concat(t.split(/\s*,\s*/)):[n];try{q=G(u,a.contextRequire)}catch(z){}q||x.forEach(u,function(a){~a.indexOf("/")&&!g[a]&&(g[a]=!0,e[e.length]=a)});t=q&&!q.prototype._noScript?[]:null;c={types:u,ctor:q,parent:c,node:k,scripts:t};c.inherited=d(c);f.push(c)}else c={node:k,scripts:u,parent:c};u=t;q=k.stopParser||q&&q.prototype.stopParser&&!a.template;k=h}}else{if(!c||!c.node)break;
k=c.node.nextSibling;q=!1;c=c.parent;u=c.scripts}var w=new D;e.length?(E("dojo-debug-messages")&&console.warn("WARNING: Modules being Auto-Required: "+e.join(", ")),(a.contextRequire||C)(e,function(){w.resolve(x.filter(f,function(b){if(!b.ctor)try{b.ctor=G(b.types,a.contextRequire)}catch(d){}for(var c=b.parent;c&&!c.types;)c=c.parent;var e=b.ctor&&b.ctor.prototype;b.instantiateChildren=!(e&&e.stopParser&&!a.template);b.instantiate=!c||c.instantiate&&c.instantiateChildren;return b.instantiate}))})):
w.resolve(f);return w.promise},_require:function(b,a){var d=F("{"+b.innerHTML+"}"),f=[],e=[],g=new D,v=a&&a.contextRequire||C,m;for(m in d)f.push(m),e.push(d[m]);v(e,function(){for(var a=0;a<f.length;a++)s.setObject(f[a],arguments[a]);g.resolve(arguments)});return g.promise},_scanAmd:function(b,a){var d=new D,f=d.promise;d.resolve(!0);var e=this;K("script[type\x3d'dojo/require']",b).forEach(function(b){f=f.then(function(){return e._require(b,a)});b.parentNode.removeChild(b)});return f},parse:function(b,
a){var d;!a&&b&&b.rootNode?(a=b,d=a.rootNode):b&&s.isObject(b)&&!("nodeType"in b)?a=b:d=b;d=d?M.byId(d):N.body();a=a||{};var f=a.template?{template:!0}:{},e=[],g=this,v=this._scanAmd(d,a).then(function(){return g.scan(d,a)}).then(function(b){return g._instantiate(b,f,a,!0)}).then(function(a){return e=e.concat(a)}).otherwise(function(a){console.error("dojo/parser::parse() error",a);throw a;});s.mixin(e,v);return e}};y.parser=I;L.parseOnLoad&&S(100,I,"parse");return I});