(function(){var Y=this,ad,F=Y.jQuery,T=Y.$,U=Y.jQuery=Y.$=function(b,a){return new U.fn.init(b,a)},M=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,ae=/^.[^:#\[\.,]*$/;U.fn=U.prototype={init:function(g,b){g=g||document;if(g.nodeType){this[0]=g;this.length=1;this.context=g;return this}if(typeof g==="string"){var d=M.exec(g);if(d&&(d[1]||!b)){if(d[1]){g=U.clean([d[1]],b)}else{var a=document.getElementById(d[3]);if(a&&a.id!=d[3]){return U().find(g)}var e=U(a||[]);e.context=document;e.selector=g;return e}}else{return U(b).find(g)}}else{if(U.isFunction(g)){return U(document).ready(g)}}if(g.selector&&g.context){this.selector=g.selector;this.context=g.context}return this.setArray(U.isArray(g)?g:U.makeArray(g))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(a){return a===ad?Array.prototype.slice.call(this):this[a]},pushStack:function(d,a,e){var b=U(d);b.prevObject=this;b.context=this.context;if(a==="find"){b.selector=this.selector+(this.selector?" ":"")+e}else{if(a){b.selector=this.selector+"."+a+"("+e+")"}}return b},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this},each:function(a,b){return U.each(this,a,b)},index:function(a){return U.inArray(a&&a.jquery?a[0]:a,this)},attr:function(d,a,b){var e=d;if(typeof d==="string"){if(a===ad){return this[0]&&U[b||"attr"](this[0],d)}else{e={};e[d]=a}}return this.each(function(g){for(d in e){U.attr(b?this.style:this,d,U.prop(this,e[d],b,g,d))}})},css:function(b,a){if((b=="width"||b=="height")&&parseFloat(a)<0){a=ad}return this.attr(b,a,"curCSS")},text:function(a){if(typeof a!=="object"&&a!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(a))}var b="";U.each(a||this,function(){U.each(this.childNodes,function(){if(this.nodeType!=8){b+=this.nodeType!=1?this.nodeValue:U.fn.text([this])}})});return b},wrapAll:function(b){if(this[0]){var a=U(b,this[0].ownerDocument).clone();if(this[0].parentNode){a.insertBefore(this[0])}a.map(function(){var d=this;while(d.firstChild){d=d.firstChild}return d}).append(this)}return this},wrapInner:function(a){return this.each(function(){U(this).contents().wrapAll(a)})},wrap:function(a){return this.each(function(){U(this).wrapAll(a)})},append:function(){return this.domManip(arguments,true,function(a){if(this.nodeType==1){this.appendChild(a)}})},prepend:function(){return this.domManip(arguments,true,function(a){if(this.nodeType==1){this.insertBefore(a,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this.nextSibling)})},end:function(){return this.prevObject||U([])},push:[].push,sort:[].sort,splice:[].splice,find:function(b){if(this.length===1){var a=this.pushStack([],"find",b);a.length=0;U.find(b,this[0],a);return a}else{return this.pushStack(U.unique(U.map(this,function(d){return U.find(b,d)})),"find",b)}},clone:function(b){var e=this.map(function(){if(!U.support.noCloneEvent&&!U.isXMLDoc(this)){var h=this.outerHTML;if(!h){var g=this.ownerDocument.createElement("div");g.appendChild(this.cloneNode(true));h=g.innerHTML}return U.clean([h.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(b===true){var a=this.find("*").andSelf(),d=0;e.find("*").andSelf().each(function(){if(this.nodeName!==a[d].nodeName){return}var l=U.data(a[d],"events");for(var g in l){for(var h in l[g]){U.event.add(this,g,l[g][h],l[g][h].data)}}d++})}return e},filter:function(a){return this.pushStack(U.isFunction(a)&&U.grep(this,function(b,d){return a.call(b,d)})||U.multiFilter(a,U.grep(this,function(b){return b.nodeType===1})),"filter",a)},closest:function(d){var a=U.expr.match.POS.test(d)?U(d):null,b=0;return this.map(function(){var e=this;while(e&&e.ownerDocument){if(a?a.index(e)>-1:U(e).is(d)){U.data(e,"closest",b);return e}e=e.parentNode;b++}})},not:function(b){if(typeof b==="string"){if(ae.test(b)){return this.pushStack(U.multiFilter(b,this,true),"not",b)}else{b=U.multiFilter(b,this)}}var a=b.length&&b[b.length-1]!==ad&&!b.nodeType;return this.filter(function(){return a?U.inArray(this,b)<0:this!=b})},add:function(a){return this.pushStack(U.unique(U.merge(this.get(),typeof a==="string"?U(a):U.makeArray(a))))},is:function(a){return !!a&&U.multiFilter(a,this).length>0},hasClass:function(a){return !!a&&this.is("."+a)},val:function(d){if(d===ad){var o=this[0];if(o){if(U.nodeName(o,"option")){return(o.attributes.value||{}).specified?o.value:o.text}if(U.nodeName(o,"select")){var g=o.selectedIndex,b=[],a=o.options,h=o.type=="select-one";if(g<0){return null}for(var m=h?g:0,e=h?g+1:a.length;m<e;m++){var l=a[m];if(l.selected){d=U(l).val();if(h){return d}b.push(d)}}return b}return(o.value||"").replace(/\r/g,"")}return ad}if(typeof d==="number"){d+=""}return this.each(function(){if(this.nodeType!=1){return}if(U.isArray(d)&&/radio|checkbox/.test(this.type)){this.checked=(U.inArray(this.value,d)>=0||U.inArray(this.name,d)>=0)}else{if(U.nodeName(this,"select")){var p=U.makeArray(d);U("option",this).each(function(){this.selected=(U.inArray(this.value,p)>=0||U.inArray(this.text,p)>=0)});if(!p.length){this.selectedIndex=-1}}else{this.value=d}}})},html:function(a){return a===ad?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(a)},replaceWith:function(a){return this.after(a).remove()},eq:function(a){return this.slice(a,+a+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(a){return this.pushStack(U.map(this,function(b,d){return a.call(b,d,b)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(e,a,b){if(this[0]){var g=(this[0].ownerDocument||this[0]).createDocumentFragment(),m=U.clean(e,(this[0].ownerDocument||this[0]),g),h=g.firstChild;if(h){for(var l=0,o=this.length;l<o;l++){b.call(d(this[l],h),this.length>1||l>0?g.cloneNode(true):g)}}if(m){U.each(m,E)}}return this;function d(q,p){return a&&U.nodeName(q,"table")&&U.nodeName(p,"tr")?(q.getElementsByTagName("tbody")[0]||q.appendChild(q.ownerDocument.createElement("tbody"))):q}}};U.fn.init.prototype=U.fn;function E(b,a){if(a.src){U.ajax({url:a.src,async:false,dataType:"script"})}else{U.globalEval(a.text||a.textContent||a.innerHTML||"")}if(a.parentNode){a.parentNode.removeChild(a)}}function af(){return +new Date}U.extend=U.fn.extend=function(){var d=arguments[0]||{},g=1,e=arguments.length,m=false,h;if(typeof d==="boolean"){m=d;d=arguments[1]||{};g=2}if(typeof d!=="object"&&!U.isFunction(d)){d={}}if(e==g){d=this;--g}for(;g<e;g++){if((h=arguments[g])!=null){for(var l in h){var b=d[l],a=h[l];if(d===a){continue}if(m&&a&&typeof a==="object"&&!a.nodeType){d[l]=U.extend(m,b||(a.length!=null?[]:{}),a)}else{if(a!==ad){d[l]=a}}}}}return d};var ai=/z-?index|font-?weight|opacity|zoom|line-?height/i,Q=document.defaultView||{},L=Object.prototype.toString;U.extend({noConflict:function(a){Y.$=T;if(a){Y.jQuery=F}return U},isFunction:function(a){return L.call(a)==="[object Function]"},isArray:function(a){return L.call(a)==="[object Array]"},isXMLDoc:function(a){return a.nodeType===9&&a.documentElement.nodeName!=="HTML"||!!a.ownerDocument&&U.isXMLDoc(a.ownerDocument)},globalEval:function(a){if(a&&/\S/.test(a)){var b=document.getElementsByTagName("head")[0]||document.documentElement,d=document.createElement("script");d.type="text/javascript";if(U.support.scriptEval){d.appendChild(document.createTextNode(a))}else{d.text=a}b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()==b.toUpperCase()},each:function(g,a,h){var l,e=0,d=g.length;if(h){if(d===ad){for(l in g){if(a.apply(g[l],h)===false){break}}}else{for(;e<d;){if(a.apply(g[e++],h)===false){break}}}}else{if(d===ad){for(l in g){if(a.call(g[l],l,g[l])===false){break}}}else{for(var b=g[0];e<d&&a.call(b,e,b)!==false;b=g[++e]){}}}return g},prop:function(b,a,d,e,g){if(U.isFunction(a)){a=a.call(b,e)}return typeof a==="number"&&d=="curCSS"&&!ai.test(g)?a+"px":a},className:{add:function(b,a){U.each((a||"").split(/\s+/),function(e,d){if(b.nodeType==1&&!U.className.has(b.className,d)){b.className+=(b.className?" ":"")+d}})},remove:function(b,a){if(b.nodeType==1){b.className=a!==ad?U.grep(b.className.split(/\s+/),function(d){return !U.className.has(a,d)}).join(" "):""}},has:function(a,b){return a&&U.inArray(b,(a.className||a).toString().split(/\s+/))>-1}},swap:function(b,d,a){var g={};for(var e in d){g[e]=b.style[e];b.style[e]=d[e]}a.call(b);for(var e in d){b.style[e]=g[e]}},css:function(g,l,d,m){if(l=="width"||l=="height"){var a,h={position:"absolute",visibility:"hidden",display:"block"},b=l=="width"?["Left","Right"]:["Top","Bottom"];function e(){a=l=="width"?g.offsetWidth:g.offsetHeight;if(m==="border"){return}U.each(b,function(){if(!m){a-=parseFloat(U.curCSS(g,"padding"+this,true))||0}if(m==="margin"){a+=parseFloat(U.curCSS(g,"margin"+this,true))||0}else{a-=parseFloat(U.curCSS(g,"border"+this+"Width",true))||0}})}if(g.offsetWidth!==0){e()}else{U.swap(g,h,e)}return Math.max(0,Math.round(a))}return U.curCSS(g,l,d)},curCSS:function(g,m,l){var b,o=g.style;if(m=="opacity"&&!U.support.opacity){b=U.attr(o,"opacity");return b==""?"1":b}if(m.match(/float/i)){m=H}if(!l&&o&&o[m]){b=o[m]}else{if(Q.getComputedStyle){if(m.match(/float/i)){m="float"}m=m.replace(/([A-Z])/g,"-$1").toLowerCase();var a=Q.getComputedStyle(g,null);if(a){b=a.getPropertyValue(m)}if(m=="opacity"&&b==""){b="1"}}else{if(g.currentStyle){var e=m.replace(/\-(\w)/g,function(q,p){return p.toUpperCase()});b=g.currentStyle[m]||g.currentStyle[e];if(!/^\d+(px)?$/i.test(b)&&/^\d/.test(b)){var h=o.left,d=g.runtimeStyle.left;g.runtimeStyle.left=g.currentStyle.left;o.left=b||0;b=o.pixelLeft+"px";o.left=h;g.runtimeStyle.left=d}}}}return b},clean:function(l,b,e){b=b||document;if(typeof b.createElement==="undefined"){b=b.ownerDocument||b[0]&&b[0].ownerDocument||document}if(!e&&l.length===1&&typeof l[0]==="string"){var g=/^<(\w+)\s*\/?>$/.exec(l[0]);if(g){return[b.createElement(g[1])]}}var h=[],m=[],a=b.createElement("div");U.each(l,function(r,o){if(typeof o==="number"){o+=""}if(!o){return}if(typeof o==="string"){o=o.replace(/(<(\w+)[^>]*?)\/>/g,function(w,v,z){return z.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?w:v+"></"+z+">"});var s=o.replace(/^\s+/,"").substring(0,10).toLowerCase();var q=!s.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!s.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||s.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!s.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!s.indexOf("<td")||!s.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!s.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!U.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];a.innerHTML=q[1]+o+q[2];while(q[0]--){a=a.lastChild}if(!U.support.tbody){var p=/<tbody/i.test(o),t=!s.indexOf("<table")&&!p?a.firstChild&&a.firstChild.childNodes:q[1]=="<table>"&&!p?a.childNodes:[];for(var u=t.length-1;u>=0;--u){if(U.nodeName(t[u],"tbody")&&!t[u].childNodes.length){t[u].parentNode.removeChild(t[u])}}}if(!U.support.leadingWhitespace&&/^\s/.test(o)){a.insertBefore(b.createTextNode(o.match(/^\s*/)[0]),a.firstChild)}o=U.makeArray(a.childNodes)}if(o.nodeType){h.push(o)}else{h=U.merge(h,o)}});if(e){for(var d=0;h[d];d++){if(U.nodeName(h[d],"script")&&(!h[d].type||h[d].type.toLowerCase()==="text/javascript")){m.push(h[d].parentNode?h[d].parentNode.removeChild(h[d]):h[d])}else{if(h[d].nodeType===1){h.splice.apply(h,[d+1,0].concat(U.makeArray(h[d].getElementsByTagName("script"))))}e.appendChild(h[d])}}return m}return h},attr:function(d,h,b){if(!d||d.nodeType==3||d.nodeType==8){return ad}var g=!U.isXMLDoc(d),a=b!==ad;h=g&&U.props[h]||h;if(d.tagName){var l=/href|src|style/.test(h);if(h=="selected"&&d.parentNode){d.parentNode.selectedIndex}if(h in d&&g&&!l){if(a){if(h=="type"&&U.nodeName(d,"input")&&d.parentNode){throw"type property can't be changed"}d[h]=b}if(U.nodeName(d,"form")&&d.getAttributeNode(h)){return d.getAttributeNode(h).nodeValue}if(h=="tabIndex"){var e=d.getAttributeNode("tabIndex");return e&&e.specified?e.value:d.nodeName.match(/(button|input|object|select|textarea)/i)?0:d.nodeName.match(/^(a|area)$/i)&&d.href?0:ad}return d[h]}if(!U.support.style&&g&&h=="style"){return U.attr(d.style,"cssText",b)}if(a){d.setAttribute(h,""+b)}var m=!U.support.hrefNormalized&&g&&l?d.getAttribute(h,2):d.getAttribute(h);return m===null?ad:m}if(!U.support.opacity&&h=="opacity"){if(a){d.zoom=1;d.filter=(d.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(b)+""=="NaN"?"":"alpha(opacity="+b*100+")")}return d.filter&&d.filter.indexOf("opacity=")>=0?(parseFloat(d.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}h=h.replace(/-([a-z])/ig,function(p,o){return o.toUpperCase()});if(a){d[h]=b}return d[h]},trim:function(a){return(a||"").replace(/^\s+|\s+$/g,"")},makeArray:function(a){var d=[];if(a!=null){var b=a.length;if(b==null||typeof a==="string"||U.isFunction(a)||a.setInterval){d[0]=a}else{while(b){d[--b]=a[b]}}}return d},inArray:function(b,a){for(var e=0,d=a.length;e<d;e++){if(a[e]===b){return e}}return -1},merge:function(b,g){var e=0,d,a=b.length;if(!U.support.getAll){while((d=g[e++])!=null){if(d.nodeType!=8){b[a++]=d}}}else{while((d=g[e++])!=null){b[a++]=d}}return b},unique:function(a){var h=[],l={};try{for(var g=0,e=a.length;g<e;g++){var b=U.data(a[g]);if(!l[b]){l[b]=true;h.push(a[g])}}}catch(d){h=a}return h},grep:function(g,a,h){var e=[];for(var d=0,b=g.length;d<b;d++){if(!h!=!a(g[d],d)){e.push(g[d])}}return e},map:function(h,a){var g=[];for(var e=0,d=h.length;e<d;e++){var b=a(h[e],e);if(b!=null){g[g.length]=b}}return g.concat.apply([],g)}});var O=navigator.userAgent.toLowerCase();U.browser={version:(O.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(O),opera:/opera/.test(O),msie:/msie/.test(O)&&!/opera/.test(O),mozilla:/mozilla/.test(O)&&!/(compatible|webkit)/.test(O)};U.each({parent:function(a){return a.parentNode},parents:function(a){return U.dir(a,"parentNode")},next:function(a){return U.nth(a,2,"nextSibling")},prev:function(a){return U.nth(a,2,"previousSibling")},nextAll:function(a){return U.dir(a,"nextSibling")},prevAll:function(a){return U.dir(a,"previousSibling")},siblings:function(a){return U.sibling(a.parentNode.firstChild,a)},children:function(a){return U.sibling(a.firstChild)},contents:function(a){return U.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:U.makeArray(a.childNodes)}},function(b,a){U.fn[b]=function(e){var d=U.map(this,a);if(e&&typeof e=="string"){d=U.multiFilter(e,d)}return this.pushStack(U.unique(d),b,e)}});U.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(b,a){U.fn[b]=function(m){var g=[],d=U(m);for(var e=0,l=d.length;e<l;e++){var h=(e>0?this.clone(true):this).get();U.fn[a].apply(U(d[e]),h);g=g.concat(h)}return this.pushStack(g,b,m)}});U.each({removeAttr:function(a){U.attr(this,a,"");if(this.nodeType==1){this.removeAttribute(a)}},addClass:function(a){U.className.add(this,a)},removeClass:function(a){U.className.remove(this,a)},toggleClass:function(a,b){if(typeof b!=="boolean"){b=!U.className.has(this,a)}U.className[b?"add":"remove"](this,a)},remove:function(a){if(!a||U.filter(a,[this]).length){U("*",this).add([this]).each(function(){U.event.remove(this);U.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){U(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(b,a){U.fn[b]=function(){return this.each(a,arguments)}});function aa(b,a){return b[0]&&parseInt(U.curCSS(b[0],a,true),10)||0}var ac="jQuery"+af(),I=0,S={};U.extend({cache:{},data:function(d,e,b){d=d==Y?S:d;var a=d[ac];if(!a){a=d[ac]=++I}if(e&&!U.cache[a]){U.cache[a]={}}if(b!==ad){U.cache[a][e]=b}return e?U.cache[a][e]:a},removeData:function(d,e){d=d==Y?S:d;var a=d[ac];if(e){if(U.cache[a]){delete U.cache[a][e];e="";for(e in U.cache[a]){break}if(!e){U.removeData(d)}}}else{try{delete d[ac]}catch(b){if(d.removeAttribute){d.removeAttribute(ac)}}delete U.cache[a]}},queue:function(d,e,a){if(d){e=(e||"fx")+"queue";var b=U.data(d,e);if(!b||U.isArray(a)){b=U.data(d,e,U.makeArray(a))}else{if(a){b.push(a)}}}return b},dequeue:function(a,b){var e=U.queue(a,b),d=e.shift();if(!b||b==="fx"){d=e[0]}if(d!==ad){d.call(a)}}});U.fn.extend({data:function(e,b){var a=e.split(".");a[1]=a[1]?"."+a[1]:"";if(b===ad){var d=this.triggerHandler("getData"+a[1]+"!",[a[0]]);if(d===ad&&this.length){d=U.data(this[0],e)}return d===ad&&a[1]?this.data(a[0]):d}else{return this.trigger("setData"+a[1]+"!",[a[0],b]).each(function(){U.data(this,e,b)})}},removeData:function(a){return this.each(function(){U.removeData(this,a)})},queue:function(b,a){if(typeof b!=="string"){a=b;b="fx"}if(a===ad){return U.queue(this[0],b)}return this.each(function(){var d=U.queue(this,b,a);if(b=="fx"&&d.length==1){d[0].call(this)}})},dequeue:function(a){return this.each(function(){U.dequeue(this,a)})}});(function(){var b=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,m=0,r=Object.prototype.toString;var t=function(z,ak,au,at){au=au||[];ak=ak||document;if(ak.nodeType!==1&&ak.nodeType!==9){return[]}if(!z||typeof z!=="string"){return au}var w=[],C,ap,am,al,ar,D,B=true;b.lastIndex=0;while((C=b.exec(z))!==null){w.push(C[1]);if(C[2]){D=RegExp.rightContext;break}}if(w.length>1&&l.exec(z)){if(w.length===2&&q.relative[w[0]]){ap=p(w[0]+w[1],ak)}else{ap=q.relative[w[0]]?[ak]:t(w.shift(),ak);while(w.length){z=w.shift();if(q.relative[z]){z+=w.shift()}ap=p(z,ap)}}}else{var aq=at?{expr:w.pop(),set:u(at)}:t.find(w.pop(),w.length===1&&ak.parentNode?ak.parentNode:ak,d(ak));ap=t.filter(aq.expr,aq.set);if(w.length>0){am=u(ap)}else{B=false}while(w.length){var an=w.pop(),ao=an;if(!q.relative[an]){an=""}else{ao=w.pop()}if(ao==null){ao=ak}q.relative[an](am,ao,d(ak))}}if(!am){am=ap}if(!am){throw"Syntax error, unrecognized expression: "+(an||z)}if(r.call(am)==="[object Array]"){if(!B){au.push.apply(au,am)}else{if(ak.nodeType===1){for(var v=0;am[v]!=null;v++){if(am[v]&&(am[v]===true||am[v].nodeType===1&&o(ak,am[v]))){au.push(ap[v])}}}else{for(var v=0;am[v]!=null;v++){if(am[v]&&am[v].nodeType===1){au.push(ap[v])}}}}}else{u(am,au)}if(D){t(D,ak,au,at);if(s){hasDuplicate=false;au.sort(s);if(hasDuplicate){for(var v=1;v<au.length;v++){if(au[v]===au[v-1]){au.splice(v--,1)}}}}}return au};t.matches=function(w,v){return t(w,null,null,v)};t.find=function(v,al,am){var w,B;if(!v){return[]}for(var C=0,D=q.order.length;C<D;C++){var z=q.order[C],B;if((B=q.match[z].exec(v))){var ak=RegExp.leftContext;if(ak.substr(ak.length-1)!=="\\"){B[1]=(B[1]||"").replace(/\\/g,"");w=q.find[z](B,al,am);if(w!=null){v=v.replace(q.match[z],"");break}}}}if(!w){w=al.getElementsByTagName("*")}return{set:w,expr:v}};t.filter=function(ar,at,ao,C){var D=ar,am=[],v=at,z,al,w=at&&at[0]&&d(at[0]);while(ar&&at.length){for(var au in q.filter){if((z=q.match[au].exec(ar))!=null){var ak=q.filter[au],an,ap;al=false;if(v==am){am=[]}if(q.preFilter[au]){z=q.preFilter[au](z,v,ao,am,C,w);if(!z){al=an=true}else{if(z===true){continue}}}if(z){for(var B=0;(ap=v[B])!=null;B++){if(ap){an=ak(ap,z,B,v);var aq=C^!!an;if(ao&&an!=null){if(aq){al=true}else{v[B]=false}}else{if(aq){am.push(ap);al=true}}}}}if(an!==ad){if(!ao){v=am}ar=ar.replace(q.match[au],"");if(!al){return[]}break}}}if(ar==D){if(al==null){throw"Syntax error, unrecognized expression: "+ar}else{break}}D=ar}return v};var q=t.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(v){return v.getAttribute("href")}},relative:{"+":function(v,al,w){var B=typeof al==="string",am=B&&!/\W/.test(al),z=B&&!am;if(am&&!w){al=al.toUpperCase()}for(var C=0,D=v.length,ak;C<D;C++){if((ak=v[C])){while((ak=ak.previousSibling)&&ak.nodeType!==1){}v[C]=z||ak&&ak.nodeName===al?ak||false:ak===al}}if(z){t.filter(al,v,true)}},">":function(D,z,C){var al=typeof z==="string";if(al&&!/\W/.test(z)){z=C?z:z.toUpperCase();for(var w=0,B=D.length;w<B;w++){var ak=D[w];if(ak){var v=ak.parentNode;D[w]=v.nodeName===z?v:false}}}else{for(var w=0,B=D.length;w<B;w++){var ak=D[w];if(ak){D[w]=al?ak.parentNode:ak.parentNode===z}}if(al){t.filter(z,D,true)}}},"":function(v,z,C){var w=m++,B=a;if(!z.match(/\W/)){var D=z=C?z:z.toUpperCase();B=e}B("parentNode",z,w,v,D,C)},"~":function(v,z,C){var w=m++,B=a;if(typeof z==="string"&&!z.match(/\W/)){var D=z=C?z:z.toUpperCase();B=e}B("previousSibling",z,w,v,D,C)}},find:{ID:function(z,w,v){if(typeof w.getElementById!=="undefined"&&!v){var B=w.getElementById(z[1]);return B?[B]:[]}},NAME:function(w,D,C){if(typeof D.getElementsByName!=="undefined"){var z=[],ak=D.getElementsByName(w[1]);for(var v=0,B=ak.length;v<B;v++){if(ak[v].getAttribute("name")===w[1]){z.push(ak[v])}}return z.length===0?null:z}},TAG:function(w,v){return v.getElementsByTagName(w[1])}},preFilter:{CLASS:function(v,z,w,B,D,C){v=" "+v[1].replace(/\\/g,"")+" ";if(C){return v}for(var al=0,ak;(ak=z[al])!=null;al++){if(ak){if(D^(ak.className&&(" "+ak.className+" ").indexOf(v)>=0)){if(!w){B.push(ak)}}else{if(w){z[al]=false}}}}return false},ID:function(v){return v[1].replace(/\\/g,"")},TAG:function(w,z){for(var v=0;z[v]===false;v++){}return z[v]&&d(z[v])?w[1]:w[1].toUpperCase()},CHILD:function(w){if(w[1]=="nth"){var v=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(w[2]=="even"&&"2n"||w[2]=="odd"&&"2n+1"||!/\D/.test(w[2])&&"0n+"+w[2]||w[2]);w[2]=(v[1]+(v[2]||1))-0;w[3]=v[3]-0}w[0]=m++;return w},ATTR:function(ak,z,w,B,D,C){var v=ak[1].replace(/\\/g,"");if(!C&&q.attrMap[v]){ak[1]=q.attrMap[v]}if(ak[2]==="~="){ak[4]=" "+ak[4]+" "}return ak},PSEUDO:function(D,z,w,B,C){if(D[1]==="not"){if(D[3].match(b).length>1||/^\w/.test(D[3])){D[3]=t(D[3],null,null,z)}else{var v=t.filter(D[3],z,w,true^C);if(!w){B.push.apply(B,v)}return false}}else{if(q.match.POS.test(D[0])||q.match.CHILD.test(D[0])){return true}}return D},POS:function(v){v.unshift(true);return v}},filters:{enabled:function(v){return v.disabled===false&&v.type!=="hidden"},disabled:function(v){return v.disabled===true},checked:function(v){return v.checked===true},selected:function(v){v.parentNode.selectedIndex;return v.selected===true},parent:function(v){return !!v.firstChild},empty:function(v){return !v.firstChild},has:function(v,w,z){return !!t(z[3],v).length},header:function(v){return/h\d/i.test(v.nodeName)},text:function(v){return"text"===v.type},radio:function(v){return"radio"===v.type},checkbox:function(v){return"checkbox"===v.type},file:function(v){return"file"===v.type},password:function(v){return"password"===v.type},submit:function(v){return"submit"===v.type},image:function(v){return"image"===v.type},reset:function(v){return"reset"===v.type},button:function(v){return"button"===v.type||v.nodeName.toUpperCase()==="BUTTON"},input:function(v){return/input|select|textarea|button/i.test(v.nodeName)}},setFilters:{first:function(v,w){return w===0},last:function(w,z,B,v){return z===v.length-1},even:function(v,w){return w%2===0},odd:function(v,w){return w%2===1},lt:function(v,w,z){return w<z[3]-0},gt:function(v,w,z){return w>z[3]-0},nth:function(v,w,z){return z[3]-0==w},eq:function(v,w,z){return z[3]-0==w}},filter:{PSEUDO:function(D,w,v,C){var z=w[1],al=q.filters[z];if(al){return al(D,v,w,C)}else{if(z==="contains"){return(D.textContent||D.innerText||"").indexOf(w[3])>=0}else{if(z==="not"){var ak=w[3];for(var v=0,B=ak.length;v<B;v++){if(ak[v]===D){return false}}return true}}}},CHILD:function(al,C){var w=C[1],ak=al;switch(w){case"only":case"first":while(ak=ak.previousSibling){if(ak.nodeType===1){return false}}if(w=="first"){return true}ak=al;case"last":while(ak=ak.nextSibling){if(ak.nodeType===1){return false}}return true;case"nth":var D=C[2],am=C[3];if(D==1&&am==0){return true}var z=C[0],an=al.parentNode;if(an&&(an.sizcache!==z||!al.nodeIndex)){var B=0;for(ak=an.firstChild;ak;ak=ak.nextSibling){if(ak.nodeType===1){ak.nodeIndex=++B}}an.sizcache=z}var v=al.nodeIndex-am;if(D==0){return v==0}else{return(v%D==0&&v/D>=0)}}},ID:function(v,w){return v.nodeType===1&&v.getAttribute("id")===w},TAG:function(v,w){return(w==="*"&&v.nodeType===1)||v.nodeName===w},CLASS:function(v,w){return(" "+(v.className||v.getAttribute("class"))+" ").indexOf(w)>-1},ATTR:function(D,v){var w=v[1],B=q.attrHandle[w]?q.attrHandle[w](D):D[w]!=null?D[w]:D.getAttribute(w),C=B+"",ak=v[2],z=v[4];return B==null?ak==="!=":ak==="="?C===z:ak==="*="?C.indexOf(z)>=0:ak==="~="?(" "+C+" ").indexOf(z)>=0:!z?C&&B!==false:ak==="!="?C!=z:ak==="^="?C.indexOf(z)===0:ak==="$="?C.substr(C.length-z.length)===z:ak==="|="?C===z||C.substr(0,z.length+1)===z+"-":false},POS:function(D,z,w,C){var B=z[2],v=q.setFilters[B];if(v){return v(D,w,z,C)}}}};var l=q.match.POS;for(var g in q.match){q.match[g]=RegExp(q.match[g].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var u=function(v,w){v=Array.prototype.slice.call(v);if(w){w.push.apply(w,v);return w}return v};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(h){u=function(C,v){var z=v||[];if(r.call(C)==="[object Array]"){Array.prototype.push.apply(z,C)}else{if(typeof C.length==="number"){for(var w=0,B=C.length;w<B;w++){z.push(C[w])}}else{for(var w=0;C[w];w++){z.push(C[w])}}}return z}}var s;if(document.documentElement.compareDocumentPosition){s=function(w,z){var v=w.compareDocumentPosition(z)&4?-1:w===z?0:1;if(v===0){hasDuplicate=true}return v}}else{if("sourceIndex" in document.documentElement){s=function(w,z){var v=w.sourceIndex-z.sourceIndex;if(v===0){hasDuplicate=true}return v}}else{if(document.createRange){s=function(v,z){var w=v.ownerDocument.createRange(),B=z.ownerDocument.createRange();w.selectNode(v);w.collapse(true);B.selectNode(z);B.collapse(true);var C=w.compareBoundaryPoints(Range.START_TO_END,B);if(C===0){hasDuplicate=true}return C}}}}(function(){var w=document.createElement("form"),v="script"+(new Date).getTime();w.innerHTML="<input name='"+v+"'/>";var z=document.documentElement;z.insertBefore(w,z.firstChild);if(!!document.getElementById(v)){q.find.ID=function(ak,D,C){if(typeof D.getElementById!=="undefined"&&!C){var B=D.getElementById(ak[1]);return B?B.id===ak[1]||typeof B.getAttributeNode!=="undefined"&&B.getAttributeNode("id").nodeValue===ak[1]?[B]:ad:[]}};q.filter.ID=function(C,B){var D=typeof C.getAttributeNode!=="undefined"&&C.getAttributeNode("id");return C.nodeType===1&&D&&D.nodeValue===B}}z.removeChild(w)})();(function(){var v=document.createElement("div");v.appendChild(document.createComment(""));if(v.getElementsByTagName("*").length>0){q.find.TAG=function(B,C){var D=C.getElementsByTagName(B[1]);if(B[1]==="*"){var w=[];for(var z=0;D[z];z++){if(D[z].nodeType===1){w.push(D[z])}}D=w}return D}}v.innerHTML="<a href='#'></a>";if(v.firstChild&&typeof v.firstChild.getAttribute!=="undefined"&&v.firstChild.getAttribute("href")!=="#"){q.attrHandle.href=function(w){return w.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var w=t,v=document.createElement("div");v.innerHTML="<p class='TEST'></p>";if(v.querySelectorAll&&v.querySelectorAll(".TEST").length===0){return}t=function(D,ak,B,z){ak=ak||document;if(!z&&ak.nodeType===9&&!d(ak)){try{return u(ak.querySelectorAll(D),B)}catch(C){}}return w(D,ak,B,z)};t.find=w.find;t.filter=w.filter;t.selectors=w.selectors;t.matches=w.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var v=document.createElement("div");v.innerHTML="<div class='test e'></div><div class='test'></div>";if(v.getElementsByClassName("e").length===0){return}v.lastChild.className="e";if(v.getElementsByClassName("e").length===1){return}q.order.splice(1,0,"CLASS");q.find.CLASS=function(B,z,w){if(typeof z.getElementsByClassName!=="undefined"&&!w){return z.getElementsByClassName(B[1])}}})()}function e(ak,w,z,am,v,an){var ao=ak=="previousSibling"&&!an;for(var C=0,D=am.length;C<D;C++){var al=am[C];if(al){if(ao&&al.nodeType===1){al.sizcache=z;al.sizset=C}al=al[ak];var B=false;while(al){if(al.sizcache===z){B=am[al.sizset];break}if(al.nodeType===1&&!an){al.sizcache=z;al.sizset=C}if(al.nodeName===w){B=al;break}al=al[ak]}am[C]=B}}}function a(ak,w,z,am,v,an){var ao=ak=="previousSibling"&&!an;for(var C=0,D=am.length;C<D;C++){var al=am[C];if(al){if(ao&&al.nodeType===1){al.sizcache=z;al.sizset=C}al=al[ak];var B=false;while(al){if(al.sizcache===z){B=am[al.sizset];break}if(al.nodeType===1){if(!an){al.sizcache=z;al.sizset=C}if(typeof w!=="string"){if(al===w){B=true;break}}else{if(t.filter(w,[al]).length>0){B=al;break}}}al=al[ak]}am[C]=B}}}var o=document.compareDocumentPosition?function(v,w){return v.compareDocumentPosition(w)&16}:function(v,w){return v!==w&&(v.contains?v.contains(w):true)};var d=function(v){return v.nodeType===9&&v.documentElement.nodeName!=="HTML"||!!v.ownerDocument&&d(v.ownerDocument)};var p=function(B,D){var v=[],al="",ak,w=D.nodeType?[D]:D;while((ak=q.match.PSEUDO.exec(B))){al+=ak[0];B=B.replace(q.match.PSEUDO,"")}B=q.relative[B]?B+"*":B;for(var C=0,z=w.length;C<z;C++){t(B,w[C],v)}return t.filter(al,v)};U.find=t;U.filter=t.filter;U.expr=t.selectors;U.expr[":"]=U.expr.filters;t.selectors.filters.hidden=function(v){return v.offsetWidth===0||v.offsetHeight===0};t.selectors.filters.visible=function(v){return v.offsetWidth>0||v.offsetHeight>0};t.selectors.filters.animated=function(v){return U.grep(U.timers,function(w){return v===w.elem}).length};U.multiFilter=function(v,z,w){if(w){v=":not("+v+")"}return t.matches(v,z)};U.dir=function(w,z){var B=[],v=w[z];while(v&&v!=document){if(v.nodeType==1){B.push(v)}v=v[z]}return B};U.nth=function(C,B,w,v){B=B||1;var z=0;for(;C;C=C[w]){if(C.nodeType==1&&++z==B){break}}return C};U.sibling=function(v,w){var z=[];for(;v;v=v.nextSibling){if(v.nodeType==1&&v!=w){z.push(v)}}return z};return;Y.Sizzle=t})();U.event={add:function(d,h,e,a){if(d.nodeType==3||d.nodeType==8){return}if(d.setInterval&&d!=Y){d=Y}if(!e.guid){e.guid=this.guid++}if(a!==ad){var g=e;e=this.proxy(g);e.data=a}var l=U.data(d,"events")||U.data(d,"events",{}),b=U.data(d,"handle")||U.data(d,"handle",function(){return typeof U!=="undefined"&&!U.event.triggered?U.event.handle.apply(arguments.callee.elem,arguments):ad});b.elem=d;U.each(h.split(/\s+/),function(q,p){var o=p.split(".");p=o.shift();e.type=o.slice().sort().join(".");var m=l[p];if(U.event.specialAll[p]){U.event.specialAll[p].setup.call(d,a,o)}if(!m){m=l[p]={};if(!U.event.special[p]||U.event.special[p].setup.call(d,a,o)===false){if(d.addEventListener){d.addEventListener(p,b,false)}else{if(d.attachEvent){d.attachEvent("on"+p,b)}}}}m[e.guid]=e;U.event.global[p]=true});d=null},guid:1,global:{},remove:function(b,g,d){if(b.nodeType==3||b.nodeType==8){return}var h=U.data(b,"events"),l,m;if(h){if(g===ad||(typeof g==="string"&&g.charAt(0)==".")){for(var e in h){this.remove(b,e+(g||""))}}else{if(g.type){d=g.handler;g=g.type}U.each(g.split(/\s+/),function(s,q){var o=q.split(".");q=o.shift();var r=RegExp("(^|\\.)"+o.slice().sort().join(".*\\.")+"(\\.|$)");if(h[q]){if(d){delete h[q][d.guid]}else{for(var p in h[q]){if(r.test(h[q][p].type)){delete h[q][p]}}}if(U.event.specialAll[q]){U.event.specialAll[q].teardown.call(b,o)}for(l in h[q]){break}if(!l){if(!U.event.special[q]||U.event.special[q].teardown.call(b,o)===false){if(b.removeEventListener){b.removeEventListener(q,U.data(b,"handle"),false)}else{if(b.detachEvent){b.detachEvent("on"+q,U.data(b,"handle"))}}}l=null;delete h[q]}}})}for(l in h){break}if(!l){var a=U.data(b,"handle");if(a){a.elem=null}U.removeData(b,"events");U.removeData(b,"handle")}}},trigger:function(e,b,g,m){var h=e.type||e;if(!m){e=typeof e==="object"?e[ac]?e:U.extend(U.Event(h),e):U.Event(h);if(h.indexOf("!")>=0){e.type=h=h.slice(0,-1);e.exclusive=true}if(!g){e.stopPropagation();if(this.global[h]){U.each(U.cache,function(){if(this.events&&this.events[h]){U.event.trigger(e,b,this.handle.elem)}})}}if(!g||g.nodeType==3||g.nodeType==8){return ad}e.result=ad;e.target=g;b=U.makeArray(b);b.unshift(e)}e.currentTarget=g;var d=U.data(g,"handle");if(d){d.apply(g,b)}if((!g[h]||(U.nodeName(g,"a")&&h=="click"))&&g["on"+h]&&g["on"+h].apply(g,b)===false){e.result=false}if(!m&&g[h]&&!e.isDefaultPrevented()&&!(U.nodeName(g,"a")&&h=="click")){this.triggered=true;try{g[h]()}catch(a){}}this.triggered=false;if(!e.isPropagationStopped()){var l=g.parentNode||g.ownerDocument;if(l){U.event.trigger(e,b,l,true)}}},handle:function(b){var d,m;b=arguments[0]=U.event.fix(b||Y.event);b.currentTarget=this;var a=b.type.split(".");b.type=a.shift();d=!a.length&&!b.exclusive;var e=RegExp("(^|\\.)"+a.slice().sort().join(".*\\.")+"(\\.|$)");m=(U.data(this,"events")||{})[b.type];for(var h in m){var g=m[h];if(d||e.test(g.type)){b.handler=g;b.data=g.data;var l=g.apply(this,arguments);if(l!==ad){b.result=l;if(l===false){b.preventDefault();b.stopPropagation()}}if(b.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(d){if(d[ac]){return d}var g=d;d=U.Event(g);for(var e=this.props.length,a;e;){a=this.props[--e];d[a]=g[a]}if(!d.target){d.target=d.srcElement||document}if(d.target.nodeType==3){d.target=d.target.parentNode}if(!d.relatedTarget&&d.fromElement){d.relatedTarget=d.fromElement==d.target?d.toElement:d.fromElement}if(d.pageX==null&&d.clientX!=null){var b=document.documentElement,h=document.body;d.pageX=d.clientX+(b&&b.scrollLeft||h&&h.scrollLeft||0)-(b.clientLeft||0);d.pageY=d.clientY+(b&&b.scrollTop||h&&h.scrollTop||0)-(b.clientTop||0)}if(!d.which&&((d.charCode||d.charCode===0)?d.charCode:d.keyCode)){d.which=d.charCode||d.keyCode}if(!d.metaKey&&d.ctrlKey){d.metaKey=d.ctrlKey}if(!d.which&&d.button){d.which=(d.button&1?1:(d.button&2?3:(d.button&4?2:0)))}return d},proxy:function(a,b){b=b||function(){return a.apply(this,arguments)};b.guid=a.guid=a.guid||b.guid||this.guid++;return b},special:{ready:{setup:P,teardown:function(){}}},specialAll:{live:{setup:function(b,a){U.event.add(this,a[0],ah)},teardown:function(a){if(a.length){var d=0,b=RegExp("(^|\\.)"+a[0]+"(\\.|$)");U.each((U.data(this,"events").live||{}),function(){if(b.test(this.type)){d++}});if(d<1){U.event.remove(this,a[0],ah)}}}}}};U.Event=function(a){if(!this.preventDefault){return new U.Event(a)}if(a&&a.type){this.originalEvent=a;this.type=a.type}else{this.type=a}this.timeStamp=af();this[ac]=true};function Z(){return false}function J(){return true}U.Event.prototype={preventDefault:function(){this.isDefaultPrevented=J;var a=this.originalEvent;if(!a){return}if(a.preventDefault){a.preventDefault()}a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=J;var a=this.originalEvent;if(!a){return}if(a.stopPropagation){a.stopPropagation()}a.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=J;this.stopPropagation()},isDefaultPrevented:Z,isPropagationStopped:Z,isImmediatePropagationStopped:Z};var aj=function(b){var d=b.relatedTarget;while(d&&d!=this){try{d=d.parentNode}catch(a){d=this}}if(d!=this){b.type=b.data;U.event.handle.apply(this,arguments)}};U.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(a,b){U.event.special[b]={setup:function(){U.event.add(this,a,aj,b)},teardown:function(){U.event.remove(this,a,aj)}}});U.fn.extend({bind:function(b,a,d){return b=="unload"?this.one(b,a,d):this.each(function(){U.event.add(this,b,d||a,d&&a)})},one:function(b,a,d){var e=U.event.proxy(d||a,function(g){U(this).unbind(g,e);return(d||a).apply(this,arguments)});return this.each(function(){U.event.add(this,b,e,d&&a)})},unbind:function(a,b){return this.each(function(){U.event.remove(this,a,b)})},trigger:function(b,a){return this.each(function(){U.event.trigger(b,a,this)})},triggerHandler:function(d,a){if(this[0]){var b=U.Event(d);b.preventDefault();b.stopPropagation();U.event.trigger(b,a,this[0]);return b.result}},toggle:function(a){var d=arguments,b=1;while(b<d.length){U.event.proxy(a,d[b++])}return this.click(U.event.proxy(a,function(e){this.lastToggle=(this.lastToggle||0)%b;e.preventDefault();return d[this.lastToggle++].apply(this,arguments)||false}))},hover:function(b,a){return this.mouseenter(b).mouseleave(a)},ready:function(a){P();if(U.isReady){a.call(document,U)}else{U.readyList.push(a)}return this},live:function(a,b){var d=U.event.proxy(b);d.guid+=this.selector+a;U(document).bind(ab(a,this.selector),this.selector,d);return this},die:function(a,b){U(document).unbind(ab(a,this.selector),b?{guid:b.guid+this.selector+a}:null);return this}});function ah(a){var e=RegExp("(^|\\.)"+a.type+"(\\.|$)"),b=true,d=[];U.each(U.data(this,"events").live||[],function(l,h){if(e.test(h.type)){var g=U(a.target).closest(h.data)[0];if(g){d.push({elem:g,fn:h})}}});d.sort(function(g,h){return U.data(g.elem,"closest")-U.data(h.elem,"closest")});U.each(d,function(){if(this.fn.call(this.elem,a,this.fn.data)===false){return(b=false)}});return b}function ab(a,b){return["live",a,b.replace(/\./g,"`").replace(/ /g,"|")].join(".")}U.extend({isReady:false,readyList:[],ready:function(){if(!U.isReady){U.isReady=true;if(U.readyList){U.each(U.readyList,function(){this.call(document,U)});U.readyList=null}U(document).triggerHandler("ready")}}});var G=false;function P(){if(G){return}G=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);U.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);U.ready()}});if(document.documentElement.doScroll&&Y==Y.top){(function(){if(U.isReady){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}U.ready()})()}}}U.event.add(Y,"load",U.ready)}U.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(a,b){U.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)}});U(Y).bind("unload",function(){for(var a in U.cache){if(a!=1&&U.cache[a].handle){U.event.remove(U.cache[a].handle.elem)}}});(function(){U.support={};var h=document.documentElement,g=document.createElement("script"),a=document.createElement("div"),b="script"+(new Date).getTime();a.style.display="none";a.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var e=a.getElementsByTagName("*"),l=a.getElementsByTagName("a")[0];if(!e||!e.length||!l){return}U.support={leadingWhitespace:a.firstChild.nodeType==3,tbody:!a.getElementsByTagName("tbody").length,objectAll:!!a.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/red/.test(l.getAttribute("style")),hrefNormalized:l.getAttribute("href")==="/a",opacity:l.style.opacity==="0.5",cssFloat:!!l.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};g.type="text/javascript";try{g.appendChild(document.createTextNode("window."+b+"=1;"))}catch(d){}h.insertBefore(g,h.firstChild);if(Y[b]){U.support.scriptEval=true;delete Y[b]}h.removeChild(g);if(a.attachEvent&&a.fireEvent){a.attachEvent("onclick",function(){U.support.noCloneEvent=false;a.detachEvent("onclick",arguments.callee)});a.cloneNode(true).fireEvent("onclick")}U(function(){var m=document.createElement("div");m.style.width=m.style.paddingLeft="1px";document.body.appendChild(m);U.boxModel=U.support.boxModel=m.offsetWidth===2;document.body.removeChild(m).style.display="none"})})();var H=U.support.cssFloat?"cssFloat":"styleFloat";U.props={"for":"htmlFor","class":"className","float":H,cssFloat:H,styleFloat:H,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};U.fn.extend({_load:U.fn.load,load:function(g,b,a){if(typeof g!=="string"){return this._load(g)}var d=g.indexOf(" ");if(d>=0){var l=g.slice(d,g.length);g=g.slice(0,d)}var e="GET";if(b){if(U.isFunction(b)){a=b;b=null}else{if(typeof b==="object"){b=U.param(b);e="POST"}}}var h=this;U.ajax({url:g,type:e,dataType:"html",data:b,complete:function(o,m){if(m=="success"||m=="notmodified"){h.html(l?U("<div/>").append(o.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(l):o.responseText)}if(a){h.each(a,[o.responseText,m,o])}}});return this},serialize:function(){return U.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?U.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(d,b){var a=U(this).val();return a==null?null:U.isArray(a)?U.map(a,function(e,g){return{name:b.name,value:e}}):{name:b.name,value:a}}).get()}});U.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(b,a){U.fn[a]=function(d){return this.bind(a,d)}});var N=af();U.extend({get:function(e,b,a,d){if(U.isFunction(b)){a=b;b=null}return U.ajax({type:"GET",url:e,data:b,success:a,dataType:d})},getScript:function(b,a){return U.get(b,null,a,"script")},getJSON:function(d,b,a){return U.get(d,b,a,"json")},post:function(e,b,a,d){if(U.isFunction(b)){a=b;b={}}return U.ajax({type:"POST",url:e,data:b,success:a,dataType:d})},ajaxSetup:function(a){U.extend(U.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return Y.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(q){q=U.extend(true,q,U.extend(true,{},U.ajaxSettings,q));var a,z=/=\?(&|$)/g,h,b,w=q.type.toUpperCase();if(q.data&&q.processData&&typeof q.data!=="string"){q.data=U.param(q.data)}if(q.dataType=="jsonp"){if(w=="GET"){if(!q.url.match(z)){q.url+=(q.url.match(/\?/)?"&":"?")+(q.jsonp||"callback")+"=?"}}else{if(!q.data||!q.data.match(z)){q.data=(q.data?q.data+"&":"")+(q.jsonp||"callback")+"=?"}}q.dataType="json"}if(q.dataType=="json"&&(q.data&&q.data.match(z)||q.url.match(z))){a="jsonp"+N++;if(q.data){q.data=(q.data+"").replace(z,"="+a+"$1")}q.url=q.url.replace(z,"="+a+"$1");q.dataType="script";Y[a]=function(D){b=D;u();r();Y[a]=ad;try{delete Y[a]}catch(C){}if(v){v.removeChild(e)}}}if(q.dataType=="script"&&q.cache==null){q.cache=false}if(q.cache===false&&w=="GET"){var B=af();var d=q.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+B+"$2");q.url=d+((d==q.url)?(q.url.match(/\?/)?"&":"?")+"_="+B:"")}if(q.data&&w=="GET"){q.url+=(q.url.match(/\?/)?"&":"?")+q.data;q.data=null}if(q.global&&!U.active++){U.event.trigger("ajaxStart")}var l=/^(\w+:)?\/\/([^\/?#]+)/.exec(q.url);if(q.dataType=="script"&&w=="GET"&&l&&(l[1]&&l[1]!=location.protocol||l[2]!=location.host)){var v=document.getElementsByTagName("head")[0];var e=document.createElement("script");e.src=q.url;if(q.scriptCharset){e.charset=q.scriptCharset}if(!a){var o=false;e.onload=e.onreadystatechange=function(){if(!o&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){o=true;u();r();e.onload=e.onreadystatechange=null;v.removeChild(e)}}}v.appendChild(e);return ad}var s=false;var t=q.xhr();if(q.username){t.open(w,q.url,q.async,q.username,q.password)}else{t.open(w,q.url,q.async)}try{if(q.data){t.setRequestHeader("Content-Type",q.contentType)}if(q.ifModified){t.setRequestHeader("If-Modified-Since",U.lastModified[q.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}t.setRequestHeader("X-Requested-With","XMLHttpRequest");t.setRequestHeader("Accept",q.dataType&&q.accepts[q.dataType]?q.accepts[q.dataType]+", */*":q.accepts._default)}catch(g){}if(q.beforeSend&&q.beforeSend(t,q)===false){if(q.global&&!--U.active){U.event.trigger("ajaxStop")}t.abort();return false}if(q.global){U.event.trigger("ajaxSend",[t,q])}var p=function(ak){if(t.readyState==0){if(m){clearInterval(m);m=null;if(q.global&&!--U.active){U.event.trigger("ajaxStop")}}}else{if(!s&&t&&(t.readyState==4||ak=="timeout")){s=true;if(m){clearInterval(m);m=null}h=ak=="timeout"?"timeout":!U.httpSuccess(t)?"error":q.ifModified&&U.httpNotModified(t,q.url)?"notmodified":"success";if(h=="success"){try{b=U.httpData(t,q.dataType,q)}catch(C){h="parsererror"}}if(h=="success"){var D;try{D=t.getResponseHeader("Last-Modified")}catch(C){}if(q.ifModified&&D){U.lastModified[q.url]=D}if(!a){u()}}else{U.handleError(q,t,h)}r();if(ak){t.abort()}if(q.async){t=null}}}};if(q.async){var m=setInterval(p,13);if(q.timeout>0){setTimeout(function(){if(t&&!s){p("timeout")}},q.timeout)}}try{t.send(q.data)}catch(g){U.handleError(q,t,null,g)}if(!q.async){p()}function u(){if(q.success){q.success(b,h)}if(q.global){U.event.trigger("ajaxSuccess",[t,q])}}function r(){if(q.complete){q.complete(t,h)}if(q.global){U.event.trigger("ajaxComplete",[t,q])}if(q.global&&!--U.active){U.event.trigger("ajaxStop")}}return t},handleError:function(d,a,e,b){if(d.error){d.error(a,e,b)}if(d.global){U.event.trigger("ajaxError",[a,d,b])}},active:0,httpSuccess:function(a){try{return !a.status&&location.protocol=="file:"||(a.status>=200&&a.status<300)||a.status==304||a.status==1223}catch(b){}return false},httpNotModified:function(b,e){try{var a=b.getResponseHeader("Last-Modified");return b.status==304||a==U.lastModified[e]}catch(d){}return false},httpData:function(a,d,e){var g=a.getResponseHeader("content-type"),h=d=="xml"||!d&&g&&g.indexOf("xml")>=0,b=h?a.responseXML:a.responseText;if(h&&b.documentElement.tagName=="parsererror"){throw"parsererror"}if(e&&e.dataFilter){b=e.dataFilter(b,d)}if(typeof b==="string"){if(d=="script"){U.globalEval(b)}if(d=="json"){b=Y["eval"]("("+b+")")}}return b},param:function(e){var b=[];function a(h,g){b[b.length]=encodeURIComponent(h)+"="+encodeURIComponent(g)}if(U.isArray(e)||e.jquery){U.each(e,function(){a(this.name,this.value)})}else{for(var d in e){if(U.isArray(e[d])){U.each(e[d],function(){a(d,this)})}else{a(d,U.isFunction(e[d])?e[d]():e[d])}}}return b.join("&").replace(/%20/g,"+")}});var W={},V,ag=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function K(b,d){var a={};U.each(ag.concat.apply([],ag.slice(0,d)),function(){a[this]=b});return a}U.fn.extend({show:function(d,a){if(d){return this.animate(K("show",3),d,a)}else{for(var g=0,l=this.length;g<l;g++){var m=U.data(this[g],"olddisplay");this[g].style.display=m||"";if(U.css(this[g],"display")==="none"){var h=this[g].tagName,b;if(W[h]){b=W[h]}else{var e=U("<"+h+" />").appendTo("body");b=e.css("display");if(b==="none"){b="block"}e.remove();W[h]=b}U.data(this[g],"olddisplay",b)}}for(var g=0,l=this.length;g<l;g++){this[g].style.display=U.data(this[g],"olddisplay")||""}return this}},hide:function(b,a){if(b){return this.animate(K("hide",3),b,a)}else{for(var d=0,e=this.length;d<e;d++){var g=U.data(this[d],"olddisplay");if(!g&&g!=="none"){U.data(this[d],"olddisplay",U.css(this[d],"display"))}}for(var d=0,e=this.length;d<e;d++){this[d].style.display="none"}return this}},_toggle:U.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";return U.isFunction(a)&&U.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var e=d?a:U(this).is(":hidden");U(this)[e?"show":"hide"]()}):this.animate(K("toggle",3),a,b)},fadeTo:function(d,a,b){return this.animate({opacity:a},d,b)},animate:function(a,e,b,d){var g=U.speed(e,b,d);return this[g.queue===false?"each":"queue"](function(){var l=U.extend({},g),o,h=this.nodeType==1&&U(this).is(":hidden"),m=this;for(o in a){if(a[o]=="hide"&&h||a[o]=="show"&&!h){return l.complete.call(this)}if((o=="height"||o=="width")&&this.style){l.display=U.css(this,"display");l.overflow=this.style.overflow}}if(l.overflow!=null){this.style.overflow="hidden"}l.curAnim=U.extend({},a);U.each(a,function(u,q){var r=new U.fx(m,l,u);if(/toggle|show|hide/.test(q)){r[q=="toggle"?h?"show":"hide":q](a)}else{var s=q.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),p=r.cur(true)||0;if(s){var v=parseFloat(s[2]),t=s[3]||"px";if(t!="px"){m.style[u]=(v||1)+t;p=((v||1)/r.cur(true))*p;m.style[u]=p+t}if(s[1]){v=((s[1]=="-="?-1:1)*v)+p}r.custom(p,v,t)}else{r.custom(p,q,"")}}});return true})},stop:function(b,d){var a=U.timers;if(b){this.queue([])}this.each(function(){for(var e=a.length-1;e>=0;e--){if(a[e].elem==this){if(d){a[e](true)}a.splice(e,1)}}});if(!d){this.dequeue()}return this}});U.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(b,a){U.fn[b]=function(e,d){return this.animate(a,e,d)}});U.extend({speed:function(b,a,d){var e=typeof b==="object"?b:{complete:d||!d&&a||U.isFunction(b)&&b,duration:b,easing:d&&a||a&&!U.isFunction(a)&&a};e.duration=U.fx.off?0:typeof e.duration==="number"?e.duration:U.fx.speeds[e.duration]||U.fx.speeds._default;e.old=e.complete;e.complete=function(){if(e.queue!==false){U(this).dequeue()}if(U.isFunction(e.old)){e.old.call(this)}};return e},easing:{linear:function(b,a,e,d){return e+d*b},swing:function(b,a,e,d){return((-Math.cos(b*Math.PI)/2)+0.5)*d+e}},timers:[],fx:function(b,d,a){this.options=d;this.elem=b;this.prop=a;if(!d.orig){d.orig={}}}});U.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(U.fx.step[this.prop]||U.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var b=parseFloat(U.css(this.elem,this.prop,a));return b&&b>-10000?b:parseFloat(U.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){this.startTime=af();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var g=this;function e(h){return g.step(h)}e.elem=this.elem;if(e()&&U.timers.push(e)&&!V){V=setInterval(function(){var h=U.timers;for(var l=0;l<h.length;l++){if(!h[l]()){h.splice(l--,1)}}if(!h.length){clearInterval(V);V=ad}},13)}},show:function(){this.options.orig[this.prop]=U.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());U(this.elem).show()},hide:function(){this.options.orig[this.prop]=U.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(d){var e=af();if(d||e>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var h=true;for(var g in this.options.curAnim){if(this.options.curAnim[g]!==true){h=false}}if(h){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(U.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){U(this.elem).hide()}if(this.options.hide||this.options.show){for(var b in this.options.curAnim){U.attr(this.elem.style,b,this.options.orig[b])}}this.options.complete.call(this.elem)}return false}else{var a=e-this.startTime;this.state=a/this.options.duration;this.pos=U.easing[this.options.easing||(U.easing.swing?"swing":"linear")](this.state,a,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};U.extend(U.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){U.attr(a.elem.style,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null){a.elem.style[a.prop]=a.now+a.unit}else{a.elem[a.prop]=a.now}}}});if(document.documentElement.getBoundingClientRect){U.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return U.offset.bodyOffset(this[0])}var h=this[0].getBoundingClientRect(),d=this[0].ownerDocument,l=d.body,m=d.documentElement,a=m.clientTop||l.clientTop||0,b=m.clientLeft||l.clientLeft||0,e=h.top+(self.pageYOffset||U.boxModel&&m.scrollTop||l.scrollTop)-a,g=h.left+(self.pageXOffset||U.boxModel&&m.scrollLeft||l.scrollLeft)-b;return{top:e,left:g}}}else{U.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return U.offset.bodyOffset(this[0])}U.offset.initialized||U.offset.initialize();var h=this[0],o=h.offsetParent,p=h,a=h.ownerDocument,d,m=a.documentElement,g=a.body,e=a.defaultView,q=e.getComputedStyle(h,null),b=h.offsetTop,l=h.offsetLeft;while((h=h.parentNode)&&h!==g&&h!==m){d=e.getComputedStyle(h,null);b-=h.scrollTop,l-=h.scrollLeft;if(h===o){b+=h.offsetTop,l+=h.offsetLeft;if(U.offset.doesNotAddBorder&&!(U.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(h.tagName))){b+=parseInt(d.borderTopWidth,10)||0,l+=parseInt(d.borderLeftWidth,10)||0}p=o,o=h.offsetParent}if(U.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){b+=parseInt(d.borderTopWidth,10)||0,l+=parseInt(d.borderLeftWidth,10)||0}q=d}if(q.position==="relative"||q.position==="static"){b+=g.offsetTop,l+=g.offsetLeft}if(q.position==="fixed"){b+=Math.max(m.scrollTop,g.scrollTop),l+=Math.max(m.scrollLeft,g.scrollLeft)}return{top:b,left:l}}}U.offset={initialize:function(){if(this.initialized){return}var d=document.body,o=document.createElement("div"),l,m,a,h,b,p,g=d.style.marginTop,e='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';b={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(p in b){o.style[p]=b[p]}o.innerHTML=e;d.insertBefore(o,d.firstChild);l=o.firstChild,m=l.firstChild,h=l.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(m.offsetTop!==5);this.doesAddBorderForTableAndCells=(h.offsetTop===5);l.style.overflow="hidden",l.style.position="relative";this.subtractsBorderForOverflowNotVisible=(m.offsetTop===-5);d.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(d.offsetTop===0);d.style.marginTop=g;d.removeChild(o);this.initialized=true},bodyOffset:function(d){U.offset.initialized||U.offset.initialize();var a=d.offsetTop,b=d.offsetLeft;if(U.offset.doesNotIncludeMarginInBodyOffset){a+=parseInt(U.curCSS(d,"marginTop",true),10)||0,b+=parseInt(U.curCSS(d,"marginLeft",true),10)||0}return{top:a,left:b}}};U.fn.extend({position:function(){var b=0,d=0,g;if(this[0]){var e=this.offsetParent(),a=this.offset(),h=/^body|html$/i.test(e[0].tagName)?{top:0,left:0}:e.offset();a.top-=aa(this,"marginTop");a.left-=aa(this,"marginLeft");h.top+=aa(e,"borderTopWidth");h.left+=aa(e,"borderLeftWidth");g={top:a.top-h.top,left:a.left-h.left}}return g},offsetParent:function(){var a=this[0].offsetParent||document.body;while(a&&(!/^body|html$/i.test(a.tagName)&&U.css(a,"position")=="static")){a=a.offsetParent}return U(a)}});U.each(["Left","Top"],function(b,d){var a="scroll"+d;U.fn[a]=function(e){if(!this[0]){return null}return e!==ad?this.each(function(){this==Y||this==document?Y.scrollTo(!b?e:U(Y).scrollLeft(),b?e:U(Y).scrollTop()):this[a]=e}):this[0]==Y||this[0]==document?self[b?"pageYOffset":"pageXOffset"]||U.boxModel&&document.documentElement[a]||document.body[a]:this[0][a]}});U.each(["Height","Width"],function(b,e){var h=b?"Left":"Top",d=b?"Right":"Bottom",g=e.toLowerCase();U.fn["inner"+e]=function(){return this[0]?U.css(this[0],g,false,"padding"):null};U.fn["outer"+e]=function(l){return this[0]?U.css(this[0],g,false,l?"margin":"border"):null};var a=e.toLowerCase();U.fn[a]=function(l){return this[0]==Y?document.compatMode=="CSS1Compat"&&document.documentElement["client"+e]||document.body["client"+e]:this[0]==document?Math.max(document.documentElement["client"+e],document.body["scroll"+e],document.documentElement["scroll"+e],document.body["offset"+e],document.documentElement["offset"+e]):l===ad?(this.length?U.css(this[0],a):null):this.css(a,typeof l==="string"?l:l+"px")}})})();Ext={version:"2.2.1"};window["undefined"]=window["undefined"];Ext.apply=function(m,l,g){if(g){Ext.apply(m,g)}if(m&&l&&typeof l=="object"){for(var h in l){m[h]=l[h]}}return m};(function(){var idSeed=0;var ua=navigator.userAgent.toLowerCase();var isStrict=document.compatMode=="CSS1Compat",isOpera=ua.indexOf("opera")>-1,isChrome=ua.indexOf("chrome")>-1,isSafari=!isChrome&&(/webkit|khtml/).test(ua),isSafari3=isSafari&&ua.indexOf("webkit/5")!=-1,isIE=!isOpera&&ua.indexOf("msie")>-1,isIE7=!isOpera&&ua.indexOf("msie 7")>-1,isIE8=!isOpera&&ua.indexOf("msie 8")>-1,isGecko=!isSafari&&!isChrome&&ua.indexOf("gecko")>-1,isGecko3=isGecko&&ua.indexOf("rv:1.9")>-1,isBorderBox=isIE&&!isStrict,isWindows=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),isMac=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),isAir=(ua.indexOf("adobeair")!=-1),isLinux=(ua.indexOf("linux")!=-1),isSecure=window.location.href.toLowerCase().indexOf("https")===0;if(isIE&&!isIE7){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}Ext.apply(Ext,{isStrict:isStrict,isSecure:isSecure,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http://extjs.com/s.gif",emptyFn:function(){},applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p]}}}return o},addBehaviors:function(o){if(!Ext.isReady){Ext.onReady(function(){Ext.addBehaviors(o)});return}var cache={};for(var b in o){var parts=b.split("@");if(parts[1]){var s=parts[0];if(!cache[s]){cache[s]=Ext.select(s)}cache[s].on(parts[1],o[b])}}cache=null},id:function(el,prefix){prefix=prefix||"ext-gen";el=Ext.getDom(el);var id=prefix+(++idSeed);return el?(el.id?el.id:(el.id=id)):id},extend:function(){var io=function(o){for(var m in o){this[m]=o[m]}};var oc=Object.prototype.constructor;return function(sb,sp,overrides){if(typeof sp=="object"){overrides=sp;sp=sb;sb=overrides.constructor!=oc?overrides.constructor:function(){sp.apply(this,arguments)}}var F=function(){},sbp,spp=sp.prototype;F.prototype=spp;sbp=sb.prototype=new F();sbp.constructor=sb;sb.superclass=spp;if(spp.constructor==oc){spp.constructor=sp}sb.override=function(o){Ext.override(sb,o)};sbp.override=io;Ext.override(sb,overrides);sb.extend=function(o){Ext.extend(sb,o)};return sb}}(),override:function(origclass,overrides){if(overrides){var p=origclass.prototype;for(var method in overrides){p[method]=overrides[method]}if(Ext.isIE&&overrides.toString!=origclass.toString){p.toString=overrides.toString}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i<a.length;++i){d=a[i].split(".");rt=d[0];eval("if (typeof "+rt+' == "undefined"){'+rt+" = {};} o = "+rt+";");for(j=1;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]]}}},urlEncode:function(o){if(!o){return""}var buf=[];for(var key in o){var ov=o[key],k=encodeURIComponent(key);var type=typeof ov;if(type=="undefined"){buf.push(k,"=&")}else{if(type!="function"&&type!="object"){buf.push(k,"=",encodeURIComponent(ov),"&")}else{if(Ext.isDate(ov)){var s=Ext.encode(ov).replace(/"/g,"");buf.push(k,"=",s,"&")}else{if(Ext.isArray(ov)){if(ov.length){for(var i=0,len=ov.length;i<len;i++){buf.push(k,"=",encodeURIComponent(ov[i]===undefined?"":ov[i]),"&")}}else{buf.push(k,"=&")}}}}}}buf.pop();return buf.join("")},urlDecode:function(string,overwrite){if(!string||!string.length){return{}}var obj={};var pairs=string.split("&");var pair,name,value;for(var i=0,len=pairs.length;i<len;i++){pair=pairs[i].split("=");name=decodeURIComponent(pair[0]);value=decodeURIComponent(pair[1]);if(overwrite!==true){if(typeof obj[name]=="undefined"){obj[name]=value}else{if(typeof obj[name]=="string"){obj[name]=[obj[name]];obj[name].push(value)}else{obj[name].push(value)}}}else{obj[name]=value}}return obj},each:function(array,fn,scope){if(typeof array.length=="undefined"||typeof array=="string"){array=[array]}for(var i=0,len=array.length;i<len;i++){if(fn.call(scope||array[i],array[i],i,array)===false){return i}}},combine:function(){var as=arguments,l=as.length,r=[];for(var i=0;i<l;i++){var a=as[i];if(Ext.isArray(a)){r=r.concat(a)}else{if(a.length!==undefined&&!a.substr){r=r.concat(Array.prototype.slice.call(a,0))}else{r.push(a)}}}return r},escapeRe:function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},callback:function(cb,scope,args,delay){if(typeof cb=="function"){if(delay){cb.defer(delay,scope,args||[])}else{cb.apply(scope,args||[])}}},getDom:function(el){if(!el||!document){return null}return el.dom?el.dom:(typeof el=="string"?document.getElementById(el):el)},getDoc:function(){return Ext.get(document)},getBody:function(){return Ext.get(document.body||document.documentElement)},getCmp:function(id){return Ext.ComponentMgr.get(id)},num:function(v,defaultValue){if(typeof v!="number"||isNaN(v)){return defaultValue}return v},destroy:function(){for(var i=0,a=arguments,len=a.length;i<len;i++){var as=a[i];if(as){if(typeof as.destroy=="function"){as.destroy()}else{if(as.dom){as.removeAllListeners();as.remove()}}}}},removeNode:isIE?function(){var d;return function(n){if(n&&n.tagName!="BODY"){d=d||document.createElement("div");d.appendChild(n);d.innerHTML=""}}}():function(n){if(n&&n.parentNode&&n.tagName!="BODY"){n.parentNode.removeChild(n)}},type:function(o){if(o===undefined||o===null){return false}if(o.htmlElement){return"element"}var t=typeof o;if(t=="object"&&o.nodeName){switch(o.nodeType){case 1:return"element";case 3:return(/\S/).test(o.nodeValue)?"textnode":"whitespace"}}if(t=="object"||t=="function"){switch(o.constructor){case Array:return"array";case RegExp:return"regexp";case Date:return"date"}if(typeof o.length=="number"&&typeof o.item=="function"){return"nodelist"}}return t},isEmpty:function(v,allowBlank){return v===null||v===undefined||(!allowBlank?v==="":false)},value:function(v,defaultValue,allowBlank){return Ext.isEmpty(v,allowBlank)?defaultValue:v},isArray:function(v){return v&&typeof v.length=="number"&&typeof v.splice=="function"},isDate:function(v){return v&&typeof v.getFullYear=="function"},isOpera:isOpera,isChrome:isChrome,isSafari:isSafari,isSafari3:isSafari3,isSafari2:isSafari&&!isSafari3,isIE:isIE,isIE6:isIE&&!isIE7&&!isIE8,isIE7:isIE7,isIE8:isIE8,isGecko:isGecko,isGecko2:isGecko&&!isGecko3,isGecko3:isGecko3,isBorderBox:isBorderBox,isLinux:isLinux,isWindows:isWindows,isMac:isMac,isAir:isAir,useShims:((isIE&&!isIE7)||(isMac&&isGecko&&!isGecko3))});Ext.ns=Ext.namespace})();Ext.ns("Ext","Ext.util","Ext.grid","Ext.dd","Ext.tree","Ext.data","Ext.form","Ext.menu","Ext.state","Ext.lib","Ext.layout","Ext.app","Ext.ux");Ext.apply(Function.prototype,{createCallback:function(){var e=arguments;var d=this;return function(){return d.apply(window,e)}},createDelegate:function(l,e,g){var h=this;return function(){var a=e||arguments;if(g===true){a=Array.prototype.slice.call(arguments,0);a=a.concat(e)}else{if(typeof g=="number"){a=Array.prototype.slice.call(arguments,0);var b=[g,0].concat(e);Array.prototype.splice.apply(a,b)}}return h.apply(l||window,a)}},defer:function(o,l,g,h){var m=this.createDelegate(l,g,h);if(o){return setTimeout(m,o)}m();return 0},createSequence:function(d,e){if(typeof d!="function"){return this}var g=this;return function(){var a=g.apply(this||window,arguments);d.apply(e||this||window,arguments);return a}},createInterceptor:function(d,e){if(typeof d!="function"){return this}var g=this;return function(){d.target=this;d.method=g;if(d.apply(e||this||window,arguments)===false){return}return g.apply(this||window,arguments)}}});Ext.applyIf(String,{escape:function(b){return b.replace(/('|\\)/g,"\\$1")},leftPad:function(h,e,l){var g=new String(h);if(!l){l=" "}while(g.length<e){g=l+g}return g.toString()},format:function(d){var e=Array.prototype.slice.call(arguments,1);return d.replace(/\{(\d+)\}/g,function(b,a){return e[a]})}});String.prototype.toggle=function(d,e){return this==d?e:d};String.prototype.trim=function(){var b=/^\s+|\s+$/g;return function(){return this.replace(b,"")}}();Ext.applyIf(Number.prototype,{constrain:function(d,e){return Math.min(Math.max(this,d),e)}});Ext.applyIf(Array.prototype,{indexOf:function(g){for(var d=0,e=this.length;d<e;d++){if(this[d]==g){return d}}return -1},remove:function(d){var e=this.indexOf(d);if(e!=-1){this.splice(e,1)}return this}});Date.prototype.getElapsed=function(b){return Math.abs((b||new Date()).getTime()-this.getTime())};(function(){var e;Ext.lib.Dom={getViewWidth:function(a){return a?this.getDocumentWidth():this.getViewportWidth()},getViewHeight:function(a){return a?this.getDocumentHeight():this.getViewportHeight()},getDocumentHeight:function(){var a=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;return Math.max(a,this.getViewportHeight())},getDocumentWidth:function(){var a=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;return Math.max(a,this.getViewportWidth())},getViewportHeight:function(){if(Ext.isIE){return Ext.isStrict?document.documentElement.clientHeight:document.body.clientHeight}else{return self.innerHeight}},getViewportWidth:function(){if(Ext.isIE){return Ext.isStrict?document.documentElement.clientWidth:document.body.clientWidth}else{return self.innerWidth}},isAncestor:function(b,a){b=Ext.getDom(b);a=Ext.getDom(a);if(!b||!a){return false}if(b.contains&&!Ext.isSafari){return b.contains(a)}else{if(b.compareDocumentPosition){return !!(b.compareDocumentPosition(a)&16)}else{var d=a.parentNode;while(d){if(d==b){return true}else{if(!d.tagName||d.tagName.toUpperCase()=="HTML"){return false}}d=d.parentNode}return false}}},getRegion:function(a){return Ext.lib.Region.getRegion(a)},getY:function(a){return this.getXY(a)[1]},getX:function(a){return this.getXY(a)[0]},getXY:function(w){var z,s,p,d,t=(document.body||document.documentElement);w=Ext.getDom(w);if(w==t){return[0,0]}if(w.getBoundingClientRect){p=w.getBoundingClientRect();d=l(document).getScroll();return[p.left+d.left,p.top+d.top]}var b=0,r=0;z=w;var B=l(w).getStyle("position")=="absolute";while(z){b+=z.offsetLeft;r+=z.offsetTop;if(!B&&l(z).getStyle("position")=="absolute"){B=true}if(Ext.isGecko){s=l(z);var a=parseInt(s.getStyle("borderTopWidth"),10)||0;var v=parseInt(s.getStyle("borderLeftWidth"),10)||0;b+=v;r+=a;if(z!=w&&s.getStyle("overflow")!="visible"){b+=v;r+=a}}z=z.offsetParent}if(Ext.isSafari&&B){b-=t.offsetLeft;r-=t.offsetTop}if(Ext.isGecko&&!B){var u=l(t);b+=parseInt(u.getStyle("borderLeftWidth"),10)||0;r+=parseInt(u.getStyle("borderTopWidth"),10)||0}z=w.parentNode;while(z&&z!=t){if(!Ext.isOpera||(z.tagName!="TR"&&l(z).getStyle("display")!="inline")){b-=z.scrollLeft;r-=z.scrollTop}z=z.parentNode}return[b,r]},setXY:function(d,b){d=Ext.fly(d,"_setXY");d.position();var a=d.translatePoints(b);if(b[0]!==false){d.dom.style.left=a.left+"px"}if(b[1]!==false){d.dom.style.top=a.top+"px"}},setX:function(a,b){this.setXY(a,[b,false])},setY:function(b,a){this.setXY(b,[false,a])}};Ext.lib.Event=function(){var p=false;var o=[];var a=[];var d=0;var m=[];var q=0;var b=null;return{POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,_interval:null,startInterval:function(){if(!this._interval){var s=this;var r=function(){s._tryPreloadAttach()};this._interval=setInterval(r,this.POLL_INTERVAL)}},onAvailable:function(u,s,t,r){m.push({id:u,fn:s,obj:t,override:r,checkReady:false});d=this.POLL_RETRYS;this.startInterval()},addListener:function(t,r,u){t=Ext.getDom(t);if(!t||!u){return false}if("unload"==r){a[a.length]=[t,r,u];return true}var v=function(z){return typeof Ext!="undefined"?u(Ext.lib.Event.getEvent(z)):false};var s=[t,r,u,v];var w=o.length;o[w]=s;this.doAdd(t,r,v,false);return true},removeListener:function(v,C,w){var z,D;v=Ext.getDom(v);if(!w){return this.purgeElement(v,false,C)}if("unload"==C){for(z=0,D=a.length;z<D;z++){var t=a[z];if(t&&t[0]==v&&t[1]==C&&t[2]==w){a.splice(z,1);return true}}return false}var u=null;var B=arguments[3];if("undefined"==typeof B){B=this._getCacheIndex(v,C,w)}if(B>=0){u=o[B]}if(!v||!u){return false}this.doRemove(v,C,u[this.WFN],false);delete o[B][this.WFN];delete o[B][this.FN];o.splice(B,1);return true},getTarget:function(t,r){t=t.browserEvent||t;var s=t.target||t.srcElement;return this.resolveTextNode(s)},resolveTextNode:function(r){if(Ext.isSafari&&r&&3==r.nodeType){return r.parentNode}else{return r}},getPageX:function(r){r=r.browserEvent||r;var s=r.pageX;if(!s&&0!==s){s=r.clientX||0;if(Ext.isIE){s+=this.getScroll()[1]}}return s},getPageY:function(s){s=s.browserEvent||s;var r=s.pageY;if(!r&&0!==r){r=s.clientY||0;if(Ext.isIE){r+=this.getScroll()[0]}}return r},getXY:function(r){r=r.browserEvent||r;return[this.getPageX(r),this.getPageY(r)]},getRelatedTarget:function(r){r=r.browserEvent||r;var s=r.relatedTarget;if(!s){if(r.type=="mouseout"){s=r.toElement}else{if(r.type=="mouseover"){s=r.fromElement}}}return this.resolveTextNode(s)},getTime:function(t){t=t.browserEvent||t;if(!t.time){var r=new Date().getTime();try{t.time=r}catch(s){this.lastError=s;return r}}return t.time},stopEvent:function(r){this.stopPropagation(r);this.preventDefault(r)},stopPropagation:function(r){r=r.browserEvent||r;if(r.stopPropagation){r.stopPropagation()}else{r.cancelBubble=true}},preventDefault:function(r){r=r.browserEvent||r;if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}},getEvent:function(r){var s=r||window.event;if(!s){var t=this.getEvent.caller;while(t){s=t.arguments[0];if(s&&Event==s.constructor){break}t=t.caller}}return s},getCharCode:function(r){r=r.browserEvent||r;return r.charCode||r.keyCode||0},_getCacheIndex:function(t,w,u){for(var v=0,r=o.length;v<r;++v){var s=o[v];if(s&&s[this.FN]==u&&s[this.EL]==t&&s[this.TYPE]==w){return v}}return -1},elCache:{},getEl:function(r){return document.getElementById(r)},clearCache:function(){},_load:function(r){p=true;var s=Ext.lib.Event;if(Ext.isIE){s.doRemove(window,"load",s._load)}},_tryPreloadAttach:function(){if(this.locked){return false}this.locked=true;var u=!p;if(!u){u=(d>0)}var v=[];for(var s=0,t=m.length;s<t;++s){var w=m[s];if(w){var z=this.getEl(w.id);if(z){if(!w.checkReady||p||z.nextSibling||(document&&document.body)){var B=z;if(w.override){if(w.override===true){B=w.obj}else{B=w.override}}w.fn.call(B,w.obj);m[s]=null}}else{v.push(w)}}}d=(v.length===0)?0:d-1;if(u){this.startInterval()}else{clearInterval(this._interval);this._interval=null}this.locked=false;return true},purgeElement:function(w,v,B){var u=this.getListeners(w,B);if(u){for(var z=0,t=u.length;z<t;++z){var C=u[z];this.removeListener(w,C.type,C.fn)}}if(v&&w&&w.childNodes){for(z=0,t=w.childNodes.length;z<t;++z){this.purgeElement(w.childNodes[z],v,B)}}},getListeners:function(C,G){var w=[],D;if(!G){D=[o,a]}else{if(G=="unload"){D=[a]}else{D=[o]}}for(var z=0;z<D.length;++z){var E=D[z];if(E&&E.length>0){for(var v=0,F=E.length;v<F;++v){var B=E[v];if(B&&B[this.EL]===C&&(!G||G===B[this.TYPE])){w.push({type:B[this.TYPE],fn:B[this.FN],obj:B[this.OBJ],adjust:B[this.ADJ_SCOPE],index:v})}}}}return(w.length)?w:null},_unload:function(v){var w=Ext.lib.Event,B,C,E,u,D;for(B=0,u=a.length;B<u;++B){E=a[B];if(E){var z=window;if(E[w.ADJ_SCOPE]){if(E[w.ADJ_SCOPE]===true){z=E[w.OBJ]}else{z=E[w.ADJ_SCOPE]}}E[w.FN].call(z,w.getEvent(v),E[w.OBJ]);a[B]=null;E=null;z=null}}a=null;if(o&&o.length>0){C=o.length;while(C){D=C-1;E=o[D];if(E){w.removeListener(E[w.EL],E[w.TYPE],E[w.FN],D)}C=C-1}E=null;w.clearCache()}w.doRemove(window,"unload",w._unload)},getScroll:function(){var s=document.documentElement,r=document.body;if(s&&(s.scrollTop||s.scrollLeft)){return[s.scrollTop,s.scrollLeft]}else{if(r){return[r.scrollTop,r.scrollLeft]}else{return[0,0]}}},doAdd:function(){if(window.addEventListener){return function(t,r,u,s){t.addEventListener(r,u,(s))}}else{if(window.attachEvent){return function(t,r,u,s){t.attachEvent("on"+r,u)}}else{return function(){}}}}(),doRemove:function(){if(window.removeEventListener){return function(t,r,u,s){t.removeEventListener(r,u,(s))}}else{if(window.detachEvent){return function(t,s,r){t.detachEvent("on"+s,r)}}else{return function(){}}}}()}}();var h=Ext.lib.Event;h.on=h.addListener;h.un=h.removeListener;if(document&&document.body){h._load()}else{h.doAdd(window,"load",h._load)}h.doAdd(window,"unload",h._unload);h._tryPreloadAttach();Ext.lib.Ajax={request:function(a,d,q,b,p){if(p){var o=p.headers;if(o){for(var m in o){if(o.hasOwnProperty(m)){this.initHeader(m,o[m],false)}}}if(p.xmlData){if(!o||!o["Content-Type"]){this.initHeader("Content-Type","text/xml",false)}a=(a?a:(p.method?p.method:"POST"));b=p.xmlData}else{if(p.jsonData){if(!o||!o["Content-Type"]){this.initHeader("Content-Type","application/json",false)}a=(a?a:(p.method?p.method:"POST"));b=typeof p.jsonData=="object"?Ext.encode(p.jsonData):p.jsonData}}}return this.asyncRequest(a,d,q,b)},serializeForm:function(t){if(typeof t=="string"){t=(document.getElementById(t)||document.forms[t])}var s,u,r,p,d="",a=false;for(var b=0;b<t.elements.length;b++){s=t.elements[b];p=t.elements[b].disabled;u=t.elements[b].name;r=t.elements[b].value;if(!p&&u){switch(s.type){case"select-one":case"select-multiple":for(var q=0;q<s.options.length;q++){if(s.options[q].selected){if(Ext.isIE){d+=encodeURIComponent(u)+"="+encodeURIComponent(s.options[q].attributes.value.specified?s.options[q].value:s.options[q].text)+"&"}else{d+=encodeURIComponent(u)+"="+encodeURIComponent(s.options[q].hasAttribute("value")?s.options[q].value:s.options[q].text)+"&"}}}break;case"radio":case"checkbox":if(s.checked){d+=encodeURIComponent(u)+"="+encodeURIComponent(r)+"&"}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(a==false){d+=encodeURIComponent(u)+"="+encodeURIComponent(r)+"&";a=true}break;default:d+=encodeURIComponent(u)+"="+encodeURIComponent(r)+"&";break}}}d=d.substr(0,d.length-1);return d},headers:{},hasHeaders:false,useDefaultHeader:true,defaultPostHeader:"application/x-www-form-urlencoded; charset=UTF-8",useDefaultXhrHeader:true,defaultXhrHeader:"XMLHttpRequest",hasDefaultHeaders:true,defaultHeaders:{},poll:{},timeout:{},pollInterval:50,transactionId:0,setProgId:function(a){this.activeX.unshift(a)},setDefaultPostHeader:function(a){this.useDefaultHeader=a},setDefaultXhrHeader:function(a){this.useDefaultXhrHeader=a},setPollingInterval:function(a){if(typeof a=="number"&&isFinite(a)){this.pollInterval=a}},createXhrObject:function(a){var b,o;try{o=new XMLHttpRequest();b={conn:o,tId:a}}catch(d){for(var m=0;m<this.activeX.length;++m){try{o=new ActiveXObject(this.activeX[m]);b={conn:o,tId:a};break}catch(d){}}}finally{return b}},getConnectionObject:function(){var b;var a=this.transactionId;try{b=this.createXhrObject(a);if(b){this.transactionId++}}catch(d){}finally{return b}},asyncRequest:function(a,m,b,o){var d=this.getConnectionObject();if(!d){return null}else{d.conn.open(a,m,true);if(this.useDefaultXhrHeader){if(!this.defaultHeaders["X-Requested-With"]){this.initHeader("X-Requested-With",this.defaultXhrHeader,true)}}if(o&&this.useDefaultHeader&&(!this.hasHeaders||!this.headers["Content-Type"])){this.initHeader("Content-Type",this.defaultPostHeader)}if(this.hasDefaultHeaders||this.hasHeaders){this.setHeader(d)}this.handleReadyState(d,b);d.conn.send(o||null);return d}},handleReadyState:function(b,a){var d=this;if(a&&a.timeout){this.timeout[b.tId]=window.setTimeout(function(){d.abort(b,a,true)},a.timeout)}this.poll[b.tId]=window.setInterval(function(){if(b.conn&&b.conn.readyState==4){window.clearInterval(d.poll[b.tId]);delete d.poll[b.tId];if(a&&a.timeout){window.clearTimeout(d.timeout[b.tId]);delete d.timeout[b.tId]}d.handleTransactionResponse(b,a)}},this.pollInterval)},handleTransactionResponse:function(b,a,p){if(!a){this.releaseObject(b);return}var m,o;try{if(b.conn.status!==undefined&&b.conn.status!=0){m=b.conn.status}else{m=13030}}catch(d){m=13030}if((m>=200&&m<300)||(Ext.isIE&&m==1223)){o=this.createResponseObject(b,a.argument);if(a.success){if(!a.scope){a.success(o)}else{a.success.apply(a.scope,[o])}}}else{switch(m){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:o=this.createExceptionObject(b.tId,a.argument,(p?p:false));if(a.failure){if(!a.scope){a.failure(o)}else{a.failure.apply(a.scope,[o])}}break;default:o=this.createResponseObject(b,a.argument);if(a.failure){if(!a.scope){a.failure(o)}else{a.failure.apply(a.scope,[o])}}}}this.releaseObject(b);o=null},createResponseObject:function(u,d){var r={};var a={};try{var s=u.conn.getAllResponseHeaders();var o=s.split("\n");for(var q=0;q<o.length;q++){var t=o[q].indexOf(":");if(t!=-1){a[o[q].substring(0,t)]=o[q].substring(t+2)}}}catch(b){}r.tId=u.tId;r.status=u.conn.status;r.statusText=u.conn.statusText;r.getResponseHeader=a;r.getAllResponseHeaders=s;r.responseText=u.conn.responseText;r.responseXML=u.conn.responseXML;if(typeof d!==undefined){r.argument=d}return r},createExceptionObject:function(a,o,r){var d=0;var b="communication failure";var p=-1;var q="transaction aborted";var m={};m.tId=a;if(r){m.status=p;m.statusText=q}else{m.status=d;m.statusText=b}if(o){m.argument=o}return m},initHeader:function(m,a,b){var d=(b)?this.defaultHeaders:this.headers;if(d[m]===undefined){d[m]=a}else{d[m]=a+","+d[m]}if(b){this.hasDefaultHeaders=true}else{this.hasHeaders=true}},setHeader:function(b){if(this.hasDefaultHeaders){for(var a in this.defaultHeaders){if(this.defaultHeaders.hasOwnProperty(a)){b.conn.setRequestHeader(a,this.defaultHeaders[a])}}}if(this.hasHeaders){for(var a in this.headers){if(this.headers.hasOwnProperty(a)){b.conn.setRequestHeader(a,this.headers[a])}}this.headers={};this.hasHeaders=false}},resetDefaultHeaders:function(){delete this.defaultHeaders;this.defaultHeaders={};this.hasDefaultHeaders=false},abort:function(b,a,d){if(this.isCallInProgress(b)){b.conn.abort();window.clearInterval(this.poll[b.tId]);delete this.poll[b.tId];if(d){delete this.timeout[b.tId]}this.handleTransactionResponse(b,a,true);return true}else{return false}},isCallInProgress:function(a){if(a.conn){return a.conn.readyState!=4&&a.conn.readyState!=0}else{return false}},releaseObject:function(a){a.conn=null;a=null},activeX:["MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"]};Ext.lib.Region=function(b,a,m,d){this.top=b;this[1]=b;this.right=a;this.bottom=m;this.left=d;this[0]=d};Ext.lib.Region.prototype={contains:function(a){return(a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom)},getArea:function(){return((this.bottom-this.top)*(this.right-this.left))},intersect:function(a){var d=Math.max(this.top,a.top);var b=Math.min(this.right,a.right);var o=Math.min(this.bottom,a.bottom);var m=Math.max(this.left,a.left);if(o>=d&&b>=m){return new Ext.lib.Region(d,b,o,m)}else{return null}},union:function(a){var d=Math.min(this.top,a.top);var b=Math.max(this.right,a.right);var o=Math.max(this.bottom,a.bottom);var m=Math.min(this.left,a.left);return new Ext.lib.Region(d,b,o,m)},constrainTo:function(a){this.top=this.top.constrain(a.top,a.bottom);this.bottom=this.bottom.constrain(a.top,a.bottom);this.left=this.left.constrain(a.left,a.right);this.right=this.right.constrain(a.left,a.right);return this},adjust:function(b,d,m,a){this.top+=b;this.left+=d;this.right+=a;this.bottom+=m;return this}};Ext.lib.Region.getRegion=function(d){var a=Ext.lib.Dom.getXY(d);var m=a[1];var b=a[0]+d.offsetWidth;var p=a[1]+d.offsetHeight;var o=a[0];return new Ext.lib.Region(m,b,p,o)};Ext.lib.Point=function(b,a){if(Ext.isArray(b)){a=b[1];b=b[0]}this.x=this.right=this.left=this[0]=b;this.y=this.top=this.bottom=this[1]=a};Ext.lib.Point.prototype=new Ext.lib.Region();Ext.lib.Anim={scroll:function(d,o,b,a,p,m){return this.run(d,o,b,a,p,m,Ext.lib.Scroll)},motion:function(d,o,b,a,p,m){return this.run(d,o,b,a,p,m,Ext.lib.Motion)},color:function(d,o,b,a,p,m){return this.run(d,o,b,a,p,m,Ext.lib.ColorAnim)},run:function(m,q,b,a,r,o,p){p=p||Ext.lib.AnimBase;if(typeof a=="string"){a=Ext.lib.Easing[a]}var d=new p(m,q,b,a);d.animateX(function(){Ext.callback(r,o)});return d}};function l(a){if(!e){e=new Ext.Element.Flyweight()}e.dom=a;return e}if(Ext.isIE){function g(){var a=Function.prototype;delete a.createSequence;delete a.defer;delete a.createDelegate;delete a.createCallback;delete a.createInterceptor;window.detachEvent("onunload",g)}window.attachEvent("onunload",g)}Ext.lib.AnimBase=function(d,m,b,a){if(d){this.init(d,m,b,a)}};Ext.lib.AnimBase.prototype={toString:function(){var b=this.getEl();var a=b.id||b.tagName;return("Anim "+a)},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(d,a,b){return this.method(this.currentFrame,a,b-a,this.totalFrames)},setAttribute:function(d,a,b){if(this.patterns.noNegatives.test(d)){a=(a>0)?a:0}Ext.fly(this.getEl(),"_anim").setStyle(d,a+b)},getAttribute:function(p){var m=this.getEl();var b=l(m).getStyle(p);if(b!=="auto"&&!this.patterns.offsetUnit.test(b)){return parseFloat(b)}var o=this.patterns.offsetAttribute.exec(p)||[];var a=!!(o[3]);var d=!!(o[2]);if(d||(l(m).getStyle("position")=="absolute"&&a)){b=m["offset"+o[0].charAt(0).toUpperCase()+o[0].substr(1)]}else{b=0}return b},getDefaultUnit:function(a){if(this.patterns.defaultUnit.test(a)){return"px"}return""},animateX:function(a,d){var b=function(){this.onComplete.removeListener(b);if(typeof a=="function"){a.call(d||this,this)}};this.onComplete.addListener(b,this);this.animate()},setRuntimeAttribute:function(p){var a;var o;var m=this.attributes;this.runtimeAttributes[p]={};var b=function(r){return(typeof r!=="undefined")};if(!b(m[p]["to"])&&!b(m[p]["by"])){return false}a=(b(m[p]["from"]))?m[p]["from"]:this.getAttribute(p);if(b(m[p]["to"])){o=m[p]["to"]}else{if(b(m[p]["by"])){if(a.constructor==Array){o=[];for(var d=0,q=a.length;d<q;++d){o[d]=a[d]+m[p]["by"][d]}}else{o=a+m[p]["by"]}}}this.runtimeAttributes[p].start=a;this.runtimeAttributes[p].end=o;this.runtimeAttributes[p].unit=(b(m[p].unit))?m[p]["unit"]:this.getDefaultUnit(p)},init:function(s,d,o,u){var t=false;var r=null;var p=0;s=Ext.getDom(s);this.attributes=d||{};this.duration=o||1;this.method=u||Ext.lib.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=Ext.lib.AnimMgr.fps;this.getEl=function(){return s};this.isAnimated=function(){return t};this.getStartTime=function(){return r};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(Ext.lib.AnimMgr.fps*this.duration):this.duration;Ext.lib.AnimMgr.registerElement(this)};this.stop=function(m){if(m){this.currentFrame=this.totalFrames;this._onTween.fire()}Ext.lib.AnimMgr.stop(this)};var a=function(){this.onStart.fire();this.runtimeAttributes={};for(var m in this.attributes){this.setRuntimeAttribute(m)}t=true;p=0;r=new Date()};var b=function(){var m={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};m.toString=function(){return("duration: "+m.duration+", currentFrame: "+m.currentFrame)};this.onTween.fire(m);var v=this.runtimeAttributes;for(var w in v){this.setAttribute(w,this.doMethod(w,v[w].start,v[w].end),v[w].unit)}p+=1};var q=function(){var v=(new Date()-r)/1000;var m={duration:v,frames:p,fps:p/v};m.toString=function(){return("duration: "+m.duration+", frames: "+m.frames+", fps: "+m.fps)};t=false;p=0;this.onComplete.fire(m)};this._onStart=new Ext.util.Event(this);this.onStart=new Ext.util.Event(this);this.onTween=new Ext.util.Event(this);this._onTween=new Ext.util.Event(this);this.onComplete=new Ext.util.Event(this);this._onComplete=new Ext.util.Event(this);this._onStart.addListener(a);this._onTween.addListener(b);this._onComplete.addListener(q)}};Ext.lib.AnimMgr=new function(){var d=null;var m=[];var o=0;this.fps=1000;this.delay=1;this.registerElement=function(p){m[m.length]=p;o+=1;p._onStart.fire();this.start()};this.unRegister=function(p,q){p._onComplete.fire();q=q||a(p);if(q!=-1){m.splice(q,1)}o-=1;if(o<=0){this.stop()}};this.start=function(){if(d===null){d=setInterval(this.run,this.delay)}};this.stop=function(p){if(!p){clearInterval(d);for(var q=0,r=m.length;q<r;++q){if(m[0].isAnimated()){this.unRegister(m[0],0)}}m=[];d=null;o=0}else{this.unRegister(p)}};this.run=function(){for(var p=0,r=m.length;p<r;++p){var q=m[p];if(!q||!q.isAnimated()){continue}if(q.currentFrame<q.totalFrames||q.totalFrames===null){q.currentFrame+=1;if(q.useSeconds){b(q)}q._onTween.fire()}else{Ext.lib.AnimMgr.stop(q,p)}}};var a=function(p){for(var q=0,r=m.length;q<r;++q){if(m[q]==p){return q}}return -1};var b=function(r){var u=r.totalFrames;var p=r.currentFrame;var q=(r.currentFrame*r.duration*1000/r.totalFrames);var s=(new Date()-r.getStartTime());var t=0;if(s<r.duration*1000){t=Math.round((s/q-1)*r.currentFrame)}else{t=u-(p+1)}if(t>0&&isFinite(t)){if(r.currentFrame+t>=u){t=u-(p+1)}r.currentFrame+=t}}};Ext.lib.Bezier=new function(){this.getPosition=function(b,d){var a=b.length;var m=[];for(var o=0;o<a;++o){m[o]=[b[o][0],b[o][1]]}for(var p=1;p<a;++p){for(o=0;o<a-p;++o){m[o][0]=(1-d)*m[o][0]+d*m[parseInt(o+1,10)][0];m[o][1]=(1-d)*m[o][1]+d*m[parseInt(o+1,10)][1]}}return[m[0][0],m[0][1]]}};(function(){Ext.lib.ColorAnim=function(p,q,o,m){Ext.lib.ColorAnim.superclass.constructor.call(this,p,q,o,m)};Ext.extend(Ext.lib.ColorAnim,Ext.lib.AnimBase);var b=Ext.lib;var a=b.ColorAnim.superclass;var d=b.ColorAnim.prototype;d.toString=function(){var o=this.getEl();var m=o.id||o.tagName;return("ColorAnim "+m)};d.patterns.color=/color$/i;d.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;d.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;d.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;d.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;d.parseColor=function(o){if(o.length==3){return o}var m=this.patterns.hex.exec(o);if(m&&m.length==4){return[parseInt(m[1],16),parseInt(m[2],16),parseInt(m[3],16)]}m=this.patterns.rgb.exec(o);if(m&&m.length==4){return[parseInt(m[1],10),parseInt(m[2],10),parseInt(m[3],10)]}m=this.patterns.hex3.exec(o);if(m&&m.length==4){return[parseInt(m[1]+m[1],16),parseInt(m[2]+m[2],16),parseInt(m[3]+m[3],16)]}return null};d.getAttribute=function(q){var o=this.getEl();if(this.patterns.color.test(q)){var m=l(o).getStyle(q);if(this.patterns.transparent.test(m)){var p=o.parentNode;m=l(p).getStyle(q);while(p&&this.patterns.transparent.test(m)){p=p.parentNode;m=l(p).getStyle(q);if(p.tagName.toUpperCase()=="HTML"){m="#fff"}}}}else{m=a.getAttribute.call(this,q)}return m};d.doMethod=function(r,t,q){var o;if(this.patterns.color.test(r)){o=[];for(var p=0,s=t.length;p<s;++p){o[p]=a.doMethod.call(this,r,t[p],q[p])}o="rgb("+Math.floor(o[0])+","+Math.floor(o[1])+","+Math.floor(o[2])+")"}else{o=a.doMethod.call(this,r,t,q)}return o};d.setRuntimeAttribute=function(r){a.setRuntimeAttribute.call(this,r);if(this.patterns.color.test(r)){var p=this.attributes;var t=this.parseColor(this.runtimeAttributes[r].start);var q=this.parseColor(this.runtimeAttributes[r].end);if(typeof p[r]["to"]==="undefined"&&typeof p[r]["by"]!=="undefined"){q=this.parseColor(p[r].by);for(var o=0,s=t.length;o<s;++o){q[o]=t[o]+q[o]}}this.runtimeAttributes[r].start=t;this.runtimeAttributes[r].end=q}}})();Ext.lib.Easing={easeNone:function(d,m,a,b){return a*d/b+m},easeIn:function(d,m,a,b){return a*(d/=b)*d+m},easeOut:function(d,m,a,b){return -a*(d/=b)*(d-2)+m},easeBoth:function(d,m,a,b){if((d/=b/2)<1){return a/2*d*d+m}return -a/2*((--d)*(d-2)-1)+m},easeInStrong:function(d,m,a,b){return a*(d/=b)*d*d*d+m},easeOutStrong:function(d,m,a,b){return -a*((d=d/b-1)*d*d*d-1)+m},easeBothStrong:function(d,m,a,b){if((d/=b/2)<1){return a/2*d*d*d*d+m}return -a/2*((d-=2)*d*d*d-2)+m},elasticIn:function(o,q,a,b,p,d){if(o==0){return q}if((o/=b)==1){return q+a}if(!d){d=b*0.3}if(!p||p<Math.abs(a)){p=a;var m=d/4}else{var m=d/(2*Math.PI)*Math.asin(a/p)}return -(p*Math.pow(2,10*(o-=1))*Math.sin((o*b-m)*(2*Math.PI)/d))+q},elasticOut:function(o,q,a,b,p,d){if(o==0){return q}if((o/=b)==1){return q+a}if(!d){d=b*0.3}if(!p||p<Math.abs(a)){p=a;var m=d/4}else{var m=d/(2*Math.PI)*Math.asin(a/p)}return p*Math.pow(2,-10*o)*Math.sin((o*b-m)*(2*Math.PI)/d)+a+q},elasticBoth:function(o,q,a,b,p,d){if(o==0){return q}if((o/=b/2)==2){return q+a}if(!d){d=b*(0.3*1.5)}if(!p||p<Math.abs(a)){p=a;var m=d/4}else{var m=d/(2*Math.PI)*Math.asin(a/p)}if(o<1){return -0.5*(p*Math.pow(2,10*(o-=1))*Math.sin((o*b-m)*(2*Math.PI)/d))+q}return p*Math.pow(2,-10*(o-=1))*Math.sin((o*b-m)*(2*Math.PI)/d)*0.5+a+q},backIn:function(m,o,a,b,d){if(typeof d=="undefined"){d=1.70158}return a*(m/=b)*m*((d+1)*m-d)+o},backOut:function(m,o,a,b,d){if(typeof d=="undefined"){d=1.70158}return a*((m=m/b-1)*m*((d+1)*m+d)+1)+o},backBoth:function(m,o,a,b,d){if(typeof d=="undefined"){d=1.70158}if((m/=b/2)<1){return a/2*(m*m*(((d*=(1.525))+1)*m-d))+o}return a/2*((m-=2)*m*(((d*=(1.525))+1)*m+d)+2)+o},bounceIn:function(d,m,a,b){return a-Ext.lib.Easing.bounceOut(b-d,0,a,b)+m},bounceOut:function(d,m,a,b){if((d/=b)<(1/2.75)){return a*(7.5625*d*d)+m}else{if(d<(2/2.75)){return a*(7.5625*(d-=(1.5/2.75))*d+0.75)+m}else{if(d<(2.5/2.75)){return a*(7.5625*(d-=(2.25/2.75))*d+0.9375)+m}}}return a*(7.5625*(d-=(2.625/2.75))*d+0.984375)+m},bounceBoth:function(d,m,a,b){if(d<b/2){return Ext.lib.Easing.bounceIn(d*2,0,a,b)*0.5+m}return Ext.lib.Easing.bounceOut(d*2-b,0,a,b)*0.5+a*0.5+m}};(function(){Ext.lib.Motion=function(r,s,q,p){if(r){Ext.lib.Motion.superclass.constructor.call(this,r,s,q,p)}};Ext.extend(Ext.lib.Motion,Ext.lib.ColorAnim);var b=Ext.lib;var a=b.Motion.superclass;var m=b.Motion.prototype;m.toString=function(){var q=this.getEl();var p=q.id||q.tagName;return("Motion "+p)};m.patterns.points=/^points$/i;m.setAttribute=function(r,p,q){if(this.patterns.points.test(r)){q=q||"px";a.setAttribute.call(this,"left",p[0],q);a.setAttribute.call(this,"top",p[1],q)}else{a.setAttribute.call(this,r,p,q)}};m.getAttribute=function(q){if(this.patterns.points.test(q)){var p=[a.getAttribute.call(this,"left"),a.getAttribute.call(this,"top")]}else{p=a.getAttribute.call(this,q)}return p};m.doMethod=function(s,t,r){var p=null;if(this.patterns.points.test(s)){var q=this.method(this.currentFrame,0,100,this.totalFrames)/100;p=b.Bezier.getPosition(this.runtimeAttributes[s],q)}else{p=a.doMethod.call(this,s,t,r)}return p};m.setRuntimeAttribute=function(F){if(this.patterns.points.test(F)){var D=this.getEl();var B=this.attributes;var E;var w=B.points.control||[];var C;var v,t;if(w.length>0&&!Ext.isArray(w[0])){w=[w]}else{var z=[];for(v=0,t=w.length;v<t;++v){z[v]=w[v]}w=z}Ext.fly(D,"_anim").position();if(d(B.points.from)){Ext.lib.Dom.setXY(D,B.points.from)}else{Ext.lib.Dom.setXY(D,Ext.lib.Dom.getXY(D))}E=this.getAttribute("points");if(d(B.points.to)){C=o.call(this,B.points.to,E);var u=Ext.lib.Dom.getXY(this.getEl());for(v=0,t=w.length;v<t;++v){w[v]=o.call(this,w[v],E)}}else{if(d(B.points.by)){C=[E[0]+B.points.by[0],E[1]+B.points.by[1]];for(v=0,t=w.length;v<t;++v){w[v]=[E[0]+w[v][0],E[1]+w[v][1]]}}}this.runtimeAttributes[F]=[E];if(w.length>0){this.runtimeAttributes[F]=this.runtimeAttributes[F].concat(w)}this.runtimeAttributes[F][this.runtimeAttributes[F].length]=C}else{a.setRuntimeAttribute.call(this,F)}};var o=function(r,p){var q=Ext.lib.Dom.getXY(this.getEl());r=[r[0]-q[0]+p[0],r[1]-q[1]+p[1]];return r};var d=function(p){return(typeof p!=="undefined")}})();(function(){Ext.lib.Scroll=function(p,q,o,m){if(p){Ext.lib.Scroll.superclass.constructor.call(this,p,q,o,m)}};Ext.extend(Ext.lib.Scroll,Ext.lib.ColorAnim);var b=Ext.lib;var a=b.Scroll.superclass;var d=b.Scroll.prototype;d.toString=function(){var o=this.getEl();var m=o.id||o.tagName;return("Scroll "+m)};d.doMethod=function(q,m,p){var o=null;if(q=="scroll"){o=[this.method(this.currentFrame,m[0],p[0]-m[0],this.totalFrames),this.method(this.currentFrame,m[1],p[1]-m[1],this.totalFrames)]}else{o=a.doMethod.call(this,q,m,p)}return o};d.getAttribute=function(p){var m=null;var o=this.getEl();if(p=="scroll"){m=[o.scrollLeft,o.scrollTop]}else{m=a.getAttribute.call(this,p)}return m};d.setAttribute=function(q,m,o){var p=this.getEl();if(q=="scroll"){p.scrollLeft=m[0];p.scrollTop=m[1]}else{a.setAttribute.call(this,q,m,o)}}})()})();Ext.DomHelper=function(){var q=null;var w=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i;var D=/^table|tbody|tr|td$/i;var E=function(b){if(typeof b=="string"){return b}var l="";if(Ext.isArray(b)){for(var e=0,h=b.length;e<h;e++){l+=E(b[e])}return l}if(!b.tag){b.tag="div"}l+="<"+b.tag;for(var m in b){if(m=="tag"||m=="children"||m=="cn"||m=="html"||typeof b[m]=="function"){continue}if(m=="style"){var d=b.style;if(typeof d=="function"){d=d.call()}if(typeof d=="string"){l+=' style="'+d+'"'}else{if(typeof d=="object"){l+=' style="';for(var g in d){if(typeof d[g]!="function"){l+=g+":"+d[g]+";"}}l+='"'}}}else{if(m=="cls"){l+=' class="'+b.cls+'"'}else{if(m=="htmlFor"){l+=' for="'+b.htmlFor+'"'}else{l+=" "+m+'="'+b[m]+'"'}}}}if(w.test(b.tag)){l+="/>"}else{l+=">";var a=b.children||b.cn;if(a){l+=E(a)}else{if(b.html){l+=b.html}}l+="</"+b.tag+">"}return l};var p=function(b,l){var d;if(Ext.isArray(b)){d=document.createDocumentFragment();for(var e=0,h=b.length;e<h;e++){p(b[e],d)}}else{if(typeof b=="string"){d=document.createTextNode(b)}else{d=document.createElement(b.tag||"div");var g=!!d.setAttribute;for(var m in b){if(m=="tag"||m=="children"||m=="cn"||m=="html"||m=="style"||typeof b[m]=="function"){continue}if(m=="cls"){d.className=b.cls}else{if(g){d.setAttribute(m,b[m])}else{d[m]=b[m]}}}Ext.DomHelper.applyStyles(d,b.style);var a=b.children||b.cn;if(a){p(a,d)}else{if(b.html){d.innerHTML=b.html}}}}if(l){l.appendChild(d)}return d};var t=function(a,d,e,b){q.innerHTML=[d,e,b].join("");var h=-1,g=q;while(++h<a){g=g.firstChild}return g};var s="<table>",z="</table>",C=s+"<tbody>",r="</tbody>"+z,u=C+"<tr>",B="</tr>"+r;var v=function(h,g,d,e){if(!q){q=document.createElement("div")}var b;var a=null;if(h=="td"){if(g=="afterbegin"||g=="beforeend"){return}if(g=="beforebegin"){a=d;d=d.parentNode}else{a=d.nextSibling;d=d.parentNode}b=t(4,u,e,B)}else{if(h=="tr"){if(g=="beforebegin"){a=d;d=d.parentNode;b=t(3,C,e,r)}else{if(g=="afterend"){a=d.nextSibling;d=d.parentNode;b=t(3,C,e,r)}else{if(g=="afterbegin"){a=d.firstChild}b=t(4,u,e,B)}}}else{if(h=="tbody"){if(g=="beforebegin"){a=d;d=d.parentNode;b=t(2,s,e,z)}else{if(g=="afterend"){a=d.nextSibling;d=d.parentNode;b=t(2,s,e,z)}else{if(g=="afterbegin"){a=d.firstChild}b=t(3,C,e,r)}}}else{if(g=="beforebegin"||g=="afterend"){return}if(g=="afterbegin"){a=d.firstChild}b=t(2,s,e,z)}}}d.insertBefore(b,a);return b};return{useDom:false,markup:function(a){return E(a)},applyStyles:function(d,b){if(b){d=Ext.fly(d);if(typeof b=="string"){var e=/\s?([a-z\-]*)\:\s?([^;]*);?/gi;var a;while((a=e.exec(b))!=null){d.setStyle(a[1],a[2])}}else{if(typeof b=="object"){for(var g in b){d.setStyle(g,b[g])}}else{if(typeof b=="function"){Ext.DomHelper.applyStyles(d,b.call())}}}}},insertHtml:function(e,b,d){e=e.toLowerCase();if(b.insertAdjacentHTML){if(D.test(b.tagName)){var g;if(g=v(b.tagName.toLowerCase(),e,b,d)){return g}}switch(e){case"beforebegin":b.insertAdjacentHTML("BeforeBegin",d);return b.previousSibling;case"afterbegin":b.insertAdjacentHTML("AfterBegin",d);return b.firstChild;case"beforeend":b.insertAdjacentHTML("BeforeEnd",d);return b.lastChild;case"afterend":b.insertAdjacentHTML("AfterEnd",d);return b.nextSibling}throw'Illegal insertion point -> "'+e+'"'}var h=b.ownerDocument.createRange();var a;switch(e){case"beforebegin":h.setStartBefore(b);a=h.createContextualFragment(d);b.parentNode.insertBefore(a,b);return b.previousSibling;case"afterbegin":if(b.firstChild){h.setStartBefore(b.firstChild);a=h.createContextualFragment(d);b.insertBefore(a,b.firstChild);return b.firstChild}else{b.innerHTML=d;return b.firstChild}case"beforeend":if(b.lastChild){h.setStartAfter(b.lastChild);a=h.createContextualFragment(d);b.appendChild(a);return b.lastChild}else{b.innerHTML=d;return b.lastChild}case"afterend":h.setStartAfter(b);a=h.createContextualFragment(d);b.parentNode.insertBefore(a,b.nextSibling);return b.nextSibling}throw'Illegal insertion point -> "'+e+'"'},insertBefore:function(d,a,b){return this.doInsert(d,a,b,"beforeBegin")},insertAfter:function(d,a,b){return this.doInsert(d,a,b,"afterEnd","nextSibling")},insertFirst:function(d,a,b){return this.doInsert(d,a,b,"afterBegin","firstChild")},doInsert:function(e,b,d,a,g){e=Ext.getDom(e);var h;if(this.useDom){h=p(b,null);(g==="firstChild"?e:e.parentNode).insertBefore(h,g?e[g]:e)}else{var l=E(b);h=this.insertHtml(a,e,l)}return d?Ext.get(h,true):h},append:function(d,a,b){d=Ext.getDom(d);var e;if(this.useDom){e=p(a,null);d.appendChild(e)}else{var g=E(a);e=this.insertHtml("beforeEnd",d,g)}return b?Ext.get(e,true):e},overwrite:function(d,a,b){d=Ext.getDom(d);d.innerHTML=E(a);return b?Ext.get(d.firstChild,true):d.firstChild},createTemplate:function(a){var b=E(a);return new Ext.Template(b)}}}();Ext.Template=function(h){var o=arguments;if(Ext.isArray(h)){h=h.join("")}else{if(o.length>1){var m=[];for(var l=0,a=o.length;l<a;l++){if(typeof o[l]=="object"){Ext.apply(this,o[l])}else{m[m.length]=o[l]}}h=m.join("")}}this.html=h;if(this.compiled){this.compile()}};Ext.Template.prototype={applyTemplate:function(g){if(this.compiled){return this.compiled(g)}var h=this.disableFormats!==true;var l=Ext.util.Format,o=this;var m=function(d,a,q,b){if(q&&h){if(q.substr(0,5)=="this."){return o.call(q.substr(5),g[a],g)}else{if(b){var r=/^\s*['"](.*)["']\s*$/;b=b.split(",");for(var s=0,e=b.length;s<e;s++){b[s]=b[s].replace(r,"$1")}b=[g[a]].concat(b)}else{b=[g[a]]}return l[q].apply(l,b)}}else{return g[a]!==undefined?g[a]:""}};return this.html.replace(this.re,m)},set:function(e,d){this.html=e;this.compiled=null;if(d){this.compile()}return this},disableFormats:false,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var fm=Ext.util.Format;var useF=this.disableFormats!==true;var sep=Ext.isGecko?"+":",";var fn=function(m,name,format,args){if(format&&useF){args=args?","+args:"";if(format.substr(0,5)!="this."){format="fm."+format+"("}else{format='this.call("'+format.substr(5)+'", ';args=", values"}}else{args="";format="(values['"+name+"'] == undefined ? '' : "}return"'"+sep+format+"values['"+name+"']"+args+")"+sep+"'"};var body;if(Ext.isGecko){body="this.compiled = function(values){ return '"+this.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn)+"';};"}else{body=["this.compiled = function(values){ return ['"];body.push(this.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn));body.push("'].join('');};");body=body.join("")}eval(body);return this},call:function(g,d,e){return this[g](d,e)},insertFirst:function(d,e,g){return this.doInsert("afterBegin",d,e,g)},insertBefore:function(d,e,g){return this.doInsert("beforeBegin",d,e,g)},insertAfter:function(d,e,g){return this.doInsert("afterEnd",d,e,g)},append:function(d,e,g){return this.doInsert("beforeEnd",d,e,g)},doInsert:function(o,l,g,h){l=Ext.getDom(l);var m=Ext.DomHelper.insertHtml(o,l,this.applyTemplate(g));return h?Ext.get(m,true):m},overwrite:function(d,e,g){d=Ext.getDom(d);d.innerHTML=this.applyTemplate(e);return g?Ext.get(d.firstChild,true):d.firstChild}};Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;Ext.DomHelper.Template=Ext.Template;Ext.Template.from=function(d,e){d=Ext.getDom(d);return new Ext.Template(d.value||d.innerHTML,e||"")};Ext.DomQuery=function(){var cache={},simpleCache={},valueCache={};var nonSpace=/\S/;var trimRe=/^\s+|\s+$/g;var tplRe=/\{(\d+)\}/g;var modeRe=/^(\s?[\/>+~]\s?|\s|$)/;var tagTokenRe=/^(#)?([\w-\*]+)/;var nthRe=/(\d*)n\+?(\d*)/,nthRe2=/\D/;function child(p,index){var i=0;var n=p.firstChild;while(n){if(n.nodeType==1){if(++i==index){return n}}n=n.nextSibling}return null}function next(n){while((n=n.nextSibling)&&n.nodeType!=1){}return n}function prev(n){while((n=n.previousSibling)&&n.nodeType!=1){}return n}function children(d){var n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!nonSpace.test(n.nodeValue)){d.removeChild(n)}else{n.nodeIndex=++ni}n=nx}return this}function byClassName(c,a,v){if(!v){return c}var r=[],ri=-1,cn;for(var i=0,ci;ci=c[i];i++){if((" "+ci.className+" ").indexOf(v)!=-1){r[++ri]=ci}}return r}function attrValue(n,attr){if(!n.tagName&&typeof n.length!="undefined"){n=n[0]}if(!n){return null}if(attr=="for"){return n.htmlFor}if(attr=="class"||attr=="className"){return n.className}return n.getAttribute(attr)||n[attr]}function getNodes(ns,mode,tagName){var result=[],ri=-1,cs;if(!ns){return result}tagName=tagName||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns]}if(!mode){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(tagName);for(var j=0,ci;ci=cs[j];j++){result[++ri]=ci}}}else{if(mode=="/"||mode==">"){var utag=tagName.toUpperCase();for(var i=0,ni,cn;ni=ns[i];i++){cn=ni.children||ni.childNodes;for(var j=0,cj;cj=cn[j];j++){if(cj.nodeName==utag||cj.nodeName==tagName||tagName=="*"){result[++ri]=cj}}}}else{if(mode=="+"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(n&&(n.nodeName==utag||n.nodeName==tagName||tagName=="*")){result[++ri]=n}}}else{if(mode=="~"){for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&(n.nodeType!=1||(tagName=="*"||n.tagName.toLowerCase()!=tagName))){}if(n){result[++ri]=n}}}}}}return result}function concat(a,b){if(b.slice){return a.concat(b)}for(var i=0,l=b.length;i<l;i++){a[a.length]=b[i]}return a}function byTag(cs,tagName){if(cs.tagName||cs==document){cs=[cs]}if(!tagName){return cs}var r=[],ri=-1;tagName=tagName.toLowerCase();for(var i=0,ci;ci=cs[i];i++){if(ci.nodeType==1&&ci.tagName.toLowerCase()==tagName){r[++ri]=ci}}return r}function byId(cs,attr,id){if(cs.tagName||cs==document){cs=[cs]}if(!id){return cs}var r=[],ri=-1;for(var i=0,ci;ci=cs[i];i++){if(ci&&ci.id==id){r[++ri]=ci;return r}}return r}function byAttribute(cs,attr,value,op,custom){var r=[],ri=-1,st=custom=="{";var f=Ext.DomQuery.operators[op];for(var i=0,ci;ci=cs[i];i++){var a;if(st){a=Ext.DomQuery.getStyle(ci,attr)}else{if(attr=="class"||attr=="className"){a=ci.className}else{if(attr=="for"){a=ci.htmlFor}else{if(attr=="href"){a=ci.getAttribute("href",2)}else{a=ci.getAttribute(attr)}}}}if((f&&f(a,value))||(!f&&a)){r[++ri]=ci}}return r}function byPseudo(cs,name,value){return Ext.DomQuery.pseudos[name](cs,value)}var isIE=window.ActiveXObject?true:false;eval("var batch = 30803;");var key=30803;function nodupIEXml(cs){var d=++key;cs[0].setAttribute("_nodup",d);var r=[cs[0]];for(var i=1,len=cs.length;i<len;i++){var c=cs[i];if(!c.getAttribute("_nodup")!=d){c.setAttribute("_nodup",d);r[r.length]=c}}for(var i=0,len=cs.length;i<len;i++){cs[i].removeAttribute("_nodup")}return r}function nodup(cs){if(!cs){return[]}var len=cs.length,c,i,r=cs,cj,ri=-1;if(!len||typeof cs.nodeType!="undefined"||len==1){return cs}if(isIE&&typeof cs[0].selectSingleNode!="undefined"){return nodupIEXml(cs)}var d=++key;cs[0]._nodup=d;for(i=1;c=cs[i];i++){if(c._nodup!=d){c._nodup=d}else{r=[];for(var j=0;j<i;j++){r[++ri]=cs[j]}for(j=i+1;cj=cs[j];j++){if(cj._nodup!=d){cj._nodup=d;r[++ri]=cj}}return r}}return r}function quickDiffIEXml(c1,c2){var d=++key;for(var i=0,len=c1.length;i<len;i++){c1[i].setAttribute("_qdiff",d)}var r=[];for(var i=0,len=c2.length;i<len;i++){if(c2[i].getAttribute("_qdiff")!=d){r[r.length]=c2[i]}}for(var i=0,len=c1.length;i<len;i++){c1[i].removeAttribute("_qdiff")}return r}function quickDiff(c1,c2){var len1=c1.length;if(!len1){return c2}if(isIE&&c1[0].selectSingleNode){return quickDiffIEXml(c1,c2)}var d=++key;for(var i=0;i<len1;i++){c1[i]._qdiff=d}var r=[];for(var i=0,len=c2.length;i<len;i++){if(c2[i]._qdiff!=d){r[r.length]=c2[i]}}return r}function quickId(ns,mode,root,id){if(ns==root){var d=root.ownerDocument||root;return d.getElementById(id)}ns=getNodes(ns,mode,"*");return byId(ns,null,id)}return{getStyle:function(el,name){return Ext.fly(el).getStyle(name)},compile:function(path,type){type=type||"select";var fn=["var f = function(root){\n var mode; ++batch; var n = root || document;\n"];var q=path,mode,lq;var tk=Ext.DomQuery.matchers;var tklen=tk.length;var mm;var lmode=q.match(modeRe);if(lmode&&lmode[1]){fn[fn.length]='mode="'+lmode[1].replace(trimRe,"")+'";';q=q.replace(lmode[1],"")}while(path.substr(0,1)=="/"){path=path.substr(1)}while(q&&lq!=q){lq=q;var tm=q.match(tagTokenRe);if(type=="select"){if(tm){if(tm[1]=="#"){fn[fn.length]='n = quickId(n, mode, root, "'+tm[2]+'");'}else{fn[fn.length]='n = getNodes(n, mode, "'+tm[2]+'");'}q=q.replace(tm[0],"")}else{if(q.substr(0,1)!="@"){fn[fn.length]='n = getNodes(n, mode, "*");'}}}else{if(tm){if(tm[1]=="#"){fn[fn.length]='n = byId(n, null, "'+tm[2]+'");'}else{fn[fn.length]='n = byTag(n, "'+tm[2]+'");'}q=q.replace(tm[0],"")}}while(!(mm=q.match(modeRe))){var matched=false;for(var j=0;j<tklen;j++){var t=tk[j];var m=q.match(t.re);if(m){fn[fn.length]=t.select.replace(tplRe,function(x,i){return m[i]});q=q.replace(m[0],"");matched=true;break}}if(!matched){throw'Error parsing selector, parsing failed at "'+q+'"'}}if(mm[1]){fn[fn.length]='mode="'+mm[1].replace(trimRe,"")+'";';q=q.replace(mm[1],"")}}fn[fn.length]="return nodup(n);\n}";eval(fn.join(""));return f},select:function(path,root,type){if(!root||root==document){root=document}if(typeof root=="string"){root=document.getElementById(root)}var paths=path.split(",");var results=[];for(var i=0,len=paths.length;i<len;i++){var p=paths[i].replace(trimRe,"");if(!cache[p]){cache[p]=Ext.DomQuery.compile(p);if(!cache[p]){throw p+" is not a valid selector"}}var result=cache[p](root);if(result&&result!=document){results=results.concat(result)}}if(paths.length>1){return nodup(results)}return results},selectNode:function(path,root){return Ext.DomQuery.select(path,root)[0]},selectValue:function(path,root,defaultValue){path=path.replace(trimRe,"");if(!valueCache[path]){valueCache[path]=Ext.DomQuery.compile(path,"select")}var n=valueCache[path](root);n=n[0]?n[0]:n;var v=(n&&n.firstChild?n.firstChild.nodeValue:null);return((v===null||v===undefined||v==="")?defaultValue:v)},selectNumber:function(path,root,defaultValue){var v=Ext.DomQuery.selectValue(path,root,defaultValue||0);return parseFloat(v)},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el)}var isArray=Ext.isArray(el);var result=Ext.DomQuery.filter(isArray?el:[el],ss);return isArray?(result.length==el.length):(result.length>0)},filter:function(els,ss,nonMatches){ss=ss.replace(trimRe,"");if(!simpleCache[ss]){simpleCache[ss]=Ext.DomQuery.compile(ss,"simple")}var result=simpleCache[ss](els);return nonMatches?quickDiff(result,els):result},matchers:[{re:/^\.([\w-]+)/,select:'n = byClassName(n, null, " {1} ");'},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'},{re:/^#([\w-]+)/,select:'n = byId(n, null, "{1}");'},{re:/^@([\w-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],operators:{"=":function(a,v){return a==v},"!=":function(a,v){return a!=v},"^=":function(a,v){return a&&a.substr(0,v.length)==v},"$=":function(a,v){return a&&a.substr(a.length-v.length)==v},"*=":function(a,v){return a&&a.indexOf(v)!==-1},"%=":function(a,v){return(a%v)==0},"|=":function(a,v){return a&&(a==v||a.substr(0,v.length+1)==v+"-")},"~=":function(a,v){return a&&(" "+a+" ").indexOf(" "+v+" ")!=-1}},pseudos:{"first-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.previousSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"last-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"nth-child":function(c,a){var r=[],ri=-1;var m=nthRe.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!nthRe2.test(a)&&"n+"+a||a);var f=(m[1]||1)-0,l=m[2]-0;for(var i=0,n;n=c[i];i++){var pn=n.parentNode;if(batch!=pn._batch){var j=0;for(var cn=pn.firstChild;cn;cn=cn.nextSibling){if(cn.nodeType==1){cn.nodeIndex=++j}}pn._batch=batch}if(f==1){if(l==0||n.nodeIndex==l){r[++ri]=n}}else{if((n.nodeIndex+l)%f==0){r[++ri]=n}}}return r},"only-child":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(!prev(ci)&&!next(ci)){r[++ri]=ci}}return r},empty:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var cns=ci.childNodes,j=0,cn,empty=true;while(cn=cns[j]){++j;if(cn.nodeType==1||cn.nodeType==3){empty=false;break}}if(empty){r[++ri]=ci}}return r},contains:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if((ci.textContent||ci.innerText||"").indexOf(v)!=-1){r[++ri]=ci}}return r},nodeValue:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[++ri]=ci}}return r},checked:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[++ri]=ci}}return r},not:function(c,ss){return Ext.DomQuery.filter(c,ss,true)},any:function(c,selectors){var ss=selectors.split("|");var r=[],ri=-1,s;for(var i=0,ci;ci=c[i];i++){for(var j=0;s=ss[j];j++){if(Ext.DomQuery.is(ci,s)){r[++ri]=ci;break}}}return r},odd:function(c){return this["nth-child"](c,"odd")},even:function(c){return this["nth-child"](c,"even")},nth:function(c,a){return c[a-1]||[]},first:function(c){return c[0]||[]},last:function(c){return c[c.length-1]||[]},has:function(c,ss){var s=Ext.DomQuery.select;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[++ri]=ci}}return r},next:function(c,ss){var is=Ext.DomQuery.is;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=next(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r},prev:function(c,ss){var is=Ext.DomQuery.is;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=prev(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r}}}}();Ext.query=Ext.DomQuery.select;Ext.util.Observable=function(){if(this.listeners){this.on(this.listeners);delete this.listeners}};Ext.util.Observable.prototype={fireEvent:function(){if(this.eventsSuspended!==true){var b=this.events[arguments[0].toLowerCase()];if(typeof b=="object"){return b.fire.apply(b,Array.prototype.slice.call(arguments,1))}}return true},filterOptRe:/^(?:scope|delay|buffer|single)$/,addListener:function(l,q,e,m){if(typeof l=="object"){m=l;for(var o in m){if(this.filterOptRe.test(o)){continue}if(typeof m[o]=="function"){this.addListener(o,m[o],m.scope,m)}else{this.addListener(o,m[o].fn,m[o].scope,m[o])}}return}m=(!m||typeof m=="boolean")?{}:m;l=l.toLowerCase();var p=this.events[l]||true;if(typeof p=="boolean"){p=new Ext.util.Event(this,l);this.events[l]=p}p.addListener(q,e,m)},removeListener:function(g,l,e){var h=this.events[g.toLowerCase()];if(typeof h=="object"){h.removeListener(l,e)}},purgeListeners:function(){for(var b in this.events){if(typeof this.events[b]=="object"){this.events[b].clearListeners()}}},relayEvents:function(m,p){var o=function(a){return function(){return this.fireEvent.apply(this,Ext.combine(a,Array.prototype.slice.call(arguments,0)))}};for(var q=0,l=p.length;q<l;q++){var h=p[q];if(!this.events[h]){this.events[h]=true}m.on(h,o(h),this)}},addEvents:function(g){if(!this.events){this.events={}}if(typeof g=="string"){for(var h=0,a=arguments,l;l=a[h];h++){if(!this.events[a[h]]){this.events[a[h]]=true}}}else{Ext.applyIf(this.events,g)}},hasListener:function(e){var d=this.events[e];return typeof d=="object"&&d.listeners.length>0},suspendEvents:function(){this.eventsSuspended=true},resumeEvents:function(){this.eventsSuspended=false},getMethodEvent:function(m){if(!this.methodEvents){this.methodEvents={}}var o=this.methodEvents[m];if(!o){o={};this.methodEvents[m]=o;o.originalFn=this[m];o.methodName=m;o.before=[];o.after=[];var r,e,q;var p=this;var l=function(a,b,d){if((e=a.apply(b||p,d))!==undefined){if(typeof e==="object"){if(e.returnValue!==undefined){r=e.returnValue}else{r=e}if(e.cancel===true){q=true}}else{if(e===false){q=true}else{r=e}}}};this[m]=function(){r=e=undefined;q=false;var b=Array.prototype.slice.call(arguments,0);for(var a=0,d=o.before.length;a<d;a++){l(o.before[a].fn,o.before[a].scope,b);if(q){return r}}if((e=o.originalFn.apply(p,b))!==undefined){r=e}for(var a=0,d=o.after.length;a<d;a++){l(o.after[a].fn,o.after[a].scope,b);if(q){return r}}return r}}return o},beforeMethod:function(h,e,g){var l=this.getMethodEvent(h);l.before.push({fn:e,scope:g})},afterMethod:function(h,e,g){var l=this.getMethodEvent(h);l.after.push({fn:e,scope:g})},removeMethodListener:function(m,p,q){var o=this.getMethodEvent(m);for(var e=0,l=o.before.length;e<l;e++){if(o.before[e].fn==p&&o.before[e].scope==q){o.before.splice(e,1);return}}for(var e=0,l=o.after.length;e<l;e++){if(o.after[e].fn==p&&o.after[e].scope==q){o.after.splice(e,1);return}}}};Ext.util.Observable.prototype.on=Ext.util.Observable.prototype.addListener;Ext.util.Observable.prototype.un=Ext.util.Observable.prototype.removeListener;Ext.util.Observable.capture=function(g,d,e){g.fireEvent=g.fireEvent.createInterceptor(d,e)};Ext.util.Observable.releaseCapture=function(b){b.fireEvent=Ext.util.Observable.prototype.fireEvent};(function(){var d=function(b,a,h){var l=new Ext.util.DelayedTask();return function(){l.delay(a.buffer,b,h,Array.prototype.slice.call(arguments,0))}};var g=function(b,a,h,l){return function(){a.removeListener(h,l);return b.apply(l,arguments)}};var e=function(b,a,h){return function(){var l=Array.prototype.slice.call(arguments,0);setTimeout(function(){b.apply(h,l)},a.delay||10)}};Ext.util.Event=function(a,b){this.name=b;this.obj=a;this.listeners=[]};Ext.util.Event.prototype={addListener:function(a,b,l){b=b||this.obj;if(!this.isListening(a,b)){var m=this.createListener(a,b,l);if(!this.firing){this.listeners.push(m)}else{this.listeners=this.listeners.slice(0);this.listeners.push(m)}}},createListener:function(b,h,a){a=a||{};h=h||this.obj;var m={fn:b,scope:h,options:a};var l=b;if(a.delay){l=e(l,a,h)}if(a.single){l=g(l,this,b,h)}if(a.buffer){l=d(l,a,h)}m.fireFn=l;return m},findListener:function(a,b){b=b||this.obj;var o=this.listeners;for(var l=0,q=o.length;l<q;l++){var p=o[l];if(p.fn==a&&p.scope==b){return l}}return -1},isListening:function(a,b){return this.findListener(a,b)!=-1},removeListener:function(a,b){var h;if((h=this.findListener(a,b))!=-1){if(!this.firing){this.listeners.splice(h,1)}else{this.listeners=this.listeners.slice(0);this.listeners.splice(h,1)}return true}return false},clearListeners:function(){this.listeners=[]},fire:function(){var o=this.listeners,a,q=o.length;if(q>0){this.firing=true;var l=Array.prototype.slice.call(arguments,0);for(var b=0;b<q;b++){var p=o[b];if(p.fireFn.apply(p.scope||this.obj||window,arguments)===false){this.firing=false;return false}}this.firing=false}return true}}})();Ext.EventManager=function(){var z,H,L=false;var K,B,Q,F;var I=Ext.lib.Event;var G=Ext.lib.Dom;var W="Ext";var O={};var J=function(e,h,g,m,a){var b=Ext.id(e);if(!O[b]){O[b]={}}var d=O[b];if(!d[h]){d[h]=[]}var l=d[h];l.push({id:b,ename:h,fn:g,wrap:m,scope:a});I.on(e,h,m);if(h=="mousewheel"&&e.addEventListener){e.addEventListener("DOMMouseScroll",m,false);I.on(window,"unload",function(){e.removeEventListener("DOMMouseScroll",m,false)})}if(h=="mousedown"&&e==document){Ext.EventManager.stoppedMouseDownEvent.addListener(m)}};var P=function(e,b,o,l){e=Ext.getDom(e);var h=Ext.id(e),m=O[h],g;if(m){var q=m[b],d;if(q){for(var a=0,p=q.length;a<p;a++){d=q[a];if(d.fn==o&&(!l||d.scope==l)){g=d.wrap;I.un(e,b,g);q.splice(a,1);break}}}}if(b=="mousewheel"&&e.addEventListener&&g){e.removeEventListener("DOMMouseScroll",g,false)}if(b=="mousedown"&&e==document&&g){Ext.EventManager.stoppedMouseDownEvent.removeListener(g)}};var T=function(g){g=Ext.getDom(g);var b=Ext.id(g),d=O[b],e;if(d){for(var l in d){if(d.hasOwnProperty(l)){e=d[l];for(var a=0,h=e.length;a<h;a++){I.un(g,l,e[a].wrap);e[a]=null}}d[l]=null}delete O[b]}};var U=function(){if(!L){L=true;Ext.isReady=true;if(H){clearInterval(H)}if(Ext.isGecko||Ext.isOpera){document.removeEventListener("DOMContentLoaded",U,false)}if(Ext.isIE){var a=document.getElementById("ie-deferred-loader");if(a){a.onreadystatechange=null;a.parentNode.removeChild(a)}}if(z){z.fire();z.clearListeners()}}};var V=function(){z=new Ext.util.Event();if(Ext.isGecko||Ext.isOpera){document.addEventListener("DOMContentLoaded",U,false)}else{if(Ext.isIE){document.write('<script id="ie-deferred-loader" defer="defer" src="//:"><\/script>');var a=document.getElementById("ie-deferred-loader");a.onreadystatechange=function(){if(this.readyState=="complete"){U()}}}else{if(Ext.isSafari){H=setInterval(function(){var b=document.readyState;if(b=="complete"){U()}},10)}}}I.on(window,"load",U)};var C=function(b,a){var d=new Ext.util.DelayedTask(b);return function(e){e=new Ext.EventObjectImpl(e);d.delay(a.buffer,b,null,[e])}};var E=function(d,g,e,a,b){return function(h){Ext.EventManager.removeListener(g,e,a,b);d(h)}};var S=function(b,a){return function(d){d=new Ext.EventObjectImpl(d);setTimeout(function(){b(d)},a.delay||10)}};var M=function(a,h,m,d,e){var b=(!m||typeof m=="boolean")?{}:m;d=d||b.fn;e=e||b.scope;var g=Ext.getDom(a);if(!g){throw'Error listening for "'+h+'". Element "'+a+"\" doesn't exist."}var l=function(o){if(!window[W]){return}o=Ext.EventObject.setEvent(o);var p;if(b.delegate){p=o.getTarget(b.delegate,g);if(!p){return}}else{p=o.target}if(b.stopEvent===true){o.stopEvent()}if(b.preventDefault===true){o.preventDefault()}if(b.stopPropagation===true){o.stopPropagation()}if(b.normalized===false){o=o.browserEvent}d.call(e||g,o,p,b)};if(b.delay){l=S(l,b)}if(b.single){l=E(l,g,h,d,e)}if(b.buffer){l=C(l,b)}J(g,h,d,l,e);return l};var N=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;var D={addListener:function(a,l,g,h,e){if(typeof l=="object"){var b=l;for(var d in b){if(N.test(d)){continue}if(typeof b[d]=="function"){M(a,d,b,b[d],b.scope)}else{M(a,d,b[d])}}return}return M(a,l,e,g,h)},removeListener:function(b,e,d,a){return P(b,e,d,a)},removeAll:function(a){return T(a)},onDocumentReady:function(a,b,d){if(L){z.addListener(a,b,d);z.fire();z.clearListeners();return}if(!z){V()}d=d||{};if(!d.delay){d.delay=1}z.addListener(a,b,d)},doResizeEvent:function(){K.fire(G.getViewWidth(),G.getViewHeight())},onWindowResize:function(a,b,d){if(!K){K=new Ext.util.Event();B=new Ext.util.DelayedTask(this.doResizeEvent);I.on(window,"resize",this.fireWindowResize,this)}K.addListener(a,b,d)},fireWindowResize:function(){if(K){if((Ext.isIE||Ext.isAir)&&B){B.delay(50)}else{K.fire(G.getViewWidth(),G.getViewHeight())}}},onTextResize:function(e,a,d){if(!Q){Q=new Ext.util.Event();var b=new Ext.Element(document.createElement("div"));b.dom.className="x-text-resize";b.dom.innerHTML="X";b.appendTo(document.body);F=b.dom.offsetHeight;setInterval(function(){if(b.dom.offsetHeight!=F){Q.fire(F,F=b.dom.offsetHeight)}},this.textResizeInterval)}Q.addListener(e,a,d)},removeResizeListener:function(a,b){if(K){K.removeListener(a,b)}},fireResize:function(){if(K){K.fire(G.getViewWidth(),G.getViewHeight())}},ieDeferSrc:false,textResizeInterval:50};D.on=D.addListener;D.un=D.removeListener;D.stoppedMouseDownEvent=new Ext.util.Event();return D}();Ext.onReady=Ext.EventManager.onDocumentReady;(function(){var b=function(){var g=document.body||document.getElementsByTagName("body")[0];if(!g){return false}var a=[" ",Ext.isIE?"ext-ie "+(Ext.isIE6?"ext-ie6":(Ext.isIE7?"ext-ie7":"ext-ie8")):Ext.isGecko?"ext-gecko "+(Ext.isGecko2?"ext-gecko2":"ext-gecko3"):Ext.isOpera?"ext-opera":Ext.isSafari?"ext-safari":Ext.isChrome?"ext-chrome":""];if(Ext.isMac){a.push("ext-mac")}if(Ext.isLinux){a.push("ext-linux")}if(Ext.isBorderBox){a.push("ext-border-box")}if(Ext.isStrict){var e=g.parentNode;if(e){e.className+=" ext-strict"}}g.className+=a.join(" ");return true};if(!b()){Ext.onReady(b)}})();Ext.EventObject=function(){var d=Ext.lib.Event;var e={3:13,63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35};var g=Ext.isIE?{1:0,4:1,2:2}:(Ext.isSafari?{1:0,2:1,3:2}:{0:0,1:1,2:2});Ext.EventObjectImpl=function(a){if(a){this.setEvent(a.browserEvent||a)}};Ext.EventObjectImpl.prototype={browserEvent:null,button:-1,shiftKey:false,ctrlKey:false,altKey:false,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,RETURN:13,SHIFT:16,CTRL:17,CONTROL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGEUP:33,PAGE_DOWN:34,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,setEvent:function(a){if(a==this||(a&&a.browserEvent)){return a}this.browserEvent=a;if(a){this.button=a.button?g[a.button]:(a.which?a.which-1:-1);if(a.type=="click"&&this.button==-1){this.button=0}this.type=a.type;this.shiftKey=a.shiftKey;this.ctrlKey=a.ctrlKey||a.metaKey;this.altKey=a.altKey;this.keyCode=a.keyCode;this.charCode=a.charCode;this.target=d.getTarget(a);this.xy=d.getXY(a)}else{this.button=-1;this.shiftKey=false;this.ctrlKey=false;this.altKey=false;this.keyCode=0;this.charCode=0;this.target=null;this.xy=[0,0]}return this},stopEvent:function(){if(this.browserEvent){if(this.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(this)}d.stopEvent(this.browserEvent)}},preventDefault:function(){if(this.browserEvent){d.preventDefault(this.browserEvent)}},isNavKeyPress:function(){var a=this.keyCode;a=Ext.isSafari?(e[a]||a):a;return(a>=33&&a<=40)||a==this.RETURN||a==this.TAB||a==this.ESC},isSpecialKey:function(){var a=this.keyCode;return(this.type=="keypress"&&this.ctrlKey)||a==9||a==13||a==40||a==27||(a==16)||(a==17)||(a>=18&&a<=20)||(a>=33&&a<=35)||(a>=36&&a<=39)||(a>=44&&a<=45)},stopPropagation:function(){if(this.browserEvent){if(this.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(this)}d.stopPropagation(this.browserEvent)}},getCharCode:function(){return this.charCode||this.keyCode},getKey:function(){var a=this.keyCode||this.charCode;return Ext.isSafari?(e[a]||a):a},getPageX:function(){return this.xy[0]},getPageY:function(){return this.xy[1]},getTime:function(){if(this.browserEvent){return d.getTime(this.browserEvent)}return null},getXY:function(){return this.xy},getTarget:function(b,a,h){return b?Ext.fly(this.target).findParent(b,a,h):(h?Ext.get(this.target):this.target)},getRelatedTarget:function(){if(this.browserEvent){return d.getRelatedTarget(this.browserEvent)}return null},getWheelDelta:function(){var b=this.browserEvent;var a=0;if(b.wheelDelta){a=b.wheelDelta/120}else{if(b.detail){a=-b.detail/3}}return a},hasModifier:function(){return((this.ctrlKey||this.altKey)||this.shiftKey)?true:false},within:function(b,a,m){var l=this[a?"getRelatedTarget":"getTarget"]();return l&&((m?(l===Ext.getDom(b)):false)||Ext.fly(b).contains(l))},getPoint:function(){return new Ext.lib.Point(this.xy[0],this.xy[1])}};return new Ext.EventObjectImpl()}();(function(){var D=Ext.lib.Dom;var E=Ext.lib.Event;var A=Ext.lib.Anim;var propCache={};var camelRe=/(-[a-z])/gi;var camelFn=function(m,a){return a.charAt(1).toUpperCase()};var view=document.defaultView;Ext.Element=function(element,forceNew){var dom=typeof element=="string"?document.getElementById(element):element;if(!dom){return null}var id=dom.id;if(forceNew!==true&&id&&Ext.Element.cache[id]){return Ext.Element.cache[id]}this.dom=dom;this.id=id||Ext.id(dom)};var El=Ext.Element;El.prototype={originalDisplay:"",visibilityMode:1,defaultUnit:"px",setVisibilityMode:function(visMode){this.visibilityMode=visMode;return this},enableDisplayMode:function(display){this.setVisibilityMode(El.DISPLAY);if(typeof display!="undefined"){this.originalDisplay=display}return this},findParent:function(simpleSelector,maxDepth,returnEl){var p=this.dom,b=document.body,depth=0,dq=Ext.DomQuery,stopEl;maxDepth=maxDepth||50;if(typeof maxDepth!="number"){stopEl=Ext.getDom(maxDepth);maxDepth=10}while(p&&p.nodeType==1&&depth<maxDepth&&p!=b&&p!=stopEl){if(dq.is(p,simpleSelector)){return returnEl?Ext.get(p):p}depth++;p=p.parentNode}return null},findParentNode:function(simpleSelector,maxDepth,returnEl){var p=Ext.fly(this.dom.parentNode,"_internal");return p?p.findParent(simpleSelector,maxDepth,returnEl):null},up:function(simpleSelector,maxDepth){return this.findParentNode(simpleSelector,maxDepth,true)},is:function(simpleSelector){return Ext.DomQuery.is(this.dom,simpleSelector)},animate:function(args,duration,onComplete,easing,animType){this.anim(args,{duration:duration,callback:onComplete,easing:easing},animType);return this},anim:function(args,opt,animType,defaultDur,defaultEase,cb){animType=animType||"run";opt=opt||{};var anim=Ext.lib.Anim[animType](this.dom,args,(opt.duration||defaultDur)||0.35,(opt.easing||defaultEase)||"easeOut",function(){Ext.callback(cb,this);Ext.callback(opt.callback,opt.scope||this,[this,opt])},this);opt.anim=anim;return anim},preanim:function(a,i){return !a[i]?false:(typeof a[i]=="object"?a[i]:{duration:a[i+1],callback:a[i+2],easing:a[i+3]})},clean:function(forceReclean){if(this.isCleaned&&forceReclean!==true){return this}var ns=/\S/;var d=this.dom,n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!ns.test(n.nodeValue)){d.removeChild(n)}else{n.nodeIndex=++ni}n=nx}this.isCleaned=true;return this},scrollIntoView:function(container,hscroll){var c=Ext.getDom(container)||Ext.getBody().dom;var el=this.dom;var o=this.getOffsetsTo(c),l=o[0]+c.scrollLeft,t=o[1]+c.scrollTop,b=t+el.offsetHeight,r=l+el.offsetWidth;var ch=c.clientHeight;var ct=parseInt(c.scrollTop,10);var cl=parseInt(c.scrollLeft,10);var cb=ct+ch;var cr=cl+c.clientWidth;if(el.offsetHeight>ch||t<ct){c.scrollTop=t}else{if(b>cb){c.scrollTop=b-ch}}c.scrollTop=c.scrollTop;if(hscroll!==false){if(el.offsetWidth>c.clientWidth||l<cl){c.scrollLeft=l}else{if(r>cr){c.scrollLeft=r-c.clientWidth}}c.scrollLeft=c.scrollLeft}return this},scrollChildIntoView:function(child,hscroll){Ext.fly(child,"_scrollChildIntoView").scrollIntoView(this,hscroll)},autoHeight:function(animate,duration,onComplete,easing){var oldHeight=this.getHeight();this.clip();this.setHeight(1);setTimeout(function(){var height=parseInt(this.dom.scrollHeight,10);if(!animate){this.setHeight(height);this.unclip();if(typeof onComplete=="function"){onComplete()}}else{this.setHeight(oldHeight);this.setHeight(height,animate,duration,function(){this.unclip();if(typeof onComplete=="function"){onComplete()}}.createDelegate(this),easing)}}.createDelegate(this),0);return this},contains:function(el){if(!el){return false}return D.isAncestor(this.dom,el.dom?el.dom:el)},isVisible:function(deep){var vis=!(this.getStyle("visibility")=="hidden"||this.getStyle("display")=="none");if(deep!==true||!vis){return vis}var p=this.dom.parentNode;while(p&&p.tagName.toLowerCase()!="body"){if(!Ext.fly(p,"_isVisible").isVisible()){return false}p=p.parentNode}return true},select:function(selector,unique){return El.select(selector,unique,this.dom)},query:function(selector){return Ext.DomQuery.select(selector,this.dom)},child:function(selector,returnDom){var n=Ext.DomQuery.selectNode(selector,this.dom);return returnDom?n:Ext.get(n)},down:function(selector,returnDom){var n=Ext.DomQuery.selectNode(" > "+selector,this.dom);return returnDom?n:Ext.get(n)},initDD:function(group,config,overrides){var dd=new Ext.dd.DD(Ext.id(this.dom),group,config);return Ext.apply(dd,overrides)},initDDProxy:function(group,config,overrides){var dd=new Ext.dd.DDProxy(Ext.id(this.dom),group,config);return Ext.apply(dd,overrides)},initDDTarget:function(group,config,overrides){var dd=new Ext.dd.DDTarget(Ext.id(this.dom),group,config);return Ext.apply(dd,overrides)},setVisible:function(visible,animate){if(!animate||!A){if(this.visibilityMode==El.DISPLAY){this.setDisplayed(visible)}else{this.fixDisplay();this.dom.style.visibility=visible?"visible":"hidden"}}else{var dom=this.dom;var visMode=this.visibilityMode;if(visible){this.setOpacity(0.01);this.setVisible(true)}this.anim({opacity:{to:(visible?1:0)}},this.preanim(arguments,1),null,0.35,"easeIn",function(){if(!visible){if(visMode==El.DISPLAY){dom.style.display="none"}else{dom.style.visibility="hidden"}Ext.get(dom).setOpacity(1)}})}return this},isDisplayed:function(){return this.getStyle("display")!="none"},toggle:function(animate){this.setVisible(!this.isVisible(),this.preanim(arguments,0));return this},setDisplayed:function(value){if(typeof value=="boolean"){value=value?this.originalDisplay:"none"}this.setStyle("display",value);return this},focus:function(){try{this.dom.focus()}catch(e){}return this},blur:function(){try{this.dom.blur()}catch(e){}return this},addClass:function(className){if(Ext.isArray(className)){for(var i=0,len=className.length;i<len;i++){this.addClass(className[i])}}else{if(className&&!this.hasClass(className)){this.dom.className=this.dom.className+" "+className}}return this},radioClass:function(className){var siblings=this.dom.parentNode.childNodes;for(var i=0;i<siblings.length;i++){var s=siblings[i];if(s.nodeType==1){Ext.get(s).removeClass(className)}}this.addClass(className);return this},removeClass:function(className){if(!className||!this.dom.className){return this}if(Ext.isArray(className)){for(var i=0,len=className.length;i<len;i++){this.removeClass(className[i])}}else{if(this.hasClass(className)){var re=this.classReCache[className];if(!re){re=new RegExp("(?:^|\\s+)"+className+"(?:\\s+|$)","g");this.classReCache[className]=re}this.dom.className=this.dom.className.replace(re," ")}}return this},classReCache:{},toggleClass:function(className){if(this.hasClass(className)){this.removeClass(className)}else{this.addClass(className)}return this},hasClass:function(className){return className&&(" "+this.dom.className+" ").indexOf(" "+className+" ")!=-1},replaceClass:function(oldClassName,newClassName){this.removeClass(oldClassName);this.addClass(newClassName);return this},getStyles:function(){var a=arguments,len=a.length,r={};for(var i=0;i<len;i++){r[a[i]]=this.getStyle(a[i])}return r},getStyle:function(){return view&&view.getComputedStyle?function(prop){var el=this.dom,v,cs,camel;if(prop=="float"){prop="cssFloat"}if(v=el.style[prop]){return v}if(cs=view.getComputedStyle(el,"")){if(!(camel=propCache[prop])){camel=propCache[prop]=prop.replace(camelRe,camelFn)}return cs[camel]}return null}:function(prop){var el=this.dom,v,cs,camel;if(prop=="opacity"){if(typeof el.style.filter=="string"){var m=el.style.filter.match(/alpha\(opacity=(.*)\)/i);if(m){var fv=parseFloat(m[1]);if(!isNaN(fv)){return fv?fv/100:0}}}return 1}else{if(prop=="float"){prop="styleFloat"}}if(!(camel=propCache[prop])){camel=propCache[prop]=prop.replace(camelRe,camelFn)}if(v=el.style[camel]){return v}if(cs=el.currentStyle){return cs[camel]}return null}}(),setStyle:function(prop,value){if(typeof prop=="string"){var camel;if(!(camel=propCache[prop])){camel=propCache[prop]=prop.replace(camelRe,camelFn)}if(camel=="opacity"){this.setOpacity(value)}else{this.dom.style[camel]=value}}else{for(var style in prop){if(typeof prop[style]!="function"){this.setStyle(style,prop[style])}}}return this},applyStyles:function(style){Ext.DomHelper.applyStyles(this.dom,style);return this},getX:function(){return D.getX(this.dom)},getY:function(){return D.getY(this.dom)},getXY:function(){return D.getXY(this.dom)},getOffsetsTo:function(el){var o=this.getXY();var e=Ext.fly(el,"_internal").getXY();return[o[0]-e[0],o[1]-e[1]]},setX:function(x,animate){if(!animate||!A){D.setX(this.dom,x)}else{this.setXY([x,this.getY()],this.preanim(arguments,1))}return this},setY:function(y,animate){if(!animate||!A){D.setY(this.dom,y)}else{this.setXY([this.getX(),y],this.preanim(arguments,1))}return this},setLeft:function(left){this.setStyle("left",this.addUnits(left));return this},setTop:function(top){this.setStyle("top",this.addUnits(top));return this},setRight:function(right){this.setStyle("right",this.addUnits(right));return this},setBottom:function(bottom){this.setStyle("bottom",this.addUnits(bottom));return this},setXY:function(pos,animate){if(!animate||!A){D.setXY(this.dom,pos)}else{this.anim({points:{to:pos}},this.preanim(arguments,1),"motion")}return this},setLocation:function(x,y,animate){this.setXY([x,y],this.preanim(arguments,2));return this},moveTo:function(x,y,animate){this.setXY([x,y],this.preanim(arguments,2));return this},getRegion:function(){return D.getRegion(this.dom)},getHeight:function(contentHeight){var h=this.dom.offsetHeight||0;h=contentHeight!==true?h:h-this.getBorderWidth("tb")-this.getPadding("tb");return h<0?0:h},getWidth:function(contentWidth){var w=this.dom.offsetWidth||0;w=contentWidth!==true?w:w-this.getBorderWidth("lr")-this.getPadding("lr");return w<0?0:w},getComputedHeight:function(){var h=Math.max(this.dom.offsetHeight,this.dom.clientHeight);if(!h){h=parseInt(this.getStyle("height"),10)||0;if(!this.isBorderBox()){h+=this.getFrameWidth("tb")}}return h},getComputedWidth:function(){var w=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!w){w=parseInt(this.getStyle("width"),10)||0;if(!this.isBorderBox()){w+=this.getFrameWidth("lr")}}return w},getSize:function(contentSize){return{width:this.getWidth(contentSize),height:this.getHeight(contentSize)}},getStyleSize:function(){var w,h,d=this.dom,s=d.style;if(s.width&&s.width!="auto"){w=parseInt(s.width,10);if(Ext.isBorderBox){w-=this.getFrameWidth("lr")}}if(s.height&&s.height!="auto"){h=parseInt(s.height,10);if(Ext.isBorderBox){h-=this.getFrameWidth("tb")}}return{width:w||this.getWidth(true),height:h||this.getHeight(true)}},getViewSize:function(){var d=this.dom,doc=document,aw=0,ah=0;if(d==doc||d==doc.body){return{width:D.getViewWidth(),height:D.getViewHeight()}}else{return{width:d.clientWidth,height:d.clientHeight}}},getValue:function(asNumber){return asNumber?parseInt(this.dom.value,10):this.dom.value},adjustWidth:function(width){if(typeof width=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){width-=(this.getBorderWidth("lr")+this.getPadding("lr"))}if(width<0){width=0}}return width},adjustHeight:function(height){if(typeof height=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){height-=(this.getBorderWidth("tb")+this.getPadding("tb"))}if(height<0){height=0}}return height},setWidth:function(width,animate){width=this.adjustWidth(width);if(!animate||!A){this.dom.style.width=this.addUnits(width)}else{this.anim({width:{to:width}},this.preanim(arguments,1))}return this},setHeight:function(height,animate){height=this.adjustHeight(height);if(!animate||!A){this.dom.style.height=this.addUnits(height)}else{this.anim({height:{to:height}},this.preanim(arguments,1))}return this},setSize:function(width,height,animate){if(typeof width=="object"){height=width.height;width=width.width}width=this.adjustWidth(width);height=this.adjustHeight(height);if(!animate||!A){this.dom.style.width=this.addUnits(width);this.dom.style.height=this.addUnits(height)}else{this.anim({width:{to:width},height:{to:height}},this.preanim(arguments,2))}return this},setBounds:function(x,y,width,height,animate){if(!animate||!A){this.setSize(width,height);this.setLocation(x,y)}else{width=this.adjustWidth(width);height=this.adjustHeight(height);this.anim({points:{to:[x,y]},width:{to:width},height:{to:height}},this.preanim(arguments,4),"motion")}return this},setRegion:function(region,animate){this.setBounds(region.left,region.top,region.right-region.left,region.bottom-region.top,this.preanim(arguments,1));return this},addListener:function(eventName,fn,scope,options){Ext.EventManager.on(this.dom,eventName,fn,scope||this,options)},removeListener:function(eventName,fn,scope){Ext.EventManager.removeListener(this.dom,eventName,fn,scope||this);return this},removeAllListeners:function(){Ext.EventManager.removeAll(this.dom);return this},relayEvent:function(eventName,observable){this.on(eventName,function(e){observable.fireEvent(eventName,e)})},setOpacity:function(opacity,animate){if(!animate||!A){var s=this.dom.style;if(Ext.isIE){s.zoom=1;s.filter=(s.filter||"").replace(/alpha\([^\)]*\)/gi,"")+(opacity==1?"":" alpha(opacity="+opacity*100+")")}else{s.opacity=opacity}}else{this.anim({opacity:{to:opacity}},this.preanim(arguments,1),null,0.35,"easeIn")}return this},getLeft:function(local){if(!local){return this.getX()}else{return parseInt(this.getStyle("left"),10)||0}},getRight:function(local){if(!local){return this.getX()+this.getWidth()}else{return(this.getLeft(true)+this.getWidth())||0}},getTop:function(local){if(!local){return this.getY()}else{return parseInt(this.getStyle("top"),10)||0}},getBottom:function(local){if(!local){return this.getY()+this.getHeight()}else{return(this.getTop(true)+this.getHeight())||0}},position:function(pos,zIndex,x,y){if(!pos){if(this.getStyle("position")=="static"){this.setStyle("position","relative")}}else{this.setStyle("position",pos)}if(zIndex){this.setStyle("z-index",zIndex)}if(x!==undefined&&y!==undefined){this.setXY([x,y])}else{if(x!==undefined){this.setX(x)}else{if(y!==undefined){this.setY(y)}}}},clearPositioning:function(value){value=value||"";this.setStyle({left:value,right:value,top:value,bottom:value,"z-index":"",position:"static"});return this},getPositioning:function(){var l=this.getStyle("left");var t=this.getStyle("top");return{position:this.getStyle("position"),left:l,right:l?"":this.getStyle("right"),top:t,bottom:t?"":this.getStyle("bottom"),"z-index":this.getStyle("z-index")}},getBorderWidth:function(side){return this.addStyles(side,El.borders)},getPadding:function(side){return this.addStyles(side,El.paddings)},setPositioning:function(pc){this.applyStyles(pc);if(pc.right=="auto"){this.dom.style.right=""}if(pc.bottom=="auto"){this.dom.style.bottom=""}return this},fixDisplay:function(){if(this.getStyle("display")=="none"){this.setStyle("visibility","hidden");this.setStyle("display",this.originalDisplay);if(this.getStyle("display")=="none"){this.setStyle("display","block")}}},setOverflow:function(v){if(v=="auto"&&Ext.isMac&&Ext.isGecko2){this.dom.style.overflow="hidden";(function(){this.dom.style.overflow="auto"}).defer(1,this)}else{this.dom.style.overflow=v}},setLeftTop:function(left,top){this.dom.style.left=this.addUnits(left);this.dom.style.top=this.addUnits(top);return this},move:function(direction,distance,animate){var xy=this.getXY();direction=direction.toLowerCase();switch(direction){case"l":case"left":this.moveTo(xy[0]-distance,xy[1],this.preanim(arguments,2));break;case"r":case"right":this.moveTo(xy[0]+distance,xy[1],this.preanim(arguments,2));break;case"t":case"top":case"up":this.moveTo(xy[0],xy[1]-distance,this.preanim(arguments,2));break;case"b":case"bottom":case"down":this.moveTo(xy[0],xy[1]+distance,this.preanim(arguments,2));break}return this},clip:function(){if(!this.isClipped){this.isClipped=true;this.originalClip={o:this.getStyle("overflow"),x:this.getStyle("overflow-x"),y:this.getStyle("overflow-y")};this.setStyle("overflow","hidden");this.setStyle("overflow-x","hidden");this.setStyle("overflow-y","hidden")}return this},unclip:function(){if(this.isClipped){this.isClipped=false;var o=this.originalClip;if(o.o){this.setStyle("overflow",o.o)}if(o.x){this.setStyle("overflow-x",o.x)}if(o.y){this.setStyle("overflow-y",o.y)}}return this},getAnchorXY:function(anchor,local,s){var w,h,vp=false;if(!s){var d=this.dom;if(d==document.body||d==document){vp=true;w=D.getViewWidth();h=D.getViewHeight()}else{w=this.getWidth();h=this.getHeight()}}else{w=s.width;h=s.height}var x=0,y=0,r=Math.round;switch((anchor||"tl").toLowerCase()){case"c":x=r(w*0.5);y=r(h*0.5);break;case"t":x=r(w*0.5);y=0;break;case"l":x=0;y=r(h*0.5);break;case"r":x=w;y=r(h*0.5);break;case"b":x=r(w*0.5);y=h;break;case"tl":x=0;y=0;break;case"bl":x=0;y=h;break;case"br":x=w;y=h;break;case"tr":x=w;y=0;break}if(local===true){return[x,y]}if(vp){var sc=this.getScroll();return[x+sc.left,y+sc.top]}var o=this.getXY();return[x+o[0],y+o[1]]},getAlignToXY:function(el,p,o){el=Ext.get(el);if(!el||!el.dom){throw"Element.alignToXY with an element that doesn't exist"}var d=this.dom;var c=false;var p1="",p2="";o=o||[0,0];if(!p){p="tl-bl"}else{if(p=="?"){p="tl-bl?"}else{if(p.indexOf("-")==-1){p="tl-"+p}}}p=p.toLowerCase();var m=p.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!m){throw"Element.alignTo with an invalid alignment "+p}p1=m[1];p2=m[2];c=!!m[3];var a1=this.getAnchorXY(p1,true);var a2=el.getAnchorXY(p2,false);var x=a2[0]-a1[0]+o[0];var y=a2[1]-a1[1]+o[1];if(c){var w=this.getWidth(),h=this.getHeight(),r=el.getRegion();var dw=D.getViewWidth()-5,dh=D.getViewHeight()-5;var p1y=p1.charAt(0),p1x=p1.charAt(p1.length-1);var p2y=p2.charAt(0),p2x=p2.charAt(p2.length-1);var swapY=((p1y=="t"&&p2y=="b")||(p1y=="b"&&p2y=="t"));var swapX=((p1x=="r"&&p2x=="l")||(p1x=="l"&&p2x=="r"));var doc=document;var scrollX=(doc.documentElement.scrollLeft||doc.body.scrollLeft||0)+5;var scrollY=(doc.documentElement.scrollTop||doc.body.scrollTop||0)+5;if((x+w)>dw+scrollX){x=swapX?r.left-w:dw+scrollX-w}if(x<scrollX){x=swapX?r.right:scrollX}if((y+h)>dh+scrollY){y=swapY?r.top-h:dh+scrollY-h}if(y<scrollY){y=swapY?r.bottom:scrollY}}return[x,y]},getConstrainToXY:function(){var os={top:0,left:0,bottom:0,right:0};return function(el,local,offsets,proposedXY){el=Ext.get(el);offsets=offsets?Ext.applyIf(offsets,os):os;var vw,vh,vx=0,vy=0;if(el.dom==document.body||el.dom==document){vw=Ext.lib.Dom.getViewWidth();vh=Ext.lib.Dom.getViewHeight()}else{vw=el.dom.clientWidth;vh=el.dom.clientHeight;if(!local){var vxy=el.getXY();vx=vxy[0];vy=vxy[1]}}var s=el.getScroll();vx+=offsets.left+s.left;vy+=offsets.top+s.top;vw-=offsets.right;vh-=offsets.bottom;var vr=vx+vw;var vb=vy+vh;var xy=proposedXY||(!local?this.getXY():[this.getLeft(true),this.getTop(true)]);var x=xy[0],y=xy[1];var w=this.dom.offsetWidth,h=this.dom.offsetHeight;var moved=false;if((x+w)>vr){x=vr-w;moved=true}if((y+h)>vb){y=vb-h;moved=true}if(x<vx){x=vx;moved=true}if(y<vy){y=vy;moved=true}return moved?[x,y]:false}}(),adjustForConstraints:function(xy,parent,offsets){return this.getConstrainToXY(parent||document,false,offsets,xy)||xy},alignTo:function(element,position,offsets,animate){var xy=this.getAlignToXY(element,position,offsets);this.setXY(xy,this.preanim(arguments,3));return this},anchorTo:function(el,alignment,offsets,animate,monitorScroll,callback){var action=function(){this.alignTo(el,alignment,offsets,animate);Ext.callback(callback,this)};Ext.EventManager.onWindowResize(action,this);var tm=typeof monitorScroll;if(tm!="undefined"){Ext.EventManager.on(window,"scroll",action,this,{buffer:tm=="number"?monitorScroll:50})}action.call(this);return this},clearOpacity:function(){if(window.ActiveXObject){if(typeof this.dom.style.filter=="string"&&(/alpha/i).test(this.dom.style.filter)){this.dom.style.filter=""}}else{this.dom.style.opacity="";this.dom.style["-moz-opacity"]="";this.dom.style["-khtml-opacity"]=""}return this},hide:function(animate){this.setVisible(false,this.preanim(arguments,0));return this},show:function(animate){this.setVisible(true,this.preanim(arguments,0));return this},addUnits:function(size){return Ext.Element.addUnits(size,this.defaultUnit)},update:function(html,loadScripts,callback){if(typeof html=="undefined"){html=""}if(loadScripts!==true){this.dom.innerHTML=html;if(typeof callback=="function"){callback()}return this}var id=Ext.id();var dom=this.dom;html+='<span id="'+id+'"></span>';E.onAvailable(id,function(){var hd=document.getElementsByTagName("head")[0];var re=/(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig;var srcRe=/\ssrc=([\'\"])(.*?)\1/i;var typeRe=/\stype=([\'\"])(.*?)\1/i;var match;while(match=re.exec(html)){var attrs=match[1];var srcMatch=attrs?attrs.match(srcRe):false;if(srcMatch&&srcMatch[2]){var s=document.createElement("script");s.src=srcMatch[2];var typeMatch=attrs.match(typeRe);if(typeMatch&&typeMatch[2]){s.type=typeMatch[2]}hd.appendChild(s)}else{if(match[2]&&match[2].length>0){if(window.execScript){window.execScript(match[2])}else{window.eval(match[2])}}}}var el=document.getElementById(id);if(el){Ext.removeNode(el)}if(typeof callback=="function"){callback()}});dom.innerHTML=html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,"");return this},load:function(){var um=this.getUpdater();um.update.apply(um,arguments);return this},getUpdater:function(){if(!this.updateManager){this.updateManager=new Ext.Updater(this)}return this.updateManager},unselectable:function(){this.dom.unselectable="on";this.swallowEvent("selectstart",true);this.applyStyles("-moz-user-select:none;-khtml-user-select:none;");this.addClass("x-unselectable");return this},getCenterXY:function(){return this.getAlignToXY(document,"c-c")},center:function(centerIn){this.alignTo(centerIn||document,"c-c");return this},isBorderBox:function(){return noBoxAdjust[this.dom.tagName.toLowerCase()]||Ext.isBorderBox},getBox:function(contentBox,local){var xy;if(!local){xy=this.getXY()}else{var left=parseInt(this.getStyle("left"),10)||0;var top=parseInt(this.getStyle("top"),10)||0;xy=[left,top]}var el=this.dom,w=el.offsetWidth,h=el.offsetHeight,bx;if(!contentBox){bx={x:xy[0],y:xy[1],0:xy[0],1:xy[1],width:w,height:h}}else{var l=this.getBorderWidth("l")+this.getPadding("l");var r=this.getBorderWidth("r")+this.getPadding("r");var t=this.getBorderWidth("t")+this.getPadding("t");var b=this.getBorderWidth("b")+this.getPadding("b");bx={x:xy[0]+l,y:xy[1]+t,0:xy[0]+l,1:xy[1]+t,width:w-(l+r),height:h-(t+b)}}bx.right=bx.x+bx.width;bx.bottom=bx.y+bx.height;return bx},getFrameWidth:function(sides,onlyContentBox){return onlyContentBox&&Ext.isBorderBox?0:(this.getPadding(sides)+this.getBorderWidth(sides))},setBox:function(box,adjust,animate){var w=box.width,h=box.height;if((adjust&&!this.autoBoxAdjust)&&!this.isBorderBox()){w-=(this.getBorderWidth("lr")+this.getPadding("lr"));h-=(this.getBorderWidth("tb")+this.getPadding("tb"))}this.setBounds(box.x,box.y,w,h,this.preanim(arguments,2));return this},repaint:function(){var dom=this.dom;this.addClass("x-repaint");setTimeout(function(){Ext.get(dom).removeClass("x-repaint")},1);return this},getMargins:function(side){if(!side){return{top:parseInt(this.getStyle("margin-top"),10)||0,left:parseInt(this.getStyle("margin-left"),10)||0,bottom:parseInt(this.getStyle("margin-bottom"),10)||0,right:parseInt(this.getStyle("margin-right"),10)||0}}else{return this.addStyles(side,El.margins)}},addStyles:function(sides,styles){var val=0,v,w;for(var i=0,len=sides.length;i<len;i++){v=this.getStyle(styles[sides.charAt(i)]);if(v){w=parseInt(v,10);if(w){val+=(w>=0?w:-1*w)}}}return val},createProxy:function(config,renderTo,matchBox){config=typeof config=="object"?config:{tag:"div",cls:config};var proxy;if(renderTo){proxy=Ext.DomHelper.append(renderTo,config,true)}else{proxy=Ext.DomHelper.insertBefore(this.dom,config,true)}if(matchBox){proxy.setBox(this.getBox())}return proxy},mask:function(msg,msgCls){if(this.getStyle("position")=="static"){this.addClass("x-masked-relative")}if(this._maskMsg){this._maskMsg.remove()}if(this._mask){this._mask.remove()}this._mask=Ext.DomHelper.append(this.dom,{cls:"ext-el-mask"},true);this.addClass("x-masked");this._mask.setDisplayed(true);if(typeof msg=="string"){this._maskMsg=Ext.DomHelper.append(this.dom,{cls:"ext-el-mask-msg",cn:{tag:"div"}},true);var mm=this._maskMsg;mm.dom.className=msgCls?"ext-el-mask-msg "+msgCls:"ext-el-mask-msg";mm.dom.firstChild.innerHTML=msg;mm.setDisplayed(true);mm.center(this)}if(Ext.isIE&&!(Ext.isIE7&&Ext.isStrict)&&this.getStyle("height")=="auto"){this._mask.setSize(this.getWidth(),this.getHeight())}return this._mask},unmask:function(){if(this._mask){if(this._maskMsg){this._maskMsg.remove();delete this._maskMsg}this._mask.remove();delete this._mask}this.removeClass(["x-masked","x-masked-relative"])},isMasked:function(){return this._mask&&this._mask.isVisible()},createShim:function(){var el=document.createElement("iframe");el.frameBorder="0";el.className="ext-shim";if(Ext.isIE&&Ext.isSecure){el.src=Ext.SSL_SECURE_URL}var shim=Ext.get(this.dom.parentNode.insertBefore(el,this.dom));shim.autoBoxAdjust=false;return shim},remove:function(){Ext.removeNode(this.dom);delete El.cache[this.dom.id]},hover:function(overFn,outFn,scope){var preOverFn=function(e){if(!e.within(this,true)){overFn.apply(scope||this,arguments)}};var preOutFn=function(e){if(!e.within(this,true)){outFn.apply(scope||this,arguments)}};this.on("mouseover",preOverFn,this.dom);this.on("mouseout",preOutFn,this.dom);return this},addClassOnOver:function(className){this.hover(function(){Ext.fly(this,"_internal").addClass(className)},function(){Ext.fly(this,"_internal").removeClass(className)});return this},addClassOnFocus:function(className){this.on("focus",function(){Ext.fly(this,"_internal").addClass(className)},this.dom);this.on("blur",function(){Ext.fly(this,"_internal").removeClass(className)},this.dom);return this},addClassOnClick:function(className){var dom=this.dom;this.on("mousedown",function(){Ext.fly(dom,"_internal").addClass(className);var d=Ext.getDoc();var fn=function(){Ext.fly(dom,"_internal").removeClass(className);d.removeListener("mouseup",fn)};d.on("mouseup",fn)});return this},swallowEvent:function(eventName,preventDefault){var fn=function(e){e.stopPropagation();if(preventDefault){e.preventDefault()}};if(Ext.isArray(eventName)){for(var i=0,len=eventName.length;i<len;i++){this.on(eventName[i],fn)}return this}this.on(eventName,fn);return this},parent:function(selector,returnDom){return this.matchNode("parentNode","parentNode",selector,returnDom)},next:function(selector,returnDom){return this.matchNode("nextSibling","nextSibling",selector,returnDom)},prev:function(selector,returnDom){return this.matchNode("previousSibling","previousSibling",selector,returnDom)},first:function(selector,returnDom){return this.matchNode("nextSibling","firstChild",selector,returnDom)},last:function(selector,returnDom){return this.matchNode("previousSibling","lastChild",selector,returnDom)},matchNode:function(dir,start,selector,returnDom){var n=this.dom[start];while(n){if(n.nodeType==1&&(!selector||Ext.DomQuery.is(n,selector))){return !returnDom?Ext.get(n):n}n=n[dir]}return null},appendChild:function(el){el=Ext.get(el);el.appendTo(this);return this},createChild:function(config,insertBefore,returnDom){config=config||{tag:"div"};if(insertBefore){return Ext.DomHelper.insertBefore(insertBefore,config,returnDom!==true)}return Ext.DomHelper[!this.dom.firstChild?"overwrite":"append"](this.dom,config,returnDom!==true)},appendTo:function(el){el=Ext.getDom(el);el.appendChild(this.dom);return this},insertBefore:function(el){el=Ext.getDom(el);el.parentNode.insertBefore(this.dom,el);return this},insertAfter:function(el){el=Ext.getDom(el);el.parentNode.insertBefore(this.dom,el.nextSibling);return this},insertFirst:function(el,returnDom){el=el||{};if(typeof el=="object"&&!el.nodeType&&!el.dom){return this.createChild(el,this.dom.firstChild,returnDom)}else{el=Ext.getDom(el);this.dom.insertBefore(el,this.dom.firstChild);return !returnDom?Ext.get(el):el}},insertSibling:function(el,where,returnDom){var rt;if(Ext.isArray(el)){for(var i=0,len=el.length;i<len;i++){rt=this.insertSibling(el[i],where,returnDom)}return rt}where=where?where.toLowerCase():"before";el=el||{};var refNode=where=="before"?this.dom:this.dom.nextSibling;if(typeof el=="object"&&!el.nodeType&&!el.dom){if(where=="after"&&!this.dom.nextSibling){rt=Ext.DomHelper.append(this.dom.parentNode,el,!returnDom)}else{rt=Ext.DomHelper[where=="after"?"insertAfter":"insertBefore"](this.dom,el,!returnDom)}}else{rt=this.dom.parentNode.insertBefore(Ext.getDom(el),refNode);if(!returnDom){rt=Ext.get(rt)}}return rt},wrap:function(config,returnDom){if(!config){config={tag:"div"}}var newEl=Ext.DomHelper.insertBefore(this.dom,config,!returnDom);newEl.dom?newEl.dom.appendChild(this.dom):newEl.appendChild(this.dom);return newEl},replace:function(el){el=Ext.get(el);this.insertBefore(el);el.remove();return this},replaceWith:function(el){if(typeof el=="object"&&!el.nodeType&&!el.dom){el=this.insertSibling(el,"before")}else{el=Ext.getDom(el);this.dom.parentNode.insertBefore(el,this.dom)}El.uncache(this.id);Ext.removeNode(this.dom);this.dom=el;this.id=Ext.id(el);El.cache[this.id]=this;return this},insertHtml:function(where,html,returnEl){var el=Ext.DomHelper.insertHtml(where,this.dom,html);return returnEl?Ext.get(el):el},set:function(o,useSet){var el=this.dom;useSet=typeof useSet=="undefined"?(el.setAttribute?true:false):useSet;for(var attr in o){if(attr=="style"||typeof o[attr]=="function"){continue}if(attr=="cls"){el.className=o.cls}else{if(o.hasOwnProperty(attr)){if(useSet){el.setAttribute(attr,o[attr])}else{el[attr]=o[attr]}}}}if(o.style){Ext.DomHelper.applyStyles(el,o.style)}return this},addKeyListener:function(key,fn,scope){var config;if(typeof key!="object"||Ext.isArray(key)){config={key:key,fn:fn,scope:scope}}else{config={key:key.key,shift:key.shift,ctrl:key.ctrl,alt:key.alt,fn:fn,scope:scope}}return new Ext.KeyMap(this,config)},addKeyMap:function(config){return new Ext.KeyMap(this,config)},isScrollable:function(){var dom=this.dom;return dom.scrollHeight>dom.clientHeight||dom.scrollWidth>dom.clientWidth},scrollTo:function(side,value,animate){var prop=side.toLowerCase()=="left"?"scrollLeft":"scrollTop";if(!animate||!A){this.dom[prop]=value}else{var to=prop=="scrollLeft"?[value,this.dom.scrollTop]:[this.dom.scrollLeft,value];this.anim({scroll:{to:to}},this.preanim(arguments,2),"scroll")}return this},scroll:function(direction,distance,animate){if(!this.isScrollable()){return}var el=this.dom;var l=el.scrollLeft,t=el.scrollTop;var w=el.scrollWidth,h=el.scrollHeight;var cw=el.clientWidth,ch=el.clientHeight;direction=direction.toLowerCase();var scrolled=false;var a=this.preanim(arguments,2);switch(direction){case"l":case"left":if(w-l>cw){var v=Math.min(l+distance,w-cw);this.scrollTo("left",v,a);scrolled=true}break;case"r":case"right":if(l>0){var v=Math.max(l-distance,0);this.scrollTo("left",v,a);scrolled=true}break;case"t":case"top":case"up":if(t>0){var v=Math.max(t-distance,0);this.scrollTo("top",v,a);scrolled=true}break;case"b":case"bottom":case"down":if(h-t>ch){var v=Math.min(t+distance,h-ch);this.scrollTo("top",v,a);scrolled=true}break}return scrolled},translatePoints:function(x,y){if(typeof x=="object"||Ext.isArray(x)){y=x[1];x=x[0]}var p=this.getStyle("position");var o=this.getXY();var l=parseInt(this.getStyle("left"),10);var t=parseInt(this.getStyle("top"),10);if(isNaN(l)){l=(p=="relative")?0:this.dom.offsetLeft}if(isNaN(t)){t=(p=="relative")?0:this.dom.offsetTop}return{left:(x-o[0]+l),top:(y-o[1]+t)}},getScroll:function(){var d=this.dom,doc=document;if(d==doc||d==doc.body){var l,t;if(Ext.isIE&&Ext.isStrict){l=doc.documentElement.scrollLeft||(doc.body.scrollLeft||0);t=doc.documentElement.scrollTop||(doc.body.scrollTop||0)}else{l=window.pageXOffset||(doc.body.scrollLeft||0);t=window.pageYOffset||(doc.body.scrollTop||0)}return{left:l,top:t}}else{return{left:d.scrollLeft,top:d.scrollTop}}},getColor:function(attr,defaultValue,prefix){var v=this.getStyle(attr);if(!v||v=="transparent"||v=="inherit"){return defaultValue}var color=typeof prefix=="undefined"?"#":prefix;if(v.substr(0,4)=="rgb("){var rvs=v.slice(4,v.length-1).split(",");for(var i=0;i<3;i++){var h=parseInt(rvs[i]);var s=h.toString(16);if(h<16){s="0"+s}color+=s}}else{if(v.substr(0,1)=="#"){if(v.length==4){for(var i=1;i<4;i++){var c=v.charAt(i);color+=c+c}}else{if(v.length==7){color+=v.substr(1)}}}}return(color.length>5?color.toLowerCase():defaultValue)},boxWrap:function(cls){cls=cls||"x-box";var el=Ext.get(this.insertHtml("beforeBegin",String.format('<div class="{0}">'+El.boxMarkup+"</div>",cls)));el.child("."+cls+"-mc").dom.appendChild(this.dom);return el},getAttributeNS:Ext.isIE?function(ns,name){var d=this.dom;var type=typeof d[ns+":"+name];if(type!="undefined"&&type!="unknown"){return d[ns+":"+name]}return d[name]}:function(ns,name){var d=this.dom;return d.getAttributeNS(ns,name)||d.getAttribute(ns+":"+name)||d.getAttribute(name)||d[name]},getTextWidth:function(text,min,max){return(Ext.util.TextMetrics.measure(this.dom,Ext.value(text,this.dom.innerHTML,true)).width).constrain(min||0,max||1000000)}};var ep=El.prototype;ep.on=ep.addListener;ep.mon=ep.addListener;ep.getUpdateManager=ep.getUpdater;ep.un=ep.removeListener;ep.autoBoxAdjust=true;El.unitPattern=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i;El.addUnits=function(v,defaultUnit){if(v===""||v=="auto"){return v}if(v===undefined){return""}if(typeof v=="number"||!El.unitPattern.test(v)){return v+(defaultUnit||"px")}return v};El.boxMarkup='<div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div><div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div><div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>';El.VISIBILITY=1;El.DISPLAY=2;El.borders={l:"border-left-width",r:"border-right-width",t:"border-top-width",b:"border-bottom-width"};El.paddings={l:"padding-left",r:"padding-right",t:"padding-top",b:"padding-bottom"};El.margins={l:"margin-left",r:"margin-right",t:"margin-top",b:"margin-bottom"};El.cache={};var docEl;El.get=function(el){var ex,elm,id;if(!el){return null}if(typeof el=="string"){if(!(elm=document.getElementById(el))){return null}if(ex=El.cache[el]){ex.dom=elm}else{ex=El.cache[el]=new El(elm)}return ex}else{if(el.tagName){if(!(id=el.id)){id=Ext.id(el)}if(ex=El.cache[id]){ex.dom=el}else{ex=El.cache[id]=new El(el)}return ex}else{if(el instanceof El){if(el!=docEl){el.dom=document.getElementById(el.id)||el.dom;El.cache[el.id]=el}return el}else{if(el.isComposite){return el}else{if(Ext.isArray(el)){return El.select(el)}else{if(el==document){if(!docEl){var f=function(){};f.prototype=El.prototype;docEl=new f();docEl.dom=document}return docEl}}}}}}return null};El.uncache=function(el){for(var i=0,a=arguments,len=a.length;i<len;i++){if(a[i]){delete El.cache[a[i].id||a[i]]}}};El.garbageCollect=function(){if(!Ext.enableGarbageCollector){clearInterval(El.collectorThread);return}for(var eid in El.cache){var el=El.cache[eid],d=el.dom;if(!d||!d.parentNode||(!d.offsetParent&&!document.getElementById(eid))){delete El.cache[eid];if(d&&Ext.enableListenerCollection){Ext.EventManager.removeAll(d)}}}};El.collectorThreadId=setInterval(El.garbageCollect,30000);var flyFn=function(){};flyFn.prototype=El.prototype;var _cls=new flyFn();El.Flyweight=function(dom){this.dom=dom};El.Flyweight.prototype=_cls;El.Flyweight.prototype.isFlyweight=true;El._flyweights={};El.fly=function(el,named){named=named||"_global";el=Ext.getDom(el);if(!el){return null}if(!El._flyweights[named]){El._flyweights[named]=new El.Flyweight()}El._flyweights[named].dom=el;return El._flyweights[named]};Ext.get=El.get;Ext.fly=El.fly;var noBoxAdjust=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko){noBoxAdjust.button=1}Ext.EventManager.on(window,"unload",function(){delete El.cache;delete El._flyweights})})();Ext.enableFx=true;Ext.Fx={slideIn:function(e,g){var d=this.getFxEl();g=g||{};d.queueFx(g,function(){e=e||"t";this.fixDisplay();var u=this.getFxRestore();var p=this.getBox();this.setSize(p);var s=this.fxWrap(u.pos,g,"hidden");var b=this.dom.style;b.visibility="visible";b.position="absolute";var t=function(){d.fxUnwrap(s,u.pos,g);b.width=u.width;b.height=u.height;d.afterFx(g)};var o,a={to:[p.x,p.y]},q={to:p.width},r={to:p.height};switch(e.toLowerCase()){case"t":s.setSize(p.width,0);b.left=b.bottom="0";o={height:r};break;case"l":s.setSize(0,p.height);b.right=b.top="0";o={width:q};break;case"r":s.setSize(0,p.height);s.setX(p.right);b.left=b.top="0";o={width:q,points:a};break;case"b":s.setSize(p.width,0);s.setY(p.bottom);b.left=b.top="0";o={height:r,points:a};break;case"tl":s.setSize(0,0);b.right=b.bottom="0";o={width:q,height:r};break;case"bl":s.setSize(0,0);s.setY(p.y+p.height);b.right=b.top="0";o={width:q,height:r,points:a};break;case"br":s.setSize(0,0);s.setXY([p.right,p.bottom]);b.left=b.top="0";o={width:q,height:r,points:a};break;case"tr":s.setSize(0,0);s.setX(p.x+p.width);b.left=b.bottom="0";o={width:q,height:r,points:a};break}this.dom.style.visibility="visible";s.show();arguments.callee.anim=s.fxanim(o,g,"motion",0.5,"easeOut",t)});return this},slideOut:function(e,g){var d=this.getFxEl();g=g||{};d.queueFx(g,function(){e=e||"t";var b=this.getFxRestore();var r=this.getBox();this.setSize(r);var o=this.fxWrap(b.pos,g,"visible");var p=this.dom.style;p.visibility="visible";p.position="absolute";o.setSize(r);var a=function(){if(g.useDisplay){d.setDisplayed(false)}else{d.hide()}d.fxUnwrap(o,b.pos,g);p.width=b.width;p.height=b.height;d.afterFx(g)};var q,m={to:0};switch(e.toLowerCase()){case"t":p.left=p.bottom="0";q={height:m};break;case"l":p.right=p.top="0";q={width:m};break;case"r":p.left=p.top="0";q={width:m,points:{to:[r.right,r.y]}};break;case"b":p.left=p.top="0";q={height:m,points:{to:[r.x,r.bottom]}};break;case"tl":p.right=p.bottom="0";q={width:m,height:m};break;case"bl":p.right=p.top="0";q={width:m,height:m,points:{to:[r.x,r.bottom]}};break;case"br":p.left=p.top="0";q={width:m,height:m,points:{to:[r.x+r.width,r.bottom]}};break;case"tr":p.left=p.bottom="0";q={width:m,height:m,points:{to:[r.right,r.y]}};break}arguments.callee.anim=o.fxanim(q,g,"motion",0.5,"easeOut",a)});return this},puff:function(d){var e=this.getFxEl();d=d||{};e.queueFx(d,function(){this.clearOpacity();this.show();var b=this.getFxRestore();var m=this.dom.style;var a=function(){if(d.useDisplay){e.setDisplayed(false)}else{e.hide()}e.clearOpacity();e.setPositioning(b.pos);m.width=b.width;m.height=b.height;m.fontSize="";e.afterFx(d)};var l=this.getWidth();var o=this.getHeight();arguments.callee.anim=this.fxanim({width:{to:this.adjustWidth(l*2)},height:{to:this.adjustHeight(o*2)},points:{by:[-(l*0.5),-(o*0.5)]},opacity:{to:0},fontSize:{to:200,unit:"%"}},d,"motion",0.5,"easeOut",a)});return this},switchOff:function(d){var e=this.getFxEl();d=d||{};e.queueFx(d,function(){this.clearOpacity();this.clip();var b=this.getFxRestore();var g=this.dom.style;var a=function(){if(d.useDisplay){e.setDisplayed(false)}else{e.hide()}e.clearOpacity();e.setPositioning(b.pos);g.width=b.width;g.height=b.height;e.afterFx(d)};this.fxanim({opacity:{to:0.3}},null,null,0.1,null,function(){this.clearOpacity();(function(){this.fxanim({height:{to:1},points:{by:[0,this.getHeight()*0.5]}},d,"motion",0.3,"easeIn",a)}).defer(100,this)})});return this},highlight:function(e,g){var d=this.getFxEl();g=g||{};d.queueFx(g,function(){e=e||"ffff9c";var p=g.attr||"backgroundColor";this.clearOpacity();this.show();var l=this.getColor(p);var b=this.dom.style[p];var m=(g.endColor||l)||"ffffff";var a=function(){d.dom.style[p]=b;d.afterFx(g)};var o={};o[p]={from:e,to:m};arguments.callee.anim=this.fxanim(o,g,"color",1,"easeIn",a)});return this},frame:function(g,l,h){var e=this.getFxEl();h=h||{};e.queueFx(h,function(){g=g||"#C3DAF9";if(g.length==6){g="#"+g}l=l||1;var a=h.duration||1;this.show();var d=this.getBox();var b=function(){var o=Ext.getBody().createChild({style:{visbility:"hidden",position:"absolute","z-index":"35000",border:"0px solid "+g}});var m=Ext.isBorderBox?2:1;o.animate({top:{from:d.y,to:d.y-20},left:{from:d.x,to:d.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:d.height,to:(d.height+(20*m))},width:{from:d.width,to:(d.width+(20*m))}},a,function(){o.remove();if(--l>0){b()}else{e.afterFx(h)}})};b.call(this)});return this},pause:function(g){var e=this.getFxEl();var d={};e.queueFx(d,function(){setTimeout(function(){e.afterFx(d)},g*1000)});return this},fadeIn:function(d){var e=this.getFxEl();d=d||{};e.queueFx(d,function(){this.setOpacity(0);this.fixDisplay();this.dom.style.visibility="visible";var a=d.endOpacity||1;arguments.callee.anim=this.fxanim({opacity:{to:a}},d,null,0.5,"easeOut",function(){if(a==1){this.clearOpacity()}e.afterFx(d)})});return this},fadeOut:function(d){var e=this.getFxEl();d=d||{};e.queueFx(d,function(){var a=d.endOpacity||0;arguments.callee.anim=this.fxanim({opacity:{to:a}},d,null,0.5,"easeOut",function(){if(a===0){if(this.visibilityMode==Ext.Element.DISPLAY||d.useDisplay){this.dom.style.display="none"}else{this.dom.style.visibility="hidden"}this.clearOpacity()}e.afterFx(d)})});return this},scale:function(e,d,g){this.shift(Ext.apply({},g,{width:e,height:d}));return this},shift:function(d){var e=this.getFxEl();d=d||{};e.queueFx(d,function(){var l={},m=d.width,h=d.height,o=d.x,a=d.y,b=d.opacity;if(m!==undefined){l.width={to:this.adjustWidth(m)}}if(h!==undefined){l.height={to:this.adjustHeight(h)}}if(d.left!==undefined){l.left={to:d.left}}if(d.top!==undefined){l.top={to:d.top}}if(d.right!==undefined){l.right={to:d.right}}if(d.bottom!==undefined){l.bottom={to:d.bottom}}if(o!==undefined||a!==undefined){l.points={to:[o!==undefined?o:this.getX(),a!==undefined?a:this.getY()]}}if(b!==undefined){l.opacity={to:b}}if(d.xy!==undefined){l.points={to:d.xy}}arguments.callee.anim=this.fxanim(l,d,"motion",0.35,"easeOut",function(){e.afterFx(d)})});return this},ghost:function(e,g){var d=this.getFxEl();g=g||{};d.queueFx(g,function(){e=e||"b";var h=this.getFxRestore();var q=this.getWidth(),o=this.getHeight();var p=this.dom.style;var a=function(){if(g.useDisplay){d.setDisplayed(false)}else{d.hide()}d.clearOpacity();d.setPositioning(h.pos);p.width=h.width;p.height=h.height;d.afterFx(g)};var r={opacity:{to:0},points:{}},b=r.points;switch(e.toLowerCase()){case"t":b.by=[0,-o];break;case"l":b.by=[-q,0];break;case"r":b.by=[q,0];break;case"b":b.by=[0,o];break;case"tl":b.by=[-q,-o];break;case"bl":b.by=[-q,o];break;case"br":b.by=[q,o];break;case"tr":b.by=[q,-o];break}arguments.callee.anim=this.fxanim(r,g,"motion",0.5,"easeOut",a)});return this},syncFx:function(){this.fxDefaults=Ext.apply(this.fxDefaults||{},{block:false,concurrent:true,stopFx:false});return this},sequenceFx:function(){this.fxDefaults=Ext.apply(this.fxDefaults||{},{block:false,concurrent:false,stopFx:false});return this},nextFx:function(){var b=this.fxQueue[0];if(b){b.call(this)}},hasActiveFx:function(){return this.fxQueue&&this.fxQueue[0]},stopFx:function(){if(this.hasActiveFx()){var b=this.fxQueue[0];if(b&&b.anim&&b.anim.isAnimated()){this.fxQueue=[b];b.anim.stop(true)}}return this},beforeFx:function(b){if(this.hasActiveFx()&&!b.concurrent){if(b.stopFx){this.stopFx();return true}return false}return true},hasFxBlock:function(){var b=this.fxQueue;return b&&b[0]&&b[0].block},queueFx:function(g,e){if(!this.fxQueue){this.fxQueue=[]}if(!this.hasFxBlock()){Ext.applyIf(g,this.fxDefaults);if(!g.concurrent){var d=this.beforeFx(g);e.block=g.block;this.fxQueue.push(e);if(d){this.nextFx()}}else{e.call(this)}}return this},fxWrap:function(m,p,q){var h;if(!p.wrap||!(h=Ext.get(p.wrap))){var l;if(p.fixPosition){l=this.getXY()}var o=document.createElement("div");o.style.visibility=q;h=Ext.get(this.dom.parentNode.insertBefore(o,this.dom));h.setPositioning(m);if(h.getStyle("position")=="static"){h.position("relative")}this.clearPositioning("auto");h.clip();h.dom.appendChild(this.dom);if(l){h.setXY(l)}}return h},fxUnwrap:function(e,g,d){this.clearPositioning();this.setPositioning(g);if(!d.wrap){e.dom.parentNode.insertBefore(this.dom,e.dom);e.remove()}},getFxRestore:function(){var b=this.dom.style;return{pos:this.getPositioning(),width:b.width,height:b.height}},afterFx:function(b){if(b.afterStyle){this.applyStyles(b.afterStyle)}if(b.afterCls){this.addClass(b.afterCls)}if(b.remove===true){this.remove()}Ext.callback(b.callback,b.scope,[this]);if(!b.concurrent){this.fxQueue.shift();this.nextFx()}},getFxEl:function(){return Ext.get(this.dom)},fxanim:function(r,q,l,p,s,m){l=l||"run";q=q||{};var o=Ext.lib.Anim[l](this.dom,r,(q.duration||p)||0.35,(q.easing||s)||"easeOut",function(){Ext.callback(m,this)},this);q.anim=o;return o}};Ext.Fx.resize=Ext.Fx.scale;Ext.apply(Ext.Element.prototype,Ext.Fx);Ext.CompositeElement=function(b){this.elements=[];this.addElements(b)};Ext.CompositeElement.prototype={isComposite:true,addElements:function(l){if(!l){return this}if(typeof l=="string"){l=Ext.Element.selectorFunction(l)}var m=this.elements;var g=m.length-1;for(var o=0,h=l.length;o<h;o++){m[++g]=Ext.get(l[o])}return this},fill:function(b){this.elements=[];this.add(b);return this},filter:function(e){var d=[];this.each(function(a){if(a.is(e)){d[d.length]=a.dom}});this.fill(d);return this},invoke:function(l,g){var m=this.elements;for(var o=0,h=m.length;o<h;o++){Ext.Element.prototype[l].apply(m[o],g)}return this},add:function(b){if(typeof b=="string"){this.addElements(Ext.Element.selectorFunction(b))}else{if(b.length!==undefined){this.addElements(b)}else{this.addElements([b])}}return this},each:function(l,m){var o=this.elements;for(var g=0,h=o.length;g<h;g++){if(l.call(m||o[g],o[g],this,g)===false){break}}return this},item:function(b){return this.elements[b]||null},first:function(){return this.item(0)},last:function(){return this.item(this.elements.length-1)},getCount:function(){return this.elements.length},contains:function(b){return this.indexOf(b)!==-1},indexOf:function(b){return this.elements.indexOf(Ext.get(b))},removeElement:function(p,m){if(Ext.isArray(p)){for(var q=0,l=p.length;q<l;q++){this.removeElement(p[q])}return this}var d=typeof p=="number"?p:this.indexOf(p);if(d!==-1&&this.elements[d]){if(m){var o=this.elements[d];if(o.dom){o.remove()}else{Ext.removeNode(o)}}this.elements.splice(d,1)}return this},replaceElement:function(h,l,g){var e=typeof h=="number"?h:this.indexOf(h);if(e!==-1){if(g){this.elements[e].replaceWith(l)}else{this.elements.splice(e,1,Ext.get(l))}}return this},clear:function(){this.elements=[]}};(function(){Ext.CompositeElement.createCall=function(a,d){if(!a[d]){a[d]=function(){return this.invoke(d,arguments)}}};for(var b in Ext.Element.prototype){if(typeof Ext.Element.prototype[b]=="function"){Ext.CompositeElement.createCall(Ext.CompositeElement.prototype,b)}}})();Ext.CompositeElementLite=function(b){Ext.CompositeElementLite.superclass.constructor.call(this,b);this.el=new Ext.Element.Flyweight()};Ext.extend(Ext.CompositeElementLite,Ext.CompositeElement,{addElements:function(l){if(l){if(Ext.isArray(l)){this.elements=this.elements.concat(l)}else{var m=this.elements;var g=m.length-1;for(var o=0,h=l.length;o<h;o++){m[++g]=l[o]}}}return this},invoke:function(m,h){var p=this.elements;var o=this.el;for(var q=0,l=p.length;q<l;q++){o.dom=p[q];Ext.Element.prototype[m].apply(o,h)}return this},item:function(b){if(!this.elements[b]){return null}this.el.dom=this.elements[b];return this.el},addListener:function(l,o,p,q){var r=this.elements;for(var s=0,m=r.length;s<m;s++){Ext.EventManager.on(r[s],l,o,p||r[s],q)}return this},each:function(m,o){var q=this.elements;var p=this.el;for(var h=0,l=q.length;h<l;h++){p.dom=q[h];if(m.call(o||p,p,this,h)===false){break}}return this},indexOf:function(b){return this.elements.indexOf(Ext.getDom(b))},replaceElement:function(m,o,h){var d=typeof m=="number"?m:this.indexOf(m);if(d!==-1){o=Ext.getDom(o);if(h){var l=this.elements[d];l.parentNode.insertBefore(o,l);Ext.removeNode(l)}this.elements.splice(d,1,o)}return this}});Ext.CompositeElementLite.prototype.on=Ext.CompositeElementLite.prototype.addListener;if(Ext.DomQuery){Ext.Element.selectorFunction=Ext.DomQuery.select}Ext.Element.select=function(g,h,e){var l;if(typeof g=="string"){l=Ext.Element.selectorFunction(g,e)}else{if(g.length!==undefined){l=g}else{throw"Invalid selector"}}if(h===true){return new Ext.CompositeElement(l)}else{return new Ext.CompositeElementLite(l)}};Ext.select=Ext.Element.select;Ext.data.Connection=function(b){Ext.apply(this,b);this.addEvents("beforerequest","requestcomplete","requestexception");Ext.data.Connection.superclass.constructor.call(this)};Ext.extend(Ext.data.Connection,Ext.util.Observable,{timeout:30000,autoAbort:false,disableCaching:true,disableCachingParam:"_dc",request:function(u){if(this.fireEvent("beforerequest",this,u)!==false){var w=u.params;if(typeof w=="function"){w=w.call(u.scope||window,u)}if(typeof w=="object"){w=Ext.urlEncode(w)}if(this.extraParams){var s=Ext.urlEncode(this.extraParams);w=w?(w+"&"+s):s}var z=u.url||this.url;if(typeof z=="function"){z=z.call(u.scope||window,u)}if(u.form){var v=Ext.getDom(u.form);z=z||v.action;var p=v.getAttribute("enctype");if(u.isUpload||(p&&p.toLowerCase()=="multipart/form-data")){return this.doFormUpload(u,w,z)}var q=Ext.lib.Ajax.serializeForm(v);w=w?(w+"&"+q):q}var o=u.headers;if(this.defaultHeaders){o=Ext.apply(o||{},this.defaultHeaders);if(!u.headers){u.headers=o}}var t={success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{options:u},timeout:u.timeout||this.timeout};var B=u.method||this.method||((w||u.xmlData||u.jsonData)?"POST":"GET");if(B=="GET"&&(this.disableCaching&&u.disableCaching!==false)||u.disableCaching===true){var r=u.disableCachingParam||this.disableCachingParam;z+=(z.indexOf("?")!=-1?"&":"?")+r+"="+(new Date().getTime())}if(typeof u.autoAbort=="boolean"){if(u.autoAbort){this.abort()}}else{if(this.autoAbort!==false){this.abort()}}if((B=="GET"||u.xmlData||u.jsonData)&&w){z+=(z.indexOf("?")!=-1?"&":"?")+w;w=""}this.transId=Ext.lib.Ajax.request(B,z,t,w,u);return this.transId}else{Ext.callback(u.callback,u.scope,[u,null,null]);return null}},isLoading:function(b){if(b){return Ext.lib.Ajax.isCallInProgress(b)}else{return this.transId?true:false}},abort:function(b){if(b||this.isLoading()){Ext.lib.Ajax.abort(b||this.transId)}},handleResponse:function(e){this.transId=false;var d=e.argument.options;e.argument=d?d.argument:null;this.fireEvent("requestcomplete",this,e,d);Ext.callback(d.success,d.scope,[e,d]);Ext.callback(d.callback,d.scope,[d,true,e])},handleFailure:function(e,g){this.transId=false;var d=e.argument.options;e.argument=d?d.argument:null;this.fireEvent("requestexception",this,e,d,g);Ext.callback(d.failure,d.scope,[e,d]);Ext.callback(d.callback,d.scope,[d,false,e])},doFormUpload:function(z,E,D){var C=Ext.id();var w=document.createElement("iframe");w.id=C;w.name=C;w.className="x-hidden";if(Ext.isIE){w.src=Ext.SSL_SECURE_URL}document.body.appendChild(w);if(Ext.isIE){document.frames[C].name=C}var B=Ext.getDom(z.form);B.target=C;B.method="POST";B.enctype=B.encoding="multipart/form-data";if(D){B.action=D}var o,s;if(E){o=[];E=Ext.urlDecode(E,false);for(var u in E){if(E.hasOwnProperty(u)){s=document.createElement("input");s.type="hidden";s.name=u;s.value=E[u];B.appendChild(s);o.push(s)}}}function v(){var b={responseText:"",responseXML:null};b.argument=z?z.argument:null;try{var d;if(Ext.isIE){d=w.contentWindow.document}else{d=(w.contentDocument||window.frames[C].document)}if(d&&d.body){b.responseText=d.body.innerHTML}if(d&&d.XMLDocument){b.responseXML=d.XMLDocument}else{b.responseXML=d}}catch(a){}Ext.EventManager.removeListener(w,"load",v,this);this.fireEvent("requestcomplete",this,b,z);Ext.callback(z.success,z.scope,[b,z]);Ext.callback(z.callback,z.scope,[z,true,b]);setTimeout(function(){Ext.removeNode(w)},100)}Ext.EventManager.on(w,"load",v,this);B.submit();if(o){for(var t=0,r=o.length;t<r;t++){Ext.removeNode(o[t])}}}});Ext.Ajax=new Ext.data.Connection({autoAbort:false,serializeForm:function(b){return Ext.lib.Ajax.serializeForm(b)}});Ext.Updater=Ext.extend(Ext.util.Observable,{constructor:function(d,e){d=Ext.get(d);if(!e&&d.updateManager){return d.updateManager}this.el=d;this.defaultUrl=null;this.addEvents("beforeupdate","update","failure");var g=Ext.Updater.defaults;this.sslBlankUrl=g.sslBlankUrl;this.disableCaching=g.disableCaching;this.indicatorText=g.indicatorText;this.showLoadIndicator=g.showLoadIndicator;this.timeout=g.timeout;this.loadScripts=g.loadScripts;this.transaction=null;this.refreshDelegate=this.refresh.createDelegate(this);this.updateDelegate=this.update.createDelegate(this);this.formUpdateDelegate=this.formUpdate.createDelegate(this);if(!this.renderer){this.renderer=this.getDefaultRenderer()}Ext.Updater.superclass.constructor.call(this)},getDefaultRenderer:function(){return new Ext.Updater.BasicRenderer()},getEl:function(){return this.el},update:function(l,p,o,r){if(this.fireEvent("beforeupdate",this.el,l,p)!==false){var m,s;if(typeof l=="object"){m=l;l=m.url;p=p||m.params;o=o||m.callback;r=r||m.discardUrl;s=m.scope;if(typeof m.nocache!="undefined"){this.disableCaching=m.nocache}if(typeof m.text!="undefined"){this.indicatorText='<div class="loading-indicator">'+m.text+"</div>"}if(typeof m.scripts!="undefined"){this.loadScripts=m.scripts}if(typeof m.timeout!="undefined"){this.timeout=m.timeout}}this.showLoading();if(!r){this.defaultUrl=l}if(typeof l=="function"){l=l.call(this)}var q=Ext.apply({},{url:l,params:(typeof p=="function"&&s)?p.createDelegate(s):p,success:this.processSuccess,failure:this.processFailure,scope:this,callback:undefined,timeout:(this.timeout*1000),disableCaching:this.disableCaching,argument:{options:m,url:l,form:null,callback:o,scope:s||window,params:p}},m);this.transaction=Ext.Ajax.request(q)}},formUpdate:function(l,g,e,h){if(this.fireEvent("beforeupdate",this.el,l,g)!==false){if(typeof g=="function"){g=g.call(this)}l=Ext.getDom(l);this.transaction=Ext.Ajax.request({form:l,url:g,success:this.processSuccess,failure:this.processFailure,scope:this,timeout:(this.timeout*1000),argument:{url:g,form:l,callback:h,reset:e}});this.showLoading.defer(1,this)}},refresh:function(b){if(this.defaultUrl==null){return}this.update(this.defaultUrl,null,b,true)},startAutoRefresh:function(g,o,m,l,h){if(h){this.update(o||this.defaultUrl,m,l,true)}if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId)}this.autoRefreshProcId=setInterval(this.update.createDelegate(this,[o||this.defaultUrl,m,l,true]),g*1000)},stopAutoRefresh:function(){if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);delete this.autoRefreshProcId}},isAutoRefreshing:function(){return this.autoRefreshProcId?true:false},showLoading:function(){if(this.showLoadIndicator){this.el.update(this.indicatorText)}},processSuccess:function(e){this.transaction=null;if(e.argument.form&&e.argument.reset){try{e.argument.form.reset()}catch(d){}}if(this.loadScripts){this.renderer.render(this.el,e,this,this.updateComplete.createDelegate(this,[e]))}else{this.renderer.render(this.el,e,this);this.updateComplete(e)}},updateComplete:function(b){this.fireEvent("update",this.el,b);if(typeof b.argument.callback=="function"){b.argument.callback.call(b.argument.scope,this.el,true,b,b.argument.options)}},processFailure:function(b){this.transaction=null;this.fireEvent("failure",this.el,b);if(typeof b.argument.callback=="function"){b.argument.callback.call(b.argument.scope,this.el,false,b,b.argument.options)}},setRenderer:function(b){this.renderer=b},getRenderer:function(){return this.renderer},setDefaultUrl:function(b){this.defaultUrl=b},abort:function(){if(this.transaction){Ext.Ajax.abort(this.transaction)}},isUpdating:function(){if(this.transaction){return Ext.Ajax.isLoading(this.transaction)}return false}});Ext.Updater.defaults={timeout:30,loadScripts:false,sslBlankUrl:(Ext.SSL_SECURE_URL||"javascript:false"),disableCaching:false,showLoadIndicator:true,indicatorText:'<div class="loading-indicator">Loading...</div>'};Ext.Updater.updateElement=function(m,o,l,g){var h=Ext.get(m).getUpdater();Ext.apply(h,g);h.update(o,l,g?g.callback:null)};Ext.Updater.BasicRenderer=function(){};Ext.Updater.BasicRenderer.prototype={render:function(l,g,e,h){l.update(g.responseText,e.loadScripts,h)}};Ext.UpdateManager=Ext.Updater;(function(){function xf(format){var args=Array.prototype.slice.call(arguments,1);return format.replace(/\{(\d+)\}/g,function(m,i){return args[i]})}Date.formatCodeToRegex=function(character,currentGroup){var p=Date.parseCodes[character];if(p){p=Ext.type(p)=="function"?p():p;Date.parseCodes[character]=p}return p?Ext.applyIf({c:p.c?xf(p.c,currentGroup||"{0}"):p.c},p):{g:0,c:null,s:Ext.escapeRe(character)}};var $f=Date.formatCodeToRegex;Ext.apply(Date,{parseFunctions:{count:0},parseRegexes:[],formatFunctions:{count:0},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],y2kYear:50,MILLI:"ms",SECOND:"s",MINUTE:"mi",HOUR:"h",DAY:"d",MONTH:"mo",YEAR:"y",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNumbers:{Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},getShortMonthName:function(month){return Date.monthNames[month].substring(0,3)},getShortDayName:function(day){return Date.dayNames[day].substring(0,3)},getMonthNumber:function(name){return Date.monthNumbers[name.substring(0,1).toUpperCase()+name.substring(1,3).toLowerCase()]},formatCodes:{d:"String.leftPad(this.getDate(), 2, '0')",D:"Date.getShortDayName(this.getDay())",j:"this.getDate()",l:"Date.dayNames[this.getDay()]",N:"(this.getDay() ? this.getDay() : 7)",S:"this.getSuffix()",w:"this.getDay()",z:"this.getDayOfYear()",W:"String.leftPad(this.getWeekOfYear(), 2, '0')",F:"Date.monthNames[this.getMonth()]",m:"String.leftPad(this.getMonth() + 1, 2, '0')",M:"Date.getShortMonthName(this.getMonth())",n:"(this.getMonth() + 1)",t:"this.getDaysInMonth()",L:"(this.isLeapYear() ? 1 : 0)",o:"(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0)))",Y:"this.getFullYear()",y:"('' + this.getFullYear()).substring(2, 4)",a:"(this.getHours() < 12 ? 'am' : 'pm')",A:"(this.getHours() < 12 ? 'AM' : 'PM')",g:"((this.getHours() % 12) ? this.getHours() % 12 : 12)",G:"this.getHours()",h:"String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')",H:"String.leftPad(this.getHours(), 2, '0')",i:"String.leftPad(this.getMinutes(), 2, '0')",s:"String.leftPad(this.getSeconds(), 2, '0')",u:"String.leftPad(this.getMilliseconds(), 3, '0')",O:"this.getGMTOffset()",P:"this.getGMTOffset(true)",T:"this.getTimezone()",Z:"(this.getTimezoneOffset() * -60)",c:function(){for(var c="Y-m-dTH:i:sP",code=[],i=0,l=c.length;i<l;++i){var e=c.charAt(i);code.push(e=="T"?"'T'":Date.getFormatCode(e))}return code.join(" + ")},U:"Math.round(this.getTime() / 1000)"},parseDate:function(input,format){var p=Date.parseFunctions;if(p[format]==null){Date.createParser(format)}var func=p[format];return Date[func](input)},getFormatCode:function(character){var f=Date.formatCodes[character];if(f){f=Ext.type(f)=="function"?f():f;Date.formatCodes[character]=f}return f||("'"+String.escape(character)+"'")},createNewFormat:function(format){var funcName="format"+Date.formatFunctions.count++,code="Date.prototype."+funcName+" = function(){return ",special=false,ch="";Date.formatFunctions[format]=funcName;for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true}else{if(special){special=false;code+="'"+String.escape(ch)+"' + "}else{code+=Date.getFormatCode(ch)+" + "}}}eval(code.substring(0,code.length-3)+";}")},createParser:function(){var code=["Date.{0} = function(input){","var y, m, d, h = 0, i = 0, s = 0, ms = 0, o, z, u, v;","input = String(input);","d = new Date();","y = d.getFullYear();","m = d.getMonth();","d = d.getDate();","var results = input.match(Date.parseRegexes[{1}]);","if(results && results.length > 0){","{2}","if(u){","v = new Date(u * 1000);","}else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0 && ms >= 0){","v = new Date(y, m, d, h, i, s, ms);","}else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0){","v = new Date(y, m, d, h, i, s);","}else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0){","v = new Date(y, m, d, h, i);","}else if (y >= 0 && m >= 0 && d > 0 && h >= 0){","v = new Date(y, m, d, h);","}else if (y >= 0 && m >= 0 && d > 0){","v = new Date(y, m, d);","}else if (y >= 0 && m >= 0){","v = new Date(y, m);","}else if (y >= 0){","v = new Date(y);","}","}","return (v && (z != null || o != null))? (Ext.type(z) == 'number' ? v.add(Date.SECOND, -v.getTimezoneOffset() * 60 - z) : v.add(Date.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn))) : v;","}"].join("\n");return function(format){var funcName="parse"+Date.parseFunctions.count++,regexNum=Date.parseRegexes.length,currentGroup=1,calc="",regex="",special=false,ch="";Date.parseFunctions[format]=funcName;for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true}else{if(special){special=false;regex+=String.escape(ch)}else{var obj=$f(ch,currentGroup);currentGroup+=obj.g;regex+=obj.s;if(obj.g&&obj.c){calc+=obj.c}}}}Date.parseRegexes[regexNum]=new RegExp("^"+regex+"$","i");eval(xf(code,funcName,regexNum,calc))}}(),parseCodes:{d:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},j:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},D:function(){for(var a=[],i=0;i<7;a.push(Date.getShortDayName(i)),++i){}return{g:0,c:null,s:"(?:"+a.join("|")+")"}},l:function(){return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"}},N:{g:0,c:null,s:"[1-7]"},S:{g:0,c:null,s:"(?:st|nd|rd|th)"},w:{g:0,c:null,s:"[0-6]"},z:{g:0,c:null,s:"(?:\\d{1,3})"},W:{g:0,c:null,s:"(?:\\d{2})"},F:function(){return{g:1,c:"m = parseInt(Date.getMonthNumber(results[{0}]), 10);\n",s:"("+Date.monthNames.join("|")+")"}},M:function(){for(var a=[],i=0;i<12;a.push(Date.getShortMonthName(i)),++i){}return Ext.applyIf({s:"("+a.join("|")+")"},$f("F"))},m:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{2})"},n:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{1,2})"},t:{g:0,c:null,s:"(?:\\d{2})"},L:{g:0,c:null,s:"(?:1|0)"},o:function(){return $f("Y")},Y:{g:1,c:"y = parseInt(results[{0}], 10);\n",s:"(\\d{4})"},y:{g:1,c:"var ty = parseInt(results[{0}], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"},a:{g:1,c:"if (results[{0}] == 'am') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(am|pm)"},A:{g:1,c:"if (results[{0}] == 'AM') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"},g:function(){return $f("G")},G:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},h:function(){return $f("H")},H:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},i:{g:1,c:"i = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},s:{g:1,c:"s = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},u:{g:1,c:"ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",s:"(\\d+)"},O:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1);","var hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60);","var mn = o.substring(3,5) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{4})"},P:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1);","var hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60);","var mn = o.substring(4,6) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{2}:\\d{2})"},T:{g:0,c:null,s:"[A-Z]{1,4}"},Z:{g:1,c:"z = results[{0}] * 1;\nz = (-43200 <= z && z <= 50400)? z : null;\n",s:"([+-]?\\d{1,5})"},c:function(){var calc=[],arr=[$f("Y",1),$f("m",2),$f("d",3),$f("h",4),$f("i",5),$f("s",6),{c:"ms = (results[7] || '.0').substring(1); ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"},{c:["if(results[9] == 'Z'){","z = 0;","}else{",$f("P",9).c,"}"].join("\n")}];for(var i=0,l=arr.length;i<l;++i){calc.push(arr[i].c)}return{g:1,c:calc.join(""),s:arr[0].s+"-"+arr[1].s+"-"+arr[2].s+"T"+arr[3].s+":"+arr[4].s+":"+arr[5].s+"((.|,)\\d+)?(Z|([+-]\\d{2}:\\d{2}))"}},U:{g:1,c:"u = parseInt(results[{0}], 10);\n",s:"(-?\\d+)"}}})}());Ext.apply(Date.prototype,{dateFormat:function(d){if(Date.formatFunctions[d]==null){Date.createNewFormat(d)}var e=Date.formatFunctions[d];return this[e]()},getTimezone:function(){return this.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/,"$1$2").replace(/[^A-Z]/g,"")},getGMTOffset:function(b){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+(b?":":"")+String.leftPad(Math.abs(this.getTimezoneOffset()%60),2,"0")},getDayOfYear:function(){var e=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var d=0;d<this.getMonth();++d){e+=Date.daysInMonth[d]}return e+this.getDate()-1},getWeekOfYear:function(){var e=86400000,d=7*e;return function(){var b=Date.UTC(this.getFullYear(),this.getMonth(),this.getDate()+3)/e,g=Math.floor(b/7),a=new Date(g*d).getUTCFullYear();return g-Math.floor(Date.UTC(a,0,7)/d)+1}}(),isLeapYear:function(){var b=this.getFullYear();return !!((b&3)==0&&(b%100||(b%400==0&&b)))},getFirstDayOfMonth:function(){var b=(this.getDay()-(this.getDate()-1))%7;return(b<0)?(b+7):b},getLastDayOfMonth:function(){var b=(this.getDay()+(Date.daysInMonth[this.getMonth()]-this.getDate()))%7;return(b<0)?(b+7):b},getFirstDateOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),1)},getLastDateOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),this.getDaysInMonth())},getDaysInMonth:function(){Date.daysInMonth[1]=this.isLeapYear()?29:28;return Date.daysInMonth[this.getMonth()]},getSuffix:function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}},clone:function(){return new Date(this.getTime())},clearTime:function(b){if(b){return this.clone().clearTime()}this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this},add:function(d,l){var h=this.clone();if(!d||l===0){return h}switch(d.toLowerCase()){case Date.MILLI:h.setMilliseconds(this.getMilliseconds()+l);break;case Date.SECOND:h.setSeconds(this.getSeconds()+l);break;case Date.MINUTE:h.setMinutes(this.getMinutes()+l);break;case Date.HOUR:h.setHours(this.getHours()+l);break;case Date.DAY:h.setDate(this.getDate()+l);break;case Date.MONTH:var g=this.getDate();if(g>28){g=Math.min(g,this.getFirstDateOfMonth().add("mo",l).getLastDateOfMonth().getDate())}h.setDate(g);h.setMonth(this.getMonth()+l);break;case Date.YEAR:h.setFullYear(this.getFullYear()+l);break}return h},between:function(g,e){var d=this.getTime();return g.getTime()<=d&&d<=e.getTime()}});Date.prototype.format=Date.prototype.dateFormat;if(Ext.isSafari){Date.brokenSetMonth=Date.prototype.setMonth;Date.prototype.setMonth=function(g){if(g<=-1){var h=Math.ceil(-g);var l=Math.ceil(h/12);var e=(h%12)?12-h%12:0;this.setFullYear(this.getFullYear()-l);return Date.brokenSetMonth.call(this,e)}else{return Date.brokenSetMonth.apply(this,arguments)}}}Ext.util.DelayedTask=function(p,q,l){var m=null,o,d;var r=function(){var a=new Date().getTime();if(a-d>=o){clearInterval(m);m=null;p.apply(q,l||[])}};this.delay=function(e,a,b,g){if(m&&e!=o){this.cancel()}o=e;d=new Date().getTime();p=a||p;q=b||q;l=g||l;if(!m){m=setInterval(r,o)}};this.cancel=function(){if(m){clearInterval(m);m=null}}};Ext.util.TaskRunner=function(q){q=q||10;var p=[],u=[];var t=0;var o=false;var r=function(){o=false;clearInterval(t);t=0};var m=function(){if(!o){o=true;t=setInterval(l,q)}};var s=function(a){u.push(a);if(a.onStop){a.onStop.apply(a.scope||a)}};var l=function(){if(u.length>0){for(var d=0,a=u.length;d<a;d++){p.remove(u[d])}u=[];if(p.length<1){r();return}}var g=new Date().getTime();for(var d=0,a=p.length;d<a;++d){var e=p[d];var b=g-e.taskRunTime;if(e.interval<=b){var h=e.run.apply(e.scope||e,e.args||[++e.taskRunCount]);e.taskRunTime=g;if(h===false||e.taskRunCount===e.repeat){s(e);return}}if(e.duration&&e.duration<=(g-e.taskStartTime)){s(e)}}};this.start=function(a){p.push(a);a.taskStartTime=new Date().getTime();a.taskRunTime=0;a.taskRunCount=0;m();return a};this.stop=function(a){s(a);return a};this.stopAll=function(){r();for(var a=0,b=p.length;a<b;a++){if(p[a].onStop){p[a].onStop()}}p=[];u=[]}};Ext.TaskMgr=new Ext.util.TaskRunner();Ext.util.MixedCollection=function(d,e){this.items=[];this.map={};this.keys=[];this.length=0;this.addEvents("clear","add","replace","remove","sort");this.allowFunctions=d===true;if(e){this.getKey=e}Ext.util.MixedCollection.superclass.constructor.call(this)};Ext.extend(Ext.util.MixedCollection,Ext.util.Observable,{allowFunctions:false,add:function(d,g){if(arguments.length==1){g=arguments[0];d=this.getKey(g)}if(typeof d=="undefined"||d===null){this.length++;this.items.push(g);this.keys.push(null)}else{var e=this.map[d];if(e){return this.replace(d,g)}this.length++;this.items.push(g);this.map[d]=g;this.keys.push(d)}this.fireEvent("add",this.length-1,g,d);return g},getKey:function(b){return b.id},replace:function(l,h){if(arguments.length==1){h=arguments[0];l=this.getKey(h)}var g=this.item(l);if(typeof l=="undefined"||l===null||typeof g=="undefined"){return this.add(l,h)}var e=this.indexOfKey(l);this.items[e]=h;this.map[l]=h;this.fireEvent("replace",l,g,h);return h},addAll:function(l){if(arguments.length>1||Ext.isArray(l)){var g=arguments.length>1?arguments:l;for(var m=0,h=g.length;m<h;m++){this.add(g[m])}}else{for(var o in l){if(this.allowFunctions||typeof l[o]!="function"){this.add(o,l[o])}}}},each:function(l,m){var g=[].concat(this.items);for(var o=0,h=g.length;o<h;o++){if(l.call(m||g[o],g[o],o,h)===false){break}}},eachKey:function(h,l){for(var e=0,g=this.keys.length;e<g;e++){h.call(l||window,this.keys[e],this.items[e],e,g)}},find:function(h,l){for(var e=0,g=this.items.length;e<g;e++){if(h.call(l||window,this.items[e],this.keys[e])){return this.items[e]}}return null},insert:function(e,d,g){if(arguments.length==2){g=arguments[1];d=this.getKey(g)}if(e>=this.length){return this.add(d,g)}this.length++;this.items.splice(e,0,g);if(typeof d!="undefined"&&d!=null){this.map[d]=g}this.keys.splice(e,0,d);this.fireEvent("add",e,g,d);return g},remove:function(b){return this.removeAt(this.indexOf(b))},removeAt:function(e){if(e<this.length&&e>=0){this.length--;var g=this.items[e];this.items.splice(e,1);var d=this.keys[e];if(typeof d!="undefined"){delete this.map[d]}this.keys.splice(e,1);this.fireEvent("remove",g,d);return g}return false},removeKey:function(b){return this.removeAt(this.indexOfKey(b))},getCount:function(){return this.length},indexOf:function(b){return this.items.indexOf(b)},indexOfKey:function(b){return this.keys.indexOf(b)},item:function(e){var d=typeof this.map[e]!="undefined"?this.map[e]:this.items[e];return typeof d!="function"||this.allowFunctions?d:null},itemAt:function(b){return this.items[b]},key:function(b){return this.map[b]},contains:function(b){return this.indexOf(b)!=-1},containsKey:function(b){return typeof this.map[b]!="undefined"},clear:function(){this.length=0;this.items=[];this.keys=[];this.map={};this.fireEvent("clear")},first:function(){return this.items[0]},last:function(){return this.items[this.length-1]},_sort:function(o,w,p){var u=String(w).toUpperCase()=="DESC"?-1:1;p=p||function(a,b){return a-b};var q=[],v=this.keys,r=this.items;for(var t=0,s=r.length;t<s;t++){q[q.length]={key:v[t],value:r[t],index:t}}q.sort(function(b,d){var a=p(b[o],d[o])*u;if(a==0){a=(b.index<d.index?-1:1)}return a});for(var t=0,s=q.length;t<s;t++){r[t]=q[t].value;v[t]=q[t].key}this.fireEvent("sort",this)},sort:function(e,d){this._sort("value",e,d)},keySort:function(e,d){this._sort("key",e,d||function(h,l){var a=String(h).toUpperCase(),b=String(l).toUpperCase();return a>b?1:(a<b?-1:0)})},getRange:function(l,h){var g=this.items;if(g.length<1){return[]}l=l||0;h=Math.min(typeof h=="undefined"?this.length-1:h,this.length-1);var m=[];if(l<=h){for(var o=l;o<=h;o++){m[m.length]=g[o]}}else{for(var o=l;o>=h;o--){m[m.length]=g[o]}}return m},filter:function(l,e,h,g){if(Ext.isEmpty(e,false)){return this.clone()}e=this.createValueMatcher(e,h,g);return this.filterBy(function(a){return a&&e.test(a[l])})},filterBy:function(p,q){var o=new Ext.util.MixedCollection();o.getKey=this.getKey;var l=this.keys,r=this.items;for(var s=0,m=r.length;s<m;s++){if(p.call(q||this,r[s],l[s])){o.add(l[s],r[s])}}return o},findIndex:function(o,g,l,m,h){if(Ext.isEmpty(g,false)){return -1}g=this.createValueMatcher(g,m,h);return this.findIndexBy(function(a){return a&&g.test(a[o])},null,l)},findIndexBy:function(p,q,o){var l=this.keys,r=this.items;for(var s=(o||0),m=r.length;s<m;s++){if(p.call(q||this,r[s],l[s])){return s}}if(typeof o=="number"&&o>0){for(var s=0;s<o;s++){if(p.call(q||this,r[s],l[s])){return s}}}return -1},createValueMatcher:function(d,g,e){if(!d.exec){d=String(d);d=new RegExp((g===true?"":"^")+Ext.escapeRe(d),e?"":"i")}return d},clone:function(){var l=new Ext.util.MixedCollection();var g=this.keys,m=this.items;for(var o=0,h=m.length;o<h;o++){l.add(g[o],m[o])}l.getKey=this.getKey;return l}});Ext.util.MixedCollection.prototype.get=Ext.util.MixedCollection.prototype.item;Ext.util.JSON=new (function(){var useHasOwn=!!{}.hasOwnProperty;var pad=function(n){return n<10?"0"+n:n};var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};var encodeString=function(s){if(/["\\\x00-\x1f]/.test(s)){return'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+s+'"'};var encodeArray=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i<l;i+=1){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(v===null?"null":Ext.util.JSON.encode(v));b=true}}a.push("]");return a.join("")};this.encodeDate=function(o){return'"'+o.getFullYear()+"-"+pad(o.getMonth()+1)+"-"+pad(o.getDate())+"T"+pad(o.getHours())+":"+pad(o.getMinutes())+":"+pad(o.getSeconds())+'"'};this.encode=function(o){if(typeof o=="undefined"||o===null){return"null"}else{if(Ext.isArray(o)){return encodeArray(o)}else{if(Ext.isDate(o)){return Ext.util.JSON.encodeDate(o)}else{if(typeof o=="string"){return encodeString(o)}else{if(typeof o=="number"){return isFinite(o)?String(o):"null"}else{if(typeof o=="boolean"){return String(o)}else{var a=["{"],b,i,v;for(i in o){if(!useHasOwn||o.hasOwnProperty(i)){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(this.encode(i),":",v===null?"null":this.encode(v));b=true}}}a.push("}");return a.join("")}}}}}}};this.decode=function(json){return eval("("+json+")")}})();Ext.encode=Ext.util.JSON.encode;Ext.decode=Ext.util.JSON.decode;Ext.util.Format=function(){var trimRe=/^\s+|\s+$/g;return{ellipsis:function(value,len){if(value&&value.length>len){return value.substr(0,len-3)+"..."}return value},undef:function(value){return value!==undefined?value:""},defaultValue:function(value,defaultValue){return value!==undefined&&value!==""?value:defaultValue},htmlEncode:function(value){return !value?value:String(value).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")},htmlDecode:function(value){return !value?value:String(value).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&")},trim:function(value){return String(value).replace(trimRe,"")},substr:function(value,start,length){return String(value).substr(start,length)},lowercase:function(value){return String(value).toLowerCase()},uppercase:function(value){return String(value).toUpperCase()},capitalize:function(value){return !value?value:value.charAt(0).toUpperCase()+value.substr(1).toLowerCase()},call:function(value,fn){if(arguments.length>2){var args=Array.prototype.slice.call(arguments,2);args.unshift(value);return eval(fn).apply(window,args)}else{return eval(fn).call(window,value)}},usMoney:function(v){v=(Math.round((v-0)*100))/100;v=(v==Math.floor(v))?v+".00":((v*10==Math.floor(v*10))?v+"0":v);v=String(v);var ps=v.split(".");var whole=ps[0];var sub=ps[1]?"."+ps[1]:".00";var r=/(\d+)(\d{3})/;while(r.test(whole)){whole=whole.replace(r,"$1,$2")}v=whole+sub;if(v.charAt(0)=="-"){return"-$"+v.substr(1)}return"$"+v},date:function(v,format){if(!v){return""}if(!Ext.isDate(v)){v=new Date(Date.parse(v))}return v.dateFormat(format||"m/d/Y")},dateRenderer:function(format){return function(v){return Ext.util.Format.date(v,format)}},stripTagsRE:/<\/?[^>]+>/gi,stripTags:function(v){return !v?v:String(v).replace(this.stripTagsRE,"")},stripScriptsRe:/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,stripScripts:function(v){return !v?v:String(v).replace(this.stripScriptsRe,"")},fileSize:function(size){if(size<1024){return size+" bytes"}else{if(size<1048576){return(Math.round(((size*10)/1024))/10)+" KB"}else{return(Math.round(((size*10)/1048576))/10)+" MB"}}},math:function(){var fns={};return function(v,a){if(!fns[a]){fns[a]=new Function("v","return v "+a+";")}return fns[a](v)}}(),nl2br:function(v){return v===undefined||v===null?"":v.replace(/\n/g,"<br/>")}}}();Ext.XTemplate=function(){Ext.XTemplate.superclass.constructor.apply(this,arguments);var K=this.html;K=["<tpl>",K,"</tpl>"].join("");var L=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/;var m=/^<tpl\b[^>]*?for="(.*?)"/;var v=/^<tpl\b[^>]*?if="(.*?)"/;var z=/^<tpl\b[^>]*?exec="(.*?)"/;var H,I=0;var D=[];while(H=K.match(L)){var s=H[0].match(m);var w=H[0].match(v);var B=H[0].match(z);var F=null,C=null,G=null;var J=s&&s[1]?s[1]:"";if(w){F=w&&w[1]?w[1]:null;if(F){C=new Function("values","parent","xindex","xcount","with(values){ return "+(Ext.util.Format.htmlDecode(F))+"; }")}}if(B){F=B&&B[1]?B[1]:null;if(F){G=new Function("values","parent","xindex","xcount","with(values){ "+(Ext.util.Format.htmlDecode(F))+"; }")}}if(J){switch(J){case".":J=new Function("values","parent","with(values){ return values; }");break;case"..":J=new Function("values","parent","with(values){ return parent; }");break;default:J=new Function("values","parent","with(values){ return "+J+"; }")}}D.push({id:I,target:J,exec:G,test:C,body:H[1]||""});K=K.replace(H[0],"{xtpl"+I+"}");++I}for(var E=D.length-1;E>=0;--E){this.compileTpl(D[E])}this.master=D[D.length-1];this.tpls=D};Ext.extend(Ext.XTemplate,Ext.Template,{re:/\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,codeRe:/\{\[((?:\\\]|.|\n)*?)\]\}/g,applySubTemplate:function(z,q,r,u,v){var o=this.tpls[z];if(o.test&&!o.test.call(this,q,r,u,v)){return""}if(o.exec&&o.exec.call(this,q,r,u,v)){return""}var p=o.target?o.target.call(this,q,r):q;r=o.target?q:r;if(o.target&&Ext.isArray(p)){var w=[];for(var t=0,s=p.length;t<s;t++){w[w.length]=o.compiled.call(this,p[t],r,t+1,s)}return w.join("")}return o.compiled.call(this,p,r,u,v)},compileTpl:function(tpl){var fm=Ext.util.Format;var useF=this.disableFormats!==true;var sep=Ext.isGecko?"+":",";var fn=function(m,name,format,args,math){if(name.substr(0,4)=="xtpl"){return"'"+sep+"this.applySubTemplate("+name.substr(4)+", values, parent, xindex, xcount)"+sep+"'"}var v;if(name==="."){v="values"}else{if(name==="#"){v="xindex"}else{if(name.indexOf(".")!=-1){v=name}else{v="values['"+name+"']"}}}if(math){v="("+v+math+")"}if(format&&useF){args=args?","+args:"";if(format.substr(0,5)!="this."){format="fm."+format+"("}else{format='this.call("'+format.substr(5)+'", ';args=", values"}}else{args="";format="("+v+" === undefined ? '' : "}return"'"+sep+format+v+args+")"+sep+"'"};var codeFn=function(m,code){return"'"+sep+"("+code+")"+sep+"'"};var body;if(Ext.isGecko){body="tpl.compiled = function(values, parent, xindex, xcount){ return '"+tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn)+"';};"}else{body=["tpl.compiled = function(values, parent, xindex, xcount){ return ['"];body.push(tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,codeFn));body.push("'].join('');};");body=body.join("")}eval(body);return this},applyTemplate:function(b){return this.master.compiled.call(this,b,{},1,1)},compile:function(){return this}});Ext.XTemplate.prototype.apply=Ext.XTemplate.prototype.applyTemplate;Ext.XTemplate.from=function(b){b=Ext.getDom(b);return new Ext.XTemplate(b.value||b.innerHTML)};Ext.util.CSS=function(){var h=null;var l=document;var e=/(-[a-z])/gi;var g=function(b,a){return a.charAt(1).toUpperCase()};return{createStyleSheet:function(o,a){var p;var q=l.getElementsByTagName("head")[0];var b=l.createElement("style");b.setAttribute("type","text/css");if(a){b.setAttribute("id",a)}if(Ext.isIE){q.appendChild(b);p=b.styleSheet;p.cssText=o}else{try{b.appendChild(l.createTextNode(o))}catch(d){b.cssText=o}q.appendChild(b);p=b.styleSheet?b.styleSheet:(b.sheet||l.styleSheets[l.styleSheets.length-1])}this.cacheStyleSheet(p);return p},removeStyleSheet:function(a){var b=l.getElementById(a);if(b){b.parentNode.removeChild(b)}},swapStyleSheet:function(a,d){this.removeStyleSheet(a);var b=l.createElement("link");b.setAttribute("rel","stylesheet");b.setAttribute("type","text/css");b.setAttribute("id",a);b.setAttribute("href",d);l.getElementsByTagName("head")[0].appendChild(b)},refreshCache:function(){return this.getRules(true)},cacheStyleSheet:function(d){if(!h){h={}}try{var a=d.cssRules||d.rules;for(var m=a.length-1;m>=0;--m){h[a[m].selectorText]=a[m]}}catch(b){}},getRules:function(o){if(h==null||o){h={};var b=l.styleSheets;for(var d=0,p=b.length;d<p;d++){try{this.cacheStyleSheet(b[d])}catch(a){}}}return h},getRule:function(m,b){var d=this.getRules(b);if(!Ext.isArray(m)){return d[m]}for(var a=0;a<m.length;a++){if(d[m[a]]){return d[m[a]]}}return null},updateRule:function(o,b,d){if(!Ext.isArray(o)){var a=this.getRule(o);if(a){a.style[b.replace(e,g)]=d;return true}}else{for(var m=0;m<o.length;m++){if(this.updateRule(o[m],b,d)){return true}}}return false}}}();Ext.util.ClickRepeater=function(d,e){this.el=Ext.get(d);this.el.unselectable();Ext.apply(this,e);this.addEvents("mousedown","click","mouseup");this.el.on("mousedown",this.handleMouseDown,this);if(this.preventDefault||this.stopDefault){this.el.on("click",function(a){if(this.preventDefault){a.preventDefault()}if(this.stopDefault){a.stopEvent()}},this)}if(this.handler){this.on("click",this.handler,this.scope||this)}Ext.util.ClickRepeater.superclass.constructor.call(this)};Ext.extend(Ext.util.ClickRepeater,Ext.util.Observable,{interval:20,delay:250,preventDefault:true,stopDefault:false,timer:0,destroy:function(){Ext.destroy(this.el);this.purgeListeners()},handleMouseDown:function(){clearTimeout(this.timer);this.el.blur();if(this.pressClass){this.el.addClass(this.pressClass)}this.mousedownTime=new Date();Ext.getDoc().on("mouseup",this.handleMouseUp,this);this.el.on("mouseout",this.handleMouseOut,this);this.fireEvent("mousedown",this);this.fireEvent("click",this);if(this.accelerate){this.delay=400}this.timer=this.click.defer(this.delay||this.interval,this)},click:function(){this.fireEvent("click",this);this.timer=this.click.defer(this.accelerate?this.easeOutExpo(this.mousedownTime.getElapsed(),400,-390,12000):this.interval,this)},easeOutExpo:function(m,b,d,l){return(m==l)?b+d:d*(-Math.pow(2,-10*m/l)+1)+b},handleMouseOut:function(){clearTimeout(this.timer);if(this.pressClass){this.el.removeClass(this.pressClass)}this.el.on("mouseover",this.handleMouseReturn,this)},handleMouseReturn:function(){this.el.un("mouseover",this.handleMouseReturn,this);if(this.pressClass){this.el.addClass(this.pressClass)}this.click()},handleMouseUp:function(){clearTimeout(this.timer);this.el.un("mouseover",this.handleMouseReturn,this);this.el.un("mouseout",this.handleMouseOut,this);Ext.getDoc().un("mouseup",this.handleMouseUp,this);this.el.removeClass(this.pressClass);this.fireEvent("mouseup",this)}});Ext.KeyNav=function(d,e){this.el=Ext.get(d);Ext.apply(this,e);if(!this.disabled){this.disabled=true;this.enable()}};Ext.KeyNav.prototype={disabled:false,defaultEventAction:"stopEvent",forceKeyDown:false,prepareEvent:function(g){var e=g.getKey();var d=this.keyToHandler[e];if(Ext.isSafari2&&d&&e>=37&&e<=40){g.stopEvent()}},relay:function(g){var e=g.getKey();var d=this.keyToHandler[e];if(d&&this[d]){if(this.doRelay(g,this[d],d)!==true){g[this.defaultEventAction]()}}},doRelay:function(g,d,e){return d.call(this.scope||this,g)},enter:false,left:false,right:false,up:false,down:false,tab:false,esc:false,pageUp:false,pageDown:false,del:false,home:false,end:false,keyToHandler:{37:"left",39:"right",38:"up",40:"down",33:"pageUp",34:"pageDown",46:"del",36:"home",35:"end",13:"enter",27:"esc",9:"tab"},enable:function(){if(this.disabled){if(this.forceKeyDown||Ext.isIE||Ext.isSafari3||Ext.isAir){this.el.on("keydown",this.relay,this)}else{this.el.on("keydown",this.prepareEvent,this);this.el.on("keypress",this.relay,this)}this.disabled=false}},disable:function(){if(!this.disabled){if(this.forceKeyDown||Ext.isIE||Ext.isSafari3||Ext.isAir){this.el.un("keydown",this.relay,this)}else{this.el.un("keydown",this.prepareEvent,this);this.el.un("keypress",this.relay,this)}this.disabled=true}}};Ext.KeyMap=function(g,d,e){this.el=Ext.get(g);this.eventName=e||"keydown";this.bindings=[];if(d){this.addBinding(d)}this.enable()};Ext.KeyMap.prototype={stopEvent:false,addBinding:function(E){if(Ext.isArray(E)){for(var C=0,z=E.length;C<z;C++){this.addBinding(E[C])}return}var r=E.key,F=E.shift,H=E.ctrl,B=E.alt,v=E.fn||E.handler,s=E.scope;if(E.stopEvent){this.stopEvent=E.stopEvent}if(typeof r=="string"){var u=[];var w=r.toUpperCase();for(var D=0,z=w.length;D<z;D++){u.push(w.charCodeAt(D))}r=u}var G=Ext.isArray(r);var t=function(a){if((!F||a.shiftKey)&&(!H||a.ctrlKey)&&(!B||a.altKey)){var d=a.getKey();if(G){for(var b=0,e=r.length;b<e;b++){if(r[b]==d){if(this.stopEvent){a.stopEvent()}v.call(s||window,d,a);return}}}else{if(d==r){if(this.stopEvent){a.stopEvent()}v.call(s||window,d,a)}}}};this.bindings.push(t)},on:function(l,r,s){var o,m,q,p;if(typeof l=="object"&&!Ext.isArray(l)){o=l.key;m=l.shift;q=l.ctrl;p=l.alt}else{o=l}this.addBinding({key:o,shift:m,ctrl:q,alt:p,fn:r,scope:s})},handleKeyDown:function(e){if(this.enabled){var l=this.bindings;for(var h=0,b=l.length;h<b;h++){l[h].call(this,e)}}},isEnabled:function(){return this.enabled},enable:function(){if(!this.enabled){this.el.on(this.eventName,this.handleKeyDown,this);this.enabled=true}},disable:function(){if(this.enabled){this.el.removeListener(this.eventName,this.handleKeyDown,this);this.enabled=false}}};Ext.util.TextMetrics=function(){var b;return{measure:function(a,g,e){if(!b){b=Ext.util.TextMetrics.Instance(a,e)}b.bind(a);b.setFixedWidth(e||"auto");return b.getSize(g)},createInstance:function(a,d){return Ext.util.TextMetrics.Instance(a,d)}}}();Ext.util.TextMetrics.Instance=function(e,h){var l=new Ext.Element(document.createElement("div"));document.body.appendChild(l.dom);l.position("absolute");l.setLeftTop(-1000,-1000);l.hide();if(h){l.setWidth(h)}var g={getSize:function(a){l.update(a);var b=l.getSize();l.update("");return b},bind:function(a){l.setStyle(Ext.fly(a).getStyles("font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"))},setFixedWidth:function(a){l.setWidth(a)},getWidth:function(a){l.dom.style.width="auto";return this.getSize(a).width},getHeight:function(a){return this.getSize(a).height}};g.bind(e);return g};Ext.Element.measureText=Ext.util.TextMetrics.measure;(function(){var e=Ext.EventManager;var d=Ext.lib.Dom;Ext.dd.DragDrop=function(a,g,b){if(a){this.init(a,g,b)}};Ext.dd.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true},moveOnly:false,unlock:function(){this.locked=false},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(b,a){},startDrag:function(b,a){},b4Drag:function(a){},onDrag:function(a){},onDragEnter:function(b,a){},b4DragOver:function(a){},onDragOver:function(b,a){},b4DragOut:function(a){},onDragOut:function(b,a){},b4DragDrop:function(a){},onDragDrop:function(b,a){},onInvalidDrop:function(a){},b4EndDrag:function(a){},endDrag:function(a){},b4MouseDown:function(a){},onMouseDown:function(a){},onMouseUp:function(a){},onAvailable:function(){},defaultPadding:{left:0,right:0,top:0,bottom:0},constrainTo:function(t,v,a){if(typeof v=="number"){v={left:v,right:v,top:v,bottom:v}}v=v||this.defaultPadding;var r=Ext.get(this.getEl()).getBox();var B=Ext.get(t);var b=B.getScroll();var s,z=B.dom;if(z==document.body){s={x:b.left,y:b.top,width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()}}else{var q=B.getXY();s={x:q[0]+b.left,y:q[1]+b.top,width:z.clientWidth,height:z.clientHeight}}var u=r.y-s.y;var w=r.x-s.x;this.resetConstraints();this.setXConstraint(w-(v.left||0),s.width-w-r.width-(v.right||0),this.xTickSize);this.setYConstraint(u-(v.top||0),s.height-u-r.height-(v.bottom||0),this.yTickSize)},getEl:function(){if(!this._domRef){this._domRef=Ext.getDom(this.id)}return this._domRef},getDragEl:function(){return Ext.getDom(this.dragElId)},init:function(a,g,b){this.initTarget(a,g,b);e.on(this.id,"mousedown",this.handleMouseDown,this)},initTarget:function(a,g,b){this.config=b||{};this.DDM=Ext.dd.DDM;this.groups={};if(typeof a!=="string"){a=Ext.id(a)}this.id=a;this.addToGroup((g)?g:"default");this.handleElId=a;this.setDragElId(a);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();this.handleOnAvailable()},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false)},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable()},setPadding:function(b,l,a,h){if(!l&&0!==l){this.padding=[b,b,b,b]}else{if(!a&&0!==a){this.padding=[b,l,b,l]}else{this.padding=[b,l,a,h]}}},setInitPosition:function(l,m){var b=this.getEl();if(!this.DDM.verifyEl(b)){return}var o=l||0;var p=m||0;var a=d.getXY(b);this.initPageX=a[0]-o;this.initPageY=a[1]-p;this.lastPageX=a[0];this.lastPageY=a[1];this.setStartPosition(a)},setStartPosition:function(a){var b=a||d.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=b[0];this.startPageY=b[1]},addToGroup:function(a){this.groups[a]=true;this.DDM.regDragDrop(this,a)},removeFromGroup:function(a){if(this.groups[a]){delete this.groups[a]}this.DDM.removeDDFromGroup(this,a)},setDragElId:function(a){this.dragElId=a},setHandleElId:function(a){if(typeof a!=="string"){a=Ext.id(a)}this.handleElId=a;this.DDM.regHandle(this.id,a)},setOuterHandleElId:function(a){if(typeof a!=="string"){a=Ext.id(a)}e.on(a,"mousedown",this.handleMouseDown,this);this.setHandleElId(a);this.hasOuterHandles=true},unreg:function(){e.un(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this)},destroy:function(){this.unreg()},isLocked:function(){return(this.DDM.isLocked()||this.locked)},handleMouseDown:function(a,b){if(this.primaryButtonOnly&&a.button!=0){return}if(this.isLocked()){return}this.DDM.refreshCache(this.groups);var h=new Ext.lib.Point(Ext.lib.Event.getPageX(a),Ext.lib.Event.getPageY(a));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(h,this)){}else{if(this.clickValidator(a)){this.setStartPosition();this.b4MouseDown(a);this.onMouseDown(a);this.DDM.handleMouseDown(a,this);this.DDM.stopEvent(a)}else{}}},clickValidator:function(a){var b=a.getTarget();return(this.isValidHandleChild(b)&&(this.id==this.handleElId||this.DDM.handleWasClicked(b,this.id)))},addInvalidHandleType:function(b){var a=b.toUpperCase();this.invalidHandleTypes[a]=a},addInvalidHandleId:function(a){if(typeof a!=="string"){a=Ext.id(a)}this.invalidHandleIds[a]=a},addInvalidHandleClass:function(a){this.invalidHandleClasses.push(a)},removeInvalidHandleType:function(b){var a=b.toUpperCase();delete this.invalidHandleTypes[a]},removeInvalidHandleId:function(a){if(typeof a!=="string"){a=Ext.id(a)}delete this.invalidHandleIds[a]},removeInvalidHandleClass:function(b){for(var a=0,g=this.invalidHandleClasses.length;a<g;++a){if(this.invalidHandleClasses[a]==b){delete this.invalidHandleClasses[a]}}},isValidHandleChild:function(m){var o=true;var a;try{a=m.nodeName.toUpperCase()}catch(b){a=m.nodeName}o=o&&!this.invalidHandleTypes[a];o=o&&!this.invalidHandleIds[m.id];for(var p=0,q=this.invalidHandleClasses.length;o&&p<q;++p){o=!Ext.fly(m).hasClass(this.invalidHandleClasses[p])}return o},setXTicks:function(a,l){this.xTicks=[];this.xTickSize=l;var b={};for(var h=this.initPageX;h>=this.minX;h=h-l){if(!b[h]){this.xTicks[this.xTicks.length]=h;b[h]=true}}for(h=this.initPageX;h<=this.maxX;h=h+l){if(!b[h]){this.xTicks[this.xTicks.length]=h;b[h]=true}}this.xTicks.sort(this.DDM.numericSort)},setYTicks:function(a,l){this.yTicks=[];this.yTickSize=l;var b={};for(var h=this.initPageY;h>=this.minY;h=h-l){if(!b[h]){this.yTicks[this.yTicks.length]=h;b[h]=true}}for(h=this.initPageY;h<=this.maxY;h=h+l){if(!b[h]){this.yTicks[this.yTicks.length]=h;b[h]=true}}this.yTicks.sort(this.DDM.numericSort)},setXConstraint:function(a,b,g){this.leftConstraint=a;this.rightConstraint=b;this.minX=this.initPageX-a;this.maxX=this.initPageX+b;if(g){this.setXTicks(this.initPageX,g)}this.constrainX=true},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks()},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0},setYConstraint:function(g,a,b){this.topConstraint=g;this.bottomConstraint=a;this.minY=this.initPageY-g;this.maxY=this.initPageY+a;if(b){this.setYTicks(this.initPageY,b)}this.constrainY=true},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var a=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var b=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(a,b)}else{this.setInitPosition()}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize)}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize)}},getTick:function(a,o){if(!o){return a}else{if(o[0]>=a){return o[0]}else{for(var q=0,r=o.length;q<r;++q){var p=q+1;if(o[p]&&o[p]>=a){var b=a-o[q];var m=o[p]-a;return(m>b)?o[q]:o[p]}}return o[o.length-1]}}},toString:function(){return("DragDrop "+this.id)}}})();if(!Ext.dd.DragDropMgr){Ext.dd.DragDropMgr=function(){var b=Ext.EventManager;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,init:function(){this.initialized=true},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(m,o){for(var l in this.ids){for(var a in this.ids[l]){var h=this.ids[l][a];if(!this.isTypeOfDD(h)){continue}h[m].apply(h,o)}}},_onLoad:function(){this.init();b.on(document,"mouseup",this.handleMouseUp,this,true);b.on(document,"mousemove",this.handleMouseMove,this,true);b.on(window,"unload",this._onUnload,this,true);b.on(window,"resize",this._onResize,this,true)},_onResize:function(a){this._execOnAll("resetConstraints",[])},lock:function(){this.locked=true},unlock:function(){this.locked=false},isLocked:function(){return this.locked},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:350,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(d,a){if(!this.initialized){this.init()}if(!this.ids[a]){this.ids[a]={}}this.ids[a][d.id]=d},removeDDFromGroup:function(e,a){if(!this.ids[a]){this.ids[a]={}}var g=this.ids[a];if(g&&g[e.id]){delete g[e.id]}},_remove:function(d){for(var a in d.groups){if(a&&this.ids[a]&&this.ids[a][d.id]){delete this.ids[a][d.id]}}delete this.handleIds[d.id]},regHandle:function(d,a){if(!this.handleIds[d]){this.handleIds[d]={}}this.handleIds[d][a]=a},isDragDrop:function(a){return(this.getDDById(a))?true:false},getRelated:function(h,o){var l=[];for(var m in h.groups){for(j in this.ids[m]){var a=this.ids[m][j];if(!this.isTypeOfDD(a)){continue}if(!o||a.isTarget){l[l.length]=a}}}return l},isLegalTarget:function(h,l){var o=this.getRelated(h,true);for(var m=0,a=o.length;m<a;++m){if(o[m].id==l.id){return true}}return false},isTypeOfDD:function(a){return(a&&a.__ygDragDrop)},isHandle:function(d,a){return(this.handleIds[d]&&this.handleIds[d][a])},getDDById:function(d){for(var a in this.ids){if(this.ids[a][d]){return this.ids[a][d]}}return null},handleMouseDown:function(e,g){if(Ext.QuickTips){Ext.QuickTips.disable()}if(this.dragCurrent){this.handleMouseUp(e)}this.currentTarget=e.getTarget();this.dragCurrent=g;var a=g.getEl();this.startX=e.getPageX();this.startY=e.getPageY();this.deltaX=this.startX-a.offsetLeft;this.deltaY=this.startY-a.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var d=Ext.dd.DDM;d.startDrag(d.startX,d.startY)},this.clickTimeThresh)},startDrag:function(a,d){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(a,d);this.dragCurrent.startDrag(a,d)}this.dragThreshMet=true},handleMouseUp:function(a){if(Ext.QuickTips){Ext.QuickTips.enable()}if(!this.dragCurrent){return}clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(a,true)}else{}this.stopDrag(a);this.stopEvent(a)},stopEvent:function(a){if(this.stopPropagation){a.stopPropagation()}if(this.preventDefault){a.preventDefault()}},stopDrag:function(a){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(a);this.dragCurrent.endDrag(a)}this.dragCurrent.onMouseUp(a)}this.dragCurrent=null;this.dragOvers={}},handleMouseMove:function(e){if(!this.dragCurrent){return true}if(Ext.isIE&&(e.button!==0&&e.button!==1&&e.button!==2)){this.stopEvent(e);return this.handleMouseUp(e)}if(!this.dragThreshMet){var g=Math.abs(this.startX-e.getPageX());var a=Math.abs(this.startY-e.getPageY());if(g>this.clickPixelThresh||a>this.clickPixelThresh){this.startDrag(this.startX,this.startY)}}if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);if(!this.dragCurrent.moveOnly){this.fireEvents(e,false)}}this.stopEvent(e);return true},fireEvents:function(u,t){var a=this.dragCurrent;if(!a||a.isLocked()){return}var H=u.getPoint();var G=[];var D=[];var w=[];var B=[];var E=[];for(var C in this.dragOvers){var F=this.dragOvers[C];if(!this.isTypeOfDD(F)){continue}if(!this.isOverTarget(H,F,this.mode)){D.push(F)}G[C]=true;delete this.dragOvers[C]}for(var e in a.groups){if("string"!=typeof e){continue}for(C in this.ids[e]){var z=this.ids[e][C];if(!this.isTypeOfDD(z)){continue}if(z.isTarget&&!z.isLocked()&&z!=a){if(this.isOverTarget(H,z,this.mode)){if(t){B.push(z)}else{if(!G[z.id]){E.push(z)}else{w.push(z)}this.dragOvers[z.id]=z}}}}}if(this.mode){if(D.length){a.b4DragOut(u,D);a.onDragOut(u,D)}if(E.length){a.onDragEnter(u,E)}if(w.length){a.b4DragOver(u,w);a.onDragOver(u,w)}if(B.length){a.b4DragDrop(u,B);a.onDragDrop(u,B)}}else{var v=0;for(C=0,v=D.length;C<v;++C){a.b4DragOut(u,D[C].id);a.onDragOut(u,D[C].id)}for(C=0,v=E.length;C<v;++C){a.onDragEnter(u,E[C].id)}for(C=0,v=w.length;C<v;++C){a.b4DragOver(u,w[C].id);a.onDragOver(u,w[C].id)}for(C=0,v=B.length;C<v;++C){a.b4DragDrop(u,B[C].id);a.onDragDrop(u,B[C].id)}}if(t&&!B.length){a.onInvalidDrop(u)}},getBestMatch:function(m){var h=null;var o=m.length;if(o==1){h=m[0]}else{for(var l=0;l<o;++l){var a=m[l];if(a.cursorIsOver){h=a;break}else{if(!h||h.overlap.getArea()<a.overlap.getArea()){h=a}}}}return h},refreshCache:function(o){for(var a in o){if("string"!=typeof a){continue}for(var m in this.ids[a]){var l=this.ids[a][m];if(this.isTypeOfDD(l)){var h=this.getLocation(l);if(h){this.locationCache[l.id]=h}else{delete this.locationCache[l.id]}}}}},verifyEl:function(g){if(g){var a;if(Ext.isIE){try{a=g.offsetParent}catch(e){}}else{a=g.offsetParent}if(a){return true}}return false},getLocation:function(u){if(!this.isTypeOfDD(u)){return null}var w=u.getEl(),l,z,B,a,e,D,C,r,v;try{l=Ext.lib.Dom.getXY(w)}catch(t){}if(!l){return null}z=l[0];B=z+w.offsetWidth;a=l[1];e=a+w.offsetHeight;D=a-u.padding[0];C=B+u.padding[1];r=e+u.padding[2];v=z-u.padding[3];return new Ext.lib.Region(D,C,r,v)},isOverTarget:function(a,u,s){var q=this.locationCache[u.id];if(!q||!this.useCache){q=this.getLocation(u);this.locationCache[u.id]=q}if(!q){return false}u.cursorIsOver=q.contains(a);var m=this.dragCurrent;if(!m||!m.getTargetCoord||(!s&&!m.constrainX&&!m.constrainY)){return u.cursorIsOver}u.overlap=null;var p=m.getTargetCoord(a.x,a.y);var t=m.getDragEl();var r=new Ext.lib.Region(p.y,p.x+t.offsetWidth,p.y+t.offsetHeight,p.x);var o=r.intersect(q);if(o){u.overlap=o;return(s)?true:u.cursorIsOver}else{return false}},_onUnload:function(d,a){Ext.dd.DragDropMgr.unregAll()},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null}this._execOnAll("unreg",[]);for(var a in this.elementCache){delete this.elementCache[a]}this.elementCache={};this.ids={}},elementCache:{},getElWrapper:function(d){var a=this.elementCache[d];if(!a||!a.el){a=this.elementCache[d]=new this.ElementWrapper(Ext.getDom(d))}return a},getElement:function(a){return Ext.getDom(a)},getCss:function(d){var a=Ext.getDom(d);return(a)?a.style:null},ElementWrapper:function(a){this.el=a||null;this.id=this.el&&a.id;this.css=this.el&&a.style},getPosX:function(a){return Ext.lib.Dom.getX(a)},getPosY:function(a){return Ext.lib.Dom.getY(a)},swapNode:function(h,a){if(h.swapNode){h.swapNode(a)}else{var g=a.parentNode;var l=a.nextSibling;if(l==h){g.insertBefore(h,a)}else{if(a==h.nextSibling){g.insertBefore(a,h)}else{h.parentNode.replaceChild(a,h);g.insertBefore(h,l)}}}},getScroll:function(){var h,a,g=document.documentElement,l=document.body;if(g&&(g.scrollTop||g.scrollLeft)){h=g.scrollTop;a=g.scrollLeft}else{if(l){h=l.scrollTop;a=l.scrollLeft}else{}}return{top:h,left:a}},getStyle:function(d,a){return Ext.fly(d).getStyle(a)},getScrollTop:function(){return this.getScroll().top},getScrollLeft:function(){return this.getScroll().left},moveToEl:function(a,e){var g=Ext.lib.Dom.getXY(e);Ext.lib.Dom.setXY(a,g)},numericSort:function(a,e){return(a-e)},_timeoutCount:0,_addListeners:function(){var a=Ext.dd.DDM;if(Ext.lib.Event&&document){a._onLoad()}else{if(a._timeoutCount>2000){}else{setTimeout(a._addListeners,10);if(document&&document.body){a._timeoutCount+=1}}}},handleWasClicked:function(a,e){if(this.isHandle(e,a.id)){return true}else{var g=a.parentNode;while(g){if(this.isHandle(e,g.id)){return true}else{g=g.parentNode}}}return false}}}();Ext.dd.DDM=Ext.dd.DragDropMgr;Ext.dd.DDM._addListeners()}Ext.dd.DD=function(g,e,d){if(g){this.init(g,e,d)}};Ext.extend(Ext.dd.DD,Ext.dd.DragDrop,{scroll:true,autoOffset:function(l,e){var g=l-this.startPageX;var h=e-this.startPageY;this.setDelta(g,h)},setDelta:function(d,e){this.deltaX=d;this.deltaY=e},setDragElPos:function(g,d){var e=this.getDragEl();this.alignElWithMouse(e,g,d)},alignElWithMouse:function(t,p,q){var r=this.getTargetCoord(p,q);var l=t.dom?t:Ext.fly(t,"_dd");if(!this.deltaSetXY){var o=[r.x,r.y];l.setXY(o);var s=l.getLeft(true);var m=l.getTop(true);this.deltaSetXY=[s-r.x,m-r.y]}else{l.setLeftTop(r.x+this.deltaSetXY[0],r.y+this.deltaSetXY[1])}this.cachePosition(r.x,r.y);this.autoScroll(r.x,r.y,t.offsetHeight,t.offsetWidth);return r},cachePosition:function(d,e){if(d){this.lastPageX=d;this.lastPageY=e}else{var g=Ext.lib.Dom.getXY(this.getEl());this.lastPageX=g[0];this.lastPageY=g[1]}},autoScroll:function(u,v,C,t){if(this.scroll){var s=Ext.lib.Dom.getViewHeight();var F=Ext.lib.Dom.getViewWidth();var h=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var w=C+v;var r=t+u;var z=(s+h-v-this.deltaY);var B=(F+D-u-this.deltaX);var E=40;var G=(document.all)?80:30;if(w>s&&z<E){window.scrollTo(D,h+G)}if(v<h&&h>0&&v-h<E){window.scrollTo(D,h-G)}if(r>F&&B<E){window.scrollTo(D+G,h)}if(u<D&&D>0&&u-D<E){window.scrollTo(D-G,h)}}},getTargetCoord:function(l,e){var g=l-this.deltaX;var h=e-this.deltaY;if(this.constrainX){if(g<this.minX){g=this.minX}if(g>this.maxX){g=this.maxX}}if(this.constrainY){if(h<this.minY){h=this.minY}if(h>this.maxY){h=this.maxY}}g=this.getTick(g,this.xTicks);h=this.getTick(h,this.yTicks);return{x:g,y:h}},applyConfig:function(){Ext.dd.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false)},b4MouseDown:function(b){this.autoOffset(b.getPageX(),b.getPageY())},b4Drag:function(b){this.setDragElPos(b.getPageX(),b.getPageY())},toString:function(){return("DD "+this.id)}});Ext.dd.DDProxy=function(g,e,d){if(g){this.init(g,e,d);this.initFrame()}};Ext.dd.DDProxy.dragElId="ygddfdiv";Ext.extend(Ext.dd.DDProxy,Ext.dd.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var e=this;var g=document.body;if(!g||!g.firstChild){setTimeout(function(){e.createFrame()},50);return}var h=this.getDragEl();if(!h){h=document.createElement("div");h.id=this.dragElId;var l=h.style;l.position="absolute";l.visibility="hidden";l.cursor="move";l.border="2px solid #aaa";l.zIndex=999;g.insertBefore(h,g.firstChild)}},initFrame:function(){this.createFrame()},applyConfig:function(){Ext.dd.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||Ext.dd.DDProxy.dragElId)},showFrame:function(l,m){var o=this.getEl();var h=this.getDragEl();var g=h.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(g.width,10)/2),Math.round(parseInt(g.height,10)/2))}this.setDragElPos(l,m);Ext.fly(h).show()},_resizeProxy:function(){if(this.resizeFrame){var b=this.getEl();Ext.fly(this.getDragEl()).setSize(b.offsetWidth,b.offsetHeight)}},b4MouseDown:function(d){var e=d.getPageX();var g=d.getPageY();this.autoOffset(e,g);this.setDragElPos(e,g)},b4StartDrag:function(e,d){this.showFrame(e,d)},b4EndDrag:function(b){Ext.fly(this.getDragEl()).hide()},endDrag:function(g){var d=this.getEl();var e=this.getDragEl();e.style.visibility="";this.beforeMove();d.style.visibility="hidden";Ext.dd.DDM.moveToEl(d,e);e.style.visibility="hidden";d.style.visibility="";this.afterDrag()},beforeMove:function(){},afterDrag:function(){},toString:function(){return("DDProxy "+this.id)}});Ext.dd.DDTarget=function(g,e,d){if(g){this.initTarget(g,e,d)}};Ext.extend(Ext.dd.DDTarget,Ext.dd.DragDrop,{toString:function(){return("DDTarget "+this.id)}});Ext.dd.DragTracker=function(b){Ext.apply(this,b);this.addEvents("mousedown","mouseup","mousemove","dragstart","dragend","drag");this.dragRegion=new Ext.lib.Region(0,0,0,0);if(this.el){this.initEl(this.el)}};Ext.extend(Ext.dd.DragTracker,Ext.util.Observable,{active:false,tolerance:5,autoStart:false,initEl:function(b){this.el=Ext.get(b);b.on("mousedown",this.onMouseDown,this,this.delegate?{delegate:this.delegate}:undefined)},destroy:function(){this.el.un("mousedown",this.onMouseDown,this)},onMouseDown:function(g,d){if(this.fireEvent("mousedown",this,g)!==false&&this.onBeforeStart(g)!==false){this.startXY=this.lastXY=g.getXY();this.dragTarget=this.delegate?d:this.el.dom;g.preventDefault();var e=Ext.getDoc();e.on("mouseup",this.onMouseUp,this);e.on("mousemove",this.onMouseMove,this);e.on("selectstart",this.stopSelect,this);if(this.autoStart){this.timer=this.triggerStart.defer(this.autoStart===true?1000:this.autoStart,this)}}},onMouseMove:function(h,l){h.preventDefault();var e=h.getXY(),g=this.startXY;this.lastXY=e;if(!this.active){if(Math.abs(g[0]-e[0])>this.tolerance||Math.abs(g[1]-e[1])>this.tolerance){this.triggerStart()}else{return}}this.fireEvent("mousemove",this,h);this.onDrag(h);this.fireEvent("drag",this,h)},onMouseUp:function(d){var e=Ext.getDoc();e.un("mousemove",this.onMouseMove,this);e.un("mouseup",this.onMouseUp,this);e.un("selectstart",this.stopSelect,this);d.preventDefault();this.clearStart();this.active=false;delete this.elRegion;this.fireEvent("mouseup",this,d);this.onEnd(d);this.fireEvent("dragend",this,d)},triggerStart:function(b){this.clearStart();this.active=true;this.onStart(this.startXY);this.fireEvent("dragstart",this,this.startXY)},clearStart:function(){if(this.timer){clearTimeout(this.timer);delete this.timer}},stopSelect:function(b){b.stopEvent();return false},onBeforeStart:function(b){},onStart:function(b){},onDrag:function(b){},onEnd:function(b){},getDragTarget:function(){return this.dragTarget},getDragCt:function(){return this.el},getXY:function(b){return b?this.constrainModes[b].call(this,this.lastXY):this.lastXY},getOffset:function(g){var d=this.getXY(g);var e=this.startXY;return[e[0]-d[0],e[1]-d[1]]},constrainModes:{point:function(d){if(!this.elRegion){this.elRegion=this.getDragCt().getRegion()}var e=this.dragRegion;e.left=d[0];e.top=d[1];e.right=d[0];e.bottom=d[1];e.constrainTo(this.elRegion);return[e.left,e.top]}}});Ext.dd.ScrollManager=function(){var u=Ext.dd.DragDropMgr;var s={};var v=null;var p={};var q=function(a){v=null;w()};var o=function(){if(u.dragCurrent){u.refreshCache(u.dragCurrent.groups)}};var t=function(){if(u.dragCurrent){var a=Ext.dd.ScrollManager;var b=p.el.ddScrollConfig?p.el.ddScrollConfig.increment:a.increment;if(!a.animate){if(p.el.scroll(p.dir,b)){o()}}else{p.el.scroll(p.dir,b,true,a.animDuration,o)}}};var w=function(){if(p.id){clearInterval(p.id)}p.id=0;p.el=null;p.dir=""};var r=function(d,a){w();p.el=d;p.dir=a;var b=(d.ddScrollConfig&&d.ddScrollConfig.frequency)?d.ddScrollConfig.frequency:Ext.dd.ScrollManager.frequency;p.id=setInterval(t,b)};var m=function(b,B){if(B||!u.dragCurrent){return}var z=Ext.dd.ScrollManager;if(!v||v!=u.dragCurrent){v=u.dragCurrent;z.refreshCache()}var l=Ext.lib.Event.getXY(b);var h=new Ext.lib.Point(l[0],l[1]);for(var e in s){var d=s[e],g=d._region;var a=d.ddScrollConfig?d.ddScrollConfig:z;if(g&&g.contains(h)&&d.isScrollable()){if(g.bottom-h.y<=a.vthresh){if(p.el!=d){r(d,"down")}return}else{if(g.right-h.x<=a.hthresh){if(p.el!=d){r(d,"left")}return}else{if(h.y-g.top<=a.vthresh){if(p.el!=d){r(d,"up")}return}else{if(h.x-g.left<=a.hthresh){if(p.el!=d){r(d,"right")}return}}}}}}w()};u.fireEvents=u.fireEvents.createSequence(m,u);u.stopDrag=u.stopDrag.createSequence(q,u);return{register:function(b){if(Ext.isArray(b)){for(var d=0,a=b.length;d<a;d++){this.register(b[d])}}else{b=Ext.get(b);s[b.id]=b}},unregister:function(b){if(Ext.isArray(b)){for(var d=0,a=b.length;d<a;d++){this.unregister(b[d])}}else{b=Ext.get(b);delete s[b.id]}},vthresh:25,hthresh:25,increment:100,frequency:500,animate:true,animDuration:0.4,refreshCache:function(){for(var a in s){if(typeof s[a]=="object"){s[a]._region=s[a].getRegion()}}}}}();Ext.dd.Registry=function(){var h={};var e={};var g=0;var l=function(b,d){if(typeof b=="string"){return b}var a=b.id;if(!a&&d!==false){a="extdd-"+(++g);b.id=a}return a};return{register:function(b,a){a=a||{};if(typeof b=="string"){b=document.getElementById(b)}a.ddel=b;h[l(b)]=a;if(a.isHandle!==false){e[a.ddel.id]=a}if(a.handles){var d=a.handles;for(var m=0,o=d.length;m<o;m++){e[l(d[m])]=a}}},unregister:function(d){var a=l(d,false);var b=h[a];if(b){delete h[a];if(b.handles){var o=b.handles;for(var p=0,q=o.length;p<q;p++){delete e[l(o[p],false)]}}}},getHandle:function(a){if(typeof a!="string"){a=a.id}return e[a]},getHandleFromEvent:function(a){var b=Ext.lib.Event.getTarget(a);return b?e[b.id]:null},getTarget:function(a){if(typeof a!="string"){a=a.id}return h[a]},getTargetFromEvent:function(a){var b=Ext.lib.Event.getTarget(a);return b?h[b.id]||e[b.id]:null}}}();Ext.dd.StatusProxy=function(b){Ext.apply(this,b);this.id=this.id||Ext.id();this.el=new Ext.Layer({dh:{id:this.id,tag:"div",cls:"x-dd-drag-proxy "+this.dropNotAllowed,children:[{tag:"div",cls:"x-dd-drop-icon"},{tag:"div",cls:"x-dd-drag-ghost"}]},shadow:!b||b.shadow!==false});this.ghost=Ext.get(this.el.dom.childNodes[1]);this.dropStatus=this.dropNotAllowed};Ext.dd.StatusProxy.prototype={dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",setStatus:function(b){b=b||this.dropNotAllowed;if(this.dropStatus!=b){this.el.replaceClass(this.dropStatus,b);this.dropStatus=b}},reset:function(b){this.el.dom.className="x-dd-drag-proxy "+this.dropNotAllowed;this.dropStatus=this.dropNotAllowed;if(b){this.ghost.update("")}},update:function(e){if(typeof e=="string"){this.ghost.update(e)}else{this.ghost.update("");e.style.margin="0";this.ghost.dom.appendChild(e)}var d=this.ghost.dom.firstChild;if(d){Ext.fly(d).setStyle(Ext.isIE?"styleFloat":"cssFloat","none")}},getEl:function(){return this.el},getGhost:function(){return this.ghost},hide:function(b){this.el.hide();if(b){this.reset(true)}},stop:function(){if(this.anim&&this.anim.isAnimated&&this.anim.isAnimated()){this.anim.stop()}},show:function(){this.el.show()},sync:function(){this.el.sync()},repair:function(d,g,e){this.callback=g;this.scope=e;if(d&&this.animRepair!==false){this.el.addClass("x-dd-drag-repair");this.el.hideUnders(true);this.anim=this.el.shift({duration:this.repairDuration||0.5,easing:"easeOut",xy:d,stopFx:true,callback:this.afterRepair,scope:this})}else{this.afterRepair()}},afterRepair:function(){this.hide(true);if(typeof this.callback=="function"){this.callback.call(this.scope||this)}this.callback=null;this.scope=null}};Ext.dd.DragSource=function(d,e){this.el=Ext.get(d);if(!this.dragData){this.dragData={}}Ext.apply(this,e);if(!this.proxy){this.proxy=new Ext.dd.StatusProxy()}Ext.dd.DragSource.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{dragElId:this.proxy.id,resizeFrame:false,isTarget:false,scroll:this.scroll===true});this.dragging=false};Ext.extend(Ext.dd.DragSource,Ext.dd.DDProxy,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",getDragData:function(b){return this.dragData},onDragEnter:function(l,h){var e=Ext.dd.DragDropMgr.getDDById(h);this.cachedTarget=e;if(this.beforeDragEnter(e,l,h)!==false){if(e.isNotifyTarget){var g=e.notifyEnter(this,l,this.dragData);this.proxy.setStatus(g)}else{this.proxy.setStatus(this.dropAllowed)}if(this.afterDragEnter){this.afterDragEnter(e,l,h)}}},beforeDragEnter:function(d,e,g){return true},alignElWithMouse:function(){Ext.dd.DragSource.superclass.alignElWithMouse.apply(this,arguments);this.proxy.sync()},onDragOver:function(l,h){var e=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(h);if(this.beforeDragOver(e,l,h)!==false){if(e.isNotifyTarget){var g=e.notifyOver(this,l,this.dragData);this.proxy.setStatus(g)}if(this.afterDragOver){this.afterDragOver(e,l,h)}}},beforeDragOver:function(d,e,g){return true},onDragOut:function(d,g){var e=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(g);if(this.beforeDragOut(e,d,g)!==false){if(e.isNotifyTarget){e.notifyOut(this,d,this.dragData)}this.proxy.reset();if(this.afterDragOut){this.afterDragOut(e,d,g)}}this.cachedTarget=null},beforeDragOut:function(d,e,g){return true},onDragDrop:function(d,g){var e=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(g);if(this.beforeDragDrop(e,d,g)!==false){if(e.isNotifyTarget){if(e.notifyDrop(this,d,this.dragData)){this.onValidDrop(e,d,g)}else{this.onInvalidDrop(e,d,g)}}else{this.onValidDrop(e,d,g)}if(this.afterDragDrop){this.afterDragDrop(e,d,g)}}delete this.cachedTarget},beforeDragDrop:function(d,e,g){return true},onValidDrop:function(d,e,g){this.hideProxy();if(this.afterValidDrop){this.afterValidDrop(d,e,g)}},getRepairXY:function(d,e){return this.el.getXY()},onInvalidDrop:function(d,e,g){this.beforeInvalidDrop(d,e,g);if(this.cachedTarget){if(this.cachedTarget.isNotifyTarget){this.cachedTarget.notifyOut(this,e,this.dragData)}this.cacheTarget=null}this.proxy.repair(this.getRepairXY(e,this.dragData),this.afterRepair,this);if(this.afterInvalidDrop){this.afterInvalidDrop(e,g)}},afterRepair:function(){if(Ext.enableFx){this.el.highlight(this.hlColor||"c3daf9")}this.dragging=false},beforeInvalidDrop:function(d,e,g){return true},handleMouseDown:function(d){if(this.dragging){return}var e=this.getDragData(d);if(e&&this.onBeforeDrag(e,d)!==false){this.dragData=e;this.proxy.stop();Ext.dd.DragSource.superclass.handleMouseDown.apply(this,arguments)}},onBeforeDrag:function(e,d){return true},onStartDrag:Ext.emptyFn,startDrag:function(e,d){this.proxy.reset();this.dragging=true;this.proxy.update("");this.onInitDrag(e,d);this.proxy.show()},onInitDrag:function(e,g){var d=this.el.dom.cloneNode(true);d.id=Ext.id();this.proxy.update(d);this.onStartDrag(e,g);return true},getProxy:function(){return this.proxy},hideProxy:function(){this.proxy.hide();this.proxy.reset(true);this.dragging=false},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)},b4EndDrag:function(b){},endDrag:function(b){this.onEndDrag(this.dragData,b)},onEndDrag:function(e,d){},autoOffset:function(e,d){this.setDelta(-12,-20)}});Ext.dd.DropTarget=function(d,e){this.el=Ext.get(d);Ext.apply(this,e);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el)}Ext.dd.DropTarget.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{isTarget:true})};Ext.extend(Ext.dd.DropTarget,Ext.dd.DDTarget,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",isTarget:true,isNotifyTarget:true,notifyEnter:function(e,g,d){if(this.overClass){this.el.addClass(this.overClass)}return this.dropAllowed},notifyOver:function(e,g,d){return this.dropAllowed},notifyOut:function(e,g,d){if(this.overClass){this.el.removeClass(this.overClass)}},notifyDrop:function(e,g,d){return false}});Ext.dd.DragZone=function(d,e){Ext.dd.DragZone.superclass.constructor.call(this,d,e);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el)}};Ext.extend(Ext.dd.DragZone,Ext.dd.DragSource,{getDragData:function(b){return Ext.dd.Registry.getHandleFromEvent(b)},onInitDrag:function(e,d){this.proxy.update(this.dragData.ddel.cloneNode(true));this.onStartDrag(e,d);return true},afterRepair:function(){if(Ext.enableFx){Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9")}this.dragging=false},getRepairXY:function(b){return Ext.Element.fly(this.dragData.ddel).getXY()}});Ext.dd.DropZone=function(d,e){Ext.dd.DropZone.superclass.constructor.call(this,d,e)};Ext.extend(Ext.dd.DropZone,Ext.dd.DropTarget,{getTargetFromEvent:function(b){return Ext.dd.Registry.getTargetFromEvent(b)},onNodeEnter:function(h,g,l,e){},onNodeOver:function(h,g,l,e){return this.dropAllowed},onNodeOut:function(h,g,l,e){},onNodeDrop:function(h,g,l,e){return false},onContainerOver:function(e,g,d){return this.dropNotAllowed},onContainerDrop:function(e,g,d){return false},notifyEnter:function(e,g,d){return this.dropNotAllowed},notifyOver:function(g,l,e){var h=this.getTargetFromEvent(l);if(!h){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,g,l,e);this.lastOverNode=null}return this.onContainerOver(g,l,e)}if(this.lastOverNode!=h){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,g,l,e)}this.onNodeEnter(h,g,l,e);this.lastOverNode=h}return this.onNodeOver(h,g,l,e)},notifyOut:function(e,g,d){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,e,g,d);this.lastOverNode=null}},notifyDrop:function(g,l,e){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,g,l,e);this.lastOverNode=null}var h=this.getTargetFromEvent(l);return h?this.onNodeDrop(h,g,l,e):this.onContainerDrop(g,l,e)},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)}});Ext.data.SortTypes={none:function(b){return b},stripTagsRE:/<\/?[^>]+>/gi,asText:function(b){return String(b).replace(this.stripTagsRE,"")},asUCText:function(b){return String(b).toUpperCase().replace(this.stripTagsRE,"")},asUCString:function(b){return String(b).toUpperCase()},asDate:function(b){if(!b){return 0}if(Ext.isDate(b)){return b.getTime()}return Date.parse(String(b))},asFloat:function(e){var d=parseFloat(String(e).replace(/,/g,""));if(isNaN(d)){d=0}return d},asInt:function(e){var d=parseInt(String(e).replace(/,/g,""));if(isNaN(d)){d=0}return d}};Ext.data.Record=function(e,d){this.id=(d||d===0)?d:++Ext.data.Record.AUTO_ID;this.data=e};Ext.data.Record.create=function(l){var o=Ext.extend(Ext.data.Record,{});var m=o.prototype;m.fields=new Ext.util.MixedCollection(false,function(a){return a.name});for(var g=0,h=l.length;g<h;g++){m.fields.add(new Ext.data.Field(l[g]))}o.getField=function(a){return m.fields.get(a)};return o};Ext.data.Record.AUTO_ID=1000;Ext.data.Record.EDIT="edit";Ext.data.Record.REJECT="reject";Ext.data.Record.COMMIT="commit";Ext.data.Record.prototype={dirty:false,editing:false,error:null,modified:null,join:function(b){this.store=b},set:function(e,d){if(String(this.data[e])==String(d)){return}this.dirty=true;if(!this.modified){this.modified={}}if(typeof this.modified[e]=="undefined"){this.modified[e]=this.data[e]}this.data[e]=d;if(!this.editing&&this.store){this.store.afterEdit(this)}},get:function(b){return this.data[b]},beginEdit:function(){this.editing=true;this.modified={}},cancelEdit:function(){this.editing=false;delete this.modified},endEdit:function(){this.editing=false;if(this.dirty&&this.store){this.store.afterEdit(this)}},reject:function(d){var e=this.modified;for(var g in e){if(typeof e[g]!="function"){this.data[g]=e[g]}}this.dirty=false;delete this.modified;this.editing=false;if(this.store&&d!==true){this.store.afterReject(this)}},commit:function(b){this.dirty=false;delete this.modified;this.editing=false;if(this.store&&b!==true){this.store.afterCommit(this)}},getChanges:function(){var e=this.modified,d={};for(var g in e){if(e.hasOwnProperty(g)){d[g]=this.data[g]}}return d},hasError:function(){return this.error!=null},clearError:function(){this.error=null},copy:function(b){return new this.constructor(Ext.apply({},this.data),b||this.id)},isModified:function(b){return !!(this.modified&&this.modified.hasOwnProperty(b))}};Ext.StoreMgr=Ext.apply(new Ext.util.MixedCollection(),{register:function(){for(var e=0,d;d=arguments[e];e++){this.add(d)}},unregister:function(){for(var e=0,d;d=arguments[e];e++){this.remove(this.lookup(d))}},lookup:function(b){return typeof b=="object"?b:this.get(b)},getKey:function(b){return b.storeId||b.id}});Ext.data.Store=function(b){this.data=new Ext.util.MixedCollection(false);this.data.getKey=function(a){return a.id};this.baseParams={};this.paramNames={start:"start",limit:"limit",sort:"sort",dir:"dir"};if(b&&b.data){this.inlineData=b.data;delete b.data}Ext.apply(this,b);if(this.url&&!this.proxy){this.proxy=new Ext.data.HttpProxy({url:this.url})}if(this.reader){if(!this.recordType){this.recordType=this.reader.recordType}if(this.reader.onMetaChange){this.reader.onMetaChange=this.onMetaChange.createDelegate(this)}}if(this.recordType){this.fields=this.recordType.prototype.fields}this.modified=[];this.addEvents("datachanged","metachange","add","remove","update","clear","beforeload","load","loadexception");if(this.proxy){this.relayEvents(this.proxy,["loadexception"])}this.sortToggle={};if(this.sortInfo){this.setDefaultSort(this.sortInfo.field,this.sortInfo.direction)}Ext.data.Store.superclass.constructor.call(this);if(this.storeId||this.id){Ext.StoreMgr.register(this)}if(this.inlineData){this.loadData(this.inlineData);delete this.inlineData}else{if(this.autoLoad){this.load.defer(10,this,[typeof this.autoLoad=="object"?this.autoLoad:undefined])}}};Ext.extend(Ext.data.Store,Ext.util.Observable,{remoteSort:false,pruneModifiedRecords:false,lastOptions:null,destroy:function(){if(this.storeId||this.id){Ext.StoreMgr.unregister(this)}this.data=null;this.purgeListeners()},add:function(e){e=[].concat(e);if(e.length<1){return}for(var h=0,g=e.length;h<g;h++){e[h].join(this)}var l=this.data.length;this.data.addAll(e);if(this.snapshot){this.snapshot.addAll(e)}this.fireEvent("add",this,e,l)},addSorted:function(e){var d=this.findInsertIndex(e);this.insert(d,e)},remove:function(e){var d=this.data.indexOf(e);this.data.removeAt(d);if(this.pruneModifiedRecords){this.modified.remove(e)}if(this.snapshot){this.snapshot.remove(e)}this.fireEvent("remove",this,e,d)},removeAt:function(b){this.remove(this.getAt(b))},removeAll:function(){this.data.clear();if(this.snapshot){this.snapshot.clear()}if(this.pruneModifiedRecords){this.modified=[]}this.fireEvent("clear",this)},insert:function(l,e){e=[].concat(e);for(var h=0,g=e.length;h<g;h++){this.data.insert(l,e[h]);e[h].join(this)}this.fireEvent("add",this,e,l)},indexOf:function(b){return this.data.indexOf(b)},indexOfId:function(b){return this.data.indexOfKey(b)},getById:function(b){return this.data.key(b)},getAt:function(b){return this.data.itemAt(b)},getRange:function(d,e){return this.data.getRange(d,e)},storeOptions:function(b){b=Ext.apply({},b);delete b.callback;delete b.scope;this.lastOptions=b},load:function(d){d=d||{};if(this.fireEvent("beforeload",this,d)!==false){this.storeOptions(d);var g=Ext.apply(d.params||{},this.baseParams);if(this.sortInfo&&this.remoteSort){var e=this.paramNames;g[e.sort]=this.sortInfo.field;g[e.dir]=this.sortInfo.direction}this.proxy.load(g,this.reader,this.loadRecords,this,d);return true}else{return false}},reload:function(b){this.load(Ext.applyIf(b||{},this.lastOptions))},loadRecords:function(o,l,p){if(!o||p===false){if(p!==false){this.fireEvent("load",this,[],l)}if(l.callback){l.callback.call(l.scope||this,[],l,false)}return}var q=o.records,r=o.totalRecords||q.length;if(!l||l.add!==true){if(this.pruneModifiedRecords){this.modified=[]}for(var s=0,m=q.length;s<m;s++){q[s].join(this)}if(this.snapshot){this.data=this.snapshot;delete this.snapshot}this.data.clear();this.data.addAll(q);this.totalLength=r;this.applySort();this.fireEvent("datachanged",this)}else{this.totalLength=Math.max(r,this.data.length+q.length);this.add(q)}this.fireEvent("load",this,q,l);if(l.callback){l.callback.call(l.scope||this,q,l,true)}},loadData:function(g,e){var d=this.reader.readRecords(g);this.loadRecords(d,{add:e},true)},getCount:function(){return this.data.length||0},getTotalCount:function(){return this.totalLength||0},getSortState:function(){return this.sortInfo},applySort:function(){if(this.sortInfo&&!this.remoteSort){var e=this.sortInfo,d=e.field;this.sortData(d,e.direction)}},sortData:function(l,h){h=h||"ASC";var g=this.fields.get(l).sortType;var e=function(d,m){var a=g(d.data[l]),b=g(m.data[l]);return a>b?1:(a<b?-1:0)};this.data.sort(h,e);if(this.snapshot&&this.snapshot!=this.data){this.snapshot.sort(h,e)}},setDefaultSort:function(d,e){e=e?e.toUpperCase():"ASC";this.sortInfo={field:d,direction:e};this.sortToggle[d]=e},sort:function(l,o){var m=this.fields.get(l);if(!m){return false}if(!o){if(this.sortInfo&&this.sortInfo.field==m.name){o=(this.sortToggle[m.name]||"ASC").toggle("ASC","DESC")}else{o=m.sortDir}}var g=(this.sortToggle)?this.sortToggle[m.name]:null;var h=(this.sortInfo)?this.sortInfo:null;this.sortToggle[m.name]=o;this.sortInfo={field:m.name,direction:o};if(!this.remoteSort){this.applySort();this.fireEvent("datachanged",this)}else{if(!this.load(this.lastOptions)){if(g){this.sortToggle[m.name]=g}if(h){this.sortInfo=h}}}},each:function(d,e){this.data.each(d,e)},getModifiedRecords:function(){return this.modified},createFilterFn:function(l,e,h,g){if(Ext.isEmpty(e,false)){return false}e=this.data.createValueMatcher(e,h,g);return function(a){return e.test(a.data[l])}},sum:function(o,m,l){var q=this.data.items,h=0;m=m||0;l=(l||l===0)?l:q.length-1;for(var p=m;p<=l;p++){h+=(q[p].data[o]||0)}return h},filter:function(m,o,l,h){var g=this.createFilterFn(m,o,l,h);return g?this.filterBy(g):this.clearFilter()},filterBy:function(d,e){this.snapshot=this.snapshot||this.data;this.data=this.queryBy(d,e||this);this.fireEvent("datachanged",this)},query:function(m,o,l,h){var g=this.createFilterFn(m,o,l,h);return g?this.queryBy(g):this.data.clone()},queryBy:function(d,e){var g=this.snapshot||this.data;return g.filterBy(d,e||this)},find:function(p,q,m,o,l){var h=this.createFilterFn(p,q,o,l);return h?this.data.findIndexBy(h,null,m):-1},findBy:function(d,e,g){return this.data.findIndexBy(d,e,g)},collect:function(q,p,v){var r=(v===true&&this.snapshot)?this.snapshot.items:this.data.items;var l,d,w=[],u={};for(var t=0,s=r.length;t<s;t++){l=r[t].data[q];d=String(l);if((p||!Ext.isEmpty(l))&&!u[d]){u[d]=true;w[w.length]=l}}return w},clearFilter:function(b){if(this.isFiltered()){this.data=this.snapshot;delete this.snapshot;if(b!==true){this.fireEvent("datachanged",this)}}},isFiltered:function(){return this.snapshot&&this.snapshot!=this.data},afterEdit:function(b){if(this.modified.indexOf(b)==-1){this.modified.push(b)}this.fireEvent("update",this,b,Ext.data.Record.EDIT)},afterReject:function(b){this.modified.remove(b);this.fireEvent("update",this,b,Ext.data.Record.REJECT)},afterCommit:function(b){this.modified.remove(b);this.fireEvent("update",this,b,Ext.data.Record.COMMIT)},commitChanges:function(){var d=this.modified.slice(0);this.modified=[];for(var g=0,e=d.length;g<e;g++){d[g].commit()}},rejectChanges:function(){var d=this.modified.slice(0);this.modified=[];for(var g=0,e=d.length;g<e;g++){d[g].reject()}},onMetaChange:function(d,e,g){this.recordType=e;this.fields=e.prototype.fields;delete this.snapshot;this.sortInfo=d.sortInfo;this.modified=[];this.fireEvent("metachange",this,this.reader.meta)},findInsertIndex:function(e){this.suspendEvents();var g=this.data.clone();this.data.add(e);this.applySort();var d=this.data.indexOf(e);this.data=g;this.resumeEvents();return d}});Ext.data.SimpleStore=function(b){Ext.data.SimpleStore.superclass.constructor.call(this,Ext.apply(b,{reader:new Ext.data.ArrayReader({id:b.id},Ext.data.Record.create(b.fields))}))};Ext.extend(Ext.data.SimpleStore,Ext.data.Store,{loadData:function(l,g){if(this.expandData===true){var m=[];for(var o=0,h=l.length;o<h;o++){m[m.length]=[l[o]]}l=m}Ext.data.SimpleStore.superclass.loadData.call(this,l,g)}});Ext.data.JsonStore=function(b){Ext.data.JsonStore.superclass.constructor.call(this,Ext.apply(b,{proxy:b.proxy||(!b.data?new Ext.data.HttpProxy({url:b.url}):undefined),reader:new Ext.data.JsonReader(b,b.fields)}))};Ext.extend(Ext.data.JsonStore,Ext.data.Store);Ext.data.Field=function(m){if(typeof m=="string"){m={name:m}}Ext.apply(this,m);if(!this.type){this.type="auto"}var o=Ext.data.SortTypes;if(typeof this.sortType=="string"){this.sortType=o[this.sortType]}if(!this.sortType){switch(this.type){case"string":this.sortType=o.asUCString;break;case"date":this.sortType=o.asDate;break;default:this.sortType=o.none}}var l=/[\$,%]/g;if(!this.convert){var g,h=this.dateFormat;switch(this.type){case"":case"auto":case undefined:g=function(a){return a};break;case"string":g=function(a){return(a===undefined||a===null)?"":String(a)};break;case"int":g=function(a){return a!==undefined&&a!==null&&a!==""?parseInt(String(a).replace(l,""),10):""};break;case"float":g=function(a){return a!==undefined&&a!==null&&a!==""?parseFloat(String(a).replace(l,""),10):""};break;case"bool":case"boolean":g=function(a){return a===true||a==="true"||a==1};break;case"date":g=function(a){if(!a){return""}if(Ext.isDate(a)){return a}if(h){if(h=="timestamp"){return new Date(a*1000)}if(h=="time"){return new Date(parseInt(a,10))}return Date.parseDate(a,h)}var b=Date.parse(a);return b?new Date(b):null};break}this.convert=g}};Ext.data.Field.prototype={dateFormat:null,defaultValue:"",mapping:null,sortType:null,sortDir:"ASC"};Ext.data.DataReader=function(e,d){this.meta=e;this.recordType=Ext.isArray(d)?Ext.data.Record.create(d):d};Ext.data.DataReader.prototype={};Ext.data.DataProxy=function(){this.addEvents("beforeload","load");Ext.data.DataProxy.superclass.constructor.call(this)};Ext.extend(Ext.data.DataProxy,Ext.util.Observable);Ext.data.MemoryProxy=function(b){Ext.data.MemoryProxy.superclass.constructor.call(this);this.data=b};Ext.extend(Ext.data.MemoryProxy,Ext.data.DataProxy,{load:function(o,r,m,q,e){o=o||{};var l;try{l=r.readRecords(this.data)}catch(p){this.fireEvent("loadexception",this,e,null,p);m.call(q,null,e,false);return}m.call(q,l,e,true)},update:function(d,e){}});Ext.data.HttpProxy=function(b){Ext.data.HttpProxy.superclass.constructor.call(this);this.conn=b;this.useAjax=!b||!b.events};Ext.extend(Ext.data.HttpProxy,Ext.data.DataProxy,{getConnection:function(){return this.useAjax?Ext.Ajax:this.conn},load:function(o,h,m,q,l){if(this.fireEvent("beforeload",this,o)!==false){var p={params:o||{},request:{callback:m,scope:q,arg:l},reader:h,callback:this.loadResponse,scope:this};if(this.useAjax){Ext.applyIf(p,this.conn);if(this.activeRequest){Ext.Ajax.abort(this.activeRequest)}this.activeRequest=Ext.Ajax.request(p)}else{this.conn.request(p)}}else{m.call(q||this,null,l,false)}},loadResponse:function(l,m,e){delete this.activeRequest;if(!m){this.fireEvent("loadexception",this,l,e);l.request.callback.call(l.request.scope,null,l.request.arg,false);return}var h;try{h=l.reader.read(e)}catch(o){this.fireEvent("loadexception",this,l,e,o);l.request.callback.call(l.request.scope,null,l.request.arg,false);return}this.fireEvent("load",this,l,l.request.arg);l.request.callback.call(l.request.scope,h,l.request.arg,true)},update:function(b){},updateResponse:function(b){}});Ext.data.ScriptTagProxy=function(b){Ext.data.ScriptTagProxy.superclass.constructor.call(this);Ext.apply(this,b);this.head=document.getElementsByTagName("head")[0]};Ext.data.ScriptTagProxy.TRANS_ID=1000;Ext.extend(Ext.data.ScriptTagProxy,Ext.data.DataProxy,{timeout:30000,callbackParam:"callback",nocache:true,load:function(u,t,r,q,p){if(this.fireEvent("beforeload",this,u)!==false){var w=Ext.urlEncode(Ext.apply(u,this.extraParams));var z=this.url;z+=(z.indexOf("?")!=-1?"&":"?")+w;if(this.nocache){z+="&_dc="+(new Date().getTime())}var B=++Ext.data.ScriptTagProxy.TRANS_ID;var o={id:B,cb:"stcCallback"+B,scriptId:"stcScript"+B,params:u,arg:p,url:z,callback:r,scope:q,reader:t};var v=this;window[o.cb]=function(a){v.handleResponse(a,o)};z+=String.format("&{0}={1}",this.callbackParam,o.cb);if(this.autoAbort!==false){this.abort()}o.timeoutId=this.handleFailure.defer(this.timeout,this,[o]);var s=document.createElement("script");s.setAttribute("src",z);s.setAttribute("type","text/javascript");s.setAttribute("id",o.scriptId);this.head.appendChild(s);this.trans=o}else{r.call(q||this,null,p,false)}},isLoading:function(){return this.trans?true:false},abort:function(){if(this.isLoading()){this.destroyTrans(this.trans)}},destroyTrans:function(d,e){this.head.removeChild(document.getElementById(d.scriptId));clearTimeout(d.timeoutId);if(e){window[d.cb]=undefined;try{delete window[d.cb]}catch(g){}}else{window[d.cb]=function(){window[d.cb]=undefined;try{delete window[d.cb]}catch(a){}}}},handleResponse:function(h,e){this.trans=false;this.destroyTrans(e,true);var g;try{g=e.reader.readRecords(h)}catch(l){this.fireEvent("loadexception",this,h,e.arg,l);e.callback.call(e.scope||window,null,e.arg,false);return}this.fireEvent("load",this,h,e.arg);e.callback.call(e.scope||window,g,e.arg,true)},handleFailure:function(b){this.trans=false;this.destroyTrans(b,false);this.fireEvent("loadexception",this,null,b.arg);b.callback.call(b.scope||window,null,b.arg,false)}});Ext.data.JsonReader=function(e,d){e=e||{};Ext.data.JsonReader.superclass.constructor.call(this,e,d||e.fields)};Ext.extend(Ext.data.JsonReader,Ext.data.DataReader,{read:function(response){var json=response.responseText;var o=eval("("+json+")");if(!o){throw {message:"JsonReader.read: Json object not found"}}return this.readRecords(o)},onMetaChange:function(e,g,d){},simpleAccess:function(d,e){return d[e]},getJsonAccessor:function(){var b=/[\[\.]/;return function(d){try{return(b.test(d))?new Function("obj","return obj."+d):function(e){return e[d]}}catch(a){}return Ext.emptyFn}}(),readRecords:function(G){this.jsonData=G;if(G.metaData){delete this.ef;this.meta=G.metaData;this.recordType=Ext.data.Record.create(G.metaData.fields);this.onMetaChange(this.meta,this.recordType,G)}var L=this.meta,T=this.recordType,J=T.prototype.fields,N=J.items,O=J.length;if(!this.ef){if(L.totalProperty){this.getTotal=this.getJsonAccessor(L.totalProperty)}if(L.successProperty){this.getSuccess=this.getJsonAccessor(L.successProperty)}this.getRoot=L.root?this.getJsonAccessor(L.root):function(a){return a};if(L.id){var g=this.getJsonAccessor(L.id);this.getId=function(a){var b=g(a);return(b===undefined||b==="")?null:b}}else{this.getId=function(){return null}}this.ef=[];for(var s=0;s<O;s++){J=N[s];var F=(J.mapping!==undefined&&J.mapping!==null)?J.mapping:J.name;this.ef[s]=this.getJsonAccessor(F)}}var D=this.getRoot(G),I=D.length,K=I,P=true;if(L.totalProperty){var M=parseInt(this.getTotal(G),10);if(!isNaN(M)){K=M}}if(L.successProperty){var M=this.getSuccess(G);if(M===false||M==="false"){P=false}}var o=[];for(var s=0;s<I;s++){var E=D[s];var S={};var H=this.getId(E);for(var v=0;v<O;v++){J=N[v];var M=this.ef[v](E);S[J.name]=J.convert((M!==undefined)?M:J.defaultValue,E)}var Q=new T(S,H);Q.json=E;o[s]=Q}return{success:P,records:o,totalRecords:K}}});Ext.data.XmlReader=function(e,d){e=e||{};Ext.data.XmlReader.superclass.constructor.call(this,e,d||e.fields)};Ext.extend(Ext.data.XmlReader,Ext.data.DataReader,{read:function(e){var d=e.responseXML;if(!d){throw {message:"XmlReader.read: XML Document not available"}}return this.readRecords(d)},readRecords:function(q){this.xmlData=q;var F=q.documentElement||q;var L=Ext.DomQuery;var T=this.recordType,I=T.prototype.fields;var Q=this.meta.id;var N=0,P=true;if(this.meta.totalRecords){N=L.selectNumber(this.meta.totalRecords,F,0)}if(this.meta.success){var J=L.selectValue(this.meta.success,F,true);P=J!==false&&J!=="false"}var C=[];var H=L.select(this.meta.record,F);for(var D=0,B=H.length;D<B;D++){var G=H[D];var U={};var K=Q?L.selectValue(Q,G):undefined;for(var E=0,M=I.length;E<M;E++){var v=I.items[E];var O=L.selectValue(v.mapping||v.name,G,v.defaultValue);O=v.convert(O,G);U[v.name]=O}var S=new T(U,K);S.node=G;C[C.length]=S}return{success:P,records:C,totalRecords:N||C.length}}});Ext.data.ArrayReader=Ext.extend(Ext.data.JsonReader,{readRecords:function(H){var I=this.meta?this.meta.id:null;var D=this.recordType,v=D.prototype.fields;var F=[];var N=H;for(var B=0;B<N.length;B++){var G=N[B];var L={};var J=((I||I===0)&&G[I]!==undefined&&G[I]!==""?G[I]:null);for(var C=0,K=v.length;C<K;C++){var o=v.items[C];var E=o.mapping!==undefined&&o.mapping!==null?o.mapping:C;var M=G[E]!==undefined?G[E]:o.defaultValue;M=o.convert(M,G);L[o.name]=M}var z=new D(L,J);z.json=G;F[F.length]=z}return{records:F,totalRecords:F.length}}});Ext.data.Tree=function(b){this.nodeHash={};this.root=null;if(b){this.setRootNode(b)}this.addEvents("append","remove","move","insert","beforeappend","beforeremove","beforemove","beforeinsert");Ext.data.Tree.superclass.constructor.call(this)};Ext.extend(Ext.data.Tree,Ext.util.Observable,{pathSeparator:"/",proxyNodeEvent:function(){return this.fireEvent.apply(this,arguments)},getRootNode:function(){return this.root},setRootNode:function(b){this.root=b;b.ownerTree=this;b.isRoot=true;this.registerNode(b);return b},getNodeById:function(b){return this.nodeHash[b]},registerNode:function(b){this.nodeHash[b.id]=b},unregisterNode:function(b){delete this.nodeHash[b.id]},toString:function(){return"[Tree"+(this.id?" "+this.id:"")+"]"}});Ext.data.Node=function(b){this.attributes=b||{};this.leaf=this.attributes.leaf;this.id=this.attributes.id;if(!this.id){this.id=Ext.id(null,"ynode-");this.attributes.id=this.id}this.childNodes=[];if(!this.childNodes.indexOf){this.childNodes.indexOf=function(e){for(var g=0,a=this.length;g<a;g++){if(this[g]==e){return g}}return -1}}this.parentNode=null;this.firstChild=null;this.lastChild=null;this.previousSibling=null;this.nextSibling=null;this.addEvents({append:true,remove:true,move:true,insert:true,beforeappend:true,beforeremove:true,beforemove:true,beforeinsert:true});this.listeners=this.attributes.listeners;Ext.data.Node.superclass.constructor.call(this)};Ext.extend(Ext.data.Node,Ext.util.Observable,{fireEvent:function(d){if(Ext.data.Node.superclass.fireEvent.apply(this,arguments)===false){return false}var e=this.getOwnerTree();if(e){if(e.proxyNodeEvent.apply(e,arguments)===false){return false}}return true},isLeaf:function(){return this.leaf===true},setFirstChild:function(b){this.firstChild=b},setLastChild:function(b){this.lastChild=b},isLast:function(){return(!this.parentNode?true:this.parentNode.lastChild==this)},isFirst:function(){return(!this.parentNode?true:this.parentNode.firstChild==this)},hasChildNodes:function(){return !this.isLeaf()&&this.childNodes.length>0},isExpandable:function(){return this.attributes.expandable||this.hasChildNodes()},appendChild:function(q){var p=false;if(Ext.isArray(q)){p=q}else{if(arguments.length>1){p=arguments}}if(p){for(var r=0,m=p.length;r<m;r++){this.appendChild(p[r])}}else{if(this.fireEvent("beforeappend",this.ownerTree,this,q)===false){return false}var l=this.childNodes.length;var s=q.parentNode;if(s){if(q.fireEvent("beforemove",q.getOwnerTree(),q,s,this,l)===false){return false}s.removeChild(q)}l=this.childNodes.length;if(l==0){this.setFirstChild(q)}this.childNodes.push(q);q.parentNode=this;var o=this.childNodes[l-1];if(o){q.previousSibling=o;o.nextSibling=q}else{q.previousSibling=null}q.nextSibling=null;this.setLastChild(q);q.setOwnerTree(this.getOwnerTree());this.fireEvent("append",this.ownerTree,this,q,l);if(s){q.fireEvent("move",this.ownerTree,q,s,this,l)}return q}},removeChild:function(d){var e=this.childNodes.indexOf(d);if(e==-1){return false}if(this.fireEvent("beforeremove",this.ownerTree,this,d)===false){return false}this.childNodes.splice(e,1);if(d.previousSibling){d.previousSibling.nextSibling=d.nextSibling}if(d.nextSibling){d.nextSibling.previousSibling=d.previousSibling}if(this.firstChild==d){this.setFirstChild(d.nextSibling)}if(this.lastChild==d){this.setLastChild(d.previousSibling)}d.setOwnerTree(null);d.parentNode=null;d.previousSibling=null;d.nextSibling=null;this.fireEvent("remove",this.ownerTree,this,d);return d},insertBefore:function(p,l){if(!l){return this.appendChild(p)}if(p==l){return false}if(this.fireEvent("beforeinsert",this.ownerTree,this,p,l)===false){return false}var h=this.childNodes.indexOf(l);var q=p.parentNode;var o=h;if(q==this&&this.childNodes.indexOf(p)<h){o--}if(q){if(p.fireEvent("beforemove",p.getOwnerTree(),p,q,this,h,l)===false){return false}q.removeChild(p)}if(o==0){this.setFirstChild(p)}this.childNodes.splice(o,0,p);p.parentNode=this;var m=this.childNodes[o-1];if(m){p.previousSibling=m;m.nextSibling=p}else{p.previousSibling=null}p.nextSibling=l;l.previousSibling=p;p.setOwnerTree(this.getOwnerTree());this.fireEvent("insert",this.ownerTree,this,p,l);if(q){p.fireEvent("move",this.ownerTree,p,q,this,o,l)}return p},remove:function(){this.parentNode.removeChild(this);return this},item:function(b){return this.childNodes[b]},replaceChild:function(e,g){var d=g?g.nextSibling:null;this.removeChild(g);this.insertBefore(e,d);return g},indexOf:function(b){return this.childNodes.indexOf(b)},getOwnerTree:function(){if(!this.ownerTree){var b=this;while(b){if(b.ownerTree){this.ownerTree=b.ownerTree;break}b=b.parentNode}}return this.ownerTree},getDepth:function(){var d=0;var e=this;while(e.parentNode){++d;e=e.parentNode}return d},setOwnerTree:function(e){if(e!=this.ownerTree){if(this.ownerTree){this.ownerTree.unregisterNode(this)}this.ownerTree=e;var h=this.childNodes;for(var l=0,g=h.length;l<g;l++){h[l].setOwnerTree(e)}if(e){e.registerNode(this)}}},getPath:function(l){l=l||"id";var g=this.parentNode;var b=[this.attributes[l]];while(g){b.unshift(g.attributes[l]);g=g.parentNode}var h=this.getOwnerTree().pathSeparator;return h+b.join(h)},bubble:function(l,e,g){var h=this;while(h){if(l.apply(e||h,g||[h])===false){break}h=h.parentNode}},cascade:function(m,o,h){if(m.apply(o||this,h||[this])!==false){var p=this.childNodes;for(var q=0,l=p.length;q<l;q++){p[q].cascade(m,o,h)}}},eachChild:function(m,o,h){var p=this.childNodes;for(var q=0,l=p.length;q<l;q++){if(m.apply(o||this,h||[p[q]])===false){break}}},findChild:function(m,l){var o=this.childNodes;for(var g=0,h=o.length;g<h;g++){if(o[g].attributes[m]==l){return o[g]}}return null},findChildBy:function(l,m){var o=this.childNodes;for(var g=0,h=o.length;g<h;g++){if(l.call(m||o[g],o[g])===true){return o[g]}}return null},sort:function(q,r){var s=this.childNodes;var m=s.length;if(m>0){var p=r?function(){q.apply(r,arguments)}:q;s.sort(p);for(var l=0;l<m;l++){var o=s[l];o.previousSibling=s[l-1];o.nextSibling=s[l+1];if(l==0){this.setFirstChild(o)}if(l==m-1){this.setLastChild(o)}}}},contains:function(b){return b.isAncestor(this)},isAncestor:function(e){var d=this.parentNode;while(d){if(d==e){return true}d=d.parentNode}return false},toString:function(){return"[Node"+(this.id?" "+this.id:"")+"]"}});Ext.data.GroupingStore=Ext.extend(Ext.data.Store,{remoteGroup:false,groupOnSort:false,clearGrouping:function(){this.groupField=false;if(this.remoteGroup){if(this.baseParams){delete this.baseParams.groupBy}this.reload()}else{this.applySort();this.fireEvent("datachanged",this)}},groupBy:function(g,d){if(this.groupField==g&&!d){return}this.groupField=g;if(this.remoteGroup){if(!this.baseParams){this.baseParams={}}this.baseParams.groupBy=g}if(this.groupOnSort){this.sort(g);return}if(this.remoteGroup){this.reload()}else{var e=this.sortInfo||{};if(e.field!=g){this.applySort()}else{this.sortData(g)}this.fireEvent("datachanged",this)}},applySort:function(){Ext.data.GroupingStore.superclass.applySort.call(this);if(!this.groupOnSort&&!this.remoteGroup){var b=this.getGroupState();if(b&&b!=this.sortInfo.field){this.sortData(this.groupField)}}},applyGrouping:function(b){if(this.groupField!==false){this.groupBy(this.groupField,true);return true}else{if(b===true){this.fireEvent("datachanged",this)}return false}},getGroupState:function(){return this.groupOnSort&&this.groupField!==false?(this.sortInfo?this.sortInfo.field:undefined):this.groupField}});Ext.ComponentMgr=function(){var d=new Ext.util.MixedCollection();var e={};return{register:function(a){d.add(a)},unregister:function(a){d.remove(a)},get:function(a){return d.get(a)},onAvailable:function(a,b,g){d.on("add",function(m,l){if(l.id==a){b.call(g||l,l);d.un("add",b,g)}})},all:d,registerType:function(a,b){e[a]=b;b.xtype=a},create:function(b,a){return new e[b.xtype||a](b)}}}();Ext.reg=Ext.ComponentMgr.registerType;Ext.Component=function(d){d=d||{};if(d.initialConfig){if(d.isAction){this.baseAction=d}d=d.initialConfig}else{if(d.tagName||d.dom||typeof d=="string"){d={applyTo:d,id:d.id||d}}}this.initialConfig=d;Ext.apply(this,d);this.addEvents("disable","enable","beforeshow","show","beforehide","hide","beforerender","render","beforedestroy","destroy","beforestaterestore","staterestore","beforestatesave","statesave");this.getId();Ext.ComponentMgr.register(this);Ext.Component.superclass.constructor.call(this);if(this.baseAction){this.baseAction.addComponent(this)}this.initComponent();if(this.plugins){if(Ext.isArray(this.plugins)){for(var g=0,e=this.plugins.length;g<e;g++){this.plugins[g]=this.initPlugin(this.plugins[g])}}else{this.plugins=this.initPlugin(this.plugins)}}if(this.stateful!==false){this.initState(d)}if(this.applyTo){this.applyToMarkup(this.applyTo);delete this.applyTo}else{if(this.renderTo){this.render(this.renderTo);delete this.renderTo}}};Ext.Component.AUTO_ID=1000;Ext.extend(Ext.Component,Ext.util.Observable,{disabledClass:"x-item-disabled",allowDomMove:true,autoShow:false,hideMode:"display",hideParent:false,hidden:false,disabled:false,rendered:false,ctype:"Ext.Component",actionMode:"el",getActionEl:function(){return this[this.actionMode]},initPlugin:function(b){b.init(this);return b},initComponent:Ext.emptyFn,render:function(d,e){if(!this.rendered&&this.fireEvent("beforerender",this)!==false){if(!d&&this.el){this.el=Ext.get(this.el);d=this.el.dom.parentNode;this.allowDomMove=false}this.container=Ext.get(d);if(this.ctCls){this.container.addClass(this.ctCls)}this.rendered=true;if(e!==undefined){if(typeof e=="number"){e=this.container.dom.childNodes[e]}else{e=Ext.getDom(e)}}this.onRender(this.container,e||null);if(this.autoShow){this.el.removeClass(["x-hidden","x-hide-"+this.hideMode])}if(this.cls){this.el.addClass(this.cls);delete this.cls}if(this.style){this.el.applyStyles(this.style);delete this.style}if(this.overCls){this.el.addClassOnOver(this.overCls)}this.fireEvent("render",this);this.afterRender(this.container);if(this.hidden){this.hide()}if(this.disabled){this.disable()}if(this.stateful!==false){this.initStateEvents()}}return this},initState:function(e){if(Ext.state.Manager){var g=this.getStateId();if(g){var d=Ext.state.Manager.get(g);if(d){if(this.fireEvent("beforestaterestore",this,d)!==false){this.applyState(d);this.fireEvent("staterestore",this,d)}}}}},getStateId:function(){return this.stateId||((this.id.indexOf("ext-comp-")==0||this.id.indexOf("ext-gen")==0)?null:this.id)},initStateEvents:function(){if(this.stateEvents){for(var e=0,d;d=this.stateEvents[e];e++){this.on(d,this.saveState,this,{delay:100})}}},applyState:function(d,e){if(d){Ext.apply(this,d)}},getState:function(){return null},saveState:function(){if(Ext.state.Manager){var d=this.getStateId();if(d){var e=this.getState();if(this.fireEvent("beforestatesave",this,e)!==false){Ext.state.Manager.set(d,e);this.fireEvent("statesave",this,e)}}}},applyToMarkup:function(b){this.allowDomMove=false;this.el=Ext.get(b);this.render(this.el.dom.parentNode)},addClass:function(b){if(this.el){this.el.addClass(b)}else{this.cls=this.cls?this.cls+" "+b:b}},removeClass:function(b){if(this.el){this.el.removeClass(b)}else{if(this.cls){this.cls=this.cls.split(" ").remove(b).join(" ")}}},onRender:function(d,e){if(this.autoEl){if(typeof this.autoEl=="string"){this.el=document.createElement(this.autoEl)}else{var g=document.createElement("div");Ext.DomHelper.overwrite(g,this.autoEl);this.el=g.firstChild}if(!this.el.id){this.el.id=this.getId()}}if(this.el){this.el=Ext.get(this.el);if(this.allowDomMove!==false){d.dom.insertBefore(this.el.dom,e)}}},getAutoCreate:function(){var b=typeof this.autoCreate=="object"?this.autoCreate:Ext.apply({},this.defaultAutoCreate);if(this.id&&!b.id){b.id=this.id}return b},afterRender:Ext.emptyFn,destroy:function(){if(this.fireEvent("beforedestroy",this)!==false){this.beforeDestroy();if(this.rendered){this.el.removeAllListeners();this.el.remove();if(this.actionMode=="container"){this.container.remove()}}this.onDestroy();Ext.ComponentMgr.unregister(this);this.fireEvent("destroy",this);this.purgeListeners()}},beforeDestroy:Ext.emptyFn,onDestroy:Ext.emptyFn,getEl:function(){return this.el},getId:function(){return this.id||(this.id="ext-comp-"+(++Ext.Component.AUTO_ID))},getItemId:function(){return this.itemId||this.getId()},focus:function(d,e){if(e){this.focus.defer(typeof e=="number"?e:10,this,[d,false]);return}if(this.rendered){this.el.focus();if(d===true){this.el.dom.select()}}return this},blur:function(){if(this.rendered){this.el.blur()}return this},disable:function(){if(this.rendered){this.onDisable()}this.disabled=true;this.fireEvent("disable",this);return this},onDisable:function(){this.getActionEl().addClass(this.disabledClass);this.el.dom.disabled=true},enable:function(){if(this.rendered){this.onEnable()}this.disabled=false;this.fireEvent("enable",this);return this},onEnable:function(){this.getActionEl().removeClass(this.disabledClass);this.el.dom.disabled=false},setDisabled:function(b){this[b?"disable":"enable"]()},show:function(){if(this.fireEvent("beforeshow",this)!==false){this.hidden=false;if(this.autoRender){this.render(typeof this.autoRender=="boolean"?Ext.getBody():this.autoRender)}if(this.rendered){this.onShow()}this.fireEvent("show",this)}return this},onShow:function(){if(this.hideParent){this.container.removeClass("x-hide-"+this.hideMode)}else{this.getActionEl().removeClass("x-hide-"+this.hideMode)}},hide:function(){if(this.fireEvent("beforehide",this)!==false){this.hidden=true;if(this.rendered){this.onHide()}this.fireEvent("hide",this)}return this},onHide:function(){if(this.hideParent){this.container.addClass("x-hide-"+this.hideMode)}else{this.getActionEl().addClass("x-hide-"+this.hideMode)}},setVisible:function(b){if(b){this.show()}else{this.hide()}return this},isVisible:function(){return this.rendered&&this.getActionEl().isVisible()},cloneConfig:function(d){d=d||{};var g=d.id||Ext.id();var e=Ext.applyIf(d,this.initialConfig);e.id=g;return new this.constructor(e)},getXType:function(){return this.constructor.xtype},isXType:function(d,e){if(typeof d=="function"){d=d.xtype}else{if(typeof d=="object"){d=d.constructor.xtype}}return !e?("/"+this.getXTypes()+"/").indexOf("/"+d+"/")!=-1:this.constructor.xtype==d},getXTypes:function(){var g=this.constructor;if(!g.xtypes){var h=[],e=this;while(e&&e.constructor.xtype){h.unshift(e.constructor.xtype);e=e.constructor.superclass}g.xtypeChain=h;g.xtypes=h.join("/")}return g.xtypes},findParentBy:function(e){for(var d=this.ownerCt;(d!=null)&&!e(d,this);d=d.ownerCt){}return d||null},findParentByType:function(b){return typeof b=="function"?this.findParentBy(function(a){return a.constructor===b}):this.findParentBy(function(a){return a.constructor.xtype===b})},mon:function(l,g,m,o,h){if(!this.mons){this.mons=[];this.on("beforedestroy",function(){for(var a=0,b=this.mons.length;a<b;a++){var d=this.mons[a];d.item.un(d.ename,d.fn,d.scope)}},this)}this.mons.push({item:l,ename:g,fn:m,scope:o});l.on(g,m,o,h)}});Ext.reg("component",Ext.Component);Ext.Action=function(b){this.initialConfig=b;this.items=[]};Ext.Action.prototype={isAction:true,setText:function(b){this.initialConfig.text=b;this.callEach("setText",[b])},getText:function(){return this.initialConfig.text},setIconClass:function(b){this.initialConfig.iconCls=b;this.callEach("setIconClass",[b])},getIconClass:function(){return this.initialConfig.iconCls},setDisabled:function(b){this.initialConfig.disabled=b;this.callEach("setDisabled",[b])},enable:function(){this.setDisabled(false)},disable:function(){this.setDisabled(true)},isDisabled:function(){return this.initialConfig.disabled},setHidden:function(b){this.initialConfig.hidden=b;this.callEach("setVisible",[!b])},show:function(){this.setHidden(false)},hide:function(){this.setHidden(true)},isHidden:function(){return this.initialConfig.hidden},setHandler:function(d,e){this.initialConfig.handler=d;this.initialConfig.scope=e;this.callEach("setHandler",[d,e])},each:function(d,e){Ext.each(this.items,d,e)},callEach:function(l,g){var m=this.items;for(var o=0,h=m.length;o<h;o++){m[o][l].apply(m[o],g)}},addComponent:function(b){this.items.push(b);b.on("destroy",this.removeComponent,this)},removeComponent:function(b){this.items.remove(b)},execute:function(){this.initialConfig.handler.apply(this.initialConfig.scope||window,arguments)}};(function(){Ext.Layer=function(o,p){o=o||{};var m=Ext.DomHelper;var b=o.parentEl,l=b?Ext.getDom(b):document.body;if(p){this.dom=Ext.getDom(p)}if(!this.dom){var a=o.dh||{tag:"div",cls:"x-layer"};this.dom=m.append(l,a)}if(o.cls){this.addClass(o.cls)}this.constrain=o.constrain!==false;this.visibilityMode=Ext.Element.VISIBILITY;if(o.id){this.id=this.dom.id=o.id}else{this.id=Ext.id(this.dom)}this.zindex=o.zindex||this.getZIndex();this.position("absolute",this.zindex);if(o.shadow){this.shadowOffset=o.shadowOffset||4;this.shadow=new Ext.Shadow({offset:this.shadowOffset,mode:o.shadow})}else{this.shadowOffset=0}this.useShim=o.shim!==false&&Ext.useShims;this.useDisplay=o.useDisplay;this.hide()};var e=Ext.Element.prototype;var d=[];Ext.extend(Ext.Layer,Ext.Element,{getZIndex:function(){return this.zindex||parseInt(this.getStyle("z-index"),10)||11000},getShim:function(){if(!this.useShim){return null}if(this.shim){return this.shim}var a=d.shift();if(!a){a=this.createShim();a.enableDisplayMode("block");a.dom.style.display="none";a.dom.style.visibility="visible"}var b=this.dom.parentNode;if(a.dom.parentNode!=b){b.insertBefore(a.dom,this.dom)}a.setStyle("z-index",this.getZIndex()-2);this.shim=a;return a},hideShim:function(){if(this.shim){this.shim.setDisplayed(false);d.push(this.shim);delete this.shim}},disableShadow:function(){if(this.shadow){this.shadowDisabled=true;this.shadow.hide();this.lastShadowOffset=this.shadowOffset;this.shadowOffset=0}},enableShadow:function(a){if(this.shadow){this.shadowDisabled=false;this.shadowOffset=this.lastShadowOffset;delete this.lastShadowOffset;if(a){this.sync(true)}}},sync:function(t){var h=this.shadow;if(!this.updating&&this.isVisible()&&(h||this.useShim)){var q=this.getShim();var l=this.getWidth(),r=this.getHeight();var s=this.getLeft(true),b=this.getTop(true);if(h&&!this.shadowDisabled){if(t&&!h.isVisible()){h.show(this)}else{h.realign(s,b,l,r)}if(q){if(t){q.show()}var p=h.adjusts,a=q.dom.style;a.left=(Math.min(s,s+p.l))+"px";a.top=(Math.min(b,b+p.t))+"px";a.width=(l+p.w)+"px";a.height=(r+p.h)+"px"}}else{if(q){if(t){q.show()}q.setSize(l,r);q.setLeftTop(s,b)}}}},destroy:function(){this.hideShim();if(this.shadow){this.shadow.hide()}this.removeAllListeners();Ext.removeNode(this.dom);Ext.Element.uncache(this.id)},remove:function(){this.destroy()},beginUpdate:function(){this.updating=true},endUpdate:function(){this.updating=false;this.sync(true)},hideUnders:function(a){if(this.shadow){this.shadow.hide()}this.hideShim()},constrainXY:function(){if(this.constrain){var r=Ext.lib.Dom.getViewWidth(),v=Ext.lib.Dom.getViewHeight();var a=Ext.getDoc().getScroll();var b=this.getXY();var q=b[0],s=b[1];var p=this.dom.offsetWidth+this.shadowOffset,u=this.dom.offsetHeight+this.shadowOffset;var t=false;if((q+p)>r+a.left){q=r-p-this.shadowOffset;t=true}if((s+u)>v+a.top){s=v-u-this.shadowOffset;t=true}if(q<a.left){q=a.left;t=true}if(s<a.top){s=a.top;t=true}if(t){if(this.avoidY){var h=this.avoidY;if(s<=h&&(s+u)>=h){s=h-u-5}}b=[q,s];this.storeXY(b);e.setXY.call(this,b);this.sync()}}},isVisible:function(){return this.visible},showAction:function(){this.visible=true;if(this.useDisplay===true){this.setDisplayed("")}else{if(this.lastXY){e.setXY.call(this,this.lastXY)}else{if(this.lastLT){e.setLeftTop.call(this,this.lastLT[0],this.lastLT[1])}}}},hideAction:function(){this.visible=false;if(this.useDisplay===true){this.setDisplayed(false)}else{this.setLeftTop(-10000,-10000)}},setVisible:function(p,q,b,a,o){if(p){this.showAction()}if(q&&p){var r=function(){this.sync(true);if(a){a()}}.createDelegate(this);e.setVisible.call(this,true,true,b,r,o)}else{if(!p){this.hideUnders(true)}var r=a;if(q){r=function(){this.hideAction();if(a){a()}}.createDelegate(this)}e.setVisible.call(this,p,q,b,r,o);if(p){this.sync(true)}else{if(!q){this.hideAction()}}}},storeXY:function(a){delete this.lastLT;this.lastXY=a},storeLeftTop:function(a,b){delete this.lastXY;this.lastLT=[a,b]},beforeFx:function(){this.beforeAction();return Ext.Layer.superclass.beforeFx.apply(this,arguments)},afterFx:function(){Ext.Layer.superclass.afterFx.apply(this,arguments);this.sync(this.isVisible())},beforeAction:function(){if(!this.updating&&this.shadow){this.shadow.hide()}},setLeft:function(a){this.storeLeftTop(a,this.getTop(true));e.setLeft.apply(this,arguments);this.sync()},setTop:function(a){this.storeLeftTop(this.getLeft(true),a);e.setTop.apply(this,arguments);this.sync()},setLeftTop:function(a,b){this.storeLeftTop(a,b);e.setLeftTop.apply(this,arguments);this.sync()},setXY:function(o,q,b,a,p){this.fixDisplay();this.beforeAction();this.storeXY(o);var r=this.createCB(a);e.setXY.call(this,o,q,b,r,p);if(!q){r()}},createCB:function(a){var b=this;return function(){b.constrainXY();b.sync(true);if(a){a()}}},setX:function(p,o,b,a,m){this.setXY([p,this.getY()],o,b,a,m)},setY:function(a,p,m,b,o){this.setXY([this.getX(),a],p,m,b,o)},setSize:function(h,b,p,s,r,a){this.beforeAction();var q=this.createCB(r);e.setSize.call(this,h,b,p,s,q,a);if(!p){q()}},setWidth:function(p,q,b,a,o){this.beforeAction();var r=this.createCB(a);e.setWidth.call(this,p,q,b,r,o);if(!q){r()}},setHeight:function(h,o,a,q,b){this.beforeAction();var p=this.createCB(q);e.setHeight.call(this,h,o,a,p,b);if(!o){p()}},setBounds:function(b,r,a,v,h,t,s,u){this.beforeAction();var w=this.createCB(s);if(!h){this.storeXY([b,r]);e.setXY.call(this,[b,r]);e.setSize.call(this,a,v,h,t,w,u);w()}else{e.setBounds.call(this,b,r,a,v,h,t,w,u)}return this},setZIndex:function(a){this.zindex=a;this.setStyle("z-index",a+2);if(this.shadow){this.shadow.setZIndex(a+1)}if(this.shim){this.shim.setStyle("z-index",a)}}})})();Ext.Shadow=function(h){Ext.apply(this,h);if(typeof this.mode!="string"){this.mode=this.defaultMode}var g=this.offset,l={h:0};var a=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case"drop":l.w=0;l.l=l.t=g;l.t-=1;if(Ext.isIE){l.l-=this.offset+a;l.t-=this.offset+a;l.w-=a;l.h-=a;l.t+=1}break;case"sides":l.w=(g*2);l.l=-g;l.t=g-1;if(Ext.isIE){l.l-=(this.offset-a);l.t-=this.offset+a;l.l+=1;l.w-=(this.offset-a)*2;l.w-=a+1;l.h-=1}break;case"frame":l.w=l.h=(g*2);l.l=l.t=-g;l.t+=1;l.h-=2;if(Ext.isIE){l.l-=(this.offset-a);l.t-=(this.offset-a);l.l+=1;l.w-=(this.offset+a+1);l.h-=(this.offset+a);l.h+=1}break}this.adjusts=l};Ext.Shadow.prototype={offset:4,defaultMode:"drop",show:function(b){b=Ext.get(b);if(!this.el){this.el=Ext.Shadow.Pool.pull();if(this.el.dom.nextSibling!=b.dom){this.el.insertBefore(b)}}this.el.setStyle("z-index",this.zIndex||parseInt(b.getStyle("z-index"),10)-1);if(Ext.isIE){this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")"}this.realign(b.getLeft(true),b.getTop(true),b.getWidth(),b.getHeight());this.el.dom.style.display="block"},isVisible:function(){return this.el?true:false},realign:function(E,G,a,B){if(!this.el){return}var l=this.adjusts,t=this.el.dom,F=t.style;var z=0;F.left=(E+l.l)+"px";F.top=(G+l.t)+"px";var d=(a+l.w),C=(B+l.h),w=d+"px",h=C+"px";if(F.width!=w||F.height!=h){F.width=w;F.height=h;if(!Ext.isIE){var s=t.childNodes;var D=Math.max(0,(d-12))+"px";s[0].childNodes[1].style.width=D;s[1].childNodes[1].style.width=D;s[2].childNodes[1].style.width=D;s[1].style.height=Math.max(0,(C-12))+"px"}}},hide:function(){if(this.el){this.el.dom.style.display="none";Ext.Shadow.Pool.push(this.el);delete this.el}},setZIndex:function(b){this.zIndex=b;if(this.el){this.el.setStyle("z-index",b)}}};Ext.Shadow.Pool=function(){var d=[];var e=Ext.isIE?'<div class="x-ie-shadow"></div>':'<div class="x-shadow"><div class="xst"><div class="xstl"></div><div class="xstc"></div><div class="xstr"></div></div><div class="xsc"><div class="xsml"></div><div class="xsmc"></div><div class="xsmr"></div></div><div class="xsb"><div class="xsbl"></div><div class="xsbc"></div><div class="xsbr"></div></div></div>';return{pull:function(){var a=d.shift();if(!a){a=Ext.get(Ext.DomHelper.insertHtml("beforeBegin",document.body.firstChild,e));a.autoBoxAdjust=false}return a},push:function(a){d.push(a)}}}();Ext.BoxComponent=Ext.extend(Ext.Component,{initComponent:function(){Ext.BoxComponent.superclass.initComponent.call(this);this.addEvents("resize","move")},boxReady:false,deferHeight:false,setSize:function(h,p){if(typeof h=="object"){p=h.height;h=h.width}if(!this.boxReady){this.width=h;this.height=p;return this}if(this.lastSize&&this.lastSize.width==h&&this.lastSize.height==p){return this}this.lastSize={width:h,height:p};var q=this.adjustSize(h,p);var m=q.width,l=q.height;if(m!==undefined||l!==undefined){var o=this.getResizeEl();if(!this.deferHeight&&m!==undefined&&l!==undefined){o.setSize(m,l)}else{if(!this.deferHeight&&l!==undefined){o.setHeight(l)}else{if(m!==undefined){o.setWidth(m)}}}this.onResize(m,l,h,p);this.fireEvent("resize",this,m,l,h,p)}return this},setWidth:function(b){return this.setSize(b)},setHeight:function(b){return this.setSize(undefined,b)},getSize:function(){return this.el.getSize()},getPosition:function(b){if(b===true){return[this.el.getLeft(true),this.el.getTop(true)]}return this.xy||this.el.getXY()},getBox:function(e){var d=this.el.getSize();if(e===true){d.x=this.el.getLeft(true);d.y=this.el.getTop(true)}else{var g=this.xy||this.el.getXY();d.x=g[0];d.y=g[1]}return d},updateBox:function(b){this.setSize(b.width,b.height);this.setPagePosition(b.x,b.y);return this},getResizeEl:function(){return this.resizeEl||this.el},getPositionEl:function(){return this.positionEl||this.el},setPosition:function(l,m){if(l&&typeof l[1]=="number"){m=l[1];l=l[0]}this.x=l;this.y=m;if(!this.boxReady){return this}var h=this.adjustPosition(l,m);var o=h.x,p=h.y;var q=this.getPositionEl();if(o!==undefined||p!==undefined){if(o!==undefined&&p!==undefined){q.setLeftTop(o,p)}else{if(o!==undefined){q.setLeft(o)}else{if(p!==undefined){q.setTop(p)}}}this.onPosition(o,p);this.fireEvent("move",this,o,p)}return this},setPagePosition:function(e,g){if(e&&typeof e[1]=="number"){g=e[1];e=e[0]}this.pageX=e;this.pageY=g;if(!this.boxReady){return}if(e===undefined||g===undefined){return}var d=this.el.translatePoints(e,g);this.setPosition(d.left,d.top);return this},onRender:function(d,e){Ext.BoxComponent.superclass.onRender.call(this,d,e);if(this.resizeEl){this.resizeEl=Ext.get(this.resizeEl)}if(this.positionEl){this.positionEl=Ext.get(this.positionEl)}},afterRender:function(){Ext.BoxComponent.superclass.afterRender.call(this);this.boxReady=true;this.setSize(this.width,this.height);if(this.x||this.y){this.setPosition(this.x,this.y)}else{if(this.pageX||this.pageY){this.setPagePosition(this.pageX,this.pageY)}}},syncSize:function(){delete this.lastSize;this.setSize(this.autoWidth?undefined:this.el.getWidth(),this.autoHeight?undefined:this.el.getHeight());return this},onResize:function(h,e,g,l){},onPosition:function(e,d){},adjustSize:function(e,d){if(this.autoWidth){e="auto"}if(this.autoHeight){d="auto"}return{width:e,height:d}},adjustPosition:function(e,d){return{x:e,y:d}}});Ext.reg("box",Ext.BoxComponent);Ext.SplitBar=function(o,l,g,m,h){this.el=Ext.get(o,true);this.el.dom.unselectable="on";this.resizingEl=Ext.get(l,true);this.orientation=g||Ext.SplitBar.HORIZONTAL;this.minSize=0;this.maxSize=2000;this.animate=false;this.useShim=false;this.shim=null;if(!h){this.proxy=Ext.SplitBar.createProxy(this.orientation)}else{this.proxy=Ext.get(h).dom}this.dd=new Ext.dd.DDProxy(this.el.dom.id,"XSplitBars",{dragElId:this.proxy.id});this.dd.b4StartDrag=this.onStartProxyDrag.createDelegate(this);this.dd.endDrag=this.onEndProxyDrag.createDelegate(this);this.dragSpecs={};this.adapter=new Ext.SplitBar.BasicLayoutAdapter();this.adapter.init(this);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.placement=m||(this.el.getX()>this.resizingEl.getX()?Ext.SplitBar.LEFT:Ext.SplitBar.RIGHT);this.el.addClass("x-splitbar-h")}else{this.placement=m||(this.el.getY()>this.resizingEl.getY()?Ext.SplitBar.TOP:Ext.SplitBar.BOTTOM);this.el.addClass("x-splitbar-v")}this.addEvents("resize","moved","beforeresize","beforeapply");Ext.SplitBar.superclass.constructor.call(this)};Ext.extend(Ext.SplitBar,Ext.util.Observable,{onStartProxyDrag:function(h,l){this.fireEvent("beforeresize",this);this.overlay=Ext.DomHelper.append(document.body,{cls:"x-drag-overlay",html:"&#160;"},true);this.overlay.unselectable();this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();Ext.get(this.proxy).setDisplayed("block");var o=this.adapter.getElementSize(this);this.activeMinSize=this.getMinimumSize();this.activeMaxSize=this.getMaximumSize();var m=o-this.activeMinSize;var g=Math.max(this.activeMaxSize-o,0);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.dd.resetConstraints();this.dd.setXConstraint(this.placement==Ext.SplitBar.LEFT?m:g,this.placement==Ext.SplitBar.LEFT?g:m);this.dd.setYConstraint(0,0)}else{this.dd.resetConstraints();this.dd.setXConstraint(0,0);this.dd.setYConstraint(this.placement==Ext.SplitBar.TOP?m:g,this.placement==Ext.SplitBar.TOP?g:m)}this.dragSpecs.startSize=o;this.dragSpecs.startPoint=[h,l];Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd,h,l)},onEndProxyDrag:function(g){Ext.get(this.proxy).setDisplayed(false);var d=Ext.lib.Event.getXY(g);if(this.overlay){Ext.destroy(this.overlay);delete this.overlay}var e;if(this.orientation==Ext.SplitBar.HORIZONTAL){e=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.LEFT?d[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-d[0])}else{e=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.TOP?d[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-d[1])}e=Math.min(Math.max(e,this.activeMinSize),this.activeMaxSize);if(e!=this.dragSpecs.startSize){if(this.fireEvent("beforeapply",this,e)!==false){this.adapter.setElementSize(this,e);this.fireEvent("moved",this,e);this.fireEvent("resize",this,e)}}},getAdapter:function(){return this.adapter},setAdapter:function(b){this.adapter=b;this.adapter.init(this)},getMinimumSize:function(){return this.minSize},setMinimumSize:function(b){this.minSize=b},getMaximumSize:function(){return this.maxSize},setMaximumSize:function(b){this.maxSize=b},setCurrentSize:function(d){var e=this.animate;this.animate=false;this.adapter.setElementSize(this,d);this.animate=e},destroy:function(b){if(this.shim){this.shim.remove()}this.dd.unreg();Ext.destroy(Ext.get(this.proxy));if(b){this.el.remove()}}});Ext.SplitBar.createProxy=function(d){var g=new Ext.Element(document.createElement("div"));g.unselectable();var e="x-splitbar-proxy";g.addClass(e+" "+(d==Ext.SplitBar.HORIZONTAL?e+"-h":e+"-v"));document.body.appendChild(g.dom);return g.dom};Ext.SplitBar.BasicLayoutAdapter=function(){};Ext.SplitBar.BasicLayoutAdapter.prototype={init:function(b){},getElementSize:function(b){if(b.orientation==Ext.SplitBar.HORIZONTAL){return b.resizingEl.getWidth()}else{return b.resizingEl.getHeight()}},setElementSize:function(d,e,g){if(d.orientation==Ext.SplitBar.HORIZONTAL){if(!d.animate){d.resizingEl.setWidth(e);if(g){g(d,e)}}else{d.resizingEl.setWidth(e,true,0.1,g,"easeOut")}}else{if(!d.animate){d.resizingEl.setHeight(e);if(g){g(d,e)}}else{d.resizingEl.setHeight(e,true,0.1,g,"easeOut")}}}};Ext.SplitBar.AbsoluteLayoutAdapter=function(b){this.basic=new Ext.SplitBar.BasicLayoutAdapter();this.container=Ext.get(b)};Ext.SplitBar.AbsoluteLayoutAdapter.prototype={init:function(b){this.basic.init(b)},getElementSize:function(b){return this.basic.getElementSize(b)},setElementSize:function(d,e,g){this.basic.setElementSize(d,e,this.moveSplitter.createDelegate(this,[d]))},moveSplitter:function(e){var d=Ext.SplitBar;switch(e.placement){case d.LEFT:e.el.setX(e.resizingEl.getRight());break;case d.RIGHT:e.el.setStyle("right",(this.container.getWidth()-e.resizingEl.getLeft())+"px");break;case d.TOP:e.el.setY(e.resizingEl.getBottom());break;case d.BOTTOM:e.el.setY(e.resizingEl.getTop()-e.el.getHeight());break}}};Ext.SplitBar.VERTICAL=1;Ext.SplitBar.HORIZONTAL=2;Ext.SplitBar.LEFT=1;Ext.SplitBar.RIGHT=2;Ext.SplitBar.TOP=3;Ext.SplitBar.BOTTOM=4;Ext.Container=Ext.extend(Ext.BoxComponent,{autoDestroy:true,defaultType:"panel",initComponent:function(){Ext.Container.superclass.initComponent.call(this);this.addEvents("afterlayout","beforeadd","beforeremove","add","remove");var b=this.items;if(b){delete this.items;if(Ext.isArray(b)&&b.length>0){this.add.apply(this,b)}else{this.add(b)}}},initItems:function(){if(!this.items){this.items=new Ext.util.MixedCollection(false,this.getComponentId);this.getLayout()}},setLayout:function(b){if(this.layout&&this.layout!=b){this.layout.setContainer(null)}this.initItems();this.layout=b;b.setContainer(this)},render:function(){Ext.Container.superclass.render.apply(this,arguments);if(this.layout){if(typeof this.layout=="string"){this.layout=new Ext.Container.LAYOUTS[this.layout.toLowerCase()](this.layoutConfig)}this.setLayout(this.layout);if(this.activeItem!==undefined){var b=this.activeItem;delete this.activeItem;this.layout.setActiveItem(b);return}}if(!this.ownerCt){this.doLayout()}if(this.monitorResize===true){Ext.EventManager.onWindowResize(this.doLayout,this,[false])}},getLayoutTarget:function(){return this.el},getComponentId:function(b){return b.itemId||b.id},add:function(p){if(!this.items){this.initItems()}var q=arguments,a=q.length;if(a>1){for(var o=0;o<a;o++){this.add(q[o])}return}var l=this.lookupComponent(this.applyDefaults(p));var m=this.items.length;if(this.fireEvent("beforeadd",this,l,m)!==false&&this.onBeforeAdd(l)!==false){this.items.add(l);l.ownerCt=this;this.fireEvent("add",this,l,m)}return l},insert:function(o,p){if(!this.items){this.initItems()}var q=arguments,a=q.length;if(a>2){for(var m=a-1;m>=1;--m){this.insert(o,q[m])}return}var l=this.lookupComponent(this.applyDefaults(p));if(l.ownerCt==this&&this.items.indexOf(l)<o){--o}if(this.fireEvent("beforeadd",this,l,o)!==false&&this.onBeforeAdd(l)!==false){this.items.insert(o,l);l.ownerCt=this;this.fireEvent("add",this,l,o)}return l},applyDefaults:function(b){if(this.defaults){if(typeof b=="string"){b=Ext.ComponentMgr.get(b);Ext.apply(b,this.defaults)}else{if(!b.events){Ext.applyIf(b,this.defaults)}else{Ext.apply(b,this.defaults)}}}return b},onBeforeAdd:function(b){if(b.ownerCt){b.ownerCt.remove(b,false)}if(this.hideBorders===true){b.border=(b.border===true)}},remove:function(g,e){var h=this.getComponent(g);if(h&&this.fireEvent("beforeremove",this,h)!==false){this.items.remove(h);delete h.ownerCt;if(e===true||(e!==false&&this.autoDestroy)){h.destroy()}if(this.layout&&this.layout.activeItem==h){delete this.layout.activeItem}this.fireEvent("remove",this,h)}return h},removeAll:function(d){var g,e=[];while((g=this.items.last())){e.unshift(this.remove(g,d))}return e},getComponent:function(b){if(typeof b=="object"){return b}return this.items.get(b)},lookupComponent:function(b){if(typeof b=="string"){return Ext.ComponentMgr.get(b)}else{if(!b.events){return this.createComponent(b)}}return b},createComponent:function(b){return Ext.ComponentMgr.create(b,this.defaultType)},doLayout:function(o){if(this.rendered&&this.layout){this.layout.layout()}if(o!==false&&this.items){var p=this.items.items;for(var h=0,l=p.length;h<l;h++){var m=p[h];if(m.doLayout){m.doLayout()}}}},getLayout:function(){if(!this.layout){var b=new Ext.layout.ContainerLayout(this.layoutConfig);this.setLayout(b)}return this.layout},beforeDestroy:function(){if(this.items){Ext.destroy.apply(Ext,this.items.items)}if(this.monitorResize){Ext.EventManager.removeResizeListener(this.doLayout,this)}if(this.layout&&this.layout.destroy){this.layout.destroy()}Ext.Container.superclass.beforeDestroy.call(this)},bubble:function(l,e,g){var h=this;while(h){if(l.apply(e||h,g||[h])===false){break}h=h.ownerCt}},cascade:function(m,o,h){if(m.apply(o||this,h||[this])!==false){if(this.items){var p=this.items.items;for(var q=0,l=p.length;q<l;q++){if(p[q].cascade){p[q].cascade(m,o,h)}else{m.apply(o||p[q],h||[p[q]])}}}}},findById:function(g){var e,d=this;this.cascade(function(a){if(d!=a&&a.id===g){e=a;return false}});return e||null},findByType:function(d,e){return this.findBy(function(a){return a.isXType(d,e)})},find:function(d,e){return this.findBy(function(a){return a[d]===e})},findBy:function(h,l){var g=[],e=this;this.cascade(function(a){if(e!=a&&h.call(l||a,a,e)===true){g.push(a)}});return g}});Ext.Container.LAYOUTS={};Ext.reg("container",Ext.Container);Ext.layout.ContainerLayout=function(b){Ext.apply(this,b)};Ext.layout.ContainerLayout.prototype={monitorResize:false,activeItem:null,layout:function(){var b=this.container.getLayoutTarget();this.onLayout(this.container,b);this.container.fireEvent("afterlayout",this.container,this)},onLayout:function(e,d){this.renderAll(e,d)},isValidParent:function(h,e){var g=h.getPositionEl?h.getPositionEl():h.getEl();return g.dom.parentNode==e.dom},renderAll:function(q,p){var l=q.items.items;for(var r=0,m=l.length;r<m;r++){var o=l[r];if(o&&(!o.rendered||!this.isValidParent(o,p))){this.renderItem(o,r,p)}}},renderItem:function(l,h,m){if(l&&!l.rendered){l.render(m,h);if(this.extraCls){var g=l.getPositionEl?l.getPositionEl():l;g.addClass(this.extraCls)}if(this.renderHidden&&l!=this.activeItem){l.hide()}}else{if(l&&!this.isValidParent(l,m)){if(this.extraCls){var g=l.getPositionEl?l.getPositionEl():l;g.addClass(this.extraCls)}if(typeof h=="number"){h=m.dom.childNodes[h]}m.dom.insertBefore(l.getEl().dom,h||null);if(this.renderHidden&&l!=this.activeItem){l.hide()}}}},onResize:function(){if(this.container.collapsed){return}var b=this.container.bufferResize;if(b){if(!this.resizeTask){this.resizeTask=new Ext.util.DelayedTask(this.layout,this);this.resizeBuffer=typeof b=="number"?b:100}this.resizeTask.delay(this.resizeBuffer)}else{this.layout()}},setContainer:function(b){if(this.monitorResize&&b!=this.container){if(this.container){this.container.un("resize",this.onResize,this)}if(b){b.on("resize",this.onResize,this)}}this.container=b},parseMargins:function(d){var g=d.split(" ");var e=g.length;if(e==1){g[1]=g[0];g[2]=g[0];g[3]=g[0]}if(e==2){g[2]=g[0];g[3]=g[1]}return{top:parseInt(g[0],10)||0,right:parseInt(g[1],10)||0,bottom:parseInt(g[2],10)||0,left:parseInt(g[3],10)||0}},destroy:Ext.emptyFn};Ext.Container.LAYOUTS.auto=Ext.layout.ContainerLayout;Ext.layout.FitLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,onLayout:function(e,d){Ext.layout.FitLayout.superclass.onLayout.call(this,e,d);if(!this.container.collapsed){this.setItemSize(this.activeItem||e.items.itemAt(0),d.getStyleSize())}},setItemSize:function(d,e){if(d&&e.height>0){d.setSize(e)}}});Ext.Container.LAYOUTS.fit=Ext.layout.FitLayout;Ext.layout.CardLayout=Ext.extend(Ext.layout.FitLayout,{deferredRender:false,renderHidden:true,setActiveItem:function(b){b=this.container.getComponent(b);if(this.activeItem!=b){if(this.activeItem){this.activeItem.hide()}this.activeItem=b;b.show();this.layout()}},renderAll:function(e,d){if(this.deferredRender){this.renderItem(this.activeItem,undefined,d)}else{Ext.layout.CardLayout.superclass.renderAll.call(this,e,d)}}});Ext.Container.LAYOUTS.card=Ext.layout.CardLayout;Ext.layout.AnchorLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,getAnchorViewSize:function(e,d){return d.dom==document.body?d.getViewSize():d.getStyleSize()},onLayout:function(C,w){Ext.layout.AnchorLayout.superclass.onLayout.call(this,C,w);var I=this.getAnchorViewSize(C,w);var K=I.width,D=I.height;if(K<20||D<20){return}var G,h;if(C.anchorSize){if(typeof C.anchorSize=="number"){G=C.anchorSize}else{G=C.anchorSize.width;h=C.anchorSize.height}}else{G=C.initialConfig.width;h=C.initialConfig.height}var z=C.items.items,B=z.length,E,v,a,F,H;for(E=0;E<B;E++){v=z[E];if(v.anchor){a=v.anchorSpec;if(!a){var J=v.anchor.split(" ");v.anchorSpec=a={right:this.parseAnchor(J[0],v.initialConfig.width,G),bottom:this.parseAnchor(J[1],v.initialConfig.height,h)}}F=a.right?this.adjustWidthAnchor(a.right(K),v):undefined;H=a.bottom?this.adjustHeightAnchor(a.bottom(D),v):undefined;if(F||H){v.setSize(F||undefined,H||undefined)}}}},parseAnchor:function(q,l,a){if(q&&q!="none"){var o;if(/^(r|right|b|bottom)$/i.test(q)){var m=a-l;return function(b){if(b!==o){o=b;return b-m}}}else{if(q.indexOf("%")!=-1){var p=parseFloat(q.replace("%",""))*0.01;return function(b){if(b!==o){o=b;return Math.floor(b*p)}}}else{q=parseInt(q,10);if(!isNaN(q)){return function(b){if(b!==o){o=b;return b+q}}}}}}return false},adjustWidthAnchor:function(d,e){return d},adjustHeightAnchor:function(d,e){return d}});Ext.Container.LAYOUTS.anchor=Ext.layout.AnchorLayout;Ext.layout.ColumnLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,extraCls:"x-column",scrollOffset:0,isValidParent:function(d,e){return(d.getPositionEl?d.getPositionEl():d.getEl()).dom.parentNode==this.innerCt.dom},onLayout:function(v,s){var u=v.items.items,t=u.length,r,z;if(!this.innerCt){s.addClass("x-column-layout-ct");this.innerCt=s.createChild({cls:"x-column-inner"});this.innerCt.createChild({cls:"x-clear"})}this.renderAll(v,this.innerCt);var h=Ext.isIE&&s.dom!=Ext.getBody().dom?s.getStyleSize():s.getViewSize();if(h.width<1&&h.height<1){return}var q=h.width-s.getPadding("lr")-this.scrollOffset,w=h.height-s.getPadding("tb"),p=q;this.innerCt.setWidth(q);for(z=0;z<t;z++){r=u[z];if(!r.columnWidth){p-=(r.getSize().width+r.getEl().getMargins("lr"))}}p=p<0?0:p;for(z=0;z<t;z++){r=u[z];if(r.columnWidth){r.setSize(Math.floor(r.columnWidth*p)-r.getEl().getMargins("lr"))}}}});Ext.Container.LAYOUTS.column=Ext.layout.ColumnLayout;Ext.layout.BorderLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,rendered:false,onLayout:function(ab,h){var aa;if(!this.rendered){h.position();h.addClass("x-border-layout-ct");var m=ab.items.items;aa=[];for(var S=0,P=m.length;S<P;S++){var K=m[S];var W=K.region;if(K.collapsed){aa.push(K)}K.collapsed=false;if(!K.rendered){K.cls=K.cls?K.cls+" x-border-panel":"x-border-panel";K.render(h,S)}this[W]=W!="center"&&K.split?new Ext.layout.BorderLayout.SplitRegion(this,K.initialConfig,W):new Ext.layout.BorderLayout.Region(this,K.initialConfig,W);this[W].render(h,K)}this.rendered=true}var J=h.getViewSize();if(J.width<20||J.height<20){if(aa){this.restoreCollapsed=aa}return}else{if(this.restoreCollapsed){aa=this.restoreCollapsed;delete this.restoreCollapsed}}var N=J.width,O=J.height;var Q=N,U=O,V=0,T=0;var e=this.north,L=this.south,Y=this.west,M=this.east,K=this.center;if(!K&&Ext.layout.BorderLayout.WARN!==false){throw"No center region defined in BorderLayout "+ab.id}if(e&&e.isVisible()){var s=e.getSize();var b=e.getMargins();s.width=N-(b.left+b.right);s.x=b.left;s.y=b.top;V=s.height+s.y+b.bottom;U-=V;e.applyLayout(s)}if(L&&L.isVisible()){var s=L.getSize();var b=L.getMargins();s.width=N-(b.left+b.right);s.x=b.left;var w=(s.height+b.top+b.bottom);s.y=O-w+b.top;U-=w;L.applyLayout(s)}if(Y&&Y.isVisible()){var s=Y.getSize();var b=Y.getMargins();s.height=U-(b.top+b.bottom);s.x=b.left;s.y=V+b.top;var ac=(s.width+b.left+b.right);T+=ac;Q-=ac;Y.applyLayout(s)}if(M&&M.isVisible()){var s=M.getSize();var b=M.getMargins();s.height=U-(b.top+b.bottom);var ac=(s.width+b.left+b.right);s.x=N-ac+b.left;s.y=V+b.top;Q-=ac;M.applyLayout(s)}if(K){var b=K.getMargins();var Z={x:T+b.left,y:V+b.top,width:Q-(b.left+b.right),height:U-(b.top+b.bottom)};K.applyLayout(Z)}if(aa){for(var S=0,P=aa.length;S<P;S++){aa[S].collapse(false)}}if(Ext.isIE&&Ext.isStrict){h.repaint()}},destroy:function(){var d=["north","south","east","west"];for(var e=0;e<d.length;e++){var g=this[d[e]];if(g){if(g.destroy){g.destroy()}else{if(g.split){g.split.destroy(true)}}}}Ext.layout.BorderLayout.superclass.destroy.call(this)}});Ext.layout.BorderLayout.Region=function(d,e,g){Ext.apply(this,e);this.layout=d;this.position=g;this.state={};if(typeof this.margins=="string"){this.margins=this.layout.parseMargins(this.margins)}this.margins=Ext.applyIf(this.margins||{},this.defaultMargins);if(this.collapsible){if(typeof this.cmargins=="string"){this.cmargins=this.layout.parseMargins(this.cmargins)}if(this.collapseMode=="mini"&&!this.cmargins){this.cmargins={left:0,top:0,right:0,bottom:0}}else{this.cmargins=Ext.applyIf(this.cmargins||{},g=="north"||g=="south"?this.defaultNSCMargins:this.defaultEWCMargins)}}};Ext.layout.BorderLayout.Region.prototype={collapsible:false,split:false,floatable:true,minWidth:50,minHeight:50,defaultMargins:{left:0,top:0,right:0,bottom:0},defaultNSCMargins:{left:5,top:5,right:5,bottom:5},defaultEWCMargins:{left:5,top:0,right:5,bottom:0},isCollapsed:false,render:function(e,l){this.panel=l;l.el.enableDisplayMode();this.targetEl=e;this.el=l.el;var g=l.getState,h=this.position;l.getState=function(){return Ext.apply(g.call(l)||{},this.state)}.createDelegate(this);if(h!="center"){l.allowQueuedExpand=false;l.on({beforecollapse:this.beforeCollapse,collapse:this.onCollapse,beforeexpand:this.beforeExpand,expand:this.onExpand,hide:this.onHide,show:this.onShow,scope:this});if(this.collapsible){l.collapseEl="el";l.slideAnchor=this.getSlideAnchor()}if(l.tools&&l.tools.toggle){l.tools.toggle.addClass("x-tool-collapse-"+h);l.tools.toggle.addClassOnOver("x-tool-collapse-"+h+"-over")}}},getCollapsedEl:function(){if(!this.collapsedEl){if(!this.toolTemplate){var d=new Ext.Template('<div class="x-tool x-tool-{id}">&#160;</div>');d.disableFormats=true;d.compile();Ext.layout.BorderLayout.Region.prototype.toolTemplate=d}this.collapsedEl=this.targetEl.createChild({cls:"x-layout-collapsed x-layout-collapsed-"+this.position,id:this.panel.id+"-xcollapsed"});this.collapsedEl.enableDisplayMode("block");if(this.collapseMode=="mini"){this.collapsedEl.addClass("x-layout-cmini-"+this.position);this.miniCollapsedEl=this.collapsedEl.createChild({cls:"x-layout-mini x-layout-mini-"+this.position,html:"&#160;"});this.miniCollapsedEl.addClassOnOver("x-layout-mini-over");this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this.onExpandClick,this,{stopEvent:true})}else{var e=this.toolTemplate.append(this.collapsedEl.dom,{id:"expand-"+this.position},true);e.addClassOnOver("x-tool-expand-"+this.position+"-over");e.on("click",this.onExpandClick,this,{stopEvent:true});if(this.floatable!==false){this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this.collapseClick,this)}}}return this.collapsedEl},onExpandClick:function(b){if(this.isSlid){this.afterSlideIn();this.panel.expand(false)}else{this.panel.expand()}},onCollapseClick:function(b){this.panel.collapse()},beforeCollapse:function(d,e){this.lastAnim=e;if(this.splitEl){this.splitEl.hide()}this.getCollapsedEl().show();this.panel.el.setStyle("z-index",100);this.isCollapsed=true;this.layout.layout()},onCollapse:function(b){this.panel.el.setStyle("z-index",1);if(this.lastAnim===false||this.panel.animCollapse===false){this.getCollapsedEl().dom.style.visibility="visible"}else{this.getCollapsedEl().slideIn(this.panel.slideAnchor,{duration:0.2})}this.state.collapsed=true;this.panel.saveState()},beforeExpand:function(e){var d=this.getCollapsedEl();this.el.show();if(this.position=="east"||this.position=="west"){this.panel.setSize(undefined,d.getHeight())}else{this.panel.setSize(d.getWidth(),undefined)}d.hide();d.dom.style.visibility="hidden";this.panel.el.setStyle("z-index",100)},onExpand:function(){this.isCollapsed=false;if(this.splitEl){this.splitEl.show()}this.layout.layout();this.panel.el.setStyle("z-index",1);this.state.collapsed=false;this.panel.saveState()},collapseClick:function(b){if(this.isSlid){b.stopPropagation();this.slideIn()}else{b.stopPropagation();this.slideOut()}},onHide:function(){if(this.isCollapsed){this.getCollapsedEl().hide()}else{if(this.splitEl){this.splitEl.hide()}}},onShow:function(){if(this.isCollapsed){this.getCollapsedEl().show()}else{if(this.splitEl){this.splitEl.show()}}},isVisible:function(){return !this.panel.hidden},getMargins:function(){return this.isCollapsed&&this.cmargins?this.cmargins:this.margins},getSize:function(){return this.isCollapsed?this.getCollapsedEl().getSize():this.panel.getSize()},setPanel:function(b){this.panel=b},getMinWidth:function(){return this.minWidth},getMinHeight:function(){return this.minHeight},applyLayoutCollapsed:function(e){var d=this.getCollapsedEl();d.setLeftTop(e.x,e.y);d.setSize(e.width,e.height)},applyLayout:function(b){if(this.isCollapsed){this.applyLayoutCollapsed(b)}else{this.panel.setPosition(b.x,b.y);this.panel.setSize(b.width,b.height)}},beforeSlide:function(){this.panel.beforeEffect()},afterSlide:function(){this.panel.afterEffect()},initAutoHide:function(){if(this.autoHide!==false){if(!this.autoHideHd){var b=new Ext.util.DelayedTask(this.slideIn,this);this.autoHideHd={mouseout:function(a){if(!a.within(this.el,true)){b.delay(500)}},mouseover:function(a){b.cancel()},scope:this}}this.el.on(this.autoHideHd)}},clearAutoHide:function(){if(this.autoHide!==false){this.el.un("mouseout",this.autoHideHd.mouseout);this.el.un("mouseover",this.autoHideHd.mouseover)}},clearMonitor:function(){Ext.getDoc().un("click",this.slideInIf,this)},slideOut:function(){if(this.isSlid||this.el.hasActiveFx()){return}this.isSlid=true;var b=this.panel.tools;if(b&&b.toggle){b.toggle.hide()}this.el.show();if(this.position=="east"||this.position=="west"){this.panel.setSize(undefined,this.collapsedEl.getHeight())}else{this.panel.setSize(this.collapsedEl.getWidth(),undefined)}this.restoreLT=[this.el.dom.style.left,this.el.dom.style.top];this.el.alignTo(this.collapsedEl,this.getCollapseAnchor());this.el.setStyle("z-index",102);this.panel.el.replaceClass("x-panel-collapsed","x-panel-floating");if(this.animFloat!==false){this.beforeSlide();this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.afterSlide();this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)},scope:this,block:true})}else{this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)}},afterSlideIn:function(){this.clearAutoHide();this.isSlid=false;this.clearMonitor();this.el.setStyle("z-index","");this.panel.el.replaceClass("x-panel-floating","x-panel-collapsed");this.el.dom.style.left=this.restoreLT[0];this.el.dom.style.top=this.restoreLT[1];var b=this.panel.tools;if(b&&b.toggle){b.toggle.show()}},slideIn:function(b){if(!this.isSlid||this.el.hasActiveFx()){Ext.callback(b);return}this.isSlid=false;if(this.animFloat!==false){this.beforeSlide();this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.hide();this.afterSlide();this.afterSlideIn();Ext.callback(b)},scope:this,block:true})}else{this.el.hide();this.afterSlideIn()}},slideInIf:function(b){if(!b.within(this.el)){this.slideIn()}},anchors:{west:"left",east:"right",north:"top",south:"bottom"},sanchors:{west:"l",east:"r",north:"t",south:"b"},canchors:{west:"tl-tr",east:"tr-tl",north:"tl-bl",south:"bl-tl"},getAnchor:function(){return this.anchors[this.position]},getCollapseAnchor:function(){return this.canchors[this.position]},getSlideAnchor:function(){return this.sanchors[this.position]},getAlignAdj:function(){var b=this.cmargins;switch(this.position){case"west":return[0,0];break;case"east":return[0,0];break;case"north":return[0,0];break;case"south":return[0,0];break}},getExpandAdj:function(){var d=this.collapsedEl,e=this.cmargins;switch(this.position){case"west":return[-(e.right+d.getWidth()+e.left),0];break;case"east":return[e.right+d.getWidth()+e.left,0];break;case"north":return[0,-(e.top+e.bottom+d.getHeight())];break;case"south":return[0,e.top+e.bottom+d.getHeight()];break}}};Ext.layout.BorderLayout.SplitRegion=function(d,e,g){Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this,d,e,g);this.applyLayout=this.applyFns[g]};Ext.extend(Ext.layout.BorderLayout.SplitRegion,Ext.layout.BorderLayout.Region,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:false,splitSettings:{north:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.TOP,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},south:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.BOTTOM,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},east:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.RIGHT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"},west:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.LEFT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"}},applyFns:{west:function(l){if(this.isCollapsed){return this.applyLayoutCollapsed(l)}var h=this.splitEl.dom,e=h.style;this.panel.setPosition(l.x,l.y);var g=h.offsetWidth;e.left=(l.x+l.width-g)+"px";e.top=(l.y)+"px";e.height=Math.max(0,l.height)+"px";this.panel.setSize(l.width-g,l.height)},east:function(l){if(this.isCollapsed){return this.applyLayoutCollapsed(l)}var h=this.splitEl.dom,e=h.style;var g=h.offsetWidth;this.panel.setPosition(l.x+g,l.y);e.left=(l.x)+"px";e.top=(l.y)+"px";e.height=Math.max(0,l.height)+"px";this.panel.setSize(l.width-g,l.height)},north:function(l){if(this.isCollapsed){return this.applyLayoutCollapsed(l)}var h=this.splitEl.dom,e=h.style;var g=h.offsetHeight;this.panel.setPosition(l.x,l.y);e.left=(l.x)+"px";e.top=(l.y+l.height-g)+"px";e.width=Math.max(0,l.width)+"px";this.panel.setSize(l.width,l.height-g)},south:function(l){if(this.isCollapsed){return this.applyLayoutCollapsed(l)}var h=this.splitEl.dom,e=h.style;var g=h.offsetHeight;this.panel.setPosition(l.x,l.y+g);e.left=(l.x)+"px";e.top=(l.y)+"px";e.width=Math.max(0,l.width)+"px";this.panel.setSize(l.width,l.height-g)}},render:function(g,l){Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this,g,l);var h=this.position;this.splitEl=g.createChild({cls:"x-layout-split x-layout-split-"+h,html:"&#160;",id:this.panel.id+"-xsplit"});if(this.collapseMode=="mini"){this.miniSplitEl=this.splitEl.createChild({cls:"x-layout-mini x-layout-mini-"+h,html:"&#160;"});this.miniSplitEl.addClassOnOver("x-layout-mini-over");this.miniSplitEl.on("click",this.onCollapseClick,this,{stopEvent:true})}var e=this.splitSettings[h];this.split=new Ext.SplitBar(this.splitEl.dom,l.el,e.orientation);this.split.placement=e.placement;this.split.getMaximumSize=this[e.maxFn].createDelegate(this);this.split.minSize=this.minSize||this[e.minProp];this.split.on("beforeapply",this.onSplitMove,this);this.split.useShim=this.useShim===true;this.maxSize=this.maxSize||this[e.maxProp];if(l.hidden){this.splitEl.hide()}if(this.useSplitTips){this.splitEl.dom.title=this.collapsible?this.collapsibleSplitTip:this.splitTip}if(this.collapsible){this.splitEl.on("dblclick",this.onCollapseClick,this)}},getSize:function(){if(this.isCollapsed){return this.collapsedEl.getSize()}var b=this.panel.getSize();if(this.position=="north"||this.position=="south"){b.height+=this.splitEl.dom.offsetHeight}else{b.width+=this.splitEl.dom.offsetWidth}return b},getHMaxSize:function(){var d=this.maxSize||10000;var e=this.layout.center;return Math.min(d,(this.el.getWidth()+e.el.getWidth())-e.getMinWidth())},getVMaxSize:function(){var d=this.maxSize||10000;var e=this.layout.center;return Math.min(d,(this.el.getHeight()+e.el.getHeight())-e.getMinHeight())},onSplitMove:function(d,e){var g=this.panel.getSize();this.lastSplitSize=e;if(this.position=="north"||this.position=="south"){this.panel.setSize(g.width,e);this.state.height=e}else{this.panel.setSize(e,g.height);this.state.width=e}this.layout.layout();this.panel.saveState();return false},getSplitBar:function(){return this.split},destroy:function(){Ext.destroy(this.miniSplitEl,this.split,this.splitEl)}});Ext.Container.LAYOUTS.border=Ext.layout.BorderLayout;Ext.layout.FormLayout=Ext.extend(Ext.layout.AnchorLayout,{labelSeparator:":",getAnchorViewSize:function(e,d){return(e.body||e.el).getStyleSize()},setContainer:function(d){Ext.layout.FormLayout.superclass.setContainer.call(this,d);if(d.labelAlign){d.addClass("x-form-label-"+d.labelAlign)}if(d.hideLabels){this.labelStyle="display:none";this.elementStyle="padding-left:0;";this.labelAdjust=0}else{this.labelSeparator=d.labelSeparator||this.labelSeparator;d.labelWidth=d.labelWidth||100;if(typeof d.labelWidth=="number"){var g=(typeof d.labelPad=="number"?d.labelPad:5);this.labelAdjust=d.labelWidth+g;this.labelStyle="width:"+d.labelWidth+"px;";this.elementStyle="padding-left:"+(d.labelWidth+g)+"px"}if(d.labelAlign=="top"){this.labelStyle="width:auto;";this.labelAdjust=0;this.elementStyle="padding-left:0;"}}if(!this.fieldTpl){var e=new Ext.Template('<div class="x-form-item {5}" tabIndex="-1">','<label for="{0}" style="{2}" class="x-form-item-label">{1}{4}</label>','<div class="x-form-element" id="x-form-el-{0}" style="{3}">','</div><div class="{6}"></div>',"</div>");e.disableFormats=true;e.compile();Ext.layout.FormLayout.prototype.fieldTpl=e}},getLabelStyle:function(l){var g="",o=[this.labelStyle,l];for(var m=0,h=o.length;m<h;++m){if(o[m]){g+=o[m];if(g.substr(-1,1)!=";"){g+=";"}}}return g},renderItem:function(l,h,m){if(l&&!l.rendered&&l.isFormField&&l.inputType!="hidden"){var g=[l.id,l.fieldLabel,this.getLabelStyle(l.labelStyle),this.elementStyle||"",typeof l.labelSeparator=="undefined"?this.labelSeparator:l.labelSeparator,(l.itemCls||this.container.itemCls||"")+(l.hideLabel?" x-hide-label":""),l.clearCls||"x-form-clear-left"];if(typeof h=="number"){h=m.dom.childNodes[h]||null}if(h){this.fieldTpl.insertBefore(h,g)}else{this.fieldTpl.append(m,g)}l.render("x-form-el-"+l.id)}else{Ext.layout.FormLayout.superclass.renderItem.apply(this,arguments)}},adjustWidthAnchor:function(d,e){return d-(e.isFormField?(e.hideLabel?0:this.labelAdjust):0)},isValidParent:function(d,e){return true}});Ext.Container.LAYOUTS.form=Ext.layout.FormLayout;Ext.layout.Accordion=Ext.extend(Ext.layout.FitLayout,{fill:true,autoWidth:true,titleCollapse:true,hideCollapseTool:false,collapseFirst:false,animate:false,sequence:false,activeOnTop:false,renderItem:function(b){if(this.animate===false){b.animCollapse=false}b.collapsible=true;if(this.autoWidth){b.autoWidth=true}if(this.titleCollapse){b.titleCollapse=true}if(this.hideCollapseTool){b.hideCollapseTool=true}if(this.collapseFirst!==undefined){b.collapseFirst=this.collapseFirst}if(!this.activeItem&&!b.collapsed){this.activeItem=b}else{if(this.activeItem){b.collapsed=true}}Ext.layout.Accordion.superclass.renderItem.apply(this,arguments);b.header.addClass("x-accordion-hd");b.on("beforeexpand",this.beforeExpand,this)},beforeExpand:function(g,d){var e=this.activeItem;if(e){if(this.sequence){delete this.activeItem;if(!e.collapsed){e.collapse({callback:function(){g.expand(d||true)},scope:this});return false}}else{e.collapse(this.animate)}}this.activeItem=g;if(this.activeOnTop){g.el.dom.parentNode.insertBefore(g.el.dom,g.el.dom.parentNode.firstChild)}this.layout()},setItemSize:function(p,q){if(this.fill&&p){var l=this.container.items.items;var r=0;for(var s=0,m=l.length;s<m;s++){var o=l[s];if(o!=p){r+=(o.getSize().height-o.bwrap.getHeight())}}q.height-=r;p.setSize(q)}}});Ext.Container.LAYOUTS.accordion=Ext.layout.Accordion;Ext.layout.TableLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:false,setContainer:function(b){Ext.layout.TableLayout.superclass.setContainer.call(this,b);this.currentRow=0;this.currentColumn=0;this.cells=[]},onLayout:function(r,p){var q=r.items.items,m=q.length,o,l;if(!this.table){p.addClass("x-table-layout-ct");this.table=p.createChild({tag:"table",cls:"x-table-layout",cellspacing:0,cn:{tag:"tbody"}},null,true);this.renderAll(r,p)}},getRow:function(e){var d=this.table.tBodies[0].childNodes[e];if(!d){d=document.createElement("tr");this.table.tBodies[0].appendChild(d)}return d},getNextCell:function(o){var m=this.getNextNonSpan(this.currentColumn,this.currentRow);var r=this.currentColumn=m[0],s=this.currentRow=m[1];for(var p=s;p<s+(o.rowspan||1);p++){if(!this.cells[p]){this.cells[p]=[]}for(var t=r;t<r+(o.colspan||1);t++){this.cells[p][t]=true}}var q=document.createElement("td");if(o.cellId){q.id=o.cellId}var l="x-table-layout-cell";if(o.cellCls){l+=" "+o.cellCls}q.className=l;if(o.colspan){q.colSpan=o.colspan}if(o.rowspan){q.rowSpan=o.rowspan}this.getRow(s).appendChild(q);return q},getNextNonSpan:function(e,g){var d=this.columns;while((d&&e>=d)||(this.cells[g]&&this.cells[g][e])){if(d&&e>=d){g++;e=0}else{e++}}return[e,g]},renderItem:function(l,h,m){if(l&&!l.rendered){l.render(this.getNextCell(l));if(this.extraCls){var g=l.getPositionEl?l.getPositionEl():l;g.addClass(this.extraCls)}}},isValidParent:function(d,e){return true}});Ext.Container.LAYOUTS.table=Ext.layout.TableLayout;Ext.layout.AbsoluteLayout=Ext.extend(Ext.layout.AnchorLayout,{extraCls:"x-abs-layout-item",isForm:false,setContainer:function(b){Ext.layout.AbsoluteLayout.superclass.setContainer.call(this,b);if(b.isXType("form")){this.isForm=true}},onLayout:function(e,d){if(this.isForm){e.body.position()}else{d.position()}Ext.layout.AbsoluteLayout.superclass.onLayout.call(this,e,d)},getAnchorViewSize:function(e,d){return this.isForm?e.body.getStyleSize():Ext.layout.AbsoluteLayout.superclass.getAnchorViewSize.call(this,e,d)},isValidParent:function(d,e){return this.isForm?true:Ext.layout.AbsoluteLayout.superclass.isValidParent.call(this,d,e)},adjustWidthAnchor:function(d,e){return d?d-e.getPosition(true)[0]:d},adjustHeightAnchor:function(d,e){return d?d-e.getPosition(true)[1]:d}});Ext.Container.LAYOUTS.absolute=Ext.layout.AbsoluteLayout;Ext.Viewport=Ext.extend(Ext.Container,{initComponent:function(){Ext.Viewport.superclass.initComponent.call(this);document.getElementsByTagName("html")[0].className+=" x-viewport";this.el=Ext.getBody();this.el.setHeight=Ext.emptyFn;this.el.setWidth=Ext.emptyFn;this.el.setSize=Ext.emptyFn;this.el.dom.scroll="no";this.allowDomMove=false;this.autoWidth=true;this.autoHeight=true;Ext.EventManager.onWindowResize(this.fireResize,this);this.renderTo=this.el},fireResize:function(e,d){this.fireEvent("resize",this,e,d,e,d)}});Ext.reg("viewport",Ext.Viewport);Ext.Panel=Ext.extend(Ext.Container,{baseCls:"x-panel",collapsedCls:"x-panel-collapsed",maskDisabled:true,animCollapse:Ext.enableFx,headerAsText:true,buttonAlign:"right",collapsed:false,collapseFirst:true,minButtonWidth:75,elements:"body",toolTarget:"header",collapseEl:"bwrap",slideAnchor:"t",disabledClass:"",deferHeight:true,expandDefaults:{duration:0.25},collapseDefaults:{duration:0.25},initComponent:function(){Ext.Panel.superclass.initComponent.call(this);this.addEvents("bodyresize","titlechange","iconchange","collapse","expand","beforecollapse","beforeexpand","beforeclose","close","activate","deactivate");if(this.tbar){this.elements+=",tbar";if(typeof this.tbar=="object"){this.topToolbar=this.tbar}delete this.tbar}if(this.bbar){this.elements+=",bbar";if(typeof this.bbar=="object"){this.bottomToolbar=this.bbar}delete this.bbar}if(this.header===true){this.elements+=",header";delete this.header}else{if(this.title&&this.header!==false){this.elements+=",header"}}if(this.footer===true){this.elements+=",footer";delete this.footer}if(this.buttons){var g=this.buttons;this.buttons=[];for(var d=0,e=g.length;d<e;d++){if(g[d].render){g[d].ownerCt=this;this.buttons.push(g[d])}else{this.addButton(g[d])}}}if(this.autoLoad){this.on("render",this.doAutoLoad,this,{delay:10})}},createElement:function(e,g){if(this[e]){g.appendChild(this[e].dom);return}if(e==="bwrap"||this.elements.indexOf(e)!=-1){if(this[e+"Cfg"]){this[e]=Ext.fly(g).createChild(this[e+"Cfg"])}else{var d=document.createElement("div");d.className=this[e+"Cls"];this[e]=Ext.get(g.appendChild(d))}if(this[e+"CssClass"]){this[e].addClass(this[e+"CssClass"])}if(this[e+"Style"]){this[e].applyStyles(this[e+"Style"])}}},onRender:function(B,C){Ext.Panel.superclass.onRender.call(this,B,C);this.createClasses();if(this.el){this.el.addClass(this.baseCls);this.header=this.el.down("."+this.headerCls);this.bwrap=this.el.down("."+this.bwrapCls);var b=this.bwrap?this.bwrap:this.el;this.tbar=b.down("."+this.tbarCls);this.body=b.down("."+this.bodyCls);this.bbar=b.down("."+this.bbarCls);this.footer=b.down("."+this.footerCls);this.fromMarkup=true}else{this.el=B.createChild({id:this.id,cls:this.baseCls},C)}var I=this.el,v=I.dom;if(this.cls){this.el.addClass(this.cls)}if(this.buttons){this.elements+=",footer"}if(this.frame){I.insertHtml("afterBegin",String.format(Ext.Element.boxMarkup,this.baseCls));this.createElement("header",v.firstChild.firstChild.firstChild);this.createElement("bwrap",v);var K=this.bwrap.dom;var E=v.childNodes[1],H=v.childNodes[2];K.appendChild(E);K.appendChild(H);var J=K.firstChild.firstChild.firstChild;this.createElement("tbar",J);this.createElement("body",J);this.createElement("bbar",J);this.createElement("footer",K.lastChild.firstChild.firstChild);if(!this.footer){this.bwrap.dom.lastChild.className+=" x-panel-nofooter"}}else{this.createElement("header",v);this.createElement("bwrap",v);var K=this.bwrap.dom;this.createElement("tbar",K);this.createElement("body",K);this.createElement("bbar",K);this.createElement("footer",K);if(!this.header){this.body.addClass(this.bodyCls+"-noheader");if(this.tbar){this.tbar.addClass(this.tbarCls+"-noheader")}}}if(this.border===false){this.el.addClass(this.baseCls+"-noborder");this.body.addClass(this.bodyCls+"-noborder");if(this.header){this.header.addClass(this.headerCls+"-noborder")}if(this.footer){this.footer.addClass(this.footerCls+"-noborder")}if(this.tbar){this.tbar.addClass(this.tbarCls+"-noborder")}if(this.bbar){this.bbar.addClass(this.bbarCls+"-noborder")}}if(this.bodyBorder===false){this.body.addClass(this.bodyCls+"-noborder")}this.bwrap.enableDisplayMode("block");if(this.header){this.header.unselectable();if(this.headerAsText){this.header.dom.innerHTML='<span class="'+this.headerTextCls+'">'+this.header.dom.innerHTML+"</span>";if(this.iconCls){this.setIconClass(this.iconCls)}}}if(this.floating){this.makeFloating(this.floating)}if(this.collapsible){this.tools=this.tools?this.tools.slice(0):[];if(!this.hideCollapseTool){this.tools[this.collapseFirst?"unshift":"push"]({id:"toggle",handler:this.toggleCollapse,scope:this})}if(this.titleCollapse&&this.header){this.header.on("click",this.toggleCollapse,this);this.header.setStyle("cursor","pointer")}}if(this.tools){var w=this.tools;this.tools={};this.addTool.apply(this,w)}else{this.tools={}}if(this.buttons&&this.buttons.length>0){var F=this.footer.createChild({cls:"x-panel-btns-ct",cn:{cls:"x-panel-btns x-panel-btns-"+this.buttonAlign,html:'<table cellspacing="0"><tbody><tr></tr></tbody></table><div class="x-clear"></div>'}},null,true);var d=F.getElementsByTagName("tr")[0];for(var D=0,z=this.buttons.length;D<z;D++){var L=this.buttons[D];var G=document.createElement("td");G.className="x-panel-btn-td";L.render(d.appendChild(G))}}if(this.tbar&&this.topToolbar){if(Ext.isArray(this.topToolbar)){this.topToolbar=new Ext.Toolbar(this.topToolbar)}this.topToolbar.render(this.tbar);this.topToolbar.ownerCt=this}if(this.bbar&&this.bottomToolbar){if(Ext.isArray(this.bottomToolbar)){this.bottomToolbar=new Ext.Toolbar(this.bottomToolbar)}this.bottomToolbar.render(this.bbar);this.bottomToolbar.ownerCt=this}},setIconClass:function(e){var g=this.iconCls;this.iconCls=e;if(this.rendered&&this.header){if(this.frame){this.header.addClass("x-panel-icon");this.header.replaceClass(g,this.iconCls)}else{var h=this.header.dom;var l=h.firstChild&&String(h.firstChild.tagName).toLowerCase()=="img"?h.firstChild:null;if(l){Ext.fly(l).replaceClass(g,this.iconCls)}else{Ext.DomHelper.insertBefore(h.firstChild,{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-panel-inline-icon "+this.iconCls})}}}this.fireEvent("iconchange",this,e,g)},makeFloating:function(b){this.floating=true;this.el=new Ext.Layer(typeof b=="object"?b:{shadow:this.shadow!==undefined?this.shadow:"sides",shadowOffset:this.shadowOffset,constrain:false,shim:this.shim===false?false:undefined},this.el)},getTopToolbar:function(){return this.topToolbar},getBottomToolbar:function(){return this.bottomToolbar},addButton:function(h,m,o){var l={handler:m,scope:o,minWidth:this.minButtonWidth,hideParent:true};if(typeof h=="string"){l.text=h}else{Ext.apply(l,h)}var g=new Ext.Button(l);g.ownerCt=this;if(!this.buttons){this.buttons=[]}this.buttons.push(g);return g},addTool:function(){if(!this[this.toolTarget]){return}if(!this.toolTemplate){var m=new Ext.Template('<div class="x-tool x-tool-{id}">&#160;</div>');m.disableFormats=true;m.compile();Ext.Panel.prototype.toolTemplate=m}for(var o=0,q=arguments,r=q.length;o<r;o++){var a=q[o];if(!this.tools[a.id]){var l="x-tool-"+a.id+"-over";var p=this.toolTemplate.insertFirst((a.align!=="left")?this[this.toolTarget]:this[this.toolTarget].child("span"),a,true);this.tools[a.id]=p;p.enableDisplayMode("block");p.on("click",this.createToolHandler(p,a,l,this));if(a.on){p.on(a.on)}if(a.hidden){p.hide()}if(a.qtip){if(typeof a.qtip=="object"){Ext.QuickTips.register(Ext.apply({target:p.id},a.qtip))}else{p.dom.qtip=a.qtip}}p.addClassOnOver(l)}}},onShow:function(){if(this.floating){return this.el.show()}Ext.Panel.superclass.onShow.call(this)},onHide:function(){if(this.floating){return this.el.hide()}Ext.Panel.superclass.onHide.call(this)},createToolHandler:function(l,g,h,e){return function(a){l.removeClass(h);a.stopEvent();if(g.handler){g.handler.call(g.scope||l,a,l,e)}}},afterRender:function(){if(this.fromMarkup&&this.height===undefined&&!this.autoHeight){this.height=this.el.getHeight()}if(this.floating&&!this.hidden&&!this.initHidden){this.el.show()}if(this.title){this.setTitle(this.title)}this.setAutoScroll();if(this.html){this.body.update(typeof this.html=="object"?Ext.DomHelper.markup(this.html):this.html);delete this.html}if(this.contentEl){var b=Ext.getDom(this.contentEl);Ext.fly(b).removeClass(["x-hidden","x-hide-display"]);this.body.dom.appendChild(b)}if(this.collapsed){this.collapsed=false;this.collapse(false)}Ext.Panel.superclass.afterRender.call(this);this.initEvents()},setAutoScroll:function(){if(this.rendered&&this.autoScroll){var b=this.body||this.el;if(b){b.setOverflow("auto")}}},getKeyMap:function(){if(!this.keyMap){this.keyMap=new Ext.KeyMap(this.el,this.keys)}return this.keyMap},initEvents:function(){if(this.keys){this.getKeyMap()}if(this.draggable){this.initDraggable()}},initDraggable:function(){this.dd=new Ext.Panel.DD(this,typeof this.draggable=="boolean"?null:this.draggable)},beforeEffect:function(){if(this.floating){this.el.beforeAction()}this.el.addClass("x-panel-animated")},afterEffect:function(){this.syncShadow();this.el.removeClass("x-panel-animated")},createEffect:function(l,a,h){var g={scope:h,block:true};if(l===true){g.callback=a;return g}else{if(!l.callback){g.callback=a}else{g.callback=function(){a.call(h);Ext.callback(l.callback,l.scope)}}}return Ext.applyIf(g,l)},collapse:function(d){if(this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforecollapse",this,d)===false){return}var e=d===true||(d!==false&&this.animCollapse);this.beforeEffect();this.onCollapse(e,d);return this},onCollapse:function(e,d){if(e){this[this.collapseEl].slideOut(this.slideAnchor,Ext.apply(this.createEffect(d||true,this.afterCollapse,this),this.collapseDefaults))}else{this[this.collapseEl].hide();this.afterCollapse()}},afterCollapse:function(){this.collapsed=true;this.el.addClass(this.collapsedCls);this.afterEffect();this.fireEvent("collapse",this)},expand:function(d){if(!this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforeexpand",this,d)===false){return}var e=d===true||(d!==false&&this.animCollapse);this.el.removeClass(this.collapsedCls);this.beforeEffect();this.onExpand(e,d);return this},onExpand:function(e,d){if(e){this[this.collapseEl].slideIn(this.slideAnchor,Ext.apply(this.createEffect(d||true,this.afterExpand,this),this.expandDefaults))}else{this[this.collapseEl].show();this.afterExpand()}},afterExpand:function(){this.collapsed=false;this.afterEffect();this.fireEvent("expand",this)},toggleCollapse:function(b){this[this.collapsed?"expand":"collapse"](b);return this},onDisable:function(){if(this.rendered&&this.maskDisabled){this.el.mask()}Ext.Panel.superclass.onDisable.call(this)},onEnable:function(){if(this.rendered&&this.maskDisabled){this.el.unmask()}Ext.Panel.superclass.onEnable.call(this)},onResize:function(e,d){if(e!==undefined||d!==undefined){if(!this.collapsed){if(typeof e=="number"){this.body.setWidth(this.adjustBodyWidth(e-this.getFrameWidth()))}else{if(e=="auto"){this.body.setWidth(e)}}if(typeof d=="number"){this.body.setHeight(this.adjustBodyHeight(d-this.getFrameHeight()))}else{if(d=="auto"){this.body.setHeight(d)}}if(this.disabled&&this.el._mask){this.el._mask.setSize(this.el.dom.clientWidth,this.el.getHeight())}}else{this.queuedBodySize={width:e,height:d};if(!this.queuedExpand&&this.allowQueuedExpand!==false){this.queuedExpand=true;this.on("expand",function(){delete this.queuedExpand;this.onResize(this.queuedBodySize.width,this.queuedBodySize.height);this.doLayout()},this,{single:true})}}this.fireEvent("bodyresize",this,e,d)}this.syncShadow()},adjustBodyHeight:function(b){return b},adjustBodyWidth:function(b){return b},onPosition:function(){this.syncShadow()},getFrameWidth:function(){var d=this.el.getFrameWidth("lr");if(this.frame){var e=this.bwrap.dom.firstChild;d+=(Ext.fly(e).getFrameWidth("l")+Ext.fly(e.firstChild).getFrameWidth("r"));var g=this.bwrap.dom.firstChild.firstChild.firstChild;d+=Ext.fly(g).getFrameWidth("lr")}return d},getFrameHeight:function(){var g=this.el.getFrameWidth("tb");g+=(this.tbar?this.tbar.getHeight():0)+(this.bbar?this.bbar.getHeight():0);if(this.frame){var l=this.el.dom.firstChild;var h=this.bwrap.dom.lastChild;g+=(l.offsetHeight+h.offsetHeight);var e=this.bwrap.dom.firstChild.firstChild.firstChild;g+=Ext.fly(e).getFrameWidth("tb")}else{g+=(this.header?this.header.getHeight():0)+(this.footer?this.footer.getHeight():0)}return g},getInnerWidth:function(){return this.getSize().width-this.getFrameWidth()},getInnerHeight:function(){return this.getSize().height-this.getFrameHeight()},syncShadow:function(){if(this.floating){this.el.sync(true)}},getLayoutTarget:function(){return this.body},setTitle:function(d,e){this.title=d;if(this.header&&this.headerAsText){this.header.child("span").update(d)}if(e){this.setIconClass(e)}this.fireEvent("titlechange",this,d);return this},getUpdater:function(){return this.body.getUpdater()},load:function(){var b=this.body.getUpdater();b.update.apply(b,arguments);return this},beforeDestroy:function(){if(this.header){this.header.removeAllListeners();if(this.headerAsText){Ext.Element.uncache(this.header.child("span"))}}Ext.Element.uncache(this.header,this.tbar,this.bbar,this.footer,this.body,this.bwrap);if(this.tools){for(var d in this.tools){Ext.destroy(this.tools[d])}}if(this.buttons){for(var b in this.buttons){Ext.destroy(this.buttons[b])}}Ext.destroy(this.topToolbar,this.bottomToolbar);Ext.Panel.superclass.beforeDestroy.call(this)},createClasses:function(){this.headerCls=this.baseCls+"-header";this.headerTextCls=this.baseCls+"-header-text";this.bwrapCls=this.baseCls+"-bwrap";this.tbarCls=this.baseCls+"-tbar";this.bodyCls=this.baseCls+"-body";this.bbarCls=this.baseCls+"-bbar";this.footerCls=this.baseCls+"-footer"},createGhost:function(h,l,g){var m=document.createElement("div");m.className="x-panel-ghost "+(h?h:"");if(this.header){m.appendChild(this.el.dom.firstChild.cloneNode(true))}Ext.fly(m.appendChild(document.createElement("ul"))).setHeight(this.bwrap.getHeight());m.style.width=this.el.dom.offsetWidth+"px";if(!g){this.container.dom.appendChild(m)}else{Ext.getDom(g).appendChild(m)}if(l!==false&&this.el.useShim!==false){var o=new Ext.Layer({shadow:false,useDisplay:true,constrain:false},m);o.show();return o}else{return new Ext.Element(m)}},doAutoLoad:function(){this.body.load(typeof this.autoLoad=="object"?this.autoLoad:{url:this.autoLoad})},getTool:function(b){return this.tools[b]}});Ext.reg("panel",Ext.Panel);Ext.Window=Ext.extend(Ext.Panel,{baseCls:"x-window",resizable:true,draggable:true,closable:true,constrain:false,constrainHeader:false,plain:false,minimizable:false,maximizable:false,minHeight:100,minWidth:200,expandOnShow:true,closeAction:"close",elements:"header,body",collapsible:false,initHidden:true,monitorResize:true,frame:true,floating:true,initComponent:function(){Ext.Window.superclass.initComponent.call(this);this.addEvents("resize","maximize","minimize","restore")},getState:function(){return Ext.apply(Ext.Window.superclass.getState.call(this)||{},this.getBox())},onRender:function(d,e){Ext.Window.superclass.onRender.call(this,d,e);if(this.plain){this.el.addClass("x-window-plain")}this.focusEl=this.el.createChild({tag:"a",href:"#",cls:"x-dlg-focus",tabIndex:"-1",html:"&#160;"});this.focusEl.swallowEvent("click",true);this.proxy=this.el.createProxy("x-window-proxy");this.proxy.enableDisplayMode("block");if(this.modal){this.mask=this.container.createChild({cls:"ext-el-mask"},this.el.dom);this.mask.enableDisplayMode("block");this.mask.hide();this.mask.on("click",this.focus,this)}},initEvents:function(){Ext.Window.superclass.initEvents.call(this);if(this.animateTarget){this.setAnimateTarget(this.animateTarget)}if(this.resizable){this.resizer=new Ext.Resizable(this.el,{minWidth:this.minWidth,minHeight:this.minHeight,handles:this.resizeHandles||"all",pinned:true,resizeElement:this.resizerAction});this.resizer.window=this;this.resizer.on("beforeresize",this.beforeResize,this)}if(this.draggable){this.header.addClass("x-window-draggable")}this.initTools();this.el.on("mousedown",this.toFront,this);this.manager=this.manager||Ext.WindowMgr;this.manager.register(this);this.hidden=true;if(this.maximized){this.maximized=false;this.maximize()}if(this.closable){var b=this.getKeyMap();b.on(27,this.onEsc,this);b.disable()}},initDraggable:function(){this.dd=new Ext.Window.DD(this)},onEsc:function(){this[this.closeAction]()},beforeDestroy:function(){this.hide();if(this.doAnchor){Ext.EventManager.removeResizeListener(this.doAnchor,this);Ext.EventManager.un(window,"scroll",this.doAnchor,this)}Ext.destroy(this.focusEl,this.resizer,this.dd,this.proxy,this.mask);Ext.Window.superclass.beforeDestroy.call(this)},onDestroy:function(){if(this.manager){this.manager.unregister(this)}Ext.Window.superclass.onDestroy.call(this)},initTools:function(){if(this.minimizable){this.addTool({id:"minimize",handler:this.minimize.createDelegate(this,[])})}if(this.maximizable){this.addTool({id:"maximize",handler:this.maximize.createDelegate(this,[])});this.addTool({id:"restore",handler:this.restore.createDelegate(this,[]),hidden:true});this.header.on("dblclick",this.toggleMaximize,this)}if(this.closable){this.addTool({id:"close",handler:this[this.closeAction].createDelegate(this,[])})}},resizerAction:function(){var b=this.proxy.getBox();this.proxy.hide();this.window.handleResize(b);return b},beforeResize:function(){this.resizer.minHeight=Math.max(this.minHeight,this.getFrameHeight()+40);this.resizer.minWidth=Math.max(this.minWidth,this.getFrameWidth()+40);this.resizeBox=this.el.getBox()},updateHandles:function(){if(Ext.isIE&&this.resizer){this.resizer.syncHandleHeight();this.el.repaint()}},handleResize:function(d){var e=this.resizeBox;if(e.x!=d.x||e.y!=d.y){this.updateBox(d)}else{this.setSize(d)}this.focus();this.updateHandles();this.saveState();if(this.layout){this.doLayout()}this.fireEvent("resize",this,d.width,d.height)},focus:function(){var g=this.focusEl,e=this.defaultButton,d=typeof e;if(d!="undefined"){if(d=="number"){g=this.buttons[e]}else{if(d=="string"){g=Ext.getCmp(e)}else{g=e}}}g.focus.defer(10,g)},setAnimateTarget:function(b){b=Ext.get(b);this.animateTarget=b},beforeShow:function(){delete this.el.lastXY;delete this.el.lastLT;if(this.x===undefined||this.y===undefined){var e=this.el.getAlignToXY(this.container,"c-c");var d=this.el.translatePoints(e[0],e[1]);this.x=this.x===undefined?d.left:this.x;this.y=this.y===undefined?d.top:this.y}this.el.setLeftTop(this.x,this.y);if(this.expandOnShow){this.expand(false)}if(this.modal){Ext.getBody().addClass("x-body-masked");this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.mask.show()}},show:function(g,e,d){if(!this.rendered){this.render(Ext.getBody())}if(this.hidden===false){this.toFront();return}if(this.fireEvent("beforeshow",this)===false){return}if(e){this.on("show",e,d,{single:true})}this.hidden=false;if(g!==undefined){this.setAnimateTarget(g)}this.beforeShow();if(this.animateTarget){this.animShow()}else{this.afterShow()}},afterShow:function(){this.proxy.hide();this.el.setStyle("display","block");this.el.show();if(this.maximized){this.fitContainer()}if(Ext.isMac&&Ext.isGecko){this.cascade(this.setAutoScroll)}if(this.monitorResize||this.modal||this.constrain||this.constrainHeader){Ext.EventManager.onWindowResize(this.onWindowResize,this)}this.doConstrain();if(this.layout){this.doLayout()}if(this.keyMap){this.keyMap.enable()}this.toFront();this.updateHandles();this.fireEvent("show",this)},animShow:function(){this.proxy.show();this.proxy.setBox(this.animateTarget.getBox());this.proxy.setOpacity(0);var b=this.getBox(false);b.callback=this.afterShow;b.scope=this;b.duration=0.25;b.easing="easeNone";b.opacity=0.5;b.block=true;this.el.setStyle("display","none");this.proxy.shift(b)},hide:function(g,e,d){if(this.activeGhost){this.hide.defer(100,this,[g,e,d]);return}if(this.hidden||this.fireEvent("beforehide",this)===false){return}if(e){this.on("hide",e,d,{single:true})}this.hidden=true;if(g!==undefined){this.setAnimateTarget(g)}if(this.animateTarget){this.animHide()}else{this.el.hide();this.afterHide()}},afterHide:function(){this.proxy.hide();if(this.monitorResize||this.modal||this.constrain||this.constrainHeader){Ext.EventManager.removeResizeListener(this.onWindowResize,this)}if(this.modal){this.mask.hide();Ext.getBody().removeClass("x-body-masked")}if(this.keyMap){this.keyMap.disable()}this.fireEvent("hide",this)},animHide:function(){this.proxy.setOpacity(0.5);this.proxy.show();var d=this.getBox(false);this.proxy.setBox(d);this.el.hide();var b=this.animateTarget.getBox();b.callback=this.afterHide;b.scope=this;b.duration=0.25;b.easing="easeNone";b.block=true;b.opacity=0;this.proxy.shift(b)},onWindowResize:function(){if(this.maximized){this.fitContainer()}if(this.modal){this.mask.setSize("100%","100%");var b=this.mask.dom.offsetHeight;this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true))}this.doConstrain()},doConstrain:function(){if(this.constrain||this.constrainHeader){var d;if(this.constrain){d={right:this.el.shadowOffset,left:this.el.shadowOffset,bottom:this.el.shadowOffset}}else{var e=this.getSize();d={right:-(e.width-100),bottom:-(e.height-25)}}var g=this.el.getConstrainToXY(this.container,true,d);if(g){this.setPosition(g[0],g[1])}}},ghost:function(e){var g=this.createGhost(e);var d=this.getBox(true);g.setLeftTop(d.x,d.y);g.setWidth(d.width);this.el.hide();this.activeGhost=g;return g},unghost:function(d,e){if(d!==false){this.el.show();this.focus();if(Ext.isMac&&Ext.isGecko){this.cascade(this.setAutoScroll)}}if(e!==false){this.setPosition(this.activeGhost.getLeft(true),this.activeGhost.getTop(true))}this.activeGhost.hide();this.activeGhost.remove();delete this.activeGhost},minimize:function(){this.fireEvent("minimize",this)},close:function(){if(this.fireEvent("beforeclose",this)!==false){this.hide(null,function(){this.fireEvent("close",this);this.destroy()},this)}},maximize:function(){if(!this.maximized){this.expand(false);this.restoreSize=this.getSize();this.restorePos=this.getPosition(true);if(this.maximizable){this.tools.maximize.hide();this.tools.restore.show()}this.maximized=true;this.el.disableShadow();if(this.dd){this.dd.lock()}if(this.collapsible){this.tools.toggle.hide()}this.el.addClass("x-window-maximized");this.container.addClass("x-window-maximized-ct");this.setPosition(0,0);this.fitContainer();this.fireEvent("maximize",this)}},restore:function(){if(this.maximized){this.el.removeClass("x-window-maximized");this.tools.restore.hide();this.tools.maximize.show();this.setPosition(this.restorePos[0],this.restorePos[1]);this.setSize(this.restoreSize.width,this.restoreSize.height);delete this.restorePos;delete this.restoreSize;this.maximized=false;this.el.enableShadow(true);if(this.dd){this.dd.unlock()}if(this.collapsible){this.tools.toggle.show()}this.container.removeClass("x-window-maximized-ct");this.doConstrain();this.fireEvent("restore",this)}},toggleMaximize:function(){this[this.maximized?"restore":"maximize"]()},fitContainer:function(){var b=this.container.getViewSize();this.setSize(b.width,b.height)},setZIndex:function(b){if(this.modal){this.mask.setStyle("z-index",b)}this.el.setZIndex(++b);b+=5;if(this.resizer){this.resizer.proxy.setStyle("z-index",++b)}this.lastZIndex=b},alignTo:function(e,g,l){var h=this.el.getAlignToXY(e,g,l);this.setPagePosition(h[0],h[1]);return this},anchorTo:function(o,l,m,g){if(this.doAnchor){Ext.EventManager.removeResizeListener(this.doAnchor,this);Ext.EventManager.un(window,"scroll",this.doAnchor,this)}this.doAnchor=function(){this.alignTo(o,l,m)};Ext.EventManager.onWindowResize(this.doAnchor,this);var h=typeof g;if(h!="undefined"){Ext.EventManager.on(window,"scroll",this.doAnchor,this,{buffer:h=="number"?g:50})}this.doAnchor();return this},toFront:function(b){if(this.manager.bringToFront(this)){if(!b||!b.getTarget().focus){this.focus()}}return this},setActive:function(b){if(b){if(!this.maximized){this.el.enableShadow(true)}this.fireEvent("activate",this)}else{this.el.disableShadow();this.fireEvent("deactivate",this)}},toBack:function(){this.manager.sendToBack(this);return this},center:function(){var b=this.el.getAlignToXY(this.container,"c-c");this.setPagePosition(b[0],b[1]);return this}});Ext.reg("window",Ext.Window);Ext.Window.DD=function(b){this.win=b;Ext.Window.DD.superclass.constructor.call(this,b.el.id,"WindowDD-"+b.id);this.setHandleElId(b.header.id);this.scroll=false};Ext.extend(Ext.Window.DD,Ext.dd.DD,{moveOnly:true,headerOffsets:[100,25],startDrag:function(){var e=this.win;this.proxy=e.ghost();if(e.constrain!==false){var g=e.el.shadowOffset;this.constrainTo(e.container,{right:g,left:g,bottom:g})}else{if(e.constrainHeader!==false){var d=this.proxy.getSize();this.constrainTo(e.container,{right:-(d.width-this.headerOffsets[0]),bottom:-(d.height-this.headerOffsets[1])})}}},b4Drag:Ext.emptyFn,onDrag:function(b){this.alignElWithMouse(this.proxy,b.getPageX(),b.getPageY())},endDrag:function(b){this.win.unghost();this.win.saveState()}});Ext.WindowGroup=function(){var p={};var r=[];var q=null;var s=function(a,b){return(!a._lastAccess||a._lastAccess<b._lastAccess)?-1:1};var o=function(){var a=r,d=a.length;if(d>0){a.sort(s);var b=a[0].manager.zseed;for(var g=0;g<d;g++){var e=a[g];if(e&&!e.hidden){e.setZIndex(b+(g*10))}}}m()};var l=function(a){if(a!=q){if(q){q.setActive(false)}q=a;if(a){a.setActive(true)}}};var m=function(){for(var a=r.length-1;a>=0;--a){if(!r[a].hidden){l(r[a]);return}}l(null)};return{zseed:9000,register:function(a){p[a.id]=a;r.push(a);a.on("hide",m)},unregister:function(a){delete p[a.id];a.un("hide",m);r.remove(a)},get:function(a){return typeof a=="object"?a:p[a]},bringToFront:function(a){a=this.get(a);if(a!=q){a._lastAccess=new Date().getTime();o();return true}return false},sendToBack:function(a){a=this.get(a);a._lastAccess=-(new Date().getTime());o();return a},hideAll:function(){for(var a in p){if(p[a]&&typeof p[a]!="function"&&p[a].isVisible()){p[a].hide()}}},getActive:function(){return q},getBy:function(a,b){var g=[];for(var d=r.length-1;d>=0;--d){var e=r[d];if(a.call(b||e,e)!==false){g.push(e)}}return g},each:function(b,d){for(var a in p){if(p[a]&&typeof p[a]!="function"){if(b.call(d||p[a],p[a])===false){return}}}}}};Ext.WindowMgr=new Ext.WindowGroup();Ext.dd.PanelProxy=function(e,d){this.panel=e;this.id=this.panel.id+"-ddproxy";Ext.apply(this,d)};Ext.dd.PanelProxy.prototype={insertProxy:true,setStatus:Ext.emptyFn,reset:Ext.emptyFn,update:Ext.emptyFn,stop:Ext.emptyFn,sync:Ext.emptyFn,getEl:function(){return this.ghost},getGhost:function(){return this.ghost},getProxy:function(){return this.proxy},hide:function(){if(this.ghost){if(this.proxy){this.proxy.remove();delete this.proxy}this.panel.el.dom.style.display="";this.ghost.remove();delete this.ghost}},show:function(){if(!this.ghost){this.ghost=this.panel.createGhost(undefined,undefined,Ext.getBody());this.ghost.setXY(this.panel.el.getXY());if(this.insertProxy){this.proxy=this.panel.el.insertSibling({cls:"x-panel-dd-spacer"});this.proxy.setSize(this.panel.getSize())}this.panel.el.dom.style.display="none"}},repair:function(d,g,e){this.hide();if(typeof g=="function"){g.call(e||this)}},moveProxy:function(e,d){if(this.proxy){e.insertBefore(this.proxy.dom,d)}}};Ext.Panel.DD=function(d,e){this.panel=d;this.dragData={panel:d};this.proxy=new Ext.dd.PanelProxy(d,e);Ext.Panel.DD.superclass.constructor.call(this,d.el,e);var g=d.header;if(g){this.setHandleElId(g.id)}(g?g:this.panel.body).setStyle("cursor","move");this.scroll=false};Ext.extend(Ext.Panel.DD,Ext.dd.DragSource,{showFrame:Ext.emptyFn,startDrag:Ext.emptyFn,b4StartDrag:function(e,d){this.proxy.show()},b4MouseDown:function(d){var e=d.getPageX();var g=d.getPageY();this.autoOffset(e,g)},onInitDrag:function(e,d){this.onStartDrag(e,d);return true},createFrame:Ext.emptyFn,getDragEl:function(b){return this.proxy.ghost.dom},endDrag:function(b){this.proxy.hide();this.panel.saveState()},autoOffset:function(e,d){e-=this.startPageX;d-=this.startPageY;this.setDelta(e,d)}});Ext.state.Provider=function(){this.addEvents("statechange");this.state={};Ext.state.Provider.superclass.constructor.call(this)};Ext.extend(Ext.state.Provider,Ext.util.Observable,{get:function(d,e){return typeof this.state[d]=="undefined"?e:this.state[d]},clear:function(b){delete this.state[b];this.fireEvent("statechange",this,b,null)},set:function(e,d){this.state[e]=d;this.fireEvent("statechange",this,e,d)},decodeValue:function(z){var o=/^(a|n|d|b|s|o)\:(.*)$/;var v=o.exec(unescape(z));if(!v||!v[1]){return}var s=v[1];var q=v[2];switch(s){case"n":return parseFloat(q);case"d":return new Date(Date.parse(q));case"b":return(q=="1");case"a":var r=[];var p=q.split("^");for(var w=0,u=p.length;w<u;w++){r.push(this.decodeValue(p[w]))}return r;case"o":var r={};var p=q.split("^");for(var w=0,u=p.length;w<u;w++){var t=p[w].split("=");r[t[0]]=this.decodeValue(t[1])}return r;default:return q}},encodeValue:function(q){var h;if(typeof q=="number"){h="n:"+q}else{if(typeof q=="boolean"){h="b:"+(q?"1":"0")}else{if(Ext.isDate(q)){h="d:"+q.toGMTString()}else{if(Ext.isArray(q)){var m="";for(var o=0,l=q.length;o<l;o++){m+=this.encodeValue(q[o]);if(o!=l-1){m+="^"}}h="a:"+m}else{if(typeof q=="object"){var m="";for(var p in q){if(typeof q[p]!="function"&&q[p]!==undefined){m+=p+"="+this.encodeValue(q[p])+"^"}}h="o:"+m.substring(0,m.length-1)}else{h="s:"+q}}}}}return escape(h)}});Ext.state.Manager=function(){var b=new Ext.state.Provider();return{setProvider:function(a){b=a},get:function(d,a){return b.get(d,a)},set:function(a,d){b.set(a,d)},clear:function(a){b.clear(a)},getProvider:function(){return b}}}();Ext.state.CookieProvider=function(b){Ext.state.CookieProvider.superclass.constructor.call(this);this.path="/";this.expires=new Date(new Date().getTime()+(1000*60*60*24*7));this.domain=null;this.secure=false;Ext.apply(this,b);this.state=this.readCookies()};Ext.extend(Ext.state.CookieProvider,Ext.state.Provider,{set:function(e,d){if(typeof d=="undefined"||d===null){this.clear(e);return}this.setCookie(e,d);Ext.state.CookieProvider.superclass.set.call(this,e,d)},clear:function(b){this.clearCookie(b);Ext.state.CookieProvider.superclass.clear.call(this,b)},readCookies:function(){var r={};var o=document.cookie+";";var l=/\s?(.*?)=(.*?);/g;var p;while((p=l.exec(o))!=null){var m=p[1];var q=p[2];if(m&&m.substring(0,3)=="ys-"){r[m.substr(3)]=this.decodeValue(q)}}return r},setCookie:function(e,d){document.cookie="ys-"+e+"="+this.encodeValue(d)+((this.expires==null)?"":("; expires="+this.expires.toGMTString()))+((this.path==null)?"":("; path="+this.path))+((this.domain==null)?"":("; domain="+this.domain))+((this.secure==true)?"; secure":"")},clearCookie:function(b){document.cookie="ys-"+b+"=null; expires=Thu, 01-Jan-70 00:00:01 GMT"+((this.path==null)?"":("; path="+this.path))+((this.domain==null)?"":("; domain="+this.domain))+((this.secure==true)?"; secure":"")}});Ext.DataView=Ext.extend(Ext.BoxComponent,{selectedClass:"x-view-selected",emptyText:"",deferEmptyText:true,trackOver:false,last:false,initComponent:function(){Ext.DataView.superclass.initComponent.call(this);if(typeof this.tpl=="string"){this.tpl=new Ext.XTemplate(this.tpl)}this.addEvents("beforeclick","click","mouseenter","mouseleave","containerclick","dblclick","contextmenu","selectionchange","beforeselect");this.all=new Ext.CompositeElementLite();this.selected=new Ext.CompositeElementLite()},onRender:function(){if(!this.el){this.el=document.createElement("div");this.el.id=this.id}Ext.DataView.superclass.onRender.apply(this,arguments)},afterRender:function(){Ext.DataView.superclass.afterRender.call(this);this.el.on({click:this.onClick,dblclick:this.onDblClick,contextmenu:this.onContextMenu,scope:this});if(this.overClass||this.trackOver){this.el.on({mouseover:this.onMouseOver,mouseout:this.onMouseOut,scope:this})}if(this.store){this.setStore(this.store,true)}},refresh:function(){this.clearSelections(false,true);this.el.update("");var b=this.store.getRange();if(b.length<1){if(!this.deferEmptyText||this.hasSkippedEmptyText){this.el.update(this.emptyText)}this.hasSkippedEmptyText=true;this.all.clear();return}this.tpl.overwrite(this.el,this.collectData(b,0));this.all.fill(Ext.query(this.itemSelector,this.el.dom));this.updateIndexes(0)},prepareData:function(b){return b},collectData:function(g,l){var m=[];for(var o=0,h=g.length;o<h;o++){m[m.length]=this.prepareData(g[o].data,l+o,g[o])}return m},bufferRender:function(e){var d=document.createElement("div");this.tpl.overwrite(d,this.collectData(e));return Ext.query(this.itemSelector,d)},onUpdate:function(m,l){var h=this.store.indexOf(l);var o=this.isSelected(h);var q=this.all.elements[h];var p=this.bufferRender([l],h)[0];this.all.replaceElement(h,p,true);if(o){this.selected.replaceElement(q,p);this.all.item(h).addClass(this.selectedClass)}this.updateIndexes(h,h)},onAdd:function(m,p,o){if(this.all.getCount()==0){this.refresh();return}var q=this.bufferRender(p,o),l,a=this.all.elements;if(o<this.all.getCount()){l=this.all.item(o).insertSibling(q,"before",true);a.splice.apply(a,[o,0].concat(q))}else{l=this.all.last().insertSibling(q,"after",true);a.push.apply(a,q)}this.updateIndexes(o)},onRemove:function(g,e,d){this.deselect(d);this.all.removeElement(d,true);this.updateIndexes(d)},refreshNode:function(b){this.onUpdate(this.store,this.store.getAt(b))},updateIndexes:function(h,l){var e=this.all.elements;h=h||0;l=l||((l===0)?0:(e.length-1));for(var g=h;g<=l;g++){e[g].viewIndex=g}},getStore:function(){return this.store},setStore:function(e,d){if(!d&&this.store){this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("datachanged",this.refresh,this);this.store.un("add",this.onAdd,this);this.store.un("remove",this.onRemove,this);this.store.un("update",this.onUpdate,this);this.store.un("clear",this.refresh,this)}if(e){e=Ext.StoreMgr.lookup(e);e.on("beforeload",this.onBeforeLoad,this);e.on("datachanged",this.refresh,this);e.on("add",this.onAdd,this);e.on("remove",this.onRemove,this);e.on("update",this.onUpdate,this);e.on("clear",this.refresh,this)}this.store=e;if(e){this.refresh()}},findItemFromChild:function(b){return Ext.fly(b).findParent(this.itemSelector,this.el)},onClick:function(g){var d=g.getTarget(this.itemSelector,this.el);if(d){var e=this.indexOf(d);if(this.onItemClick(d,e,g)!==false){this.fireEvent("click",this,e,d,g)}}else{if(this.fireEvent("containerclick",this,g)!==false){this.clearSelections()}}},onContextMenu:function(d){var e=d.getTarget(this.itemSelector,this.el);if(e){this.fireEvent("contextmenu",this,this.indexOf(e),e,d)}},onDblClick:function(d){var e=d.getTarget(this.itemSelector,this.el);if(e){this.fireEvent("dblclick",this,this.indexOf(e),e,d)}},onMouseOver:function(d){var e=d.getTarget(this.itemSelector,this.el);if(e&&e!==this.lastItem){this.lastItem=e;Ext.fly(e).addClass(this.overClass);this.fireEvent("mouseenter",this,this.indexOf(e),e,d)}},onMouseOut:function(b){if(this.lastItem){if(!b.within(this.lastItem,true,true)){Ext.fly(this.lastItem).removeClass(this.overClass);this.fireEvent("mouseleave",this,this.indexOf(this.lastItem),this.lastItem,b);delete this.lastItem}}},onItemClick:function(d,e,g){if(this.fireEvent("beforeclick",this,e,d,g)===false){return false}if(this.multiSelect){this.doMultiSelection(d,e,g);g.preventDefault()}else{if(this.singleSelect){this.doSingleSelection(d,e,g);g.preventDefault()}}return true},doSingleSelection:function(d,e,g){if(g.ctrlKey&&this.isSelected(e)){this.deselect(e)}else{this.select(e,false)}},doMultiSelection:function(l,g,h){if(h.shiftKey&&this.last!==false){var e=this.last;this.selectRange(e,g,h.ctrlKey);this.last=e}else{if((h.ctrlKey||this.simpleSelect)&&this.isSelected(g)){this.deselect(g)}else{this.select(g,h.ctrlKey||h.shiftKey||this.simpleSelect)}}},getSelectionCount:function(){return this.selected.getCount()},getSelectedNodes:function(){return this.selected.elements},getSelectedIndexes:function(){var e=[],h=this.selected.elements;for(var l=0,g=h.length;l<g;l++){e.push(h[l].viewIndex)}return e},getSelectedRecords:function(){var h=[],l=this.selected.elements;for(var e=0,g=l.length;e<g;e++){h[h.length]=this.store.getAt(l[e].viewIndex)}return h},getRecords:function(g){var l=[],m=g;for(var o=0,h=m.length;o<h;o++){l[l.length]=this.store.getAt(m[o].viewIndex)}return l},getRecord:function(b){return this.store.getAt(b.viewIndex)},clearSelections:function(e,d){if((this.multiSelect||this.singleSelect)&&this.selected.getCount()>0){if(!d){this.selected.removeClass(this.selectedClass)}this.selected.clear();this.last=false;if(!e){this.fireEvent("selectionchange",this,this.selected.elements)}}},isSelected:function(b){return this.selected.contains(this.getNode(b))},deselect:function(b){if(this.isSelected(b)){b=this.getNode(b);this.selected.removeElement(b);if(this.last==b.viewIndex){this.last=false}Ext.fly(b).removeClass(this.selectedClass);this.fireEvent("selectionchange",this,this.selected.elements)}},select:function(p,m,h){if(Ext.isArray(p)){if(!m){this.clearSelections(true)}for(var q=0,l=p.length;q<l;q++){this.select(p[q],true,true)}if(!h){this.fireEvent("selectionchange",this,this.selected.elements)}}else{var o=this.getNode(p);if(!m){this.clearSelections(true)}if(o&&!this.isSelected(o)){if(this.fireEvent("beforeselect",this,o,this.selected.elements)!==false){Ext.fly(o).addClass(this.selectedClass);this.selected.add(o);this.last=o.viewIndex;if(!h){this.fireEvent("selectionchange",this,this.selected.elements)}}}}},selectRange:function(g,e,d){if(!d){this.clearSelections(true)}this.select(this.getNodes(g,e),true)},getNode:function(b){if(typeof b=="string"){return document.getElementById(b)}else{if(typeof b=="number"){return this.all.elements[b]}}return b},getNodes:function(l,h){var m=this.all.elements;l=l||0;h=typeof h=="undefined"?Math.max(m.length-1,0):h;var g=[],o;if(l<=h){for(o=l;o<=h&&m[o];o++){g.push(m[o])}}else{for(o=l;o>=h&&m[o];o--){g.push(m[o])}}return g},indexOf:function(b){b=this.getNode(b);if(typeof b.viewIndex=="number"){return b.viewIndex}return this.all.indexOf(b)},onBeforeLoad:function(){if(this.loadingText){this.clearSelections(false,true);this.el.update('<div class="loading-indicator">'+this.loadingText+"</div>");this.all.clear()}},onDestroy:function(){Ext.DataView.superclass.onDestroy.call(this);this.setStore(null)}});Ext.reg("dataview",Ext.DataView);Ext.ColorPalette=function(b){Ext.ColorPalette.superclass.constructor.call(this,b);this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope,true)}};Ext.extend(Ext.ColorPalette,Ext.Component,{itemCls:"x-color-palette",value:null,clickEvent:"click",ctype:"Ext.ColorPalette",allowReselect:false,colors:["000000","993300","333300","003300","003366","000080","333399","333333","800000","FF6600","808000","008000","008080","0000FF","666699","808080","FF0000","FF9900","99CC00","339966","33CCCC","3366FF","800080","969696","FF00FF","FFCC00","FFFF00","00FF00","00FFFF","00CCFF","993366","C0C0C0","FF99CC","FFCC99","FFFF99","CCFFCC","CCFFFF","99CCFF","CC99FF","FFFFFF"],onRender:function(e,g){var l=this.tpl||new Ext.XTemplate('<tpl for="."><a href="#" class="color-{.}" hidefocus="on"><em><span style="background:#{.}" unselectable="on">&#160;</span></em></a></tpl>');var h=document.createElement("div");h.id=this.getId();h.className=this.itemCls;l.overwrite(h,this.colors);e.dom.insertBefore(h,g);this.el=Ext.get(h);this.el.on(this.clickEvent,this.handleClick,this,{delegate:"a"});if(this.clickEvent!="click"){this.el.on("click",Ext.emptyFn,this,{delegate:"a",preventDefault:true})}},afterRender:function(){Ext.ColorPalette.superclass.afterRender.call(this);if(this.value){var b=this.value;this.value=null;this.select(b)}},handleClick:function(e,g){e.preventDefault();if(!this.disabled){var h=g.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];this.select(h.toUpperCase())}},select:function(e){e=e.replace("#","");if(e!=this.value||this.allowReselect){var d=this.el;if(this.value){d.child("a.color-"+this.value).removeClass("x-color-palette-sel")}d.child("a.color-"+e).addClass("x-color-palette-sel");this.value=e;this.fireEvent("select",this,e)}}});Ext.reg("colorpalette",Ext.ColorPalette);Ext.DatePicker=Ext.extend(Ext.Component,{todayText:"Today",okText:"&#160;OK&#160;",cancelText:"Cancel",todayTip:"{0} (Spacebar)",minText:"This date is before the minimum date",maxText:"This date is after the maximum date",format:"m/d/y",disabledDaysText:"Disabled",disabledDatesText:"Disabled",constrainToViewport:true,monthNames:Date.monthNames,dayNames:Date.dayNames,nextText:"Next Month (Control+Right)",prevText:"Previous Month (Control+Left)",monthYearText:"Choose a month (Control+Up/Down to move years)",startDay:0,showToday:true,initComponent:function(){Ext.DatePicker.superclass.initComponent.call(this);this.value=this.value?this.value.clearTime():new Date().clearTime();this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope||this)}this.initDisabledDays()},initDisabledDays:function(){if(!this.disabledDatesRE&&this.disabledDates){var e=this.disabledDates;var g="(?:";for(var d=0;d<e.length;d++){g+=e[d];if(d!=e.length-1){g+="|"}}this.disabledDatesRE=new RegExp(g+")")}},setDisabledDates:function(b){if(Ext.isArray(b)){this.disabledDates=b;this.disabledDatesRE=null}else{this.disabledDatesRE=b}this.initDisabledDays();this.update(this.value,true)},setDisabledDays:function(b){this.disabledDays=b;this.update(this.value,true)},setMinDate:function(b){this.minDate=b;this.update(this.value,true)},setMaxDate:function(b){this.maxDate=b;this.update(this.value,true)},setValue:function(d){var e=this.value;this.value=d.clearTime(true);if(this.el){this.update(this.value)}},getValue:function(){return this.value},focus:function(){if(this.el){this.update(this.activeDate)}},onRender:function(u,p){var s=['<table cellspacing="0">','<tr><td class="x-date-left"><a href="#" title="',this.prevText,'">&#160;</a></td><td class="x-date-middle" align="center"></td><td class="x-date-right"><a href="#" title="',this.nextText,'">&#160;</a></td></tr>','<tr><td colspan="3"><table class="x-date-inner" cellspacing="0"><thead><tr>'];var q=this.dayNames;for(var r=0;r<7;r++){var o=this.startDay+r;if(o>6){o=o-7}s.push("<th><span>",q[o].substr(0,1),"</span></th>")}s[s.length]="</tr></thead><tbody><tr>";for(var r=0;r<42;r++){if(r%7==0&&r!=0){s[s.length]="</tr><tr>"}s[s.length]='<td><a href="#" hidefocus="on" class="x-date-date" tabIndex="1"><em><span></span></em></a></td>'}s.push("</tr></tbody></table></td></tr>",this.showToday?'<tr><td colspan="3" class="x-date-bottom" align="center"></td></tr>':"",'</table><div class="x-date-mp"></div>');var t=document.createElement("div");t.className="x-date-picker";t.innerHTML=s.join("");u.dom.insertBefore(t,p);this.el=Ext.get(t);this.eventEl=Ext.get(t.firstChild);this.leftClickRpt=new Ext.util.ClickRepeater(this.el.child("td.x-date-left a"),{handler:this.showPrevMonth,scope:this,preventDefault:true,stopDefault:true});this.rightClickRpt=new Ext.util.ClickRepeater(this.el.child("td.x-date-right a"),{handler:this.showNextMonth,scope:this,preventDefault:true,stopDefault:true});this.eventEl.on("mousewheel",this.handleMouseWheel,this);this.monthPicker=this.el.down("div.x-date-mp");this.monthPicker.enableDisplayMode("block");var d=new Ext.KeyNav(this.eventEl,{left:function(a){a.ctrlKey?this.showPrevMonth():this.update(this.activeDate.add("d",-1))},right:function(a){a.ctrlKey?this.showNextMonth():this.update(this.activeDate.add("d",1))},up:function(a){a.ctrlKey?this.showNextYear():this.update(this.activeDate.add("d",-7))},down:function(a){a.ctrlKey?this.showPrevYear():this.update(this.activeDate.add("d",7))},pageUp:function(a){this.showNextMonth()},pageDown:function(a){this.showPrevMonth()},enter:function(a){a.stopPropagation();return true},scope:this});this.eventEl.on("click",this.handleDateClick,this,{delegate:"a.x-date-date"});this.el.unselectable();this.cells=this.el.select("table.x-date-inner tbody td");this.textNodes=this.el.query("table.x-date-inner tbody span");this.mbtn=new Ext.Button({text:"&#160;",tooltip:this.monthYearText,renderTo:this.el.child("td.x-date-middle",true)});this.mbtn.on("click",this.showMonthPicker,this);this.mbtn.el.child(this.mbtn.menuClassTarget).addClass("x-btn-with-menu");if(this.showToday){this.todayKeyListener=this.eventEl.addKeyListener(Ext.EventObject.SPACE,this.selectToday,this);var m=(new Date()).dateFormat(this.format);this.todayBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom",true),text:String.format(this.todayText,m),tooltip:String.format(this.todayTip,m),handler:this.selectToday,scope:this})}if(Ext.isIE){this.el.repaint()}this.update(this.value)},createMonthPicker:function(){if(!this.monthPicker.dom.firstChild){var e=['<table border="0" cellspacing="0">'];for(var d=0;d<6;d++){e.push('<tr><td class="x-date-mp-month"><a href="#">',this.monthNames[d].substr(0,3),"</a></td>",'<td class="x-date-mp-month x-date-mp-sep"><a href="#">',this.monthNames[d+6].substr(0,3),"</a></td>",d==0?'<td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-prev"></a></td><td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-next"></a></td></tr>':'<td class="x-date-mp-year"><a href="#"></a></td><td class="x-date-mp-year"><a href="#"></a></td></tr>')}e.push('<tr class="x-date-mp-btns"><td colspan="4"><button type="button" class="x-date-mp-ok">',this.okText,'</button><button type="button" class="x-date-mp-cancel">',this.cancelText,"</button></td></tr>","</table>");this.monthPicker.update(e.join(""));this.monthPicker.on("click",this.onMonthClick,this);this.monthPicker.on("dblclick",this.onMonthDblClick,this);this.mpMonths=this.monthPicker.select("td.x-date-mp-month");this.mpYears=this.monthPicker.select("td.x-date-mp-year");this.mpMonths.each(function(g,b,a){a+=1;if((a%2)==0){g.dom.xmonth=5+Math.round(a*0.5)}else{g.dom.xmonth=Math.round((a-1)*0.5)}})}},showMonthPicker:function(){this.createMonthPicker();var b=this.el.getSize();this.monthPicker.setSize(b);this.monthPicker.child("table").setSize(b);this.mpSelMonth=(this.activeDate||this.value).getMonth();this.updateMPMonth(this.mpSelMonth);this.mpSelYear=(this.activeDate||this.value).getFullYear();this.updateMPYear(this.mpSelYear);this.monthPicker.slideIn("t",{duration:0.2})},updateMPYear:function(l){this.mpyear=l;var o=this.mpYears.elements;for(var g=1;g<=10;g++){var m=o[g-1],h;if((g%2)==0){h=l+Math.round(g*0.5);m.firstChild.innerHTML=h;m.xyear=h}else{h=l-(5-Math.round(g*0.5));m.firstChild.innerHTML=h;m.xyear=h}this.mpYears.item(g-1)[h==this.mpSelYear?"addClass":"removeClass"]("x-date-mp-sel")}},updateMPMonth:function(b){this.mpMonths.each(function(a,g,e){a[a.dom.xmonth==b?"addClass":"removeClass"]("x-date-mp-sel")})},selectMPMonth:function(b){},onMonthClick:function(m,d){m.stopEvent();var o=new Ext.Element(d),e;if(o.is("button.x-date-mp-cancel")){this.hideMonthPicker()}else{if(o.is("button.x-date-mp-ok")){var l=new Date(this.mpSelYear,this.mpSelMonth,(this.activeDate||this.value).getDate());if(l.getMonth()!=this.mpSelMonth){l=new Date(this.mpSelYear,this.mpSelMonth,1).getLastDateOfMonth()}this.update(l);this.hideMonthPicker()}else{if(e=o.up("td.x-date-mp-month",2)){this.mpMonths.removeClass("x-date-mp-sel");e.addClass("x-date-mp-sel");this.mpSelMonth=e.dom.xmonth}else{if(e=o.up("td.x-date-mp-year",2)){this.mpYears.removeClass("x-date-mp-sel");e.addClass("x-date-mp-sel");this.mpSelYear=e.dom.xyear}else{if(o.is("a.x-date-mp-prev")){this.updateMPYear(this.mpyear-10)}else{if(o.is("a.x-date-mp-next")){this.updateMPYear(this.mpyear+10)}}}}}}},onMonthDblClick:function(h,e){h.stopEvent();var l=new Ext.Element(e),g;if(g=l.up("td.x-date-mp-month",2)){this.update(new Date(this.mpSelYear,g.dom.xmonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}else{if(g=l.up("td.x-date-mp-year",2)){this.update(new Date(g.dom.xyear,this.mpSelMonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}}},hideMonthPicker:function(b){if(this.monthPicker){if(b===true){this.monthPicker.hide()}else{this.monthPicker.slideOut("t",{duration:0.2})}}},showPrevMonth:function(b){this.update(this.activeDate.add("mo",-1))},showNextMonth:function(b){this.update(this.activeDate.add("mo",1))},showPrevYear:function(){this.update(this.activeDate.add("y",-1))},showNextYear:function(){this.update(this.activeDate.add("y",1))},handleMouseWheel:function(e){var d=e.getWheelDelta();if(d>0){this.showPrevMonth();e.stopEvent()}else{if(d<0){this.showNextMonth();e.stopEvent()}}},handleDateClick:function(d,e){d.stopEvent();if(e.dateValue&&!Ext.fly(e.parentNode).hasClass("x-date-disabled")){this.setValue(new Date(e.dateValue));this.fireEvent("select",this,this.value)}},selectToday:function(){if(this.todayBtn&&!this.todayBtn.disabled){this.setValue(new Date().clearTime());this.fireEvent("select",this,this.value)}},update:function(M,Y){var am=this.activeDate;this.activeDate=M;if(!Y&&am&&this.el){var ab=M.getTime();if(am.getMonth()==M.getMonth()&&am.getFullYear()==M.getFullYear()){this.cells.removeClass("x-date-selected");this.cells.each(function(a){if(a.dom.firstChild.dateValue==ab){a.addClass("x-date-selected");setTimeout(function(){try{a.dom.firstChild.focus()}catch(b){}},50);return false}});return}}var af=M.getDaysInMonth();var Z=M.getFirstDateOfMonth();var ai=Z.getDay()-this.startDay;if(ai<=this.startDay){ai+=7}var V=M.add("mo",-1);var ah=V.getDaysInMonth()-ai;var aj=this.cells.elements;var W=this.textNodes;af+=ai;var w=86400000;var S=(new Date(V.getFullYear(),V.getMonth(),ah)).clearTime();var U=new Date().clearTime().getTime();var O=M.clearTime().getTime();var Q=this.minDate?this.minDate.clearTime():Number.NEGATIVE_INFINITY;var d=this.maxDate?this.maxDate.clearTime():Number.POSITIVE_INFINITY;var N=this.disabledDatesRE;var T=this.disabledDatesText;var t=this.disabledDays?this.disabledDays.join(""):false;var P=this.disabledDaysText;var aa=this.format;if(this.showToday){var ad=new Date().clearTime();var ak=(ad<Q||ad>d||(N&&aa&&N.test(ad.dateFormat(aa)))||(t&&t.indexOf(ad.getDay())!=-1));this.todayBtn.setDisabled(ak);this.todayKeyListener[ak?"disable":"enable"]()}var ae=function(b,g){g.title="";var e=S.getTime();g.firstChild.dateValue=e;if(e==U){g.className+=" x-date-today";g.title=b.todayText}if(e==O){g.className+=" x-date-selected";setTimeout(function(){try{g.firstChild.focus()}catch(h){}},50)}if(e<Q){g.className=" x-date-disabled";g.title=b.minText;return}if(e>d){g.className=" x-date-disabled";g.title=b.maxText;return}if(t){if(t.indexOf(S.getDay())!=-1){g.title=P;g.className=" x-date-disabled"}}if(N&&aa){var a=S.dateFormat(aa);if(N.test(a)){g.title=T.replace("%0",a);g.className=" x-date-disabled"}}};var L=0;for(;L<ai;L++){W[L].innerHTML=(++ah);S.setDate(S.getDate()+1);aj[L].className="x-date-prevday";ae(this,aj[L])}for(;L<af;L++){var al=L-ai+1;W[L].innerHTML=(al);S.setDate(S.getDate()+1);aj[L].className="x-date-active";ae(this,aj[L])}var K=0;for(;L<42;L++){W[L].innerHTML=(++K);S.setDate(S.getDate()+1);aj[L].className="x-date-nextday";ae(this,aj[L])}this.mbtn.setText(this.monthNames[M.getMonth()]+" "+M.getFullYear());if(!this.internalRender){var ag=this.el.dom.firstChild;var ac=ag.offsetWidth;this.el.setWidth(ac+this.el.getBorderWidth("lr"));Ext.fly(ag).setWidth(ac);this.internalRender=true;if(Ext.isOpera&&!this.secondPass){ag.rows[0].cells[1].style.width=(ac-(ag.rows[0].cells[0].offsetWidth+ag.rows[0].cells[2].offsetWidth))+"px";this.secondPass=true;this.update.defer(10,this,[M])}}},beforeDestroy:function(){if(this.rendered){Ext.destroy(this.leftClickRpt,this.rightClickRpt,this.monthPicker,this.eventEl,this.mbtn,this.todayBtn)}}});Ext.reg("datepicker",Ext.DatePicker);Ext.TabPanel=Ext.extend(Ext.Panel,{monitorResize:true,deferredRender:true,tabWidth:120,minTabWidth:30,resizeTabs:false,enableTabScroll:false,scrollIncrement:0,scrollRepeatInterval:400,scrollDuration:0.35,animScroll:true,tabPosition:"top",baseCls:"x-tab-panel",autoTabs:false,autoTabSelector:"div.x-tab",activeTab:null,tabMargin:2,plain:false,wheelIncrement:20,idDelimiter:"__",itemCls:"x-tab-item",elements:"body",headerAsText:false,frame:false,hideBorders:true,initComponent:function(){this.frame=false;Ext.TabPanel.superclass.initComponent.call(this);this.addEvents("beforetabchange","tabchange","contextmenu");this.setLayout(new Ext.layout.CardLayout({deferredRender:this.deferredRender}));if(this.tabPosition=="top"){this.elements+=",header";this.stripTarget="header"}else{this.elements+=",footer";this.stripTarget="footer"}if(!this.stack){this.stack=Ext.TabPanel.AccessStack()}this.initItems()},render:function(){Ext.TabPanel.superclass.render.apply(this,arguments);if(this.activeTab!==undefined){var b=this.activeTab;delete this.activeTab;this.setActiveTab(b)}},onRender:function(q,l){Ext.TabPanel.superclass.onRender.call(this,q,l);if(this.plain){var m=this.tabPosition=="top"?"header":"footer";this[m].addClass("x-tab-panel-"+m+"-plain")}var h=this[this.stripTarget];this.stripWrap=h.createChild({cls:"x-tab-strip-wrap",cn:{tag:"ul",cls:"x-tab-strip x-tab-strip-"+this.tabPosition}});var o=(this.tabPosition=="bottom"?this.stripWrap:null);this.stripSpacer=h.createChild({cls:"x-tab-strip-spacer"},o);this.strip=new Ext.Element(this.stripWrap.dom.firstChild);this.edge=this.strip.createChild({tag:"li",cls:"x-tab-edge"});this.strip.createChild({cls:"x-clear"});this.body.addClass("x-tab-panel-body-"+this.tabPosition);if(!this.itemTpl){var p=new Ext.Template('<li class="{cls}" id="{id}"><a class="x-tab-strip-close" onclick="return false;"></a>','<a class="x-tab-right" href="#" onclick="return false;"><em class="x-tab-left">','<span class="x-tab-strip-inner"><span class="x-tab-strip-text {iconCls}">{text}</span></span>',"</em></a></li>");p.disableFormats=true;p.compile();Ext.TabPanel.prototype.itemTpl=p}this.items.each(this.initTab,this)},afterRender:function(){Ext.TabPanel.superclass.afterRender.call(this);if(this.autoTabs){this.readTabs(false)}},initEvents:function(){Ext.TabPanel.superclass.initEvents.call(this);this.on("add",this.onAdd,this);this.on("remove",this.onRemove,this);this.strip.on("mousedown",this.onStripMouseDown,this);this.strip.on("contextmenu",this.onStripContextMenu,this);if(this.enableTabScroll){this.strip.on("mousewheel",this.onWheel,this)}},findTargets:function(g){var d=null;var e=g.getTarget("li",this.strip);if(e){d=this.getComponent(e.id.split(this.idDelimiter)[1]);if(d.disabled){return{close:null,item:null,el:null}}}return{close:g.getTarget(".x-tab-strip-close",this.strip),item:d,el:e}},onStripMouseDown:function(d){if(d.button!=0){return}d.preventDefault();var e=this.findTargets(d);if(e.close){this.remove(e.item);return}if(e.item&&e.item!=this.activeTab){this.setActiveTab(e.item)}},onStripContextMenu:function(d){d.preventDefault();var e=this.findTargets(d);if(e.item){this.fireEvent("contextmenu",this,e.item,d)}},readTabs:function(p){if(p===true){this.items.each(function(a){this.remove(a)},this)}var q=this.el.query(this.autoTabSelector);for(var h=0,l=q.length;h<l;h++){var o=q[h];var m=o.getAttribute("title");o.removeAttribute("title");this.add({title:m,el:o})}},initTab:function(p,h){var o=this.strip.dom.childNodes[h];var l=p.closable?"x-tab-strip-closable":"";if(p.disabled){l+=" x-item-disabled"}if(p.iconCls){l+=" x-tab-with-icon"}if(p.tabCls){l+=" "+p.tabCls}var m={id:this.id+this.idDelimiter+p.getItemId(),text:p.title,cls:l,iconCls:p.iconCls||""};var q=o?this.itemTpl.insertBefore(o,m):this.itemTpl.append(this.strip,m);Ext.fly(q).addClassOnOver("x-tab-strip-over");if(p.tabTip){Ext.fly(q).child("span.x-tab-strip-text",true).qtip=p.tabTip}p.tabEl=q;p.on("disable",this.onItemDisabled,this);p.on("enable",this.onItemEnabled,this);p.on("titlechange",this.onItemTitleChanged,this);p.on("iconchange",this.onItemIconChanged,this);p.on("beforeshow",this.onBeforeShowItem,this)},onAdd:function(g,d,e){this.initTab(d,e);if(this.items.getCount()==1){this.syncSize()}this.delegateUpdates()},onBeforeAdd:function(d){var e=d.events?(this.items.containsKey(d.getItemId())?d:null):this.items.get(d);if(e){this.setActiveTab(d);return false}Ext.TabPanel.superclass.onBeforeAdd.apply(this,arguments);var g=d.elements;d.elements=g?g.replace(",header",""):g;d.border=(d.border===true)},onRemove:function(g,d){Ext.destroy(Ext.get(this.getTabEl(d)));this.stack.remove(d);d.un("disable",this.onItemDisabled,this);d.un("enable",this.onItemEnabled,this);d.un("titlechange",this.onItemTitleChanged,this);d.un("iconchange",this.onItemIconChanged,this);d.un("beforeshow",this.onBeforeShowItem,this);if(d==this.activeTab){var e=this.stack.next();if(e){this.setActiveTab(e)}else{if(this.items.getCount()>0){this.setActiveTab(0)}else{this.activeTab=null}}}this.delegateUpdates()},onBeforeShowItem:function(b){if(b!=this.activeTab){this.setActiveTab(b);return false}},onItemDisabled:function(d){var e=this.getTabEl(d);if(e){Ext.fly(e).addClass("x-item-disabled")}this.stack.remove(d)},onItemEnabled:function(d){var e=this.getTabEl(d);if(e){Ext.fly(e).removeClass("x-item-disabled")}},onItemTitleChanged:function(d){var e=this.getTabEl(d);if(e){Ext.fly(e).child("span.x-tab-strip-text",true).innerHTML=d.title}},onItemIconChanged:function(h,g,l){var e=this.getTabEl(h);if(e){Ext.fly(e).child("span.x-tab-strip-text").replaceClass(l,g)}},getTabEl:function(e){var d=(typeof e==="number")?this.items.items[e].getItemId():e.getItemId();return document.getElementById(this.id+this.idDelimiter+d)},onResize:function(){Ext.TabPanel.superclass.onResize.apply(this,arguments);this.delegateUpdates()},beginUpdate:function(){this.suspendUpdates=true},endUpdate:function(){this.suspendUpdates=false;this.delegateUpdates()},hideTabStripItem:function(d){d=this.getComponent(d);var e=this.getTabEl(d);if(e){e.style.display="none";this.delegateUpdates()}this.stack.remove(d)},unhideTabStripItem:function(d){d=this.getComponent(d);var e=this.getTabEl(d);if(e){e.style.display="";this.delegateUpdates()}},delegateUpdates:function(){if(this.suspendUpdates){return}if(this.resizeTabs&&this.rendered){this.autoSizeTabs()}if(this.enableTabScroll&&this.rendered){this.autoScrollTabs()}},autoSizeTabs:function(){var u=this.items.length;var C=this.tabPosition!="bottom"?"header":"footer";var B=this[C].dom.offsetWidth;var D=this[C].dom.clientWidth;if(!this.resizeTabs||u<1||!D){return}var s=Math.max(Math.min(Math.floor((D-4)/u)-this.tabMargin,this.tabWidth),this.minTabWidth);this.lastTabWidth=s;var q=this.stripWrap.dom.getElementsByTagName("li");for(var w=0,t=q.length-1;w<t;w++){var r=q[w];var p=r.childNodes[1].firstChild.firstChild;var v=r.offsetWidth;var z=p.offsetWidth;p.style.width=(s-(v-z))+"px"}},adjustBodyWidth:function(b){if(this.header){this.header.setWidth(b)}if(this.footer){this.footer.setWidth(b)}return b},setActiveTab:function(g){g=this.getComponent(g);if(!g||this.fireEvent("beforetabchange",this,g,this.activeTab)===false){return}if(!this.rendered){this.activeTab=g;return}if(this.activeTab!=g){if(this.activeTab){var e=this.getTabEl(this.activeTab);if(e){Ext.fly(e).removeClass("x-tab-strip-active")}this.activeTab.fireEvent("deactivate",this.activeTab)}var d=this.getTabEl(g);Ext.fly(d).addClass("x-tab-strip-active");this.activeTab=g;this.stack.add(g);this.layout.setActiveItem(g);if(this.layoutOnTabChange&&g.doLayout){g.doLayout()}if(this.scrolling){this.scrollToTab(g,this.animScroll)}g.fireEvent("activate",g);this.fireEvent("tabchange",this,g)}},getActiveTab:function(){return this.activeTab||null},getItem:function(b){return this.getComponent(b)},autoScrollTabs:function(){this.pos=this.tabPosition=="bottom"?this.footer:this.header;var p=this.items.length;var s=this.pos.dom.offsetWidth;var t=this.pos.dom.clientWidth;var q=this.stripWrap;var r=q.dom;var l=r.offsetWidth;var o=this.getScrollPos();var m=this.edge.getOffsetsTo(this.stripWrap)[0]+o;if(!this.enableTabScroll||p<1||l<20){return}if(m<=t){r.scrollLeft=0;q.setWidth(t);if(this.scrolling){this.scrolling=false;this.pos.removeClass("x-tab-scrolling");this.scrollLeft.hide();this.scrollRight.hide();if(Ext.isAir||Ext.isSafari){r.style.marginLeft="";r.style.marginRight=""}}}else{if(!this.scrolling){this.pos.addClass("x-tab-scrolling");if(Ext.isAir||Ext.isSafari){r.style.marginLeft="18px";r.style.marginRight="18px"}}t-=q.getMargins("lr");q.setWidth(t>20?t:20);if(!this.scrolling){if(!this.scrollLeft){this.createScrollers()}else{this.scrollLeft.show();this.scrollRight.show()}}this.scrolling=true;if(o>(m-t)){r.scrollLeft=m-t}else{this.scrollToTab(this.activeTab,false)}this.updateScrollButtons()}},createScrollers:function(){this.pos.addClass("x-tab-scrolling-"+this.tabPosition);var g=this.stripWrap.dom.offsetHeight;var e=this.pos.insertFirst({cls:"x-tab-scroller-left"});e.setHeight(g);e.addClassOnOver("x-tab-scroller-left-over");this.leftRepeater=new Ext.util.ClickRepeater(e,{interval:this.scrollRepeatInterval,handler:this.onScrollLeft,scope:this});this.scrollLeft=e;var d=this.pos.insertFirst({cls:"x-tab-scroller-right"});d.setHeight(g);d.addClassOnOver("x-tab-scroller-right-over");this.rightRepeater=new Ext.util.ClickRepeater(d,{interval:this.scrollRepeatInterval,handler:this.onScrollRight,scope:this});this.scrollRight=d},getScrollWidth:function(){return this.edge.getOffsetsTo(this.stripWrap)[0]+this.getScrollPos()},getScrollPos:function(){return parseInt(this.stripWrap.dom.scrollLeft,10)||0},getScrollArea:function(){return parseInt(this.stripWrap.dom.clientWidth,10)||0},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},getScrollIncrement:function(){return this.scrollIncrement||(this.resizeTabs?this.lastTabWidth+2:100)},scrollToTab:function(q,m){if(!q){return}var s=this.getTabEl(q);var o=this.getScrollPos(),r=this.getScrollArea();var p=Ext.fly(s).getOffsetsTo(this.stripWrap)[0]+o;var l=p+s.offsetWidth;if(p<o){this.scrollTo(p,m)}else{if(l>(o+r)){this.scrollTo(l-r,m)}}},scrollTo:function(d,e){this.stripWrap.scrollTo("left",d,e?this.getScrollAnim():false);if(!e){this.updateScrollButtons()}},onWheel:function(o){var m=o.getWheelDelta()*this.wheelIncrement*-1;o.stopEvent();var l=this.getScrollPos();var p=l+m;var e=this.getScrollWidth()-this.getScrollArea();var d=Math.max(0,Math.min(e,p));if(d!=l){this.scrollTo(d,false)}},onScrollRight:function(){var e=this.getScrollWidth()-this.getScrollArea();var g=this.getScrollPos();var d=Math.min(e,g+this.getScrollIncrement());if(d!=g){this.scrollTo(d,this.animScroll)}},onScrollLeft:function(){var d=this.getScrollPos();var e=Math.max(0,d-this.getScrollIncrement());if(e!=d){this.scrollTo(e,this.animScroll)}},updateScrollButtons:function(){var b=this.getScrollPos();this.scrollLeft[b==0?"addClass":"removeClass"]("x-tab-scroller-left-disabled");this.scrollRight[b>=(this.getScrollWidth()-this.getScrollArea())?"addClass":"removeClass"]("x-tab-scroller-right-disabled")},beforeDestroy:function(){if(this.items){this.items.each(function(b){if(b&&b.tabEl){Ext.get(b.tabEl).removeAllListeners();b.tabEl=null}},this)}if(this.strip){this.strip.removeAllListeners()}Ext.TabPanel.superclass.beforeDestroy.apply(this)}});Ext.reg("tabpanel",Ext.TabPanel);Ext.TabPanel.prototype.activate=Ext.TabPanel.prototype.setActiveTab;Ext.TabPanel.AccessStack=function(){var b=[];return{add:function(a){b.push(a);if(b.length>10){b.shift()}},remove:function(g){var h=[];for(var l=0,a=b.length;l<a;l++){if(b[l]!=g){h.push(b[l])}}b=h},next:function(){return b.pop()}}};Ext.Button=Ext.extend(Ext.Component,{hidden:false,disabled:false,pressed:false,enableToggle:false,menuAlign:"tl-bl?",type:"button",menuClassTarget:"tr",clickEvent:"click",handleMouseEvents:true,tooltipType:"qtip",buttonSelector:"button:first-child",initComponent:function(){Ext.Button.superclass.initComponent.call(this);this.addEvents("click","toggle","mouseover","mouseout","menushow","menuhide","menutriggerover","menutriggerout");if(this.menu){this.menu=Ext.menu.MenuMgr.get(this.menu)}if(typeof this.toggleGroup==="string"){this.enableToggle=true}},onRender:function(o,h){if(!this.template){if(!Ext.Button.buttonTemplate){Ext.Button.buttonTemplate=new Ext.Template('<table border="0" cellpadding="0" cellspacing="0" class="x-btn-wrap"><tbody><tr>','<td class="x-btn-left"><i>&#160;</i></td><td class="x-btn-center"><em unselectable="on"><button class="x-btn-text" type="{1}">{0}</button></em></td><td class="x-btn-right"><i>&#160;</i></td>',"</tr></tbody></table>")}this.template=Ext.Button.buttonTemplate}var g,l=[this.text||"&#160;",this.type];if(h){g=this.template.insertBefore(h,l,true)}else{g=this.template.append(o,l,true)}var m=g.child(this.buttonSelector);m.on("focus",this.onFocus,this);m.on("blur",this.onBlur,this);this.initButtonEl(g,m);if(this.menu){this.el.child(this.menuClassTarget).addClass("x-btn-with-menu")}Ext.ButtonToggleMgr.register(this)},initButtonEl:function(d,g){this.el=d;d.addClass("x-btn");if(this.id){this.el.dom.id=this.el.id=this.id}if(this.icon){g.setStyle("background-image","url("+this.icon+")")}if(this.iconCls){g.addClass(this.iconCls);if(!this.cls){d.addClass(this.text?"x-btn-text-icon":"x-btn-icon")}}if(this.tabIndex!==undefined){g.dom.tabIndex=this.tabIndex}if(this.tooltip){if(typeof this.tooltip=="object"){Ext.QuickTips.register(Ext.apply({target:g.id},this.tooltip))}else{g.dom[this.tooltipType]=this.tooltip}}if(this.pressed){this.el.addClass("x-btn-pressed")}if(this.handleMouseEvents){d.on("mouseover",this.onMouseOver,this);d.on("mousedown",this.onMouseDown,this)}if(this.menu){this.menu.on("show",this.onMenuShow,this);this.menu.on("hide",this.onMenuHide,this)}if(this.repeat){var e=new Ext.util.ClickRepeater(d,typeof this.repeat=="object"?this.repeat:{});e.on("click",this.onClick,this)}d.on(this.clickEvent,this.onClick,this)},afterRender:function(){Ext.Button.superclass.afterRender.call(this);if(Ext.isIE6){this.autoWidth.defer(1,this)}else{this.autoWidth()}},setIconClass:function(b){if(this.el){this.el.child(this.buttonSelector).replaceClass(this.iconCls,b)}this.iconCls=b},beforeDestroy:function(){if(this.rendered){var b=this.el.child(this.buttonSelector);if(b){if(this.tooltip){Ext.QuickTips.unregister(b)}b.removeAllListeners()}}if(this.menu){Ext.destroy(this.menu)}},onDestroy:function(){if(this.rendered){Ext.ButtonToggleMgr.unregister(this)}},autoWidth:function(){if(this.el){this.el.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var b=this.el.child(this.buttonSelector);if(b&&b.getWidth()>20){b.clip();b.setWidth(Ext.util.TextMetrics.measure(b,this.text).width+b.getFrameWidth("lr"))}}if(this.minWidth){if(this.el.getWidth()<this.minWidth){this.el.setWidth(this.minWidth)}}}},setHandler:function(d,e){this.handler=d;this.scope=e},setText:function(b){this.text=b;if(this.el){this.el.child("td.x-btn-center "+this.buttonSelector).update(b)}this.autoWidth()},getText:function(){return this.text},toggle:function(b){b=b===undefined?!this.pressed:b;if(b!=this.pressed){if(b){this.el.addClass("x-btn-pressed");this.pressed=true;this.fireEvent("toggle",this,true)}else{this.el.removeClass("x-btn-pressed");this.pressed=false;this.fireEvent("toggle",this,false)}if(this.toggleHandler){this.toggleHandler.call(this.scope||this,this,b)}}},focus:function(){this.el.child(this.buttonSelector).focus()},onDisable:function(){if(this.el){if(!Ext.isIE6||!this.text){this.el.addClass(this.disabledClass)}this.el.dom.disabled=true}this.disabled=true},onEnable:function(){if(this.el){if(!Ext.isIE6||!this.text){this.el.removeClass(this.disabledClass)}this.el.dom.disabled=false}this.disabled=false},showMenu:function(){if(this.menu){this.menu.show(this.el,this.menuAlign)}return this},hideMenu:function(){if(this.menu){this.menu.hide()}return this},hasVisibleMenu:function(){return this.menu&&this.menu.isVisible()},onClick:function(b){if(b){b.preventDefault()}if(b.button!=0){return}if(!this.disabled){if(this.enableToggle&&(this.allowDepress!==false||!this.pressed)){this.toggle()}if(this.menu&&!this.menu.isVisible()&&!this.ignoreNextClick){this.showMenu()}this.fireEvent("click",this,b);if(this.handler){this.handler.call(this.scope||this,this,b)}}},isMenuTriggerOver:function(d,e){return this.menu&&!e},isMenuTriggerOut:function(d,e){return this.menu&&!e},onMouseOver:function(d){if(!this.disabled){var e=d.within(this.el,true);if(!e){this.el.addClass("x-btn-over");if(!this.monitoringMouseOver){Ext.getDoc().on("mouseover",this.monitorMouseOver,this);this.monitoringMouseOver=true}this.fireEvent("mouseover",this,d)}if(this.isMenuTriggerOver(d,e)){this.fireEvent("menutriggerover",this,this.menu,d)}}},monitorMouseOver:function(b){if(b.target!=this.el.dom&&!b.within(this.el)){if(this.monitoringMouseOver){Ext.getDoc().un("mouseover",this.monitorMouseOver,this);this.monitoringMouseOver=false}this.onMouseOut(b)}},onMouseOut:function(d){var e=d.within(this.el)&&d.target!=this.el.dom;this.el.removeClass("x-btn-over");this.fireEvent("mouseout",this,d);if(this.isMenuTriggerOut(d,e)){this.fireEvent("menutriggerout",this,this.menu,d)}},onFocus:function(b){if(!this.disabled){this.el.addClass("x-btn-focus")}},onBlur:function(b){this.el.removeClass("x-btn-focus")},getClickEl:function(d,e){return this.el},onMouseDown:function(b){if(!this.disabled&&b.button==0){this.getClickEl(b).addClass("x-btn-click");Ext.getDoc().on("mouseup",this.onMouseUp,this)}},onMouseUp:function(b){if(b.button==0){this.getClickEl(b,true).removeClass("x-btn-click");Ext.getDoc().un("mouseup",this.onMouseUp,this)}},onMenuShow:function(b){this.ignoreNextClick=0;this.el.addClass("x-btn-menu-active");this.fireEvent("menushow",this,this.menu)},onMenuHide:function(b){this.el.removeClass("x-btn-menu-active");this.ignoreNextClick=this.restoreClick.defer(250,this);this.fireEvent("menuhide",this,this.menu)},restoreClick:function(){this.ignoreNextClick=0}});Ext.reg("button",Ext.Button);Ext.ButtonToggleMgr=function(){var e={};function d(g,a){if(a){var b=e[g.toggleGroup];for(var l=0,m=b.length;l<m;l++){if(b[l]!=g){b[l].toggle(false)}}}}return{register:function(b){if(!b.toggleGroup){return}var a=e[b.toggleGroup];if(!a){a=e[b.toggleGroup]=[]}a.push(b);b.on("toggle",d)},unregister:function(b){if(!b.toggleGroup){return}var a=e[b.toggleGroup];if(a){a.remove(b);b.un("toggle",d)}}}}();Ext.SplitButton=Ext.extend(Ext.Button,{arrowSelector:"button:last",initComponent:function(){Ext.SplitButton.superclass.initComponent.call(this);this.addEvents("arrowclick")},onRender:function(p,l){var h=new Ext.Template('<table cellspacing="0" class="x-btn-menu-wrap x-btn"><tr><td>','<table cellspacing="0" class="x-btn-wrap x-btn-menu-text-wrap"><tbody>','<tr><td class="x-btn-left"><i>&#160;</i></td><td class="x-btn-center"><button class="x-btn-text" type="{1}">{0}</button></td></tr>',"</tbody></table></td><td>",'<table cellspacing="0" class="x-btn-wrap x-btn-menu-arrow-wrap"><tbody>','<tr><td class="x-btn-center"><button class="x-btn-menu-arrow-el" type="button">&#160;</button></td><td class="x-btn-right"><i>&#160;</i></td></tr>',"</tbody></table></td></tr></table>");var q,m=[this.text||"&#160;",this.type];if(l){q=h.insertBefore(l,m,true)}else{q=h.append(p,m,true)}var o=q.child(this.buttonSelector);this.initButtonEl(q,o);this.arrowBtnTable=q.child("table:last");if(this.arrowTooltip){q.child(this.arrowSelector).dom[this.tooltipType]=this.arrowTooltip}},autoWidth:function(){if(this.el){var g=this.el.child("table:first");var d=this.el.child("table:last");this.el.setWidth("auto");g.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var e=this.el.child(this.buttonSelector);if(e&&e.getWidth()>20){e.clip();e.setWidth(Ext.util.TextMetrics.measure(e,this.text).width+e.getFrameWidth("lr"))}}if(this.minWidth){if((g.getWidth()+d.getWidth())<this.minWidth){g.setWidth(this.minWidth-d.getWidth())}}this.el.setWidth(g.getWidth()+d.getWidth())}},setArrowHandler:function(d,e){this.arrowHandler=d;this.scope=e},onClick:function(b){b.preventDefault();if(!this.disabled){if(b.getTarget(".x-btn-menu-arrow-wrap")){if(this.menu&&!this.menu.isVisible()&&!this.ignoreNextClick){this.showMenu()}this.fireEvent("arrowclick",this,b);if(this.arrowHandler){this.arrowHandler.call(this.scope||this,this,b)}}else{if(this.enableToggle){this.toggle()}this.fireEvent("click",this,b);if(this.handler){this.handler.call(this.scope||this,this,b)}}}},getClickEl:function(d,e){if(!e){return(this.lastClickEl=d.getTarget("table",10,true))}return this.lastClickEl},onDisable:function(){if(this.el){if(!Ext.isIE6){this.el.addClass("x-item-disabled")}this.el.child(this.buttonSelector).dom.disabled=true;this.el.child(this.arrowSelector).dom.disabled=true}this.disabled=true},onEnable:function(){if(this.el){if(!Ext.isIE6){this.el.removeClass("x-item-disabled")}this.el.child(this.buttonSelector).dom.disabled=false;this.el.child(this.arrowSelector).dom.disabled=false}this.disabled=false},isMenuTriggerOver:function(b){return this.menu&&b.within(this.arrowBtnTable)&&!b.within(this.arrowBtnTable,true)},isMenuTriggerOut:function(d,e){return this.menu&&!d.within(this.arrowBtnTable)},onDestroy:function(){Ext.destroy(this.arrowBtnTable);Ext.SplitButton.superclass.onDestroy.call(this)}});Ext.MenuButton=Ext.SplitButton;Ext.reg("splitbutton",Ext.SplitButton);Ext.CycleButton=Ext.extend(Ext.SplitButton,{getItemText:function(e){if(e&&this.showText===true){var d="";if(this.prependText){d+=this.prependText}d+=e.text;return d}return undefined},setActiveItem:function(g,e){if(typeof g!="object"){g=this.menu.items.get(g)}if(g){if(!this.rendered){this.text=this.getItemText(g);this.iconCls=g.iconCls}else{var d=this.getItemText(g);if(d){this.setText(d)}this.setIconClass(g.iconCls)}this.activeItem=g;if(!g.checked){g.setChecked(true,true)}if(this.forceIcon){this.setIconClass(this.forceIcon)}if(!e){this.fireEvent("change",this,g)}}},getActiveItem:function(){return this.activeItem},initComponent:function(){this.addEvents("change");if(this.changeHandler){this.on("change",this.changeHandler,this.scope||this);delete this.changeHandler}this.itemCount=this.items.length;this.menu={cls:"x-cycle-menu",items:[]};var h;for(var e=0,g=this.itemCount;e<g;e++){var l=this.items[e];l.group=l.group||this.id;l.itemIndex=e;l.checkHandler=this.checkHandler;l.scope=this;l.checked=l.checked||false;this.menu.items.push(l);if(l.checked){h=l}}this.setActiveItem(h,true);Ext.CycleButton.superclass.initComponent.call(this);this.on("click",this.toggleSelected,this)},checkHandler:function(e,d){if(d){this.setActiveItem(e)}},toggleSelected:function(){this.menu.render();var g,e;for(var d=1;d<this.itemCount;d++){g=(this.activeItem.itemIndex+d)%this.itemCount;e=this.menu.items.itemAt(g);if(!e.disabled){e.setChecked(true);break}}}});Ext.reg("cycle",Ext.CycleButton);Ext.Toolbar=function(b){if(Ext.isArray(b)){b={buttons:b}}Ext.Toolbar.superclass.constructor.call(this,b)};(function(){var b=Ext.Toolbar;Ext.extend(b,Ext.BoxComponent,{trackMenus:true,initComponent:function(){b.superclass.initComponent.call(this);if(this.items){this.buttons=this.items}this.items=new Ext.util.MixedCollection(false,function(a){return a.itemId||a.id||Ext.id()})},autoCreate:{cls:"x-toolbar x-small-editor",html:'<table cellspacing="0"><tr></tr></table>'},onRender:function(d,a){this.el=d.createChild(Ext.apply({id:this.id},this.autoCreate),a);this.tr=this.el.child("tr",true)},afterRender:function(){b.superclass.afterRender.call(this);if(this.buttons){this.add.apply(this,this.buttons);delete this.buttons}},add:function(){var l=arguments,a=l.length;for(var h=0;h<a;h++){var g=l[h];if(g.isFormField){this.addField(g)}else{if(g.render){this.addItem(g)}else{if(typeof g=="string"){if(g=="separator"||g=="-"){this.addSeparator()}else{if(g==" "){this.addSpacer()}else{if(g=="->"){this.addFill()}else{this.addText(g)}}}}else{if(g.tagName){this.addElement(g)}else{if(typeof g=="object"){if(g.xtype){this.addField(Ext.ComponentMgr.create(g,"button"))}else{this.addButton(g)}}}}}}}},addSeparator:function(){return this.addItem(new b.Separator())},addSpacer:function(){return this.addItem(new b.Spacer())},addFill:function(){return this.addItem(new b.Fill())},addElement:function(a){return this.addItem(new b.Item(a))},addItem:function(a){var d=this.nextBlock();this.initMenuTracking(a);a.render(d);this.items.add(a);return a},addButton:function(o){if(Ext.isArray(o)){var l=[];for(var m=0,p=o.length;m<p;m++){l.push(this.addButton(o[m]))}return l}var q=o;if(!(o instanceof b.Button)){q=o.split?new b.SplitButton(o):new b.Button(o)}var a=this.nextBlock();this.initMenuTracking(q);q.render(a);this.items.add(q);return q},initMenuTracking:function(a){if(this.trackMenus&&a.menu){a.on({menutriggerover:this.onButtonTriggerOver,menushow:this.onButtonMenuShow,menuhide:this.onButtonMenuHide,scope:this})}},addText:function(a){return this.addItem(new b.TextItem(a))},insertButton:function(q,m){if(Ext.isArray(m)){var o=[];for(var p=0,a=m.length;p<a;p++){o.push(this.insertButton(q+p,m[p]))}return o}if(!(m instanceof b.Button)){m=new b.Button(m)}var l=document.createElement("td");this.tr.insertBefore(l,this.tr.childNodes[q]);this.initMenuTracking(m);m.render(l);this.items.insert(q,m);return m},addDom:function(l,a){var g=this.nextBlock();Ext.DomHelper.overwrite(g,l);var h=new b.Item(g.firstChild);h.render(g);this.items.add(h);return h},addField:function(g){var e=this.nextBlock();g.render(e);var a=new b.Item(e.firstChild);a.render(e);this.items.add(g);return a},nextBlock:function(){var a=document.createElement("td");this.tr.appendChild(a);return a},onDestroy:function(){Ext.Toolbar.superclass.onDestroy.call(this);if(this.rendered){if(this.items){Ext.destroy.apply(Ext,this.items.items)}Ext.Element.uncache(this.tr)}},onDisable:function(){this.items.each(function(a){if(a.disable){a.disable()}})},onEnable:function(){this.items.each(function(a){if(a.enable){a.enable()}})},onButtonTriggerOver:function(a){if(this.activeMenuBtn&&this.activeMenuBtn!=a){this.activeMenuBtn.hideMenu();a.showMenu();this.activeMenuBtn=a}},onButtonMenuShow:function(a){this.activeMenuBtn=a},onButtonMenuHide:function(a){delete this.activeMenuBtn}});Ext.reg("toolbar",Ext.Toolbar);b.Item=function(a){this.el=Ext.getDom(a);this.id=Ext.id(this.el);this.hidden=false};b.Item.prototype={getEl:function(){return this.el},render:function(a){this.td=a;a.appendChild(this.el)},destroy:function(){if(this.el){var a=Ext.get(this.el);Ext.destroy(a)}Ext.removeNode(this.td)},show:function(){this.hidden=false;this.td.style.display=""},hide:function(){this.hidden=true;this.td.style.display="none"},setVisible:function(a){if(a){this.show()}else{this.hide()}},focus:function(){Ext.fly(this.el).focus()},disable:function(){Ext.fly(this.td).addClass("x-item-disabled");this.disabled=true;this.el.disabled=true},enable:function(){Ext.fly(this.td).removeClass("x-item-disabled");this.disabled=false;this.el.disabled=false}};Ext.reg("tbitem",b.Item);b.Separator=function(){var a=document.createElement("span");a.className="ytb-sep";b.Separator.superclass.constructor.call(this,a)};Ext.extend(b.Separator,b.Item,{enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.reg("tbseparator",b.Separator);b.Spacer=function(){var a=document.createElement("div");a.className="ytb-spacer";b.Spacer.superclass.constructor.call(this,a)};Ext.extend(b.Spacer,b.Item,{enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.reg("tbspacer",b.Spacer);b.Fill=Ext.extend(b.Spacer,{render:function(a){a.style.width="100%";b.Fill.superclass.render.call(this,a)}});Ext.reg("tbfill",b.Fill);b.TextItem=function(a){var d=document.createElement("span");d.className="ytb-text";d.innerHTML=a.text?a.text:a;b.TextItem.superclass.constructor.call(this,d)};Ext.extend(b.TextItem,b.Item,{enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.reg("tbtext",b.TextItem);b.Button=Ext.extend(Ext.Button,{hideParent:true,onDestroy:function(){b.Button.superclass.onDestroy.call(this);if(this.container){this.container.remove()}}});Ext.reg("tbbutton",b.Button);b.SplitButton=Ext.extend(Ext.SplitButton,{hideParent:true,onDestroy:function(){b.SplitButton.superclass.onDestroy.call(this);if(this.container){this.container.remove()}}});Ext.reg("tbsplit",b.SplitButton);b.MenuButton=b.SplitButton})();Ext.PagingToolbar=Ext.extend(Ext.Toolbar,{pageSize:20,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No data to display",beforePageText:"Page",afterPageText:"of {0}",firstText:"First Page",prevText:"Previous Page",nextText:"Next Page",lastText:"Last Page",refreshText:"Refresh",paramNames:{start:"start",limit:"limit"},initComponent:function(){this.addEvents("change","beforechange");Ext.PagingToolbar.superclass.initComponent.call(this);this.cursor=0;this.bind(this.store)},onRender:function(d,e){Ext.PagingToolbar.superclass.onRender.call(this,d,e);this.first=this.addButton({tooltip:this.firstText,iconCls:"x-tbar-page-first",disabled:true,handler:this.onClick.createDelegate(this,["first"])});this.prev=this.addButton({tooltip:this.prevText,iconCls:"x-tbar-page-prev",disabled:true,handler:this.onClick.createDelegate(this,["prev"])});this.addSeparator();this.add(this.beforePageText);this.field=Ext.get(this.addDom({tag:"input",type:"text",size:"3",value:"1",cls:"x-tbar-page-number"}).el);this.field.on("keydown",this.onPagingKeydown,this);this.field.on("focus",function(){this.dom.select()});this.field.on("blur",this.onPagingBlur,this);this.afterTextEl=this.addText(String.format(this.afterPageText,1));this.field.setHeight(18);this.addSeparator();this.next=this.addButton({tooltip:this.nextText,iconCls:"x-tbar-page-next",disabled:true,handler:this.onClick.createDelegate(this,["next"])});this.last=this.addButton({tooltip:this.lastText,iconCls:"x-tbar-page-last",disabled:true,handler:this.onClick.createDelegate(this,["last"])});this.addSeparator();this.loading=this.addButton({tooltip:this.refreshText,iconCls:"x-tbar-loading",handler:this.onClick.createDelegate(this,["refresh"])});if(this.displayInfo){this.displayEl=Ext.fly(this.el.dom).createChild({cls:"x-paging-info"})}if(this.dsLoaded){this.onLoad.apply(this,this.dsLoaded)}},updateInfo:function(){if(this.displayEl){var e=this.store.getCount();var d=e==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+e,this.store.getTotalCount());this.displayEl.update(d)}},onLoad:function(l,q,m){if(!this.rendered){this.dsLoaded=[l,q,m];return}this.cursor=m.params?m.params[this.paramNames.start]:0;var o=this.getPageData(),d=o.activePage,p=o.pages;this.afterTextEl.el.innerHTML=String.format(this.afterPageText,o.pages);this.field.dom.value=d;this.first.setDisabled(d==1);this.prev.setDisabled(d==1);this.next.setDisabled(d==p);this.last.setDisabled(d==p);this.loading.enable();this.updateInfo();this.fireEvent("change",this,o)},getPageData:function(){var b=this.store.getTotalCount();return{total:b,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:b<this.pageSize?1:Math.ceil(b/this.pageSize)}},onLoadError:function(){if(!this.rendered){return}this.loading.enable()},readPage:function(g){var e=this.field.dom.value,d;if(!e||isNaN(d=parseInt(e,10))){this.field.dom.value=g.activePage;return false}return d},onPagingBlur:function(b){this.field.dom.value=this.getPageData().activePage},onPagingKeydown:function(m){var d=m.getKey(),l=this.getPageData(),o;if(d==m.RETURN){m.stopEvent();o=this.readPage(l);if(o!==false){o=Math.min(Math.max(1,o),l.pages)-1;this.doLoad(o*this.pageSize)}}else{if(d==m.HOME||d==m.END){m.stopEvent();o=d==m.HOME?1:l.pages;this.field.dom.value=o}else{if(d==m.UP||d==m.PAGEUP||d==m.DOWN||d==m.PAGEDOWN){m.stopEvent();if(o=this.readPage(l)){var e=m.shiftKey?10:1;if(d==m.DOWN||d==m.PAGEDOWN){e*=-1}o+=e;if(o>=1&o<=l.pages){this.field.dom.value=o}}}}}},beforeLoad:function(){if(this.rendered&&this.loading){this.loading.disable()}},doLoad:function(g){var d={},e=this.paramNames;d[e.start]=g;d[e.limit]=this.pageSize;if(this.fireEvent("beforechange",this,d)!==false){this.store.load({params:d})}},changePage:function(b){this.doLoad(((b-1)*this.pageSize).constrain(0,this.store.getTotalCount()))},onClick:function(l){var g=this.store;switch(l){case"first":this.doLoad(0);break;case"prev":this.doLoad(Math.max(0,this.cursor-this.pageSize));break;case"next":this.doLoad(this.cursor+this.pageSize);break;case"last":var m=g.getTotalCount();var h=m%this.pageSize;var o=h?(m-h):m-this.pageSize;this.doLoad(o);break;case"refresh":this.doLoad(this.cursor);break}},unbind:function(b){b=Ext.StoreMgr.lookup(b);b.un("beforeload",this.beforeLoad,this);b.un("load",this.onLoad,this);b.un("loadexception",this.onLoadError,this);this.store=undefined},bind:function(b){b=Ext.StoreMgr.lookup(b);b.on("beforeload",this.beforeLoad,this);b.on("load",this.onLoad,this);b.on("loadexception",this.onLoadError,this);this.store=b},onDestroy:function(){if(this.store){this.unbind(this.store)}Ext.PagingToolbar.superclass.onDestroy.call(this)}});Ext.reg("paging",Ext.PagingToolbar);Ext.Resizable=function(C,B){this.el=Ext.get(C);if(B&&B.wrap){B.resizeChild=this.el;this.el=this.el.wrap(typeof B.wrap=="object"?B.wrap:{cls:"xresizable-wrap"});this.el.id=this.el.dom.id=B.resizeChild.id+"-rzwrap";this.el.setStyle("overflow","hidden");this.el.setPositioning(B.resizeChild.getPositioning());B.resizeChild.clearPositioning();if(!B.width||!B.height){var z=B.resizeChild.getSize();this.el.setSize(z.width,z.height)}if(B.pinned&&!B.adjustments){B.adjustments="auto"}}this.proxy=this.el.createProxy({tag:"div",cls:"x-resizable-proxy",id:this.el.id+"-rzproxy"},Ext.getBody());this.proxy.unselectable();this.proxy.enableDisplayMode("block");Ext.apply(this,B);if(this.pinned){this.disableTrackOver=true;this.el.addClass("x-resizable-pinned")}var u=this.el.getStyle("position");if(u!="absolute"&&u!="fixed"){this.el.setStyle("position","relative")}if(!this.handles){this.handles="s,e,se";if(this.multiDirectional){this.handles+=",n,w"}}if(this.handles=="all"){this.handles="n s e w ne nw se sw"}var q=this.handles.split(/\s*?[,;]\s*?| /);var D=Ext.Resizable.positions;for(var v=0,t=q.length;v<t;v++){if(q[v]&&D[q[v]]){var r=D[q[v]];this[r]=new Ext.Resizable.Handle(this,r,this.disableTrackOver,this.transparent)}}this.corner=this.southeast;if(this.handles.indexOf("n")!=-1||this.handles.indexOf("w")!=-1){this.updateBox=true}this.activeHandle=null;if(this.resizeChild){if(typeof this.resizeChild=="boolean"){this.resizeChild=Ext.get(this.el.dom.firstChild,true)}else{this.resizeChild=Ext.get(this.resizeChild,true)}}if(this.adjustments=="auto"){var E=this.resizeChild;var s=this.west,w=this.east,F=this.north,q=this.south;if(E&&(s||F)){E.position("relative");E.setLeft(s?s.el.getWidth():0);E.setTop(F?F.el.getHeight():0)}this.adjustments=[(w?-w.el.getWidth():0)+(s?-s.el.getWidth():0),(F?-F.el.getHeight():0)+(q?-q.el.getHeight():0)-1]}if(this.draggable){this.dd=this.dynamic?this.el.initDD(null):this.el.initDDProxy(null,{dragElId:this.proxy.id});this.dd.setHandleElId(this.resizeChild?this.resizeChild.id:this.el.id)}this.addEvents("beforeresize","resize");if(this.width!==null&&this.height!==null){this.resizeTo(this.width,this.height)}else{this.updateChildSize()}if(Ext.isIE){this.el.dom.style.zoom=1}Ext.Resizable.superclass.constructor.call(this)};Ext.extend(Ext.Resizable,Ext.util.Observable,{resizeChild:false,adjustments:[0,0],minWidth:5,minHeight:5,maxWidth:10000,maxHeight:10000,enabled:true,animate:false,duration:0.35,dynamic:false,handles:false,multiDirectional:false,disableTrackOver:false,easing:"easeOutStrong",widthIncrement:0,heightIncrement:0,pinned:false,width:null,height:null,preserveRatio:false,transparent:false,minX:0,minY:0,draggable:false,resizeTo:function(d,e){this.el.setSize(d,e);this.updateChildSize();this.fireEvent("resize",this,d,e,null)},startSizing:function(g,d){this.fireEvent("beforeresize",this,g);if(this.enabled){if(!this.overlay){this.overlay=this.el.createProxy({tag:"div",cls:"x-resizable-overlay",html:"&#160;"},Ext.getBody());this.overlay.unselectable();this.overlay.enableDisplayMode("block");this.overlay.on("mousemove",this.onMouseMove,this);this.overlay.on("mouseup",this.onMouseUp,this)}this.overlay.setStyle("cursor",d.el.getStyle("cursor"));this.resizing=true;this.startBox=this.el.getBox();this.startPoint=g.getXY();this.offsets=[(this.startBox.x+this.startBox.width)-this.startPoint[0],(this.startBox.y+this.startBox.height)-this.startPoint[1]];this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();if(this.constrainTo){var e=Ext.get(this.constrainTo);this.resizeRegion=e.getRegion().adjust(e.getFrameWidth("t"),e.getFrameWidth("l"),-e.getFrameWidth("b"),-e.getFrameWidth("r"))}this.proxy.setStyle("visibility","hidden");this.proxy.show();this.proxy.setBox(this.startBox);if(!this.dynamic){this.proxy.setStyle("visibility","visible")}}},onMouseDown:function(e,d){if(this.enabled){d.stopEvent();this.activeHandle=e;this.startSizing(d,e)}},onMouseUp:function(d){var e=this.resizeElement();this.resizing=false;this.handleOut();this.overlay.hide();this.proxy.hide();this.fireEvent("resize",this,e.width,e.height,d)},updateChildSize:function(){if(this.resizeChild){var h=this.el;var g=this.resizeChild;var l=this.adjustments;if(h.dom.offsetWidth){var b=h.getSize(true);g.setSize(b.width+l[0],b.height+l[1])}if(Ext.isIE){setTimeout(function(){if(h.dom.offsetWidth){var a=h.getSize(true);g.setSize(a.width+l[0],a.height+l[1])}},10)}}},snap:function(o,l,g){if(!l||!o){return o}var m=o;var h=o%l;if(h>0){if(h>(l/2)){m=o+(l-h)}else{m=o-h}}return Math.max(g,m)},resizeElement:function(){var b=this.proxy.getBox();if(this.updateBox){this.el.setBox(b,false,this.animate,this.duration,null,this.easing)}else{this.el.setSize(b.width,b.height,this.animate,this.duration,null,this.easing)}this.updateChildSize();if(!this.dynamic){this.proxy.hide()}return b},constrain:function(e,l,g,h){if(e-l<g){l=e-g}else{if(e-l>h){l=h-e}}return l},onMouseMove:function(e){if(this.enabled){try{if(this.resizeRegion&&!this.resizeRegion.contains(e.getPoint())){return}var w=this.curSize||this.startBox;var S=this.startBox.x,T=this.startBox.y;var Z=S,aa=T;var Q=w.width,h=w.height;var Y=Q,O=h;var P=this.minWidth,N=this.minHeight;var G=this.maxWidth,I=this.maxHeight;var V=this.widthIncrement;var ab=this.heightIncrement;var M=e.getXY();var H=-(this.startPoint[0]-Math.max(this.minX,M[0]));var L=-(this.startPoint[1]-Math.max(this.minY,M[1]));var U=this.activeHandle.position;switch(U){case"east":Q+=H;Q=Math.min(Math.max(P,Q),G);break;case"south":h+=L;h=Math.min(Math.max(N,h),I);break;case"southeast":Q+=H;h+=L;Q=Math.min(Math.max(P,Q),G);h=Math.min(Math.max(N,h),I);break;case"north":L=this.constrain(h,L,N,I);T+=L;h-=L;break;case"west":H=this.constrain(Q,H,P,G);S+=H;Q-=H;break;case"northeast":Q+=H;Q=Math.min(Math.max(P,Q),G);L=this.constrain(h,L,N,I);T+=L;h-=L;break;case"northwest":H=this.constrain(Q,H,P,G);L=this.constrain(h,L,N,I);T+=L;h-=L;S+=H;Q-=H;break;case"southwest":H=this.constrain(Q,H,P,G);h+=L;h=Math.min(Math.max(N,h),I);S+=H;Q-=H;break}var K=this.snap(Q,V,P);var J=this.snap(h,ab,N);if(K!=Q||J!=h){switch(U){case"northeast":T-=J-h;break;case"north":T-=J-h;break;case"southwest":S-=K-Q;break;case"west":S-=K-Q;break;case"northwest":S-=K-Q;T-=J-h;break}Q=K;h=J}if(this.preserveRatio){switch(U){case"southeast":case"east":h=O*(Q/Y);h=Math.min(Math.max(N,h),I);Q=Y*(h/O);break;case"south":Q=Y*(h/O);Q=Math.min(Math.max(P,Q),G);h=O*(Q/Y);break;case"northeast":Q=Y*(h/O);Q=Math.min(Math.max(P,Q),G);h=O*(Q/Y);break;case"north":var F=Q;Q=Y*(h/O);Q=Math.min(Math.max(P,Q),G);h=O*(Q/Y);S+=(F-Q)/2;break;case"southwest":h=O*(Q/Y);h=Math.min(Math.max(N,h),I);var F=Q;Q=Y*(h/O);S+=F-Q;break;case"west":var W=h;h=O*(Q/Y);h=Math.min(Math.max(N,h),I);T+=(W-h)/2;var F=Q;Q=Y*(h/O);S+=F-Q;break;case"northwest":var F=Q;var W=h;h=O*(Q/Y);h=Math.min(Math.max(N,h),I);Q=Y*(h/O);T+=W-h;S+=F-Q;break}}this.proxy.setBounds(S,T,Q,h);if(this.dynamic){this.resizeElement()}}catch(e){}}},handleOver:function(){if(this.enabled){this.el.addClass("x-resizable-over")}},handleOut:function(){if(!this.resizing){this.el.removeClass("x-resizable-over")}},getEl:function(){return this.el},getResizeChild:function(){return this.resizeChild},destroy:function(d){if(this.dd){this.dd.destroy()}if(this.overlay){Ext.destroy(this.overlay);this.overlay=null}Ext.destroy(this.proxy);this.proxy=null;var g=Ext.Resizable.positions;for(var e in g){if(typeof g[e]!="function"&&this[g[e]]){this[g[e]].destroy()}}if(d){this.el.update("");Ext.destroy(this.el);this.el=null}},syncHandleHeight:function(){var b=this.el.getHeight(true);if(this.west){this.west.el.setHeight(b)}if(this.east){this.east.el.setHeight(b)}}});Ext.Resizable.positions={n:"north",s:"south",e:"east",w:"west",se:"southeast",sw:"southwest",nw:"northwest",ne:"northeast"};Ext.Resizable.Handle=function(o,l,g,m){if(!this.tpl){var h=Ext.DomHelper.createTemplate({tag:"div",cls:"x-resizable-handle x-resizable-handle-{0}"});h.compile();Ext.Resizable.Handle.prototype.tpl=h}this.position=l;this.rz=o;this.el=this.tpl.append(o.el.dom,[this.position],true);this.el.unselectable();if(m){this.el.setOpacity(0)}this.el.on("mousedown",this.onMouseDown,this);if(!g){this.el.on("mouseover",this.onMouseOver,this);this.el.on("mouseout",this.onMouseOut,this)}};Ext.Resizable.Handle.prototype={afterResize:function(b){},onMouseDown:function(b){this.rz.onMouseDown(this,b)},onMouseOver:function(b){this.rz.handleOver(this,b)},onMouseOut:function(b){this.rz.handleOut(this,b)},destroy:function(){Ext.destroy(this.el);this.el=null}};Ext.Editor=function(d,e){this.field=d;Ext.Editor.superclass.constructor.call(this,e)};Ext.extend(Ext.Editor,Ext.Component,{value:"",alignment:"c-c?",shadow:"frame",constrain:false,swallowKeys:true,completeOnEnter:false,cancelOnEsc:false,updateEl:false,initComponent:function(){Ext.Editor.superclass.initComponent.call(this);this.addEvents("beforestartedit","startedit","beforecomplete","complete","canceledit","specialkey")},onRender:function(d,e){this.el=new Ext.Layer({shadow:this.shadow,cls:"x-editor",parentEl:d,shim:this.shim,shadowOffset:4,id:this.id,constrain:this.constrain});this.el.setStyle("overflow",Ext.isGecko?"auto":"hidden");if(this.field.msgTarget!="title"){this.field.msgTarget="qtip"}this.field.inEditor=true;this.field.render(this.el);if(Ext.isGecko){this.field.el.dom.setAttribute("autocomplete","off")}this.field.on("specialkey",this.onSpecialKey,this);if(this.swallowKeys){this.field.el.swallowEvent(["keydown","keypress"])}this.field.show();this.field.on("blur",this.onBlur,this);if(this.field.grow){this.field.on("autosize",this.el.sync,this.el,{delay:1})}},onSpecialKey:function(g,d){var e=d.getKey();if(this.completeOnEnter&&e==d.ENTER){d.stopEvent();this.completeEdit()}else{if(this.cancelOnEsc&&e==d.ESC){this.cancelEdit()}else{this.fireEvent("specialkey",g,d)}}if(this.field.triggerBlur&&(e==d.ENTER||e==d.ESC||e==d.TAB)){this.field.triggerBlur()}},startEdit:function(d,g){if(this.editing){this.completeEdit()}this.boundEl=Ext.get(d);var e=g!==undefined?g:this.boundEl.dom.innerHTML;if(!this.rendered){this.render(this.parentEl||document.body)}if(this.fireEvent("beforestartedit",this,this.boundEl,e)===false){return}this.startValue=e;this.field.setValue(e);this.doAutoSize();this.el.alignTo(this.boundEl,this.alignment);this.editing=true;this.show()},doAutoSize:function(){if(this.autoSize){var b=this.boundEl.getSize();switch(this.autoSize){case"width":this.setSize(b.width,"");break;case"height":this.setSize("",b.height);break;default:this.setSize(b.width,b.height)}}},setSize:function(e,d){delete this.field.lastSize;this.field.setSize(e,d);if(this.el){if(Ext.isGecko2||Ext.isOpera){this.el.setSize(e,d)}this.el.sync()}},realign:function(){this.el.alignTo(this.boundEl,this.alignment)},completeEdit:function(e){if(!this.editing){return}var d=this.getValue();if(this.revertInvalid!==false&&!this.field.isValid()){d=this.startValue;this.cancelEdit(true)}if(String(d)===String(this.startValue)&&this.ignoreNoChange){this.editing=false;this.hide();return}if(this.fireEvent("beforecomplete",this,d,this.startValue)!==false){this.editing=false;if(this.updateEl&&this.boundEl){this.boundEl.update(d)}if(e!==true){this.hide()}this.fireEvent("complete",this,d,this.startValue)}},onShow:function(){this.el.show();if(this.hideEl!==false){this.boundEl.hide()}this.field.show();if(Ext.isIE&&!this.fixIEFocus){this.fixIEFocus=true;this.deferredFocus.defer(50,this)}else{this.field.focus()}this.fireEvent("startedit",this.boundEl,this.startValue)},deferredFocus:function(){if(this.editing){this.field.focus()}},cancelEdit:function(e){if(this.editing){var d=this.getValue();this.setValue(this.startValue);if(e!==true){this.hide()}this.fireEvent("canceledit",this,d,this.startValue)}},onBlur:function(){if(this.allowBlur!==true&&this.editing){this.completeEdit()}},onHide:function(){if(this.editing){this.completeEdit();return}this.field.blur();if(this.field.collapse){this.field.collapse()}this.el.hide();if(this.hideEl!==false){this.boundEl.show()}},setValue:function(b){this.field.setValue(b)},getValue:function(){return this.field.getValue()},beforeDestroy:function(){Ext.destroy(this.field);this.field=null}});Ext.reg("editor",Ext.Editor);Ext.MessageBox=function(){var B,S,F,C;var M,J,D,T,I,G,L,N;var E,z,H,Q="";var P=function(a){if(B.isVisible()){B.hide();Ext.callback(S.fn,S.scope||window,[a,z.dom.value,S],1)}};var w=function(){if(S&&S.cls){B.el.removeClass(S.cls)}I.reset()};var O=function(d,b,a){if(S&&S.closable!==false){B.hide()}if(a){a.stopEvent()}};var K=function(b){var d=0;if(!b){E.ok.hide();E.cancel.hide();E.yes.hide();E.no.hide();return d}B.footer.dom.style.display="";for(var a in E){if(typeof E[a]!="function"){if(b[a]){E[a].show();E[a].setText(typeof b[a]=="string"?b[a]:Ext.MessageBox.buttonText[a]);d+=E[a].el.getWidth()+15}else{E[a].hide()}}}return d};return{getDialog:function(b){if(!B){B=new Ext.Window({autoCreate:true,title:b,resizable:false,constrain:true,constrainHeader:true,minimizable:false,maximizable:false,stateful:false,modal:true,shim:true,buttonAlign:"center",width:400,height:100,minHeight:80,plain:true,footer:true,closable:true,close:function(){if(S&&S.buttons&&S.buttons.no&&!S.buttons.cancel){P("no")}else{P("cancel")}}});E={};var a=this.buttonText;E.ok=B.addButton(a.ok,P.createCallback("ok"));E.yes=B.addButton(a.yes,P.createCallback("yes"));E.no=B.addButton(a.no,P.createCallback("no"));E.cancel=B.addButton(a.cancel,P.createCallback("cancel"));E.ok.hideMode=E.yes.hideMode=E.no.hideMode=E.cancel.hideMode="offsets";B.render(document.body);B.getEl().addClass("x-window-dlg");F=B.mask;M=B.body.createChild({html:'<div class="ext-mb-icon"></div><div class="ext-mb-content"><span class="ext-mb-text"></span><br /><div class="ext-mb-fix-cursor"><input type="text" class="ext-mb-input" /><textarea class="ext-mb-textarea"></textarea></div></div>'});L=Ext.get(M.dom.firstChild);var d=M.dom.childNodes[1];J=Ext.get(d.firstChild);D=Ext.get(d.childNodes[2].firstChild);D.enableDisplayMode();D.addKeyListener([10,13],function(){if(B.isVisible()&&S&&S.buttons){if(S.buttons.ok){P("ok")}else{if(S.buttons.yes){P("yes")}}}});T=Ext.get(d.childNodes[2].childNodes[1]);T.enableDisplayMode();I=new Ext.ProgressBar({renderTo:M});M.createChild({cls:"x-clear"})}return B},updateText:function(b){if(!B.isVisible()&&!S.width){B.setSize(this.maxWidth,100)}J.update(b||"&#160;");var h=Q!=""?(L.getWidth()+L.getMargins("lr")):0;var e=J.getWidth()+J.getMargins("lr");var d=B.getFrameWidth("lr");var g=B.body.getFrameWidth("lr");if(Ext.isIE&&h>0){h+=3}var a=Math.max(Math.min(S.width||h+e+d+g,this.maxWidth),Math.max(S.minWidth||this.minWidth,H||0));if(S.prompt===true){z.setWidth(a-h-d-g)}if(S.progress===true||S.wait===true){I.setSize(a-h-d-g)}if(Ext.isIE&&a==H){a+=4}B.setSize(a,"auto").center();return this},updateProgress:function(a,b,d){I.updateProgress(a,b);if(d){this.updateText(d)}return this},isVisible:function(){return B&&B.isVisible()},hide:function(){var a=B.activeGhost;if(this.isVisible()||a){B.hide();w();if(a){a.hide()}}return this},show:function(e){if(this.isVisible()){this.hide()}S=e;var b=this.getDialog(S.title||"&#160;");b.setTitle(S.title||"&#160;");var d=(S.closable!==false&&S.progress!==true&&S.wait!==true);b.tools.close.setDisplayed(d);z=D;S.prompt=S.prompt||(S.multiline?true:false);if(S.prompt){if(S.multiline){D.hide();T.show();T.setHeight(typeof S.multiline=="number"?S.multiline:this.defaultTextHeight);z=T}else{D.show();T.hide()}}else{D.hide();T.hide()}z.dom.value=S.value||"";if(S.prompt){b.focusEl=z}else{var g=S.buttons;var a=null;if(g&&g.ok){a=E.ok}else{if(g&&g.yes){a=E.yes}}if(a){b.focusEl=a}}if(S.iconCls){b.setIconClass(S.iconCls)}this.setIcon(S.icon);H=K(S.buttons);I.setVisible(S.progress===true||S.wait===true);this.updateProgress(0,S.progressText);this.updateText(S.msg);if(S.cls){b.el.addClass(S.cls)}b.proxyDrag=S.proxyDrag===true;b.modal=S.modal!==false;b.mask=S.modal!==false?F:false;if(!b.isVisible()){document.body.appendChild(B.el.dom);b.setAnimateTarget(S.animEl);b.show(S.animEl)}b.on("show",function(){if(d===true){b.keyMap.enable()}else{b.keyMap.disable()}},this,{single:true});if(S.wait===true){I.wait(S.waitConfig)}return this},setIcon:function(a){if(a&&a!=""){L.removeClass("x-hidden");L.replaceClass(Q,a);Q=a}else{L.replaceClass(Q,"x-hidden");Q=""}return this},progress:function(d,a,b){this.show({title:d,msg:a,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth,progressText:b});return this},wait:function(d,a,b){this.show({title:a,msg:d,buttons:false,closable:false,wait:true,modal:true,minWidth:this.minProgressWidth,waitConfig:b});return this},alert:function(d,e,a,b){this.show({title:d,msg:e,buttons:this.OK,fn:a,scope:b});return this},confirm:function(d,e,a,b){this.show({title:d,msg:e,buttons:this.YESNO,fn:a,scope:b,icon:this.QUESTION});return this},prompt:function(h,b,g,a,d,e){this.show({title:h,msg:b,buttons:this.OKCANCEL,fn:g,minWidth:250,scope:a,prompt:true,multiline:d,value:e});return this},OK:{ok:true},CANCEL:{cancel:true},OKCANCEL:{ok:true,cancel:true},YESNO:{yes:true,no:true},YESNOCANCEL:{yes:true,no:true,cancel:true},INFO:"ext-mb-info",WARNING:"ext-mb-warning",QUESTION:"ext-mb-question",ERROR:"ext-mb-error",defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}}}();Ext.Msg=Ext.MessageBox;Ext.Tip=Ext.extend(Ext.Panel,{minWidth:40,maxWidth:300,shadow:"sides",defaultAlign:"tl-bl?",autoRender:true,quickShowInterval:250,frame:true,hidden:true,baseCls:"x-tip",floating:{shadow:true,shim:true,useDisplay:true,constrain:false},autoHeight:true,initComponent:function(){Ext.Tip.superclass.initComponent.call(this);if(this.closable&&!this.title){this.elements+=",header"}},afterRender:function(){Ext.Tip.superclass.afterRender.call(this);if(this.closable){this.addTool({id:"close",handler:this.hide,scope:this})}},showAt:function(b){Ext.Tip.superclass.show.call(this);if(this.measureWidth!==false&&(!this.initialConfig||typeof this.initialConfig.width!="number")){this.doAutoWidth()}if(this.constrainPosition){b=this.el.adjustForConstraints(b)}this.setPagePosition(b[0],b[1])},doAutoWidth:function(){var b=this.body.getTextWidth();if(this.title){b=Math.max(b,this.header.child("span").getTextWidth(this.title))}b+=this.getFrameWidth()+(this.closable?20:0)+this.body.getPadding("lr");this.setWidth(b.constrain(this.minWidth,this.maxWidth));if(Ext.isIE7&&!this.repainted){this.el.repaint();this.repainted=true}},showBy:function(e,d){if(!this.rendered){this.render(Ext.getBody())}this.showAt(this.el.getAlignToXY(e,d||this.defaultAlign))},initDraggable:function(){this.dd=new Ext.Tip.DD(this,typeof this.draggable=="boolean"?null:this.draggable);this.header.addClass("x-tip-draggable")}});Ext.Tip.DD=function(d,e){Ext.apply(this,e);this.tip=d;Ext.Tip.DD.superclass.constructor.call(this,d.el.id,"WindowDD-"+d.id);this.setHandleElId(d.header.id);this.scroll=false};Ext.extend(Ext.Tip.DD,Ext.dd.DD,{moveOnly:true,scroll:false,headerOffsets:[100,25],startDrag:function(){this.tip.el.disableShadow()},endDrag:function(b){this.tip.el.enableShadow(true)}});Ext.ToolTip=Ext.extend(Ext.Tip,{showDelay:500,hideDelay:200,dismissDelay:5000,mouseOffset:[15,18],trackMouse:false,constrainPosition:true,initComponent:function(){Ext.ToolTip.superclass.initComponent.call(this);this.lastActive=new Date();this.initTarget()},initTarget:function(){if(this.target){this.target=Ext.get(this.target);this.target.on("mouseover",this.onTargetOver,this);this.target.on("mouseout",this.onTargetOut,this);this.target.on("mousemove",this.onMouseMove,this)}},onMouseMove:function(b){this.targetXY=b.getXY();if(!this.hidden&&this.trackMouse){this.setPagePosition(this.getTargetXY())}},getTargetXY:function(){return[this.targetXY[0]+this.mouseOffset[0],this.targetXY[1]+this.mouseOffset[1]]},onTargetOver:function(b){if(this.disabled||b.within(this.target.dom,true)){return}this.clearTimer("hide");this.targetXY=b.getXY();this.delayShow()},delayShow:function(){if(this.hidden&&!this.showTimer){if(this.lastActive.getElapsed()<this.quickShowInterval){this.show()}else{this.showTimer=this.show.defer(this.showDelay,this)}}else{if(!this.hidden&&this.autoHide!==false){this.show()}}},onTargetOut:function(b){if(this.disabled||b.within(this.target.dom,true)){return}this.clearTimer("show");if(this.autoHide!==false){this.delayHide()}},delayHide:function(){if(!this.hidden&&!this.hideTimer){this.hideTimer=this.hide.defer(this.hideDelay,this)}},hide:function(){this.clearTimer("dismiss");this.lastActive=new Date();Ext.ToolTip.superclass.hide.call(this)},show:function(){this.showAt(this.getTargetXY())},showAt:function(b){this.lastActive=new Date();this.clearTimers();Ext.ToolTip.superclass.showAt.call(this,b);if(this.dismissDelay&&this.autoHide!==false){this.dismissTimer=this.hide.defer(this.dismissDelay,this)}},clearTimer:function(b){b=b+"Timer";clearTimeout(this[b]);delete this[b]},clearTimers:function(){this.clearTimer("show");this.clearTimer("dismiss");this.clearTimer("hide")},onShow:function(){Ext.ToolTip.superclass.onShow.call(this);Ext.getDoc().on("mousedown",this.onDocMouseDown,this)},onHide:function(){Ext.ToolTip.superclass.onHide.call(this);Ext.getDoc().un("mousedown",this.onDocMouseDown,this)},onDocMouseDown:function(b){if(this.autoHide!==false&&!b.within(this.el.dom)){this.disable();this.enable.defer(100,this)}},onDisable:function(){this.clearTimers();this.hide()},adjustPosition:function(g,h){var l=this.targetXY[1],e=this.getSize().height;if(this.constrainPosition&&h<=l&&(h+e)>=l){h=l-e-5}return{x:g,y:h}},onDestroy:function(){Ext.ToolTip.superclass.onDestroy.call(this);if(this.target){this.target.un("mouseover",this.onTargetOver,this);this.target.un("mouseout",this.onTargetOut,this);this.target.un("mousemove",this.onMouseMove,this)}}});Ext.QuickTip=Ext.extend(Ext.ToolTip,{interceptTitles:false,tagConfig:{namespace:"ext",attribute:"qtip",width:"qwidth",target:"target",title:"qtitle",hide:"hide",cls:"qclass",align:"qalign"},initComponent:function(){this.target=this.target||Ext.getDoc();this.targets=this.targets||{};Ext.QuickTip.superclass.initComponent.call(this)},register:function(t){var r=Ext.isArray(t)?t:arguments;for(var s=0,p=r.length;s<p;s++){var o=r[s];var q=o.target;if(q){if(Ext.isArray(q)){for(var u=0,m=q.length;u<m;u++){this.targets[Ext.id(q[u])]=o}}else{this.targets[Ext.id(q)]=o}}}},unregister:function(b){delete this.targets[Ext.id(b)]},onTargetOver:function(m){if(this.disabled){return}this.targetXY=m.getXY();var r=m.getTarget();if(!r||r.nodeType!==1||r==document||r==document.body){return}if(this.activeTarget&&r==this.activeTarget.el){this.clearTimer("hide");this.show();return}if(r&&this.targets[r.id]){this.activeTarget=this.targets[r.id];this.activeTarget.el=r;this.delayShow();return}var p,o=Ext.fly(r),e=this.tagConfig;var q=e.namespace;if(this.interceptTitles&&r.title){p=r.title;r.qtip=p;r.removeAttribute("title");m.preventDefault()}else{p=r.qtip||o.getAttributeNS(q,e.attribute)}if(p){var l=o.getAttributeNS(q,e.hide);this.activeTarget={el:r,text:p,width:o.getAttributeNS(q,e.width),autoHide:l!="user"&&l!=="false",title:o.getAttributeNS(q,e.title),cls:o.getAttributeNS(q,e.cls),align:o.getAttributeNS(q,e.align)};this.delayShow()}},onTargetOut:function(b){this.clearTimer("show");if(this.autoHide!==false){this.delayHide()}},showAt:function(d){var e=this.activeTarget;if(e){if(!this.rendered){this.render(Ext.getBody());this.activeTarget=e}if(e.width){this.setWidth(e.width);this.body.setWidth(this.adjustBodyWidth(e.width-this.getFrameWidth()));this.measureWidth=false}else{this.measureWidth=true}this.setTitle(e.title||"");this.body.update(e.text);this.autoHide=e.autoHide;this.dismissDelay=e.dismissDelay||this.dismissDelay;if(this.lastCls){this.el.removeClass(this.lastCls);delete this.lastCls}if(e.cls){this.el.addClass(e.cls);this.lastCls=e.cls}if(e.align){d=this.el.getAlignToXY(e.el,e.align);this.constrainPosition=false}else{this.constrainPosition=true}}Ext.QuickTip.superclass.showAt.call(this,d)},hide:function(){delete this.activeTarget;Ext.QuickTip.superclass.hide.call(this)}});Ext.QuickTips=function(){var d,e=[];return{init:function(a){if(!d){if(!Ext.isReady){Ext.onReady(function(){Ext.QuickTips.init(a)});return}d=new Ext.QuickTip({elements:"header,body"});if(a!==false){d.render(Ext.getBody())}}},enable:function(){if(d){e.pop();if(e.length<1){d.enable()}}},disable:function(){if(d){d.disable()}e.push(1)},isEnabled:function(){return d!==undefined&&!d.disabled},getQuickTip:function(){return d},register:function(){d.register.apply(d,arguments)},unregister:function(){d.unregister.apply(d,arguments)},tips:function(){d.register.apply(d,arguments)}}}();Ext.tree.TreePanel=Ext.extend(Ext.Panel,{rootVisible:true,animate:Ext.enableFx,lines:true,enableDD:false,hlDrop:Ext.enableFx,pathSeparator:"/",initComponent:function(){Ext.tree.TreePanel.superclass.initComponent.call(this);if(!this.eventModel){this.eventModel=new Ext.tree.TreeEventModel(this)}var b=this.loader;if(!b){b=new Ext.tree.TreeLoader({dataUrl:this.dataUrl})}else{if(typeof b=="object"&&!b.load){b=new Ext.tree.TreeLoader(b)}}this.loader=b;this.nodeHash={};if(this.root){this.setRootNode(this.root)}this.addEvents("append","remove","movenode","insert","beforeappend","beforeremove","beforemovenode","beforeinsert","beforeload","load","textchange","beforeexpandnode","beforecollapsenode","expandnode","disabledchange","collapsenode","beforeclick","click","checkchange","dblclick","contextmenu","beforechildrenrendered","startdrag","enddrag","dragdrop","beforenodedrop","nodedrop","nodedragover");if(this.singleExpand){this.on("beforeexpandnode",this.restrictExpand,this)}},proxyNodeEvent:function(s,l,m,o,p,q,r){if(s=="collapse"||s=="expand"||s=="beforecollapse"||s=="beforeexpand"||s=="move"||s=="beforemove"){s=s+"node"}return this.fireEvent(s,l,m,o,p,q,r)},getRootNode:function(){return this.root},setRootNode:function(d){if(!d.render){d=this.loader.createNode(d)}this.root=d;d.ownerTree=this;d.isRoot=true;this.registerNode(d);if(!this.rootVisible){var e=d.attributes.uiProvider;d.ui=e?new e(d):new Ext.tree.RootTreeNodeUI(d)}return d},getNodeById:function(b){return this.nodeHash[b]},registerNode:function(b){this.nodeHash[b.id]=b},unregisterNode:function(b){delete this.nodeHash[b.id]},toString:function(){return"[Tree"+(this.id?" "+this.id:"")+"]"},restrictExpand:function(e){var d=e.parentNode;if(d){if(d.expandedChild&&d.expandedChild.parentNode==d){d.expandedChild.collapse()}d.expandedChild=e}},getChecked:function(a,l){l=l||this.root;var h=[];var g=function(){if(this.attributes.checked){h.push(!a?this:(a=="id"?this.id:this.attributes[a]))}};l.cascade(g);return h},getEl:function(){return this.el},getLoader:function(){return this.loader},expandAll:function(){this.root.expand(true)},collapseAll:function(){this.root.collapse(true)},getSelectionModel:function(){if(!this.selModel){this.selModel=new Ext.tree.DefaultSelectionModel()}return this.selModel},expandPath:function(p,m,o){m=m||"id";var r=p.split(this.pathSeparator);var s=this.root;if(s.attributes[m]!=r[1]){if(o){o(false,null)}return}var l=1;var q=function(){if(++l==r.length){if(o){o(true,s)}return}var a=s.findChild(m,r[l]);if(!a){if(o){o(false,s)}return}s=a;a.expand(false,false,q)};s.expand(false,false,q)},selectPath:function(o,l,m){l=l||"id";var q=o.split(this.pathSeparator);var h=q.pop();if(q.length>0){var p=function(b,d){if(b&&d){var a=d.findChild(l,h);if(a){a.select();if(m){m(true,a)}}else{if(m){m(false,a)}}}else{if(m){m(false,a)}}};this.expandPath(q.join(this.pathSeparator),l,p)}else{this.root.select();if(m){m(true,this.root)}}},getTreeEl:function(){return this.body},onRender:function(d,e){Ext.tree.TreePanel.superclass.onRender.call(this,d,e);this.el.addClass("x-tree");this.innerCt=this.body.createChild({tag:"ul",cls:"x-tree-root-ct "+(this.useArrows?"x-tree-arrows":this.lines?"x-tree-lines":"x-tree-no-lines")})},initEvents:function(){Ext.tree.TreePanel.superclass.initEvents.call(this);if(this.containerScroll){Ext.dd.ScrollManager.register(this.body)}if((this.enableDD||this.enableDrop)&&!this.dropZone){this.dropZone=new Ext.tree.TreeDropZone(this,this.dropConfig||{ddGroup:this.ddGroup||"TreeDD",appendOnly:this.ddAppendOnly===true})}if((this.enableDD||this.enableDrag)&&!this.dragZone){this.dragZone=new Ext.tree.TreeDragZone(this,this.dragConfig||{ddGroup:this.ddGroup||"TreeDD",scroll:this.ddScroll})}this.getSelectionModel().init(this)},afterRender:function(){Ext.tree.TreePanel.superclass.afterRender.call(this);this.root.render();if(!this.rootVisible){this.root.renderChildren()}},onDestroy:function(){if(this.rendered){this.body.removeAllListeners();Ext.dd.ScrollManager.unregister(this.body);if(this.dropZone){this.dropZone.unreg()}if(this.dragZone){this.dragZone.unreg()}}this.root.destroy();this.nodeHash=null;Ext.tree.TreePanel.superclass.onDestroy.call(this)}});Ext.tree.TreePanel.nodeTypes={};Ext.reg("treepanel",Ext.tree.TreePanel);Ext.tree.TreeEventModel=function(b){this.tree=b;this.tree.on("render",this.initEvents,this)};Ext.tree.TreeEventModel.prototype={initEvents:function(){var b=this.tree.getTreeEl();b.on("click",this.delegateClick,this);if(this.tree.trackMouseOver!==false){b.on("mouseover",this.delegateOver,this);b.on("mouseout",this.delegateOut,this)}b.on("dblclick",this.delegateDblClick,this);b.on("contextmenu",this.delegateContextMenu,this)},getNode:function(d){var e;if(e=d.getTarget(".x-tree-node-el",10)){var g=Ext.fly(e,"_treeEvents").getAttributeNS("ext","tree-node-id");if(g){return this.tree.getNodeById(g)}}return null},getNodeTarget:function(d){var e=d.getTarget(".x-tree-node-icon",1);if(!e){e=d.getTarget(".x-tree-node-el",6)}return e},delegateOut:function(d,e){if(!this.beforeEvent(d)){return}if(d.getTarget(".x-tree-ec-icon",1)){var g=this.getNode(d);this.onIconOut(d,g);if(g==this.lastEcOver){delete this.lastEcOver}}if((e=this.getNodeTarget(d))&&!d.within(e,true)){this.onNodeOut(d,this.getNode(d))}},delegateOver:function(d,e){if(!this.beforeEvent(d)){return}if(this.lastEcOver){this.onIconOut(d,this.lastEcOver);delete this.lastEcOver}if(d.getTarget(".x-tree-ec-icon",1)){this.lastEcOver=this.getNode(d);this.onIconOver(d,this.lastEcOver)}if(e=this.getNodeTarget(d)){this.onNodeOver(d,this.getNode(d))}},delegateClick:function(d,e){if(!this.beforeEvent(d)){return}if(d.getTarget("input[type=checkbox]",1)){this.onCheckboxClick(d,this.getNode(d))}else{if(d.getTarget(".x-tree-ec-icon",1)){this.onIconClick(d,this.getNode(d))}else{if(this.getNodeTarget(d)){this.onNodeClick(d,this.getNode(d))}}}},delegateDblClick:function(d,e){if(this.beforeEvent(d)&&this.getNodeTarget(d)){this.onNodeDblClick(d,this.getNode(d))}},delegateContextMenu:function(d,e){if(this.beforeEvent(d)&&this.getNodeTarget(d)){this.onNodeContextMenu(d,this.getNode(d))}},onNodeClick:function(d,e){e.ui.onClick(d)},onNodeOver:function(d,e){e.ui.onOver(d)},onNodeOut:function(d,e){e.ui.onOut(d)},onIconOver:function(d,e){e.ui.addClass("x-tree-ec-over")},onIconOut:function(d,e){e.ui.removeClass("x-tree-ec-over")},onIconClick:function(d,e){e.ui.ecClick(d)},onCheckboxClick:function(d,e){e.ui.onCheckChange(d)},onNodeDblClick:function(d,e){e.ui.onDblClick(d)},onNodeContextMenu:function(d,e){e.ui.onContextMenu(d)},beforeEvent:function(b){if(this.disabled){b.stopEvent();return false}return true},disable:function(){this.disabled=true},enable:function(){this.disabled=false}};Ext.tree.DefaultSelectionModel=function(b){this.selNode=null;this.addEvents("selectionchange","beforeselect");Ext.apply(this,b);Ext.tree.DefaultSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.tree.DefaultSelectionModel,Ext.util.Observable,{init:function(b){this.tree=b;b.getTreeEl().on("keydown",this.onKeyDown,this);b.on("click",this.onNodeClick,this)},onNodeClick:function(e,d){this.select(e)},select:function(d){var e=this.selNode;if(e!=d&&this.fireEvent("beforeselect",this,d,e)!==false){if(e){e.ui.onSelectedChange(false)}this.selNode=d;d.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,d,e)}return d},unselect:function(b){if(this.selNode==b){this.clearSelections()}},clearSelections:function(){var b=this.selNode;if(b){b.ui.onSelectedChange(false);this.selNode=null;this.fireEvent("selectionchange",this,null)}return b},getSelectedNode:function(){return this.selNode},isSelected:function(b){return this.selNode==b},selectPrevious:function(){var e=this.selNode||this.lastSelNode;if(!e){return null}var g=e.previousSibling;if(g){if(!g.isExpanded()||g.childNodes.length<1){return this.select(g)}else{var d=g.lastChild;while(d&&d.isExpanded()&&d.childNodes.length>0){d=d.lastChild}return this.select(d)}}else{if(e.parentNode&&(this.tree.rootVisible||!e.parentNode.isRoot)){return this.select(e.parentNode)}}return null},selectNext:function(){var d=this.selNode||this.lastSelNode;if(!d){return null}if(d.firstChild&&d.isExpanded()){return this.select(d.firstChild)}else{if(d.nextSibling){return this.select(d.nextSibling)}else{if(d.parentNode){var e=null;d.parentNode.bubble(function(){if(this.nextSibling){e=this.getOwnerTree().selModel.select(this.nextSibling);return false}});return e}}}return null},onKeyDown:function(l){var e=this.selNode||this.lastSelNode;var h=this;if(!e){return}var g=l.getKey();switch(g){case l.DOWN:l.stopEvent();this.selectNext();break;case l.UP:l.stopEvent();this.selectPrevious();break;case l.RIGHT:l.preventDefault();if(e.hasChildNodes()){if(!e.isExpanded()){e.expand()}else{if(e.firstChild){this.select(e.firstChild,l)}}}break;case l.LEFT:l.preventDefault();if(e.hasChildNodes()&&e.isExpanded()){e.collapse()}else{if(e.parentNode&&(this.tree.rootVisible||e.parentNode!=this.tree.getRootNode())){this.select(e.parentNode,l)}}break}}});Ext.tree.MultiSelectionModel=function(b){this.selNodes=[];this.selMap={};this.addEvents("selectionchange");Ext.apply(this,b);Ext.tree.MultiSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.tree.MultiSelectionModel,Ext.util.Observable,{init:function(b){this.tree=b;b.getTreeEl().on("keydown",this.onKeyDown,this);b.on("click",this.onNodeClick,this)},onNodeClick:function(e,d){this.select(e,d,d.ctrlKey)},select:function(e,g,d){if(d!==true){this.clearSelections(true)}if(this.isSelected(e)){this.lastSelNode=e;return e}this.selNodes.push(e);this.selMap[e.id]=e;this.lastSelNode=e;e.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,this.selNodes);return e},unselect:function(d){if(this.selMap[d.id]){d.ui.onSelectedChange(false);var g=this.selNodes;var e=g.indexOf(d);if(e!=-1){this.selNodes.splice(e,1)}delete this.selMap[d.id];this.fireEvent("selectionchange",this,this.selNodes)}},clearSelections:function(e){var h=this.selNodes;if(h.length>0){for(var l=0,g=h.length;l<g;l++){h[l].ui.onSelectedChange(false)}this.selNodes=[];this.selMap={};if(e!==true){this.fireEvent("selectionchange",this,this.selNodes)}}},isSelected:function(b){return this.selMap[b.id]?true:false},getSelectedNodes:function(){return this.selNodes},onKeyDown:Ext.tree.DefaultSelectionModel.prototype.onKeyDown,selectNext:Ext.tree.DefaultSelectionModel.prototype.selectNext,selectPrevious:Ext.tree.DefaultSelectionModel.prototype.selectPrevious});Ext.tree.TreeNode=function(e){e=e||{};if(typeof e=="string"){e={text:e}}this.childrenRendered=false;this.rendered=false;Ext.tree.TreeNode.superclass.constructor.call(this,e);this.expanded=e.expanded===true;this.isTarget=e.isTarget!==false;this.draggable=e.draggable!==false&&e.allowDrag!==false;this.allowChildren=e.allowChildren!==false&&e.allowDrop!==false;this.text=e.text;this.disabled=e.disabled===true;this.addEvents("textchange","beforeexpand","beforecollapse","expand","disabledchange","collapse","beforeclick","click","checkchange","dblclick","contextmenu","beforechildrenrendered");var d=this.attributes.uiProvider||this.defaultUI||Ext.tree.TreeNodeUI;this.ui=new d(this)};Ext.extend(Ext.tree.TreeNode,Ext.data.Node,{preventHScroll:true,isExpanded:function(){return this.expanded},getUI:function(){return this.ui},getLoader:function(){var b;return this.loader||((b=this.getOwnerTree())&&b.loader?b.loader:new Ext.tree.TreeLoader())},setFirstChild:function(e){var d=this.firstChild;Ext.tree.TreeNode.superclass.setFirstChild.call(this,e);if(this.childrenRendered&&d&&e!=d){d.renderIndent(true,true)}if(this.rendered){this.renderIndent(true,true)}},setLastChild:function(d){var e=this.lastChild;Ext.tree.TreeNode.superclass.setLastChild.call(this,d);if(this.childrenRendered&&e&&d!=e){e.renderIndent(true,true)}if(this.rendered){this.renderIndent(true,true)}},appendChild:function(d){if(!d.render&&!Ext.isArray(d)){d=this.getLoader().createNode(d)}var e=Ext.tree.TreeNode.superclass.appendChild.call(this,d);if(e&&this.childrenRendered){e.render()}this.ui.updateExpandIcon();return e},removeChild:function(b){this.ownerTree.getSelectionModel().unselect(b);Ext.tree.TreeNode.superclass.removeChild.apply(this,arguments);if(this.childrenRendered){b.ui.remove()}if(this.childNodes.length<1){this.collapse(false,false)}else{this.ui.updateExpandIcon()}if(!this.firstChild&&!this.isHiddenRoot()){this.childrenRendered=false}return b},insertBefore:function(g,e){if(!g.render){g=this.getLoader().createNode(g)}var d=Ext.tree.TreeNode.superclass.insertBefore.apply(this,arguments);if(d&&e&&this.childrenRendered){g.render()}this.ui.updateExpandIcon();return d},setText:function(d){var e=this.text;this.text=d;this.attributes.text=d;if(this.rendered){this.ui.onTextChange(this,d,e)}this.fireEvent("textchange",this,d,e)},select:function(){this.getOwnerTree().getSelectionModel().select(this)},unselect:function(){this.getOwnerTree().getSelectionModel().unselect(this)},isSelected:function(){return this.getOwnerTree().getSelectionModel().isSelected(this)},expand:function(e,d,g){if(!this.expanded){if(this.fireEvent("beforeexpand",this,e,d)===false){return}if(!this.childrenRendered){this.renderChildren()}this.expanded=true;if(!this.isHiddenRoot()&&(this.getOwnerTree().animate&&d!==false)||d){this.ui.animExpand(function(){this.fireEvent("expand",this);if(typeof g=="function"){g(this)}if(e===true){this.expandChildNodes(true)}}.createDelegate(this));return}else{this.ui.expand();this.fireEvent("expand",this);if(typeof g=="function"){g(this)}}}else{if(typeof g=="function"){g(this)}}if(e===true){this.expandChildNodes(true)}},isHiddenRoot:function(){return this.isRoot&&!this.getOwnerTree().rootVisible},collapse:function(g,l){if(this.expanded&&!this.isHiddenRoot()){if(this.fireEvent("beforecollapse",this,g,l)===false){return}this.expanded=false;if((this.getOwnerTree().animate&&l!==false)||l){this.ui.animCollapse(function(){this.fireEvent("collapse",this);if(g===true){this.collapseChildNodes(true)}}.createDelegate(this));return}else{this.ui.collapse();this.fireEvent("collapse",this)}}if(g===true){var m=this.childNodes;for(var o=0,h=m.length;o<h;o++){m[o].collapse(true,false)}}},delayedExpand:function(b){if(!this.expandProcId){this.expandProcId=this.expand.defer(b,this)}},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId)}this.expandProcId=false},toggle:function(){if(this.expanded){this.collapse()}else{this.expand()}},ensureVisible:function(d){var e=this.getOwnerTree();e.expandPath(this.parentNode?this.parentNode.getPath():this.getPath(),false,function(){var a=e.getNodeById(this.id);e.getTreeEl().scrollChildIntoView(a.ui.anchor);Ext.callback(d)}.createDelegate(this))},expandChildNodes:function(e){var h=this.childNodes;for(var l=0,g=h.length;l<g;l++){h[l].expand(e)}},collapseChildNodes:function(e){var h=this.childNodes;for(var l=0,g=h.length;l<g;l++){h[l].collapse(e)}},disable:function(){this.disabled=true;this.unselect();if(this.rendered&&this.ui.onDisableChange){this.ui.onDisableChange(this,true)}this.fireEvent("disabledchange",this,true)},enable:function(){this.disabled=false;if(this.rendered&&this.ui.onDisableChange){this.ui.onDisableChange(this,false)}this.fireEvent("disabledchange",this,false)},renderChildren:function(e){if(e!==false){this.fireEvent("beforechildrenrendered",this)}var h=this.childNodes;for(var l=0,g=h.length;l<g;l++){h[l].render(true)}this.childrenRendered=true},sort:function(l,m){Ext.tree.TreeNode.superclass.sort.apply(this,arguments);if(this.childrenRendered){var o=this.childNodes;for(var g=0,h=o.length;g<h;g++){o[g].render(true)}}},render:function(b){this.ui.render(b);if(!this.rendered){this.getOwnerTree().registerNode(this);this.rendered=true;if(this.expanded){this.expanded=false;this.expand(false,false)}}},renderIndent:function(g,l){if(l){this.ui.childIndent=null}this.ui.renderIndent();if(g===true&&this.childrenRendered){var m=this.childNodes;for(var o=0,h=m.length;o<h;o++){m[o].renderIndent(true,l)}}},beginUpdate:function(){this.childrenRendered=false},endUpdate:function(){if(this.expanded&&this.rendered){this.renderChildren()}},destroy:function(){if(this.childNodes){for(var d=0,e=this.childNodes.length;d<e;d++){this.childNodes[d].destroy()}this.childNodes=null}if(this.ui.destroy){this.ui.destroy()}}});Ext.tree.TreePanel.nodeTypes.node=Ext.tree.TreeNode;Ext.tree.AsyncTreeNode=function(b){this.loaded=b&&b.loaded===true;this.loading=false;Ext.tree.AsyncTreeNode.superclass.constructor.apply(this,arguments);this.addEvents("beforeload","load")};Ext.extend(Ext.tree.AsyncTreeNode,Ext.tree.TreeNode,{expand:function(h,p,m){if(this.loading){var o;var q=function(){if(!this.loading){clearInterval(o);this.expand(h,p,m)}}.createDelegate(this);o=setInterval(q,200);return}if(!this.loaded){if(this.fireEvent("beforeload",this)===false){return}this.loading=true;this.ui.beforeLoad(this);var l=this.loader||this.attributes.loader||this.getOwnerTree().getLoader();if(l){l.load(this,this.loadComplete.createDelegate(this,[h,p,m]));return}}Ext.tree.AsyncTreeNode.superclass.expand.call(this,h,p,m)},isLoading:function(){return this.loading},loadComplete:function(e,d,g){this.loading=false;this.loaded=true;this.ui.afterLoad(this);this.fireEvent("load",this);this.expand(e,d,g)},isLoaded:function(){return this.loaded},hasChildNodes:function(){if(!this.isLeaf()&&!this.loaded){return true}else{return Ext.tree.AsyncTreeNode.superclass.hasChildNodes.call(this)}},reload:function(b){this.collapse(false,false);while(this.firstChild){this.removeChild(this.firstChild).destroy()}this.childrenRendered=false;this.loaded=false;if(this.isHiddenRoot()){this.expanded=false}this.expand(false,false,b)}});Ext.tree.TreePanel.nodeTypes.async=Ext.tree.AsyncTreeNode;Ext.tree.TreeNodeUI=function(b){this.node=b;this.rendered=false;this.animating=false;this.wasLeaf=true;this.ecc="x-tree-ec-icon x-tree-elbow";this.emptyIcon=Ext.BLANK_IMAGE_URL};Ext.tree.TreeNodeUI.prototype={removeChild:function(b){if(this.rendered){this.ctNode.removeChild(b.ui.getEl())}},beforeLoad:function(){this.addClass("x-tree-node-loading")},afterLoad:function(){this.removeClass("x-tree-node-loading")},onTextChange:function(d,g,e){if(this.rendered){this.textNode.innerHTML=g}},onDisableChange:function(e,d){this.disabled=d;if(this.checkbox){this.checkbox.disabled=d}if(d){this.addClass("x-tree-node-disabled")}else{this.removeClass("x-tree-node-disabled")}},onSelectedChange:function(b){if(b){this.focus();this.addClass("x-tree-selected")}else{this.removeClass("x-tree-selected")}},onMove:function(m,p,r,q,s,l){this.childIndent=null;if(this.rendered){var o=q.ui.getContainer();if(!o){this.holder=document.createElement("div");this.holder.appendChild(this.wrap);return}var t=l?l.ui.getEl():null;if(t){o.insertBefore(this.wrap,t)}else{o.appendChild(this.wrap)}this.node.renderIndent(true)}},addClass:function(b){if(this.elNode){Ext.fly(this.elNode).addClass(b)}},removeClass:function(b){if(this.elNode){Ext.fly(this.elNode).removeClass(b)}},remove:function(){if(this.rendered){this.holder=document.createElement("div");this.holder.appendChild(this.wrap)}},fireEvent:function(){return this.node.fireEvent.apply(this.node,arguments)},initEvents:function(){this.node.on("move",this.onMove,this);if(this.node.disabled){this.addClass("x-tree-node-disabled");if(this.checkbox){this.checkbox.disabled=true}}if(this.node.hidden){this.hide()}var d=this.node.getOwnerTree();var e=d.enableDD||d.enableDrag||d.enableDrop;if(e&&(!this.node.isRoot||d.rootVisible)){Ext.dd.Registry.register(this.elNode,{node:this.node,handles:this.getDDHandles(),isHandle:false})}},getDDHandles:function(){return[this.iconNode,this.textNode,this.elNode]},hide:function(){this.node.hidden=true;if(this.wrap){this.wrap.style.display="none"}},show:function(){this.node.hidden=false;if(this.wrap){this.wrap.style.display=""}},onContextMenu:function(b){if(this.node.hasListener("contextmenu")||this.node.getOwnerTree().hasListener("contextmenu")){b.preventDefault();this.focus();this.fireEvent("contextmenu",this.node,b)}},onClick:function(d){if(this.dropping){d.stopEvent();return}if(this.fireEvent("beforeclick",this.node,d)!==false){var a=d.getTarget("a");if(!this.disabled&&this.node.attributes.href&&a){this.fireEvent("click",this.node,d);return}else{if(a&&d.ctrlKey){d.stopEvent()}}d.preventDefault();if(this.disabled){return}if(this.node.attributes.singleClickExpand&&!this.animating&&this.node.isExpandable()){this.node.toggle()}this.fireEvent("click",this.node,d)}else{d.stopEvent()}},onDblClick:function(b){b.preventDefault();if(this.disabled){return}if(this.checkbox){this.toggleCheck()}if(!this.animating&&this.node.isExpandable()){this.node.toggle()}this.fireEvent("dblclick",this.node,b)},onOver:function(b){this.addClass("x-tree-node-over")},onOut:function(b){this.removeClass("x-tree-node-over")},onCheckChange:function(){var b=this.checkbox.checked;this.checkbox.defaultChecked=b;this.node.attributes.checked=b;this.fireEvent("checkchange",this.node,b)},ecClick:function(b){if(!this.animating&&this.node.isExpandable()){this.node.toggle()}},startDrop:function(){this.dropping=true},endDrop:function(){setTimeout(function(){this.dropping=false}.createDelegate(this),50)},expand:function(){this.updateExpandIcon();this.ctNode.style.display=""},focus:function(){if(!this.node.preventHScroll){try{this.anchor.focus()}catch(g){}}else{try{var d=this.node.getOwnerTree().getTreeEl().dom;var e=d.scrollLeft;this.anchor.focus();d.scrollLeft=e}catch(g){}}},toggleCheck:function(d){var e=this.checkbox;if(e){e.checked=(d===undefined?!e.checked:d);this.onCheckChange()}},blur:function(){try{this.anchor.blur()}catch(b){}},animExpand:function(d){var e=Ext.get(this.ctNode);e.stopFx();if(!this.node.isExpandable()){this.updateExpandIcon();this.ctNode.style.display="";Ext.callback(d);return}this.animating=true;this.updateExpandIcon();e.slideIn("t",{callback:function(){this.animating=false;Ext.callback(d)},scope:this,duration:this.node.ownerTree.duration||0.25})},highlight:function(){var b=this.node.getOwnerTree();Ext.fly(this.wrap).highlight(b.hlColor||"C3DAF9",{endColor:b.hlBaseColor})},collapse:function(){this.updateExpandIcon();this.ctNode.style.display="none"},animCollapse:function(d){var e=Ext.get(this.ctNode);e.enableDisplayMode("block");e.stopFx();this.animating=true;this.updateExpandIcon();e.slideOut("t",{callback:function(){this.animating=false;Ext.callback(d)},scope:this,duration:this.node.ownerTree.duration||0.25})},getContainer:function(){return this.ctNode},getEl:function(){return this.wrap},appendDDGhost:function(b){b.appendChild(this.elNode.cloneNode(true))},getDDRepairXY:function(){return Ext.lib.Dom.getXY(this.iconNode)},onRender:function(){this.render()},render:function(l){var g=this.node,a=g.attributes;var h=g.parentNode?g.parentNode.ui.getContainer():g.ownerTree.innerCt.dom;if(!this.rendered){this.rendered=true;this.renderElements(g,a,h,l);if(a.qtip){if(this.textNode.setAttributeNS){this.textNode.setAttributeNS("ext","qtip",a.qtip);if(a.qtipTitle){this.textNode.setAttributeNS("ext","qtitle",a.qtipTitle)}}else{this.textNode.setAttribute("ext:qtip",a.qtip);if(a.qtipTitle){this.textNode.setAttribute("ext:qtitle",a.qtipTitle)}}}else{if(a.qtipCfg){a.qtipCfg.target=Ext.id(this.textNode);Ext.QuickTips.register(a.qtipCfg)}}this.initEvents();if(!this.node.expanded){this.updateExpandIcon(true)}}else{if(l===true){h.appendChild(this.wrap)}}},renderElements:function(t,o,p,a){this.indentMarkup=t.parentNode?t.parentNode.ui.getChildIndent():"";var s=typeof o.checked=="boolean";var v=o.href?o.href:Ext.isGecko?"":"#";var u=['<li class="x-tree-node"><div ext:tree-node-id="',t.id,'" class="x-tree-node-el x-tree-node-leaf x-unselectable ',o.cls,'" unselectable="on">','<span class="x-tree-node-indent">',this.indentMarkup,"</span>",'<img src="',this.emptyIcon,'" class="x-tree-ec-icon x-tree-elbow" />','<img src="',o.icon||this.emptyIcon,'" class="x-tree-node-icon',(o.icon?" x-tree-node-inline-icon":""),(o.iconCls?" "+o.iconCls:""),'" unselectable="on" />',s?('<input class="x-tree-node-cb" type="checkbox" '+(o.checked?'checked="checked" />':"/>")):"",'<a hidefocus="on" class="x-tree-node-anchor" href="',v,'" tabIndex="1" ',o.hrefTarget?' target="'+o.hrefTarget+'"':"",'><span unselectable="on">',t.text,"</span></a></div>",'<ul class="x-tree-node-ct" style="display:none;"></ul>',"</li>"].join("");var w;if(a!==true&&t.nextSibling&&(w=t.nextSibling.ui.getEl())){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",w,u)}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",p,u)}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var q=this.elNode.childNodes;this.indentNode=q[0];this.ecNode=q[1];this.iconNode=q[2];var r=3;if(s){this.checkbox=q[3];this.checkbox.defaultChecked=this.checkbox.checked;r++}this.anchor=q[r];this.textNode=q[r].firstChild},getAnchor:function(){return this.anchor},getTextEl:function(){return this.textNode},getIconEl:function(){return this.iconNode},isChecked:function(){return this.checkbox?this.checkbox.checked:false},updateExpandIcon:function(){if(this.rendered){var l=this.node,m,o;var h=l.isLast()?"x-tree-elbow-end":"x-tree-elbow";if(l.isExpandable()){if(l.expanded){h+="-minus";m="x-tree-node-collapsed";o="x-tree-node-expanded"}else{h+="-plus";m="x-tree-node-expanded";o="x-tree-node-collapsed"}if(this.wasLeaf){this.removeClass("x-tree-node-leaf");this.wasLeaf=false}if(this.c1!=m||this.c2!=o){Ext.fly(this.elNode).replaceClass(m,o);this.c1=m;this.c2=o}}else{if(!this.wasLeaf){Ext.fly(this.elNode).replaceClass("x-tree-node-expanded","x-tree-node-leaf");delete this.c1;delete this.c2;this.wasLeaf=true}}var g="x-tree-ec-icon "+h;if(this.ecc!=g){this.ecNode.className=g;this.ecc=g}}},getChildIndent:function(){if(!this.childIndent){var e=[];var d=this.node;while(d){if(!d.isRoot||(d.isRoot&&d.ownerTree.rootVisible)){if(!d.isLast()){e.unshift('<img src="'+this.emptyIcon+'" class="x-tree-elbow-line" />')}else{e.unshift('<img src="'+this.emptyIcon+'" class="x-tree-icon" />')}}d=d.parentNode}this.childIndent=e.join("")}return this.childIndent},renderIndent:function(){if(this.rendered){var e="";var d=this.node.parentNode;if(d){e=d.ui.getChildIndent()}if(this.indentMarkup!=e){this.indentNode.innerHTML=e;this.indentMarkup=e}this.updateExpandIcon()}},destroy:function(){if(this.elNode){Ext.dd.Registry.unregister(this.elNode.id)}delete this.elNode;delete this.ctNode;delete this.indentNode;delete this.ecNode;delete this.iconNode;delete this.checkbox;delete this.anchor;delete this.textNode;if(this.holder){delete this.wrap;Ext.removeNode(this.holder);delete this.holder}else{Ext.removeNode(this.wrap);delete this.wrap}}};Ext.tree.RootTreeNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{render:function(){if(!this.rendered){var b=this.node.ownerTree.innerCt.dom;this.node.expanded=true;b.innerHTML='<div class="x-tree-root-node"></div>';this.wrap=this.ctNode=b.firstChild}},collapse:Ext.emptyFn,expand:Ext.emptyFn});Ext.tree.TreeLoader=function(b){this.baseParams={};Ext.apply(this,b);this.addEvents("beforeload","load","loadexception");Ext.tree.TreeLoader.superclass.constructor.call(this)};Ext.extend(Ext.tree.TreeLoader,Ext.util.Observable,{uiProviders:{},clearOnLoad:true,load:function(e,d){if(this.clearOnLoad){while(e.firstChild){e.removeChild(e.firstChild)}}if(this.doPreload(e)){if(typeof d=="function"){d()}}else{if(this.dataUrl||this.url){this.requestData(e,d)}}},doPreload:function(m){if(m.attributes.children){if(m.childNodes.length<1){var o=m.attributes.children;m.beginUpdate();for(var g=0,h=o.length;g<h;g++){var l=m.appendChild(this.createNode(o[g]));if(this.preloadChildren){this.doPreload(l)}}m.endUpdate()}return true}else{return false}},getParams:function(h){var g=[],l=this.baseParams;for(var e in l){if(typeof l[e]!="function"){g.push(encodeURIComponent(e),"=",encodeURIComponent(l[e]),"&")}}g.push("node=",encodeURIComponent(h.id));return g.join("")},requestData:function(e,d){if(this.fireEvent("beforeload",this,e,d)!==false){this.transId=Ext.Ajax.request({method:this.requestMethod,url:this.dataUrl||this.url,success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{callback:d,node:e},params:this.getParams(e)})}else{if(typeof d=="function"){d()}}},isLoading:function(){return !!this.transId},abort:function(){if(this.isLoading()){Ext.Ajax.abort(this.transId)}},createNode:function(attr){if(this.baseAttrs){Ext.applyIf(attr,this.baseAttrs)}if(this.applyLoader!==false){attr.loader=this}if(typeof attr.uiProvider=="string"){attr.uiProvider=this.uiProviders[attr.uiProvider]||eval(attr.uiProvider)}if(attr.nodeType){return new Ext.tree.TreePanel.nodeTypes[attr.nodeType](attr)}else{return attr.leaf?new Ext.tree.TreeNode(attr):new Ext.tree.AsyncTreeNode(attr)}},processResponse:function(response,node,callback){var json=response.responseText;try{var o=eval("("+json+")");node.beginUpdate();for(var i=0,len=o.length;i<len;i++){var n=this.createNode(o[i]);if(n){node.appendChild(n)}}node.endUpdate();if(typeof callback=="function"){callback(this,node)}}catch(e){this.handleFailure(response)}},handleResponse:function(d){this.transId=false;var a=d.argument;this.processResponse(d,a.node,a.callback);this.fireEvent("load",this,a.node,d)},handleFailure:function(d){this.transId=false;var a=d.argument;this.fireEvent("loadexception",this,a.node,d);if(typeof a.callback=="function"){a.callback(this,a.node)}}});Ext.tree.TreeFilter=function(e,d){this.tree=e;this.filtered={};Ext.apply(this,d)};Ext.tree.TreeFilter.prototype={clearBlank:false,reverse:false,autoClear:false,remove:false,filter:function(m,h,g){h=h||"text";var o;if(typeof m=="string"){var l=m.length;if(l==0&&this.clearBlank){this.clear();return}m=m.toLowerCase();o=function(a){return a.attributes[h].substr(0,l).toLowerCase()==m}}else{if(m.exec){o=function(a){return m.test(a.attributes[h])}}else{throw"Illegal filter type, must be string or regex"}}this.filterBy(o,null,g)},filterBy:function(s,t,l){l=l||this.tree.root;if(this.autoClear){this.clear()}var m=this.filtered,o=this.reverse;var r=function(a){if(a==l){return true}if(m[a.id]){return false}var b=s.call(t||a,a);if(!b||o){m[a.id]=a;a.ui.hide();return false}return true};l.cascade(r);if(this.remove){for(var p in m){if(typeof p!="function"){var q=m[p];if(q&&q.parentNode){q.parentNode.removeChild(q)}}}}},clear:function(){var e=this.tree;var g=this.filtered;for(var h in g){if(typeof h!="function"){var l=g[h];if(l){l.ui.show()}}}this.filtered={}}};Ext.tree.TreeSorter=function(l,t){Ext.apply(this,t);l.on("beforechildrenrendered",this.doSort,this);l.on("append",this.updateSort,this);l.on("insert",this.updateSort,this);l.on("textchange",this.updateSortParent,this);var r=this.dir&&this.dir.toLowerCase()=="desc";var q=this.property||"text";var p=this.sortType;var m=this.folderSort;var s=this.caseSensitive===true;var o=this.leafAttr||"leaf";this.sortFn=function(b,d){if(m){if(b.attributes[o]&&!d.attributes[o]){return 1}if(!b.attributes[o]&&d.attributes[o]){return -1}}var e=p?p(b):(s?b.attributes[q]:b.attributes[q].toUpperCase());var a=p?p(d):(s?d.attributes[q]:d.attributes[q].toUpperCase());if(e<a){return r?+1:-1}else{if(e>a){return r?-1:+1}else{return 0}}}};Ext.tree.TreeSorter.prototype={doSort:function(b){b.sort(this.sortFn)},compareNodes:function(d,e){return(d.text.toUpperCase()>e.text.toUpperCase()?1:-1)},updateSort:function(e,d){if(d.childrenRendered){this.doSort.defer(1,this,[d])}},updateSortParent:function(e){var d=e.parentNode;if(d&&d.childrenRendered){this.doSort.defer(1,this,[d])}}};if(Ext.dd.DropZone){Ext.tree.TreeDropZone=function(e,d){this.allowParentInsert=false;this.allowContainerDrop=false;this.appendOnly=false;Ext.tree.TreeDropZone.superclass.constructor.call(this,e.innerCt,d);this.tree=e;this.dragOverData={};this.lastInsertClass="x-tree-no-status"};Ext.extend(Ext.tree.TreeDropZone,Ext.dd.DropZone,{ddGroup:"TreeDD",expandDelay:1000,expandNode:function(b){if(b.hasChildNodes()&&!b.isExpanded()){b.expand(false,null,this.triggerCacheRefresh.createDelegate(this))}},queueExpand:function(b){this.expandProcId=this.expandNode.defer(this.expandDelay,this,[b])},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId);this.expandProcId=false}},isValidDropPoint:function(u,e,o,r,s){if(!u||!s){return false}var q=u.node;var p=s.node;if(!(q&&q.isTarget&&e)){return false}if(e=="append"&&q.allowChildren===false){return false}if((e=="above"||e=="below")&&(q.parentNode&&q.parentNode.allowChildren===false)){return false}if(p&&(q==p||p.contains(q))){return false}var t=this.dragOverData;t.tree=this.tree;t.target=q;t.data=s;t.point=e;t.source=o;t.rawEvent=r;t.dropNode=p;t.cancel=false;var m=this.tree.fireEvent("nodedragover",t);return t.cancel===false&&m!==false},getDropPoint:function(u,v,q){var e=v.node;if(e.isRoot){return e.allowChildren!==false?"append":false}var z=v.ddel;var b=Ext.lib.Dom.getY(z),s=b+z.offsetHeight;var t=Ext.lib.Event.getPageY(u);var r=e.allowChildren===false||e.isLeaf();if(this.appendOnly||e.parentNode.allowChildren===false){return r?false:"append"}var w=false;if(!this.allowParentInsert){w=e.hasChildNodes()&&e.isExpanded()}var B=(s-b)/(r?2:3);if(t>=b&&t<(b+B)){return"above"}else{if(!w&&(r||t>=s-B&&t<=s)){return"below"}else{return"append"}}},onNodeEnter:function(h,g,l,e){this.cancelExpand()},onNodeOver:function(t,o,p,q){var e=this.getDropPoint(p,t,o);var s=t.node;if(!this.expandProcId&&e=="append"&&s.hasChildNodes()&&!t.node.isExpanded()){this.queueExpand(s)}else{if(e!="append"){this.cancelExpand()}}var r=this.dropNotAllowed;if(this.isValidDropPoint(t,e,o,p,q)){if(e){var u=t.ddel;var m;if(e=="above"){r=t.node.isFirst()?"x-tree-drop-ok-above":"x-tree-drop-ok-between";m="x-tree-drag-insert-above"}else{if(e=="below"){r=t.node.isLast()?"x-tree-drop-ok-below":"x-tree-drop-ok-between";m="x-tree-drag-insert-below"}else{r="x-tree-drop-ok-append";m="x-tree-drag-append"}}if(this.lastInsertClass!=m){Ext.fly(u).replaceClass(this.lastInsertClass,m);this.lastInsertClass=m}}}return r},onNodeOut:function(h,g,l,e){this.cancelExpand();this.removeDropIndicators(h)},onNodeDrop:function(s,e,q,r){var m=this.getDropPoint(q,s,e);var p=s.node;p.ui.startDrop();if(!this.isValidDropPoint(s,m,e,q,r)){p.ui.endDrop();return false}var o=r.node||(e.getTreeNode?e.getTreeNode(r,p,m,q):null);var t={tree:this.tree,target:p,data:r,point:m,source:e,rawEvent:q,dropNode:o,cancel:!o,dropStatus:false};var u=this.tree.fireEvent("beforenodedrop",t);if(u===false||t.cancel===true||!t.dropNode){p.ui.endDrop();return t.dropStatus}p=t.target;if(m=="append"&&!p.isExpanded()){p.expand(false,null,function(){this.completeDrop(t)}.createDelegate(this))}else{this.completeDrop(t)}return true},completeDrop:function(o){var r=o.dropNode,q=o.point,s=o.target;if(!Ext.isArray(r)){r=[r]}var p;for(var l=0,m=r.length;l<m;l++){p=r[l];if(q=="above"){s.parentNode.insertBefore(p,s)}else{if(q=="below"){s.parentNode.insertBefore(p,s.nextSibling)}else{s.appendChild(p)}}}p.ui.focus();if(Ext.enableFx&&this.tree.hlDrop){p.ui.highlight()}s.ui.endDrop();this.tree.fireEvent("nodedrop",o)},afterNodeMoved:function(h,o,l,m,e){if(Ext.enableFx&&this.tree.hlDrop){e.ui.focus();e.ui.highlight()}this.tree.fireEvent("nodedrop",this.tree,m,o,h,l)},getTree:function(){return this.tree},removeDropIndicators:function(d){if(d&&d.ddel){var e=d.ddel;Ext.fly(e).removeClass(["x-tree-drag-insert-above","x-tree-drag-insert-below","x-tree-drag-append"]);this.lastInsertClass="_noclass"}},beforeDragDrop:function(d,e,g){this.cancelExpand();return true},afterRepair:function(b){if(b&&Ext.enableFx){b.node.ui.highlight()}this.hideProxy()}})}if(Ext.dd.DragZone){Ext.tree.TreeDragZone=function(e,d){Ext.tree.TreeDragZone.superclass.constructor.call(this,e.getTreeEl(),d);this.tree=e};Ext.extend(Ext.tree.TreeDragZone,Ext.dd.DragZone,{ddGroup:"TreeDD",onBeforeDrag:function(e,d){var g=e.node;return g&&g.draggable&&!g.disabled},onInitDrag:function(d){var e=this.dragData;this.tree.getSelectionModel().select(e.node);this.tree.eventModel.disable();this.proxy.update("");e.node.ui.appendDDGhost(this.proxy.ghost.dom);this.tree.fireEvent("startdrag",this.tree,e.node,d)},getRepairXY:function(d,e){return e.node.ui.getDDRepairXY()},onEndDrag:function(e,d){this.tree.eventModel.enable.defer(100,this.tree.eventModel);this.tree.fireEvent("enddrag",this.tree,e.node,d)},onValidDrop:function(e,d,g){this.tree.fireEvent("dragdrop",this.tree,this.dragData.node,e,d);this.hideProxy()},beforeInvalidDrop:function(e,g){var d=this.tree.getSelectionModel();d.clearSelections();d.select(this.dragData.node)},afterRepair:function(){if(Ext.enableFx&&this.tree.hlDrop){Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9")}this.dragging=false}})}Ext.tree.TreeEditor=function(g,l,e){l=l||{};var h=l.events?l:new Ext.form.TextField(l);Ext.tree.TreeEditor.superclass.constructor.call(this,h,e);this.tree=g;if(!g.rendered){g.on("render",this.initEditor,this)}else{this.initEditor(g)}};Ext.extend(Ext.tree.TreeEditor,Ext.Editor,{alignment:"l-l",autoSize:false,hideEl:false,cls:"x-small-editor x-tree-editor",shim:false,shadow:"frame",maxWidth:250,editDelay:350,initEditor:function(b){b.on("beforeclick",this.beforeNodeClick,this);b.on("dblclick",this.onNodeDblClick,this);this.on("complete",this.updateNode,this);this.on("beforestartedit",this.fitToTree,this);this.on("startedit",this.bindScroll,this,{delay:10});this.on("specialkey",this.onSpecialKey,this)},fitToTree:function(g,o){var l=this.tree.getTreeEl().dom,m=o.dom;if(l.scrollLeft>m.offsetLeft){l.scrollLeft=m.offsetLeft}var h=Math.min(this.maxWidth,(l.clientWidth>20?l.clientWidth:l.offsetWidth)-Math.max(0,m.offsetLeft-l.scrollLeft)-5);this.setSize(h,"")},triggerEdit:function(e,d){this.completeEdit();if(e.attributes.editable!==false){this.editNode=e;if(this.tree.autoScroll){e.ui.getEl().scrollIntoView(this.tree.body)}this.autoEditTimer=this.startEdit.defer(this.editDelay,this,[e.ui.textNode,e.text]);return false}},bindScroll:function(){this.tree.getTreeEl().on("scroll",this.cancelEdit,this)},beforeNodeClick:function(e,d){clearTimeout(this.autoEditTimer);if(this.tree.getSelectionModel().isSelected(e)){d.stopEvent();return this.triggerEdit(e)}},onNodeDblClick:function(e,d){clearTimeout(this.autoEditTimer)},updateNode:function(e,d){this.tree.getTreeEl().un("scroll",this.cancelEdit,this);this.editNode.setText(d)},onHide:function(){Ext.tree.TreeEditor.superclass.onHide.call(this);if(this.editNode){this.editNode.ui.focus.defer(50,this.editNode.ui)}},onSpecialKey:function(g,d){var e=d.getKey();if(e==d.ESC){d.stopEvent();this.cancelEdit()}else{if(e==d.ENTER&&!d.hasModifier()){d.stopEvent();this.completeEdit()}}}});Ext.menu.Menu=function(e){if(Ext.isArray(e)){e={items:e}}Ext.apply(this,e);this.id=this.id||Ext.id();this.addEvents("beforeshow","beforehide","show","hide","click","mouseover","mouseout","itemclick");Ext.menu.MenuMgr.register(this);Ext.menu.Menu.superclass.constructor.call(this);var d=this.items;this.items=new Ext.util.MixedCollection();if(d){this.add.apply(this,d)}};Ext.extend(Ext.menu.Menu,Ext.util.Observable,{minWidth:120,shadow:"sides",subMenuAlign:"tl-tr?",defaultAlign:"tl-bl?",allowOtherMenus:false,ignoreParentClicks:false,hidden:true,createEl:function(){return new Ext.Layer({cls:"x-menu",shadow:this.shadow,constrain:false,parentEl:this.parentEl||document.body,zindex:15000})},render:function(){if(this.el){return}var d=this.el=this.createEl();if(!this.keyNav){this.keyNav=new Ext.menu.MenuNav(this)}if(this.plain){d.addClass("x-menu-plain")}if(this.cls){d.addClass(this.cls)}this.focusEl=d.createChild({tag:"a",cls:"x-menu-focus",href:"#",onclick:"return false;",tabIndex:"-1"});var e=d.createChild({tag:"ul",cls:"x-menu-list"});e.on("click",this.onClick,this);e.on("mouseover",this.onMouseOver,this);e.on("mouseout",this.onMouseOut,this);this.items.each(function(a){var b=document.createElement("li");b.className="x-menu-list-item";e.dom.appendChild(b);a.render(b,this)},this);this.ul=e;this.autoWidth()},autoWidth:function(){var h=this.el,l=this.ul;if(!h){return}var g=this.width;if(g){h.setWidth(g)}else{if(Ext.isIE){h.setWidth(this.minWidth);var e=h.dom.offsetWidth;h.setWidth(l.getWidth()+h.getFrameWidth("lr"))}}},delayAutoWidth:function(){if(this.el){if(!this.awTask){this.awTask=new Ext.util.DelayedTask(this.autoWidth,this)}this.awTask.delay(20)}},findTargetItem:function(d){var e=d.getTarget(".x-menu-list-item",this.ul,true);if(e&&e.menuItemId){return this.items.get(e.menuItemId)}},onClick:function(d){var e;if(e=this.findTargetItem(d)){if(e.menu&&this.ignoreParentClicks){e.expandMenu()}else{e.onClick(d);this.fireEvent("click",this,e,d)}}},setActiveItem:function(e,d){if(e!=this.activeItem){if(this.activeItem){this.activeItem.deactivate()}this.activeItem=e;e.activate(d)}else{if(d){e.expandMenu()}}},tryActivate:function(m,o){var h=this.items;for(var q=m,l=h.length;q>=0&&q<l;q+=o){var p=h.get(q);if(!p.disabled&&p.canActivate){this.setActiveItem(p,false);return p}}return false},onMouseOver:function(d){var e;if(e=this.findTargetItem(d)){if(e.canActivate&&!e.disabled){this.setActiveItem(e,true)}}this.over=true;this.fireEvent("mouseover",this,d,e)},onMouseOut:function(d){var e;if(e=this.findTargetItem(d)){if(e==this.activeItem&&e.shouldDeactivate(d)){this.activeItem.deactivate();delete this.activeItem}}this.over=false;this.fireEvent("mouseout",this,d,e)},isVisible:function(){return this.el&&!this.hidden},show:function(d,g,e){this.parentMenu=e;if(!this.el){this.render()}this.fireEvent("beforeshow",this);this.showAt(this.el.getAlignToXY(d,g||this.defaultAlign),e,false)},showAt:function(g,d,e){this.parentMenu=d;if(!this.el){this.render()}if(e!==false){this.fireEvent("beforeshow",this);g=this.el.adjustForConstraints(g)}this.el.setXY(g);this.el.show();this.hidden=false;this.focus();this.fireEvent("show",this)},focus:function(){if(!this.hidden){this.doFocus.defer(50,this)}},doFocus:function(){if(!this.hidden){this.focusEl.focus()}},hide:function(b){if(this.el&&this.isVisible()){this.fireEvent("beforehide",this);if(this.activeItem){this.activeItem.deactivate();this.activeItem=null}this.el.hide();this.hidden=true;this.fireEvent("hide",this)}if(b===true&&this.parentMenu){this.parentMenu.hide(true)}},add:function(){var o=arguments,a=o.length,h;for(var m=0;m<a;m++){var l=o[m];if(l.render){h=this.addItem(l)}else{if(typeof l=="string"){if(l=="separator"||l=="-"){h=this.addSeparator()}else{h=this.addText(l)}}else{if(l.tagName||l.el){h=this.addElement(l)}else{if(typeof l=="object"){Ext.applyIf(l,this.defaults);h=this.addMenuItem(l)}}}}}return h},getEl:function(){if(!this.el){this.render()}return this.el},addSeparator:function(){return this.addItem(new Ext.menu.Separator())},addElement:function(b){return this.addItem(new Ext.menu.BaseItem(b))},addItem:function(d){this.items.add(d);if(this.ul){var e=document.createElement("li");e.className="x-menu-list-item";this.ul.dom.appendChild(e);d.render(e,this);this.delayAutoWidth()}return d},addMenuItem:function(b){if(!(b instanceof Ext.menu.Item)){if(typeof b.checked=="boolean"){b=new Ext.menu.CheckItem(b)}else{b=new Ext.menu.Item(b)}}return this.addItem(b)},addText:function(b){return this.addItem(new Ext.menu.TextItem(b))},insert:function(d,g){this.items.insert(d,g);if(this.ul){var e=document.createElement("li");e.className="x-menu-list-item";this.ul.dom.insertBefore(e,this.ul.dom.childNodes[d]);g.render(e,this);this.delayAutoWidth()}return g},remove:function(b){this.items.removeKey(b.id);b.destroy()},removeAll:function(){if(this.items){var b;while(b=this.items.first()){this.remove(b)}}},destroy:function(){this.beforeDestroy();Ext.menu.MenuMgr.unregister(this);if(this.keyNav){this.keyNav.disable()}this.removeAll();if(this.ul){this.ul.removeAllListeners()}if(this.el){this.el.destroy()}},beforeDestroy:Ext.emptyFn});Ext.menu.MenuNav=function(b){Ext.menu.MenuNav.superclass.constructor.call(this,b.el);this.scope=this.menu=b};Ext.extend(Ext.menu.MenuNav,Ext.KeyNav,{doRelay:function(g,d){var e=g.getKey();if(!this.menu.activeItem&&g.isNavKeyPress()&&e!=g.SPACE&&e!=g.RETURN){this.menu.tryActivate(0,1);return false}return d.call(this.scope||this,g,this.menu)},up:function(d,e){if(!e.tryActivate(e.items.indexOf(e.activeItem)-1,-1)){e.tryActivate(e.items.length-1,-1)}},down:function(d,e){if(!e.tryActivate(e.items.indexOf(e.activeItem)+1,1)){e.tryActivate(0,1)}},right:function(d,e){if(e.activeItem){e.activeItem.expandMenu(true)}},left:function(d,e){e.hide();if(e.parentMenu&&e.parentMenu.activeItem){e.parentMenu.activeItem.activate()}},enter:function(d,e){if(e.activeItem){d.stopPropagation();e.activeItem.onClick(d);e.fireEvent("click",this,e.activeItem);return true}}});Ext.menu.MenuMgr=function(){var w,B,C={},E=false,r=new Date();function p(){w={};B=new Ext.util.MixedCollection();Ext.getDoc().addKeyListener(27,function(){if(B.length>0){u()}})}function u(){if(B&&B.length>0){var a=B.clone();a.each(function(b){b.hide()})}}function z(a){B.remove(a);if(B.length<1){Ext.getDoc().un("mousedown",q);E=false}}function s(b){var a=B.last();r=new Date();B.add(b);if(!E){Ext.getDoc().on("mousedown",q);E=true}if(b.parentMenu){b.getEl().setZIndex(parseInt(b.parentMenu.getEl().getStyle("z-index"),10)+3);b.parentMenu.activeChild=b}else{if(a&&a.isVisible()){b.getEl().setZIndex(parseInt(a.getEl().getStyle("z-index"),10)+3)}}}function D(a){if(a.activeChild){a.activeChild.hide()}if(a.autoHideTimer){clearTimeout(a.autoHideTimer);delete a.autoHideTimer}}function v(b){var a=b.parentMenu;if(!a&&!b.allowOtherMenus){u()}else{if(a&&a.activeChild){a.activeChild.hide()}}}function q(a){if(r.getElapsed()>50&&B.length>0&&!a.getTarget(".x-menu")){u()}}function t(e,a){if(a){var b=C[e.group];for(var d=0,g=b.length;d<g;d++){if(b[d]!=e){b[d].setChecked(false)}}}}return{hideAll:function(){u()},register:function(a){if(!w){p()}w[a.id]=a;a.on("beforehide",D);a.on("hide",z);a.on("beforeshow",v);a.on("show",s);var b=a.group;if(b&&a.events.checkchange){if(!C[b]){C[b]=[]}C[b].push(a);a.on("checkchange",onCheck)}},get:function(a){if(typeof a=="string"){if(!w){return null}return w[a]}else{if(a.events){return a}else{if(typeof a.length=="number"){return new Ext.menu.Menu({items:a})}else{return new Ext.menu.Menu(a)}}}},unregister:function(a){delete w[a.id];a.un("beforehide",D);a.un("hide",z);a.un("beforeshow",v);a.un("show",s);var b=a.group;if(b&&a.events.checkchange){C[b].remove(a);a.un("checkchange",onCheck)}},registerCheckable:function(b){var a=b.group;if(a){if(!C[a]){C[a]=[]}C[a].push(b);b.on("beforecheckchange",t)}},unregisterCheckable:function(b){var a=b.group;if(a){C[a].remove(b);b.un("beforecheckchange",t)}},getCheckedItem:function(b){var a=C[b];if(a){for(var d=0,e=a.length;d<e;d++){if(a[d].checked){return a[d]}}}return null},setCheckedItem:function(d,a){var b=C[d];if(b){for(var e=0,g=b.length;e<g;e++){if(b[e].id==a){b[e].setChecked(true)}}}return null}}}();Ext.menu.BaseItem=function(b){Ext.menu.BaseItem.superclass.constructor.call(this,b);this.addEvents("click","activate","deactivate");if(this.handler){this.on("click",this.handler,this.scope)}};Ext.extend(Ext.menu.BaseItem,Ext.Component,{canActivate:false,activeClass:"x-menu-item-active",hideOnClick:true,hideDelay:100,ctype:"Ext.menu.BaseItem",actionMode:"container",render:function(e,d){this.parentMenu=d;Ext.menu.BaseItem.superclass.render.call(this,e);this.container.menuItemId=this.id},onRender:function(d,e){this.el=Ext.get(this.el);if(this.id){this.el.id=this.id}d.dom.appendChild(this.el.dom)},setHandler:function(d,e){if(this.handler){this.un("click",this.handler,this.scope)}this.on("click",this.handler=d,this.scope=e)},onClick:function(b){if(!this.disabled&&this.fireEvent("click",this,b)!==false&&this.parentMenu.fireEvent("itemclick",this,b)!==false){this.handleClick(b)}else{b.stopEvent()}},activate:function(){if(this.disabled){return false}var b=this.container;b.addClass(this.activeClass);this.region=b.getRegion().adjust(2,2,-2,-2);this.fireEvent("activate",this);return true},deactivate:function(){this.container.removeClass(this.activeClass);this.fireEvent("deactivate",this)},shouldDeactivate:function(b){return !this.region||!this.region.contains(b.getPoint())},handleClick:function(b){if(this.hideOnClick){this.parentMenu.hide.defer(this.hideDelay,this.parentMenu,[true])}},expandMenu:function(b){},hideMenu:function(){}});Ext.menu.TextItem=function(b){if(typeof b=="string"){b={text:b}}Ext.menu.TextItem.superclass.constructor.call(this,b)};Ext.extend(Ext.menu.TextItem,Ext.menu.BaseItem,{hideOnClick:false,itemCls:"x-menu-text",onRender:function(){var b=document.createElement("span");b.className=this.itemCls;b.innerHTML=this.text;this.el=b;Ext.menu.TextItem.superclass.onRender.apply(this,arguments)}});Ext.menu.Separator=function(b){Ext.menu.Separator.superclass.constructor.call(this,b)};Ext.extend(Ext.menu.Separator,Ext.menu.BaseItem,{itemCls:"x-menu-sep",hideOnClick:false,onRender:function(e){var d=document.createElement("span");d.className=this.itemCls;d.innerHTML="&#160;";this.el=d;e.addClass("x-menu-sep-li");Ext.menu.Separator.superclass.onRender.apply(this,arguments)}});Ext.menu.Item=function(b){Ext.menu.Item.superclass.constructor.call(this,b);if(this.menu){this.menu=Ext.menu.MenuMgr.get(this.menu)}};Ext.extend(Ext.menu.Item,Ext.menu.BaseItem,{itemCls:"x-menu-item",canActivate:true,showDelay:200,hideDelay:200,ctype:"Ext.menu.Item",onRender:function(d,e){var g=document.createElement("a");g.hideFocus=true;g.unselectable="on";g.href=this.href||"#";if(this.hrefTarget){g.target=this.hrefTarget}g.className=this.itemCls+(this.menu?" x-menu-item-arrow":"")+(this.cls?" "+this.cls:"");g.innerHTML=String.format('<img src="{0}" class="x-menu-item-icon {2}" />{1}',this.icon||Ext.BLANK_IMAGE_URL,this.itemText||this.text,this.iconCls||"");this.el=g;Ext.menu.Item.superclass.onRender.call(this,d,e)},setText:function(b){this.text=b;if(this.rendered){this.el.update(String.format('<img src="{0}" class="x-menu-item-icon {2}">{1}',this.icon||Ext.BLANK_IMAGE_URL,this.text,this.iconCls||""));this.parentMenu.autoWidth()}},setIconClass:function(e){var d=this.iconCls;this.iconCls=e;if(this.rendered){this.el.child("img.x-menu-item-icon").replaceClass(d,this.iconCls)}},beforeDestroy:function(){if(this.menu){this.menu.destroy()}Ext.menu.Item.superclass.beforeDestroy.call(this)},handleClick:function(b){if(!this.href){b.stopEvent()}Ext.menu.Item.superclass.handleClick.apply(this,arguments)},activate:function(b){if(Ext.menu.Item.superclass.activate.apply(this,arguments)){this.focus();if(b){this.expandMenu()}}return true},shouldDeactivate:function(b){if(Ext.menu.Item.superclass.shouldDeactivate.call(this,b)){if(this.menu&&this.menu.isVisible()){return !this.menu.getEl().getRegion().contains(b.getPoint())}return true}return false},deactivate:function(){Ext.menu.Item.superclass.deactivate.apply(this,arguments);this.hideMenu()},expandMenu:function(b){if(!this.disabled&&this.menu){clearTimeout(this.hideTimer);delete this.hideTimer;if(!this.menu.isVisible()&&!this.showTimer){this.showTimer=this.deferExpand.defer(this.showDelay,this,[b])}else{if(this.menu.isVisible()&&b){this.menu.tryActivate(0,1)}}}},deferExpand:function(b){delete this.showTimer;this.menu.show(this.container,this.parentMenu.subMenuAlign||"tl-tr?",this.parentMenu);if(b){this.menu.tryActivate(0,1)}},hideMenu:function(){clearTimeout(this.showTimer);delete this.showTimer;if(!this.hideTimer&&this.menu&&this.menu.isVisible()){this.hideTimer=this.deferHide.defer(this.hideDelay,this)}},deferHide:function(){delete this.hideTimer;if(this.menu.over){this.parentMenu.setActiveItem(this,false)}else{this.menu.hide()}}});Ext.menu.CheckItem=function(b){Ext.menu.CheckItem.superclass.constructor.call(this,b);this.addEvents("beforecheckchange","checkchange");if(this.checkHandler){this.on("checkchange",this.checkHandler,this.scope)}Ext.menu.MenuMgr.registerCheckable(this)};Ext.extend(Ext.menu.CheckItem,Ext.menu.Item,{itemCls:"x-menu-item x-menu-check-item",groupClass:"x-menu-group-item",checked:false,ctype:"Ext.menu.CheckItem",onRender:function(b){Ext.menu.CheckItem.superclass.onRender.apply(this,arguments);if(this.group){this.el.addClass(this.groupClass)}if(this.checked){this.checked=false;this.setChecked(true,true)}},destroy:function(){Ext.menu.MenuMgr.unregisterCheckable(this);Ext.menu.CheckItem.superclass.destroy.apply(this,arguments)},setChecked:function(d,e){if(this.checked!=d&&this.fireEvent("beforecheckchange",this,d)!==false){if(this.container){this.container[d?"addClass":"removeClass"]("x-menu-item-checked")}this.checked=d;if(e!==true){this.fireEvent("checkchange",this,d)}}},handleClick:function(b){if(!this.disabled&&!(this.checked&&this.group)){this.setChecked(!this.checked)}Ext.menu.CheckItem.superclass.handleClick.apply(this,arguments)}});Ext.menu.Adapter=function(d,e){Ext.menu.Adapter.superclass.constructor.call(this,e);this.component=d};Ext.extend(Ext.menu.Adapter,Ext.menu.BaseItem,{canActivate:true,onRender:function(d,e){this.component.render(d);this.el=this.component.getEl()},activate:function(){if(this.disabled){return false}this.component.focus();this.fireEvent("activate",this);return true},deactivate:function(){this.fireEvent("deactivate",this)},disable:function(){this.component.disable();Ext.menu.Adapter.superclass.disable.call(this)},enable:function(){this.component.enable();Ext.menu.Adapter.superclass.enable.call(this)}});Ext.menu.DateItem=function(b){Ext.menu.DateItem.superclass.constructor.call(this,new Ext.DatePicker(b),b);this.picker=this.component;this.addEvents("select");this.picker.on("render",function(a){a.getEl().swallowEvent("click");a.container.addClass("x-menu-date-item")});this.picker.on("select",this.onSelect,this)};Ext.extend(Ext.menu.DateItem,Ext.menu.Adapter,{onSelect:function(d,e){this.fireEvent("select",this,e,d);Ext.menu.DateItem.superclass.handleClick.call(this)}});Ext.menu.ColorItem=function(b){Ext.menu.ColorItem.superclass.constructor.call(this,new Ext.ColorPalette(b),b);this.palette=this.component;this.relayEvents(this.palette,["select"]);if(this.selectHandler){this.on("select",this.selectHandler,this.scope)}};Ext.extend(Ext.menu.ColorItem,Ext.menu.Adapter);Ext.menu.DateMenu=function(e){Ext.menu.DateMenu.superclass.constructor.call(this,e);this.plain=true;var d=new Ext.menu.DateItem(e);this.add(d);this.picker=d.picker;this.relayEvents(d,["select"]);this.on("beforeshow",function(){if(this.picker){this.picker.hideMonthPicker(true)}},this)};Ext.extend(Ext.menu.DateMenu,Ext.menu.Menu,{cls:"x-date-menu",beforeDestroy:function(){this.picker.destroy()}});Ext.menu.ColorMenu=function(e){Ext.menu.ColorMenu.superclass.constructor.call(this,e);this.plain=true;var d=new Ext.menu.ColorItem(e);this.add(d);this.palette=d.palette;this.relayEvents(d,["select"])};Ext.extend(Ext.menu.ColorMenu,Ext.menu.Menu,{beforeDestroy:function(){this.palette.destroy()}});Ext.form.Field=Ext.extend(Ext.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"off"},fieldClass:"x-form-field",msgTarget:"qtip",msgFx:"normal",readOnly:false,disabled:false,isFormField:true,hasFocus:false,initComponent:function(){Ext.form.Field.superclass.initComponent.call(this);this.addEvents("focus","blur","specialkey","change","invalid","valid")},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:(this.hiddenName||"")},onRender:function(l,g){Ext.form.Field.superclass.onRender.call(this,l,g);if(!this.el){var e=this.getAutoCreate();if(!e.name){e.name=this.name||this.id}if(this.inputType){e.type=this.inputType}this.el=l.createChild(e,g)}var h=this.el.dom.type;if(h){if(h=="password"){h="text"}this.el.addClass("x-form-"+h)}if(this.readOnly){this.el.dom.readOnly=true}if(this.tabIndex!==undefined){this.el.dom.setAttribute("tabIndex",this.tabIndex)}this.el.addClass([this.fieldClass,this.cls])},initValue:function(){if(this.value!==undefined){this.setValue(this.value)}else{if(this.el.dom.value.length>0&&this.el.dom.value!=this.emptyText){this.setValue(this.el.dom.value)}}this.originalValue=this.getValue()},isDirty:function(){if(this.disabled){return false}return String(this.getValue())!==String(this.originalValue)},afterRender:function(){Ext.form.Field.superclass.afterRender.call(this);this.initEvents();this.initValue()},fireKey:function(b){if(b.isSpecialKey()){this.fireEvent("specialkey",this,b)}},reset:function(){this.setValue(this.originalValue);this.clearInvalid()},initEvents:function(){this.el.on(Ext.isIE||Ext.isSafari3?"keydown":"keypress",this.fireKey,this);this.el.on("focus",this.onFocus,this);var b=this.inEditor&&Ext.isWindows&&Ext.isGecko?{buffer:10}:null;this.el.on("blur",this.onBlur,this,b)},onFocus:function(){if(this.focusClass){this.el.addClass(this.focusClass)}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this)}},beforeBlur:Ext.emptyFn,onBlur:function(){this.beforeBlur();if(this.focusClass){this.el.removeClass(this.focusClass)}this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate()}var b=this.getValue();if(String(b)!==String(this.startValue)){this.fireEvent("change",this,b,this.startValue)}this.fireEvent("blur",this)},isValid:function(e){if(this.disabled){return true}var g=this.preventMark;this.preventMark=e===true;var d=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=g;return d},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true}return false},processValue:function(b){return b},validateValue:function(b){return true},markInvalid:function(g){if(!this.rendered||this.preventMark){return}this.el.addClass(this.invalidClass);g=g||this.invalidText;switch(this.msgTarget){case"qtip":this.el.dom.qtip=g;this.el.dom.qclass="x-form-invalid-tip";if(Ext.QuickTips){Ext.QuickTips.enable()}break;case"title":this.el.dom.title=g;break;case"under":if(!this.errorEl){var d=this.getErrorCt();if(!d){this.el.dom.title=g;break}this.errorEl=d.createChild({cls:"x-form-invalid-msg"});this.errorEl.setWidth(d.getWidth(true)-20)}this.errorEl.update(g);Ext.form.Field.msgFx[this.msgFx].show(this.errorEl,this);break;case"side":if(!this.errorIcon){var d=this.getErrorCt();if(!d){this.el.dom.title=g;break}this.errorIcon=d.createChild({cls:"x-form-invalid-icon"})}this.alignErrorIcon();this.errorIcon.dom.qtip=g;this.errorIcon.dom.qclass="x-form-invalid-tip";this.errorIcon.show();this.on("resize",this.alignErrorIcon,this);break;default:var e=Ext.getDom(this.msgTarget);e.innerHTML=g;e.style.display=this.msgDisplay;break}this.fireEvent("invalid",this,g)},getErrorCt:function(){return this.el.findParent(".x-form-element",5,true)||this.el.findParent(".x-form-field-wrap",5,true)},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,"tl-tr",[2,0])},clearInvalid:function(){if(!this.rendered||this.preventMark){return}this.el.removeClass(this.invalidClass);switch(this.msgTarget){case"qtip":this.el.dom.qtip="";break;case"title":this.el.dom.title="";break;case"under":if(this.errorEl){Ext.form.Field.msgFx[this.msgFx].hide(this.errorEl,this)}break;case"side":if(this.errorIcon){this.errorIcon.dom.qtip="";this.errorIcon.hide();this.un("resize",this.alignErrorIcon,this)}break;default:var b=Ext.getDom(this.msgTarget);b.innerHTML="";b.style.display="none";break}this.fireEvent("valid",this)},getRawValue:function(){var b=this.rendered?this.el.getValue():Ext.value(this.value,"");if(b===this.emptyText){b=""}return b},getValue:function(){if(!this.rendered){return this.value}var b=this.el.getValue();if(b===this.emptyText||b===undefined){b=""}return b},setRawValue:function(b){return this.el.dom.value=(b===null||b===undefined?"":b)},setValue:function(b){this.value=b;if(this.rendered){this.el.dom.value=(b===null||b===undefined?"":b);this.validate()}},adjustSize:function(e,g){var d=Ext.form.Field.superclass.adjustSize.call(this,e,g);d.width=this.adjustWidth(this.el.dom.tagName,d.width);return d},adjustWidth:function(e,d){e=e.toLowerCase();if(typeof d=="number"&&!Ext.isSafari){if(Ext.isIE&&(e=="input"||e=="textarea")){if(e=="input"&&!Ext.isStrict){return this.inEditor?d:d-3}if(e=="input"&&Ext.isStrict){return d-(Ext.isIE6?4:1)}if(e=="textarea"&&Ext.isStrict){return d-2}}else{if(Ext.isOpera&&Ext.isStrict){if(e=="input"){return d+2}if(e=="textarea"){return d-2}}}}return d}});Ext.form.MessageTargets={qtip:{mark:function(b){this.el.dom.qtip=msg;this.el.dom.qclass="x-form-invalid-tip";if(Ext.QuickTips){Ext.QuickTips.enable()}},clear:function(b){this.el.dom.qtip=""}},title:{mark:function(b){this.el.dom.title=msg},clear:function(b){this.el.dom.title=""}},under:{mark:function(d){if(!this.errorEl){var e=this.getErrorCt();if(!e){this.el.dom.title=msg;return}this.errorEl=e.createChild({cls:"x-form-invalid-msg"});this.errorEl.setWidth(e.getWidth(true)-20)}this.errorEl.update(msg);Ext.form.Field.msgFx[this.msgFx].show(this.errorEl,this)},clear:function(b){if(this.errorEl){Ext.form.Field.msgFx[this.msgFx].hide(this.errorEl,this)}else{this.el.dom.title=""}}},side:{mark:function(d){if(!this.errorIcon){var e=this.getErrorCt();if(!e){this.el.dom.title=msg;return}this.errorIcon=e.createChild({cls:"x-form-invalid-icon"})}this.alignErrorIcon();this.errorIcon.dom.qtip=msg;this.errorIcon.dom.qclass="x-form-invalid-tip";this.errorIcon.show();this.on("resize",this.alignErrorIcon,this)},clear:function(b){if(this.errorIcon){this.errorIcon.dom.qtip="";this.errorIcon.hide();this.un("resize",this.alignErrorIcon,this)}else{this.el.dom.title=""}}},around:{mark:function(b){},clear:function(b){}}};Ext.form.Field.msgFx={normal:{show:function(e,d){e.setDisplayed("block")},hide:function(e,d){e.setDisplayed(false).update("")}},slide:{show:function(e,d){e.slideIn("t",{stopFx:true})},hide:function(e,d){e.slideOut("t",{stopFx:true,useDisplay:true})}},slideRight:{show:function(e,d){e.fixDisplay();e.alignTo(d.el,"tl-tr");e.slideIn("l",{stopFx:true})},hide:function(e,d){e.slideOut("l",{stopFx:true,useDisplay:true})}}};Ext.reg("field",Ext.form.Field);Ext.form.TextField=Ext.extend(Ext.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,emptyClass:"x-form-empty-field",initComponent:function(){Ext.form.TextField.superclass.initComponent.call(this);this.addEvents("autosize","keydown","keyup","keypress")},initEvents:function(){Ext.form.TextField.superclass.initEvents.call(this);if(this.validationEvent=="keyup"){this.validationTask=new Ext.util.DelayedTask(this.validate,this);this.el.on("keyup",this.filterValidation,this)}else{if(this.validationEvent!==false){this.el.on(this.validationEvent,this.validate,this,{buffer:this.validationDelay})}}if(this.selectOnFocus||this.emptyText){this.on("focus",this.preFocus,this);this.el.on("mousedown",function(){if(!this.hasFocus){this.el.on("mouseup",function(b){b.preventDefault()},this,{single:true})}},this);if(this.emptyText){this.on("blur",this.postBlur,this);this.applyEmptyText()}}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Ext.form.VTypes[this.vtype+"Mask"]))){this.el.on("keypress",this.filterKeys,this)}if(this.grow){this.el.on("keyup",this.onKeyUpBuffered,this,{buffer:50});this.el.on("click",this.autoSize,this)}if(this.enableKeyEvents){this.el.on("keyup",this.onKeyUp,this);this.el.on("keydown",this.onKeyDown,this);this.el.on("keypress",this.onKeyPress,this)}},processValue:function(e){if(this.stripCharsRe){var d=e.replace(this.stripCharsRe,"");if(d!==e){this.setRawValue(d);return d}}return e},filterValidation:function(b){if(!b.isNavKeyPress()){this.validationTask.delay(this.validationDelay)}},onDisable:function(){Ext.form.TextField.superclass.onDisable.call(this);if(Ext.isIE){this.el.dom.unselectable="on"}},onEnable:function(){Ext.form.TextField.superclass.onEnable.call(this);if(Ext.isIE){this.el.dom.unselectable=""}},onKeyUpBuffered:function(b){if(!b.isNavKeyPress()){this.autoSize()}},onKeyUp:function(b){this.fireEvent("keyup",this,b)},onKeyDown:function(b){this.fireEvent("keydown",this,b)},onKeyPress:function(b){this.fireEvent("keypress",this,b)},reset:function(){Ext.form.TextField.superclass.reset.call(this);this.applyEmptyText()},applyEmptyText:function(){if(this.rendered&&this.emptyText&&this.getRawValue().length<1&&!this.hasFocus){this.setRawValue(this.emptyText);this.el.addClass(this.emptyClass)}},preFocus:function(){if(this.emptyText){if(this.el.dom.value==this.emptyText){this.setRawValue("")}this.el.removeClass(this.emptyClass)}if(this.selectOnFocus){this.el.dom.select()}},postBlur:function(){this.applyEmptyText()},filterKeys:function(e){if(e.ctrlKey){return}var h=e.getKey();if(Ext.isGecko&&(e.isNavKeyPress()||h==e.BACKSPACE||(h==e.DELETE&&e.button==-1))){return}var l=e.getCharCode(),m=String.fromCharCode(l);if(!Ext.isGecko&&e.isSpecialKey()&&!m){return}if(!this.maskRe.test(m)){e.stopEvent()}},setValue:function(b){if(this.emptyText&&this.el&&b!==undefined&&b!==null&&b!==""){this.el.removeClass(this.emptyClass)}Ext.form.TextField.superclass.setValue.apply(this,arguments);this.applyEmptyText();this.autoSize()},validateValue:function(e){if(e.length<1||e===this.emptyText){if(this.allowBlank){this.clearInvalid();return true}else{this.markInvalid(this.blankText);return false}}if(e.length<this.minLength){this.markInvalid(String.format(this.minLengthText,this.minLength));return false}if(e.length>this.maxLength){this.markInvalid(String.format(this.maxLengthText,this.maxLength));return false}if(this.vtype){var g=Ext.form.VTypes;if(!g[this.vtype](e,this)){this.markInvalid(this.vtypeText||g[this.vtype+"Text"]);return false}}if(typeof this.validator=="function"){var d=this.validator(e);if(d!==true){this.markInvalid(d);return false}}if(this.regex&&!this.regex.test(e)){this.markInvalid(this.regexText);return false}return true},selectText:function(m,l){var q=this.getRawValue();var p=false;if(q.length>0){m=m===undefined?0:m;l=l===undefined?q.length:l;var o=this.el.dom;if(o.setSelectionRange){o.setSelectionRange(m,l)}else{if(o.createTextRange){var d=o.createTextRange();d.moveStart("character",m);d.moveEnd("character",l-q.length);d.select()}}p=Ext.isGecko||Ext.isOpera}else{p=true}if(p){this.focus()}},autoSize:function(){if(!this.grow||!this.rendered){return}if(!this.metrics){this.metrics=Ext.util.TextMetrics.createInstance(this.el)}var l=this.el;var d=l.dom.value;var h=document.createElement("div");h.appendChild(document.createTextNode(d));d=h.innerHTML;Ext.removeNode(h);h=null;d+="&#160;";var g=Math.min(this.growMax,Math.max(this.metrics.getWidth(d)+10,this.growMin));this.el.setWidth(g);this.fireEvent("autosize",this,g)}});Ext.reg("textfield",Ext.form.TextField);Ext.form.TriggerField=Ext.extend(Ext.form.TextField,{defaultAutoCreate:{tag:"input",type:"text",size:"16",autocomplete:"off"},hideTrigger:false,autoSize:Ext.emptyFn,monitorTab:true,deferHeight:true,mimicing:false,onResize:function(e,d){Ext.form.TriggerField.superclass.onResize.call(this,e,d);if(typeof e=="number"){this.el.setWidth(this.adjustWidth("input",e-this.trigger.getWidth()))}this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())},adjustSize:Ext.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.wrap},getPositionEl:function(){return this.wrap},alignErrorIcon:function(){if(this.wrap){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])}},onRender:function(d,e){Ext.form.TriggerField.superclass.onRender.call(this,d,e);this.wrap=this.el.wrap({cls:"x-form-field-wrap"});this.trigger=this.wrap.createChild(this.triggerConfig||{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});if(this.hideTrigger){this.trigger.setDisplayed(false)}this.initTrigger();if(!this.width){this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())}},afterRender:function(){Ext.form.TriggerField.superclass.afterRender.call(this);var b;if(Ext.isIE&&!this.hideTrigger&&this.el.getY()!=(b=this.trigger.getY())){this.el.position();this.el.setY(b)}},initTrigger:function(){this.trigger.on("click",this.onTriggerClick,this,{preventDefault:true});this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},onDestroy:function(){if(this.trigger){this.trigger.removeAllListeners();this.trigger.remove()}if(this.wrap){this.wrap.remove()}Ext.form.TriggerField.superclass.onDestroy.call(this)},onFocus:function(){Ext.form.TriggerField.superclass.onFocus.call(this);if(!this.mimicing){this.wrap.addClass("x-trigger-wrap-focus");this.mimicing=true;Ext.get(Ext.isIE?document.body:document).on("mousedown",this.mimicBlur,this,{delay:10});if(this.monitorTab){this.el.on("keydown",this.checkTab,this)}}},checkTab:function(b){if(b.getKey()==b.TAB){this.triggerBlur()}},onBlur:function(){},mimicBlur:function(b){if(!this.wrap.contains(b.target)&&this.validateBlur(b)){this.triggerBlur()}},triggerBlur:function(){this.mimicing=false;Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur,this);if(this.monitorTab&&this.el){this.el.un("keydown",this.checkTab,this)}this.beforeBlur();if(this.wrap){this.wrap.removeClass("x-trigger-wrap-focus")}Ext.form.TriggerField.superclass.onBlur.call(this)},beforeBlur:Ext.emptyFn,validateBlur:function(b){return true},onDisable:function(){Ext.form.TriggerField.superclass.onDisable.call(this);if(this.wrap){this.wrap.addClass(this.disabledClass);this.el.removeClass(this.disabledClass)}},onEnable:function(){Ext.form.TriggerField.superclass.onEnable.call(this);if(this.wrap){this.wrap.removeClass(this.disabledClass)}},onShow:function(){if(this.wrap){this.wrap.dom.style.display="";this.wrap.dom.style.visibility="visible"}},onHide:function(){this.wrap.dom.style.display="none"},onTriggerClick:Ext.emptyFn});Ext.form.TwinTriggerField=Ext.extend(Ext.form.TriggerField,{initComponent:function(){Ext.form.TwinTriggerField.superclass.initComponent.call(this);this.triggerConfig={tag:"span",cls:"x-form-twin-triggers",cn:[{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger2Class}]}},getTrigger:function(b){return this.triggers[b]},initTrigger:function(){var e=this.trigger.select(".x-form-trigger",true);this.wrap.setStyle("overflow","hidden");var d=this;e.each(function(h,a,l){h.hide=function(){var g=d.wrap.getWidth();this.dom.style.display="none";d.el.setWidth(g-d.trigger.getWidth())};h.show=function(){var g=d.wrap.getWidth();this.dom.style.display="";d.el.setWidth(g-d.trigger.getWidth())};var b="Trigger"+(l+1);if(this["hide"+b]){h.dom.style.display="none"}h.on("click",this["on"+b+"Click"],this,{preventDefault:true});h.addClassOnOver("x-form-trigger-over");h.addClassOnClick("x-form-trigger-click")},this);this.triggers=e.elements},onTrigger1Click:Ext.emptyFn,onTrigger2Click:Ext.emptyFn});Ext.reg("trigger",Ext.form.TriggerField);Ext.form.TextArea=Ext.extend(Ext.form.TextField,{growMin:60,growMax:1000,growAppend:"&#160;\n&#160;",growPad:0,enterIsSpecial:false,preventScrollbars:false,onRender:function(d,e){if(!this.el){this.defaultAutoCreate={tag:"textarea",style:"width:100px;height:60px;",autocomplete:"off"}}Ext.form.TextArea.superclass.onRender.call(this,d,e);if(this.grow){this.textSizeEl=Ext.DomHelper.append(document.body,{tag:"pre",cls:"x-form-grow-sizer"});if(this.preventScrollbars){this.el.setStyle("overflow","hidden")}this.el.setHeight(this.growMin)}},onDestroy:function(){if(this.textSizeEl){Ext.removeNode(this.textSizeEl)}Ext.form.TextArea.superclass.onDestroy.call(this)},fireKey:function(b){if(b.isSpecialKey()&&(this.enterIsSpecial||(b.getKey()!=b.ENTER||b.hasModifier()))){this.fireEvent("specialkey",this,b)}},onKeyUp:function(b){if(!b.isNavKeyPress()||b.getKey()==b.ENTER){this.autoSize()}Ext.form.TextArea.superclass.onKeyUp.call(this,b)},autoSize:function(){if(!this.grow||!this.textSizeEl){return}var l=this.el;var g=l.dom.value;var h=this.textSizeEl;h.innerHTML="";h.appendChild(document.createTextNode(g));g=h.innerHTML;Ext.fly(h).setWidth(this.el.getWidth());if(g.length<1){g="&#160;&#160;"}else{if(Ext.isIE){g=g.replace(/\n/g,"<p>&#160;</p>")}g+=this.growAppend}h.innerHTML=g;var e=Math.min(this.growMax,Math.max(h.offsetHeight,this.growMin)+this.growPad);if(e!=this.lastHeight){this.lastHeight=e;this.el.setHeight(e);this.fireEvent("autosize",this,e)}}});Ext.reg("textarea",Ext.form.TextArea);Ext.form.NumberField=Ext.extend(Ext.form.TextField,{fieldClass:"x-form-field x-form-num-field",allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",baseChars:"0123456789",initEvents:function(){Ext.form.NumberField.superclass.initEvents.call(this);var d=this.baseChars+"";if(this.allowDecimals){d+=this.decimalSeparator}if(this.allowNegative){d+="-"}this.stripCharsRe=new RegExp("[^"+d+"]","gi");var e=function(b){var l=b.getKey();if(!Ext.isIE&&(b.isSpecialKey()||l==b.BACKSPACE||l==b.DELETE)){return}var a=b.getCharCode();if(d.indexOf(String.fromCharCode(a))===-1){b.stopEvent()}};this.el.on("keypress",e,this)},validateValue:function(d){if(!Ext.form.NumberField.superclass.validateValue.call(this,d)){return false}if(d.length<1){return true}d=String(d).replace(this.decimalSeparator,".");if(isNaN(d)){this.markInvalid(String.format(this.nanText,d));return false}var e=this.parseValue(d);if(e<this.minValue){this.markInvalid(String.format(this.minText,this.minValue));return false}if(e>this.maxValue){this.markInvalid(String.format(this.maxText,this.maxValue));return false}return true},getValue:function(){return this.fixPrecision(this.parseValue(Ext.form.NumberField.superclass.getValue.call(this)))},setValue:function(b){b=typeof b=="number"?b:parseFloat(String(b).replace(this.decimalSeparator,"."));b=isNaN(b)?"":String(b).replace(".",this.decimalSeparator);Ext.form.NumberField.superclass.setValue.call(this,b)},parseValue:function(b){b=parseFloat(String(b).replace(this.decimalSeparator,"."));return isNaN(b)?"":b},fixPrecision:function(d){var e=isNaN(d);if(!this.allowDecimals||this.decimalPrecision==-1||e||!d){return e?"":d}return parseFloat(parseFloat(d).toFixed(this.decimalPrecision))},beforeBlur:function(){var b=this.parseValue(this.getRawValue());if(b||b===0){this.setValue(this.fixPrecision(b))}}});Ext.reg("numberfield",Ext.form.NumberField);Ext.form.DateField=Ext.extend(Ext.form.TriggerField,{format:"m/d/Y",altFormats:"m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d",disabledDaysText:"Disabled",disabledDatesText:"Disabled",minText:"The date in this field must be equal to or after {0}",maxText:"The date in this field must be equal to or before {0}",invalidText:"{0} is not a valid date - it must be in the format {1}",triggerClass:"x-form-date-trigger",showToday:true,defaultAutoCreate:{tag:"input",type:"text",size:"10",autocomplete:"off"},initComponent:function(){Ext.form.DateField.superclass.initComponent.call(this);this.addEvents("select");if(typeof this.minValue=="string"){this.minValue=this.parseDate(this.minValue)}if(typeof this.maxValue=="string"){this.maxValue=this.parseDate(this.maxValue)}this.disabledDatesRE=null;this.initDisabledDays()},initDisabledDays:function(){if(this.disabledDates){var e=this.disabledDates;var g="(?:";for(var d=0;d<e.length;d++){g+=e[d];if(d!=e.length-1){g+="|"}}this.disabledDatesRE=new RegExp(g+")")}},setDisabledDates:function(b){this.disabledDates=b;this.initDisabledDays();if(this.menu){this.menu.picker.setDisabledDates(this.disabledDatesRE)}},setDisabledDays:function(b){this.disabledDays=b;if(this.menu){this.menu.picker.setDisabledDays(b)}},setMinValue:function(b){this.minValue=(typeof b=="string"?this.parseDate(b):b);if(this.menu){this.menu.picker.setMinDate(this.minValue)}},setMaxValue:function(b){this.maxValue=(typeof b=="string"?this.parseDate(b):b);if(this.menu){this.menu.picker.setMaxDate(this.maxValue)}},validateValue:function(o){o=this.formatDate(o);if(!Ext.form.DateField.superclass.validateValue.call(this,o)){return false}if(o.length<1){return true}var q=o;o=this.parseDate(o);if(!o){this.markInvalid(String.format(this.invalidText,q,this.format));return false}var m=o.getTime();if(this.minValue&&m<this.minValue.getTime()){this.markInvalid(String.format(this.minText,this.formatDate(this.minValue)));return false}if(this.maxValue&&m>this.maxValue.getTime()){this.markInvalid(String.format(this.maxText,this.formatDate(this.maxValue)));return false}if(this.disabledDays){var l=o.getDay();for(var h=0;h<this.disabledDays.length;h++){if(l===this.disabledDays[h]){this.markInvalid(this.disabledDaysText);return false}}}var p=this.formatDate(o);if(this.disabledDatesRE&&this.disabledDatesRE.test(p)){this.markInvalid(String.format(this.disabledDatesText,p));return false}return true},validateBlur:function(){return !this.menu||!this.menu.isVisible()},getValue:function(){return this.parseDate(Ext.form.DateField.superclass.getValue.call(this))||""},setValue:function(b){Ext.form.DateField.superclass.setValue.call(this,this.formatDate(this.parseDate(b)))},parseDate:function(h){if(!h||Ext.isDate(h)){return h}var e=Date.parseDate(h,this.format);if(!e&&this.altFormats){if(!this.altFormatsArray){this.altFormatsArray=this.altFormats.split("|")}for(var l=0,g=this.altFormatsArray.length;l<g&&!e;l++){e=Date.parseDate(h,this.altFormatsArray[l])}}return e},onDestroy:function(){if(this.menu){this.menu.destroy()}if(this.wrap){this.wrap.remove()}Ext.form.DateField.superclass.onDestroy.call(this)},formatDate:function(b){return Ext.isDate(b)?b.dateFormat(this.format):b},menuListeners:{select:function(e,d){this.setValue(d);this.fireEvent("select",this,d)},show:function(){this.onFocus()},hide:function(){this.focus.defer(10,this);var b=this.menuListeners;this.menu.un("select",b.select,this);this.menu.un("show",b.show,this);this.menu.un("hide",b.hide,this)}},onTriggerClick:function(){if(this.disabled){return}if(this.menu==null){this.menu=new Ext.menu.DateMenu()}Ext.apply(this.menu.picker,{minDate:this.minValue,maxDate:this.maxValue,disabledDatesRE:this.disabledDatesRE,disabledDatesText:this.disabledDatesText,disabledDays:this.disabledDays,disabledDaysText:this.disabledDaysText,format:this.format,showToday:this.showToday,minText:String.format(this.minText,this.formatDate(this.minValue)),maxText:String.format(this.maxText,this.formatDate(this.maxValue))});this.menu.on(Ext.apply({},this.menuListeners,{scope:this}));this.menu.picker.setValue(this.getValue()||new Date());this.menu.show(this.el,"tl-bl?")},beforeBlur:function(){var b=this.parseDate(this.getRawValue());if(b){this.setValue(b)}}});Ext.reg("datefield",Ext.form.DateField);Ext.form.ComboBox=Ext.extend(Ext.form.TriggerField,{defaultAutoCreate:{tag:"input",type:"text",size:"24",autocomplete:"off"},listClass:"",selectedClass:"x-combo-selected",triggerClass:"x-form-arrow-trigger",shadow:"sides",listAlign:"tl-bl?",maxHeight:300,minHeight:90,triggerAction:"query",minChars:4,typeAhead:false,queryDelay:500,pageSize:0,selectOnFocus:false,queryParam:"query",loadingText:"Loading...",resizable:false,handleHeight:8,editable:true,allQuery:"",mode:"remote",minListWidth:70,forceSelection:false,typeAheadDelay:250,lazyInit:true,initComponent:function(){Ext.form.ComboBox.superclass.initComponent.call(this);this.addEvents("expand","collapse","beforeselect","select","beforequery");if(this.transform){this.allowDomMove=false;var r=Ext.getDom(this.transform);if(!this.hiddenName){this.hiddenName=r.name}if(!this.store){this.mode="local";var m=[],q=r.options;for(var d=0,l=q.length;d<l;d++){var o=q[d];var p=(Ext.isIE?o.getAttributeNode("value").specified:o.hasAttribute("value"))?o.value:o.text;if(o.selected){this.value=p}m.push([p,o.text])}this.store=new Ext.data.SimpleStore({id:0,fields:["value","text"],data:m});this.valueField="value";this.displayField="text"}r.name=Ext.id();if(!this.lazyRender){this.target=true;this.el=Ext.DomHelper.insertBefore(r,this.autoCreate||this.defaultAutoCreate);Ext.removeNode(r);this.render(this.el.parentNode)}else{Ext.removeNode(r)}}else{if(Ext.isArray(this.store)){if(Ext.isArray(this.store[0])){this.store=new Ext.data.SimpleStore({fields:["value","text"],data:this.store});this.valueField="value"}else{this.store=new Ext.data.SimpleStore({fields:["text"],data:this.store,expandData:true});this.valueField="text"}this.displayField="text";this.mode="local"}}this.selectedIndex=-1;if(this.mode=="local"){if(this.initialConfig.queryDelay===undefined){this.queryDelay=10}if(this.initialConfig.minChars===undefined){this.minChars=0}}},onRender:function(d,e){Ext.form.ComboBox.superclass.onRender.call(this,d,e);if(this.hiddenName){this.hiddenField=this.el.insertSibling({tag:"input",type:"hidden",name:this.hiddenName,id:(this.hiddenId||this.hiddenName)},"before",true);this.el.dom.removeAttribute("name")}if(Ext.isGecko){this.el.dom.setAttribute("autocomplete","off")}if(!this.lazyInit){this.initList()}else{this.on("focus",this.initList,this,{single:true})}if(!this.editable){this.editable=true;this.setEditable(false)}},initValue:function(){Ext.form.ComboBox.superclass.initValue.call(this);if(this.hiddenField){this.hiddenField.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:""}},initList:function(){if(!this.list){var e="x-combo-list";this.list=new Ext.Layer({shadow:this.shadow,cls:[e,this.listClass].join(" "),constrain:false});var d=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setWidth(d);this.list.swallowEvent("mousewheel");this.assetHeight=0;if(this.title){this.header=this.list.createChild({cls:e+"-hd",html:this.title});this.assetHeight+=this.header.getHeight()}this.innerList=this.list.createChild({cls:e+"-inner"});this.innerList.on("mouseover",this.onViewOver,this);this.innerList.on("mousemove",this.onViewMove,this);this.innerList.setWidth(d-this.list.getFrameWidth("lr"));if(this.pageSize){this.footer=this.list.createChild({cls:e+"-ft"});this.pageTb=new Ext.PagingToolbar({store:this.store,pageSize:this.pageSize,renderTo:this.footer});this.assetHeight+=this.footer.getHeight()}if(!this.tpl){this.tpl='<tpl for="."><div class="'+e+'-item">{'+this.displayField+"}</div></tpl>"}this.view=new Ext.DataView({applyTo:this.innerList,tpl:this.tpl,singleSelect:true,selectedClass:this.selectedClass,itemSelector:this.itemSelector||"."+e+"-item"});this.view.on("click",this.onViewClick,this);this.bindStore(this.store,true);if(this.resizable){this.resizer=new Ext.Resizable(this.list,{pinned:true,handles:"se"});this.resizer.on("resize",function(a,g,b){this.maxHeight=b-this.handleHeight-this.list.getFrameWidth("tb")-this.assetHeight;this.listWidth=g;this.innerList.setWidth(g-this.list.getFrameWidth("lr"));this.restrictHeight()},this);this[this.pageSize?"footer":"innerList"].setStyle("margin-bottom",this.handleHeight+"px")}}},getStore:function(){return this.store},bindStore:function(e,d){if(this.store&&!d){this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("loadexception",this.collapse,this);if(!e){this.store=null;if(this.view){this.view.setStore(null)}}}if(e){this.store=Ext.StoreMgr.lookup(e);this.store.on("beforeload",this.onBeforeLoad,this);this.store.on("load",this.onLoad,this);this.store.on("loadexception",this.collapse,this);if(this.view){this.view.setStore(e)}}},initEvents:function(){Ext.form.ComboBox.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{up:function(b){this.inKeyMode=true;this.selectPrev()},down:function(b){if(!this.isExpanded()){this.onTriggerClick()}else{this.inKeyMode=true;this.selectNext()}},enter:function(b){this.onViewClick();this.delayedCheck=true;this.unsetDelayCheck.defer(10,this)},esc:function(b){this.collapse()},tab:function(b){this.onViewClick(false);return true},scope:this,doRelay:function(g,d,e){if(e=="down"||this.scope.isExpanded()){return Ext.KeyNav.prototype.doRelay.apply(this,arguments)}return true},forceKeyDown:true});this.queryDelay=Math.max(this.queryDelay||10,this.mode=="local"?10:250);this.dqTask=new Ext.util.DelayedTask(this.initQuery,this);if(this.typeAhead){this.taTask=new Ext.util.DelayedTask(this.onTypeAhead,this)}if(this.editable!==false){this.el.on("keyup",this.onKeyUp,this)}if(this.forceSelection){this.on("blur",this.doForce,this)}},onDestroy:function(){if(this.view){Ext.destroy(this.view)}if(this.list){if(this.innerList){this.innerList.un("mouseover",this.onViewOver,this);this.innerList.un("mousemove",this.onViewMove,this)}this.list.destroy()}if(this.dqTask){this.dqTask.cancel();this.dqTask=null}this.bindStore(null);Ext.form.ComboBox.superclass.onDestroy.call(this)},unsetDelayCheck:function(){delete this.delayedCheck},fireKey:function(b){if(b.isNavKeyPress()&&!this.isExpanded()&&!this.delayedCheck){this.fireEvent("specialkey",this,b)}},onResize:function(e,d){Ext.form.ComboBox.superclass.onResize.apply(this,arguments);if(this.list&&this.listWidth===undefined){var g=Math.max(e,this.minListWidth);this.list.setWidth(g);this.innerList.setWidth(g-this.list.getFrameWidth("lr"))}},onEnable:function(){Ext.form.ComboBox.superclass.onEnable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=false}},onDisable:function(){Ext.form.ComboBox.superclass.onDisable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=true}},setEditable:function(b){if(b==this.editable){return}this.editable=b;if(!b){this.el.dom.setAttribute("readOnly",true);this.el.on("mousedown",this.onTriggerClick,this);this.el.addClass("x-combo-noedit")}else{this.el.dom.removeAttribute("readOnly");this.el.un("mousedown",this.onTriggerClick,this);this.el.removeClass("x-combo-noedit")}},onBeforeLoad:function(){if(!this.hasFocus){return}this.innerList.update(this.loadingText?'<div class="loading-indicator">'+this.loadingText+"</div>":"");this.restrictHeight();this.selectedIndex=-1},onLoad:function(){if(!this.hasFocus){return}if(this.store.getCount()>0){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable){this.el.dom.select()}if(!this.selectByValue(this.value,true)){this.select(0,true)}}else{this.selectNext();if(this.typeAhead&&this.lastKey!=Ext.EventObject.BACKSPACE&&this.lastKey!=Ext.EventObject.DELETE){this.taTask.delay(this.typeAheadDelay)}}}else{this.onEmptyResults()}},onTypeAhead:function(){if(this.store.getCount()>0){var e=this.store.getAt(0);var l=e.data[this.displayField];var g=l.length;var h=this.getRawValue().length;if(h!=g){this.setRawValue(l);this.selectText(h,l.length)}}},onSelect:function(e,d){if(this.fireEvent("beforeselect",this,e,d)!==false){this.setValue(e.data[this.valueField||this.displayField]);this.collapse();this.fireEvent("select",this,e,d)}},getValue:function(){if(this.valueField){return typeof this.value!="undefined"?this.value:""}else{return Ext.form.ComboBox.superclass.getValue.call(this)}},clearValue:function(){if(this.hiddenField){this.hiddenField.value=""}this.setRawValue("");this.lastSelectionText="";this.applyEmptyText();this.value=""},setValue:function(e){var g=e;if(this.valueField){var d=this.findRecord(this.valueField,e);if(d){g=d.data[this.displayField]}else{if(this.valueNotFoundText!==undefined){g=this.valueNotFoundText}}}this.lastSelectionText=g;if(this.hiddenField){this.hiddenField.value=e}Ext.form.ComboBox.superclass.setValue.call(this,g);this.value=e},findRecord:function(g,d){var e;if(this.store.getCount()>0){this.store.each(function(a){if(a.data[g]==d){e=a;return false}})}return e},onViewMove:function(d,e){this.inKeyMode=false},onViewOver:function(h,e){if(this.inKeyMode){return}var l=this.view.findItemFromChild(e);if(l){var g=this.view.indexOf(l);this.select(g,false)}},onViewClick:function(d){var e=this.view.getSelectedIndexes()[0];var g=this.store.getAt(e);if(g){this.onSelect(g,e)}if(d!==false){this.el.focus()}},restrictHeight:function(){this.innerList.dom.style.height="";var h=this.innerList.dom;var o=this.list.getFrameWidth("tb")+(this.resizable?this.handleHeight:0)+this.assetHeight;var q=Math.max(h.clientHeight,h.offsetHeight,h.scrollHeight);var l=this.getPosition()[1]-Ext.getBody().getScroll().top;var m=Ext.lib.Dom.getViewHeight()-l-this.getSize().height;var p=Math.max(l,m,this.minHeight||0)-this.list.shadowOffset-o-5;q=Math.min(q,p,this.maxHeight);this.innerList.setHeight(q);this.list.beginUpdate();this.list.setHeight(q+o);this.list.alignTo(this.wrap,this.listAlign);this.list.endUpdate()},onEmptyResults:function(){this.collapse()},isExpanded:function(){return this.list&&this.list.isVisible()},selectByValue:function(e,g){if(e!==undefined&&e!==null){var d=this.findRecord(this.valueField||this.displayField,e);if(d){this.select(this.store.indexOf(d),g);return true}}return false},select:function(e,g){this.selectedIndex=e;this.view.select(e);if(g!==false){var d=this.view.getNode(e);if(d){this.innerList.scrollChildIntoView(d,false)}}},selectNext:function(){var b=this.store.getCount();if(b>0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex<b-1){this.select(this.selectedIndex+1)}}}},selectPrev:function(){var b=this.store.getCount();if(b>0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex!=0){this.select(this.selectedIndex-1)}}}},onKeyUp:function(b){if(this.editable!==false&&!b.isSpecialKey()){this.lastKey=b.getKey();this.dqTask.delay(this.queryDelay)}},validateBlur:function(){return !this.list||!this.list.isVisible()},initQuery:function(){this.doQuery(this.getRawValue())},doForce:function(){if(this.el.dom.value.length>0){this.el.dom.value=this.lastSelectionText===undefined?"":this.lastSelectionText;this.applyEmptyText()}},doQuery:function(g,d){if(g===undefined||g===null){g=""}var e={query:g,forceAll:d,combo:this,cancel:false};if(this.fireEvent("beforequery",e)===false||e.cancel){return false}g=e.query;d=e.forceAll;if(d===true||(g.length>=this.minChars)){if(this.lastQuery!==g){this.lastQuery=g;if(this.mode=="local"){this.selectedIndex=-1;if(d){this.store.clearFilter()}else{this.store.filter(this.displayField,g)}this.onLoad()}else{this.store.baseParams[this.queryParam]=g;this.store.load({params:this.getParams(g)});this.expand()}}else{this.selectedIndex=-1;this.onLoad()}}},getParams:function(e){var d={};if(this.pageSize){d.start=0;d.limit=this.pageSize}return d},collapse:function(){if(!this.isExpanded()){return}this.list.hide();Ext.getDoc().un("mousewheel",this.collapseIf,this);Ext.getDoc().un("mousedown",this.collapseIf,this);this.fireEvent("collapse",this)},collapseIf:function(b){if(!b.within(this.wrap)&&!b.within(this.list)){this.collapse()}},expand:function(){if(this.isExpanded()||!this.hasFocus){return}this.list.alignTo(this.wrap,this.listAlign);this.list.show();this.innerList.setOverflow("auto");Ext.getDoc().on("mousewheel",this.collapseIf,this);Ext.getDoc().on("mousedown",this.collapseIf,this);this.fireEvent("expand",this)},onTriggerClick:function(){if(this.disabled){return}if(this.isExpanded()){this.collapse();this.el.focus()}else{this.onFocus({});if(this.triggerAction=="all"){this.doQuery(this.allQuery,true)}else{this.doQuery(this.getRawValue())}this.el.focus()}}});Ext.reg("combo",Ext.form.ComboBox);Ext.form.Checkbox=Ext.extend(Ext.form.Field,{checkedCls:"x-form-check-checked",focusCls:"x-form-check-focus",overCls:"x-form-check-over",mouseDownCls:"x-form-check-down",tabIndex:0,checked:false,defaultAutoCreate:{tag:"input",type:"checkbox",autocomplete:"off"},baseCls:"x-form-check",initComponent:function(){Ext.form.Checkbox.superclass.initComponent.call(this);this.addEvents("check")},initEvents:function(){Ext.form.Checkbox.superclass.initEvents.call(this);this.initCheckEvents()},initCheckEvents:function(){this.innerWrap.removeAllListeners();this.innerWrap.addClassOnOver(this.overCls);this.innerWrap.addClassOnClick(this.mouseDownCls);this.innerWrap.on("click",this.onClick,this);this.innerWrap.on("keyup",this.onKeyUp,this)},onRender:function(d,e){Ext.form.Checkbox.superclass.onRender.call(this,d,e);if(this.inputValue!==undefined){this.el.dom.value=this.inputValue}this.el.addClass("x-hidden");this.innerWrap=this.el.wrap({tabIndex:this.tabIndex,cls:this.baseCls+"-wrap-inner"});this.wrap=this.innerWrap.wrap({cls:this.baseCls+"-wrap"});if(this.boxLabel){this.labelEl=this.innerWrap.createChild({tag:"label",htmlFor:this.el.id,cls:"x-form-cb-label",html:this.boxLabel})}this.imageEl=this.innerWrap.createChild({tag:"img",src:Ext.BLANK_IMAGE_URL,cls:this.baseCls},this.el);if(this.checked){this.setValue(true)}else{this.checked=this.el.dom.checked}this.originalValue=this.checked},afterRender:function(){Ext.form.Checkbox.superclass.afterRender.call(this);this.wrap[this.checked?"addClass":"removeClass"](this.checkedCls)},onDestroy:function(){if(this.rendered){Ext.destroy(this.imageEl,this.labelEl,this.innerWrap,this.wrap)}Ext.form.Checkbox.superclass.onDestroy.call(this)},onFocus:function(b){Ext.form.Checkbox.superclass.onFocus.call(this,b);this.el.addClass(this.focusCls)},onBlur:function(b){Ext.form.Checkbox.superclass.onBlur.call(this,b);this.el.removeClass(this.focusCls)},onResize:function(){Ext.form.Checkbox.superclass.onResize.apply(this,arguments);if(!this.boxLabel&&!this.fieldLabel){this.el.alignTo(this.wrap,"c-c")}},onKeyUp:function(b){if(b.getKey()==Ext.EventObject.SPACE){this.onClick(b)}},onClick:function(b){if(!this.disabled&&!this.readOnly){this.toggleValue()}b.stopEvent()},onEnable:function(){Ext.form.Checkbox.superclass.onEnable.call(this);this.initCheckEvents()},onDisable:function(){Ext.form.Checkbox.superclass.onDisable.call(this);this.innerWrap.removeAllListeners()},toggleValue:function(){this.setValue(!this.checked)},getResizeEl:function(){if(!this.resizeEl){this.resizeEl=Ext.isSafari?this.wrap:(this.wrap.up(".x-form-element",5)||this.wrap)}return this.resizeEl},getPositionEl:function(){return this.wrap},getActionEl:function(){return this.wrap},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,initValue:Ext.emptyFn,getValue:function(){if(this.rendered){return this.el.dom.checked}return this.checked},setValue:function(e){var d=this.checked;this.checked=(e===true||e==="true"||e=="1"||String(e).toLowerCase()=="on");if(this.rendered){this.el.dom.checked=this.checked;this.el.dom.defaultChecked=this.checked;this.wrap[this.checked?"addClass":"removeClass"](this.checkedCls)}if(d!=this.checked){this.fireEvent("check",this,this.checked);if(this.handler){this.handler.call(this.scope||this,this,this.checked)}}}});Ext.reg("checkbox",Ext.form.Checkbox);Ext.form.CheckboxGroup=Ext.extend(Ext.form.Field,{columns:"auto",vertical:false,allowBlank:true,blankText:"You must select at least one item in this group",defaultType:"checkbox",groupCls:"x-form-check-group",onRender:function(B,D){if(!this.el){var t={cls:this.groupCls,layout:"column",border:false,renderTo:B};var I={defaultType:this.defaultType,layout:"form",border:false,defaults:{hideLabel:true,anchor:"100%"}};if(this.items[0].items){Ext.apply(t,{layoutConfig:{columns:this.items.length},defaults:this.defaults,items:this.items});for(var E=0,w=this.items.length;E<w;E++){Ext.applyIf(this.items[E],I)}}else{var F,v=[];if(typeof this.columns=="string"){this.columns=this.items.length}if(!Ext.isArray(this.columns)){var z=[];for(var E=0;E<this.columns;E++){z.push((100/this.columns)*0.01)}this.columns=z}F=this.columns.length;for(var E=0;E<F;E++){var H=Ext.apply({items:[]},I);H[this.columns[E]<=1?"columnWidth":"width"]=this.columns[E];if(this.defaults){H.defaults=Ext.apply(H.defaults||{},this.defaults)}v.push(H)}if(this.vertical){var J=Math.ceil(this.items.length/F),u=0;for(var E=0,w=this.items.length;E<w;E++){if(E>0&&E%J==0){u++}if(this.items[E].fieldLabel){this.items[E].hideLabel=false}v[u].items.push(this.items[E])}}else{for(var E=0,w=this.items.length;E<w;E++){var l=E%F;if(this.items[E].fieldLabel){this.items[E].hideLabel=false}v[l].items.push(this.items[E])}}Ext.apply(t,{layoutConfig:{columns:F},items:v})}this.panel=new Ext.Panel(t);this.el=this.panel.getEl();if(this.forId&&this.itemCls){var G=this.el.up(this.itemCls).child("label",true);if(G){G.setAttribute("htmlFor",this.forId)}}var C=this.panel.findBy(function(a){return a.isFormField},this);this.items=new Ext.util.MixedCollection();this.items.addAll(C)}Ext.form.CheckboxGroup.superclass.onRender.call(this,B,D)},validateValue:function(e){if(!this.allowBlank){var d=true;this.items.each(function(a){if(a.checked){return d=false}},this);if(d){this.markInvalid(this.blankText);return false}}return true},onDisable:function(){this.items.each(function(b){b.disable()})},onEnable:function(){this.items.each(function(b){b.enable()})},onResize:function(e,d){this.panel.setSize(e,d);this.panel.doLayout()},reset:function(){Ext.form.CheckboxGroup.superclass.reset.call(this);this.items.each(function(b){if(b.reset){b.reset()}},this)},initValue:Ext.emptyFn,getValue:Ext.emptyFn,getRawValue:Ext.emptyFn,setValue:Ext.emptyFn,setRawValue:Ext.emptyFn});Ext.reg("checkboxgroup",Ext.form.CheckboxGroup);Ext.form.Radio=Ext.extend(Ext.form.Checkbox,{inputType:"radio",baseCls:"x-form-radio",getGroupValue:function(){var b=this.getParent().child("input[name="+this.el.dom.name+"]:checked",true);return b?b.value:null},getParent:function(){return this.el.up("form")||Ext.getBody()},toggleValue:function(){if(!this.checked){var b=this.getParent().select("input[name="+this.el.dom.name+"]");b.each(function(a){if(a.dom.id==this.id){this.setValue(true)}else{Ext.getCmp(a.dom.id).setValue(false)}},this)}},setValue:function(e){if(typeof e=="boolean"){Ext.form.Radio.superclass.setValue.call(this,e)}else{var d=this.getParent().child("input[name="+this.el.dom.name+"][value="+e+"]",true);if(d&&!d.checked){Ext.getCmp(d.id).toggleValue()}}},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn});Ext.reg("radio",Ext.form.Radio);Ext.form.RadioGroup=Ext.extend(Ext.form.CheckboxGroup,{allowBlank:true,blankText:"You must select one item in this group",defaultType:"radio",groupCls:"x-form-radio-group"});Ext.reg("radiogroup",Ext.form.RadioGroup);Ext.form.Hidden=Ext.extend(Ext.form.Field,{inputType:"hidden",onRender:function(){Ext.form.Hidden.superclass.onRender.apply(this,arguments)},initEvents:function(){this.originalValue=this.getValue()},setSize:Ext.emptyFn,setWidth:Ext.emptyFn,setHeight:Ext.emptyFn,setPosition:Ext.emptyFn,setPagePosition:Ext.emptyFn,markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn});Ext.reg("hidden",Ext.form.Hidden);Ext.form.BasicForm=function(d,e){Ext.apply(this,e);this.items=new Ext.util.MixedCollection(false,function(a){return a.id||(a.id=Ext.id())});this.addEvents("beforeaction","actionfailed","actioncomplete");if(d){this.initEl(d)}Ext.form.BasicForm.superclass.constructor.call(this)};Ext.extend(Ext.form.BasicForm,Ext.util.Observable,{timeout:30,activeAction:null,trackResetOnLoad:false,initEl:function(b){this.el=Ext.get(b);this.id=this.el.id||Ext.id();if(!this.standardSubmit){this.el.on("submit",this.onSubmit,this)}this.el.addClass("x-form")},getEl:function(){return this.el},onSubmit:function(b){b.stopEvent()},destroy:function(){this.items.each(function(b){Ext.destroy(b)});if(this.el){this.el.removeAllListeners();this.el.remove()}this.purgeListeners()},isValid:function(){var b=true;this.items.each(function(a){if(!a.validate()){b=false}});return b},isDirty:function(){var b=false;this.items.each(function(a){if(a.isDirty()){b=true;return false}});return b},doAction:function(d,e){if(typeof d=="string"){d=new Ext.form.Action.ACTION_TYPES[d](this,e)}if(this.fireEvent("beforeaction",this,d)!==false){this.beforeAction(d);d.run.defer(100,d)}return this},submit:function(d){if(this.standardSubmit){var e=this.isValid();if(e){this.el.dom.submit()}return e}this.doAction("submit",d);return this},load:function(b){this.doAction("load",b);return this},updateRecord:function(d){d.beginEdit();var e=d.fields;e.each(function(b){var a=this.findField(b.name);if(a){d.set(b.name,a.getValue())}},this);d.endEdit();return this},loadRecord:function(b){this.setValues(b.data);return this},beforeAction:function(e){var d=e.options;if(d.waitMsg){if(this.waitMsgTarget===true){this.el.mask(d.waitMsg,"x-mask-loading")}else{if(this.waitMsgTarget){this.waitMsgTarget=Ext.get(this.waitMsgTarget);this.waitMsgTarget.mask(d.waitMsg,"x-mask-loading")}else{Ext.MessageBox.wait(d.waitMsg,d.waitTitle||this.waitTitle||"Please Wait...")}}}},afterAction:function(e,g){this.activeAction=null;var d=e.options;if(d.waitMsg){if(this.waitMsgTarget===true){this.el.unmask()}else{if(this.waitMsgTarget){this.waitMsgTarget.unmask()}else{Ext.MessageBox.updateProgress(1);Ext.MessageBox.hide()}}}if(g){if(d.reset){this.reset()}Ext.callback(d.success,d.scope,[this,e]);this.fireEvent("actioncomplete",this,e)}else{Ext.callback(d.failure,d.scope,[this,e]);this.fireEvent("actionfailed",this,e)}},findField:function(d){var e=this.items.get(d);if(!e){this.items.each(function(a){if(a.isFormField&&(a.dataIndex==d||a.id==d||a.getName()==d)){e=a;return false}})}return e||null},markInvalid:function(o){if(Ext.isArray(o)){for(var s=0,m=o.length;s<m;s++){var l=o[s];var r=this.findField(l.id);if(r){r.markInvalid(l.msg)}}}else{var q,p;for(p in o){if(typeof o[p]!="function"&&(q=this.findField(p))){q.markInvalid(o[p])}}}return this},setValues:function(s){if(Ext.isArray(s)){for(var r=0,m=s.length;r<m;r++){var l=s[r];var q=this.findField(l.id);if(q){q.setValue(l.value);if(this.trackResetOnLoad){q.originalValue=q.getValue()}}}}else{var p,o;for(o in s){if(typeof s[o]!="function"&&(p=this.findField(o))){p.setValue(s[o]);if(this.trackResetOnLoad){p.originalValue=p.getValue()}}}}return this},getValues:function(d){var e=Ext.lib.Ajax.serializeForm(this.el.dom);if(d===true){return e}return Ext.urlDecode(e)},clearInvalid:function(){this.items.each(function(b){b.clearInvalid()});return this},reset:function(){this.items.each(function(b){b.reset()});return this},add:function(){this.items.addAll(Array.prototype.slice.call(arguments,0));return this},remove:function(b){this.items.remove(b);return this},render:function(){this.items.each(function(b){if(b.isFormField&&!b.rendered&&document.getElementById(b.id)){b.applyToMarkup(b.id)}});return this},applyToFields:function(b){this.items.each(function(a){Ext.apply(a,b)});return this},applyIfToFields:function(b){this.items.each(function(a){Ext.applyIf(a,b)});return this}});Ext.BasicForm=Ext.form.BasicForm;Ext.FormPanel=Ext.extend(Ext.Panel,{buttonAlign:"center",minButtonWidth:75,labelAlign:"left",monitorValid:false,monitorPoll:200,layout:"form",initComponent:function(){this.form=this.createForm();this.bodyCfg={tag:"form",cls:this.baseCls+"-body",method:this.method||"POST",id:this.formId||Ext.id()};if(this.fileUpload){this.bodyCfg.enctype="multipart/form-data"}Ext.FormPanel.superclass.initComponent.call(this);this.initItems();this.addEvents("clientvalidation");this.relayEvents(this.form,["beforeaction","actionfailed","actioncomplete"])},createForm:function(){delete this.initialConfig.listeners;return new Ext.form.BasicForm(null,this.initialConfig)},initFields:function(){var g=this.form;var e=this;var d=function(a){if(a.isFormField){g.add(a)}else{if(a.doLayout&&a!=e){Ext.applyIf(a,{labelAlign:a.ownerCt.labelAlign,labelWidth:a.ownerCt.labelWidth,itemCls:a.ownerCt.itemCls});if(a.items){a.items.each(d)}}}};this.items.each(d)},getLayoutTarget:function(){return this.form.el},getForm:function(){return this.form},onRender:function(d,e){this.initFields();Ext.FormPanel.superclass.onRender.call(this,d,e);this.form.initEl(this.body)},beforeDestroy:function(){Ext.FormPanel.superclass.beforeDestroy.call(this);this.stopMonitoring();Ext.destroy(this.form)},initEvents:function(){Ext.FormPanel.superclass.initEvents.call(this);this.items.on("remove",this.onRemove,this);this.items.on("add",this.onAdd,this);if(this.monitorValid){this.startMonitoring()}},onAdd:function(e,d){if(d.isFormField){this.form.add(d)}},onRemove:function(b){if(b.isFormField){Ext.destroy(b.container.up(".x-form-item"));this.form.remove(b)}},startMonitoring:function(){if(!this.bound){this.bound=true;Ext.TaskMgr.start({run:this.bindHandler,interval:this.monitorPoll||200,scope:this})}},stopMonitoring:function(){this.bound=false},load:function(){this.form.load.apply(this.form,arguments)},onDisable:function(){Ext.FormPanel.superclass.onDisable.call(this);if(this.form){this.form.items.each(function(){this.disable()})}},onEnable:function(){Ext.FormPanel.superclass.onEnable.call(this);if(this.form){this.form.items.each(function(){this.enable()})}},bindHandler:function(){if(!this.bound){return false}var h=true;this.form.items.each(function(a){if(!a.isValid(true)){h=false;return false}});if(this.buttons){for(var l=0,g=this.buttons.length;l<g;l++){var e=this.buttons[l];if(e.formBind===true&&e.disabled===h){e.setDisabled(!h)}}}this.fireEvent("clientvalidation",this,h)}});Ext.reg("form",Ext.FormPanel);Ext.form.FormPanel=Ext.FormPanel;Ext.form.FieldSet=Ext.extend(Ext.Panel,{baseCls:"x-fieldset",layout:"form",animCollapse:false,onRender:function(d,e){if(!this.el){this.el=document.createElement("fieldset");this.el.id=this.id;if(this.title||this.header||this.checkboxToggle){this.el.appendChild(document.createElement("legend")).className="x-fieldset-header"}}Ext.form.FieldSet.superclass.onRender.call(this,d,e);if(this.checkboxToggle){var g=typeof this.checkboxToggle=="object"?this.checkboxToggle:{tag:"input",type:"checkbox",name:this.checkboxName||this.id+"-checkbox"};this.checkbox=this.header.insertFirst(g);this.checkbox.dom.checked=!this.collapsed;this.checkbox.on("click",this.onCheckClick,this)}},onCollapse:function(e,d){if(this.checkbox){this.checkbox.dom.checked=false}Ext.form.FieldSet.superclass.onCollapse.call(this,e,d)},onExpand:function(e,d){if(this.checkbox){this.checkbox.dom.checked=true}Ext.form.FieldSet.superclass.onExpand.call(this,e,d)},onCheckClick:function(){this[this.checkbox.dom.checked?"expand":"collapse"]()},beforeDestroy:function(){if(this.checkbox){this.checkbox.un("click",this.onCheckClick,this)}Ext.form.FieldSet.superclass.beforeDestroy.call(this)}});Ext.reg("fieldset",Ext.form.FieldSet);Ext.form.HtmlEditor=Ext.extend(Ext.form.Field,{enableFormat:true,enableFontSize:true,enableColors:true,enableAlignments:true,enableLists:true,enableSourceEdit:true,enableLinks:true,enableFont:true,createLinkText:"Please enter the URL for the link:",defaultLinkValue:"http://",fontFamilies:["Arial","Courier New","Tahoma","Times New Roman","Verdana"],defaultFont:"tahoma",validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Ext.emptyFn,iframePad:3,hideMode:"offsets",defaultAutoCreate:{tag:"textarea",style:"width:500px;height:300px;",autocomplete:"off"},initComponent:function(){this.addEvents("initialize","activate","beforesync","beforepush","sync","push","editmodechange")},createFontOptions:function(){var p=[],h=this.fontFamilies,q,m;for(var o=0,l=h.length;o<l;o++){q=h[o];m=q.toLowerCase();p.push('<option value="',m,'" style="font-family:',q,';"',(this.defaultFont==m?' selected="true">':">"),q,"</option>")}return p.join("")},createToolbar:function(h){var g=Ext.QuickTips&&Ext.QuickTips.isEnabled();function l(a,d,b){return{itemId:a,cls:"x-btn-icon x-edit-"+a,enableToggle:d!==false,scope:h,handler:b||h.relayBtnCmd,clickEvent:"mousedown",tooltip:g?h.buttonTips[a]||undefined:undefined,tabIndex:-1}}var e=new Ext.Toolbar({renderTo:this.wrap.dom.firstChild});e.el.on("click",function(a){a.preventDefault()});if(this.enableFont&&!Ext.isSafari2){this.fontSelect=e.el.createChild({tag:"select",cls:"x-font-select",html:this.createFontOptions()});this.fontSelect.on("change",function(){var a=this.fontSelect.dom.value;this.relayCmd("fontname",a);this.deferFocus()},this);e.add(this.fontSelect.dom,"-")}if(this.enableFormat){e.add(l("bold"),l("italic"),l("underline"))}if(this.enableFontSize){e.add("-",l("increasefontsize",false,this.adjustFont),l("decreasefontsize",false,this.adjustFont))}if(this.enableColors){e.add("-",{itemId:"forecolor",cls:"x-btn-icon x-edit-forecolor",clickEvent:"mousedown",tooltip:g?h.buttonTips.forecolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({allowReselect:true,focus:Ext.emptyFn,value:"000000",plain:true,selectHandler:function(a,b){this.execCmd("forecolor",Ext.isSafari||Ext.isIE?"#"+b:b);this.deferFocus()},scope:this,clickEvent:"mousedown"})},{itemId:"backcolor",cls:"x-btn-icon x-edit-backcolor",clickEvent:"mousedown",tooltip:g?h.buttonTips.backcolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({focus:Ext.emptyFn,value:"FFFFFF",plain:true,allowReselect:true,selectHandler:function(a,b){if(Ext.isGecko){this.execCmd("useCSS",false);this.execCmd("hilitecolor",b);this.execCmd("useCSS",true);this.deferFocus()}else{this.execCmd(Ext.isOpera?"hilitecolor":"backcolor",Ext.isSafari||Ext.isIE?"#"+b:b);this.deferFocus()}},scope:this,clickEvent:"mousedown"})})}if(this.enableAlignments){e.add("-",l("justifyleft"),l("justifycenter"),l("justifyright"))}if(!Ext.isSafari2){if(this.enableLinks){e.add("-",l("createlink",false,this.createLink))}if(this.enableLists){e.add("-",l("insertorderedlist"),l("insertunorderedlist"))}if(this.enableSourceEdit){e.add("-",l("sourceedit",true,function(a){this.toggleSourceEdit(a.pressed)}))}}this.tb=e},getDocMarkup:function(){return'<html><head><style type="text/css">body{border:0;margin:0;padding:3px;height:98%;cursor:text;}</style></head><body></body></html>'},getEditorBody:function(){return this.doc.body||this.doc.documentElement},getDoc:function(){return Ext.isIE?this.getWin().document:(this.iframe.contentDocument||this.getWin().document)},getWin:function(){return Ext.isIE?this.iframe.contentWindow:window.frames[this.iframe.name]},onRender:function(e,g){Ext.form.HtmlEditor.superclass.onRender.call(this,e,g);this.el.dom.style.border="0 none";this.el.dom.setAttribute("tabIndex",-1);this.el.addClass("x-hidden");if(Ext.isIE){this.el.applyStyles("margin-top:-1px;margin-bottom:-1px;")}this.wrap=this.el.wrap({cls:"x-html-editor-wrap",cn:{cls:"x-html-editor-tb"}});this.createToolbar(this);this.tb.items.each(function(a){if(a.itemId!="sourceedit"){a.disable()}});var l=document.createElement("iframe");l.name=Ext.id();l.frameBorder="0";l.src=Ext.isIE?Ext.SSL_SECURE_URL:"javascript:;";this.wrap.dom.appendChild(l);this.iframe=l;this.initFrame();if(this.autoMonitorDesignMode!==false){this.monitorTask=Ext.TaskMgr.start({run:this.checkDesignMode,scope:this,interval:100})}if(!this.width){var h=this.el.getSize();this.setSize(h.width,this.height||h.height)}},initFrame:function(){this.doc=this.getDoc();this.win=this.getWin();this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var b={run:function(){if(this.doc.body||this.doc.readyState=="complete"){Ext.TaskMgr.stop(b);this.doc.designMode="on";this.initEditor.defer(10,this)}},interval:10,duration:10000,scope:this};Ext.TaskMgr.start(b)},checkDesignMode:function(){if(this.wrap&&this.wrap.dom.offsetWidth){var b=this.getDoc();if(!b){return}if(!b.editorInitialized||String(b.designMode).toLowerCase()!="on"){this.initFrame()}}},onResize:function(e,l){Ext.form.HtmlEditor.superclass.onResize.apply(this,arguments);if(this.el&&this.iframe){if(typeof e=="number"){var h=e-this.wrap.getFrameWidth("lr");this.el.setWidth(this.adjustWidth("textarea",h));this.iframe.style.width=Math.max(h,0)+"px"}if(typeof l=="number"){var g=l-this.wrap.getFrameWidth("tb")-this.tb.el.getHeight();this.el.setHeight(this.adjustWidth("textarea",g));this.iframe.style.height=Math.max(g,0)+"px";if(this.doc){this.getEditorBody().style.height=Math.max((g-(this.iframePad*2)),0)+"px"}}}},toggleSourceEdit:function(e){if(e===undefined){e=!this.sourceEditMode}this.sourceEditMode=e===true;var g=this.tb.items.get("sourceedit");if(g.pressed!==this.sourceEditMode){g.toggle(this.sourceEditMode);return}if(this.sourceEditMode){this.tb.items.each(function(a){if(a.itemId!="sourceedit"){a.disable()}});this.syncValue();this.iframe.className="x-hidden";this.el.removeClass("x-hidden");this.el.dom.removeAttribute("tabIndex");this.el.focus()}else{if(this.initialized){this.tb.items.each(function(a){a.enable()})}this.pushValue();this.iframe.className="";this.el.addClass("x-hidden");this.el.dom.setAttribute("tabIndex",-1);this.deferFocus()}var d=this.lastSize;if(d){delete this.lastSize;this.setSize(d)}this.fireEvent("editmodechange",this,this.sourceEditMode)},createLink:function(){var b=prompt(this.createLinkText,this.defaultLinkValue);if(b&&b!="http://"){this.relayCmd("createlink",b)}},adjustSize:Ext.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.wrap},getPositionEl:function(){return this.wrap},initEvents:function(){this.originalValue=this.getValue()},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,setValue:function(b){Ext.form.HtmlEditor.superclass.setValue.call(this,b);this.pushValue()},cleanHtml:function(b){b=String(b);if(b.length>5){if(Ext.isSafari){b=b.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,"")}}if(b=="&nbsp;"){b=""}return b},syncValue:function(){if(this.initialized){var h=this.getEditorBody();var l=h.innerHTML;if(Ext.isSafari){var e=h.getAttribute("style");var g=e.match(/text-align:(.*?);/i);if(g&&g[1]){l='<div style="'+g[0]+'">'+l+"</div>"}}l=this.cleanHtml(l);if(this.fireEvent("beforesync",this,l)!==false){this.el.dom.value=l;this.fireEvent("sync",this,l)}}},getValue:function(){this.syncValue();return Ext.form.HtmlEditor.superclass.getValue.call(this)},pushValue:function(){if(this.initialized){var b=this.el.dom.value;if(!this.activated&&b.length<1){b="&nbsp;"}if(this.fireEvent("beforepush",this,b)!==false){this.getEditorBody().innerHTML=b;this.fireEvent("push",this,b)}}},deferFocus:function(){this.focus.defer(10,this)},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus()}else{this.el.focus()}},initEditor:function(){var d=this.getEditorBody();var e=this.el.getStyles("font-size","font-family","background-image","background-repeat");e["background-attachment"]="fixed";d.bgProperties="fixed";Ext.DomHelper.applyStyles(d,e);if(this.doc){try{Ext.EventManager.removeAll(this.doc)}catch(g){}}this.doc=this.getDoc();Ext.EventManager.on(this.doc,{mousedown:this.onEditorEvent,dblclick:this.onEditorEvent,click:this.onEditorEvent,keyup:this.onEditorEvent,buffer:100,scope:this});if(Ext.isGecko){Ext.EventManager.on(this.doc,"keypress",this.applyCommand,this)}if(Ext.isIE||Ext.isSafari||Ext.isOpera){Ext.EventManager.on(this.doc,"keydown",this.fixKeys,this)}this.initialized=true;this.fireEvent("initialize",this);this.doc.editorInitialized=true;this.pushValue()},onDestroy:function(){if(this.monitorTask){Ext.TaskMgr.stop(this.monitorTask)}if(this.rendered){this.tb.items.each(function(b){if(b.menu){b.menu.removeAll();if(b.menu.el){b.menu.el.destroy()}}b.destroy()});this.wrap.dom.innerHTML="";this.wrap.remove()}},onFirstFocus:function(){this.activated=true;this.tb.items.each(function(a){a.enable()});if(Ext.isGecko){this.win.focus();var e=this.win.getSelection();if(!e.focusNode||e.focusNode.nodeType!=3){var d=e.getRangeAt(0);d.selectNodeContents(this.getEditorBody());d.collapse(true);this.deferFocus()}try{this.execCmd("useCSS",true);this.execCmd("styleWithCSS",false)}catch(g){}}this.fireEvent("activate",this)},adjustFont:function(d){var g=d.itemId=="increasefontsize"?1:-1;var e=parseInt(this.doc.queryCommandValue("FontSize")||2,10);if(Ext.isSafari3||Ext.isAir){if(e<=10){e=1+g}else{if(e<=13){e=2+g}else{if(e<=16){e=3+g}else{if(e<=18){e=4+g}else{if(e<=24){e=5+g}else{e=6+g}}}}}e=e.constrain(1,6)}else{if(Ext.isSafari){g*=2}e=Math.max(1,e+g)+(Ext.isSafari?"px":0)}this.execCmd("FontSize",e)},onEditorEvent:function(b){this.updateToolbar()},updateToolbar:function(){if(!this.activated){this.onFirstFocus();return}var d=this.tb.items.map,g=this.doc;if(this.enableFont&&!Ext.isSafari2){var e=(this.doc.queryCommandValue("FontName")||this.defaultFont).toLowerCase();if(e!=this.fontSelect.dom.value){this.fontSelect.dom.value=e}}if(this.enableFormat){d.bold.toggle(g.queryCommandState("bold"));d.italic.toggle(g.queryCommandState("italic"));d.underline.toggle(g.queryCommandState("underline"))}if(this.enableAlignments){d.justifyleft.toggle(g.queryCommandState("justifyleft"));d.justifycenter.toggle(g.queryCommandState("justifycenter"));d.justifyright.toggle(g.queryCommandState("justifyright"))}if(!Ext.isSafari2&&this.enableLists){d.insertorderedlist.toggle(g.queryCommandState("insertorderedlist"));d.insertunorderedlist.toggle(g.queryCommandState("insertunorderedlist"))}Ext.menu.MenuMgr.hideAll();this.syncValue()},relayBtnCmd:function(b){this.relayCmd(b.itemId)},relayCmd:function(d,e){(function(){this.focus();this.execCmd(d,e);this.updateToolbar()}).defer(10,this)},execCmd:function(d,e){this.doc.execCommand(d,false,e===undefined?null:e);this.syncValue()},applyCommand:function(e){if(e.ctrlKey){var h=e.getCharCode(),g;if(h>0){h=String.fromCharCode(h);switch(h){case"b":g="bold";break;case"i":g="italic";break;case"u":g="underline";break}if(g){this.win.focus();this.execCmd(g);this.deferFocus();e.preventDefault()}}}},insertAtCursor:function(d){if(!this.activated){return}if(Ext.isIE){this.win.focus();var e=this.doc.selection.createRange();if(e){e.collapse(true);e.pasteHTML(d);this.syncValue();this.deferFocus()}}else{if(Ext.isGecko||Ext.isOpera){this.win.focus();this.execCmd("InsertHTML",d);this.deferFocus()}else{if(Ext.isSafari){this.execCmd("InsertText",d);this.deferFocus()}}}},fixKeys:function(){if(Ext.isIE){return function(h){var g=h.getKey(),e;if(g==h.TAB){h.stopEvent();e=this.doc.selection.createRange();if(e){e.collapse(true);e.pasteHTML("&nbsp;&nbsp;&nbsp;&nbsp;");this.deferFocus()}}else{if(g==h.ENTER){e=this.doc.selection.createRange();if(e){var l=e.parentElement();if(!l||l.tagName.toLowerCase()!="li"){h.stopEvent();e.pasteHTML("<br />");e.collapse(false);e.select()}}}}}}else{if(Ext.isOpera){return function(d){var e=d.getKey();if(e==d.TAB){d.stopEvent();this.win.focus();this.execCmd("InsertHTML","&nbsp;&nbsp;&nbsp;&nbsp;");this.deferFocus()}}}else{if(Ext.isSafari){return function(d){var e=d.getKey();if(e==d.TAB){d.stopEvent();this.execCmd("InsertText","\t");this.deferFocus()}}}}}}(),getToolbar:function(){return this.tb},buttonTips:{bold:{title:"Bold (Ctrl+B)",text:"Make the selected text bold.",cls:"x-html-editor-tip"},italic:{title:"Italic (Ctrl+I)",text:"Make the selected text italic.",cls:"x-html-editor-tip"},underline:{title:"Underline (Ctrl+U)",text:"Underline the selected text.",cls:"x-html-editor-tip"},increasefontsize:{title:"Grow Text",text:"Increase the font size.",cls:"x-html-editor-tip"},decreasefontsize:{title:"Shrink Text",text:"Decrease the font size.",cls:"x-html-editor-tip"},backcolor:{title:"Text Highlight Color",text:"Change the background color of the selected text.",cls:"x-html-editor-tip"},forecolor:{title:"Font Color",text:"Change the color of the selected text.",cls:"x-html-editor-tip"},justifyleft:{title:"Align Text Left",text:"Align text to the left.",cls:"x-html-editor-tip"},justifycenter:{title:"Center Text",text:"Center text in the editor.",cls:"x-html-editor-tip"},justifyright:{title:"Align Text Right",text:"Align text to the right.",cls:"x-html-editor-tip"},insertunorderedlist:{title:"Bullet List",text:"Start a bulleted list.",cls:"x-html-editor-tip"},insertorderedlist:{title:"Numbered List",text:"Start a numbered list.",cls:"x-html-editor-tip"},createlink:{title:"Hyperlink",text:"Make the selected text a hyperlink.",cls:"x-html-editor-tip"},sourceedit:{title:"Source Edit",text:"Switch to source editing mode.",cls:"x-html-editor-tip"}}});Ext.reg("htmleditor",Ext.form.HtmlEditor);Ext.form.TimeField=Ext.extend(Ext.form.ComboBox,{minValue:null,maxValue:null,minText:"The time in this field must be equal to or after {0}",maxText:"The time in this field must be equal to or before {0}",invalidText:"{0} is not a valid time",format:"g:i A",altFormats:"g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H",increment:15,mode:"local",triggerAction:"all",typeAhead:false,initDate:"1/1/2008",initComponent:function(){Ext.form.TimeField.superclass.initComponent.call(this);if(typeof this.minValue=="string"){this.minValue=this.parseDate(this.minValue)}if(typeof this.maxValue=="string"){this.maxValue=this.parseDate(this.maxValue)}if(!this.store){var d=this.parseDate(this.minValue);if(!d){d=new Date(this.initDate).clearTime()}var e=this.parseDate(this.maxValue);if(!e){e=new Date(this.initDate).clearTime().add("mi",(24*60)-1)}var g=[];while(d<=e){g.push([d.dateFormat(this.format)]);d=d.add("mi",this.increment)}this.store=new Ext.data.SimpleStore({fields:["text"],data:g});this.displayField="text"}},getValue:function(){var b=Ext.form.TimeField.superclass.getValue.call(this);return this.formatDate(this.parseDate(b))||""},setValue:function(b){Ext.form.TimeField.superclass.setValue.call(this,this.formatDate(this.parseDate(b)))},validateValue:Ext.form.DateField.prototype.validateValue,parseDate:Ext.form.DateField.prototype.parseDate,formatDate:Ext.form.DateField.prototype.formatDate,beforeBlur:function(){var b=this.parseDate(this.getRawValue());if(b){this.setValue(b.dateFormat(this.format))}}});Ext.reg("timefield",Ext.form.TimeField);Ext.form.Label=Ext.extend(Ext.BoxComponent,{onRender:function(d,e){if(!this.el){this.el=document.createElement("label");this.el.id=this.getId();this.el.innerHTML=this.text?Ext.util.Format.htmlEncode(this.text):(this.html||"");if(this.forId){this.el.setAttribute("for",this.forId)}}Ext.form.Label.superclass.onRender.call(this,d,e)},setText:function(e,d){this.text=e;if(this.rendered){this.el.dom.innerHTML=d!==false?Ext.util.Format.htmlEncode(e):e}return this}});Ext.reg("label",Ext.form.Label);Ext.form.Action=function(d,e){this.form=d;this.options=e||{}};Ext.form.Action.CLIENT_INVALID="client";Ext.form.Action.SERVER_INVALID="server";Ext.form.Action.CONNECT_FAILURE="connect";Ext.form.Action.LOAD_FAILURE="load";Ext.form.Action.prototype={type:"default",run:function(b){},success:function(b){},handleResponse:function(b){},failure:function(b){this.response=b;this.failureType=Ext.form.Action.CONNECT_FAILURE;this.form.afterAction(this,false)},processResponse:function(b){this.response=b;if(!b.responseText){return true}this.result=this.handleResponse(b);return this.result},getUrl:function(g){var e=this.options.url||this.form.url||this.form.el.dom.action;if(g){var d=this.getParams();if(d){e+=(e.indexOf("?")!=-1?"&":"?")+d}}return e},getMethod:function(){return(this.options.method||this.form.method||this.form.el.dom.method||"POST").toUpperCase()},getParams:function(){var e=this.form.baseParams;var d=this.options.params;if(d){if(typeof d=="object"){d=Ext.urlEncode(Ext.applyIf(d,e))}else{if(typeof d=="string"&&e){d+="&"+Ext.urlEncode(e)}}}else{if(e){d=Ext.urlEncode(e)}}return d},createCallback:function(b){var b=b||{};return{success:this.success,failure:this.failure,scope:this,timeout:(b.timeout*1000)||(this.form.timeout*1000),upload:this.form.fileUpload?this.success:undefined}}};Ext.form.Action.Submit=function(d,e){Ext.form.Action.Submit.superclass.constructor.call(this,d,e)};Ext.extend(Ext.form.Action.Submit,Ext.form.Action,{type:"submit",run:function(){var d=this.options;var g=this.getMethod();var e=g=="GET";if(d.clientValidation===false||this.form.isValid()){Ext.Ajax.request(Ext.apply(this.createCallback(d),{form:this.form.el.dom,url:this.getUrl(e),method:g,headers:d.headers,params:!e?this.getParams():null,isUpload:this.form.fileUpload}))}else{if(d.clientValidation!==false){this.failureType=Ext.form.Action.CLIENT_INVALID;this.form.afterAction(this,false)}}},success:function(d){var e=this.processResponse(d);if(e===true||e.success){this.form.afterAction(this,true);return}if(e.errors){this.form.markInvalid(e.errors);this.failureType=Ext.form.Action.SERVER_INVALID}this.form.afterAction(this,false)},handleResponse:function(q){if(this.form.errorReader){var h=this.form.errorReader.read(q);var m=[];if(h.records){for(var p=0,l=h.records.length;p<l;p++){var o=h.records[p];m[p]=o.data}}if(m.length<1){m=null}return{success:h.success,errors:m}}return Ext.decode(q.responseText)}});Ext.form.Action.Load=function(d,e){Ext.form.Action.Load.superclass.constructor.call(this,d,e);this.reader=this.form.reader};Ext.extend(Ext.form.Action.Load,Ext.form.Action,{type:"load",run:function(){Ext.Ajax.request(Ext.apply(this.createCallback(this.options),{method:this.getMethod(),url:this.getUrl(false),headers:this.options.headers,params:this.getParams()}))},success:function(d){var e=this.processResponse(d);if(e===true||!e.success||!e.data){this.failureType=Ext.form.Action.LOAD_FAILURE;this.form.afterAction(this,false);return}this.form.clearInvalid();this.form.setValues(e.data);this.form.afterAction(this,true)},handleResponse:function(d){if(this.form.reader){var e=this.form.reader.read(d);var g=e.records&&e.records[0]?e.records[0].data:null;return{success:e.success,data:g}}return Ext.decode(d.responseText)}});Ext.form.Action.ACTION_TYPES={load:Ext.form.Action.Load,submit:Ext.form.Action.Submit};Ext.form.VTypes=function(){var l=/^[a-zA-Z_]+$/;var h=/^[a-zA-Z0-9_]+$/;var e=/^([\w]+)(\.[\w]+)*@([\w\-]+\.){1,5}([A-Za-z]){2,4}$/;var g=/(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;return{email:function(a){return e.test(a)},emailText:'This field should be an e-mail address in the format "user@domain.com"',emailMask:/[a-z0-9_\.\-@]/i,url:function(a){return g.test(a)},urlText:'This field should be a URL in the format "http://www.domain.com"',alpha:function(a){return l.test(a)},alphaText:"This field should only contain letters and _",alphaMask:/[a-z_]/i,alphanum:function(a){return h.test(a)},alphanumText:"This field should only contain letters, numbers and _",alphanumMask:/[a-z0-9_]/i}}();Ext.grid.GridPanel=Ext.extend(Ext.Panel,{ddText:"{0} selected row{1}",minColumnWidth:25,trackMouseOver:true,enableDragDrop:false,enableColumnMove:true,enableColumnHide:true,enableHdMenu:true,stripeRows:false,autoExpandColumn:false,autoExpandMin:50,autoExpandMax:1000,view:null,loadMask:false,deferRowRender:true,rendered:false,viewReady:false,stateEvents:["columnmove","columnresize","sortchange"],initComponent:function(){Ext.grid.GridPanel.superclass.initComponent.call(this);this.autoScroll=false;this.autoWidth=false;if(Ext.isArray(this.columns)){this.colModel=new Ext.grid.ColumnModel(this.columns);delete this.columns}if(this.ds){this.store=this.ds;delete this.ds}if(this.cm){this.colModel=this.cm;delete this.cm}if(this.sm){this.selModel=this.sm;delete this.sm}this.store=Ext.StoreMgr.lookup(this.store);this.addEvents("click","dblclick","contextmenu","mousedown","mouseup","mouseover","mouseout","keypress","keydown","cellmousedown","rowmousedown","headermousedown","cellclick","celldblclick","rowclick","rowdblclick","headerclick","headerdblclick","rowcontextmenu","cellcontextmenu","headercontextmenu","bodyscroll","columnresize","columnmove","sortchange")},onRender:function(m,h){Ext.grid.GridPanel.superclass.onRender.apply(this,arguments);var l=this.body;this.el.addClass("x-grid-panel");var g=this.getView();g.init(this);l.on("mousedown",this.onMouseDown,this);l.on("click",this.onClick,this);l.on("dblclick",this.onDblClick,this);l.on("contextmenu",this.onContextMenu,this);l.on("keydown",this.onKeyDown,this);this.relayEvents(l,["mousedown","mouseup","mouseover","mouseout","keypress"]);this.getSelectionModel().init(this);this.view.render()},initEvents:function(){Ext.grid.GridPanel.superclass.initEvents.call(this);if(this.loadMask){this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({store:this.store},this.loadMask))}},initStateEvents:function(){Ext.grid.GridPanel.superclass.initStateEvents.call(this);this.colModel.on("hiddenchange",this.saveState,this,{delay:100})},applyState:function(r){var m=this.colModel;var s=r.columns;if(s){for(var u=0,p=s.length;u<p;u++){var t=s[u];var o=m.getColumnById(t.id);if(o){o.hidden=t.hidden;o.width=t.width;var q=m.getIndexById(t.id);if(q!=u){m.moveColumn(q,u)}}}}if(r.sort){this.store[this.store.remoteSort?"setDefaultSort":"sort"](r.sort.field,r.sort.direction)}},getState:function(){var m={columns:[]};for(var g=0,l;l=this.colModel.config[g];g++){m.columns[g]={id:l.id,width:l.width};if(l.hidden){m.columns[g].hidden=true}}var h=this.store.getSortState();if(h){m.sort=h}return m},afterRender:function(){Ext.grid.GridPanel.superclass.afterRender.call(this);this.view.layout();if(this.deferRowRender){this.view.afterRender.defer(10,this.view)}else{this.view.afterRender()}this.viewReady=true},reconfigure:function(e,d){if(this.loadMask){this.loadMask.destroy();this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({store:e},this.initialConfig.loadMask))}this.view.bind(e,d);this.store=e;this.colModel=d;if(this.rendered){this.view.refresh(true)}},onKeyDown:function(b){this.fireEvent("keydown",b)},onDestroy:function(){if(this.rendered){if(this.loadMask){this.loadMask.destroy()}var b=this.body;b.removeAllListeners();this.view.destroy();b.update("")}this.colModel.purgeListeners();Ext.grid.GridPanel.superclass.onDestroy.call(this)},processEvent:function(r,p){this.fireEvent(r,p);var q=p.getTarget();var e=this.view;var m=e.findHeaderIndex(q);if(m!==false){this.fireEvent("header"+r,this,m,p)}else{var o=e.findRowIndex(q);var l=e.findCellIndex(q);if(o!==false){this.fireEvent("row"+r,this,o,p);if(l!==false){this.fireEvent("cell"+r,this,o,l,p)}}}},onClick:function(b){this.processEvent("click",b)},onMouseDown:function(b){this.processEvent("mousedown",b)},onContextMenu:function(d,e){this.processEvent("contextmenu",d)},onDblClick:function(b){this.processEvent("dblclick",b)},walkCells:function(m,u,v,s,o){var p=this.colModel,r=p.getColumnCount();var w=this.store,q=w.getCount(),t=true;if(v<0){if(u<0){m--;t=false}while(m>=0){if(!t){u=r-1}t=false;while(u>=0){if(s.call(o||this,m,u,p)===true){return[m,u]}u--}m--}}else{if(u>=r){m++;t=false}while(m<q){if(!t){u=0}t=false;while(u<r){if(s.call(o||this,m,u,p)===true){return[m,u]}u++}m++}}return null},getSelections:function(){return this.selModel.getSelections()},onResize:function(){Ext.grid.GridPanel.superclass.onResize.apply(this,arguments);if(this.viewReady){this.view.layout()}},getGridEl:function(){return this.body},stopEditing:Ext.emptyFn,getSelectionModel:function(){if(!this.selModel){this.selModel=new Ext.grid.RowSelectionModel(this.disableSelection?{selectRow:Ext.emptyFn}:null)}return this.selModel},getStore:function(){return this.store},getColumnModel:function(){return this.colModel},getView:function(){if(!this.view){this.view=new Ext.grid.GridView(this.viewConfig)}return this.view},getDragDropText:function(){var b=this.selModel.getCount();return String.format(this.ddText,b,b==1?"":"s")}});Ext.reg("grid",Ext.grid.GridPanel);Ext.grid.GridView=function(b){Ext.apply(this,b);this.addEvents("beforerowremoved","beforerowsinserted","beforerefresh","rowremoved","rowsinserted","rowupdated","refresh");Ext.grid.GridView.superclass.constructor.call(this)};Ext.extend(Ext.grid.GridView,Ext.util.Observable,{deferEmptyText:true,scrollOffset:19,autoFill:false,forceFit:false,sortClasses:["sort-asc","sort-desc"],sortAscText:"Sort Ascending",sortDescText:"Sort Descending",columnsText:"Columns",borderWidth:2,tdClass:"x-grid3-cell",hdCls:"x-grid3-hd",cellSelectorDepth:4,rowSelectorDepth:10,cellSelector:"td.x-grid3-cell",rowSelector:"div.x-grid3-row",initTemplates:function(){var g=this.templates||{};if(!g.master){g.master=new Ext.Template('<div class="x-grid3" hidefocus="true">','<div class="x-grid3-viewport">','<div class="x-grid3-header"><div class="x-grid3-header-inner"><div class="x-grid3-header-offset">{header}</div></div><div class="x-clear"></div></div>','<div class="x-grid3-scroller"><div class="x-grid3-body">{body}</div><a href="#" class="x-grid3-focus" tabIndex="-1"></a></div>',"</div>",'<div class="x-grid3-resize-marker">&#160;</div>','<div class="x-grid3-resize-proxy">&#160;</div>',"</div>")}if(!g.header){g.header=new Ext.Template('<table border="0" cellspacing="0" cellpadding="0" style="{tstyle}">','<thead><tr class="x-grid3-hd-row">{cells}</tr></thead>',"</table>")}if(!g.hcell){g.hcell=new Ext.Template('<td class="x-grid3-hd x-grid3-cell x-grid3-td-{id} {css}" style="{style}"><div {tooltip} {attr} class="x-grid3-hd-inner x-grid3-hd-{id}" unselectable="on" style="{istyle}">',this.grid.enableHdMenu?'<a class="x-grid3-hd-btn" href="#"></a>':"",'{value}<img class="x-grid3-sort-icon" src="',Ext.BLANK_IMAGE_URL,'" />',"</div></td>")}if(!g.body){g.body=new Ext.Template("{rows}")}if(!g.row){g.row=new Ext.Template('<div class="x-grid3-row {alt}" style="{tstyle}"><table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',"<tbody><tr>{cells}</tr>",(this.enableRowBody?'<tr class="x-grid3-row-body-tr" style="{bodyStyle}"><td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on"><div class="x-grid3-row-body">{body}</div></td></tr>':""),"</tbody></table></div>")}if(!g.cell){g.cell=new Ext.Template('<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} {css}" style="{style}" tabIndex="0" {cellAttr}>','<div class="x-grid3-cell-inner x-grid3-col-{id}" unselectable="on" {attr}>{value}</div>',"</td>")}for(var e in g){var d=g[e];if(d&&typeof d.compile=="function"&&!d.compiled){d.disableFormats=true;d.compile()}}this.templates=g;this.colRe=new RegExp("x-grid3-td-([^\\s]+)","")},fly:function(b){if(!this._flyweight){this._flyweight=new Ext.Element.Flyweight(document.body)}this._flyweight.dom=b;return this._flyweight},getEditorParent:function(){return this.scroller.dom},initElements:function(){var g=Ext.Element;var d=this.grid.getGridEl().dom.firstChild;var e=d.childNodes;this.el=new g(d);this.mainWrap=new g(e[0]);this.mainHd=new g(this.mainWrap.dom.firstChild);if(this.grid.hideHeaders){this.mainHd.setDisplayed(false)}this.innerHd=this.mainHd.dom.firstChild;this.scroller=new g(this.mainWrap.dom.childNodes[1]);if(this.forceFit){this.scroller.setStyle("overflow-x","hidden")}this.mainBody=new g(this.scroller.dom.firstChild);this.focusEl=new g(this.scroller.dom.childNodes[1]);this.focusEl.swallowEvent("click",true);this.resizeMarker=new g(e[1]);this.resizeProxy=new g(e[2])},getRows:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},findCell:function(b){if(!b){return false}return this.fly(b).findParent(this.cellSelector,this.cellSelectorDepth)},findCellIndex:function(g,d){var e=this.findCell(g);if(e&&(!d||this.fly(e).hasClass(d))){return this.getCellIndex(e)}return false},getCellIndex:function(d){if(d){var e=d.className.match(this.colRe);if(e&&e[1]){return this.cm.getIndexById(e[1])}}return false},findHeaderCell:function(d){var e=this.findCell(d);return e&&this.fly(e).hasClass(this.hdCls)?e:null},findHeaderIndex:function(b){return this.findCellIndex(b,this.hdCls)},findRow:function(b){if(!b){return false}return this.fly(b).findParent(this.rowSelector,this.rowSelectorDepth)},findRowIndex:function(e){var d=this.findRow(e);return d?d.rowIndex:false},getRow:function(b){return this.getRows()[b]},getCell:function(d,e){return this.getRow(d).getElementsByTagName("td")[e]},getHeaderCell:function(b){return this.mainHd.dom.getElementsByTagName("td")[b]},addRowClass:function(g,e){var d=this.getRow(g);if(d){this.fly(d).addClass(e)}},removeRowClass:function(g,e){var d=this.getRow(g);if(d){this.fly(d).removeClass(e)}},removeRow:function(b){Ext.removeNode(this.getRow(b));this.syncFocusEl(b)},removeRows:function(l,g){var e=this.mainBody.dom;for(var h=l;h<=g;h++){Ext.removeNode(e.childNodes[l])}this.syncFocusEl(l)},getScrollState:function(){var b=this.scroller.dom;return{left:b.scrollLeft,top:b.scrollTop}},restoreScroll:function(e){var d=this.scroller.dom;d.scrollLeft=e.left;d.scrollTop=e.top},scrollToTop:function(){this.scroller.dom.scrollTop=0;this.scroller.dom.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var b=this.scroller.dom;this.grid.fireEvent("bodyscroll",b.scrollLeft,b.scrollTop)},syncHeaderScroll:function(){var b=this.scroller.dom;this.innerHd.scrollLeft=b.scrollLeft;this.innerHd.scrollLeft=b.scrollLeft},updateSortIcon:function(e,g){var h=this.sortClasses;var l=this.mainHd.select("td").removeClass(h);l.item(e).addClass(h[g=="DESC"?1:0])},updateAllColumnWidths:function(){var u=this.getTotalWidth();var p=this.cm.getColumnCount();var s=[];for(var w=0;w<p;w++){s[w]=this.getColumnWidth(w)}this.innerHd.firstChild.firstChild.style.width=u;for(var w=0;w<p;w++){var v=this.getHeaderCell(w);v.style.width=s[w]}var r=this.getRows(),o,q;for(var w=0,t=r.length;w<t;w++){o=r[w];o.style.width=u;if(o.firstChild){o.firstChild.style.width=u;q=o.firstChild.rows[0];for(var z=0;z<p;z++){q.childNodes[z].style.width=s[z]}}}this.onAllColumnWidthsUpdated(s,u)},updateColumnWidth:function(u,v){var o=this.getColumnWidth(u);var r=this.getTotalWidth();this.innerHd.firstChild.firstChild.style.width=r;var s=this.getHeaderCell(u);s.style.width=o;var p=this.getRows(),m;for(var t=0,q=p.length;t<q;t++){m=p[t];m.style.width=r;if(m.firstChild){m.firstChild.style.width=r;m.firstChild.rows[0].childNodes[u].style.width=o}}this.onColumnWidthUpdated(u,o,r)},updateColumnHidden:function(v,r){var s=this.getTotalWidth();this.innerHd.firstChild.firstChild.style.width=s;var p=r?"none":"";var t=this.getHeaderCell(v);t.style.display=p;var o=this.getRows(),m;for(var u=0,q=o.length;u<q;u++){m=o[u];m.style.width=s;if(m.firstChild){m.firstChild.style.width=s;m.firstChild.rows[0].childNodes[v].style.display=p}}this.onColumnHiddenUpdated(v,r,s);delete this.lastViewWidth;this.layout()},doRender:function(S,P,H,W,J,D){var V=this.templates,T=V.cell,Q=V.row,O=J-1;var U="width:"+this.getTotalWidth()+";";var p=[],G,K,F={},N={tstyle:U},L;for(var E=0,r=P.length;E<r;E++){L=P[E];G=[];var M=(E+W);for(var C=0;C<J;C++){K=S[C];F.id=K.id;F.css=C==0?"x-grid3-cell-first ":(C==O?"x-grid3-cell-last ":"");F.attr=F.cellAttr="";F.value=K.renderer(L.data[K.name],F,L,M,C,H);F.style=K.style;if(F.value==undefined||F.value===""){F.value="&#160;"}if(L.dirty&&typeof L.modified[K.name]!=="undefined"){F.css+=" x-grid3-dirty-cell"}G[G.length]=T.apply(F)}var I=[];if(D&&((M+1)%2==0)){I[0]="x-grid3-row-alt"}if(L.dirty){I[1]=" x-grid3-dirty-row"}N.cols=J;if(this.getRowClass){I[2]=this.getRowClass(L,M,N,H)}N.alt=I.join(" ");N.cells=G.join("");p[p.length]=Q.apply(N)}return p.join("")},processRows:function(r,s){if(this.ds.getCount()<1){return}s=s||!this.grid.stripeRows;r=r||0;var m=this.getRows();var q=" x-grid3-row-alt ";m[0].className+=" x-grid3-row-first";m[m.length-1].className+=" x-grid3-row-last";for(var u=r,t=m.length;u<t;u++){var o=m[u];o.rowIndex=u;if(!s){var v=((u+1)%2==0);var p=(" "+o.className+" ").indexOf(q)!=-1;if(v==p){continue}if(v){o.className+=" x-grid3-row-alt"}else{o.className=o.className.replace("x-grid3-row-alt","")}}}},afterRender:function(){this.mainBody.dom.innerHTML=this.renderRows();this.processRows(0,true);if(this.deferEmptyText!==true){this.applyEmptyText()}},renderUI:function(){var h=this.renderHeaders();var g=this.templates.body.apply({rows:""});var e=this.templates.master.apply({body:g,header:h});var l=this.grid;l.getGridEl().dom.innerHTML=e;this.initElements();Ext.fly(this.innerHd).on("click",this.handleHdDown,this);this.mainHd.on("mouseover",this.handleHdOver,this);this.mainHd.on("mouseout",this.handleHdOut,this);this.mainHd.on("mousemove",this.handleHdMove,this);this.scroller.on("scroll",this.syncScroll,this);if(l.enableColumnResize!==false){this.splitZone=new Ext.grid.GridView.SplitDragZone(l,this.mainHd.dom)}if(l.enableColumnMove){this.columnDrag=new Ext.grid.GridView.ColumnDragZone(l,this.innerHd);this.columnDrop=new Ext.grid.HeaderDropZone(l,this.mainHd.dom)}if(l.enableHdMenu!==false){if(l.enableColumnHide!==false){this.colMenu=new Ext.menu.Menu({id:l.id+"-hcols-menu"});this.colMenu.on("beforeshow",this.beforeColMenuShow,this);this.colMenu.on("itemclick",this.handleHdMenuClick,this)}this.hmenu=new Ext.menu.Menu({id:l.id+"-hctx"});this.hmenu.add({id:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"},{id:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"});if(l.enableColumnHide!==false){this.hmenu.add("-",{id:"columns",text:this.columnsText,menu:this.colMenu,iconCls:"x-cols-icon"})}this.hmenu.on("itemclick",this.handleHdMenuClick,this)}if(l.trackMouseOver){this.mainBody.on("mouseover",this.onRowOver,this);this.mainBody.on("mouseout",this.onRowOut,this)}if(l.enableDragDrop||l.enableDrag){this.dragZone=new Ext.grid.GridDragZone(l,{ddGroup:l.ddGroup||"GridDD"})}this.updateHeaderSortState()},layout:function(){if(!this.mainBody){return}var q=this.grid;var m=q.getGridEl();var l=m.getSize(true);var g=l.width;if(g<20||l.height<20){return}if(q.autoHeight){this.scroller.dom.style.overflow="visible";if(Ext.isSafari){this.scroller.dom.style.position="static"}}else{this.el.setSize(l.width,l.height);var o=this.mainHd.getHeight();var p=l.height-(o);this.scroller.setSize(g,p);if(this.innerHd){this.innerHd.style.width=(g)+"px"}}if(this.forceFit){if(this.lastViewWidth!=g){this.fitColumns(false,false);this.lastViewWidth=g}}else{this.autoExpand();this.syncHeaderScroll()}this.onLayout(g,p)},onLayout:function(e,d){},onColumnWidthUpdated:function(g,e,d){this.focusEl.setWidth(d)},onAllColumnWidthsUpdated:function(e,d){this.focusEl.setWidth(d)},onColumnHiddenUpdated:function(d,g,e){this.focusEl.setWidth(e)},updateColumnText:function(e,d){},afterMove:function(b){},init:function(b){this.grid=b;this.initTemplates();this.initData(b.store,b.colModel);this.initUI(b)},getColumnId:function(b){return this.cm.getColumnId(b)},renderHeaders:function(){var o=this.cm,q=this.templates;var s=q.hcell;var u=[],p=[],v={};var r=o.getColumnCount();var m=r-1;for(var t=0;t<r;t++){v.id=o.getColumnId(t);v.value=o.getColumnHeader(t)||"";v.style=this.getColumnStyle(t,true);v.tooltip=this.getColumnTooltip(t);v.css=t==0?"x-grid3-cell-first ":(t==m?"x-grid3-cell-last ":"");if(o.config[t].align=="right"){v.istyle="padding-right:16px"}else{delete v.istyle}u[u.length]=s.apply(v)}return q.header.apply({cells:u.join(""),tstyle:"width:"+this.getTotalWidth()+";"})},getColumnTooltip:function(e){var d=this.cm.getColumnTooltip(e);if(d){if(Ext.QuickTips.isEnabled()){return'ext:qtip="'+d+'"'}else{return'title="'+d+'"'}}return""},beforeUpdate:function(){this.grid.stopEditing(true)},updateHeaders:function(){this.innerHd.firstChild.innerHTML=this.renderHeaders()},focusRow:function(b){this.focusCell(b,0,false)},focusCell:function(g,e,d){this.syncFocusEl(this.ensureVisible(g,e,d));if(Ext.isGecko){this.focusEl.focus()}else{this.focusEl.focus.defer(1,this.focusEl)}},resolveCell:function(l,o,m){if(typeof l!="number"){l=l.rowIndex}if(!this.ds){return null}if(l<0||l>=this.ds.getCount()){return null}o=(o!==undefined?o:0);var g=this.getRow(l),h;if(!(m===false&&o===0)){while(this.cm.isHidden(o)){o++}h=this.getCell(l,o)}return{row:g,cell:h}},getResolvedXY:function(h){if(!h){return null}var g=this.scroller.dom,l=h.cell,m=h.row;return l?Ext.fly(l).getXY():[this.el.getX(),Ext.fly(m).getY()]},syncFocusEl:function(h,g,l){var e=h;if(!Ext.isArray(e)){h=Math.min(h,Math.max(0,this.getRows().length-1));e=this.getResolvedXY(this.resolveCell(h,g,l))}this.focusEl.setXY(e||this.scroller.getXY())},ensureVisible:function(L,G,H){var N=this.resolveCell(L,G,H);if(!N||!N.row){return}var C=N.row,F=N.cell;var w=this.scroller.dom;var M=0;var I=C,v=this.el.dom;while(I&&I!=v){M+=I.offsetTop;I=I.offsetParent}M-=this.mainHd.dom.offsetHeight;var p=M+C.offsetHeight;var K=w.clientHeight;var v=parseInt(w.scrollTop,10);var z=v+K;if(M<v){w.scrollTop=M}else{if(p>z){w.scrollTop=p-K}}if(H!==false){var B=parseInt(F.offsetLeft,10);var D=B+F.offsetWidth;var E=parseInt(w.scrollLeft,10);var J=E+w.clientWidth;if(B<E){w.scrollLeft=B}else{if(D>J){w.scrollLeft=D-w.clientWidth}}}return this.getResolvedXY(N)},insertRows:function(l,m,q,o){if(!o&&m===0&&q>=l.getCount()-1){this.refresh()}else{if(!o){this.fireEvent("beforerowsinserted",this,m,q)}var h=this.renderRows(m,q);var p=this.getRow(m);if(p){Ext.DomHelper.insertHtml("beforeBegin",p,h)}else{Ext.DomHelper.insertHtml("beforeEnd",this.mainBody.dom,h)}if(!o){this.fireEvent("rowsinserted",this,m,q);this.processRows(m)}}this.syncFocusEl(m)},deleteRows:function(e,g,d){if(e.getRowCount()<1){this.refresh()}else{this.fireEvent("beforerowsdeleted",this,g,d);this.removeRows(g,d);this.processRows(g);this.fireEvent("rowsdeleted",this,g,d)}},getColumnStyle:function(g,l){var e=!l?(this.cm.config[g].css||""):"";e+="width:"+this.getColumnWidth(g)+";";if(this.cm.isHidden(g)){e+="display:none;"}var h=this.cm.config[g].align;if(h){e+="text-align:"+h+";"}return e},getColumnWidth:function(d){var e=this.cm.getColumnWidth(d);if(typeof e=="number"){return(Ext.isBorderBox?e:(e-this.borderWidth>0?e-this.borderWidth:0))+"px"}return e},getTotalWidth:function(){return this.cm.getTotalWidth()+"px"},fitColumns:function(O,L,N){var M=this.cm,w,G,D;var z=M.getTotalWidth(false);var I=this.grid.getGridEl().getWidth(true)-this.scrollOffset;if(I<20){return}var Q=I-z;if(Q===0){return false}var S=M.getColumnCount(true);var C=S-(typeof N=="number"?1:0);if(C===0){C=1;N=undefined}var H=M.getColumnCount();var J=[];var E=0;var F=0;var K;for(D=0;D<H;D++){if(!M.isHidden(D)&&!M.isFixed(D)&&D!==N){K=M.getColumnWidth(D);J.push(D);E=D;J.push(K);F+=K}}var P=(I-M.getTotalWidth())/F;while(J.length){K=J.pop();D=J.pop();M.setColumnWidth(D,Math.max(this.grid.minColumnWidth,Math.floor(K+K*P)),true)}if((z=M.getTotalWidth(false))>I){var B=C!=S?N:E;M.setColumnWidth(B,Math.max(1,M.getColumnWidth(B)-(z-I)),true)}if(O!==true){this.updateAllColumnWidths()}return true},autoExpand:function(g){var o=this.grid,l=this.cm;if(!this.userResized&&o.autoExpandColumn){var r=l.getTotalWidth(false);var m=this.grid.getGridEl().getWidth(true)-this.scrollOffset;if(r!=m){var p=l.getIndexById(o.autoExpandColumn);var q=l.getColumnWidth(p);var s=Math.min(Math.max(((m-r)+q),o.autoExpandMin),o.autoExpandMax);if(s!=q){l.setColumnWidth(p,s,true);if(g!==true){this.updateColumnWidth(p,s)}}}}},getColumnData:function(){var m=[],h=this.cm,l=h.getColumnCount();for(var o=0;o<l;o++){var g=h.getDataIndex(o);m[o]={name:(typeof g=="undefined"?this.ds.fields.get(o).name:g),renderer:h.getRenderer(o),id:h.getColumnId(o),style:this.getColumnStyle(o)}}return m},renderRows:function(m,s){var r=this.grid,p=r.colModel,u=r.store,g=r.stripeRows;var o=p.getColumnCount();if(u.getCount()<1){return""}var q=this.getColumnData();m=m||0;s=typeof s=="undefined"?u.getCount()-1:s;var t=u.getRange(m,s);return this.doRender(q,t,u,m,o,g)},renderBody:function(){var b=this.renderRows();return this.templates.body.apply({rows:b})},refreshRow:function(e){var h=this.ds,l;if(typeof e=="number"){l=e;e=h.getAt(l)}else{l=h.indexOf(e)}var g=[];this.insertRows(h,l,l,true);this.getRow(l).rowIndex=l;this.onRemove(h,e,l+1,true);this.fireEvent("rowupdated",this,l,e)},refresh:function(d){this.fireEvent("beforerefresh",this);this.grid.stopEditing(true);var e=this.renderBody();this.mainBody.update(e);if(d===true){this.updateHeaders();this.updateHeaderSortState()}this.processRows(0,true);this.layout();this.applyEmptyText();this.fireEvent("refresh",this)},applyEmptyText:function(){if(this.emptyText&&!this.hasRows()){this.mainBody.update('<div class="x-grid-empty">'+this.emptyText+"</div>")}},updateHeaderSortState:function(){var d=this.ds.getSortState();if(!d){return}if(!this.sortState||(this.sortState.field!=d.field||this.sortState.direction!=d.direction)){this.grid.fireEvent("sortchange",this.grid,d)}this.sortState=d;var g=this.cm.findColumnIndex(d.field);if(g!=-1){var e=d.direction;this.updateSortIcon(g,e)}},destroy:function(){if(this.colMenu){Ext.menu.MenuMgr.unregister(this.colMenu);this.colMenu.destroy();delete this.colMenu}if(this.hmenu){Ext.menu.MenuMgr.unregister(this.hmenu);this.hmenu.destroy();delete this.hmenu}if(this.grid.enableColumnMove){var g=Ext.dd.DDM.ids["gridHeader"+this.grid.getGridEl().id];if(g){for(var e in g){if(!g[e].config.isTarget&&g[e].dragElId){var d=g[e].dragElId;g[e].unreg();Ext.get(d).remove()}else{if(g[e].config.isTarget){g[e].proxyTop.remove();g[e].proxyBottom.remove();g[e].unreg()}}if(Ext.dd.DDM.locationCache[e]){delete Ext.dd.DDM.locationCache[e]}}delete Ext.dd.DDM.ids["gridHeader"+this.grid.getGridEl().id]}}if(this.dragZone){this.dragZone.unreg()}Ext.fly(this.innerHd).removeAllListeners();Ext.removeNode(this.innerHd);Ext.destroy(this.resizeMarker,this.resizeProxy,this.focusEl,this.mainBody,this.scroller,this.mainHd,this.mainWrap,this.dragZone,this.splitZone,this.columnDrag,this.columnDrop);this.initData(null,null);Ext.EventManager.removeResizeListener(this.onWindowResize,this);this.purgeListeners()},onDenyColumnHide:function(){},render:function(){if(this.autoFill){var b=this.grid.ownerCt;if(b&&b.getLayout()){b.on("afterlayout",function(){this.fitColumns(true,true);this.updateHeaders()},this,{single:true})}else{this.fitColumns(true,true)}}else{if(this.forceFit){this.fitColumns(true,false)}else{if(this.grid.autoExpandColumn){this.autoExpand(true)}}}this.renderUI()},initData:function(d,e){if(this.ds){this.ds.un("load",this.onLoad,this);this.ds.un("datachanged",this.onDataChange,this);this.ds.un("add",this.onAdd,this);this.ds.un("remove",this.onRemove,this);this.ds.un("update",this.onUpdate,this);this.ds.un("clear",this.onClear,this)}if(d){d.on("load",this.onLoad,this);d.on("datachanged",this.onDataChange,this);d.on("add",this.onAdd,this);d.on("remove",this.onRemove,this);d.on("update",this.onUpdate,this);d.on("clear",this.onClear,this)}this.ds=d;if(this.cm){this.cm.un("configchange",this.onColConfigChange,this);this.cm.un("widthchange",this.onColWidthChange,this);this.cm.un("headerchange",this.onHeaderChange,this);this.cm.un("hiddenchange",this.onHiddenChange,this);this.cm.un("columnmoved",this.onColumnMove,this);this.cm.un("columnlockchange",this.onColumnLock,this)}if(e){delete this.lastViewWidth;e.on("configchange",this.onColConfigChange,this);e.on("widthchange",this.onColWidthChange,this);e.on("headerchange",this.onHeaderChange,this);e.on("hiddenchange",this.onHiddenChange,this);e.on("columnmoved",this.onColumnMove,this);e.on("columnlockchange",this.onColumnLock,this)}this.cm=e},onDataChange:function(){this.refresh();this.updateHeaderSortState();this.syncFocusEl(0)},onClear:function(){this.refresh();this.syncFocusEl(0)},onUpdate:function(d,e){this.refreshRow(e)},onAdd:function(g,e,d){this.insertRows(g,d,d+(e.length-1))},onRemove:function(h,g,e,l){if(l!==true){this.fireEvent("beforerowremoved",this,e,g)}this.removeRow(e);if(l!==true){this.processRows(e);this.applyEmptyText();this.fireEvent("rowremoved",this,e,g)}},onLoad:function(){this.scrollToTop()},onColWidthChange:function(e,d,g){this.updateColumnWidth(d,g)},onHeaderChange:function(e,d,g){this.updateHeaders()},onHiddenChange:function(e,d,g){this.updateColumnHidden(d,g)},onColumnMove:function(g,h,e){this.indexMap=null;var l=this.getScrollState();this.refresh(true);this.restoreScroll(l);this.afterMove(e)},onColConfigChange:function(){delete this.lastViewWidth;this.indexMap=null;this.refresh(true)},initUI:function(b){b.on("headerclick",this.onHeaderClick,this)},initEvents:function(){},onHeaderClick:function(d,e){if(this.headersDisabled||!this.cm.isSortable(e)){return}d.stopEditing(true);d.store.sort(this.cm.getDataIndex(e))},onRowOver:function(d,e){var g;if((g=this.findRowIndex(e))!==false){this.addRowClass(g,"x-grid3-row-over")}},onRowOut:function(d,e){var g;if((g=this.findRowIndex(e))!==false&&!d.within(this.getRow(g),true)){this.removeRowClass(g,"x-grid3-row-over")}},handleWheel:function(b){b.stopPropagation()},onRowSelect:function(b){this.addRowClass(b,"x-grid3-row-selected")},onRowDeselect:function(b){this.removeRowClass(b,"x-grid3-row-selected")},onCellSelect:function(g,d){var e=this.getCell(g,d);if(e){this.fly(e).addClass("x-grid3-cell-selected")}},onCellDeselect:function(g,d){var e=this.getCell(g,d);if(e){this.fly(e).removeClass("x-grid3-cell-selected")}},onColumnSplitterMoved:function(g,d){this.userResized=true;var e=this.grid.colModel;e.setColumnWidth(g,d,true);if(this.forceFit){this.fitColumns(true,false,g);this.updateAllColumnWidths()}else{this.updateColumnWidth(g,d);this.syncHeaderScroll()}this.grid.fireEvent("columnresize",g,d)},handleHdMenuClick:function(l){var e=this.hdCtxIndex;var g=this.cm,h=this.ds;switch(l.id){case"asc":h.sort(g.getDataIndex(e),"ASC");break;case"desc":h.sort(g.getDataIndex(e),"DESC");break;default:e=g.getIndexById(l.id.substr(4));if(e!=-1){if(l.checked&&g.getColumnsBy(this.isHideableColumn,this).length<=1){this.onDenyColumnHide();return false}g.setHidden(e,l.checked)}}return true},isHideableColumn:function(b){return !b.hidden&&!b.fixed},beforeColMenuShow:function(){var e=this.cm,g=e.getColumnCount();this.colMenu.removeAll();for(var d=0;d<g;d++){if(e.config[d].fixed!==true&&e.config[d].hideable!==false){this.colMenu.add(new Ext.menu.CheckItem({id:"col-"+e.getColumnId(d),text:e.getColumnHeader(d),checked:!e.isHidden(d),hideOnClick:false,disabled:e.config[d].hideable===false}))}}},handleHdDown:function(m,p){if(Ext.fly(p).hasClass("x-grid3-hd-btn")){m.stopEvent();var o=this.findHeaderCell(p);Ext.fly(o).addClass("x-grid3-hd-menu-open");var q=this.getCellIndex(o);this.hdCtxIndex=q;var e=this.hmenu.items,l=this.cm;e.get("asc").setDisabled(!l.isSortable(q));e.get("desc").setDisabled(!l.isSortable(q));this.hmenu.on("hide",function(){Ext.fly(o).removeClass("x-grid3-hd-menu-open")},this,{single:true});this.hmenu.show(p,"tl-bl?")}},handleHdOver:function(h,g){var l=this.findHeaderCell(g);if(l&&!this.headersDisabled){this.activeHd=l;this.activeHdIndex=this.getCellIndex(l);var e=this.fly(l);this.activeHdRegion=e.getRegion();if(!this.cm.isMenuDisabled(this.activeHdIndex)){e.addClass("x-grid3-hd-over");this.activeHdBtn=e.child(".x-grid3-hd-btn");if(this.activeHdBtn){this.activeHdBtn.dom.style.height=(l.firstChild.offsetHeight-1)+"px"}}}},handleHdMove:function(m,p){if(this.activeHd&&!this.headersDisabled){var e=this.splitHandleWidth||5;var o=this.activeHdRegion;var l=m.getPageX();var q=this.activeHd.style;if(l-o.left<=e&&this.cm.isResizable(this.activeHdIndex-1)){q.cursor=Ext.isAir?"move":Ext.isSafari?"e-resize":"col-resize"}else{if(o.right-l<=(!this.activeHdBtn?e:2)&&this.cm.isResizable(this.activeHdIndex)){q.cursor=Ext.isAir?"move":Ext.isSafari?"w-resize":"col-resize"}else{q.cursor=""}}}},handleHdOut:function(g,e){var d=this.findHeaderCell(e);if(d&&(!Ext.isIE||!g.within(d,true))){this.activeHd=null;this.fly(d).removeClass("x-grid3-hd-over");d.style.cursor=""}},hasRows:function(){var b=this.mainBody.dom.firstChild;return b&&b.className!="x-grid-empty"},bind:function(e,d){this.initData(e,d)}});Ext.grid.GridView.SplitDragZone=function(e,d){this.grid=e;this.view=e.getView();this.marker=this.view.resizeMarker;this.proxy=this.view.resizeProxy;Ext.grid.GridView.SplitDragZone.superclass.constructor.call(this,d,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});this.scroll=false;this.hw=this.view.splitHandleWidth||5};Ext.extend(Ext.grid.GridView.SplitDragZone,Ext.dd.DDProxy,{b4StartDrag:function(h,l){this.view.headersDisabled=true;var m=this.view.mainWrap.getHeight();this.marker.setHeight(m);this.marker.show();this.marker.alignTo(this.view.getHeaderCell(this.cellIndex),"tl-tl",[-2,0]);this.proxy.setHeight(m);var g=this.cm.getColumnWidth(this.cellIndex);var o=Math.max(g-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(o,1000);this.setYConstraint(0,0);this.minX=h-o;this.maxX=h+1000;this.startPos=h;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,h,l)},handleMouseDown:function(z){var q=this.view.findHeaderCell(z.getTarget());if(q){var e=this.view.fly(q).getXY(),t=e[0],u=e[1];var p=z.getXY(),v=p[0],w=p[1];var r=q.offsetWidth,s=false;if((v-t)<=this.hw){s=-1}else{if((t+r)-v<=this.hw){s=0}}if(s!==false){this.cm=this.grid.colModel;var o=this.view.getCellIndex(q);if(s==-1){if(o+s<0){return}while(this.cm.isHidden(o+s)){--s;if(o+s<0){return}}}this.cellIndex=o+s;this.split=q.dom;if(this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)){Ext.grid.GridView.SplitDragZone.superclass.handleMouseDown.apply(this,arguments)}}else{if(this.view.columnDrag){this.view.columnDrag.callHandleMouseDown(z)}}}},endDrag:function(h){this.marker.hide();var g=this.view;var e=Math.max(this.minX,h.getPageX());var l=e-this.startPos;g.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+l);setTimeout(function(){g.headersDisabled=false},50)},autoOffset:function(){this.setDelta(0,0)}});Ext.grid.GroupingView=Ext.extend(Ext.grid.GridView,{hideGroupedColumn:false,showGroupName:true,startCollapsed:false,enableGrouping:true,enableGroupingMenu:true,enableNoGroups:true,emptyGroupText:"(None)",ignoreAdd:false,groupTextTpl:"{text}",gidSeed:1000,initTemplates:function(){Ext.grid.GroupingView.superclass.initTemplates.call(this);this.state={};var b=this.grid.getSelectionModel();b.on(b.selectRow?"beforerowselect":"beforecellselect",this.onBeforeRowSelect,this);if(!this.startGroup){this.startGroup=new Ext.XTemplate('<div id="{groupId}" class="x-grid-group {cls}">','<div id="{groupId}-hd" class="x-grid-group-hd" style="{style}"><div>',this.groupTextTpl,"</div></div>",'<div id="{groupId}-bd" class="x-grid-group-body">')}this.startGroup.compile();this.endGroup="</div></div>"},findGroup:function(b){return Ext.fly(b).up(".x-grid-group",this.mainBody.dom)},getGroups:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},onAdd:function(){if(this.enableGrouping&&!this.ignoreAdd){var b=this.getScrollState();this.refresh();this.restoreScroll(b)}else{if(!this.enableGrouping){Ext.grid.GroupingView.superclass.onAdd.apply(this,arguments)}}},onRemove:function(l,h,g,m){Ext.grid.GroupingView.superclass.onRemove.apply(this,arguments);var o=document.getElementById(h._groupId);if(o&&o.childNodes[1].childNodes.length<1){Ext.removeNode(o)}this.applyEmptyText()},refreshRow:function(b){if(this.ds.getCount()==1){this.refresh()}else{this.isUpdating=true;Ext.grid.GroupingView.superclass.refreshRow.apply(this,arguments);this.isUpdating=false}},beforeMenuShow:function(){var g=this.getGroupField();var d=this.hmenu.items.get("groupBy");if(d){d.setDisabled(this.cm.config[this.hdCtxIndex].groupable===false)}var e=this.hmenu.items.get("showGroups");if(e){e.setDisabled(!g&&this.cm.config[this.hdCtxIndex].groupable===false);e.setChecked(!!g,true)}},renderUI:function(){Ext.grid.GroupingView.superclass.renderUI.call(this);this.mainBody.on("mousedown",this.interceptMouse,this);if(this.enableGroupingMenu&&this.hmenu){this.hmenu.add("-",{id:"groupBy",text:this.groupByText,handler:this.onGroupByClick,scope:this,iconCls:"x-group-by-icon"});if(this.enableNoGroups){this.hmenu.add({id:"showGroups",text:this.showGroupsText,checked:true,checkHandler:this.onShowGroupsClick,scope:this})}this.hmenu.on("beforeshow",this.beforeMenuShow,this)}},onGroupByClick:function(){this.grid.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));this.beforeMenuShow()},onShowGroupsClick:function(e,d){if(d){this.onGroupByClick()}else{this.grid.store.clearGrouping()}},toggleGroup:function(g,d){this.grid.stopEditing(true);g=Ext.getDom(g);var e=Ext.fly(g);d=d!==undefined?d:e.hasClass("x-grid-group-collapsed");this.state[e.dom.id]=d;e[d?"removeClass":"addClass"]("x-grid-group-collapsed")},toggleAllGroups:function(l){var e=this.getGroups();for(var h=0,g=e.length;h<g;h++){this.toggleGroup(e[h],l)}},expandAllGroups:function(){this.toggleAllGroups(true)},collapseAllGroups:function(){this.toggleAllGroups(false)},interceptMouse:function(d){var e=d.getTarget(".x-grid-group-hd",this.mainBody);if(e){d.stopEvent();this.toggleGroup(e.parentNode)}},getGroup:function(l,q,o,m,g,p){var r=o?o(l,{},q,m,g,p):String(l);if(r===""){r=this.cm.config[g].emptyGroupText||this.emptyGroupText}return r},getGroupField:function(){return this.grid.store.getGroupState()},renderRows:function(){var g=this.getGroupField();var h=!!g;if(this.hideGroupedColumn){var e=this.cm.findColumnIndex(g);if(!h&&this.lastGroupField!==undefined){this.mainBody.update("");this.cm.setHidden(this.cm.findColumnIndex(this.lastGroupField),false);delete this.lastGroupField}else{if(h&&this.lastGroupField===undefined){this.lastGroupField=g;this.cm.setHidden(e,true)}else{if(h&&this.lastGroupField!==undefined&&g!==this.lastGroupField){this.mainBody.update("");var l=this.cm.findColumnIndex(this.lastGroupField);this.cm.setHidden(l,false);this.lastGroupField=g;this.cm.setHidden(e,true)}}}}return Ext.grid.GroupingView.superclass.renderRows.apply(this,arguments)},doRender:function(Z,V,H,ac,I,F){if(V.length<1){return""}var K=this.getGroupField();var J=this.cm.findColumnIndex(K);this.enableGrouping=!!K;if(!this.enableGrouping||this.isUpdating){return Ext.grid.GroupingView.superclass.doRender.apply(this,arguments)}var U="width:"+this.getTotalWidth()+";";var G=this.grid.getGridEl().id;var W=this.cm.config[J];var ab=W.groupRenderer||W.renderer;var E=this.showGroupName?(W.groupName||W.header)+": ":"";var L=[],Q,r,g,N;for(r=0,g=V.length;r<g;r++){var S=ac+r;var P=V[r],Y=P.data[K],O=this.getGroup(Y,P,ab,S,J,H);if(!Q||Q.group!=O){N=G+"-gp-"+K+"-"+Ext.util.Format.htmlEncode(O);var aa=typeof this.state[N]!=="undefined"?!this.state[N]:this.startCollapsed;var T=aa?"x-grid-group-collapsed":"";Q={group:O,gvalue:Y,text:E+O,groupId:N,startRow:S,rs:[P],cls:T,style:U};L.push(Q)}else{Q.rs.push(P)}P._groupId=N}var M=[];for(r=0,g=L.length;r<g;r++){var O=L[r];this.doGroupStart(M,O,Z,H,I);M[M.length]=Ext.grid.GroupingView.superclass.doRender.call(this,Z,O.rs,H,O.startRow,I,F);this.doGroupEnd(M,O,Z,H,I)}return M.join("")},getGroupId:function(p){var r=this.grid.getGridEl().id;var s=this.getGroupField();var q=this.cm.findColumnIndex(s);var l=this.cm.config[q];var o=l.groupRenderer||l.renderer;var m=this.getGroup(p,{data:{}},o,0,q,this.ds);return r+"-gp-"+s+"-"+Ext.util.Format.htmlEncode(p)},doGroupStart:function(h,m,g,l,o){h[h.length]=this.startGroup.apply(m)},doGroupEnd:function(h,m,g,l,o){h[h.length]=this.endGroup},getRows:function(){if(!this.enableGrouping){return Ext.grid.GroupingView.superclass.getRows.call(this)}var m=[];var o,r=this.getGroups();for(var p=0,l=r.length;p<l;p++){o=r[p].childNodes[1].childNodes;for(var q=0,g=o.length;q<g;q++){m[m.length]=o[q]}}return m},updateGroupWidths:function(){if(!this.enableGrouping||!this.hasRows()){return}var l=Math.max(this.cm.getTotalWidth(),this.el.dom.offsetWidth-this.scrollOffset)+"px";var e=this.getGroups();for(var h=0,g=e.length;h<g;h++){e[h].firstChild.style.width=l}},onColumnWidthUpdated:function(g,e,d){Ext.grid.GroupingView.superclass.onColumnWidthUpdated.call(this,g,e,d);this.updateGroupWidths()},onAllColumnWidthsUpdated:function(e,d){Ext.grid.GroupingView.superclass.onAllColumnWidthsUpdated.call(this,e,d);this.updateGroupWidths()},onColumnHiddenUpdated:function(d,g,e){Ext.grid.GroupingView.superclass.onColumnHiddenUpdated.call(this,d,g,e);this.updateGroupWidths()},onLayout:function(){this.updateGroupWidths()},onBeforeRowSelect:function(h,l){if(!this.enableGrouping){return}var e=this.getRow(l);if(e&&!e.offsetParent){var g=this.findGroup(e);this.toggleGroup(g,true)}},groupByText:"Group By This Field",showGroupsText:"Show in Groups"});Ext.grid.GroupingView.GROUP_ID=1000;Ext.grid.HeaderDragZone=function(e,g,d){this.grid=e;this.view=e.getView();this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDragZone.superclass.constructor.call(this,g);if(d){this.setHandleElId(Ext.id(g));this.setOuterHandleElId(Ext.id(d))}this.scroll=false};Ext.extend(Ext.grid.HeaderDragZone,Ext.dd.DragZone,{maxDragWidth:120,getDragData:function(g){var e=Ext.lib.Event.getTarget(g);var d=this.view.findHeaderCell(e);if(d){return{ddel:d.firstChild,header:d}}return false},onInitDrag:function(e){this.view.headersDisabled=true;var d=this.dragData.ddel.cloneNode(true);d.id=Ext.id();d.style.width=Math.min(this.dragData.header.offsetWidth,this.maxDragWidth)+"px";this.proxy.update(d);return true},afterValidDrop:function(){var b=this.view;setTimeout(function(){b.headersDisabled=false},50)},afterInvalidDrop:function(){var b=this.view;setTimeout(function(){b.headersDisabled=false},50)}});Ext.grid.HeaderDropZone=function(e,g,d){this.grid=e;this.view=e.getView();this.proxyTop=Ext.DomHelper.append(document.body,{cls:"col-move-top",html:"&#160;"},true);this.proxyBottom=Ext.DomHelper.append(document.body,{cls:"col-move-bottom",html:"&#160;"},true);this.proxyTop.hide=this.proxyBottom.hide=function(){this.setLeftTop(-100,-100);this.setStyle("visibility","hidden")};this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDropZone.superclass.constructor.call(this,e.getGridEl().dom)};Ext.extend(Ext.grid.HeaderDropZone,Ext.dd.DropZone,{proxyOffsets:[-4,-9],fly:Ext.Element.fly,getTargetFromEvent:function(g){var e=Ext.lib.Event.getTarget(g);var d=this.view.findCellIndex(e);if(d!==false){return this.view.getHeaderCell(d)}},nextVisible:function(g){var d=this.view,e=this.grid.colModel;g=g.nextSibling;while(g){if(!e.isHidden(d.getCellIndex(g))){return g}g=g.nextSibling}return null},prevVisible:function(g){var d=this.view,e=this.grid.colModel;g=g.prevSibling;while(g){if(!e.isHidden(d.getCellIndex(g))){return g}g=g.prevSibling}return null},positionIndicator:function(v,z,u){var r=Ext.lib.Event.getPageX(u);var B=Ext.lib.Dom.getRegion(z.firstChild);var q,e,s=B.top+this.proxyOffsets[1];if((B.right-r)<=(B.right-B.left)/2){q=B.right+this.view.borderWidth;e="after"}else{q=B.left;e="before"}var t=this.view.getCellIndex(v);var h=this.view.getCellIndex(z);if(this.grid.colModel.isFixed(h)){return false}var w=this.grid.colModel.isLocked(h);if(e=="after"){h++}if(t<h){h--}if(t==h&&(w==this.grid.colModel.isLocked(t))){return false}q+=this.proxyOffsets[0];this.proxyTop.setLeftTop(q,s);this.proxyTop.show();if(!this.bottomOffset){this.bottomOffset=this.view.mainHd.getHeight()}this.proxyBottom.setLeftTop(q,s+this.proxyTop.dom.offsetHeight+this.bottomOffset);this.proxyBottom.show();return e},onNodeEnter:function(h,g,l,e){if(e.header!=h){this.positionIndicator(e.header,h,l)}},onNodeOver:function(l,e,m,o){var h=false;if(o.header!=l){h=this.positionIndicator(o.header,l,m)}if(!h){this.proxyTop.hide();this.proxyBottom.hide()}return h?this.dropAllowed:this.dropNotAllowed},onNodeOut:function(h,g,l,e){this.proxyTop.hide();this.proxyBottom.hide()},onNodeDrop:function(C,h,v,z){var w=z.header;if(w!=C){var s=this.grid.colModel;var t=Ext.lib.Event.getPageX(v);var D=Ext.lib.Dom.getRegion(C.firstChild);var e=(D.right-t)<=((D.right-D.left)/2)?"after":"before";var u=this.view.getCellIndex(w);var r=this.view.getCellIndex(C);var B=s.isLocked(r);if(e=="after"){r++}if(u<r){r--}if(u==r&&(B==s.isLocked(u))){return false}s.setLocked(u,B,true);s.moveColumn(u,r);this.grid.fireEvent("columnmove",u,r);return true}return false}});Ext.grid.GridView.ColumnDragZone=function(e,d){Ext.grid.GridView.ColumnDragZone.superclass.constructor.call(this,e,d,null);this.proxy.el.addClass("x-grid3-col-dd")};Ext.extend(Ext.grid.GridView.ColumnDragZone,Ext.grid.HeaderDragZone,{handleMouseDown:function(b){},callHandleMouseDown:function(b){Ext.grid.GridView.ColumnDragZone.superclass.handleMouseDown.call(this,b)}});Ext.grid.SplitDragZone=function(e,g,d){this.grid=e;this.view=e.getView();this.proxy=this.view.resizeProxy;Ext.grid.SplitDragZone.superclass.constructor.call(this,g,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});this.setHandleElId(Ext.id(g));this.setOuterHandleElId(Ext.id(d));this.scroll=false};Ext.extend(Ext.grid.SplitDragZone,Ext.dd.DDProxy,{fly:Ext.Element.fly,b4StartDrag:function(g,h){this.view.headersDisabled=true;this.proxy.setHeight(this.view.mainWrap.getHeight());var e=this.cm.getColumnWidth(this.cellIndex);var l=Math.max(e-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(l,1000);this.setYConstraint(0,0);this.minX=g-l;this.maxX=g+1000;this.startPos=g;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,g,h)},handleMouseDown:function(d){ev=Ext.EventObject.setEvent(d);var e=this.fly(ev.getTarget());if(e.hasClass("x-grid-split")){this.cellIndex=this.view.getCellIndex(e.dom);this.split=e.dom;this.cm=this.grid.colModel;if(this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)){Ext.grid.SplitDragZone.superclass.handleMouseDown.apply(this,arguments)}}},endDrag:function(g){this.view.headersDisabled=false;var e=Math.max(this.minX,Ext.lib.Event.getPageX(g));var d=e-this.startPos;this.view.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+d)},autoOffset:function(){this.setDelta(0,0)}});Ext.grid.GridDragZone=function(d,e){this.view=d.getView();Ext.grid.GridDragZone.superclass.constructor.call(this,this.view.mainBody.dom,e);if(this.view.lockedBody){this.setHandleElId(Ext.id(this.view.mainBody.dom));this.setOuterHandleElId(Ext.id(this.view.lockedBody.dom))}this.scroll=false;this.grid=d;this.ddel=document.createElement("div");this.ddel.className="x-grid-dd-wrap"};Ext.extend(Ext.grid.GridDragZone,Ext.dd.DragZone,{ddGroup:"GridDD",getDragData:function(e){var g=Ext.lib.Event.getTarget(e);var h=this.view.findRowIndex(g);if(h!==false){var l=this.grid.selModel;if(!l.isSelected(h)||e.hasModifier()){l.handleMouseDown(this.grid,h,e)}return{grid:this.grid,ddel:this.ddel,rowIndex:h,selections:l.getSelections()}}return false},onInitDrag:function(d){var e=this.dragData;this.ddel.innerHTML=this.grid.getDragDropText();this.proxy.update(this.ddel)},afterRepair:function(){this.dragging=false},getRepairXY:function(d,e){return false},onEndDrag:function(e,d){},onValidDrop:function(e,d,g){this.hideProxy()},beforeInvalidDrop:function(e,d){}});Ext.grid.ColumnModel=function(b){this.defaultWidth=100;this.defaultSortable=false;if(b.columns){Ext.apply(this,b);this.setConfig(b.columns,true)}else{this.setConfig(b,true)}this.addEvents("widthchange","headerchange","hiddenchange","columnmoved","columnlockchange","configchange");Ext.grid.ColumnModel.superclass.constructor.call(this)};Ext.extend(Ext.grid.ColumnModel,Ext.util.Observable,{getColumnId:function(b){return this.config[b].id},setConfig:function(p,h){if(!h){delete this.totalWidth;for(var o=0,l=this.config.length;o<l;o++){var m=this.config[o];if(m.editor){m.editor.destroy()}}}this.config=p;this.lookup={};for(var o=0,l=p.length;o<l;o++){var m=p[o];if(typeof m.renderer=="string"){m.renderer=Ext.util.Format[m.renderer]}if(typeof m.id=="undefined"){m.id=o}if(m.editor&&m.editor.isFormField){m.editor=new Ext.grid.GridEditor(m.editor)}this.lookup[m.id]=m}if(!h){this.fireEvent("configchange",this)}},getColumnById:function(b){return this.lookup[b]},getIndexById:function(g){for(var d=0,e=this.config.length;d<e;d++){if(this.config[d].id==g){return d}}return -1},moveColumn:function(h,g){var e=this.config[h];this.config.splice(h,1);this.config.splice(g,0,e);this.dataMap=null;this.fireEvent("columnmoved",this,h,g)},isLocked:function(b){return this.config[b].locked===true},setLocked:function(d,g,e){if(this.isLocked(d)==g){return}this.config[d].locked=g;if(!e){this.fireEvent("columnlockchange",this,d,g)}},getTotalLockedWidth:function(){var e=0;for(var d=0;d<this.config.length;d++){if(this.isLocked(d)&&!this.isHidden(d)){this.totalWidth+=this.getColumnWidth(d)}}return e},getLockedCount:function(){for(var d=0,e=this.config.length;d<e;d++){if(!this.isLocked(d)){return d}}},getColumnCount:function(m){if(m===true){var l=0;for(var g=0,h=this.config.length;g<h;g++){if(!this.isHidden(g)){l++}}return l}return this.config.length},getColumnsBy:function(q,r){var p=[];for(var l=0,m=this.config.length;l<m;l++){var o=this.config[l];if(q.call(r||this,o,l)===true){p[p.length]=o}}return p},isSortable:function(b){if(typeof this.config[b].sortable=="undefined"){return this.defaultSortable}return this.config[b].sortable},isMenuDisabled:function(b){return !!this.config[b].menuDisabled},getRenderer:function(b){if(!this.config[b].renderer){return Ext.grid.ColumnModel.defaultRenderer}return this.config[b].renderer},setRenderer:function(e,d){this.config[e].renderer=d},getColumnWidth:function(b){return this.config[b].width||this.defaultWidth},setColumnWidth:function(d,g,e){this.config[d].width=g;this.totalWidth=null;if(!e){this.fireEvent("widthchange",this,d,g)}},getTotalWidth:function(d){if(!this.totalWidth){this.totalWidth=0;for(var g=0,e=this.config.length;g<e;g++){if(d||!this.isHidden(g)){this.totalWidth+=this.getColumnWidth(g)}}}return this.totalWidth},getColumnHeader:function(b){return this.config[b].header},setColumnHeader:function(e,d){this.config[e].header=d;this.fireEvent("headerchange",this,e,d)},getColumnTooltip:function(b){return this.config[b].tooltip},setColumnTooltip:function(e,d){this.config[e].tooltip=d},getDataIndex:function(b){return this.config[b].dataIndex},setDataIndex:function(e,d){this.config[e].dataIndex=d},findColumnIndex:function(m){var l=this.config;for(var g=0,h=l.length;g<h;g++){if(l[g].dataIndex==m){return g}}return -1},isCellEditable:function(e,d){return(this.config[e].editable||(typeof this.config[e].editable=="undefined"&&this.config[e].editor))?true:false},getCellEditor:function(e,d){return this.config[e].editor},setEditable:function(e,d){this.config[e].editable=d},isHidden:function(b){return this.config[b].hidden},isFixed:function(b){return this.config[b].fixed},isResizable:function(b){return b>=0&&this.config[b].resizable!==false&&this.config[b].fixed!==true},setHidden:function(g,e){var h=this.config[g];if(h.hidden!==e){h.hidden=e;this.totalWidth=null;this.fireEvent("hiddenchange",this,g,e)}},setEditor:function(e,d){this.config[e].editor=d}});Ext.grid.ColumnModel.defaultRenderer=function(b){if(typeof b=="string"&&b.length<1){return"&#160;"}return b};Ext.grid.DefaultColumnModel=Ext.grid.ColumnModel;Ext.grid.AbstractSelectionModel=function(){this.locked=false;Ext.grid.AbstractSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.grid.AbstractSelectionModel,Ext.util.Observable,{init:function(b){this.grid=b;this.initEvents()},lock:function(){this.locked=true},unlock:function(){this.locked=false},isLocked:function(){return this.locked}});Ext.grid.RowSelectionModel=function(b){Ext.apply(this,b);this.selections=new Ext.util.MixedCollection(false,function(a){return a.id});this.last=false;this.lastActive=false;this.addEvents("selectionchange","beforerowselect","rowselect","rowdeselect");Ext.grid.RowSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.grid.RowSelectionModel,Ext.grid.AbstractSelectionModel,{singleSelect:false,initEvents:function(){if(!this.grid.enableDragDrop&&!this.grid.enableDrag){this.grid.on("rowmousedown",this.handleMouseDown,this)}else{this.grid.on("rowclick",function(a,e,g){if(g.button===0&&!g.shiftKey&&!g.ctrlKey){this.selectRow(e,false);a.view.focusRow(e)}},this)}this.rowNav=new Ext.KeyNav(this.grid.getGridEl(),{up:function(d){if(!d.shiftKey||this.singleSelect){this.selectPrevious(false)}else{if(this.last!==false&&this.lastActive!==false){var a=this.last;this.selectRange(this.last,this.lastActive-1);this.grid.getView().focusRow(this.lastActive);if(a!==false){this.last=a}}else{this.selectFirstRow()}}},down:function(d){if(!d.shiftKey||this.singleSelect){this.selectNext(false)}else{if(this.last!==false&&this.lastActive!==false){var a=this.last;this.selectRange(this.last,this.lastActive+1);this.grid.getView().focusRow(this.lastActive);if(a!==false){this.last=a}}else{this.selectFirstRow()}}},scope:this});var b=this.grid.view;b.on("refresh",this.onRefresh,this);b.on("rowupdated",this.onRowUpdated,this);b.on("rowremoved",this.onRemove,this)},onRefresh:function(){var m=this.grid.store,h;var p=this.getSelections();this.clearSelections(true);for(var q=0,l=p.length;q<l;q++){var o=p[q];if((h=m.indexOfId(o.id))!=-1){this.selectRow(h,true)}}if(p.length!=this.selections.getCount()){this.fireEvent("selectionchange",this)}},onRemove:function(e,d,g){if(this.selections.remove(g)!==false){this.fireEvent("selectionchange",this)}},onRowUpdated:function(e,d,g){if(this.isSelected(g)){e.onRowSelect(d)}},selectRecords:function(g,l){if(!l){this.clearSelections()}var m=this.grid.store;for(var o=0,h=g.length;o<h;o++){this.selectRow(m.indexOf(g[o]),true)}},getCount:function(){return this.selections.length},selectFirstRow:function(){this.selectRow(0)},selectLastRow:function(b){this.selectRow(this.grid.store.getCount()-1,b)},selectNext:function(b){if(this.hasNext()){this.selectRow(this.last+1,b);this.grid.getView().focusRow(this.last);return true}return false},selectPrevious:function(b){if(this.hasPrevious()){this.selectRow(this.last-1,b);this.grid.getView().focusRow(this.last);return true}return false},hasNext:function(){return this.last!==false&&(this.last+1)<this.grid.store.getCount()},hasPrevious:function(){return !!this.last},getSelections:function(){return[].concat(this.selections.items)},getSelected:function(){return this.selections.itemAt(0)},each:function(l,m){var o=this.getSelections();for(var g=0,h=o.length;g<h;g++){if(l.call(m||this,o[g],g)===false){return false}}return true},clearSelections:function(e){if(this.isLocked()){return}if(e!==true){var g=this.grid.store;var d=this.selections;d.each(function(a){this.deselectRow(g.indexOfId(a.id))},this);d.clear()}else{this.selections.clear()}this.last=false},selectAll:function(){if(this.isLocked()){return}this.selections.clear();for(var d=0,e=this.grid.store.getCount();d<e;d++){this.selectRow(d,true)}},hasSelection:function(){return this.selections.length>0},isSelected:function(e){var d=typeof e=="number"?this.grid.store.getAt(e):e;return(d&&this.selections.key(d.id)?true:false)},isIdSelected:function(b){return(this.selections.key(b)?true:false)},handleMouseDown:function(o,l,m){if(m.button!==0||this.isLocked()){return}var g=this.grid.getView();if(m.shiftKey&&!this.singleSelect&&this.last!==false){var p=this.last;this.selectRange(p,l,m.ctrlKey);this.last=p;g.focusRow(l)}else{var e=this.isSelected(l);if(m.ctrlKey&&e){this.deselectRow(l)}else{if(!e||this.getCount()>1){this.selectRow(l,m.ctrlKey||m.shiftKey);g.focusRow(l)}}}},selectRows:function(l,h){if(!h){this.clearSelections()}for(var e=0,g=l.length;e<g;e++){this.selectRow(l[e],true)}},selectRange:function(e,g,h){if(this.isLocked()){return}if(!h){this.clearSelections()}if(e<=g){for(var l=e;l<=g;l++){this.selectRow(l,true)}}else{for(var l=e;l>=g;l--){this.selectRow(l,true)}}},deselectRange:function(l,e,g){if(this.isLocked()){return}for(var h=l;h<=e;h++){this.deselectRow(h,g)}},selectRow:function(e,h,g){if(this.isLocked()||(e<0||e>=this.grid.store.getCount())||this.isSelected(e)){return}var l=this.grid.store.getAt(e);if(l&&this.fireEvent("beforerowselect",this,e,h,l)!==false){if(!h||this.singleSelect){this.clearSelections()}this.selections.add(l);this.last=this.lastActive=e;if(!g){this.grid.getView().onRowSelect(e)}this.fireEvent("rowselect",this,e,l);this.fireEvent("selectionchange",this)}},deselectRow:function(d,e){if(this.isLocked()){return}if(this.last==d){this.last=false}if(this.lastActive==d){this.lastActive=false}var g=this.grid.store.getAt(d);if(g){this.selections.remove(g);if(!e){this.grid.getView().onRowDeselect(d)}this.fireEvent("rowdeselect",this,d,g);this.fireEvent("selectionchange",this)}},restoreLast:function(){if(this._last){this.last=this._last}},acceptsNav:function(g,d,e){return !e.isHidden(d)&&e.isCellEditable(d,g)},onEditorKey:function(o,p){var r=p.getKey(),m,q=this.grid,e=q.activeEditor;var g=p.shiftKey;if(r==p.TAB){p.stopEvent();e.completeEdit();if(g){m=q.walkCells(e.row,e.col-1,-1,this.acceptsNav,this)}else{m=q.walkCells(e.row,e.col+1,1,this.acceptsNav,this)}}else{if(r==p.ENTER){p.stopEvent();e.completeEdit();if(this.moveEditorOnEnter!==false){if(g){m=q.walkCells(e.row-1,e.col,-1,this.acceptsNav,this)}else{m=q.walkCells(e.row+1,e.col,1,this.acceptsNav,this)}}}else{if(r==p.ESC){e.cancelEdit()}}}if(m){q.startEditing(m[0],m[1])}}});Ext.grid.CellSelectionModel=function(b){Ext.apply(this,b);this.selection=null;this.addEvents("beforecellselect","cellselect","selectionchange");Ext.grid.CellSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.grid.CellSelectionModel,Ext.grid.AbstractSelectionModel,{initEvents:function(){this.grid.on("cellmousedown",this.handleMouseDown,this);this.grid.getGridEl().on(Ext.isIE||Ext.isSafari3?"keydown":"keypress",this.handleKeyDown,this);var b=this.grid.view;b.on("refresh",this.onViewChange,this);b.on("rowupdated",this.onRowUpdated,this);b.on("beforerowremoved",this.clearSelections,this);b.on("beforerowsinserted",this.clearSelections,this);if(this.grid.isEditor){this.grid.on("beforeedit",this.beforeEdit,this)}},beforeEdit:function(b){this.select(b.row,b.column,false,true,b.record)},onRowUpdated:function(e,d,g){if(this.selection&&this.selection.record==g){e.onCellSelect(d,this.selection.cell[1])}},onViewChange:function(){this.clearSelections(true)},getSelectedCell:function(){return this.selection?this.selection.cell:null},clearSelections:function(d){var e=this.selection;if(e){if(d!==true){this.grid.view.onCellDeselect(e.cell[0],e.cell[1])}this.selection=null;this.fireEvent("selectionchange",this,null)}},hasSelection:function(){return this.selection?true:false},handleMouseDown:function(e,h,g,l){if(l.button!==0||this.isLocked()){return}this.select(h,g)},select:function(m,q,h,o,p){if(this.fireEvent("beforecellselect",this,m,q)!==false){this.clearSelections();p=p||this.grid.store.getAt(m);this.selection={record:p,cell:[m,q]};if(!h){var l=this.grid.getView();l.onCellSelect(m,q);if(o!==true){l.focusCell(m,q)}}this.fireEvent("cellselect",this,m,q);this.fireEvent("selectionchange",this,this.selection)}},isSelectable:function(g,d,e){return !e.isHidden(d)},handleKeyDown:function(s){if(!s.isNavKeyPress()){return}var t=this.grid,e=this.selection;if(!e){s.stopEvent();var g=t.walkCells(0,0,1,this.isSelectable,this);if(g){this.select(g[0],g[1])}return}var w=this;var q=function(a,d,b){return t.walkCells(a,d,b,w.isSelectable,w)};var v=s.getKey(),z=e.cell[0],r=e.cell[1];var u;switch(v){case s.TAB:if(s.shiftKey){u=q(z,r-1,-1)}else{u=q(z,r+1,1)}break;case s.DOWN:u=q(z+1,r,1);break;case s.UP:u=q(z-1,r,-1);break;case s.RIGHT:u=q(z,r+1,1);break;case s.LEFT:u=q(z,r-1,-1);break;case s.ENTER:if(t.isEditor&&!t.editing){t.startEditing(z,r);s.stopEvent();return}break}if(u){this.select(u[0],u[1]);s.stopEvent()}},acceptsNav:function(g,d,e){return !e.isHidden(d)&&e.isCellEditable(d,g)},onEditorKey:function(m,o){var e=o.getKey(),l,p=this.grid,g=p.activeEditor;if(e==o.TAB){if(o.shiftKey){l=p.walkCells(g.row,g.col-1,-1,this.acceptsNav,this)}else{l=p.walkCells(g.row,g.col+1,1,this.acceptsNav,this)}o.stopEvent()}else{if(e==o.ENTER){g.completeEdit();o.stopEvent()}else{if(e==o.ESC){o.stopEvent();g.cancelEdit()}}}if(l){p.startEditing(l[0],l[1])}}});Ext.grid.EditorGridPanel=Ext.extend(Ext.grid.GridPanel,{clicksToEdit:2,isEditor:true,detectEdit:false,autoEncode:false,trackMouseOver:false,initComponent:function(){Ext.grid.EditorGridPanel.superclass.initComponent.call(this);if(!this.selModel){this.selModel=new Ext.grid.CellSelectionModel()}this.activeEditor=null;this.addEvents("beforeedit","afteredit","validateedit")},initEvents:function(){Ext.grid.EditorGridPanel.superclass.initEvents.call(this);this.on("bodyscroll",this.stopEditing,this,[true]);this.on("columnresize",this.stopEditing,this,[true]);if(this.clicksToEdit==1){this.on("cellclick",this.onCellDblClick,this)}else{if(this.clicksToEdit=="auto"&&this.view.mainBody){this.view.mainBody.on("mousedown",this.onAutoEditClick,this)}this.on("celldblclick",this.onCellDblClick,this)}},onCellDblClick:function(d,g,e){this.startEditing(g,e)},onAutoEditClick:function(o,e){if(o.button!==0){return}var l=this.view.findRowIndex(e);var h=this.view.findCellIndex(e);if(l!==false&&h!==false){this.stopEditing();if(this.selModel.getSelectedCell){var m=this.selModel.getSelectedCell();if(m&&m.cell[0]===l&&m.cell[1]===h){this.startEditing(l,h)}}else{if(this.selModel.isSelected(l)){this.startEditing(l,h)}}}},onEditComplete:function(e,p,l){this.editing=false;this.activeEditor=null;e.un("specialkey",this.selModel.onEditorKey,this.selModel);var q=e.record;var m=this.colModel.getDataIndex(e.col);p=this.postEditValue(p,l,q,m);if(String(p)!==String(l)){var o={grid:this,record:q,field:m,originalValue:l,value:p,row:e.row,column:e.col,cancel:false};if(this.fireEvent("validateedit",o)!==false&&!o.cancel){q.set(m,o.value);delete o.cancel;this.fireEvent("afteredit",o)}}this.view.focusCell(e.row,e.col)},startEditing:function(m,e){this.stopEditing();if(this.colModel.isCellEditable(e,m)){this.view.ensureVisible(m,e,true);var q=this.store.getAt(m);var o=this.colModel.getDataIndex(e);var p={grid:this,record:q,field:o,value:q.data[o],row:m,column:e,cancel:false};if(this.fireEvent("beforeedit",p)!==false&&!p.cancel){this.editing=true;var l=this.colModel.getCellEditor(e,m);if(!l.rendered){l.render(this.view.getEditorParent(l))}(function(){l.row=m;l.col=e;l.record=q;l.on("complete",this.onEditComplete,this,{single:true});l.on("specialkey",this.selModel.onEditorKey,this.selModel);this.activeEditor=l;var a=this.preEditValue(q,o);l.startEdit(this.view.getCell(m,e).firstChild,a===undefined?"":a)}).defer(50,this)}}},preEditValue:function(e,g){var d=e.data[g];return this.autoEncode&&typeof d=="string"?Ext.util.Format.htmlDecode(d):d},postEditValue:function(l,g,e,h){return this.autoEncode&&typeof l=="string"?Ext.util.Format.htmlEncode(l):l},stopEditing:function(b){if(this.activeEditor){this.activeEditor[b===true?"cancelEdit":"completeEdit"]()}this.activeEditor=null},onDestroy:function(){if(this.rendered){var m=this.colModel.config;for(var g=0,h=m.length;g<h;g++){var l=m[g];Ext.destroy(l.editor)}}Ext.grid.EditorGridPanel.superclass.onDestroy.call(this)}});Ext.reg("editorgrid",Ext.grid.EditorGridPanel);Ext.grid.GridEditor=function(d,e){Ext.grid.GridEditor.superclass.constructor.call(this,d,e);d.monitorTab=false};Ext.extend(Ext.grid.GridEditor,Ext.Editor,{alignment:"tl-tl",autoSize:"width",hideEl:false,cls:"x-small-editor x-grid-editor",shim:false,shadow:false});Ext.grid.PropertyRecord=Ext.data.Record.create([{name:"name",type:"string"},"value"]);Ext.grid.PropertyStore=function(e,d){this.grid=e;this.store=new Ext.data.Store({recordType:Ext.grid.PropertyRecord});this.store.on("update",this.onUpdate,this);if(d){this.setSource(d)}Ext.grid.PropertyStore.superclass.constructor.call(this)};Ext.extend(Ext.grid.PropertyStore,Ext.util.Observable,{setSource:function(g){this.source=g;this.store.removeAll();var d=[];for(var e in g){if(this.isEditableValue(g[e])){d.push(new Ext.grid.PropertyRecord({name:e,value:g[e]},e))}}this.store.loadRecords({records:d},{},true)},onUpdate:function(l,h,m){if(m==Ext.data.Record.EDIT){var g=h.data.value;var o=h.modified.value;if(this.grid.fireEvent("beforepropertychange",this.source,h.id,g,o)!==false){this.source[h.id]=g;h.commit();this.grid.fireEvent("propertychange",this.source,h.id,g,o)}else{h.reject()}}},getProperty:function(b){return this.store.getAt(b)},isEditableValue:function(b){if(Ext.isDate(b)){return true}else{if(typeof b=="object"||typeof b=="function"){return false}}return true},setValue:function(d,e){this.source[d]=e;this.store.getById(d).set("value",e)},getSource:function(){return this.source}});Ext.grid.PropertyColumnModel=function(o,g){this.grid=o;var m=Ext.grid;m.PropertyColumnModel.superclass.constructor.call(this,[{header:this.nameText,width:50,sortable:true,dataIndex:"name",id:"name",menuDisabled:true},{header:this.valueText,width:50,resizable:false,dataIndex:"value",id:"value",menuDisabled:true}]);this.store=g;this.bselect=Ext.DomHelper.append(document.body,{tag:"select",cls:"x-grid-editor x-hide-display",children:[{tag:"option",value:"true",html:"true"},{tag:"option",value:"false",html:"false"}]});var l=Ext.form;var h=new l.Field({el:this.bselect,bselect:this.bselect,autoShow:true,getValue:function(){return this.bselect.value=="true"}});this.editors={date:new m.GridEditor(new l.DateField({selectOnFocus:true})),string:new m.GridEditor(new l.TextField({selectOnFocus:true})),number:new m.GridEditor(new l.NumberField({selectOnFocus:true,style:"text-align:left;"})),"boolean":new m.GridEditor(h)};this.renderCellDelegate=this.renderCell.createDelegate(this);this.renderPropDelegate=this.renderProp.createDelegate(this)};Ext.extend(Ext.grid.PropertyColumnModel,Ext.grid.ColumnModel,{nameText:"Name",valueText:"Value",dateFormat:"m/j/Y",renderDate:function(b){return b.dateFormat(this.dateFormat)},renderBool:function(b){return b?"true":"false"},isCellEditable:function(e,d){return e==1},getRenderer:function(b){return b==1?this.renderCellDelegate:this.renderPropDelegate},renderProp:function(b){return this.getPropertyName(b)},renderCell:function(e){var d=e;if(Ext.isDate(e)){d=this.renderDate(e)}else{if(typeof e=="boolean"){d=this.renderBool(e)}}return Ext.util.Format.htmlEncode(d)},getPropertyName:function(d){var e=this.grid.propertyNames;return e&&e[d]?e[d]:d},getCellEditor:function(h,l){var g=this.store.getProperty(l);var m=g.data.name,o=g.data.value;if(this.grid.customEditors[m]){return this.grid.customEditors[m]}if(Ext.isDate(o)){return this.editors.date}else{if(typeof o=="number"){return this.editors.number}else{if(typeof o=="boolean"){return this.editors["boolean"]}else{return this.editors.string}}}}});Ext.grid.PropertyGrid=Ext.extend(Ext.grid.EditorGridPanel,{enableColumnMove:false,stripeRows:false,trackMouseOver:false,clicksToEdit:1,enableHdMenu:false,viewConfig:{forceFit:true},initComponent:function(){this.customEditors=this.customEditors||{};this.lastEditRow=null;var d=new Ext.grid.PropertyStore(this);this.propStore=d;var e=new Ext.grid.PropertyColumnModel(this,d);d.store.sort("name","ASC");this.addEvents("beforepropertychange","propertychange");this.cm=e;this.ds=d.store;Ext.grid.PropertyGrid.superclass.initComponent.call(this);this.selModel.on("beforecellselect",function(a,b,g){if(g===0){this.startEditing.defer(200,this,[b,1]);return false}},this)},onRender:function(){Ext.grid.PropertyGrid.superclass.onRender.apply(this,arguments);this.getGridEl().addClass("x-props-grid")},afterRender:function(){Ext.grid.PropertyGrid.superclass.afterRender.apply(this,arguments);if(this.source){this.setSource(this.source)}},setSource:function(b){this.propStore.setSource(b)},getSource:function(){return this.propStore.getSource()}});Ext.reg("propertygrid",Ext.grid.PropertyGrid);Ext.grid.RowNumberer=function(b){Ext.apply(this,b);if(this.rowspan){this.renderer=this.renderer.createDelegate(this)}};Ext.grid.RowNumberer.prototype={header:"",width:23,sortable:false,fixed:true,menuDisabled:true,dataIndex:"",id:"numberer",rowspan:undefined,renderer:function(e,l,g,h){if(this.rowspan){l.cellAttr='rowspan="'+this.rowspan+'"'}return h+1}};Ext.grid.CheckboxSelectionModel=Ext.extend(Ext.grid.RowSelectionModel,{header:'<div class="x-grid3-hd-checker">&#160;</div>',width:20,sortable:false,menuDisabled:true,fixed:true,dataIndex:"",id:"checker",initEvents:function(){Ext.grid.CheckboxSelectionModel.superclass.initEvents.call(this);this.grid.on("render",function(){var b=this.grid.getView();b.mainBody.on("mousedown",this.onMouseDown,this);Ext.fly(b.innerHd).on("mousedown",this.onHdMouseDown,this)},this)},onMouseDown:function(l,e){if(l.button===0&&e.className=="x-grid3-row-checker"){l.stopEvent();var h=l.getTarget(".x-grid3-row");if(h){var g=h.rowIndex;if(this.isSelected(g)){this.deselectRow(g)}else{this.selectRow(g,true)}}}},onHdMouseDown:function(l,g){if(g.className=="x-grid3-hd-checker"){l.stopEvent();var e=Ext.fly(g.parentNode);var h=e.hasClass("x-grid3-hd-checker-on");if(h){e.removeClass("x-grid3-hd-checker-on");this.clearSelections()}else{e.addClass("x-grid3-hd-checker-on");this.selectAll()}}},renderer:function(d,g,e){return'<div class="x-grid3-row-checker">&#160;</div>'}});Ext.LoadMask=function(g,d){this.el=Ext.get(g);Ext.apply(this,d);if(this.store){this.store.on("beforeload",this.onBeforeLoad,this);this.store.on("load",this.onLoad,this);this.store.on("loadexception",this.onLoad,this);this.removeMask=Ext.value(this.removeMask,false)}else{var e=this.el.getUpdater();e.showLoadIndicator=false;e.on("beforeupdate",this.onBeforeLoad,this);e.on("update",this.onLoad,this);e.on("failure",this.onLoad,this);this.removeMask=Ext.value(this.removeMask,true)}};Ext.LoadMask.prototype={msg:"Loading...",msgCls:"x-mask-loading",disabled:false,disable:function(){this.disabled=true},enable:function(){this.disabled=false},onLoad:function(){this.el.unmask(this.removeMask)},onBeforeLoad:function(){if(!this.disabled){this.el.mask(this.msg,this.msgCls)}},show:function(){this.onBeforeLoad()},hide:function(){this.onLoad()},destroy:function(){if(this.store){this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("loadexception",this.onLoad,this)}else{var b=this.el.getUpdater();b.un("beforeupdate",this.onBeforeLoad,this);b.un("update",this.onLoad,this);b.un("failure",this.onLoad,this)}}};Ext.ProgressBar=Ext.extend(Ext.BoxComponent,{baseCls:"x-progress",animate:false,waitTimer:null,initComponent:function(){Ext.ProgressBar.superclass.initComponent.call(this);this.addEvents("update")},onRender:function(m,h){Ext.ProgressBar.superclass.onRender.call(this,m,h);var o=new Ext.Template('<div class="{cls}-wrap">','<div class="{cls}-inner">','<div class="{cls}-bar">','<div class="{cls}-text">',"<div>&#160;</div>","</div>","</div>",'<div class="{cls}-text {cls}-text-back">',"<div>&#160;</div>","</div>","</div>","</div>");if(h){this.el=o.insertBefore(h,{cls:this.baseCls},true)}else{this.el=o.append(m,{cls:this.baseCls},true)}if(this.id){this.el.dom.id=this.id}var g=this.el.dom.firstChild;this.progressBar=Ext.get(g.firstChild);if(this.textEl){this.textEl=Ext.get(this.textEl);delete this.textTopEl}else{this.textTopEl=Ext.get(this.progressBar.dom.firstChild);var l=Ext.get(g.childNodes[1]);this.textTopEl.setStyle("z-index",99).addClass("x-hidden");this.textEl=new Ext.CompositeElement([this.textTopEl.dom.firstChild,l.dom.firstChild]);this.textEl.setWidth(g.offsetWidth)}this.progressBar.setHeight(g.offsetHeight)},afterRender:function(){Ext.ProgressBar.superclass.afterRender.call(this);if(this.value){this.updateProgress(this.value,this.text)}else{this.updateText(this.text)}},updateProgress:function(l,h,e){this.value=l||0;if(h){this.updateText(h)}if(this.rendered){var g=Math.floor(l*this.el.dom.firstChild.offsetWidth);this.progressBar.setWidth(g,e===true||(e!==false&&this.animate));if(this.textTopEl){this.textTopEl.removeClass("x-hidden").setWidth(g)}}this.fireEvent("update",this,l,h);return this},wait:function(d){if(!this.waitTimer){var e=this;d=d||{};this.updateText(d.text);this.waitTimer=Ext.TaskMgr.start({run:function(b){var a=d.increment||10;this.updateProgress(((((b+a)%a)+1)*(100/a))*0.01,null,d.animate)},interval:d.interval||1000,duration:d.duration,onStop:function(){if(d.fn){d.fn.apply(d.scope||this)}this.reset()},scope:e})}return this},isWaiting:function(){return this.waitTimer!=null},updateText:function(b){this.text=b||"&#160;";if(this.rendered){this.textEl.update(this.text)}return this},syncProgressBar:function(){if(this.value){this.updateProgress(this.value,this.text)}return this},setSize:function(e,g){Ext.ProgressBar.superclass.setSize.call(this,e,g);if(this.textTopEl){var d=this.el.dom.firstChild;this.textEl.setSize(d.offsetWidth,d.offsetHeight)}this.syncProgressBar();return this},reset:function(b){this.updateProgress(0);if(this.textTopEl){this.textTopEl.addClass("x-hidden")}if(this.waitTimer){this.waitTimer.onStop=null;Ext.TaskMgr.stop(this.waitTimer);this.waitTimer=null}if(b===true){this.hide()}return this}});Ext.reg("progress",Ext.ProgressBar);Ext.Slider=Ext.extend(Ext.BoxComponent,{vertical:false,minValue:0,maxValue:100,keyIncrement:1,increment:0,clickRange:[5,15],clickToChange:true,animate:true,dragging:false,initComponent:function(){if(this.value===undefined){this.value=this.minValue}Ext.Slider.superclass.initComponent.call(this);this.keyIncrement=Math.max(this.increment,this.keyIncrement);this.addEvents("beforechange","change","changecomplete","dragstart","drag","dragend");if(this.vertical){Ext.apply(this,Ext.Slider.Vertical)}},onRender:function(){this.autoEl={cls:"x-slider "+(this.vertical?"x-slider-vert":"x-slider-horz"),cn:{cls:"x-slider-end",cn:{cls:"x-slider-inner",cn:[{cls:"x-slider-thumb"},{tag:"a",cls:"x-slider-focus",href:"#",tabIndex:"-1",hidefocus:"on"}]}}};Ext.Slider.superclass.onRender.apply(this,arguments);this.endEl=this.el.first();this.innerEl=this.endEl.first();this.thumb=this.innerEl.first();this.halfThumb=(this.vertical?this.thumb.getHeight():this.thumb.getWidth())/2;this.focusEl=this.thumb.next();this.initEvents()},initEvents:function(){this.thumb.addClassOnOver("x-slider-thumb-over");this.mon(this.el,"mousedown",this.onMouseDown,this);this.mon(this.el,"keydown",this.onKeyDown,this);this.focusEl.swallowEvent("click",true);this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeDragStart.createDelegate(this),onStart:this.onDragStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onDragEnd.createDelegate(this),tolerance:3,autoStart:300});this.tracker.initEl(this.thumb);this.on("beforedestroy",this.tracker.destroy,this.tracker)},onMouseDown:function(d){if(this.disabled){return}if(this.clickToChange&&d.target!=this.thumb.dom){var e=this.innerEl.translatePoints(d.getXY());this.onClickChange(e)}this.focus()},onClickChange:function(b){if(b.top>this.clickRange[0]&&b.top<this.clickRange[1]){this.setValue(Math.round(this.reverseValue(b.left)),undefined,true)}},onKeyDown:function(d){if(this.disabled){d.preventDefault();return}var e=d.getKey();switch(e){case d.UP:case d.RIGHT:d.stopEvent();if(d.ctrlKey){this.setValue(this.maxValue,undefined,true)}else{this.setValue(this.value+this.keyIncrement,undefined,true)}break;case d.DOWN:case d.LEFT:d.stopEvent();if(d.ctrlKey){this.setValue(this.minValue,undefined,true)}else{this.setValue(this.value-this.keyIncrement,undefined,true)}break;default:d.preventDefault()}},doSnap:function(e){if(!this.increment||this.increment==1||!e){return e}var h=e,l=this.increment;var g=e%l;if(g>0){if(g>(l/2)){h=e+(l-g)}else{h=e-g}}return h.constrain(this.minValue,this.maxValue)},afterRender:function(){Ext.Slider.superclass.afterRender.apply(this,arguments);if(this.value!==undefined){var b=this.normalizeValue(this.value);if(b!==this.value){delete this.value;this.setValue(b,false)}else{this.moveThumb(this.translateValue(b),false)}}},getRatio:function(){var e=this.innerEl.getWidth();var d=this.maxValue-this.minValue;return d==0?e:(e/d)},normalizeValue:function(b){if(typeof b!="number"){b=parseInt(b)}b=Math.round(b);b=this.doSnap(b);b=b.constrain(this.minValue,this.maxValue);return b},setValue:function(d,e,g){d=this.normalizeValue(d);if(d!==this.value&&this.fireEvent("beforechange",this,d,this.value)!==false){this.value=d;this.moveThumb(this.translateValue(d),e!==false);this.fireEvent("change",this,d);if(g){this.fireEvent("changecomplete",this,d)}}},translateValue:function(e){var d=this.getRatio();return(e*d)-(this.minValue*d)-this.halfThumb},reverseValue:function(d){var e=this.getRatio();return(d+this.halfThumb+(this.minValue*e))/e},moveThumb:function(d,e){if(!e||this.animate===false){this.thumb.setLeft(d)}else{this.thumb.shift({left:d,stopFx:true,duration:0.35})}},focus:function(){this.focusEl.focus(10)},onBeforeDragStart:function(b){return !this.disabled},onDragStart:function(b){this.thumb.addClass("x-slider-thumb-drag");this.dragging=true;this.dragStartValue=this.value;this.fireEvent("dragstart",this,b)},onDrag:function(e){var d=this.innerEl.translatePoints(this.tracker.getXY());this.setValue(Math.round(this.reverseValue(d.left)),false);this.fireEvent("drag",this,e)},onDragEnd:function(b){this.thumb.removeClass("x-slider-thumb-drag");this.dragging=false;this.fireEvent("dragend",this,b);if(this.dragStartValue!=this.value){this.fireEvent("changecomplete",this,this.value)}},onDisable:function(){Ext.Slider.superclass.onDisable.call(this);this.thumb.addClass(this.disabledClass);if(Ext.isIE){var b=this.thumb.getXY();this.thumb.hide();this.innerEl.addClass(this.disabledClass).dom.disabled=true;if(!this.thumbHolder){this.thumbHolder=this.endEl.createChild({cls:"x-slider-thumb "+this.disabledClass})}this.thumbHolder.show().setXY(b)}},onEnable:function(){Ext.Slider.superclass.onEnable.call(this);this.thumb.removeClass(this.disabledClass);if(Ext.isIE){this.innerEl.removeClass(this.disabledClass).dom.disabled=false;if(this.thumbHolder){this.thumbHolder.hide()}this.thumb.show();this.syncThumb()}},onResize:function(e,d){this.innerEl.setWidth(e-(this.el.getPadding("l")+this.endEl.getPadding("r")));this.syncThumb()},syncThumb:function(){if(this.rendered){this.moveThumb(this.translateValue(this.value))}},getValue:function(){return this.value}});Ext.reg("slider",Ext.Slider);Ext.Slider.Vertical={onResize:function(e,d){this.innerEl.setHeight(d-(this.el.getPadding("t")+this.endEl.getPadding("b")));this.syncThumb()},getRatio:function(){var d=this.innerEl.getHeight();var e=this.maxValue-this.minValue;return d/e},moveThumb:function(d,e){if(!e||this.animate===false){this.thumb.setBottom(d)}else{this.thumb.shift({bottom:d,stopFx:true,duration:0.35})}},onDrag:function(d){var g=this.innerEl.translatePoints(this.tracker.getXY());var e=this.innerEl.getHeight()-g.top;this.setValue(this.minValue+Math.round(e/this.getRatio()),false);this.fireEvent("drag",this,d)},onClickChange:function(d){if(d.left>this.clickRange[0]&&d.left<this.clickRange[1]){var e=this.innerEl.getHeight()-d.top;this.setValue(this.minValue+Math.round(e/this.getRatio()),undefined,true)}}};Ext.StatusBar=Ext.extend(Ext.Toolbar,{cls:"x-statusbar",busyIconCls:"x-status-busy",busyText:"Loading...",autoClear:5000,activeThreadId:0,initComponent:function(){if(this.statusAlign=="right"){this.cls+=" x-status-right"}Ext.StatusBar.superclass.initComponent.call(this)},afterRender:function(){Ext.StatusBar.superclass.afterRender.call(this);var e=this.statusAlign=="right",d=Ext.get(this.nextBlock());if(e){this.tr.appendChild(d.dom)}else{d.insertBefore(this.tr.firstChild)}this.statusEl=d.createChild({cls:"x-status-text "+(this.iconCls||this.defaultIconCls||""),html:this.text||this.defaultText||""});this.statusEl.unselectable();this.spacerEl=d.insertSibling({tag:"td",style:"width:100%",cn:[{cls:"ytb-spacer"}]},e?"before":"after")},setStatus:function(m){m=m||{};if(typeof m=="string"){m={text:m}}if(m.text!==undefined){this.setText(m.text)}if(m.iconCls!==undefined){this.setIcon(m.iconCls)}if(m.clear){var l=m.clear,g=this.autoClear,h={useDefaults:true,anim:true};if(typeof l=="object"){l=Ext.applyIf(l,h);if(l.wait){g=l.wait}}else{if(typeof l=="number"){g=l;l=h}else{if(typeof l=="boolean"){l=h}}}l.threadId=this.activeThreadId;this.clearStatus.defer(g,this,[l])}return this},clearStatus:function(g){g=g||{};if(g.threadId&&g.threadId!==this.activeThreadId){return this}var d=g.useDefaults?this.defaultText:"",e=g.useDefaults?(this.defaultIconCls?this.defaultIconCls:""):"";if(g.anim){this.statusEl.fadeOut({remove:false,useDisplay:true,scope:this,callback:function(){this.setStatus({text:d,iconCls:e});this.statusEl.show()}})}else{this.statusEl.hide();this.setStatus({text:d,iconCls:e});this.statusEl.show()}return this},setText:function(b){this.activeThreadId++;this.text=b||"";if(this.rendered){this.statusEl.update(this.text)}return this},getText:function(){return this.text},setIcon:function(b){this.activeThreadId++;b=b||"";if(this.rendered){if(this.currIconCls){this.statusEl.removeClass(this.currIconCls);this.currIconCls=null}if(b.length>0){this.statusEl.addClass(b);this.currIconCls=b}}else{this.currIconCls=b}return this},showBusy:function(b){if(typeof b=="string"){b={text:b}}b=Ext.applyIf(b||{},{text:this.busyText,iconCls:this.busyIconCls});return this.setStatus(b)}});Ext.reg("statusbar",Ext.StatusBar);Ext.History=(function(){var s,u;var m=false;var t;function r(){var a=top.location.href,b=a.indexOf("#");return b>=0?a.substr(b+1):null}function w(){u.value=t}function q(a){t=a;Ext.History.fireEvent("change",a)}function p(e){var a=['<html><body><div id="state">',e,"</div></body></html>"].join("");try{var b=s.contentWindow.document;b.open();b.write(a);b.close();return true}catch(d){return false}}function v(){if(!s.contentWindow||!s.contentWindow.document){setTimeout(v,10);return}var b=s.contentWindow.document;var e=b.getElementById("state");var a=e?e.innerText:null;var d=r();setInterval(function(){b=s.contentWindow.document;e=b.getElementById("state");var g=e?e.innerText:null;var h=r();if(g!==a){a=g;q(a);top.location.hash=a;d=a;w()}else{if(h!==d){d=h;p(h)}}},50);m=true;Ext.History.fireEvent("ready",Ext.History)}function o(){t=u.value?u.value:r();if(Ext.isIE){v()}else{var a=r();setInterval(function(){var b=r();if(b!==a){a=b;q(a);w()}},50);m=true;Ext.History.fireEvent("ready",Ext.History)}}return{fieldId:"x-history-field",iframeId:"x-history-frame",events:{},init:function(b,a){if(m){Ext.callback(b,a,[this]);return}if(!Ext.isReady){Ext.onReady(function(){Ext.History.init(b,a)});return}u=Ext.getDom(Ext.History.fieldId);if(Ext.isIE){s=Ext.getDom(Ext.History.iframeId)}this.addEvents("ready","change");if(b){this.on("ready",b,a,{single:true})}o()},add:function(a,b){if(b!==false){if(this.getToken()==a){return true}}if(Ext.isIE){return p(a)}else{top.location.hash=a;return true}},back:function(){history.go(-1)},forward:function(){history.go(1)},getToken:function(){return m?t:r()}}})();Ext.apply(Ext.History,new Ext.util.Observable());var humanMsg={setup:function(b,a,d){humanMsg.msgID="humanMsg";if(b===undefined){b="body"}humanMsg.msgOpacity=0.8;if(d!==undefined){humanMsg.msgOpacity=parseFloat(d)}jQuery(b).append('<div id="'+humanMsg.msgID+'" class="humanMsg"><p></p></div>')},displayMsg:function(a){if(a===""){return}clearTimeout(humanMsg.t2);jQuery("#"+humanMsg.msgID+" p").html(a);jQuery("#"+humanMsg.msgID+"").show().animate({opacity:humanMsg.msgOpacity},200);humanMsg.t1=setTimeout("humanMsg.bindEvents()",700);humanMsg.t2=setTimeout("humanMsg.removeMsg()",5000)},bindEvents:function(){jQuery(window).mousemove(humanMsg.removeMsg).click(humanMsg.removeMsg).keypress(humanMsg.removeMsg)},removeMsg:function(){jQuery(window).unbind("mousemove",humanMsg.removeMsg).unbind("click",humanMsg.removeMsg).unbind("keypress",humanMsg.removeMsg);if(jQuery("#"+humanMsg.msgID).css("opacity")==humanMsg.msgOpacity){jQuery("#"+humanMsg.msgID).animate({opacity:0},500,function(){jQuery(this).hide()})}}};jQuery(document).ready(function(){humanMsg.setup()});var OpenLayers={singleFile:true};(function(){var m=(typeof OpenLayers=="object"&&OpenLayers.singleFile);window.OpenLayers={_scriptName:(!m)?"lib/OpenLayers.js":"OpenLayers.js",_getScriptLocation:function(){var v="";var w=OpenLayers._scriptName;var r=document.getElementsByTagName("script");for(var t=0,h=r.length;t<h;t++){var z=r[t].getAttribute("src");if(z){var s=z.lastIndexOf(w);var u=z.lastIndexOf("?");if(u<0){u=z.length}if((s>-1)&&(s+w.length==u)){v=z.slice(0,u-w.length);break}}}return v}};if(!m){var o=new Array("OpenLayers/Util.js","OpenLayers/BaseTypes.js","OpenLayers/BaseTypes/Class.js","OpenLayers/BaseTypes/Bounds.js","OpenLayers/BaseTypes/Element.js","OpenLayers/BaseTypes/LonLat.js","OpenLayers/BaseTypes/Pixel.js","OpenLayers/BaseTypes/Size.js","OpenLayers/Console.js","OpenLayers/Tween.js","Rico/Corner.js","Rico/Color.js","OpenLayers/Ajax.js","OpenLayers/Request.js","OpenLayers/Request/XMLHttpRequest.js","OpenLayers/Events.js","OpenLayers/Projection.js","OpenLayers/Map.js","OpenLayers/Layer.js","OpenLayers/Icon.js","OpenLayers/Marker.js","OpenLayers/Marker/Box.js","OpenLayers/Popup.js","OpenLayers/Tile.js","OpenLayers/Tile/Image.js","OpenLayers/Tile/WFS.js","OpenLayers/Layer/Image.js","OpenLayers/Layer/SphericalMercator.js","OpenLayers/Layer/EventPane.js","OpenLayers/Layer/FixedZoomLevels.js","OpenLayers/Layer/Google.js","OpenLayers/Layer/VirtualEarth.js","OpenLayers/Layer/Yahoo.js","OpenLayers/Layer/HTTPRequest.js","OpenLayers/Layer/Grid.js","OpenLayers/Layer/MapGuide.js","OpenLayers/Layer/MapServer.js","OpenLayers/Layer/MapServer/Untiled.js","OpenLayers/Layer/KaMap.js","OpenLayers/Layer/KaMapCache.js","OpenLayers/Layer/MultiMap.js","OpenLayers/Layer/Markers.js","OpenLayers/Layer/Text.js","OpenLayers/Layer/WorldWind.js","OpenLayers/Layer/WMS.js","OpenLayers/Layer/WMS/Untiled.js","OpenLayers/Layer/GeoRSS.js","OpenLayers/Layer/Boxes.js","OpenLayers/Layer/TMS.js","OpenLayers/Layer/TileCache.js","OpenLayers/Popup/Anchored.js","OpenLayers/Popup/AnchoredBubble.js","OpenLayers/Popup/Framed.js","OpenLayers/Popup/FramedCloud.js","OpenLayers/Feature.js","OpenLayers/Feature/Vector.js","OpenLayers/Feature/WFS.js","OpenLayers/Handler.js","OpenLayers/Handler/Click.js","OpenLayers/Handler/Hover.js","OpenLayers/Handler/Point.js","OpenLayers/Handler/Path.js","OpenLayers/Handler/Polygon.js","OpenLayers/Handler/Feature.js","OpenLayers/Handler/Drag.js","OpenLayers/Handler/RegularPolygon.js","OpenLayers/Handler/Box.js","OpenLayers/Handler/MouseWheel.js","OpenLayers/Handler/Keyboard.js","OpenLayers/Control.js","OpenLayers/Control/Attribution.js","OpenLayers/Control/Button.js","OpenLayers/Control/ZoomBox.js","OpenLayers/Control/ZoomToMaxExtent.js","OpenLayers/Control/DragPan.js","OpenLayers/Control/Navigation.js","OpenLayers/Control/MouseDefaults.js","OpenLayers/Control/MousePosition.js","OpenLayers/Control/OverviewMap.js","OpenLayers/Control/KeyboardDefaults.js","OpenLayers/Control/PanZoom.js","OpenLayers/Control/PanZoomBar.js","OpenLayers/Control/ArgParser.js","OpenLayers/Control/Permalink.js","OpenLayers/Control/Scale.js","OpenLayers/Control/ScaleLine.js","OpenLayers/Control/LayerSwitcher.js","OpenLayers/Control/DrawFeature.js","OpenLayers/Control/DragFeature.js","OpenLayers/Control/ModifyFeature.js","OpenLayers/Control/Panel.js","OpenLayers/Control/SelectFeature.js","OpenLayers/Control/NavigationHistory.js","OpenLayers/Control/Measure.js","OpenLayers/Geometry.js","OpenLayers/Geometry/Rectangle.js","OpenLayers/Geometry/Collection.js","OpenLayers/Geometry/Point.js","OpenLayers/Geometry/MultiPoint.js","OpenLayers/Geometry/Curve.js","OpenLayers/Geometry/LineString.js","OpenLayers/Geometry/LinearRing.js","OpenLayers/Geometry/Polygon.js","OpenLayers/Geometry/MultiLineString.js","OpenLayers/Geometry/MultiPolygon.js","OpenLayers/Geometry/Surface.js","OpenLayers/Renderer.js","OpenLayers/Renderer/Elements.js","OpenLayers/Renderer/SVG.js","OpenLayers/Renderer/Canvas.js","OpenLayers/Renderer/VML.js","OpenLayers/Layer/Vector.js","OpenLayers/Strategy.js","OpenLayers/Strategy/Fixed.js","OpenLayers/Strategy/Cluster.js","OpenLayers/Strategy/Paging.js","OpenLayers/Strategy/BBOX.js","OpenLayers/Protocol.js","OpenLayers/Protocol/HTTP.js","OpenLayers/Protocol/SQL.js","OpenLayers/Protocol/SQL/Gears.js","OpenLayers/Layer/PointTrack.js","OpenLayers/Layer/GML.js","OpenLayers/Style.js","OpenLayers/StyleMap.js","OpenLayers/Rule.js","OpenLayers/Filter.js","OpenLayers/Filter/FeatureId.js","OpenLayers/Filter/Logical.js","OpenLayers/Filter/Comparison.js","OpenLayers/Filter/Spatial.js","OpenLayers/Format.js","OpenLayers/Format/XML.js","OpenLayers/Format/GML.js","OpenLayers/Format/GML/Base.js","OpenLayers/Format/GML/v2.js","OpenLayers/Format/GML/v3.js","OpenLayers/Format/KML.js","OpenLayers/Format/GeoRSS.js","OpenLayers/Format/WFS.js","OpenLayers/Format/WKT.js","OpenLayers/Format/OSM.js","OpenLayers/Format/GPX.js","OpenLayers/Format/SLD.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/SLD/v1_0_0.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/Filter.js","OpenLayers/Format/Filter/v1.js","OpenLayers/Format/Filter/v1_0_0.js","OpenLayers/Format/Text.js","OpenLayers/Format/JSON.js","OpenLayers/Format/GeoJSON.js","OpenLayers/Format/WMC.js","OpenLayers/Format/WMC/v1.js","OpenLayers/Format/WMC/v1_0_0.js","OpenLayers/Format/WMC/v1_1_0.js","OpenLayers/Layer/WFS.js","OpenLayers/Control/MouseToolbar.js","OpenLayers/Control/NavToolbar.js","OpenLayers/Control/PanPanel.js","OpenLayers/Control/Pan.js","OpenLayers/Control/ZoomIn.js","OpenLayers/Control/ZoomOut.js","OpenLayers/Control/ZoomPanel.js","OpenLayers/Control/EditingToolbar.js","OpenLayers/Lang.js","OpenLayers/Lang/en.js");var b=navigator.userAgent;var e=(b.match("MSIE")||b.match("Safari"));if(e){var a=new Array(o.length)}var p=OpenLayers._getScriptLocation()+"lib/";for(var d=0,l=o.length;d<l;d++){if(e){a[d]="<script src='"+p+o[d]+"'><\/script>"}else{var q=document.createElement("script");q.src=p+o[d];var g=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;g.appendChild(q)}}if(e){document.write(a.join(""))}}})();OpenLayers.VERSION_NUMBER="$Revision: 8089 $";OpenLayers.String={startsWith:function(b,a){return(b.indexOf(a)==0)},contains:function(b,a){return(b.indexOf(a)!=-1)},trim:function(a){return a.replace(/^\s*(.*?)\s*$/,"$1")},camelize:function(h){var e=h.split("-");var b=e[0];for(var d=1,a=e.length;d<a;d++){var g=e[d];b+=g.charAt(0).toUpperCase()+g.substring(1)}return b},format:function(m,a,g){if(!a){a=window}var h=m.split("${");var o,l,b;for(var d=1,e=h.length;d<e;d++){o=h[d];l=o.indexOf("}");if(l>0){b=a[o.substring(0,l)];if(typeof b=="function"){b=g?b.apply(null,g):b()}h[d]=b+o.substring(++l)}else{h[d]="${"+o}}return h.join("")},numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(a){return OpenLayers.String.numberRegEx.test(a)}};if(!String.prototype.startsWith){String.prototype.startsWith=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.startsWith"}));return OpenLayers.String.startsWith(this,a)}}if(!String.prototype.contains){String.prototype.contains=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.contains"}));return OpenLayers.String.contains(this,a)}}if(!String.prototype.trim){String.prototype.trim=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.trim"}));return OpenLayers.String.trim(this)}}if(!String.prototype.camelize){String.prototype.camelize=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.camelize"}));return OpenLayers.String.camelize(this)}}OpenLayers.Number={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(a,d){var b=0;if(d>0){b=parseFloat(a.toPrecision(d))}return b},format:function(d,a,l,o){a=(typeof a!="undefined")?a:0;l=(typeof l!="undefined")?l:OpenLayers.Number.thousandsSeparator;o=(typeof o!="undefined")?o:OpenLayers.Number.decimalSeparator;if(a!=null){d=parseFloat(d.toFixed(a))}var b=d.toString().split(".");if(b.length==1&&a==null){a=0}var e=b[0];if(l){var g=/(-?[0-9]+)([0-9]{3})/;while(g.test(e)){e=e.replace(g,"$1"+l+"$2")}}var h;if(a==0){h=e}else{var m=b.length>1?b[1]:"0";if(a!=null){m=m+new Array(a-m.length+1).join("0")}h=e+o+m}return h}};if(!Number.prototype.limitSigDigs){Number.prototype.limitSigDigs=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Number.limitSigDigs"}));return OpenLayers.Number.limitSigDigs(this,a)}}OpenLayers.Function={bind:function(d,b){var a=Array.prototype.slice.apply(arguments,[2]);return function(){var e=a.concat(Array.prototype.slice.apply(arguments,[0]));return d.apply(b,e)}},bindAsEventListener:function(b,a){return function(d){return b.call(a,d||window.event)}}};if(!Function.prototype.bind){Function.prototype.bind=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Function.bind"}));Array.prototype.unshift.apply(arguments,[this]);return OpenLayers.Function.bind.apply(null,arguments)}}if(!Function.prototype.bindAsEventListener){Function.prototype.bindAsEventListener=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Function.bindAsEventListener"}));return OpenLayers.Function.bindAsEventListener(this,a)}}OpenLayers.Array={filter:function(l,h,b){var e=[];if(Array.prototype.filter){e=l.filter(h,b)}else{var a=l.length;if(typeof h!="function"){throw new TypeError()}for(var d=0;d<a;d++){if(d in l){var g=l[d];if(h.call(b,g,d,l)){e.push(g)}}}}return e}};OpenLayers.Class=function(){var e=function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments)}};var d={};var h,b;for(var g=0,a=arguments.length;g<a;++g){if(typeof arguments[g]=="function"){if(g==0&&a>1){b=arguments[g].prototype.initialize;arguments[g].prototype.initialize=function(){};d=new arguments[g];arguments[g].prototype.initialize=b}h=arguments[g].prototype}else{h=arguments[g]}OpenLayers.Util.extend(d,h)}e.prototype=d;return e};OpenLayers.Class.isPrototype=function(){};OpenLayers.Class.create=function(){return function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments)}}};OpenLayers.Class.inherit=function(){var e=arguments[0];var g=new e(OpenLayers.Class.isPrototype);for(var d=1,a=arguments.length;d<a;d++){if(typeof arguments[d]=="function"){var b=arguments[d];arguments[d]=new b(OpenLayers.Class.isPrototype)}OpenLayers.Util.extend(g,arguments[d])}return g};OpenLayers.Util={};OpenLayers.Util.getElement=function(){var e=[];for(var d=0,a=arguments.length;d<a;d++){var b=arguments[d];if(typeof b=="string"){b=document.getElementById(b)}if(arguments.length==1){return b}e.push(b)}return e};if($==null){var $=OpenLayers.Util.getElement}OpenLayers.Util.extend=function(a,g){a=a||{};if(g){for(var e in g){var d=g[e];if(d!==undefined){a[e]=d}}var b=typeof window.Event=="function"&&g instanceof window.Event;if(!b&&g.hasOwnProperty&&g.hasOwnProperty("toString")){a.toString=g.toString}}return a};OpenLayers.Util.removeItem=function(d,b){for(var a=d.length-1;a>=0;a--){if(d[a]==b){d.splice(a,1)}}return d};OpenLayers.Util.clearArray=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"array = []"}));a.length=0};OpenLayers.Util.indexOf=function(e,d){for(var b=0,a=e.length;b<a;b++){if(e[b]==d){return b}}return -1};OpenLayers.Util.modifyDOMElement=function(g,m,e,h,a,d,l,b){if(m){g.id=m}if(e){g.style.left=e.x+"px";g.style.top=e.y+"px"}if(h){g.style.width=h.w+"px";g.style.height=h.h+"px"}if(a){g.style.position=a}if(d){g.style.border=d}if(l){g.style.overflow=l}if(parseFloat(b)>=0&&parseFloat(b)<1){g.style.filter="alpha(opacity="+(b*100)+")";g.style.opacity=b}else{if(parseFloat(b)==1){g.style.filter="";g.style.opacity=""}}};OpenLayers.Util.createDiv=function(a,o,m,h,g,d,b,l){var e=document.createElement("div");if(h){e.style.backgroundImage="url("+h+")"}if(!a){a=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!g){g="absolute"}OpenLayers.Util.modifyDOMElement(e,a,o,m,g,d,b,l);return e};OpenLayers.Util.createImage=function(a,m,l,g,e,d,h,o){var b=document.createElement("img");if(!a){a=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!e){e="relative"}OpenLayers.Util.modifyDOMElement(b,a,m,l,e,d,null,h);if(o){b.style.display="none";OpenLayers.Event.observe(b,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,b));OpenLayers.Event.observe(b,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,b))}b.style.alt=a;b.galleryImg="no";if(g){b.src=g}return b};OpenLayers.Util.setOpacity=function(b,a){OpenLayers.Util.modifyDOMElement(b,null,null,null,null,null,null,a)};OpenLayers.Util.onImageLoad=function(){if(!this.viewRequestID||(this.map&&this.viewRequestID==this.map.viewRequestID)){this.style.backgroundColor="transparent";this.style.display=""}};OpenLayers.Util.onImageLoadErrorColor="pink";OpenLayers.IMAGE_RELOAD_ATTEMPTS=0;OpenLayers.Util.onImageLoadError=function(){this._attempts=(this._attempts)?(this._attempts+1):1;if(this._attempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS){var e=this.urls;if(e&&e instanceof Array&&e.length>1){var g=this.src.toString();var d,a;for(a=0;d=e[a];a++){if(g.indexOf(d)!=-1){break}}var h=Math.floor(e.length*Math.random());var b=e[h];a=0;while(b==d&&a++<4){h=Math.floor(e.length*Math.random());b=e[h]}this.src=g.replace(d,b)}else{this.src=this.src}}else{this.style.backgroundColor=OpenLayers.Util.onImageLoadErrorColor}this.style.display=""};OpenLayers.Util.alphaHackNeeded=null;OpenLayers.Util.alphaHack=function(){if(OpenLayers.Util.alphaHackNeeded==null){var g=navigator.appVersion.split("MSIE");var a=parseFloat(g[1]);var b=false;try{b=!!(document.body.filters)}catch(d){}OpenLayers.Util.alphaHackNeeded=(b&&(a>=5.5)&&(a<7))}return OpenLayers.Util.alphaHackNeeded};OpenLayers.Util.modifyAlphaImageDiv=function(a,b,p,o,l,h,d,e,m){OpenLayers.Util.modifyDOMElement(a,b,p,o,h,null,null,m);var g=a.childNodes[0];if(l){g.src=l}OpenLayers.Util.modifyDOMElement(g,a.id+"_innerImage",null,o,"relative",d);if(OpenLayers.Util.alphaHack()){if(a.style.display!="none"){a.style.display="inline-block"}if(e==null){e="scale"}a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+g.src+"', sizingMethod='"+e+"')";if(parseFloat(a.style.opacity)>=0&&parseFloat(a.style.opacity)<1){a.style.filter+=" alpha(opacity="+a.style.opacity*100+")"}g.style.filter="alpha(opacity=0)"}};OpenLayers.Util.createAlphaImageDiv=function(b,p,o,l,h,d,e,m,q){var a=OpenLayers.Util.createDiv();var g=OpenLayers.Util.createImage(null,null,null,null,null,null,null,false);a.appendChild(g);if(q){g.style.display="none";OpenLayers.Event.observe(g,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,a));OpenLayers.Event.observe(g,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,a))}OpenLayers.Util.modifyAlphaImageDiv(a,b,p,o,l,h,d,e,m);return a};OpenLayers.Util.upperCaseObject=function(b){var a={};for(var d in b){a[d.toUpperCase()]=b[d]}return a};OpenLayers.Util.applyDefaults=function(e,d){e=e||{};var b=typeof window.Event=="function"&&d instanceof window.Event;for(var a in d){if(e[a]===undefined||(!b&&d.hasOwnProperty&&d.hasOwnProperty(a)&&!e.hasOwnProperty(a))){e[a]=d[a]}}if(!b&&d&&d.hasOwnProperty&&d.hasOwnProperty("toString")&&!e.hasOwnProperty("toString")){e.toString=d.toString}return e};OpenLayers.Util.getParameterString=function(m){var l=[];for(var d in m){var g=m[d];if((g!=null)&&(typeof g!="function")){var b;if(typeof g=="object"&&g.constructor==Array){var h=[];for(var e=0,a=g.length;e<a;e++){h.push(encodeURIComponent(g[e]))}b=h.join(",")}else{b=encodeURIComponent(g)}l.push(encodeURIComponent(d)+"="+b)}}return l.join("&")};OpenLayers.ImgPath="";OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||(OpenLayers._getScriptLocation()+"img/")};OpenLayers.Util.Try=function(){var g=null;for(var d=0,a=arguments.length;d<a;d++){var b=arguments[d];try{g=b();break}catch(h){}}return g};OpenLayers.Util.getNodes=function(d,b){var a=OpenLayers.Util.Try(function(){return OpenLayers.Util._getNodes(d.documentElement.childNodes,b)},function(){return OpenLayers.Util._getNodes(d.childNodes,b)});return a};OpenLayers.Util._getNodes=function(d,g){var b=[];for(var e=0,a=d.length;e<a;e++){if(d[e].nodeName==g){b.push(d[e])}}return b};OpenLayers.Util.getTagText=function(d,e,b){var a=OpenLayers.Util.getNodes(d,e);if(a&&(a.length>0)){if(!b){b=0}if(a[b].childNodes.length>1){return a.childNodes[1].nodeValue}else{if(a[b].childNodes.length==1){return a[b].firstChild.nodeValue}}}else{return""}};OpenLayers.Util.getXmlNodeValue=function(a){var b=null;OpenLayers.Util.Try(function(){b=a.text;if(!b){b=a.textContent}if(!b){b=a.firstChild.nodeValue}},function(){b=a.textContent});return b};OpenLayers.Util.mouseLeft=function(a,d){var b=(a.relatedTarget)?a.relatedTarget:a.toElement;while(b!=d&&b!=null){b=b.parentNode}return(b!=d)};OpenLayers.Util.rad=function(a){return a*Math.PI/180};OpenLayers.Util.distVincenty=function(h,e){var T=6378137,S=6356752.3142,N=1/298.257223563;var r=OpenLayers.Util.rad(e.lon-h.lon);var Q=Math.atan((1-N)*Math.tan(OpenLayers.Util.rad(h.lat)));var P=Math.atan((1-N)*Math.tan(OpenLayers.Util.rad(e.lat)));var q=Math.sin(Q),m=Math.cos(Q);var p=Math.sin(P),l=Math.cos(P);var w=r,t=2*Math.PI;var v=20;while(Math.abs(w-t)>1e-12&&--v>0){var I=Math.sin(w),g=Math.cos(w);var U=Math.sqrt((l*I)*(l*I)+(m*p-q*l*g)*(m*p-q*l*g));if(U==0){return 0}var K=q*p+m*l*g;var H=Math.atan2(U,K);var o=Math.asin(m*l*I/U);var M=Math.cos(o)*Math.cos(o);var u=K-2*q*p/M;var E=N/16*M*(4+N*(4-3*M));t=w;w=r+(1-E)*N*Math.sin(o)*(H+E*U*(u+E*K*(-1+2*u*u)))}if(v==0){return NaN}var D=M*(T*T-S*S)/(S*S);var G=1+D/16384*(4096+D*(-768+D*(320-175*D)));var F=D/1024*(256+D*(-128+D*(74-47*D)));var J=F*U*(u+F/4*(K*(-1+2*u*u)-F/6*u*(-3+4*U*U)*(-3+4*u*u)));var z=S*G*(H-J);var O=z.toFixed(3)/1000;return O};OpenLayers.Util.getParameters=function(b){b=b||window.location.href;var a="";if(OpenLayers.String.contains(b,"?")){var d=b.indexOf("?")+1;var g=OpenLayers.String.contains(b,"#")?b.indexOf("#"):b.length;a=b.substring(d,g)}var s={};var e=a.split(/[&;]/);for(var m=0,o=e.length;m<o;++m){var l=e[m].split("=");if(l[0]){var q=decodeURIComponent(l[0]);var p=l[1]||"";p=p.split(",");for(var h=0,r=p.length;h<r;h++){p[h]=decodeURIComponent(p[h])}if(p.length==1){p=p[0]}s[q]=p}}return s};OpenLayers.Util.getArgs=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Util.getParameters"}));return OpenLayers.Util.getParameters(a)};OpenLayers.Util.lastSeqID=0;OpenLayers.Util.createUniqueID=function(a){if(a==null){a="id_"}OpenLayers.Util.lastSeqID+=1;return a+OpenLayers.Util.lastSeqID};OpenLayers.INCHES_PER_UNIT={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};OpenLayers.INCHES_PER_UNIT["in"]=OpenLayers.INCHES_PER_UNIT.inches;OpenLayers.INCHES_PER_UNIT.degrees=OpenLayers.INCHES_PER_UNIT.dd;OpenLayers.INCHES_PER_UNIT.nmi=1852*OpenLayers.INCHES_PER_UNIT.m;OpenLayers.METERS_PER_INCH=0.0254000508001016;OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{Inch:OpenLayers.INCHES_PER_UNIT.inches,Meter:1/OpenLayers.METERS_PER_INCH,Foot:0.3048006096012192/OpenLayers.METERS_PER_INCH,IFoot:0.3048/OpenLayers.METERS_PER_INCH,ClarkeFoot:0.3047972651151/OpenLayers.METERS_PER_INCH,SearsFoot:0.30479947153867626/OpenLayers.METERS_PER_INCH,GoldCoastFoot:0.3047997101815088/OpenLayers.METERS_PER_INCH,IInch:0.0254/OpenLayers.METERS_PER_INCH,MicroInch:0.0000254/OpenLayers.METERS_PER_INCH,Mil:2.54e-8/OpenLayers.METERS_PER_INCH,Centimeter:0.01/OpenLayers.METERS_PER_INCH,Kilometer:1000/OpenLayers.METERS_PER_INCH,Yard:0.9144018288036576/OpenLayers.METERS_PER_INCH,SearsYard:0.914398414616029/OpenLayers.METERS_PER_INCH,IndianYard:0.9143985307444408/OpenLayers.METERS_PER_INCH,IndianYd37:0.91439523/OpenLayers.METERS_PER_INCH,IndianYd62:0.9143988/OpenLayers.METERS_PER_INCH,IndianYd75:0.9143985/OpenLayers.METERS_PER_INCH,IndianFoot:0.30479951/OpenLayers.METERS_PER_INCH,IndianFt37:0.30479841/OpenLayers.METERS_PER_INCH,IndianFt62:0.3047996/OpenLayers.METERS_PER_INCH,IndianFt75:0.3047995/OpenLayers.METERS_PER_INCH,Mile:1609.3472186944373/OpenLayers.METERS_PER_INCH,IYard:0.9144/OpenLayers.METERS_PER_INCH,IMile:1609.344/OpenLayers.METERS_PER_INCH,NautM:1852/OpenLayers.METERS_PER_INCH,"Lat-66":110943.31648893273/OpenLayers.METERS_PER_INCH,"Lat-83":110946.25736872235/OpenLayers.METERS_PER_INCH,Decimeter:0.1/OpenLayers.METERS_PER_INCH,Millimeter:0.001/OpenLayers.METERS_PER_INCH,Dekameter:10/OpenLayers.METERS_PER_INCH,Decameter:10/OpenLayers.METERS_PER_INCH,Hectometer:100/OpenLayers.METERS_PER_INCH,GermanMeter:1.0000135965/OpenLayers.METERS_PER_INCH,CaGrid:0.999738/OpenLayers.METERS_PER_INCH,ClarkeChain:20.1166194976/OpenLayers.METERS_PER_INCH,GunterChain:20.11684023368047/OpenLayers.METERS_PER_INCH,BenoitChain:20.116782494375872/OpenLayers.METERS_PER_INCH,SearsChain:20.11676512155/OpenLayers.METERS_PER_INCH,ClarkeLink:0.201166194976/OpenLayers.METERS_PER_INCH,GunterLink:0.2011684023368047/OpenLayers.METERS_PER_INCH,BenoitLink:0.20116782494375873/OpenLayers.METERS_PER_INCH,SearsLink:0.2011676512155/OpenLayers.METERS_PER_INCH,Rod:5.02921005842012/OpenLayers.METERS_PER_INCH,IntnlChain:20.1168/OpenLayers.METERS_PER_INCH,IntnlLink:0.201168/OpenLayers.METERS_PER_INCH,Perch:5.02921005842012/OpenLayers.METERS_PER_INCH,Pole:5.02921005842012/OpenLayers.METERS_PER_INCH,Furlong:201.1684023368046/OpenLayers.METERS_PER_INCH,Rood:3.778266898/OpenLayers.METERS_PER_INCH,CapeFoot:0.3047972615/OpenLayers.METERS_PER_INCH,Brealey:375/OpenLayers.METERS_PER_INCH,ModAmFt:0.304812252984506/OpenLayers.METERS_PER_INCH,Fathom:1.8288/OpenLayers.METERS_PER_INCH,"NautM-UK":1853.184/OpenLayers.METERS_PER_INCH,"50kilometers":50000/OpenLayers.METERS_PER_INCH,"150kilometers":150000/OpenLayers.METERS_PER_INCH});OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{mm:OpenLayers.INCHES_PER_UNIT.Meter/1000,cm:OpenLayers.INCHES_PER_UNIT.Meter/100,dm:OpenLayers.INCHES_PER_UNIT.Meter*100,km:OpenLayers.INCHES_PER_UNIT.Meter*1000,kmi:OpenLayers.INCHES_PER_UNIT.nmi,fath:OpenLayers.INCHES_PER_UNIT.Fathom,ch:OpenLayers.INCHES_PER_UNIT.IntnlChain,link:OpenLayers.INCHES_PER_UNIT.IntnlLink,"us-in":OpenLayers.INCHES_PER_UNIT.inches,"us-ft":OpenLayers.INCHES_PER_UNIT.Foot,"us-yd":OpenLayers.INCHES_PER_UNIT.Yard,"us-ch":OpenLayers.INCHES_PER_UNIT.GunterChain,"us-mi":OpenLayers.INCHES_PER_UNIT.Mile,"ind-yd":OpenLayers.INCHES_PER_UNIT.IndianYd37,"ind-ft":OpenLayers.INCHES_PER_UNIT.IndianFt37,"ind-ch":20.11669506/OpenLayers.METERS_PER_INCH});OpenLayers.DOTS_PER_INCH=72;OpenLayers.Util.normalizeScale=function(b){var a=(b>1)?(1/b):b;return a};OpenLayers.Util.getResolutionFromScale=function(e,a){if(a==null){a="degrees"}var d=OpenLayers.Util.normalizeScale(e);var b=1/(d*OpenLayers.INCHES_PER_UNIT[a]*OpenLayers.DOTS_PER_INCH);return b};OpenLayers.Util.getScaleFromResolution=function(b,a){if(a==null){a="degrees"}var d=b*OpenLayers.INCHES_PER_UNIT[a]*OpenLayers.DOTS_PER_INCH;return d};OpenLayers.Util.safeStopPropagation=function(a){OpenLayers.Event.stop(a,true)};OpenLayers.Util.pagePosition=function(h){var a=0,g=0;var b=h;var l=h;while(b){if(b==document.body){if(OpenLayers.Element.getStyle(l,"position")=="absolute"){break}}a+=b.offsetTop||0;g+=b.offsetLeft||0;l=b;try{b=b.offsetParent}catch(d){OpenLayers.Console.error(OpenLayers.i18n("pagePositionFailed",{elemId:b.id}));break}}b=h;while(b){a-=b.scrollTop||0;g-=b.scrollLeft||0;b=b.parentNode}return[g,a]};OpenLayers.Util.isEquivalentUrl=function(m,l,d){d=d||{};OpenLayers.Util.applyDefaults(d,{ignoreCase:true,ignorePort80:true,ignoreHash:true});var b=OpenLayers.Util.createUrlObject(m,d);var a=OpenLayers.Util.createUrlObject(l,d);for(var e in b){if(d.test){OpenLayers.Console.userError(e+"\n1:"+b[e]+"\n2:"+a[e])}var h=b[e];var g=a[e];switch(e){case"args":break;case"host":case"port":case"protocol":if((h=="")||(g=="")){break}default:if((e!="args")&&(b[e]!=a[e])){return false}break}}for(var e in b.args){if(b.args[e]!=a.args[e]){return false}delete a.args[e]}for(var e in a.args){return false}return true};OpenLayers.Util.createUrlObject=function(h,e){e=e||{};var z={};if(e.ignoreCase){h=h.toLowerCase()}var C=document.createElement("a");C.href=h;z.host=C.host;var q=C.port;if(q.length<=0){var u=z.host.length-(q.length);z.host=z.host.substring(0,u)}z.protocol=C.protocol;z.port=((q=="80")&&(e.ignorePort80))?"":q;z.hash=(e.ignoreHash)?"":C.hash;var d=C.search;if(!d){var o=h.indexOf("?");d=(o!=-1)?h.substr(o):""}z.args=OpenLayers.Util.getParameters(d);if(((z.protocol=="file:")&&(h.indexOf("file:")!=-1))||((z.protocol!="file:")&&(z.host!=""))){z.pathname=C.pathname;var r=z.pathname.indexOf("?");if(r!=-1){z.pathname=z.pathname.substring(0,r)}}else{var p=OpenLayers.Util.removeTail(h);var w=0;do{var l=p.indexOf("../");if(l==0){w++;p=p.substr(3)}else{if(l>=0){var s=p.substr(0,l-1);var v=s.indexOf("/");s=(v!=-1)?s.substr(0,v+1):"";var B=p.substr(l+3);p=s+B}}}while(l!=-1);var g=document.createElement("a");var t=window.location.href;if(e.ignoreCase){t=t.toLowerCase()}g.href=t;z.protocol=g.protocol;var b=(g.pathname.indexOf("/")!=-1)?"/":"\\";var m=g.pathname.split(b);m.pop();while((w>0)&&(m.length>0)){m.pop();w--}p=m.join("/")+"/"+p;z.pathname=p}if((z.protocol=="file:")||(z.protocol=="")){z.host="localhost"}return z};OpenLayers.Util.removeTail=function(b){var d=null;var a=b.indexOf("?");var e=b.indexOf("#");if(a==-1){d=(e!=-1)?b.substr(0,e):b}else{d=(e!=-1)?b.substr(0,Math.min(a,e)):b.substr(0,a)}return d};OpenLayers.Util.getBrowserName=function(){var b="";var a=navigator.userAgent.toLowerCase();if(a.indexOf("opera")!=-1){b="opera"}else{if(a.indexOf("msie")!=-1){b="msie"}else{if(a.indexOf("safari")!=-1){b="safari"}else{if(a.indexOf("mozilla")!=-1){if(a.indexOf("firefox")!=-1){b="firefox"}else{b="mozilla"}}}}}return b};OpenLayers.Util.getRenderedDimensions=function(m,e,d){var b,g;var a=document.createElement("div");a.style.overflow="";a.style.position="absolute";a.style.left="-9999px";if(e){if(e.w){b=e.w;a.style.width=b+"px"}else{if(e.h){g=e.h;a.style.height=g+"px"}}}if(d&&d.displayClass){a.className=d.displayClass}var l=document.createElement("div");l.innerHTML=m;a.appendChild(l);document.body.appendChild(a);if(!b){b=parseInt(l.scrollWidth);a.style.width=b+"px"}if(!g){g=parseInt(l.scrollHeight)}a.removeChild(l);document.body.removeChild(a);return new OpenLayers.Size(b,g)};OpenLayers.Util.getScrollbarWidth=function(){var d=OpenLayers.Util._scrollbarWidth;if(d==null){var g=null;var e=null;var a=0;var b=0;g=document.createElement("div");g.style.position="absolute";g.style.top="-1000px";g.style.left="-1000px";g.style.width="100px";g.style.height="50px";g.style.overflow="hidden";e=document.createElement("div");e.style.width="100%";e.style.height="200px";g.appendChild(e);document.body.appendChild(g);a=e.offsetWidth;g.style.overflow="scroll";b=e.offsetWidth;document.body.removeChild(document.body.lastChild);OpenLayers.Util._scrollbarWidth=(a-b);d=OpenLayers.Util._scrollbarWidth}return d};OpenLayers.Rico=new Object();OpenLayers.Rico.Corner={round:function(g,b){g=OpenLayers.Util.getElement(g);this._setOptions(b);var a=this.options.color;if(this.options.color=="fromElement"){a=this._background(g)}var d=this.options.bgColor;if(this.options.bgColor=="fromParent"){d=this._background(g.offsetParent)}this._roundCornersImpl(g,a,d)},changeColor:function(d,b){d.style.backgroundColor=b;var a=d.parentNode.getElementsByTagName("span");for(var e=0;e<a.length;e++){a[e].style.backgroundColor=b}},changeOpacity:function(d,h){var e=h;var a="alpha(opacity="+h*100+")";d.style.opacity=e;d.style.filter=a;var b=d.parentNode.getElementsByTagName("span");for(var g=0;g<b.length;g++){b[g].style.opacity=e;b[g].style.filter=a}},reRound:function(e,d){var b=e.parentNode.childNodes[0];var a=e.parentNode.childNodes[2];e.parentNode.removeChild(b);e.parentNode.removeChild(a);this.round(e.parentNode,d)},_roundCornersImpl:function(d,a,b){if(this.options.border){this._renderBorder(d,b)}if(this._isTopRounded()){this._roundTopCorners(d,a,b)}if(this._isBottomRounded()){this._roundBottomCorners(d,a,b)}},_renderBorder:function(e,g){var b="1px solid "+this._borderColor(g);var a="border-left: "+b;var h="border-right: "+b;var d="style='"+a+";"+h+"'";e.innerHTML="<div "+d+">"+e.innerHTML+"</div>"},_roundTopCorners:function(d,a,g){var e=this._createCorner(g);for(var b=0;b<this.options.numSlices;b++){e.appendChild(this._createCornerSlice(a,g,b,"top"))}d.style.paddingTop=0;d.insertBefore(e,d.firstChild)},_roundBottomCorners:function(d,a,g){var e=this._createCorner(g);for(var b=(this.options.numSlices-1);b>=0;b--){e.appendChild(this._createCornerSlice(a,g,b,"bottom"))}d.style.paddingBottom=0;d.appendChild(e)},_createCorner:function(b){var a=document.createElement("div");a.style.backgroundColor=(this._isTransparent()?"transparent":b);return a},_createCornerSlice:function(d,e,l,a){var g=document.createElement("span");var b=g.style;b.backgroundColor=d;b.display="block";b.height="1px";b.overflow="hidden";b.fontSize="1px";var h=this._borderColor(d,e);if(this.options.border&&l==0){b.borderTopStyle="solid";b.borderTopWidth="1px";b.borderLeftWidth="0px";b.borderRightWidth="0px";b.borderBottomWidth="0px";b.height="0px";b.borderColor=h}else{if(h){b.borderColor=h;b.borderStyle="solid";b.borderWidth="0px 1px"}}if(!this.options.compact&&(l==(this.options.numSlices-1))){b.height="2px"}this._setMargin(g,l,a);this._setBorder(g,l,a);return g},_setOptions:function(a){this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false};OpenLayers.Util.extend(this.options,a||{});this.options.numSlices=this.options.compact?2:4;if(this._isTransparent()){this.options.blend=false}},_whichSideTop:function(){if(this._hasString(this.options.corners,"all","top")){return""}if(this.options.corners.indexOf("tl")>=0&&this.options.corners.indexOf("tr")>=0){return""}if(this.options.corners.indexOf("tl")>=0){return"left"}else{if(this.options.corners.indexOf("tr")>=0){return"right"}}return""},_whichSideBottom:function(){if(this._hasString(this.options.corners,"all","bottom")){return""}if(this.options.corners.indexOf("bl")>=0&&this.options.corners.indexOf("br")>=0){return""}if(this.options.corners.indexOf("bl")>=0){return"left"}else{if(this.options.corners.indexOf("br")>=0){return"right"}}return""},_borderColor:function(a,b){if(a=="transparent"){return b}else{if(this.options.border){return this.options.border}else{if(this.options.blend){return this._blend(b,a)}else{return""}}}},_setMargin:function(e,g,b){var d=this._marginSize(g);var a=b=="top"?this._whichSideTop():this._whichSideBottom();if(a=="left"){e.style.marginLeft=d+"px";e.style.marginRight="0px"}else{if(a=="right"){e.style.marginRight=d+"px";e.style.marginLeft="0px"}else{e.style.marginLeft=d+"px";e.style.marginRight=d+"px"}}},_setBorder:function(e,g,b){var d=this._borderSize(g);var a=b=="top"?this._whichSideTop():this._whichSideBottom();if(a=="left"){e.style.borderLeftWidth=d+"px";e.style.borderRightWidth="0px"}else{if(a=="right"){e.style.borderRightWidth=d+"px";e.style.borderLeftWidth="0px"}else{e.style.borderLeftWidth=d+"px";e.style.borderRightWidth=d+"px"}}if(this.options.border!=false){e.style.borderLeftWidth=d+"px";e.style.borderRightWidth=d+"px"}},_marginSize:function(g){if(this._isTransparent()){return 0}var e=[5,3,2,1];var a=[3,2,1,0];var d=[2,1];var b=[1,0];if(this.options.compact&&this.options.blend){return b[g]}else{if(this.options.compact){return d[g]}else{if(this.options.blend){return a[g]}else{return e[g]}}}},_borderSize:function(g){var e=[5,3,2,1];var b=[2,1,1,1];var a=[1,0];var d=[0,2,0,0];if(this.options.compact&&(this.options.blend||this._isTransparent())){return 1}else{if(this.options.compact){return a[g]}else{if(this.options.blend){return b[g]}else{if(this.options.border){return d[g]}else{if(this._isTransparent()){return e[g]}}}}}return 0},_hasString:function(b){for(var a=1;a<arguments.length;a++){if(b.indexOf(arguments[a])>=0){return true}}return false},_blend:function(d,a){var b=OpenLayers.Rico.Color.createFromHex(d);b.blend(OpenLayers.Rico.Color.createFromHex(a));return b},_background:function(a){try{return OpenLayers.Rico.Color.createColorFromBackground(a).asHex()}catch(b){return"#ffffff"}},_isTransparent:function(){return this.options.color=="transparent"},_isTopRounded:function(){return this._hasString(this.options.corners,"all","top","tl","tr")},_isBottomRounded:function(){return this._hasString(this.options.corners,"all","bottom","bl","br")},_hasSingleTextChild:function(a){return a.childNodes.length==1&&a.childNodes[0].nodeType==3}};(function(){window.mapfish={singleFile:true};var b=true;var a=document.getElementsByTagName("script");for(var d=0;d<a.length;d++){var e=a[d].getAttribute("src");if(e&&e.lastIndexOf("OpenLayers.js")>-1){b=false;break}}if(b){window.OpenLayers._getScriptLocation=function(){return mapfish._getScriptLocation()+"../openlayers/"}}})();(function(){var a=(typeof window.mapfish=="object"&&window.mapfish.singleFile);window.mapfish={_scriptName:"MapFish.js",_getScriptLocation:function(){if(window.gMfLocation){return window.gMfLocation}var r="";var s=mapfish._scriptName;var h=document.getElementsByTagName("script");for(var q=0;q<h.length;q++){var t=h[q].getAttribute("src");if(t){var p=t.lastIndexOf(s);if((p>-1)&&(p+s.length==t.length)){r=t.slice(0,-s.length);break}}}return r}};if(!a){var m=new Array("lang/en.js","core/Color.js","core/GeoStat.js","core/GeoStat/Choropleth.js","core/GeoStat/ProportionalSymbol.js","core/Routing.js","core/Util.js","core/Searcher.js","core/Searcher/Map.js","core/Searcher/Form.js","core/PrintProtocol.js","core/Offline.js","core/Protocol.js","core/Protocol/MapFish.js","core/Protocol/MergeFilterDecorator.js","core/Protocol/TriggerEventDecorator.js","core/Strategy.js","core/Strategy/ProtocolListener.js","widgets/MapComponent.js","widgets/Shortcuts.js","widgets/ComboBoxFactory.js","widgets/recenter/Base.js","widgets/recenter/Coords.js","widgets/data/FeatureReader.js","widgets/data/FeatureStore.js","widgets/data/FeatureStoreMediator.js","widgets/data/SearchStoreMediator.js","widgets/data/LayerStoreMediator.js","widgets/data/GridRowFeatureMediator.js","widgets/geostat/Choropleth.js","widgets/geostat/ProportionalSymbol.js","widgets/tree/LayerTree.js","widgets/tree/LayerTreeExtra.js","widgets/toolbar/Toolbar.js","widgets/toolbar/CheckItem.js","widgets/toolbar/MenuItem.js","widgets/editing/FeatureList.js","widgets/print/Base.js","widgets/print/BaseWidget.js","widgets/print/SimpleForm.js","widgets/print/MultiPage.js","widgets/print/PrintAction.js");var o="";var l=mapfish._getScriptLocation();for(var b=0;b<m.length;b++){if(/MSIE/.test(navigator.userAgent)||/Safari/.test(navigator.userAgent)){var g="<script src='"+l+m[b]+"'><\/script>";o+=g}else{var e=document.createElement("script");e.src=l+m[b];var d=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;d.appendChild(e)}}if(o){document.write(o)}}})();mapfish.Util={};mapfish.Util.sum=function(d){for(var a=0,b=0;a<d.length;b+=d[a++]){}return b};mapfish.Util.max=function(a){return Math.max.apply({},a)};mapfish.Util.min=function(a){return Math.min.apply({},a)};mapfish.Util.getIconUrl=function(b,a){if(!a.layer){OpenLayers.Console.warn("Missing required layer option in mapfish.Util.getIconUrl");return""}if(!a.rule){a.rule=a.layer}if(b.indexOf("?")<0){b+="?"}else{if(b.lastIndexOf("&")!=(b.length-1)){if(b.indexOf("?")!=(b.length-1)){b+="&"}}}var a=OpenLayers.Util.extend({layer:"",rule:"",service:"WMS",version:"1.1.1",request:"GetLegendGraphic",format:"image/png",width:16,height:16},a);a=OpenLayers.Util.upperCaseObject(a);return b+OpenLayers.Util.getParameterString(a)};mapfish.Util.arrayEqual=function(e,d){if(e==null||d==null){return false}if(typeof(e)!="object"||typeof(d)!="object"){return false}if(e.length!=d.length){return false}for(var g=0;g<e.length;g++){if(typeof(e[g])!=typeof(d[g])){return false}if(e[g]!=d[g]){return false}}return true};mapfish.Util.isIE7=function(){var a=navigator.userAgent.toLowerCase();return a.indexOf("msie 7")>-1};mapfish.Util.relativeToAbsoluteURL=function(b){if(/^\w+:/.test(b)||!b){return b}var a=location.protocol+"//"+location.host;if(b.indexOf("/")==0){return a+b}var d=location.pathname.replace(/\/[^\/]*$/,"");return a+d+"/"+b};mapfish.Util.fixArray=function(a){if(a==""||a==null){return[]}else{if(a instanceof Array){return a}else{return a.split(",")}}};OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(e,a,b,d){if(e!=null){this.left=parseFloat(e)}if(a!=null){this.bottom=parseFloat(a)}if(b!=null){this.right=parseFloat(b)}if(d!=null){this.top=parseFloat(d)}},clone:function(){return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top)},equals:function(b){var a=false;if(b!=null){a=((this.left==b.left)&&(this.right==b.right)&&(this.top==b.top)&&(this.bottom==b.bottom))}return a},toString:function(){return("left-bottom=("+this.left+","+this.bottom+") right-top=("+this.right+","+this.top+")")},toArray:function(){return[this.left,this.bottom,this.right,this.top]},toBBOX:function(a){if(a==null){a=6}var b=Math.pow(10,a);var d=Math.round(this.left*b)/b+","+Math.round(this.bottom*b)/b+","+Math.round(this.right*b)/b+","+Math.round(this.top*b)/b;return d},toGeometry:function(){return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(this.left,this.bottom),new OpenLayers.Geometry.Point(this.right,this.bottom),new OpenLayers.Geometry.Point(this.right,this.top),new OpenLayers.Geometry.Point(this.left,this.top)])])},getWidth:function(){return(this.right-this.left)},getHeight:function(){return(this.top-this.bottom)},getSize:function(){return new OpenLayers.Size(this.getWidth(),this.getHeight())},getCenterPixel:function(){return new OpenLayers.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2)},getCenterLonLat:function(){if(!this.centerLonLat){this.centerLonLat=new OpenLayers.LonLat((this.left+this.right)/2,(this.bottom+this.top)/2)}return this.centerLonLat},scale:function(h,m){if(m==null){m=this.getCenterLonLat()}var a=[];var g,e;if(m.CLASS_NAME=="OpenLayers.LonLat"){g=m.lon;e=m.lat}else{g=m.x;e=m.y}var d=(this.left-g)*h+g;var b=(this.bottom-e)*h+e;var o=(this.right-g)*h+g;var l=(this.top-e)*h+e;return new OpenLayers.Bounds(d,b,o,l)},add:function(a,d){if((a==null)||(d==null)){var b=OpenLayers.i18n("boundsAddError");OpenLayers.Console.error(b);return null}return new OpenLayers.Bounds(this.left+a,this.bottom+d,this.right+a,this.top+d)},extend:function(a){var b=null;if(a){switch(a.CLASS_NAME){case"OpenLayers.LonLat":b=new OpenLayers.Bounds(a.lon,a.lat,a.lon,a.lat);break;case"OpenLayers.Geometry.Point":b=new OpenLayers.Bounds(a.x,a.y,a.x,a.y);break;case"OpenLayers.Bounds":b=a;break}if(b){this.centerLonLat=null;if((this.left==null)||(b.left<this.left)){this.left=b.left}if((this.bottom==null)||(b.bottom<this.bottom)){this.bottom=b.bottom}if((this.right==null)||(b.right>this.right)){this.right=b.right}if((this.top==null)||(b.top>this.top)){this.top=b.top}}}},containsLonLat:function(b,a){return this.contains(b.lon,b.lat,a)},containsPixel:function(b,a){return this.contains(b.x,b.y,a)},contains:function(b,e,a){if(a==null){a=true}var d=false;if(a){d=((b>=this.left)&&(b<=this.right)&&(e>=this.bottom)&&(e<=this.top))}else{d=((b>this.left)&&(b<this.right)&&(e>this.bottom)&&(e<this.top))}return d},intersectsBounds:function(e,b){if(b==null){b=true}var h=(e.bottom==this.bottom&&e.top==this.top)?true:(((e.bottom>this.bottom)&&(e.bottom<this.top))||((this.bottom>e.bottom)&&(this.bottom<e.top)));var g=(e.bottom==this.bottom&&e.top==this.top)?true:(((e.top>this.bottom)&&(e.top<this.top))||((this.top>e.bottom)&&(this.top<e.top)));var a=(e.right==this.right&&e.left==this.left)?true:(((e.right>this.left)&&(e.right<this.right))||((this.right>e.left)&&(this.right<e.right)));var d=(e.right==this.right&&e.left==this.left)?true:(((e.left>this.left)&&(e.left<this.right))||((this.left>e.left)&&(this.left<e.right)));return(this.containsBounds(e,true,b)||e.containsBounds(this,true,b)||((g||h)&&(d||a)))},containsBounds:function(g,e,b){if(e==null){e=false}if(b==null){b=true}var d;var l;var a;var h;if(b){d=(g.left>=this.left)&&(g.left<=this.right);l=(g.top>=this.bottom)&&(g.top<=this.top);a=(g.right>=this.left)&&(g.right<=this.right);h=(g.bottom>=this.bottom)&&(g.bottom<=this.top)}else{d=(g.left>this.left)&&(g.left<this.right);l=(g.top>this.bottom)&&(g.top<this.top);a=(g.right>this.left)&&(g.right<this.right);h=(g.bottom>this.bottom)&&(g.bottom<this.top)}return(e)?(l||h)&&(d||a):(l&&d&&h&&a)},determineQuadrant:function(d){var b="";var a=this.getCenterLonLat();b+=(d.lat<a.lat)?"b":"t";b+=(d.lon<a.lon)?"l":"r";return b},transform:function(e,b){this.centerLonLat=null;var g=OpenLayers.Projection.transform({x:this.left,y:this.bottom},e,b);var a=OpenLayers.Projection.transform({x:this.right,y:this.bottom},e,b);var d=OpenLayers.Projection.transform({x:this.left,y:this.top},e,b);var h=OpenLayers.Projection.transform({x:this.right,y:this.top},e,b);this.left=Math.min(g.x,d.x);this.bottom=Math.min(g.y,a.y);this.right=Math.max(a.x,h.x);this.top=Math.max(d.y,h.y);return this},wrapDateLine:function(a,d){d=d||{};var e=d.leftTolerance||0;var b=d.rightTolerance||0;var g=this.clone();if(a){while(g.left<a.left&&(g.right-b)<=a.left){g=g.add(a.getWidth(),0)}while((g.left+e)>=a.right&&g.right>a.right){g=g.add(-a.getWidth(),0)}}return g},CLASS_NAME:"OpenLayers.Bounds"});OpenLayers.Bounds.fromString=function(b){var a=b.split(",");return OpenLayers.Bounds.fromArray(a)};OpenLayers.Bounds.fromArray=function(a){return new OpenLayers.Bounds(parseFloat(a[0]),parseFloat(a[1]),parseFloat(a[2]),parseFloat(a[3]))};OpenLayers.Bounds.fromSize=function(a){return new OpenLayers.Bounds(0,a.h,a.w,0)};OpenLayers.Bounds.oppositeQuadrant=function(a){var b="";b+=(a.charAt(0)=="t")?"b":"t";b+=(a.charAt(1)=="l")?"r":"l";return b};OpenLayers.Element={visible:function(a){return OpenLayers.Util.getElement(a).style.display!="none"},toggle:function(){for(var d=0,a=arguments.length;d<a;d++){var b=OpenLayers.Util.getElement(arguments[d]);var e=OpenLayers.Element.visible(b)?"hide":"show";OpenLayers.Element[e](b)}},hide:function(){for(var d=0,a=arguments.length;d<a;d++){var b=OpenLayers.Util.getElement(arguments[d]);b.style.display="none"}},show:function(){for(var d=0,a=arguments.length;d<a;d++){var b=OpenLayers.Util.getElement(arguments[d]);b.style.display=""}},remove:function(a){a=OpenLayers.Util.getElement(a);a.parentNode.removeChild(a)},getHeight:function(a){a=OpenLayers.Util.getElement(a);return a.offsetHeight},getDimensions:function(b){b=OpenLayers.Util.getElement(b);if(OpenLayers.Element.getStyle(b,"display")!="none"){return{width:b.offsetWidth,height:b.offsetHeight}}var a=b.style;var g=a.visibility;var d=a.position;a.visibility="hidden";a.position="absolute";a.display="";var h=b.clientWidth;var e=b.clientHeight;a.display="none";a.position=d;a.visibility=g;return{width:h,height:e}},hasClass:function(b,a){var d=b.className;return(!!d&&new RegExp("(^|\\s)"+a+"(\\s|$)").test(d))},addClass:function(b,a){if(!OpenLayers.Element.hasClass(b,a)){b.className+=(b.className?" ":"")+a}return b},removeClass:function(b,a){var d=b.className;if(d){b.className=OpenLayers.String.trim(d.replace(new RegExp("(^|\\s+)"+a+"(\\s+|$)")," "))}return b},toggleClass:function(b,a){if(OpenLayers.Element.hasClass(b,a)){OpenLayers.Element.removeClass(b,a)}else{OpenLayers.Element.addClass(b,a)}return b},getStyle:function(d,e){d=OpenLayers.Util.getElement(d);var g=null;if(d&&d.style){g=d.style[OpenLayers.String.camelize(e)];if(!g){if(document.defaultView&&document.defaultView.getComputedStyle){var b=document.defaultView.getComputedStyle(d,null);g=b?b.getPropertyValue(e):null}else{if(d.currentStyle){g=d.currentStyle[OpenLayers.String.camelize(e)]}}}var a=["left","top","right","bottom"];if(window.opera&&(OpenLayers.Util.indexOf(a,e)!=-1)&&(OpenLayers.Element.getStyle(d,"position")=="static")){g="auto"}}return g=="auto"?null:g}};OpenLayers.LonLat=OpenLayers.Class({lon:0,lat:0,initialize:function(b,a){this.lon=parseFloat(b);this.lat=parseFloat(a)},toString:function(){return("lon="+this.lon+",lat="+this.lat)},toShortString:function(){return(this.lon+", "+this.lat)},clone:function(){return new OpenLayers.LonLat(this.lon,this.lat)},add:function(d,a){if((d==null)||(a==null)){var b=OpenLayers.i18n("lonlatAddError");OpenLayers.Console.error(b);return null}return new OpenLayers.LonLat(this.lon+d,this.lat+a)},equals:function(b){var a=false;if(b!=null){a=((this.lon==b.lon&&this.lat==b.lat)||(isNaN(this.lon)&&isNaN(this.lat)&&isNaN(b.lon)&&isNaN(b.lat)))}return a},transform:function(d,b){var a=OpenLayers.Projection.transform({x:this.lon,y:this.lat},d,b);this.lon=a.x;this.lat=a.y;return this},wrapDateLine:function(a){var b=this.clone();if(a){while(b.lon<a.left){b.lon+=a.getWidth()}while(b.lon>a.right){b.lon-=a.getWidth()}}return b},CLASS_NAME:"OpenLayers.LonLat"});OpenLayers.LonLat.fromString=function(b){var a=b.split(",");return new OpenLayers.LonLat(parseFloat(a[0]),parseFloat(a[1]))};OpenLayers.Pixel=OpenLayers.Class({x:0,y:0,initialize:function(a,b){this.x=parseFloat(a);this.y=parseFloat(b)},toString:function(){return("x="+this.x+",y="+this.y)},clone:function(){return new OpenLayers.Pixel(this.x,this.y)},equals:function(a){var b=false;if(a!=null){b=((this.x==a.x&&this.y==a.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(a.x)&&isNaN(a.y)))}return b},add:function(a,d){if((a==null)||(d==null)){var b=OpenLayers.i18n("pixelAddError");OpenLayers.Console.error(b);return null}return new OpenLayers.Pixel(this.x+a,this.y+d)},offset:function(a){var b=this.clone();if(a){b=this.add(a.x,a.y)}return b},CLASS_NAME:"OpenLayers.Pixel"});OpenLayers.Size=OpenLayers.Class({w:0,h:0,initialize:function(a,b){this.w=parseFloat(a);this.h=parseFloat(b)},toString:function(){return("w="+this.w+",h="+this.h)},clone:function(){return new OpenLayers.Size(this.w,this.h)},equals:function(b){var a=false;if(b!=null){a=((this.w==b.w&&this.h==b.h)||(isNaN(this.w)&&isNaN(this.h)&&isNaN(b.w)&&isNaN(b.h)))}return a},CLASS_NAME:"OpenLayers.Size"});OpenLayers.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},userError:function(a){alert(a)},assert:function(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},groupEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profileEnd:function(){},count:function(){},CLASS_NAME:"OpenLayers.Console"};(function(){var b=document.getElementsByTagName("script");for(var d=0,a=b.length;d<a;++d){if(b[d].src.indexOf("firebug.js")!=-1){if(console){OpenLayers.Util.extend(OpenLayers.Console,console);break}}}})();OpenLayers.Control=OpenLayers.Class({id:null,map:null,div:null,type:null,allowSelection:false,displayClass:"",title:"",active:null,handler:null,eventListeners:null,events:null,EVENT_TYPES:["activate","deactivate"],initialize:function(a){this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");OpenLayers.Util.extend(this,a);this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES);if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}if(this.id==null){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")}},destroy:function(){if(this.events){if(this.eventListeners){this.events.un(this.eventListeners)}this.events.destroy();this.events=null}this.eventListeners=null;if(this.handler){this.handler.destroy();this.handler=null}if(this.handlers){for(var a in this.handlers){if(this.handlers.hasOwnProperty(a)&&typeof this.handlers[a].destroy=="function"){this.handlers[a].destroy()}}this.handlers=null}if(this.map){this.map.removeControl(this);this.map=null}},setMap:function(a){this.map=a;if(this.handler){this.handler.setMap(a)}},draw:function(a){if(this.div==null){this.div=OpenLayers.Util.createDiv(this.id);this.div.className=this.displayClass;if(!this.allowSelection){this.div.className+=" olControlNoSelect";this.div.setAttribute("unselectable","on",0);this.div.onselectstart=function(){return(false)}}if(this.title!=""){this.div.title=this.title}}if(a!=null){this.position=a.clone()}this.moveTo(this.position);return this.div},moveTo:function(a){if((a!=null)&&(this.div!=null)){this.div.style.left=a.x+"px";this.div.style.top=a.y+"px"}},activate:function(){if(this.active){return false}if(this.handler){this.handler.activate()}this.active=true;this.events.triggerEvent("activate");return true},deactivate:function(){if(this.active){if(this.handler){this.handler.deactivate()}this.active=false;this.events.triggerEvent("deactivate");return true}return false},CLASS_NAME:"OpenLayers.Control"});OpenLayers.Control.TYPE_BUTTON=1;OpenLayers.Control.TYPE_TOGGLE=2;OpenLayers.Control.TYPE_TOOL=3;OpenLayers.Icon=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,initialize:function(a,b,e,d){this.url=a;this.size=(b)?b:new OpenLayers.Size(20,20);this.offset=e?e:new OpenLayers.Pixel(-(this.size.w/2),-(this.size.h/2));this.calculateOffset=d;var g=OpenLayers.Util.createUniqueID("OL_Icon_");this.imageDiv=OpenLayers.Util.createAlphaImageDiv(g)},destroy:function(){OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild);this.imageDiv.innerHTML="";this.imageDiv=null},clone:function(){return new OpenLayers.Icon(this.url,this.size,this.offset,this.calculateOffset)},setSize:function(a){if(a!=null){this.size=a}this.draw()},setUrl:function(a){if(a!=null){this.url=a}this.draw()},draw:function(a){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute");this.moveTo(a);return this.imageDiv},setOpacity:function(a){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null,null,null,null,a)},moveTo:function(a){if(a!=null){this.px=a}if(this.imageDiv!=null){if(this.px==null){this.display(false)}else{if(this.calculateOffset){this.offset=this.calculateOffset(this.size)}var b=this.px.offset(this.offset);OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,b)}}},display:function(a){this.imageDiv.style.display=(a)?"":"none"},isDrawn:function(){var a=(this.imageDiv&&this.imageDiv.parentNode&&(this.imageDiv.parentNode.nodeType!=11));return a},CLASS_NAME:"OpenLayers.Icon"});OpenLayers.Lang={code:null,defaultCode:"en",getCode:function(){if(!OpenLayers.Lang.code){OpenLayers.Lang.setCode()}return OpenLayers.Lang.code},setCode:function(b){var e;if(!b){b=(OpenLayers.Util.getBrowserName()=="msie")?navigator.userLanguage:navigator.language}var d=b.split("-");d[0]=d[0].toLowerCase();if(typeof OpenLayers.Lang[d[0]]=="object"){e=d[0]}if(d[1]){var a=d[0]+"-"+d[1].toUpperCase();if(typeof OpenLayers.Lang[a]=="object"){e=a}}if(!e){OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+d.join("-")+" dictionary, falling back to default language");e=OpenLayers.Lang.defaultCode}OpenLayers.Lang.code=e},translate:function(b,a){var e=OpenLayers.Lang[OpenLayers.Lang.getCode()];var d=e[b];if(!d){d=b}if(a){d=OpenLayers.String.format(d,a)}return d}};OpenLayers.i18n=OpenLayers.Lang.translate;OpenLayers.Popup=OpenLayers.Class({events:null,id:"",lonlat:null,div:null,contentSize:null,size:null,contentHTML:null,backgroundColor:"",opacity:"",border:"",contentDiv:null,groupDiv:null,closeDiv:null,autoSize:false,minSize:null,maxSize:null,displayClass:"olPopup",contentDisplayClass:"olPopupContent",padding:0,fixPadding:function(){if(typeof this.padding=="number"){this.padding=new OpenLayers.Bounds(this.padding,this.padding,this.padding,this.padding)}},panMapIfOutOfView:false,closeOnMove:false,map:null,initialize:function(l,d,h,b,g,e){if(l==null){l=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")}this.id=l;this.lonlat=d;this.contentSize=(h!=null)?h:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);if(b!=null){this.contentHTML=b}this.backgroundColor=OpenLayers.Popup.COLOR;this.opacity=OpenLayers.Popup.OPACITY;this.border=OpenLayers.Popup.BORDER;this.div=OpenLayers.Util.createDiv(this.id,null,null,null,null,null,"hidden");this.div.className=this.displayClass;var a=this.id+"_GroupDiv";this.groupDiv=OpenLayers.Util.createDiv(a,null,null,null,"relative",null,"hidden");var l=this.div.id+"_contentDiv";this.contentDiv=OpenLayers.Util.createDiv(l,null,this.contentSize.clone(),null,"relative");this.contentDiv.className=this.contentDisplayClass;this.groupDiv.appendChild(this.contentDiv);this.div.appendChild(this.groupDiv);if(g){this.addCloseBox(e)}this.registerEvents()},destroy:function(){this.id=null;this.lonlat=null;this.size=null;this.contentHTML=null;this.backgroundColor=null;this.opacity=null;this.border=null;if(this.closeOnMove&&this.map){this.map.events.unregister("movestart",this,this.hide)}this.events.destroy();this.events=null;if(this.closeDiv){OpenLayers.Event.stopObservingElement(this.closeDiv);this.groupDiv.removeChild(this.closeDiv)}this.closeDiv=null;this.div.removeChild(this.groupDiv);this.groupDiv=null;if(this.map!=null){this.map.removePopup(this)}this.map=null;this.div=null;this.autoSize=null;this.minSize=null;this.maxSize=null;this.padding=null;this.panMapIfOutOfView=null},draw:function(a){if(a==null){if((this.lonlat!=null)&&(this.map!=null)){a=this.map.getLayerPxFromLonLat(this.lonlat)}}if(this.closeOnMove){this.map.events.register("movestart",this,this.hide)}if(OpenLayers.Util.getBrowserName()=="firefox"){this.map.events.register("movestart",this,function(){var b=document.defaultView.getComputedStyle(this.contentDiv,null);var d=b.getPropertyValue("overflow");if(d!="hidden"){this.contentDiv._oldOverflow=d;this.contentDiv.style.overflow="hidden"}});this.map.events.register("moveend",this,function(){var b=this.contentDiv._oldOverflow;if(b){this.contentDiv.style.overflow=b;this.contentDiv._oldOverflow=null}})}this.moveTo(a);if(!this.autoSize&&!this.size){this.setSize(this.contentSize)}this.setBackgroundColor();this.setOpacity();this.setBorder();this.setContentHTML();if(this.panMapIfOutOfView){this.panIntoView()}return this.div},updatePosition:function(){if((this.lonlat)&&(this.map)){var a=this.map.getLayerPxFromLonLat(this.lonlat);if(a){this.moveTo(a)}}},moveTo:function(a){if((a!=null)&&(this.div!=null)){this.div.style.left=a.x+"px";this.div.style.top=a.y+"px"}},visible:function(){return OpenLayers.Element.visible(this.div)},toggle:function(){if(this.visible()){this.hide()}else{this.show()}},show:function(){OpenLayers.Element.show(this.div);if(this.panMapIfOutOfView){this.panIntoView()}},hide:function(){OpenLayers.Element.hide(this.div)},setSize:function(d){this.size=d.clone();var b=this.getContentDivPadding();var a=b.left+b.right;var g=b.top+b.bottom;this.fixPadding();a+=this.padding.left+this.padding.right;g+=this.padding.top+this.padding.bottom;if(this.closeDiv){var e=parseInt(this.closeDiv.style.width);a+=e+b.right}this.size.w+=a;this.size.h+=g;if(OpenLayers.Util.getBrowserName()=="msie"){this.contentSize.w+=b.left+b.right;this.contentSize.h+=b.bottom+b.top}if(this.div!=null){this.div.style.width=this.size.w+"px";this.div.style.height=this.size.h+"px"}if(this.contentDiv!=null){this.contentDiv.style.width=d.w+"px";this.contentDiv.style.height=d.h+"px"}},updateSize:function(){var g="<div class='"+this.contentDisplayClass+"'>"+this.contentDiv.innerHTML+"<div>";var e=OpenLayers.Util.getRenderedDimensions(g,null,{displayClass:this.displayClass});var b=this.getSafeContentSize(e);var d=null;if(b.equals(e)){d=e}else{var m=new OpenLayers.Size();m.w=(b.w<e.w)?b.w:null;m.h=(b.h<e.h)?b.h:null;if(m.w&&m.h){d=b}else{var a=OpenLayers.Util.getRenderedDimensions(g,m,{displayClass:this.contentDisplayClass});var l=OpenLayers.Element.getStyle(this.contentDiv,"overflow");if((l!="hidden")&&(a.equals(b))){var h=OpenLayers.Util.getScrollbarWidth();if(m.w){a.h+=h}else{a.w+=h}}d=this.getSafeContentSize(a)}}this.setSize(d)},setBackgroundColor:function(a){if(a!=undefined){this.backgroundColor=a}if(this.div!=null){this.div.style.backgroundColor=this.backgroundColor}},setOpacity:function(a){if(a!=undefined){this.opacity=a}if(this.div!=null){this.div.style.opacity=this.opacity;this.div.style.filter="alpha(opacity="+this.opacity*100+")"}},setBorder:function(a){if(a!=undefined){this.border=a}if(this.div!=null){this.div.style.border=this.border}},setContentHTML:function(a){if(a!=null){this.contentHTML=a}if((this.contentDiv!=null)&&(this.contentHTML!=null)&&(this.contentHTML!=this.contentDiv.innerHTML)){this.contentDiv.innerHTML=this.contentHTML;if(this.autoSize){this.registerImageListeners();this.updateSize()}}},registerImageListeners:function(){var h=function(){this.popup.updateSize();if(this.popup.visible()&&this.popup.panMapIfOutOfView){this.popup.panIntoView()}OpenLayers.Event.stopObserving(this.img,"load",this.img._onImageLoad)};var b=this.contentDiv.getElementsByTagName("img");for(var g=0,a=b.length;g<a;g++){var d=b[g];if(d.width==0||d.height==0){var e={popup:this,img:d};d._onImgLoad=OpenLayers.Function.bind(h,e);OpenLayers.Event.observe(d,"load",d._onImgLoad)}}},getSafeContentSize:function(b){var g=b.clone();var e=this.getContentDivPadding();var a=e.left+e.right;var m=e.top+e.bottom;this.fixPadding();a+=this.padding.left+this.padding.right;m+=this.padding.top+this.padding.bottom;if(this.closeDiv){var l=parseInt(this.closeDiv.style.width);a+=l+e.right}if(this.minSize){g.w=Math.max(g.w,(this.minSize.w-a));g.h=Math.max(g.h,(this.minSize.h-m))}if(this.maxSize){g.w=Math.min(g.w,(this.maxSize.w-a));g.h=Math.min(g.h,(this.maxSize.h-m))}if(this.map&&this.map.size){var d=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-m;var h=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-a;g.w=Math.min(g.w,h);g.h=Math.min(g.h,d)}return g},getContentDivPadding:function(){var a=this._contentDivPadding;if(!a){this.div.style.display="none";document.body.appendChild(this.div);a=new OpenLayers.Bounds(OpenLayers.Element.getStyle(this.contentDiv,"padding-left"),OpenLayers.Element.getStyle(this.contentDiv,"padding-bottom"),OpenLayers.Element.getStyle(this.contentDiv,"padding-right"),OpenLayers.Element.getStyle(this.contentDiv,"padding-top"));this._contentDivPadding=a;document.body.removeChild(this.div);this.div.style.display=""}return a},addCloseBox:function(d){this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,new OpenLayers.Size(17,17));this.closeDiv.className="olPopupCloseBox";var b=this.getContentDivPadding();this.closeDiv.style.right=b.right+"px";this.closeDiv.style.top=b.top+"px";this.groupDiv.appendChild(this.closeDiv);var a=d||function(g){this.hide();OpenLayers.Event.stop(g)};OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(a,this))},panIntoView:function(){var g=this.map.getSize();var e=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top)));var d=e.clone();if(e.x<this.map.paddingForPopups.left){d.x=this.map.paddingForPopups.left}else{if((e.x+this.size.w)>(g.w-this.map.paddingForPopups.right)){d.x=g.w-this.map.paddingForPopups.right-this.size.w}}if(e.y<this.map.paddingForPopups.top){d.y=this.map.paddingForPopups.top}else{if((e.y+this.size.h)>(g.h-this.map.paddingForPopups.bottom)){d.y=g.h-this.map.paddingForPopups.bottom-this.size.h}}var b=e.x-d.x;var a=e.y-d.y;this.map.pan(b,a)},registerEvents:function(){this.events=new OpenLayers.Events(this,this.div,null,true);this.events.on({mousedown:this.onmousedown,mousemove:this.onmousemove,mouseup:this.onmouseup,click:this.onclick,mouseout:this.onmouseout,dblclick:this.ondblclick,scope:this})},onmousedown:function(a){this.mousedown=true;OpenLayers.Event.stop(a,true)},onmousemove:function(a){if(this.mousedown){OpenLayers.Event.stop(a,true)}},onmouseup:function(a){if(this.mousedown){this.mousedown=false;OpenLayers.Event.stop(a,true)}},onclick:function(a){OpenLayers.Event.stop(a,true)},onmouseout:function(a){this.mousedown=false},ondblclick:function(a){OpenLayers.Event.stop(a,true)},CLASS_NAME:"OpenLayers.Popup"});OpenLayers.Popup.WIDTH=200;OpenLayers.Popup.HEIGHT=200;OpenLayers.Popup.COLOR="white";OpenLayers.Popup.OPACITY=1;OpenLayers.Popup.BORDER="0px";OpenLayers.Renderer=OpenLayers.Class({container:null,extent:null,locked:false,size:null,resolution:null,map:null,initialize:function(a,b){this.container=OpenLayers.Util.getElement(a)},destroy:function(){this.container=null;this.extent=null;this.size=null;this.resolution=null;this.map=null},supported:function(){return false},setExtent:function(a,b){this.extent=a.clone();if(b){this.resolution=null}},setSize:function(a){this.size=a.clone();this.resolution=null},getResolution:function(){this.resolution=this.resolution||this.map.getResolution();return this.resolution},drawFeature:function(a,b){if(b==null){b=a.style}if(a.geometry){var d=a.geometry.getBounds();if(d){if(!d.intersectsBounds(this.extent)){b={display:"none"}}return this.drawGeometry(a.geometry,b,a.id)}}},drawGeometry:function(d,a,b){},clear:function(){},getFeatureIdFromEvent:function(a){},eraseFeatures:function(d){if(!(d instanceof Array)){d=[d]}for(var b=0,a=d.length;b<a;++b){this.eraseGeometry(d[b].geometry)}},eraseGeometry:function(a){},CLASS_NAME:"OpenLayers.Renderer"});OpenLayers.Request={DEFAULT_CONFIG:{method:"GET",url:window.location.href,async:true,user:undefined,password:undefined,params:null,proxy:OpenLayers.ProxyHost,headers:{},data:null,callback:function(){},success:null,failure:null,scope:null},issue:function(e){var l=OpenLayers.Util.extend(this.DEFAULT_CONFIG,{proxy:OpenLayers.ProxyHost});e=OpenLayers.Util.applyDefaults(e,l);var h=new OpenLayers.Request.XMLHttpRequest();var a=e.url;if(e.params){var g=OpenLayers.Util.getParameterString(e.params);if(g.length>0){var o=(a.indexOf("?")>-1)?"&":"?";a+=o+g}}if(e.proxy&&(a.indexOf("http")==0)){a=e.proxy+encodeURIComponent(a)}h.open(e.method,a,e.async,e.user,e.password);for(var m in e.headers){h.setRequestHeader(m,e.headers[m])}var b=(e.scope)?OpenLayers.Function.bind(e.callback,e.scope):e.callback;var p;if(e.success){p=(e.scope)?OpenLayers.Function.bind(e.success,e.scope):e.success}var d;if(e.failure){d=(e.scope)?OpenLayers.Function.bind(e.failure,e.scope):e.failure}h.onreadystatechange=function(){if(h.readyState==OpenLayers.Request.XMLHttpRequest.DONE){b(h);if(p&&(!h.status||(h.status>=200&&h.status<300))){p(h)}if(d&&(h.status&&(h.status<200||h.status>=300))){d(h)}}};h.send(e.data);return h},GET:function(a){a=OpenLayers.Util.extend(a,{method:"GET"});return OpenLayers.Request.issue(a)},POST:function(a){a=OpenLayers.Util.extend(a,{method:"POST"});a.headers=a.headers?a.headers:{};if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(a.headers))){a.headers["Content-Type"]="application/xml"}return OpenLayers.Request.issue(a)},PUT:function(a){a=OpenLayers.Util.extend(a,{method:"PUT"});a.headers=a.headers?a.headers:{};if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(a.headers))){a.headers["Content-Type"]="application/xml"}return OpenLayers.Request.issue(a)},DELETE:function(a){a=OpenLayers.Util.extend(a,{method:"DELETE"});return OpenLayers.Request.issue(a)},HEAD:function(a){a=OpenLayers.Util.extend(a,{method:"HEAD"});return OpenLayers.Request.issue(a)},OPTIONS:function(a){a=OpenLayers.Util.extend(a,{method:"OPTIONS"});return OpenLayers.Request.issue(a)}};OpenLayers.Tween=OpenLayers.Class({INTERVAL:10,easing:null,begin:null,finish:null,duration:null,callbacks:null,time:null,interval:null,playing:false,initialize:function(a){this.easing=(a)?a:OpenLayers.Easing.Expo.easeOut},start:function(d,b,e,a){this.playing=true;this.begin=d;this.finish=b;this.duration=e;this.callbacks=a.callbacks;this.time=0;if(this.interval){window.clearInterval(this.interval);this.interval=null}if(this.callbacks&&this.callbacks.start){this.callbacks.start.call(this,this.begin)}this.interval=window.setInterval(OpenLayers.Function.bind(this.play,this),this.INTERVAL)},stop:function(){if(!this.playing){return}if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish)}window.clearInterval(this.interval);this.interval=null;this.playing=false},play:function(){var g={};for(var d in this.begin){var a=this.begin[d];var e=this.finish[d];if(a==null||e==null||isNaN(a)||isNaN(e)){OpenLayers.Console.error("invalid value for Tween")}var h=e-a;g[d]=this.easing.apply(this,[this.time,a,h,this.duration])}this.time++;if(this.callbacks&&this.callbacks.eachStep){this.callbacks.eachStep.call(this,g)}if(this.time>this.duration){if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish);this.playing=false}window.clearInterval(this.interval);this.interval=null}},CLASS_NAME:"OpenLayers.Tween"});OpenLayers.Easing={CLASS_NAME:"OpenLayers.Easing"};OpenLayers.Easing.Linear={easeIn:function(e,a,h,g){return h*e/g+a},easeOut:function(e,a,h,g){return h*e/g+a},easeInOut:function(e,a,h,g){return h*e/g+a},CLASS_NAME:"OpenLayers.Easing.Linear"};OpenLayers.Easing.Expo={easeIn:function(e,a,h,g){return(e==0)?a:h*Math.pow(2,10*(e/g-1))+a},easeOut:function(e,a,h,g){return(e==g)?a+h:h*(-Math.pow(2,-10*e/g)+1)+a},easeInOut:function(e,a,h,g){if(e==0){return a}if(e==g){return a+h}if((e/=g/2)<1){return h/2*Math.pow(2,10*(e-1))+a}return h/2*(-Math.pow(2,-10*--e)+2)+a},CLASS_NAME:"OpenLayers.Easing.Expo"};OpenLayers.Easing.Quad={easeIn:function(e,a,h,g){return h*(e/=g)*e+a},easeOut:function(e,a,h,g){return -h*(e/=g)*(e-2)+a},easeInOut:function(e,a,h,g){if((e/=g/2)<1){return h/2*e*e+a}return -h/2*((--e)*(e-2)-1)+a},CLASS_NAME:"OpenLayers.Easing.Quad"};mapfish.Color=OpenLayers.Class({getColorRgb:function(){}});mapfish.ColorRgb=OpenLayers.Class(mapfish.Color,{redLevel:null,greenLevel:null,blueLevel:null,initialize:function(d,b,a){this.redLevel=d;this.greenLevel=b;this.blueLevel=a},equals:function(a){return a.redLevel==this.redLevel&&a.greenLevel==this.greenLevel&&a.blueLevel==this.blueLevel},getColorRgb:function(){return this},getRgbArray:function(){return[this.redLevel,this.greenLevel,this.blueLevel]},hex2rgbArray:function(a){if(a.charAt(0)=="#"){a=a.substr(1)}var b=[parseInt(a.substring(0,2),16),parseInt(a.substring(2,4),16),parseInt(a.substring(4,6),16)];for(var d=0;d<b.length;d++){if(b[d]<0||b[d]>255){OpenLayers.Console.error("Invalid rgb hex color string: rgbHexString")}}return b},setFromHex:function(a){var b=this.hex2rgbArray(a);this.redLevel=b[0];this.greenLevel=b[1];this.blueLevel=b[2]},setFromRgb:function(b){var a=dojo.colorFromString(b);this.redLevel=a.r;this.greenLevel=a.g;this.blueLevel=a.b},toHexString:function(){var e=this.toHex(this.redLevel);var d=this.toHex(this.greenLevel);var a=this.toHex(this.blueLevel);return"#"+e+d+a},toHex:function(g){var b="0123456789ABCDEF";if(g<0||g>255){var e="Invalid decimal value for color level";OpenLayers.Console.error(e)}var d=Math.floor(g/16);var a=g%16;return b.charAt(d)+b.charAt(a)},CLASS_NAME:"mapfish.ColorRgb"});mapfish.ColorRgb.getColorsArrayByRgbInterpolation=function(o,e,h){var p=[];var b=o.getColorRgb();var a=e.getColorRgb();var m=b.getRgbArray();var l=a.getRgbArray();if(h==1){return[b]}for(var g=0;g<h;g++){var d=[];d[0]=m[0]+g*(l[0]-m[0])/(h-1);d[1]=m[1]+g*(l[1]-m[1])/(h-1);d[2]=m[2]+g*(l[2]-m[2])/(h-1);p[g]=new mapfish.ColorRgb(parseInt(d[0]),parseInt(d[1]),parseInt(d[2]))}return p};mapfish.Protocol={decorateProtocol:function(a){var d=a.protocol;for(var b in a){if(b!="protocol"){if(!mapfish.Protocol[b]){OpenLayers.Console.error("mapfish.Protocol."+b+" does not exist")}else{d=new mapfish.Protocol[b](OpenLayers.Util.extend({protocol:d},a[b]))}}}return d}};mapfish.Searcher=OpenLayers.Class({initialize:function(){},getFilter:function(){},CLASS_NAME:"mapfish.Searcher"});Ext.namespace("mapfish.widgets");mapfish.widgets.createScaleComboBox=function(d,g){if(!d.scales){OpenLayers.Console.error("scales is missing in the config")}var b=function(l){l=String(Math.round(l));var h=/(\d+)(\d{3})/;while(h.test(l)){l=l.replace(h,"$1'$2")}return"1:"+l};var a=[];for(var e=0;e<d.scales.length;e++){a.push([d.scales[e],b(d.scales[e])])}return new Ext.form.ComboBox(Ext.apply(g,{store:a}))};Ext.namespace("mapfish.widgets");mapfish.widgets.MapComponent=function(a){Ext.apply(this,a);this.contentEl=this.map.div;var b=Ext.get(this.contentEl);b.setStyle("width","100%");b.setStyle("height","100%");mapfish.widgets.MapComponent.superclass.constructor.call(this)};Ext.extend(mapfish.widgets.MapComponent,Ext.Panel,{map:null,initComponent:function(){mapfish.widgets.MapComponent.superclass.initComponent.apply(this,arguments);this.on("bodyresize",this.map.updateSize,this.map)}});Ext.reg("mapcomponent",mapfish.widgets.MapComponent);Ext.namespace("mapfish.widgets.toolbar");mapfish.widgets.toolbar.CheckItem=function(a){Ext.apply(this,a);mapfish.widgets.toolbar.CheckItem.superclass.constructor.call(this)};Ext.extend(mapfish.widgets.toolbar.CheckItem,Ext.menu.CheckItem,{controlAdded:false,olHandler:null,initComponent:function(){mapfish.widgets.toolbar.CheckItem.superclass.initComponent.call(this);Ext.QuickTips.init();if(this.control){this.scope=this;this.checkHandler=this.handleChecked}},handleChecked:function(item,checked){if(!this.controlAdded){this.map.addControl(this.control);this.controlAdded=true}if(checked){if(!this.olHandler){if(this.control.div){this.control.div.style.display="block"}}else{this.control.deactivate();eval("this.control."+this.olHandler+".activate();")}}else{if(!this.olHandler){if(this.control.div){this.control.div.style.display="none"}}else{this.control.deactivate()}}this.saveState()},getState:function(){return{className:this.control.CLASS_NAME,olHandler:this.olHandler,active:this.checked}},applyState:function(a){if(!a){return false}if(this.control.CLASS_NAME==a.className&&this.olHandler==a.olHandler){this.checked=a.active}else{if(this.control.CLASS_NAME==a.className){this.checked=a.active}}this.handleChecked(null,this.checked)},onRender:function(b,a){mapfish.widgets.toolbar.CheckItem.superclass.onRender.apply(this,arguments);if(this.tooltip){this.el.dom.qtip=this.tooltip}}});Ext.reg("checkitem",mapfish.widgets.toolbar.CheckItem);Ext.namespace("mapfish.widgets.toolbar");mapfish.widgets.toolbar.MenuItem=function(a){Ext.apply(this,a);mapfish.widgets.toolbar.MenuItem.superclass.constructor.call(this)};Ext.extend(mapfish.widgets.toolbar.MenuItem,Ext.menu.Item,{initComponent:function(){mapfish.widgets.toolbar.MenuItem.superclass.initComponent.call(this);Ext.QuickTips.init();if(this.control){this.scope=this;this.handler=function(){this.control.trigger()}}},onRender:function(b,a){mapfish.widgets.toolbar.MenuItem.superclass.onRender.apply(this,arguments);if(this.tooltip){this.el.dom.qtip=this.tooltip}}});Ext.reg("menuitem",mapfish.widgets.toolbar.MenuItem);Ext.namespace("mapfish.widgets.toolbar");mapfish.widgets.toolbar.Toolbar=function(a){Ext.apply(this,a);mapfish.widgets.toolbar.Toolbar.superclass.constructor.call(this)};Ext.extend(mapfish.widgets.toolbar.Toolbar,Ext.Toolbar,{controls:null,state:null,configurable:false,_buttons:null,initComponent:function(){mapfish.widgets.toolbar.Toolbar.superclass.initComponent.call(this);this.controls=[];this._buttons=[];this.autoWidth=true;this.autoHeight=true;Ext.QuickTips.init()},addControl:function(d,a){d.visible=true;this.controls.push(d);this.map.addControl(d);var b=new Ext.Toolbar.Button(a);if(!b.tooltip){b.tooltip=d.title}b.enableToggle=(d.type!=OpenLayers.Control.TYPE_BUTTON);if(d.isDefault){b.pressed=true}if(d.type==OpenLayers.Control.TYPE_BUTTON){b.on("click",d.trigger,d)}else{b.on("toggle",function(e,g){this.toggleHandler(d,g)},this);d.events.on({activate:this.onControlActivate,deactivate:this.onControlDeactivate,scope:this})}this.add(b);this._buttons.push(b);return b},removeControl:function(b){var a=this.getButtonForControl(b);a.destroy();OpenLayers.Util.removeItem(this._buttons,a);b.events.un({activate:this.onControlActivate,deactivate:this.onControlDeactivate,scope:this});this.map.removeControl(b);OpenLayers.Util.removeItem(this.controls,b)},onControlActivate:function(a){var d=a.object;var b=this.getButtonForControl(d);b.toggle(true)},onControlDeactivate:function(a){var d=a.object;var b=this.getButtonForControl(d);b.toggle(false);this.checkDefaultControl(b)},getControlByClassName:function(b){if(this.controls){for(var a=0;a<this.controls.length;a++){if(this.controls[a].CLASS_NAME==b){return this.controls[a]}}}return null},getButtonForControl:function(b){if(this.controls){for(var a=0;a<this.controls.length;a++){if(this.controls[a]==b){return this._buttons[a]}}}return null},activate:function(){if(this.configurable){this.applyState(this.state);var d=new Ext.Toolbar.Button({text:"+"});d.menu=new Ext.menu.Menu();for(var b=0;b<this.controls.length;b++){d.menu.add({style:"height:25px",text:'<div style="position: relative; left: 25px; top: -15px;" class="'+this._buttons[b].iconCls+'"/>',checked:this.controls[b].visible,scope:{toolbar:this,button:this._buttons[b],control:this.controls[b]},checkHandler:function(h,g){if(g){this.control.visible=true;if(this.control.isDefault){this.control.activate()}this.button.show()}else{this.control.visible=false;this.control.deactivate();this.button.hide()}this.toolbar.saveState()}})}this.add(d)}else{for(var a=0,e;a<this.controls.length;a++){e=this.controls[a];if(e.isDefault){e.activate()}}}},deactivate:function(){for(var a=0;a<this.controls.length;a++){this.controls[a].deactivate()}},applyState:function(g){if(!g){return false}this.state=g;var e=g.controls;if(e){for(var b=0,a=e.length;b<a;b++){var d=e[b];var h=this.getControlByClassName(d.id);if(h){h.visible=d.visible;if(!h.visible){this._buttons[b].hide()}}}}},getState:function(){var b={controls:[]};for(var a=0,d;a<this.controls.length;a++){d=this.controls[a];b.controls[a]={id:d.CLASS_NAME,visible:d.visible}}return b},toggleHandler:function(b,a){if(a!=b.active){if(a){b.activate()}else{b.deactivate()}}},checkDefaultControl:function(d){var h=d.toggleGroup;if(h){var e=null;for(var b=0;b<this.controls.length;b++){var a=this._buttons[b];if(a.toggleGroup==h){var g=this.controls[b];if(g.active){return}else{if(g.isDefault){e=g}}}}if(e){e.activate()}}}});Ext.reg("toolbar",mapfish.widgets.toolbar.Toolbar);OpenLayers.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments)},setMap:function(g){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var d=0,a=this.map.controls.length;d<a;d++){var e=this.map.controls[d];if((e!=this)&&(e.CLASS_NAME=="OpenLayers.Control.ArgParser")){if(e.displayProjection!=this.displayProjection){this.displayProjection=e.displayProjection}break}}if(d==this.map.controls.length){var b=OpenLayers.Util.getParameters();if(b.layers){this.layers=b.layers;this.map.events.register("addlayer",this,this.configureLayers);this.configureLayers()}if(b.lat&&b.lon){this.center=new OpenLayers.LonLat(parseFloat(b.lon),parseFloat(b.lat));if(b.zoom){this.zoom=parseInt(b.zoom)}this.map.events.register("changebaselayer",this,this.setCenter);this.setCenter()}}},setCenter:function(){if(this.map.baseLayer){this.map.events.unregister("changebaselayer",this,this.setCenter);if(this.displayProjection){this.center.transform(this.displayProjection,this.map.getProjectionObject())}this.map.setCenter(this.center,this.zoom)}},configureLayers:function(){if(this.layers.length==this.map.layers.length){this.map.events.unregister("addlayer",this,this.configureLayers);for(var d=0,a=this.layers.length;d<a;d++){var b=this.map.layers[d];var e=this.layers.charAt(d);if(e=="B"){this.map.setBaseLayer(b)}else{if((e=="T")||(e=="F")){b.setVisibility(e=="T")}}}}},CLASS_NAME:"OpenLayers.Control.ArgParser"});OpenLayers.Control.Attribution=OpenLayers.Class(OpenLayers.Control,{separator:", ",initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.map.events.un({removelayer:this.updateAttribution,addlayer:this.updateAttribution,changelayer:this.updateAttribution,changebaselayer:this.updateAttribution,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.map.events.on({changebaselayer:this.updateAttribution,changelayer:this.updateAttribution,addlayer:this.updateAttribution,removelayer:this.updateAttribution,scope:this});this.updateAttribution();return this.div},updateAttribution:function(){var e=[];if(this.map&&this.map.layers){for(var d=0,a=this.map.layers.length;d<a;d++){var b=this.map.layers[d];if(b.attribution&&b.getVisibility()){e.push(b.attribution)}}this.div.innerHTML=e.join(this.separator)}},CLASS_NAME:"OpenLayers.Control.Attribution"});OpenLayers.Control.Button=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){},CLASS_NAME:"OpenLayers.Control.Button"});OpenLayers.Control.LayerSwitcher=OpenLayers.Class(OpenLayers.Control,{activeColor:"darkblue",layerStates:null,layersDiv:null,baseLayersDiv:null,baseLayers:null,dataLbl:null,dataLayersDiv:null,dataLayers:null,minimizeDiv:null,maximizeDiv:null,ascending:true,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.layerStates=[]},destroy:function(){OpenLayers.Event.stopObservingElement(this.div);OpenLayers.Event.stopObservingElement(this.minimizeDiv);OpenLayers.Event.stopObservingElement(this.maximizeDiv);this.clearLayersArray("base");this.clearLayersArray("data");this.map.events.un({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.on({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this})},draw:function(){OpenLayers.Control.prototype.draw.apply(this);this.loadContents();if(!this.outsideViewport){this.minimizeControl()}this.redraw();return this.div},clearLayersArray:function(e){var g=this[e+"Layers"];if(g){for(var d=0,a=g.length;d<a;d++){var b=g[d];OpenLayers.Event.stopObservingElement(b.inputElem);OpenLayers.Event.stopObservingElement(b.labelSpan)}}this[e+"LayersDiv"].innerHTML="";this[e+"Layers"]=[]},checkRedraw:function(){var g=false;if(!this.layerStates.length||(this.map.layers.length!=this.layerStates.length)){g=true}else{for(var d=0,a=this.layerStates.length;d<a;d++){var e=this.layerStates[d];var b=this.map.layers[d];if((e.name!=b.name)||(e.inRange!=b.inRange)||(e.id!=b.id)||(e.visibility!=b.visibility)){g=true;break}}}return g},redraw:function(){if(!this.checkRedraw()){return this.div}this.clearLayersArray("base");this.clearLayersArray("data");var e=false;var r=false;var m=this.map.layers.length;this.layerStates=new Array(m);for(var h=0;h<m;h++){var l=this.map.layers[h];this.layerStates[h]={name:l.name,visibility:l.visibility,inRange:l.inRange,id:l.id}}var g=this.map.layers.slice();if(!this.ascending){g.reverse()}for(var h=0,m=g.length;h<m;h++){var l=g[h];var o=l.isBaseLayer;if(l.displayInLayerSwitcher){if(o){r=true}else{e=true}var q=(o)?(l==this.map.baseLayer):l.getVisibility();var p=document.createElement("input");p.id=this.id+"_input_"+l.name;p.name=(o)?"baseLayers":l.name;p.type=(o)?"radio":"checkbox";p.value=l.name;p.checked=q;p.defaultChecked=q;if(!o&&!l.inRange){p.disabled=true}var a={inputElem:p,layer:l,layerSwitcher:this};OpenLayers.Event.observe(p,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputClick,a));var b=document.createElement("span");if(!o&&!l.inRange){b.style.color="gray"}b.innerHTML=l.name;b.style.verticalAlign=(o)?"bottom":"baseline";OpenLayers.Event.observe(b,"click",OpenLayers.Function.bindAsEventListener(this.onInputClick,a));var t=document.createElement("br");var s=(o)?this.baseLayers:this.dataLayers;s.push({layer:l,inputElem:p,labelSpan:b});var d=(o)?this.baseLayersDiv:this.dataLayersDiv;d.appendChild(p);d.appendChild(b);d.appendChild(t)}}this.dataLbl.style.display=(e)?"":"none";this.baseLbl.style.display=(r)?"":"none";return this.div},onInputClick:function(a){if(!this.inputElem.disabled){if(this.inputElem.type=="radio"){this.inputElem.checked=true;this.layer.map.setBaseLayer(this.layer)}else{this.inputElem.checked=!this.inputElem.checked;this.layerSwitcher.updateMap()}}OpenLayers.Event.stop(a)},onLayerClick:function(a){this.updateMap()},updateMap:function(){for(var b=0,a=this.baseLayers.length;b<a;b++){var d=this.baseLayers[b];if(d.inputElem.checked){this.map.setBaseLayer(d.layer,false)}}for(var b=0,a=this.dataLayers.length;b<a;b++){var d=this.dataLayers[b];d.layer.setVisibility(d.inputElem.checked)}},maximizeControl:function(a){this.div.style.width="20em";this.div.style.height="";this.showControls(false);if(a!=null){OpenLayers.Event.stop(a)}},minimizeControl:function(a){this.div.style.width="0px";this.div.style.height="0px";this.showControls(true);if(a!=null){OpenLayers.Event.stop(a)}},showControls:function(a){this.maximizeDiv.style.display=a?"":"none";this.minimizeDiv.style.display=a?"none":"";this.layersDiv.style.display=a?"none":""},loadContents:function(){this.div.style.position="absolute";this.div.style.top="25px";this.div.style.right="0px";this.div.style.left="";this.div.style.fontFamily="sans-serif";this.div.style.fontWeight="bold";this.div.style.marginTop="3px";this.div.style.marginLeft="3px";this.div.style.marginBottom="3px";this.div.style.fontSize="smaller";this.div.style.color="white";this.div.style.backgroundColor="transparent";OpenLayers.Event.observe(this.div,"mouseup",OpenLayers.Function.bindAsEventListener(this.mouseUp,this));OpenLayers.Event.observe(this.div,"click",this.ignoreEvent);OpenLayers.Event.observe(this.div,"mousedown",OpenLayers.Function.bindAsEventListener(this.mouseDown,this));OpenLayers.Event.observe(this.div,"dblclick",this.ignoreEvent);this.layersDiv=document.createElement("div");this.layersDiv.id=this.id+"_layersDiv";this.layersDiv.style.paddingTop="5px";this.layersDiv.style.paddingLeft="10px";this.layersDiv.style.paddingBottom="5px";this.layersDiv.style.paddingRight="75px";this.layersDiv.style.backgroundColor=this.activeColor;this.layersDiv.style.width="100%";this.layersDiv.style.height="100%";this.baseLbl=document.createElement("div");this.baseLbl.innerHTML=OpenLayers.i18n("baseLayer");this.baseLbl.style.marginTop="3px";this.baseLbl.style.marginLeft="3px";this.baseLbl.style.marginBottom="3px";this.baseLayersDiv=document.createElement("div");this.baseLayersDiv.style.paddingLeft="10px";this.dataLbl=document.createElement("div");this.dataLbl.innerHTML=OpenLayers.i18n("overlays");this.dataLbl.style.marginTop="3px";this.dataLbl.style.marginLeft="3px";this.dataLbl.style.marginBottom="3px";this.dataLayersDiv=document.createElement("div");this.dataLayersDiv.style.paddingLeft="10px";if(this.ascending){this.layersDiv.appendChild(this.baseLbl);this.layersDiv.appendChild(this.baseLayersDiv);this.layersDiv.appendChild(this.dataLbl);this.layersDiv.appendChild(this.dataLayersDiv)}else{this.layersDiv.appendChild(this.dataLbl);this.layersDiv.appendChild(this.dataLayersDiv);this.layersDiv.appendChild(this.baseLbl);this.layersDiv.appendChild(this.baseLayersDiv)}this.div.appendChild(this.layersDiv);OpenLayers.Rico.Corner.round(this.div,{corners:"tl bl",bgColor:"transparent",color:this.activeColor,blend:false});OpenLayers.Rico.Corner.changeOpacity(this.layersDiv,0.75);var d=OpenLayers.Util.getImagesLocation();var b=new OpenLayers.Size(18,18);var a=d+"layer-switcher-maximize.png";this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MaximizeDiv",null,b,a,"absolute");this.maximizeDiv.style.top="5px";this.maximizeDiv.style.right="0px";this.maximizeDiv.style.left="";this.maximizeDiv.style.display="none";OpenLayers.Event.observe(this.maximizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));this.div.appendChild(this.maximizeDiv);var a=d+"layer-switcher-minimize.png";var b=new OpenLayers.Size(18,18);this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MinimizeDiv",null,b,a,"absolute");this.minimizeDiv.style.top="5px";this.minimizeDiv.style.right="0px";this.minimizeDiv.style.left="";this.minimizeDiv.style.display="none";OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv)},ignoreEvent:function(a){OpenLayers.Event.stop(a)},mouseDown:function(a){this.isMouseDown=true;this.ignoreEvent(a)},mouseUp:function(a){if(this.isMouseDown){this.isMouseDown=false;this.ignoreEvent(a)}},CLASS_NAME:"OpenLayers.Control.LayerSwitcher"});OpenLayers.Control.MouseDefaults=OpenLayers.Class(OpenLayers.Control,{performedDrag:false,wheelObserver:null,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){if(this.handler){this.handler.destroy()}this.handler=null;this.map.events.un({click:this.defaultClick,dblclick:this.defaultDblClick,mousedown:this.defaultMouseDown,mouseup:this.defaultMouseUp,mousemove:this.defaultMouseMove,mouseout:this.defaultMouseOut,scope:this});OpenLayers.Event.stopObserving(window,"DOMMouseScroll",this.wheelObserver);OpenLayers.Event.stopObserving(window,"mousewheel",this.wheelObserver);OpenLayers.Event.stopObserving(document,"mousewheel",this.wheelObserver);this.wheelObserver=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){this.map.events.on({click:this.defaultClick,dblclick:this.defaultDblClick,mousedown:this.defaultMouseDown,mouseup:this.defaultMouseUp,mousemove:this.defaultMouseMove,mouseout:this.defaultMouseOut,scope:this});this.registerWheelEvents()},registerWheelEvents:function(){this.wheelObserver=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this);OpenLayers.Event.observe(window,"DOMMouseScroll",this.wheelObserver);OpenLayers.Event.observe(window,"mousewheel",this.wheelObserver);OpenLayers.Event.observe(document,"mousewheel",this.wheelObserver)},defaultClick:function(b){if(!OpenLayers.Event.isLeftClick(b)){return}var a=!this.performedDrag;this.performedDrag=false;return a},defaultDblClick:function(b){var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(a,this.map.zoom+1);OpenLayers.Event.stop(b);return false},defaultMouseDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}this.mouseDragStart=a.xy.clone();this.performedDrag=false;if(a.shiftKey){this.map.div.style.cursor="crosshair";this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.mouseDragStart,null,null,"absolute","2px solid red");this.zoomBox.style.backgroundColor="white";this.zoomBox.style.filter="alpha(opacity=50)";this.zoomBox.style.opacity="0.50";this.zoomBox.style.fontSize="1px";this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.viewPortDiv.appendChild(this.zoomBox)}document.onselectstart=function(){return false};OpenLayers.Event.stop(a)},defaultMouseMove:function(g){this.mousePosition=g.xy.clone();if(this.mouseDragStart!=null){if(this.zoomBox){var e=Math.abs(this.mouseDragStart.x-g.xy.x);var b=Math.abs(this.mouseDragStart.y-g.xy.y);this.zoomBox.style.width=Math.max(1,e)+"px";this.zoomBox.style.height=Math.max(1,b)+"px";if(g.xy.x<this.mouseDragStart.x){this.zoomBox.style.left=g.xy.x+"px"}if(g.xy.y<this.mouseDragStart.y){this.zoomBox.style.top=g.xy.y+"px"}}else{var e=this.mouseDragStart.x-g.xy.x;var b=this.mouseDragStart.y-g.xy.y;var h=this.map.getSize();var a=new OpenLayers.Pixel(h.w/2+e,h.h/2+b);var d=this.map.getLonLatFromViewPortPx(a);this.map.setCenter(d,null,true);this.mouseDragStart=g.xy.clone();this.map.div.style.cursor="move"}this.performedDrag=true}},defaultMouseUp:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}if(this.zoomBox){this.zoomBoxEnd(a)}else{if(this.performedDrag){this.map.setCenter(this.map.center)}}document.onselectstart=null;this.mouseDragStart=null;this.map.div.style.cursor=""},defaultMouseOut:function(a){if(this.mouseDragStart!=null&&OpenLayers.Util.mouseLeft(a,this.map.div)){if(this.zoomBox){this.removeZoomBox()}this.mouseDragStart=null}},defaultWheelUp:function(a){if(this.map.getZoom()<=this.map.getNumZoomLevels()){this.map.setCenter(this.map.getLonLatFromPixel(a.xy),this.map.getZoom()+1)}},defaultWheelDown:function(a){if(this.map.getZoom()>0){this.map.setCenter(this.map.getLonLatFromPixel(a.xy),this.map.getZoom()-1)}},zoomBoxEnd:function(b){if(this.mouseDragStart!=null){if(Math.abs(this.mouseDragStart.x-b.xy.x)>5||Math.abs(this.mouseDragStart.y-b.xy.y)>5){var m=this.map.getLonLatFromViewPortPx(this.mouseDragStart);var a=this.map.getLonLatFromViewPortPx(b.xy);var l=Math.max(m.lat,a.lat);var d=Math.min(m.lat,a.lat);var h=Math.min(m.lon,a.lon);var e=Math.max(m.lon,a.lon);var g=new OpenLayers.Bounds(h,d,e,l);this.map.zoomToExtent(g)}else{var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(new OpenLayers.LonLat((a.lon),(a.lat)),this.map.getZoom()+1)}this.removeZoomBox()}},removeZoomBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null},onWheelEvent:function(d){var b=false;var a=OpenLayers.Event.element(d);while(a!=null){if(this.map&&a==this.map.div){b=true;break}a=a.parentNode}if(b){var g=0;if(!d){d=window.event}if(d.wheelDelta){g=d.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){g=-g}}else{if(d.detail){g=-d.detail/3}}if(g){d.xy=this.mousePosition;if(g<0){this.defaultWheelDown(d)}else{this.defaultWheelUp(d)}}OpenLayers.Event.stop(d)}},CLASS_NAME:"OpenLayers.Control.MouseDefaults"});OpenLayers.Control.MousePosition=OpenLayers.Class(OpenLayers.Control,{element:null,prefix:"",separator:", ",suffix:"",numDigits:5,granularity:10,lastXy:null,displayProjection:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){if(this.map){this.map.events.unregister("mousemove",this,this.redraw)}OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.left="";this.div.top="";this.element=this.div}this.redraw();return this.div},redraw:function(a){var d;if(a==null){d=new OpenLayers.LonLat(0,0)}else{if(this.lastXy==null||Math.abs(a.xy.x-this.lastXy.x)>this.granularity||Math.abs(a.xy.y-this.lastXy.y)>this.granularity){this.lastXy=a.xy;return}d=this.map.getLonLatFromPixel(a.xy);if(!d){return}if(this.displayProjection){d.transform(this.map.getProjectionObject(),this.displayProjection)}this.lastXy=a.xy}var b=this.formatOutput(d);if(b!=this.element.innerHTML){this.element.innerHTML=b}},formatOutput:function(b){var d=parseInt(this.numDigits);var a=this.prefix+b.lon.toFixed(d)+this.separator+b.lat.toFixed(d)+this.suffix;return a},setMap:function(){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.register("mousemove",this,this.redraw)},CLASS_NAME:"OpenLayers.Control.MousePosition"});OpenLayers.Control.NavigationHistory=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOGGLE,previous:null,previousOptions:null,next:null,nextOptions:null,limit:50,activateOnDraw:true,clearOnDeactivate:false,registry:null,nextStack:null,previousStack:null,listeners:null,restoring:false,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.registry=OpenLayers.Util.extend({moveend:function(){return{center:this.map.getCenter(),resolution:this.map.getResolution()}}},this.registry);this.clear();var b={trigger:OpenLayers.Function.bind(this.previousTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Previous"};OpenLayers.Util.extend(b,this.previousOptions);this.previous=new OpenLayers.Control.Button(b);var d={trigger:OpenLayers.Function.bind(this.nextTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Next"};OpenLayers.Util.extend(d,this.nextOptions);this.next=new OpenLayers.Control.Button(d)},onPreviousChange:function(b,a){if(b&&!this.previous.active){this.previous.activate()}else{if(!b&&this.previous.active){this.previous.deactivate()}}},onNextChange:function(b,a){if(b&&!this.next.active){this.next.activate()}else{if(!b&&this.next.active){this.next.deactivate()}}},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this);this.previous.destroy();this.next.destroy();this.deactivate();for(var a in this){this[a]=null}},setMap:function(a){this.map=a;this.next.setMap(a);this.previous.setMap(a)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.next.draw();this.previous.draw();if(this.activateOnDraw){this.activate()}},previousTrigger:function(){var b=this.previousStack.shift();var a=this.previousStack.shift();if(a!=undefined){this.nextStack.unshift(b);this.previousStack.unshift(a);this.restoring=true;this.restore(a);this.restoring=false;this.onNextChange(this.nextStack[0],this.nextStack.length);this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)}else{this.previousStack.unshift(b)}return a},nextTrigger:function(){var a=this.nextStack.shift();if(a!=undefined){this.previousStack.unshift(a);this.restoring=true;this.restore(a);this.restoring=false;this.onNextChange(this.nextStack[0],this.nextStack.length);this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)}return a},clear:function(){this.previousStack=[];this.nextStack=[]},restore:function(b){var a=this.map.getZoomForResolution(b.resolution);this.map.setCenter(b.center,a)},setListeners:function(){this.listeners={};for(var a in this.registry){this.listeners[a]=OpenLayers.Function.bind(function(){if(!this.restoring){var b=this.registry[a].apply(this,arguments);this.previousStack.unshift(b);if(this.previousStack.length>1){this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)}if(this.previousStack.length>(this.limit+1)){this.previousStack.pop()}if(this.nextStack.length>0){this.nextStack=[];this.onNextChange(null,0)}}return true},this)}},activate:function(){var a=false;if(this.map){if(OpenLayers.Control.prototype.activate.apply(this)){if(this.listeners==null){this.setListeners()}for(var b in this.listeners){this.map.events.register(b,this,this.listeners[b])}a=true;if(this.previousStack.length==0){this.initStack()}}}return a},initStack:function(){if(this.map.getCenter()){this.listeners.moveend()}},deactivate:function(){var b=false;if(this.map){if(OpenLayers.Control.prototype.deactivate.apply(this)){for(var a in this.listeners){this.map.events.unregister(a,this,this.listeners[a])}if(this.clearOnDeactivate){this.clear()}b=true}}return b},CLASS_NAME:"OpenLayers.Control.NavigationHistory"});OpenLayers.Control.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,buttons:null,position:null,initialize:function(a){this.position=new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,OpenLayers.Control.PanZoom.Y);OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);while(this.buttons.length){var a=this.buttons.shift();a.map=null;OpenLayers.Event.stopObservingElement(a)}this.buttons=null;this.position=null},draw:function(b){OpenLayers.Control.prototype.draw.apply(this,arguments);b=this.position;this.buttons=[];var d=new OpenLayers.Size(18,18);var a=new OpenLayers.Pixel(b.x+d.w/2,b.y);this._addButton("panup","north-mini.png",a,d);b.y=a.y+d.h;this._addButton("panleft","west-mini.png",b,d);this._addButton("panright","east-mini.png",b.add(d.w,0),d);this._addButton("pandown","south-mini.png",a.add(0,d.h*2),d);this._addButton("zoomin","zoom-plus-mini.png",a.add(0,d.h*3+5),d);this._addButton("zoomworld","zoom-world-mini.png",a.add(0,d.h*4+5),d);this._addButton("zoomout","zoom-minus-mini.png",a.add(0,d.h*5+5),d);return this.div},_addButton:function(h,a,g,e){var d=OpenLayers.Util.getImagesLocation()+a;var b=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+h,g,e,d,"absolute");this.div.appendChild(b);OpenLayers.Event.observe(b,"mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,b));OpenLayers.Event.observe(b,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick,b));OpenLayers.Event.observe(b,"click",OpenLayers.Function.bindAsEventListener(this.doubleClick,b));b.action=h;b.map=this.map;b.slideFactor=this.slideFactor;this.buttons.push(b);return b},doubleClick:function(a){OpenLayers.Event.stop(a);return false},buttonDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}switch(this.action){case"panup":this.map.pan(0,-this.slideFactor);break;case"pandown":this.map.pan(0,this.slideFactor);break;case"panleft":this.map.pan(-this.slideFactor,0);break;case"panright":this.map.pan(this.slideFactor,0);break;case"zoomin":this.map.zoomIn();break;case"zoomout":this.map.zoomOut();break;case"zoomworld":this.map.zoomToMaxExtent();break}OpenLayers.Event.stop(a)},CLASS_NAME:"OpenLayers.Control.PanZoom"});OpenLayers.Control.PanZoom.X=4;OpenLayers.Control.PanZoom.Y=4;OpenLayers.Control.Panel=OpenLayers.Class(OpenLayers.Control,{controls:null,defaultControl:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.controls=[]},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);for(var a=this.controls.length-1;a>=0;a--){if(this.controls[a].events){this.controls[a].events.un({activate:this.redraw,deactivate:this.redraw,scope:this})}OpenLayers.Event.stopObservingElement(this.controls[a].panel_div);this.controls[a].panel_div=null}},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){for(var b=0,a=this.controls.length;b<a;b++){if(this.controls[b]==this.defaultControl){this.controls[b].activate()}}this.redraw();return true}else{return false}},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){for(var b=0,a=this.controls.length;b<a;b++){this.controls[b].deactivate()}return true}else{return false}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);for(var b=0,a=this.controls.length;b<a;b++){this.map.addControl(this.controls[b]);this.controls[b].deactivate();this.controls[b].events.on({activate:this.redraw,deactivate:this.redraw,scope:this})}this.activate();return this.div},redraw:function(){this.div.innerHTML="";if(this.active){for(var d=0,a=this.controls.length;d<a;d++){var b=this.controls[d].panel_div;if(this.controls[d].active){b.className=this.controls[d].displayClass+"ItemActive"}else{b.className=this.controls[d].displayClass+"ItemInactive"}this.div.appendChild(b)}}},activateControl:function(d){if(!this.active){return false}if(d.type==OpenLayers.Control.TYPE_BUTTON){d.trigger();this.redraw();return}if(d.type==OpenLayers.Control.TYPE_TOGGLE){if(d.active){d.deactivate()}else{d.activate()}this.redraw();return}for(var b=0,a=this.controls.length;b<a;b++){if(this.controls[b]!=d){if(this.controls[b].type!=OpenLayers.Control.TYPE_TOGGLE){this.controls[b].deactivate()}}}d.activate()},addControls:function(b){if(!(b instanceof Array)){b=[b]}this.controls=this.controls.concat(b);for(var e=0,a=b.length;e<a;e++){var d=document.createElement("div");var g=document.createTextNode(" ");b[e].panel_div=d;if(b[e].title!=""){b[e].panel_div.title=b[e].title}OpenLayers.Event.observe(b[e].panel_div,"click",OpenLayers.Function.bind(this.onClick,this,b[e]));OpenLayers.Event.observe(b[e].panel_div,"mousedown",OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop))}if(this.map){for(var e=0,a=b.length;e<a;e++){this.map.addControl(b[e]);b[e].deactivate();b[e].events.on({activate:this.redraw,deactivate:this.redraw,scope:this})}this.redraw()}},onClick:function(b,a){OpenLayers.Event.stop(a?a:window.event);this.activateControl(b)},getControlsBy:function(d,a){var e=(typeof a.test=="function");var b=OpenLayers.Array.filter(this.controls,function(g){return g[d]==a||(e&&a.test(g[d]))});return b},getControlsByName:function(a){return this.getControlsBy("name",a)},getControlsByClass:function(a){return this.getControlsBy("CLASS_NAME",a)},CLASS_NAME:"OpenLayers.Control.Panel"});OpenLayers.Control.Scale=OpenLayers.Class(OpenLayers.Control,{element:null,initialize:function(b,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.element=OpenLayers.Util.getElement(b)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.element=document.createElement("div");this.div.appendChild(this.element)}this.map.events.register("moveend",this,this.updateScale);this.updateScale();return this.div},updateScale:function(){var a=this.map.getScale();if(!a){return}if(a>=9500&&a<=950000){a=Math.round(a/1000)+"K"}else{if(a>=950000){a=Math.round(a/1000000)+"M"}else{a=Math.round(a)}}this.element.innerHTML=OpenLayers.i18n("scale",{scaleDenom:a})},CLASS_NAME:"OpenLayers.Control.Scale"});OpenLayers.Control.ZoomToMaxExtent=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){if(this.map){this.map.zoomToMaxExtent()}},CLASS_NAME:"OpenLayers.Control.ZoomToMaxExtent"});OpenLayers.Event={observers:false,KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(a){return a.target||a.srcElement},isLeftClick:function(a){return(((a.which)&&(a.which==1))||((a.button)&&(a.button==1)))},isRightClick:function(a){return(((a.which)&&(a.which==3))||((a.button)&&(a.button==2)))},stop:function(b,a){if(!a){if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}}if(b.stopPropagation){b.stopPropagation()}else{b.cancelBubble=true}},findElement:function(d,b){var a=OpenLayers.Event.element(d);while(a.parentNode&&(!a.tagName||(a.tagName.toUpperCase()!=b.toUpperCase()))){a=a.parentNode}return a},observe:function(b,e,d,a){var g=OpenLayers.Util.getElement(b);a=a||false;if(e=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||g.attachEvent)){e="keydown"}if(!this.observers){this.observers={}}if(!g._eventCacheID){var h="eventCacheID_";if(g.id){h=g.id+"_"+h}g._eventCacheID=OpenLayers.Util.createUniqueID(h)}var l=g._eventCacheID;if(!this.observers[l]){this.observers[l]=[]}this.observers[l].push({element:g,name:e,observer:d,useCapture:a});if(g.addEventListener){g.addEventListener(e,d,a)}else{if(g.attachEvent){g.attachEvent("on"+e,d)}}},stopObservingElement:function(a){var b=OpenLayers.Util.getElement(a);var d=b._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[d])},_removeElementObservers:function(g){if(g){for(var b=g.length-1;b>=0;b--){var d=g[b];var a=new Array(d.element,d.name,d.observer,d.useCapture);var e=OpenLayers.Event.stopObserving.apply(this,a)}}},stopObserving:function(m,a,l,b){b=b||false;var h=OpenLayers.Util.getElement(m);var e=h._eventCacheID;if(a=="keypress"){if(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||h.detachEvent){a="keydown"}}var p=false;var d=OpenLayers.Event.observers[e];if(d){var g=0;while(!p&&g<d.length){var o=d[g];if((o.name==a)&&(o.observer==l)&&(o.useCapture==b)){d.splice(g,1);if(d.length==0){delete OpenLayers.Event.observers[e]}p=true;break}g++}}if(p){if(h.removeEventListener){h.removeEventListener(a,l,b)}else{if(h&&h.detachEvent){h.detachEvent("on"+a,l)}}}return p},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var a in OpenLayers.Event.observers){var b=OpenLayers.Event.observers[a];OpenLayers.Event._removeElementObservers.apply(this,[b])}OpenLayers.Event.observers=false}},CLASS_NAME:"OpenLayers.Event"};OpenLayers.Event.observe(window,"unload",OpenLayers.Event.unloadCache,false);if(window.Event){OpenLayers.Util.applyDefaults(window.Event,OpenLayers.Event)}else{var Event=OpenLayers.Event}OpenLayers.Events=OpenLayers.Class({BROWSER_EVENTS:["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur"],listeners:null,object:null,element:null,eventTypes:null,eventHandler:null,fallThrough:null,includeXY:false,initialize:function(d,g,l,h,b){OpenLayers.Util.extend(this,b);this.object=d;this.element=g;this.fallThrough=h;this.listeners={};this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this);this.eventTypes=[];if(l!=null){for(var e=0,a=l.length;e<a;e++){this.addEventType(l[e])}}if(this.element!=null){this.attachToElement(g)}},destroy:function(){if(this.element){OpenLayers.Event.stopObservingElement(this.element)}this.element=null;this.listeners=null;this.object=null;this.eventTypes=null;this.fallThrough=null;this.eventHandler=null},addEventType:function(a){if(!this.listeners[a]){this.eventTypes.push(a);this.listeners[a]=[]}},attachToElement:function(e){for(var d=0,a=this.BROWSER_EVENTS.length;d<a;d++){var b=this.BROWSER_EVENTS[d];this.addEventType(b);OpenLayers.Event.observe(e,b,this.eventHandler)}OpenLayers.Event.observe(e,"dragstart",OpenLayers.Event.stop)},on:function(a){for(var b in a){if(b!="scope"){this.register(b,a.scope,a[b])}}},register:function(b,e,d){if((d!=null)&&(OpenLayers.Util.indexOf(this.eventTypes,b)!=-1)){if(e==null){e=this.object}var a=this.listeners[b];a.push({obj:e,func:d})}},registerPriority:function(b,e,d){if(d!=null){if(e==null){e=this.object}var a=this.listeners[b];if(a!=null){a.unshift({obj:e,func:d})}}},un:function(a){for(var b in a){if(b!="scope"){this.unregister(b,a.scope,a[b])}}},unregister:function(e,h,g){if(h==null){h=this.object}var d=this.listeners[e];if(d!=null){for(var b=0,a=d.length;b<a;b++){if(d[b].obj==h&&d[b].func==g){d.splice(b,1);break}}}},remove:function(a){if(this.listeners[a]!=null){this.listeners[a]=[]}},triggerEvent:function(g,b){if(b==null){b={}}b.object=this.object;b.element=this.element;if(!b.type){b.type=g}var e=(this.listeners[g])?this.listeners[g].slice():null;if((e!=null)&&(e.length>0)){var h;for(var d=0,a=e.length;d<a;d++){var l=e[d];h=l.func.apply(l.obj,[b]);if((h!=undefined)&&(h==false)){break}}if(!this.fallThrough){OpenLayers.Event.stop(b,true)}}return h},handleBrowserEvent:function(a){if(this.includeXY){a.xy=this.getMousePosition(a)}this.triggerEvent(a.type,a)},clearMouseCache:function(){this.element.scrolls=null;this.element.lefttop=null;this.element.offsets=null},getMousePosition:function(a){if(!this.includeXY){this.clearMouseCache()}else{if(!this.element.hasScrollEvent){OpenLayers.Event.observe(window,"scroll",OpenLayers.Function.bind(this.clearMouseCache,this));this.element.hasScrollEvent=true}}if(!this.element.scrolls){this.element.scrolls=[];this.element.scrolls[0]=(document.documentElement.scrollLeft||document.body.scrollLeft);this.element.scrolls[1]=(document.documentElement.scrollTop||document.body.scrollTop)}if(!this.element.lefttop){this.element.lefttop=[];this.element.lefttop[0]=(document.documentElement.clientLeft||0);this.element.lefttop[1]=(document.documentElement.clientTop||0)}if(!this.element.offsets){this.element.offsets=OpenLayers.Util.pagePosition(this.element);this.element.offsets[0]+=this.element.scrolls[0];this.element.offsets[1]+=this.element.scrolls[1]}return new OpenLayers.Pixel((a.clientX+this.element.scrolls[0])-this.element.offsets[0]-this.element.lefttop[0],(a.clientY+this.element.scrolls[1])-this.element.offsets[1]-this.element.lefttop[1])},CLASS_NAME:"OpenLayers.Events"});OpenLayers.Format=OpenLayers.Class({options:null,externalProjection:null,internalProjection:null,initialize:function(a){OpenLayers.Util.extend(this,a);this.options=a},destroy:function(){},read:function(a){OpenLayers.Console.userError(OpenLayers.i18n("readNotImplemented"))},write:function(a){OpenLayers.Console.userError(OpenLayers.i18n("writeNotImplemented"))},CLASS_NAME:"OpenLayers.Format"});OpenLayers.Lang.en={unhandledRequest:"Unhandled request return ${statusText}",permalink:"Permalink",overlays:"Overlays",baseLayer:"Base Layer",sameProjection:"The overview map only works when it is in the same projection as the main map",readNotImplemented:"Read not implemented.",writeNotImplemented:"Write not implemented.",noFID:"Can't update a feature for which there is no FID.",errorLoadingGML:"Error in loading GML file ${url}",browserNotSupported:"Your browser does not support vector rendering. Currently supported renderers are:\n${renderers}",componentShouldBe:"addFeatures : component should be an ${geomType}",getFeatureError:"getFeatureFromEvent called on layer with no renderer. This usually means you destroyed a layer, but not some handler which is associated with it.",minZoomLevelError:"The minZoomLevel property is only intended for use with the FixedZoomLevels-descendent layers. That this wfs layer checks for minZoomLevel is a relic of thepast. We cannot, however, remove it without possibly breaking OL based applications that may depend on it. Therefore we are deprecating it -- the minZoomLevel check below will be removed at 3.0. Please instead use min/max resolution setting as described here: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"WFS Transaction: SUCCESS ${response}",commitFailed:"WFS Transaction: FAILED ${response}",googleWarning:"The Google Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the Google Maps library script was either not included, or does not contain the correct API key for your site.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>click here</a>",getLayerWarning:"The ${layerType} Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the ${layerLib} library script was not correctly included.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>click here</a>",scale:"Scale = 1 : ${scaleDenom}",layerAlreadyAdded:"You tried to add the layer: ${layerName} to the map, but it has already been added",reprojectDeprecated:"You are using the 'reproject' option on the ${layerName} layer. This option is deprecated: its use was designed to support displaying data over commercial basemaps, but that functionality should now be achieved by using Spherical Mercator support. More information is available from http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"This method has been deprecated and will be removed in 3.0. Please use ${newMethod} instead.",boundsAddError:"You must pass both x and y values to the add function.",lonlatAddError:"You must pass both lon and lat values to the add function.",pixelAddError:"You must pass both x and y values to the add function.",unsupportedGeometryType:"Unsupported geometry type: ${geomType}",pagePositionFailed:"OpenLayers.Util.pagePosition failed: element with id ${elemId} may be misplaced.",end:"",filterEvaluateNotImplemented:"evaluate is not implemented for this filter type."};OpenLayers.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup,{relativePosition:null,anchor:null,initialize:function(m,e,l,d,b,h,g){var a=[m,e,l,d,h,g];OpenLayers.Popup.prototype.initialize.apply(this,a);this.anchor=(b!=null)?b:{size:new OpenLayers.Size(0,0),offset:new OpenLayers.Pixel(0,0)}},destroy:function(){this.anchor=null;this.relativePosition=null;OpenLayers.Popup.prototype.destroy.apply(this,arguments)},show:function(){this.updatePosition();OpenLayers.Popup.prototype.show.apply(this,arguments)},moveTo:function(d){var b=this.relativePosition;this.relativePosition=this.calculateRelativePosition(d);var e=this.calculateNewPx(d);var a=new Array(e);OpenLayers.Popup.prototype.moveTo.apply(this,a);if(this.relativePosition!=b){this.updateRelativePosition()}},setSize:function(b){OpenLayers.Popup.prototype.setSize.apply(this,arguments);if((this.lonlat)&&(this.map)){var a=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(a)}},calculateRelativePosition:function(b){var e=this.map.getLonLatFromLayerPx(b);var d=this.map.getExtent();var a=d.determineQuadrant(e);return OpenLayers.Bounds.oppositeQuadrant(a)},updateRelativePosition:function(){},calculateNewPx:function(b){var g=b.offset(this.anchor.offset);var a=this.size||this.contentSize;var e=(this.relativePosition.charAt(0)=="t");g.y+=(e)?-a.h:this.anchor.size.h;var d=(this.relativePosition.charAt(1)=="l");g.x+=(d)?-a.w:this.anchor.size.w;return g},CLASS_NAME:"OpenLayers.Popup.Anchored"});OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,initialize:function(b,a){OpenLayers.Util.extend(this,a);this.projCode=b;if(window.Proj4js){this.proj=new Proj4js.Proj(b)}},getCode:function(){return this.proj?this.proj.srsCode:this.projCode},getUnits:function(){return this.proj?this.proj.units:null},toString:function(){return this.getCode()},equals:function(a){if(a&&a.getCode){return this.getCode()==a.getCode()}else{return false}},destroy:function(){delete this.proj;delete this.projCode},CLASS_NAME:"OpenLayers.Projection"});OpenLayers.Projection.transforms={};OpenLayers.Projection.addTransform=function(d,b,a){if(!OpenLayers.Projection.transforms[d]){OpenLayers.Projection.transforms[d]={}}OpenLayers.Projection.transforms[d][b]=a};OpenLayers.Projection.transform=function(a,d,b){if(d.proj&&b.proj){a=Proj4js.transform(d.proj,b.proj,a)}else{if(d&&b&&OpenLayers.Projection.transforms[d.getCode()]&&OpenLayers.Projection.transforms[d.getCode()][b.getCode()]){OpenLayers.Projection.transforms[d.getCode()][b.getCode()](a)}}return a};OpenLayers.ElementsIndexer=OpenLayers.Class({maxZIndex:null,order:null,indices:null,compare:null,initialize:function(a){this.compare=a?OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER;this.order=[];this.indices={};this.maxZIndex=0},insert:function(e){if(this.exists(e)){this.remove(e)}var l=e.id;this.determineZIndex(e);var g=-1;var h=this.order.length;var b;while(h-g>1){b=parseInt((g+h)/2);var d=this.compare(this,e,OpenLayers.Util.getElement(this.order[b]));if(d>0){g=b}else{h=b}}this.order.splice(h,0,l);this.indices[l]=this.getZIndex(e);var a=h+1;return a<this.order.length?OpenLayers.Util.getElement(this.order[a]):null},remove:function(b){var e=b.id;var a=OpenLayers.Util.indexOf(this.order,e);if(a>=0){this.order.splice(a,1);delete this.indices[e];if(this.order.length>0){var d=this.order[this.order.length-1];this.maxZIndex=this.indices[d]}else{this.maxZIndex=0}}},clear:function(){this.order=[];this.indices={};this.maxZIndex=0},exists:function(a){return(this.indices[a.id]!=null)},getZIndex:function(a){return a._style.graphicZIndex},determineZIndex:function(a){var b=a._style.graphicZIndex;if(b==null){b=this.maxZIndex;a._style.graphicZIndex=b}else{if(b>this.maxZIndex){this.maxZIndex=b}}},CLASS_NAME:"OpenLayers.ElementsIndexer"});OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(g,e,b){var a=g.getZIndex(e);var h=0;if(b){var d=g.getZIndex(b);h=a-d}return h},Z_ORDER_DRAWING_ORDER:function(d,b,a){var e=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(d,b,a);if(a&&e==0){e=1}return e},Z_ORDER_Y_ORDER:function(h,g,b){var l=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(h,g,b);if(b&&l==0){var d=g._geometry.getBounds().bottom;var e=b._geometry.getBounds().bottom;var a=e-d;l=(a==0)?1:a}return l}};OpenLayers.Renderer.Elements=OpenLayers.Class(OpenLayers.Renderer,{rendererRoot:null,root:null,xmlns:null,indexer:null,BACKGROUND_ID_SUFFIX:"_background",minimumSymbolizer:{strokeLinecap:"round",strokeOpacity:1,strokeDashstyle:"solid",fillOpacity:1,pointRadius:0},initialize:function(a,b){OpenLayers.Renderer.prototype.initialize.apply(this,arguments);this.rendererRoot=this.createRenderRoot();this.root=this.createRoot();this.rendererRoot.appendChild(this.root);this.container.appendChild(this.rendererRoot);if(b&&(b.zIndexing||b.yOrdering)){this.indexer=new OpenLayers.ElementsIndexer(b.yOrdering)}},destroy:function(){this.clear();this.rendererRoot=null;this.root=null;this.xmlns=null;OpenLayers.Renderer.prototype.destroy.apply(this,arguments)},clear:function(){if(this.root){while(this.root.childNodes.length>0){this.root.removeChild(this.root.firstChild)}}if(this.indexer){this.indexer.clear()}},getNodeType:function(b,a){},drawGeometry:function(l,e,h){var d=l.CLASS_NAME;var m=true;if((d=="OpenLayers.Geometry.Collection")||(d=="OpenLayers.Geometry.MultiPoint")||(d=="OpenLayers.Geometry.MultiLineString")||(d=="OpenLayers.Geometry.MultiPolygon")){for(var b=0,a=l.components.length;b<a;b++){m=this.drawGeometry(l.components[b],e,h)&&m}return m}m=false;if(e.display!="none"){if(e.backgroundGraphic){this.redrawBackgroundNode(l.id,l,e,h)}m=this.redrawNode(l.id,l,e,h)}if(m==false){var g=document.getElementById(l.id);if(g){if(g._style.backgroundGraphic){g.parentNode.removeChild(document.getElementById(l.id+this.BACKGROUND_ID_SUFFIX))}g.parentNode.removeChild(g)}}return m},redrawNode:function(l,h,b,g){var d=this.nodeFactory(l,this.getNodeType(h,b));d._featureId=g;d._geometry=h;d._geometryClass=h.CLASS_NAME;d._style=b;var a=this.drawGeometryNode(d,h,b);if(a===false){return false}d=a.node;var e=this.indexer?this.indexer.insert(d):null;if(e){this.root.insertBefore(d,e)}else{this.root.appendChild(d)}this.postDraw(d);return a.complete},redrawBackgroundNode:function(g,e,b,d){var a=OpenLayers.Util.extend({},b);a.externalGraphic=a.backgroundGraphic;a.graphicXOffset=a.backgroundXOffset;a.graphicYOffset=a.backgroundYOffset;a.graphicZIndex=a.backgroundGraphicZIndex;a.backgroundGraphic=null;a.backgroundXOffset=null;a.backgroundYOffset=null;a.backgroundGraphicZIndex=null;return this.redrawNode(g+this.BACKGROUND_ID_SUFFIX,e,a,null)},drawGeometryNode:function(d,g,b){b=b||d._style;OpenLayers.Util.applyDefaults(b,this.minimumSymbolizer);var a={isFilled:true,isStroked:!!b.strokeWidth};var e;switch(g.CLASS_NAME){case"OpenLayers.Geometry.Point":e=this.drawPoint(d,g);break;case"OpenLayers.Geometry.LineString":a.isFilled=false;e=this.drawLineString(d,g);break;case"OpenLayers.Geometry.LinearRing":e=this.drawLinearRing(d,g);break;case"OpenLayers.Geometry.Polygon":e=this.drawPolygon(d,g);break;case"OpenLayers.Geometry.Surface":e=this.drawSurface(d,g);break;case"OpenLayers.Geometry.Rectangle":e=this.drawRectangle(d,g);break;default:break}d._style=b;d._options=a;if(e!=false){return{node:this.setStyle(d,b,a,g),complete:e}}else{return false}},postDraw:function(a){},drawPoint:function(a,b){},drawLineString:function(a,b){},drawLinearRing:function(a,b){},drawPolygon:function(a,b){},drawRectangle:function(a,b){},drawCircle:function(a,b){},drawSurface:function(a,b){},getFeatureIdFromEvent:function(a){var e=a.target;var b=e&&e.correspondingUseElement;var d=b?b:(e||a.srcElement);var g=d._featureId;return g},eraseGeometry:function(h){if((h.CLASS_NAME=="OpenLayers.Geometry.MultiPoint")||(h.CLASS_NAME=="OpenLayers.Geometry.MultiLineString")||(h.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon")||(h.CLASS_NAME=="OpenLayers.Geometry.Collection")){for(var e=0,a=h.components.length;e<a;e++){this.eraseGeometry(h.components[e])}}else{var d=OpenLayers.Util.getElement(h.id);if(d&&d.parentNode){if(d.geometry){d.geometry.destroy();d.geometry=null}d.parentNode.removeChild(d);if(this.indexer){this.indexer.remove(d)}if(d._style.backgroundGraphic){var b=h.id+this.BACKGROUND_ID_SUFFIX;var g=OpenLayers.Util.getElement(b);if(g&&g.parentNode){g.parentNode.removeChild(g)}}}}},nodeFactory:function(d,a){var b=OpenLayers.Util.getElement(d);if(b){if(!this.nodeTypeCompare(b,a)){b.parentNode.removeChild(b);b=this.nodeFactory(d,a)}}else{b=this.createNode(a,d)}return b},nodeTypeCompare:function(b,a){},createNode:function(a,b){},isComplexSymbol:function(a){return(a!="circle")&&!!a},CLASS_NAME:"OpenLayers.Renderer.Elements"});OpenLayers.Renderer.symbol={star:[350,75,379,161,469,161,397,215,423,301,350,250,277,301,303,215,231,161,321,161,350,75],cross:[4,0,6,0,6,4,10,4,10,6,6,6,6,10,4,10,4,6,0,6,0,4,4,4,4,0],x:[0,0,25,0,50,35,75,0,100,0,65,50,100,100,75,100,50,65,25,100,0,100,35,50,0,0],square:[0,0,0,1,1,1,1,0,0,0],triangle:[0,10,10,10,5,0,0,10]};(function(){var e=window.XMLHttpRequest;var m=!!window.controllers,g=window.document.all&&!window.opera;function d(){this._object=e?new e:new window.ActiveXObject("Microsoft.XMLHTTP")}if(m&&e.wrapped){d.wrapped=e.wrapped}d.UNSENT=0;d.OPENED=1;d.HEADERS_RECEIVED=2;d.LOADING=3;d.DONE=4;d.prototype.readyState=d.UNSENT;d.prototype.responseText="";d.prototype.responseXML=null;d.prototype.status=0;d.prototype.statusText="";d.prototype.onreadystatechange=null;d.onreadystatechange=null;d.onopen=null;d.onsend=null;d.onabort=null;d.prototype.open=function(r,u,q,v,p){this._async=q;var t=this,s=this.readyState;if(g){var o=function(){if(t._object.readyState!=d.DONE){a(t)}};if(q){window.attachEvent("onunload",o)}}this._object.onreadystatechange=function(){if(m&&!q){return}t.readyState=t._object.readyState;l(t);if(t._aborted){t.readyState=d.UNSENT;return}if(t.readyState==d.DONE){a(t);if(g&&q){window.detachEvent("onunload",o)}}if(s!=t.readyState){h(t)}s=t.readyState};if(d.onopen){d.onopen.apply(this,arguments)}this._object.open(r,u,q,v,p);if(!q&&m){this.readyState=d.OPENED;h(this)}};d.prototype.send=function(o){if(d.onsend){d.onsend.apply(this,arguments)}if(o&&o.nodeType){o=window.XMLSerializer?new window.XMLSerializer().serializeToString(o):o.xml;if(!this._headers["Content-Type"]){this._object.setRequestHeader("Content-Type","application/xml")}}this._object.send(o);if(m&&!this._async){this.readyState=d.OPENED;l(this);while(this.readyState<d.DONE){this.readyState++;h(this);if(this._aborted){return}}}};d.prototype.abort=function(){if(d.onabort){d.onabort.apply(this,arguments)}if(this.readyState>d.UNSENT){this._aborted=true}this._object.abort();a(this)};d.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};d.prototype.getResponseHeader=function(o){return this._object.getResponseHeader(o)};d.prototype.setRequestHeader=function(o,p){if(!this._headers){this._headers={}}this._headers[o]=p;return this._object.setRequestHeader(o,p)};d.prototype.toString=function(){return"[object XMLHttpRequest]"};d.toString=function(){return"[XMLHttpRequest]"};function h(o){if(o.onreadystatechange){o.onreadystatechange.apply(o)}if(d.onreadystatechange){d.onreadystatechange.apply(o)}}function b(p){var o=p.responseXML;if(g&&o&&!o.documentElement&&p.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)){o=new ActiveXObject("Microsoft.XMLDOM");o.loadXML(p.responseText)}if(o){if((g&&o.parseError!=0)||(o.documentElement&&o.documentElement.tagName=="parsererror")){return null}}return o}function l(o){try{o.responseText=o._object.responseText}catch(p){}try{o.responseXML=b(o._object)}catch(p){}try{o.status=o._object.status}catch(p){}try{o.statusText=o._object.statusText}catch(p){}}function a(o){o._object.onreadystatechange=new window.Function;delete o._headers}if(!window.Function.prototype.apply){window.Function.prototype.apply=function(o,p){if(!p){p=[]}o.__func=this;o.__func(p[0],p[1],p[2],p[3],p[4]);delete o.__func}}OpenLayers.Request.XMLHttpRequest=d})();OpenLayers.Tile=OpenLayers.Class({EVENT_TYPES:["loadstart","loadend","reload","unload"],events:null,id:null,layer:null,url:null,bounds:null,size:null,position:null,isLoading:false,initialize:function(e,a,g,b,d){this.layer=e;this.position=a.clone();this.bounds=g.clone();this.url=b;this.size=d.clone();this.id=OpenLayers.Util.createUniqueID("Tile_");this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES)},unload:function(){if(this.isLoading){this.isLoading=false;this.events.triggerEvent("unload")}},destroy:function(){this.layer=null;this.bounds=null;this.size=null;this.position=null;this.events.destroy();this.events=null},clone:function(a){if(a==null){a=new OpenLayers.Tile(this.layer,this.position,this.bounds,this.url,this.size)}OpenLayers.Util.applyDefaults(a,this);return a},draw:function(){var a=this.layer.maxExtent;var b=(a&&this.bounds.intersectsBounds(a,false));this.shouldDraw=(b||this.layer.displayOutsideMaxExtent);this.clear();return this.shouldDraw},moveTo:function(b,a,d){if(d==null){d=true}this.bounds=b.clone();this.position=a.clone();if(d){this.draw()}},clear:function(){},getBoundsFromBaseLayer:function(a){var h=OpenLayers.i18n("reprojectDeprecated",{layerName:this.layer.name});OpenLayers.Console.warn(h);var e=this.layer.map.getLonLatFromLayerPx(a);var d=a.clone();d.x+=this.size.w;d.y+=this.size.h;var b=this.layer.map.getLonLatFromLayerPx(d);if(e.lon>b.lon){if(e.lon<0){e.lon=-180-(e.lon+180)}else{b.lon=180+b.lon+180}}var g=new OpenLayers.Bounds(e.lon,b.lat,b.lon,e.lat);return g},showTile:function(){if(this.shouldDraw){this.show()}},show:function(){},hide:function(){},CLASS_NAME:"OpenLayers.Tile"});mapfish.Searcher.Form=OpenLayers.Class(mapfish.Searcher,{protocol:null,form:null,response:null,initialize:function(a){mapfish.Searcher.prototype.initialize.call(this,a);OpenLayers.Util.extend(this,a);if(!this.form){OpenLayers.Console.error("no form set");return}if(!this.protocol){OpenLayers.Console.error("no protocol set");return}},triggerSearch:function(){this.protocol.abort(this.response);this.response=this.protocol.read({filter:this.getFilter(),searcher:this})},getFilter:function(){var l;var g={};var a=this.form;var q=a.getElementsByTagName("input");for(l=0;l<q.length;l++){o=q.item(l);if(o.disabled==true){continue}var b=o.getAttribute("type");if(b=="radio"||b=="checkbox"){if(o.checked){g=OpenLayers.Util.extend(g,this.getParamsFromInput(o))}}else{if(b=="submit"||b=="button"||b=="image"){}else{g=OpenLayers.Util.extend(g,this.getParamsFromInput(o))}}}var p=a.getElementsByTagName("select");for(l=0;l<p.length;l++){var o=p.item(l);var m=o.getAttribute("name");var r=o.getElementsByTagName("option");for(var h=0;h<r.length;h++){o=r.item(h);if(o.selected){var e=o.getAttribute("value");if(e==null){e=""}var d={};d[m]=e;g=OpenLayers.Util.extend(g,d)}}}return OpenLayers.Util.extend(this.params,g)},getParamsFromInput:function(e){var g;var b=e.getAttribute("type");var d=e.getAttribute("name");if(b=="text"){g=e.value}else{g=e.getAttribute("value")}var a=new Object();if(g!=null){a[d]=g}else{a[d]=null}return a},CLASS_NAME:"mapfish.Searcher.Form"});OpenLayers.ProxyHost="";OpenLayers.nullHandler=function(a){OpenLayers.Console.userError(OpenLayers.i18n("unhandledRequest",{statusText:a.statusText}))};OpenLayers.loadURL=function(e,l,b,g,d){if(typeof l=="string"){l=OpenLayers.Util.getParameters(l)}var h=(g)?g:OpenLayers.nullHandler;var a=(d)?d:OpenLayers.nullHandler;return OpenLayers.Request.GET({url:e,params:l,success:h,failure:a,scope:b})};OpenLayers.parseXMLString=function(d){var a=d.indexOf("<");if(a>0){d=d.substring(a)}var b=OpenLayers.Util.Try(function(){var e=new ActiveXObject("Microsoft.XMLDOM");e.loadXML(d);return e},function(){return new DOMParser().parseFromString(d,"text/xml")},function(){var e=new XMLHttpRequest();e.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(d),false);if(e.overrideMimeType){e.overrideMimeType("text/xml")}e.send(null);return e.responseXML});return b};OpenLayers.Ajax={emptyFunction:function(){},getTransport:function(){return OpenLayers.Util.Try(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};OpenLayers.Ajax.Responders={responders:[],register:function(b){for(var a=0;a<this.responders.length;a++){if(b==this.responders[a]){return}}this.responders.push(b)},unregister:function(a){OpenLayers.Util.removeItem(this.reponders,a)},dispatch:function(l,d,h){var a;for(var b=0;b<this.responders.length;b++){a=this.responders[b];if(a[l]&&typeof a[l]=="function"){try{a[l].apply(a,[d,h])}catch(g){}}}}};OpenLayers.Ajax.Responders.register({onCreate:function(){OpenLayers.Ajax.activeRequestCount++},onComplete:function(){OpenLayers.Ajax.activeRequestCount--}});OpenLayers.Ajax.Base=OpenLayers.Class({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/xml",parameters:""};OpenLayers.Util.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(typeof this.options.parameters=="string"){this.options.parameters=OpenLayers.Util.getParameters(this.options.parameters)}}});OpenLayers.Ajax.Request=OpenLayers.Class(OpenLayers.Ajax.Base,{_complete:false,initialize:function(b,a){OpenLayers.Ajax.Base.prototype.initialize.apply(this,[a]);if(OpenLayers.ProxyHost&&OpenLayers.String.startsWith(b,"http")){b=OpenLayers.ProxyHost+encodeURIComponent(b)}this.transport=OpenLayers.Ajax.getTransport();this.request(b)},request:function(b){this.url=b;this.method=this.options.method;var g=OpenLayers.Util.extend({},this.options.parameters);if(this.method!="get"&&this.method!="post"){g._method=this.method;this.method="post"}this.parameters=g;if(g=OpenLayers.Util.getParameterString(g)){if(this.method=="get"){this.url+=((this.url.indexOf("?")>-1)?"&":"?")+g}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){g+="&_="}}}try{var a=new OpenLayers.Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(a)}OpenLayers.Ajax.Responders.dispatch("onCreate",this,a);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){window.setTimeout(OpenLayers.Function.bind(this.respondToReadyState,this,1),10)}this.transport.onreadystatechange=OpenLayers.Function.bind(this.onStateChange,this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||g):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(d){this.dispatchException(d)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var g={"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*",OpenLayers:true};if(this.method=="post"){g["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){g.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var d=this.options.requestHeaders;if(typeof d.push=="function"){for(var b=0,e=d.length;b<e;b+=2){g[d[b]]=d[b+1]}}else{for(var b in d){g[b]=d[b]}}}for(var a in g){this.transport.setRequestHeader(a,g[a])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var d=OpenLayers.Ajax.Request.Events[a];var b=new OpenLayers.Ajax.Response(this);if(d=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||OpenLayers.Ajax.emptyFunction)(b)}catch(g){this.dispatchException(g)}var h=b.getHeader("Content-type")}try{(this.options["on"+d]||OpenLayers.Ajax.emptyFunction)(b);OpenLayers.Ajax.Responders.dispatch("on"+d,this,b)}catch(g){this.dispatchException(g)}if(d=="Complete"){this.transport.onreadystatechange=OpenLayers.Ajax.emptyFunction}},getHeader:function(a){try{return this.transport.getResponseHeader(a)}catch(b){return null}},dispatchException:function(d){var e=this.options.onException;if(e){e(this,d);OpenLayers.Ajax.Responders.dispatch("onException",this,d)}else{var g=false;var a=OpenLayers.Ajax.Responders.responders;for(var b=0;b<a.length;b++){if(a[b].onException){g=true;break}}if(g){OpenLayers.Ajax.Responders.dispatch("onException",this,d)}else{throw d}}}});OpenLayers.Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];OpenLayers.Ajax.Response=OpenLayers.Class({status:0,statusText:"",initialize:function(d){this.request=d;var e=this.transport=d.transport,a=this.readyState=e.readyState;if((a>2&&!(!!(window.attachEvent&&!window.opera)))||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=e.responseText==null?"":String(e.responseText)}if(a==4){var b=e.responseXML;this.responseXML=b===undefined?null:b}},getStatus:OpenLayers.Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:OpenLayers.Ajax.Request.prototype.getHeader,getResponseHeader:function(a){return this.transport.getResponseHeader(a)}});OpenLayers.Ajax.getElementsByTagNameNS=function(b,a,d,g){var e=null;if(b.getElementsByTagNameNS){e=b.getElementsByTagNameNS(a,g)}else{e=b.getElementsByTagName(d+":"+g)}return e};OpenLayers.Ajax.serializeXMLToString=function(a){var b=new XMLSerializer();var d=b.serializeToString(a);return d};OpenLayers.Control.PanZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoom,{zoomStopWidth:18,zoomStopHeight:11,slider:null,sliderEvents:null,zoomBarDiv:null,divEvents:null,zoomWorldIcon:false,initialize:function(){OpenLayers.Control.PanZoom.prototype.initialize.apply(this,arguments)},destroy:function(){this.div.removeChild(this.slider);this.slider=null;this.sliderEvents.destroy();this.sliderEvents=null;this.div.removeChild(this.zoombarDiv);this.zoomBarDiv=null;this.divEvents.destroy();this.divEvents=null;this.map.events.un({zoomend:this.moveZoomBar,changebaselayer:this.redraw,scope:this});OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments)},setMap:function(a){OpenLayers.Control.PanZoom.prototype.setMap.apply(this,arguments);this.map.events.register("changebaselayer",this,this.redraw)},redraw:function(){if(this.div!=null){this.div.innerHTML=""}this.draw()},draw:function(b){OpenLayers.Control.prototype.draw.apply(this,arguments);b=this.position.clone();this.buttons=[];var e=new OpenLayers.Size(18,18);var a=new OpenLayers.Pixel(b.x+e.w/2,b.y);var d=e.w;if(this.zoomWorldIcon){a=new OpenLayers.Pixel(b.x+e.w,b.y)}this._addButton("panup","north-mini.png",a,e);b.y=a.y+e.h;this._addButton("panleft","west-mini.png",b,e);if(this.zoomWorldIcon){this._addButton("zoomworld","zoom-world-mini.png",b.add(e.w,0),e);d*=2}this._addButton("panright","east-mini.png",b.add(d,0),e);this._addButton("pandown","south-mini.png",a.add(0,e.h*2),e);this._addButton("zoomin","zoom-plus-mini.png",a.add(0,e.h*3+5),e);a=this._addZoomBar(a.add(0,e.h*4+5));this._addButton("zoomout","zoom-minus-mini.png",a,e);return this.div},_addZoomBar:function(a){var g=OpenLayers.Util.getImagesLocation();var l=this.id+"_"+this.map.id;var b=this.map.getNumZoomLevels()-1-this.map.getZoom();var d=OpenLayers.Util.createAlphaImageDiv(l,a.add(-1,b*this.zoomStopHeight),new OpenLayers.Size(20,9),g+"slider.png","absolute");this.slider=d;this.sliderEvents=new OpenLayers.Events(this,d,null,true,{includeXY:true});this.sliderEvents.on({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});var e=new OpenLayers.Size();e.h=this.zoomStopHeight*this.map.getNumZoomLevels();e.w=this.zoomStopWidth;var h=null;if(OpenLayers.Util.alphaHack()){var l=this.id+"_"+this.map.id;h=OpenLayers.Util.createAlphaImageDiv(l,a,new OpenLayers.Size(e.w,this.zoomStopHeight),g+"zoombar.png","absolute",null,"crop");h.style.height=e.h+"px"}else{h=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,a,e,g+"zoombar.png")}this.zoombarDiv=h;this.divEvents=new OpenLayers.Events(this,h,null,true,{includeXY:true});this.divEvents.on({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick});this.div.appendChild(h);this.startTop=parseInt(h.style.top);this.div.appendChild(d);this.map.events.register("zoomend",this,this.moveZoomBar);a=a.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());return a},passEventToSlider:function(a){this.sliderEvents.handleBrowserEvent(a)},divClick:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}var g=a.xy.y;var e=OpenLayers.Util.pagePosition(a.object)[1];var d=(g-e)/this.zoomStopHeight;if(!this.map.fractionalZoom){d=Math.floor(d)}var b=(this.map.getNumZoomLevels()-1)-d;b=Math.min(Math.max(b,0),this.map.getNumZoomLevels()-1);this.map.zoomTo(b);OpenLayers.Event.stop(a)},zoomBarDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}this.map.events.on({mousemove:this.passEventToSlider,mouseup:this.passEventToSlider,scope:this});this.mouseDragStart=a.xy.clone();this.zoomStart=a.xy.clone();this.div.style.cursor="move";this.zoombarDiv.offsets=null;OpenLayers.Event.stop(a)},zoomBarDrag:function(b){if(this.mouseDragStart!=null){var a=this.mouseDragStart.y-b.xy.y;var e=OpenLayers.Util.pagePosition(this.zoombarDiv);if((b.clientY-e[1])>0&&(b.clientY-e[1])<parseInt(this.zoombarDiv.style.height)-2){var d=parseInt(this.slider.style.top)-a;this.slider.style.top=d+"px";this.mouseDragStart=b.xy.clone()}OpenLayers.Event.stop(b)}},zoomBarUp:function(b){if(!OpenLayers.Event.isLeftClick(b)){return}if(this.zoomStart){this.div.style.cursor="";this.map.events.un({mouseup:this.passEventToSlider,mousemove:this.passEventToSlider,scope:this});var a=this.zoomStart.y-b.xy.y;var d=this.map.zoom;if(this.map.fractionalZoom){d+=a/this.zoomStopHeight;d=Math.min(Math.max(d,0),this.map.getNumZoomLevels()-1)}else{d+=Math.round(a/this.zoomStopHeight)}this.map.zoomTo(d);this.moveZoomBar();this.mouseDragStart=null;OpenLayers.Event.stop(b)}},moveZoomBar:function(){var a=((this.map.getNumZoomLevels()-1)-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;this.slider.style.top=a+"px"},CLASS_NAME:"OpenLayers.Control.PanZoomBar"});OpenLayers.Format.JSON=OpenLayers.Class(OpenLayers.Format,{indent:"    ",space:" ",newline:"\n",level:0,pretty:false,initialize:function(a){OpenLayers.Format.prototype.initialize.apply(this,[a])},read:function(json,filter){try{if(/^[\],:{}\s]*$/.test(json.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){var object=eval("("+json+")");if(typeof filter==="function"){function walk(k,v){if(v&&typeof v==="object"){for(var i in v){if(v.hasOwnProperty(i)){v[i]=walk(i,v[i])}}}return filter(k,v)}object=walk("",object)}return object}}catch(e){}return null},write:function(e,d){this.pretty=!!d;var a=null;var b=typeof e;if(this.serialize[b]){a=this.serialize[b].apply(this,[e])}return a},writeIndent:function(){var b=[];if(this.pretty){for(var a=0;a<this.level;++a){b.push(this.indent)}}return b.join("")},writeNewline:function(){return(this.pretty)?this.newline:""},writeSpace:function(){return(this.pretty)?this.space:""},serialize:{object:function(d){if(d==null){return"null"}if(d.constructor==Date){return this.serialize.date.apply(this,[d])}if(d.constructor==Array){return this.serialize.array.apply(this,[d])}var h=["{"];this.level+=1;var e,b,g;var a=false;for(e in d){if(d.hasOwnProperty(e)){b=OpenLayers.Format.JSON.prototype.write.apply(this,[e,this.pretty]);g=OpenLayers.Format.JSON.prototype.write.apply(this,[d[e],this.pretty]);if(b!=null&&g!=null){if(a){h.push(",")}h.push(this.writeNewline(),this.writeIndent(),b,":",this.writeSpace(),g);a=true}}}this.level-=1;h.push(this.writeNewline(),this.writeIndent(),"}");return h.join("")},array:function(g){var d;var e=["["];this.level+=1;for(var b=0,a=g.length;b<a;++b){d=OpenLayers.Format.JSON.prototype.write.apply(this,[g[b],this.pretty]);if(d!=null){if(b>0){e.push(",")}e.push(this.writeNewline(),this.writeIndent(),d)}}this.level-=1;e.push(this.writeNewline(),this.writeIndent(),"]");return e.join("")},string:function(b){var a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};if(/["\\\x00-\x1f]/.test(b)){return'"'+b.replace(/([\x00-\x1f\\"])/g,function(e,d){var g=a[d];if(g){return g}g=d.charCodeAt();return"\\u00"+Math.floor(g/16).toString(16)+(g%16).toString(16)})+'"'}return'"'+b+'"'},number:function(a){return isFinite(a)?String(a):"null"},"boolean":function(a){return String(a)},date:function(a){function b(d){return(d<10)?"0"+d:d}return'"'+a.getFullYear()+"-"+b(a.getMonth()+1)+"-"+b(a.getDate())+"T"+b(a.getHours())+":"+b(a.getMinutes())+":"+b(a.getSeconds())+'"'}},CLASS_NAME:"OpenLayers.Format.JSON"});OpenLayers.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:false,evt:null,initialize:function(d,b,a){OpenLayers.Util.extend(this,a);this.control=d;this.callbacks=b;if(d.map){this.setMap(d.map)}OpenLayers.Util.extend(this,a);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},setMap:function(a){this.map=a},checkModifiers:function(a){if(this.keyMask==null){return true}var b=(a.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(a.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(a.altKey?OpenLayers.Handler.MOD_ALT:0);return(b==this.keyMask)},activate:function(){if(this.active){return false}var d=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var b=0,a=d.length;b<a;b++){if(this[d[b]]){this.register(d[b],this[d[b]])}}this.active=true;return true},deactivate:function(){if(!this.active){return false}var d=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var b=0,a=d.length;b<a;b++){if(this[d[b]]){this.unregister(d[b],this[d[b]])}}this.active=false;return true},callback:function(b,a){if(b&&this.callbacks[b]){this.callbacks[b].apply(this.control,a)}},register:function(a,b){this.map.events.registerPriority(a,this,b);this.map.events.registerPriority(a,this,this.setEvent)},unregister:function(a,b){this.map.events.unregister(a,this,b);this.map.events.unregister(a,this,this.setEvent)},setEvent:function(a){this.evt=a;return true},destroy:function(){this.deactivate();this.control=this.map=null},CLASS_NAME:"OpenLayers.Handler"});OpenLayers.Handler.MOD_NONE=0;OpenLayers.Handler.MOD_SHIFT=1;OpenLayers.Handler.MOD_CTRL=2;OpenLayers.Handler.MOD_ALT=4;OpenLayers.Map=OpenLayers.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Feature:725,Popup:750,Control:1000},EVENT_TYPES:["preaddlayer","addlayer","removelayer","changelayer","movestart","move","moveend","zoomend","popupopen","popupclose","addmarker","removemarker","clearmarkers","mouseover","mouseout","mousemove","dragstart","drag","dragend","changebaselayer"],id:null,fractionalZoom:false,events:null,div:null,dragging:false,size:null,viewPortDiv:null,layerContainerOrigin:null,layerContainerDiv:null,layers:null,controls:null,popups:null,baseLayer:null,center:null,resolution:null,zoom:0,panRatio:1.5,viewRequestID:0,tileSize:null,projection:"EPSG:4326",units:"degrees",resolutions:null,maxResolution:1.40625,minResolution:null,maxScale:null,minScale:null,maxExtent:null,minExtent:null,restrictedExtent:null,numZoomLevels:16,theme:null,displayProjection:null,fallThrough:true,panTween:null,eventListeners:null,panMethod:OpenLayers.Easing.Expo.easeOut,paddingForPopups:null,initialize:function(m,e){this.tileSize=new OpenLayers.Size(OpenLayers.Map.TILE_WIDTH,OpenLayers.Map.TILE_HEIGHT);this.maxExtent=new OpenLayers.Bounds(-180,-90,180,90);this.paddingForPopups=new OpenLayers.Bounds(15,15,15,15);this.theme=OpenLayers._getScriptLocation()+"theme/default/style.css";OpenLayers.Util.extend(this,e);this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");this.div=OpenLayers.Util.getElement(m);OpenLayers.Element.addClass(this.div,"olMap");var l=this.div.id+"_OpenLayers_ViewPort";this.viewPortDiv=OpenLayers.Util.createDiv(l,null,null,null,"relative",null,"hidden");this.viewPortDiv.style.width="100%";this.viewPortDiv.style.height="100%";this.viewPortDiv.className="olMapViewport";this.div.appendChild(this.viewPortDiv);l=this.div.id+"_OpenLayers_Container";this.layerContainerDiv=OpenLayers.Util.createDiv(l);this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE.Popup-1;this.viewPortDiv.appendChild(this.layerContainerDiv);this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES,this.fallThrough,{includeXY:true});this.updateSize();if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}this.events.register("movestart",this,this.updateSize);if(OpenLayers.String.contains(navigator.appName,"Microsoft")){this.events.register("resize",this,this.updateSize)}else{this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this);OpenLayers.Event.observe(window,"resize",this.updateSizeDestroy)}if(this.theme){var h=true;var d=document.getElementsByTagName("link");for(var g=0,a=d.length;g<a;++g){if(OpenLayers.Util.isEquivalentUrl(d.item(g).href,this.theme)){h=false;break}}if(h){var b=document.createElement("link");b.setAttribute("rel","stylesheet");b.setAttribute("type","text/css");b.setAttribute("href",this.theme);document.getElementsByTagName("head")[0].appendChild(b)}}this.layers=[];if(this.controls==null){if(OpenLayers.Control!=null){this.controls=[new OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoom(),new OpenLayers.Control.ArgParser(),new OpenLayers.Control.Attribution()]}else{this.controls=[]}}for(var g=0,a=this.controls.length;g<a;g++){this.addControlToMap(this.controls[g])}this.popups=[];this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);OpenLayers.Event.observe(window,"unload",this.unloadDestroy)},unloadDestroy:null,updateSizeDestroy:null,destroy:function(){if(!this.unloadDestroy){return false}OpenLayers.Event.stopObserving(window,"unload",this.unloadDestroy);this.unloadDestroy=null;if(this.updateSizeDestroy){OpenLayers.Event.stopObserving(window,"resize",this.updateSizeDestroy)}else{this.events.unregister("resize",this,this.updateSize)}this.paddingForPopups=null;if(this.controls!=null){for(var a=this.controls.length-1;a>=0;--a){this.controls[a].destroy()}this.controls=null}if(this.layers!=null){for(var a=this.layers.length-1;a>=0;--a){this.layers[a].destroy(false)}this.layers=null}if(this.viewPortDiv){this.div.removeChild(this.viewPortDiv)}this.viewPortDiv=null;if(this.eventListeners){this.events.un(this.eventListeners);this.eventListeners=null}this.events.destroy();this.events=null},setOptions:function(a){OpenLayers.Util.extend(this,a)},getTileSize:function(){return this.tileSize},getBy:function(g,d,a){var e=(typeof a.test=="function");var b=OpenLayers.Array.filter(this[g],function(h){return h[d]==a||(e&&a.test(h[d]))});return b},getLayersBy:function(b,a){return this.getBy("layers",b,a)},getLayersByName:function(a){return this.getLayersBy("name",a)},getLayersByClass:function(a){return this.getLayersBy("CLASS_NAME",a)},getControlsBy:function(b,a){return this.getBy("controls",b,a)},getControlsByClass:function(a){return this.getControlsBy("CLASS_NAME",a)},getLayer:function(g){var b=null;for(var e=0,a=this.layers.length;e<a;e++){var d=this.layers[e];if(d.id==g){b=d;break}}return b},setLayerZIndex:function(b,a){b.setZIndex(this.Z_INDEX_BASE[b.isBaseLayer?"BaseLayer":"Overlay"]+a*5)},resetLayersZIndex:function(){for(var d=0,a=this.layers.length;d<a;d++){var b=this.layers[d];this.setLayerZIndex(b,d)}},addLayer:function(d){for(var b=0,a=this.layers.length;b<a;b++){if(this.layers[b]==d){var e=OpenLayers.i18n("layerAlreadyAdded",{layerName:d.name});OpenLayers.Console.warn(e);return false}}this.events.triggerEvent("preaddlayer",{layer:d});d.div.className="olLayerDiv";d.div.style.overflow="";this.setLayerZIndex(d,this.layers.length);if(d.isFixed){this.viewPortDiv.appendChild(d.div)}else{this.layerContainerDiv.appendChild(d.div)}this.layers.push(d);d.setMap(this);if(d.isBaseLayer){if(this.baseLayer==null){this.setBaseLayer(d)}else{d.setVisibility(false)}}else{d.redraw()}this.events.triggerEvent("addlayer",{layer:d})},addLayers:function(d){for(var b=0,a=d.length;b<a;b++){this.addLayer(d[b])}},removeLayer:function(d,g){if(g==null){g=true}if(d.isFixed){this.viewPortDiv.removeChild(d.div)}else{this.layerContainerDiv.removeChild(d.div)}OpenLayers.Util.removeItem(this.layers,d);d.removeMap(this);d.map=null;if(this.baseLayer==d){this.baseLayer=null;if(g){for(var b=0,a=this.layers.length;b<a;b++){var e=this.layers[b];if(e.isBaseLayer){this.setBaseLayer(e);break}}}}this.resetLayersZIndex();this.events.triggerEvent("removelayer",{layer:d})},getNumLayers:function(){return this.layers.length},getLayerIndex:function(a){return OpenLayers.Util.indexOf(this.layers,a)},setLayerIndex:function(e,b){var g=this.getLayerIndex(e);if(b<0){b=0}else{if(b>this.layers.length){b=this.layers.length}}if(g!=b){this.layers.splice(g,1);this.layers.splice(b,0,e);for(var d=0,a=this.layers.length;d<a;d++){this.setLayerZIndex(this.layers[d],d)}this.events.triggerEvent("changelayer",{layer:e,property:"order"})}},raiseLayer:function(b,d){var a=this.getLayerIndex(b)+d;this.setLayerIndex(b,a)},setBaseLayer:function(g){var e=null;if(this.baseLayer){e=this.baseLayer.getExtent()}if(g!=this.baseLayer){if(OpenLayers.Util.indexOf(this.layers,g)!=-1){if(this.baseLayer!=null){this.baseLayer.setVisibility(false)}this.baseLayer=g;this.viewRequestID++;this.baseLayer.visibility=true;var a=this.getCenter();if(a!=null){var b=(e)?e.getCenterLonLat():a;var d=(e)?this.getZoomForExtent(e,true):this.getZoomForResolution(this.resolution,true);this.setCenter(b,d,false,true)}this.events.triggerEvent("changebaselayer",{layer:this.baseLayer})}}},addControl:function(b,a){this.controls.push(b);this.addControlToMap(b,a)},addControlToMap:function(b,a){b.outsideViewport=(b.div!=null);if(this.displayProjection&&!b.displayProjection){b.displayProjection=this.displayProjection}b.setMap(this);var d=b.draw(a);if(d){if(!b.outsideViewport){d.style.zIndex=this.Z_INDEX_BASE.Control+this.controls.length;this.viewPortDiv.appendChild(d)}}},getControl:function(g){var b=null;for(var d=0,a=this.controls.length;d<a;d++){var e=this.controls[d];if(e.id==g){b=e;break}}return b},removeControl:function(a){if((a)&&(a==this.getControl(a.id))){if(a.div&&(a.div.parentNode==this.viewPortDiv)){this.viewPortDiv.removeChild(a.div)}OpenLayers.Util.removeItem(this.controls,a)}},addPopup:function(a,e){if(e){for(var b=this.popups.length-1;b>=0;--b){this.removePopup(this.popups[b])}}a.map=this;this.popups.push(a);var d=a.draw();if(d){d.style.zIndex=this.Z_INDEX_BASE.Popup+this.popups.length;this.layerContainerDiv.appendChild(d)}},removePopup:function(a){OpenLayers.Util.removeItem(this.popups,a);if(a.div){try{this.layerContainerDiv.removeChild(a.div)}catch(b){}}a.map=null},getSize:function(){var a=null;if(this.size!=null){a=this.size.clone()}return a},updateSize:function(){this.events.clearMouseCache();var d=this.getCurrentSize();var h=this.getSize();if(h==null){this.size=h=d}if(!d.equals(h)){this.size=d;for(var e=0,b=this.layers.length;e<b;e++){this.layers[e].onMapResize()}if(this.baseLayer!=null){var a=new OpenLayers.Pixel(d.w/2,d.h/2);var l=this.getLonLatFromViewPortPx(a);var g=this.getZoom();this.zoom=null;this.setCenter(this.getCenter(),g)}}},getCurrentSize:function(){var a=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(a.w==0&&a.h==0||isNaN(a.w)&&isNaN(a.h)){var b=OpenLayers.Element.getDimensions(this.div);a.w=b.width;a.h=b.height}if(a.w==0&&a.h==0||isNaN(a.w)&&isNaN(a.h)){a.w=parseInt(this.div.style.width);a.h=parseInt(this.div.style.height)}return a},calculateBounds:function(a,b){var g=null;if(a==null){a=this.getCenter()}if(b==null){b=this.getResolution()}if((a!=null)&&(b!=null)){var e=this.getSize();var h=e.w*b;var d=e.h*b;g=new OpenLayers.Bounds(a.lon-h/2,a.lat-d/2,a.lon+h/2,a.lat+d/2)}return g},getCenter:function(){var a=null;if(this.center){a=this.center.clone()}return a},getZoom:function(){return this.zoom},pan:function(e,d,g){g=OpenLayers.Util.applyDefaults(g,{animate:true,dragging:false});var h=this.getViewPortPxFromLonLat(this.getCenter());var b=h.add(e,d);if(!g.dragging||!b.equals(h)){var a=this.getLonLatFromViewPortPx(b);if(g.animate){this.panTo(a)}else{this.setCenter(a,null,g.dragging)}}},panTo:function(b){if(this.panMethod&&this.getExtent().scale(this.panRatio).containsLonLat(b)){if(!this.panTween){this.panTween=new OpenLayers.Tween(this.panMethod)}var a=this.getCenter();if(b.lon==a.lon&&b.lat==a.lat){return}var e={lon:a.lon,lat:a.lat};var d={lon:b.lon,lat:b.lat};this.panTween.start(e,d,50,{callbacks:{start:OpenLayers.Function.bind(function(g){this.events.triggerEvent("movestart")},this),eachStep:OpenLayers.Function.bind(function(g){g=new OpenLayers.LonLat(g.lon,g.lat);this.moveTo(g,this.zoom,{dragging:true,noEvent:true})},this),done:OpenLayers.Function.bind(function(g){g=new OpenLayers.LonLat(g.lon,g.lat);this.moveTo(g,this.zoom,{noEvent:true});this.events.triggerEvent("moveend")},this)}})}else{this.setCenter(b)}},setCenter:function(d,a,b,e){this.moveTo(d,a,{dragging:b,forceZoomChange:e,caller:"setCenter"})},moveTo:function(l,s,v){if(!v){v={}}var r=v.dragging;var d=v.forceZoomChange;var m=v.noEvent;if(this.panTween&&v.caller=="setCenter"){this.panTween.stop()}if(!this.center&&!this.isValidLonLat(l)){l=this.maxExtent.getCenterLonLat()}if(this.restrictedExtent!=null){if(l==null){l=this.getCenter()}if(s==null){s=this.getZoom()}var e=this.getResolutionForZoom(s);var t=this.calculateBounds(l,e);if(!this.restrictedExtent.containsBounds(t)){var u=this.restrictedExtent.getCenterLonLat();if(t.getWidth()>this.restrictedExtent.getWidth()){l=new OpenLayers.LonLat(u.lon,l.lat)}else{if(t.left<this.restrictedExtent.left){l=l.add(this.restrictedExtent.left-t.left,0)}else{if(t.right>this.restrictedExtent.right){l=l.add(this.restrictedExtent.right-t.right,0)}}}if(t.getHeight()>this.restrictedExtent.getHeight()){l=new OpenLayers.LonLat(l.lon,u.lat)}else{if(t.bottom<this.restrictedExtent.bottom){l=l.add(0,this.restrictedExtent.bottom-t.bottom)}else{if(t.top>this.restrictedExtent.top){l=l.add(0,this.restrictedExtent.top-t.top)}}}}}var b=d||((this.isValidZoomLevel(s))&&(s!=this.getZoom()));var g=(this.isValidLonLat(l))&&(!l.equals(this.center));if(b||g||!r){if(!this.dragging&&!m){this.events.triggerEvent("movestart")}if(g){if((!b)&&(this.center)){this.centerLayerContainer(l)}this.center=l.clone()}if((b)||(this.layerContainerOrigin==null)){this.layerContainerOrigin=this.center.clone();this.layerContainerDiv.style.left="0px";this.layerContainerDiv.style.top="0px"}if(b){this.zoom=s;this.resolution=this.getResolutionForZoom(s);this.viewRequestID++}var a=this.getExtent();this.baseLayer.moveTo(a,b,r);if(r){this.baseLayer.events.triggerEvent("move")}else{this.baseLayer.events.triggerEvent("moveend",{zoomChanged:b})}a=this.baseLayer.getExtent();for(var h=0,p=this.layers.length;h<p;h++){var o=this.layers[h];if(!o.isBaseLayer){var q=o.calculateInRange();if(o.inRange!=q){o.inRange=q;if(!q){o.display(false)}this.events.triggerEvent("changelayer",{layer:o,property:"visibility"})}if(q&&o.visibility){o.moveTo(a,b,r);if(r){o.events.triggerEvent("move")}else{o.events.triggerEvent("moveend",{zoomChanged:b})}}}}if(b){for(var h=0,p=this.popups.length;h<p;h++){this.popups[h].updatePosition()}}this.events.triggerEvent("move");if(b){this.events.triggerEvent("zoomend")}}if(!r&&!m){this.events.triggerEvent("moveend")}this.dragging=!!r},centerLayerContainer:function(b){var a=this.getViewPortPxFromLonLat(this.layerContainerOrigin);var d=this.getViewPortPxFromLonLat(b);if((a!=null)&&(d!=null)){this.layerContainerDiv.style.left=Math.round(a.x-d.x)+"px";this.layerContainerDiv.style.top=Math.round(a.y-d.y)+"px"}},isValidZoomLevel:function(a){return((a!=null)&&(a>=0)&&(a<this.getNumZoomLevels()))},isValidLonLat:function(d){var b=false;if(d!=null){var a=this.getMaxExtent();b=a.containsLonLat(d)}return b},getProjection:function(){var a=this.getProjectionObject();return a?a.getCode():null},getProjectionObject:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.projection}return a},getMaxResolution:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.maxResolution}return a},getMaxExtent:function(b){var a=null;if(b&&b.restricted&&this.restrictedExtent){a=this.restrictedExtent}else{if(this.baseLayer!=null){a=this.baseLayer.maxExtent}}return a},getNumZoomLevels:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.numZoomLevels}return a},getExtent:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getExtent()}return a},getResolution:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getResolution()}return a},getUnits:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.units}return a},getScale:function(){var d=null;if(this.baseLayer!=null){var b=this.getResolution();var a=this.baseLayer.units;d=OpenLayers.Util.getScaleFromResolution(b,a)}return d},getZoomForExtent:function(d,b){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getZoomForExtent(d,b)}return a},getResolutionForZoom:function(b){var a=null;if(this.baseLayer){a=this.baseLayer.getResolutionForZoom(b)}return a},getZoomForResolution:function(a,d){var b=null;if(this.baseLayer!=null){b=this.baseLayer.getZoomForResolution(a,d)}return b},zoomTo:function(a){if(this.isValidZoomLevel(a)){this.setCenter(null,a)}},zoomIn:function(){this.zoomTo(this.getZoom()+1)},zoomOut:function(){this.zoomTo(this.getZoom()-1)},zoomToExtent:function(e,d){var b=e.getCenterLonLat();if(this.baseLayer.wrapDateLine){var a=this.getMaxExtent();e=e.clone();while(e.right<e.left){e.right+=a.getWidth()}b=e.getCenterLonLat().wrapDateLine(a)}this.setCenter(b,this.getZoomForExtent(e,d))},zoomToMaxExtent:function(d){var b=(d)?d.restricted:true;var a=this.getMaxExtent({restricted:b});this.zoomToExtent(a)},zoomToScale:function(m,l){var e=OpenLayers.Util.getResolutionFromScale(m,this.baseLayer.units);var d=this.getSize();var h=d.w*e;var b=d.h*e;var a=this.getCenter();var g=new OpenLayers.Bounds(a.lon-h/2,a.lat-b/2,a.lon+h/2,a.lat+b/2);this.zoomToExtent(g,l)},getLonLatFromViewPortPx:function(a){var b=null;if(this.baseLayer!=null){b=this.baseLayer.getLonLatFromViewPortPx(a)}return b},getViewPortPxFromLonLat:function(b){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getViewPortPxFromLonLat(b)}return a},getLonLatFromPixel:function(a){return this.getLonLatFromViewPortPx(a)},getPixelFromLonLat:function(b){var a=this.getViewPortPxFromLonLat(b);a.x=Math.round(a.x);a.y=Math.round(a.y);return a},getViewPortPxFromLayerPx:function(e){var d=null;if(e!=null){var b=parseInt(this.layerContainerDiv.style.left);var a=parseInt(this.layerContainerDiv.style.top);d=e.add(b,a)}return d},getLayerPxFromViewPortPx:function(d){var e=null;if(d!=null){var b=-parseInt(this.layerContainerDiv.style.left);var a=-parseInt(this.layerContainerDiv.style.top);e=d.add(b,a);if(isNaN(e.x)||isNaN(e.y)){e=null}}return e},getLonLatFromLayerPx:function(a){a=this.getViewPortPxFromLayerPx(a);return this.getLonLatFromViewPortPx(a)},getLayerPxFromLonLat:function(b){var a=this.getPixelFromLonLat(b);return this.getLayerPxFromViewPortPx(a)},CLASS_NAME:"OpenLayers.Map"});OpenLayers.Map.TILE_WIDTH=256;OpenLayers.Map.TILE_HEIGHT=256;OpenLayers.Marker=OpenLayers.Class({icon:null,lonlat:null,events:null,map:null,initialize:function(d,b){this.lonlat=d;var a=(b)?b:OpenLayers.Marker.defaultIcon();if(this.icon==null){this.icon=a}else{this.icon.url=a.url;this.icon.size=a.size;this.icon.offset=a.offset;this.icon.calculateOffset=a.calculateOffset}this.events=new OpenLayers.Events(this,this.icon.imageDiv,null)},destroy:function(){this.map=null;this.events.destroy();this.events=null;if(this.icon!=null){this.icon.destroy();this.icon=null}},draw:function(a){return this.icon.draw(a)},moveTo:function(a){if((a!=null)&&(this.icon!=null)){this.icon.moveTo(a)}this.lonlat=this.map.getLonLatFromLayerPx(a)},isDrawn:function(){var a=(this.icon&&this.icon.isDrawn());return a},onScreen:function(){var b=false;if(this.map){var a=this.map.getExtent();b=a.containsLonLat(this.lonlat)}return b},inflate:function(b){if(this.icon){var a=new OpenLayers.Size(this.icon.size.w*b,this.icon.size.h*b);this.icon.setSize(a)}},setOpacity:function(a){this.icon.setOpacity(a)},setUrl:function(a){this.icon.setUrl(a)},display:function(a){this.icon.display(a)},CLASS_NAME:"OpenLayers.Marker"});OpenLayers.Marker.defaultIcon=function(){var a=OpenLayers.Util.getImagesLocation()+"marker.png";var b=new OpenLayers.Size(21,25);var d=function(e){return new OpenLayers.Pixel(-(e.w/2),-e.h)};return new OpenLayers.Icon(a,b,null,d)};OpenLayers.Popup.AnchoredBubble=OpenLayers.Class(OpenLayers.Popup.Anchored,{rounded:false,initialize:function(l,d,h,b,a,g,e){this.padding=new OpenLayers.Bounds(0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE,0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments)},draw:function(a){OpenLayers.Popup.Anchored.prototype.draw.apply(this,arguments);this.setContentHTML();this.setBackgroundColor();this.setOpacity();return this.div},updateRelativePosition:function(){this.setRicoCorners()},setSize:function(a){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.setRicoCorners()},setBackgroundColor:function(a){if(a!=undefined){this.backgroundColor=a}if(this.div!=null){if(this.contentDiv!=null){this.div.style.background="transparent";OpenLayers.Rico.Corner.changeColor(this.groupDiv,this.backgroundColor)}}},setOpacity:function(a){OpenLayers.Popup.Anchored.prototype.setOpacity.call(this,a);if(this.div!=null){if(this.groupDiv!=null){OpenLayers.Rico.Corner.changeOpacity(this.groupDiv,this.opacity)}}},setBorder:function(a){this.border=0},setRicoCorners:function(){var a=this.getCornersToRound(this.relativePosition);var b={corners:a,color:this.backgroundColor,bgColor:"transparent",blend:false};if(!this.rounded){OpenLayers.Rico.Corner.round(this.div,b);this.rounded=true}else{OpenLayers.Rico.Corner.reRound(this.groupDiv,b);this.setBackgroundColor();this.setOpacity()}},getCornersToRound:function(){var a=["tl","tr","bl","br"];var b=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);OpenLayers.Util.removeItem(a,b);return a.join(" ")},CLASS_NAME:"OpenLayers.Popup.AnchoredBubble"});OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5;OpenLayers.Popup.Framed=OpenLayers.Class(OpenLayers.Popup.Anchored,{imageSrc:null,imageSize:null,isAlphaImage:false,positionBlocks:null,blocks:null,fixedRelativePosition:false,initialize:function(l,d,h,b,a,g,e){OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments);if(this.fixedRelativePosition){this.updateRelativePosition();this.calculateRelativePosition=function(m){return this.relativePosition}}this.contentDiv.style.position="absolute";this.contentDiv.style.zIndex=1;if(g){this.closeDiv.style.zIndex=1}this.groupDiv.style.position="absolute";this.groupDiv.style.top="0px";this.groupDiv.style.left="0px";this.groupDiv.style.height="100%";this.groupDiv.style.width="100%"},destroy:function(){this.imageSrc=null;this.imageSize=null;this.isAlphaImage=null;this.fixedRelativePosition=false;this.positionBlocks=null;for(var a=0;a<this.blocks.length;a++){var b=this.blocks[a];if(b.image){b.div.removeChild(b.image)}b.image=null;if(b.div){this.groupDiv.removeChild(b.div)}b.div=null}this.blocks=null;OpenLayers.Popup.Anchored.prototype.destroy.apply(this,arguments)},setBackgroundColor:function(a){},setBorder:function(){},setOpacity:function(a){},setSize:function(a){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.updateBlocks()},updateRelativePosition:function(){this.padding=this.positionBlocks[this.relativePosition].padding;if(this.closeDiv){var a=this.getContentDivPadding();this.closeDiv.style.right=a.right+this.padding.right+"px";this.closeDiv.style.top=a.top+this.padding.top+"px"}this.updateBlocks()},calculateNewPx:function(a){var b=OpenLayers.Popup.Anchored.prototype.calculateNewPx.apply(this,arguments);b=b.offset(this.positionBlocks[this.relativePosition].offset);return b},createBlocks:function(){this.blocks=[];var h=null;for(var g in this.positionBlocks){h=g;break}var a=this.positionBlocks[h];for(var e=0;e<a.blocks.length;e++){var m={};this.blocks.push(m);var b=this.id+"_FrameDecorationDiv_"+e;m.div=OpenLayers.Util.createDiv(b,null,null,null,"absolute",null,"hidden",null);var d=this.id+"_FrameDecorationImg_"+e;var l=(this.isAlphaImage)?OpenLayers.Util.createAlphaImageDiv:OpenLayers.Util.createImage;m.image=l(d,null,this.imageSize,this.imageSrc,"absolute",null,null,null);m.div.appendChild(m.image);this.groupDiv.appendChild(m.div)}},updateBlocks:function(){if(!this.blocks){this.createBlocks()}if(this.size&&this.relativePosition){var p=this.positionBlocks[this.relativePosition];for(var m=0;m<p.blocks.length;m++){var d=p.blocks[m];var g=this.blocks[m];var e=d.anchor.left;var q=d.anchor.bottom;var a=d.anchor.right;var u=d.anchor.top;var s=(isNaN(d.size.w))?this.size.w-(a+e):d.size.w;var o=(isNaN(d.size.h))?this.size.h-(q+u):d.size.h;g.div.style.width=s+"px";g.div.style.height=o+"px";g.div.style.left=(e!=null)?e+"px":"";g.div.style.bottom=(q!=null)?q+"px":"";g.div.style.right=(a!=null)?a+"px":"";g.div.style.top=(u!=null)?u+"px":"";g.image.style.left=d.position.x+"px";g.image.style.top=d.position.y+"px"}this.contentDiv.style.left=this.padding.left+"px";this.contentDiv.style.top=this.padding.top+"px"}},CLASS_NAME:"OpenLayers.Popup.Framed"});OpenLayers.Renderer.SVG=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"http://www.w3.org/2000/svg",xlinkns:"http://www.w3.org/1999/xlink",MAX_PIXEL:15000,translationParameters:null,symbolSize:{},initialize:function(a){if(!this.supported()){return}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);this.translationParameters={x:0,y:0}},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){var a="http://www.w3.org/TR/SVG11/feature#";return(document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(a+"SVG","1.1")||document.implementation.hasFeature(a+"BasicStructure","1.1")))},inValidRange:function(a,g,b){var e=a+(b?0:this.translationParameters.x);var d=g+(b?0:this.translationParameters.y);return(e>=-this.MAX_PIXEL&&e<=this.MAX_PIXEL&&d>=-this.MAX_PIXEL&&d<=this.MAX_PIXEL)},setExtent:function(b,e){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var a=this.getResolution();var h=-b.left/a;var g=b.top/a;if(e){this.left=h;this.top=g;var d="0 0 "+this.size.w+" "+this.size.h;this.rendererRoot.setAttributeNS(null,"viewBox",d);this.translate(0,0);return true}else{var l=this.translate(h-this.left,g-this.top);if(!l){this.setExtent(b,true)}return l}},translate:function(a,d){if(!this.inValidRange(a,d,true)){return false}else{var b="";if(a||d){b="translate("+a+","+d+")"}this.root.setAttributeNS(null,"transform",b);this.translationParameters={x:a,y:d};return true}},setSize:function(a){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);this.rendererRoot.setAttributeNS(null,"width",this.size.w);this.rendererRoot.setAttributeNS(null,"height",this.size.h)},getNodeType:function(d,b){var a=null;switch(d.CLASS_NAME){case"OpenLayers.Geometry.Point":if(b.externalGraphic){a="image"}else{if(this.isComplexSymbol(b.graphicName)){a="use"}else{a="circle"}}break;case"OpenLayers.Geometry.Rectangle":a="rect";break;case"OpenLayers.Geometry.LineString":a="polyline";break;case"OpenLayers.Geometry.LinearRing":a="polygon";break;case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":a="path";break;default:break}return a},setStyle:function(h,d,w){d=d||h._style;w=w||h._options;var a=parseFloat(h.getAttributeNS(null,"r"));var q=1;var s;if(h._geometryClass=="OpenLayers.Geometry.Point"&&a){if(d.externalGraphic){s=this.getPosition(h);if(d.graphicWidth&&d.graphicHeight){h.setAttributeNS(null,"preserveAspectRatio","none")}var g=d.graphicWidth||d.graphicHeight;var t=d.graphicHeight||d.graphicWidth;g=g?g:d.pointRadius*2;t=t?t:d.pointRadius*2;var p=(d.graphicXOffset!=undefined)?d.graphicXOffset:-(0.5*g);var l=(d.graphicYOffset!=undefined)?d.graphicYOffset:-(0.5*t);var o=d.graphicOpacity||d.fillOpacity;h.setAttributeNS(null,"x",(s.x+p).toFixed());h.setAttributeNS(null,"y",(s.y+l).toFixed());h.setAttributeNS(null,"width",g);h.setAttributeNS(null,"height",t);h.setAttributeNS(this.xlinkns,"href",d.externalGraphic);h.setAttributeNS(null,"style","opacity: "+o)}else{if(this.isComplexSymbol(d.graphicName)){var m=d.pointRadius*3;var v=m*2;var e=this.importSymbol(d.graphicName);var b="#"+e;s=this.getPosition(h);q=this.symbolSize[e]/v;if(h.getAttributeNS(this.xlinkns,"href")!=b){h.setAttributeNS(this.xlinkns,"href",b)}else{if(v!=parseFloat(h.getAttributeNS(null,"width"))){h.style.visibility="hidden";this.container.scrollLeft=this.container.scrollLeft}}h.setAttributeNS(null,"width",v);h.setAttributeNS(null,"height",v);h.setAttributeNS(null,"x",s.x-m);h.setAttributeNS(null,"y",s.y-m);h.style.visibility=""}else{h.setAttributeNS(null,"r",d.pointRadius)}}if(typeof d.rotation!="undefined"&&s){var u=OpenLayers.String.format("rotate(${0} ${1} ${2})",[d.rotation,s.x,s.y]);h.setAttributeNS(null,"transform",u)}}if(w.isFilled){h.setAttributeNS(null,"fill",d.fillColor);h.setAttributeNS(null,"fill-opacity",d.fillOpacity)}else{h.setAttributeNS(null,"fill","none")}if(w.isStroked){h.setAttributeNS(null,"stroke",d.strokeColor);h.setAttributeNS(null,"stroke-opacity",d.strokeOpacity);h.setAttributeNS(null,"stroke-width",d.strokeWidth*q);h.setAttributeNS(null,"stroke-linecap",d.strokeLinecap);h.setAttributeNS(null,"stroke-linejoin","round");h.setAttributeNS(null,"stroke-dasharray",this.dashStyle(d,q))}else{h.setAttributeNS(null,"stroke","none")}if(d.pointerEvents){h.setAttributeNS(null,"pointer-events",d.pointerEvents)}if(d.cursor!=null){h.setAttributeNS(null,"cursor",d.cursor)}return h},dashStyle:function(d,b){var a=d.strokeWidth*b;switch(d.strokeDashstyle){case"solid":return"none";case"dot":return[1,4*a].join();case"dash":return[4*a,4*a].join();case"dashdot":return[4*a,4*a,1,4*a].join();case"longdash":return[8*a,4*a].join();case"longdashdot":return[8*a,4*a,1,4*a].join();default:return d.strokeDashstyle.replace(/ /g,",")}},createNode:function(a,d){var b=document.createElementNS(this.xmlns,a);if(d){b.setAttributeNS(null,"id",d)}return b},nodeTypeCompare:function(b,a){return(a==b.nodeName)},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_svgRoot","svg")},createRoot:function(){return this.nodeFactory(this.container.id+"_root","g")},createDefs:function(){var a=this.nodeFactory(this.container.id+"_defs","defs");this.rendererRoot.appendChild(a);return a},drawPoint:function(a,b){return this.drawCircle(a,b,1)},drawCircle:function(e,g,b){var d=this.getResolution();var a=(g.x/d+this.left);var h=(this.top-g.y/d);if(this.inValidRange(a,h)){e.setAttributeNS(null,"cx",a);e.setAttributeNS(null,"cy",h);e.setAttributeNS(null,"r",b);return e}else{return false}},drawLineString:function(b,d){var a=this.getComponentsString(d.components);if(a.path){b.setAttributeNS(null,"points",a.path);return(a.complete?b:null)}else{return false}},drawLinearRing:function(b,d){var a=this.getComponentsString(d.components);if(a.path){b.setAttributeNS(null,"points",a.path);return(a.complete?b:null)}else{return false}},drawPolygon:function(b,m){var l="";var o=true;var a=true;var e,p;for(var g=0,h=m.components.length;g<h;g++){l+=" M";e=this.getComponentsString(m.components[g].components," ");p=e.path;if(p){l+=" "+p;a=e.complete&&a}else{o=false}}l+=" z";if(o){b.setAttributeNS(null,"d",l);b.setAttributeNS(null,"fill-rule","evenodd");return a?b:null}else{return false}},drawRectangle:function(d,e){var b=this.getResolution();var a=(e.x/b+this.left);var g=(this.top-e.y/b);if(this.inValidRange(a,g)){d.setAttributeNS(null,"x",a);d.setAttributeNS(null,"y",g);d.setAttributeNS(null,"width",e.width/b);d.setAttributeNS(null,"height",e.height/b);return d}else{return false}},drawSurface:function(h,m){var l=null;var b=true;for(var g=0,a=m.components.length;g<a;g++){if((g%3)==0&&(g/3)==0){var e=this.getShortString(m.components[g]);if(!e){b=false}l="M "+e}else{if((g%3)==1){var e=this.getShortString(m.components[g]);if(!e){b=false}l+=" C "+e}else{var e=this.getShortString(m.components[g]);if(!e){b=false}l+=" "+e}}}l+=" Z";if(b){h.setAttributeNS(null,"d",l);return h}else{return false}},getComponentsString:function(g,e){var l=[];var a=true;var h=g.length;var p=[];var m,o,b;for(var d=0;d<h;d++){o=g[d];l.push(o);m=this.getShortString(o);if(m){p.push(m)}else{if(d>0){if(this.getShortString(g[d-1])){p.push(this.clipLine(g[d],g[d-1]))}}if(d<h-1){if(this.getShortString(g[d+1])){p.push(this.clipLine(g[d],g[d+1]))}}a=false}}return{path:p.join(e||","),complete:a}},clipLine:function(g,m){if(m.equals(g)){return""}var h=this.getResolution();var b=this.MAX_PIXEL-this.translationParameters.x;var a=this.MAX_PIXEL-this.translationParameters.y;var e=m.x/h+this.left;var p=this.top-m.y/h;var d=g.x/h+this.left;var o=this.top-g.y/h;var l;if(d<-b||d>b){l=(o-p)/(d-e);d=d<0?-b:b;o=p+(d-e)*l}if(o<-a||o>a){l=(d-e)/(o-p);o=o<0?-a:a;d=e+(o-p)*l}return d+","+o},getShortString:function(b){var d=this.getResolution();var a=(b.x/d+this.left);var e=(this.top-b.y/d);if(this.inValidRange(a,e)){return a+","+e}else{return false}},getPosition:function(a){return({x:parseFloat(a.getAttributeNS(null,"cx")),y:parseFloat(a.getAttributeNS(null,"cy"))})},importSymbol:function(g){if(!this.defs){this.defs=this.createDefs()}var b=this.container.id+"-"+g;if(document.getElementById(b)!=null){return b}var e=OpenLayers.Renderer.symbol[g];if(!e){throw new Error(g+" is not a valid symbol name");return}var l=this.nodeFactory(b,"symbol");var d=this.nodeFactory(null,"polygon");l.appendChild(d);var r=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var p="";var o,m;for(var h=0;h<e.length;h=h+2){o=e[h];m=e[h+1];r.left=Math.min(r.left,o);r.bottom=Math.min(r.bottom,m);r.right=Math.max(r.right,o);r.top=Math.max(r.top,m);p+=" "+o+","+m}d.setAttributeNS(null,"points",p);var a=r.getWidth();var q=r.getHeight();var s=[r.left-a,r.bottom-q,a*3,q*3];l.setAttributeNS(null,"viewBox",s.join(" "));this.symbolSize[b]=Math.max(a,q)*3;this.defs.appendChild(l);return l.id},CLASS_NAME:"OpenLayers.Renderer.SVG"});OpenLayers.Renderer.VML=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"urn:schemas-microsoft-com:vml",symbolCache:{},offset:null,initialize:function(a){if(!this.supported()){return}if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);var b=document.createStyleSheet();b.addRule("olv\\:*","behavior: url(#default#VML); position: absolute; display: inline-block;")}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);this.offset={x:0,y:0}},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){return !!(document.namespaces)},setExtent:function(d,e){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var a=this.getResolution();var h=d.left/a;var g=d.top/a-this.size.h;if(e){this.offset={x:h,y:g};h=0;g=0}else{h=h-this.offset.x;g=g-this.offset.y}var l=h+" "+g;this.root.setAttribute("coordorigin",l);var b=this.size.w+" "+this.size.h;this.root.setAttribute("coordsize",b);this.root.style.flip="y";return true},setSize:function(a){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);this.rendererRoot.style.width=this.size.w+"px";this.rendererRoot.style.height=this.size.h+"px";this.root.style.width=this.size.w+"px";this.root.style.height=this.size.h+"px"},getNodeType:function(d,b){var a=null;switch(d.CLASS_NAME){case"OpenLayers.Geometry.Point":if(b.externalGraphic){a="olv:rect"}else{if(this.isComplexSymbol(b.graphicName)){a="olv:shape"}else{a="olv:oval"}}break;case"OpenLayers.Geometry.Rectangle":a="olv:rect";break;case"OpenLayers.Geometry.LineString":case"OpenLayers.Geometry.LinearRing":case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":a="olv:shape";break;default:break}return a},setStyle:function(e,b,v,q){b=b||e._style;v=v||e._options;var o=1;if(e._geometryClass=="OpenLayers.Geometry.Point"){if(b.externalGraphic){var d=b.graphicWidth||b.graphicHeight;var r=b.graphicHeight||b.graphicWidth;d=d?d:b.pointRadius*2;r=r?r:b.pointRadius*2;var h=this.getResolution();var m=(b.graphicXOffset!=undefined)?b.graphicXOffset:-(0.5*d);var g=(b.graphicYOffset!=undefined)?b.graphicYOffset:-(0.5*r);e.style.left=((q.x/h-this.offset.x)+m).toFixed();e.style.top=((q.y/h-this.offset.y)-(g+r)).toFixed();e.style.width=d+"px";e.style.height=r+"px";e.style.flip="y";b.fillColor="none";v.isStroked=false}else{if(this.isComplexSymbol(b.graphicName)){var a=this.importSymbol(b.graphicName);var u=a.extent;var d=u.getWidth();var r=u.getHeight();e.setAttribute("path",a.path);e.setAttribute("coordorigin",u.left+","+u.bottom);e.setAttribute("coordsize",d+","+r);e.style.left=u.left+"px";e.style.top=u.bottom+"px";e.style.width=d+"px";e.style.height=r+"px";this.drawCircle(e,q,b.pointRadius);e.style.flip="y"}else{this.drawCircle(e,q,b.pointRadius)}}}if(v.isFilled){e.setAttribute("fillcolor",b.fillColor)}else{e.setAttribute("filled","false")}var p=e.getElementsByTagName("fill");var t=(p.length==0)?null:p[0];if(!v.isFilled){if(t){e.removeChild(t)}}else{if(!t){t=this.createNode("olv:fill",e.id+"_fill")}t.setAttribute("opacity",b.fillOpacity);if(e._geometryClass=="OpenLayers.Geometry.Point"&&b.externalGraphic){if(b.graphicOpacity){t.setAttribute("opacity",b.graphicOpacity)}t.setAttribute("src",b.externalGraphic);t.setAttribute("type","frame");if(!(b.graphicWidth&&b.graphicHeight)){t.aspect="atmost"}}if(t.parentNode!=e){e.appendChild(t)}}if(typeof b.rotation!="undefined"){if(b.externalGraphic){this.graphicRotate(e,m,g);t.setAttribute("opacity",0)}else{e.style.rotation=b.rotation}}if(v.isStroked){e.setAttribute("strokecolor",b.strokeColor);e.setAttribute("strokeweight",b.strokeWidth+"px")}else{e.setAttribute("stroked","false")}var l=e.getElementsByTagName("stroke");var s=(l.length==0)?null:l[0];if(!v.isStroked){if(s){e.removeChild(s)}}else{if(!s){s=this.createNode("olv:stroke",e.id+"_stroke");e.appendChild(s)}s.setAttribute("opacity",b.strokeOpacity);s.setAttribute("endcap",!b.strokeLinecap||b.strokeLinecap=="butt"?"flat":b.strokeLinecap);s.setAttribute("dashstyle",this.dashStyle(b))}if(b.cursor!="inherit"&&b.cursor!=null){e.style.cursor=b.cursor}return e},graphicRotate:function(t,z,h){var w=w||t._style;var e=t._options;var a,p;if(!(w.graphicWidth&&w.graphicHeight)){var B=new Image();B.onreadystatechange=OpenLayers.Function.bind(function(){if(B.readyState=="complete"||B.readyState=="interactive"){a=B.width/B.height;p=Math.max(w.pointRadius*2,w.graphicWidth||0,w.graphicHeight||0);z=z*a;w.graphicWidth=p*a;w.graphicHeight=p;this.graphicRotate(t,z,h)}},this);B.src=w.externalGraphic;return}else{p=Math.max(w.graphicWidth,w.graphicHeight);a=w.graphicWidth/w.graphicHeight}var s=Math.round(w.graphicWidth||p*a);var q=Math.round(w.graphicHeight||p);t.style.width=s+"px";t.style.height=q+"px";var r=document.getElementById(t.id+"_image");if(!r){r=this.createNode("olv:imagedata",t.id+"_image");t.appendChild(r)}r.style.width=s+"px";r.style.height=q+"px";r.src=w.externalGraphic;r.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";var u=w.rotation*Math.PI/180;var m=Math.sin(u);var g=Math.cos(u);var l="progid:DXImageTransform.Microsoft.Matrix(M11="+g+",M12="+(-m)+",M21="+m+",M22="+g+",SizingMethod='auto expand')\n";var b=w.graphicOpacity||w.fillOpacity;if(b&&b!=1){l+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+b+")\n"}t.style.filter=l;var v=new OpenLayers.Geometry.Point(-z,-h);var d=new OpenLayers.Bounds(0,0,s,q).toGeometry();d.rotate(w.rotation,v);var o=d.getBounds();t.style.left=Math.round(parseInt(t.style.left)+o.left)+"px";t.style.top=Math.round(parseInt(t.style.top)-o.bottom)+"px"},postDraw:function(a){var d=a._style.fillColor;var b=a._style.strokeColor;if(d=="none"&&a.getAttribute("fillcolor")!=d){a.setAttribute("fillcolor",d)}if(b=="none"&&a.getAttribute("strokecolor")!=b){a.setAttribute("strokecolor",b)}},setNodeDimension:function(b,g){var e=g.getBounds();if(e){var a=this.getResolution();var d=new OpenLayers.Bounds((e.left/a-this.offset.x).toFixed(),(e.bottom/a-this.offset.y).toFixed(),(e.right/a-this.offset.x).toFixed(),(e.top/a-this.offset.y).toFixed());b.style.left=d.left+"px";b.style.top=d.top+"px";b.style.width=d.getWidth()+"px";b.style.height=d.getHeight()+"px";b.coordorigin=d.left+" "+d.top;b.coordsize=d.getWidth()+" "+d.getHeight()}},dashStyle:function(a){var d=a.strokeDashstyle;switch(d){case"solid":case"dot":case"dash":case"dashdot":case"longdash":case"longdashdot":return d;default:var b=d.split(/[ ,]/);if(b.length==2){if(1*b[0]>=2*b[1]){return"longdash"}return(b[0]==1||b[1]==1)?"dot":"dash"}else{if(b.length==4){return(1*b[0]>=2*b[1])?"longdashdot":"dashdot"}}return"solid"}},createNode:function(a,d){var b=document.createElement(a);if(d){b.setAttribute("id",d)}b.setAttribute("unselectable","on",0);b.onselectstart=function(){return(false)};return b},nodeTypeCompare:function(d,b){var e=b;var a=e.indexOf(":");if(a!=-1){e=e.substr(a+1)}var g=d.nodeName;a=g.indexOf(":");if(a!=-1){g=g.substr(a+1)}return(e==g)},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_vmlRoot","div")},createRoot:function(){return this.nodeFactory(this.container.id+"_root","olv:group")},drawPoint:function(a,b){return this.drawCircle(a,b,1)},drawCircle:function(e,g,a){if(!isNaN(g.x)&&!isNaN(g.y)){var b=this.getResolution();e.style.left=((g.x/b-this.offset.x).toFixed()-a)+"px";e.style.top=((g.y/b-this.offset.y).toFixed()-a)+"px";var d=a*2;e.style.width=d+"px";e.style.height=d+"px";return e}return false},drawLineString:function(a,b){return this.drawLine(a,b,false)},drawLinearRing:function(a,b){return this.drawLine(a,b,true)},drawLine:function(b,p,l){this.setNodeDimension(b,p);var d=this.getResolution();var a=p.components.length;var g=new Array(a);var m,q,o;for(var h=0;h<a;h++){m=p.components[h];q=(m.x/d-this.offset.x);o=(m.y/d-this.offset.y);g[h]=" "+q.toFixed()+","+o.toFixed()+" l "}var e=(l)?" x e":" e";b.path="m"+g.join("")+e;return b},drawPolygon:function(b,p){this.setNodeDimension(b,p);var d=this.getResolution();var r=[];var h,g,e,m,a,l,q,o;for(e=0,m=p.components.length;e<m;e++){h=p.components[e];r.push("m");for(g=0,a=h.components.length;g<a;g++){l=h.components[g];q=l.x/d-this.offset.x;o=l.y/d-this.offset.y;r.push(" "+q.toFixed()+","+o.toFixed());if(g==0){r.push(" l")}}r.push(" x ")}r.push("e");b.path=r.join("");return b},drawRectangle:function(b,d){var a=this.getResolution();b.style.left=(d.x/a-this.offset.x)+"px";b.style.top=(d.y/a-this.offset.y)+"px";b.style.width=d.width/a+"px";b.style.height=d.height/a+"px";return b},drawSurface:function(a,l){this.setNodeDimension(a,l);var b=this.getResolution();var o=[];var e,m,h;for(var d=0,g=l.components.length;d<g;d++){e=l.components[d];m=e.x/b-this.offset.x;h=e.y/b-this.offset.y;if((d%3)==0&&(d/3)==0){o.push("m")}else{if((d%3)==1){o.push(" c")}}o.push(" "+m+","+h)}o.push(" x e");a.path=o.join("");return a},importSymbol:function(b){var m=this.container.id+"-"+b;var a=this.symbolCache[m];if(a){return a}var g=OpenLayers.Renderer.symbol[b];if(!g){throw new Error(b+" is not a valid symbol name");return}var l=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var e=["m"];for(var d=0;d<g.length;d=d+2){x=g[d];y=g[d+1];l.left=Math.min(l.left,x);l.bottom=Math.min(l.bottom,y);l.right=Math.max(l.right,x);l.top=Math.max(l.top,y);e.push(x);e.push(y);if(d==0){e.push("l")}}e.push("x e");var h=e.join(" ");a={path:h,extent:l};this.symbolCache[m]=a;return a},CLASS_NAME:"OpenLayers.Renderer.VML"});OpenLayers.Tile.Image=OpenLayers.Class(OpenLayers.Tile,{url:null,imgDiv:null,frame:null,layerAlphaHack:null,isBackBuffer:false,lastRatio:1,isFirstDraw:true,backBufferTile:null,initialize:function(e,a,g,b,d){OpenLayers.Tile.prototype.initialize.apply(this,arguments);this.url=b;this.frame=document.createElement("div");this.frame.style.overflow="hidden";this.frame.style.position="absolute";this.layerAlphaHack=this.layer.alpha&&OpenLayers.Util.alphaHack()},destroy:function(){if(this.imgDiv!=null){if(this.layerAlphaHack){OpenLayers.Event.stopObservingElement(this.imgDiv.childNodes[0].id)}OpenLayers.Event.stopObservingElement(this.imgDiv.id);if(this.imgDiv.parentNode==this.frame){this.frame.removeChild(this.imgDiv);this.imgDiv.map=null}this.imgDiv.urls=null}this.imgDiv=null;if((this.frame!=null)&&(this.frame.parentNode==this.layer.div)){this.layer.div.removeChild(this.frame)}this.frame=null;if(this.backBufferTile){this.backBufferTile.destroy();this.backBufferTile=null}this.layer.events.unregister("loadend",this,this.resetBackBuffer);OpenLayers.Tile.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Tile.Image(this.layer,this.position,this.bounds,this.url,this.size)}a=OpenLayers.Tile.prototype.clone.apply(this,[a]);a.imgDiv=null;return a},draw:function(){if(this.layer!=this.layer.map.baseLayer&&this.layer.reproject){this.bounds=this.getBoundsFromBaseLayer(this.position)}var a=OpenLayers.Tile.prototype.draw.apply(this,arguments);if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(a){if(!this.backBufferTile){this.backBufferTile=this.clone();this.backBufferTile.hide();this.backBufferTile.isBackBuffer=true;this.events.register("loadend",this,this.resetBackBuffer);this.layer.events.register("loadend",this,this.resetBackBuffer)}this.startTransition()}else{if(this.backBufferTile){this.backBufferTile.clear()}}}else{if(a&&this.isFirstDraw){this.events.register("loadend",this,this.showTile);this.isFirstDraw=false}}if(!a){return false}if(this.isLoading){this.events.triggerEvent("reload")}else{this.isLoading=true;this.events.triggerEvent("loadstart")}return this.renderTile()},resetBackBuffer:function(){this.showTile();if(this.backBufferTile&&(this.isFirstDraw||!this.layer.numLoadingTiles)){this.isFirstDraw=false;var a=this.layer.maxExtent;var b=(a&&this.bounds.intersectsBounds(a,false));if(b){this.backBufferTile.position=this.position;this.backBufferTile.bounds=this.bounds;this.backBufferTile.size=this.size;this.backBufferTile.imageSize=this.layer.imageSize||this.size;this.backBufferTile.imageOffset=this.layer.imageOffset;this.backBufferTile.resolution=this.layer.getResolution();this.backBufferTile.renderTile()}}},renderTile:function(){if(this.imgDiv==null){this.initImgDiv()}this.imgDiv.viewRequestID=this.layer.map.viewRequestID;if(this.layer.url instanceof Array){this.imgDiv.urls=this.layer.url.slice()}this.url=this.layer.getURL(this.bounds);OpenLayers.Util.modifyDOMElement(this.frame,null,this.position,this.size);var a=this.layer.getImageSize();if(this.layerAlphaHack){OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,null,a,this.url)}else{OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,a);this.imgDiv.src=this.url}return true},clear:function(){if(this.imgDiv){this.hide();if(OpenLayers.Tile.Image.useBlankTile){this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif"}}},initImgDiv:function(){var e=this.layer.imageOffset;var b=this.layer.getImageSize();if(this.layerAlphaHack){this.imgDiv=OpenLayers.Util.createAlphaImageDiv(null,e,b,null,"relative",null,null,null,true)}else{this.imgDiv=OpenLayers.Util.createImage(null,e,b,null,"relative",null,null,true)}this.imgDiv.className="olTileImage";this.frame.style.zIndex=this.isBackBuffer?0:1;this.frame.appendChild(this.imgDiv);this.layer.div.appendChild(this.frame);if(this.layer.opacity!=null){OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,null,null,null,null,this.layer.opacity)}this.imgDiv.map=this.layer.map;var d=function(){if(this.isLoading){this.isLoading=false;this.events.triggerEvent("loadend")}};if(this.layerAlphaHack){OpenLayers.Event.observe(this.imgDiv.childNodes[0],"load",OpenLayers.Function.bind(d,this))}else{OpenLayers.Event.observe(this.imgDiv,"load",OpenLayers.Function.bind(d,this))}var a=function(){if(this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS){d.call(this)}};OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(a,this))},checkImgURL:function(){if(this.layer){var a=this.layerAlphaHack?this.imgDiv.firstChild.src:this.imgDiv.src;if(!OpenLayers.Util.isEquivalentUrl(a,this.url)){this.hide()}}},startTransition:function(){if(!this.backBufferTile||!this.backBufferTile.imgDiv){return}var e=1;if(this.backBufferTile.resolution){e=this.backBufferTile.resolution/this.layer.getResolution()}if(e!=this.lastRatio){if(this.layer.transitionEffect=="resize"){var d=new OpenLayers.LonLat(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top);var b=new OpenLayers.Size(this.backBufferTile.size.w*e,this.backBufferTile.size.h*e);var a=this.layer.map.getLayerPxFromLonLat(d);OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,a,b);var g=this.backBufferTile.imageSize;g=new OpenLayers.Size(g.w*e,g.h*e);var h=this.backBufferTile.imageOffset;if(h){h=new OpenLayers.Pixel(h.x*e,h.y*e)}OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,h,g);this.backBufferTile.show()}}else{if(this.layer.singleTile){this.backBufferTile.show()}else{this.backBufferTile.hide()}}this.lastRatio=e},show:function(){this.frame.style.display="";if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.frame.scrollLeft=this.frame.scrollLeft}}},hide:function(){this.frame.style.display="none"},CLASS_NAME:"OpenLayers.Tile.Image"});OpenLayers.Tile.Image.useBlankTile=(OpenLayers.Util.getBrowserName()=="safari"||OpenLayers.Util.getBrowserName()=="opera");OpenLayers.Util.extend(OpenLayers.Lang.en,{"mf.layertree.opacity":"Opacity","mf.layertree.remove":"Remove","mf.layertree.zoomToExtent":"Zoom to extent","mf.print.mapTitle":"Title","mf.print.comment":"Comments","mf.print.loadingConfig":"Loading the configuration...","mf.print.serverDown":"The print service is not working","mf.print.unableToPrint":"Unable to print","mf.print.generatingPDF":"Generating PDF...","mf.print.dpi":"DPI","mf.print.scale":"Scale","mf.print.rotation":"Rotation","mf.print.print":"Print","mf.print.resetPos":"Reset Pos.","mf.print.layout":"Layout","mf.print.addPage":"Add page","mf.print.remove":"Remove page","mf.print.clearAll":"Clear all","mf.print.pdfReady":"Your PDF document is ready.","mf.print.noPage":'No page selected, click on the "Add page" button to add one.',"mf.print.print-tooltip":"Generate a PDF with at least the extent shown on the map","mf.error":"Error","mf.warning":"Warning","mf.information":"Information","mf.recenter.x":"X","mf.recenter.y":"Y","mf.recenter.submit":"Recenter","mf.recenter.missingCoords":"Some coordinates are missing.","mf.recenter.outOfRangeCoords":"Submitted coordinates (${myX}, ${myY}) are not in the map area<br />and must be within following ranges:<br/>${coordX} between ${minCoordX} and ${maxCoordX},<br />${coordY} between ${minCoordY} and ${maxCoordY}","mf.recenter.ws.error":"An error occured when accessing the distant webservice:","mf.recenter.ws.service":"Selected service"});OpenLayers.Control.OverviewMap=OpenLayers.Class(OpenLayers.Control,{element:null,ovmap:null,size:new OpenLayers.Size(180,90),layers:null,minRectSize:15,minRectDisplayClass:"RectReplacement",minRatio:8,maxRatio:32,mapOptions:null,handlers:null,resolutionFactor:1,initialize:function(a){this.layers=[];this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,[a])},destroy:function(){if(!this.mapDiv){return}this.handlers.click.destroy();this.mapDiv.removeChild(this.extentRectangle);this.extentRectangle=null;this.rectEvents.destroy();this.rectEvents=null;this.ovmap.destroy();this.ovmap=null;this.element.removeChild(this.mapDiv);this.mapDiv=null;this.div.removeChild(this.element);this.element=null;if(this.maximizeDiv){OpenLayers.Event.stopObservingElement(this.maximizeDiv);this.div.removeChild(this.maximizeDiv);this.maximizeDiv=null}if(this.minimizeDiv){OpenLayers.Event.stopObservingElement(this.minimizeDiv);this.div.removeChild(this.minimizeDiv);this.minimizeDiv=null}this.map.events.un({moveend:this.update,changebaselayer:this.baseLayerDraw,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!(this.layers.length>0)){if(this.map.baseLayer){var e=this.map.baseLayer.clone();this.layers=[e]}else{this.map.events.register("changebaselayer",this,this.baseLayerDraw);return this.div}}this.element=document.createElement("div");this.element.className=this.displayClass+"Element";this.element.style.display="none";this.mapDiv=document.createElement("div");this.mapDiv.style.width=this.size.w+"px";this.mapDiv.style.height=this.size.h+"px";this.mapDiv.style.position="relative";this.mapDiv.style.overflow="hidden";this.mapDiv.id=OpenLayers.Util.createUniqueID("overviewMap");this.extentRectangle=document.createElement("div");this.extentRectangle.style.position="absolute";this.extentRectangle.style.zIndex=1000;this.extentRectangle.className=this.displayClass+"ExtentRectangle";this.mapDiv.appendChild(this.extentRectangle);this.element.appendChild(this.mapDiv);this.div.appendChild(this.element);if(!this.outsideViewport){this.div.className+=" "+this.displayClass+"Container";var g=OpenLayers.Util.getImagesLocation();var b=g+"layer-switcher-maximize.png";this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+"MaximizeButton",null,new OpenLayers.Size(18,18),b,"absolute");this.maximizeDiv.style.display="none";this.maximizeDiv.className=this.displayClass+"MaximizeButton";OpenLayers.Event.observe(this.maximizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));this.div.appendChild(this.maximizeDiv);var b=g+"layer-switcher-minimize.png";this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_minimizeDiv",null,new OpenLayers.Size(18,18),b,"absolute");this.minimizeDiv.style.display="none";this.minimizeDiv.className=this.displayClass+"MinimizeButton";OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv);var h=["dblclick","mousedown"];for(var d=0,a=h.length;d<a;d++){OpenLayers.Event.observe(this.maximizeDiv,h[d],OpenLayers.Event.stop);OpenLayers.Event.observe(this.minimizeDiv,h[d],OpenLayers.Event.stop)}this.minimizeControl()}else{this.element.style.display=""}if(this.map.getExtent()){this.update()}this.map.events.register("moveend",this,this.update);return this.div},baseLayerDraw:function(){this.draw();this.map.events.unregister("changebaselayer",this,this.baseLayerDraw)},rectDrag:function(o){var e=this.handlers.drag.last.x-o.x;var b=this.handlers.drag.last.y-o.y;if(e!=0||b!=0){var l=this.rectPxBounds.top;var a=this.rectPxBounds.left;var g=Math.abs(this.rectPxBounds.getHeight());var d=this.rectPxBounds.getWidth();var h=Math.max(0,(l-b));h=Math.min(h,this.ovmap.size.h-this.hComp-g);var m=Math.max(0,(a-e));m=Math.min(m,this.ovmap.size.w-this.wComp-d);this.setRectPxBounds(new OpenLayers.Bounds(m,h+g,m+d,h))}},mapDivClick:function(o){var b=this.rectPxBounds.getCenterPixel();var g=o.xy.x-b.x;var e=o.xy.y-b.y;var l=this.rectPxBounds.top;var d=this.rectPxBounds.left;var p=Math.abs(this.rectPxBounds.getHeight());var a=this.rectPxBounds.getWidth();var h=Math.max(0,(l+e));h=Math.min(h,this.ovmap.size.h-p);var m=Math.max(0,(d+g));m=Math.min(m,this.ovmap.size.w-a);this.setRectPxBounds(new OpenLayers.Bounds(m,h+p,m+a,h));this.updateMapToRect()},maximizeControl:function(a){this.element.style.display="";this.showToggle(false);if(a!=null){OpenLayers.Event.stop(a)}},minimizeControl:function(a){this.element.style.display="none";this.showToggle(true);if(a!=null){OpenLayers.Event.stop(a)}},showToggle:function(a){this.maximizeDiv.style.display=a?"":"none";this.minimizeDiv.style.display=a?"none":""},update:function(){if(this.ovmap==null){this.createMap()}if(!this.isSuitableOverview()){this.updateOverview()}this.updateRectToMap()},isSuitableOverview:function(){var b=this.map.getExtent();var a=this.map.maxExtent;var d=new OpenLayers.Bounds(Math.max(b.left,a.left),Math.max(b.bottom,a.bottom),Math.min(b.right,a.right),Math.min(b.top,a.top));if(this.ovmap.getProjection()!=this.map.getProjection()){d=d.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}var e=this.ovmap.getResolution()/this.map.getResolution();return((e>this.minRatio)&&(e<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(d)))},updateOverview:function(){var d=this.map.getResolution();var b=this.ovmap.getResolution();var e=b/d;if(e>this.maxRatio){b=this.minRatio*d}else{if(e<=this.minRatio){b=this.maxRatio*d}}var a;if(this.ovmap.getProjection()!=this.map.getProjection()){a=this.map.center.clone();a.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{a=this.map.center}this.ovmap.setCenter(a,this.ovmap.getZoomForResolution(b*this.resolutionFactor));this.updateRectToMap()},createMap:function(){var b=OpenLayers.Util.extend({controls:[],maxResolution:"auto",fallThrough:false},this.mapOptions);this.ovmap=new OpenLayers.Map(this.mapDiv,b);OpenLayers.Event.stopObserving(window,"unload",this.ovmap.unloadDestroy);this.ovmap.addLayers(this.layers);this.ovmap.zoomToMaxExtent();this.wComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-right-width"));this.wComp=(this.wComp)?this.wComp:2;this.hComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-bottom-width"));this.hComp=(this.hComp)?this.hComp:2;this.handlers.drag=new OpenLayers.Handler.Drag(this,{move:this.rectDrag,done:this.updateMapToRect},{map:this.ovmap});this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.mapDivClick},{single:true,"double":false,stopSingle:true,stopDouble:true,pixelTolerance:1,map:this.ovmap});this.handlers.click.activate();this.rectEvents=new OpenLayers.Events(this,this.extentRectangle,null,true);this.rectEvents.register("mouseover",this,function(g){if(!this.handlers.drag.active&&!this.map.dragging){this.handlers.drag.activate()}});this.rectEvents.register("mouseout",this,function(g){if(!this.handlers.drag.dragging){this.handlers.drag.deactivate()}});if(this.ovmap.getProjection()!=this.map.getProjection()){var d=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units;var a=this.ovmap.getProjectionObject().getUnits()||this.ovmap.units||this.ovmap.baseLayer.units;this.resolutionFactor=d&&a?OpenLayers.INCHES_PER_UNIT[d]/OpenLayers.INCHES_PER_UNIT[a]:1}},updateRectToMap:function(){var b;if(this.ovmap.getProjection()!=this.map.getProjection()){b=this.map.getExtent().transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{b=this.map.getExtent()}var a=this.getRectBoundsFromMapBounds(b);if(a){this.setRectPxBounds(a)}},updateMapToRect:function(){var a=this.getMapBoundsFromRectBounds(this.rectPxBounds);if(this.ovmap.getProjection()!=this.map.getProjection()){a=a.transform(this.ovmap.getProjectionObject(),this.map.getProjectionObject())}this.map.panTo(a.getCenterLonLat())},setRectPxBounds:function(e){var l=Math.max(e.top,0);var g=Math.max(e.left,0);var b=Math.min(e.top+Math.abs(e.getHeight()),this.ovmap.size.h-this.hComp);var m=Math.min(e.left+e.getWidth(),this.ovmap.size.w-this.wComp);var d=Math.max(m-g,0);var o=Math.max(b-l,0);if(d<this.minRectSize||o<this.minRectSize){this.extentRectangle.className=this.displayClass+this.minRectDisplayClass;var h=g+(d/2)-(this.minRectSize/2);var a=l+(o/2)-(this.minRectSize/2);this.extentRectangle.style.top=Math.round(a)+"px";this.extentRectangle.style.left=Math.round(h)+"px";this.extentRectangle.style.height=this.minRectSize+"px";this.extentRectangle.style.width=this.minRectSize+"px"}else{this.extentRectangle.className=this.displayClass+"ExtentRectangle";this.extentRectangle.style.top=Math.round(l)+"px";this.extentRectangle.style.left=Math.round(g)+"px";this.extentRectangle.style.height=Math.round(o)+"px";this.extentRectangle.style.width=Math.round(d)+"px"}this.rectPxBounds=new OpenLayers.Bounds(Math.round(g),Math.round(b),Math.round(m),Math.round(l))},getRectBoundsFromMapBounds:function(e){var a=new OpenLayers.LonLat(e.left,e.bottom);var h=new OpenLayers.LonLat(e.right,e.top);var d=this.getOverviewPxFromLonLat(a);var b=this.getOverviewPxFromLonLat(h);var g=null;if(d&&b){g=new OpenLayers.Bounds(d.x,d.y,b.x,b.y)}return g},getMapBoundsFromRectBounds:function(e){var d=new OpenLayers.Pixel(e.left,e.bottom);var b=new OpenLayers.Pixel(e.right,e.top);var a=this.getLonLatFromOverviewPx(d);var g=this.getLonLatFromOverviewPx(b);return new OpenLayers.Bounds(a.lon,a.lat,g.lon,g.lat)},getLonLatFromOverviewPx:function(h){var d=this.ovmap.size;var b=this.ovmap.getResolution();var a=this.ovmap.getExtent().getCenterLonLat();var g=h.x-(d.w/2);var e=h.y-(d.h/2);return new OpenLayers.LonLat(a.lon+g*b,a.lat-e*b)},getOverviewPxFromLonLat:function(e){var b=this.ovmap.getResolution();var d=this.ovmap.getExtent();var a=null;if(d){a=new OpenLayers.Pixel(Math.round(1/b*(e.lon-d.left)),Math.round(1/b*(d.top-e.lat)))}return a},CLASS_NAME:"OpenLayers.Control.OverviewMap"});OpenLayers.Feature=OpenLayers.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:OpenLayers.Popup.AnchoredBubble,popup:null,initialize:function(a,d,b){this.layer=a;this.lonlat=d;this.data=(b!=null)?b:{};this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){if((this.layer!=null)&&(this.layer.map!=null)){if(this.popup!=null){this.layer.map.removePopup(this.popup)}}this.layer=null;this.id=null;this.lonlat=null;this.data=null;if(this.marker!=null){this.destroyMarker(this.marker);this.marker=null}if(this.popup!=null){this.destroyPopup(this.popup);this.popup=null}},onScreen:function(){var b=false;if((this.layer!=null)&&(this.layer.map!=null)){var a=this.layer.map.getExtent();b=a.containsLonLat(this.lonlat)}return b},createMarker:function(){if(this.lonlat!=null){this.marker=new OpenLayers.Marker(this.lonlat,this.data.icon)}return this.marker},destroyMarker:function(){this.marker.destroy()},createPopup:function(b){if(this.lonlat!=null){var d=this.id+"_popup";var a=(this.marker)?this.marker.icon:null;if(!this.popup){this.popup=new this.popupClass(d,this.lonlat,this.data.popupSize,this.data.popupContentHTML,a,b)}if(this.data.overflow!=null){this.popup.contentDiv.style.overflow=this.data.overflow}this.popup.feature=this}return this.popup},destroyPopup:function(){if(this.popup){this.popup.feature=null;this.popup.destroy();this.popup=null}},CLASS_NAME:"OpenLayers.Feature"});OpenLayers.Handler.Click=OpenLayers.Class(OpenLayers.Handler,{delay:300,single:true,"double":false,pixelTolerance:0,stopSingle:false,stopDouble:false,timerId:null,down:null,rightclickTimerId:null,initialize:function(d,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments);if(this.pixelTolerance!=null){this.mousedown=function(e){this.down=e.xy;return true}}},mousedown:null,mouseup:function(b){var a=true;if(this.checkModifiers(b)&&this.control.handleRightClicks&&OpenLayers.Event.isRightClick(b)){a=this.rightclick(b)}return a},rightclick:function(b){if(this.passesTolerance(b)){if(this.rightclickTimerId!=null){this.clearTimer();this.callback("dblrightclick",[b]);return !this.stopDouble}else{var a=this["double"]?OpenLayers.Util.extend({},b):this.callback("rightclick",[b]);var d=OpenLayers.Function.bind(this.delayedRightCall,this,a);this.rightclickTimerId=window.setTimeout(d,this.delay)}}return !this.stopSingle},delayedRightCall:function(a){this.rightclickTimerId=null;if(a){this.callback("rightclick",[a])}return !this.stopSingle},dblclick:function(a){if(this.passesTolerance(a)){if(this["double"]){this.callback("dblclick",[a])}this.clearTimer()}return !this.stopDouble},click:function(b){if(this.passesTolerance(b)){if(this.timerId!=null){this.clearTimer()}else{var a=this.single?OpenLayers.Util.extend({},b):null;this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,a),this.delay)}}return !this.stopSingle},passesTolerance:function(b){var d=true;if(this.pixelTolerance!=null&&this.down){var a=Math.sqrt(Math.pow(this.down.x-b.xy.x,2)+Math.pow(this.down.y-b.xy.y,2));if(a>this.pixelTolerance){d=false}}return d},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId);this.timerId=null}},delayedCall:function(a){this.timerId=null;if(a){this.callback("click",[a])}},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();this.down=null;a=true}return a},CLASS_NAME:"OpenLayers.Handler.Click"});OpenLayers.Handler.Drag=OpenLayers.Class(OpenLayers.Handler,{started:false,stopDown:true,dragging:false,last:null,start:null,oldOnselectstart:null,interval:0,timeoutId:null,initialize:function(d,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},down:function(a){},move:function(a){},up:function(a){},out:function(a){},mousedown:function(b){var a=true;this.dragging=false;if(this.checkModifiers(b)&&OpenLayers.Event.isLeftClick(b)){this.started=true;this.start=b.xy;this.last=b.xy;this.map.div.style.cursor="move";this.down(b);this.callback("down",[b.xy]);OpenLayers.Event.stop(b);if(!this.oldOnselectstart){this.oldOnselectstart=(document.onselectstart)?document.onselectstart:function(){return true};document.onselectstart=function(){return false}}a=!this.stopDown}else{this.started=false;this.start=null;this.last=null}return a},mousemove:function(a){if(this.started&&!this.timeoutId&&(a.xy.x!=this.last.x||a.xy.y!=this.last.y)){if(this.interval>0){this.timeoutId=setTimeout(OpenLayers.Function.bind(this.removeTimeout,this),this.interval)}this.dragging=true;this.move(a);this.callback("move",[a.xy]);if(!this.oldOnselectstart){this.oldOnselectstart=document.onselectstart;document.onselectstart=function(){return false}}this.last=this.evt.xy}return true},removeTimeout:function(){this.timeoutId=null},mouseup:function(b){if(this.started){var a=(this.start!=this.last);this.started=false;this.dragging=false;this.map.div.style.cursor="";this.up(b);this.callback("up",[b.xy]);if(a){this.callback("done",[b.xy])}document.onselectstart=this.oldOnselectstart}return true},mouseout:function(b){if(this.started&&OpenLayers.Util.mouseLeft(b,this.map.div)){var a=(this.start!=this.last);this.started=false;this.dragging=false;this.map.div.style.cursor="";this.out(b);this.callback("out",[]);if(a){this.callback("done",[b.xy])}if(document.onselectstart){document.onselectstart=this.oldOnselectstart}}return true},click:function(a){return(this.start==this.last)},activate:function(){var a=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragging=false;a=true}return a},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.started=false;this.dragging=false;this.start=null;this.last=null;a=true}return a},CLASS_NAME:"OpenLayers.Handler.Drag"});OpenLayers.Handler.Feature=OpenLayers.Class(OpenLayers.Handler,{EVENTMAP:{click:{"in":"click",out:"clickout"},mousemove:{"in":"over",out:"out"},dblclick:{"in":"dblclick",out:null},mousedown:{"in":null,out:null},mouseup:{"in":null,out:null}},feature:null,lastFeature:null,down:null,up:null,clickoutTolerance:4,geometryTypes:null,stopClick:true,stopDown:true,stopUp:false,initialize:function(e,b,d,a){OpenLayers.Handler.prototype.initialize.apply(this,[e,d,a]);this.layer=b},mousedown:function(a){this.down=a.xy;return this.handle(a)?!this.stopDown:true},mouseup:function(a){this.up=a.xy;return this.handle(a)?!this.stopUp:true},click:function(a){return this.handle(a)?!this.stopClick:true},mousemove:function(a){if(!this.callbacks.over&&!this.callbacks.out){return true}this.handle(a);return true},dblclick:function(a){return !this.handle(a)},geometryTypeMatches:function(a){return this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,a.geometry.CLASS_NAME)>-1},handle:function(a){if(this.feature&&!this.feature.layer){this.feature=null}var d=a.type;var h=false;var g=!!(this.feature);var e=(d=="click"||d=="dblclick");this.feature=this.layer.getFeatureFromEvent(a);if(this.feature&&!this.feature.layer){this.feature=null}if(this.lastFeature&&!this.lastFeature.layer){this.lastFeature=null}if(this.feature){var b=(this.feature!=this.lastFeature);if(this.geometryTypeMatches(this.feature)){if(g&&b){if(this.lastFeature){this.triggerCallback(d,"out",[this.lastFeature])}this.triggerCallback(d,"in",[this.feature])}else{if(!g||e){this.triggerCallback(d,"in",[this.feature])}}this.lastFeature=this.feature;h=true}else{if(this.lastFeature&&(g&&b||e)){this.triggerCallback(d,"out",[this.lastFeature])}this.feature=null}}else{if(this.lastFeature&&(g||e)){this.triggerCallback(d,"out",[this.lastFeature])}}return h},triggerCallback:function(e,g,b){var d=this.EVENTMAP[e][g];if(d){if(e=="click"&&g=="out"&&this.up&&this.down){var a=Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2));if(a<=this.clickoutTolerance){this.callback(d,b)}}else{this.callback(d,b)}}},activate:function(){var a=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.moveLayerToTop();this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});a=true}return a},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.moveLayerBack();this.feature=null;this.lastFeature=null;this.down=null;this.up=null;this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});a=true}return a},handleMapEvents:function(a){if(!a.property||a.property=="order"){this.moveLayerToTop()}},moveLayerToTop:function(){var a=Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1;this.layer.setZIndex(a)},moveLayerBack:function(){var a=this.layer.getZIndex()-1;if(a>=this.map.Z_INDEX_BASE.Feature){this.layer.setZIndex(a)}else{this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))}},CLASS_NAME:"OpenLayers.Handler.Feature"});OpenLayers.Handler.Hover=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:false,px:null,timerId:null,initialize:function(d,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},mousemove:function(a){if(this.passesTolerance(a.xy)){this.clearTimer();this.callback("move",[a]);this.px=a.xy;a=OpenLayers.Util.extend({},a);this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,a),this.delay)}return !this.stopMove},mouseout:function(a){if(OpenLayers.Util.mouseLeft(a,this.map.div)){this.clearTimer();this.callback("move",[a])}return true},passesTolerance:function(b){var d=true;if(this.pixelTolerance&&this.px){var a=Math.sqrt(Math.pow(this.px.x-b.x,2)+Math.pow(this.px.y-b.y,2));if(a<this.pixelTolerance){d=false}}return d},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId);this.timerId=null}},delayedCall:function(a){this.callback("pause",[a])},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();a=true}return a},CLASS_NAME:"OpenLayers.Handler.Hover"});OpenLayers.Handler.Keyboard=OpenLayers.Class(OpenLayers.Handler,{KEY_EVENTS:["keydown","keyup"],eventListener:null,initialize:function(d,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.eventListener=OpenLayers.Function.bindAsEventListener(this.handleKeyEvent,this)},destroy:function(){this.deactivate();this.eventListener=null;OpenLayers.Handler.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){for(var b=0,a=this.KEY_EVENTS.length;b<a;b++){OpenLayers.Event.observe(document,this.KEY_EVENTS[b],this.eventListener)}return true}else{return false}},deactivate:function(){var d=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){for(var b=0,a=this.KEY_EVENTS.length;b<a;b++){OpenLayers.Event.stopObserving(document,this.KEY_EVENTS[b],this.eventListener)}d=true}return d},handleKeyEvent:function(a){if(this.checkModifiers(a)){this.callback(a.type,[a])}},CLASS_NAME:"OpenLayers.Handler.Keyboard"});OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener:null,mousePosition:null,initialize:function(d,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.wheelListener=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this)},destroy:function(){OpenLayers.Handler.prototype.destroy.apply(this,arguments);this.wheelListener=null},onWheelEvent:function(p){if(!this.map||!this.checkModifiers(p)){return}var l=false;var q=false;var h=false;var b=OpenLayers.Event.element(p);while((b!=null)&&!h&&!l){if(!l){try{if(b.currentStyle){d=b.currentStyle.overflow}else{var a=document.defaultView.getComputedStyle(b,null);var d=a.getPropertyValue("overflow")}l=(d&&(d=="auto")||(d=="scroll"))}catch(g){}}if(!q){for(var m=0,o=this.map.layers.length;m<o;m++){if(b==this.map.layers[m].div||b==this.map.layers[m].pane){q=true;break}}}h=(b==this.map.div);b=b.parentNode}if(!l&&h){if(q){this.wheelZoom(p)}OpenLayers.Event.stop(p)}},wheelZoom:function(a){var b=0;if(!a){a=window.event}if(a.wheelDelta){b=a.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){b=-b}}else{if(a.detail){b=-a.detail/3}}if(b){if(this.mousePosition){a.xy=this.mousePosition}if(!a.xy){a.xy=this.map.getPixelFromLonLat(this.map.getCenter())}if(b<0){this.callback("down",[a,b])}else{this.callback("up",[a,b])}}},mousemove:function(a){this.mousePosition=a.xy},activate:function(a){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var b=this.wheelListener;OpenLayers.Event.observe(window,"DOMMouseScroll",b);OpenLayers.Event.observe(window,"mousewheel",b);OpenLayers.Event.observe(document,"mousewheel",b);return true}else{return false}},deactivate:function(a){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){var b=this.wheelListener;OpenLayers.Event.stopObserving(window,"DOMMouseScroll",b);OpenLayers.Event.stopObserving(window,"mousewheel",b);OpenLayers.Event.stopObserving(document,"mousewheel",b);return true}else{return false}},CLASS_NAME:"OpenLayers.Handler.MouseWheel"});OpenLayers.Layer=OpenLayers.Class({id:null,name:null,div:null,opacity:null,alwaysInRange:null,EVENT_TYPES:["loadstart","loadend","loadcancel","visibilitychanged","move","moveend"],events:null,map:null,isBaseLayer:false,alpha:false,displayInLayerSwitcher:true,visibility:true,attribution:null,inRange:false,imageSize:null,imageOffset:null,options:null,eventListeners:null,gutter:0,projection:null,units:null,scales:null,resolutions:null,maxExtent:null,minExtent:null,maxResolution:null,minResolution:null,numZoomLevels:null,minScale:null,maxScale:null,displayOutsideMaxExtent:false,wrapDateLine:false,transitionEffect:null,SUPPORTED_TRANSITIONS:["resize"],initialize:function(b,a){this.addOptions(a);this.name=b;if(this.id==null){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");this.div=OpenLayers.Util.createDiv(this.id);this.div.style.width="100%";this.div.style.height="100%";this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES);if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}}if(this.wrapDateLine){this.displayOutsideMaxExtent=true}},destroy:function(a){if(a==null){a=true}if(this.map!=null){this.map.removeLayer(this,a)}this.projection=null;this.map=null;this.name=null;this.div=null;this.options=null;if(this.events){if(this.eventListeners){this.events.un(this.eventListeners)}this.events.destroy()}this.eventListeners=null;this.events=null},clone:function(a){if(a==null){a=new OpenLayers.Layer(this.name,this.options)}OpenLayers.Util.applyDefaults(a,this);a.map=null;return a},setName:function(a){if(a!=this.name){this.name=a;if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"name"})}}},addOptions:function(a){if(this.options==null){this.options={}}OpenLayers.Util.extend(this.options,a);OpenLayers.Util.extend(this,a)},onMapResize:function(){},redraw:function(){var a=false;if(this.map){this.inRange=this.calculateInRange();var b=this.getExtent();if(b&&this.inRange&&this.visibility){this.moveTo(b,true,false);a=true}}return a},moveTo:function(b,a,d){var e=this.visibility;if(!this.isBaseLayer){e=e&&this.inRange}this.display(e)},setMap:function(b){if(this.map==null){this.map=b;this.maxExtent=this.maxExtent||this.map.maxExtent;this.projection=this.projection||this.map.projection;if(this.projection&&typeof this.projection=="string"){this.projection=new OpenLayers.Projection(this.projection)}this.units=this.projection.getUnits()||this.units||this.map.units;this.initResolutions();if(!this.isBaseLayer){this.inRange=this.calculateInRange();var a=((this.visibility)&&(this.inRange));this.div.style.display=a?"":"none"}this.setTileSize()}},removeMap:function(a){},getImageSize:function(){return(this.imageSize||this.tileSize)},setTileSize:function(a){var b=(a)?a:((this.tileSize)?this.tileSize:this.map.getTileSize());this.tileSize=b;if(this.gutter){this.imageOffset=new OpenLayers.Pixel(-this.gutter,-this.gutter);this.imageSize=new OpenLayers.Size(b.w+(2*this.gutter),b.h+(2*this.gutter))}},getVisibility:function(){return this.visibility},setVisibility:function(a){if(a!=this.visibility){this.visibility=a;this.display(a);this.redraw();if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"visibility"})}this.events.triggerEvent("visibilitychanged")}},display:function(a){var b=this.calculateInRange();if(a!=(this.div.style.display!="none")){this.div.style.display=(a&&b)?"block":"none"}},calculateInRange:function(){var b=false;if(this.alwaysInRange){b=true}else{if(this.map){var a=this.map.getResolution();b=((a>=this.minResolution)&&(a<=this.maxResolution))}}return b},setIsBaseLayer:function(a){if(a!=this.isBaseLayer){this.isBaseLayer=a;if(this.map!=null){this.map.events.triggerEvent("changebaselayer",{layer:this})}}},initResolutions:function(){var s=new Array("projection","units","scales","resolutions","maxScale","minScale","maxResolution","minResolution","minExtent","maxExtent","numZoomLevels","maxZoomLevel");var b=["projection","units"];var g=false;var e={};for(var h=0,o=s.length;h<o;h++){var u=s[h];if(this.options[u]&&OpenLayers.Util.indexOf(b,u)==-1){g=true}e[u]=this.options[u]||this.map[u]}if(this.alwaysInRange==null){this.alwaysInRange=!g}if((this.options.minScale!=null||this.options.maxScale!=null)&&this.options.scales==null){e.scales=null}if((this.options.minResolution!=null||this.options.maxResolution!=null)&&this.options.resolutions==null){e.resolutions=null}if((!e.numZoomLevels)&&(e.maxZoomLevel)){e.numZoomLevels=e.maxZoomLevel+1}if((e.scales!=null)||(e.resolutions!=null)){if(e.scales!=null){e.resolutions=[];for(var h=0,o=e.scales.length;h<o;h++){var d=e.scales[h];e.resolutions[h]=OpenLayers.Util.getResolutionFromScale(d,e.units)}}e.numZoomLevels=e.resolutions.length}else{if(e.minScale){e.maxResolution=OpenLayers.Util.getResolutionFromScale(e.minScale,e.units)}else{if(e.maxResolution=="auto"){var t=this.map.getSize();var r=e.maxExtent.getWidth()/t.w;var m=e.maxExtent.getHeight()/t.h;e.maxResolution=Math.max(r,m)}}if(e.maxScale!=null){e.minResolution=OpenLayers.Util.getResolutionFromScale(e.maxScale,e.units)}else{if((e.minResolution=="auto")&&(e.minExtent!=null)){var t=this.map.getSize();var r=e.minExtent.getWidth()/t.w;var m=e.minExtent.getHeight()/t.h;e.minResolution=Math.max(r,m)}}if(e.minResolution!=null&&this.options.numZoomLevels==undefined){var q=e.maxResolution/e.minResolution;e.numZoomLevels=Math.floor(Math.log(q)/Math.log(2))+1}e.resolutions=new Array(e.numZoomLevels);var a=2;if(typeof e.minResolution=="number"&&e.numZoomLevels>1){a=Math.pow((e.maxResolution/e.minResolution),(1/(e.numZoomLevels-1)))}for(var h=0;h<e.numZoomLevels;h++){var p=e.maxResolution/Math.pow(a,h);e.resolutions[h]=p}}e.resolutions.sort(function(w,v){return(v-w)});this.resolutions=e.resolutions;this.maxResolution=e.resolutions[0];var l=e.resolutions.length-1;this.minResolution=e.resolutions[l];this.scales=[];for(var h=0,o=e.resolutions.length;h<o;h++){this.scales[h]=OpenLayers.Util.getScaleFromResolution(e.resolutions[h],e.units)}this.minScale=this.scales[0];this.maxScale=this.scales[this.scales.length-1];this.numZoomLevels=e.numZoomLevels},getResolution:function(){var a=this.map.getZoom();return this.getResolutionForZoom(a)},getExtent:function(){return this.map.calculateBounds()},getZoomForExtent:function(b,d){var e=this.map.getSize();var a=Math.max(b.getWidth()/e.w,b.getHeight()/e.h);return this.getZoomForResolution(a,d)},getDataExtent:function(){},getResolutionForZoom:function(d){d=Math.max(0,Math.min(d,this.resolutions.length-1));var b;if(this.map.fractionalZoom){var a=Math.floor(d);var e=Math.ceil(d);b=this.resolutions[a]-((d-a)*(this.resolutions[a]-this.resolutions[e]))}else{b=this.resolutions[Math.round(d)]}return b},getZoomForResolution:function(g,a){var s;if(this.map.fractionalZoom){var p=0;var d=this.resolutions.length-1;var e=this.resolutions[p];var b=this.resolutions[d];var o;for(var h=0,l=this.resolutions.length;h<l;++h){o=this.resolutions[h];if(o>=g){e=o;p=h}if(o<=g){b=o;d=h;break}}var m=e-b;if(m>0){s=p+((e-g)/m)}else{s=p}}else{var q;var r=Number.POSITIVE_INFINITY;for(var h=0,l=this.resolutions.length;h<l;h++){if(a){q=Math.abs(this.resolutions[h]-g);if(q>r){break}r=q}else{if(this.resolutions[h]<g){break}}}s=Math.max(0,h-1)}return s},getLonLatFromViewPortPx:function(b){var g=null;if(b!=null){var e=this.map.getSize();var a=this.map.getCenter();if(a){var d=this.map.getResolution();var l=b.x-(e.w/2);var h=b.y-(e.h/2);g=new OpenLayers.LonLat(a.lon+l*d,a.lat-h*d);if(this.wrapDateLine){g=g.wrapDateLine(this.maxExtent)}}}return g},getViewPortPxFromLonLat:function(e){var b=null;if(e!=null){var a=this.map.getResolution();var d=this.map.getExtent();b=new OpenLayers.Pixel((1/a*(e.lon-d.left)),(1/a*(d.top-e.lat)))}return b},setOpacity:function(b){if(b!=this.opacity){this.opacity=b;for(var e=0,a=this.div.childNodes.length;e<a;++e){var d=this.div.childNodes[e].firstChild;OpenLayers.Util.modifyDOMElement(d,null,null,null,null,null,null,b)}}},getZIndex:function(){return this.div.style.zIndex},setZIndex:function(a){this.div.style.zIndex=a},adjustBounds:function(b){if(this.gutter){var a=this.gutter*this.map.getResolution();b=new OpenLayers.Bounds(b.left-a,b.bottom-a,b.right+a,b.top+a)}if(this.wrapDateLine){var d={rightTolerance:this.getResolution()};b=b.wrapDateLine(this.maxExtent,d)}return b},CLASS_NAME:"OpenLayers.Layer"});OpenLayers.Popup.FramedCloud=OpenLayers.Class(OpenLayers.Popup.Framed,{contentDisplayClass:"olFramedCloudPopupContent",autoSize:true,panMapIfOutOfView:true,imageSize:new OpenLayers.Size(676,736),isAlphaImage:false,fixedRelativePosition:false,positionBlocks:{tl:{offset:new OpenLayers.Pixel(44,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,32,80,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,54),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(0,-668)}]},tr:{offset:new OpenLayers.Pixel(-45,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,54),anchor:new OpenLayers.Bounds(0,0,null,null),position:new OpenLayers.Pixel(-215,-668)}]},bl:{offset:new OpenLayers.Pixel(45,0),padding:new OpenLayers.Bounds(8,9,8,40),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,54),anchor:new OpenLayers.Bounds(null,null,0,0),position:new OpenLayers.Pixel(-101,-674)}]},br:{offset:new OpenLayers.Pixel(-44,0),padding:new OpenLayers.Bounds(8,9,8,40),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,54),anchor:new OpenLayers.Bounds(0,null,null,0),position:new OpenLayers.Pixel(-311,-674)}]}},minSize:new OpenLayers.Size(105,10),maxSize:new OpenLayers.Size(600,660),initialize:function(l,d,h,b,a,g,e){this.imageSrc=OpenLayers.Util.getImagesLocation()+"cloud-popup-relative.png";OpenLayers.Popup.Framed.prototype.initialize.apply(this,arguments);this.contentDiv.className=this.contentDisplayClass},destroy:function(){OpenLayers.Popup.Framed.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Popup.FramedCloud"});mapfish.PrintProtocol=OpenLayers.Class({config:null,spec:null,params:null,initialize:function(d,a,g,b,e){this.config=a;this.spec={pages:[]};this.addMapParams(g,d,b);this.params=e},getAllInOneUrl:function(){var b=new OpenLayers.Format.JSON();var a=this.config.printURL+"?spec="+b.write(this.encodeForURL(this.spec));if(this.params){a+="&"+OpenLayers.Util.getParameterString(this.params)}return a},createPDF:function(l,a,b,e){var d=new OpenLayers.Format.JSON().write(this.spec);OpenLayers.Console.info(d);try{var m="UTF-8";var h=OpenLayers.Util.applyDefaults({url:this.config.createURL},this.params);OpenLayers.Request.POST({url:this.config.createURL,data:d,params:h,headers:{"CONTENT-TYPE":"application/json; charset="+m},callback:function(p){if(p.status>=200&&p.status<300){var o=new OpenLayers.Format.JSON();var q=o.read(p.responseText);if(q&&q.getURL){this.openPdf(q,l,a,e)}else{b.call(e,p)}}else{b.call(e,p)}},scope:this})}catch(g){OpenLayers.Console.warn("Cannot request the print service by AJAX. You must set the 'OpenLayers.ProxyHost' variable. Fallback to GET method");window.open(this.getAllInOneUrl());l.call(e,g)}},openPdf:function(d,e,a,b){OpenLayers.Console.info(d.getURL);if(Ext.isIE||Ext.isOpera){a.call(b,d)}else{window.location=d.getURL;e.call(b)}},fixOverrides:function(l,e){l=OpenLayers.Util.extend({},l);var d=false;var a;for(var b=0;b<e.layers.length;++b){var h=e.layers[b];a=h.name;if(!l[a]){l[a]={}}else{if(l[a].overview){d=true}}}if(d){for(a in l){var g=l[a];if(!g.overview){g.overview=false}}}return l},addMapParams:function(o,a,b){var p=this.spec;p.dpi=b;p.units=a.baseLayer.units;p.srs=a.baseLayer.projection.getCode();var d=p.layers=[];o=this.fixOverrides(o,a);for(var e=0;e<a.layers.length;++e){var m=a.layers[e];var g=OpenLayers.Util.extend({},o[m.name]);OpenLayers.Util.extend(g,g[b]);if((m.getVisibility()&&g.visibility!==false)||g.visibility===true){var l=m.CLASS_NAME;var q=mapfish.PrintProtocol.SUPPORTED_TYPES[l];if(q){var h=q.call(this,m);if(h){this.applyOverrides(h,g);if(m.isBaseLayer){d.unshift(h)}else{d.push(h)}}}else{if(!q){OpenLayers.Console.error("Don't know how to print a layer of type "+l+" ("+m.name+")")}}}}},applyOverrides:function(b,e){for(var a in e){if(isNaN(parseInt(a))){var d=e[a];if(a=="layers"||a=="styles"){d=mapfish.Util.fixArray(d)}if(a=="visibility"){}else{if(b[a]!=null||a=="overview"){b[a]=d}else{b.customParams[a]=d}}}}},convertLayer:function(b){var a=b.url;if(a instanceof Array){a=a[0]}return{baseURL:mapfish.Util.relativeToAbsoluteURL(a),opacity:(b.opacity!=null)?b.opacity:1,singleTile:b.singleTile,customParams:{}}},convertWMSLayer:function(d){var a=OpenLayers.Util.extend(this.convertLayer(d),{type:"WMS",layers:mapfish.Util.fixArray(d.params.LAYERS),format:d.params.FORMAT||d.DEFAULT_PARAMS.format,styles:mapfish.Util.fixArray(d.params.STYLES||d.DEFAULT_PARAMS.styles)});for(var b in d.params){var e=b.toLowerCase();if(d.DEFAULT_PARAMS[e]==null&&e!="layers"&&e!="width"&&e!="height"&&e!="srs"){a.customParams[b]=d.params[b]}}return a},convertMapServerLayer:function(d){var a=OpenLayers.Util.extend(this.convertLayer(d),{type:"MapServer",layers:mapfish.Util.fixArray(d.params.LAYERS||d.params.layers),format:d.params.FORMAT||d.params.format||d.DEFAULT_PARAMS.format});for(var b in d.params){var e=b.toLowerCase();if(d.DEFAULT_PARAMS[e]==null&&e!="layers"&&e!="format"&&e!="width"&&e!="height"&&e!="srs"){a.customParams[b]=d.params[b]}}return a},convertTileCacheLayer:function(a){return OpenLayers.Util.extend(this.convertLayer(a),{type:"TileCache",layer:a.layername,maxExtent:a.maxExtent.toArray(),tileSize:[a.tileSize.w,a.tileSize.h],extension:a.extension,resolutions:a.resolutions})},convertImageLayer:function(b){var a=b.getURL(b.extent);return{type:"Image",baseURL:mapfish.Util.relativeToAbsoluteURL(a),opacity:(b.opacity!=null)?b.opacity:1,extent:b.extent.toArray(),pixelSize:[b.size.w,b.size.h],name:b.name}},convertVectorLayer:function(o){var g=o.features;var d=[];var t={};var q=new OpenLayers.Format.GeoJSON();var b=1;for(var m=0;m<g.length;++m){var u=g[m];var a=u.style||o.style||o.styleMap.createSymbolizer(u,u.renderIntent);var e;if(a._printId){e=a._printId}else{a._printId=e=b++;t[e]=a;if(a.externalGraphic){a.externalGraphic=mapfish.Util.relativeToAbsoluteURL(a.externalGraphic)}}var h=q.extract.feature.call(q,u);h.properties=OpenLayers.Util.extend({_style:e},h.properties);for(var s in h.properties){var p=h.properties[s];if(p instanceof Object&&!(p instanceof String)){delete h.properties[s]}}d.push(h)}for(var r in t){delete t[r]._printId}var l={type:"FeatureCollection",features:d};return OpenLayers.Util.extend(this.convertLayer(o),{type:"Vector",styles:t,styleProperty:"_style",geoJson:l,name:o.name,opacity:(o.opacity!=null)?o.opacity:1})},encodeForURL:function(l){if(l==null){return null}var d=typeof l;Ext.type(l);if(d=="string"){return escape(l.replace(/[\n]/g,"\\n"))}else{if(d=="object"&&l.constructor==Array){var m=[];for(var b=0;b<l.length;++b){var h=this.encodeForURL(l[b]);if(h!=null){m.push(h)}}return m}else{if(d=="object"&&l.CLASS_NAME&&l.CLASS_NAME=="OpenLayers.Feature.Vector"){return new OpenLayers.Format.WKT().write(l)}else{if(d=="object"){var g={};for(var a in l){var e=this.encodeForURL(l[a]);if(e!=null){g[a]=e}}return g}else{return l}}}}},CLASS_NAME:"mapfish.PrintProtocol"});mapfish.PrintProtocol.getConfiguration=function(b,h,a,d,g){try{g=OpenLayers.Util.extend(g,{url:b});OpenLayers.Request.GET({url:b,params:g,callback:function(m){if(m.status>=200&&m.status<300){var l=new OpenLayers.Format.JSON();var o=l.read(m.responseText);if(o){h.call(d,o)}else{a.call(d,m)}}else{a.call(d,m)}}})}catch(e){a.call(d,e)}};mapfish.PrintProtocol.IGNORED=function(){return null};mapfish.PrintProtocol.SUPPORTED_TYPES={"OpenLayers.Layer":mapfish.PrintProtocol.IGNORED,"OpenLayers.Layer.WMS":mapfish.PrintProtocol.prototype.convertWMSLayer,"OpenLayers.Layer.WMS.Untiled":mapfish.PrintProtocol.prototype.convertWMSLayer,"OpenLayers.Layer.TileCache":mapfish.PrintProtocol.prototype.convertTileCacheLayer,"OpenLayers.Layer.Vector":mapfish.PrintProtocol.prototype.convertVectorLayer,"OpenLayers.Layer.GML":mapfish.PrintProtocol.prototype.convertVectorLayer,"OpenLayers.Layer.PointTrack":mapfish.PrintProtocol.prototype.convertVectorLayer,"OpenLayers.Layer.MapServer":mapfish.PrintProtocol.prototype.convertMapServerLayer,"OpenLayers.Layer.MapServer.Untiled":mapfish.PrintProtocol.prototype.convertMapServerLayer,"OpenLayers.Layer.Image":mapfish.PrintProtocol.prototype.convertImageLayer};Ext.namespace("mapfish.widgets");mapfish.widgets.Shortcuts=function(a){Ext.apply(this,a);mapfish.widgets.Shortcuts.superclass.constructor.call(this)};Ext.extend(mapfish.widgets.Shortcuts,Ext.Container,{combo:null,initComponent:function(){this.combo=new Ext.form.ComboBox({name:"shortcuts",hiddenName:"",store:this.store,valueField:"value",displayField:"text",editable:false,mode:"local",triggerAction:"all",emptyText:"Select a value ...",lazyRender:true,width:150});this.combo.on("select",this.recenter,this);mapfish.widgets.Shortcuts.superclass.initComponent.call(this)},onRender:function(b,a){this.add(this.combo);if(!this.el){this.el=document.createElement("div")}mapfish.widgets.Shortcuts.superclass.onRender.apply(this,arguments);this.initTemplates();this.applyTemplates()},initTemplates:function(){var a=this.templates||{};if(!a.header){a.header=new Ext.Template("some text before")}if(!a.footer){a.footer=new Ext.Template("some text after")}this.templates=a},applyTemplates:function(){for(var a in this.templates){var d=this.templates[a];var b=document.createElement("div");d.overwrite(b);switch(a){case"header":d.insertBefore(this.el);break;case"footer":d.insertAfter(this.el);break}}},recenter:function(b,a){this.map.zoomToExtent(a.get("bbox"))}});Ext.reg("shortcuts",mapfish.widgets.Shortcuts);OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,onStart:function(b,a){},onDrag:function(b,a){},onComplete:function(b,a){},layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(b,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.layer=b;this.handlers={drag:new OpenLayers.Handler.Drag(this,OpenLayers.Util.extend({down:this.downFeature,move:this.moveFeature,up:this.upFeature,out:this.cancel,done:this.doneDragging},this.dragCallbacks)),feature:new OpenLayers.Handler.Feature(this,this.layer,OpenLayers.Util.extend({over:this.overFeature,out:this.outFeature},this.featureCallbacks),{geometryTypes:this.geometryTypes})}},destroy:function(){this.layer=null;OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return(this.handlers.feature.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments))},deactivate:function(){this.handlers.drag.deactivate();this.handlers.feature.deactivate();this.feature=null;this.dragging=false;this.lastPixel=null;return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},overFeature:function(a){if(!this.handlers.drag.dragging){this.feature=a;this.handlers.drag.activate();this.over=true;this.map.div.style.cursor="move"}else{if(this.feature.id==a.id){this.over=true}else{this.over=false}}},downFeature:function(a){this.lastPixel=a;this.onStart(this.feature,a)},moveFeature:function(a){var b=this.map.getResolution();this.feature.geometry.move(b*(a.x-this.lastPixel.x),b*(this.lastPixel.y-a.y));this.layer.drawFeature(this.feature);this.lastPixel=a;this.onDrag(this.feature,a)},upFeature:function(a){if(!this.over){this.handlers.drag.deactivate();this.feature=null;this.map.div.style.cursor="default"}else{this.map.div.style.cursor="move"}},doneDragging:function(a){this.onComplete(this.feature,a)},outFeature:function(a){if(!this.handlers.drag.dragging){this.over=false;this.handlers.drag.deactivate();this.map.div.style.cursor="default";this.feature=null}else{if(this.feature.id==a.id){this.over=false}}},cancel:function(){this.handlers.drag.deactivate();this.over=false},setMap:function(a){this.handlers.drag.setMap(a);this.handlers.feature.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.DragFeature"});OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,panned:false,interval:25,draw:function(){this.handler=new OpenLayers.Handler.Drag(this,{move:this.panMap,done:this.panMapDone},{interval:this.interval})},panMap:function(a){this.panned=true;this.map.pan(this.handler.last.x-a.x,this.handler.last.y-a.y,{dragging:this.handler.dragging,animate:false})},panMapDone:function(a){if(this.panned){this.panMap(a);this.panned=false}},CLASS_NAME:"OpenLayers.Control.DragPan"});OpenLayers.State={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"};OpenLayers.Feature.Vector=OpenLayers.Class(OpenLayers.Feature,{fid:null,geometry:null,attributes:null,bounds:null,state:null,style:null,renderIntent:"default",initialize:function(d,a,b){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,a]);this.lonlat=null;this.geometry=d?d:null;this.state=null;this.attributes={};if(a){this.attributes=OpenLayers.Util.extend(this.attributes,a)}this.style=b?b:null},destroy:function(){if(this.layer){this.layer.removeFeatures(this);this.layer=null}this.geometry=null;OpenLayers.Feature.prototype.destroy.apply(this,arguments)},clone:function(){return new OpenLayers.Feature.Vector(this.geometry?this.geometry.clone():null,this.attributes,this.style)},onScreen:function(e){var d=false;if(this.layer&&this.layer.map){var a=this.layer.map.getExtent();if(e){var b=this.geometry.getBounds();d=a.intersectsBounds(b)}else{var g=a.toGeometry();d=g.intersects(this.geometry)}}return d},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(b,e,d){var a=false;if(this.geometry){a=this.geometry.atPoint(b,e,d)}return a},destroyPopup:function(){},move:function(a){if(!this.layer||!this.geometry.move){return}var b;if(a.CLASS_NAME=="OpenLayers.LonLat"){b=this.layer.getViewPortPxFromLonLat(a)}else{b=a}var e=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat());var d=this.layer.map.getResolution();this.geometry.move(d*(b.x-e.x),d*(e.y-b.y));this.layer.drawFeature(this);return e},toState:function(a){if(a==OpenLayers.State.UPDATE){switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.DELETE:this.state=a;break;case OpenLayers.State.UPDATE:case OpenLayers.State.INSERT:break}}else{if(a==OpenLayers.State.INSERT){switch(this.state){case OpenLayers.State.UNKNOWN:break;default:this.state=a;break}}else{if(a==OpenLayers.State.DELETE){switch(this.state){case OpenLayers.State.INSERT:break;case OpenLayers.State.DELETE:break;case OpenLayers.State.UNKNOWN:case OpenLayers.State.UPDATE:this.state=a;break}}else{if(a==OpenLayers.State.UNKNOWN){this.state=a}}}}},CLASS_NAME:"OpenLayers.Feature.Vector"});OpenLayers.Feature.Vector.style={"default":{fillColor:"#ee9900",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},select:{fillColor:"blue",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer"},temporary:{fillColor:"yellow",fillOpacity:0.2,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"yellow",strokeOpacity:1,strokeLinecap:"round",strokeWidth:4,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"}};OpenLayers.Handler.Box=OpenLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:"olHandlerBoxZoomBox",boxCharacteristics:null,initialize:function(d,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments);var b={down:this.startBox,move:this.moveBox,out:this.removeBox,up:this.endBox};this.dragHandler=new OpenLayers.Handler.Drag(this,b,{keyMask:this.keyMask})},setMap:function(a){OpenLayers.Handler.prototype.setMap.apply(this,arguments);if(this.dragHandler){this.dragHandler.setMap(a)}},startBox:function(a){this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.dragHandler.start);this.zoomBox.className=this.boxDivClassName;this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.viewPortDiv.appendChild(this.zoomBox);this.map.div.style.cursor="crosshair"},moveBox:function(h){var e=this.dragHandler.start.x;var b=this.dragHandler.start.y;var d=Math.abs(e-h.x);var a=Math.abs(b-h.y);this.zoomBox.style.width=Math.max(1,d)+"px";this.zoomBox.style.height=Math.max(1,a)+"px";this.zoomBox.style.left=h.x<e?h.x+"px":e+"px";this.zoomBox.style.top=h.y<b?h.y+"px":b+"px";var g=this.getBoxCharacteristics();if(g.newBoxModel){if(h.x>e){this.zoomBox.style.width=Math.max(1,d-g.xOffset)+"px"}if(h.y>b){this.zoomBox.style.height=Math.max(1,a-g.yOffset)+"px"}}},endBox:function(b){var a;if(Math.abs(this.dragHandler.start.x-b.x)>5||Math.abs(this.dragHandler.start.y-b.y)>5){var l=this.dragHandler.start;var h=Math.min(l.y,b.y);var d=Math.max(l.y,b.y);var g=Math.min(l.x,b.x);var e=Math.max(l.x,b.x);a=new OpenLayers.Bounds(g,d,e,h)}else{a=this.dragHandler.start.clone()}this.removeBox();this.map.div.style.cursor="";this.callback("done",[a])},removeBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null;this.boxCharacteristics=null},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragHandler.activate();return true}else{return false}},deactivate:function(){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.dragHandler.deactivate();return true}else{return false}},getBoxCharacteristics:function(){if(!this.boxCharacteristics){var a=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width"))+1;var d=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-bottom-width"))+1;var b=OpenLayers.Util.getBrowserName()=="msie"?document.compatMode!="BackCompat":true;this.boxCharacteristics={xOffset:a,yOffset:d,newBoxModel:b}}return this.boxCharacteristics},CLASS_NAME:"OpenLayers.Handler.Box"});OpenLayers.Layer.HTTPRequest=OpenLayers.Class(OpenLayers.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:false,initialize:function(e,d,g,b){var a=arguments;a=[e,b];OpenLayers.Layer.prototype.initialize.apply(this,a);this.url=d;this.params=OpenLayers.Util.extend({},g)},destroy:function(){this.url=null;this.params=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.prototype.clone.apply(this,[a]);return a},setUrl:function(a){this.url=a},mergeNewParams:function(a){this.params=OpenLayers.Util.extend(this.params,a);return this.redraw()},redraw:function(a){if(a){return this.mergeNewParams({_olSalt:Math.random()})}else{return OpenLayers.Layer.prototype.redraw.apply(this,[])}},selectUrl:function(g,e){var d=1;for(var b=0,a=g.length;b<a;b++){d*=g.charCodeAt(b)*this.URL_HASH_FACTOR;d-=Math.floor(d)}return e[Math.floor(d*e.length)]},getFullRequestString:function(h,g){var b=g||this.url;var l=OpenLayers.Util.extend({},this.params);l=OpenLayers.Util.extend(l,h);var a=OpenLayers.Util.getParameterString(l);if(b instanceof Array){b=this.selectUrl(a,b)}var e=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(b));for(var m in l){if(m.toUpperCase() in e){delete l[m]}}a=OpenLayers.Util.getParameterString(l);var o=b;if(a!=""){var d=b.charAt(b.length-1);if((d=="&")||(d=="?")){o+=a}else{if(b.indexOf("?")==-1){o+="?"+a}else{o+="&"+a}}}return o},CLASS_NAME:"OpenLayers.Layer.HTTPRequest"});Ext.namespace("mapfish.widgets");Ext.namespace("mapfish.widgets.print");mapfish.widgets.print.Base={map:null,overrides:null,configUrl:null,config:null,layerTree:null,grids:null,serviceParams:null,mask:null,printing:false,initPrint:function(){if(this.overrides==null){this.overrides={}}if(this.config==null){mapfish.PrintProtocol.getConfiguration(this.configUrl,this.configReceived,this.configFailed,this,this.serviceParams);return true}else{this.fillComponent();return false}},configReceived:function(a){this.config=a;if(this.mask){this.mask.hide()}},configFailed:function(){if(this.mask){this.mask.hide()}},print:function(){if(this.mask){this.mask.msg=OpenLayers.Lang.translate("mf.print.generatingPDF");this.mask.show()}var a=new mapfish.PrintProtocol(this.map,this.config,this.overrides,this.getCurDpi(),this.serviceParams);if(this.layerTree){this.addLegends(a.spec)}if(this.grids){this.addGrids(a.spec)}this.fillSpec(a);this.printing=true;a.createPDF(function(){if(this.mask){this.mask.hide()}this.printing=false},function(e){var g="Ext.getCmp('printPopup').destroy();";if(Ext.isOpera){g+="window.open('"+e.getURL+"', '_blank');"}else{g+="window.location='"+e.getURL+"';"}var d=OpenLayers.Lang.translate("mf.print.pdfReady")+'<br /><br /><table onclick="'+g+'" border="0" cellpadding="0" cellspacing="0" class="x-btn-wrap" align="center"><tbody><tr><td class="x-btn-left"><i>&#160;</i></td><td class="x-btn-center"><em unselectable="on" class="x-btn x-btn-text">'+Ext.MessageBox.buttonText.ok+'</em></td><td class="x-btn-right"><i>&#160;</i></td></tr></tbody></table>';var b=new Ext.Window({bodyStyle:"padding: 7px;",width:200,id:"printPopup",autoHeight:true,constrain:true,closable:false,title:OpenLayers.Lang.translate("mf.information"),html:d,listeners:{destroy:function(){if(this.mask){this.mask.hide()}this.printing=false},scope:this}});b.show()},function(b){Ext.Msg.alert(OpenLayers.Lang.translate("mf.error"),OpenLayers.Lang.translate("mf.print.unableToPrint"));if(this.mask){this.mask.hide()}this.printing=false},this)},addGrids:function(o){var e=this.grids;if(e&&typeof e=="function"){e=e()}if(e){for(var b in e){var a=e[b];if(!a){continue}o[b]={};var h=o[b].data=[];var l=o[b].columns=[];var d=a.getColumnModel();var m=a.getStore();for(var g=0;g<d.getColumnCount();++g){if(!d.isHidden(g)){l.push(d.getDataIndex(g))}}m.each(function(p){var r={};for(var q in p.data){var s=p.data[q];if(s!=null){if(s.CLASS_NAME&&s.CLASS_NAME=="OpenLayers.Feature.Vector"){s=new OpenLayers.Format.WKT().write(s)}r[q]=s}}h.push(r)},this)}}},addLegends:function(d){var a=d.legends=[];function e(g){var l={name:g.attributes.printText||g.attributes.text,icon:mapfish.Util.relativeToAbsoluteURL(g.attributes.icon)};var h=l.classes=[];g.eachChild(function(m){h.push({name:m.attributes.printText||m.attributes.text,icon:mapfish.Util.relativeToAbsoluteURL(m.attributes.icon)})},this);a.push(l)}function b(g){g.eachChild(function(l){var h=l.attributes;if(h.checked&&h.layerNames){e(l)}else{b(l)}},this)}b(this.layerTree.getRootNode())},fillSpec:null,getCurDpi:null};OpenLayers.Control.DrawFeature=OpenLayers.Class(OpenLayers.Control,{layer:null,callbacks:null,EVENT_TYPES:["featureadded"],featureAdded:function(){},handlerOptions:null,initialize:function(b,d,a){this.EVENT_TYPES=OpenLayers.Control.DrawFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);this.callbacks=OpenLayers.Util.extend({done:this.drawFeature},this.callbacks);this.layer=b;this.handler=new d(this,this.callbacks,this.handlerOptions)},drawFeature:function(b){var a=new OpenLayers.Feature.Vector(b);a.state=OpenLayers.State.INSERT;this.layer.addFeatures([a]);this.featureAdded(a);this.events.triggerEvent("featureadded",{feature:a})},CLASS_NAME:"OpenLayers.Control.DrawFeature"});OpenLayers.Control.SelectFeature=OpenLayers.Class(OpenLayers.Control,{multipleKey:null,toggleKey:null,multiple:false,clickout:true,toggle:false,hover:false,box:false,onBeforeSelect:function(){},onSelect:function(){},onUnselect:function(){},scope:this,geometryTypes:null,layer:null,callbacks:null,selectStyle:null,renderIntent:"select",handlers:null,initialize:function(b,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.layer=b;var d={click:this.clickFeature,clickout:this.clickoutFeature};if(this.hover){d.over=this.overFeature;d.out=this.outFeature}this.callbacks=OpenLayers.Util.extend(d,this.callbacks);this.handlers={feature:new OpenLayers.Handler.Feature(this,b,this.callbacks,{geometryTypes:this.geometryTypes})};if(this.box){this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},{boxDivClassName:"olHandlerBoxSelectFeature"})}},activate:function(){if(!this.active){this.handlers.feature.activate();if(this.box&&this.handlers.box){this.handlers.box.activate()}}return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.active){this.handlers.feature.deactivate();if(this.handlers.box){this.handlers.box.deactivate()}}return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},unselectAll:function(a){var d;for(var b=this.layer.selectedFeatures.length-1;b>=0;--b){d=this.layer.selectedFeatures[b];if(!a||a.except!=d){this.unselect(d)}}},clickFeature:function(a){if(!this.hover){var b=(OpenLayers.Util.indexOf(this.layer.selectedFeatures,a)>-1);if(b){if(this.toggleSelect()){this.unselect(a)}else{if(!this.multipleSelect()){this.unselectAll({except:a})}}}else{if(!this.multipleSelect()){this.unselectAll({except:a})}this.select(a)}}},multipleSelect:function(){return this.multiple||this.handlers.feature.evt[this.multipleKey]},toggleSelect:function(){return this.toggle||this.handlers.feature.evt[this.toggleKey]},clickoutFeature:function(a){if(!this.hover&&this.clickout){this.unselectAll()}},overFeature:function(a){if(this.hover&&(OpenLayers.Util.indexOf(this.layer.selectedFeatures,a)==-1)){this.select(a)}},outFeature:function(a){if(this.hover){this.unselect(a)}},select:function(d){var a=this.onBeforeSelect.call(this.scope,d);if(a!==false){a=this.layer.events.triggerEvent("beforefeatureselected",{feature:d});if(a!==false){this.layer.selectedFeatures.push(d);var b=this.selectStyle||this.renderIntent;this.layer.drawFeature(d,b);this.layer.events.triggerEvent("featureselected",{feature:d});this.onSelect.call(this.scope,d)}}},unselect:function(a){this.layer.drawFeature(a,"default");OpenLayers.Util.removeItem(this.layer.selectedFeatures,a);this.layer.events.triggerEvent("featureunselected",{feature:a});this.onUnselect.call(this.scope,a)},selectBox:function(b){if(b instanceof OpenLayers.Bounds){var l=this.map.getLonLatFromPixel(new OpenLayers.Pixel(b.left,b.bottom));var d=this.map.getLonLatFromPixel(new OpenLayers.Pixel(b.right,b.top));var h=new OpenLayers.Bounds(l.lon,l.lat,d.lon,d.lat);if(!this.multipleSelect()){this.unselectAll()}var m=this.multiple;this.multiple=true;for(var g=0,a=this.layer.features.length;g<a;++g){var e=this.layer.features[g];if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,e.geometry.CLASS_NAME)>-1){if(h.toGeometry().intersects(e.geometry)){if(OpenLayers.Util.indexOf(this.layer.selectedFeatures,e)==-1){this.select(e)}}}}this.multiple=m}},setMap:function(a){this.handlers.feature.setMap(a);if(this.box){this.handlers.box.setMap(a)}OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.SelectFeature"});OpenLayers.Control.ZoomBox=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,out:false,draw:function(){this.handler=new OpenLayers.Handler.Box(this,{done:this.zoomBox},{keyMask:this.keyMask})},zoomBox:function(m){if(m instanceof OpenLayers.Bounds){if(!this.out){var o=this.map.getLonLatFromPixel(new OpenLayers.Pixel(m.left,m.bottom));var r=this.map.getLonLatFromPixel(new OpenLayers.Pixel(m.right,m.top));var b=new OpenLayers.Bounds(o.lon,o.lat,r.lon,r.lat)}else{var l=Math.abs(m.right-m.left);var p=Math.abs(m.top-m.bottom);var g=Math.min((this.map.size.h/p),(this.map.size.w/l));var s=this.map.getExtent();var a=this.map.getLonLatFromPixel(m.getCenterPixel());var d=a.lon-(s.getWidth()/2)*g;var h=a.lon+(s.getWidth()/2)*g;var q=a.lat-(s.getHeight()/2)*g;var e=a.lat+(s.getHeight()/2)*g;var b=new OpenLayers.Bounds(d,q,h,e)}this.map.zoomToExtent(b)}else{if(!this.out){this.map.setCenter(this.map.getLonLatFromPixel(m),this.map.getZoom()+1)}else{this.map.setCenter(this.map.getLonLatFromPixel(m),this.map.getZoom()-1)}}},CLASS_NAME:"OpenLayers.Control.ZoomBox"});OpenLayers.Format.WKT=OpenLayers.Class(OpenLayers.Format,{initialize:function(a){this.regExes={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/};OpenLayers.Format.prototype.initialize.apply(this,[a])},read:function(h){var g,e,m;var l=this.regExes.typeStr.exec(h);if(l){e=l[1].toLowerCase();m=l[2];if(this.parse[e]){g=this.parse[e].apply(this,[m])}if(this.internalProjection&&this.externalProjection){if(g&&g.CLASS_NAME=="OpenLayers.Feature.Vector"){g.geometry.transform(this.externalProjection,this.internalProjection)}else{if(g&&e!="geometrycollection"&&typeof g=="object"){for(var d=0,a=g.length;d<a;d++){var b=g[d];b.geometry.transform(this.externalProjection,this.internalProjection)}}}}}return g},write:function(a){var h,o,m,e,b;if(a.constructor==Array){h=a;b=true}else{h=[a];b=false}var d=[];if(b){d.push("GEOMETRYCOLLECTION(")}for(var g=0,l=h.length;g<l;++g){if(b&&g>0){d.push(",")}o=h[g].geometry;m=o.CLASS_NAME.split(".")[2].toLowerCase();if(!this.extract[m]){return null}if(this.internalProjection&&this.externalProjection){o=o.clone();o.transform(this.internalProjection,this.externalProjection)}e=this.extract[m].apply(this,[o]);d.push(m.toUpperCase()+"("+e+")")}if(b){d.push(")")}return d.join("")},extract:{point:function(a){return a.x+" "+a.y},multipoint:function(d){var e=[];for(var b=0,a=d.components.length;b<a;++b){e.push(this.extract.point.apply(this,[d.components[b]]))}return e.join(",")},linestring:function(b){var e=[];for(var d=0,a=b.components.length;d<a;++d){e.push(this.extract.point.apply(this,[b.components[d]]))}return e.join(",")},multilinestring:function(d){var e=[];for(var b=0,a=d.components.length;b<a;++b){e.push("("+this.extract.linestring.apply(this,[d.components[b]])+")")}return e.join(",")},polygon:function(d){var e=[];for(var b=0,a=d.components.length;b<a;++b){e.push("("+this.extract.linestring.apply(this,[d.components[b]])+")")}return e.join(",")},multipolygon:function(e){var d=[];for(var b=0,a=e.components.length;b<a;++b){d.push("("+this.extract.polygon.apply(this,[e.components[b]])+")")}return d.join(",")}},parse:{point:function(b){var a=OpenLayers.String.trim(b).split(this.regExes.spaces);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(a[0],a[1]))},multipoint:function(g){var d=OpenLayers.String.trim(g).split(",");var e=[];for(var b=0,a=d.length;b<a;++b){e.push(this.parse.point.apply(this,[d[b]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(e))},linestring:function(g){var d=OpenLayers.String.trim(g).split(",");var e=[];for(var b=0,a=d.length;b<a;++b){e.push(this.parse.point.apply(this,[d[b]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(e))},multilinestring:function(h){var d;var b=OpenLayers.String.trim(h).split(this.regExes.parenComma);var g=[];for(var e=0,a=b.length;e<a;++e){d=b[e].replace(this.regExes.trimParens,"$1");g.push(this.parse.linestring.apply(this,[d]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(g))},polygon:function(m){var d,b,h;var l=OpenLayers.String.trim(m).split(this.regExes.parenComma);var g=[];for(var e=0,a=l.length;e<a;++e){d=l[e].replace(this.regExes.trimParens,"$1");b=this.parse.linestring.apply(this,[d]).geometry;h=new OpenLayers.Geometry.LinearRing(b.components);g.push(h)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(g))},multipolygon:function(h){var e;var b=OpenLayers.String.trim(h).split(this.regExes.doubleParenComma);var g=[];for(var d=0,a=b.length;d<a;++d){e=b[d].replace(this.regExes.trimParens,"$1");g.push(this.parse.polygon.apply(this,[e]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(g))},geometrycollection:function(g){g=g.replace(/,\s*([A-Za-z])/g,"|$1");var e=OpenLayers.String.trim(g).split("|");var d=[];for(var b=0,a=e.length;b<a;++b){d.push(OpenLayers.Format.WKT.prototype.read.apply(this,[e[b]]))}return d}},CLASS_NAME:"OpenLayers.Format.WKT"});OpenLayers.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.HTTPRequest,{tileSize:null,grid:null,singleTile:false,ratio:1.5,buffer:2,numLoadingTiles:0,initialize:function(d,b,e,a){OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,arguments);this.events.addEventType("tileloaded");this.grid=[]},destroy:function(){this.clearGrid();this.grid=null;this.tileSize=null;OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments)},clearGrid:function(){if(this.grid){for(var h=0,b=this.grid.length;h<b;h++){var g=this.grid[h];for(var d=0,a=g.length;d<a;d++){var e=g[d];this.removeTileMonitoringHooks(e);e.destroy()}}this.grid=[]}},clone:function(a){if(a==null){a=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[a]);if(this.tileSize!=null){a.tileSize=this.tileSize.clone()}a.grid=[];return a},moveTo:function(e,a,g){OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);e=e||this.map.getExtent();if(e!=null){var d=!this.grid.length||a;var b=this.getTilesBounds();if(this.singleTile){if(d||(!g&&!b.containsBounds(e))){this.initSingleTile(e)}}else{if(d||!b.containsBounds(e,true)){this.initGriddedTiles(e)}else{this.moveGriddedTiles(e)}}}},setTileSize:function(a){if(this.singleTile){a=this.map.getSize().clone();a.h=parseInt(a.h*this.ratio);a.w=parseInt(a.w*this.ratio)}OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this,[a])},getGridBounds:function(){var a="The getGridBounds() function is deprecated. It will be removed in 3.0. Please use getTilesBounds() instead.";OpenLayers.Console.warn(a);return this.getTilesBounds()},getTilesBounds:function(){var g=null;if(this.grid.length){var a=this.grid.length-1;var e=this.grid[a][0];var b=this.grid[0].length-1;var d=this.grid[0][b];g=new OpenLayers.Bounds(e.bounds.left,e.bounds.bottom,d.bounds.right,d.bounds.top)}return g},initSingleTile:function(h){var a=h.getCenterLonLat();var m=h.getWidth()*this.ratio;var b=h.getHeight()*this.ratio;var l=new OpenLayers.Bounds(a.lon-(m/2),a.lat-(b/2),a.lon+(m/2),a.lat+(b/2));var e=new OpenLayers.LonLat(l.left,l.top);var d=this.map.getLayerPxFromLonLat(e);if(!this.grid.length){this.grid[0]=[]}var g=this.grid[0][0];if(!g){g=this.addTile(l,d);this.addTileMonitoringHooks(g);g.draw();this.grid[0][0]=g}else{g.moveTo(l,d)}this.removeExcessTiles(1,1)},calculateGridLayout:function(a,u,g){var q=g*this.tileSize.w;var d=g*this.tileSize.h;var o=a.left-u.left;var r=Math.floor(o/q)-this.buffer;var p=o/q-r;var h=-p*this.tileSize.w;var s=u.left+r*q;var b=a.top-(u.bottom+d);var m=Math.ceil(b/d)+this.buffer;var t=m-b/d;var e=-t*this.tileSize.h;var l=u.bottom+m*d;return{tilelon:q,tilelat:d,tileoffsetlon:s,tileoffsetlat:l,tileoffsetx:h,tileoffsety:e}},initGriddedTiles:function(o){var l=this.map.getSize();var E=Math.ceil(l.h/this.tileSize.h)+Math.max(1,2*this.buffer);var G=Math.ceil(l.w/this.tileSize.w)+Math.max(1,2*this.buffer);var u=this.maxExtent;var z=this.map.getResolution();var w=this.calculateGridLayout(o,u,z);var h=Math.round(w.tileoffsetx);var d=Math.round(w.tileoffsety);var q=w.tileoffsetlon;var t=w.tileoffsetlat;var g=w.tilelon;var p=w.tilelat;this.origin=new OpenLayers.Pixel(h,d);var D=h;var F=q;var C=0;var a=parseInt(this.map.layerContainerDiv.style.left);var B=parseInt(this.map.layerContainerDiv.style.top);do{var m=this.grid[C++];if(!m){m=[];this.grid.push(m)}q=F;h=D;var e=0;do{var b=new OpenLayers.Bounds(q,t,q+g,t+p);var s=h;s-=a;var r=d;r-=B;var v=new OpenLayers.Pixel(s,r);var H=m[e++];if(!H){H=this.addTile(b,v);this.addTileMonitoringHooks(H);m.push(H)}else{H.moveTo(b,v,false)}q+=g;h+=this.tileSize.w}while((q<=o.right+g*this.buffer)||e<G);t-=p;d+=this.tileSize.h}while((t>=o.bottom-p*this.buffer)||C<E);this.removeExcessTiles(C,e);this.spiralTileLoad()},spiralTileLoad:function(){var b=[];var m=["right","down","left","up"];var l=0;var a=-1;var p=OpenLayers.Util.indexOf(m,"right");var q=0;while(q<m.length){var o=l;var d=a;switch(m[p]){case"right":d++;break;case"down":o++;break;case"left":d--;break;case"up":o--;break}var h=null;if((o<this.grid.length)&&(o>=0)&&(d<this.grid[0].length)&&(d>=0)){h=this.grid[o][d]}if((h!=null)&&(!h.queued)){b.unshift(h);h.queued=true;q=0;l=o;a=d}else{p=(p+1)%4;q++}}for(var e=0,g=b.length;e<g;e++){var h=b[e];h.draw();h.queued=false}},addTile:function(b,a){},addTileMonitoringHooks:function(a){a.onLoadStart=function(){if(this.numLoadingTiles==0){this.events.triggerEvent("loadstart")}this.numLoadingTiles++};a.events.register("loadstart",this,a.onLoadStart);a.onLoadEnd=function(){this.numLoadingTiles--;this.events.triggerEvent("tileloaded");if(this.numLoadingTiles==0){this.events.triggerEvent("loadend")}};a.events.register("loadend",this,a.onLoadEnd);a.events.register("unload",this,a.onLoadEnd)},removeTileMonitoringHooks:function(a){a.unload();a.events.un({loadstart:a.onLoadStart,loadend:a.onLoadEnd,unload:a.onLoadEnd,scope:this})},moveGriddedTiles:function(d){var b=this.buffer||1;while(true){var a=this.grid[0][0].position;var e=this.map.getViewPortPxFromLayerPx(a);if(e.x>-this.tileSize.w*(b-1)){this.shiftColumn(true)}else{if(e.x<-this.tileSize.w*b){this.shiftColumn(false)}else{if(e.y>-this.tileSize.h*(b-1)){this.shiftRow(true)}else{if(e.y<-this.tileSize.h*b){this.shiftRow(false)}else{break}}}}}},shiftRow:function(s){var d=(s)?0:(this.grid.length-1);var b=this.grid;var h=b[d];var g=this.map.getResolution();var m=(s)?-this.tileSize.h:this.tileSize.h;var l=g*-m;var r=(s)?b.pop():b.shift();for(var o=0,q=h.length;o<q;o++){var e=h[o];var a=e.bounds.clone();var p=e.position.clone();a.bottom=a.bottom+l;a.top=a.top+l;p.y=p.y+m;r[o].moveTo(a,p)}if(s){b.unshift(r)}else{b.push(r)}},shiftColumn:function(r){var e=(r)?-this.tileSize.w:this.tileSize.w;var d=this.map.getResolution();var p=d*e;for(var g=0,l=this.grid.length;g<l;g++){var q=this.grid[g];var o=(r)?0:(q.length-1);var b=q[o];var a=b.bounds.clone();var h=b.position.clone();a.left=a.left+p;a.right=a.right+p;h.x=h.x+e;var m=r?this.grid[g].pop():this.grid[g].shift();m.moveTo(a,h);if(r){q.unshift(m)}else{q.push(m)}}},removeExcessTiles:function(g,d){while(this.grid.length>g){var h=this.grid.pop();for(var b=0,a=h.length;b<a;b++){var e=h[b];this.removeTileMonitoringHooks(e);e.destroy()}}while(this.grid[0].length>d){for(var b=0,a=this.grid.length;b<a;b++){var h=this.grid[b];var e=h.pop();this.removeTileMonitoringHooks(e);e.destroy()}}},onMapResize:function(){if(this.singleTile){this.clearGrid();this.setTileSize()}},getTileBounds:function(e){var d=this.maxExtent;var h=this.getResolution();var g=h*this.tileSize.w;var b=h*this.tileSize.h;var m=this.getLonLatFromViewPortPx(e);var a=d.left+(g*Math.floor((m.lon-d.left)/g));var l=d.bottom+(b*Math.floor((m.lat-d.bottom)/b));return new OpenLayers.Bounds(a,l,a+g,l+b)},CLASS_NAME:"OpenLayers.Layer.Grid"});OpenLayers.Style=OpenLayers.Class({name:null,title:null,description:null,layerName:null,isDefault:false,rules:null,context:null,defaultStyle:null,propertyStyles:null,initialize:function(b,a){this.rules=[];this.setDefaultStyle(b||OpenLayers.Feature.Vector.style["default"]);OpenLayers.Util.extend(this,a)},destroy:function(){for(var b=0,a=this.rules.length;b<a;b++){this.rules[b].destroy();this.rules[b]=null}this.rules=null;this.defaultStyle=null},createSymbolizer:function(p){var a=this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),p);var o=this.rules;var m,b;var d=[];var h=false;for(var e=0,g=o.length;e<g;e++){m=o[e];var l=m.evaluate(p);if(l){if(m instanceof OpenLayers.Rule&&m.elseFilter){d.push(m)}else{h=true;this.applySymbolizer(m,a,p)}}}if(h==false&&d.length>0){h=true;for(var e=0,g=d.length;e<g;e++){this.applySymbolizer(d[e],a,p)}}if(o.length>0&&h==false){a.display="none"}return a},applySymbolizer:function(g,e,b){var a=b.geometry?this.getSymbolizerPrefix(b.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];var d=g.symbolizer[a]||g.symbolizer;return this.createLiterals(OpenLayers.Util.extend(e,d),b)},createLiterals:function(e,d){var b=this.context||d.attributes||d.data;for(var a in this.propertyStyles){e[a]=OpenLayers.Style.createLiteral(e[a],b,d)}return e},findPropertyStyles:function(){var e={};var h=this.defaultStyle;this.addPropertyStyles(e,h);var m=this.rules;var g,l;for(var d=0,a=m.length;d<a;d++){var g=m[d].symbolizer;for(var b in g){l=g[b];if(typeof l=="object"){this.addPropertyStyles(e,l)}else{this.addPropertyStyles(e,g);break}}}return e},addPropertyStyles:function(b,d){var e;for(var a in d){e=d[a];if(typeof e=="string"&&e.match(/\$\{\w+\}/)){b[a]=true}}return b},addRules:function(a){this.rules=this.rules.concat(a);this.propertyStyles=this.findPropertyStyles()},setDefaultStyle:function(a){this.defaultStyle=a;this.propertyStyles=this.findPropertyStyles()},getSymbolizerPrefix:function(e){var d=OpenLayers.Style.SYMBOLIZER_PREFIXES;for(var b=0,a=d.length;b<a;b++){if(e.CLASS_NAME.indexOf(d[b])!=-1){return d[b]}}},CLASS_NAME:"OpenLayers.Style"});OpenLayers.Style.createLiteral=function(d,b,a){if(typeof d=="string"&&d.indexOf("${")!=-1){d=OpenLayers.String.format(d,b,[a]);d=(isNaN(d)||!d)?d:parseFloat(d)}return d};OpenLayers.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon","Text"];Ext.namespace("mapfish.widgets");Ext.namespace("mapfish.widgets.print");mapfish.widgets.print.PrintAction=function(a){var b=OpenLayers.Util.extend({iconCls:"mf-print-action",text:OpenLayers.Lang.translate("mf.print.print"),tooltip:OpenLayers.Lang.translate("mf.print.print-tooltip"),handler:this.handler,scope:this},a);mapfish.widgets.print.PrintAction.superclass.constructor.call(this,b);OpenLayers.Util.extend(this,a);this.mask=new Ext.LoadMask(this.map.div,{msg:OpenLayers.Lang.translate("mf.print.loadingConfig")});this.initPrint()};Ext.extend(mapfish.widgets.print.PrintAction,Ext.Action,{handler:function(){if(!this.printing){this.print()}},fillSpec:function(a){var b={bbox:this.map.getExtent().toArray()};var d=a.spec;d.pages.push(b);d.layout=this.getCurLayout()},getCurDpi:function(){return this.config.dpis[0].value},getCurLayout:function(){return this.config.layouts[0].name}});OpenLayers.Util.applyDefaults(mapfish.widgets.print.PrintAction.prototype,mapfish.widgets.print.Base);Ext.reg("print-action",mapfish.widgets.print.PrintAction);OpenLayers.Control.ModifyFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,clickout:true,toggle:true,layer:null,feature:null,vertices:null,virtualVertices:null,selectControl:null,dragControl:null,handlers:null,deleteCodes:null,virtualStyle:null,mode:null,radiusHandle:null,dragHandle:null,onModificationStart:function(){},onModification:function(){},onModificationEnd:function(){},initialize:function(e,d){this.layer=e;this.vertices=[];this.virtualVertices=[];this.virtualStyle=OpenLayers.Util.extend({},this.layer.style||this.layer.styleMap.createSymbolizer());this.virtualStyle.fillOpacity=0.3;this.virtualStyle.strokeOpacity=0.3;this.deleteCodes=[46,68];this.mode=OpenLayers.Control.ModifyFeature.RESHAPE;OpenLayers.Control.prototype.initialize.apply(this,[d]);if(!(this.deleteCodes instanceof Array)){this.deleteCodes=[this.deleteCodes]}var h=this;var a={geometryTypes:this.geometryTypes,clickout:this.clickout,toggle:this.toggle,onBeforeSelect:this.beforeSelectFeature,onSelect:this.selectFeature,onUnselect:this.unselectFeature,scope:this};this.selectControl=new OpenLayers.Control.SelectFeature(e,a);var b={geometryTypes:["OpenLayers.Geometry.Point"],snappingOptions:this.snappingOptions,onStart:function(m,l){h.dragStart.apply(h,[m,l])},onDrag:function(l){h.dragVertex.apply(h,[l])},onComplete:function(l){h.dragComplete.apply(h,[l])}};this.dragControl=new OpenLayers.Control.DragFeature(e,b);var g={keydown:this.handleKeypress};this.handlers={keyboard:new OpenLayers.Handler.Keyboard(this,g)}},destroy:function(){this.layer=null;this.selectControl.destroy();this.dragControl.destroy();OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return(this.selectControl.activate()&&this.handlers.keyboard.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments))},deactivate:function(){var a=false;if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){this.layer.removeFeatures(this.vertices,{silent:true});this.layer.removeFeatures(this.virtualVertices,{silent:true});this.vertices=[];this.dragControl.deactivate();if(this.feature&&this.feature.geometry){this.selectControl.unselect.apply(this.selectControl,[this.feature])}this.selectControl.deactivate();this.handlers.keyboard.deactivate();a=true}return a},beforeSelectFeature:function(a){return this.layer.events.triggerEvent("beforefeaturemodified",{feature:a})},selectFeature:function(a){this.feature=a;this.resetVertices();this.dragControl.activate();this.onModificationStart(this.feature)},unselectFeature:function(a){this.layer.removeFeatures(this.vertices,{silent:true});this.vertices=[];this.layer.destroyFeatures(this.virtualVertices,{silent:true});this.virtualVertices=[];if(this.dragHandle){this.layer.destroyFeatures([this.dragHandle],{silent:true});delete this.dragHandle}if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});delete this.radiusHandle}this.feature=null;this.dragControl.deactivate();this.onModificationEnd(a);this.layer.events.triggerEvent("afterfeaturemodified",{feature:a})},dragStart:function(b,a){if(b!=this.feature&&!b.geometry.parent&&b!=this.dragHandle&&b!=this.radiusHandle){if(this.feature){this.selectControl.clickFeature.apply(this.selectControl,[this.feature])}if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,b.geometry.CLASS_NAME)!=-1){this.selectControl.clickFeature.apply(this.selectControl,[b]);this.dragControl.overFeature.apply(this.dragControl,[b]);this.dragControl.lastPixel=a;this.dragControl.handlers.drag.started=true;this.dragControl.handlers.drag.start=a;this.dragControl.handlers.drag.last=a}}},dragVertex:function(a){if(this.feature.geometry.CLASS_NAME=="OpenLayers.Geometry.Point"){if(this.feature!=a){this.feature=a}}else{if(a._index){a.geometry.parent.addComponent(a.geometry,a._index);delete a._index;OpenLayers.Util.removeItem(this.virtualVertices,a);this.vertices.push(a)}else{if(a==this.dragHandle){this.layer.removeFeatures(this.vertices,{silent:true});this.vertices=[];if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});this.radiusHandle=null}}}if(this.virtualVertices.length>0){this.layer.destroyFeatures(this.virtualVertices,{silent:true});this.virtualVertices=[]}this.layer.drawFeature(this.feature,this.selectControl.renderIntent)}this.layer.drawFeature(a)},dragComplete:function(a){this.resetVertices();this.setFeatureState();this.onModification(this.feature);this.layer.events.triggerEvent("featuremodified",{feature:this.feature})},setFeatureState:function(){if(this.feature.state!=OpenLayers.State.INSERT&&this.feature.state!=OpenLayers.State.DELETE){this.feature.state=OpenLayers.State.UPDATE}},resetVertices:function(){if(this.dragControl.feature){this.dragControl.outFeature(this.dragControl.feature)}if(this.vertices.length>0){this.layer.removeFeatures(this.vertices,{silent:true});this.vertices=[]}if(this.virtualVertices.length>0){this.layer.removeFeatures(this.virtualVertices,{silent:true});this.virtualVertices=[]}if(this.dragHandle){this.layer.destroyFeatures([this.dragHandle],{silent:true});this.dragHandle=null}if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});this.radiusHandle=null}if(this.feature&&this.feature.geometry.CLASS_NAME!="OpenLayers.Geometry.Point"){if((this.mode&OpenLayers.Control.ModifyFeature.DRAG)){this.collectDragHandle()}if((this.mode&(OpenLayers.Control.ModifyFeature.ROTATE|OpenLayers.Control.ModifyFeature.RESIZE))){this.collectRadiusHandle()}if((this.mode&OpenLayers.Control.ModifyFeature.RESHAPE)){this.collectVertices()}}},handleKeypress:function(a){var b=a.keyCode;if(this.feature&&OpenLayers.Util.indexOf(this.deleteCodes,b)!=-1){var d=this.dragControl.feature;if(d&&OpenLayers.Util.indexOf(this.vertices,d)!=-1&&!this.dragControl.handlers.drag.dragging&&d.geometry.parent){d.geometry.parent.removeComponent(d.geometry);this.layer.drawFeature(this.feature,this.selectControl.renderIntent);this.resetVertices();this.setFeatureState();this.onModification(this.feature);this.layer.events.triggerEvent("featuremodified",{feature:this.feature})}}},collectVertices:function(){this.vertices=[];this.virtualVertices=[];var a=this;function b(m){var e,g,o,h;if(m.CLASS_NAME=="OpenLayers.Geometry.Point"){g=new OpenLayers.Feature.Vector(m);a.vertices.push(g)}else{var d=m.components.length;if(m.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){d-=1}for(e=0;e<d;++e){o=m.components[e];if(o.CLASS_NAME=="OpenLayers.Geometry.Point"){g=new OpenLayers.Feature.Vector(o);a.vertices.push(g)}else{b(o)}}if(m.CLASS_NAME!="OpenLayers.Geometry.MultiPoint"){for(e=0,h=m.components.length;e<h-1;++e){var r=m.components[e];var s=m.components[e+1];if(r.CLASS_NAME=="OpenLayers.Geometry.Point"&&s.CLASS_NAME=="OpenLayers.Geometry.Point"){var p=(r.x+s.x)/2;var l=(r.y+s.y)/2;var q=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(p,l),null,a.virtualStyle);q.geometry.parent=m;q._index=e+1;a.virtualVertices.push(q)}}}}}b.call(this,this.feature.geometry);this.layer.addFeatures(this.virtualVertices,{silent:true});this.layer.addFeatures(this.vertices,{silent:true})},collectDragHandle:function(){var e=this.feature.geometry;var a=e.getBounds().getCenterLonLat();var d=new OpenLayers.Geometry.Point(a.lon,a.lat);var b=new OpenLayers.Feature.Vector(d);d.move=function(g,h){OpenLayers.Geometry.Point.prototype.move.call(this,g,h);e.move(g,h)};this.dragHandle=b;this.layer.addFeatures([this.dragHandle],{silent:true})},collectRadiusHandle:function(){var m=this.feature.geometry;var l=m.getBounds();var b=l.getCenterLonLat();var h=new OpenLayers.Geometry.Point(b.lon,b.lat);var d=new OpenLayers.Geometry.Point(l.right,l.bottom);var a=new OpenLayers.Feature.Vector(d);var g=(this.mode&OpenLayers.Control.ModifyFeature.RESIZE);var e=(this.mode&OpenLayers.Control.ModifyFeature.ROTATE);d.move=function(w,v){OpenLayers.Geometry.Point.prototype.move.call(this,w,v);var z=this.x-h.x;var t=this.y-h.y;var B=z-w;var u=t-v;if(e){var p=Math.atan2(u,B);var o=Math.atan2(t,z);var r=o-p;r*=180/Math.PI;m.rotate(r,h)}if(g){var s=Math.sqrt((B*B)+(u*u));var q=Math.sqrt((z*z)+(t*t));m.resize(q/s,h)}};this.radiusHandle=a;this.layer.addFeatures([this.radiusHandle],{silent:true})},setMap:function(a){this.selectControl.setMap(a);this.dragControl.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.ModifyFeature"});OpenLayers.Control.ModifyFeature.RESHAPE=1;OpenLayers.Control.ModifyFeature.RESIZE=2;OpenLayers.Control.ModifyFeature.ROTATE=4;OpenLayers.Control.ModifyFeature.DRAG=8;OpenLayers.Control.Navigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,dragPanOptions:null,zoomBox:null,zoomWheelEnabled:true,handleRightClicks:false,zoomBoxKeyMask:OpenLayers.Handler.MOD_SHIFT,initialize:function(a){this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.deactivate();if(this.dragPan){this.dragPan.destroy()}this.dragPan=null;if(this.zoomBox){this.zoomBox.destroy()}this.zoomBox=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){this.dragPan.activate();if(this.zoomWheelEnabled){this.handlers.wheel.activate()}this.handlers.click.activate();this.zoomBox.activate();return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){this.zoomBox.deactivate();this.dragPan.deactivate();this.handlers.click.deactivate();this.handlers.wheel.deactivate();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},draw:function(){if(this.handleRightClicks){this.map.div.oncontextmenu=function(){return false}}var a={dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick};var b={"double":true,stopDouble:true};this.handlers.click=new OpenLayers.Handler.Click(this,a,b);this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map},this.dragPanOptions));this.zoomBox=new OpenLayers.Control.ZoomBox({map:this.map,keyMask:this.zoomBoxKeyMask});this.dragPan.draw();this.zoomBox.draw();this.handlers.wheel=new OpenLayers.Handler.MouseWheel(this,{up:this.wheelUp,down:this.wheelDown});this.activate()},defaultDblClick:function(b){var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(a,this.map.zoom+1)},defaultDblRightClick:function(b){var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(a,this.map.zoom-1)},wheelChange:function(m,d){var h=this.map.getZoom()+d;if(!this.map.isValidZoomLevel(h)){return}var o=this.map.getSize();var g=o.w/2-m.xy.x;var e=m.xy.y-o.h/2;var l=this.map.baseLayer.getResolutionForZoom(h);var a=this.map.getLonLatFromPixel(m.xy);var b=new OpenLayers.LonLat(a.lon+g*l,a.lat+e*l);this.map.setCenter(b,h)},wheelUp:function(a){this.wheelChange(a,1)},wheelDown:function(a){this.wheelChange(a,-1)},disableZoomWheel:function(){this.zoomWheelEnabled=false;this.handlers.wheel.deactivate()},enableZoomWheel:function(){this.zoomWheelEnabled=true;if(this.active){this.handlers.wheel.activate()}},CLASS_NAME:"OpenLayers.Control.Navigation"});OpenLayers.Filter=OpenLayers.Class({initialize:function(a){OpenLayers.Util.extend(this,a)},destroy:function(){},evaluate:function(a){return true},CLASS_NAME:"OpenLayers.Filter"});OpenLayers.Geometry=OpenLayers.Class({id:null,parent:null,bounds:null,initialize:function(){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){this.id=null;this.bounds=null},clone:function(){return new OpenLayers.Geometry()},setBounds:function(a){if(a){this.bounds=a.clone()}},clearBounds:function(){this.bounds=null;if(this.parent){this.parent.clearBounds()}},extendBounds:function(b){var a=this.getBounds();if(!a){this.setBounds(b)}else{this.bounds.extend(b)}},getBounds:function(){if(this.bounds==null){this.calculateBounds()}return this.bounds},calculateBounds:function(){},atPoint:function(g,m,h){var d=false;var e=this.getBounds();if((e!=null)&&(g!=null)){var b=(m!=null)?m:0;var a=(h!=null)?h:0;var l=new OpenLayers.Bounds(this.bounds.left-b,this.bounds.bottom-a,this.bounds.right+b,this.bounds.top+a);d=l.containsLonLat(g)}return d},getLength:function(){return 0},getArea:function(){return 0},toString:function(){return OpenLayers.Format.WKT.prototype.write(new OpenLayers.Feature.Vector(this))},CLASS_NAME:"OpenLayers.Geometry"});OpenLayers.Geometry.segmentsIntersect=function(z,w,t){var a=false;var u=z.x1-w.x1;var b=z.y1-w.y1;var v=z.x2-z.x1;var e=z.y2-z.y1;var s=w.y2-w.y1;var l=w.x2-w.x1;var p=(s*v)-(l*e);var o=(l*b)-(s*u);var m=(v*b)-(e*u);if(p==0){if(o==0&&m==0){a=true}}else{var h=o/p;var g=m/p;if(h>=0&&h<=1&&g>=0&&g<=1){if(!t){a=true}else{var r=z.x1+(h*v);var q=z.y1+(h*e);a=new OpenLayers.Geometry.Point(r,q)}}}return a};OpenLayers.Layer.MapServer=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{mode:"map",map_imagetype:"png"},initialize:function(e,d,g,b){var a=[];a.push(e,d,g,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);if(b==null||b.isBaseLayer==null){this.isBaseLayer=((this.params.transparent!="true")&&(this.params.transparent!=true))}},clone:function(a){if(a==null){a=new OpenLayers.Layer.MapServer(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},getURL:function(d){d=this.adjustBounds(d);var b=[d.left,d.bottom,d.right,d.top];var e=this.getImageSize();var a=this.getFullRequestString({mapext:b,imgext:b,map_size:[e.w,e.h],imgx:e.w/2,imgy:e.h/2,imgxy:[e.w,e.h]});return a},getFullRequestString:function(h,g){var b=(g==null)?this.url:g;var l=OpenLayers.Util.extend({},this.params);l=OpenLayers.Util.extend(l,h);var a=OpenLayers.Util.getParameterString(l);if(b instanceof Array){b=this.selectUrl(a,b)}var e=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(b));for(var m in l){if(m.toUpperCase() in e){delete l[m]}}a=OpenLayers.Util.getParameterString(l);var o=b;a=a.replace(/,/g,"+");if(a!=""){var d=b.charAt(b.length-1);if((d=="&")||(d=="?")){o+=a}else{if(b.indexOf("?")==-1){o+="?"+a}else{o+="&"+a}}}return o},CLASS_NAME:"OpenLayers.Layer.MapServer"});OpenLayers.Layer.TileCache=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,tileOrigin:null,format:"image/png",initialize:function(d,b,e,a){this.layername=e;OpenLayers.Layer.Grid.prototype.initialize.apply(this,[d,b,{},a]);this.extension=this.format.split("/")[1].toLowerCase();this.extension=(this.extension=="jpg")?"jpeg":this.extension},clone:function(a){if(a==null){a=new OpenLayers.Layer.TileCache(this.name,this.url,this.layername,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},getURL:function(b){var h=this.map.getResolution();var l=this.maxExtent;var q=this.tileSize;var a=Math.round((b.left-l.left)/(h*q.w));var p=Math.round((b.bottom-l.bottom)/(h*q.h));var m=this.map.zoom;function g(u,t){u=String(u);var r=[];for(var s=0;s<t;++s){r.push("0")}return r.join("").substring(0,t-u.length)+u}var e=[this.layername,g(m,2),g(parseInt(a/1000000),3),g((parseInt(a/1000)%1000),3),g((parseInt(a)%1000),3),g(parseInt(p/1000000),3),g((parseInt(p/1000)%1000),3),g((parseInt(p)%1000),3)+"."+this.extension];var o=e.join("/");var d=this.url;if(d instanceof Array){d=this.selectUrl(o,d)}d=(d.charAt(d.length-1)=="/")?d:d+"/";return d+o},addTile:function(d,a){var b=this.getURL(d);return new OpenLayers.Tile.Image(this,a,d,b,this.tileSize)},setMap:function(a){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);if(!this.tileOrigin){this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.bottom)}},CLASS_NAME:"OpenLayers.Layer.TileCache"});OpenLayers.Layer.WMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{service:"WMS",version:"1.1.1",request:"GetMap",styles:"",exceptions:"application/vnd.ogc.se_inimage",format:"image/jpeg"},reproject:false,isBaseLayer:true,encodeBBOX:false,initialize:function(e,d,g,b){var a=[];g=OpenLayers.Util.upperCaseObject(g);a.push(e,d,g,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));if(this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true"){if((b==null)||(!b.isBaseLayer)){this.isBaseLayer=false}if(this.params.FORMAT=="image/jpeg"){this.params.FORMAT=OpenLayers.Util.alphaHack()?"image/gif":"image/png"}}},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Layer.WMS(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},getURL:function(b){b=this.adjustBounds(b);var d=this.getImageSize();var e={BBOX:this.encodeBBOX?b.toBBOX():b.toArray(),WIDTH:d.w,HEIGHT:d.h};var a=this.getFullRequestString(e);return a},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},mergeNewParams:function(d){var b=OpenLayers.Util.upperCaseObject(d);var a=[b];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,a)},getFullRequestString:function(d,b){var a=this.map.getProjection();this.params.SRS=(a=="none")?null:a;return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)},CLASS_NAME:"OpenLayers.Layer.WMS"});OpenLayers.Rule=OpenLayers.Class({id:null,name:"default",title:null,description:null,context:null,filter:null,elseFilter:false,symbolizer:null,minScaleDenominator:null,maxScaleDenominator:null,initialize:function(a){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");this.symbolizer={};OpenLayers.Util.extend(this,a)},destroy:function(){for(var a in this.symbolizer){this.symbolizer[a]=null}this.symbolizer=null},evaluate:function(d){var b=this.getContext(d);var a=true;if(this.minScaleDenominator||this.maxScaleDenominator){var e=d.layer.map.getScale()}if(this.minScaleDenominator){a=e>=OpenLayers.Style.createLiteral(this.minScaleDenominator,b)}if(a&&this.maxScaleDenominator){a=e<OpenLayers.Style.createLiteral(this.maxScaleDenominator,b)}if(a&&this.filter){if(this.filter.CLASS_NAME=="OpenLayers.Filter.FeatureId"){a=this.filter.evaluate(d)}else{a=this.filter.evaluate(b)}}return a},getContext:function(b){var a=this.context;if(!a){a=b.attributes||b.data}if(typeof this.context=="function"){a=this.context(b)}return a},CLASS_NAME:"OpenLayers.Rule"});OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:true,initialize:function(d,a){this.styles={"default":new OpenLayers.Style(OpenLayers.Feature.Vector.style["default"]),select:new OpenLayers.Style(OpenLayers.Feature.Vector.style.select),temporary:new OpenLayers.Style(OpenLayers.Feature.Vector.style.temporary)};if(d instanceof OpenLayers.Style){this.styles["default"]=d;this.styles.select=d;this.styles.temporary=d}else{if(typeof d=="object"){for(var b in d){if(d[b] instanceof OpenLayers.Style){this.styles[b]=d[b]}else{if(typeof d[b]=="object"){this.styles[b]=new OpenLayers.Style(d[b])}else{this.styles["default"]=new OpenLayers.Style(d);this.styles.select=new OpenLayers.Style(d);this.styles.temporary=new OpenLayers.Style(d);break}}}}}OpenLayers.Util.extend(this,a)},destroy:function(){for(var a in this.styles){this.styles[a].destroy()}this.styles=null},createSymbolizer:function(b,d){if(!b){b=new OpenLayers.Feature.Vector()}if(!this.styles[d]){d="default"}b.renderIntent=d;var a={};if(this.extendDefault&&d!="default"){a=this.styles["default"].createSymbolizer(b)}return OpenLayers.Util.extend(a,this.styles[d].createSymbolizer(b))},addUniqueValueRules:function(b,e,h,a){var g=[];for(var d in h){g.push(new OpenLayers.Rule({symbolizer:h[d],context:a,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:e,value:d})}))}this.styles[b].addRules(g)},CLASS_NAME:"OpenLayers.StyleMap"});OpenLayers.Filter.Comparison=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,lowerBoundary:null,upperBoundary:null,initialize:function(a){OpenLayers.Filter.prototype.initialize.apply(this,[a])},evaluate:function(b){switch(this.type){case OpenLayers.Filter.Comparison.EQUAL_TO:case OpenLayers.Filter.Comparison.LESS_THAN:case OpenLayers.Filter.Comparison.GREATER_THAN:case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:return this.binaryCompare(b,this.property,this.value);case OpenLayers.Filter.Comparison.BETWEEN:var a=b[this.property]>=this.lowerBoundary;a=a&&b[this.property]<=this.upperBoundary;return a;case OpenLayers.Filter.Comparison.LIKE:var d=new RegExp(this.value,"gi");return d.test(b[this.property])}},value2regex:function(e,b,a){if(e=="."){var d="'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison";OpenLayers.Console.error(d);return null}e=e?e:"*";b=b?b:".";a=a?a:"!";this.value=this.value.replace(new RegExp("\\"+a+"(.|$)","g"),"\\$1");this.value=this.value.replace(new RegExp("\\"+b,"g"),".");this.value=this.value.replace(new RegExp("\\"+e,"g"),".*");this.value=this.value.replace(new RegExp("\\\\.\\*","g"),"\\"+e);this.value=this.value.replace(new RegExp("\\\\\\.","g"),"\\"+b);return this.value},regex2value:function(){var a=this.value;a=a.replace(/!/g,"!!");a=a.replace(/(\\)?\\\./g,function(d,b){return b?d:"!."});a=a.replace(/(\\)?\\\*/g,function(d,b){return b?d:"!*"});a=a.replace(/\\\\/g,"\\");a=a.replace(/\.\*/g,"*");return a},binaryCompare:function(a,d,b){switch(this.type){case OpenLayers.Filter.Comparison.EQUAL_TO:return a[d]==b;case OpenLayers.Filter.Comparison.NOT_EQUAL_TO:return a[d]!=b;case OpenLayers.Filter.Comparison.LESS_THAN:return a[d]<b;case OpenLayers.Filter.Comparison.GREATER_THAN:return a[d]>b;case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:return a[d]<=b;case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:return a[d]>=b}},CLASS_NAME:"OpenLayers.Filter.Comparison"});OpenLayers.Filter.Comparison.EQUAL_TO="==";OpenLayers.Filter.Comparison.NOT_EQUAL_TO="!=";OpenLayers.Filter.Comparison.LESS_THAN="<";OpenLayers.Filter.Comparison.GREATER_THAN=">";OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO="<=";OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO=">=";OpenLayers.Filter.Comparison.BETWEEN="..";OpenLayers.Filter.Comparison.LIKE="~";OpenLayers.Filter.FeatureId=OpenLayers.Class(OpenLayers.Filter,{fids:null,initialize:function(a){this.fids=[];OpenLayers.Filter.prototype.initialize.apply(this,[a])},evaluate:function(d){for(var b=0,a=this.fids.length;b<a;b++){var e=d.fid||d.id;if(e==this.fids[b]){return true}}return false},CLASS_NAME:"OpenLayers.Filter.FeatureId"});OpenLayers.Filter.Logical=OpenLayers.Class(OpenLayers.Filter,{filters:null,type:null,initialize:function(a){this.filters=[];OpenLayers.Filter.prototype.initialize.apply(this,[a])},destroy:function(){this.filters=null;OpenLayers.Filter.prototype.destroy.apply(this)},evaluate:function(d){switch(this.type){case OpenLayers.Filter.Logical.AND:for(var b=0,a=this.filters.length;b<a;b++){if(this.filters[b].evaluate(d)==false){return false}}return true;case OpenLayers.Filter.Logical.OR:for(var b=0,a=this.filters.length;b<a;b++){if(this.filters[b].evaluate(d)==true){return true}}return false;case OpenLayers.Filter.Logical.NOT:return(!this.filters[0].evaluate(d))}},CLASS_NAME:"OpenLayers.Filter.Logical"});OpenLayers.Filter.Logical.AND="&&";OpenLayers.Filter.Logical.OR="||";OpenLayers.Filter.Logical.NOT="!";OpenLayers.Filter.Spatial=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,distance:null,distanceUnits:null,initialize:function(a){OpenLayers.Filter.prototype.initialize.apply(this,[a])},evaluate:function(d){var a=false;switch(this.type){case OpenLayers.Filter.Spatial.BBOX:case OpenLayers.Filter.Spatial.INTERSECTS:if(d.geometry){var b=this.value;if(this.value.CLASS_NAME=="OpenLayers.Bounds"){b=this.value.toGeometry()}if(d.geometry.intersects(b)){a=true}}break;default:OpenLayers.Console.error(OpenLayers.i18n("filterEvaluateNotImplemented"));break}return a},CLASS_NAME:"OpenLayers.Filter.Spatial"});OpenLayers.Filter.Spatial.BBOX="BBOX";OpenLayers.Filter.Spatial.INTERSECTS="INTERSECTS";OpenLayers.Filter.Spatial.DWITHIN="DWITHIN";OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function(a){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.components=[];if(a!=null){this.addComponents(a)}},destroy:function(){this.components.length=0;this.components=null},clone:function(){var geometry=eval("new "+this.CLASS_NAME+"()");for(var i=0,len=this.components.length;i<len;i++){geometry.addComponent(this.components[i].clone())}OpenLayers.Util.applyDefaults(geometry,this);return geometry},getComponentsString:function(){var b=[];for(var d=0,a=this.components.length;d<a;d++){b.push(this.components[d].toShortString())}return b.join(",")},calculateBounds:function(){this.bounds=null;if(this.components&&this.components.length>0){this.setBounds(this.components[0].getBounds());for(var b=1,a=this.components.length;b<a;b++){this.extendBounds(this.components[b].getBounds())}}},addComponents:function(d){if(!(d instanceof Array)){d=[d]}for(var b=0,a=d.length;b<a;b++){this.addComponent(d[b])}},addComponent:function(b,a){var e=false;if(b){if(this.componentTypes==null||(OpenLayers.Util.indexOf(this.componentTypes,b.CLASS_NAME)>-1)){if(a!=null&&(a<this.components.length)){var g=this.components.slice(0,a);var d=this.components.slice(a,this.components.length);g.push(b);this.components=g.concat(d)}else{this.components.push(b)}b.parent=this;this.clearBounds();e=true}}return e},removeComponents:function(b){if(!(b instanceof Array)){b=[b]}for(var a=b.length-1;a>=0;--a){this.removeComponent(b[a])}},removeComponent:function(a){OpenLayers.Util.removeItem(this.components,a);this.clearBounds()},getLength:function(){var d=0;for(var b=0,a=this.components.length;b<a;b++){d+=this.components[b].getLength()}return d},getArea:function(){var d=0;for(var b=0,a=this.components.length;b<a;b++){d+=this.components[b].getArea()}return d},move:function(b,e){for(var d=0,a=this.components.length;d<a;d++){this.components[d].move(b,e)}},rotate:function(e,b){for(var d=0,a=this.components.length;d<a;++d){this.components[d].rotate(e,b)}},resize:function(e,a,d){for(var b=0;b<this.components.length;++b){this.components[b].resize(e,a,d)}},equals:function(e){var b=true;if(!e||!e.CLASS_NAME||(this.CLASS_NAME!=e.CLASS_NAME)){b=false}else{if(!(e.components instanceof Array)||(e.components.length!=this.components.length)){b=false}else{for(var d=0,a=this.components.length;d<a;++d){if(!this.components[d].equals(e.components[d])){b=false;break}}}}return b},transform:function(g,d){if(g&&d){for(var e=0,a=this.components.length;e<a;e++){var b=this.components[e];b.transform(g,d)}this.bounds=null}return this},intersects:function(e){var b=false;for(var d=0,a=this.components.length;d<a;++d){b=e.intersects(this.components[d]);if(b){break}}return b},CLASS_NAME:"OpenLayers.Geometry.Collection"});OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,initialize:function(a,b){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=parseFloat(a);this.y=parseFloat(b)},clone:function(a){if(a==null){a=new OpenLayers.Geometry.Point(this.x,this.y)}OpenLayers.Util.applyDefaults(a,this);return a},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x,this.y)},distanceTo:function(b){var e=0;if((this.x!=null)&&(this.y!=null)&&(b!=null)&&(b.x!=null)&&(b.y!=null)){var d=Math.pow(this.x-b.x,2);var a=Math.pow(this.y-b.y,2);e=Math.sqrt(d+a)}return e},equals:function(a){var b=false;if(a!=null){b=((this.x==a.x&&this.y==a.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(a.x)&&isNaN(a.y)))}return b},toShortString:function(){return(this.x+", "+this.y)},move:function(a,b){this.x=this.x+a;this.y=this.y+b;this.clearBounds()},rotate:function(e,b){e*=Math.PI/180;var a=this.distanceTo(b);var d=e+Math.atan2(this.y-b.y,this.x-b.x);this.x=b.x+(a*Math.cos(d));this.y=b.y+(a*Math.sin(d));this.clearBounds()},resize:function(d,a,b){b=(b==undefined)?1:b;this.x=a.x+(d*b*(this.x-a.x));this.y=a.y+(d*(this.y-a.y));this.clearBounds()},intersects:function(b){var a=false;if(b.CLASS_NAME=="OpenLayers.Geometry.Point"){a=this.equals(b)}else{a=b.intersects(this)}return a},transform:function(b,a){if((b&&a)){OpenLayers.Projection.transform(this,b,a);this.bounds=null}return this},CLASS_NAME:"OpenLayers.Geometry.Point"});OpenLayers.Geometry.Rectangle=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,width:null,height:null,initialize:function(b,e,d,a){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=b;this.y=e;this.width=d;this.height=a},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x+this.width,this.y+this.height)},getLength:function(){var a=(2*this.width)+(2*this.height);return a},getArea:function(){var a=this.width*this.height;return a},CLASS_NAME:"OpenLayers.Geometry.Rectangle"});OpenLayers.Geometry.Surface=OpenLayers.Class(OpenLayers.Geometry,{initialize:function(){OpenLayers.Geometry.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Geometry.Surface"});OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{EVENT_TYPES:["beforefeatureadded","beforefeaturesadded","featureadded","featuresadded","beforefeatureremoved","featureremoved","featuresremoved","beforefeatureselected","featureselected","featureunselected","beforefeaturemodified","featuremodified","afterfeaturemodified","refresh"],isBaseLayer:false,isFixed:false,isVector:true,features:null,selectedFeatures:null,unrenderedFeatures:null,reportError:true,style:null,styleMap:null,strategies:null,protocol:null,renderers:["SVG","VML","Canvas"],renderer:null,rendererOptions:null,geometryType:null,drawn:false,initialize:function(d,b){this.EVENT_TYPES=OpenLayers.Layer.Vector.prototype.EVENT_TYPES.concat(OpenLayers.Layer.prototype.EVENT_TYPES);OpenLayers.Layer.prototype.initialize.apply(this,arguments);if(!this.renderer||!this.renderer.supported()){this.assignRenderer()}if(!this.renderer||!this.renderer.supported()){this.renderer=null;this.displayError()}if(!this.styleMap){this.styleMap=new OpenLayers.StyleMap()}this.features=[];this.selectedFeatures=[];this.unrenderedFeatures={};if(this.strategies){for(var e=0,a=this.strategies.length;e<a;e++){this.strategies[e].setLayer(this)}}},destroy:function(){if(this.strategies){var d,b,a;for(b=0,a=this.strategies.length;b<a;b++){d=this.strategies[b];if(d.autoDestroy){d.destroy()}}this.strategies=null}if(this.protocol){if(this.protocol.autoDestroy){this.protocol.destroy()}this.protocol=null}this.destroyFeatures();this.features=null;this.selectedFeatures=null;this.unrenderedFeatures=null;if(this.renderer){this.renderer.destroy()}this.renderer=null;this.geometryType=null;this.drawn=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},refresh:function(a){if(this.inRange&&this.visibility){this.events.triggerEvent("refresh",a)}},assignRenderer:function(){for(var d=0,a=this.renderers.length;d<a;d++){var b=OpenLayers.Renderer[this.renderers[d]];if(b&&b.prototype.supported()){this.renderer=new b(this.div,this.rendererOptions);break}}},displayError:function(){if(this.reportError){OpenLayers.Console.userError(OpenLayers.i18n("browserNotSupported",{renderers:this.renderers.join("\n")}))}},setMap:function(d){OpenLayers.Layer.prototype.setMap.apply(this,arguments);if(!this.renderer){this.map.removeLayer(this)}else{this.renderer.map=this.map;this.renderer.setSize(this.map.getSize())}if(this.strategies){var e,b,a;for(b=0,a=this.strategies.length;b<a;b++){e=this.strategies[b];if(e.autoActivate){e.activate()}}}},removeMap:function(d){if(this.strategies){var e,b,a;for(b=0,a=this.strategies.length;b<a;b++){e=this.strategies[b];if(e.autoActivate){e.deactivate()}}}},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);this.renderer.setSize(this.map.getSize())},moveTo:function(l,b,m){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var g=true;if(!m){this.renderer.root.style.visibility="hidden";this.div.style.left=-parseInt(this.map.layerContainerDiv.style.left)+"px";this.div.style.top=-parseInt(this.map.layerContainerDiv.style.top)+"px";var h=this.map.getExtent();g=this.renderer.setExtent(h,b);this.renderer.root.style.visibility="visible";if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.div.scrollLeft=this.div.scrollLeft}if(!b&&g){for(var e in this.unrenderedFeatures){var d=this.unrenderedFeatures[e];this.drawFeature(d)}}}if(!this.drawn||b||!g){this.drawn=true;var d;for(var e=0,a=this.features.length;e<a;e++){this.renderer.locked=(e!==(a-1));d=this.features[e];this.drawFeature(d)}}},addFeatures:function(b,o){if(!(b instanceof Array)){b=[b]}var l=!o||!o.silent;if(l){var a={features:b};var h=this.events.triggerEvent("beforefeaturesadded",a);if(h===false){return}b=a.features}for(var d=0,g=b.length;d<g;d++){if(d!=(b.length-1)){this.renderer.locked=true}else{this.renderer.locked=false}var m=b[d];if(this.geometryType&&!(m.geometry instanceof this.geometryType)){var e=OpenLayers.i18n("componentShouldBe",{geomType:this.geometryType.prototype.CLASS_NAME});throw e}this.features.push(m);m.layer=this;if(!m.style&&this.style){m.style=OpenLayers.Util.extend({},this.style)}if(l){if(this.events.triggerEvent("beforefeatureadded",{feature:m})===false){continue}this.preFeatureInsert(m)}this.drawFeature(m);if(l){this.events.triggerEvent("featureadded",{feature:m});this.onFeatureInsert(m)}}if(l){this.events.triggerEvent("featuresadded",{features:b})}},removeFeatures:function(g,a){if(!g||g.length===0){return}if(!(g instanceof Array)){g=[g]}var e=!a||!a.silent;for(var d=g.length-1;d>=0;d--){if(d!=0&&g[d-1].geometry){this.renderer.locked=true}else{this.renderer.locked=false}var b=g[d];delete this.unrenderedFeatures[b.id];if(e){this.events.triggerEvent("beforefeatureremoved",{feature:b})}this.features=OpenLayers.Util.removeItem(this.features,b);b.layer=null;if(b.geometry){this.renderer.eraseGeometry(b.geometry)}if(OpenLayers.Util.indexOf(this.selectedFeatures,b)!=-1){OpenLayers.Util.removeItem(this.selectedFeatures,b)}if(e){this.events.triggerEvent("featureremoved",{feature:b})}}if(e){this.events.triggerEvent("featuresremoved",{features:g})}},destroyFeatures:function(e,a){var d=(e==undefined);if(d){e=this.features}if(e){this.removeFeatures(e,a);for(var b=e.length-1;b>=0;b--){e[b].destroy()}}},drawFeature:function(a,b){if(!this.drawn){return}if(typeof b!="object"){var d=typeof b=="string"?b:a.renderIntent;b=a.style||this.style;if(!b){b=this.styleMap.createSymbolizer(a,d)}}if(!this.renderer.drawFeature(a,b)){this.unrenderedFeatures[a.id]=a}else{delete this.unrenderedFeatures[a.id]}},eraseFeatures:function(a){this.renderer.eraseFeatures(a)},getFeatureFromEvent:function(a){if(!this.renderer){OpenLayers.Console.error(OpenLayers.i18n("getFeatureError"));return null}var b=this.renderer.getFeatureIdFromEvent(a);return this.getFeatureById(b)},getFeatureById:function(e){var d=null;for(var b=0,a=this.features.length;b<a;++b){if(this.features[b].id==e){d=this.features[b];break}}return d},onFeatureInsert:function(a){},preFeatureInsert:function(a){},getDataExtent:function(){var b=null;if(this.features&&(this.features.length>0)){b=new OpenLayers.Bounds();for(var d=0,a=this.features.length;d<a;d++){b.extend(this.features[d].geometry.getBounds())}}return b},CLASS_NAME:"OpenLayers.Layer.Vector"});OpenLayers.Layer.WMS.Untiled=OpenLayers.Class(OpenLayers.Layer.WMS,{singleTile:true,initialize:function(d,b,g,a){OpenLayers.Layer.WMS.prototype.initialize.apply(this,arguments);var e="The OpenLayers.Layer.WMS.Untiled class is deprecated and will be removed in 3.0. Instead, you should use the normal OpenLayers.Layer.WMS class, passing it the option 'singleTile' as true.";OpenLayers.Console.warn(e)},clone:function(a){if(a==null){a=new OpenLayers.Layer.WMS.Untiled(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.WMS.prototype.clone.apply(this,[a]);return a},CLASS_NAME:"OpenLayers.Layer.WMS.Untiled"});OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},addPoint:function(a,b){this.addComponent(a,b)},removePoint:function(a){this.removeComponent(a)},CLASS_NAME:"OpenLayers.Geometry.MultiPoint"});OpenLayers.Handler.Point=OpenLayers.Class(OpenLayers.Handler,{point:null,layer:null,multi:false,drawing:false,mouseDown:false,lastDown:null,lastUp:null,persist:false,layerOptions:null,initialize:function(d,b,a){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{});OpenLayers.Handler.prototype.initialize.apply(this,arguments)},activate:function(){if(!OpenLayers.Handler.prototype.activate.apply(this,arguments)){return false}var a=OpenLayers.Util.extend({displayInLayerSwitcher:false,calculateInRange:function(){return true}},this.layerOptions);this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,a);this.map.addLayer(this.layer);return true},createFeature:function(){this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point());this.layer.addFeatures([this.point],{silent:true})},deactivate:function(){if(!OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){return false}if(this.drawing){this.cancel()}this.destroyFeature();if(this.layer.map!=null){this.layer.destroy(false)}this.layer=null;return true},destroyFeature:function(){if(this.layer){this.layer.destroyFeatures()}this.point=null},finalize:function(b){var a=b?"cancel":"done";this.drawing=false;this.mouseDown=false;this.lastDown=null;this.lastUp=null;this.callback(a,[this.geometryClone()]);if(b||!this.persist){this.destroyFeature()}},cancel:function(){this.finalize(true)},click:function(a){OpenLayers.Event.stop(a);return false},dblclick:function(a){OpenLayers.Event.stop(a);return false},drawFeature:function(){this.layer.drawFeature(this.point,this.style)},getGeometry:function(){var a=this.point.geometry;if(this.multi){a=new OpenLayers.Geometry.MultiPoint([a])}return a},geometryClone:function(){return this.getGeometry().clone()},mousedown:function(a){if(!this.checkModifiers(a)){return true}if(this.lastDown&&this.lastDown.equals(a.xy)){return true}if(this.lastDown==null){if(this.persist){this.destroyFeature()}this.createFeature()}this.lastDown=a.xy;this.drawing=true;var b=this.map.getLonLatFromPixel(a.xy);this.point.geometry.x=b.lon;this.point.geometry.y=b.lat;this.point.geometry.clearBounds();this.drawFeature();return false},mousemove:function(a){if(this.drawing){var b=this.map.getLonLatFromPixel(a.xy);this.point.geometry.x=b.lon;this.point.geometry.y=b.lat;this.point.geometry.clearBounds();this.drawFeature()}return true},mouseup:function(a){if(this.drawing){this.finalize();return false}else{return true}},CLASS_NAME:"OpenLayers.Handler.Point"});mapfish.Searcher.Map=OpenLayers.Class(mapfish.Searcher,OpenLayers.Control,{protocol:null,mode:null,searchTolerance:3,searchToleranceUnits:"pixels",pixelTolerance:2,delay:300,boxDivClassName:"olHandlerBoxZoomBox",displayDefaultPopup:false,onMouseMove:function(a){},position:null,popupLonLat:null,response:null,initialize:function(a){this.mode=mapfish.Searcher.Map.CLICK;mapfish.Searcher.prototype.initialize.call(this,a);OpenLayers.Control.prototype.initialize.call(this,a);if(!this.protocol){OpenLayers.Console.error("no protocol set");return}switch(this.mode){case mapfish.Searcher.Map.CLICK:this.handler=new OpenLayers.Handler.Click(this,{click:this.handlePoint},{delay:this.delay,pixelTolerance:this.pixelTolerance});break;case mapfish.Searcher.Map.HOVER:this.handler=new OpenLayers.Handler.Hover(this,{pause:this.handlePoint,move:this.cancelSearch},{delay:this.delay,pixelTolerance:this.pixelTolerance});break;case mapfish.Searcher.Map.BOX:this.handler=new OpenLayers.Handler.Box(this,{done:this.handleBox},{boxDivClassName:this.boxDivClassName});break;case mapfish.Searcher.Map.EXTENT:break;default:OpenLayers.Console.error("unsupported mode");return}},activate:function(){var a=OpenLayers.Control.prototype.activate.call(this);if(a){if(this.mode==mapfish.Searcher.Map.EXTENT){this.map.events.register("moveend",this,this.handleMoveend)}else{if(this.displayDefaultPopup&&this.protocol.CLASS_NAME=="mapfish.Protocol.TriggerEventDecorator"){this.protocol.events.on({crudfinished:this.displayPopup,scope:this})}}}return a},deactivate:function(){var a=OpenLayers.Control.prototype.deactivate.call(this);if(a){if(this.mode==mapfish.Searcher.Map.EXTENT){this.map.events.unregister("moveend",this,this.handleMoveend)}else{if(this.displayDefaultPopup&&this.protocol.CLASS_NAME=="mapfish.Protocol.TriggerEventDecorator"){this.protocol.events.un({crudfinished:this.displayPopup,scope:this})}}}return a},handlePoint:function(a){this.position=a.xy;this.popupLonLat=this.map.getLonLatFromViewPortPx(this.position);this.triggerSearch()},handleBox:function(a){if(a instanceof OpenLayers.Bounds){var d=this.map.getLonLatFromPixel(new OpenLayers.Pixel(a.left,a.bottom));var b=this.map.getLonLatFromPixel(new OpenLayers.Pixel(a.right,a.top));this.position=new OpenLayers.Bounds(d.lon,d.lat,b.lon,b.lat);this.popupLonLat=this.position.getCenterLonLat()}else{this.position=a;this.popupLonLat=this.map.getLonLatFromViewPortPx(this.position)}this.triggerSearch()},handleMoveend:function(){this.position=this.map.getExtent();this.triggerSearch()},triggerSearch:function(){this.cancelSearch();var b=this.getFilter();b=this.isFilter(b)?{filter:b}:{params:b};var a=OpenLayers.Util.extend({searcher:this},b);this.response=this.protocol.read(a)},cancelSearch:function(a){this.protocol.abort(this.response);this.response=null;if(this.mode==mapfish.Searcher.Map.HOVER){this.onMouseMove()}},displayPopup:function(e){var l=e.features;if(l&&l.length>0){var d;var h="<table><tr>";for(d in l[0].attributes){h+="<th>"+d+"</th>"}h+="</tr>";for(var g=0;g<l.length;g++){var b=l[g].attributes;h+="<tr>";for(d in b){h+="<td>"+b[d]+"</td>"}h+="</tr>"}h+="</table>";var a=new OpenLayers.Popup.FramedCloud("mapfish_popup",this.popupLonLat,null,h,null,true);this.map.addPopup(a,true)}},isFilter:function(a){return !!a.CLASS_NAME&&!!a.CLASS_NAME.match(/^OpenLayers\.Filter/)},getFilter:function(){var b=null;if(this.mode==mapfish.Searcher.Map.EXTENT&&!this.position){this.position=this.map.getExtent()}if(this.position){if(this.position instanceof OpenLayers.Bounds){b=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:this.position})}else{var a=this.searchTolerance;if(a&&this.searchToleranceUnits=="pixels"){a*=this.map.getResolution()}var d=this.map.getLonLatFromViewPortPx(this.position);b={lon:d.lon,lat:d.lat};if(a){b.tolerance=a}}this.position=null}return b},CLASS_NAME:"mapfish.Searcher.Map"});mapfish.Searcher.Map.CLICK="CLICK";mapfish.Searcher.Map.HOVER="HOVER";mapfish.Searcher.Map.BOX="BOX";mapfish.Searcher.Map.EXTENT="EXTENT";Ext.namespace("mapfish.widgets");Ext.namespace("mapfish.widgets.editing");mapfish.widgets.editing.FeatureList=function(a){Ext.apply(this,a,{sm:new Ext.grid.RowSelectionModel({singleSelect:true}),clicksToEdit:1,enableDragDrop:true});mapfish.widgets.editing.FeatureList.superclass.constructor.call(this)};Ext.extend(mapfish.widgets.editing.FeatureList,Ext.grid.EditorGridPanel,{featureType:null,map:null,layer:null,automaticMode:false,autoFocusMode:2,displayNotEdited:true,editGeometryVisual:function(b,a,d){return b?(d?"->":"X"):""},isDnd:false,colDefs:null,modifyFeature:null,initComponent:function(){if(!this.map&&!this.layer){OpenLayers.Console.error("Mandatory param for FeatureList missing: layer and/or map")}if(!this.featureType){OpenLayers.Console.error("Mandatory param for FeatureList missing: featureType")}this.colDefs=this.columns;mapfish.widgets.editing.FeatureList.superclass.initComponent.call(this);this.setGeoColRenderer();if(!this.map){this.map=this.layer.map}else{if(!this.layer){this.layer=new OpenLayers.Layer.Vector("Geometry editing");this.map.addLayer(this.layer)}}var a=this;this.addEvents({geomodifstart:true,geomodif:true,geomodifend:true});var d=OpenLayers.Control.ModifyFeature.RESHAPE|OpenLayers.Control.ModifyFeature.DRAG;this.modifyFeature=new OpenLayers.Control.ModifyFeature(this.layer,{mode:d,onModificationStart:function(g){if(!a.automaticMode){this.activate()}a.refreshGeometryVisual(g.data);var e=g.data;var h=a.getStore().findBy(function(l){return l.id==e.id});a.getView().focusCell(h,0);a.getSelectionModel().selectRange(h,h);a.fireEvent("geomodifstart",a,e,g)},onModification:function(e){a.fireEvent("geomodif",a,e.data,e)},onModificationEnd:function(e){if(!a.automaticMode){this.deactivate()}if(e.data){a.refreshGeometryVisual(e.data)}if(!a.displayNotEdited){a.layer.removeFeatures(e)}a.fireEvent("geomodifend",a,e.data,e)}});this.map.addControl(this.modifyFeature);this.getStore().on("remove",function(g,e,h){this.removeGeometries(e)},this);this.getStore().on("clear",function(e){e.each(this.removeGeometries,this)},this);function b(g,e,h){if(a.displayNotEdited){for(var l=0;l<e.length;++l){a.addGeometries(e[l])}}return true}this.getStore().on("add",b);this.getStore().on("load",function(g,e,h){if(!h.add){if(this.modifyFeature.feature){this.modifyFeature.selectControl.unselect(this.modifyFeature.feature)}this.clearLayer()}b(g,e,0);return true},this)},onRender:function(){mapfish.widgets.editing.FeatureList.superclass.onRender.apply(this,arguments);var b=this;var a=new Ext.dd.DropTarget(this.getView().mainBody,{ddGroup:"GridDD",notifyOver:function(h,l,g){var d=h.getDragData(l).rowIndex;if(typeof d!="undefined"){return this.dropAllowed}return this.dropNotAllowed},notifyDrop:function(d,o,l){var m=d.getDragData(o);var h=m.rowIndex;if(typeof h!="undefined"){var g=l.selections[0];b.isDnd=true;l.grid.store.remove(g);m.grid.store.insert(h,g);b.isDnd=false;return true}return false}});if(this.displayNotEdited){this.drawAllFeatures()}},eachGeoColumn:function(e){for(var d=0;d<this.colDefs.length;++d){var b=this.colDefs[d];var a=this.featureType.prototype.fields.get(b.dataIndex);if(a.type=="geo"){e.call(this,b,a,d)}}},setGeoColRenderer:function(){this.eachGeoColumn(function(d,a,b){d.renderer=OpenLayers.Function.bind(function(m,l,e,o,h,g){if(m){var p=(this.grid.modifyFeature.feature!=null)&&(this.grid.getFeatureByGeometry(m)==this.grid.modifyFeature.feature);return"<div onclick=\"mapfish.widgets.editing.FeatureList.geometryClickHandler('"+this.grid.id+"', "+e.id+", '"+this.colName+"');\">"+this.grid.editGeometryVisual(m,e,p)+"</div>"}else{return this.grid.editGeometryVisual(m,e,false)}},{grid:this,colName:a.name})})},drawAllFeatures:function(){this.clearLayer();if(this.displayNotEdited){var a=[];this.eachGeoColumn(function(e,b,d){this.store.each(function(h){var l=h.get(b.name);if(l&&!this.getFeatureByGeometry(l)){var g=new OpenLayers.Feature.Vector(l,h);a.push(g)}},this)});this.layer.addFeatures(a)}},addGeometries:function(a){var b=this.layer;this.eachGeoColumn(function(h,d,g){var l=a.get(d.name);if(l&&!this.getFeatureByGeometry(l)){var e=new OpenLayers.Feature.Vector(l,a);b.addFeatures(e)}})},removeGeometries:function(a){this.eachGeoColumn(function(e,b,d){var h=a.get(b.name);if(h){var g=this.getFeatureByGeometry(h);if(g){if(g==this.modifyFeature.feature){g.data=null;this.modifyFeature.selectControl.unselect(g)}this.layer.removeFeatures([g]);g.destroy()}}});return true},getFeatureByGeometry:function(e){var b=this.layer.features;for(var a=0;a<b.length;++a){var d=b[a];if(d.geometry==e){return d}}return null},editFirstGeometry:function(b){if(this.automaticMode){return}var g;for(var e=0;e<this.colDefs.length;++e){var d=this.colDefs[e];var a=this.featureType.prototype.fields.get(d.dataIndex);if(a.type=="geo"){g=a.name;break}}this.editGeometry(b,g,false)},editGeometry:function(b,g,a){var h=b.get(g);if(!h){return}var d=this.getFeatureByGeometry(h);if(!d&&!this.displayNotEdited){d=new OpenLayers.Feature.Vector(h,b);this.layer.addFeatures(d)}if(d){var e=this.modifyFeature.feature;if(e){this.modifyFeature.selectControl.unselect(this.modifyFeature.feature)}if(e!=d){this.modifyFeature.selectControl.select(d);if(a){this.manageAutoFocus(h)}}}else{OpenLayers.Console.error("BUG: cannot find vector feature for: "+b)}},manageAutoFocus:function(d){if(this.autoFocusMode==1){this.map.zoomToExtent(d.getBounds())}else{if(this.autoFocusMode==2){var a=this.map.getExtent();a.extend(d.getBounds());var b=a.getWidth()*0.02;a.left+=b;a.right-=b;a.top-=b;a.bottom+=b;this.map.zoomToExtent(a)}}},refreshGeometryVisual:function(a){this.getView().refreshRow(a)},setAutomaticMode:function(a){if(a==this.automaticMode){return}this.automaticMode=a;if(this.modifyFeature.feature){this.modifyFeature.selectControl.unselect(this.modifyFeature.feature)}if(a){this.modifyFeature.activate()}else{this.modifyFeature.deactivate()}},setDisplayNotEdited:function(a){if(a==this.displayNotEdited){return}this.displayNotEdited=a;if(a){this.drawAllFeatures()}else{this.clearLayer();this.setAutomaticMode(false)}},clearLayer:function(){var d=[];var b=this.layer;var g=this.modifyFeature.feature;for(var a=0;a<b.features.length;++a){var e=b.features[a];if(e!=g&&e.data&&e.data.endEdit){d.push(e)}}b.removeFeatures(d)}});Ext.reg("featurelist",mapfish.widgets.editing.FeatureList);mapfish.widgets.editing.FeatureList.geometryClickHandler=function(b,e,g){var d=Ext.getCmp(b);if(d){var a=d.store.getById(e);if(a){d.editGeometry(a,g,true)}else{OpenLayers.Console.error("Cannot find record with id="+e)}}else{OpenLayers.Console.error("Cannot find grid with id="+b)}};mapfish.widgets.editing.FeatureList.createRecord=function(d){for(var b=0;b<d.length;++b){var a=d[b];if(a.type=="geo"){if(!a.convert){a.convert=function(e){return e}}if(!a.sortType){a.sortType=Ext.data.SortTypes.none()}}}return Ext.data.Record.create.apply(null,arguments)};Ext.namespace("mapfish.widgets","mapfish.widgets.recenter");mapfish.widgets.recenter.Base=function(a){Ext.apply(this,a);mapfish.widgets.recenter.Base.superclass.constructor.call(this)};Ext.extend(mapfish.widgets.recenter.Base,Ext.FormPanel,{scales:null,showCenter:null,defaultZoom:null,vectorLayer:null,expandedOnce:false,initComponent:function(){mapfish.widgets.recenter.Base.superclass.initComponent.apply(this,arguments);this.on("destroy",this.destroyResources,this);this.on("collapse",this.destroyResources,this);this.on("deactivate",this.destroyResources,this);this.on("disable",this.destroyResources,this)},render:function(){if(!this.ownerCt.initialConfig.layout||this.ownerCt.initialConfig.layout.toLowerCase!="accordion"){this.addItems()}mapfish.widgets.recenter.Base.superclass.render.apply(this,arguments)},expand:function(){mapfish.widgets.recenter.Base.superclass.expand.apply(this,arguments);if(!this.expandedOnce){this.addItems();this.expandedOnce=true;this.doLayout()}},addItems:function(){OpenLayers.Console.warn("must be implemented by subclasses")},removeAll:function(){if(this.items){this.items.each(this.remove,this);this.form.items.clear()}},addRecenterButton:function(){this.addButton({text:OpenLayers.i18n("mf.recenter.submit"),handler:this.recenter,scope:this})},addScaleCombo:function(){this.add(mapfish.widgets.createScaleComboBox({scales:this.scales},{fieldLabel:OpenLayers.i18n("mf.print.scale"),typeAhead:false,mode:"local",id:"scale_"+this.getId(),name:"scale",hiddenName:"scaleValue",editable:false,triggerAction:"all"}))},recenter:function(){OpenLayers.Console.warn("must be implemented by subclasses")},recenterOnCoords:function(a,d,b){b=b||this.defaultZoom||this.map.getZoom();if(this.showCenter){this.showCenterMark(a,d)}this.map.setCenter(new OpenLayers.LonLat(a,d),b)},showCenterMark:function(a,d){this.prepareVectorLayer();var b=[new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(a,d),{type:"cross"})];this.vectorLayer.addFeatures(b)},prepareVectorLayer:function(){if(this.vectorLayer){this.vectorLayer.destroyFeatures()}else{var a=new OpenLayers.StyleMap({"default":{graphicName:"${type}",pointRadius:10,fillColor:"red",fillOpacity:1}});this.vectorLayer=new OpenLayers.Layer.Vector("Center Symbol",{styleMap:a,alwaysInRange:true});this.map.addLayer(this.vectorLayer)}},showError:function(b,a){a=a||OpenLayers.i18n("mf.error");Ext.Msg.alert(a,b)},destroyLayer:function(){var a=this.vectorLayer;if(a){a.destroy();this.vectorLayer=null}},destroyResources:function(){this.destroyLayer()}});Ext.namespace("mapfish.widgets");mapfish.widgets.RadioTreeNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{renderElements:function(g,q,p,r){this.indentMarkup=g.parentNode?g.parentNode.ui.getChildIndent():"";var h=typeof q.checked=="boolean";var l=g.attributes.radioGrp||"radioGrp";var d=q.href?q.href:Ext.isGecko?"":"#";var e=['<li class="x-tree-node"><div ext:tree-node-id="',g.id,'" class="x-tree-node-el x-tree-node-leaf x-unselectable ',q.cls,'" unselectable="on">','<span class="x-tree-node-indent">',this.indentMarkup,"</span>",'<img src="',this.emptyIcon,'" class="x-tree-ec-icon x-tree-elbow" />','<img src="',q.icon||this.emptyIcon,'" class="x-tree-node-icon',(q.icon?" x-tree-node-inline-icon":""),(q.iconCls?" "+q.iconCls:""),'" unselectable="on" />',h?('<input class="x-tree-node-cb" type="radio" id="'+g.id+'" name="'+l+'" '+(q.checked?'checked="checked" />':"/>")):"",'<a hidefocus="on" class="x-tree-node-anchor" href="',d,'" tabIndex="1" ',q.hrefTarget?' target="'+q.hrefTarget+'"':"",'><span unselectable="on">',g.text,"</span></a></div>",'<ul class="x-tree-node-ct" style="display:none;"></ul>',"</li>"].join("");var b;if(r!==true&&g.nextSibling&&(b=g.nextSibling.ui.getEl())){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",b,e)}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",p,e)}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var o=this.elNode.childNodes;this.indentNode=o[0];this.ecNode=o[1];this.iconNode=o[2];var m=3;if(h){this.checkbox=o[3];m++}this.anchor=o[m];this.textNode=o[m].firstChild},_unused_renderElements:function(l,d,g,b){mapfish.widgets.RadioTreeNodeUI.superclass.renderElements.apply(this,arguments);var h=Ext.DomQuery.selectNode(".x-tree-node-cb",this.elNode);var e=l.attributes.radioGrp||"radioGrp";h.setAttribute("type","radio");h.setAttribute("id",l.id);h.setAttribute("name",e)},onRadioChange:function(){var a=this.checkbox.checked;this.node.attributes.checked=a;this.fireEvent("radiochange",this.node,a)}});mapfish.widgets.LayerTreeEventModel=Ext.extend(Ext.tree.TreeEventModel,{delegateClick:function(b,a){if(!this.beforeEvent(b)){return}if(b.getTarget("input[type=checkbox]",1)){this.onCheckboxClick(b,this.getNode(b))}else{if(b.getTarget("input[type=radio]",1)){this.onRadioClick(b,this.getNode(b))}else{if(b.getTarget(".x-tree-ec-icon",1)){this.onIconClick(b,this.getNode(b))}else{if(this.getNodeTarget(b)){this.onNodeClick(b,this.getNode(b))}}}}},onRadioClick:function(b,a){if(!a.ui.onRadioChange){OpenLayers.Console.error("Invalid TreeNodeUI Class, no onRadioChange is available");return}a.ui.onRadioChange(b)}});mapfish.widgets.LayerTree=function(a){Ext.apply(this,a);mapfish.widgets.LayerTree.superclass.constructor.call(this)};Ext.extend(mapfish.widgets.LayerTree,Ext.tree.TreePanel,{separator:":",model:null,showWmsLegend:false,rootVisible:false,animate:true,autoScroll:true,loader:new Ext.tree.TreeLoader({}),enableDD:false,containerScroll:true,ascending:true,_automaticModel:true,layerNameToLayer:{},baseLayerNames:[],layersWithSublayers:{},layerToNodeIds:{},nodeIdToNode:{},nodeIdToLayers:{},hasCheckbox:function(a){return typeof(a.attributes.checked)=="boolean"},setNodeChecked:function(a,e,b){var d=(a instanceof Ext.data.Node)?a:this.getNodeById(a);if(!d||!this.hasCheckbox(d)){return}if(e===undefined){e=!d.attributes.checked}d.attributes.checked=e;if(d.ui&&d.ui.checkbox){d.ui.checkbox.checked=e}if(b||(b===undefined)){d.fireEvent("checkchange",d,e)}},updateDisabled:function(){var a=this.map.getScale();this.getRootNode().cascade(function(b){if((b.attributes.minscale&&a<b.attributes.minscale)||(b.attributes.maxscale&&a>b.attributes.maxscale)){b.disable()}else{b.enable()}},this)},_updateCachedObjects:function(){if(!this.map){OpenLayers.Console.error("map Object needs to be available when calling _updateCachedObjects");return}this.layerNameToLayer={};this.baseLayerNames=[];this.layersWithSublayers={};this.layerToNodeIds={};this.nodeIdToNode={};this.nodeIdToLayers={};Ext.each(this.map.layers,function(b){var a=b.name;this.layerNameToLayer[a]=b;if(b.isBaseLayer){this.baseLayerNames.push(a)}},this);this.getRootNode().cascade(function(d){if(!d.attributes.layerNames){return true}var e=d.attributes.layerNames;for(var b=0;b<e.length;b++){var a=e[b];if(a.indexOf(this.separator)!=-1){var a=a.split(this.separator)[0];this.layersWithSublayers[a]=true}if(!this.nodeIdToLayers[d.id]){this.nodeIdToLayers[d.id]=[]}this.nodeIdToLayers[d.id].push(this.layerNameToLayer[a])}},this);this.getRootNode().cascade(function(e){var d=e.attributes.checked;var g=e.attributes.layerNames;if(!g){return}for(var b=0;b<g.length;b++){var a=g[b];if(!a){continue}if(!this.layerToNodeIds[a]){this.layerToNodeIds[a]=[]}this.layerToNodeIds[a].push(e.id);this.nodeIdToNode[e.id]=e}},this)},_updateCheckboxAncestors:function(){var e={};var d=this;function b(m){if(!d.hasCheckbox(m)){throw new Error(arguments.callee.name+" should only be called on checkbox nodes")}var l=[];m.eachChild(function(o){if(d.hasCheckbox(o)){l.push(o)}},this);if(l.length==0){return m.attributes.checked}var h=true;Ext.each(l,function(o){if(!b(o)){h=false;return false}},this);d.setNodeChecked(m,h,false);delete e[m.id];return h}var a=[];this.getRootNode().cascade(function(h){if(this.hasCheckbox(h)){a.push(h);e[h.id]=true}},this);var g;while(g=a.shift()){if(e[g.id]){b(g)}}},_handleModelChange:function LT__handleModelChange(s,m){if(s){s.cascade(function(t){this.setNodeChecked(t,m,false)},this)}this._updateCheckboxAncestors();if(!this.map){return}this._updateCachedObjects();function h(){var t={};Ext.each(this.map.layers,function(w){var v=w.name;t[v]=w.visibility;if(!(w instanceof OpenLayers.Layer.WMS)&&!(w instanceof OpenLayers.Layer.WMS.Untiled)&&!(w instanceof OpenLayers.Layer.MapServer)){return}if(!this.layersWithSublayers[w.name]){return}if(w.isBaseLayer){OpenLayers.Console.error("Using sublayers on a base layer is not supported (base layer is "+v+")")}if(!w._origLayers){w._origLayers=w.params.LAYERS||w.params.layers}var B=w._origLayers;if(B instanceof Array){for(var u=0;u<B.length;u++){var z=B[u];t[v+this.separator+z]=w.visibility}}},this);return t}function e(u){var t={};this.getRootNode().cascade(function(B){var z=B.attributes.checked;var D=B.attributes.layerNames;var C=null;if(!D){return}for(var w=0;w<D.length;w++){var v=D[w];if(!v){continue}if(u[v]==undefined){OpenLayers.Console.error("Invalid layer: ",v)}if(B.attributes.radio){C=B.attributes.radioGrp||"radioGrp";if(!d[C]){d[C]={}}d[C][v]=z}if(t[v]){continue}if(B==s){if(this.baseLayerNames.indexOf(v)!=-1){q=v}if(C){l[0]=C;l[1]=v}t[v]=true}u[v]=z}},this);return u}function p(v,u,z){var w=0;for(var t=0;t<this.baseLayerNames.length;t++){if(v[this.baseLayerNames[t]]){w++}}if(w==1){return v}for(var t=0;t<this.baseLayerNames.length;t++){v[this.baseLayerNames[t]]=false}if(u){v[u]=true;return v}if(!z){return v}v[z]=true;return v}function r(v,z,u){for(var w in u){for(var t in u[w]){if(z[0]==w){v[t]=t==z[1]}else{v[t]=u[w][t]}}}return v}function a(C){for(var v in C){var z=this.layerToNodeIds[v];if(!z){continue}for(var w=0;w<z.length;w++){var B=this.nodeIdToNode[z[w]];if(!B){continue}var D=B.attributes.layerNames;if(!D){OpenLayers.Console.error("unexpected state");continue}var t=true;for(var u=0;u<D.length;u++){var v=D[u];if(!v){continue}if(!C[v]){t=false;break}}this.setNodeChecked(B,t,false)}}}function b(F){var G={};for(var E in F){var u=F[E];var H=E.split(this.separator);if(H.length!=2){continue}delete F[E];E=H[0];var I=H[1];if(!G[E]){G[E]=[]}if(u){G[E].push(I)}}for(E in G){if(F[E]!==undefined){delete F[E]}}for(var E in F){var D=this.layerNameToLayer[E];if(!D){OpenLayers.Console.error("Non existing layer name",E);continue}if(this.baseLayerNames.indexOf(E)!=-1){if(F[E]){this.map.setBaseLayer(D)}}else{D.setVisibility(F[E])}}for(var E in G){var D=this.layerNameToLayer[E];var z=G[E];if(D.isBaseLayer){OpenLayers.Console.error("base layer for sublayer are not supported");return}if(z.length==0){D.setVisibility(false,true)}else{if(!this.enableDD){if(!D._origLayers){OpenLayers.Console.error("Assertion failure")}var C=D._origLayers;var B=[];for(var w=0;w<C.length;w++){var v=C[w];if(z.indexOf(v)!=-1){B.push(v)}}z=B}var t=D.params.LAYERS?"LAYERS":"layers";if(!mapfish.Util.arrayEqual(D.params[t],z)){D.params[t]=z;D.redraw()}D.setVisibility(true,true)}}}var o;if(this.map.baseLayer){o=this.map.baseLayer.name}var q;var d={};var l=[];var g=h.call(this);g=e.call(this,g);p.call(this,g,q,o);r.call(this,g,l,d);a.call(this,g);b.call(this,g)},_extractOLModel:function LT__extractOLModel(){var p=[];var e=this.map.layers.slice();if(!this.ascending){e.reverse()}for(var q=0;q<e.length;q++){var g=e[q];var h=[];if(g instanceof OpenLayers.Layer.WMS||g instanceof OpenLayers.Layer.WMS.Untiled||g instanceof OpenLayers.Layer.MapServer){var o=g.params.LAYERS||g.params.layers;if(o instanceof Array){for(var m=0;m<o.length;m++){var r=o[m];var a;if(this.showWmsLegend){a=mapfish.Util.getIconUrl(g.url,{layer:r})}var b={text:r,checked:g.getVisibility(),icon:a,layerName:g.name+this.separator+r,children:[],cls:"cf-wms-node"};if(this.ascending){h.push(b)}else{h.unshift(b)}}}}var d={text:g.name,checked:g.getVisibility(),layerName:(h.length>0?null:g.name),children:h};if(!g.displayInLayerSwitcher){d.uiProvider=function(){};d.uiProvider.prototype={render:function(){},renderIndent:function(){}}}p.push(d)}return p},_updateOrder:function(){this._updateCachedObjects();function e(p,m){for(var o=0;o<p.length;o++){var h=p[o];if(h.name==m){return o}}return -1}var a=this.map.layers.slice();var g={};var b=[];this.getRootNode().cascade(function(h){if(this.ascending){b.push(h)}else{b.unshift(h)}},this);Ext.each(b,function(h){var l=this.nodeIdToLayers[h.id];if(!l){return}Ext.each(l,function(p){var o=p.name;if(g[o]){return}g[o]=true;var m=e(a,o);if(m==-1||!this.layerNameToLayer[o]){throw new Error("Layer "+o+" not available")}a.splice(m,1);a.push(this.layerNameToLayer[o])},this)},this);this._updateCheckboxAncestors();this.map.layers=a;for(var d=0;d<this.map.layers.length;d++){this.map.setLayerZIndex(this.map.layers[d],d)}},_fixupModel:function(){this.getRootNode().cascade(function(b){var a=b.attributes;if(!a.layerNames&&a.layerName){a.layerNames=[a.layerName];delete a.layerName}},this);if(this.map){this._updateCachedObjects()}this.getRootNode().cascade(function(b){var d;if(!b.attributes.radio&&(!this.map||!(d=this.nodeIdToLayers[b.id]))){return}var a=false;if(d){a=true;Ext.each(d,function(e){if(!e.isBaseLayer){a=false;return false}},this)}if(a||b.attributes.radio){b.attributes.uiProvider=mapfish.widgets.RadioTreeNodeUI;if(b.ui){b.ui=new mapfish.widgets.RadioTreeNodeUI(b)}}},this)},initComponent:function(){this.eventModel=new mapfish.widgets.LayerTreeEventModel(this);mapfish.widgets.LayerTree.superclass.initComponent.call(this);this.addListener("checkchange",function e(l,h){this._handleModelChange(l,h)},this);this.addListener("radiochange",function b(l,h){this._handleModelChange(l,h)},this);this._automaticModel=!this.model;if(!this.model){this.model=this._extractOLModel()}var a={text:"Root",draggable:false,id:"source",children:this.model,leaf:false};function g(h){var o=new Ext.tree.TreeNode(h);var m=h.children;o.leaf=!m;if(!m){return o}for(var l=0;l<m.length;l++){if(!m[l]){continue}o.appendChild(g(m[l]))}return o}var d=g(a);this.setRootNode(d);this._fixupModel();this.addListener("dragdrop",function(){this._updateOrder(arguments)},this);if(!this._automaticModel){this._handleModelChange(null,null);if(this.enableDD){this._updateOrder()}}},onRender:function(b,a){if(!this.el){this.el=document.createElement("div")}mapfish.widgets.LayerTree.superclass.onRender.apply(this,arguments)}});Ext.reg("layertree",mapfish.widgets.LayerTree);OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(a){OpenLayers.Geometry.MultiPoint.prototype.initialize.apply(this,arguments)},getLength:function(){var d=0;if(this.components&&(this.components.length>1)){for(var b=1,a=this.components.length;b<a;b++){d+=this.components[b-1].distanceTo(this.components[b])}}return d},CLASS_NAME:"OpenLayers.Geometry.Curve"});Ext.namespace("mapfish.widgets","mapfish.widgets.recenter");mapfish.widgets.recenter.Coords=function(a){Ext.apply(this,a);mapfish.widgets.recenter.Coords.superclass.constructor.call(this)};Ext.extend(mapfish.widgets.recenter.Coords,mapfish.widgets.recenter.Base,{addItems:function(){this.removeAll();this.add({xtype:"numberfield",fieldLabel:OpenLayers.i18n("mf.recenter.x"),name:"coordx"});this.add({xtype:"numberfield",fieldLabel:OpenLayers.i18n("mf.recenter.y"),name:"coordy"});if(this.scales){this.addScaleCombo()}this.addRecenterButton()},recenter:function(){var b=this.getForm().getValues();var a=b.coordx;var e=b.coordy;if(this.checkCoords(a,e)){var d;if(this.scales&&b.scaleValue){resolution=OpenLayers.Util.getResolutionFromScale(b.scaleValue,this.map.units);d=this.map.getZoomForResolution(resolution)}this.recenterOnCoords(a,e,d)}},checkCoords:function(b,d){if(!b||!d){this.showError(OpenLayers.i18n("mf.recenter.missingCoords"));return false}var a=this.map.maxExtent;if(b<a.left||b>a.right||d<a.bottom||d>a.top){this.showError(OpenLayers.i18n("mf.recenter.outOfRangeCoords",{myX:b,myY:d,coordX:OpenLayers.i18n("mf.recenter.x"),coordY:OpenLayers.i18n("mf.recenter.y"),minCoordX:a.left,maxCoordX:a.right,minCoordY:a.bottom,maxCoordY:a.top}));return false}return true}});Ext.reg("coordsrecenter",mapfish.widgets.recenter.Coords);mapfish.widgets.LayerTree.getNodeLayers=function(a,d){var b=[];d.cascade(function(g){var e=a.nodeIdToLayers[g.id];if(e){b=b.concat(e)}});return b};mapfish.widgets.LayerTree.removeNode=function(a,b){b.cascade(function(o){if(o.attributes&&o.attributes.layerNames){var m=o.attributes.layerNames;for(var e=0;e<m.length;++e){var d=m[e].split(a.separator);var l=a.layerNameToLayer[d[0]];var h=d[1];var g;if(l.params.LAYERS){g=l.params.LAYERS=mapfish.Util.fixArray(l.params.LAYERS)}else{g=l.params.layers=mapfish.Util.fixArray(l.params.layers)}if(h&&g){g.remove(h)}if(!h||!g||g.length==0){l.destroy()}else{l.redraw()}}}});b.remove();a._updateCachedObjects()};mapfish.widgets.LayerTree.MenuFeatures={opacitySlide:function(a,d,b){if(b.length==0){return null}return{text:OpenLayers.Lang.translate("mf.layertree.opacity"),menu:{plain:true,items:[mapfish.widgets.LayerTree.MenuFeatures.opacitySlideDirect(a,d,b)]}}},opacitySlideDirect:function(a,e,d){if(d.length==0){return null}var g=0;for(var b=0;b<d.length;++b){g+=d[b].opacity==null?1:d[b].opacity}g=g/d.length;return new Ext.menu.Adapter(new Ext.Slider({width:200,value:g*100,listeners:{change:function(l,m){for(var h=0;h<d.length;++h){d[h].setOpacity(m/100)}}}}))},remove:function(a,g,e){if(e.length==0){return null}for(var d=0;d<e.length;++d){var b=e[d];if(b.isBaseLayer&&b.getVisibility()){return null}}return{text:OpenLayers.Lang.translate("mf.layertree.remove"),handler:function(){mapfish.widgets.LayerTree.removeNode(a,g)}}},zoomToExtent:function(a,g,e){if(e.length==0){return null}var h=null;for(var d=0;d<e.length;++d){var b=e[d];if(h){h.extend(b.maxExtent)}else{h=b.maxExtent.clone()}}return{text:OpenLayers.Lang.translate("mf.layertree.zoomToExtent"),handler:function(){a.map.zoomToExtent(h)}}}};mapfish.widgets.LayerTree.createContextualMenuPlugin=function(a){return{init:function(b){function d(p,q){var o=mapfish.widgets.LayerTree.getNodeLayers(b,p);var g=[];for(var h=0;h<a.length;++h){var m=mapfish.widgets.LayerTree.MenuFeatures[a[h]];var l=m(b,p,o);if(l){g.push(l)}}if(g.length>0){var r=new Ext.menu.Menu({ignoreParentClick:true,defaults:{scope:b},items:g});r.showAt(q.getXY());r.on("hide",function(){r.destroy()})}}if(Ext.isOpera){b.on("click",function(g,h){if(h.hasModifier()){h.stopEvent();d(g,h)}})}else{b.on("contextMenu",function(g,h){h.stopEvent();d(g,h)})}}}};OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{initialize:function(a){OpenLayers.Geometry.Curve.prototype.initialize.apply(this,arguments)},removeComponent:function(a){if(this.components&&(this.components.length>2)){OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments)}},intersects:function(q){var d=false;var p=q.CLASS_NAME;if(p=="OpenLayers.Geometry.LineString"||p=="OpenLayers.Geometry.LinearRing"||p=="OpenLayers.Geometry.Point"){var t=this.getSortedSegments();var r;if(p=="OpenLayers.Geometry.Point"){r=[{x1:q.x,y1:q.y,x2:q.x,y2:q.y}]}else{r=q.getSortedSegments()}var w,l,g,a,v,u,e,b;outer:for(var m=0,o=t.length;m<o;++m){w=t[m];l=w.x1;g=w.x2;a=w.y1;v=w.y2;inner:for(var h=0,s=r.length;h<s;++h){u=r[h];if(u.x1>g){break}if(u.x2<l){continue}e=u.y1;b=u.y2;if(Math.min(e,b)>Math.max(a,v)){continue}if(Math.max(e,b)<Math.min(a,v)){continue}if(OpenLayers.Geometry.segmentsIntersect(w,u)){d=true;break outer}}}}else{d=q.intersects(this)}return d},getSortedSegments:function(){var a=this.components.length-1;var b=new Array(a);for(var d=0;d<a;++d){point1=this.components[d];point2=this.components[d+1];if(point1.x<point2.x){b[d]={x1:point1.x,y1:point1.y,x2:point2.x,y2:point2.y}}else{b[d]={x1:point2.x,y1:point2.y,x2:point1.x,y2:point1.y}}}function e(h,g){return h.x1-g.x1}return b.sort(e)},CLASS_NAME:"OpenLayers.Geometry.LineString"});OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(a){OpenLayers.Geometry.LineString.prototype.initialize.apply(this,arguments)},addComponent:function(a,b){var d=false;var e=this.components.pop();if(b!=null||!a.equals(e)){d=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments)}var g=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[g]);return d},removeComponent:function(a){if(this.components.length>4){this.components.pop();OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);var b=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[b])}},move:function(b,e){for(var d=0,a=this.components.length;d<a-1;d++){this.components[d].move(b,e)}},rotate:function(e,b){for(var d=0,a=this.components.length;d<a-1;++d){this.components[d].rotate(e,b)}},resize:function(g,b,e){for(var d=0,a=this.components.length;d<a-1;++d){this.components[d].resize(g,b,e)}},transform:function(g,d){if(g&&d){for(var e=0,a=this.components.length;e<a-1;e++){var b=this.components[e];b.transform(g,d)}this.bounds=null}return this},getArea:function(){var h=0;if(this.components&&(this.components.length>2)){var g=0;for(var e=0,d=this.components.length;e<d-1;e++){var a=this.components[e];var l=this.components[e+1];g+=(a.x+l.x)*(l.y-a.y)}h=-g/2}return h},containsPoint:function(r){var z=OpenLayers.Number.limitSigDigs;var q=14;var p=z(r.x,q);var o=z(r.y,q);function w(F,C,E,B,D){return(((C-B)*F)+((B*E)-(C*D)))/(E-D)}var a=this.components.length-1;var l,h,v,e,t,b,g,d;var m=0;for(var s=0;s<a;++s){l=this.components[s];v=z(l.x,q);e=z(l.y,q);h=this.components[s+1];t=z(h.x,q);b=z(h.y,q);if(e==b){if(o==e){if(v<=t&&(p>=v&&p<=t)||v>=t&&(p<=v&&p>=t)){m=-1;break}}continue}g=z(w(o,v,e,t,b),q);if(g==p){if(e<b&&(o>=e&&o<=b)||e>b&&(o<=e&&o>=b)){m=-1;break}}if(g<=p){continue}if(v!=t&&(g<Math.min(v,t)||g>Math.max(v,t))){continue}if(e<b&&(o>=e&&o<b)||e>b&&(o<e&&o>=b)){++m}}var u=(m==-1)?1:!!(m&1);return u},intersects:function(e){var b=false;if(e.CLASS_NAME=="OpenLayers.Geometry.Point"){b=this.containsPoint(e)}else{if(e.CLASS_NAME=="OpenLayers.Geometry.LineString"){b=e.intersects(this)}else{if(e.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){b=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[e])}else{for(var d=0,a=e.components.length;d<a;++d){b=e.components[d].intersects(this);if(b){break}}}}}return b},CLASS_NAME:"OpenLayers.Geometry.LinearRing"});OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LineString"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Geometry.MultiLineString"});OpenLayers.Handler.Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,freehand:false,freehandToggle:"shiftKey",initialize:function(d,b,a){OpenLayers.Handler.Point.prototype.initialize.apply(this,arguments)},createFeature:function(){this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString());this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point());this.layer.addFeatures([this.line,this.point],{silent:true})},destroyFeature:function(){OpenLayers.Handler.Point.prototype.destroyFeature.apply(this);this.line=null},destroyPoint:function(){if(this.point){this.layer.destroyFeatures([this.point])}},addPoint:function(){this.line.geometry.addComponent(this.point.geometry.clone(),this.line.geometry.components.length);this.callback("point",[this.point.geometry,this.getGeometry()])},freehandMode:function(a){return(this.freehandToggle&&a[this.freehandToggle])?!this.freehand:this.freehand},modifyFeature:function(){var a=this.line.geometry.components.length-1;this.line.geometry.components[a].x=this.point.geometry.x;this.line.geometry.components[a].y=this.point.geometry.y;this.line.geometry.components[a].clearBounds()},drawFeature:function(){this.layer.drawFeature(this.line,this.style);this.layer.drawFeature(this.point,this.style)},getGeometry:function(){var a=this.line.geometry;if(this.multi){a=new OpenLayers.Geometry.MultiLineString([a])}return a},mousedown:function(a){if(this.lastDown&&this.lastDown.equals(a.xy)){return false}if(this.lastDown==null){if(this.persist){this.destroyFeature()}this.createFeature()}this.mouseDown=true;this.lastDown=a.xy;var b=this.control.map.getLonLatFromPixel(a.xy);this.point.geometry.x=b.lon;this.point.geometry.y=b.lat;this.point.geometry.clearBounds();if((this.lastUp==null)||!this.lastUp.equals(a.xy)){this.addPoint()}this.drawFeature();this.drawing=true;return false},mousemove:function(a){if(this.drawing){var b=this.map.getLonLatFromPixel(a.xy);this.point.geometry.x=b.lon;this.point.geometry.y=b.lat;this.point.geometry.clearBounds();if(this.mouseDown&&this.freehandMode(a)){this.addPoint()}else{this.modifyFeature()}this.drawFeature()}return true},mouseup:function(a){this.mouseDown=false;if(this.drawing){if(this.freehandMode(a)){if(this.persist){this.destroyPoint()}this.finalize()}else{if(this.lastUp==null){this.addPoint()}this.lastUp=a.xy}return false}return true},dblclick:function(a){if(!this.freehandMode(a)){var b=this.line.geometry.components.length-1;this.line.geometry.removeComponent(this.line.geometry.components[b]);if(this.persist){this.destroyPoint()}this.finalize()}return false},CLASS_NAME:"OpenLayers.Handler.Path"});OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LinearRing"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},getArea:function(){var d=0;if(this.components&&(this.components.length>0)){d+=Math.abs(this.components[0].getArea());for(var b=1,a=this.components.length;b<a;b++){d-=Math.abs(this.components[b].getArea())}}return d},containsPoint:function(a){var g=this.components.length;var d=false;if(g>0){d=this.components[0].containsPoint(a);if(d!==1){if(d&&g>1){var e;for(var b=1;b<g;++b){e=this.components[b].containsPoint(a);if(e){if(e===1){d=1}else{d=false}break}}}}}return d},intersects:function(g){var b=false;var e,a;if(g.CLASS_NAME=="OpenLayers.Geometry.Point"){b=this.containsPoint(g)}else{if(g.CLASS_NAME=="OpenLayers.Geometry.LineString"||g.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){for(e=0,a=this.components.length;e<a;++e){b=g.intersects(this.components[e]);if(b){break}}if(!b){for(e=0,a=g.components.length;e<a;++e){b=this.containsPoint(g.components[e]);if(b){break}}}}else{for(e=0,a=g.components.length;e<a;++e){b=this.intersects(g.components[e]);if(b){break}}}}if(!b&&g.CLASS_NAME=="OpenLayers.Geometry.Polygon"){var d=this.components[0];for(e=0,a=d.components.length;e<a;++e){b=g.containsPoint(d.components[e]);if(b){break}}}return b},CLASS_NAME:"OpenLayers.Geometry.Polygon"});OpenLayers.Geometry.Polygon.createRegularPolygon=function(o,h,b,q){var d=Math.PI*((1/b)-(1/2));if(q){d+=(q/180)*Math.PI}var a,m,l;var p=[];for(var g=0;g<b;++g){a=d+(g*2*Math.PI/b);m=o.x+(h*Math.cos(a));l=o.y+(h*Math.sin(a));p.push(new OpenLayers.Geometry.Point(m,l))}var e=new OpenLayers.Geometry.LinearRing(p);return new OpenLayers.Geometry.Polygon([e])};OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Polygon"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Geometry.MultiPolygon"});OpenLayers.Handler.Polygon=OpenLayers.Class(OpenLayers.Handler.Path,{polygon:null,initialize:function(d,b,a){OpenLayers.Handler.Path.prototype.initialize.apply(this,arguments)},createFeature:function(){this.polygon=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon());this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LinearRing());this.polygon.geometry.addComponent(this.line.geometry);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point());this.layer.addFeatures([this.polygon,this.point],{silent:true})},destroyFeature:function(){OpenLayers.Handler.Path.prototype.destroyFeature.apply(this);this.polygon=null},modifyFeature:function(){var a=this.line.geometry.components.length-2;this.line.geometry.components[a].x=this.point.geometry.x;this.line.geometry.components[a].y=this.point.geometry.y;this.line.geometry.components[a].clearBounds()},drawFeature:function(){this.layer.drawFeature(this.polygon,this.style);this.layer.drawFeature(this.point,this.style)},getGeometry:function(){var a=this.polygon.geometry;if(this.multi){a=new OpenLayers.Geometry.MultiPolygon([a])}return a},dblclick:function(a){if(!this.freehandMode(a)){var b=this.line.geometry.components.length-2;this.line.geometry.removeComponent(this.line.geometry.components[b]);if(this.persist){this.destroyPoint()}this.finalize()}return false},CLASS_NAME:"OpenLayers.Handler.Polygon"});Ext.namespace("mapfish.widgets");Ext.namespace("mapfish.widgets.print");mapfish.widgets.print.BaseWidget=function(a){mapfish.widgets.print.BaseWidget.superclass.constructor.call(this,a)};Ext.extend(mapfish.widgets.print.BaseWidget,Ext.Panel,{pageDrag:null,rotateHandle:null,layer:null,layout:"fit",initComponent:function(){mapfish.widgets.print.BaseWidget.superclass.initComponent.call(this);this.addEvents("configloaded");this.on("expand",this.setUp,this);this.on("collapse",this.tearDown,this);this.on("activate",this.setUp,this);this.on("deactivate",this.tearDown,this);this.on("enable",this.setUp,this);this.on("disable",this.tearDown,this);this.on("render",function(){var a=this.mask=new Ext.LoadMask(this.body,{msg:OpenLayers.Lang.translate("mf.print.loadingConfig")});if(this.config==null){a.show()}},this);if(!this.initPrint()){this.fillComponent()}},configReceived:function(a){mapfish.widgets.print.Base.configReceived.call(this,a);this.fillComponent();this.doLayout();this.setUp();this.fireEvent("configloaded")},configFailed:function(){mapfish.widgets.print.Base.configFailed.call(this);this.add({border:false,region:"center",html:OpenLayers.Lang.translate("mf.print.serverDown")});this.doLayout();this.config=false},isReallyVisible:function(){if(!this.isVisible()||!this.body.isVisible(true)){return false}var a=true;this.bubble(function(b){return a=a&&b.isVisible()&&(!b.body||b.body.isVisible())},this);return a},setUp:function(){if(!this.disabled&&this.isReallyVisible()&&this.config&&!this.layer){this.map.addLayer(this.getOrCreateLayer());this.pageDrag.activate()}},tearDown:function(){if(this.config&&this.pageDrag&&this.layer){this.pageDrag.destroy();this.pageDrag=null;this.removeRotateHandle();this.layer.removeFeatures(this.layer.features);this.layer.destroy();this.layer=null}},getOrCreateLayer:function(){if(!this.layer){var a=this;this.layer=new OpenLayers.Layer.Vector("_Print"+this.getId(),{displayInLayerSwitcher:false,calculateInRange:function(){return true}});this.pageDrag=new OpenLayers.Control.DragFeature(this.layer);this.map.addControl(this.pageDrag);var b=null;this.pageDrag.onStart=function(d){OpenLayers.Control.DragFeature.prototype.onStart.apply(this,arguments);b=d;if(d.attributes.rotate){a.pageRotateStart(d)}else{a.pageDragStart(d)}};this.pageDrag.onDrag=function(d){OpenLayers.Control.DragFeature.prototype.onDrag.apply(this,arguments);if(!d){d=b}if(d.attributes.rotate){a.pageRotated(d)}};this.pageDrag.onComplete=function(d){OpenLayers.Control.DragFeature.prototype.onComplete.apply(this,arguments);if(!d){d=b}if(d.attributes.rotate){a.pageRotateComplete(d)}else{a.pageDragComplete(d)}b=null};this.afterLayerCreated()}return this.layer},pageRotateStart:function(a){},pageRotated:function(d){var b=d.attributes.center;var h=d.geometry;var g=Math.atan2(h.x-b.x,h.y-b.y)*180/Math.PI;var e=d.attributes.page;e.attributes.rotation=g;var a=new OpenLayers.Geometry.Point(b.x,b.y);e.geometry.rotate(d.attributes.prevAngle-g,a);this.layer.drawFeature(e);this.setCurRotation(Math.round(g));d.attributes.prevAngle=g},pageRotateComplete:function(a){this.createRotateHandle(a.attributes.page)},pageDragStart:function(a){this.removeRotateHandle()},removeRotateHandle:function(){if(this.rotateHandle){this.rotateHandle.destroy();this.rotateHandle=null}},pageDragComplete:function(a){if(this.getCurLayout().rotation){this.createRotateHandle(a)}},createRotateHandle:function(d){this.removeRotateHandle();var l=d.geometry.components[0].components[2];var b=d.geometry.components[0].components[3];var h=(l.x+b.x)/2;var g=(l.y+b.y)/2;var e=new OpenLayers.Geometry.Point(h,g);var a=this.getCenterRectangle(d);this.rotateHandle=new OpenLayers.Feature.Vector(e,{rotate:true,page:d,center:{x:a[0],y:a[1]},prevAngle:d.attributes.rotation});this.layer.addFeatures(this.rotateHandle)},createRectangle:function(b,m,l,e){var g=this.getExtent(b,m,l);var h=g.toGeometry();var a=new OpenLayers.Geometry.Point(b.lon,b.lat);h.rotate(-e,a);var d=new OpenLayers.Feature.Vector(h,{rotation:e});this.layer.addFeatures(d);return d},getCenterRectangle:function(b){var a=b.geometry.getBounds().getCenterLonLat();return[a.lon,a.lat]},getExtent:function(a,m,g){var l=OpenLayers.INCHES_PER_UNIT[this.map.baseLayer.units];var d=g.map;var b=d.width/72/l*m/2;var e=d.height/72/l*m/2;return new OpenLayers.Bounds(a.lon-b,a.lat-e,a.lon+b,a.lat+e)},fitScale:function(l){var m=this.config.scales;if(m.length==0){return}var h=[];for(var e=0;e<m.length;++e){h.push(parseFloat(m[e].value))}h.sort(function(r,q){return r-q});var a=this.map.getExtent();var g=OpenLayers.INCHES_PER_UNIT[this.map.baseLayer.units];var p=l.map;var o=Math.min(a.getWidth()/p.width*72*g,a.getHeight()/p.height*72*g);var b=h[0];for(var d=1;d<h.length;++d){if(h[d]<=o){b=h[d]}else{break}}return b},print:function(){this.overrides[this.layer.name]={visibility:false};mapfish.widgets.print.Base.print.call(this);delete this.overrides[this.layer.name]},getLayoutForName:function(a){var d=this.config.layouts;for(var b=0;b<d.length;++b){var e=d[b];if(e.name==a){return e}}},createScaleCombo:function(){var a=new Ext.data.JsonStore({root:"scales",fields:["name","value"],data:this.config});return new Ext.form.ComboBox({fieldLabel:OpenLayers.Lang.translate("mf.print.scale"),store:a,displayField:"name",valueField:"value",typeAhead:false,mode:"local",id:"scale_"+this.getId(),hiddenId:"scaleId_"+this.getId(),hiddenName:"scale",name:"scale",editable:false,triggerAction:"all",value:this.config.scales[this.config.scales.length-1].value})},createDpiCombo:function(a){if(this.config.dpis.length>1){var b=new Ext.data.JsonStore({root:"dpis",fields:["name","value"],data:this.config});return{fieldLabel:OpenLayers.Lang.translate("mf.print.dpi"),xtype:"combo",store:b,displayField:"name",valueField:"value",typeAhead:false,mode:"local",id:"dpi_"+this.getId(),hiddenId:"dpiId_"+this.getId(),hiddenName:a,name:a,editable:false,triggerAction:"all",value:this.config.dpis[0].value}}else{return{xtype:"hidden",name:a,value:this.config.dpis[0].value}}},createLayoutCombo:function(a){if(this.config.layouts.length>1){var b=new Ext.data.JsonStore({root:"layouts",fields:["name"],data:this.config});return new Ext.form.ComboBox({fieldLabel:OpenLayers.Lang.translate("mf.print.layout"),store:b,displayField:"name",valueField:"name",typeAhead:false,mode:"local",id:"layout_"+this.getId(),hiddenId:"layoutId_"+this.getId(),hiddenName:a,name:a,editable:false,triggerAction:"all",value:this.config.layouts[0].name})}else{return new Ext.form.Hidden({name:a,value:this.config.layouts[0].name})}},createRotationTextField:function(){var e=this.config.layouts;var a=false;for(var d=0;d<e.length&&!a;++d){a=e[d].rotation}if(a){var b=/^-?[0-9]+$/;return new Ext.form.TextField({fieldLabel:OpenLayers.Lang.translate("mf.print.rotation"),name:"rotation",value:"0",maskRe:/^[-0-9]$/,msgTarget:"side",validator:function(g){return b.test(g)?true:"Not a number"}})}else{return null}},fillComponent:null,afterLayerCreated:null,fillSpec:null,getCurLayout:null,setCurRotation:null});OpenLayers.Util.applyDefaults(mapfish.widgets.print.BaseWidget.prototype,mapfish.widgets.print.Base);OpenLayers.Control.EditingToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(d,b){OpenLayers.Control.Panel.prototype.initialize.apply(this,[b]);this.addControls([new OpenLayers.Control.Navigation()]);var a=[new OpenLayers.Control.DrawFeature(d,OpenLayers.Handler.Point,{displayClass:"olControlDrawFeaturePoint"}),new OpenLayers.Control.DrawFeature(d,OpenLayers.Handler.Path,{displayClass:"olControlDrawFeaturePath"}),new OpenLayers.Control.DrawFeature(d,OpenLayers.Handler.Polygon,{displayClass:"olControlDrawFeaturePolygon"})];this.addControls(a)},draw:function(){var a=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);this.activateControl(this.controls[0]);return a},CLASS_NAME:"OpenLayers.Control.EditingToolbar"});OpenLayers.Format.GeoJSON=OpenLayers.Class(OpenLayers.Format.JSON,{initialize:function(a){OpenLayers.Format.JSON.prototype.initialize.apply(this,[a])},read:function(o,l,a){l=(l)?l:"FeatureCollection";var e=null;var d=null;if(typeof o=="string"){d=OpenLayers.Format.JSON.prototype.read.apply(this,[o,a])}else{d=o}if(!d){OpenLayers.Console.error("Bad JSON: "+o)}else{if(typeof(d.type)!="string"){OpenLayers.Console.error("Bad GeoJSON - no type: "+o)}else{if(this.isValidType(d,l)){switch(l){case"Geometry":try{e=this.parseGeometry(d)}catch(b){OpenLayers.Console.error(b)}break;case"Feature":try{e=this.parseFeature(d);e.type="Feature"}catch(b){OpenLayers.Console.error(b)}break;case"FeatureCollection":e=[];switch(d.type){case"Feature":try{e.push(this.parseFeature(d))}catch(b){e=null;OpenLayers.Console.error(b)}break;case"FeatureCollection":for(var g=0,h=d.features.length;g<h;++g){try{e.push(this.parseFeature(d.features[g]))}catch(b){e=null;OpenLayers.Console.error(b)}}break;default:try{var m=this.parseGeometry(d);e.push(new OpenLayers.Feature.Vector(m))}catch(b){e=null;OpenLayers.Console.error(b)}}break}}}}return e},isValidType:function(d,a){var b=false;switch(a){case"Geometry":if(OpenLayers.Util.indexOf(["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","Box","GeometryCollection"],d.type)==-1){OpenLayers.Console.error("Unsupported geometry type: "+d.type)}else{b=true}break;case"FeatureCollection":b=true;break;default:if(d.type==a){b=true}else{OpenLayers.Console.error("Cannot convert types from "+d.type+" to "+a)}}return b},parseFeature:function(e){var b,h,a,g;a=(e.properties)?e.properties:{};g=(e.geometry&&e.geometry.bbox)||e.bbox;try{h=this.parseGeometry(e.geometry)}catch(d){throw d}b=new OpenLayers.Feature.Vector(h,a);if(g){b.bounds=OpenLayers.Bounds.fromArray(g)}if(e.id){b.fid=e.id}return b},parseGeometry:function(g){if(g==null){return null}var h;if(g.type=="GeometryCollection"){if(!(g.geometries instanceof Array)){throw"GeometryCollection must have geometries array: "+g}var b=g.geometries.length;var e=new Array(b);for(var a=0;a<b;++a){e[a]=this.parseGeometry.apply(this,[g.geometries[a]])}h=new OpenLayers.Geometry.Collection(e)}else{if(!(g.coordinates instanceof Array)){throw"Geometry must have coordinates array: "+g}if(!this.parseCoords[g.type.toLowerCase()]){throw"Unsupported geometry type: "+g.type}try{h=this.parseCoords[g.type.toLowerCase()].apply(this,[g.coordinates])}catch(d){throw d}}if(this.internalProjection&&this.externalProjection){h.transform(this.externalProjection,this.internalProjection)}return h},parseCoords:{point:function(a){if(a.length!=2){throw"Only 2D points are supported: "+a}return new OpenLayers.Geometry.Point(a[0],a[1])},multipoint:function(h){var d=[];var g=null;for(var b=0,a=h.length;b<a;++b){try{g=this.parseCoords.point.apply(this,[h[b]])}catch(e){throw e}d.push(g)}return new OpenLayers.Geometry.MultiPoint(d)},linestring:function(h){var d=[];var g=null;for(var b=0,a=h.length;b<a;++b){try{g=this.parseCoords.point.apply(this,[h[b]])}catch(e){throw e}d.push(g)}return new OpenLayers.Geometry.LineString(d)},multilinestring:function(h){var d=[];var b=null;for(var e=0,a=h.length;e<a;++e){try{b=this.parseCoords.linestring.apply(this,[h[e]])}catch(g){throw g}d.push(b)}return new OpenLayers.Geometry.MultiLineString(d)},polygon:function(m){var h=[];var g,b;for(var d=0,a=m.length;d<a;++d){try{b=this.parseCoords.linestring.apply(this,[m[d]])}catch(e){throw e}g=new OpenLayers.Geometry.LinearRing(b.components);h.push(g)}return new OpenLayers.Geometry.Polygon(h)},multipolygon:function(h){var b=[];var g=null;for(var d=0,a=h.length;d<a;++d){try{g=this.parseCoords.polygon.apply(this,[h[d]])}catch(e){throw e}b.push(g)}return new OpenLayers.Geometry.MultiPolygon(b)},box:function(a){if(a.length!=2){throw"GeoJSON box coordinates must have 2 elements"}return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(a[0][0],a[0][1]),new OpenLayers.Geometry.Point(a[1][0],a[0][1]),new OpenLayers.Geometry.Point(a[1][0],a[1][1]),new OpenLayers.Geometry.Point(a[0][0],a[1][1]),new OpenLayers.Geometry.Point(a[0][0],a[0][1])])])}},write:function(g,e){var a={type:null};if(g instanceof Array){a.type="FeatureCollection";var l=g.length;a.features=new Array(l);for(var d=0;d<l;++d){var b=g[d];if(!b instanceof OpenLayers.Feature.Vector){var h="FeatureCollection only supports collections of features: "+b;throw h}a.features[d]=this.extract.feature.apply(this,[b])}}else{if(g.CLASS_NAME.indexOf("OpenLayers.Geometry")==0){a=this.extract.geometry.apply(this,[g])}else{if(g instanceof OpenLayers.Feature.Vector){a=this.extract.feature.apply(this,[g]);if(g.layer&&g.layer.projection){a.crs=this.createCRSObject(g)}}}}return OpenLayers.Format.JSON.prototype.write.apply(this,[a,e])},createCRSObject:function(b){var d=b.layer.projection.toString();var a={};if(d.match(/epsg:/i)){var e=parseInt(d.substring(d.indexOf(":")+1));if(e==4326){a={type:"OGC",properties:{urn:"urn:ogc:def:crs:OGC:1.3:CRS84"}}}else{a={type:"EPSG",properties:{code:e}}}}return a},extract:{feature:function(b){var a=this.extract.geometry.apply(this,[b.geometry]);return{type:"Feature",id:b.fid==null?b.id:b.fid,properties:b.attributes,geometry:a}},geometry:function(e){if(e==null){return null}if(this.internalProjection&&this.externalProjection){e=e.clone();e.transform(this.internalProjection,this.externalProjection)}var a=e.CLASS_NAME.split(".")[2];var d=this.extract[a.toLowerCase()].apply(this,[e]);var b;if(a=="Collection"){b={type:"GeometryCollection",geometries:d}}else{b={type:a,coordinates:d}}return b},point:function(a){return[a.x,a.y]},multipoint:function(d){var e=[];for(var b=0,a=d.components.length;b<a;++b){e.push(this.extract.point.apply(this,[d.components[b]]))}return e},linestring:function(b){var e=[];for(var d=0,a=b.components.length;d<a;++d){e.push(this.extract.point.apply(this,[b.components[d]]))}return e},multilinestring:function(d){var e=[];for(var b=0,a=d.components.length;b<a;++b){e.push(this.extract.linestring.apply(this,[d.components[b]]))}return e},polygon:function(d){var e=[];for(var b=0,a=d.components.length;b<a;++b){e.push(this.extract.linestring.apply(this,[d.components[b]]))}return e},multipolygon:function(e){var d=[];for(var b=0,a=e.components.length;b<a;++b){d.push(this.extract.polygon.apply(this,[e.components[b]]))}return d},collection:function(d){var a=d.components.length;var e=new Array(a);for(var b=0;b<a;++b){e[b]=this.extract.geometry.apply(this,[d.components[b]])}return e}},CLASS_NAME:"OpenLayers.Format.GeoJSON"});Ext.namespace("mapfish.widgets");Ext.namespace("mapfish.widgets.print");mapfish.widgets.print.MultiPage=Ext.extend(mapfish.widgets.print.BaseWidget,{formConfig:null,columns:null,zoomToExtentEnabled:true,grid:null,printButton:null,freezeGeometryRefresh:false,fillComponent:function(){var a=this.add({border:false,layout:"border",id:this.getId()+"InnerPanel"});this.createGlobalForm(a);this.createGrid(a)},setUp:function(){if(this.config){if(Ext.isGecko3){var a=this.formPanel.getEl().parent();a.setStyle("position","absolute");setTimeout(function(){a.setStyle("position","relative")},20)}mapfish.widgets.print.BaseWidget.prototype.setUp.call(this)}},createGlobalForm:function(d){var e=OpenLayers.Util.extend({region:"south",bodyStyle:"padding: 7px 0 0 0;",border:false,bodyBorder:false,id:this.getId()+"formPanel"},this.formConfig);var a=this.formPanel=new Ext.form.FormPanel(e);var b=this.createLayoutCombo("layout");if(this.config.layouts.length>1){b.on("select",this.layoutChanged,this)}a.add(b);a.add(this.createDpiCombo("dpi"));this.printButton=a.addButton({text:OpenLayers.Lang.translate("mf.print.print"),scope:this,handler:this.print,disabled:true});d.add(a)},createGrid:function(h){var d=this.createScaleCombo();d.on("select",this.updateCurrentRectangle,this);var o=this;var e=[{header:OpenLayers.Lang.translate("mf.print.scale"),dataIndex:"scale",editor:d,renderer:function(p){return o.getScaleName(p)}}];var m=this.createRotationTextField();if(m!=null){e.push({header:OpenLayers.Lang.translate("mf.print.rotation"),dataIndex:"rotation",editor:m,id:this.getId()+"_rotation",hidden:!this.config.layouts[0].rotation})}if(this.columns){e.push.apply(e,this.columns)}var l=[];for(var g=0;g<e.length;++g){l.push({name:e[g].dataIndex})}var b=new Ext.data.SimpleStore({fields:l});var a=this.grid=new Ext.grid.EditorGridPanel({region:"center",border:false,id:this.getId()+"PagesGrid",autoScroll:true,enableColumnHide:false,enableHdMenu:false,store:b,viewConfig:{forceFit:true,emptyText:OpenLayers.Lang.translate("mf.print.noPage")},sm:new Ext.grid.RowSelectionModel({singleSelect:true}),clicksToEdit:1,columns:e,bbar:[{text:OpenLayers.Lang.translate("mf.print.addPage"),scope:this,handler:this.addPage},{text:OpenLayers.Lang.translate("mf.print.remove"),scope:this,handler:this.removeSelected,id:this.getId()+"_remove",disabled:true},{text:OpenLayers.Lang.translate("mf.print.clearAll"),scope:this,handler:this.clearPages}]});h.add(a);a.getSelectionModel().addListener("selectionchange",this.selectionChanged,this);a.getStore().addListener("update",function(r,p,q){if(!this.freezeGeometryRefresh){this.updateRectangle(p);this.updatePrintLayerStyle()}},this);a.getStore().addListener("remove",function(q,p,r){this.layer.removeFeatures(p.data.rectangle);this.removeRotateHandle();if(q.getCount()==0){this.printButton.disable()}},this);a.getStore().addListener("clear",function(){this.layer.removeFeatures(this.layer.features);this.printButton.disable()},this)},selectionChanged:function(){this.updatePrintLayerStyle();var d=Ext.getCmp(this.getId()+"_remove");var a=this.grid.getSelectionModel().getSelected();if(a){if(this.zoomToExtentEnabled){var b=a.data.rectangle.geometry.getBounds().clone();b.extend(this.map.getExtent());this.map.zoomToExtent(b)}d.enable();var e=this.getCurLayout();if(e.rotation){this.createRotateHandle(a.data.rectangle)}}else{d.disable()}},updatePrintLayerStyle:function(){var d=this.grid.getSelectionModel().getSelected();var g=null;for(var b=0;b<this.layer.features.length;++b){var a=this.layer.features[b];var e=a.data.record==d;a.style=OpenLayers.Feature.Vector.style[e?"select":"default"];if(e&&b!=this.layer.features.length-1){g=a;this.layer.removeFeatures(a)}}if(g){this.layer.addFeatures(g)}this.layer.redraw()},addPage:function(){var h=this.getCurLayout();var m=this.fitScale(h);var e=this.createRectangle(this.map.getCenter(),m,h,0);var g={scale:m,rotation:0,rectangle:e};for(var d=0;d<this.columns.length;++d){var l=this.columns[d].dataIndex;if(g[l]==null){g[l]=""}}var a=this.grid.getStore();var b=new a.recordType(g);a.add(b);e.data.record=b;this.grid.getSelectionModel().selectLastRow();this.printButton.enable()},clearPages:function(){this.grid.stopEditing();this.grid.getStore().removeAll()},removeSelected:function(){this.grid.stopEditing();var a=this.grid.getSelectionModel().getSelected();this.grid.getStore().remove(a)},layoutChanged:function(){this.grid.getStore().each(function(e){this.updateRectangle(e)},this);this.updatePrintLayerStyle();var a=this.grid.getColumnModel();var b=a.getIndexById(this.id+"_rotation");if(b>=0){var d=this.getCurLayout();a.setHidden(b,!d.rotation)}},updateCurrentRectangle:function(){this.updateRectangle(this.grid.getSelectionModel().getSelected());this.updatePrintLayerStyle()},updateRectangle:function(b){this.grid.stopEditing();this.layer.removeFeatures(b.data.rectangle);var e=this.getCurLayout();var h=b.get("scale");var g=e.rotation?b.get("rotation"):0;var a=b.data.rectangle.geometry.getBounds().getCenterLonLat();var d=this.createRectangle(a,h,e,g);d.data.record=b;b.data.rectangle=d;var l=this.grid.getSelectionModel();if(l.getSelected()==b){if(e.rotation){this.createRotateHandle(d)}else{this.removeRotateHandle()}}},afterLayerCreated:function(){if(this.grid.getStore().getCount()!=0){this.grid.getStore().each(function(d){this.layer.addFeatures(d.data.rectangle)},this);this.updatePrintLayerStyle();var b=this.grid.getSelectionModel();var a=b.getSelected();if(a&&this.getCurLayout().rotation){this.createRotateHandle(a.data.rectangle)}}else{this.addPage()}},pageRotateStart:function(a){mapfish.widgets.print.BaseWidget.prototype.pageRotateStart.call(this,a);this.grid.stopEditing()},pageDragStart:function(a){mapfish.widgets.print.BaseWidget.prototype.pageDragStart.call(this,a);var b=this.zoomToExtentEnabled;var d=this.grid.getSelectionModel();if(d.getSelected()!=a.data.record){this.zoomToExtentEnabled=false;d.selectRecords([a.data.record]);this.zoomToExtentEnabled=b}this.grid.stopEditing()},getCurDpi:function(){var a=this.formPanel.getForm().getValues();return a.dpi},getCurLayoutName:function(){var a=this.formPanel.getForm().getValues();return a.layout},getCurLayout:function(){var a=this.getCurLayoutName();return this.getLayoutForName(a)},setCurRotation:function(a){var b=this.grid.getSelectionModel().getSelected();this.freezeGeometryRefresh=true;b.set("rotation",a);this.freezeGeometryRefresh=false},fillSpec:function(a){var d=a.spec;var b=this.getCurLayout();this.formPanel.getForm().items.each(function(e){d[e.getName()]=e.getValue()},this);this.grid.getStore().each(function(e){var h={};for(var g in e.data){if(g=="rectangle"){h.center=this.getCenterRectangle(e.data.rectangle)}else{if(g=="rotation"&&!b.rotation){}else{h[g]=e.data[g]}}}d.pages.push(h)},this)},getScaleName:function(e){var d=this.config.scales;for(var a=0;a<d.length;++a){var b=d[a];if(b.value==e){return b.name}}}});Ext.reg("print-multi",mapfish.widgets.print.MultiPage);Ext.namespace("mapfish.widgets");Ext.namespace("mapfish.widgets.print");mapfish.widgets.print.SimpleForm=Ext.extend(mapfish.widgets.print.BaseWidget,{formConfig:null,wantResetButton:true,scale:null,rectangle:null,rotation:null,infoPanel:null,fillComponent:function(){var d=OpenLayers.Util.extend({border:false,bodyBorder:false},this.formConfig);var a=this.formPanel=new Ext.form.FormPanel(d);var b=this.createLayoutCombo("/layout");if(this.config.layouts.length>1){b.on("select",this.updateRectangle,this)}a.add(b);a.add(this.createDpiCombo("/dpi"));this.scale=a.add(this.createScaleCombo());this.scale.on("select",this.updateRectangle,this);this.rotation=this.createRotationTextField();if(this.rotation!=null){this.rotation.setDisabled(!this.config.layouts[0].rotation);a.add(this.rotation);this.rotation.on("change",function(){if(!this.rotation.isValid(true)){this.rotation.setValue(0)}this.updateRectangle()},this)}if(this.infoPanel!=null){a.add(this.infoPanel)}if(this.wantResetButton){a.addButton({text:OpenLayers.Lang.translate("mf.print.resetPos"),scope:this,handler:function(){this.setCurScale(this.fitScale(this.getCurLayout()));if(this.rotation){this.setCurRotation(0)}this.createTheRectangle()}})}a.addButton({text:OpenLayers.Lang.translate("mf.print.print"),scope:this,handler:this.print});this.add(a)},updateRectangle:function(){this.layer.removeFeatures(this.rectangle);var a=this.rectangle.geometry.getBounds().getCenterLonLat();var b=this.getCurLayout();this.rectangle=this.createRectangle(a,this.getCurScale(),b,this.rotation&&b.rotation?this.rotation.getValue():0);if(this.rotation){this.rotation.setDisabled(!b.rotation);if(!b.rotation){this.rotation.setValue(0)}}if(b.rotation){this.createRotateHandle(this.rectangle)}else{this.removeRotateHandle()}},createTheRectangle:function(){if(this.rectangle){this.layer.removeFeatures(this.rectangle)}var a=this.getCurLayout();this.rectangle=this.createRectangle(this.map.getCenter(),this.getCurScale(),this.getCurLayout(),this.rotation&&a.rotation?this.rotation.getValue():0);if(a.rotation){this.createRotateHandle(this.rectangle)}},afterLayerCreated:function(){this.setCurScale(this.fitScale(this.getCurLayout()));this.createTheRectangle()},getCurLayout:function(){var a=this.formPanel.getForm().getValues();var b=a["/layout"];return this.getLayoutForName(b)},getCurScale:function(){var a=this.formPanel.getForm().getValues();return a.scale},setCurScale:function(a){this.scale.setValue(a)},getCurDpi:function(){var a=this.formPanel.getForm().getValues();return a.dpi},setCurRotation:function(a){this.rotation.setValue(a)},fillSpec:function(a){var b={center:this.getCenterRectangle(this.rectangle)};var d=a.spec;d.pages.push(b);this.formPanel.getForm().items.each(function(g){var e=g.getName();if(OpenLayers.String.startsWith(e,"/")){d[e.substr(1)]=g.getValue()}else{b[e]=g.getValue()}},this)}});Ext.reg("print-simple",mapfish.widgets.print.SimpleForm);mapfish.GeoStat=OpenLayers.Class({layer:null,format:null,url:null,requestSuccess:function(a){},requestFailure:function(a){},featureSelection:true,nameAttribute:null,indicator:null,defaultSymbolizer:{},selectSymbolizer:{strokeColor:"#000000"},legendDiv:null,initialize:function(g,b){this.map=g;this.addOptions(b);if(!this.layer){var e=new OpenLayers.StyleMap({"default":new OpenLayers.Style(OpenLayers.Util.applyDefaults(this.defaultSymbolizer,OpenLayers.Feature.Vector.style["default"])),select:new OpenLayers.Style(this.selectSymbolizer)});var d=new OpenLayers.Layer.Vector("geostat",{displayInLayerSwitcher:false,visibility:false,styleMap:e});g.addLayer(d);this.layer=d}if(this.featureSelection){this.layer.events.on({featureselected:this.showDetails,featureunselected:this.hideDetails,scope:this});var a=new OpenLayers.Control.SelectFeature(this.layer,{hover:true});g.addControl(a);a.activate()}if(this.url){OpenLayers.loadURL(this.url,"",this,this.onSuccess,this.onFailure)}this.legendDiv=Ext.get(b.legendDiv)},onSuccess:function(a){var d=a.responseXML;if(!d||!d.documentElement){d=a.responseText}var b=this.format||new OpenLayers.Format.GeoJSON();this.layer.addFeatures(b.read(d));this.requestSuccess(a)},onFailure:function(a){this.requestFailure(a)},addOptions:function(a){if(a){if(!this.options){this.options={}}OpenLayers.Util.extend(this.options,a);OpenLayers.Util.extend(this,a)}},extendStyle:function(e,d,a){var b=this.layer.styleMap.styles["default"];if(e){b.rules=e}if(d){b.setDefaultStyle(OpenLayers.Util.applyDefaults(d,b.defaultStyle))}if(a){if(!b.context){b.context={}}OpenLayers.Util.extend(b.context,a)}},applyClassification:function(a){this.layer.renderer.clear();this.layer.redraw();this.updateLegend();this.layer.setVisibility(true)},showDetails:function(m){var e=m.feature;var d=typeof this.nameAttribute=="string"?'<h4 style="margin-top:5px">'+e.attributes[this.nameAttribute]+"</h4>":"";d+=this.indicator+": "+e.attributes[this.indicator];var h=this.layer.map.getExtent();var l=new OpenLayers.LonLat(h.right,h.bottom);var b=new OpenLayers.Size(200,100);var a=new OpenLayers.Popup.AnchoredBubble(e.attributes[this.nameAttribute],l,b,d,0.5,false);var g=e.layer.styleMap.createSymbolizer(e,"default");a.setBackgroundColor(g.fillColor);this.layer.map.addPopup(a)},hideDetails:function(d){var b=this.layer.map;for(var a=b.popups.length-1;a>=0;--a){b.removePopup(b.popups[a])}},CLASS_NAME:"mapfish.GeoStat"});mapfish.GeoStat.Distribution=OpenLayers.Class({labelGenerator:function(a,b,d){return this.defaultLabelGenerator(a,b,d)},values:null,nbVal:null,minVal:null,maxVal:null,initialize:function(a,b){OpenLayers.Util.extend(this,b);this.values=a;this.nbVal=a.length;this.minVal=this.nbVal?mapfish.Util.min(this.values):0;this.maxVal=this.nbVal?mapfish.Util.max(this.values):0},defaultLabelGenerator:function(a,b,d){return a.lowerBound.toFixed(3)+" - "+a.upperBound.toFixed(3)+" ("+a.nbVal+")"},classifyWithBounds:function(g){var e=[];var l=[];var a=[];for(var b=0;b<this.values.length;b++){a.push(this.values[b])}a.sort(function(o,m){return o-m});var h=g.length-1;for(var b=0;b<h;b++){l[b]=0}for(var b=0;b<h-1;b){if(a[0]<g[b+1]){l[b]=l[b]+1;a.shift()}else{b++}}l[h-1]=this.nbVal-mapfish.Util.sum(l);for(var b=0;b<h;b++){e[b]=new mapfish.GeoStat.Bin(l[b],g[b],g[b+1],b==(h-1));var d=this.labelGenerator||this.defaultLabelGenerator;e[b].label=d(e[b],b,h)}return new mapfish.GeoStat.Classification(e)},classifyByEqIntervals:function(d){var b=[];for(var a=0;a<=d;a++){b[a]=this.minVal+a*(this.maxVal-this.minVal)/d}return this.classifyWithBounds(b)},classifyByQuantils:function(g){var a=this.values;a.sort(function(l,h){return l-h});var e=Math.round(this.values.length/g);var d=[];var b=(e==0)?0:e;if(a.length>0){d[0]=a[0];for(i=1;i<g;i++){d[i]=a[b];b+=e}d.push(a[a.length-1])}return this.classifyWithBounds(d)},sturgesRule:function(){return Math.floor(1+3.3*Math.log(this.nbVal,10))},classify:function(e,d,a){var b=null;if(!d){d=this.sturgesRule()}switch(e){case mapfish.GeoStat.Distribution.CLASSIFY_WITH_BOUNDS:b=this.classifyWithBounds(a);break;case mapfish.GeoStat.Distribution.CLASSIFY_BY_EQUAL_INTERVALS:b=this.classifyByEqIntervals(d);break;case mapfish.GeoStat.Distribution.CLASSIFY_BY_QUANTILS:b=this.classifyByQuantils(d);break;default:OpenLayers.Console.error("unsupported or invalid classification method")}return b},CLASS_NAME:"mapfish.GeoStat.Distribution"});mapfish.GeoStat.Distribution.CLASSIFY_WITH_BOUNDS=0;mapfish.GeoStat.Distribution.CLASSIFY_BY_EQUAL_INTERVALS=1;mapfish.GeoStat.Distribution.CLASSIFY_BY_QUANTILS=2;mapfish.GeoStat.Bin=OpenLayers.Class({label:null,nbVal:null,lowerBound:null,upperBound:null,isLast:false,initialize:function(d,e,b,a){this.nbVal=d;this.lowerBound=e;this.upperBound=b;this.isLast=a},CLASS_NAME:"mapfish.GeoStat.Bin"});mapfish.GeoStat.Classification=OpenLayers.Class({bins:[],initialize:function(a){this.bins=a},getBoundsArray:function(){var b=[];for(var a=0;a<this.bins.length;a++){b.push(this.bins[a].lowerBound)}if(this.bins.length>0){b.push(this.bins[this.bins.length-1].upperBound)}return b},CLASS_NAME:"mapfish.GeoStat.Classification"});mapfish.Routing=OpenLayers.Class({url:null,vector:null,parser:null,initialize:function(b,d,a){this.url=b;this.map=d;OpenLayers.Util.extend(this,a);this.parser=new OpenLayers.Format.GeoJSON();this.vector=new OpenLayers.Layer.Vector("Routing");this.map.addLayer(this.vector)},onSuccess:function(a){if(a.responseText.search(/^error/)!=-1){OpenLayers.Console.error("Routing data returned by server contains error: "+a.responseText);this.onFailure(a);return}this.vector.destroyFeatures();var d=this.parser.read(a.responseText);if(!d){this.onFailure("can't parse features");return}var e=d[0].geometry.getBounds();for(var b=0;b<d.length;b++){if(d[b].attributes._isSourceNode){d[b].style=mapfish.Routing.firstPointStyle}else{if(d[b].attributes._isTargetNode){d[b].style=mapfish.Routing.lastPointStyle}else{e.extend(d[b].geometry.getBounds());d[b].style=mapfish.Routing.routeStyle}}}this.vector.addFeatures(d);if(!this.map.getExtent().containsBounds(e)){this.map.zoomToExtent(e)}},onFailure:function(a){OpenLayers.Console.error("Failed to fetch routing data: "+a)},fetchRoute:function(a){new OpenLayers.Ajax.Request(this.url,{method:"get",parameters:a,onSuccess:OpenLayers.Function.bind(this.onSuccess,this),onFailure:OpenLayers.Function.bind(this.onFailure,this)})}});mapfish.Routing.routeStyle={strokeColor:"blue",strokeWidth:6,strokeOpacity:0.4};OpenLayers.Util.applyDefaults(mapfish.Routing.routeStyle,OpenLayers.Feature.Vector.style["default"]);mapfish.Routing.firstPointStyle={externalGraphic:mapfish._getScriptLocation()+"img/routing-start-node.png",graphicWidth:18,graphicHeight:26,graphicYOffset:-26,fillOpacity:1,cursor:"pointer"};OpenLayers.Util.applyDefaults(mapfish.Routing.firstPointStyle,OpenLayers.Feature.Vector.style["default"]);mapfish.Routing.lastPointStyle={externalGraphic:mapfish._getScriptLocation()+"img/routing-stop-node.png",graphicWidth:18,graphicHeight:26,graphicYOffset:-26,fillOpacity:1,cursor:"pointer"};OpenLayers.Util.applyDefaults(mapfish.Routing.lastPointStyle,OpenLayers.Feature.Vector.style["default"]);mapfish.GeoStat.Choropleth=OpenLayers.Class(mapfish.GeoStat,{colors:[new mapfish.ColorRgb(120,120,0),new mapfish.ColorRgb(255,0,0)],method:mapfish.GeoStat.Distribution.CLASSIFY_BY_QUANTILS,numClasses:5,defaultSymbolizer:{fillOpacity:1},classification:null,colorInterpolation:null,initialize:function(b,a){mapfish.GeoStat.prototype.initialize.apply(this,arguments)},updateOptions:function(b){var a=OpenLayers.Util.extend({},this.options);this.addOptions(b);if(b){if(b.method!=a.method||b.indicator!=a.indicator||b.numClasses!=a.numClasses){this.setClassification()}else{if(b.colors&&(!b.colors[0].equals(a.colors[0])||!b.colors[1].equals(a.colors[1]))){this.createColorInterpolation()}}}},createColorInterpolation:function(){var b=this.colors;var a=this.classification.bins.length;this.colorInterpolation=mapfish.ColorRgb.getColorsArrayByRgbInterpolation(b[0],b[1],a)},setClassification:function(){var b=[];var e=this.layer.features;for(var d=0;d<e.length;d++){b.push(e[d].attributes[this.indicator])}var a={labelGenerator:this.options.labelGenerator};var g=new mapfish.GeoStat.Distribution(b,a);this.classification=g.classify(this.method,this.numClasses,null);this.createColorInterpolation()},applyClassification:function(a){this.updateOptions(a);var e=this.classification.getBoundsArray();var g=new Array(e.length-1);for(var b=0;b<e.length-1;b++){var d=new OpenLayers.Rule({symbolizer:{fillColor:this.colorInterpolation[b].toHexString()},filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN,property:this.indicator,lowerBoundary:e[b],upperBoundary:e[b+1]})});g[b]=d}this.extendStyle(g);mapfish.GeoStat.prototype.applyClassification.apply(this,arguments)},updateLegend:function(){if(!this.legendDiv){return}this.legendDiv.update("");for(var b=0;b<this.classification.bins.length;b++){var a=document.createElement("div");a.style.backgroundColor=this.colorInterpolation[b].toHexString();a.style.width="30px";a.style.height="15px";a.style.cssFloat="left";a.style.marginRight="10px";this.legendDiv.appendChild(a);a=document.createElement("div");a.innerHTML=this.classification.bins[b].label;this.legendDiv.appendChild(a);a=document.createElement("div");a.style.clear="left";this.legendDiv.appendChild(a)}},CLASS_NAME:"mapfish.GeoStat.Choropleth"});mapfish.GeoStat.ProportionalSymbol=OpenLayers.Class(mapfish.GeoStat,{minSize:2,maxSize:20,minVal:null,maxVal:null,initialize:function(b,a){mapfish.GeoStat.prototype.initialize.apply(this,arguments)},updateOptions:function(b){var a=OpenLayers.Util.extend({},this.options);this.addOptions(b);if(b&&b.indicator!=a.indicator){this.setClassification()}},setClassification:function(){var a=[];var d=this.layer.features;for(var b=0;b<d.length;b++){a.push(d[b].attributes[this.indicator])}var e=new mapfish.GeoStat.Distribution(a);this.minVal=e.minVal;this.maxVal=e.maxVal},applyClassification:function(a){if(a&&a.resetClassification){this.setClassification()}var b=OpenLayers.Function.bind(function(e){var g=e.attributes[this.indicator];var d=(g-this.minVal)/(this.maxVal-this.minVal)*(this.maxSize-this.minSize)+this.minSize;return d},this);this.extendStyle(null,{pointRadius:"${calculateRadius}"},{calculateRadius:b});mapfish.GeoStat.prototype.applyClassification.apply(this,arguments)},updateLegend:function(){if(!this.legendDiv){return}this.legendDiv.innerHTML="Needs to be done !"},CLASS_NAME:"mapfish.GeoStat.ProportionalSymbol"});Ext.namespace("mapfish.widgets","mapfish.widgets.geostat");mapfish.widgets.geostat.Choropleth=Ext.extend(Ext.FormPanel,{layer:null,format:null,url:null,featureSelection:true,nameAttribute:null,indicator:null,indicatorText:null,coreComp:null,classificationApplied:false,ready:false,border:false,loadMask:false,labelGenerator:null,initComponent:function(){this.items=[{xtype:"combo",fieldLabel:"Indicator",name:"indicator",editable:false,valueField:"value",displayField:"text",mode:"local",emptyText:"Select an indicator",triggerAction:"all",store:new Ext.data.SimpleStore({fields:["value","text"],data:this.indicators}),listeners:{select:{fn:function(){this.classify(false)},scope:this}}},{xtype:"combo",fieldLabel:"Method",name:"method",hiddenName:"method",editable:false,valueField:"value",displayField:"text",mode:"local",emptyText:"Select a method",triggerAction:"all",store:new Ext.data.SimpleStore({fields:["value","text"],data:[["CLASSIFY_BY_EQUAL_INTERVALS","Equal Intervals"],["CLASSIFY_BY_QUANTILS","Quantils"]]}),listeners:{select:{fn:function(){this.classify(false)},scope:this}}},{xtype:"combo",fieldLabel:"Number of classes",name:"numClasses",editable:false,valueField:"value",displayField:"value",mode:"local",value:5,triggerAction:"all",store:new Ext.data.SimpleStore({fields:["value"],data:[[0],[1],[2],[3],[4],[5],[6],[7],[8],[9]]}),listeners:{select:{fn:function(){this.classify(false)},scope:this}}},{xtype:"colorfield",fieldLabel:"Color",name:"colorA",width:100,allowBlank:false,value:"#FFFF00",listeners:{valid:{fn:function(){this.classify(false)},scope:this}}},{xtype:"colorfield",fieldLabel:"Color",name:"colorB",width:100,allowBlank:false,value:"#FF0000",listeners:{valid:{fn:function(){this.classify(false)},scope:this}}}];mapfish.widgets.geostat.Choropleth.superclass.initComponent.apply(this)},requestSuccess:function(a){this.ready=true;if(this.loadMask&&this.rendered){this.loadMask.hide()}},requestFailure:function(a){OpenLayers.Console.error("Ajax request failed")},getColors:function(){var b=new mapfish.ColorRgb();b.setFromHex(this.form.findField("colorA").getValue());var a=new mapfish.ColorRgb();a.setFromHex(this.form.findField("colorB").getValue());return[b,a]},classify:function(b){if(!this.ready){if(b){Ext.MessageBox.alert("Error","Component init not complete")}return}var a={};this.indicator=this.form.findField("indicator").getValue();this.indicatorText=this.form.findField("indicator").getRawValue();a.indicator=this.indicator;if(!a.indicator){if(b){Ext.MessageBox.alert("Error","You must choose an indicator")}return}a.method=this.form.findField("method").getValue();if(!a.method){if(b){Ext.MessageBox.alert("Error","You must choose a method")}return}a.method=mapfish.GeoStat.Distribution[a.method];a.numClasses=this.form.findField("numClasses").getValue();a.colors=this.getColors();this.coreComp.updateOptions(a);this.coreComp.applyClassification();this.classificationApplied=true},onRender:function(b,a){mapfish.widgets.geostat.Choropleth.superclass.onRender.apply(this,arguments);if(this.loadMask){this.loadMask=new Ext.LoadMask(this.bwrap,this.loadMask);this.loadMask.show()}var d={layer:this.layer,format:this.format,url:this.url,requestSuccess:this.requestSuccess.createDelegate(this),requestFailure:this.requestFailure.createDelegate(this),featureSelection:this.featureSelection,nameAttribute:this.nameAttribute,legendDiv:this.legendDiv,labelGenerator:this.labelGenerator};this.coreComp=new mapfish.GeoStat.Choropleth(this.map,d)}});Ext.reg("choropleth",mapfish.widgets.geostat.Choropleth);Ext.namespace("mapfish.widgets","mapfish.widgets.geostat");mapfish.widgets.geostat.ProportionalSymbol=Ext.extend(Ext.FormPanel,{layer:null,format:null,url:null,featureSelection:true,nameAttribute:null,indicator:null,indicatorText:null,coreComp:null,classificationApplied:false,ready:false,border:false,loadMask:false,initComponent:function(){this.items=[{xtype:"combo",fieldLabel:"Indicator",name:"indicator",editable:false,valueField:"value",displayField:"text",mode:"local",emptyText:"select an indicator",triggerAction:"all",store:new Ext.data.SimpleStore({fields:["value","text"],data:this.indicators})},{xtype:"numberfield",fieldLabel:"Min Size",name:"minSize",width:30,value:2,maxValue:20},{xtype:"numberfield",fieldLabel:"Max Size",name:"maxSize",width:30,value:20,maxValue:50}];this.buttons=[{text:"OK",handler:this.classify,scope:this}];mapfish.widgets.geostat.ProportionalSymbol.superclass.initComponent.apply(this)},requestSuccess:function(a){this.ready=true;if(this.loadMask&&this.rendered){this.loadMask.hide()}},requestFailure:function(a){OpenLayers.Console.error("Ajax request failed")},classify:function(){if(!this.ready){if(exception){Ext.MessageBox.alert("Error","Component init not complete")}return}this.indicator=this.form.findField("indicator").getValue();this.indicatorText=this.form.findField("indicator").getRawValue();if(!this.indicator){Ext.MessageBox.alert("Error","You must choose an indicator");return}var a=this.form.findField("minSize").getValue();var b=this.form.findField("maxSize").getValue();this.coreComp.updateOptions({indicator:this.indicator,minSize:a,maxSize:b});this.coreComp.applyClassification();this.classificationApplied=true},onRender:function(b,a){mapfish.widgets.geostat.Choropleth.superclass.onRender.apply(this,arguments);if(this.loadMask){this.loadMask=new Ext.LoadMask(this.bwrap,this.loadMask);this.loadMask.show()}this.coreComp=new mapfish.GeoStat.ProportionalSymbol(this.map,{layer:this.layer,format:this.format,url:this.url,requestSuccess:this.requestSuccess.createDelegate(this),requestFailure:this.requestFailure.createDelegate(this),featureSelection:this.featureSelection,nameAttribute:this.nameAttribute})}});Ext.reg("proportionalsymbol",mapfish.widgets.geostat.ProportionalSymbol);var OpenLayers={singleFile:true};(function(){var m=(typeof OpenLayers=="object"&&OpenLayers.singleFile);window.OpenLayers={_scriptName:(!m)?"lib/OpenLayers.js":"OpenLayers.js",_getScriptLocation:function(){var u="";var w=new RegExp("(^|(.*?\\/))("+OpenLayers._scriptName+")(\\?|$)");var r=document.getElementsByTagName("script");for(var t=0,h=r.length;t<h;t++){var v=r[t].getAttribute("src");if(v){var s=v.match(w);if(s){u=s[1];break}}}return u}};if(!m){var o=new Array("OpenLayers/Util.js","OpenLayers/BaseTypes.js","OpenLayers/BaseTypes/Class.js","OpenLayers/BaseTypes/Bounds.js","OpenLayers/BaseTypes/Element.js","OpenLayers/BaseTypes/LonLat.js","OpenLayers/BaseTypes/Pixel.js","OpenLayers/BaseTypes/Size.js","OpenLayers/Console.js","OpenLayers/Tween.js","Rico/Corner.js","Rico/Color.js","OpenLayers/Ajax.js","OpenLayers/Events.js","OpenLayers/Request.js","OpenLayers/Request/XMLHttpRequest.js","OpenLayers/Projection.js","OpenLayers/Map.js","OpenLayers/Layer.js","OpenLayers/Icon.js","OpenLayers/Marker.js","OpenLayers/Marker/Box.js","OpenLayers/Popup.js","OpenLayers/Tile.js","OpenLayers/Tile/Image.js","OpenLayers/Tile/WFS.js","OpenLayers/Layer/Image.js","OpenLayers/Layer/SphericalMercator.js","OpenLayers/Layer/EventPane.js","OpenLayers/Layer/FixedZoomLevels.js","OpenLayers/Layer/Google.js","OpenLayers/Layer/VirtualEarth.js","OpenLayers/Layer/Yahoo.js","OpenLayers/Layer/HTTPRequest.js","OpenLayers/Layer/Grid.js","OpenLayers/Layer/MapGuide.js","OpenLayers/Layer/MapServer.js","OpenLayers/Layer/MapServer/Untiled.js","OpenLayers/Layer/KaMap.js","OpenLayers/Layer/KaMapCache.js","OpenLayers/Layer/MultiMap.js","OpenLayers/Layer/Markers.js","OpenLayers/Layer/Text.js","OpenLayers/Layer/WorldWind.js","OpenLayers/Layer/ArcGIS93Rest.js","OpenLayers/Layer/WMS.js","OpenLayers/Layer/WMS/Untiled.js","OpenLayers/Layer/ArcIMS.js","OpenLayers/Layer/GeoRSS.js","OpenLayers/Layer/Boxes.js","OpenLayers/Layer/XYZ.js","OpenLayers/Layer/TMS.js","OpenLayers/Layer/TileCache.js","OpenLayers/Popup/Anchored.js","OpenLayers/Popup/AnchoredBubble.js","OpenLayers/Popup/Framed.js","OpenLayers/Popup/FramedCloud.js","OpenLayers/Feature.js","OpenLayers/Feature/Vector.js","OpenLayers/Feature/WFS.js","OpenLayers/Handler.js","OpenLayers/Handler/Click.js","OpenLayers/Handler/Hover.js","OpenLayers/Handler/Point.js","OpenLayers/Handler/Path.js","OpenLayers/Handler/Polygon.js","OpenLayers/Handler/Feature.js","OpenLayers/Handler/Drag.js","OpenLayers/Handler/RegularPolygon.js","OpenLayers/Handler/Box.js","OpenLayers/Handler/MouseWheel.js","OpenLayers/Handler/Keyboard.js","OpenLayers/Control.js","OpenLayers/Control/Attribution.js","OpenLayers/Control/Button.js","OpenLayers/Control/ZoomBox.js","OpenLayers/Control/ZoomToMaxExtent.js","OpenLayers/Control/DragPan.js","OpenLayers/Control/Navigation.js","OpenLayers/Control/MouseDefaults.js","OpenLayers/Control/MousePosition.js","OpenLayers/Control/OverviewMap.js","OpenLayers/Control/KeyboardDefaults.js","OpenLayers/Control/PanZoom.js","OpenLayers/Control/PanZoomBar.js","OpenLayers/Control/ArgParser.js","OpenLayers/Control/Permalink.js","OpenLayers/Control/Scale.js","OpenLayers/Control/ScaleLine.js","OpenLayers/Control/Snapping.js","OpenLayers/Control/Split.js","OpenLayers/Control/LayerSwitcher.js","OpenLayers/Control/DrawFeature.js","OpenLayers/Control/DragFeature.js","OpenLayers/Control/ModifyFeature.js","OpenLayers/Control/Panel.js","OpenLayers/Control/SelectFeature.js","OpenLayers/Control/NavigationHistory.js","OpenLayers/Control/Measure.js","OpenLayers/Control/WMSGetFeatureInfo.js","OpenLayers/Geometry.js","OpenLayers/Geometry/Rectangle.js","OpenLayers/Geometry/Collection.js","OpenLayers/Geometry/Point.js","OpenLayers/Geometry/MultiPoint.js","OpenLayers/Geometry/Curve.js","OpenLayers/Geometry/LineString.js","OpenLayers/Geometry/LinearRing.js","OpenLayers/Geometry/Polygon.js","OpenLayers/Geometry/MultiLineString.js","OpenLayers/Geometry/MultiPolygon.js","OpenLayers/Geometry/Surface.js","OpenLayers/Renderer.js","OpenLayers/Renderer/Elements.js","OpenLayers/Renderer/SVG.js","OpenLayers/Renderer/Canvas.js","OpenLayers/Renderer/VML.js","OpenLayers/Layer/Vector.js","OpenLayers/Layer/Vector/RootContainer.js","OpenLayers/Strategy.js","OpenLayers/Strategy/Fixed.js","OpenLayers/Strategy/Cluster.js","OpenLayers/Strategy/Paging.js","OpenLayers/Strategy/BBOX.js","OpenLayers/Strategy/Save.js","OpenLayers/Protocol.js","OpenLayers/Protocol/HTTP.js","OpenLayers/Protocol/SQL.js","OpenLayers/Protocol/SQL/Gears.js","OpenLayers/Protocol/WFS.js","OpenLayers/Protocol/WFS/v1.js","OpenLayers/Protocol/WFS/v1_0_0.js","OpenLayers/Protocol/WFS/v1_1_0.js","OpenLayers/Layer/PointTrack.js","OpenLayers/Layer/GML.js","OpenLayers/Style.js","OpenLayers/StyleMap.js","OpenLayers/Rule.js","OpenLayers/Filter.js","OpenLayers/Filter/FeatureId.js","OpenLayers/Filter/Logical.js","OpenLayers/Filter/Comparison.js","OpenLayers/Filter/Spatial.js","OpenLayers/Format.js","OpenLayers/Format/XML.js","OpenLayers/Format/ArcXML.js","OpenLayers/Format/ArcXML/Features.js","OpenLayers/Format/GML.js","OpenLayers/Format/GML/Base.js","OpenLayers/Format/GML/v2.js","OpenLayers/Format/GML/v3.js","OpenLayers/Format/KML.js","OpenLayers/Format/GeoRSS.js","OpenLayers/Format/WFS.js","OpenLayers/Format/WFSCapabilities.js","OpenLayers/Format/WFSCapabilities/v1.js","OpenLayers/Format/WFSCapabilities/v1_0_0.js","OpenLayers/Format/WFSCapabilities/v1_1_0.js","OpenLayers/Format/WFSDescribeFeatureType.js","OpenLayers/Format/WMSDescribeLayer.js","OpenLayers/Format/WMSDescribeLayer/v1_1.js","OpenLayers/Format/WKT.js","OpenLayers/Format/OSM.js","OpenLayers/Format/GPX.js","OpenLayers/Format/Filter.js","OpenLayers/Format/Filter/v1.js","OpenLayers/Format/Filter/v1_0_0.js","OpenLayers/Format/Filter/v1_1_0.js","OpenLayers/Format/SLD.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/SLD/v1_0_0.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/WFST.js","OpenLayers/Format/WFST/v1.js","OpenLayers/Format/WFST/v1_0_0.js","OpenLayers/Format/WFST/v1_1_0.js","OpenLayers/Format/Text.js","OpenLayers/Format/JSON.js","OpenLayers/Format/GeoJSON.js","OpenLayers/Format/WMC.js","OpenLayers/Format/WMC/v1.js","OpenLayers/Format/WMC/v1_0_0.js","OpenLayers/Format/WMC/v1_1_0.js","OpenLayers/Format/WMSCapabilities.js","OpenLayers/Format/WMSCapabilities/v1_1.js","OpenLayers/Format/WMSCapabilities/v1_1_0.js","OpenLayers/Format/WMSCapabilities/v1_1_1.js","OpenLayers/Format/WMSGetFeatureInfo.js","OpenLayers/Layer/WFS.js","OpenLayers/Control/GetFeature.js","OpenLayers/Control/MouseToolbar.js","OpenLayers/Control/NavToolbar.js","OpenLayers/Control/PanPanel.js","OpenLayers/Control/Pan.js","OpenLayers/Control/ZoomIn.js","OpenLayers/Control/ZoomOut.js","OpenLayers/Control/ZoomPanel.js","OpenLayers/Control/EditingToolbar.js","OpenLayers/Lang.js","OpenLayers/Lang/en.js");var b=navigator.userAgent;var e=(b.match("MSIE")||b.match("Safari"));if(e){var a=new Array(o.length)}var p=OpenLayers._getScriptLocation()+"lib/";for(var d=0,l=o.length;d<l;d++){if(e){a[d]="<script src='"+p+o[d]+"'><\/script>"}else{var q=document.createElement("script");q.src=p+o[d];var g=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;g.appendChild(q)}}if(e){document.write(a.join(""))}}})();OpenLayers.VERSION_NUMBER="OpenLayers 2.8 -- $Revision: 9492 $";OpenLayers.String={startsWith:function(b,a){return(b.indexOf(a)==0)},contains:function(b,a){return(b.indexOf(a)!=-1)},trim:function(a){return a.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(h){var e=h.split("-");var b=e[0];for(var d=1,a=e.length;d<a;d++){var g=e[d];b+=g.charAt(0).toUpperCase()+g.substring(1)}return b},format:function(e,d,a){if(!d){d=window}var b=function(o,g){var m;var l=g.split(/\.+/);for(var h=0;h<l.length;h++){if(h==0){m=d}m=m[l[h]]}if(typeof m=="function"){m=a?m.apply(null,a):m()}if(typeof m=="undefined"){return"undefined"}else{return m}};return e.replace(OpenLayers.String.tokenRegEx,b)},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(a){return OpenLayers.String.numberRegEx.test(a)},numericIf:function(a){return OpenLayers.String.isNumeric(a)?parseFloat(a):a}};if(!String.prototype.startsWith){String.prototype.startsWith=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.startsWith"}));return OpenLayers.String.startsWith(this,a)}}if(!String.prototype.contains){String.prototype.contains=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.contains"}));return OpenLayers.String.contains(this,a)}}if(!String.prototype.trim){String.prototype.trim=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.trim"}));return OpenLayers.String.trim(this)}}if(!String.prototype.camelize){String.prototype.camelize=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.camelize"}));return OpenLayers.String.camelize(this)}}OpenLayers.Number={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(a,d){var b=0;if(d>0){b=parseFloat(a.toPrecision(d))}return b},format:function(d,a,l,o){a=(typeof a!="undefined")?a:0;l=(typeof l!="undefined")?l:OpenLayers.Number.thousandsSeparator;o=(typeof o!="undefined")?o:OpenLayers.Number.decimalSeparator;if(a!=null){d=parseFloat(d.toFixed(a))}var b=d.toString().split(".");if(b.length==1&&a==null){a=0}var e=b[0];if(l){var g=/(-?[0-9]+)([0-9]{3})/;while(g.test(e)){e=e.replace(g,"$1"+l+"$2")}}var h;if(a==0){h=e}else{var m=b.length>1?b[1]:"0";if(a!=null){m=m+new Array(a-m.length+1).join("0")}h=e+o+m}return h}};if(!Number.prototype.limitSigDigs){Number.prototype.limitSigDigs=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Number.limitSigDigs"}));return OpenLayers.Number.limitSigDigs(this,a)}}OpenLayers.Function={bind:function(d,b){var a=Array.prototype.slice.apply(arguments,[2]);return function(){var e=a.concat(Array.prototype.slice.apply(arguments,[0]));return d.apply(b,e)}},bindAsEventListener:function(b,a){return function(d){return b.call(a,d||window.event)}}};if(!Function.prototype.bind){Function.prototype.bind=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Function.bind"}));Array.prototype.unshift.apply(arguments,[this]);return OpenLayers.Function.bind.apply(null,arguments)}}if(!Function.prototype.bindAsEventListener){Function.prototype.bindAsEventListener=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Function.bindAsEventListener"}));return OpenLayers.Function.bindAsEventListener(this,a)}}OpenLayers.Array={filter:function(l,h,b){var e=[];if(Array.prototype.filter){e=l.filter(h,b)}else{var a=l.length;if(typeof h!="function"){throw new TypeError()}for(var d=0;d<a;d++){if(d in l){var g=l[d];if(h.call(b,g,d,l)){e.push(g)}}}}return e}};OpenLayers.Class=function(){var e=function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments)}};var d={};var h,b;for(var g=0,a=arguments.length;g<a;++g){if(typeof arguments[g]=="function"){if(g==0&&a>1){b=arguments[g].prototype.initialize;arguments[g].prototype.initialize=function(){};d=new arguments[g];if(b===undefined){delete arguments[g].prototype.initialize}else{arguments[g].prototype.initialize=b}}h=arguments[g].prototype}else{h=arguments[g]}OpenLayers.Util.extend(d,h)}e.prototype=d;return e};OpenLayers.Class.isPrototype=function(){};OpenLayers.Class.create=function(){return function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments)}}};OpenLayers.Class.inherit=function(){var e=arguments[0];var g=new e(OpenLayers.Class.isPrototype);for(var d=1,a=arguments.length;d<a;d++){if(typeof arguments[d]=="function"){var b=arguments[d];arguments[d]=new b(OpenLayers.Class.isPrototype)}OpenLayers.Util.extend(g,arguments[d])}return g};OpenLayers.Util={};OpenLayers.Util.getElement=function(){var e=[];for(var d=0,a=arguments.length;d<a;d++){var b=arguments[d];if(typeof b=="string"){b=document.getElementById(b)}if(arguments.length==1){return b}e.push(b)}return e};if(typeof window.$==="undefined"){window.$=OpenLayers.Util.getElement}OpenLayers.Util.extend=function(a,g){a=a||{};if(g){for(var e in g){var d=g[e];if(d!==undefined){a[e]=d}}var b=typeof window.Event=="function"&&g instanceof window.Event;if(!b&&g.hasOwnProperty&&g.hasOwnProperty("toString")){a.toString=g.toString}}return a};OpenLayers.Util.removeItem=function(d,b){for(var a=d.length-1;a>=0;a--){if(d[a]==b){d.splice(a,1)}}return d};OpenLayers.Util.clearArray=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"array = []"}));a.length=0};OpenLayers.Util.indexOf=function(e,d){for(var b=0,a=e.length;b<a;b++){if(e[b]==d){return b}}return -1};OpenLayers.Util.modifyDOMElement=function(g,m,e,h,a,d,l,b){if(m){g.id=m}if(e){g.style.left=e.x+"px";g.style.top=e.y+"px"}if(h){g.style.width=h.w+"px";g.style.height=h.h+"px"}if(a){g.style.position=a}if(d){g.style.border=d}if(l){g.style.overflow=l}if(parseFloat(b)>=0&&parseFloat(b)<1){g.style.filter="alpha(opacity="+(b*100)+")";g.style.opacity=b}else{if(parseFloat(b)==1){g.style.filter="";g.style.opacity=""}}};OpenLayers.Util.createDiv=function(a,o,m,h,g,d,b,l){var e=document.createElement("div");if(h){e.style.backgroundImage="url("+h+")"}if(!a){a=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!g){g="absolute"}OpenLayers.Util.modifyDOMElement(e,a,o,m,g,d,b,l);return e};OpenLayers.Util.createImage=function(a,m,l,g,e,d,h,o){var b=document.createElement("img");if(!a){a=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!e){e="relative"}OpenLayers.Util.modifyDOMElement(b,a,m,l,e,d,null,h);if(o){b.style.display="none";OpenLayers.Event.observe(b,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,b));OpenLayers.Event.observe(b,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,b))}b.style.alt=a;b.galleryImg="no";if(g){b.src=g}return b};OpenLayers.Util.setOpacity=function(b,a){OpenLayers.Util.modifyDOMElement(b,null,null,null,null,null,null,a)};OpenLayers.Util.onImageLoad=function(){if(!this.viewRequestID||(this.map&&this.viewRequestID==this.map.viewRequestID)){this.style.backgroundColor="transparent";this.style.display=""}};OpenLayers.Util.onImageLoadErrorColor="pink";OpenLayers.IMAGE_RELOAD_ATTEMPTS=0;OpenLayers.Util.onImageLoadError=function(){this._attempts=(this._attempts)?(this._attempts+1):1;if(this._attempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS){var e=this.urls;if(e&&e instanceof Array&&e.length>1){var g=this.src.toString();var d,a;for(a=0;d=e[a];a++){if(g.indexOf(d)!=-1){break}}var h=Math.floor(e.length*Math.random());var b=e[h];a=0;while(b==d&&a++<4){h=Math.floor(e.length*Math.random());b=e[h]}this.src=g.replace(d,b)}else{this.src=this.src}}else{this.style.backgroundColor=OpenLayers.Util.onImageLoadErrorColor}this.style.display=""};OpenLayers.Util.alphaHackNeeded=null;OpenLayers.Util.alphaHack=function(){if(OpenLayers.Util.alphaHackNeeded==null){var g=navigator.appVersion.split("MSIE");var a=parseFloat(g[1]);var b=false;try{b=!!(document.body.filters)}catch(d){}OpenLayers.Util.alphaHackNeeded=(b&&(a>=5.5)&&(a<7))}return OpenLayers.Util.alphaHackNeeded};OpenLayers.Util.modifyAlphaImageDiv=function(a,b,p,o,l,h,d,e,m){OpenLayers.Util.modifyDOMElement(a,b,p,o,h,null,null,m);var g=a.childNodes[0];if(l){g.src=l}OpenLayers.Util.modifyDOMElement(g,a.id+"_innerImage",null,o,"relative",d);if(OpenLayers.Util.alphaHack()){if(a.style.display!="none"){a.style.display="inline-block"}if(e==null){e="scale"}a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+g.src+"', sizingMethod='"+e+"')";if(parseFloat(a.style.opacity)>=0&&parseFloat(a.style.opacity)<1){a.style.filter+=" alpha(opacity="+a.style.opacity*100+")"}g.style.filter="alpha(opacity=0)"}};OpenLayers.Util.createAlphaImageDiv=function(b,p,o,l,h,d,e,m,q){var a=OpenLayers.Util.createDiv();var g=OpenLayers.Util.createImage(null,null,null,null,null,null,null,false);a.appendChild(g);if(q){g.style.display="none";OpenLayers.Event.observe(g,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,a));OpenLayers.Event.observe(g,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,a))}OpenLayers.Util.modifyAlphaImageDiv(a,b,p,o,l,h,d,e,m);return a};OpenLayers.Util.upperCaseObject=function(b){var a={};for(var d in b){a[d.toUpperCase()]=b[d]}return a};OpenLayers.Util.applyDefaults=function(e,d){e=e||{};var b=typeof window.Event=="function"&&d instanceof window.Event;for(var a in d){if(e[a]===undefined||(!b&&d.hasOwnProperty&&d.hasOwnProperty(a)&&!e.hasOwnProperty(a))){e[a]=d[a]}}if(!b&&d&&d.hasOwnProperty&&d.hasOwnProperty("toString")&&!e.hasOwnProperty("toString")){e.toString=d.toString}return e};OpenLayers.Util.getParameterString=function(m){var l=[];for(var d in m){var g=m[d];if((g!=null)&&(typeof g!="function")){var b;if(typeof g=="object"&&g.constructor==Array){var h=[];for(var e=0,a=g.length;e<a;e++){h.push(encodeURIComponent(g[e]))}b=h.join(",")}else{b=encodeURIComponent(g)}l.push(encodeURIComponent(d)+"="+b)}}return l.join("&")};OpenLayers.ImgPath="";OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||(OpenLayers._getScriptLocation()+"img/")};OpenLayers.Util.Try=function(){var g=null;for(var d=0,a=arguments.length;d<a;d++){var b=arguments[d];try{g=b();break}catch(h){}}return g};OpenLayers.Util.getNodes=function(d,b){var a=OpenLayers.Util.Try(function(){return OpenLayers.Util._getNodes(d.documentElement.childNodes,b)},function(){return OpenLayers.Util._getNodes(d.childNodes,b)});return a};OpenLayers.Util._getNodes=function(d,g){var b=[];for(var e=0,a=d.length;e<a;e++){if(d[e].nodeName==g){b.push(d[e])}}return b};OpenLayers.Util.getTagText=function(d,e,b){var a=OpenLayers.Util.getNodes(d,e);if(a&&(a.length>0)){if(!b){b=0}if(a[b].childNodes.length>1){return a.childNodes[1].nodeValue}else{if(a[b].childNodes.length==1){return a[b].firstChild.nodeValue}}}else{return""}};OpenLayers.Util.getXmlNodeValue=function(a){var b=null;OpenLayers.Util.Try(function(){b=a.text;if(!b){b=a.textContent}if(!b){b=a.firstChild.nodeValue}},function(){b=a.textContent});return b};OpenLayers.Util.mouseLeft=function(a,d){var b=(a.relatedTarget)?a.relatedTarget:a.toElement;while(b!=d&&b!=null){b=b.parentNode}return(b!=d)};OpenLayers.Util.DEFAULT_PRECISION=14;OpenLayers.Util.toFloat=function(b,a){if(a==null){a=OpenLayers.Util.DEFAULT_PRECISION}var b;if(a==0){b=parseFloat(b)}else{b=parseFloat(parseFloat(b).toPrecision(a))}return b};OpenLayers.Util.rad=function(a){return a*Math.PI/180};OpenLayers.Util.distVincenty=function(h,e){var T=6378137,S=6356752.3142,N=1/298.257223563;var r=OpenLayers.Util.rad(e.lon-h.lon);var Q=Math.atan((1-N)*Math.tan(OpenLayers.Util.rad(h.lat)));var P=Math.atan((1-N)*Math.tan(OpenLayers.Util.rad(e.lat)));var q=Math.sin(Q),m=Math.cos(Q);var p=Math.sin(P),l=Math.cos(P);var w=r,t=2*Math.PI;var v=20;while(Math.abs(w-t)>1e-12&&--v>0){var I=Math.sin(w),g=Math.cos(w);var U=Math.sqrt((l*I)*(l*I)+(m*p-q*l*g)*(m*p-q*l*g));if(U==0){return 0}var K=q*p+m*l*g;var H=Math.atan2(U,K);var o=Math.asin(m*l*I/U);var M=Math.cos(o)*Math.cos(o);var u=K-2*q*p/M;var E=N/16*M*(4+N*(4-3*M));t=w;w=r+(1-E)*N*Math.sin(o)*(H+E*U*(u+E*K*(-1+2*u*u)))}if(v==0){return NaN}var D=M*(T*T-S*S)/(S*S);var G=1+D/16384*(4096+D*(-768+D*(320-175*D)));var F=D/1024*(256+D*(-128+D*(74-47*D)));var J=F*U*(u+F/4*(K*(-1+2*u*u)-F/6*u*(-3+4*U*U)*(-3+4*u*u)));var z=S*G*(H-J);var O=z.toFixed(3)/1000;return O};OpenLayers.Util.getParameters=function(b){b=b||window.location.href;var a="";if(OpenLayers.String.contains(b,"?")){var d=b.indexOf("?")+1;var g=OpenLayers.String.contains(b,"#")?b.indexOf("#"):b.length;a=b.substring(d,g)}var s={};var e=a.split(/[&;]/);for(var m=0,o=e.length;m<o;++m){var l=e[m].split("=");if(l[0]){var q=decodeURIComponent(l[0]);var p=l[1]||"";p=p.split(",");for(var h=0,r=p.length;h<r;h++){p[h]=decodeURIComponent(p[h])}if(p.length==1){p=p[0]}s[q]=p}}return s};OpenLayers.Util.getArgs=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Util.getParameters"}));return OpenLayers.Util.getParameters(a)};OpenLayers.Util.lastSeqID=0;OpenLayers.Util.createUniqueID=function(a){if(a==null){a="id_"}OpenLayers.Util.lastSeqID+=1;return a+OpenLayers.Util.lastSeqID};OpenLayers.INCHES_PER_UNIT={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};OpenLayers.INCHES_PER_UNIT["in"]=OpenLayers.INCHES_PER_UNIT.inches;OpenLayers.INCHES_PER_UNIT.degrees=OpenLayers.INCHES_PER_UNIT.dd;OpenLayers.INCHES_PER_UNIT.nmi=1852*OpenLayers.INCHES_PER_UNIT.m;OpenLayers.METERS_PER_INCH=0.0254000508001016;OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{Inch:OpenLayers.INCHES_PER_UNIT.inches,Meter:1/OpenLayers.METERS_PER_INCH,Foot:0.3048006096012192/OpenLayers.METERS_PER_INCH,IFoot:0.3048/OpenLayers.METERS_PER_INCH,ClarkeFoot:0.3047972651151/OpenLayers.METERS_PER_INCH,SearsFoot:0.30479947153867626/OpenLayers.METERS_PER_INCH,GoldCoastFoot:0.3047997101815088/OpenLayers.METERS_PER_INCH,IInch:0.0254/OpenLayers.METERS_PER_INCH,MicroInch:0.0000254/OpenLayers.METERS_PER_INCH,Mil:2.54e-8/OpenLayers.METERS_PER_INCH,Centimeter:0.01/OpenLayers.METERS_PER_INCH,Kilometer:1000/OpenLayers.METERS_PER_INCH,Yard:0.9144018288036576/OpenLayers.METERS_PER_INCH,SearsYard:0.914398414616029/OpenLayers.METERS_PER_INCH,IndianYard:0.9143985307444408/OpenLayers.METERS_PER_INCH,IndianYd37:0.91439523/OpenLayers.METERS_PER_INCH,IndianYd62:0.9143988/OpenLayers.METERS_PER_INCH,IndianYd75:0.9143985/OpenLayers.METERS_PER_INCH,IndianFoot:0.30479951/OpenLayers.METERS_PER_INCH,IndianFt37:0.30479841/OpenLayers.METERS_PER_INCH,IndianFt62:0.3047996/OpenLayers.METERS_PER_INCH,IndianFt75:0.3047995/OpenLayers.METERS_PER_INCH,Mile:1609.3472186944373/OpenLayers.METERS_PER_INCH,IYard:0.9144/OpenLayers.METERS_PER_INCH,IMile:1609.344/OpenLayers.METERS_PER_INCH,NautM:1852/OpenLayers.METERS_PER_INCH,"Lat-66":110943.31648893273/OpenLayers.METERS_PER_INCH,"Lat-83":110946.25736872235/OpenLayers.METERS_PER_INCH,Decimeter:0.1/OpenLayers.METERS_PER_INCH,Millimeter:0.001/OpenLayers.METERS_PER_INCH,Dekameter:10/OpenLayers.METERS_PER_INCH,Decameter:10/OpenLayers.METERS_PER_INCH,Hectometer:100/OpenLayers.METERS_PER_INCH,GermanMeter:1.0000135965/OpenLayers.METERS_PER_INCH,CaGrid:0.999738/OpenLayers.METERS_PER_INCH,ClarkeChain:20.1166194976/OpenLayers.METERS_PER_INCH,GunterChain:20.11684023368047/OpenLayers.METERS_PER_INCH,BenoitChain:20.116782494375872/OpenLayers.METERS_PER_INCH,SearsChain:20.11676512155/OpenLayers.METERS_PER_INCH,ClarkeLink:0.201166194976/OpenLayers.METERS_PER_INCH,GunterLink:0.2011684023368047/OpenLayers.METERS_PER_INCH,BenoitLink:0.20116782494375873/OpenLayers.METERS_PER_INCH,SearsLink:0.2011676512155/OpenLayers.METERS_PER_INCH,Rod:5.02921005842012/OpenLayers.METERS_PER_INCH,IntnlChain:20.1168/OpenLayers.METERS_PER_INCH,IntnlLink:0.201168/OpenLayers.METERS_PER_INCH,Perch:5.02921005842012/OpenLayers.METERS_PER_INCH,Pole:5.02921005842012/OpenLayers.METERS_PER_INCH,Furlong:201.1684023368046/OpenLayers.METERS_PER_INCH,Rood:3.778266898/OpenLayers.METERS_PER_INCH,CapeFoot:0.3047972615/OpenLayers.METERS_PER_INCH,Brealey:375/OpenLayers.METERS_PER_INCH,ModAmFt:0.304812252984506/OpenLayers.METERS_PER_INCH,Fathom:1.8288/OpenLayers.METERS_PER_INCH,"NautM-UK":1853.184/OpenLayers.METERS_PER_INCH,"50kilometers":50000/OpenLayers.METERS_PER_INCH,"150kilometers":150000/OpenLayers.METERS_PER_INCH});OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{mm:OpenLayers.INCHES_PER_UNIT.Meter/1000,cm:OpenLayers.INCHES_PER_UNIT.Meter/100,dm:OpenLayers.INCHES_PER_UNIT.Meter*100,km:OpenLayers.INCHES_PER_UNIT.Meter*1000,kmi:OpenLayers.INCHES_PER_UNIT.nmi,fath:OpenLayers.INCHES_PER_UNIT.Fathom,ch:OpenLayers.INCHES_PER_UNIT.IntnlChain,link:OpenLayers.INCHES_PER_UNIT.IntnlLink,"us-in":OpenLayers.INCHES_PER_UNIT.inches,"us-ft":OpenLayers.INCHES_PER_UNIT.Foot,"us-yd":OpenLayers.INCHES_PER_UNIT.Yard,"us-ch":OpenLayers.INCHES_PER_UNIT.GunterChain,"us-mi":OpenLayers.INCHES_PER_UNIT.Mile,"ind-yd":OpenLayers.INCHES_PER_UNIT.IndianYd37,"ind-ft":OpenLayers.INCHES_PER_UNIT.IndianFt37,"ind-ch":20.11669506/OpenLayers.METERS_PER_INCH});OpenLayers.DOTS_PER_INCH=72;OpenLayers.Util.normalizeScale=function(b){var a=(b>1)?(1/b):b;return a};OpenLayers.Util.getResolutionFromScale=function(e,a){if(a==null){a="degrees"}var d=OpenLayers.Util.normalizeScale(e);var b=1/(d*OpenLayers.INCHES_PER_UNIT[a]*OpenLayers.DOTS_PER_INCH);return b};OpenLayers.Util.getScaleFromResolution=function(b,a){if(a==null){a="degrees"}var d=b*OpenLayers.INCHES_PER_UNIT[a]*OpenLayers.DOTS_PER_INCH;return d};OpenLayers.Util.safeStopPropagation=function(a){OpenLayers.Event.stop(a,true)};OpenLayers.Util.pagePosition=function(h){var a=0,g=0;var b=h;var l=h;while(b){if(b==document.body){if(OpenLayers.Element.getStyle(l,"position")=="absolute"){break}}a+=b.offsetTop||0;g+=b.offsetLeft||0;l=b;try{b=b.offsetParent}catch(d){OpenLayers.Console.error(OpenLayers.i18n("pagePositionFailed",{elemId:b.id}));break}}b=h;while(b){a-=b.scrollTop||0;g-=b.scrollLeft||0;b=b.parentNode}return[g,a]};OpenLayers.Util.isEquivalentUrl=function(h,g,d){d=d||{};OpenLayers.Util.applyDefaults(d,{ignoreCase:true,ignorePort80:true,ignoreHash:true});var b=OpenLayers.Util.createUrlObject(h,d);var a=OpenLayers.Util.createUrlObject(g,d);for(var e in b){if(e!=="args"){if(b[e]!=a[e]){return false}}}for(var e in b.args){if(b.args[e]!=a.args[e]){return false}delete a.args[e]}for(var e in a.args){return false}return true};OpenLayers.Util.createUrlObject=function(d,q){q=q||{};if(!(/^\w+:\/\//).test(d)){var l=window.location;var g=l.port?":"+l.port:"";var m=l.protocol+"//"+l.host.split(":").shift()+g;if(d.indexOf("/")===0){d=m+d}else{var h=l.pathname.split("/");h.pop();d=m+h.join("/")+"/"+d}}if(q.ignoreCase){d=d.toLowerCase()}var o=document.createElement("a");o.href=d;var e={};e.host=o.host.split(":").shift();e.protocol=o.protocol;if(q.ignorePort80){e.port=(o.port=="80"||o.port=="0")?"":o.port}else{e.port=(o.port==""||o.port=="0")?"80":o.port}e.hash=(q.ignoreHash||o.hash==="#")?"":o.hash;var b=o.search;if(!b){var p=d.indexOf("?");b=(p!=-1)?d.substr(p):""}e.args=OpenLayers.Util.getParameters(b);e.pathname=(o.pathname.charAt(0)=="/")?o.pathname:"/"+o.pathname;return e};OpenLayers.Util.removeTail=function(b){var d=null;var a=b.indexOf("?");var e=b.indexOf("#");if(a==-1){d=(e!=-1)?b.substr(0,e):b}else{d=(e!=-1)?b.substr(0,Math.min(a,e)):b.substr(0,a)}return d};OpenLayers.Util.getBrowserName=function(){var b="";var a=navigator.userAgent.toLowerCase();if(a.indexOf("opera")!=-1){b="opera"}else{if(a.indexOf("msie")!=-1){b="msie"}else{if(a.indexOf("safari")!=-1){b="safari"}else{if(a.indexOf("mozilla")!=-1){if(a.indexOf("firefox")!=-1){b="firefox"}else{b="mozilla"}}}}}return b};OpenLayers.Util.getRenderedDimensions=function(b,t,u){var q,g;var a=document.createElement("div");a.style.visibility="hidden";var s=(u&&u.containerElement)?u.containerElement:document.body;if(t){if(t.w){q=t.w;a.style.width=q+"px"}else{if(t.h){g=t.h;a.style.height=g+"px"}}}if(u&&u.displayClass){a.className=u.displayClass}var m=document.createElement("div");m.innerHTML=b;m.style.overflow="visible";if(m.childNodes){for(var e=0,d=m.childNodes.length;e<d;e++){if(!m.childNodes[e].style){continue}m.childNodes[e].style.overflow="visible"}}a.appendChild(m);s.appendChild(a);var r=false;var p=a.parentNode;while(p&&p.tagName.toLowerCase()!="body"){var o=OpenLayers.Element.getStyle(p,"position");if(o=="absolute"){r=true;break}else{if(o&&o!="static"){break}}p=p.parentNode}if(!r){a.style.position="absolute"}if(!q){q=parseInt(m.scrollWidth);a.style.width=q+"px"}if(!g){g=parseInt(m.scrollHeight)}a.removeChild(m);s.removeChild(a);return new OpenLayers.Size(q,g)};OpenLayers.Util.getScrollbarWidth=function(){var d=OpenLayers.Util._scrollbarWidth;if(d==null){var g=null;var e=null;var a=0;var b=0;g=document.createElement("div");g.style.position="absolute";g.style.top="-1000px";g.style.left="-1000px";g.style.width="100px";g.style.height="50px";g.style.overflow="hidden";e=document.createElement("div");e.style.width="100%";e.style.height="200px";g.appendChild(e);document.body.appendChild(g);a=e.offsetWidth;g.style.overflow="scroll";b=e.offsetWidth;document.body.removeChild(document.body.lastChild);OpenLayers.Util._scrollbarWidth=(a-b);d=OpenLayers.Util._scrollbarWidth}return d};OpenLayers.Rico=new Object();OpenLayers.Rico.Corner={round:function(g,b){g=OpenLayers.Util.getElement(g);this._setOptions(b);var a=this.options.color;if(this.options.color=="fromElement"){a=this._background(g)}var d=this.options.bgColor;if(this.options.bgColor=="fromParent"){d=this._background(g.offsetParent)}this._roundCornersImpl(g,a,d)},changeColor:function(d,b){d.style.backgroundColor=b;var a=d.parentNode.getElementsByTagName("span");for(var e=0;e<a.length;e++){a[e].style.backgroundColor=b}},changeOpacity:function(d,h){var e=h;var a="alpha(opacity="+h*100+")";d.style.opacity=e;d.style.filter=a;var b=d.parentNode.getElementsByTagName("span");for(var g=0;g<b.length;g++){b[g].style.opacity=e;b[g].style.filter=a}},reRound:function(e,d){var b=e.parentNode.childNodes[0];var a=e.parentNode.childNodes[2];e.parentNode.removeChild(b);e.parentNode.removeChild(a);this.round(e.parentNode,d)},_roundCornersImpl:function(d,a,b){if(this.options.border){this._renderBorder(d,b)}if(this._isTopRounded()){this._roundTopCorners(d,a,b)}if(this._isBottomRounded()){this._roundBottomCorners(d,a,b)}},_renderBorder:function(e,g){var b="1px solid "+this._borderColor(g);var a="border-left: "+b;var h="border-right: "+b;var d="style='"+a+";"+h+"'";e.innerHTML="<div "+d+">"+e.innerHTML+"</div>"},_roundTopCorners:function(d,a,g){var e=this._createCorner(g);for(var b=0;b<this.options.numSlices;b++){e.appendChild(this._createCornerSlice(a,g,b,"top"))}d.style.paddingTop=0;d.insertBefore(e,d.firstChild)},_roundBottomCorners:function(d,a,g){var e=this._createCorner(g);for(var b=(this.options.numSlices-1);b>=0;b--){e.appendChild(this._createCornerSlice(a,g,b,"bottom"))}d.style.paddingBottom=0;d.appendChild(e)},_createCorner:function(b){var a=document.createElement("div");a.style.backgroundColor=(this._isTransparent()?"transparent":b);return a},_createCornerSlice:function(d,e,l,a){var g=document.createElement("span");var b=g.style;b.backgroundColor=d;b.display="block";b.height="1px";b.overflow="hidden";b.fontSize="1px";var h=this._borderColor(d,e);if(this.options.border&&l==0){b.borderTopStyle="solid";b.borderTopWidth="1px";b.borderLeftWidth="0px";b.borderRightWidth="0px";b.borderBottomWidth="0px";b.height="0px";b.borderColor=h}else{if(h){b.borderColor=h;b.borderStyle="solid";b.borderWidth="0px 1px"}}if(!this.options.compact&&(l==(this.options.numSlices-1))){b.height="2px"}this._setMargin(g,l,a);this._setBorder(g,l,a);return g},_setOptions:function(a){this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false};OpenLayers.Util.extend(this.options,a||{});this.options.numSlices=this.options.compact?2:4;if(this._isTransparent()){this.options.blend=false}},_whichSideTop:function(){if(this._hasString(this.options.corners,"all","top")){return""}if(this.options.corners.indexOf("tl")>=0&&this.options.corners.indexOf("tr")>=0){return""}if(this.options.corners.indexOf("tl")>=0){return"left"}else{if(this.options.corners.indexOf("tr")>=0){return"right"}}return""},_whichSideBottom:function(){if(this._hasString(this.options.corners,"all","bottom")){return""}if(this.options.corners.indexOf("bl")>=0&&this.options.corners.indexOf("br")>=0){return""}if(this.options.corners.indexOf("bl")>=0){return"left"}else{if(this.options.corners.indexOf("br")>=0){return"right"}}return""},_borderColor:function(a,b){if(a=="transparent"){return b}else{if(this.options.border){return this.options.border}else{if(this.options.blend){return this._blend(b,a)}else{return""}}}},_setMargin:function(e,g,b){var d=this._marginSize(g);var a=b=="top"?this._whichSideTop():this._whichSideBottom();if(a=="left"){e.style.marginLeft=d+"px";e.style.marginRight="0px"}else{if(a=="right"){e.style.marginRight=d+"px";e.style.marginLeft="0px"}else{e.style.marginLeft=d+"px";e.style.marginRight=d+"px"}}},_setBorder:function(e,g,b){var d=this._borderSize(g);var a=b=="top"?this._whichSideTop():this._whichSideBottom();if(a=="left"){e.style.borderLeftWidth=d+"px";e.style.borderRightWidth="0px"}else{if(a=="right"){e.style.borderRightWidth=d+"px";e.style.borderLeftWidth="0px"}else{e.style.borderLeftWidth=d+"px";e.style.borderRightWidth=d+"px"}}if(this.options.border!=false){e.style.borderLeftWidth=d+"px";e.style.borderRightWidth=d+"px"}},_marginSize:function(g){if(this._isTransparent()){return 0}var e=[5,3,2,1];var a=[3,2,1,0];var d=[2,1];var b=[1,0];if(this.options.compact&&this.options.blend){return b[g]}else{if(this.options.compact){return d[g]}else{if(this.options.blend){return a[g]}else{return e[g]}}}},_borderSize:function(g){var e=[5,3,2,1];var b=[2,1,1,1];var a=[1,0];var d=[0,2,0,0];if(this.options.compact&&(this.options.blend||this._isTransparent())){return 1}else{if(this.options.compact){return a[g]}else{if(this.options.blend){return b[g]}else{if(this.options.border){return d[g]}else{if(this._isTransparent()){return e[g]}}}}}return 0},_hasString:function(b){for(var a=1;a<arguments.length;a++){if(b.indexOf(arguments[a])>=0){return true}}return false},_blend:function(d,a){var b=OpenLayers.Rico.Color.createFromHex(d);b.blend(OpenLayers.Rico.Color.createFromHex(a));return b},_background:function(a){try{return OpenLayers.Rico.Color.createColorFromBackground(a).asHex()}catch(b){return"#ffffff"}},_isTransparent:function(){return this.options.color=="transparent"},_isTopRounded:function(){return this._hasString(this.options.corners,"all","top","tl","tr")},_isBottomRounded:function(){return this._hasString(this.options.corners,"all","bottom","bl","br")},_hasSingleTextChild:function(a){return a.childNodes.length==1&&a.childNodes[0].nodeType==3}};(function(){if(window.google&&google.gears){return}var a=null;if(typeof GearsFactory!="undefined"){a=new GearsFactory()}else{try{a=new ActiveXObject("Gears.Factory");if(a.getBuildInfo().indexOf("ie_mobile")!=-1){a.privateSetGlobalObject(this)}}catch(b){if((typeof navigator.mimeTypes!="undefined")&&navigator.mimeTypes["application/x-googlegears"]){a=document.createElement("object");a.style.display="none";a.width=0;a.height=0;a.type="application/x-googlegears";document.documentElement.appendChild(a)}}}if(!a){return}if(!window.google){google={}}if(!google.gears){google.gears={factory:a}}})();OpenLayers.Element={visible:function(a){return OpenLayers.Util.getElement(a).style.display!="none"},toggle:function(){for(var d=0,a=arguments.length;d<a;d++){var b=OpenLayers.Util.getElement(arguments[d]);var e=OpenLayers.Element.visible(b)?"hide":"show";OpenLayers.Element[e](b)}},hide:function(){for(var d=0,a=arguments.length;d<a;d++){var b=OpenLayers.Util.getElement(arguments[d]);b.style.display="none"}},show:function(){for(var d=0,a=arguments.length;d<a;d++){var b=OpenLayers.Util.getElement(arguments[d]);b.style.display=""}},remove:function(a){a=OpenLayers.Util.getElement(a);a.parentNode.removeChild(a)},getHeight:function(a){a=OpenLayers.Util.getElement(a);return a.offsetHeight},getDimensions:function(b){b=OpenLayers.Util.getElement(b);if(OpenLayers.Element.getStyle(b,"display")!="none"){return{width:b.offsetWidth,height:b.offsetHeight}}var a=b.style;var g=a.visibility;var d=a.position;a.visibility="hidden";a.position="absolute";a.display="";var h=b.clientWidth;var e=b.clientHeight;a.display="none";a.position=d;a.visibility=g;return{width:h,height:e}},hasClass:function(b,a){var d=b.className;return(!!d&&new RegExp("(^|\\s)"+a+"(\\s|$)").test(d))},addClass:function(b,a){if(!OpenLayers.Element.hasClass(b,a)){b.className+=(b.className?" ":"")+a}return b},removeClass:function(b,a){var d=b.className;if(d){b.className=OpenLayers.String.trim(d.replace(new RegExp("(^|\\s+)"+a+"(\\s+|$)")," "))}return b},toggleClass:function(b,a){if(OpenLayers.Element.hasClass(b,a)){OpenLayers.Element.removeClass(b,a)}else{OpenLayers.Element.addClass(b,a)}return b},getStyle:function(d,e){d=OpenLayers.Util.getElement(d);var g=null;if(d&&d.style){g=d.style[OpenLayers.String.camelize(e)];if(!g){if(document.defaultView&&document.defaultView.getComputedStyle){var b=document.defaultView.getComputedStyle(d,null);g=b?b.getPropertyValue(e):null}else{if(d.currentStyle){g=d.currentStyle[OpenLayers.String.camelize(e)]}}}var a=["left","top","right","bottom"];if(window.opera&&(OpenLayers.Util.indexOf(a,e)!=-1)&&(OpenLayers.Element.getStyle(d,"position")=="static")){g="auto"}}return g=="auto"?null:g}};OpenLayers.Size=OpenLayers.Class({w:0,h:0,initialize:function(a,b){this.w=parseFloat(a);this.h=parseFloat(b)},toString:function(){return("w="+this.w+",h="+this.h)},clone:function(){return new OpenLayers.Size(this.w,this.h)},equals:function(b){var a=false;if(b!=null){a=((this.w==b.w&&this.h==b.h)||(isNaN(this.w)&&isNaN(this.h)&&isNaN(b.w)&&isNaN(b.h)))}return a},CLASS_NAME:"OpenLayers.Size"});OpenLayers.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},userError:function(a){alert(a)},assert:function(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},groupEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profileEnd:function(){},count:function(){},CLASS_NAME:"OpenLayers.Console"};(function(){var b=document.getElementsByTagName("script");for(var d=0,a=b.length;d<a;++d){if(b[d].src.indexOf("firebug.js")!=-1){if(console){OpenLayers.Util.extend(OpenLayers.Console,console);break}}}})();OpenLayers.Icon=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,initialize:function(a,b,e,d){this.url=a;this.size=(b)?b:new OpenLayers.Size(20,20);this.offset=e?e:new OpenLayers.Pixel(-(this.size.w/2),-(this.size.h/2));this.calculateOffset=d;var g=OpenLayers.Util.createUniqueID("OL_Icon_");this.imageDiv=OpenLayers.Util.createAlphaImageDiv(g)},destroy:function(){this.erase();OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild);this.imageDiv.innerHTML="";this.imageDiv=null},clone:function(){return new OpenLayers.Icon(this.url,this.size,this.offset,this.calculateOffset)},setSize:function(a){if(a!=null){this.size=a}this.draw()},setUrl:function(a){if(a!=null){this.url=a}this.draw()},draw:function(a){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute");this.moveTo(a);return this.imageDiv},erase:function(){if(this.imageDiv!=null&&this.imageDiv.parentNode!=null){OpenLayers.Element.remove(this.imageDiv)}},setOpacity:function(a){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null,null,null,null,a)},moveTo:function(a){if(a!=null){this.px=a}if(this.imageDiv!=null){if(this.px==null){this.display(false)}else{if(this.calculateOffset){this.offset=this.calculateOffset(this.size)}var b=this.px.offset(this.offset);OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,b)}}},display:function(a){this.imageDiv.style.display=(a)?"":"none"},isDrawn:function(){var a=(this.imageDiv&&this.imageDiv.parentNode&&(this.imageDiv.parentNode.nodeType!=11));return a},CLASS_NAME:"OpenLayers.Icon"});OpenLayers.Popup=OpenLayers.Class({events:null,id:"",lonlat:null,div:null,contentSize:null,size:null,contentHTML:null,backgroundColor:"",opacity:"",border:"",contentDiv:null,groupDiv:null,closeDiv:null,autoSize:false,minSize:null,maxSize:null,displayClass:"olPopup",contentDisplayClass:"olPopupContent",padding:0,disableFirefoxOverflowHack:false,fixPadding:function(){if(typeof this.padding=="number"){this.padding=new OpenLayers.Bounds(this.padding,this.padding,this.padding,this.padding)}},panMapIfOutOfView:false,keepInMap:false,closeOnMove:false,map:null,initialize:function(l,d,h,b,g,e){if(l==null){l=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")}this.id=l;this.lonlat=d;this.contentSize=(h!=null)?h:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);if(b!=null){this.contentHTML=b}this.backgroundColor=OpenLayers.Popup.COLOR;this.opacity=OpenLayers.Popup.OPACITY;this.border=OpenLayers.Popup.BORDER;this.div=OpenLayers.Util.createDiv(this.id,null,null,null,null,null,"hidden");this.div.className=this.displayClass;var a=this.id+"_GroupDiv";this.groupDiv=OpenLayers.Util.createDiv(a,null,null,null,"relative",null,"hidden");var l=this.div.id+"_contentDiv";this.contentDiv=OpenLayers.Util.createDiv(l,null,this.contentSize.clone(),null,"relative");this.contentDiv.className=this.contentDisplayClass;this.groupDiv.appendChild(this.contentDiv);this.div.appendChild(this.groupDiv);if(g){this.addCloseBox(e)}this.registerEvents()},destroy:function(){this.id=null;this.lonlat=null;this.size=null;this.contentHTML=null;this.backgroundColor=null;this.opacity=null;this.border=null;if(this.closeOnMove&&this.map){this.map.events.unregister("movestart",this,this.hide)}this.events.destroy();this.events=null;if(this.closeDiv){OpenLayers.Event.stopObservingElement(this.closeDiv);this.groupDiv.removeChild(this.closeDiv)}this.closeDiv=null;this.div.removeChild(this.groupDiv);this.groupDiv=null;if(this.map!=null){this.map.removePopup(this)}this.map=null;this.div=null;this.autoSize=null;this.minSize=null;this.maxSize=null;this.padding=null;this.panMapIfOutOfView=null},draw:function(a){if(a==null){if((this.lonlat!=null)&&(this.map!=null)){a=this.map.getLayerPxFromLonLat(this.lonlat)}}if(this.closeOnMove){this.map.events.register("movestart",this,this.hide)}if(!this.disableFirefoxOverflowHack&&OpenLayers.Util.getBrowserName()=="firefox"){this.map.events.register("movestart",this,function(){var b=document.defaultView.getComputedStyle(this.contentDiv,null);var d=b.getPropertyValue("overflow");if(d!="hidden"){this.contentDiv._oldOverflow=d;this.contentDiv.style.overflow="hidden"}});this.map.events.register("moveend",this,function(){var b=this.contentDiv._oldOverflow;if(b){this.contentDiv.style.overflow=b;this.contentDiv._oldOverflow=null}})}this.moveTo(a);if(!this.autoSize&&!this.size){this.setSize(this.contentSize)}this.setBackgroundColor();this.setOpacity();this.setBorder();this.setContentHTML();if(this.panMapIfOutOfView){this.panIntoView()}return this.div},updatePosition:function(){if((this.lonlat)&&(this.map)){var a=this.map.getLayerPxFromLonLat(this.lonlat);if(a){this.moveTo(a)}}},moveTo:function(a){if((a!=null)&&(this.div!=null)){this.div.style.left=a.x+"px";this.div.style.top=a.y+"px"}},visible:function(){return OpenLayers.Element.visible(this.div)},toggle:function(){if(this.visible()){this.hide()}else{this.show()}},show:function(){OpenLayers.Element.show(this.div);if(this.panMapIfOutOfView){this.panIntoView()}},hide:function(){OpenLayers.Element.hide(this.div)},setSize:function(d){this.size=d.clone();var b=this.getContentDivPadding();var a=b.left+b.right;var g=b.top+b.bottom;this.fixPadding();a+=this.padding.left+this.padding.right;g+=this.padding.top+this.padding.bottom;if(this.closeDiv){var e=parseInt(this.closeDiv.style.width);a+=e+b.right}this.size.w+=a;this.size.h+=g;if(OpenLayers.Util.getBrowserName()=="msie"){this.contentSize.w+=b.left+b.right;this.contentSize.h+=b.bottom+b.top}if(this.div!=null){this.div.style.width=this.size.w+"px";this.div.style.height=this.size.h+"px"}if(this.contentDiv!=null){this.contentDiv.style.width=d.w+"px";this.contentDiv.style.height=d.h+"px"}},updateSize:function(){var g="<div class='"+this.contentDisplayClass+"'>"+this.contentDiv.innerHTML+"</div>";var m=(this.map)?this.map.layerContainerDiv:document.body;var o=OpenLayers.Util.getRenderedDimensions(g,null,{displayClass:this.displayClass,containerElement:m});var l=this.getSafeContentSize(o);var h=null;if(l.equals(o)){h=o}else{var b=new OpenLayers.Size();b.w=(l.w<o.w)?l.w:null;b.h=(l.h<o.h)?l.h:null;if(b.w&&b.h){h=l}else{var e=OpenLayers.Util.getRenderedDimensions(g,b,{displayClass:this.contentDisplayClass,containerElement:m});var d=OpenLayers.Element.getStyle(this.contentDiv,"overflow");if((d!="hidden")&&(e.equals(l))){var a=OpenLayers.Util.getScrollbarWidth();if(b.w){e.h+=a}else{e.w+=a}}h=this.getSafeContentSize(e)}}this.setSize(h)},setBackgroundColor:function(a){if(a!=undefined){this.backgroundColor=a}if(this.div!=null){this.div.style.backgroundColor=this.backgroundColor}},setOpacity:function(a){if(a!=undefined){this.opacity=a}if(this.div!=null){this.div.style.opacity=this.opacity;this.div.style.filter="alpha(opacity="+this.opacity*100+")"}},setBorder:function(a){if(a!=undefined){this.border=a}if(this.div!=null){this.div.style.border=this.border}},setContentHTML:function(a){if(a!=null){this.contentHTML=a}if((this.contentDiv!=null)&&(this.contentHTML!=null)&&(this.contentHTML!=this.contentDiv.innerHTML)){this.contentDiv.innerHTML=this.contentHTML;if(this.autoSize){this.registerImageListeners();this.updateSize()}}},registerImageListeners:function(){var h=function(){this.popup.updateSize();if(this.popup.visible()&&this.popup.panMapIfOutOfView){this.popup.panIntoView()}OpenLayers.Event.stopObserving(this.img,"load",this.img._onImageLoad)};var b=this.contentDiv.getElementsByTagName("img");for(var g=0,a=b.length;g<a;g++){var d=b[g];if(d.width==0||d.height==0){var e={popup:this,img:d};d._onImgLoad=OpenLayers.Function.bind(h,e);OpenLayers.Event.observe(d,"load",d._onImgLoad)}}},getSafeContentSize:function(q){var e=q.clone();var o=this.getContentDivPadding();var p=o.left+o.right;var l=o.top+o.bottom;this.fixPadding();p+=this.padding.left+this.padding.right;l+=this.padding.top+this.padding.bottom;if(this.closeDiv){var d=parseInt(this.closeDiv.style.width);p+=d+o.right}if(this.minSize){e.w=Math.max(e.w,(this.minSize.w-p));e.h=Math.max(e.h,(this.minSize.h-l))}if(this.maxSize){e.w=Math.min(e.w,(this.maxSize.w-p));e.h=Math.min(e.h,(this.maxSize.h-l))}if(this.map&&this.map.size){var h=0,g=0;if(this.keepInMap&&!this.panMapIfOutOfView){var m=this.map.getPixelFromLonLat(this.lonlat);switch(this.relativePosition){case"tr":h=m.x;g=this.map.size.h-m.y;break;case"tl":h=this.map.size.w-m.x;g=this.map.size.h-m.y;break;case"bl":h=this.map.size.w-m.x;g=m.y;break;case"br":h=m.x;g=m.y;break;default:h=m.x;g=this.map.size.h-m.y;break}}var a=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-l-g;var b=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-p-h;e.w=Math.min(e.w,b);e.h=Math.min(e.h,a)}return e},getContentDivPadding:function(){var a=this._contentDivPadding;if(!a){if(this.div.parentNode==null){this.div.style.display="none";document.body.appendChild(this.div)}a=new OpenLayers.Bounds(OpenLayers.Element.getStyle(this.contentDiv,"padding-left"),OpenLayers.Element.getStyle(this.contentDiv,"padding-bottom"),OpenLayers.Element.getStyle(this.contentDiv,"padding-right"),OpenLayers.Element.getStyle(this.contentDiv,"padding-top"));this._contentDivPadding=a;if(this.div.parentNode==document.body){document.body.removeChild(this.div);this.div.style.display=""}}return a},addCloseBox:function(d){this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,new OpenLayers.Size(17,17));this.closeDiv.className="olPopupCloseBox";var b=this.getContentDivPadding();this.closeDiv.style.right=b.right+"px";this.closeDiv.style.top=b.top+"px";this.groupDiv.appendChild(this.closeDiv);var a=d||function(g){this.hide();OpenLayers.Event.stop(g)};OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(a,this))},panIntoView:function(){var g=this.map.getSize();var e=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top)));var d=e.clone();if(e.x<this.map.paddingForPopups.left){d.x=this.map.paddingForPopups.left}else{if((e.x+this.size.w)>(g.w-this.map.paddingForPopups.right)){d.x=g.w-this.map.paddingForPopups.right-this.size.w}}if(e.y<this.map.paddingForPopups.top){d.y=this.map.paddingForPopups.top}else{if((e.y+this.size.h)>(g.h-this.map.paddingForPopups.bottom)){d.y=g.h-this.map.paddingForPopups.bottom-this.size.h}}var b=e.x-d.x;var a=e.y-d.y;this.map.pan(b,a)},registerEvents:function(){this.events=new OpenLayers.Events(this,this.div,null,true);this.events.on({mousedown:this.onmousedown,mousemove:this.onmousemove,mouseup:this.onmouseup,click:this.onclick,mouseout:this.onmouseout,dblclick:this.ondblclick,scope:this})},onmousedown:function(a){this.mousedown=true;OpenLayers.Event.stop(a,true)},onmousemove:function(a){if(this.mousedown){OpenLayers.Event.stop(a,true)}},onmouseup:function(a){if(this.mousedown){this.mousedown=false;OpenLayers.Event.stop(a,true)}},onclick:function(a){OpenLayers.Event.stop(a,true)},onmouseout:function(a){this.mousedown=false},ondblclick:function(a){OpenLayers.Event.stop(a,true)},CLASS_NAME:"OpenLayers.Popup"});OpenLayers.Popup.WIDTH=200;OpenLayers.Popup.HEIGHT=200;OpenLayers.Popup.COLOR="white";OpenLayers.Popup.OPACITY=1;OpenLayers.Popup.BORDER="0px";OpenLayers.Protocol=OpenLayers.Class({format:null,options:null,autoDestroy:true,initialize:function(a){a=a||{};OpenLayers.Util.extend(this,a);this.options=a},destroy:function(){this.options=null;this.format=null},read:function(){},create:function(){},update:function(){},"delete":function(){},commit:function(){},abort:function(a){},CLASS_NAME:"OpenLayers.Protocol"});OpenLayers.Protocol.Response=OpenLayers.Class({code:null,requestType:null,last:true,features:null,reqFeatures:null,priv:null,initialize:function(a){OpenLayers.Util.extend(this,a)},success:function(){return this.code>0},CLASS_NAME:"OpenLayers.Protocol.Response"});OpenLayers.Protocol.Response.SUCCESS=1;OpenLayers.Protocol.Response.FAILURE=0;OpenLayers.Renderer=OpenLayers.Class({container:null,root:null,extent:null,locked:false,size:null,resolution:null,map:null,initialize:function(a,b){this.container=OpenLayers.Util.getElement(a)},destroy:function(){this.container=null;this.extent=null;this.size=null;this.resolution=null;this.map=null},supported:function(){return false},setExtent:function(a,b){this.extent=a.clone();if(b){this.resolution=null}},setSize:function(a){this.size=a.clone();this.resolution=null},getResolution:function(){this.resolution=this.resolution||this.map.getResolution();return this.resolution},drawFeature:function(a,b){if(b==null){b=a.style}if(a.geometry){var d=a.geometry.getBounds();if(d){if(!d.intersectsBounds(this.extent)){b={display:"none"}}var e=this.drawGeometry(a.geometry,b,a.id);if(b.display!="none"&&b.label&&e!==false){this.drawText(a.id,b,a.geometry.getCentroid())}else{this.removeText(a.id)}return e}}},drawGeometry:function(d,a,b){},drawText:function(d,b,a){},removeText:function(a){},clear:function(){},getFeatureIdFromEvent:function(a){},eraseFeatures:function(d){if(!(d instanceof Array)){d=[d]}for(var b=0,a=d.length;b<a;++b){this.eraseGeometry(d[b].geometry);this.removeText(d[b].id)}},eraseGeometry:function(a){},moveRoot:function(a){},getRenderLayerId:function(){return this.container.id},CLASS_NAME:"OpenLayers.Renderer"});OpenLayers.Strategy=OpenLayers.Class({layer:null,options:null,active:null,autoActivate:true,autoDestroy:true,initialize:function(a){OpenLayers.Util.extend(this,a);this.options=a;this.active=false},destroy:function(){this.deactivate();this.layer=null;this.options=null},setLayer:function(a){this.layer=a},activate:function(){if(!this.active){this.active=true;return true}return false},deactivate:function(){if(this.active){this.active=false;return true}return false},CLASS_NAME:"OpenLayers.Strategy"});OpenLayers.Rico.Color=OpenLayers.Class({initialize:function(d,b,a){this.rgb={r:d,g:b,b:a}},setRed:function(a){this.rgb.r=a},setGreen:function(a){this.rgb.g=a},setBlue:function(a){this.rgb.b=a},setHue:function(b){var a=this.asHSB();a.h=b;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(a.h,a.s,a.b)},setSaturation:function(b){var a=this.asHSB();a.s=b;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(a.h,a.s,a.b)},setBrightness:function(a){var d=this.asHSB();d.b=a;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(d.h,d.s,d.b)},darken:function(b){var a=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(a.h,a.s,Math.max(a.b-b,0))},brighten:function(b){var a=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(a.h,a.s,Math.min(a.b+b,1))},blend:function(a){this.rgb.r=Math.floor((this.rgb.r+a.rgb.r)/2);this.rgb.g=Math.floor((this.rgb.g+a.rgb.g)/2);this.rgb.b=Math.floor((this.rgb.b+a.rgb.b)/2)},isBright:function(){var a=this.asHSB();return this.asHSB().b>0.5},isDark:function(){return !this.isBright()},asRGB:function(){return"rgb("+this.rgb.r+","+this.rgb.g+","+this.rgb.b+")"},asHex:function(){return"#"+this.rgb.r.toColorPart()+this.rgb.g.toColorPart()+this.rgb.b.toColorPart()},asHSB:function(){return OpenLayers.Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b)},toString:function(){return this.asHex()}});OpenLayers.Rico.Color.createFromHex=function(e){if(e.length==4){var b=e;var e="#";for(var d=1;d<4;d++){e+=(b.charAt(d)+b.charAt(d))}}if(e.indexOf("#")==0){e=e.substring(1)}var h=e.substring(0,2);var g=e.substring(2,4);var a=e.substring(4,6);return new OpenLayers.Rico.Color(parseInt(h,16),parseInt(g,16),parseInt(a,16))};OpenLayers.Rico.Color.createColorFromBackground=function(e){var b=RicoUtil.getElementsComputedStyle(OpenLayers.Util.getElement(e),"backgroundColor","background-color");if(b=="transparent"&&e.parentNode){return OpenLayers.Rico.Color.createColorFromBackground(e.parentNode)}if(b==null){return new OpenLayers.Rico.Color(255,255,255)}if(b.indexOf("rgb(")==0){var a=b.substring(4,b.length-1);var d=a.split(",");return new OpenLayers.Rico.Color(parseInt(d[0]),parseInt(d[1]),parseInt(d[2]))}else{if(b.indexOf("#")==0){return OpenLayers.Rico.Color.createFromHex(b)}else{return new OpenLayers.Rico.Color(255,255,255)}}};OpenLayers.Rico.Color.HSBtoRGB=function(m,g,r){var d=0;var e=0;var s=0;if(g==0){d=parseInt(r*255+0.5);e=d;s=d}else{var l=(m-Math.floor(m))*6;var o=l-Math.floor(l);var b=r*(1-g);var a=r*(1-g*o);var u=r*(1-(g*(1-o)));switch(parseInt(l)){case 0:d=(r*255+0.5);e=(u*255+0.5);s=(b*255+0.5);break;case 1:d=(a*255+0.5);e=(r*255+0.5);s=(b*255+0.5);break;case 2:d=(b*255+0.5);e=(r*255+0.5);s=(u*255+0.5);break;case 3:d=(b*255+0.5);e=(a*255+0.5);s=(r*255+0.5);break;case 4:d=(u*255+0.5);e=(b*255+0.5);s=(r*255+0.5);break;case 5:d=(r*255+0.5);e=(b*255+0.5);s=(a*255+0.5);break}}return{r:parseInt(d),g:parseInt(e),b:parseInt(s)}};OpenLayers.Rico.Color.RGBtoHSB=function(a,l,s){var m;var h;var q;var t=(a>l)?a:l;if(s>t){t=s}var o=(a<l)?a:l;if(s<o){o=s}q=t/255;if(t!=0){h=(t-o)/t}else{h=0}if(h==0){m=0}else{var d=(t-a)/(t-o);var p=(t-l)/(t-o);var e=(t-s)/(t-o);if(a==t){m=e-p}else{if(l==t){m=2+d-e}else{m=4+p-d}}m=m/6;if(m<0){m=m+1}}return{h:m,s:h,b:q}};OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(e,a,b,d){if(e!=null){this.left=OpenLayers.Util.toFloat(e)}if(a!=null){this.bottom=OpenLayers.Util.toFloat(a)}if(b!=null){this.right=OpenLayers.Util.toFloat(b)}if(d!=null){this.top=OpenLayers.Util.toFloat(d)}},clone:function(){return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top)},equals:function(b){var a=false;if(b!=null){a=((this.left==b.left)&&(this.right==b.right)&&(this.top==b.top)&&(this.bottom==b.bottom))}return a},toString:function(){return("left-bottom=("+this.left+","+this.bottom+") right-top=("+this.right+","+this.top+")")},toArray:function(){return[this.left,this.bottom,this.right,this.top]},toBBOX:function(a){if(a==null){a=6}var b=Math.pow(10,a);var d=Math.round(this.left*b)/b+","+Math.round(this.bottom*b)/b+","+Math.round(this.right*b)/b+","+Math.round(this.top*b)/b;return d},toGeometry:function(){return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(this.left,this.bottom),new OpenLayers.Geometry.Point(this.right,this.bottom),new OpenLayers.Geometry.Point(this.right,this.top),new OpenLayers.Geometry.Point(this.left,this.top)])])},getWidth:function(){return(this.right-this.left)},getHeight:function(){return(this.top-this.bottom)},getSize:function(){return new OpenLayers.Size(this.getWidth(),this.getHeight())},getCenterPixel:function(){return new OpenLayers.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2)},getCenterLonLat:function(){if(!this.centerLonLat){this.centerLonLat=new OpenLayers.LonLat((this.left+this.right)/2,(this.bottom+this.top)/2)}return this.centerLonLat},scale:function(h,m){if(m==null){m=this.getCenterLonLat()}var a=[];var g,e;if(m.CLASS_NAME=="OpenLayers.LonLat"){g=m.lon;e=m.lat}else{g=m.x;e=m.y}var d=(this.left-g)*h+g;var b=(this.bottom-e)*h+e;var o=(this.right-g)*h+g;var l=(this.top-e)*h+e;return new OpenLayers.Bounds(d,b,o,l)},add:function(a,d){if((a==null)||(d==null)){var b=OpenLayers.i18n("boundsAddError");OpenLayers.Console.error(b);return null}return new OpenLayers.Bounds(this.left+a,this.bottom+d,this.right+a,this.top+d)},extend:function(a){var b=null;if(a){switch(a.CLASS_NAME){case"OpenLayers.LonLat":b=new OpenLayers.Bounds(a.lon,a.lat,a.lon,a.lat);break;case"OpenLayers.Geometry.Point":b=new OpenLayers.Bounds(a.x,a.y,a.x,a.y);break;case"OpenLayers.Bounds":b=a;break}if(b){this.centerLonLat=null;if((this.left==null)||(b.left<this.left)){this.left=b.left}if((this.bottom==null)||(b.bottom<this.bottom)){this.bottom=b.bottom}if((this.right==null)||(b.right>this.right)){this.right=b.right}if((this.top==null)||(b.top>this.top)){this.top=b.top}}}},containsLonLat:function(b,a){return this.contains(b.lon,b.lat,a)},containsPixel:function(b,a){return this.contains(b.x,b.y,a)},contains:function(b,e,a){if(a==null){a=true}if(b==null||e==null){return false}b=OpenLayers.Util.toFloat(b);e=OpenLayers.Util.toFloat(e);var d=false;if(a){d=((b>=this.left)&&(b<=this.right)&&(e>=this.bottom)&&(e<=this.top))}else{d=((b>this.left)&&(b<this.right)&&(e>this.bottom)&&(e<this.top))}return d},intersectsBounds:function(g,b){if(b==null){b=true}var e=false;var m=(this.left==g.right||this.right==g.left||this.top==g.bottom||this.bottom==g.top);if(b||!m){var l=(((g.bottom>=this.bottom)&&(g.bottom<=this.top))||((this.bottom>=g.bottom)&&(this.bottom<=g.top)));var h=(((g.top>=this.bottom)&&(g.top<=this.top))||((this.top>g.bottom)&&(this.top<g.top)));var d=(((g.left>=this.left)&&(g.left<=this.right))||((this.left>=g.left)&&(this.left<=g.right)));var a=(((g.right>=this.left)&&(g.right<=this.right))||((this.right>=g.left)&&(this.right<=g.right)));e=((l||h)&&(d||a))}return e},containsBounds:function(l,b,a){if(b==null){b=false}if(a==null){a=true}var d=this.contains(l.left,l.bottom,a);var e=this.contains(l.right,l.bottom,a);var h=this.contains(l.left,l.top,a);var g=this.contains(l.right,l.top,a);return(b)?(d||e||h||g):(d&&e&&h&&g)},determineQuadrant:function(d){var b="";var a=this.getCenterLonLat();b+=(d.lat<a.lat)?"b":"t";b+=(d.lon<a.lon)?"l":"r";return b},transform:function(e,b){this.centerLonLat=null;var g=OpenLayers.Projection.transform({x:this.left,y:this.bottom},e,b);var a=OpenLayers.Projection.transform({x:this.right,y:this.bottom},e,b);var d=OpenLayers.Projection.transform({x:this.left,y:this.top},e,b);var h=OpenLayers.Projection.transform({x:this.right,y:this.top},e,b);this.left=Math.min(g.x,d.x);this.bottom=Math.min(g.y,a.y);this.right=Math.max(a.x,h.x);this.top=Math.max(d.y,h.y);return this},wrapDateLine:function(a,d){d=d||{};var e=d.leftTolerance||0;var b=d.rightTolerance||0;var g=this.clone();if(a){while(g.left<a.left&&(g.right-b)<=a.left){g=g.add(a.getWidth(),0)}while((g.left+e)>=a.right&&g.right>a.right){g=g.add(-a.getWidth(),0)}}return g},CLASS_NAME:"OpenLayers.Bounds"});OpenLayers.Bounds.fromString=function(b){var a=b.split(",");return OpenLayers.Bounds.fromArray(a)};OpenLayers.Bounds.fromArray=function(a){return new OpenLayers.Bounds(parseFloat(a[0]),parseFloat(a[1]),parseFloat(a[2]),parseFloat(a[3]))};OpenLayers.Bounds.fromSize=function(a){return new OpenLayers.Bounds(0,a.h,a.w,0)};OpenLayers.Bounds.oppositeQuadrant=function(a){var b="";b+=(a.charAt(0)=="t")?"b":"t";b+=(a.charAt(1)=="l")?"r":"l";return b};OpenLayers.LonLat=OpenLayers.Class({lon:0,lat:0,initialize:function(b,a){this.lon=OpenLayers.Util.toFloat(b);this.lat=OpenLayers.Util.toFloat(a)},toString:function(){return("lon="+this.lon+",lat="+this.lat)},toShortString:function(){return(this.lon+", "+this.lat)},clone:function(){return new OpenLayers.LonLat(this.lon,this.lat)},add:function(d,a){if((d==null)||(a==null)){var b=OpenLayers.i18n("lonlatAddError");OpenLayers.Console.error(b);return null}return new OpenLayers.LonLat(this.lon+d,this.lat+a)},equals:function(b){var a=false;if(b!=null){a=((this.lon==b.lon&&this.lat==b.lat)||(isNaN(this.lon)&&isNaN(this.lat)&&isNaN(b.lon)&&isNaN(b.lat)))}return a},transform:function(d,b){var a=OpenLayers.Projection.transform({x:this.lon,y:this.lat},d,b);this.lon=a.x;this.lat=a.y;return this},wrapDateLine:function(a){var b=this.clone();if(a){while(b.lon<a.left){b.lon+=a.getWidth()}while(b.lon>a.right){b.lon-=a.getWidth()}}return b},CLASS_NAME:"OpenLayers.LonLat"});OpenLayers.LonLat.fromString=function(b){var a=b.split(",");return new OpenLayers.LonLat(parseFloat(a[0]),parseFloat(a[1]))};OpenLayers.Pixel=OpenLayers.Class({x:0,y:0,initialize:function(a,b){this.x=parseFloat(a);this.y=parseFloat(b)},toString:function(){return("x="+this.x+",y="+this.y)},clone:function(){return new OpenLayers.Pixel(this.x,this.y)},equals:function(a){var b=false;if(a!=null){b=((this.x==a.x&&this.y==a.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(a.x)&&isNaN(a.y)))}return b},add:function(a,d){if((a==null)||(d==null)){var b=OpenLayers.i18n("pixelAddError");OpenLayers.Console.error(b);return null}return new OpenLayers.Pixel(this.x+a,this.y+d)},offset:function(a){var b=this.clone();if(a){b=this.add(a.x,a.y)}return b},CLASS_NAME:"OpenLayers.Pixel"});OpenLayers.Control=OpenLayers.Class({id:null,map:null,div:null,type:null,allowSelection:false,displayClass:"",title:"",active:null,handler:null,eventListeners:null,events:null,EVENT_TYPES:["activate","deactivate"],initialize:function(a){this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");OpenLayers.Util.extend(this,a);this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES);if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}if(this.id==null){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")}},destroy:function(){if(this.events){if(this.eventListeners){this.events.un(this.eventListeners)}this.events.destroy();this.events=null}this.eventListeners=null;if(this.handler){this.handler.destroy();this.handler=null}if(this.handlers){for(var a in this.handlers){if(this.handlers.hasOwnProperty(a)&&typeof this.handlers[a].destroy=="function"){this.handlers[a].destroy()}}this.handlers=null}if(this.map){this.map.removeControl(this);this.map=null}},setMap:function(a){this.map=a;if(this.handler){this.handler.setMap(a)}},draw:function(a){if(this.div==null){this.div=OpenLayers.Util.createDiv(this.id);this.div.className=this.displayClass;if(!this.allowSelection){this.div.className+=" olControlNoSelect";this.div.setAttribute("unselectable","on",0);this.div.onselectstart=function(){return(false)}}if(this.title!=""){this.div.title=this.title}}if(a!=null){this.position=a.clone()}this.moveTo(this.position);return this.div},moveTo:function(a){if((a!=null)&&(this.div!=null)){this.div.style.left=a.x+"px";this.div.style.top=a.y+"px"}},activate:function(){if(this.active){return false}if(this.handler){this.handler.activate()}this.active=true;if(this.map){OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active")}this.events.triggerEvent("activate");return true},deactivate:function(){if(this.active){if(this.handler){this.handler.deactivate()}this.active=false;if(this.map){OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active")}this.events.triggerEvent("deactivate");return true}return false},CLASS_NAME:"OpenLayers.Control"});OpenLayers.Control.TYPE_BUTTON=1;OpenLayers.Control.TYPE_TOGGLE=2;OpenLayers.Control.TYPE_TOOL=3;OpenLayers.Lang={code:null,defaultCode:"en",getCode:function(){if(!OpenLayers.Lang.code){OpenLayers.Lang.setCode()}return OpenLayers.Lang.code},setCode:function(b){var e;if(!b){b=(OpenLayers.Util.getBrowserName()=="msie")?navigator.userLanguage:navigator.language}var d=b.split("-");d[0]=d[0].toLowerCase();if(typeof OpenLayers.Lang[d[0]]=="object"){e=d[0]}if(d[1]){var a=d[0]+"-"+d[1].toUpperCase();if(typeof OpenLayers.Lang[a]=="object"){e=a}}if(!e){OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+d.join("-")+" dictionary, falling back to default language");e=OpenLayers.Lang.defaultCode}OpenLayers.Lang.code=e},translate:function(b,a){var e=OpenLayers.Lang[OpenLayers.Lang.getCode()];var d=e[b];if(!d){d=b}if(a){d=OpenLayers.String.format(d,a)}return d}};OpenLayers.i18n=OpenLayers.Lang.translate;OpenLayers.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup,{relativePosition:null,keepInMap:true,anchor:null,initialize:function(m,e,l,d,b,h,g){var a=[m,e,l,d,h,g];OpenLayers.Popup.prototype.initialize.apply(this,a);this.anchor=(b!=null)?b:{size:new OpenLayers.Size(0,0),offset:new OpenLayers.Pixel(0,0)}},destroy:function(){this.anchor=null;this.relativePosition=null;OpenLayers.Popup.prototype.destroy.apply(this,arguments)},show:function(){this.updatePosition();OpenLayers.Popup.prototype.show.apply(this,arguments)},moveTo:function(d){var b=this.relativePosition;this.relativePosition=this.calculateRelativePosition(d);var e=this.calculateNewPx(d);var a=new Array(e);OpenLayers.Popup.prototype.moveTo.apply(this,a);if(this.relativePosition!=b){this.updateRelativePosition()}},setSize:function(b){OpenLayers.Popup.prototype.setSize.apply(this,arguments);if((this.lonlat)&&(this.map)){var a=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(a)}},calculateRelativePosition:function(b){var e=this.map.getLonLatFromLayerPx(b);var d=this.map.getExtent();var a=d.determineQuadrant(e);return OpenLayers.Bounds.oppositeQuadrant(a)},updateRelativePosition:function(){},calculateNewPx:function(b){var g=b.offset(this.anchor.offset);var a=this.size||this.contentSize;var e=(this.relativePosition.charAt(0)=="t");g.y+=(e)?-a.h:this.anchor.size.h;var d=(this.relativePosition.charAt(1)=="l");g.x+=(d)?-a.w:this.anchor.size.w;return g},CLASS_NAME:"OpenLayers.Popup.Anchored"});OpenLayers.Protocol.SQL=OpenLayers.Class(OpenLayers.Protocol,{databaseName:"ol",tableName:"ol_vector_features",postReadFiltering:true,initialize:function(a){OpenLayers.Protocol.prototype.initialize.apply(this,[a])},destroy:function(){OpenLayers.Protocol.prototype.destroy.apply(this)},supported:function(){return false},evaluateFilter:function(a,b){return b&&this.postReadFiltering?b.evaluate(a):true},CLASS_NAME:"OpenLayers.Protocol.SQL"});OpenLayers.Protocol.WFS=function(b){b=OpenLayers.Util.applyDefaults(b,OpenLayers.Protocol.WFS.DEFAULTS);var a=OpenLayers.Protocol.WFS["v"+b.version.replace(/\./g,"_")];if(!a){throw"Unsupported WFS version: "+b.version}return new a(b)};OpenLayers.Protocol.WFS.fromWMSLayer=function(e,d){var a,g;var l=e.params.LAYERS;var h=(l instanceof Array?l[0]:l).split(":");if(h.length>1){g=h[0]}a=h.pop();var b={url:e.url,featureType:a,featurePrefix:g,srsName:e.projection&&e.projection.getCode()||e.map&&e.map.getProjectionObject().getCode(),version:"1.1.0"};return new OpenLayers.Protocol.WFS(OpenLayers.Util.applyDefaults(d,b))};OpenLayers.Protocol.WFS.DEFAULTS={version:"1.0.0"};OpenLayers.Renderer.Canvas=OpenLayers.Class(OpenLayers.Renderer,{canvas:null,features:null,geometryMap:null,initialize:function(a){OpenLayers.Renderer.prototype.initialize.apply(this,arguments);this.root=document.createElement("canvas");this.container.appendChild(this.root);this.canvas=this.root.getContext("2d");this.features={};this.geometryMap={}},eraseGeometry:function(a){this.eraseFeatures(this.features[this.geometryMap[a.id]][0])},supported:function(){var a=document.createElement("canvas");return !!a.getContext},setExtent:function(a){this.extent=a.clone();this.resolution=null;this.redraw()},setSize:function(a){this.size=a.clone();this.root.style.width=a.w+"px";this.root.style.height=a.h+"px";this.root.width=a.w;this.root.height=a.h;this.resolution=null},drawFeature:function(a,b){if(b==null){b=a.style}b=OpenLayers.Util.extend({fillColor:"#000000",strokeColor:"#000000",strokeWidth:2,fillOpacity:1,strokeOpacity:1},b);this.features[a.id]=[a,b];if(a.geometry){this.geometryMap[a.geometry.id]=a.id}this.redraw()},drawGeometry:function(e,d){var b=e.CLASS_NAME;if((b=="OpenLayers.Geometry.Collection")||(b=="OpenLayers.Geometry.MultiPoint")||(b=="OpenLayers.Geometry.MultiLineString")||(b=="OpenLayers.Geometry.MultiPolygon")){for(var a=0;a<e.components.length;a++){this.drawGeometry(e.components[a],d)}return}switch(e.CLASS_NAME){case"OpenLayers.Geometry.Point":this.drawPoint(e,d);break;case"OpenLayers.Geometry.LineString":this.drawLineString(e,d);break;case"OpenLayers.Geometry.LinearRing":this.drawLinearRing(e,d);break;case"OpenLayers.Geometry.Polygon":this.drawPolygon(e,d);break;default:break}},drawExternalGraphic:function(o,a){var g=new Image();g.src=a.externalGraphic;if(a.graphicTitle){g.title=a.graphicTitle}var d=a.graphicWidth||a.graphicHeight;var m=a.graphicHeight||a.graphicWidth;d=d?d:a.pointRadius*2;m=m?m:a.pointRadius*2;var l=(a.graphicXOffset!=undefined)?a.graphicXOffset:-(0.5*d);var e=(a.graphicYOffset!=undefined)?a.graphicYOffset:-(0.5*m);var h=a.graphicOpacity||a.fillOpacity;var b={img:g,x:(o[0]+l),y:(o[1]+e),width:d,height:m,canvas:this.canvas};g.onload=OpenLayers.Function.bind(function(){this.canvas.drawImage(this.img,this.x,this.y,this.width,this.height)},b)},setCanvasStyle:function(b,a){if(b=="fill"){this.canvas.globalAlpha=a.fillOpacity;this.canvas.fillStyle=a.fillColor}else{if(b=="stroke"){this.canvas.globalAlpha=a.strokeOpacity;this.canvas.strokeStyle=a.strokeColor;this.canvas.lineWidth=a.strokeWidth}else{this.canvas.globalAlpha=0;this.canvas.lineWidth=1}}},drawPoint:function(d,a){if(a.graphic!==false){var b=this.getLocalXY(d);if(a.externalGraphic){this.drawExternalGraphic(b,a)}else{if(a.fill!==false){this.setCanvasStyle("fill",a);this.canvas.beginPath();this.canvas.arc(b[0],b[1],6,0,Math.PI*2,true);this.canvas.fill()}if(a.stroke!==false){this.setCanvasStyle("stroke",a);this.canvas.beginPath();this.canvas.arc(b[0],b[1],6,0,Math.PI*2,true);this.canvas.stroke();this.setCanvasStyle("reset")}}}},drawLineString:function(e,b){if(b.stroke!==false){this.setCanvasStyle("stroke",b);this.canvas.beginPath();var g=this.getLocalXY(e.components[0]);this.canvas.moveTo(g[0],g[1]);for(var a=1;a<e.components.length;a++){var d=this.getLocalXY(e.components[a]);this.canvas.lineTo(d[0],d[1])}this.canvas.stroke()}this.setCanvasStyle("reset")},drawLinearRing:function(g,d){if(d.fill!==false){this.setCanvasStyle("fill",d);this.canvas.beginPath();var h=this.getLocalXY(g.components[0]);this.canvas.moveTo(h[0],h[1]);for(var b=1;b<g.components.length-1;b++){var e=this.getLocalXY(g.components[b]);this.canvas.lineTo(e[0],e[1])}this.canvas.fill()}if(d.stroke!==false){var a=this.canvas.lineWidth;this.setCanvasStyle("stroke",d);this.canvas.beginPath();var h=this.getLocalXY(g.components[0]);this.canvas.moveTo(h[0],h[1]);for(var b=1;b<g.components.length;b++){var e=this.getLocalXY(g.components[b]);this.canvas.lineTo(e[0],e[1])}this.canvas.stroke()}this.setCanvasStyle("reset")},drawPolygon:function(d,b){this.drawLinearRing(d.components[0],b);for(var a=1;a<d.components.length;a++){this.drawLinearRing(d.components[a],{fillOpacity:0,strokeWidth:0,strokeOpacity:0,strokeColor:"#000000",fillColor:"#000000"})}},drawText:function(b,e){e=OpenLayers.Util.extend({fontColor:"#000000",labelAlign:"cm"},e);var g=this.getLocalXY(b);this.setCanvasStyle("reset");this.canvas.fillStyle=e.fontColor;this.canvas.globalAlpha=1;var h=e.fontWeight+" "+e.fontSize+" "+e.fontFamily;if(this.canvas.fillText){var d=OpenLayers.Renderer.Canvas.LABEL_ALIGN[e.labelAlign[0]]||"middle";this.canvas.font=h;this.canvas.textAlign=d;this.canvas.fillText(e.label,g[0],g[1])}else{if(this.canvas.mozDrawText){this.canvas.mozTextStyle=h;var a=this.canvas.mozMeasureText(e.label);switch(e.labelAlign[0]){case"l":break;case"r":g[0]-=a;break;case"c":default:g[0]-=a/2}this.canvas.translate(g[0],g[1]);this.canvas.mozDrawText(e.label);this.canvas.translate(-1*g[0],-1*g[1])}}this.setCanvasStyle("reset")},getLocalXY:function(b){var d=this.getResolution();var e=this.extent;var a=(b.x/d+(-e.left/d));var g=((e.top/d)-b.y/d);return[a,g]},clear:function(){this.canvas.clearRect(0,0,this.root.width,this.root.height)},getFeatureIdFromEvent:function(a){var h=this.map.getLonLatFromPixel(a.xy);var b=this.getResolution();var g=new OpenLayers.Bounds(h.lon-b*5,h.lat-b*5,h.lon+b*5,h.lat+b*5);var d=g.toGeometry();for(var e in this.features){if(!this.features.hasOwnProperty(e)){continue}if(this.features[e][0].geometry.intersects(d)){return e}}return null},eraseFeatures:function(b){if(!(b instanceof Array)){b=[b]}for(var a=0;a<b.length;++a){delete this.features[b[a].id]}this.redraw()},redraw:function(){if(!this.locked){this.clear();var g=[];var b,d;for(var h in this.features){if(!this.features.hasOwnProperty(h)){continue}b=this.features[h][0];d=this.features[h][1];if(!b.geometry){continue}this.drawGeometry(b.geometry,d);if(d.label){g.push([b,d])}}var e;for(var a=0;len=g.length,a<len;++a){e=g[a];this.drawText(e[0].geometry.getCentroid(),e[1])}}},CLASS_NAME:"OpenLayers.Renderer.Canvas"});OpenLayers.Renderer.Canvas.LABEL_ALIGN={l:"left",r:"right"};OpenLayers.ElementsIndexer=OpenLayers.Class({maxZIndex:null,order:null,indices:null,compare:null,initialize:function(a){this.compare=a?OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER;this.order=[];this.indices={};this.maxZIndex=0},insert:function(d){if(this.exists(d)){this.remove(d)}var h=d.id;this.determineZIndex(d);var e=-1;var g=this.order.length;var a;while(g-e>1){a=parseInt((e+g)/2);var b=this.compare(this,d,OpenLayers.Util.getElement(this.order[a]));if(b>0){e=a}else{g=a}}this.order.splice(g,0,h);this.indices[h]=this.getZIndex(d);return this.getNextElement(g)},remove:function(b){var e=b.id;var a=OpenLayers.Util.indexOf(this.order,e);if(a>=0){this.order.splice(a,1);delete this.indices[e];if(this.order.length>0){var d=this.order[this.order.length-1];this.maxZIndex=this.indices[d]}else{this.maxZIndex=0}}},clear:function(){this.order=[];this.indices={};this.maxZIndex=0},exists:function(a){return(this.indices[a.id]!=null)},getZIndex:function(a){return a._style.graphicZIndex},determineZIndex:function(a){var b=a._style.graphicZIndex;if(b==null){b=this.maxZIndex;a._style.graphicZIndex=b}else{if(b>this.maxZIndex){this.maxZIndex=b}}},getNextElement:function(b){var a=b+1;if(a<this.order.length){var d=OpenLayers.Util.getElement(this.order[a]);if(d==undefined){d=this.getNextElement(a)}return d}else{return null}},CLASS_NAME:"OpenLayers.ElementsIndexer"});OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(g,e,b){var a=g.getZIndex(e);var h=0;if(b){var d=g.getZIndex(b);h=a-d}return h},Z_ORDER_DRAWING_ORDER:function(d,b,a){var e=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(d,b,a);if(a&&e==0){e=1}return e},Z_ORDER_Y_ORDER:function(h,g,b){var l=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(h,g,b);if(b&&l==0){var d=g._geometry.getBounds().bottom;var e=b._geometry.getBounds().bottom;var a=e-d;l=(a==0)?1:a}return l}};OpenLayers.Renderer.Elements=OpenLayers.Class(OpenLayers.Renderer,{rendererRoot:null,root:null,vectorRoot:null,textRoot:null,xmlns:null,indexer:null,BACKGROUND_ID_SUFFIX:"_background",LABEL_ID_SUFFIX:"_label",minimumSymbolizer:{strokeLinecap:"round",strokeOpacity:1,strokeDashstyle:"solid",fillOpacity:1,pointRadius:0},initialize:function(a,b){OpenLayers.Renderer.prototype.initialize.apply(this,arguments);this.rendererRoot=this.createRenderRoot();this.root=this.createRoot("_root");this.vectorRoot=this.createRoot("_vroot");this.textRoot=this.createRoot("_troot");this.root.appendChild(this.vectorRoot);this.root.appendChild(this.textRoot);this.rendererRoot.appendChild(this.root);this.container.appendChild(this.rendererRoot);if(b&&(b.zIndexing||b.yOrdering)){this.indexer=new OpenLayers.ElementsIndexer(b.yOrdering)}},destroy:function(){this.clear();this.rendererRoot=null;this.root=null;this.xmlns=null;OpenLayers.Renderer.prototype.destroy.apply(this,arguments)},clear:function(){if(this.vectorRoot){while(this.vectorRoot.childNodes.length>0){this.vectorRoot.removeChild(this.vectorRoot.firstChild)}}if(this.textRoot){while(this.textRoot.childNodes.length>0){this.textRoot.removeChild(this.textRoot.firstChild)}}if(this.indexer){this.indexer.clear()}},getNodeType:function(b,a){},drawGeometry:function(l,e,h){var d=l.CLASS_NAME;var m=true;if((d=="OpenLayers.Geometry.Collection")||(d=="OpenLayers.Geometry.MultiPoint")||(d=="OpenLayers.Geometry.MultiLineString")||(d=="OpenLayers.Geometry.MultiPolygon")){for(var b=0,a=l.components.length;b<a;b++){m=this.drawGeometry(l.components[b],e,h)&&m}return m}m=false;if(e.display!="none"){if(e.backgroundGraphic){this.redrawBackgroundNode(l.id,l,e,h)}m=this.redrawNode(l.id,l,e,h)}if(m==false){var g=document.getElementById(l.id);if(g){if(g._style.backgroundGraphic){g.parentNode.removeChild(document.getElementById(l.id+this.BACKGROUND_ID_SUFFIX))}g.parentNode.removeChild(g)}}return m},redrawNode:function(l,h,b,g){var d=this.nodeFactory(l,this.getNodeType(h,b));d._featureId=g;d._geometry=h;d._geometryClass=h.CLASS_NAME;d._style=b;var a=this.drawGeometryNode(d,h,b);if(a===false){return false}d=a.node;if(this.indexer){var e=this.indexer.insert(d);if(e){this.vectorRoot.insertBefore(d,e)}else{this.vectorRoot.appendChild(d)}}else{if(d.parentNode!==this.vectorRoot){this.vectorRoot.appendChild(d)}}this.postDraw(d);return a.complete},redrawBackgroundNode:function(g,e,b,d){var a=OpenLayers.Util.extend({},b);a.externalGraphic=a.backgroundGraphic;a.graphicXOffset=a.backgroundXOffset;a.graphicYOffset=a.backgroundYOffset;a.graphicZIndex=a.backgroundGraphicZIndex;a.graphicWidth=a.backgroundWidth||a.graphicWidth;a.graphicHeight=a.backgroundHeight||a.graphicHeight;a.backgroundGraphic=null;a.backgroundXOffset=null;a.backgroundYOffset=null;a.backgroundGraphicZIndex=null;return this.redrawNode(g+this.BACKGROUND_ID_SUFFIX,e,a,null)},drawGeometryNode:function(d,g,b){b=b||d._style;OpenLayers.Util.applyDefaults(b,this.minimumSymbolizer);var a={isFilled:b.fill===undefined?true:b.fill,isStroked:b.stroke===undefined?!!b.strokeWidth:b.stroke};var e;switch(g.CLASS_NAME){case"OpenLayers.Geometry.Point":if(b.graphic===false){a.isFilled=false;a.isStroked=false}e=this.drawPoint(d,g);break;case"OpenLayers.Geometry.LineString":a.isFilled=false;e=this.drawLineString(d,g);break;case"OpenLayers.Geometry.LinearRing":e=this.drawLinearRing(d,g);break;case"OpenLayers.Geometry.Polygon":e=this.drawPolygon(d,g);break;case"OpenLayers.Geometry.Surface":e=this.drawSurface(d,g);break;case"OpenLayers.Geometry.Rectangle":e=this.drawRectangle(d,g);break;default:break}d._style=b;d._options=a;if(e!=false){return{node:this.setStyle(d,b,a,g),complete:e}}else{return false}},postDraw:function(a){},drawPoint:function(a,b){},drawLineString:function(a,b){},drawLinearRing:function(a,b){},drawPolygon:function(a,b){},drawRectangle:function(a,b){},drawCircle:function(a,b){},drawSurface:function(a,b){},removeText:function(b){var a=document.getElementById(b+this.LABEL_ID_SUFFIX);if(a){this.textRoot.removeChild(a)}},getFeatureIdFromEvent:function(a){var e=a.target;var b=e&&e.correspondingUseElement;var d=b?b:(e||a.srcElement);var g=d._featureId;return g},eraseGeometry:function(h){if((h.CLASS_NAME=="OpenLayers.Geometry.MultiPoint")||(h.CLASS_NAME=="OpenLayers.Geometry.MultiLineString")||(h.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon")||(h.CLASS_NAME=="OpenLayers.Geometry.Collection")){for(var e=0,a=h.components.length;e<a;e++){this.eraseGeometry(h.components[e])}}else{var d=OpenLayers.Util.getElement(h.id);if(d&&d.parentNode){if(d.geometry){d.geometry.destroy();d.geometry=null}d.parentNode.removeChild(d);if(this.indexer){this.indexer.remove(d)}if(d._style.backgroundGraphic){var b=h.id+this.BACKGROUND_ID_SUFFIX;var g=OpenLayers.Util.getElement(b);if(g&&g.parentNode){g.parentNode.removeChild(g)}}}}},nodeFactory:function(d,a){var b=OpenLayers.Util.getElement(d);if(b){if(!this.nodeTypeCompare(b,a)){b.parentNode.removeChild(b);b=this.nodeFactory(d,a)}}else{b=this.createNode(a,d)}return b},nodeTypeCompare:function(b,a){},createNode:function(a,b){},moveRoot:function(b){var a=this.root;if(b.root.parentNode==this.rendererRoot){a=b.root}a.parentNode.removeChild(a);b.rendererRoot.appendChild(a)},getRenderLayerId:function(){return this.root.parentNode.parentNode.id},isComplexSymbol:function(a){return(a!="circle")&&!!a},CLASS_NAME:"OpenLayers.Renderer.Elements"});OpenLayers.Renderer.symbol={star:[350,75,379,161,469,161,397,215,423,301,350,250,277,301,303,215,231,161,321,161,350,75],cross:[4,0,6,0,6,4,10,4,10,6,6,6,6,10,4,10,4,6,0,6,0,4,4,4,4,0],x:[0,0,25,0,50,35,75,0,100,0,65,50,100,100,75,100,50,65,25,100,0,100,35,50,0,0],square:[0,0,0,1,1,1,1,0,0,0],triangle:[0,10,10,10,5,0,0,10]};OpenLayers.Strategy.Cluster=OpenLayers.Class(OpenLayers.Strategy,{distance:20,threshold:null,features:null,clusters:null,clustering:false,resolution:null,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a){this.layer.events.on({beforefeaturesadded:this.cacheFeatures,moveend:this.cluster,scope:this})}return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){this.clearCache();this.layer.events.un({beforefeaturesadded:this.cacheFeatures,moveend:this.cluster,scope:this})}return a},cacheFeatures:function(b){var a=true;if(!this.clustering){this.clearCache();this.features=b.features;this.cluster();a=false}return a},clearCache:function(){this.features=null},cluster:function(a){if((!a||a.zoomChanged)&&this.features){var d=this.layer.map.getResolution();if(d!=this.resolution||!this.clustersExist()){this.resolution=d;var m=[];var q,b,o;for(var g=0;g<this.features.length;++g){q=this.features[g];if(q.geometry){b=false;for(var e=0;e<m.length;++e){o=m[e];if(this.shouldCluster(o,q)){this.addToCluster(o,q);b=true;break}}if(!b){m.push(this.createCluster(this.features[g]))}}}this.layer.destroyFeatures();if(m.length>0){if(this.threshold>1){var l=m.slice();m=[];var p;for(var g=0,h=l.length;g<h;++g){p=l[g];if(p.attributes.count<this.threshold){Array.prototype.push.apply(m,p.cluster)}else{m.push(p)}}}this.clustering=true;this.layer.addFeatures(m);this.clustering=false}this.clusters=m}}},clustersExist:function(){var b=false;if(this.clusters&&this.clusters.length>0&&this.clusters.length==this.layer.features.length){b=true;for(var a=0;a<this.clusters.length;++a){if(this.clusters[a]!=this.layer.features[a]){b=false;break}}}return b},shouldCluster:function(a,b){var g=a.geometry.getBounds().getCenterLonLat();var d=b.geometry.getBounds().getCenterLonLat();var e=(Math.sqrt(Math.pow((g.lon-d.lon),2)+Math.pow((g.lat-d.lat),2))/this.resolution);return(e<=this.distance)},addToCluster:function(a,b){a.cluster.push(b);a.attributes.count+=1},createCluster:function(d){var b=d.geometry.getBounds().getCenterLonLat();var a=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat),{count:1});a.cluster=[d];return a},CLASS_NAME:"OpenLayers.Strategy.Cluster"});OpenLayers.Strategy.Fixed=OpenLayers.Class(OpenLayers.Strategy,{preload:false,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},destroy:function(){OpenLayers.Strategy.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Strategy.prototype.activate.apply(this,arguments)){this.layer.events.on({refresh:this.load,scope:this});if(this.layer.visibility==true||this.preload){this.load()}else{this.layer.events.on({visibilitychanged:this.load,scope:this})}return true}return false},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){this.layer.events.un({refresh:this.load,visibilitychanged:this.load,scope:this})}return a},load:function(a){this.layer.events.triggerEvent("loadstart");this.layer.protocol.read(OpenLayers.Util.applyDefaults({callback:this.merge,scope:this},a));this.layer.events.un({visibilitychanged:this.load,scope:this})},merge:function(l){this.layer.destroyFeatures();var g=l.features;if(g&&g.length>0){var h=this.layer.projection;var e=this.layer.map.getProjectionObject();if(!e.equals(h)){var d;for(var b=0,a=g.length;b<a;++b){d=g[b].geometry;if(d){d.transform(h,e)}}}this.layer.addFeatures(g)}this.layer.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Strategy.Fixed"});OpenLayers.Strategy.Paging=OpenLayers.Class(OpenLayers.Strategy,{features:null,length:10,num:null,paging:false,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a){this.layer.events.on({beforefeaturesadded:this.cacheFeatures,scope:this})}return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){this.clearCache();this.layer.events.un({beforefeaturesadded:this.cacheFeatures,scope:this})}return a},cacheFeatures:function(a){if(!this.paging){this.clearCache();this.features=a.features;this.pageNext(a)}},clearCache:function(){if(this.features){for(var a=0;a<this.features.length;++a){this.features[a].destroy()}}this.features=null;this.num=null},pageCount:function(){var a=this.features?this.features.length:0;return Math.ceil(a/this.length)},pageNum:function(){return this.num},pageLength:function(a){if(a&&a>0){this.length=a}return this.length},pageNext:function(a){var b=false;if(this.features){if(this.num===null){this.num=-1}var d=(this.num+1)*this.length;b=this.page(d,a)}return b},pagePrevious:function(){var a=false;if(this.features){if(this.num===null){this.num=this.pageCount()}var b=(this.num-1)*this.length;a=this.page(b)}return a},page:function(g,d){var e=false;if(this.features){if(g>=0&&g<this.features.length){var a=Math.floor(g/this.length);if(a!=this.num){this.paging=true;var b=this.features.slice(g,g+this.length);this.layer.removeFeatures(this.layer.features);this.num=a;if(d&&d.features){d.features=b}else{this.layer.addFeatures(b)}this.paging=false;e=true}}}return e},CLASS_NAME:"OpenLayers.Strategy.Paging"});OpenLayers.Strategy.Save=OpenLayers.Class(OpenLayers.Strategy,{auto:false,timer:null,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a){if(this.auto){if(typeof this.auto==="number"){this.timer=window.setInterval(OpenLayers.Function.bind(this.save,this),this.auto*1000)}else{this.layer.events.on({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})}}}return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){if(this.auto){if(typeof this.auto==="number"){window.clearInterval(this.timer)}else{this.layer.events.un({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})}}}return a},triggerSave:function(b){var a=b.feature;if(a.state===OpenLayers.State.INSERT||a.state===OpenLayers.State.UPDATE||a.state===OpenLayers.State.DELETE){this.save([b.feature])}},save:function(e){if(!e){e=this.layer.features}var h=this.layer.projection;var d=this.layer.map.getProjectionObject();if(!d.equals(h)){var a=e.length;var g=new Array(a);var m,l;for(var b=0;b<a;++b){m=e[b];l=m.clone();l.fid=m.fid;l.state=m.state;l._original=m;l.geometry.transform(d,h);g[b]=l}e=g}this.layer.protocol.commit(e,{callback:this.onCommit,scope:this})},onCommit:function(e){if(e.success()){var b=e.reqFeatures;var a,o;var d=[];var m=e.insertIds||[];var g=0;for(var h=0,l=b.length;h<l;++h){o=b[h];o=o._original||o;a=o.state;if(a){if(a==OpenLayers.State.DELETE){d.push(o)}else{if(a==OpenLayers.State.INSERT){o.fid=m[g];++g}}o.state=null}}if(d.length>0){this.layer.destroyFeatures(d)}}},CLASS_NAME:"OpenLayers.Strategy.Save"});OpenLayers.Tween=OpenLayers.Class({INTERVAL:10,easing:null,begin:null,finish:null,duration:null,callbacks:null,time:null,interval:null,playing:false,initialize:function(a){this.easing=(a)?a:OpenLayers.Easing.Expo.easeOut},start:function(d,b,e,a){this.playing=true;this.begin=d;this.finish=b;this.duration=e;this.callbacks=a.callbacks;this.time=0;if(this.interval){window.clearInterval(this.interval);this.interval=null}if(this.callbacks&&this.callbacks.start){this.callbacks.start.call(this,this.begin)}this.interval=window.setInterval(OpenLayers.Function.bind(this.play,this),this.INTERVAL)},stop:function(){if(!this.playing){return}if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish)}window.clearInterval(this.interval);this.interval=null;this.playing=false},play:function(){var g={};for(var d in this.begin){var a=this.begin[d];var e=this.finish[d];if(a==null||e==null||isNaN(a)||isNaN(e)){OpenLayers.Console.error("invalid value for Tween")}var h=e-a;g[d]=this.easing.apply(this,[this.time,a,h,this.duration])}this.time++;if(this.callbacks&&this.callbacks.eachStep){this.callbacks.eachStep.call(this,g)}if(this.time>this.duration){if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish);this.playing=false}window.clearInterval(this.interval);this.interval=null}},CLASS_NAME:"OpenLayers.Tween"});OpenLayers.Easing={CLASS_NAME:"OpenLayers.Easing"};OpenLayers.Easing.Linear={easeIn:function(e,a,h,g){return h*e/g+a},easeOut:function(e,a,h,g){return h*e/g+a},easeInOut:function(e,a,h,g){return h*e/g+a},CLASS_NAME:"OpenLayers.Easing.Linear"};OpenLayers.Easing.Expo={easeIn:function(e,a,h,g){return(e==0)?a:h*Math.pow(2,10*(e/g-1))+a},easeOut:function(e,a,h,g){return(e==g)?a+h:h*(-Math.pow(2,-10*e/g)+1)+a},easeInOut:function(e,a,h,g){if(e==0){return a}if(e==g){return a+h}if((e/=g/2)<1){return h/2*Math.pow(2,10*(e-1))+a}return h/2*(-Math.pow(2,-10*--e)+2)+a},CLASS_NAME:"OpenLayers.Easing.Expo"};OpenLayers.Easing.Quad={easeIn:function(e,a,h,g){return h*(e/=g)*e+a},easeOut:function(e,a,h,g){return -h*(e/=g)*(e-2)+a},easeInOut:function(e,a,h,g){if((e/=g/2)<1){return h/2*e*e+a}return -h/2*((--e)*(e-2)-1)+a},CLASS_NAME:"OpenLayers.Easing.Quad"};OpenLayers.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments)},setMap:function(g){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var d=0,a=this.map.controls.length;d<a;d++){var e=this.map.controls[d];if((e!=this)&&(e.CLASS_NAME=="OpenLayers.Control.ArgParser")){if(e.displayProjection!=this.displayProjection){this.displayProjection=e.displayProjection}break}}if(d==this.map.controls.length){var b=OpenLayers.Util.getParameters();if(b.layers){this.layers=b.layers;this.map.events.register("addlayer",this,this.configureLayers);this.configureLayers()}if(b.lat&&b.lon){this.center=new OpenLayers.LonLat(parseFloat(b.lon),parseFloat(b.lat));if(b.zoom){this.zoom=parseInt(b.zoom)}this.map.events.register("changebaselayer",this,this.setCenter);this.setCenter()}}},setCenter:function(){if(this.map.baseLayer){this.map.events.unregister("changebaselayer",this,this.setCenter);if(this.displayProjection){this.center.transform(this.displayProjection,this.map.getProjectionObject())}this.map.setCenter(this.center,this.zoom)}},configureLayers:function(){if(this.layers.length==this.map.layers.length){this.map.events.unregister("addlayer",this,this.configureLayers);for(var d=0,a=this.layers.length;d<a;d++){var b=this.map.layers[d];var e=this.layers.charAt(d);if(e=="B"){this.map.setBaseLayer(b)}else{if((e=="T")||(e=="F")){b.setVisibility(e=="T")}}}}},CLASS_NAME:"OpenLayers.Control.ArgParser"});OpenLayers.Control.Attribution=OpenLayers.Class(OpenLayers.Control,{separator:", ",initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.map.events.un({removelayer:this.updateAttribution,addlayer:this.updateAttribution,changelayer:this.updateAttribution,changebaselayer:this.updateAttribution,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.map.events.on({changebaselayer:this.updateAttribution,changelayer:this.updateAttribution,addlayer:this.updateAttribution,removelayer:this.updateAttribution,scope:this});this.updateAttribution();return this.div},updateAttribution:function(){var e=[];if(this.map&&this.map.layers){for(var d=0,a=this.map.layers.length;d<a;d++){var b=this.map.layers[d];if(b.attribution&&b.getVisibility()){e.push(b.attribution)}}this.div.innerHTML=e.join(this.separator)}},CLASS_NAME:"OpenLayers.Control.Attribution"});OpenLayers.Control.Button=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){},CLASS_NAME:"OpenLayers.Control.Button"});OpenLayers.Control.LayerSwitcher=OpenLayers.Class(OpenLayers.Control,{activeColor:"darkblue",layerStates:null,layersDiv:null,baseLayersDiv:null,baseLayers:null,dataLbl:null,dataLayersDiv:null,dataLayers:null,minimizeDiv:null,maximizeDiv:null,ascending:true,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.layerStates=[]},destroy:function(){OpenLayers.Event.stopObservingElement(this.div);OpenLayers.Event.stopObservingElement(this.minimizeDiv);OpenLayers.Event.stopObservingElement(this.maximizeDiv);this.clearLayersArray("base");this.clearLayersArray("data");this.map.events.un({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.on({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this})},draw:function(){OpenLayers.Control.prototype.draw.apply(this);this.loadContents();if(!this.outsideViewport){this.minimizeControl()}this.redraw();return this.div},clearLayersArray:function(e){var g=this[e+"Layers"];if(g){for(var d=0,a=g.length;d<a;d++){var b=g[d];OpenLayers.Event.stopObservingElement(b.inputElem);OpenLayers.Event.stopObservingElement(b.labelSpan)}}this[e+"LayersDiv"].innerHTML="";this[e+"Layers"]=[]},checkRedraw:function(){var g=false;if(!this.layerStates.length||(this.map.layers.length!=this.layerStates.length)){g=true}else{for(var d=0,a=this.layerStates.length;d<a;d++){var e=this.layerStates[d];var b=this.map.layers[d];if((e.name!=b.name)||(e.inRange!=b.inRange)||(e.id!=b.id)||(e.visibility!=b.visibility)){g=true;break}}}return g},redraw:function(){if(!this.checkRedraw()){return this.div}this.clearLayersArray("base");this.clearLayersArray("data");var e=false;var r=false;var m=this.map.layers.length;this.layerStates=new Array(m);for(var h=0;h<m;h++){var l=this.map.layers[h];this.layerStates[h]={name:l.name,visibility:l.visibility,inRange:l.inRange,id:l.id}}var g=this.map.layers.slice();if(!this.ascending){g.reverse()}for(var h=0,m=g.length;h<m;h++){var l=g[h];var o=l.isBaseLayer;if(l.displayInLayerSwitcher){if(o){r=true}else{e=true}var q=(o)?(l==this.map.baseLayer):l.getVisibility();var p=document.createElement("input");p.id=this.id+"_input_"+l.name;p.name=(o)?"baseLayers":l.name;p.type=(o)?"radio":"checkbox";p.value=l.name;p.checked=q;p.defaultChecked=q;if(!o&&!l.inRange){p.disabled=true}var a={inputElem:p,layer:l,layerSwitcher:this};OpenLayers.Event.observe(p,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputClick,a));var b=document.createElement("span");if(!o&&!l.inRange){b.style.color="gray"}b.innerHTML=l.name;b.style.verticalAlign=(o)?"bottom":"baseline";OpenLayers.Event.observe(b,"click",OpenLayers.Function.bindAsEventListener(this.onInputClick,a));var t=document.createElement("br");var s=(o)?this.baseLayers:this.dataLayers;s.push({layer:l,inputElem:p,labelSpan:b});var d=(o)?this.baseLayersDiv:this.dataLayersDiv;d.appendChild(p);d.appendChild(b);d.appendChild(t)}}this.dataLbl.style.display=(e)?"":"none";this.baseLbl.style.display=(r)?"":"none";return this.div},onInputClick:function(a){if(!this.inputElem.disabled){if(this.inputElem.type=="radio"){this.inputElem.checked=true;this.layer.map.setBaseLayer(this.layer)}else{this.inputElem.checked=!this.inputElem.checked;this.layerSwitcher.updateMap()}}OpenLayers.Event.stop(a)},onLayerClick:function(a){this.updateMap()},updateMap:function(){for(var b=0,a=this.baseLayers.length;b<a;b++){var d=this.baseLayers[b];if(d.inputElem.checked){this.map.setBaseLayer(d.layer,false)}}for(var b=0,a=this.dataLayers.length;b<a;b++){var d=this.dataLayers[b];d.layer.setVisibility(d.inputElem.checked)}},maximizeControl:function(a){this.div.style.width="20em";this.div.style.height="";this.showControls(false);if(a!=null){OpenLayers.Event.stop(a)}},minimizeControl:function(a){this.div.style.width="0px";this.div.style.height="0px";this.showControls(true);if(a!=null){OpenLayers.Event.stop(a)}},showControls:function(a){this.maximizeDiv.style.display=a?"":"none";this.minimizeDiv.style.display=a?"none":"";this.layersDiv.style.display=a?"none":""},loadContents:function(){this.div.style.position="absolute";this.div.style.top="25px";this.div.style.right="0px";this.div.style.left="";this.div.style.fontFamily="sans-serif";this.div.style.fontWeight="bold";this.div.style.marginTop="3px";this.div.style.marginLeft="3px";this.div.style.marginBottom="3px";this.div.style.fontSize="smaller";this.div.style.color="white";this.div.style.backgroundColor="transparent";OpenLayers.Event.observe(this.div,"mouseup",OpenLayers.Function.bindAsEventListener(this.mouseUp,this));OpenLayers.Event.observe(this.div,"click",this.ignoreEvent);OpenLayers.Event.observe(this.div,"mousedown",OpenLayers.Function.bindAsEventListener(this.mouseDown,this));OpenLayers.Event.observe(this.div,"dblclick",this.ignoreEvent);this.layersDiv=document.createElement("div");this.layersDiv.id=this.id+"_layersDiv";this.layersDiv.style.paddingTop="5px";this.layersDiv.style.paddingLeft="10px";this.layersDiv.style.paddingBottom="5px";this.layersDiv.style.paddingRight="75px";this.layersDiv.style.backgroundColor=this.activeColor;this.layersDiv.style.width="100%";this.layersDiv.style.height="100%";this.baseLbl=document.createElement("div");this.baseLbl.innerHTML=OpenLayers.i18n("baseLayer");this.baseLbl.style.marginTop="3px";this.baseLbl.style.marginLeft="3px";this.baseLbl.style.marginBottom="3px";this.baseLayersDiv=document.createElement("div");this.baseLayersDiv.style.paddingLeft="10px";this.dataLbl=document.createElement("div");this.dataLbl.innerHTML=OpenLayers.i18n("overlays");this.dataLbl.style.marginTop="3px";this.dataLbl.style.marginLeft="3px";this.dataLbl.style.marginBottom="3px";this.dataLayersDiv=document.createElement("div");this.dataLayersDiv.style.paddingLeft="10px";if(this.ascending){this.layersDiv.appendChild(this.baseLbl);this.layersDiv.appendChild(this.baseLayersDiv);this.layersDiv.appendChild(this.dataLbl);this.layersDiv.appendChild(this.dataLayersDiv)}else{this.layersDiv.appendChild(this.dataLbl);this.layersDiv.appendChild(this.dataLayersDiv);this.layersDiv.appendChild(this.baseLbl);this.layersDiv.appendChild(this.baseLayersDiv)}this.div.appendChild(this.layersDiv);OpenLayers.Rico.Corner.round(this.div,{corners:"tl bl",bgColor:"transparent",color:this.activeColor,blend:false});OpenLayers.Rico.Corner.changeOpacity(this.layersDiv,0.75);var d=OpenLayers.Util.getImagesLocation();var b=new OpenLayers.Size(18,18);var a=d+"layer-switcher-maximize.png";this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MaximizeDiv",null,b,a,"absolute");this.maximizeDiv.style.top="5px";this.maximizeDiv.style.right="0px";this.maximizeDiv.style.left="";this.maximizeDiv.style.display="none";OpenLayers.Event.observe(this.maximizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));this.div.appendChild(this.maximizeDiv);var a=d+"layer-switcher-minimize.png";var b=new OpenLayers.Size(18,18);this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MinimizeDiv",null,b,a,"absolute");this.minimizeDiv.style.top="5px";this.minimizeDiv.style.right="0px";this.minimizeDiv.style.left="";this.minimizeDiv.style.display="none";OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv)},ignoreEvent:function(a){OpenLayers.Event.stop(a)},mouseDown:function(a){this.isMouseDown=true;this.ignoreEvent(a)},mouseUp:function(a){if(this.isMouseDown){this.isMouseDown=false;this.ignoreEvent(a)}},CLASS_NAME:"OpenLayers.Control.LayerSwitcher"});OpenLayers.Control.MouseDefaults=OpenLayers.Class(OpenLayers.Control,{performedDrag:false,wheelObserver:null,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){if(this.handler){this.handler.destroy()}this.handler=null;this.map.events.un({click:this.defaultClick,dblclick:this.defaultDblClick,mousedown:this.defaultMouseDown,mouseup:this.defaultMouseUp,mousemove:this.defaultMouseMove,mouseout:this.defaultMouseOut,scope:this});OpenLayers.Event.stopObserving(window,"DOMMouseScroll",this.wheelObserver);OpenLayers.Event.stopObserving(window,"mousewheel",this.wheelObserver);OpenLayers.Event.stopObserving(document,"mousewheel",this.wheelObserver);this.wheelObserver=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){this.map.events.on({click:this.defaultClick,dblclick:this.defaultDblClick,mousedown:this.defaultMouseDown,mouseup:this.defaultMouseUp,mousemove:this.defaultMouseMove,mouseout:this.defaultMouseOut,scope:this});this.registerWheelEvents()},registerWheelEvents:function(){this.wheelObserver=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this);OpenLayers.Event.observe(window,"DOMMouseScroll",this.wheelObserver);OpenLayers.Event.observe(window,"mousewheel",this.wheelObserver);OpenLayers.Event.observe(document,"mousewheel",this.wheelObserver)},defaultClick:function(b){if(!OpenLayers.Event.isLeftClick(b)){return}var a=!this.performedDrag;this.performedDrag=false;return a},defaultDblClick:function(b){var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(a,this.map.zoom+1);OpenLayers.Event.stop(b);return false},defaultMouseDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}this.mouseDragStart=a.xy.clone();this.performedDrag=false;if(a.shiftKey){this.map.div.style.cursor="crosshair";this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.mouseDragStart,null,null,"absolute","2px solid red");this.zoomBox.style.backgroundColor="white";this.zoomBox.style.filter="alpha(opacity=50)";this.zoomBox.style.opacity="0.50";this.zoomBox.style.fontSize="1px";this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.viewPortDiv.appendChild(this.zoomBox)}document.onselectstart=function(){return false};OpenLayers.Event.stop(a)},defaultMouseMove:function(g){this.mousePosition=g.xy.clone();if(this.mouseDragStart!=null){if(this.zoomBox){var e=Math.abs(this.mouseDragStart.x-g.xy.x);var b=Math.abs(this.mouseDragStart.y-g.xy.y);this.zoomBox.style.width=Math.max(1,e)+"px";this.zoomBox.style.height=Math.max(1,b)+"px";if(g.xy.x<this.mouseDragStart.x){this.zoomBox.style.left=g.xy.x+"px"}if(g.xy.y<this.mouseDragStart.y){this.zoomBox.style.top=g.xy.y+"px"}}else{var e=this.mouseDragStart.x-g.xy.x;var b=this.mouseDragStart.y-g.xy.y;var h=this.map.getSize();var a=new OpenLayers.Pixel(h.w/2+e,h.h/2+b);var d=this.map.getLonLatFromViewPortPx(a);this.map.setCenter(d,null,true);this.mouseDragStart=g.xy.clone();this.map.div.style.cursor="move"}this.performedDrag=true}},defaultMouseUp:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}if(this.zoomBox){this.zoomBoxEnd(a)}else{if(this.performedDrag){this.map.setCenter(this.map.center)}}document.onselectstart=null;this.mouseDragStart=null;this.map.div.style.cursor=""},defaultMouseOut:function(a){if(this.mouseDragStart!=null&&OpenLayers.Util.mouseLeft(a,this.map.div)){if(this.zoomBox){this.removeZoomBox()}this.mouseDragStart=null}},defaultWheelUp:function(a){if(this.map.getZoom()<=this.map.getNumZoomLevels()){this.map.setCenter(this.map.getLonLatFromPixel(a.xy),this.map.getZoom()+1)}},defaultWheelDown:function(a){if(this.map.getZoom()>0){this.map.setCenter(this.map.getLonLatFromPixel(a.xy),this.map.getZoom()-1)}},zoomBoxEnd:function(b){if(this.mouseDragStart!=null){if(Math.abs(this.mouseDragStart.x-b.xy.x)>5||Math.abs(this.mouseDragStart.y-b.xy.y)>5){var m=this.map.getLonLatFromViewPortPx(this.mouseDragStart);var a=this.map.getLonLatFromViewPortPx(b.xy);var l=Math.max(m.lat,a.lat);var d=Math.min(m.lat,a.lat);var h=Math.min(m.lon,a.lon);var e=Math.max(m.lon,a.lon);var g=new OpenLayers.Bounds(h,d,e,l);this.map.zoomToExtent(g)}else{var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(new OpenLayers.LonLat((a.lon),(a.lat)),this.map.getZoom()+1)}this.removeZoomBox()}},removeZoomBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null},onWheelEvent:function(d){var b=false;var a=OpenLayers.Event.element(d);while(a!=null){if(this.map&&a==this.map.div){b=true;break}a=a.parentNode}if(b){var g=0;if(!d){d=window.event}if(d.wheelDelta){g=d.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){g=-g}}else{if(d.detail){g=-d.detail/3}}if(g){d.xy=this.mousePosition;if(g<0){this.defaultWheelDown(d)}else{this.defaultWheelUp(d)}}OpenLayers.Event.stop(d)}},CLASS_NAME:"OpenLayers.Control.MouseDefaults"});OpenLayers.Control.MousePosition=OpenLayers.Class(OpenLayers.Control,{element:null,prefix:"",separator:", ",suffix:"",numDigits:5,granularity:10,lastXy:null,displayProjection:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){if(this.map){this.map.events.unregister("mousemove",this,this.redraw)}OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.left="";this.div.top="";this.element=this.div}this.redraw();return this.div},redraw:function(a){var d;if(a==null){d=new OpenLayers.LonLat(0,0)}else{if(this.lastXy==null||Math.abs(a.xy.x-this.lastXy.x)>this.granularity||Math.abs(a.xy.y-this.lastXy.y)>this.granularity){this.lastXy=a.xy;return}d=this.map.getLonLatFromPixel(a.xy);if(!d){return}if(this.displayProjection){d.transform(this.map.getProjectionObject(),this.displayProjection)}this.lastXy=a.xy}var b=this.formatOutput(d);if(b!=this.element.innerHTML){this.element.innerHTML=b}},formatOutput:function(b){var d=parseInt(this.numDigits);var a=this.prefix+b.lon.toFixed(d)+this.separator+b.lat.toFixed(d)+this.suffix;return a},setMap:function(){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.register("mousemove",this,this.redraw)},CLASS_NAME:"OpenLayers.Control.MousePosition"});OpenLayers.Control.Pan=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,direction:null,type:OpenLayers.Control.TYPE_BUTTON,initialize:function(b,a){this.direction=b;this.CLASS_NAME+=this.direction;OpenLayers.Control.prototype.initialize.apply(this,[a])},trigger:function(){switch(this.direction){case OpenLayers.Control.Pan.NORTH:this.map.pan(0,-this.slideFactor);break;case OpenLayers.Control.Pan.SOUTH:this.map.pan(0,this.slideFactor);break;case OpenLayers.Control.Pan.WEST:this.map.pan(-this.slideFactor,0);break;case OpenLayers.Control.Pan.EAST:this.map.pan(this.slideFactor,0);break}},CLASS_NAME:"OpenLayers.Control.Pan"});OpenLayers.Control.Pan.NORTH="North";OpenLayers.Control.Pan.SOUTH="South";OpenLayers.Control.Pan.EAST="East";OpenLayers.Control.Pan.WEST="West";OpenLayers.Control.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,slideRatio:null,buttons:null,position:null,initialize:function(a){this.position=new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,OpenLayers.Control.PanZoom.Y);OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);this.removeButtons();this.buttons=null;this.position=null},draw:function(b){OpenLayers.Control.prototype.draw.apply(this,arguments);b=this.position;this.buttons=[];var d=new OpenLayers.Size(18,18);var a=new OpenLayers.Pixel(b.x+d.w/2,b.y);this._addButton("panup","north-mini.png",a,d);b.y=a.y+d.h;this._addButton("panleft","west-mini.png",b,d);this._addButton("panright","east-mini.png",b.add(d.w,0),d);this._addButton("pandown","south-mini.png",a.add(0,d.h*2),d);this._addButton("zoomin","zoom-plus-mini.png",a.add(0,d.h*3+5),d);this._addButton("zoomworld","zoom-world-mini.png",a.add(0,d.h*4+5),d);this._addButton("zoomout","zoom-minus-mini.png",a.add(0,d.h*5+5),d);return this.div},_addButton:function(a,e,o,l){var h=OpenLayers.Util.getImagesLocation()+e;var b=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+a,o,l,h,"absolute");this.div.appendChild(b);OpenLayers.Event.observe(b,"mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,b));OpenLayers.Event.observe(b,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick,b));OpenLayers.Event.observe(b,"click",OpenLayers.Function.bindAsEventListener(this.doubleClick,b));b.action=a;b.map=this.map;if(!this.slideRatio){var d=this.slideFactor;var g=function(){return d}}else{var m=this.slideRatio;var g=function(p){return this.map.getSize()[p]*m}}b.getSlideFactor=g;this.buttons.push(b);return b},_removeButton:function(a){OpenLayers.Event.stopObservingElement(a);a.map=null;this.div.removeChild(a);OpenLayers.Util.removeItem(this.buttons,a)},removeButtons:function(){for(var a=this.buttons.length-1;a>=0;--a){this._removeButton(this.buttons[a])}},doubleClick:function(a){OpenLayers.Event.stop(a);return false},buttonDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}switch(this.action){case"panup":this.map.pan(0,-this.getSlideFactor("h"));break;case"pandown":this.map.pan(0,this.getSlideFactor("h"));break;case"panleft":this.map.pan(-this.getSlideFactor("w"),0);break;case"panright":this.map.pan(this.getSlideFactor("w"),0);break;case"zoomin":this.map.zoomIn();break;case"zoomout":this.map.zoomOut();break;case"zoomworld":this.map.zoomToMaxExtent();break}OpenLayers.Event.stop(a)},CLASS_NAME:"OpenLayers.Control.PanZoom"});OpenLayers.Control.PanZoom.X=4;OpenLayers.Control.PanZoom.Y=4;OpenLayers.Control.Panel=OpenLayers.Class(OpenLayers.Control,{controls:null,defaultControl:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.controls=[]},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);for(var a=this.controls.length-1;a>=0;a--){if(this.controls[a].events){this.controls[a].events.un({activate:this.redraw,deactivate:this.redraw,scope:this})}OpenLayers.Event.stopObservingElement(this.controls[a].panel_div);this.controls[a].panel_div=null}},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){for(var b=0,a=this.controls.length;b<a;b++){if(this.controls[b]==this.defaultControl){this.controls[b].activate()}}this.redraw();return true}else{return false}},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){for(var b=0,a=this.controls.length;b<a;b++){this.controls[b].deactivate()}return true}else{return false}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);for(var b=0,a=this.controls.length;b<a;b++){this.map.addControl(this.controls[b]);this.controls[b].deactivate();this.controls[b].events.on({activate:this.redraw,deactivate:this.redraw,scope:this})}this.activate();return this.div},redraw:function(){this.div.innerHTML="";if(this.active){for(var d=0,a=this.controls.length;d<a;d++){var b=this.controls[d].panel_div;if(this.controls[d].active){b.className=this.controls[d].displayClass+"ItemActive"}else{b.className=this.controls[d].displayClass+"ItemInactive"}this.div.appendChild(b)}}},activateControl:function(d){if(!this.active){return false}if(d.type==OpenLayers.Control.TYPE_BUTTON){d.trigger();this.redraw();return}if(d.type==OpenLayers.Control.TYPE_TOGGLE){if(d.active){d.deactivate()}else{d.activate()}this.redraw();return}for(var b=0,a=this.controls.length;b<a;b++){if(this.controls[b]!=d){if(this.controls[b].type!=OpenLayers.Control.TYPE_TOGGLE){this.controls[b].deactivate()}}}d.activate()},addControls:function(b){if(!(b instanceof Array)){b=[b]}this.controls=this.controls.concat(b);for(var e=0,a=b.length;e<a;e++){var d=document.createElement("div");var g=document.createTextNode(" ");b[e].panel_div=d;if(b[e].title!=""){b[e].panel_div.title=b[e].title}OpenLayers.Event.observe(b[e].panel_div,"click",OpenLayers.Function.bind(this.onClick,this,b[e]));OpenLayers.Event.observe(b[e].panel_div,"mousedown",OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop))}if(this.map){for(var e=0,a=b.length;e<a;e++){this.map.addControl(b[e]);b[e].deactivate();b[e].events.on({activate:this.redraw,deactivate:this.redraw,scope:this})}this.redraw()}},onClick:function(b,a){OpenLayers.Event.stop(a?a:window.event);this.activateControl(b)},getControlsBy:function(d,a){var e=(typeof a.test=="function");var b=OpenLayers.Array.filter(this.controls,function(g){return g[d]==a||(e&&a.test(g[d]))});return b},getControlsByName:function(a){return this.getControlsBy("name",a)},getControlsByClass:function(a){return this.getControlsBy("CLASS_NAME",a)},CLASS_NAME:"OpenLayers.Control.Panel"});OpenLayers.Control.Scale=OpenLayers.Class(OpenLayers.Control,{element:null,initialize:function(b,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.element=OpenLayers.Util.getElement(b)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.element=document.createElement("div");this.div.appendChild(this.element)}this.map.events.register("moveend",this,this.updateScale);this.updateScale();return this.div},updateScale:function(){var a=this.map.getScale();if(!a){return}if(a>=9500&&a<=950000){a=Math.round(a/1000)+"K"}else{if(a>=950000){a=Math.round(a/1000000)+"M"}else{a=Math.round(a)}}this.element.innerHTML=OpenLayers.i18n("scale",{scaleDenom:a})},CLASS_NAME:"OpenLayers.Control.Scale"});OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a])},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.eTop){this.div.style.display="block";this.div.style.position="absolute";this.eTop=document.createElement("div");this.eTop.className=this.displayClass+"Top";var a=this.topInUnits.length;this.div.appendChild(this.eTop);if((this.topOutUnits=="")||(this.topInUnits=="")){this.eTop.style.visibility="hidden"}else{this.eTop.style.visibility="visible"}this.eBottom=document.createElement("div");this.eBottom.className=this.displayClass+"Bottom";this.div.appendChild(this.eBottom);if((this.bottomOutUnits=="")||(this.bottomInUnits=="")){this.eBottom.style.visibility="hidden"}else{this.eBottom.style.visibility="visible"}}this.map.events.register("moveend",this,this.update);this.update();return this.div},getBarLen:function(b){var e=parseInt(Math.log(b)/Math.log(10));var a=Math.pow(10,e);var d=parseInt(b/a);var g;if(d>5){g=5}else{if(d>2){g=2}else{g=1}}return g*a},update:function(){var m=this.map.getResolution();if(!m){return}var r=this.map.getUnits();var d=OpenLayers.INCHES_PER_UNIT;var o=this.maxWidth*m*d[r];var a;var e;if(o>100000){a=this.topOutUnits;e=this.bottomOutUnits}else{a=this.topInUnits;e=this.bottomInUnits}var h=o/d[a];var p=o/d[e];var l=this.getBarLen(h);var g=this.getBarLen(p);h=l/d[r]*d[a];p=g/d[r]*d[e];var b=h/m;var q=p/m;if(this.eBottom.style.visibility=="visible"){this.eBottom.style.width=Math.round(q)+"px";this.eBottom.innerHTML=g+" "+e}if(this.eTop.style.visibility=="visible"){this.eTop.style.width=Math.round(b)+"px";this.eTop.innerHTML=l+" "+a}},CLASS_NAME:"OpenLayers.Control.ScaleLine"});OpenLayers.Control.ZoomIn=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){this.map.zoomIn()},CLASS_NAME:"OpenLayers.Control.ZoomIn"});OpenLayers.Control.ZoomOut=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){this.map.zoomOut()},CLASS_NAME:"OpenLayers.Control.ZoomOut"});OpenLayers.Control.ZoomToMaxExtent=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){if(this.map){this.map.zoomToMaxExtent()}},CLASS_NAME:"OpenLayers.Control.ZoomToMaxExtent"});OpenLayers.Event={observers:false,KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(a){return a.target||a.srcElement},isLeftClick:function(a){return(((a.which)&&(a.which==1))||((a.button)&&(a.button==1)))},isRightClick:function(a){return(((a.which)&&(a.which==3))||((a.button)&&(a.button==2)))},stop:function(b,a){if(!a){if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}}if(b.stopPropagation){b.stopPropagation()}else{b.cancelBubble=true}},findElement:function(d,b){var a=OpenLayers.Event.element(d);while(a.parentNode&&(!a.tagName||(a.tagName.toUpperCase()!=b.toUpperCase()))){a=a.parentNode}return a},observe:function(b,e,d,a){var g=OpenLayers.Util.getElement(b);a=a||false;if(e=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||g.attachEvent)){e="keydown"}if(!this.observers){this.observers={}}if(!g._eventCacheID){var h="eventCacheID_";if(g.id){h=g.id+"_"+h}g._eventCacheID=OpenLayers.Util.createUniqueID(h)}var l=g._eventCacheID;if(!this.observers[l]){this.observers[l]=[]}this.observers[l].push({element:g,name:e,observer:d,useCapture:a});if(g.addEventListener){g.addEventListener(e,d,a)}else{if(g.attachEvent){g.attachEvent("on"+e,d)}}},stopObservingElement:function(a){var b=OpenLayers.Util.getElement(a);var d=b._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[d])},_removeElementObservers:function(g){if(g){for(var b=g.length-1;b>=0;b--){var d=g[b];var a=new Array(d.element,d.name,d.observer,d.useCapture);var e=OpenLayers.Event.stopObserving.apply(this,a)}}},stopObserving:function(m,a,l,b){b=b||false;var h=OpenLayers.Util.getElement(m);var e=h._eventCacheID;if(a=="keypress"){if(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||h.detachEvent){a="keydown"}}var p=false;var d=OpenLayers.Event.observers[e];if(d){var g=0;while(!p&&g<d.length){var o=d[g];if((o.name==a)&&(o.observer==l)&&(o.useCapture==b)){d.splice(g,1);if(d.length==0){delete OpenLayers.Event.observers[e]}p=true;break}g++}}if(p){if(h.removeEventListener){h.removeEventListener(a,l,b)}else{if(h&&h.detachEvent){h.detachEvent("on"+a,l)}}}return p},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var a in OpenLayers.Event.observers){var b=OpenLayers.Event.observers[a];OpenLayers.Event._removeElementObservers.apply(this,[b])}OpenLayers.Event.observers=false}},CLASS_NAME:"OpenLayers.Event"};OpenLayers.Event.observe(window,"unload",OpenLayers.Event.unloadCache,false);if(window.Event){OpenLayers.Util.applyDefaults(window.Event,OpenLayers.Event)}else{var Event=OpenLayers.Event}OpenLayers.Events=OpenLayers.Class({BROWSER_EVENTS:["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur"],listeners:null,object:null,element:null,eventTypes:null,eventHandler:null,fallThrough:null,includeXY:false,clearMouseListener:null,initialize:function(d,g,l,h,b){OpenLayers.Util.extend(this,b);this.object=d;this.fallThrough=h;this.listeners={};this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this);this.clearMouseListener=OpenLayers.Function.bind(this.clearMouseCache,this);this.eventTypes=[];if(l!=null){for(var e=0,a=l.length;e<a;e++){this.addEventType(l[e])}}if(g!=null){this.attachToElement(g)}},destroy:function(){if(this.element){OpenLayers.Event.stopObservingElement(this.element);if(this.element.hasScrollEvent){OpenLayers.Event.stopObserving(window,"scroll",this.clearMouseListener)}}this.element=null;this.listeners=null;this.object=null;this.eventTypes=null;this.fallThrough=null;this.eventHandler=null},addEventType:function(a){if(!this.listeners[a]){this.eventTypes.push(a);this.listeners[a]=[]}},attachToElement:function(e){if(this.element){OpenLayers.Event.stopObservingElement(this.element)}this.element=e;for(var d=0,a=this.BROWSER_EVENTS.length;d<a;d++){var b=this.BROWSER_EVENTS[d];this.addEventType(b);OpenLayers.Event.observe(e,b,this.eventHandler)}OpenLayers.Event.observe(e,"dragstart",OpenLayers.Event.stop)},on:function(a){for(var b in a){if(b!="scope"){this.register(b,a.scope,a[b])}}},register:function(b,e,d){if((d!=null)&&(OpenLayers.Util.indexOf(this.eventTypes,b)!=-1)){if(e==null){e=this.object}var a=this.listeners[b];a.push({obj:e,func:d})}},registerPriority:function(b,e,d){if(d!=null){if(e==null){e=this.object}var a=this.listeners[b];if(a!=null){a.unshift({obj:e,func:d})}}},un:function(a){for(var b in a){if(b!="scope"){this.unregister(b,a.scope,a[b])}}},unregister:function(e,h,g){if(h==null){h=this.object}var d=this.listeners[e];if(d!=null){for(var b=0,a=d.length;b<a;b++){if(d[b].obj==h&&d[b].func==g){d.splice(b,1);break}}}},remove:function(a){if(this.listeners[a]!=null){this.listeners[a]=[]}},triggerEvent:function(g,b){var e=this.listeners[g];if(!e||e.length==0){return}if(b==null){b={}}b.object=this.object;b.element=this.element;if(!b.type){b.type=g}var e=e.slice(),h;for(var d=0,a=e.length;d<a;d++){var l=e[d];h=l.func.apply(l.obj,[b]);if((h!=undefined)&&(h==false)){break}}if(!this.fallThrough){OpenLayers.Event.stop(b,true)}return h},handleBrowserEvent:function(a){if(this.includeXY){a.xy=this.getMousePosition(a)}this.triggerEvent(a.type,a)},clearMouseCache:function(){this.element.scrolls=null;this.element.lefttop=null;this.element.offsets=null},getMousePosition:function(a){if(!this.includeXY){this.clearMouseCache()}else{if(!this.element.hasScrollEvent){OpenLayers.Event.observe(window,"scroll",this.clearMouseListener);this.element.hasScrollEvent=true}}if(!this.element.scrolls){this.element.scrolls=[(document.documentElement.scrollLeft||document.body.scrollLeft),(document.documentElement.scrollTop||document.body.scrollTop)]}if(!this.element.lefttop){this.element.lefttop=[(document.documentElement.clientLeft||0),(document.documentElement.clientTop||0)]}if(!this.element.offsets){this.element.offsets=OpenLayers.Util.pagePosition(this.element);this.element.offsets[0]+=this.element.scrolls[0];this.element.offsets[1]+=this.element.scrolls[1]}return new OpenLayers.Pixel((a.clientX+this.element.scrolls[0])-this.element.offsets[0]-this.element.lefttop[0],(a.clientY+this.element.scrolls[1])-this.element.offsets[1]-this.element.lefttop[1])},CLASS_NAME:"OpenLayers.Events"});OpenLayers.Format=OpenLayers.Class({options:null,externalProjection:null,internalProjection:null,data:null,keepData:false,initialize:function(a){OpenLayers.Util.extend(this,a);this.options=a},destroy:function(){},read:function(a){OpenLayers.Console.userError(OpenLayers.i18n("readNotImplemented"))},write:function(a){OpenLayers.Console.userError(OpenLayers.i18n("writeNotImplemented"))},CLASS_NAME:"OpenLayers.Format"});OpenLayers.Lang.en={unhandledRequest:"Unhandled request return ${statusText}",permalink:"Permalink",overlays:"Overlays",baseLayer:"Base Layer",sameProjection:"The overview map only works when it is in the same projection as the main map",readNotImplemented:"Read not implemented.",writeNotImplemented:"Write not implemented.",noFID:"Can't update a feature for which there is no FID.",errorLoadingGML:"Error in loading GML file ${url}",browserNotSupported:"Your browser does not support vector rendering. Currently supported renderers are:\n${renderers}",componentShouldBe:"addFeatures : component should be an ${geomType}",getFeatureError:"getFeatureFromEvent called on layer with no renderer. This usually means you destroyed a layer, but not some handler which is associated with it.",minZoomLevelError:"The minZoomLevel property is only intended for use with the FixedZoomLevels-descendent layers. That this wfs layer checks for minZoomLevel is a relic of thepast. We cannot, however, remove it without possibly breaking OL based applications that may depend on it. Therefore we are deprecating it -- the minZoomLevel check below will be removed at 3.0. Please instead use min/max resolution setting as described here: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"WFS Transaction: SUCCESS ${response}",commitFailed:"WFS Transaction: FAILED ${response}",googleWarning:"The Google Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the Google Maps library script was either not included, or does not contain the correct API key for your site.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>click here</a>",getLayerWarning:"The ${layerType} Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the ${layerLib} library script was not correctly included.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>click here</a>",scale:"Scale = 1 : ${scaleDenom}",layerAlreadyAdded:"You tried to add the layer: ${layerName} to the map, but it has already been added",reprojectDeprecated:"You are using the 'reproject' option on the ${layerName} layer. This option is deprecated: its use was designed to support displaying data over commercial basemaps, but that functionality should now be achieved by using Spherical Mercator support. More information is available from http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"This method has been deprecated and will be removed in 3.0. Please use ${newMethod} instead.",boundsAddError:"You must pass both x and y values to the add function.",lonlatAddError:"You must pass both lon and lat values to the add function.",pixelAddError:"You must pass both x and y values to the add function.",unsupportedGeometryType:"Unsupported geometry type: ${geomType}",pagePositionFailed:"OpenLayers.Util.pagePosition failed: element with id ${elemId} may be misplaced.",end:"",filterEvaluateNotImplemented:"evaluate is not implemented for this filter type."};OpenLayers.Popup.AnchoredBubble=OpenLayers.Class(OpenLayers.Popup.Anchored,{rounded:false,initialize:function(l,d,h,b,a,g,e){this.padding=new OpenLayers.Bounds(0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE,0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments)},draw:function(a){OpenLayers.Popup.Anchored.prototype.draw.apply(this,arguments);this.setContentHTML();this.setBackgroundColor();this.setOpacity();return this.div},updateRelativePosition:function(){this.setRicoCorners()},setSize:function(a){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.setRicoCorners()},setBackgroundColor:function(a){if(a!=undefined){this.backgroundColor=a}if(this.div!=null){if(this.contentDiv!=null){this.div.style.background="transparent";OpenLayers.Rico.Corner.changeColor(this.groupDiv,this.backgroundColor)}}},setOpacity:function(a){OpenLayers.Popup.Anchored.prototype.setOpacity.call(this,a);if(this.div!=null){if(this.groupDiv!=null){OpenLayers.Rico.Corner.changeOpacity(this.groupDiv,this.opacity)}}},setBorder:function(a){this.border=0},setRicoCorners:function(){var a=this.getCornersToRound(this.relativePosition);var b={corners:a,color:this.backgroundColor,bgColor:"transparent",blend:false};if(!this.rounded){OpenLayers.Rico.Corner.round(this.div,b);this.rounded=true}else{OpenLayers.Rico.Corner.reRound(this.groupDiv,b);this.setBackgroundColor();this.setOpacity()}},getCornersToRound:function(){var a=["tl","tr","bl","br"];var b=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);OpenLayers.Util.removeItem(a,b);return a.join(" ")},CLASS_NAME:"OpenLayers.Popup.AnchoredBubble"});OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5;OpenLayers.Popup.Framed=OpenLayers.Class(OpenLayers.Popup.Anchored,{imageSrc:null,imageSize:null,isAlphaImage:false,positionBlocks:null,blocks:null,fixedRelativePosition:false,initialize:function(l,d,h,b,a,g,e){OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments);if(this.fixedRelativePosition){this.updateRelativePosition();this.calculateRelativePosition=function(m){return this.relativePosition}}this.contentDiv.style.position="absolute";this.contentDiv.style.zIndex=1;if(g){this.closeDiv.style.zIndex=1}this.groupDiv.style.position="absolute";this.groupDiv.style.top="0px";this.groupDiv.style.left="0px";this.groupDiv.style.height="100%";this.groupDiv.style.width="100%"},destroy:function(){this.imageSrc=null;this.imageSize=null;this.isAlphaImage=null;this.fixedRelativePosition=false;this.positionBlocks=null;for(var a=0;a<this.blocks.length;a++){var b=this.blocks[a];if(b.image){b.div.removeChild(b.image)}b.image=null;if(b.div){this.groupDiv.removeChild(b.div)}b.div=null}this.blocks=null;OpenLayers.Popup.Anchored.prototype.destroy.apply(this,arguments)},setBackgroundColor:function(a){},setBorder:function(){},setOpacity:function(a){},setSize:function(a){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.updateBlocks()},updateRelativePosition:function(){this.padding=this.positionBlocks[this.relativePosition].padding;if(this.closeDiv){var a=this.getContentDivPadding();this.closeDiv.style.right=a.right+this.padding.right+"px";this.closeDiv.style.top=a.top+this.padding.top+"px"}this.updateBlocks()},calculateNewPx:function(a){var b=OpenLayers.Popup.Anchored.prototype.calculateNewPx.apply(this,arguments);b=b.offset(this.positionBlocks[this.relativePosition].offset);return b},createBlocks:function(){this.blocks=[];var h=null;for(var g in this.positionBlocks){h=g;break}var a=this.positionBlocks[h];for(var e=0;e<a.blocks.length;e++){var m={};this.blocks.push(m);var b=this.id+"_FrameDecorationDiv_"+e;m.div=OpenLayers.Util.createDiv(b,null,null,null,"absolute",null,"hidden",null);var d=this.id+"_FrameDecorationImg_"+e;var l=(this.isAlphaImage)?OpenLayers.Util.createAlphaImageDiv:OpenLayers.Util.createImage;m.image=l(d,null,this.imageSize,this.imageSrc,"absolute",null,null,null);m.div.appendChild(m.image);this.groupDiv.appendChild(m.div)}},updateBlocks:function(){if(!this.blocks){this.createBlocks()}if(this.size&&this.relativePosition){var p=this.positionBlocks[this.relativePosition];for(var m=0;m<p.blocks.length;m++){var d=p.blocks[m];var g=this.blocks[m];var e=d.anchor.left;var q=d.anchor.bottom;var a=d.anchor.right;var u=d.anchor.top;var s=(isNaN(d.size.w))?this.size.w-(a+e):d.size.w;var o=(isNaN(d.size.h))?this.size.h-(q+u):d.size.h;g.div.style.width=(s<0?0:s)+"px";g.div.style.height=(o<0?0:o)+"px";g.div.style.left=(e!=null)?e+"px":"";g.div.style.bottom=(q!=null)?q+"px":"";g.div.style.right=(a!=null)?a+"px":"";g.div.style.top=(u!=null)?u+"px":"";g.image.style.left=d.position.x+"px";g.image.style.top=d.position.y+"px"}this.contentDiv.style.left=this.padding.left+"px";this.contentDiv.style.top=this.padding.top+"px"}},CLASS_NAME:"OpenLayers.Popup.Framed"});OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,initialize:function(b,a){OpenLayers.Util.extend(this,a);this.projCode=b;if(window.Proj4js){this.proj=new Proj4js.Proj(b)}},getCode:function(){return this.proj?this.proj.srsCode:this.projCode},getUnits:function(){return this.proj?this.proj.units:null},toString:function(){return this.getCode()},equals:function(a){if(a&&a.getCode){return this.getCode()==a.getCode()}else{return false}},destroy:function(){delete this.proj;delete this.projCode},CLASS_NAME:"OpenLayers.Projection"});OpenLayers.Projection.transforms={};OpenLayers.Projection.addTransform=function(d,b,a){if(!OpenLayers.Projection.transforms[d]){OpenLayers.Projection.transforms[d]={}}OpenLayers.Projection.transforms[d][b]=a};OpenLayers.Projection.transform=function(a,d,b){if(d.proj&&b.proj){a=Proj4js.transform(d.proj,b.proj,a)}else{if(d&&b&&OpenLayers.Projection.transforms[d.getCode()]&&OpenLayers.Projection.transforms[d.getCode()][b.getCode()]){OpenLayers.Projection.transforms[d.getCode()][b.getCode()](a)}}return a};OpenLayers.Protocol.WFS.v1=OpenLayers.Class(OpenLayers.Protocol,{version:null,srsName:"EPSG:4326",featureType:null,featureNS:null,geometryName:"the_geom",schema:null,featurePrefix:"feature",formatOptions:null,initialize:function(b){OpenLayers.Protocol.prototype.initialize.apply(this,[b]);if(!b.format){this.format=OpenLayers.Format.WFST(OpenLayers.Util.extend({version:this.version,featureType:this.featureType,featureNS:this.featureNS,featurePrefix:this.featurePrefix,geometryName:this.geometryName,srsName:this.srsName,schema:this.schema},this.formatOptions))}if(!this.featureNS){var a=this.format.readNode;this.format.readNode=function(d,e){if(!this.featureNS&&d.prefix==this.featurePrefix){this.featureNS=d.namespaceURI;this.setNamespace("feature",this.featureNS)}return a.apply(this,arguments)}}},destroy:function(){if(this.options&&!this.options.format){this.format.destroy()}this.format=null;OpenLayers.Protocol.prototype.destroy.apply(this)},createCallback:function(d,a,b){return OpenLayers.Function.bind(function(){d.apply(this,[a,b])},this)},read:function(b){b=OpenLayers.Util.extend({},b);OpenLayers.Util.applyDefaults(b,this.options||{});var a=new OpenLayers.Protocol.Response({requestType:"read"});var d=OpenLayers.Format.XML.prototype.write.apply(this.format,[this.format.writeNode("wfs:GetFeature",b)]);a.priv=OpenLayers.Request.POST({url:b.url,callback:this.createCallback(this.handleRead,a,b),params:b.params,headers:b.headers,data:d});return a},handleRead:function(a,b){if(b.callback){var d=a.priv;if(d.status>=200&&d.status<300){a.features=this.parseFeatures(d);a.code=OpenLayers.Protocol.Response.SUCCESS}else{a.code=OpenLayers.Protocol.Response.FAILURE}b.callback.call(b.scope,a)}},parseFeatures:function(a){var b=a.responseXML;if(!b||!b.documentElement){b=a.responseText}if(!b||b.length<=0){return null}return this.format.read(b)},commit:function(d,b){b=OpenLayers.Util.extend({},b);OpenLayers.Util.applyDefaults(b,this.options);var a=new OpenLayers.Protocol.Response({requestType:"commit",reqFeatures:d});a.priv=OpenLayers.Request.POST({url:b.url,data:this.format.write(d,b),callback:this.createCallback(this.handleCommit,a,b)});return a},handleCommit:function(a,b){if(b.callback){var d=a.priv;var e=d.responseXML;if(!e||!e.documentElement){e=d.responseText}var g=this.format.read(e)||{};a.insertIds=g.insertIds||[];a.code=(g.success)?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE;b.callback.call(b.scope,a)}},filterDelete:function(g,d){d=OpenLayers.Util.extend({},d);OpenLayers.Util.applyDefaults(d,this.options);var b=new OpenLayers.Protocol.Response({requestType:"commit"});var a=this.format.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version}});var e=this.format.createElementNSPlus("wfs:Delete",{attributes:{typeName:(d.featureNS?this.featurePrefix+":":"")+d.featureType}});if(d.featureNS){e.setAttribute("xmlns:"+this.featurePrefix,d.featureNS)}var l=this.format.writeNode("ogc:Filter",g);e.appendChild(l);a.appendChild(e);var h=OpenLayers.Format.XML.prototype.write.apply(this.format,[a]);return OpenLayers.Request.POST({url:this.url,callback:d.callback||function(){},data:h})},abort:function(a){if(a){a.priv.abort()}},CLASS_NAME:"OpenLayers.Protocol.WFS.v1"});OpenLayers.Renderer.SVG=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"http://www.w3.org/2000/svg",xlinkns:"http://www.w3.org/1999/xlink",MAX_PIXEL:15000,translationParameters:null,symbolSize:{},isGecko:null,initialize:function(a){if(!this.supported()){return}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);this.translationParameters={x:0,y:0};this.isGecko=(navigator.userAgent.toLowerCase().indexOf("gecko/")!=-1)},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){var a="http://www.w3.org/TR/SVG11/feature#";return(document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(a+"SVG","1.1")||document.implementation.hasFeature(a+"BasicStructure","1.1")))},inValidRange:function(a,g,b){var e=a+(b?0:this.translationParameters.x);var d=g+(b?0:this.translationParameters.y);return(e>=-this.MAX_PIXEL&&e<=this.MAX_PIXEL&&d>=-this.MAX_PIXEL&&d<=this.MAX_PIXEL)},setExtent:function(b,e){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var a=this.getResolution();var h=-b.left/a;var g=b.top/a;if(e){this.left=h;this.top=g;var d="0 0 "+this.size.w+" "+this.size.h;this.rendererRoot.setAttributeNS(null,"viewBox",d);this.translate(0,0);return true}else{var l=this.translate(h-this.left,g-this.top);if(!l){this.setExtent(b,true)}return l}},translate:function(a,d){if(!this.inValidRange(a,d,true)){return false}else{var b="";if(a||d){b="translate("+a+","+d+")"}this.root.setAttributeNS(null,"transform",b);this.translationParameters={x:a,y:d};return true}},setSize:function(a){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);this.rendererRoot.setAttributeNS(null,"width",this.size.w);this.rendererRoot.setAttributeNS(null,"height",this.size.h)},getNodeType:function(d,b){var a=null;switch(d.CLASS_NAME){case"OpenLayers.Geometry.Point":if(b.externalGraphic){a="image"}else{if(this.isComplexSymbol(b.graphicName)){a="use"}else{a="circle"}}break;case"OpenLayers.Geometry.Rectangle":a="rect";break;case"OpenLayers.Geometry.LineString":a="polyline";break;case"OpenLayers.Geometry.LinearRing":a="polygon";break;case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":a="path";break;default:break}return a},setStyle:function(u,z,b){z=z||u._style;b=b||u._options;var o=parseFloat(u.getAttributeNS(null,"r"));var m=1;var e;if(u._geometryClass=="OpenLayers.Geometry.Point"&&o){u.style.visibility="";if(z.graphic===false){u.style.visibility="hidden"}else{if(z.externalGraphic){e=this.getPosition(u);if(z.graphicTitle){u.setAttributeNS(null,"title",z.graphicTitle)}if(z.graphicWidth&&z.graphicHeight){u.setAttributeNS(null,"preserveAspectRatio","none")}var t=z.graphicWidth||z.graphicHeight;var q=z.graphicHeight||z.graphicWidth;t=t?t:z.pointRadius*2;q=q?q:z.pointRadius*2;var B=(z.graphicXOffset!=undefined)?z.graphicXOffset:-(0.5*t);var g=(z.graphicYOffset!=undefined)?z.graphicYOffset:-(0.5*q);var a=z.graphicOpacity||z.fillOpacity;u.setAttributeNS(null,"x",(e.x+B).toFixed());u.setAttributeNS(null,"y",(e.y+g).toFixed());u.setAttributeNS(null,"width",t);u.setAttributeNS(null,"height",q);u.setAttributeNS(this.xlinkns,"href",z.externalGraphic);u.setAttributeNS(null,"style","opacity: "+a)}else{if(this.isComplexSymbol(z.graphicName)){var d=z.pointRadius*3;var p=d*2;var s=this.importSymbol(z.graphicName);var w="#"+s;e=this.getPosition(u);m=this.symbolSize[s]/p;var h=u.parentNode;var l=u.nextSibling;if(h){h.removeChild(u)}u.setAttributeNS(this.xlinkns,"href",w);u.setAttributeNS(null,"width",p);u.setAttributeNS(null,"height",p);u.setAttributeNS(null,"x",e.x-d);u.setAttributeNS(null,"y",e.y-d);if(l){h.insertBefore(u,l)}else{if(h){h.appendChild(u)}}}else{u.setAttributeNS(null,"r",z.pointRadius)}}}if(typeof z.rotation!="undefined"&&e){var v=OpenLayers.String.format("rotate(${0} ${1} ${2})",[z.rotation,e.x,e.y]);u.setAttributeNS(null,"transform",v)}}if(b.isFilled){u.setAttributeNS(null,"fill",z.fillColor);u.setAttributeNS(null,"fill-opacity",z.fillOpacity)}else{u.setAttributeNS(null,"fill","none")}if(b.isStroked){u.setAttributeNS(null,"stroke",z.strokeColor);u.setAttributeNS(null,"stroke-opacity",z.strokeOpacity);u.setAttributeNS(null,"stroke-width",z.strokeWidth*m);u.setAttributeNS(null,"stroke-linecap",z.strokeLinecap);u.setAttributeNS(null,"stroke-linejoin","round");u.setAttributeNS(null,"stroke-dasharray",this.dashStyle(z,m))}else{u.setAttributeNS(null,"stroke","none")}if(z.pointerEvents){u.setAttributeNS(null,"pointer-events",z.pointerEvents)}if(z.cursor!=null){u.setAttributeNS(null,"cursor",z.cursor)}return u},dashStyle:function(d,b){var a=d.strokeWidth*b;switch(d.strokeDashstyle){case"solid":return"none";case"dot":return[1,4*a].join();case"dash":return[4*a,4*a].join();case"dashdot":return[4*a,4*a,1,4*a].join();case"longdash":return[8*a,4*a].join();case"longdashdot":return[8*a,4*a,1,4*a].join();default:return d.strokeDashstyle.replace(/ /g,",")}},createNode:function(a,d){var b=document.createElementNS(this.xmlns,a);if(d){b.setAttributeNS(null,"id",d)}return b},nodeTypeCompare:function(b,a){return(a==b.nodeName)},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_svgRoot","svg")},createRoot:function(a){return this.nodeFactory(this.container.id+a,"g")},createDefs:function(){var a=this.nodeFactory(this.container.id+"_defs","defs");this.rendererRoot.appendChild(a);return a},drawPoint:function(a,b){return this.drawCircle(a,b,1)},drawCircle:function(e,g,b){var d=this.getResolution();var a=(g.x/d+this.left);var h=(this.top-g.y/d);if(this.inValidRange(a,h)){e.setAttributeNS(null,"cx",a);e.setAttributeNS(null,"cy",h);e.setAttributeNS(null,"r",b);return e}else{return false}},drawLineString:function(b,d){var a=this.getComponentsString(d.components);if(a.path){b.setAttributeNS(null,"points",a.path);return(a.complete?b:null)}else{return false}},drawLinearRing:function(b,d){var a=this.getComponentsString(d.components);if(a.path){b.setAttributeNS(null,"points",a.path);return(a.complete?b:null)}else{return false}},drawPolygon:function(b,m){var l="";var o=true;var a=true;var e,p;for(var g=0,h=m.components.length;g<h;g++){l+=" M";e=this.getComponentsString(m.components[g].components," ");p=e.path;if(p){l+=" "+p;a=e.complete&&a}else{o=false}}l+=" z";if(o){b.setAttributeNS(null,"d",l);b.setAttributeNS(null,"fill-rule","evenodd");return a?b:null}else{return false}},drawRectangle:function(d,e){var b=this.getResolution();var a=(e.x/b+this.left);var g=(this.top-e.y/b);if(this.inValidRange(a,g)){d.setAttributeNS(null,"x",a);d.setAttributeNS(null,"y",g);d.setAttributeNS(null,"width",e.width/b);d.setAttributeNS(null,"height",e.height/b);return d}else{return false}},drawSurface:function(h,m){var l=null;var b=true;for(var g=0,a=m.components.length;g<a;g++){if((g%3)==0&&(g/3)==0){var e=this.getShortString(m.components[g]);if(!e){b=false}l="M "+e}else{if((g%3)==1){var e=this.getShortString(m.components[g]);if(!e){b=false}l+=" C "+e}else{var e=this.getShortString(m.components[g]);if(!e){b=false}l+=" "+e}}}l+=" Z";if(b){h.setAttributeNS(null,"d",l);return h}else{return false}},drawText:function(d,a,o){var b=this.getResolution();var m=(o.x/b+this.left);var g=(o.y/b-this.top);var l=this.nodeFactory(d+this.LABEL_ID_SUFFIX,"text");var h=this.nodeFactory(d+this.LABEL_ID_SUFFIX+"_tspan","tspan");l.setAttributeNS(null,"x",m);l.setAttributeNS(null,"y",-g);l.setAttributeNS(null,"pointer-events","none");if(a.fontColor){l.setAttributeNS(null,"fill",a.fontColor)}if(a.fontFamily){l.setAttributeNS(null,"font-family",a.fontFamily)}if(a.fontSize){l.setAttributeNS(null,"font-size",a.fontSize)}if(a.fontWeight){l.setAttributeNS(null,"font-weight",a.fontWeight)}var e=a.labelAlign||"cm";l.setAttributeNS(null,"text-anchor",OpenLayers.Renderer.SVG.LABEL_ALIGN[e[0]]||"middle");if(this.isGecko){l.setAttributeNS(null,"dominant-baseline",OpenLayers.Renderer.SVG.LABEL_ALIGN[e[1]]||"central")}else{h.setAttributeNS(null,"baseline-shift",OpenLayers.Renderer.SVG.LABEL_VSHIFT[e[1]]||"-35%")}h.textContent=a.label;if(!l.parentNode){l.appendChild(h);this.textRoot.appendChild(l)}},getComponentsString:function(g,e){var l=[];var a=true;var h=g.length;var p=[];var m,o,b;for(var d=0;d<h;d++){o=g[d];l.push(o);m=this.getShortString(o);if(m){p.push(m)}else{if(d>0){if(this.getShortString(g[d-1])){p.push(this.clipLine(g[d],g[d-1]))}}if(d<h-1){if(this.getShortString(g[d+1])){p.push(this.clipLine(g[d],g[d+1]))}}a=false}}return{path:p.join(e||","),complete:a}},clipLine:function(g,m){if(m.equals(g)){return""}var h=this.getResolution();var b=this.MAX_PIXEL-this.translationParameters.x;var a=this.MAX_PIXEL-this.translationParameters.y;var e=m.x/h+this.left;var p=this.top-m.y/h;var d=g.x/h+this.left;var o=this.top-g.y/h;var l;if(d<-b||d>b){l=(o-p)/(d-e);d=d<0?-b:b;o=p+(d-e)*l}if(o<-a||o>a){l=(d-e)/(o-p);o=o<0?-a:a;d=e+(o-p)*l}return d+","+o},getShortString:function(b){var d=this.getResolution();var a=(b.x/d+this.left);var e=(this.top-b.y/d);if(this.inValidRange(a,e)){return a+","+e}else{return false}},getPosition:function(a){return({x:parseFloat(a.getAttributeNS(null,"cx")),y:parseFloat(a.getAttributeNS(null,"cy"))})},importSymbol:function(g){if(!this.defs){this.defs=this.createDefs()}var b=this.container.id+"-"+g;if(document.getElementById(b)!=null){return b}var e=OpenLayers.Renderer.symbol[g];if(!e){throw new Error(g+" is not a valid symbol name");return}var l=this.nodeFactory(b,"symbol");var d=this.nodeFactory(null,"polygon");l.appendChild(d);var r=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var p="";var o,m;for(var h=0;h<e.length;h=h+2){o=e[h];m=e[h+1];r.left=Math.min(r.left,o);r.bottom=Math.min(r.bottom,m);r.right=Math.max(r.right,o);r.top=Math.max(r.top,m);p+=" "+o+","+m}d.setAttributeNS(null,"points",p);var a=r.getWidth();var q=r.getHeight();var s=[r.left-a,r.bottom-q,a*3,q*3];l.setAttributeNS(null,"viewBox",s.join(" "));this.symbolSize[b]=Math.max(a,q)*3;this.defs.appendChild(l);return l.id},CLASS_NAME:"OpenLayers.Renderer.SVG"});OpenLayers.Renderer.SVG.LABEL_ALIGN={l:"start",r:"end",b:"bottom",t:"hanging"};OpenLayers.Renderer.SVG.LABEL_VSHIFT={t:"-70%",b:"0"};OpenLayers.Renderer.VML=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"urn:schemas-microsoft-com:vml",symbolCache:{},offset:null,initialize:function(b){if(!this.supported()){return}if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);var g=document.createStyleSheet();var d=["shape","rect","oval","fill","stroke","imagedata","group","textbox"];for(var e=0,a=d.length;e<a;e++){g.addRule("olv\\:"+d[e],"behavior: url(#default#VML); position: absolute; display: inline-block;")}}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);this.offset={x:0,y:0}},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){return !!(document.namespaces)},setExtent:function(o,a){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var d=this.getResolution();var b=o.left/d;var h=o.top/d-this.size.h;if(a){this.offset={x:b,y:h};b=0;h=0}else{b=b-this.offset.x;h=h-this.offset.y}var q=b+" "+h;this.root.coordorigin=q;var m=[this.root,this.vectorRoot,this.textRoot];var l;for(var e=0,g=m.length;e<g;++e){l=m[e];var p=this.size.w+" "+this.size.h;l.coordsize=p}this.root.style.flip="y";return true},setSize:function(l){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);var e=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot];var d=this.size.w+"px";var m=this.size.h+"px";var b;for(var g=0,a=e.length;g<a;++g){b=e[g];b.style.width=d;b.style.height=m}},getNodeType:function(d,b){var a=null;switch(d.CLASS_NAME){case"OpenLayers.Geometry.Point":if(b.externalGraphic){a="olv:rect"}else{if(this.isComplexSymbol(b.graphicName)){a="olv:shape"}else{a="olv:oval"}}break;case"OpenLayers.Geometry.Rectangle":a="olv:rect";break;case"OpenLayers.Geometry.LineString":case"OpenLayers.Geometry.LinearRing":case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":a="olv:shape";break;default:break}return a},setStyle:function(e,b,v,q){b=b||e._style;v=v||e._options;var o=1;if(e._geometryClass=="OpenLayers.Geometry.Point"){if(b.externalGraphic){if(b.graphicTitle){e.title=b.graphicTitle}var d=b.graphicWidth||b.graphicHeight;var r=b.graphicHeight||b.graphicWidth;d=d?d:b.pointRadius*2;r=r?r:b.pointRadius*2;var h=this.getResolution();var m=(b.graphicXOffset!=undefined)?b.graphicXOffset:-(0.5*d);var g=(b.graphicYOffset!=undefined)?b.graphicYOffset:-(0.5*r);e.style.left=((q.x/h-this.offset.x)+m).toFixed();e.style.top=((q.y/h-this.offset.y)-(g+r)).toFixed();e.style.width=d+"px";e.style.height=r+"px";e.style.flip="y";b.fillColor="none";v.isStroked=false}else{if(this.isComplexSymbol(b.graphicName)){var a=this.importSymbol(b.graphicName);e.path=a.path;e.coordorigin=a.left+","+a.bottom;var u=a.size;e.coordsize=u+","+u;this.drawCircle(e,q,b.pointRadius);e.style.flip="y"}else{this.drawCircle(e,q,b.pointRadius)}}}if(v.isFilled){e.fillcolor=b.fillColor}else{e.filled="false"}var p=e.getElementsByTagName("fill");var t=(p.length==0)?null:p[0];if(!v.isFilled){if(t){e.removeChild(t)}}else{if(!t){t=this.createNode("olv:fill",e.id+"_fill")}t.opacity=b.fillOpacity;if(e._geometryClass=="OpenLayers.Geometry.Point"&&b.externalGraphic){if(b.graphicOpacity){t.opacity=b.graphicOpacity}t.src=b.externalGraphic;t.type="frame";if(!(b.graphicWidth&&b.graphicHeight)){t.aspect="atmost"}}if(t.parentNode!=e){e.appendChild(t)}}if(typeof b.rotation!="undefined"){if(b.externalGraphic){this.graphicRotate(e,m,g);t.opacity=0}else{e.style.rotation=b.rotation}}if(v.isStroked){e.strokecolor=b.strokeColor;e.strokeweight=b.strokeWidth+"px"}else{e.stroked=false}var l=e.getElementsByTagName("stroke");var s=(l.length==0)?null:l[0];if(!v.isStroked){if(s){e.removeChild(s)}}else{if(!s){s=this.createNode("olv:stroke",e.id+"_stroke");e.appendChild(s)}s.opacity=b.strokeOpacity;s.endcap=!b.strokeLinecap||b.strokeLinecap=="butt"?"flat":b.strokeLinecap;s.dashstyle=this.dashStyle(b)}if(b.cursor!="inherit"&&b.cursor!=null){e.style.cursor=b.cursor}return e},graphicRotate:function(t,z,h){var w=w||t._style;var e=t._options;var a,p;if(!(w.graphicWidth&&w.graphicHeight)){var B=new Image();B.onreadystatechange=OpenLayers.Function.bind(function(){if(B.readyState=="complete"||B.readyState=="interactive"){a=B.width/B.height;p=Math.max(w.pointRadius*2,w.graphicWidth||0,w.graphicHeight||0);z=z*a;w.graphicWidth=p*a;w.graphicHeight=p;this.graphicRotate(t,z,h)}},this);B.src=w.externalGraphic;return}else{p=Math.max(w.graphicWidth,w.graphicHeight);a=w.graphicWidth/w.graphicHeight}var s=Math.round(w.graphicWidth||p*a);var q=Math.round(w.graphicHeight||p);t.style.width=s+"px";t.style.height=q+"px";var r=document.getElementById(t.id+"_image");if(!r){r=this.createNode("olv:imagedata",t.id+"_image");t.appendChild(r)}r.style.width=s+"px";r.style.height=q+"px";r.src=w.externalGraphic;r.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";var u=w.rotation*Math.PI/180;var m=Math.sin(u);var g=Math.cos(u);var l="progid:DXImageTransform.Microsoft.Matrix(M11="+g+",M12="+(-m)+",M21="+m+",M22="+g+",SizingMethod='auto expand')\n";var b=w.graphicOpacity||w.fillOpacity;if(b&&b!=1){l+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+b+")\n"}t.style.filter=l;var v=new OpenLayers.Geometry.Point(-z,-h);var d=new OpenLayers.Bounds(0,0,s,q).toGeometry();d.rotate(w.rotation,v);var o=d.getBounds();t.style.left=Math.round(parseInt(t.style.left)+o.left)+"px";t.style.top=Math.round(parseInt(t.style.top)-o.bottom)+"px"},postDraw:function(a){var d=a._style.fillColor;var b=a._style.strokeColor;if(d=="none"&&a.fillcolor!=d){a.fillcolor=d}if(b=="none"&&a.strokecolor!=b){a.strokecolor=b}},setNodeDimension:function(b,g){var e=g.getBounds();if(e){var a=this.getResolution();var d=new OpenLayers.Bounds((e.left/a-this.offset.x).toFixed(),(e.bottom/a-this.offset.y).toFixed(),(e.right/a-this.offset.x).toFixed(),(e.top/a-this.offset.y).toFixed());b.style.left=d.left+"px";b.style.top=d.top+"px";b.style.width=d.getWidth()+"px";b.style.height=d.getHeight()+"px";b.coordorigin=d.left+" "+d.top;b.coordsize=d.getWidth()+" "+d.getHeight()}},dashStyle:function(a){var d=a.strokeDashstyle;switch(d){case"solid":case"dot":case"dash":case"dashdot":case"longdash":case"longdashdot":return d;default:var b=d.split(/[ ,]/);if(b.length==2){if(1*b[0]>=2*b[1]){return"longdash"}return(b[0]==1||b[1]==1)?"dot":"dash"}else{if(b.length==4){return(1*b[0]>=2*b[1])?"longdashdot":"dashdot"}}return"solid"}},createNode:function(a,d){var b=document.createElement(a);if(d){b.id=d}b.unselectable="on";b.onselectstart=function(){return(false)};return b},nodeTypeCompare:function(d,b){var e=b;var a=e.indexOf(":");if(a!=-1){e=e.substr(a+1)}var g=d.nodeName;a=g.indexOf(":");if(a!=-1){g=g.substr(a+1)}return(e==g)},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_vmlRoot","div")},createRoot:function(a){return this.nodeFactory(this.container.id+a,"olv:group")},drawPoint:function(a,b){return this.drawCircle(a,b,1)},drawCircle:function(e,g,a){if(!isNaN(g.x)&&!isNaN(g.y)){var b=this.getResolution();e.style.left=((g.x/b-this.offset.x).toFixed()-a)+"px";e.style.top=((g.y/b-this.offset.y).toFixed()-a)+"px";var d=a*2;e.style.width=d+"px";e.style.height=d+"px";return e}return false},drawLineString:function(a,b){return this.drawLine(a,b,false)},drawLinearRing:function(a,b){return this.drawLine(a,b,true)},drawLine:function(b,p,l){this.setNodeDimension(b,p);var d=this.getResolution();var a=p.components.length;var g=new Array(a);var m,q,o;for(var h=0;h<a;h++){m=p.components[h];q=(m.x/d-this.offset.x);o=(m.y/d-this.offset.y);g[h]=" "+q.toFixed()+","+o.toFixed()+" l "}var e=(l)?" x e":" e";b.path="m"+g.join("")+e;return b},drawPolygon:function(b,p){this.setNodeDimension(b,p);var d=this.getResolution();var r=[];var h,g,e,m,a,l,q,o;for(e=0,m=p.components.length;e<m;e++){h=p.components[e];r.push("m");for(g=0,a=h.components.length;g<a;g++){l=h.components[g];q=l.x/d-this.offset.x;o=l.y/d-this.offset.y;r.push(" "+q.toFixed()+","+o.toFixed());if(g==0){r.push(" l")}}r.push(" x ")}r.push("e");b.path=r.join("");return b},drawRectangle:function(b,d){var a=this.getResolution();b.style.left=(d.x/a-this.offset.x)+"px";b.style.top=(d.y/a-this.offset.y)+"px";b.style.width=d.width/a+"px";b.style.height=d.height/a+"px";return b},drawText:function(e,a,m){var l=this.nodeFactory(e+this.LABEL_ID_SUFFIX,"olv:rect");var h=this.nodeFactory(e+this.LABEL_ID_SUFFIX+"_textbox","olv:textbox");var d=this.getResolution();l.style.left=(m.x/d-this.offset.x).toFixed()+"px";l.style.top=(m.y/d-this.offset.y).toFixed()+"px";l.style.flip="y";h.innerText=a.label;if(a.fillColor){h.style.color=a.fontColor}if(a.fontFamily){h.style.fontFamily=a.fontFamily}if(a.fontSize){h.style.fontSize=a.fontSize}if(a.fontWeight){h.style.fontWeight=a.fontWeight}h.style.whiteSpace="nowrap";h.inset="1px,0px,0px,0px";if(!l.parentNode){l.appendChild(h);this.textRoot.appendChild(l)}var g=a.labelAlign||"cm";var o=h.clientWidth*(OpenLayers.Renderer.VML.LABEL_SHIFT[g.substr(0,1)]);var b=h.clientHeight*(OpenLayers.Renderer.VML.LABEL_SHIFT[g.substr(1,1)]);l.style.left=parseInt(l.style.left)-o-1+"px";l.style.top=parseInt(l.style.top)+b+"px"},drawSurface:function(a,l){this.setNodeDimension(a,l);var b=this.getResolution();var o=[];var e,m,h;for(var d=0,g=l.components.length;d<g;d++){e=l.components[d];m=e.x/b-this.offset.x;h=e.y/b-this.offset.y;if((d%3)==0&&(d/3)==0){o.push("m")}else{if((d%3)==1){o.push(" c")}}o.push(" "+m+","+h)}o.push(" x e");a.path=o.join("");return a},moveRoot:function(b){var a=this.map.getLayer(b.container.id);if(a instanceof OpenLayers.Layer.Vector.RootContainer){a=this.map.getLayer(this.container.id)}a&&a.renderer.clear();OpenLayers.Renderer.Elements.prototype.moveRoot.apply(this,arguments);a&&a.redraw()},importSymbol:function(e){var b=this.container.id+"-"+e;var a=this.symbolCache[b];if(a){return a}var d=OpenLayers.Renderer.symbol[e];if(!d){throw new Error(e+" is not a valid symbol name");return}var m=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var g=["m"];for(var h=0;h<d.length;h=h+2){x=d[h];y=d[h+1];m.left=Math.min(m.left,x);m.bottom=Math.min(m.bottom,y);m.right=Math.max(m.right,x);m.top=Math.max(m.top,y);g.push(x);g.push(y);if(h==0){g.push("l")}}g.push("x e");var o=g.join(" ");var l=(m.getWidth()-m.getHeight())/2;if(l>0){m.bottom=m.bottom-l;m.top=m.top+l}else{m.left=m.left-l;m.right=m.right+l}a={path:o,size:m.getWidth(),left:m.left,bottom:m.bottom};this.symbolCache[b]=a;return a},CLASS_NAME:"OpenLayers.Renderer.VML"});OpenLayers.Renderer.VML.LABEL_SHIFT={l:0,c:0.5,r:1,t:0,m:0.5,b:1};OpenLayers.Tile=OpenLayers.Class({EVENT_TYPES:["loadstart","loadend","reload","unload"],events:null,id:null,layer:null,url:null,bounds:null,size:null,position:null,isLoading:false,initialize:function(e,a,g,b,d){this.layer=e;this.position=a.clone();this.bounds=g.clone();this.url=b;this.size=d.clone();this.id=OpenLayers.Util.createUniqueID("Tile_");this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES)},unload:function(){if(this.isLoading){this.isLoading=false;this.events.triggerEvent("unload")}},destroy:function(){this.layer=null;this.bounds=null;this.size=null;this.position=null;this.events.destroy();this.events=null},clone:function(a){if(a==null){a=new OpenLayers.Tile(this.layer,this.position,this.bounds,this.url,this.size)}OpenLayers.Util.applyDefaults(a,this);return a},draw:function(){var a=this.layer.maxExtent;var b=(a&&this.bounds.intersectsBounds(a,false));this.shouldDraw=(b||this.layer.displayOutsideMaxExtent);this.clear();return this.shouldDraw},moveTo:function(b,a,d){if(d==null){d=true}this.bounds=b.clone();this.position=a.clone();if(d){this.draw()}},clear:function(){},getBoundsFromBaseLayer:function(a){var h=OpenLayers.i18n("reprojectDeprecated",{layerName:this.layer.name});OpenLayers.Console.warn(h);var e=this.layer.map.getLonLatFromLayerPx(a);var d=a.clone();d.x+=this.size.w;d.y+=this.size.h;var b=this.layer.map.getLonLatFromLayerPx(d);if(e.lon>b.lon){if(e.lon<0){e.lon=-180-(e.lon+180)}else{b.lon=180+b.lon+180}}var g=new OpenLayers.Bounds(e.lon,b.lat,b.lon,e.lat);return g},showTile:function(){if(this.shouldDraw){this.show()}},show:function(){},hide:function(){},CLASS_NAME:"OpenLayers.Tile"});OpenLayers.Control.MouseToolbar=OpenLayers.Class(OpenLayers.Control.MouseDefaults,{mode:null,buttons:null,direction:"vertical",buttonClicked:null,initialize:function(a,b){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.position=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,OpenLayers.Control.MouseToolbar.Y);if(a){this.position=a}if(b){this.direction=b}this.measureDivs=[]},destroy:function(){for(var b in this.buttons){var a=this.buttons[b];a.map=null;a.events.destroy()}OpenLayers.Control.MouseDefaults.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);OpenLayers.Control.MouseDefaults.prototype.draw.apply(this,arguments);this.buttons={};var b=new OpenLayers.Size(28,28);var a=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,0);this._addButton("zoombox","drag-rectangle-off.png","drag-rectangle-on.png",a,b,"Shift->Drag to zoom to area");a=a.add((this.direction=="vertical"?0:b.w),(this.direction=="vertical"?b.h:0));this._addButton("pan","panning-hand-off.png","panning-hand-on.png",a,b,"Drag the map to pan.");a=a.add((this.direction=="vertical"?0:b.w),(this.direction=="vertical"?b.h:0));this.switchModeTo("pan");return this.div},_addButton:function(a,g,e,o,l,m){var h=OpenLayers.Util.getImagesLocation()+g;var d=OpenLayers.Util.getImagesLocation()+e;var b=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MouseToolbar_"+a,o,l,h,"absolute");this.div.appendChild(b);b.imgLocation=h;b.activeImgLocation=d;b.events=new OpenLayers.Events(this,b,null,true);b.events.on({mousedown:this.buttonDown,mouseup:this.buttonUp,dblclick:OpenLayers.Event.stop,scope:this});b.action=a;b.title=m;b.alt=m;b.map=this.map;this.buttons[a]=b;return b},buttonDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}this.buttonClicked=a.element.action;OpenLayers.Event.stop(a)},buttonUp:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}if(this.buttonClicked!=null){if(this.buttonClicked==a.element.action){this.switchModeTo(a.element.action)}OpenLayers.Event.stop(a);this.buttonClicked=null}},defaultDblClick:function(b){this.switchModeTo("pan");this.performedDrag=false;var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(a,this.map.zoom+1);OpenLayers.Event.stop(b);return false},defaultMouseDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}this.mouseDragStart=a.xy.clone();this.performedDrag=false;this.startViaKeyboard=false;if(a.shiftKey&&this.mode!="zoombox"){this.switchModeTo("zoombox");this.startViaKeyboard=true}else{if(a.altKey&&this.mode!="measure"){this.switchModeTo("measure")}else{if(!this.mode){this.switchModeTo("pan")}}}switch(this.mode){case"zoombox":this.map.div.style.cursor="crosshair";this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.mouseDragStart,null,null,"absolute","2px solid red");this.zoomBox.style.backgroundColor="white";this.zoomBox.style.filter="alpha(opacity=50)";this.zoomBox.style.opacity="0.50";this.zoomBox.style.fontSize="1px";this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.viewPortDiv.appendChild(this.zoomBox);this.performedDrag=true;break;case"measure":var d="";if(this.measureStart){var b=this.map.getLonLatFromViewPortPx(this.mouseDragStart);d=OpenLayers.Util.distVincenty(this.measureStart,b);d=Math.round(d*100)/100;d=d+"km";this.measureStartBox=this.measureBox}this.measureStart=this.map.getLonLatFromViewPortPx(this.mouseDragStart);this.measureBox=OpenLayers.Util.createDiv(null,this.mouseDragStart.add(-2-parseInt(this.map.layerContainerDiv.style.left),-2-parseInt(this.map.layerContainerDiv.style.top)),null,null,"absolute");this.measureBox.style.width="4px";this.measureBox.style.height="4px";this.measureBox.style.fontSize="1px";this.measureBox.style.backgroundColor="red";this.measureBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.layerContainerDiv.appendChild(this.measureBox);if(d){this.measureBoxDistance=OpenLayers.Util.createDiv(null,this.mouseDragStart.add(-2-parseInt(this.map.layerContainerDiv.style.left),2-parseInt(this.map.layerContainerDiv.style.top)),null,null,"absolute");this.measureBoxDistance.innerHTML=d;this.measureBoxDistance.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.layerContainerDiv.appendChild(this.measureBoxDistance);this.measureDivs.push(this.measureBoxDistance)}this.measureBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.layerContainerDiv.appendChild(this.measureBox);this.measureDivs.push(this.measureBox);break;default:this.map.div.style.cursor="move";break}document.onselectstart=function(){return false};OpenLayers.Event.stop(a)},switchModeTo:function(d){if(d!=this.mode){if(this.mode&&this.buttons[this.mode]){OpenLayers.Util.modifyAlphaImageDiv(this.buttons[this.mode],null,null,null,this.buttons[this.mode].imgLocation)}if(this.mode=="measure"&&d!="measure"){for(var b=0,a=this.measureDivs.length;b<a;b++){if(this.measureDivs[b]){this.map.layerContainerDiv.removeChild(this.measureDivs[b])}}this.measureDivs=[];this.measureStart=null}this.mode=d;if(this.buttons[d]){OpenLayers.Util.modifyAlphaImageDiv(this.buttons[d],null,null,null,this.buttons[d].activeImgLocation)}switch(this.mode){case"zoombox":this.map.div.style.cursor="crosshair";break;default:this.map.div.style.cursor="";break}}},leaveMode:function(){this.switchModeTo("pan")},defaultMouseMove:function(g){if(this.mouseDragStart!=null){switch(this.mode){case"zoombox":var e=Math.abs(this.mouseDragStart.x-g.xy.x);var b=Math.abs(this.mouseDragStart.y-g.xy.y);this.zoomBox.style.width=Math.max(1,e)+"px";this.zoomBox.style.height=Math.max(1,b)+"px";if(g.xy.x<this.mouseDragStart.x){this.zoomBox.style.left=g.xy.x+"px"}if(g.xy.y<this.mouseDragStart.y){this.zoomBox.style.top=g.xy.y+"px"}break;default:var e=this.mouseDragStart.x-g.xy.x;var b=this.mouseDragStart.y-g.xy.y;var h=this.map.getSize();var a=new OpenLayers.Pixel(h.w/2+e,h.h/2+b);var d=this.map.getLonLatFromViewPortPx(a);this.map.setCenter(d,null,true);this.mouseDragStart=g.xy.clone()}this.performedDrag=true}},defaultMouseUp:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}switch(this.mode){case"zoombox":this.zoomBoxEnd(a);if(this.startViaKeyboard){this.leaveMode()}break;case"pan":if(this.performedDrag){this.map.setCenter(this.map.center)}}document.onselectstart=null;this.mouseDragStart=null;this.map.div.style.cursor="default"},defaultMouseOut:function(a){if(this.mouseDragStart!=null&&OpenLayers.Util.mouseLeft(a,this.map.div)){if(this.zoomBox){this.removeZoomBox();if(this.startViaKeyboard){this.leaveMode()}}this.mouseDragStart=null;this.map.div.style.cursor="default"}},defaultClick:function(a){if(this.performedDrag){this.performedDrag=false;return false}},CLASS_NAME:"OpenLayers.Control.MouseToolbar"});OpenLayers.Control.MouseToolbar.X=6;OpenLayers.Control.MouseToolbar.Y=300;OpenLayers.Control.NavigationHistory=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOGGLE,previous:null,previousOptions:null,next:null,nextOptions:null,limit:50,activateOnDraw:true,clearOnDeactivate:false,registry:null,nextStack:null,previousStack:null,listeners:null,restoring:false,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.registry=OpenLayers.Util.extend({moveend:function(){return{center:this.map.getCenter(),resolution:this.map.getResolution()}}},this.registry);this.clear();var b={trigger:OpenLayers.Function.bind(this.previousTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Previous"};OpenLayers.Util.extend(b,this.previousOptions);this.previous=new OpenLayers.Control.Button(b);var d={trigger:OpenLayers.Function.bind(this.nextTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Next"};OpenLayers.Util.extend(d,this.nextOptions);this.next=new OpenLayers.Control.Button(d)},onPreviousChange:function(b,a){if(b&&!this.previous.active){this.previous.activate()}else{if(!b&&this.previous.active){this.previous.deactivate()}}},onNextChange:function(b,a){if(b&&!this.next.active){this.next.activate()}else{if(!b&&this.next.active){this.next.deactivate()}}},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this);this.previous.destroy();this.next.destroy();this.deactivate();for(var a in this){this[a]=null}},setMap:function(a){this.map=a;this.next.setMap(a);this.previous.setMap(a)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.next.draw();this.previous.draw();if(this.activateOnDraw){this.activate()}},previousTrigger:function(){var b=this.previousStack.shift();var a=this.previousStack.shift();if(a!=undefined){this.nextStack.unshift(b);this.previousStack.unshift(a);this.restoring=true;this.restore(a);this.restoring=false;this.onNextChange(this.nextStack[0],this.nextStack.length);this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)}else{this.previousStack.unshift(b)}return a},nextTrigger:function(){var a=this.nextStack.shift();if(a!=undefined){this.previousStack.unshift(a);this.restoring=true;this.restore(a);this.restoring=false;this.onNextChange(this.nextStack[0],this.nextStack.length);this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)}return a},clear:function(){this.previousStack=[];this.nextStack=[]},restore:function(b){var a=this.map.getZoomForResolution(b.resolution);this.map.setCenter(b.center,a)},setListeners:function(){this.listeners={};for(var a in this.registry){this.listeners[a]=OpenLayers.Function.bind(function(){if(!this.restoring){var b=this.registry[a].apply(this,arguments);this.previousStack.unshift(b);if(this.previousStack.length>1){this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)}if(this.previousStack.length>(this.limit+1)){this.previousStack.pop()}if(this.nextStack.length>0){this.nextStack=[];this.onNextChange(null,0)}}return true},this)}},activate:function(){var a=false;if(this.map){if(OpenLayers.Control.prototype.activate.apply(this)){if(this.listeners==null){this.setListeners()}for(var b in this.listeners){this.map.events.register(b,this,this.listeners[b])}a=true;if(this.previousStack.length==0){this.initStack()}}}return a},initStack:function(){if(this.map.getCenter()){this.listeners.moveend()}},deactivate:function(){var b=false;if(this.map){if(OpenLayers.Control.prototype.deactivate.apply(this)){for(var a in this.listeners){this.map.events.unregister(a,this,this.listeners[a])}if(this.clearOnDeactivate){this.clear()}b=true}}return b},CLASS_NAME:"OpenLayers.Control.NavigationHistory"});OpenLayers.Control.PanPanel=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);this.addControls([new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST)])},CLASS_NAME:"OpenLayers.Control.PanPanel"});OpenLayers.Control.PanZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoom,{zoomStopWidth:18,zoomStopHeight:11,slider:null,sliderEvents:null,zoomBarDiv:null,divEvents:null,zoomWorldIcon:false,initialize:function(){OpenLayers.Control.PanZoom.prototype.initialize.apply(this,arguments)},destroy:function(){this._removeZoomBar();this.map.events.un({changebaselayer:this.redraw,scope:this});OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments)},setMap:function(a){OpenLayers.Control.PanZoom.prototype.setMap.apply(this,arguments);this.map.events.register("changebaselayer",this,this.redraw)},redraw:function(){if(this.div!=null){this.removeButtons();this._removeZoomBar()}this.draw()},draw:function(b){OpenLayers.Control.prototype.draw.apply(this,arguments);b=this.position.clone();this.buttons=[];var e=new OpenLayers.Size(18,18);var a=new OpenLayers.Pixel(b.x+e.w/2,b.y);var d=e.w;if(this.zoomWorldIcon){a=new OpenLayers.Pixel(b.x+e.w,b.y)}this._addButton("panup","north-mini.png",a,e);b.y=a.y+e.h;this._addButton("panleft","west-mini.png",b,e);if(this.zoomWorldIcon){this._addButton("zoomworld","zoom-world-mini.png",b.add(e.w,0),e);d*=2}this._addButton("panright","east-mini.png",b.add(d,0),e);this._addButton("pandown","south-mini.png",a.add(0,e.h*2),e);this._addButton("zoomin","zoom-plus-mini.png",a.add(0,e.h*3+5),e);a=this._addZoomBar(a.add(0,e.h*4+5));this._addButton("zoomout","zoom-minus-mini.png",a,e);return this.div},_addZoomBar:function(a){var g=OpenLayers.Util.getImagesLocation();var l=this.id+"_"+this.map.id;var b=this.map.getNumZoomLevels()-1-this.map.getZoom();var d=OpenLayers.Util.createAlphaImageDiv(l,a.add(-1,b*this.zoomStopHeight),new OpenLayers.Size(20,9),g+"slider.png","absolute");this.slider=d;this.sliderEvents=new OpenLayers.Events(this,d,null,true,{includeXY:true});this.sliderEvents.on({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});var e=new OpenLayers.Size();e.h=this.zoomStopHeight*this.map.getNumZoomLevels();e.w=this.zoomStopWidth;var h=null;if(OpenLayers.Util.alphaHack()){var l=this.id+"_"+this.map.id;h=OpenLayers.Util.createAlphaImageDiv(l,a,new OpenLayers.Size(e.w,this.zoomStopHeight),g+"zoombar.png","absolute",null,"crop");h.style.height=e.h+"px"}else{h=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,a,e,g+"zoombar.png")}this.zoombarDiv=h;this.divEvents=new OpenLayers.Events(this,h,null,true,{includeXY:true});this.divEvents.on({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick});this.div.appendChild(h);this.startTop=parseInt(h.style.top);this.div.appendChild(d);this.map.events.register("zoomend",this,this.moveZoomBar);a=a.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());return a},_removeZoomBar:function(){this.sliderEvents.un({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});this.sliderEvents.destroy();this.divEvents.un({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick});this.divEvents.destroy();this.div.removeChild(this.zoombarDiv);this.zoombarDiv=null;this.div.removeChild(this.slider);this.slider=null;this.map.events.unregister("zoomend",this,this.moveZoomBar)},passEventToSlider:function(a){this.sliderEvents.handleBrowserEvent(a)},divClick:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}var g=a.xy.y;var e=OpenLayers.Util.pagePosition(a.object)[1];var d=(g-e)/this.zoomStopHeight;if(!this.map.fractionalZoom){d=Math.floor(d)}var b=(this.map.getNumZoomLevels()-1)-d;b=Math.min(Math.max(b,0),this.map.getNumZoomLevels()-1);this.map.zoomTo(b);OpenLayers.Event.stop(a)},zoomBarDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}this.map.events.on({mousemove:this.passEventToSlider,mouseup:this.passEventToSlider,scope:this});this.mouseDragStart=a.xy.clone();this.zoomStart=a.xy.clone();this.div.style.cursor="move";this.zoombarDiv.offsets=null;OpenLayers.Event.stop(a)},zoomBarDrag:function(b){if(this.mouseDragStart!=null){var a=this.mouseDragStart.y-b.xy.y;var e=OpenLayers.Util.pagePosition(this.zoombarDiv);if((b.clientY-e[1])>0&&(b.clientY-e[1])<parseInt(this.zoombarDiv.style.height)-2){var d=parseInt(this.slider.style.top)-a;this.slider.style.top=d+"px";this.mouseDragStart=b.xy.clone()}OpenLayers.Event.stop(b)}},zoomBarUp:function(b){if(!OpenLayers.Event.isLeftClick(b)){return}if(this.zoomStart){this.div.style.cursor="";this.map.events.un({mouseup:this.passEventToSlider,mousemove:this.passEventToSlider,scope:this});var a=this.zoomStart.y-b.xy.y;var d=this.map.zoom;if(this.map.fractionalZoom){d+=a/this.zoomStopHeight;d=Math.min(Math.max(d,0),this.map.getNumZoomLevels()-1)}else{d+=Math.round(a/this.zoomStopHeight)}this.map.zoomTo(d);this.moveZoomBar();this.mouseDragStart=null;OpenLayers.Event.stop(b)}},moveZoomBar:function(){var a=((this.map.getNumZoomLevels()-1)-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;this.slider.style.top=a+"px"},CLASS_NAME:"OpenLayers.Control.PanZoomBar"});OpenLayers.Control.Permalink=OpenLayers.Class(OpenLayers.Control,{argParserClass:OpenLayers.Control.ArgParser,element:null,base:"",displayProjection:null,initialize:function(b,d,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.element=OpenLayers.Util.getElement(b);this.base=d||document.location.href},destroy:function(){if(this.element.parentNode==this.div){this.div.removeChild(this.element)}this.element=null;this.map.events.unregister("moveend",this,this.updateLink);OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(e){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var b=0,a=this.map.controls.length;b<a;b++){var d=this.map.controls[b];if(d.CLASS_NAME==this.argParserClass.CLASS_NAME){if(d.displayProjection!=this.displayProjection){this.displayProjection=d.displayProjection}break}}if(b==this.map.controls.length){this.map.addControl(new this.argParserClass({displayProjection:this.displayProjection}))}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.className=this.displayClass;this.element=document.createElement("a");this.element.innerHTML=OpenLayers.i18n("permalink");this.element.href="";this.div.appendChild(this.element)}this.map.events.on({moveend:this.updateLink,changelayer:this.updateLink,changebaselayer:this.updateLink,scope:this});this.updateLink();return this.div},updateLink:function(){var a=this.base;if(a.indexOf("?")!=-1){a=a.substring(0,a.indexOf("?"))}a+="?"+OpenLayers.Util.getParameterString(this.createParams());this.element.href=a},createParams:function(a,p,g){a=a||this.map.getCenter();var e=OpenLayers.Util.getParameters(this.base);if(a){e.zoom=p||this.map.getZoom();var o=a.lat;var b=a.lon;if(this.displayProjection){var d=OpenLayers.Projection.transform({x:b,y:o},this.map.getProjectionObject(),this.displayProjection);b=d.x;o=d.y}e.lat=Math.round(o*100000)/100000;e.lon=Math.round(b*100000)/100000;g=g||this.map.layers;e.layers="";for(var h=0,m=g.length;h<m;h++){var l=g[h];if(l.isBaseLayer){e.layers+=(l==this.map.baseLayer)?"B":"0"}else{e.layers+=(l.getVisibility())?"T":"F"}}}return e},CLASS_NAME:"OpenLayers.Control.Permalink"});OpenLayers.Control.ZoomPanel=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);this.addControls([new OpenLayers.Control.ZoomIn(),new OpenLayers.Control.ZoomToMaxExtent(),new OpenLayers.Control.ZoomOut()])},CLASS_NAME:"OpenLayers.Control.ZoomPanel"});OpenLayers.Format.JSON=OpenLayers.Class(OpenLayers.Format,{indent:"    ",space:" ",newline:"\n",level:0,pretty:false,initialize:function(a){OpenLayers.Format.prototype.initialize.apply(this,[a])},read:function(json,filter){try{if(/^[\],:{}\s]*$/.test(json.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){var object=eval("("+json+")");if(typeof filter==="function"){function walk(k,v){if(v&&typeof v==="object"){for(var i in v){if(v.hasOwnProperty(i)){v[i]=walk(i,v[i])}}}return filter(k,v)}object=walk("",object)}if(this.keepData){this.data=object}return object}}catch(e){}return null},write:function(g,d){this.pretty=!!d;var a=null;var b=typeof g;if(this.serialize[b]){try{a=this.serialize[b].apply(this,[g])}catch(e){OpenLayers.Console.error("Trouble serializing: "+e)}}return a},writeIndent:function(){var b=[];if(this.pretty){for(var a=0;a<this.level;++a){b.push(this.indent)}}return b.join("")},writeNewline:function(){return(this.pretty)?this.newline:""},writeSpace:function(){return(this.pretty)?this.space:""},serialize:{object:function(d){if(d==null){return"null"}if(d.constructor==Date){return this.serialize.date.apply(this,[d])}if(d.constructor==Array){return this.serialize.array.apply(this,[d])}var h=["{"];this.level+=1;var e,b,g;var a=false;for(e in d){if(d.hasOwnProperty(e)){b=OpenLayers.Format.JSON.prototype.write.apply(this,[e,this.pretty]);g=OpenLayers.Format.JSON.prototype.write.apply(this,[d[e],this.pretty]);if(b!=null&&g!=null){if(a){h.push(",")}h.push(this.writeNewline(),this.writeIndent(),b,":",this.writeSpace(),g);a=true}}}this.level-=1;h.push(this.writeNewline(),this.writeIndent(),"}");return h.join("")},array:function(g){var d;var e=["["];this.level+=1;for(var b=0,a=g.length;b<a;++b){d=OpenLayers.Format.JSON.prototype.write.apply(this,[g[b],this.pretty]);if(d!=null){if(b>0){e.push(",")}e.push(this.writeNewline(),this.writeIndent(),d)}}this.level-=1;e.push(this.writeNewline(),this.writeIndent(),"]");return e.join("")},string:function(b){var a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};if(/["\\\x00-\x1f]/.test(b)){return'"'+b.replace(/([\x00-\x1f\\"])/g,function(e,d){var g=a[d];if(g){return g}g=d.charCodeAt();return"\\u00"+Math.floor(g/16).toString(16)+(g%16).toString(16)})+'"'}return'"'+b+'"'},number:function(a){return isFinite(a)?String(a):"null"},"boolean":function(a){return String(a)},date:function(a){function b(d){return(d<10)?"0"+d:d}return'"'+a.getFullYear()+"-"+b(a.getMonth()+1)+"-"+b(a.getDate())+"T"+b(a.getHours())+":"+b(a.getMinutes())+":"+b(a.getSeconds())+'"'}},CLASS_NAME:"OpenLayers.Format.JSON"});OpenLayers.Format.WFST=function(b){b=OpenLayers.Util.applyDefaults(b,OpenLayers.Format.WFST.DEFAULTS);var a=OpenLayers.Format.WFST["v"+b.version.replace(/\./g,"_")];if(!a){throw"Unsupported WFST version: "+b.version}return new a(b)};OpenLayers.Format.WFST.DEFAULTS={version:"1.0.0"};OpenLayers.Format.WMSCapabilities=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.1.1",version:null,parser:null,initialize:function(a){OpenLayers.Format.prototype.initialize.apply(this,[a]);this.options=a},read:function(g){if(typeof g=="string"){g=OpenLayers.Format.XML.prototype.read.apply(this,[g])}var d=g.documentElement;var b=this.version||d.getAttribute("version")||this.defaultVersion;if(!this.parser||this.parser.version!==b){var e=OpenLayers.Format.WMSCapabilities["v"+b.replace(/\./g,"_")];if(!e){throw"Can't find a WMS capabilities parser for version "+b}var h=new e(this.options)}var a=h.read(g);a.version=b;return a},CLASS_NAME:"OpenLayers.Format.WMSCapabilities"});OpenLayers.Format.XML=OpenLayers.Class(OpenLayers.Format,{namespaces:null,namespaceAlias:null,defaultPrefix:null,readers:{},writers:{},xmldom:null,initialize:function(a){if(window.ActiveXObject){this.xmldom=new ActiveXObject("Microsoft.XMLDOM")}OpenLayers.Format.prototype.initialize.apply(this,[a]);this.namespaces=OpenLayers.Util.extend({},this.namespaces);this.namespaceAlias={};for(var b in this.namespaces){this.namespaceAlias[this.namespaces[b]]=b}},destroy:function(){this.xmldom=null;OpenLayers.Format.prototype.destroy.apply(this,arguments)},setNamespace:function(a,b){this.namespaces[a]=b;this.namespaceAlias[b]=a},read:function(d){var a=d.indexOf("<");if(a>0){d=d.substring(a)}var b=OpenLayers.Util.Try(OpenLayers.Function.bind((function(){var e;if(window.ActiveXObject&&!this.xmldom){e=new ActiveXObject("Microsoft.XMLDOM")}else{e=this.xmldom}e.loadXML(d);return e}),this),function(){return new DOMParser().parseFromString(d,"text/xml")},function(){var e=new XMLHttpRequest();e.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(d),false);if(e.overrideMimeType){e.overrideMimeType("text/xml")}e.send(null);return e.responseXML});if(this.keepData){this.data=b}return b},write:function(b){var d;if(this.xmldom){d=b.xml}else{var a=new XMLSerializer();if(b.nodeType==1){var e=document.implementation.createDocument("","",null);if(e.importNode){b=e.importNode(b,true)}e.appendChild(b);d=a.serializeToString(e)}else{d=a.serializeToString(b)}}return d},createElementNS:function(d,a){var b;if(this.xmldom){if(typeof d=="string"){b=this.xmldom.createNode(1,a,d)}else{b=this.xmldom.createNode(1,a,"")}}else{b=document.createElementNS(d,a)}return b},createTextNode:function(b){var a;if(this.xmldom){a=this.xmldom.createTextNode(b)}else{a=document.createTextNode(b)}return a},getElementsByTagNameNS:function(g,e,d){var a=[];if(g.getElementsByTagNameNS){a=g.getElementsByTagNameNS(e,d)}else{var b=g.getElementsByTagName("*");var o,h;for(var l=0,m=b.length;l<m;++l){o=b[l];h=(o.prefix)?(o.prefix+":"+d):d;if((d=="*")||(h==o.nodeName)){if((e=="*")||(e==o.namespaceURI)){a.push(o)}}}}return a},getAttributeNodeNS:function(d,b,a){var o=null;if(d.getAttributeNodeNS){o=d.getAttributeNodeNS(b,a)}else{var g=d.attributes;var m,e;for(var h=0,l=g.length;h<l;++h){m=g[h];if(m.namespaceURI==b){e=(m.prefix)?(m.prefix+":"+a):a;if(e==m.nodeName){o=m;break}}}}return o},getAttributeNS:function(g,e,a){var b="";if(g.getAttributeNS){b=g.getAttributeNS(e,a)||""}else{var d=this.getAttributeNodeNS(g,e,a);if(d){b=d.nodeValue}}return b},getChildValue:function(a,d){var b=d||"";if(a){for(var e=a.firstChild;e;e=e.nextSibling){switch(e.nodeType){case 3:case 4:b+=e.nodeValue}}}return b},concatChildValues:function(b,e){var d="";var g=b.firstChild;var a;while(g){a=g.nodeValue;if(a){d+=a}g=g.nextSibling}if(d==""&&e!=undefined){d=e}return d},isSimpleContent:function(a){var d=true;for(var b=a.firstChild;b;b=b.nextSibling){if(b.nodeType===1){d=false;break}}return d},contentType:function(d){var g=false,b=false;var a=OpenLayers.Format.XML.CONTENT_TYPE.EMPTY;for(var e=d.firstChild;e;e=e.nextSibling){switch(e.nodeType){case 1:b=true;break;case 8:break;default:g=true}if(b&&g){break}}if(b&&g){a=OpenLayers.Format.XML.CONTENT_TYPE.MIXED}else{if(b){return OpenLayers.Format.XML.CONTENT_TYPE.COMPLEX}else{if(g){return OpenLayers.Format.XML.CONTENT_TYPE.SIMPLE}}}return a},hasAttributeNS:function(d,b,a){var e=false;if(d.hasAttributeNS){e=d.hasAttributeNS(b,a)}else{e=!!this.getAttributeNodeNS(d,b,a)}return e},setAttributeNS:function(e,d,a,g){if(e.setAttributeNS){e.setAttributeNS(d,a,g)}else{if(this.xmldom){if(d){var b=e.ownerDocument.createNode(2,a,d);b.nodeValue=g;e.setAttributeNode(b)}else{e.setAttribute(a,g)}}else{throw"setAttributeNS not implemented"}}},createElementNSPlus:function(b,a){a=a||{};var e=a.uri||this.namespaces[a.prefix];if(!e){var h=b.indexOf(":");e=this.namespaces[b.substring(0,h)]}if(!e){e=this.namespaces[this.defaultPrefix]}var d=this.createElementNS(e,b);if(a.attributes){this.setAttributes(d,a.attributes)}var g=a.value;if(g!=null){if(typeof g=="boolean"){g=String(g)}d.appendChild(this.createTextNode(g))}return d},setAttributes:function(d,g){var e,b;for(var a in g){if(g[a]!=null&&g[a].toString){e=g[a].toString();b=this.namespaces[a.substring(0,a.indexOf(":"))]||null;this.setAttributeNS(d,b,a,e)}}},readNode:function(d,g){if(!g){g={}}var e=this.readers[this.namespaceAlias[d.namespaceURI]];if(e){var b=d.localName||d.nodeName.split(":").pop();var a=e[b]||e["*"];if(a){a.apply(this,[d,g])}}return g},readChildNodes:function(e,g){if(!g){g={}}var d=e.childNodes;var h;for(var b=0,a=d.length;b<a;++b){h=d[b];if(h.nodeType==1){this.readNode(h,g)}}return g},writeNode:function(a,h,e){var g,d;var b=a.indexOf(":");if(b>0){g=a.substring(0,b);d=a.substring(b+1)}else{if(e){g=this.namespaceAlias[e.namespaceURI]}else{g=this.defaultPrefix}d=a}var l=this.writers[g][d].apply(this,[h]);if(e){e.appendChild(l)}return l},getChildEl:function(d,a,b){return d&&this.getThisOrNextEl(d.firstChild,a,b)},getNextEl:function(d,a,b){return d&&this.getThisOrNextEl(d.nextSibling,a,b)},getThisOrNextEl:function(e,a,d){outer:for(var b=e;b;b=b.nextSibling){switch(b.nodeType){case 1:if((!a||a===(b.localName||b.nodeName.split(":").pop()))&&(!d||d===b.namespaceURI)){break outer}b=null;break outer;case 3:if(/^\s*$/.test(b.nodeValue)){break}case 4:case 6:case 12:case 10:case 11:b=null;break outer}}return b||null},lookupNamespaceURI:function(g,h){var e=null;if(g){if(g.lookupNamespaceURI){e=g.lookupNamespaceURI(h)}else{outer:switch(g.nodeType){case 1:if(g.namespaceURI!==null&&g.prefix===h){e=g.namespaceURI;break outer}var b=g.attributes.length;if(b){var a;for(var d=0;d<b;++d){a=g.attributes[d];if(a.prefix==="xmlns"&&a.name==="xmlns:"+h){e=a.value||null;break outer}else{if(a.name==="xmlns"&&h===null){e=a.value||null;break outer}}}}e=this.lookupNamespaceURI(g.parentNode,h);break outer;case 2:e=this.lookupNamespaceURI(g.ownerElement,h);break outer;case 9:e=this.lookupNamespaceURI(g.documentElement,h);break outer;case 6:case 12:case 10:case 11:break outer;default:e=this.lookupNamespaceURI(g.parentNode,h);break outer}}}return e},CLASS_NAME:"OpenLayers.Format.XML"});OpenLayers.Format.XML.CONTENT_TYPE={EMPTY:0,SIMPLE:1,COMPLEX:2,MIXED:3};OpenLayers.Format.XML.lookupNamespaceURI=OpenLayers.Function.bind(OpenLayers.Format.XML.prototype.lookupNamespaceURI,OpenLayers.Format.XML.prototype);OpenLayers.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:false,evt:null,initialize:function(d,b,a){OpenLayers.Util.extend(this,a);this.control=d;this.callbacks=b;if(d.map){this.setMap(d.map)}OpenLayers.Util.extend(this,a);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},setMap:function(a){this.map=a},checkModifiers:function(a){if(this.keyMask==null){return true}var b=(a.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(a.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(a.altKey?OpenLayers.Handler.MOD_ALT:0);return(b==this.keyMask)},activate:function(){if(this.active){return false}var d=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var b=0,a=d.length;b<a;b++){if(this[d[b]]){this.register(d[b],this[d[b]])}}this.active=true;return true},deactivate:function(){if(!this.active){return false}var d=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var b=0,a=d.length;b<a;b++){if(this[d[b]]){this.unregister(d[b],this[d[b]])}}this.active=false;return true},callback:function(b,a){if(b&&this.callbacks[b]){this.callbacks[b].apply(this.control,a)}},register:function(a,b){this.map.events.registerPriority(a,this,b);this.map.events.registerPriority(a,this,this.setEvent)},unregister:function(a,b){this.map.events.unregister(a,this,b);this.map.events.unregister(a,this,this.setEvent)},setEvent:function(a){this.evt=a;return true},destroy:function(){this.deactivate();this.control=this.map=null},CLASS_NAME:"OpenLayers.Handler"});OpenLayers.Handler.MOD_NONE=0;OpenLayers.Handler.MOD_SHIFT=1;OpenLayers.Handler.MOD_CTRL=2;OpenLayers.Handler.MOD_ALT=4;OpenLayers.Map=OpenLayers.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Feature:725,Popup:750,Control:1000},EVENT_TYPES:["preaddlayer","addlayer","removelayer","changelayer","movestart","move","moveend","zoomend","popupopen","popupclose","addmarker","removemarker","clearmarkers","mouseover","mouseout","mousemove","dragstart","drag","dragend","changebaselayer"],id:null,fractionalZoom:false,events:null,allOverlays:false,div:null,dragging:false,size:null,viewPortDiv:null,layerContainerOrigin:null,layerContainerDiv:null,layers:null,controls:null,popups:null,baseLayer:null,center:null,resolution:null,zoom:0,panRatio:1.5,viewRequestID:0,tileSize:null,projection:"EPSG:4326",units:"degrees",resolutions:null,maxResolution:1.40625,minResolution:null,maxScale:null,minScale:null,maxExtent:null,minExtent:null,restrictedExtent:null,numZoomLevels:16,theme:null,displayProjection:null,fallThrough:true,panTween:null,eventListeners:null,panMethod:OpenLayers.Easing.Expo.easeOut,panDuration:50,paddingForPopups:null,initialize:function(m,e){if(arguments.length===1&&typeof m==="object"){e=m;m=e&&e.div}this.tileSize=new OpenLayers.Size(OpenLayers.Map.TILE_WIDTH,OpenLayers.Map.TILE_HEIGHT);this.maxExtent=new OpenLayers.Bounds(-180,-90,180,90);this.paddingForPopups=new OpenLayers.Bounds(15,15,15,15);this.theme=OpenLayers._getScriptLocation()+"theme/default/style.css";OpenLayers.Util.extend(this,e);this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");this.div=OpenLayers.Util.getElement(m);if(!this.div){this.div=document.createElement("div");this.div.style.height="1px";this.div.style.width="1px"}OpenLayers.Element.addClass(this.div,"olMap");var l=this.div.id+"_OpenLayers_ViewPort";this.viewPortDiv=OpenLayers.Util.createDiv(l,null,null,null,"relative",null,"hidden");this.viewPortDiv.style.width="100%";this.viewPortDiv.style.height="100%";this.viewPortDiv.className="olMapViewport";this.div.appendChild(this.viewPortDiv);l=this.div.id+"_OpenLayers_Container";this.layerContainerDiv=OpenLayers.Util.createDiv(l);this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE.Popup-1;this.viewPortDiv.appendChild(this.layerContainerDiv);this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES,this.fallThrough,{includeXY:true});this.updateSize();if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}this.events.register("movestart",this,this.updateSize);if(OpenLayers.String.contains(navigator.appName,"Microsoft")){this.events.register("resize",this,this.updateSize)}else{this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this);OpenLayers.Event.observe(window,"resize",this.updateSizeDestroy)}if(this.theme){var h=true;var d=document.getElementsByTagName("link");for(var g=0,a=d.length;g<a;++g){if(OpenLayers.Util.isEquivalentUrl(d.item(g).href,this.theme)){h=false;break}}if(h){var b=document.createElement("link");b.setAttribute("rel","stylesheet");b.setAttribute("type","text/css");b.setAttribute("href",this.theme);document.getElementsByTagName("head")[0].appendChild(b)}}this.layers=[];if(this.controls==null){if(OpenLayers.Control!=null){this.controls=[new OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoom(),new OpenLayers.Control.ArgParser(),new OpenLayers.Control.Attribution()]}else{this.controls=[]}}for(var g=0,a=this.controls.length;g<a;g++){this.addControlToMap(this.controls[g])}this.popups=[];this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);OpenLayers.Event.observe(window,"unload",this.unloadDestroy)},render:function(a){this.div=OpenLayers.Util.getElement(a);OpenLayers.Element.addClass(this.div,"olMap");this.events.attachToElement(this.div);this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);this.div.appendChild(this.viewPortDiv);this.updateSize()},unloadDestroy:null,updateSizeDestroy:null,destroy:function(){if(!this.unloadDestroy){return false}OpenLayers.Event.stopObserving(window,"unload",this.unloadDestroy);this.unloadDestroy=null;if(this.updateSizeDestroy){OpenLayers.Event.stopObserving(window,"resize",this.updateSizeDestroy)}else{this.events.unregister("resize",this,this.updateSize)}this.paddingForPopups=null;if(this.controls!=null){for(var a=this.controls.length-1;a>=0;--a){this.controls[a].destroy()}this.controls=null}if(this.layers!=null){for(var a=this.layers.length-1;a>=0;--a){this.layers[a].destroy(false)}this.layers=null}if(this.viewPortDiv){this.div.removeChild(this.viewPortDiv)}this.viewPortDiv=null;if(this.eventListeners){this.events.un(this.eventListeners);this.eventListeners=null}this.events.destroy();this.events=null},setOptions:function(a){OpenLayers.Util.extend(this,a)},getTileSize:function(){return this.tileSize},getBy:function(g,d,a){var e=(typeof a.test=="function");var b=OpenLayers.Array.filter(this[g],function(h){return h[d]==a||(e&&a.test(h[d]))});return b},getLayersBy:function(b,a){return this.getBy("layers",b,a)},getLayersByName:function(a){return this.getLayersBy("name",a)},getLayersByClass:function(a){return this.getLayersBy("CLASS_NAME",a)},getControlsBy:function(b,a){return this.getBy("controls",b,a)},getControlsByClass:function(a){return this.getControlsBy("CLASS_NAME",a)},getLayer:function(g){var b=null;for(var e=0,a=this.layers.length;e<a;e++){var d=this.layers[e];if(d.id==g){b=d;break}}return b},setLayerZIndex:function(b,a){b.setZIndex(this.Z_INDEX_BASE[b.isBaseLayer?"BaseLayer":"Overlay"]+a*5)},resetLayersZIndex:function(){for(var d=0,a=this.layers.length;d<a;d++){var b=this.layers[d];this.setLayerZIndex(b,d)}},addLayer:function(d){for(var b=0,a=this.layers.length;b<a;b++){if(this.layers[b]==d){var e=OpenLayers.i18n("layerAlreadyAdded",{layerName:d.name});OpenLayers.Console.warn(e);return false}}if(this.allOverlays){d.isBaseLayer=false}this.events.triggerEvent("preaddlayer",{layer:d});d.div.className="olLayerDiv";d.div.style.overflow="";this.setLayerZIndex(d,this.layers.length);if(d.isFixed){this.viewPortDiv.appendChild(d.div)}else{this.layerContainerDiv.appendChild(d.div)}this.layers.push(d);d.setMap(this);if(d.isBaseLayer||(this.allOverlays&&!this.baseLayer)){if(this.baseLayer==null){this.setBaseLayer(d)}else{d.setVisibility(false)}}else{d.redraw()}this.events.triggerEvent("addlayer",{layer:d});d.afterAdd()},addLayers:function(d){for(var b=0,a=d.length;b<a;b++){this.addLayer(d[b])}},removeLayer:function(d,g){if(g==null){g=true}if(d.isFixed){this.viewPortDiv.removeChild(d.div)}else{this.layerContainerDiv.removeChild(d.div)}OpenLayers.Util.removeItem(this.layers,d);d.removeMap(this);d.map=null;if(this.baseLayer==d){this.baseLayer=null;if(g){for(var b=0,a=this.layers.length;b<a;b++){var e=this.layers[b];if(e.isBaseLayer||this.allOverlays){this.setBaseLayer(e);break}}}}this.resetLayersZIndex();this.events.triggerEvent("removelayer",{layer:d})},getNumLayers:function(){return this.layers.length},getLayerIndex:function(a){return OpenLayers.Util.indexOf(this.layers,a)},setLayerIndex:function(e,b){var g=this.getLayerIndex(e);if(b<0){b=0}else{if(b>this.layers.length){b=this.layers.length}}if(g!=b){this.layers.splice(g,1);this.layers.splice(b,0,e);for(var d=0,a=this.layers.length;d<a;d++){this.setLayerZIndex(this.layers[d],d)}this.events.triggerEvent("changelayer",{layer:e,property:"order"});if(this.allOverlays){if(b===0){this.setBaseLayer(e)}else{if(this.baseLayer!==this.layers[0]){this.setBaseLayer(this.layers[0])}}}}},raiseLayer:function(b,d){var a=this.getLayerIndex(b)+d;this.setLayerIndex(b,a)},setBaseLayer:function(g){var e=null;if(this.baseLayer){e=this.baseLayer.getExtent()}if(g!=this.baseLayer){if(OpenLayers.Util.indexOf(this.layers,g)!=-1){if(this.baseLayer!=null&&!this.allOverlays){this.baseLayer.setVisibility(false)}this.baseLayer=g;this.viewRequestID++;if(!this.allOverlays){this.baseLayer.visibility=true}var a=this.getCenter();if(a!=null){var b=(e)?e.getCenterLonLat():a;var d=(e)?this.getZoomForExtent(e,true):this.getZoomForResolution(this.resolution,true);this.setCenter(b,d,false,true)}this.events.triggerEvent("changebaselayer",{layer:this.baseLayer})}}},addControl:function(b,a){this.controls.push(b);this.addControlToMap(b,a)},addControlToMap:function(b,a){b.outsideViewport=(b.div!=null);if(this.displayProjection&&!b.displayProjection){b.displayProjection=this.displayProjection}b.setMap(this);var d=b.draw(a);if(d){if(!b.outsideViewport){d.style.zIndex=this.Z_INDEX_BASE.Control+this.controls.length;this.viewPortDiv.appendChild(d)}}},getControl:function(g){var b=null;for(var d=0,a=this.controls.length;d<a;d++){var e=this.controls[d];if(e.id==g){b=e;break}}return b},removeControl:function(a){if((a)&&(a==this.getControl(a.id))){if(a.div&&(a.div.parentNode==this.viewPortDiv)){this.viewPortDiv.removeChild(a.div)}OpenLayers.Util.removeItem(this.controls,a)}},addPopup:function(a,e){if(e){for(var b=this.popups.length-1;b>=0;--b){this.removePopup(this.popups[b])}}a.map=this;this.popups.push(a);var d=a.draw();if(d){d.style.zIndex=this.Z_INDEX_BASE.Popup+this.popups.length;this.layerContainerDiv.appendChild(d)}},removePopup:function(a){OpenLayers.Util.removeItem(this.popups,a);if(a.div){try{this.layerContainerDiv.removeChild(a.div)}catch(b){}}a.map=null},getSize:function(){var a=null;if(this.size!=null){a=this.size.clone()}return a},updateSize:function(){this.events.clearMouseCache();var d=this.getCurrentSize();var h=this.getSize();if(h==null){this.size=h=d}if(!d.equals(h)){this.size=d;for(var e=0,b=this.layers.length;e<b;e++){this.layers[e].onMapResize()}if(this.baseLayer!=null){var a=new OpenLayers.Pixel(d.w/2,d.h/2);var l=this.getLonLatFromViewPortPx(a);var g=this.getZoom();this.zoom=null;this.setCenter(this.getCenter(),g)}}},getCurrentSize:function(){var a=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(a.w==0&&a.h==0||isNaN(a.w)&&isNaN(a.h)){var b=OpenLayers.Element.getDimensions(this.div);a.w=b.width;a.h=b.height}if(a.w==0&&a.h==0||isNaN(a.w)&&isNaN(a.h)){a.w=parseInt(this.div.style.width);a.h=parseInt(this.div.style.height)}return a},calculateBounds:function(a,b){var g=null;if(a==null){a=this.getCenter()}if(b==null){b=this.getResolution()}if((a!=null)&&(b!=null)){var e=this.getSize();var h=e.w*b;var d=e.h*b;g=new OpenLayers.Bounds(a.lon-h/2,a.lat-d/2,a.lon+h/2,a.lat+d/2)}return g},getCenter:function(){var a=null;if(this.center){a=this.center.clone()}return a},getZoom:function(){return this.zoom},pan:function(e,d,g){g=OpenLayers.Util.applyDefaults(g,{animate:true,dragging:false});var h=this.getViewPortPxFromLonLat(this.getCenter());var b=h.add(e,d);if(!g.dragging||!b.equals(h)){var a=this.getLonLatFromViewPortPx(b);if(g.animate){this.panTo(a)}else{this.setCenter(a,null,g.dragging)}}},panTo:function(b){if(this.panMethod&&this.getExtent().scale(this.panRatio).containsLonLat(b)){if(!this.panTween){this.panTween=new OpenLayers.Tween(this.panMethod)}var a=this.getCenter();if(b.lon==a.lon&&b.lat==a.lat){return}var e={lon:a.lon,lat:a.lat};var d={lon:b.lon,lat:b.lat};this.panTween.start(e,d,this.panDuration,{callbacks:{start:OpenLayers.Function.bind(function(g){this.events.triggerEvent("movestart")},this),eachStep:OpenLayers.Function.bind(function(g){g=new OpenLayers.LonLat(g.lon,g.lat);this.moveTo(g,this.zoom,{dragging:true,noEvent:true})},this),done:OpenLayers.Function.bind(function(g){g=new OpenLayers.LonLat(g.lon,g.lat);this.moveTo(g,this.zoom,{noEvent:true});this.events.triggerEvent("moveend")},this)}})}else{this.setCenter(b)}},setCenter:function(d,a,b,e){this.moveTo(d,a,{dragging:b,forceZoomChange:e,caller:"setCenter"})},moveTo:function(l,s,v){if(!v){v={}}var r=v.dragging;var d=v.forceZoomChange;var m=v.noEvent;if(this.panTween&&v.caller=="setCenter"){this.panTween.stop()}if(!this.center&&!this.isValidLonLat(l)){l=this.maxExtent.getCenterLonLat()}if(this.restrictedExtent!=null){if(l==null){l=this.getCenter()}if(s==null){s=this.getZoom()}var e=this.getResolutionForZoom(s);var t=this.calculateBounds(l,e);if(!this.restrictedExtent.containsBounds(t)){var u=this.restrictedExtent.getCenterLonLat();if(t.getWidth()>this.restrictedExtent.getWidth()){l=new OpenLayers.LonLat(u.lon,l.lat)}else{if(t.left<this.restrictedExtent.left){l=l.add(this.restrictedExtent.left-t.left,0)}else{if(t.right>this.restrictedExtent.right){l=l.add(this.restrictedExtent.right-t.right,0)}}}if(t.getHeight()>this.restrictedExtent.getHeight()){l=new OpenLayers.LonLat(l.lon,u.lat)}else{if(t.bottom<this.restrictedExtent.bottom){l=l.add(0,this.restrictedExtent.bottom-t.bottom)}else{if(t.top>this.restrictedExtent.top){l=l.add(0,this.restrictedExtent.top-t.top)}}}}}var b=d||((this.isValidZoomLevel(s))&&(s!=this.getZoom()));var g=(this.isValidLonLat(l))&&(!l.equals(this.center));if(b||g||!r){if(!this.dragging&&!m){this.events.triggerEvent("movestart")}if(g){if((!b)&&(this.center)){this.centerLayerContainer(l)}this.center=l.clone()}if((b)||(this.layerContainerOrigin==null)){this.layerContainerOrigin=this.center.clone();this.layerContainerDiv.style.left="0px";this.layerContainerDiv.style.top="0px"}if(b){this.zoom=s;this.resolution=this.getResolutionForZoom(s);this.viewRequestID++}var a=this.getExtent();if(this.baseLayer.visibility){this.baseLayer.moveTo(a,b,r);if(r){this.baseLayer.events.triggerEvent("move")}else{this.baseLayer.events.triggerEvent("moveend",{zoomChanged:b})}}a=this.baseLayer.getExtent();for(var h=0,p=this.layers.length;h<p;h++){var o=this.layers[h];if(o!==this.baseLayer&&!o.isBaseLayer){var q=o.calculateInRange();if(o.inRange!=q){o.inRange=q;if(!q){o.display(false)}this.events.triggerEvent("changelayer",{layer:o,property:"visibility"})}if(q&&o.visibility){o.moveTo(a,b,r);if(r){o.events.triggerEvent("move")}else{o.events.triggerEvent("moveend",{zoomChanged:b})}}}}if(b){for(var h=0,p=this.popups.length;h<p;h++){this.popups[h].updatePosition()}}this.events.triggerEvent("move");if(b){this.events.triggerEvent("zoomend")}}if(!r&&!m){this.events.triggerEvent("moveend")}this.dragging=!!r},centerLayerContainer:function(b){var a=this.getViewPortPxFromLonLat(this.layerContainerOrigin);var d=this.getViewPortPxFromLonLat(b);if((a!=null)&&(d!=null)){this.layerContainerDiv.style.left=Math.round(a.x-d.x)+"px";this.layerContainerDiv.style.top=Math.round(a.y-d.y)+"px"}},isValidZoomLevel:function(a){return((a!=null)&&(a>=0)&&(a<this.getNumZoomLevels()))},isValidLonLat:function(d){var b=false;if(d!=null){var a=this.getMaxExtent();b=a.containsLonLat(d)}return b},getProjection:function(){var a=this.getProjectionObject();return a?a.getCode():null},getProjectionObject:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.projection}return a},getMaxResolution:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.maxResolution}return a},getMaxExtent:function(b){var a=null;if(b&&b.restricted&&this.restrictedExtent){a=this.restrictedExtent}else{if(this.baseLayer!=null){a=this.baseLayer.maxExtent}}return a},getNumZoomLevels:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.numZoomLevels}return a},getExtent:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getExtent()}return a},getResolution:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getResolution()}return a},getUnits:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.units}return a},getScale:function(){var d=null;if(this.baseLayer!=null){var b=this.getResolution();var a=this.baseLayer.units;d=OpenLayers.Util.getScaleFromResolution(b,a)}return d},getZoomForExtent:function(d,b){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getZoomForExtent(d,b)}return a},getResolutionForZoom:function(b){var a=null;if(this.baseLayer){a=this.baseLayer.getResolutionForZoom(b)}return a},getZoomForResolution:function(a,d){var b=null;if(this.baseLayer!=null){b=this.baseLayer.getZoomForResolution(a,d)}return b},zoomTo:function(a){if(this.isValidZoomLevel(a)){this.setCenter(null,a)}},zoomIn:function(){this.zoomTo(this.getZoom()+1)},zoomOut:function(){this.zoomTo(this.getZoom()-1)},zoomToExtent:function(e,d){var b=e.getCenterLonLat();if(this.baseLayer.wrapDateLine){var a=this.getMaxExtent();e=e.clone();while(e.right<e.left){e.right+=a.getWidth()}b=e.getCenterLonLat().wrapDateLine(a)}this.setCenter(b,this.getZoomForExtent(e,d))},zoomToMaxExtent:function(d){var b=(d)?d.restricted:true;var a=this.getMaxExtent({restricted:b});this.zoomToExtent(a)},zoomToScale:function(m,l){var e=OpenLayers.Util.getResolutionFromScale(m,this.baseLayer.units);var d=this.getSize();var h=d.w*e;var b=d.h*e;var a=this.getCenter();var g=new OpenLayers.Bounds(a.lon-h/2,a.lat-b/2,a.lon+h/2,a.lat+b/2);this.zoomToExtent(g,l)},getLonLatFromViewPortPx:function(a){var b=null;if(this.baseLayer!=null){b=this.baseLayer.getLonLatFromViewPortPx(a)}return b},getViewPortPxFromLonLat:function(b){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getViewPortPxFromLonLat(b)}return a},getLonLatFromPixel:function(a){return this.getLonLatFromViewPortPx(a)},getPixelFromLonLat:function(b){var a=this.getViewPortPxFromLonLat(b);a.x=Math.round(a.x);a.y=Math.round(a.y);return a},getViewPortPxFromLayerPx:function(e){var d=null;if(e!=null){var b=parseInt(this.layerContainerDiv.style.left);var a=parseInt(this.layerContainerDiv.style.top);d=e.add(b,a)}return d},getLayerPxFromViewPortPx:function(d){var e=null;if(d!=null){var b=-parseInt(this.layerContainerDiv.style.left);var a=-parseInt(this.layerContainerDiv.style.top);e=d.add(b,a);if(isNaN(e.x)||isNaN(e.y)){e=null}}return e},getLonLatFromLayerPx:function(a){a=this.getViewPortPxFromLayerPx(a);return this.getLonLatFromViewPortPx(a)},getLayerPxFromLonLat:function(b){var a=this.getPixelFromLonLat(b);return this.getLayerPxFromViewPortPx(a)},CLASS_NAME:"OpenLayers.Map"});OpenLayers.Map.TILE_WIDTH=256;OpenLayers.Map.TILE_HEIGHT=256;OpenLayers.Marker=OpenLayers.Class({icon:null,lonlat:null,events:null,map:null,initialize:function(d,b){this.lonlat=d;var a=(b)?b:OpenLayers.Marker.defaultIcon();if(this.icon==null){this.icon=a}else{this.icon.url=a.url;this.icon.size=a.size;this.icon.offset=a.offset;this.icon.calculateOffset=a.calculateOffset}this.events=new OpenLayers.Events(this,this.icon.imageDiv,null)},destroy:function(){this.erase();this.map=null;this.events.destroy();this.events=null;if(this.icon!=null){this.icon.destroy();this.icon=null}},draw:function(a){return this.icon.draw(a)},erase:function(){if(this.icon!=null){this.icon.erase()}},moveTo:function(a){if((a!=null)&&(this.icon!=null)){this.icon.moveTo(a)}this.lonlat=this.map.getLonLatFromLayerPx(a)},isDrawn:function(){var a=(this.icon&&this.icon.isDrawn());return a},onScreen:function(){var b=false;if(this.map){var a=this.map.getExtent();b=a.containsLonLat(this.lonlat)}return b},inflate:function(b){if(this.icon){var a=new OpenLayers.Size(this.icon.size.w*b,this.icon.size.h*b);this.icon.setSize(a)}},setOpacity:function(a){this.icon.setOpacity(a)},setUrl:function(a){this.icon.setUrl(a)},display:function(a){this.icon.display(a)},CLASS_NAME:"OpenLayers.Marker"});OpenLayers.Marker.defaultIcon=function(){var a=OpenLayers.Util.getImagesLocation()+"marker.png";var b=new OpenLayers.Size(21,25);var d=function(e){return new OpenLayers.Pixel(-(e.w/2),-e.h)};return new OpenLayers.Icon(a,b,null,d)};OpenLayers.Popup.FramedCloud=OpenLayers.Class(OpenLayers.Popup.Framed,{contentDisplayClass:"olFramedCloudPopupContent",autoSize:true,panMapIfOutOfView:true,imageSize:new OpenLayers.Size(676,736),isAlphaImage:false,fixedRelativePosition:false,positionBlocks:{tl:{offset:new OpenLayers.Pixel(44,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",19),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-631)},{size:new OpenLayers.Size(22,18),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-638,-632)},{size:new OpenLayers.Size(81,35),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(0,-688)}]},tr:{offset:new OpenLayers.Pixel(-45,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",19),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-631)},{size:new OpenLayers.Size(22,19),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-638,-631)},{size:new OpenLayers.Size(81,35),anchor:new OpenLayers.Bounds(0,0,null,null),position:new OpenLayers.Pixel(-215,-687)}]},bl:{offset:new OpenLayers.Pixel(45,0),padding:new OpenLayers.Bounds(8,9,8,40),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,33),anchor:new OpenLayers.Bounds(null,null,0,0),position:new OpenLayers.Pixel(-101,-674)}]},br:{offset:new OpenLayers.Pixel(-44,0),padding:new OpenLayers.Bounds(8,9,8,40),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,33),anchor:new OpenLayers.Bounds(0,null,null,0),position:new OpenLayers.Pixel(-311,-674)}]}},minSize:new OpenLayers.Size(105,10),maxSize:new OpenLayers.Size(600,660),initialize:function(l,d,h,b,a,g,e){this.imageSrc=OpenLayers.Util.getImagesLocation()+"cloud-popup-relative.png";OpenLayers.Popup.Framed.prototype.initialize.apply(this,arguments);this.contentDiv.className=this.contentDisplayClass},destroy:function(){OpenLayers.Popup.Framed.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Popup.FramedCloud"});OpenLayers.Request={DEFAULT_CONFIG:{method:"GET",url:window.location.href,async:true,user:undefined,password:undefined,params:null,proxy:OpenLayers.ProxyHost,headers:{},data:null,callback:function(){},success:null,failure:null,scope:null},events:new OpenLayers.Events(this,null,["complete","success","failure"]),issue:function(e){var l=OpenLayers.Util.extend(this.DEFAULT_CONFIG,{proxy:OpenLayers.ProxyHost});e=OpenLayers.Util.applyDefaults(e,l);var h=new OpenLayers.Request.XMLHttpRequest();var a=e.url;if(e.params){var g=OpenLayers.Util.getParameterString(e.params);if(g.length>0){var o=(a.indexOf("?")>-1)?"&":"?";a+=o+g}}if(e.proxy&&(a.indexOf("http")==0)){a=e.proxy+encodeURIComponent(a)}h.open(e.method,a,e.async,e.user,e.password);for(var m in e.headers){h.setRequestHeader(m,e.headers[m])}var b=(e.scope)?OpenLayers.Function.bind(e.callback,e.scope):e.callback;var p;if(e.success){p=(e.scope)?OpenLayers.Function.bind(e.success,e.scope):e.success}var d;if(e.failure){d=(e.scope)?OpenLayers.Function.bind(e.failure,e.scope):e.failure}var q=this.events;h.onreadystatechange=function(){if(h.readyState==OpenLayers.Request.XMLHttpRequest.DONE){var r=q.triggerEvent("complete",{request:h,config:e,requestUrl:a});if(r!==false){b(h);if(!h.status||(h.status>=200&&h.status<300)){q.triggerEvent("success",{request:h,config:e,requestUrl:a});if(p){p(h)}}if(h.status&&(h.status<200||h.status>=300)){q.triggerEvent("failure",{request:h,config:e,requestUrl:a});if(d){d(h)}}}}};if(e.async===false){h.send(e.data)}else{window.setTimeout(function(){h.send(e.data)},0)}return h},GET:function(a){a=OpenLayers.Util.extend(a,{method:"GET"});return OpenLayers.Request.issue(a)},POST:function(a){a=OpenLayers.Util.extend(a,{method:"POST"});a.headers=a.headers?a.headers:{};if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(a.headers))){a.headers["Content-Type"]="application/xml"}return OpenLayers.Request.issue(a)},PUT:function(a){a=OpenLayers.Util.extend(a,{method:"PUT"});a.headers=a.headers?a.headers:{};if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(a.headers))){a.headers["Content-Type"]="application/xml"}return OpenLayers.Request.issue(a)},DELETE:function(a){a=OpenLayers.Util.extend(a,{method:"DELETE"});return OpenLayers.Request.issue(a)},HEAD:function(a){a=OpenLayers.Util.extend(a,{method:"HEAD"});return OpenLayers.Request.issue(a)},OPTIONS:function(a){a=OpenLayers.Util.extend(a,{method:"OPTIONS"});return OpenLayers.Request.issue(a)}};OpenLayers.Tile.Image=OpenLayers.Class(OpenLayers.Tile,{url:null,imgDiv:null,frame:null,layerAlphaHack:null,isBackBuffer:false,lastRatio:1,isFirstDraw:true,backBufferTile:null,initialize:function(e,a,g,b,d){OpenLayers.Tile.prototype.initialize.apply(this,arguments);this.url=b;this.frame=document.createElement("div");this.frame.style.overflow="hidden";this.frame.style.position="absolute";this.layerAlphaHack=this.layer.alpha&&OpenLayers.Util.alphaHack()},destroy:function(){if(this.imgDiv!=null){if(this.layerAlphaHack){OpenLayers.Event.stopObservingElement(this.imgDiv.childNodes[0].id)}OpenLayers.Event.stopObservingElement(this.imgDiv.id);if(this.imgDiv.parentNode==this.frame){this.frame.removeChild(this.imgDiv);this.imgDiv.map=null}this.imgDiv.urls=null;this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif"}this.imgDiv=null;if((this.frame!=null)&&(this.frame.parentNode==this.layer.div)){this.layer.div.removeChild(this.frame)}this.frame=null;if(this.backBufferTile){this.backBufferTile.destroy();this.backBufferTile=null}this.layer.events.unregister("loadend",this,this.resetBackBuffer);OpenLayers.Tile.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Tile.Image(this.layer,this.position,this.bounds,this.url,this.size)}a=OpenLayers.Tile.prototype.clone.apply(this,[a]);a.imgDiv=null;return a},draw:function(){if(this.layer!=this.layer.map.baseLayer&&this.layer.reproject){this.bounds=this.getBoundsFromBaseLayer(this.position)}var a=OpenLayers.Tile.prototype.draw.apply(this,arguments);if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(a){if(!this.backBufferTile){this.backBufferTile=this.clone();this.backBufferTile.hide();this.backBufferTile.isBackBuffer=true;this.events.register("loadend",this,this.resetBackBuffer);this.layer.events.register("loadend",this,this.resetBackBuffer)}this.startTransition()}else{if(this.backBufferTile){this.backBufferTile.clear()}}}else{if(a&&this.isFirstDraw){this.events.register("loadend",this,this.showTile);this.isFirstDraw=false}}if(!a){return false}if(this.isLoading){this.events.triggerEvent("reload")}else{this.isLoading=true;this.events.triggerEvent("loadstart")}return this.renderTile()},resetBackBuffer:function(){this.showTile();if(this.backBufferTile&&(this.isFirstDraw||!this.layer.numLoadingTiles)){this.isFirstDraw=false;var a=this.layer.maxExtent;var b=(a&&this.bounds.intersectsBounds(a,false));if(b){this.backBufferTile.position=this.position;this.backBufferTile.bounds=this.bounds;this.backBufferTile.size=this.size;this.backBufferTile.imageSize=this.layer.imageSize||this.size;this.backBufferTile.imageOffset=this.layer.imageOffset;this.backBufferTile.resolution=this.layer.getResolution();this.backBufferTile.renderTile()}this.backBufferTile.hide()}},renderTile:function(){if(this.imgDiv==null){this.initImgDiv()}this.imgDiv.viewRequestID=this.layer.map.viewRequestID;if(this.layer.async){this.layer.getURLasync(this.bounds,this,"url",this.positionImage)}else{if(this.layer.url instanceof Array){this.imgDiv.urls=this.layer.url.slice()}this.url=this.layer.getURL(this.bounds);this.positionImage()}return true},positionImage:function(){if(this.layer==null){return}OpenLayers.Util.modifyDOMElement(this.frame,null,this.position,this.size);var a=this.layer.getImageSize();if(this.layerAlphaHack){OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,null,a,this.url)}else{OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,a);this.imgDiv.src=this.url}},clear:function(){if(this.imgDiv){this.hide();if(OpenLayers.Tile.Image.useBlankTile){this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif"}}},initImgDiv:function(){var e=this.layer.imageOffset;var b=this.layer.getImageSize();if(this.layerAlphaHack){this.imgDiv=OpenLayers.Util.createAlphaImageDiv(null,e,b,null,"relative",null,null,null,true)}else{this.imgDiv=OpenLayers.Util.createImage(null,e,b,null,"relative",null,null,true)}this.imgDiv.className="olTileImage";this.frame.style.zIndex=this.isBackBuffer?0:1;this.frame.appendChild(this.imgDiv);this.layer.div.appendChild(this.frame);if(this.layer.opacity!=null){OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,null,null,null,null,this.layer.opacity)}this.imgDiv.map=this.layer.map;var d=function(){if(this.isLoading){this.isLoading=false;this.events.triggerEvent("loadend")}};if(this.layerAlphaHack){OpenLayers.Event.observe(this.imgDiv.childNodes[0],"load",OpenLayers.Function.bind(d,this))}else{OpenLayers.Event.observe(this.imgDiv,"load",OpenLayers.Function.bind(d,this))}var a=function(){if(this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS){d.call(this)}};OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(a,this))},checkImgURL:function(){if(this.layer){var a=this.layerAlphaHack?this.imgDiv.firstChild.src:this.imgDiv.src;if(!OpenLayers.Util.isEquivalentUrl(a,this.url)){this.hide()}}},startTransition:function(){if(!this.backBufferTile||!this.backBufferTile.imgDiv){return}var e=1;if(this.backBufferTile.resolution){e=this.backBufferTile.resolution/this.layer.getResolution()}if(e!=this.lastRatio){if(this.layer.transitionEffect=="resize"){var d=new OpenLayers.LonLat(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top);var b=new OpenLayers.Size(this.backBufferTile.size.w*e,this.backBufferTile.size.h*e);var a=this.layer.map.getLayerPxFromLonLat(d);OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,a,b);var g=this.backBufferTile.imageSize;g=new OpenLayers.Size(g.w*e,g.h*e);var h=this.backBufferTile.imageOffset;if(h){h=new OpenLayers.Pixel(h.x*e,h.y*e)}OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,h,g);this.backBufferTile.show()}}else{if(this.layer.singleTile){this.backBufferTile.show()}else{this.backBufferTile.hide()}}this.lastRatio=e},show:function(){this.frame.style.display="";if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.frame.scrollLeft=this.frame.scrollLeft}}},hide:function(){this.frame.style.display="none"},CLASS_NAME:"OpenLayers.Tile.Image"});OpenLayers.Tile.Image.useBlankTile=(OpenLayers.Util.getBrowserName()=="safari"||OpenLayers.Util.getBrowserName()=="opera");OpenLayers.Control.OverviewMap=OpenLayers.Class(OpenLayers.Control,{element:null,ovmap:null,size:new OpenLayers.Size(180,90),layers:null,minRectSize:15,minRectDisplayClass:"RectReplacement",minRatio:8,maxRatio:32,mapOptions:null,autoPan:false,handlers:null,resolutionFactor:1,initialize:function(a){this.layers=[];this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,[a])},destroy:function(){if(!this.mapDiv){return}this.handlers.click.destroy();this.mapDiv.removeChild(this.extentRectangle);this.extentRectangle=null;this.rectEvents.destroy();this.rectEvents=null;this.ovmap.destroy();this.ovmap=null;this.element.removeChild(this.mapDiv);this.mapDiv=null;this.div.removeChild(this.element);this.element=null;if(this.maximizeDiv){OpenLayers.Event.stopObservingElement(this.maximizeDiv);this.div.removeChild(this.maximizeDiv);this.maximizeDiv=null}if(this.minimizeDiv){OpenLayers.Event.stopObservingElement(this.minimizeDiv);this.div.removeChild(this.minimizeDiv);this.minimizeDiv=null}this.map.events.un({moveend:this.update,changebaselayer:this.baseLayerDraw,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!(this.layers.length>0)){if(this.map.baseLayer){var e=this.map.baseLayer.clone();this.layers=[e]}else{this.map.events.register("changebaselayer",this,this.baseLayerDraw);return this.div}}this.element=document.createElement("div");this.element.className=this.displayClass+"Element";this.element.style.display="none";this.mapDiv=document.createElement("div");this.mapDiv.style.width=this.size.w+"px";this.mapDiv.style.height=this.size.h+"px";this.mapDiv.style.position="relative";this.mapDiv.style.overflow="hidden";this.mapDiv.id=OpenLayers.Util.createUniqueID("overviewMap");this.extentRectangle=document.createElement("div");this.extentRectangle.style.position="absolute";this.extentRectangle.style.zIndex=1000;this.extentRectangle.className=this.displayClass+"ExtentRectangle";this.mapDiv.appendChild(this.extentRectangle);this.element.appendChild(this.mapDiv);this.div.appendChild(this.element);if(!this.outsideViewport){this.div.className+=" "+this.displayClass+"Container";var g=OpenLayers.Util.getImagesLocation();var b=g+"layer-switcher-maximize.png";this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+"MaximizeButton",null,new OpenLayers.Size(18,18),b,"absolute");this.maximizeDiv.style.display="none";this.maximizeDiv.className=this.displayClass+"MaximizeButton";OpenLayers.Event.observe(this.maximizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));this.div.appendChild(this.maximizeDiv);var b=g+"layer-switcher-minimize.png";this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_minimizeDiv",null,new OpenLayers.Size(18,18),b,"absolute");this.minimizeDiv.style.display="none";this.minimizeDiv.className=this.displayClass+"MinimizeButton";OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv);var h=["dblclick","mousedown"];for(var d=0,a=h.length;d<a;d++){OpenLayers.Event.observe(this.maximizeDiv,h[d],OpenLayers.Event.stop);OpenLayers.Event.observe(this.minimizeDiv,h[d],OpenLayers.Event.stop)}this.minimizeControl()}else{this.element.style.display=""}if(this.map.getExtent()){this.update()}this.map.events.register("moveend",this,this.update);return this.div},baseLayerDraw:function(){this.draw();this.map.events.unregister("changebaselayer",this,this.baseLayerDraw)},rectDrag:function(o){var e=this.handlers.drag.last.x-o.x;var b=this.handlers.drag.last.y-o.y;if(e!=0||b!=0){var l=this.rectPxBounds.top;var a=this.rectPxBounds.left;var g=Math.abs(this.rectPxBounds.getHeight());var d=this.rectPxBounds.getWidth();var h=Math.max(0,(l-b));h=Math.min(h,this.ovmap.size.h-this.hComp-g);var m=Math.max(0,(a-e));m=Math.min(m,this.ovmap.size.w-this.wComp-d);this.setRectPxBounds(new OpenLayers.Bounds(m,h+g,m+d,h))}},mapDivClick:function(o){var b=this.rectPxBounds.getCenterPixel();var g=o.xy.x-b.x;var e=o.xy.y-b.y;var l=this.rectPxBounds.top;var d=this.rectPxBounds.left;var p=Math.abs(this.rectPxBounds.getHeight());var a=this.rectPxBounds.getWidth();var h=Math.max(0,(l+e));h=Math.min(h,this.ovmap.size.h-p);var m=Math.max(0,(d+g));m=Math.min(m,this.ovmap.size.w-a);this.setRectPxBounds(new OpenLayers.Bounds(m,h+p,m+a,h));this.updateMapToRect()},maximizeControl:function(a){this.element.style.display="";this.showToggle(false);if(a!=null){OpenLayers.Event.stop(a)}},minimizeControl:function(a){this.element.style.display="none";this.showToggle(true);if(a!=null){OpenLayers.Event.stop(a)}},showToggle:function(a){this.maximizeDiv.style.display=a?"":"none";this.minimizeDiv.style.display=a?"none":""},update:function(){if(this.ovmap==null){this.createMap()}if(this.autoPan||!this.isSuitableOverview()){this.updateOverview()}this.updateRectToMap()},isSuitableOverview:function(){var b=this.map.getExtent();var a=this.map.maxExtent;var d=new OpenLayers.Bounds(Math.max(b.left,a.left),Math.max(b.bottom,a.bottom),Math.min(b.right,a.right),Math.min(b.top,a.top));if(this.ovmap.getProjection()!=this.map.getProjection()){d=d.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}var e=this.ovmap.getResolution()/this.map.getResolution();return((e>this.minRatio)&&(e<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(d)))},updateOverview:function(){var d=this.map.getResolution();var b=this.ovmap.getResolution();var e=b/d;if(e>this.maxRatio){b=this.minRatio*d}else{if(e<=this.minRatio){b=this.maxRatio*d}}var a;if(this.ovmap.getProjection()!=this.map.getProjection()){a=this.map.center.clone();a.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{a=this.map.center}this.ovmap.setCenter(a,this.ovmap.getZoomForResolution(b*this.resolutionFactor));this.updateRectToMap()},createMap:function(){var b=OpenLayers.Util.extend({controls:[],maxResolution:"auto",fallThrough:false},this.mapOptions);this.ovmap=new OpenLayers.Map(this.mapDiv,b);OpenLayers.Event.stopObserving(window,"unload",this.ovmap.unloadDestroy);this.ovmap.addLayers(this.layers);this.ovmap.zoomToMaxExtent();this.wComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-right-width"));this.wComp=(this.wComp)?this.wComp:2;this.hComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-bottom-width"));this.hComp=(this.hComp)?this.hComp:2;this.handlers.drag=new OpenLayers.Handler.Drag(this,{move:this.rectDrag,done:this.updateMapToRect},{map:this.ovmap});this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.mapDivClick},{single:true,"double":false,stopSingle:true,stopDouble:true,pixelTolerance:1,map:this.ovmap});this.handlers.click.activate();this.rectEvents=new OpenLayers.Events(this,this.extentRectangle,null,true);this.rectEvents.register("mouseover",this,function(g){if(!this.handlers.drag.active&&!this.map.dragging){this.handlers.drag.activate()}});this.rectEvents.register("mouseout",this,function(g){if(!this.handlers.drag.dragging){this.handlers.drag.deactivate()}});if(this.ovmap.getProjection()!=this.map.getProjection()){var d=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units;var a=this.ovmap.getProjectionObject().getUnits()||this.ovmap.units||this.ovmap.baseLayer.units;this.resolutionFactor=d&&a?OpenLayers.INCHES_PER_UNIT[d]/OpenLayers.INCHES_PER_UNIT[a]:1}},updateRectToMap:function(){var b;if(this.ovmap.getProjection()!=this.map.getProjection()){b=this.map.getExtent().transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{b=this.map.getExtent()}var a=this.getRectBoundsFromMapBounds(b);if(a){this.setRectPxBounds(a)}},updateMapToRect:function(){var a=this.getMapBoundsFromRectBounds(this.rectPxBounds);if(this.ovmap.getProjection()!=this.map.getProjection()){a=a.transform(this.ovmap.getProjectionObject(),this.map.getProjectionObject())}this.map.panTo(a.getCenterLonLat())},setRectPxBounds:function(e){var l=Math.max(e.top,0);var g=Math.max(e.left,0);var b=Math.min(e.top+Math.abs(e.getHeight()),this.ovmap.size.h-this.hComp);var m=Math.min(e.left+e.getWidth(),this.ovmap.size.w-this.wComp);var d=Math.max(m-g,0);var o=Math.max(b-l,0);if(d<this.minRectSize||o<this.minRectSize){this.extentRectangle.className=this.displayClass+this.minRectDisplayClass;var h=g+(d/2)-(this.minRectSize/2);var a=l+(o/2)-(this.minRectSize/2);this.extentRectangle.style.top=Math.round(a)+"px";this.extentRectangle.style.left=Math.round(h)+"px";this.extentRectangle.style.height=this.minRectSize+"px";this.extentRectangle.style.width=this.minRectSize+"px"}else{this.extentRectangle.className=this.displayClass+"ExtentRectangle";this.extentRectangle.style.top=Math.round(l)+"px";this.extentRectangle.style.left=Math.round(g)+"px";this.extentRectangle.style.height=Math.round(o)+"px";this.extentRectangle.style.width=Math.round(d)+"px"}this.rectPxBounds=new OpenLayers.Bounds(Math.round(g),Math.round(b),Math.round(m),Math.round(l))},getRectBoundsFromMapBounds:function(e){var a=new OpenLayers.LonLat(e.left,e.bottom);var h=new OpenLayers.LonLat(e.right,e.top);var d=this.getOverviewPxFromLonLat(a);var b=this.getOverviewPxFromLonLat(h);var g=null;if(d&&b){g=new OpenLayers.Bounds(d.x,d.y,b.x,b.y)}return g},getMapBoundsFromRectBounds:function(e){var d=new OpenLayers.Pixel(e.left,e.bottom);var b=new OpenLayers.Pixel(e.right,e.top);var a=this.getLonLatFromOverviewPx(d);var g=this.getLonLatFromOverviewPx(b);return new OpenLayers.Bounds(a.lon,a.lat,g.lon,g.lat)},getLonLatFromOverviewPx:function(h){var d=this.ovmap.size;var b=this.ovmap.getResolution();var a=this.ovmap.getExtent().getCenterLonLat();var g=h.x-(d.w/2);var e=h.y-(d.h/2);return new OpenLayers.LonLat(a.lon+g*b,a.lat-e*b)},getOverviewPxFromLonLat:function(e){var b=this.ovmap.getResolution();var d=this.ovmap.getExtent();var a=null;if(d){a=new OpenLayers.Pixel(Math.round(1/b*(e.lon-d.left)),Math.round(1/b*(d.top-e.lat)))}return a},CLASS_NAME:"OpenLayers.Control.OverviewMap"});OpenLayers.Feature=OpenLayers.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:OpenLayers.Popup.AnchoredBubble,popup:null,initialize:function(a,d,b){this.layer=a;this.lonlat=d;this.data=(b!=null)?b:{};this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){if((this.layer!=null)&&(this.layer.map!=null)){if(this.popup!=null){this.layer.map.removePopup(this.popup)}}this.layer=null;this.id=null;this.lonlat=null;this.data=null;if(this.marker!=null){this.destroyMarker(this.marker);this.marker=null}if(this.popup!=null){this.destroyPopup(this.popup);this.popup=null}},onScreen:function(){var b=false;if((this.layer!=null)&&(this.layer.map!=null)){var a=this.layer.map.getExtent();b=a.containsLonLat(this.lonlat)}return b},createMarker:function(){if(this.lonlat!=null){this.marker=new OpenLayers.Marker(this.lonlat,this.data.icon)}return this.marker},destroyMarker:function(){this.marker.destroy()},createPopup:function(b){if(this.lonlat!=null){var d=this.id+"_popup";var a=(this.marker)?this.marker.icon:null;if(!this.popup){this.popup=new this.popupClass(d,this.lonlat,this.data.popupSize,this.data.popupContentHTML,a,b)}if(this.data.overflow!=null){this.popup.contentDiv.style.overflow=this.data.overflow}this.popup.feature=this}return this.popup},destroyPopup:function(){if(this.popup){this.popup.feature=null;this.popup.destroy();this.popup=null}},CLASS_NAME:"OpenLayers.Feature"});OpenLayers.Format.WFSCapabilities=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.1.0",version:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);this.options=a},read:function(g){if(typeof g=="string"){g=OpenLayers.Format.XML.prototype.read.apply(this,[g])}var d=g.documentElement;var b=this.version;if(!b){b=d.getAttribute("version");if(!b){b=this.defaultVersion}}var e=OpenLayers.Format.WFSCapabilities["v"+b.replace(/\./g,"_")];if(!e){throw"Can't find a WFS capabilities parser for version "+b}var h=new e(this.options);var a=h.read(g);a.version=b;return a},CLASS_NAME:"OpenLayers.Format.WFSCapabilities"});OpenLayers.Format.WFSDescribeFeatureType=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xsd:"http://www.w3.org/2001/XMLSchema"},initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},readers:{xsd:{schema:function(e,o){var g=[];var b={};var h={complexTypes:g,customTypes:b};this.readChildNodes(e,h);var l=e.attributes;var q,a;for(var m=0,p=l.length;m<p;++m){q=l[m];a=q.name;if(a.indexOf("xmlns")==0){this.setNamespace(a.split(":")[1]||"",q.value)}else{o[a]=q.value}}o.featureTypes=g;o.targetPrefix=this.namespaceAlias[o.targetNamespace];var r,d;for(var m=0,p=g.length;m<p;++m){r=g[m];d=b[r.typeName];if(b[r.typeName]){r.typeName=d.name}}},complexType:function(b,d){var a={typeName:b.getAttribute("name")};this.readChildNodes(b,a);d.complexTypes.push(a)},complexContent:function(a,b){this.readChildNodes(a,b)},extension:function(a,b){this.readChildNodes(a,b)},sequence:function(a,b){var d={elements:[]};this.readChildNodes(a,d);b.properties=d.elements},element:function(a,d){if(d.elements){var e={};var b=a.attributes;var l;for(var g=0,h=b.length;g<h;++g){l=b[g];e[l.name]=l.value}var m=e.type;if(!m){m={};this.readChildNodes(a,m);e.restriction=m;e.type=m.base}var p=m.base||m;e.localType=p.split(":").pop();d.elements.push(e)}if(d.complexTypes){var m=a.getAttribute("type");var o=m.split(":").pop();d.customTypes[o]={name:a.getAttribute("name"),type:m}}},simpleType:function(a,b){this.readChildNodes(a,b)},restriction:function(a,b){b.base=a.getAttribute("base");this.readRestriction(a,b)}}},readRestriction:function(e,h){var d=e.childNodes;var m,l,g;for(var b=0,a=d.length;b<a;++b){m=d[b];if(m.nodeType==1){l=m.nodeName.split(":").pop();g=m.getAttribute("value");if(!h[l]){h[l]=g}else{if(typeof h[l]=="string"){h[l]=[h[l]]}h[l].push(g)}}}},read:function(b){if(typeof b=="string"){b=OpenLayers.Format.XML.prototype.read.apply(this,[b])}if(b&&b.nodeType==9){b=b.documentElement}var a={};this.readNode(b,a);return a},CLASS_NAME:"OpenLayers.Format.WFSDescribeFeatureType"});OpenLayers.Format.WFST.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",wfs:"http://www.opengis.net/wfs",gml:"http://www.opengis.net/gml",ogc:"http://www.opengis.net/ogc"},defaultPrefix:"wfs",version:null,schemaLocations:null,srsName:null,extractAttributes:true,xy:true,stateName:null,initialize:function(a){this.stateName={};this.stateName[OpenLayers.State.INSERT]="wfs:Insert";this.stateName[OpenLayers.State.UPDATE]="wfs:Update";this.stateName[OpenLayers.State.DELETE]="wfs:Delete";OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},getSrsName:function(d,b){var a=b&&b.srsName;if(!a){if(d&&d.layer){a=d.layer.projection.getCode()}else{a=this.srsName}}return a},read:function(a){if(typeof a=="string"){a=OpenLayers.Format.XML.prototype.read.apply(this,[a])}if(a&&a.nodeType==9){a=a.documentElement}var b={};this.readNode(a,b);if(b.features){b=b.features}return b},readers:{wfs:{FeatureCollection:function(a,b){b.features=[];this.readChildNodes(a,b)}}},write:function(a){var b=this.writeNode("wfs:Transaction",a);var d=this.schemaLocationAttr();if(d){this.setAttributeNS(b,this.namespaces.xsi,"xsi:schemaLocation",d)}return OpenLayers.Format.XML.prototype.write.apply(this,[b])},writers:{wfs:{GetFeature:function(a){var b=this.createElementNSPlus("wfs:GetFeature",{attributes:{service:"WFS",version:this.version,maxFeatures:a&&a.maxFeatures,"xsi:schemaLocation":this.schemaLocationAttr(a)}});this.writeNode("Query",a,b);return b},Query:function(a){a=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},a);var b=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(a.featureNS?a.featurePrefix+":":"")+a.featureType,srsName:a.srsName}});if(a.featureNS){b.setAttribute("xmlns:"+a.featurePrefix,a.featureNS)}if(a.filter){this.setFilterProperty(a.filter);this.writeNode("ogc:Filter",a.filter,b)}return b},Transaction:function(g){var h=this.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version}});if(g){var b,e;for(var d=0,a=g.length;d<a;++d){e=g[d];b=this.stateName[e.state];if(b){this.writeNode(b,e,h)}}}return h},Insert:function(a){var b=this.createElementNSPlus("wfs:Insert");this.srsName=this.getSrsName(a);this.writeNode("feature:_typeName",a,b);return b},Update:function(b){var d=this.createElementNSPlus("wfs:Update",{attributes:{typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}});if(this.featureNS){d.setAttribute("xmlns:"+this.featurePrefix,this.featureNS)}this.writeNode("Property",{name:this.geometryName,value:b},d);for(var a in b.attributes){this.writeNode("Property",{name:a,value:b.attributes[a]},d)}this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[b.fid]}),d);return d},Property:function(b){var a=this.createElementNSPlus("wfs:Property");this.writeNode("Name",b.name,a);this.writeNode("Value",b.value,a);return a},Name:function(a){return this.createElementNSPlus("wfs:Name",{value:a})},Value:function(d){var b;if(d instanceof OpenLayers.Feature.Vector){b=this.createElementNSPlus("wfs:Value");this.srsName=this.getSrsName(d);var a=this.writeNode("feature:_geometry",d.geometry).firstChild;b.appendChild(a)}else{b=this.createElementNSPlus("wfs:Value",{value:d})}return b},Delete:function(a){var b=this.createElementNSPlus("wfs:Delete",{attributes:{typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}});if(this.featureNS){b.setAttribute("xmlns:"+this.featurePrefix,this.featureNS)}this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[a.fid]}),b);return b}}},schemaLocationAttr:function(a){a=OpenLayers.Util.extend({featurePrefix:this.featurePrefix,schema:this.schema},a);var h=OpenLayers.Util.extend({},this.schemaLocations);if(a.schema){h[a.featurePrefix]=a.schema}var g=[];var d;for(var b in h){d=this.namespaces[b];if(d){g.push(d+" "+h[b])}}var e=g.join(" ")||undefined;return e},setFilterProperty:function(d){if(d.filters){for(var b=0,a=d.filters.length;b<a;++b){this.setFilterProperty(d.filters[b])}}else{if(d instanceof OpenLayers.Filter.Spatial){d.property=this.geometryName}}},CLASS_NAME:"OpenLayers.Format.WFST.v1"});OpenLayers.Format.WMC=OpenLayers.Class({defaultVersion:"1.1.0",version:null,layerOptions:null,layerParams:null,parser:null,initialize:function(a){OpenLayers.Util.extend(this,a);this.options=a},read:function(g,d){if(typeof g=="string"){g=OpenLayers.Format.XML.prototype.read.apply(this,[g])}var b=g.documentElement;var a=this.version;if(!a){a=b.getAttribute("version");if(!a){a=this.defaultVersion}}if(!this.parser||this.parser.VERSION!=a){var l=OpenLayers.Format.WMC["v"+a.replace(/\./g,"_")];if(!l){throw"Can't find a WMC parser for version "+a}this.parser=new l(this.options)}var e=this.parser.read(g,d);var h;if(d.map){this.context=e;if(d.map instanceof OpenLayers.Map){h=this.mergeContextToMap(e,d.map)}else{h=this.contextToMap(e,d.map)}}else{h=e}return h},contextToMap:function(a,d){var b=new OpenLayers.Map(d,{maxExtent:a.maxExtent,projection:a.projection});b.addLayers(a.layers);b.setCenter(a.bounds.getCenterLonLat(),b.getZoomForExtent(a.bounds,true));return b},mergeContextToMap:function(a,b){b.addLayers(a.layers);return b},write:function(g,b){if(g.CLASS_NAME=="OpenLayers.Map"){g=this.mapToContext(g)}var a=(b&&b.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=a){var e=OpenLayers.Format.WMC["v"+a.replace(/\./g,"_")];if(!e){throw"Can't find a WMS capabilities parser for version "+a}this.parser=new e(this.options)}var d=this.parser.write(g,b);return d},mapToContext:function(b){var a={bounds:b.getExtent(),maxExtent:b.maxExtent,projection:b.projection,layers:b.layers,size:b.getSize()};return a},CLASS_NAME:"OpenLayers.Format.WMC"});OpenLayers.Format.WMSCapabilities.v1_1=OpenLayers.Class(OpenLayers.Format.XML,{initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);this.options=a},read:function(d){if(typeof d=="string"){d=OpenLayers.Format.XML.prototype.read.apply(this,[d])}var a={};var b=d.documentElement;this.runChildNodes(a,b);return a},runChildNodes:function(h,g){var d=g.childNodes;var b,e;for(var a=0;a<d.length;++a){b=d[a];if(b.nodeType==1){e=this["read_cap_"+b.nodeName];if(e){e.apply(this,[h,b])}}}},read_cap_Capability:function(a,d){var b={layers:[]};this.runChildNodes(b,d);a.capability=b},read_cap_Request:function(d,b){var a={};this.runChildNodes(a,b);d.request=a},read_cap_GetMap:function(d,b){var a={formats:[]};this.runChildNodes(a,b);d.getmap=a},read_cap_Format:function(b,a){if(b.formats){b.formats.push(this.getChildValue(a))}},read_cap_DCPType:function(d,b){var a=b.getElementsByTagName("OnlineResource");if(a.length>0){this.read_cap_OnlineResource(d,a[0])}},read_cap_Service:function(b,d){var a={};this.runChildNodes(a,d);b.service=a},read_cap_Layer:function(b,g,h){var m={formats:b.request.getmap.formats||[],styles:[],queryable:(g.getAttribute("queryable")==="1"||g.getAttribute("queryable")==="true")};if(h){m.styles=m.styles.concat(h.styles);m.llbbox=h.llbbox;m.minScale=h.minScale;m.maxScale=h.maxScale}var d=g.childNodes;var a,p,e;for(var l=0;l<d.length;++l){a=d[l];p=a.nodeName;e=this["read_cap_"+a.nodeName];if(e){if(p=="Layer"){e.apply(this,[b,a,m])}else{e.apply(this,[m,a])}}}if(m.name){var o=m.name.indexOf(":");if(o>0){m.prefix=m.name.substring(0,o)}b.layers.push(m)}},read_cap_ScaleHint:function(g,h){var e=h.getAttribute("min");var a=h.getAttribute("max");var d=Math.pow(2,0.5);var b=OpenLayers.INCHES_PER_UNIT.m;g.maxScale=parseFloat(((d*e)*b*OpenLayers.DOTS_PER_INCH).toPrecision(13));g.minScale=parseFloat(((d*a)*b*OpenLayers.DOTS_PER_INCH).toPrecision(13))},read_cap_Name:function(d,b){var a=this.getChildValue(b);if(a){d.name=a}},read_cap_Title:function(b,a){var d=this.getChildValue(a);if(d){b.title=d}},read_cap_Abstract:function(d,b){var a=this.getChildValue(b);if(a){d["abstract"]=a}},read_cap_LatLonBoundingBox:function(a,b){a.llbbox=[parseFloat(b.getAttribute("minx")),parseFloat(b.getAttribute("miny")),parseFloat(b.getAttribute("maxx")),parseFloat(b.getAttribute("maxy"))]},read_cap_Style:function(a,d){var b={};this.runChildNodes(b,d);a.styles.push(b)},read_cap_LegendURL:function(d,e){var b={width:e.getAttribute("width"),height:e.getAttribute("height")};var a=e.getElementsByTagName("OnlineResource");if(a.length>0){this.read_cap_OnlineResource(b,a[0])}d.legend=b},read_cap_OnlineResource:function(b,a){b.href=this.getAttributeNS(a,"http://www.w3.org/1999/xlink","href")},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1"});OpenLayers.Format.WMSDescribeLayer=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.1.1",version:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);this.options=a},read:function(g){if(typeof g=="string"){g=OpenLayers.Format.XML.prototype.read.apply(this,[g])}var d=g.documentElement;var b=this.version;if(!b){b=d.getAttribute("version");if(!b){b=this.defaultVersion}}if(b=="1.1.1"||b=="1.1.0"){b="1.1"}var e=OpenLayers.Format.WMSDescribeLayer["v"+b.replace(/\./g,"_")];if(!e){throw"Can't find a WMS DescribeLayer parser for version "+b}var h=new e(this.options);var a=h.read(g);a.version=b;return a},CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer"});OpenLayers.Format.WMSGetFeatureInfo=OpenLayers.Class(OpenLayers.Format.XML,{layerIdentifier:"_layer",featureIdentifier:"_feature",regExes:{trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s*/g)},gmlFormat:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,arguments);OpenLayers.Util.extend(this,a);this.options=a},read:function(g){var a;if(typeof g=="string"){g=OpenLayers.Format.XML.prototype.read.apply(this,[g])}var b=g.documentElement;if(b){var d=this;var e=this["read_"+b.nodeName];if(e){a=e.call(this,b)}else{a=new OpenLayers.Format.GML((this.options?this.options:{})).read(g)}}else{a=g}return a},read_msGMLOutput:function(l){var e=[];var b=this.getSiblingNodesByTagCriteria(l,this.layerIdentifier);if(b){for(var m=0,q=b.length;m<q;++m){var d=b[m];var o=d.nodeName;if(d.prefix){o=o.split(":")[1]}var o=o.replace(this.layerIdentifier,"");var p=this.getSiblingNodesByTagCriteria(d,this.featureIdentifier);if(p){for(var h=0;h<p.length;h++){var a=p[h];var r=this.parseGeometry(a);var g=this.parseAttributes(a);var s=new OpenLayers.Feature.Vector(r,g,null);s.type=o;e.push(s)}}}}return e},read_FeatureInfoResponse:function(h){var d=[];var m=this.getElementsByTagNameNS(h,"*","FIELDS");for(var l=0,o=m.length;l<o;l++){var a=m[l];var p=null;var g={};for(var e=0,q=a.attributes.length;e<q;e++){var b=a.attributes[e];g[b.nodeName]=b.nodeValue}d.push(new OpenLayers.Feature.Vector(p,g,null))}return d},getSiblingNodesByTagCriteria:function(h,o){var a=[];var d,g,e,l,b;if(h&&h.hasChildNodes()){d=h.childNodes;e=d.length;for(var m=0;m<e;m++){b=d[m];while(b&&b.nodeType!=1){b=b.nextSibling;m++}g=(b?b.nodeName:"");if(g.length>0&&g.indexOf(o)>-1){a.push(b)}else{l=this.getSiblingNodesByTagCriteria(b,o);if(l.length>0){(a.length==0)?a=l:a.push(l)}}}}return a},parseAttributes:function(e){var g={};if(e.nodeType==1){var d=e.childNodes;n=d.length;for(var h=0;h<n;++h){var b=d[h];if(b.nodeType==1){var o=b.childNodes;if(o.length==1){var m=o[0];if(m.nodeType==3||m.nodeType==4){var a=(b.prefix)?b.nodeName.split(":")[1]:b.nodeName;var l=m.nodeValue.replace(this.regExes.trimSpace,"");g[a]=l}}}}}return g},parseGeometry:function(b){if(!this.gmlFormat){this.gmlFormat=new OpenLayers.Format.GML()}var a=this.gmlFormat.parseFeature(b);var d=null;if(a&&a.geometry){d=a.geometry.clone();a.destroy()}return d},CLASS_NAME:"OpenLayers.Format.WMSGetFeatureInfo"});OpenLayers.Handler.Click=OpenLayers.Class(OpenLayers.Handler,{delay:300,single:true,"double":false,pixelTolerance:0,stopSingle:false,stopDouble:false,timerId:null,down:null,rightclickTimerId:null,initialize:function(d,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments);if(this.pixelTolerance!=null){this.mousedown=function(e){this.down=e.xy;return true}}},mousedown:null,mouseup:function(b){var a=true;if(this.checkModifiers(b)&&this.control.handleRightClicks&&OpenLayers.Event.isRightClick(b)){a=this.rightclick(b)}return a},rightclick:function(b){if(this.passesTolerance(b)){if(this.rightclickTimerId!=null){this.clearTimer();this.callback("dblrightclick",[b]);return !this.stopDouble}else{var a=this["double"]?OpenLayers.Util.extend({},b):this.callback("rightclick",[b]);var d=OpenLayers.Function.bind(this.delayedRightCall,this,a);this.rightclickTimerId=window.setTimeout(d,this.delay)}}return !this.stopSingle},delayedRightCall:function(a){this.rightclickTimerId=null;if(a){this.callback("rightclick",[a])}return !this.stopSingle},dblclick:function(a){if(this.passesTolerance(a)){if(this["double"]){this.callback("dblclick",[a])}this.clearTimer()}return !this.stopDouble},click:function(b){if(this.passesTolerance(b)){if(this.timerId!=null){this.clearTimer()}else{var a=this.single?OpenLayers.Util.extend({},b):null;this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,a),this.delay)}}return !this.stopSingle},passesTolerance:function(b){var d=true;if(this.pixelTolerance!=null&&this.down){var a=Math.sqrt(Math.pow(this.down.x-b.xy.x,2)+Math.pow(this.down.y-b.xy.y,2));if(a>this.pixelTolerance){d=false}}return d},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId);this.timerId=null}if(this.rightclickTimerId!=null){window.clearTimeout(this.rightclickTimerId);this.rightclickTimerId=null}},delayedCall:function(a){this.timerId=null;if(a){this.callback("click",[a])}},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();this.down=null;a=true}return a},CLASS_NAME:"OpenLayers.Handler.Click"});OpenLayers.Handler.Drag=OpenLayers.Class(OpenLayers.Handler,{started:false,stopDown:true,dragging:false,last:null,start:null,oldOnselectstart:null,interval:0,timeoutId:null,initialize:function(d,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},down:function(a){},move:function(a){},up:function(a){},out:function(a){},mousedown:function(b){var a=true;this.dragging=false;if(this.checkModifiers(b)&&OpenLayers.Event.isLeftClick(b)){this.started=true;this.start=b.xy;this.last=b.xy;OpenLayers.Element.addClass(this.map.viewPortDiv,"olDragDown");this.down(b);this.callback("down",[b.xy]);OpenLayers.Event.stop(b);if(!this.oldOnselectstart){this.oldOnselectstart=(document.onselectstart)?document.onselectstart:function(){return true};document.onselectstart=function(){return false}}a=!this.stopDown}else{this.started=false;this.start=null;this.last=null}return a},mousemove:function(a){if(this.started&&!this.timeoutId&&(a.xy.x!=this.last.x||a.xy.y!=this.last.y)){if(this.interval>0){this.timeoutId=setTimeout(OpenLayers.Function.bind(this.removeTimeout,this),this.interval)}this.dragging=true;this.move(a);this.callback("move",[a.xy]);if(!this.oldOnselectstart){this.oldOnselectstart=document.onselectstart;document.onselectstart=function(){return false}}this.last=this.evt.xy}return true},removeTimeout:function(){this.timeoutId=null},mouseup:function(b){if(this.started){var a=(this.start!=this.last);this.started=false;this.dragging=false;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.up(b);this.callback("up",[b.xy]);if(a){this.callback("done",[b.xy])}document.onselectstart=this.oldOnselectstart}return true},mouseout:function(b){if(this.started&&OpenLayers.Util.mouseLeft(b,this.map.div)){var a=(this.start!=this.last);this.started=false;this.dragging=false;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.out(b);this.callback("out",[]);if(a){this.callback("done",[b.xy])}if(document.onselectstart){document.onselectstart=this.oldOnselectstart}}return true},click:function(a){return(this.start==this.last)},activate:function(){var a=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragging=false;a=true}return a},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.started=false;this.dragging=false;this.start=null;this.last=null;a=true;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown")}return a},CLASS_NAME:"OpenLayers.Handler.Drag"});OpenLayers.Handler.Feature=OpenLayers.Class(OpenLayers.Handler,{EVENTMAP:{click:{"in":"click",out:"clickout"},mousemove:{"in":"over",out:"out"},dblclick:{"in":"dblclick",out:null},mousedown:{"in":null,out:null},mouseup:{"in":null,out:null}},feature:null,lastFeature:null,down:null,up:null,clickTolerance:4,geometryTypes:null,stopClick:true,stopDown:true,stopUp:false,initialize:function(e,b,d,a){OpenLayers.Handler.prototype.initialize.apply(this,[e,d,a]);this.layer=b},mousedown:function(a){this.down=a.xy;return this.handle(a)?!this.stopDown:true},mouseup:function(a){this.up=a.xy;return this.handle(a)?!this.stopUp:true},click:function(a){return this.handle(a)?!this.stopClick:true},mousemove:function(a){if(!this.callbacks.over&&!this.callbacks.out){return true}this.handle(a);return true},dblclick:function(a){return !this.handle(a)},geometryTypeMatches:function(a){return this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,a.geometry.CLASS_NAME)>-1},handle:function(a){if(this.feature&&!this.feature.layer){this.feature=null}var d=a.type;var h=false;var g=!!(this.feature);var e=(d=="click"||d=="dblclick");this.feature=this.layer.getFeatureFromEvent(a);if(this.feature&&!this.feature.layer){this.feature=null}if(this.lastFeature&&!this.lastFeature.layer){this.lastFeature=null}if(this.feature){var b=(this.feature!=this.lastFeature);if(this.geometryTypeMatches(this.feature)){if(g&&b){if(this.lastFeature){this.triggerCallback(d,"out",[this.lastFeature])}this.triggerCallback(d,"in",[this.feature])}else{if(!g||e){this.triggerCallback(d,"in",[this.feature])}}this.lastFeature=this.feature;h=true}else{if(this.lastFeature&&(g&&b||e)){this.triggerCallback(d,"out",[this.lastFeature])}this.feature=null}}else{if(this.lastFeature&&(g||e)){this.triggerCallback(d,"out",[this.lastFeature])}}return h},triggerCallback:function(e,g,b){var d=this.EVENTMAP[e][g];if(d){if(e=="click"&&this.up&&this.down){var a=Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2));if(a<=this.clickTolerance){this.callback(d,b)}}else{this.callback(d,b)}}},activate:function(){var a=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.moveLayerToTop();this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});a=true}return a},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.moveLayerBack();this.feature=null;this.lastFeature=null;this.down=null;this.up=null;this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});a=true}return a},handleMapEvents:function(a){if(!a.property||a.property=="order"){this.moveLayerToTop()}},moveLayerToTop:function(){var a=Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1;this.layer.setZIndex(a)},moveLayerBack:function(){var a=this.layer.getZIndex()-1;if(a>=this.map.Z_INDEX_BASE.Feature){this.layer.setZIndex(a)}else{this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))}},CLASS_NAME:"OpenLayers.Handler.Feature"});OpenLayers.Handler.Hover=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:false,px:null,timerId:null,initialize:function(d,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},mousemove:function(a){if(this.passesTolerance(a.xy)){this.clearTimer();this.callback("move",[a]);this.px=a.xy;a=OpenLayers.Util.extend({},a);this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,a),this.delay)}return !this.stopMove},mouseout:function(a){if(OpenLayers.Util.mouseLeft(a,this.map.div)){this.clearTimer();this.callback("move",[a])}return true},passesTolerance:function(b){var d=true;if(this.pixelTolerance&&this.px){var a=Math.sqrt(Math.pow(this.px.x-b.x,2)+Math.pow(this.px.y-b.y,2));if(a<this.pixelTolerance){d=false}}return d},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId);this.timerId=null}},delayedCall:function(a){this.callback("pause",[a])},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();a=true}return a},CLASS_NAME:"OpenLayers.Handler.Hover"});OpenLayers.Handler.Keyboard=OpenLayers.Class(OpenLayers.Handler,{KEY_EVENTS:["keydown","keyup"],eventListener:null,initialize:function(d,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.eventListener=OpenLayers.Function.bindAsEventListener(this.handleKeyEvent,this)},destroy:function(){this.deactivate();this.eventListener=null;OpenLayers.Handler.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){for(var b=0,a=this.KEY_EVENTS.length;b<a;b++){OpenLayers.Event.observe(document,this.KEY_EVENTS[b],this.eventListener)}return true}else{return false}},deactivate:function(){var d=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){for(var b=0,a=this.KEY_EVENTS.length;b<a;b++){OpenLayers.Event.stopObserving(document,this.KEY_EVENTS[b],this.eventListener)}d=true}return d},handleKeyEvent:function(a){if(this.checkModifiers(a)){this.callback(a.type,[a])}},CLASS_NAME:"OpenLayers.Handler.Keyboard"});OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener:null,mousePosition:null,initialize:function(d,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.wheelListener=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this)},destroy:function(){OpenLayers.Handler.prototype.destroy.apply(this,arguments);this.wheelListener=null},onWheelEvent:function(p){if(!this.map||!this.checkModifiers(p)){return}var l=false;var q=false;var h=false;var b=OpenLayers.Event.element(p);while((b!=null)&&!h&&!l){if(!l){try{if(b.currentStyle){d=b.currentStyle.overflow}else{var a=document.defaultView.getComputedStyle(b,null);var d=a.getPropertyValue("overflow")}l=(d&&(d=="auto")||(d=="scroll"))}catch(g){}}if(!q){for(var m=0,o=this.map.layers.length;m<o;m++){if(b==this.map.layers[m].div||b==this.map.layers[m].pane){q=true;break}}}h=(b==this.map.div);b=b.parentNode}if(!l&&h){if(q){this.wheelZoom(p)}OpenLayers.Event.stop(p)}},wheelZoom:function(a){var b=0;if(!a){a=window.event}if(a.wheelDelta){b=a.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){b=-b}}else{if(a.detail){b=-a.detail/3}}if(b){if(this.mousePosition){a.xy=this.mousePosition}if(!a.xy){a.xy=this.map.getPixelFromLonLat(this.map.getCenter())}if(b<0){this.callback("down",[a,b])}else{this.callback("up",[a,b])}}},mousemove:function(a){this.mousePosition=a.xy},activate:function(a){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var b=this.wheelListener;OpenLayers.Event.observe(window,"DOMMouseScroll",b);OpenLayers.Event.observe(window,"mousewheel",b);OpenLayers.Event.observe(document,"mousewheel",b);return true}else{return false}},deactivate:function(a){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){var b=this.wheelListener;OpenLayers.Event.stopObserving(window,"DOMMouseScroll",b);OpenLayers.Event.stopObserving(window,"mousewheel",b);OpenLayers.Event.stopObserving(document,"mousewheel",b);return true}else{return false}},CLASS_NAME:"OpenLayers.Handler.MouseWheel"});OpenLayers.Layer=OpenLayers.Class({id:null,name:null,div:null,opacity:null,alwaysInRange:null,EVENT_TYPES:["loadstart","loadend","loadcancel","visibilitychanged","move","moveend"],events:null,map:null,isBaseLayer:false,alpha:false,displayInLayerSwitcher:true,visibility:true,attribution:null,inRange:false,imageSize:null,imageOffset:null,options:null,eventListeners:null,gutter:0,projection:null,units:null,scales:null,resolutions:null,maxExtent:null,minExtent:null,maxResolution:null,minResolution:null,numZoomLevels:null,minScale:null,maxScale:null,displayOutsideMaxExtent:false,wrapDateLine:false,transitionEffect:null,SUPPORTED_TRANSITIONS:["resize"],initialize:function(b,a){this.addOptions(a);this.name=b;if(this.id==null){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");this.div=OpenLayers.Util.createDiv(this.id);this.div.style.width="100%";this.div.style.height="100%";this.div.dir="ltr";this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES);if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}}if(this.wrapDateLine){this.displayOutsideMaxExtent=true}},destroy:function(a){if(a==null){a=true}if(this.map!=null){this.map.removeLayer(this,a)}this.projection=null;this.map=null;this.name=null;this.div=null;this.options=null;if(this.events){if(this.eventListeners){this.events.un(this.eventListeners)}this.events.destroy()}this.eventListeners=null;this.events=null},clone:function(a){if(a==null){a=new OpenLayers.Layer(this.name,this.options)}OpenLayers.Util.applyDefaults(a,this);a.map=null;return a},setName:function(a){if(a!=this.name){this.name=a;if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"name"})}}},addOptions:function(a){if(this.options==null){this.options={}}OpenLayers.Util.extend(this.options,a);OpenLayers.Util.extend(this,a)},onMapResize:function(){},redraw:function(){var b=false;if(this.map){this.inRange=this.calculateInRange();var d=this.getExtent();if(d&&this.inRange&&this.visibility){var a=true;this.moveTo(d,a,false);this.events.triggerEvent("moveend",{zoomChanged:a});b=true}}return b},moveTo:function(b,a,d){var e=this.visibility;if(!this.isBaseLayer){e=e&&this.inRange}this.display(e)},setMap:function(b){if(this.map==null){this.map=b;this.maxExtent=this.maxExtent||this.map.maxExtent;this.projection=this.projection||this.map.projection;if(this.projection&&typeof this.projection=="string"){this.projection=new OpenLayers.Projection(this.projection)}this.units=this.projection.getUnits()||this.units||this.map.units;this.initResolutions();if(!this.isBaseLayer){this.inRange=this.calculateInRange();var a=((this.visibility)&&(this.inRange));this.div.style.display=a?"":"none"}this.setTileSize()}},afterAdd:function(){},removeMap:function(a){},getImageSize:function(){return(this.imageSize||this.tileSize)},setTileSize:function(a){var b=(a)?a:((this.tileSize)?this.tileSize:this.map.getTileSize());this.tileSize=b;if(this.gutter){this.imageOffset=new OpenLayers.Pixel(-this.gutter,-this.gutter);this.imageSize=new OpenLayers.Size(b.w+(2*this.gutter),b.h+(2*this.gutter))}},getVisibility:function(){return this.visibility},setVisibility:function(a){if(a!=this.visibility){this.visibility=a;this.display(a);this.redraw();if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"visibility"})}this.events.triggerEvent("visibilitychanged")}},display:function(a){var b=this.calculateInRange();if(a!=(this.div.style.display!="none")){this.div.style.display=(a&&b)?"block":"none"}},calculateInRange:function(){var b=false;if(this.alwaysInRange){b=true}else{if(this.map){var a=this.map.getResolution();b=((a>=this.minResolution)&&(a<=this.maxResolution))}}return b},setIsBaseLayer:function(a){if(a!=this.isBaseLayer){this.isBaseLayer=a;if(this.map!=null){this.map.events.triggerEvent("changebaselayer",{layer:this})}}},initResolutions:function(){var s=new Array("projection","units","scales","resolutions","maxScale","minScale","maxResolution","minResolution","minExtent","maxExtent","numZoomLevels","maxZoomLevel");var b=["projection","units"];var g=false;var e={};for(var h=0,o=s.length;h<o;h++){var u=s[h];if(this.options[u]&&OpenLayers.Util.indexOf(b,u)==-1){g=true}e[u]=this.options[u]||this.map[u]}if(this.alwaysInRange==null){this.alwaysInRange=!g}if((this.options.minScale!=null||this.options.maxScale!=null)&&this.options.scales==null){e.scales=null}if((this.options.minResolution!=null||this.options.maxResolution!=null)&&this.options.resolutions==null){e.resolutions=null}if((!e.numZoomLevels)&&(e.maxZoomLevel)){e.numZoomLevels=e.maxZoomLevel+1}if((e.scales!=null)||(e.resolutions!=null)){if(e.scales!=null){e.resolutions=[];for(var h=0,o=e.scales.length;h<o;h++){var d=e.scales[h];e.resolutions[h]=OpenLayers.Util.getResolutionFromScale(d,e.units)}}e.numZoomLevels=e.resolutions.length}else{if(e.minScale){e.maxResolution=OpenLayers.Util.getResolutionFromScale(e.minScale,e.units)}else{if(e.maxResolution=="auto"){var t=this.map.getSize();var r=e.maxExtent.getWidth()/t.w;var m=e.maxExtent.getHeight()/t.h;e.maxResolution=Math.max(r,m)}}if(e.maxScale!=null){e.minResolution=OpenLayers.Util.getResolutionFromScale(e.maxScale,e.units)}else{if((e.minResolution=="auto")&&(e.minExtent!=null)){var t=this.map.getSize();var r=e.minExtent.getWidth()/t.w;var m=e.minExtent.getHeight()/t.h;e.minResolution=Math.max(r,m)}}if(e.minResolution!=null&&this.options.numZoomLevels==undefined){var q=e.maxResolution/e.minResolution;e.numZoomLevels=Math.floor(Math.log(q)/Math.log(2))+1}e.resolutions=new Array(e.numZoomLevels);var a=2;if(typeof e.minResolution=="number"&&e.numZoomLevels>1){a=Math.pow((e.maxResolution/e.minResolution),(1/(e.numZoomLevels-1)))}for(var h=0;h<e.numZoomLevels;h++){var p=e.maxResolution/Math.pow(a,h);e.resolutions[h]=p}}e.resolutions.sort(function(w,v){return(v-w)});this.resolutions=e.resolutions;this.maxResolution=e.resolutions[0];var l=e.resolutions.length-1;this.minResolution=e.resolutions[l];this.scales=[];for(var h=0,o=e.resolutions.length;h<o;h++){this.scales[h]=OpenLayers.Util.getScaleFromResolution(e.resolutions[h],e.units)}this.minScale=this.scales[0];this.maxScale=this.scales[this.scales.length-1];this.numZoomLevels=e.numZoomLevels},getResolution:function(){var a=this.map.getZoom();return this.getResolutionForZoom(a)},getExtent:function(){return this.map.calculateBounds()},getZoomForExtent:function(b,d){var e=this.map.getSize();var a=Math.max(b.getWidth()/e.w,b.getHeight()/e.h);return this.getZoomForResolution(a,d)},getDataExtent:function(){},getResolutionForZoom:function(d){d=Math.max(0,Math.min(d,this.resolutions.length-1));var b;if(this.map.fractionalZoom){var a=Math.floor(d);var e=Math.ceil(d);b=this.resolutions[a]-((d-a)*(this.resolutions[a]-this.resolutions[e]))}else{b=this.resolutions[Math.round(d)]}return b},getZoomForResolution:function(g,a){var s;if(this.map.fractionalZoom){var p=0;var d=this.resolutions.length-1;var e=this.resolutions[p];var b=this.resolutions[d];var o;for(var h=0,l=this.resolutions.length;h<l;++h){o=this.resolutions[h];if(o>=g){e=o;p=h}if(o<=g){b=o;d=h;break}}var m=e-b;if(m>0){s=p+((e-g)/m)}else{s=p}}else{var q;var r=Number.POSITIVE_INFINITY;for(var h=0,l=this.resolutions.length;h<l;h++){if(a){q=Math.abs(this.resolutions[h]-g);if(q>r){break}r=q}else{if(this.resolutions[h]<g){break}}}s=Math.max(0,h-1)}return s},getLonLatFromViewPortPx:function(b){var g=null;if(b!=null){var e=this.map.getSize();var a=this.map.getCenter();if(a){var d=this.map.getResolution();var l=b.x-(e.w/2);var h=b.y-(e.h/2);g=new OpenLayers.LonLat(a.lon+l*d,a.lat-h*d);if(this.wrapDateLine){g=g.wrapDateLine(this.maxExtent)}}}return g},getViewPortPxFromLonLat:function(e){var b=null;if(e!=null){var a=this.map.getResolution();var d=this.map.getExtent();b=new OpenLayers.Pixel((1/a*(e.lon-d.left)),(1/a*(d.top-e.lat)))}return b},setOpacity:function(b){if(b!=this.opacity){this.opacity=b;for(var e=0,a=this.div.childNodes.length;e<a;++e){var d=this.div.childNodes[e].firstChild;OpenLayers.Util.modifyDOMElement(d,null,null,null,null,null,null,b)}}},getZIndex:function(){return this.div.style.zIndex},setZIndex:function(a){this.div.style.zIndex=a},adjustBounds:function(b){if(this.gutter){var a=this.gutter*this.map.getResolution();b=new OpenLayers.Bounds(b.left-a,b.bottom-a,b.right+a,b.top+a)}if(this.wrapDateLine){var d={rightTolerance:this.getResolution()};b=b.wrapDateLine(this.maxExtent,d)}return b},CLASS_NAME:"OpenLayers.Layer"});OpenLayers.Marker.Box=OpenLayers.Class(OpenLayers.Marker,{bounds:null,div:null,initialize:function(b,d,a){this.bounds=b;this.div=OpenLayers.Util.createDiv();this.div.style.overflow="hidden";this.events=new OpenLayers.Events(this,this.div,null);this.setBorder(d,a)},destroy:function(){this.bounds=null;this.div=null;OpenLayers.Marker.prototype.destroy.apply(this,arguments)},setBorder:function(a,b){if(!a){a="red"}if(!b){b=2}this.div.style.border=b+"px solid "+a},draw:function(a,b){OpenLayers.Util.modifyDOMElement(this.div,null,a,b);return this.div},onScreen:function(){var b=false;if(this.map){var a=this.map.getExtent();b=a.containsBounds(this.bounds,true,true)}return b},display:function(a){this.div.style.display=(a)?"":"none"},CLASS_NAME:"OpenLayers.Marker.Box"});(function(){var e=window.XMLHttpRequest;var m=!!window.controllers,g=window.document.all&&!window.opera;function d(){this._object=e?new e:new window.ActiveXObject("Microsoft.XMLHTTP")}if(m&&e.wrapped){d.wrapped=e.wrapped}d.UNSENT=0;d.OPENED=1;d.HEADERS_RECEIVED=2;d.LOADING=3;d.DONE=4;d.prototype.readyState=d.UNSENT;d.prototype.responseText="";d.prototype.responseXML=null;d.prototype.status=0;d.prototype.statusText="";d.prototype.onreadystatechange=null;d.onreadystatechange=null;d.onopen=null;d.onsend=null;d.onabort=null;d.prototype.open=function(r,u,q,v,p){this._async=q;var t=this,s=this.readyState;if(g){var o=function(){if(t._object.readyState!=d.DONE){a(t)}};if(q){window.attachEvent("onunload",o)}}this._object.onreadystatechange=function(){if(m&&!q){return}t.readyState=t._object.readyState;l(t);if(t._aborted){t.readyState=d.UNSENT;return}if(t.readyState==d.DONE){a(t);if(g&&q){window.detachEvent("onunload",o)}}if(s!=t.readyState){h(t)}s=t.readyState};if(d.onopen){d.onopen.apply(this,arguments)}this._object.open(r,u,q,v,p);if(!q&&m){this.readyState=d.OPENED;h(this)}};d.prototype.send=function(o){if(d.onsend){d.onsend.apply(this,arguments)}if(o&&o.nodeType){o=window.XMLSerializer?new window.XMLSerializer().serializeToString(o):o.xml;if(!this._headers["Content-Type"]){this._object.setRequestHeader("Content-Type","application/xml")}}this._object.send(o);if(m&&!this._async){this.readyState=d.OPENED;l(this);while(this.readyState<d.DONE){this.readyState++;h(this);if(this._aborted){return}}}};d.prototype.abort=function(){if(d.onabort){d.onabort.apply(this,arguments)}if(this.readyState>d.UNSENT){this._aborted=true}this._object.abort();a(this)};d.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};d.prototype.getResponseHeader=function(o){return this._object.getResponseHeader(o)};d.prototype.setRequestHeader=function(o,p){if(!this._headers){this._headers={}}this._headers[o]=p;return this._object.setRequestHeader(o,p)};d.prototype.toString=function(){return"[object XMLHttpRequest]"};d.toString=function(){return"[XMLHttpRequest]"};function h(o){if(o.onreadystatechange){o.onreadystatechange.apply(o)}if(d.onreadystatechange){d.onreadystatechange.apply(o)}}function b(p){var o=p.responseXML;if(g&&o&&!o.documentElement&&p.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)){o=new ActiveXObject("Microsoft.XMLDOM");o.loadXML(p.responseText)}if(o){if((g&&o.parseError!=0)||(o.documentElement&&o.documentElement.tagName=="parsererror")){return null}}return o}function l(o){try{o.responseText=o._object.responseText}catch(p){}try{o.responseXML=b(o._object)}catch(p){}try{o.status=o._object.status}catch(p){}try{o.statusText=o._object.statusText}catch(p){}}function a(o){o._object.onreadystatechange=new window.Function;delete o._headers}if(!window.Function.prototype.apply){window.Function.prototype.apply=function(o,p){if(!p){p=[]}o.__func=this;o.__func(p[0],p[1],p[2],p[3],p[4]);delete o.__func}}OpenLayers.Request.XMLHttpRequest=d})();OpenLayers.ProxyHost="";OpenLayers.nullHandler=function(a){OpenLayers.Console.userError(OpenLayers.i18n("unhandledRequest",{statusText:a.statusText}))};OpenLayers.loadURL=function(e,l,b,g,d){if(typeof l=="string"){l=OpenLayers.Util.getParameters(l)}var h=(g)?g:OpenLayers.nullHandler;var a=(d)?d:OpenLayers.nullHandler;return OpenLayers.Request.GET({url:e,params:l,success:h,failure:a,scope:b})};OpenLayers.parseXMLString=function(d){var a=d.indexOf("<");if(a>0){d=d.substring(a)}var b=OpenLayers.Util.Try(function(){var e=new ActiveXObject("Microsoft.XMLDOM");e.loadXML(d);return e},function(){return new DOMParser().parseFromString(d,"text/xml")},function(){var e=new XMLHttpRequest();e.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(d),false);if(e.overrideMimeType){e.overrideMimeType("text/xml")}e.send(null);return e.responseXML});return b};OpenLayers.Ajax={emptyFunction:function(){},getTransport:function(){return OpenLayers.Util.Try(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};OpenLayers.Ajax.Responders={responders:[],register:function(b){for(var a=0;a<this.responders.length;a++){if(b==this.responders[a]){return}}this.responders.push(b)},unregister:function(a){OpenLayers.Util.removeItem(this.reponders,a)},dispatch:function(l,d,h){var a;for(var b=0;b<this.responders.length;b++){a=this.responders[b];if(a[l]&&typeof a[l]=="function"){try{a[l].apply(a,[d,h])}catch(g){}}}}};OpenLayers.Ajax.Responders.register({onCreate:function(){OpenLayers.Ajax.activeRequestCount++},onComplete:function(){OpenLayers.Ajax.activeRequestCount--}});OpenLayers.Ajax.Base=OpenLayers.Class({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/xml",parameters:""};OpenLayers.Util.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(typeof this.options.parameters=="string"){this.options.parameters=OpenLayers.Util.getParameters(this.options.parameters)}}});OpenLayers.Ajax.Request=OpenLayers.Class(OpenLayers.Ajax.Base,{_complete:false,initialize:function(b,a){OpenLayers.Ajax.Base.prototype.initialize.apply(this,[a]);if(OpenLayers.ProxyHost&&OpenLayers.String.startsWith(b,"http")){b=OpenLayers.ProxyHost+encodeURIComponent(b)}this.transport=OpenLayers.Ajax.getTransport();this.request(b)},request:function(b){this.url=b;this.method=this.options.method;var g=OpenLayers.Util.extend({},this.options.parameters);if(this.method!="get"&&this.method!="post"){g._method=this.method;this.method="post"}this.parameters=g;if(g=OpenLayers.Util.getParameterString(g)){if(this.method=="get"){this.url+=((this.url.indexOf("?")>-1)?"&":"?")+g}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){g+="&_="}}}try{var a=new OpenLayers.Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(a)}OpenLayers.Ajax.Responders.dispatch("onCreate",this,a);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){window.setTimeout(OpenLayers.Function.bind(this.respondToReadyState,this,1),10)}this.transport.onreadystatechange=OpenLayers.Function.bind(this.onStateChange,this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||g):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(d){this.dispatchException(d)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var g={"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*",OpenLayers:true};if(this.method=="post"){g["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){g.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var d=this.options.requestHeaders;if(typeof d.push=="function"){for(var b=0,e=d.length;b<e;b+=2){g[d[b]]=d[b+1]}}else{for(var b in d){g[b]=d[b]}}}for(var a in g){this.transport.setRequestHeader(a,g[a])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var d=OpenLayers.Ajax.Request.Events[a];var b=new OpenLayers.Ajax.Response(this);if(d=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||OpenLayers.Ajax.emptyFunction)(b)}catch(g){this.dispatchException(g)}var h=b.getHeader("Content-type")}try{(this.options["on"+d]||OpenLayers.Ajax.emptyFunction)(b);OpenLayers.Ajax.Responders.dispatch("on"+d,this,b)}catch(g){this.dispatchException(g)}if(d=="Complete"){this.transport.onreadystatechange=OpenLayers.Ajax.emptyFunction}},getHeader:function(a){try{return this.transport.getResponseHeader(a)}catch(b){return null}},dispatchException:function(d){var e=this.options.onException;if(e){e(this,d);OpenLayers.Ajax.Responders.dispatch("onException",this,d)}else{var g=false;var a=OpenLayers.Ajax.Responders.responders;for(var b=0;b<a.length;b++){if(a[b].onException){g=true;break}}if(g){OpenLayers.Ajax.Responders.dispatch("onException",this,d)}else{throw d}}}});OpenLayers.Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];OpenLayers.Ajax.Response=OpenLayers.Class({status:0,statusText:"",initialize:function(d){this.request=d;var e=this.transport=d.transport,a=this.readyState=e.readyState;if((a>2&&!(!!(window.attachEvent&&!window.opera)))||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=e.responseText==null?"":String(e.responseText)}if(a==4){var b=e.responseXML;this.responseXML=b===undefined?null:b}},getStatus:OpenLayers.Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:OpenLayers.Ajax.Request.prototype.getHeader,getResponseHeader:function(a){return this.transport.getResponseHeader(a)}});OpenLayers.Ajax.getElementsByTagNameNS=function(b,a,d,g){var e=null;if(b.getElementsByTagNameNS){e=b.getElementsByTagNameNS(a,g)}else{e=b.getElementsByTagName(d+":"+g)}return e};OpenLayers.Ajax.serializeXMLToString=function(a){var b=new XMLSerializer();var d=b.serializeToString(a);return d};OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,onStart:function(b,a){},onDrag:function(b,a){},onComplete:function(b,a){},layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(b,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.layer=b;this.handlers={drag:new OpenLayers.Handler.Drag(this,OpenLayers.Util.extend({down:this.downFeature,move:this.moveFeature,up:this.upFeature,out:this.cancel,done:this.doneDragging},this.dragCallbacks)),feature:new OpenLayers.Handler.Feature(this,this.layer,OpenLayers.Util.extend({over:this.overFeature,out:this.outFeature},this.featureCallbacks),{geometryTypes:this.geometryTypes})}},destroy:function(){this.layer=null;OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return(this.handlers.feature.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments))},deactivate:function(){this.handlers.drag.deactivate();this.handlers.feature.deactivate();this.feature=null;this.dragging=false;this.lastPixel=null;OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over");return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},overFeature:function(a){if(!this.handlers.drag.dragging){this.feature=a;this.handlers.drag.activate();this.over=true;OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass+"Over")}else{if(this.feature.id==a.id){this.over=true}else{this.over=false}}},downFeature:function(a){this.lastPixel=a;this.onStart(this.feature,a)},moveFeature:function(a){var b=this.map.getResolution();this.feature.geometry.move(b*(a.x-this.lastPixel.x),b*(this.lastPixel.y-a.y));this.layer.drawFeature(this.feature);this.lastPixel=a;this.onDrag(this.feature,a)},upFeature:function(a){if(!this.over){this.handlers.drag.deactivate()}},doneDragging:function(a){this.onComplete(this.feature,a)},outFeature:function(a){if(!this.handlers.drag.dragging){this.over=false;this.handlers.drag.deactivate();OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over");this.feature=null}else{if(this.feature.id==a.id){this.over=false}}},cancel:function(){this.handlers.drag.deactivate();this.over=false},setMap:function(a){this.handlers.drag.setMap(a);this.handlers.feature.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.DragFeature"});OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,panned:false,interval:25,draw:function(){this.handler=new OpenLayers.Handler.Drag(this,{move:this.panMap,done:this.panMapDone},{interval:this.interval})},panMap:function(a){this.panned=true;this.map.pan(this.handler.last.x-a.x,this.handler.last.y-a.y,{dragging:this.handler.dragging,animate:false})},panMapDone:function(a){if(this.panned){this.panMap(a);this.panned=false}},CLASS_NAME:"OpenLayers.Control.DragPan"});OpenLayers.Control.KeyboardDefaults=OpenLayers.Class(OpenLayers.Control,{slideFactor:75,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){if(this.handler){this.handler.destroy()}this.handler=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){this.handler=new OpenLayers.Handler.Keyboard(this,{keydown:this.defaultKeyPress});this.activate()},defaultKeyPress:function(a){switch(a.keyCode){case OpenLayers.Event.KEY_LEFT:this.map.pan(-this.slideFactor,0);break;case OpenLayers.Event.KEY_RIGHT:this.map.pan(this.slideFactor,0);break;case OpenLayers.Event.KEY_UP:this.map.pan(0,-this.slideFactor);break;case OpenLayers.Event.KEY_DOWN:this.map.pan(0,this.slideFactor);break;case 33:var b=this.map.getSize();this.map.pan(0,-0.75*b.h);break;case 34:var b=this.map.getSize();this.map.pan(0,0.75*b.h);break;case 35:var b=this.map.getSize();this.map.pan(0.75*b.w,0);break;case 36:var b=this.map.getSize();this.map.pan(-0.75*b.w,0);break;case 43:case 61:case 187:case 107:this.map.zoomIn();break;case 45:case 109:case 189:case 95:this.map.zoomOut();break}},CLASS_NAME:"OpenLayers.Control.KeyboardDefaults"});OpenLayers.Control.WMSGetFeatureInfo=OpenLayers.Class(OpenLayers.Control,{hover:false,maxFeatures:10,layers:null,queryVisible:false,url:null,layerUrls:null,infoFormat:"text/html",vendorParams:{},format:null,formatOptions:null,handlerOptions:null,handler:null,hoverRequest:null,EVENT_TYPES:["getfeatureinfo"],initialize:function(a){this.EVENT_TYPES=OpenLayers.Control.WMSGetFeatureInfo.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);a=a||{};a.handlerOptions=a.handlerOptions||{};OpenLayers.Control.prototype.initialize.apply(this,[a]);if(!this.format){this.format=new OpenLayers.Format.WMSGetFeatureInfo(a.formatOptions)}if(this.hover){this.handler=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.getInfoForHover},OpenLayers.Util.extend(this.handlerOptions.hover||{},{delay:250}))}else{this.handler=new OpenLayers.Handler.Click(this,{click:this.getInfoForClick},this.handlerOptions.click||{})}},activate:function(){if(!this.active){this.handler.activate()}return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},getInfoForClick:function(a){OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");this.request(a.xy,{})},getInfoForHover:function(a){this.request(a.xy,{hover:true})},cancelHover:function(){if(this.hoverRequest){this.hoverRequest.abort();this.hoverRequest=null}},findLayers:function(){var h=[];var g=this.layers||this.map.layers;var e,b;for(var d=0,a=g.length;d<a;++d){e=g[d];if(e instanceof OpenLayers.Layer.WMS&&(!this.queryVisible||e.getVisibility())){b=e.url instanceof Array?e.url[0]:e.url;if(!this.url){this.url=b}if(this.urlMatches(b)){h.push(e)}}}return h},urlMatches:function(b){var e=OpenLayers.Util.isEquivalentUrl(this.url,b);if(!e&&this.layerUrls){for(var d=0,a=this.layerUrls.length;d<a;++d){if(OpenLayers.Util.isEquivalentUrl(this.layerUrls[d],b)){e=true;break}}}return e},request:function(a,o){o=o||{};var h=[];var l=[];var d=this.findLayers();if(d.length>0){for(var e=0,g=d.length;e<g;e++){h=h.concat(d[e].params.LAYERS);if(d[e].params.STYLES){l=l.concat(d[e].params.STYLES)}else{if(d[e].params.LAYERS instanceof Array){l=l.concat(new Array(d[e].params.LAYERS.length))}else{l=l.concat(d[e].params.LAYERS.replace(/[^,]/g,""))}}}var m={url:this.url,params:OpenLayers.Util.applyDefaults({service:"WMS",version:"1.1.0",request:"GetFeatureInfo",layers:h,query_layers:h,styles:l,bbox:this.map.getExtent().toBBOX(),srs:this.map.getProjection(),feature_count:this.maxFeatures,x:a.x,y:a.y,height:this.map.getSize().h,width:this.map.getSize().w,info_format:this.infoFormat},this.vendorParams),callback:function(p){this.handleResponse(a,p)},scope:this};var b=OpenLayers.Request.GET(m);if(o.hover===true){this.hoverRequest=b.priv}}else{OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")}},handleResponse:function(e,b){var d=b.responseXML;if(!d||!d.documentElement){d=b.responseText}var a=this.format.read(d);this.events.triggerEvent("getfeatureinfo",{text:b.responseText,features:a,request:b,xy:e});OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},setMap:function(a){this.handler.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.WMSGetFeatureInfo"});OpenLayers.State={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"};OpenLayers.Feature.Vector=OpenLayers.Class(OpenLayers.Feature,{fid:null,geometry:null,attributes:null,bounds:null,state:null,style:null,renderIntent:"default",initialize:function(d,a,b){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,a]);this.lonlat=null;this.geometry=d?d:null;this.state=null;this.attributes={};if(a){this.attributes=OpenLayers.Util.extend(this.attributes,a)}this.style=b?b:null},destroy:function(){if(this.layer){this.layer.removeFeatures(this);this.layer=null}this.geometry=null;OpenLayers.Feature.prototype.destroy.apply(this,arguments)},clone:function(){return new OpenLayers.Feature.Vector(this.geometry?this.geometry.clone():null,this.attributes,this.style)},onScreen:function(e){var d=false;if(this.layer&&this.layer.map){var a=this.layer.map.getExtent();if(e){var b=this.geometry.getBounds();d=a.intersectsBounds(b)}else{var g=a.toGeometry();d=g.intersects(this.geometry)}}return d},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(b,e,d){var a=false;if(this.geometry){a=this.geometry.atPoint(b,e,d)}return a},destroyPopup:function(){},move:function(a){if(!this.layer||!this.geometry.move){return}var b;if(a.CLASS_NAME=="OpenLayers.LonLat"){b=this.layer.getViewPortPxFromLonLat(a)}else{b=a}var e=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat());var d=this.layer.map.getResolution();this.geometry.move(d*(b.x-e.x),d*(e.y-b.y));this.layer.drawFeature(this);return e},toState:function(a){if(a==OpenLayers.State.UPDATE){switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.DELETE:this.state=a;break;case OpenLayers.State.UPDATE:case OpenLayers.State.INSERT:break}}else{if(a==OpenLayers.State.INSERT){switch(this.state){case OpenLayers.State.UNKNOWN:break;default:this.state=a;break}}else{if(a==OpenLayers.State.DELETE){switch(this.state){case OpenLayers.State.INSERT:break;case OpenLayers.State.DELETE:break;case OpenLayers.State.UNKNOWN:case OpenLayers.State.UPDATE:this.state=a;break}}else{if(a==OpenLayers.State.UNKNOWN){this.state=a}}}}},CLASS_NAME:"OpenLayers.Feature.Vector"});OpenLayers.Feature.Vector.style={"default":{fillColor:"#ee9900",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},select:{fillColor:"blue",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer"},temporary:{fillColor:"#66cccc",fillOpacity:0.2,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#66cccc",strokeOpacity:1,strokeLinecap:"round",strokeWidth:2,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},"delete":{display:"none"}};OpenLayers.Feature.WFS=OpenLayers.Class(OpenLayers.Feature,{initialize:function(d,b){var a=arguments;var e=this.processXMLNode(b);a=new Array(d,e.lonlat,e);OpenLayers.Feature.prototype.initialize.apply(this,a);this.createMarker();this.layer.addMarker(this.marker)},destroy:function(){if(this.marker!=null){this.layer.removeMarker(this.marker)}OpenLayers.Feature.prototype.destroy.apply(this,arguments)},processXMLNode:function(b){var a=OpenLayers.Ajax.getElementsByTagNameNS(b,"http://www.opengis.net/gml","gml","Point");var e=OpenLayers.Util.getXmlNodeValue(OpenLayers.Ajax.getElementsByTagNameNS(a[0],"http://www.opengis.net/gml","gml","coordinates")[0]);var d=e.split(",");return{lonlat:new OpenLayers.LonLat(parseFloat(d[0]),parseFloat(d[1])),id:null}},CLASS_NAME:"OpenLayers.Feature.WFS"});OpenLayers.Format.WFSCapabilities.v1=OpenLayers.Class(OpenLayers.Format.WFSCapabilities,{initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);this.options=a},read:function(d){if(typeof d=="string"){d=OpenLayers.Format.XML.prototype.read.apply(this,[d])}var a={};var b=d.documentElement;this.runChildNodes(a,b);return a},runChildNodes:function(h,g){var d=g.childNodes;var b,e;for(var a=0;a<d.length;++a){b=d[a];if(b.nodeType==1){e=this["read_cap_"+b.nodeName];if(e){e.apply(this,[h,b])}}}},read_cap_FeatureTypeList:function(d,b){var a={featureTypes:[]};this.runChildNodes(a,b);d.featureTypeList=a},read_cap_FeatureType:function(a,e,b){var d={};this.runChildNodes(d,e);a.featureTypes.push(d)},read_cap_Name:function(d,b){var a=this.getChildValue(b);if(a){d.name=a}},read_cap_Title:function(b,a){var d=this.getChildValue(a);if(d){b.title=d}},read_cap_Abstract:function(d,b){var a=this.getChildValue(b);if(a){d["abstract"]=a}},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1"});OpenLayers.Format.WMC.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ol:"http://openlayers.org/context",wmc:"http://www.opengis.net/context",sld:"http://www.opengis.net/sld",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},schemaLocation:"",getNamespacePrefix:function(a){var b=null;if(a==null){b=this.namespaces[this.defaultPrefix]}else{for(b in this.namespaces){if(this.namespaces[b]==a){break}}}return b},defaultPrefix:"wmc",rootPrefix:null,defaultStyleName:"",defaultStyleTitle:"Default",initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(d){if(typeof d=="string"){d=OpenLayers.Format.XML.prototype.read.apply(this,[d])}var a=d.documentElement;this.rootPrefix=a.prefix;var b={version:a.getAttribute("version")};this.runChildNodes(b,a);return b},runChildNodes:function(g,e){var b=e.childNodes;var a,d,l,o;for(var h=0,m=b.length;h<m;++h){a=b[h];if(a.nodeType==1){l=this.getNamespacePrefix(a.namespaceURI);o=a.nodeName.split(":").pop();d=this["read_"+l+"_"+o];if(d){d.apply(this,[g,a])}}}},read_wmc_General:function(a,b){this.runChildNodes(a,b)},read_wmc_BoundingBox:function(a,b){a.projection=b.getAttribute("SRS");a.bounds=new OpenLayers.Bounds(parseFloat(b.getAttribute("minx")),parseFloat(b.getAttribute("miny")),parseFloat(b.getAttribute("maxx")),parseFloat(b.getAttribute("maxy")))},read_wmc_LayerList:function(a,b){a.layers=[];this.runChildNodes(a,b)},read_wmc_Layer:function(b,d){var e={params:this.layerParams||{},options:{visibility:(d.getAttribute("hidden")!="1"),queryable:(d.getAttribute("queryable")=="1")},formats:[],styles:[]};this.runChildNodes(e,d);e.params.layers=e.name;e.options.maxExtent=e.maxExtent;var a=this.getLayerFromInfo(e);b.layers.push(a)},getLayerFromInfo:function(d){var a=d.options;if(this.layerOptions){OpenLayers.Util.applyDefaults(a,this.layerOptions)}var b=new OpenLayers.Layer.WMS(d.title,d.href,d.params,a);return b},read_wmc_Extension:function(b,a){this.runChildNodes(b,a)},read_ol_units:function(b,a){b.options.units=this.getChildValue(a)},read_ol_maxExtent:function(d,b){var a=new OpenLayers.Bounds(b.getAttribute("minx"),b.getAttribute("miny"),b.getAttribute("maxx"),b.getAttribute("maxy"));d.maxExtent=a},read_ol_transparent:function(b,a){b.params.transparent=this.getChildValue(a)},read_ol_numZoomLevels:function(b,a){b.options.numZoomLevels=parseInt(this.getChildValue(a))},read_ol_opacity:function(b,a){b.options.opacity=parseFloat(this.getChildValue(a))},read_ol_singleTile:function(b,a){b.options.singleTile=(this.getChildValue(a)=="true")},read_ol_isBaseLayer:function(b,a){b.options.isBaseLayer=(this.getChildValue(a)=="true")},read_ol_displayInLayerSwitcher:function(b,a){b.options.displayInLayerSwitcher=(this.getChildValue(a)=="true")},read_wmc_Server:function(b,a){b.params.version=a.getAttribute("version");this.runChildNodes(b,a)},read_wmc_FormatList:function(b,a){this.runChildNodes(b,a)},read_wmc_Format:function(d,a){var b=this.getChildValue(a);d.formats.push(b);if(a.getAttribute("current")=="1"){d.params.format=b}},read_wmc_StyleList:function(b,a){this.runChildNodes(b,a)},read_wmc_Style:function(d,b){var a={};this.runChildNodes(a,b);if(b.getAttribute("current")=="1"){if(a.href){d.params.sld=a.href}else{if(a.body){d.params.sld_body=a.body}else{d.params.styles=a.name}}}d.styles.push(a)},read_wmc_SLD:function(a,b){this.runChildNodes(a,b)},read_sld_StyledLayerDescriptor:function(d,b){var a=OpenLayers.Format.XML.prototype.write.apply(this,[b]);d.body=a},read_wmc_OnlineResource:function(b,a){b.href=this.getAttributeNS(a,this.namespaces.xlink,"href")},read_wmc_Name:function(d,b){var a=this.getChildValue(b);if(a){d.name=a}},read_wmc_Title:function(b,a){var d=this.getChildValue(a);if(d){b.title=d}},read_wmc_MetadataURL:function(d,b){var e={};var a=b.getElementsByTagName("OnlineResource");if(a.length>0){this.read_wmc_OnlineResource(e,a[0])}d.options.metadataURL=e.href},read_wmc_Abstract:function(d,b){var a=this.getChildValue(b);if(a){d["abstract"]=a}},read_wmc_LatLonBoundingBox:function(a,b){a.llbbox=[parseFloat(b.getAttribute("minx")),parseFloat(b.getAttribute("miny")),parseFloat(b.getAttribute("maxx")),parseFloat(b.getAttribute("maxy"))]},read_wmc_LegendURL:function(d,e){var b={width:e.getAttribute("width"),height:e.getAttribute("height")};var a=e.getElementsByTagName("OnlineResource");if(a.length>0){this.read_wmc_OnlineResource(b,a[0])}d.legend=b},write:function(d,b){var a=this.createElementDefaultNS("ViewContext");this.setAttributes(a,{version:this.VERSION,id:(b&&typeof b.id=="string")?b.id:OpenLayers.Util.createUniqueID("OpenLayers_Context_")});this.setAttributeNS(a,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);a.appendChild(this.write_wmc_General(d));a.appendChild(this.write_wmc_LayerList(d));return OpenLayers.Format.XML.prototype.write.apply(this,[a])},createElementDefaultNS:function(d,b,a){var e=this.createElementNS(this.namespaces[this.defaultPrefix],d);if(b){e.appendChild(this.createTextNode(b))}if(a){this.setAttributes(e,a)}return e},setAttributes:function(b,e){var d;for(var a in e){d=e[a].toString();if(d.match(/[A-Z]/)){this.setAttributeNS(b,null,a,d)}else{b.setAttribute(a,d)}}},write_wmc_General:function(a){var d=this.createElementDefaultNS("General");if(a.size){d.appendChild(this.createElementDefaultNS("Window",null,{width:a.size.w,height:a.size.h}))}var b=a.bounds;d.appendChild(this.createElementDefaultNS("BoundingBox",null,{minx:b.left.toPrecision(10),miny:b.bottom.toPrecision(10),maxx:b.right.toPrecision(10),maxy:b.top.toPrecision(10),SRS:a.projection}));d.appendChild(this.createElementDefaultNS("Title",a.title));d.appendChild(this.write_ol_MapExtension(a));return d},write_ol_MapExtension:function(b){var e=this.createElementDefaultNS("Extension");var d=b.maxExtent;if(d){var a=this.createElementNS(this.namespaces.ol,"ol:maxExtent");this.setAttributes(a,{minx:d.left.toPrecision(10),miny:d.bottom.toPrecision(10),maxx:d.right.toPrecision(10),maxy:d.top.toPrecision(10)});e.appendChild(a)}return e},write_wmc_LayerList:function(e){var g=this.createElementDefaultNS("LayerList");var d;for(var b=0,a=e.layers.length;b<a;++b){d=e.layers[b];if(d instanceof OpenLayers.Layer.WMS){g.appendChild(this.write_wmc_Layer(d))}}return g},write_wmc_Layer:function(a){var b=this.createElementDefaultNS("Layer",null,{queryable:a.queryable?"1":"0",hidden:a.visibility?"0":"1"});b.appendChild(this.write_wmc_Server(a));b.appendChild(this.createElementDefaultNS("Name",a.params.LAYERS));b.appendChild(this.createElementDefaultNS("Title",a.name));if(a.metadataURL){b.appendChild(this.write_wmc_MetadataURL(a))}b.appendChild(this.write_wmc_FormatList(a));b.appendChild(this.write_wmc_StyleList(a));b.appendChild(this.write_wmc_LayerExtension(a));return b},write_wmc_LayerExtension:function(h){var e=this.createElementDefaultNS("Extension");var a=h.maxExtent;var o=this.createElementNS(this.namespaces.ol,"ol:maxExtent");this.setAttributes(o,{minx:a.left.toPrecision(10),miny:a.bottom.toPrecision(10),maxx:a.right.toPrecision(10),maxy:a.top.toPrecision(10)});e.appendChild(o);var d=h.params.TRANSPARENT;if(d){var p=this.createElementNS(this.namespaces.ol,"ol:transparent");p.appendChild(this.createTextNode(d));e.appendChild(p)}var m=["numZoomLevels","units","isBaseLayer","opacity","displayInLayerSwitcher","singleTile"];var b;for(var g=0,l=m.length;g<l;++g){b=this.createOLPropertyNode(h,m[g]);if(b){e.appendChild(b)}}return e},createOLPropertyNode:function(b,d){var a=null;if(b[d]!=null){a=this.createElementNS(this.namespaces.ol,"ol:"+d);a.appendChild(this.createTextNode(b[d].toString()))}return a},write_wmc_Server:function(a){var b=this.createElementDefaultNS("Server");this.setAttributes(b,{service:"OGC:WMS",version:a.params.VERSION});b.appendChild(this.write_wmc_OnlineResource(a.url));return b},write_wmc_MetadataURL:function(a){var b=this.createElementDefaultNS("MetadataURL");b.appendChild(this.write_wmc_OnlineResource(a.metadataURL));return b},write_wmc_FormatList:function(a){var b=this.createElementDefaultNS("FormatList");b.appendChild(this.createElementDefaultNS("Format",a.params.FORMAT,{current:"1"}));return b},write_wmc_StyleList:function(g){var e=this.createElementDefaultNS("StyleList");var d=this.createElementDefaultNS("Style",null,{current:"1"});if(g.params.SLD){var b=this.createElementDefaultNS("SLD");var l=this.write_wmc_OnlineResource(g.params.SLD);b.appendChild(l);d.appendChild(b)}else{if(g.params.SLD_BODY){var b=this.createElementDefaultNS("SLD");var h=g.params.SLD_BODY;var m=OpenLayers.Format.XML.prototype.read.apply(this,[h]);var o=m.documentElement;if(b.ownerDocument&&b.ownerDocument.importNode){o=b.ownerDocument.importNode(o,true)}b.appendChild(o);d.appendChild(b)}else{var a=g.params.STYLES?g.params.STYLES:this.defaultStyleName;d.appendChild(this.createElementDefaultNS("Name",a));d.appendChild(this.createElementDefaultNS("Title",this.defaultStyleTitle))}}e.appendChild(d);return e},write_wmc_OnlineResource:function(a){var b=this.createElementDefaultNS("OnlineResource");this.setAttributeNS(b,this.namespaces.xlink,"xlink:type","simple");this.setAttributeNS(b,this.namespaces.xlink,"xlink:href",a);return b},CLASS_NAME:"OpenLayers.Format.WMC.v1"});OpenLayers.Format.WMSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1,{version:"1.1.0",initialize:function(a){OpenLayers.Format.WMSCapabilities.v1_1.prototype.initialize.apply(this,[a])},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_0"});OpenLayers.Format.WMSCapabilities.v1_1_1=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1,{version:"1.1.1",initialize:function(a){OpenLayers.Format.WMSCapabilities.v1_1.prototype.initialize.apply(this,[a])},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_1"});OpenLayers.Format.WMSDescribeLayer.v1_1=OpenLayers.Class(OpenLayers.Format.WMSDescribeLayer,{initialize:function(a){OpenLayers.Format.WMSDescribeLayer.prototype.initialize.apply(this,[a])},read:function(l){if(typeof l=="string"){l=OpenLayers.Format.XML.prototype.read.apply(this,[l])}var b=l.documentElement;var g=b.childNodes;var a=[];for(var e=0;e<g.length;++e){childNode=g[e];nodeName=childNode.nodeName;if(nodeName=="LayerDescription"){var m="";var h="";var d="";if(childNode.getAttribute("owsType")){m=childNode.getAttribute("owsType");h=childNode.getAttribute("owsURL")}else{if(childNode.getAttribute("wfs")!=""){m="WFS";h=childNode.getAttribute("wfs")}else{if(childNode.getAttribute("wcs")!=""){m="WCS";h=childNode.getAttribute("wcs")}}}query=childNode.getElementsByTagName("Query");if(query.length>0){d=query[0].getAttribute("typeName");if(!d){d=query[0].getAttribute("typename")}}a.push({owsType:m,owsURL:h,typeName:d})}}return a},CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer.v1_1"});OpenLayers.Handler.Box=OpenLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:"olHandlerBoxZoomBox",boxCharacteristics:null,initialize:function(d,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments);var b={down:this.startBox,move:this.moveBox,out:this.removeBox,up:this.endBox};this.dragHandler=new OpenLayers.Handler.Drag(this,b,{keyMask:this.keyMask})},setMap:function(a){OpenLayers.Handler.prototype.setMap.apply(this,arguments);if(this.dragHandler){this.dragHandler.setMap(a)}},startBox:function(a){this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.dragHandler.start);this.zoomBox.className=this.boxDivClassName;this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.viewPortDiv.appendChild(this.zoomBox);OpenLayers.Element.addClass(this.map.viewPortDiv,"olDrawBox")},moveBox:function(h){var e=this.dragHandler.start.x;var b=this.dragHandler.start.y;var d=Math.abs(e-h.x);var a=Math.abs(b-h.y);this.zoomBox.style.width=Math.max(1,d)+"px";this.zoomBox.style.height=Math.max(1,a)+"px";this.zoomBox.style.left=h.x<e?h.x+"px":e+"px";this.zoomBox.style.top=h.y<b?h.y+"px":b+"px";var g=this.getBoxCharacteristics();if(g.newBoxModel){if(h.x>e){this.zoomBox.style.width=Math.max(1,d-g.xOffset)+"px"}if(h.y>b){this.zoomBox.style.height=Math.max(1,a-g.yOffset)+"px"}}},endBox:function(b){var a;if(Math.abs(this.dragHandler.start.x-b.x)>5||Math.abs(this.dragHandler.start.y-b.y)>5){var l=this.dragHandler.start;var h=Math.min(l.y,b.y);var d=Math.max(l.y,b.y);var g=Math.min(l.x,b.x);var e=Math.max(l.x,b.x);a=new OpenLayers.Bounds(g,d,e,h)}else{a=this.dragHandler.start.clone()}this.removeBox();this.callback("done",[a])},removeBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null;this.boxCharacteristics=null;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDrawBox")},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragHandler.activate();return true}else{return false}},deactivate:function(){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.dragHandler.deactivate();return true}else{return false}},getBoxCharacteristics:function(){if(!this.boxCharacteristics){var a=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width"))+1;var d=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-bottom-width"))+1;var b=OpenLayers.Util.getBrowserName()=="msie"?document.compatMode!="BackCompat":true;this.boxCharacteristics={xOffset:a,yOffset:d,newBoxModel:b}}return this.boxCharacteristics},CLASS_NAME:"OpenLayers.Handler.Box"});OpenLayers.Handler.RegularPolygon=OpenLayers.Class(OpenLayers.Handler.Drag,{sides:4,radius:null,snapAngle:null,snapToggle:"shiftKey",persist:false,irregular:false,angle:null,fixedRadius:false,feature:null,layer:null,origin:null,initialize:function(d,b,a){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{});OpenLayers.Handler.prototype.initialize.apply(this,[d,b,a]);this.options=(a)?a:new Object()},setOptions:function(a){OpenLayers.Util.extend(this.options,a);OpenLayers.Util.extend(this,a)},activate:function(){var a=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var b={displayInLayerSwitcher:false,calculateInRange:function(){return true}};this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,b);this.map.addLayer(this.layer);a=true}return a},deactivate:function(){var a=false;if(OpenLayers.Handler.Drag.prototype.deactivate.apply(this,arguments)){if(this.dragging){this.cancel()}if(this.layer.map!=null){this.layer.destroy(false);if(this.feature){this.feature.destroy()}}this.layer=null;this.feature=null;a=true}return a},down:function(a){this.fixedRadius=!!(this.radius);var b=this.map.getLonLatFromPixel(a.xy);this.origin=new OpenLayers.Geometry.Point(b.lon,b.lat);if(!this.fixedRadius||this.irregular){this.radius=this.map.getResolution()}if(this.persist){this.clear()}this.feature=new OpenLayers.Feature.Vector();this.createGeometry();this.callback("create",[this.origin,this.feature]);this.layer.addFeatures([this.feature],{silent:true});this.layer.drawFeature(this.feature,this.style)},move:function(d){var h=this.map.getLonLatFromPixel(d.xy);var a=new OpenLayers.Geometry.Point(h.lon,h.lat);if(this.irregular){var l=Math.sqrt(2)*Math.abs(a.y-this.origin.y)/2;this.radius=Math.max(this.map.getResolution()/2,l)}else{if(this.fixedRadius){this.origin=a}else{this.calculateAngle(a,d);this.radius=Math.max(this.map.getResolution()/2,a.distanceTo(this.origin))}}this.modifyGeometry();if(this.irregular){var e=a.x-this.origin.x;var b=a.y-this.origin.y;var g;if(b==0){g=e/(this.radius*Math.sqrt(2))}else{g=e/b}this.feature.geometry.resize(1,this.origin,g);this.feature.geometry.move(e/2,b/2)}this.layer.drawFeature(this.feature,this.style)},up:function(a){this.finalize();if(this.start==this.last){this.callback("done",[a.xy])}},out:function(a){this.finalize()},createGeometry:function(){this.angle=Math.PI*((1/this.sides)-(1/2));if(this.snapAngle){this.angle+=this.snapAngle*(Math.PI/180)}this.feature.geometry=OpenLayers.Geometry.Polygon.createRegularPolygon(this.origin,this.radius,this.sides,this.snapAngle)},modifyGeometry:function(){var h,d,b,a;var e=this.feature.geometry.components[0];if(e.components.length!=(this.sides+1)){this.createGeometry();e=this.feature.geometry.components[0]}for(var g=0;g<this.sides;++g){a=e.components[g];h=this.angle+(g*2*Math.PI/this.sides);a.x=this.origin.x+(this.radius*Math.cos(h));a.y=this.origin.y+(this.radius*Math.sin(h));a.clearBounds()}},calculateAngle:function(a,b){var e=Math.atan2(a.y-this.origin.y,a.x-this.origin.x);if(this.snapAngle&&(this.snapToggle&&!b[this.snapToggle])){var d=(Math.PI/180)*this.snapAngle;this.angle=Math.round(e/d)*d}else{this.angle=e}},cancel:function(){this.callback("cancel",null);this.finalize()},finalize:function(){this.origin=null;this.radius=this.options.radius},clear:function(){this.layer.renderer.clear();this.layer.destroyFeatures()},callback:function(b,a){if(this.callbacks[b]){this.callbacks[b].apply(this.control,[this.feature.geometry.clone()])}if(!this.persist&&(b=="done"||b=="cancel")){this.clear()}},CLASS_NAME:"OpenLayers.Handler.RegularPolygon"});OpenLayers.Layer.EventPane=OpenLayers.Class(OpenLayers.Layer,{smoothDragPan:true,isBaseLayer:true,isFixed:true,pane:null,mapObject:null,initialize:function(b,a){OpenLayers.Layer.prototype.initialize.apply(this,arguments);if(this.pane==null){this.pane=OpenLayers.Util.createDiv(this.div.id+"_EventPane")}},destroy:function(){this.mapObject=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setMap:function(a){OpenLayers.Layer.prototype.setMap.apply(this,arguments);this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1;this.pane.style.display=this.div.style.display;this.pane.style.width="100%";this.pane.style.height="100%";if(OpenLayers.Util.getBrowserName()=="msie"){this.pane.style.background="url("+OpenLayers.Util.getImagesLocation()+"blank.gif)"}if(this.isFixed){this.map.viewPortDiv.appendChild(this.pane)}else{this.map.layerContainerDiv.appendChild(this.pane)}this.loadMapObject();if(this.mapObject==null){this.loadWarningMessage()}},removeMap:function(a){if(this.pane&&this.pane.parentNode){this.pane.parentNode.removeChild(this.pane);this.pane=null}OpenLayers.Layer.prototype.removeMap.apply(this,arguments)},loadWarningMessage:function(){this.div.style.backgroundColor="darkblue";var l=this.map.getSize();var a=Math.min(l.w,300);var g=Math.min(l.h,200);var b=new OpenLayers.Size(a,g);var e=new OpenLayers.Pixel(l.w/2,l.h/2);var d=e.add(-b.w/2,-b.h/2);var h=OpenLayers.Util.createDiv(this.name+"_warning",d,b,null,null,null,"auto");h.style.padding="7px";h.style.backgroundColor="yellow";h.innerHTML=this.getWarningHTML();this.div.appendChild(h)},getWarningHTML:function(){return""},display:function(a){OpenLayers.Layer.prototype.display.apply(this,arguments);this.pane.style.display=this.div.style.display},setZIndex:function(a){OpenLayers.Layer.prototype.setZIndex.apply(this,arguments);this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1},moveTo:function(d,e,p){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(this.mapObject!=null){var g=this.map.getCenter();var l=this.map.getZoom();if(g!=null){var h=this.getMapObjectCenter();var b=this.getOLLonLatFromMapObjectLonLat(h);var m=this.getMapObjectZoom();var s=this.getOLZoomFromMapObjectZoom(m);if(!(g.equals(b))||!(l==s)){if(p&&this.dragPanMapObject&&this.smoothDragPan){var o=this.map.getViewPortPxFromLonLat(b);var q=this.map.getViewPortPxFromLonLat(g);this.dragPanMapObject(q.x-o.x,o.y-q.y)}else{var a=this.getMapObjectLonLatFromOLLonLat(g);var r=this.getMapObjectZoomFromOLZoom(l);this.setMapObjectCenter(a,r,p)}}}}},getLonLatFromViewPortPx:function(a){var b=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var e=this.getMapObjectPixelFromOLPixel(a);var d=this.getMapObjectLonLatFromMapObjectPixel(e);b=this.getOLLonLatFromMapObjectLonLat(d)}return b},getViewPortPxFromLonLat:function(b){var a=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var e=this.getMapObjectLonLatFromOLLonLat(b);var d=this.getMapObjectPixelFromMapObjectLonLat(e);a=this.getOLPixelFromMapObjectPixel(d)}return a},getOLLonLatFromMapObjectLonLat:function(e){var a=null;if(e!=null){var d=this.getLongitudeFromMapObjectLonLat(e);var b=this.getLatitudeFromMapObjectLonLat(e);a=new OpenLayers.LonLat(d,b)}return a},getMapObjectLonLatFromOLLonLat:function(a){var b=null;if(a!=null){b=this.getMapObjectLonLatFromLonLat(a.lon,a.lat)}return b},getOLPixelFromMapObjectPixel:function(e){var b=null;if(e!=null){var a=this.getXFromMapObjectPixel(e);var d=this.getYFromMapObjectPixel(e);b=new OpenLayers.Pixel(a,d)}return b},getMapObjectPixelFromOLPixel:function(a){var b=null;if(a!=null){b=this.getMapObjectPixelFromXY(a.x,a.y)}return b},CLASS_NAME:"OpenLayers.Layer.EventPane"});OpenLayers.Layer.FixedZoomLevels=OpenLayers.Class({initialize:function(){},initResolutions:function(){var d=new Array("minZoomLevel","maxZoomLevel","numZoomLevels");for(var b=0,a=d.length;b<a;b++){var h=d[b];this[h]=(this.options[h]!=null)?this.options[h]:this.map[h]}if((this.minZoomLevel==null)||(this.minZoomLevel<this.MIN_ZOOM_LEVEL)){this.minZoomLevel=this.MIN_ZOOM_LEVEL}var l;var g=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1;if(((this.options.numZoomLevels==null)&&(this.options.maxZoomLevel!=null))||((this.numZoomLevels==null)&&(this.maxZoomLevel!=null))){l=this.maxZoomLevel-this.minZoomLevel+1}else{l=this.numZoomLevels}if(l!=null){this.numZoomLevels=Math.min(l,g)}else{this.numZoomLevels=g}this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1;if(this.RESOLUTIONS!=null){var e=0;this.resolutions=[];for(var b=this.minZoomLevel;b<=this.maxZoomLevel;b++){this.resolutions[e++]=this.RESOLUTIONS[b]}this.maxResolution=this.resolutions[0];this.minResolution=this.resolutions[this.resolutions.length-1]}},getResolution:function(){if(this.resolutions!=null){return OpenLayers.Layer.prototype.getResolution.apply(this,arguments)}else{var a=null;var d=this.map.getSize();var b=this.getExtent();if((d!=null)&&(b!=null)){a=Math.max(b.getWidth()/d.w,b.getHeight()/d.h)}return a}},getExtent:function(){var d=null;var b=this.map.getSize();var g=new OpenLayers.Pixel(0,0);var h=this.getLonLatFromViewPortPx(g);var a=new OpenLayers.Pixel(b.w,b.h);var e=this.getLonLatFromViewPortPx(a);if((h!=null)&&(e!=null)){d=new OpenLayers.Bounds(h.lon,e.lat,e.lon,h.lat)}return d},getZoomForResolution:function(a){if(this.resolutions!=null){return OpenLayers.Layer.prototype.getZoomForResolution.apply(this,arguments)}else{var b=OpenLayers.Layer.prototype.getExtent.apply(this,[]);return this.getZoomForExtent(b)}},getOLZoomFromMapObjectZoom:function(a){var b=null;if(a!=null){b=a-this.minZoomLevel}return b},getMapObjectZoomFromOLZoom:function(a){var b=null;if(a!=null){b=a+this.minZoomLevel}return b},CLASS_NAME:"OpenLayers.Layer.FixedZoomLevels"});OpenLayers.Layer.HTTPRequest=OpenLayers.Class(OpenLayers.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:false,initialize:function(e,d,g,b){var a=arguments;a=[e,b];OpenLayers.Layer.prototype.initialize.apply(this,a);this.url=d;this.params=OpenLayers.Util.extend({},g)},destroy:function(){this.url=null;this.params=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.prototype.clone.apply(this,[a]);return a},setUrl:function(a){this.url=a},mergeNewParams:function(a){this.params=OpenLayers.Util.extend(this.params,a);return this.redraw()},redraw:function(a){if(a){return this.mergeNewParams({_olSalt:Math.random()})}else{return OpenLayers.Layer.prototype.redraw.apply(this,[])}},selectUrl:function(g,e){var d=1;for(var b=0,a=g.length;b<a;b++){d*=g.charCodeAt(b)*this.URL_HASH_FACTOR;d-=Math.floor(d)}return e[Math.floor(d*e.length)]},getFullRequestString:function(h,g){var b=g||this.url;var l=OpenLayers.Util.extend({},this.params);l=OpenLayers.Util.extend(l,h);var a=OpenLayers.Util.getParameterString(l);if(b instanceof Array){b=this.selectUrl(a,b)}var e=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(b));for(var m in l){if(m.toUpperCase() in e){delete l[m]}}a=OpenLayers.Util.getParameterString(l);var o=b;if(a!=""){var d=b.charAt(b.length-1);if((d=="&")||(d=="?")){o+=a}else{if(b.indexOf("?")==-1){o+="?"+a}else{o+="&"+a}}}return o},CLASS_NAME:"OpenLayers.Layer.HTTPRequest"});OpenLayers.Layer.Image=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:true,url:null,extent:null,size:null,tile:null,aspectRatio:null,initialize:function(d,b,g,e,a){this.url=b;this.extent=g;this.maxExtent=g;this.size=e;OpenLayers.Layer.prototype.initialize.apply(this,[d,a]);this.aspectRatio=(this.extent.getHeight()/this.size.h)/(this.extent.getWidth()/this.size.w)},destroy:function(){if(this.tile){this.removeTileMonitoringHooks(this.tile);this.tile.destroy();this.tile=null}OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Layer.Image(this.name,this.url,this.extent,this.size,this.options)}a=OpenLayers.Layer.prototype.clone.apply(this,[a]);return a},setMap:function(a){if(this.options.maxResolution==null){this.options.maxResolution=this.aspectRatio*this.extent.getWidth()/this.size.w}OpenLayers.Layer.prototype.setMap.apply(this,arguments)},moveTo:function(g,a,h){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var b=(this.tile==null);if(a||b){this.setTileSize();var e=new OpenLayers.LonLat(this.extent.left,this.extent.top);var d=this.map.getLayerPxFromLonLat(e);if(b){this.tile=new OpenLayers.Tile.Image(this,d,this.extent,null,this.tileSize);this.addTileMonitoringHooks(this.tile)}else{this.tile.size=this.tileSize.clone();this.tile.position=d.clone()}this.tile.draw()}},setTileSize:function(){var b=this.extent.getWidth()/this.map.getResolution();var a=this.extent.getHeight()/this.map.getResolution();this.tileSize=new OpenLayers.Size(b,a)},addTileMonitoringHooks:function(a){a.onLoadStart=function(){this.events.triggerEvent("loadstart")};a.events.register("loadstart",this,a.onLoadStart);a.onLoadEnd=function(){this.events.triggerEvent("loadend")};a.events.register("loadend",this,a.onLoadEnd);a.events.register("unload",this,a.onLoadEnd)},removeTileMonitoringHooks:function(a){a.unload();a.events.un({loadstart:a.onLoadStart,loadend:a.onLoadEnd,unload:a.onLoadEnd,scope:this})},setUrl:function(a){this.url=a;this.tile.draw()},getURL:function(a){return this.url},CLASS_NAME:"OpenLayers.Layer.Image"});OpenLayers.Layer.Markers=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:false,markers:null,drawn:false,initialize:function(b,a){OpenLayers.Layer.prototype.initialize.apply(this,arguments);this.markers=[]},destroy:function(){this.clearMarkers();this.markers=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setOpacity:function(b){if(b!=this.opacity){this.opacity=b;for(var d=0,a=this.markers.length;d<a;d++){this.markers[d].setOpacity(this.opacity)}}},moveTo:function(e,b,g){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(b||!this.drawn){for(var d=0,a=this.markers.length;d<a;d++){this.drawMarker(this.markers[d])}this.drawn=true}},addMarker:function(a){this.markers.push(a);if(this.opacity!=null){a.setOpacity(this.opacity)}if(this.map&&this.map.getExtent()){a.map=this.map;this.drawMarker(a)}},removeMarker:function(a){if(this.markers&&this.markers.length){OpenLayers.Util.removeItem(this.markers,a);a.erase()}},clearMarkers:function(){if(this.markers!=null){while(this.markers.length>0){this.removeMarker(this.markers[0])}}},drawMarker:function(a){var b=this.map.getLayerPxFromLonLat(a.lonlat);if(b==null){a.display(false)}else{if(!a.isDrawn()){var d=a.draw(b);this.div.appendChild(d)}else{if(a.icon){a.icon.moveTo(b)}}}},getDataExtent:function(){var b=null;if(this.markers&&(this.markers.length>0)){var b=new OpenLayers.Bounds();for(var e=0,a=this.markers.length;e<a;e++){var d=this.markers[e];b.extend(d.lonlat)}}return b},CLASS_NAME:"OpenLayers.Layer.Markers"});OpenLayers.Layer.SphericalMercator={getExtent:function(){var a=null;if(this.sphericalMercator){a=this.map.calculateBounds()}else{a=OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this)}return a},initMercatorParameters:function(){this.RESOLUTIONS=[];var a=156543.0339;for(var b=0;b<=this.MAX_ZOOM_LEVEL;++b){this.RESOLUTIONS[b]=a/Math.pow(2,b)}this.units="m";this.projection="EPSG:900913"},forwardMercator:function(d,b){var a=d*20037508.34/180;var e=Math.log(Math.tan((90+b)*Math.PI/360))/(Math.PI/180);e=e*20037508.34/180;return new OpenLayers.LonLat(a,e)},inverseMercator:function(a,e){var d=(a/20037508.34)*180;var b=(e/20037508.34)*180;b=180/Math.PI*(2*Math.atan(Math.exp(b*Math.PI/180))-Math.PI/2);return new OpenLayers.LonLat(d,b)},projectForward:function(a){var b=OpenLayers.Layer.SphericalMercator.forwardMercator(a.x,a.y);a.x=b.lon;a.y=b.lat;return a},projectInverse:function(a){var b=OpenLayers.Layer.SphericalMercator.inverseMercator(a.x,a.y);a.x=b.lon;a.y=b.lat;return a}};OpenLayers.Projection.addTransform("EPSG:4326","EPSG:900913",OpenLayers.Layer.SphericalMercator.projectForward);OpenLayers.Projection.addTransform("EPSG:900913","EPSG:4326",OpenLayers.Layer.SphericalMercator.projectInverse);OpenLayers.Tile.WFS=OpenLayers.Class(OpenLayers.Tile,{features:null,url:null,request:null,initialize:function(e,a,g,b,d){OpenLayers.Tile.prototype.initialize.apply(this,arguments);this.url=b;this.features=[]},destroy:function(){OpenLayers.Tile.prototype.destroy.apply(this,arguments);this.destroyAllFeatures();this.features=null;this.url=null;if(this.request){this.request.abort();this.request=null}},clear:function(){this.destroyAllFeatures()},draw:function(){if(OpenLayers.Tile.prototype.draw.apply(this,arguments)){if(this.isLoading){this.events.triggerEvent("reload")}else{this.isLoading=true;this.events.triggerEvent("loadstart")}this.loadFeaturesForRegion(this.requestSuccess)}},loadFeaturesForRegion:function(b,a){if(this.request){this.request.abort()}this.request=OpenLayers.Request.GET({url:this.url,success:b,failure:a,scope:this})},requestSuccess:function(b){if(this.features){var e=b.responseXML;if(!e||!e.documentElement){e=b.responseText}if(this.layer.vectorMode){this.layer.addFeatures(this.layer.formatObject.read(e))}else{var a=new OpenLayers.Format.XML();if(typeof e=="string"){e=a.read(e)}var d=a.getElementsByTagNameNS(e,"http://www.opengis.net/gml","featureMember");this.addResults(d)}}if(this.events){this.events.triggerEvent("loadend")}this.request=null},addResults:function(d){for(var b=0;b<d.length;b++){var a=new this.layer.featureClass(this.layer,d[b]);this.features.push(a)}},destroyAllFeatures:function(){while(this.features.length>0){var a=this.features.shift();a.destroy()}},CLASS_NAME:"OpenLayers.Tile.WFS"});OpenLayers.Control.DrawFeature=OpenLayers.Class(OpenLayers.Control,{layer:null,callbacks:null,EVENT_TYPES:["featureadded"],featureAdded:function(){},handlerOptions:null,initialize:function(b,d,a){this.EVENT_TYPES=OpenLayers.Control.DrawFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);this.callbacks=OpenLayers.Util.extend({done:this.drawFeature,modify:function(h,g){this.layer.events.triggerEvent("sketchmodified",{vertex:h,feature:g})},create:function(h,g){this.layer.events.triggerEvent("sketchstarted",{vertex:h,feature:g})}},this.callbacks);this.layer=b;var e=this.layer.styleMap&&this.layer.styleMap.styles.temporary;if(e){this.handlerOptions=this.handlerOptions||{};this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new OpenLayers.StyleMap({"default":e})})}this.handler=new d(this,this.callbacks,this.handlerOptions)},drawFeature:function(d){var a=new OpenLayers.Feature.Vector(d);var b=this.layer.events.triggerEvent("sketchcomplete",{feature:a});if(b!==false){a.state=OpenLayers.State.INSERT;this.layer.addFeatures([a]);this.featureAdded(a);this.events.triggerEvent("featureadded",{feature:a})}},CLASS_NAME:"OpenLayers.Control.DrawFeature"});OpenLayers.Control.Measure=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["measure","measurepartial"],handlerOptions:null,callbacks:null,displaySystem:"metric",geodesic:false,displaySystemUnits:{geographic:["dd"],english:["mi","ft","in"],metric:["km","m"]},partialDelay:300,delayedTrigger:null,persist:false,initialize:function(b,a){this.EVENT_TYPES=OpenLayers.Control.Measure.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);this.callbacks=OpenLayers.Util.extend({done:this.measureComplete,point:this.measurePartial},this.callbacks);this.handlerOptions=OpenLayers.Util.extend({persist:this.persist},this.handlerOptions);this.handler=new b(this,this.callbacks,this.handlerOptions)},cancel:function(){this.handler.cancel()},updateHandler:function(b,a){var d=this.active;if(d){this.deactivate()}this.handler=new b(this,this.callbacks,a);if(d){this.activate()}},measureComplete:function(a){if(this.delayedTrigger){window.clearTimeout(this.delayedTrigger)}this.measure(a,"measure")},measurePartial:function(a,b){this.delayedTrigger=window.setTimeout(OpenLayers.Function.bind(function(){this.measure(b,"measurepartial")},this),this.partialDelay)},measure:function(e,b){var d,a;if(e.CLASS_NAME.indexOf("LineString")>-1){d=this.getBestLength(e);a=1}else{d=this.getBestArea(e);a=2}this.events.triggerEvent(b,{measure:d[0],units:d[1],order:a,geometry:e})},getBestArea:function(h){var b=this.displaySystemUnits[this.displaySystem];var g,e;for(var d=0,a=b.length;d<a;++d){g=b[d];e=this.getArea(h,g);if(e>1){break}}return[e,g]},getArea:function(h,a){var b,d;if(this.geodesic){b=h.getGeodesicArea(this.map.getProjectionObject());d="m"}else{b=h.getArea();d=this.map.getUnits()}var g=OpenLayers.INCHES_PER_UNIT[a];if(g){var e=OpenLayers.INCHES_PER_UNIT[d];b*=Math.pow((e/g),2)}return b},getBestLength:function(h){var b=this.displaySystemUnits[this.displaySystem];var g,e;for(var d=0,a=b.length;d<a;++d){g=b[d];e=this.getLength(h,g);if(e>1){break}}return[e,g]},getLength:function(h,a){var b,d;if(this.geodesic){b=h.getGeodesicLength(this.map.getProjectionObject());d="m"}else{b=h.getLength();d=this.map.getUnits()}var g=OpenLayers.INCHES_PER_UNIT[a];if(g){var e=OpenLayers.INCHES_PER_UNIT[d];b*=(e/g)}return b},CLASS_NAME:"OpenLayers.Control.Measure"});OpenLayers.Control.ZoomBox=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,out:false,alwaysZoom:false,draw:function(){this.handler=new OpenLayers.Handler.Box(this,{done:this.zoomBox},{keyMask:this.keyMask})},zoomBox:function(m){if(m instanceof OpenLayers.Bounds){if(!this.out){var o=this.map.getLonLatFromPixel(new OpenLayers.Pixel(m.left,m.bottom));var s=this.map.getLonLatFromPixel(new OpenLayers.Pixel(m.right,m.top));var b=new OpenLayers.Bounds(o.lon,o.lat,s.lon,s.lat)}else{var l=Math.abs(m.right-m.left);var p=Math.abs(m.top-m.bottom);var g=Math.min((this.map.size.h/p),(this.map.size.w/l));var t=this.map.getExtent();var a=this.map.getLonLatFromPixel(m.getCenterPixel());var d=a.lon-(t.getWidth()/2)*g;var h=a.lon+(t.getWidth()/2)*g;var r=a.lat-(t.getHeight()/2)*g;var e=a.lat+(t.getHeight()/2)*g;var b=new OpenLayers.Bounds(d,r,h,e)}var q=this.map.getZoom();this.map.zoomToExtent(b);if(q==this.map.getZoom()&&this.alwaysZoom==true){this.map.zoomTo(q+(this.out?-1:1))}}else{if(!this.out){this.map.setCenter(this.map.getLonLatFromPixel(m),this.map.getZoom()+1)}else{this.map.setCenter(this.map.getLonLatFromPixel(m),this.map.getZoom()-1)}}},CLASS_NAME:"OpenLayers.Control.ZoomBox"});OpenLayers.Format.WFSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{initialize:function(a){OpenLayers.Format.WFSCapabilities.v1.prototype.initialize.apply(this,[a])},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1_0_0"});OpenLayers.Format.WFSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{initialize:function(a){OpenLayers.Format.WFSCapabilities.v1.prototype.initialize.apply(this,[a])},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1_1_0"});OpenLayers.Format.WKT=OpenLayers.Class(OpenLayers.Format,{initialize:function(a){this.regExes={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/};OpenLayers.Format.prototype.initialize.apply(this,[a])},read:function(h){var g,e,m;var l=this.regExes.typeStr.exec(h);if(l){e=l[1].toLowerCase();m=l[2];if(this.parse[e]){g=this.parse[e].apply(this,[m])}if(this.internalProjection&&this.externalProjection){if(g&&g.CLASS_NAME=="OpenLayers.Feature.Vector"){g.geometry.transform(this.externalProjection,this.internalProjection)}else{if(g&&e!="geometrycollection"&&typeof g=="object"){for(var d=0,a=g.length;d<a;d++){var b=g[d];b.geometry.transform(this.externalProjection,this.internalProjection)}}}}}return g},write:function(a){var h,o,m,e,b;if(a.constructor==Array){h=a;b=true}else{h=[a];b=false}var d=[];if(b){d.push("GEOMETRYCOLLECTION(")}for(var g=0,l=h.length;g<l;++g){if(b&&g>0){d.push(",")}o=h[g].geometry;m=o.CLASS_NAME.split(".")[2].toLowerCase();if(!this.extract[m]){return null}if(this.internalProjection&&this.externalProjection){o=o.clone();o.transform(this.internalProjection,this.externalProjection)}e=this.extract[m].apply(this,[o]);d.push(m.toUpperCase()+"("+e+")")}if(b){d.push(")")}return d.join("")},extract:{point:function(a){return a.x+" "+a.y},multipoint:function(d){var e=[];for(var b=0,a=d.components.length;b<a;++b){e.push(this.extract.point.apply(this,[d.components[b]]))}return e.join(",")},linestring:function(b){var e=[];for(var d=0,a=b.components.length;d<a;++d){e.push(this.extract.point.apply(this,[b.components[d]]))}return e.join(",")},multilinestring:function(d){var e=[];for(var b=0,a=d.components.length;b<a;++b){e.push("("+this.extract.linestring.apply(this,[d.components[b]])+")")}return e.join(",")},polygon:function(d){var e=[];for(var b=0,a=d.components.length;b<a;++b){e.push("("+this.extract.linestring.apply(this,[d.components[b]])+")")}return e.join(",")},multipolygon:function(e){var d=[];for(var b=0,a=e.components.length;b<a;++b){d.push("("+this.extract.polygon.apply(this,[e.components[b]])+")")}return d.join(",")}},parse:{point:function(b){var a=OpenLayers.String.trim(b).split(this.regExes.spaces);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(a[0],a[1]))},multipoint:function(g){var d=OpenLayers.String.trim(g).split(",");var e=[];for(var b=0,a=d.length;b<a;++b){e.push(this.parse.point.apply(this,[d[b]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(e))},linestring:function(g){var d=OpenLayers.String.trim(g).split(",");var e=[];for(var b=0,a=d.length;b<a;++b){e.push(this.parse.point.apply(this,[d[b]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(e))},multilinestring:function(h){var d;var b=OpenLayers.String.trim(h).split(this.regExes.parenComma);var g=[];for(var e=0,a=b.length;e<a;++e){d=b[e].replace(this.regExes.trimParens,"$1");g.push(this.parse.linestring.apply(this,[d]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(g))},polygon:function(m){var d,b,h;var l=OpenLayers.String.trim(m).split(this.regExes.parenComma);var g=[];for(var e=0,a=l.length;e<a;++e){d=l[e].replace(this.regExes.trimParens,"$1");b=this.parse.linestring.apply(this,[d]).geometry;h=new OpenLayers.Geometry.LinearRing(b.components);g.push(h)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(g))},multipolygon:function(h){var e;var b=OpenLayers.String.trim(h).split(this.regExes.doubleParenComma);var g=[];for(var d=0,a=b.length;d<a;++d){e=b[d].replace(this.regExes.trimParens,"$1");g.push(this.parse.polygon.apply(this,[e]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(g))},geometrycollection:function(g){g=g.replace(/,\s*([A-Za-z])/g,"|$1");var e=OpenLayers.String.trim(g).split("|");var d=[];for(var b=0,a=e.length;b<a;++b){d.push(OpenLayers.Format.WKT.prototype.read.apply(this,[e[b]]))}return d}},CLASS_NAME:"OpenLayers.Format.WKT"});OpenLayers.Format.WMC.v1_0_0=OpenLayers.Class(OpenLayers.Format.WMC.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/context http://schemas.opengis.net/context/1.0.0/context.xsd",initialize:function(a){OpenLayers.Format.WMC.v1.prototype.initialize.apply(this,[a])},CLASS_NAME:"OpenLayers.Format.WMC.v1_0_0"});OpenLayers.Format.WMC.v1_1_0=OpenLayers.Class(OpenLayers.Format.WMC.v1,{VERSION:"1.1.0",schemaLocation:"http://www.opengis.net/context http://schemas.opengis.net/context/1.1.0/context.xsd",initialize:function(a){OpenLayers.Format.WMC.v1.prototype.initialize.apply(this,[a])},read_sld_MinScaleDenominator:function(b,a){b.options.maxScale=this.getChildValue(a)},read_sld_MaxScaleDenominator:function(b,a){b.options.minScale=this.getChildValue(a)},write_wmc_Layer:function(b){var d=OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(this,[b]);if(b.options.resolutions||b.options.scales||b.options.minResolution||b.options.maxScale){var e=this.createElementNS(this.namespaces.sld,"sld:MinScaleDenominator");e.appendChild(this.createTextNode(b.maxScale.toPrecision(10)));d.insertBefore(e,d.childNodes[3])}if(b.options.resolutions||b.options.scales||b.options.maxResolution||b.options.minScale){var a=this.createElementNS(this.namespaces.sld,"sld:MaxScaleDenominator");a.appendChild(this.createTextNode(b.minScale.toPrecision(10)));d.insertBefore(a,d.childNodes[4])}return d},CLASS_NAME:"OpenLayers.Format.WMC.v1_1_0"});OpenLayers.Layer.Boxes=OpenLayers.Class(OpenLayers.Layer.Markers,{initialize:function(b,a){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments)},drawMarker:function(a){var e=a.bounds;var h=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(e.left,e.top));var d=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(e.right,e.bottom));if(d==null||h==null){a.display(false)}else{var g=new OpenLayers.Size(Math.max(1,d.x-h.x),Math.max(1,d.y-h.y));var b=a.draw(h,g);if(!a.drawn){this.div.appendChild(b);a.drawn=true}}},removeMarker:function(a){OpenLayers.Util.removeItem(this.markers,a);if((a.div!=null)&&(a.div.parentNode==this.div)){this.div.removeChild(a.div)}},CLASS_NAME:"OpenLayers.Layer.Boxes"});OpenLayers.Layer.GeoRSS=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,icon:null,popupSize:null,useFeedTitle:true,initialize:function(d,a,b){OpenLayers.Layer.Markers.prototype.initialize.apply(this,[d,b]);this.location=a;this.features=[]},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);this.clearFeatures();this.features=null},loadRSS:function(){if(!this.loaded){this.events.triggerEvent("loadstart");OpenLayers.Request.GET({url:this.location,success:this.parseData,scope:this});this.loaded=true}},moveTo:function(d,a,b){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadRSS()}},parseData:function(p){var t=p.responseXML;if(!t||!t.documentElement){t=OpenLayers.Format.XML.prototype.read(p.responseText)}if(this.useFeedTitle){var a=null;try{a=t.getElementsByTagNameNS("*","title")[0].firstChild.nodeValue}catch(o){a=t.getElementsByTagName("title")[0].firstChild.nodeValue}if(a){this.setName(a)}}var z={};OpenLayers.Util.extend(z,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){z.externalProjection=this.projection;z.internalProjection=this.map.getProjectionObject()}var u=new OpenLayers.Format.GeoRSS(z);var b=u.read(t);for(var l=0,m=b.length;l<m;l++){var h={};var w=b[l];if(!w.geometry){continue}var r=w.attributes.title?w.attributes.title:"Untitled";var v=w.attributes.description?w.attributes.description:"No description.";var q=w.attributes.link?w.attributes.link:"";var s=w.geometry.getBounds().getCenterLonLat();h.icon=this.icon==null?OpenLayers.Marker.defaultIcon():this.icon.clone();h.popupSize=this.popupSize?this.popupSize.clone():new OpenLayers.Size(250,120);if(r||v){h.title=r;h.description=v;var d='<div class="olLayerGeoRSSClose">[x]</div>';d+='<div class="olLayerGeoRSSTitle">';if(q){d+='<a class="link" href="'+q+'" target="_blank">'}d+=r;if(q){d+="</a>"}d+="</div>";d+='<div style="" class="olLayerGeoRSSDescription">';d+=v;d+="</div>";h.popupContentHTML=d}var w=new OpenLayers.Feature(this,s,h);this.features.push(w);var g=w.createMarker();g.events.register("click",w,this.markerClick);this.addMarker(g)}this.events.triggerEvent("loadend")},markerClick:function(d){var g=(this==this.layer.selectedFeature);this.layer.selectedFeature=(!g)?this:null;for(var e=0,a=this.layer.map.popups.length;e<a;e++){this.layer.map.removePopup(this.layer.map.popups[e])}if(!g){var b=this.createPopup();OpenLayers.Event.observe(b.div,"click",OpenLayers.Function.bind(function(){for(var l=0,h=this.layer.map.popups.length;l<h;l++){this.layer.map.removePopup(this.layer.map.popups[l])}},this));this.layer.map.addPopup(b)}OpenLayers.Event.stop(d)},clearFeatures:function(){if(this.features!=null){while(this.features.length>0){var a=this.features[0];OpenLayers.Util.removeItem(this.features,a);a.destroy()}}},CLASS_NAME:"OpenLayers.Layer.GeoRSS"});OpenLayers.Layer.Google=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX_ZOOM_LEVEL:19,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125,0.00002145767211914062,0.00001072883605957031,0.00000536441802978515,0.00000268220901489257],type:null,sphericalMercator:false,dragObject:null,termsOfUse:null,poweredBy:null,initialize:function(b,a){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);this.addContainerPxFunction();if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters()}},loadMapObject:function(){try{this.mapObject=new GMap2(this.div);if(typeof this.mapObject.getDragObject=="function"){this.dragObject=this.mapObject.getDragObject()}else{this.dragPanMapObject=null}this.termsOfUse=this.div.lastChild;this.div.removeChild(this.termsOfUse);if(this.isFixed){this.map.viewPortDiv.appendChild(this.termsOfUse)}else{this.map.layerContainerDiv.appendChild(this.termsOfUse)}this.termsOfUse.style.zIndex="1100";this.termsOfUse.style.display=this.div.style.display;this.termsOfUse.style.right="";this.termsOfUse.style.bottom="";this.termsOfUse.className="olLayerGoogleCopyright";this.poweredBy=this.div.lastChild;this.div.removeChild(this.poweredBy);if(this.isFixed){this.map.viewPortDiv.appendChild(this.poweredBy)}else{this.map.layerContainerDiv.appendChild(this.poweredBy)}this.poweredBy.style.zIndex="1100";this.poweredBy.style.display=this.div.style.display;this.poweredBy.style.right="";this.poweredBy.style.bottom="";this.poweredBy.className="olLayerGooglePoweredBy gmnoprint"}catch(a){OpenLayers.Console.error(a)}},setMap:function(a){OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments);if(this.type!=null){this.map.events.register("moveend",this,this.setMapType)}},setMapType:function(){if(this.mapObject.getCenter()!=null){if(OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),this.type)==-1){this.mapObject.addMapType(this.type)}this.mapObject.setMapType(this.type);this.map.events.unregister("moveend",this,this.setMapType)}},onMapResize:function(){if(this.visibility&&this.mapObject.isLoaded()){this.mapObject.checkResize()}else{if(!this._resized){var a=this;var b=GEvent.addListener(this.mapObject,"load",function(){GEvent.removeListener(b);delete a._resized;a.mapObject.checkResize();a.moveTo(a.map.getCenter(),a.map.getZoom())})}this._resized=true}},display:function(a){OpenLayers.Layer.EventPane.prototype.display.apply(this,arguments);this.termsOfUse.style.display=this.div.style.display;this.poweredBy.style.display=this.div.style.display},removeMap:function(a){if(this.termsOfUse&&this.termsOfUse.parentNode){this.termsOfUse.parentNode.removeChild(this.termsOfUse);this.termsOfUse=null}if(this.poweredBy&&this.poweredBy.parentNode){this.poweredBy.parentNode.removeChild(this.poweredBy);this.poweredBy=null}OpenLayers.Layer.EventPane.prototype.removeMap.apply(this,arguments)},getOLBoundsFromMapObjectBounds:function(b){var d=null;if(b!=null){var a=b.getSouthWest();var e=b.getNorthEast();if(this.sphericalMercator){a=this.forwardMercator(a.lng(),a.lat());e=this.forwardMercator(e.lng(),e.lat())}else{a=new OpenLayers.LonLat(a.lng(),a.lat());e=new OpenLayers.LonLat(e.lng(),e.lat())}d=new OpenLayers.Bounds(a.lon,a.lat,e.lon,e.lat)}return d},getMapObjectBoundsFromOLBounds:function(d){var b=null;if(d!=null){var a=this.sphericalMercator?this.inverseMercator(d.bottom,d.left):new OpenLayers.LonLat(d.bottom,d.left);var e=this.sphericalMercator?this.inverseMercator(d.top,d.right):new OpenLayers.LonLat(d.top,d.right);b=new GLatLngBounds(new GLatLng(a.lat,a.lon),new GLatLng(e.lat,e.lon))}return b},addContainerPxFunction:function(){if((typeof GMap2!="undefined")&&!GMap2.prototype.fromLatLngToContainerPixel){GMap2.prototype.fromLatLngToContainerPixel=function(b){var a=this.fromLatLngToDivPixel(b);var d=this.getContainer().firstChild.firstChild;a.x+=d.offsetLeft;a.y+=d.offsetTop;return a}}},getWarningHTML:function(){return OpenLayers.i18n("googleWarning")},setMapObjectCenter:function(a,b){this.mapObject.setCenter(a,b)},dragPanMapObject:function(b,a){this.dragObject.moveBy(new GSize(-b,a))},getMapObjectCenter:function(){return this.mapObject.getCenter()},getMapObjectZoom:function(){return this.mapObject.getZoom()},getMapObjectLonLatFromMapObjectPixel:function(a){return this.mapObject.fromContainerPixelToLatLng(a)},getMapObjectPixelFromMapObjectLonLat:function(a){return this.mapObject.fromLatLngToContainerPixel(a)},getMapObjectZoomFromMapObjectBounds:function(a){return this.mapObject.getBoundsZoomLevel(a)},getLongitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.lng(),a.lat()).lon:a.lng()},getLatitudeFromMapObjectLonLat:function(b){var a=this.sphericalMercator?this.forwardMercator(b.lng(),b.lat()).lat:b.lat();return a},getMapObjectLonLatFromLonLat:function(e,b){var d;if(this.sphericalMercator){var a=this.inverseMercator(e,b);d=new GLatLng(a.lat,a.lon)}else{d=new GLatLng(b,e)}return d},getXFromMapObjectPixel:function(a){return a.x},getYFromMapObjectPixel:function(a){return a.y},getMapObjectPixelFromXY:function(a,b){return new GPoint(a,b)},CLASS_NAME:"OpenLayers.Layer.Google"});OpenLayers.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.HTTPRequest,{tileSize:null,grid:null,singleTile:false,ratio:1.5,buffer:2,numLoadingTiles:0,initialize:function(d,b,e,a){OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,arguments);this.events.addEventType("tileloaded");this.grid=[]},destroy:function(){this.clearGrid();this.grid=null;this.tileSize=null;OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments)},clearGrid:function(){if(this.grid){for(var h=0,b=this.grid.length;h<b;h++){var g=this.grid[h];for(var d=0,a=g.length;d<a;d++){var e=g[d];this.removeTileMonitoringHooks(e);e.destroy()}}this.grid=[]}},clone:function(a){if(a==null){a=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[a]);if(this.tileSize!=null){a.tileSize=this.tileSize.clone()}a.grid=[];return a},moveTo:function(e,a,g){OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);e=e||this.map.getExtent();if(e!=null){var d=!this.grid.length||a;var b=this.getTilesBounds();if(this.singleTile){if(d||(!g&&!b.containsBounds(e))){this.initSingleTile(e)}}else{if(d||!b.containsBounds(e,true)){this.initGriddedTiles(e)}else{this.moveGriddedTiles(e)}}}},setTileSize:function(a){if(this.singleTile){a=this.map.getSize().clone();a.h=parseInt(a.h*this.ratio);a.w=parseInt(a.w*this.ratio)}OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this,[a])},getGridBounds:function(){var a="The getGridBounds() function is deprecated. It will be removed in 3.0. Please use getTilesBounds() instead.";OpenLayers.Console.warn(a);return this.getTilesBounds()},getTilesBounds:function(){var g=null;if(this.grid.length){var a=this.grid.length-1;var e=this.grid[a][0];var b=this.grid[0].length-1;var d=this.grid[0][b];g=new OpenLayers.Bounds(e.bounds.left,e.bounds.bottom,d.bounds.right,d.bounds.top)}return g},initSingleTile:function(h){var a=h.getCenterLonLat();var m=h.getWidth()*this.ratio;var b=h.getHeight()*this.ratio;var l=new OpenLayers.Bounds(a.lon-(m/2),a.lat-(b/2),a.lon+(m/2),a.lat+(b/2));var e=new OpenLayers.LonLat(l.left,l.top);var d=this.map.getLayerPxFromLonLat(e);if(!this.grid.length){this.grid[0]=[]}var g=this.grid[0][0];if(!g){g=this.addTile(l,d);this.addTileMonitoringHooks(g);g.draw();this.grid[0][0]=g}else{g.moveTo(l,d)}this.removeExcessTiles(1,1)},calculateGridLayout:function(a,u,g){var q=g*this.tileSize.w;var d=g*this.tileSize.h;var o=a.left-u.left;var r=Math.floor(o/q)-this.buffer;var p=o/q-r;var h=-p*this.tileSize.w;var s=u.left+r*q;var b=a.top-(u.bottom+d);var m=Math.ceil(b/d)+this.buffer;var t=m-b/d;var e=-t*this.tileSize.h;var l=u.bottom+m*d;return{tilelon:q,tilelat:d,tileoffsetlon:s,tileoffsetlat:l,tileoffsetx:h,tileoffsety:e}},initGriddedTiles:function(o){var l=this.map.getSize();var E=Math.ceil(l.h/this.tileSize.h)+Math.max(1,2*this.buffer);var G=Math.ceil(l.w/this.tileSize.w)+Math.max(1,2*this.buffer);var u=this.maxExtent;var z=this.map.getResolution();var w=this.calculateGridLayout(o,u,z);var h=Math.round(w.tileoffsetx);var d=Math.round(w.tileoffsety);var q=w.tileoffsetlon;var t=w.tileoffsetlat;var g=w.tilelon;var p=w.tilelat;this.origin=new OpenLayers.Pixel(h,d);var D=h;var F=q;var C=0;var a=parseInt(this.map.layerContainerDiv.style.left);var B=parseInt(this.map.layerContainerDiv.style.top);do{var m=this.grid[C++];if(!m){m=[];this.grid.push(m)}q=F;h=D;var e=0;do{var b=new OpenLayers.Bounds(q,t,q+g,t+p);var s=h;s-=a;var r=d;r-=B;var v=new OpenLayers.Pixel(s,r);var H=m[e++];if(!H){H=this.addTile(b,v);this.addTileMonitoringHooks(H);m.push(H)}else{H.moveTo(b,v,false)}q+=g;h+=this.tileSize.w}while((q<=o.right+g*this.buffer)||e<G);t-=p;d+=this.tileSize.h}while((t>=o.bottom-p*this.buffer)||C<E);this.removeExcessTiles(C,e);this.spiralTileLoad()},spiralTileLoad:function(){var b=[];var m=["right","down","left","up"];var l=0;var a=-1;var p=OpenLayers.Util.indexOf(m,"right");var q=0;while(q<m.length){var o=l;var d=a;switch(m[p]){case"right":d++;break;case"down":o++;break;case"left":d--;break;case"up":o--;break}var h=null;if((o<this.grid.length)&&(o>=0)&&(d<this.grid[0].length)&&(d>=0)){h=this.grid[o][d]}if((h!=null)&&(!h.queued)){b.unshift(h);h.queued=true;q=0;l=o;a=d}else{p=(p+1)%4;q++}}for(var e=0,g=b.length;e<g;e++){var h=b[e];h.draw();h.queued=false}},addTile:function(b,a){},addTileMonitoringHooks:function(a){a.onLoadStart=function(){if(this.numLoadingTiles==0){this.events.triggerEvent("loadstart")}this.numLoadingTiles++};a.events.register("loadstart",this,a.onLoadStart);a.onLoadEnd=function(){this.numLoadingTiles--;this.events.triggerEvent("tileloaded");if(this.numLoadingTiles==0){this.events.triggerEvent("loadend")}};a.events.register("loadend",this,a.onLoadEnd);a.events.register("unload",this,a.onLoadEnd)},removeTileMonitoringHooks:function(a){a.unload();a.events.un({loadstart:a.onLoadStart,loadend:a.onLoadEnd,unload:a.onLoadEnd,scope:this})},moveGriddedTiles:function(d){var b=this.buffer||1;while(true){var a=this.grid[0][0].position;var e=this.map.getViewPortPxFromLayerPx(a);if(e.x>-this.tileSize.w*(b-1)){this.shiftColumn(true)}else{if(e.x<-this.tileSize.w*b){this.shiftColumn(false)}else{if(e.y>-this.tileSize.h*(b-1)){this.shiftRow(true)}else{if(e.y<-this.tileSize.h*b){this.shiftRow(false)}else{break}}}}}},shiftRow:function(s){var d=(s)?0:(this.grid.length-1);var b=this.grid;var h=b[d];var g=this.map.getResolution();var m=(s)?-this.tileSize.h:this.tileSize.h;var l=g*-m;var r=(s)?b.pop():b.shift();for(var o=0,q=h.length;o<q;o++){var e=h[o];var a=e.bounds.clone();var p=e.position.clone();a.bottom=a.bottom+l;a.top=a.top+l;p.y=p.y+m;r[o].moveTo(a,p)}if(s){b.unshift(r)}else{b.push(r)}},shiftColumn:function(r){var e=(r)?-this.tileSize.w:this.tileSize.w;var d=this.map.getResolution();var p=d*e;for(var g=0,l=this.grid.length;g<l;g++){var q=this.grid[g];var o=(r)?0:(q.length-1);var b=q[o];var a=b.bounds.clone();var h=b.position.clone();a.left=a.left+p;a.right=a.right+p;h.x=h.x+e;var m=r?this.grid[g].pop():this.grid[g].shift();m.moveTo(a,h);if(r){q.unshift(m)}else{q.push(m)}}},removeExcessTiles:function(g,d){while(this.grid.length>g){var h=this.grid.pop();for(var b=0,a=h.length;b<a;b++){var e=h[b];this.removeTileMonitoringHooks(e);e.destroy()}}while(this.grid[0].length>d){for(var b=0,a=this.grid.length;b<a;b++){var h=this.grid[b];var e=h.pop();this.removeTileMonitoringHooks(e);e.destroy()}}},onMapResize:function(){if(this.singleTile){this.clearGrid();this.setTileSize()}},getTileBounds:function(e){var d=this.maxExtent;var h=this.getResolution();var g=h*this.tileSize.w;var b=h*this.tileSize.h;var m=this.getLonLatFromViewPortPx(e);var a=d.left+(g*Math.floor((m.lon-d.left)/g));var l=d.bottom+(b*Math.floor((m.lat-d.bottom)/b));return new OpenLayers.Bounds(a,l,a+g,l+b)},CLASS_NAME:"OpenLayers.Layer.Grid"});OpenLayers.Layer.MultiMap=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:1,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[9,1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125],type:null,initialize:function(b,a){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters();this.RESOLUTIONS.unshift(10)}},loadMapObject:function(){try{this.mapObject=new MultimapViewer(this.div)}catch(a){}},getWarningHTML:function(){return OpenLayers.i18n("getLayerWarning",{layerType:"MM",layerLib:"MultiMap"})},setMapObjectCenter:function(a,b){this.mapObject.goToPosition(a,b)},getMapObjectCenter:function(){return this.mapObject.getCurrentPosition()},getMapObjectZoom:function(){return this.mapObject.getZoomFactor()},getMapObjectLonLatFromMapObjectPixel:function(a){a.x=a.x-(this.map.getSize().w/2);a.y=a.y-(this.map.getSize().h/2);return this.mapObject.getMapPositionAt(a)},getMapObjectPixelFromMapObjectLonLat:function(a){return this.mapObject.geoPosToContainerPixels(a)},getLongitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.lon,a.lat).lon:a.lon},getLatitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.lon,a.lat).lat:a.lat},getMapObjectLonLatFromLonLat:function(e,d){var a;if(this.sphericalMercator){var b=this.inverseMercator(e,d);a=new MMLatLon(b.lat,b.lon)}else{a=new MMLatLon(d,e)}return a},getXFromMapObjectPixel:function(a){return a.x},getYFromMapObjectPixel:function(a){return a.y},getMapObjectPixelFromXY:function(a,b){return new MMPoint(a,b)},CLASS_NAME:"OpenLayers.Layer.MultiMap"});OpenLayers.Layer.Text=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,initialize:function(b,a){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments);this.features=new Array()},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);this.clearFeatures();this.features=null},loadText:function(){if(!this.loaded){if(this.location!=null){var a=function(b){this.events.triggerEvent("loadend")};this.events.triggerEvent("loadstart");OpenLayers.Request.GET({url:this.location,success:this.parseData,failure:a,scope:this});this.loaded=true}}},moveTo:function(d,a,b){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadText()}},parseData:function(p){var r=p.responseText;var t={};OpenLayers.Util.extend(t,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){t.externalProjection=this.projection;t.internalProjection=this.map.getProjectionObject()}var b=new OpenLayers.Format.Text(t);var d=b.read(r);for(var l=0,m=d.length;l<m;l++){var h={};var s=d[l];var q;var o,e;q=new OpenLayers.LonLat(s.geometry.x,s.geometry.y);if(s.style.graphicWidth&&s.style.graphicHeight){o=new OpenLayers.Size(s.style.graphicWidth,s.style.graphicHeight)}if(s.style.graphicXOffset!==undefined&&s.style.graphicYOffset!==undefined){e=new OpenLayers.Pixel(s.style.graphicXOffset,s.style.graphicYOffset)}if(s.style.externalGraphic!=null){h.icon=new OpenLayers.Icon(s.style.externalGraphic,o,e)}else{h.icon=OpenLayers.Marker.defaultIcon();if(o!=null){h.icon.setSize(o)}}if((s.attributes.title!=null)&&(s.attributes.description!=null)){h.popupContentHTML="<h2>"+s.attributes.title+"</h2><p>"+s.attributes.description+"</p>"}h.overflow=s.attributes.overflow||"auto";var a=new OpenLayers.Feature(this,q,h);this.features.push(a);var g=a.createMarker();if((s.attributes.title!=null)&&(s.attributes.description!=null)){g.events.register("click",a,this.markerClick)}this.addMarker(g)}this.events.triggerEvent("loadend")},markerClick:function(b){var e=(this==this.layer.selectedFeature);this.layer.selectedFeature=(!e)?this:null;for(var d=0,a=this.layer.map.popups.length;d<a;d++){this.layer.map.removePopup(this.layer.map.popups[d])}if(!e){this.layer.map.addPopup(this.createPopup())}OpenLayers.Event.stop(b)},clearFeatures:function(){if(this.features!=null){while(this.features.length>0){var a=this.features[0];OpenLayers.Util.removeItem(this.features,a);a.destroy()}}},CLASS_NAME:"OpenLayers.Layer.Text"});OpenLayers.Layer.VirtualEarth=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:1,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125,0.00002145767211914062],type:null,sphericalMercator:false,initialize:function(b,a){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters()}},loadMapObject:function(){var a=OpenLayers.Util.createDiv(this.name);var d=this.map.getSize();a.style.width=d.w+"px";a.style.height=d.h+"px";this.div.appendChild(a);try{this.mapObject=new VEMap(this.name)}catch(b){}if(this.mapObject!=null){try{this.mapObject.LoadMap(null,null,this.type,true);this.mapObject.AttachEvent("onmousedown",function(){return true})}catch(b){}this.mapObject.HideDashboard()}if(!this.mapObject||!this.mapObject.vemapcontrol||!this.mapObject.vemapcontrol.PanMap||(typeof this.mapObject.vemapcontrol.PanMap!="function")){this.dragPanMapObject=null}},getWarningHTML:function(){return OpenLayers.i18n("getLayerWarning",{layerType:"VE",layerLib:"VirtualEarth"})},setMapObjectCenter:function(a,b){this.mapObject.SetCenterAndZoom(a,b)},getMapObjectCenter:function(){return this.mapObject.GetCenter()},dragPanMapObject:function(b,a){this.mapObject.vemapcontrol.PanMap(b,-a)},getMapObjectZoom:function(){return this.mapObject.GetZoomLevel()},getMapObjectLonLatFromMapObjectPixel:function(a){return(typeof VEPixel!="undefined")?this.mapObject.PixelToLatLong(a):this.mapObject.PixelToLatLong(a.x,a.y)},getMapObjectPixelFromMapObjectLonLat:function(a){return this.mapObject.LatLongToPixel(a)},getLongitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.Longitude,a.Latitude).lon:a.Longitude},getLatitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.Longitude,a.Latitude).lat:a.Latitude},getMapObjectLonLatFromLonLat:function(e,b){var d;if(this.sphericalMercator){var a=this.inverseMercator(e,b);d=new VELatLong(a.lat,a.lon)}else{d=new VELatLong(b,e)}return d},getXFromMapObjectPixel:function(a){return a.x},getYFromMapObjectPixel:function(a){return a.y},getMapObjectPixelFromXY:function(a,b){return(typeof VEPixel!="undefined")?new VEPixel(a,b):new Msn.VE.Pixel(a,b)},CLASS_NAME:"OpenLayers.Layer.VirtualEarth"});OpenLayers.Layer.Yahoo=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125,0.00002145767211914062,0.00001072883605957031],type:null,sphericalMercator:false,initialize:function(b,a){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters()}},loadMapObject:function(){try{var a=this.getMapObjectSizeFromOLSize(this.map.getSize());this.mapObject=new YMap(this.div,this.type,a);this.mapObject.disableKeyControls();this.mapObject.disableDragMap();if(!this.mapObject.moveByXY||(typeof this.mapObject.moveByXY!="function")){this.dragPanMapObject=null}}catch(b){}},onMapResize:function(){try{var a=this.getMapObjectSizeFromOLSize(this.map.getSize());this.mapObject.resizeTo(a)}catch(b){}},setMap:function(a){OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments);this.map.events.register("moveend",this,this.fixYahooEventPane)},fixYahooEventPane:function(){var a=OpenLayers.Util.getElement("ygddfdiv");if(a!=null){if(a.parentNode!=null){a.parentNode.removeChild(a)}this.map.events.unregister("moveend",this,this.fixYahooEventPane)}},getWarningHTML:function(){return OpenLayers.i18n("getLayerWarning",{layerType:"Yahoo",layerLib:"Yahoo"})},getOLZoomFromMapObjectZoom:function(a){var b=null;if(a!=null){b=OpenLayers.Layer.FixedZoomLevels.prototype.getOLZoomFromMapObjectZoom.apply(this,[a]);b=18-b}return b},getMapObjectZoomFromOLZoom:function(a){var b=null;if(a!=null){b=OpenLayers.Layer.FixedZoomLevels.prototype.getMapObjectZoomFromOLZoom.apply(this,[a]);b=18-b}return b},setMapObjectCenter:function(a,b){this.mapObject.drawZoomAndCenter(a,b)},getMapObjectCenter:function(){return this.mapObject.getCenterLatLon()},dragPanMapObject:function(b,a){this.mapObject.moveByXY({x:-b,y:a})},getMapObjectZoom:function(){return this.mapObject.getZoomLevel()},getMapObjectLonLatFromMapObjectPixel:function(a){return this.mapObject.convertXYLatLon(a)},getMapObjectPixelFromMapObjectLonLat:function(a){return this.mapObject.convertLatLonXY(a)},getLongitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.Lon,a.Lat).lon:a.Lon},getLatitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.Lon,a.Lat).lat:a.Lat},getMapObjectLonLatFromLonLat:function(e,d){var a;if(this.sphericalMercator){var b=this.inverseMercator(e,d);a=new YGeoPoint(b.lat,b.lon)}else{a=new YGeoPoint(d,e)}return a},getXFromMapObjectPixel:function(a){return a.x},getYFromMapObjectPixel:function(a){return a.y},getMapObjectPixelFromXY:function(a,b){return new YCoordPoint(a,b)},getMapObjectSizeFromOLSize:function(a){return new YSize(a.w,a.h)},CLASS_NAME:"OpenLayers.Layer.Yahoo"});OpenLayers.Protocol.HTTP=OpenLayers.Class(OpenLayers.Protocol,{url:null,headers:null,params:null,callback:null,scope:null,readWithPOST:false,initialize:function(a){this.params={};this.headers={};OpenLayers.Protocol.prototype.initialize.apply(this,arguments)},destroy:function(){this.params=null;this.headers=null;OpenLayers.Protocol.prototype.destroy.apply(this)},createCallback:function(d,a,b){return OpenLayers.Function.bind(function(){d.apply(this,[a,b])},this)},read:function(a){a=OpenLayers.Util.applyDefaults(a,this.options);var b=(a.readWithPOST!==undefined)?a.readWithPOST:this.readWithPOST;var d=new OpenLayers.Protocol.Response({requestType:"read"});if(a.filter&&a.filter instanceof OpenLayers.Filter.Spatial){if(a.filter.type==OpenLayers.Filter.Spatial.BBOX){a.params=OpenLayers.Util.extend(a.params,{bbox:a.filter.value.toArray()})}}if(b){d.priv=OpenLayers.Request.POST({url:a.url,callback:this.createCallback(this.handleRead,d,a),data:OpenLayers.Util.getParameterString(a.params),headers:{"Content-Type":"application/x-www-form-urlencoded"}})}else{d.priv=OpenLayers.Request.GET({url:a.url,callback:this.createCallback(this.handleRead,d,a),params:a.params,headers:a.headers})}return d},handleRead:function(b,a){this.handleResponse(b,a)},create:function(b,a){a=OpenLayers.Util.applyDefaults(a,this.options);var d=new OpenLayers.Protocol.Response({reqFeatures:b,requestType:"create"});d.priv=OpenLayers.Request.POST({url:a.url,callback:this.createCallback(this.handleCreate,d,a),headers:a.headers,data:this.format.write(b)});return d},handleCreate:function(b,a){this.handleResponse(b,a)},update:function(d,b){var a=b.url||d.url||this.options.url;b=OpenLayers.Util.applyDefaults(b,this.options);var e=new OpenLayers.Protocol.Response({reqFeatures:d,requestType:"update"});e.priv=OpenLayers.Request.PUT({url:a,callback:this.createCallback(this.handleUpdate,e,b),headers:b.headers,data:this.format.write(d)});return e},handleUpdate:function(b,a){this.handleResponse(b,a)},"delete":function(d,b){var a=b.url||d.url||this.options.url;b=OpenLayers.Util.applyDefaults(b,this.options);var e=new OpenLayers.Protocol.Response({reqFeatures:d,requestType:"delete"});e.priv=OpenLayers.Request.DELETE({url:a,callback:this.createCallback(this.handleDelete,e,b),headers:b.headers});return e},handleDelete:function(b,a){this.handleResponse(b,a)},handleResponse:function(d,a){var b=d.priv;if(a.callback){if(b.status>=200&&b.status<300){if(d.requestType!="delete"){d.features=this.parseFeatures(b)}d.code=OpenLayers.Protocol.Response.SUCCESS}else{d.code=OpenLayers.Protocol.Response.FAILURE}a.callback.call(a.scope,d)}},parseFeatures:function(a){var b=a.responseXML;if(!b||!b.documentElement){b=a.responseText}if(!b||b.length<=0){return null}return this.format.read(b)},commit:function(b,v){v=OpenLayers.Util.applyDefaults(v,this.options);var e=[],r=0;var p={};p[OpenLayers.State.INSERT]=[];p[OpenLayers.State.UPDATE]=[];p[OpenLayers.State.DELETE]=[];var u,q,d=[];for(var g=0,o=b.length;g<o;++g){u=b[g];q=p[u.state];if(q){q.push(u);d.push(u)}}var l=(p[OpenLayers.State.INSERT].length>0?1:0)+p[OpenLayers.State.UPDATE].length+p[OpenLayers.State.DELETE].length;var t=true;var a=new OpenLayers.Protocol.Response({reqFeatures:d});function m(z){var w=z.features?z.features.length:0;var C=new Array(w);for(var B=0;B<w;++B){C[B]=z.features[B].fid}a.insertIds=C;s.apply(this,[z])}function s(w){this.callUserCallback(w,v);t=t&&w.success();r++;if(r>=l){if(v.callback){a.code=t?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE;v.callback.apply(v.scope,[a])}}}var h=p[OpenLayers.State.INSERT];if(h.length>0){e.push(this.create(h,OpenLayers.Util.applyDefaults({callback:m,scope:this},v.create)))}h=p[OpenLayers.State.UPDATE];for(var g=h.length-1;g>=0;--g){e.push(this.update(h[g],OpenLayers.Util.applyDefaults({callback:s,scope:this},v.update)))}h=p[OpenLayers.State.DELETE];for(var g=h.length-1;g>=0;--g){e.push(this["delete"](h[g],OpenLayers.Util.applyDefaults({callback:s,scope:this},v["delete"])))}return e},abort:function(a){if(a){a.priv.abort()}},callUserCallback:function(d,a){var b=a[d.requestType];if(b&&b.callback){b.callback.call(b.scope,d)}},CLASS_NAME:"OpenLayers.Protocol.HTTP"});OpenLayers.Style=OpenLayers.Class({name:null,title:null,description:null,layerName:null,isDefault:false,rules:null,context:null,defaultStyle:null,defaultsPerSymbolizer:false,propertyStyles:null,initialize:function(b,a){OpenLayers.Util.extend(this,a);this.rules=[];if(a&&a.rules){this.addRules(a.rules)}this.setDefaultStyle(b||OpenLayers.Feature.Vector.style["default"])},destroy:function(){for(var b=0,a=this.rules.length;b<a;b++){this.rules[b].destroy();this.rules[b]=null}this.rules=null;this.defaultStyle=null},createSymbolizer:function(p){var a=this.defaultsPerSymbolizer?{}:this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),p);var o=this.rules;var m,b;var d=[];var h=false;for(var e=0,g=o.length;e<g;e++){m=o[e];var l=m.evaluate(p);if(l){if(m instanceof OpenLayers.Rule&&m.elseFilter){d.push(m)}else{h=true;this.applySymbolizer(m,a,p)}}}if(h==false&&d.length>0){h=true;for(var e=0,g=d.length;e<g;e++){this.applySymbolizer(d[e],a,p)}}if(o.length>0&&h==false){a.display="none"}return a},applySymbolizer:function(h,e,b){var a=b.geometry?this.getSymbolizerPrefix(b.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];var d=h.symbolizer[a]||h.symbolizer;if(this.defaultsPerSymbolizer===true){var g=this.defaultStyle;OpenLayers.Util.applyDefaults(d,{pointRadius:g.pointRadius});if(d.stroke===true||d.graphic===true){OpenLayers.Util.applyDefaults(d,{strokeWidth:g.strokeWidth,strokeColor:g.strokeColor,strokeOpacity:g.strokeOpacity,strokeDashstyle:g.strokeDashstyle,strokeLinecap:g.strokeLinecap})}if(d.fill===true||d.graphic===true){OpenLayers.Util.applyDefaults(d,{fillColor:g.fillColor,fillOpacity:g.fillOpacity})}if(d.graphic===true){OpenLayers.Util.applyDefaults(d,{pointRadius:this.defaultStyle.pointRadius,externalGraphic:this.defaultStyle.externalGraphic,graphicName:this.defaultStyle.graphicName,graphicOpacity:this.defaultStyle.graphicOpacity,graphicWidth:this.defaultStyle.graphicWidth,graphicHeight:this.defaultStyle.graphicHeight,graphicXOffset:this.defaultStyle.graphicXOffset,graphicYOffset:this.defaultStyle.graphicYOffset})}}return this.createLiterals(OpenLayers.Util.extend(e,d),b)},createLiterals:function(e,d){var b=this.context||d.attributes||d.data;for(var a in this.propertyStyles){e[a]=OpenLayers.Style.createLiteral(e[a],b,d)}return e},findPropertyStyles:function(){var e={};var h=this.defaultStyle;this.addPropertyStyles(e,h);var m=this.rules;var g,l;for(var d=0,a=m.length;d<a;d++){g=m[d].symbolizer;for(var b in g){l=g[b];if(typeof l=="object"){this.addPropertyStyles(e,l)}else{this.addPropertyStyles(e,g);break}}}return e},addPropertyStyles:function(b,d){var e;for(var a in d){e=d[a];if(typeof e=="string"&&e.match(/\$\{\w+\}/)){b[a]=true}}return b},addRules:function(a){this.rules=this.rules.concat(a);this.propertyStyles=this.findPropertyStyles()},setDefaultStyle:function(a){this.defaultStyle=a;this.propertyStyles=this.findPropertyStyles()},getSymbolizerPrefix:function(e){var d=OpenLayers.Style.SYMBOLIZER_PREFIXES;for(var b=0,a=d.length;b<a;b++){if(e.CLASS_NAME.indexOf(d[b])!=-1){return d[b]}}},CLASS_NAME:"OpenLayers.Style"});OpenLayers.Style.createLiteral=function(d,b,a){if(typeof d=="string"&&d.indexOf("${")!=-1){d=OpenLayers.String.format(d,b,[a]);d=(isNaN(d)||!d)?d:parseFloat(d)}return d};OpenLayers.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon","Text"];OpenLayers.Control.Navigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,dragPanOptions:null,zoomBox:null,zoomWheelEnabled:true,handleRightClicks:false,zoomBoxKeyMask:OpenLayers.Handler.MOD_SHIFT,initialize:function(a){this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.deactivate();if(this.dragPan){this.dragPan.destroy()}this.dragPan=null;if(this.zoomBox){this.zoomBox.destroy()}this.zoomBox=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){this.dragPan.activate();if(this.zoomWheelEnabled){this.handlers.wheel.activate()}this.handlers.click.activate();this.zoomBox.activate();return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){this.zoomBox.deactivate();this.dragPan.deactivate();this.handlers.click.deactivate();this.handlers.wheel.deactivate();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},draw:function(){if(this.handleRightClicks){this.map.viewPortDiv.oncontextmenu=function(){return false}}var a={dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick};var b={"double":true,stopDouble:true};this.handlers.click=new OpenLayers.Handler.Click(this,a,b);this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map},this.dragPanOptions));this.zoomBox=new OpenLayers.Control.ZoomBox({map:this.map,keyMask:this.zoomBoxKeyMask});this.dragPan.draw();this.zoomBox.draw();this.handlers.wheel=new OpenLayers.Handler.MouseWheel(this,{up:this.wheelUp,down:this.wheelDown});this.activate()},defaultDblClick:function(b){var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(a,this.map.zoom+1)},defaultDblRightClick:function(b){var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(a,this.map.zoom-1)},wheelChange:function(m,d){var h=this.map.getZoom()+d;if(!this.map.isValidZoomLevel(h)){return}var o=this.map.getSize();var g=o.w/2-m.xy.x;var e=m.xy.y-o.h/2;var l=this.map.baseLayer.getResolutionForZoom(h);var a=this.map.getLonLatFromPixel(m.xy);var b=new OpenLayers.LonLat(a.lon+g*l,a.lat+e*l);this.map.setCenter(b,h)},wheelUp:function(a){this.wheelChange(a,1)},wheelDown:function(a){this.wheelChange(a,-1)},disableZoomWheel:function(){this.zoomWheelEnabled=false;this.handlers.wheel.deactivate()},enableZoomWheel:function(){this.zoomWheelEnabled=true;if(this.active){this.handlers.wheel.activate()}},CLASS_NAME:"OpenLayers.Control.Navigation"});OpenLayers.Filter=OpenLayers.Class({initialize:function(a){OpenLayers.Util.extend(this,a)},destroy:function(){},evaluate:function(a){return true},clone:function(){return null},CLASS_NAME:"OpenLayers.Filter"});OpenLayers.Geometry=OpenLayers.Class({id:null,parent:null,bounds:null,initialize:function(){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){this.id=null;this.bounds=null},clone:function(){return new OpenLayers.Geometry()},setBounds:function(a){if(a){this.bounds=a.clone()}},clearBounds:function(){this.bounds=null;if(this.parent){this.parent.clearBounds()}},extendBounds:function(b){var a=this.getBounds();if(!a){this.setBounds(b)}else{this.bounds.extend(b)}},getBounds:function(){if(this.bounds==null){this.calculateBounds()}return this.bounds},calculateBounds:function(){},distanceTo:function(b,a){},getVertices:function(a){},atPoint:function(g,m,h){var d=false;var e=this.getBounds();if((e!=null)&&(g!=null)){var b=(m!=null)?m:0;var a=(h!=null)?h:0;var l=new OpenLayers.Bounds(this.bounds.left-b,this.bounds.bottom-a,this.bounds.right+b,this.bounds.top+a);d=l.containsLonLat(g)}return d},getLength:function(){return 0},getArea:function(){return 0},getCentroid:function(){return null},toString:function(){return OpenLayers.Format.WKT.prototype.write(new OpenLayers.Feature.Vector(this))},CLASS_NAME:"OpenLayers.Geometry"});OpenLayers.Geometry.fromWKT=function(h){var l=arguments.callee.format;if(!l){l=new OpenLayers.Format.WKT();arguments.callee.format=l}var e;var b=l.read(h);if(b instanceof OpenLayers.Feature.Vector){e=b.geometry}else{if(b instanceof Array){var a=b.length;var g=new Array(a);for(var d=0;d<a;++d){g[d]=b[d].geometry}e=new OpenLayers.Geometry.Collection(g)}}return e};OpenLayers.Geometry.segmentsIntersect=function(a,M,b){var w=b&&b.point;var E=b&&b.tolerance;var h=false;var G=a.x1-M.x1;var K=a.y1-M.y1;var t=a.x2-a.x1;var D=a.y2-a.y1;var z=M.y2-M.y1;var q=M.x2-M.x1;var I=(z*t)-(q*D);var g=(q*K)-(z*G);var e=(t*K)-(D*G);if(I==0){if(g==0&&e==0){h=true}}else{var J=g/I;var H=e/I;if(J>=0&&J<=1&&H>=0&&H<=1){if(!w){h=true}else{var m=a.x1+(J*t);var l=a.y1+(J*D);h=new OpenLayers.Geometry.Point(m,l)}}}if(E){var v;if(h){if(w){var s=[a,M];var F,m,l;outer:for(var C=0;C<2;++C){F=s[C];for(var B=1;B<3;++B){m=F["x"+B];l=F["y"+B];v=Math.sqrt(Math.pow(m-h.x,2)+Math.pow(l-h.y,2));if(v<E){h.x=m;h.y=l;break outer}}}}}else{var s=[a,M];var u,L,m,l,r,o;outer:for(var C=0;C<2;++C){u=s[C];L=s[(C+1)%2];for(var B=1;B<3;++B){r={x:u["x"+B],y:u["y"+B]};o=OpenLayers.Geometry.distanceToSegment(r,L);if(o.distance<E){if(w){h=new OpenLayers.Geometry.Point(r.x,r.y)}else{h=true}break outer}}}}}return h};OpenLayers.Geometry.distanceToSegment=function(q,e){var d=q.x;var p=q.y;var b=e.x1;var o=e.y1;var a=e.x2;var h=e.y2;var s=a-b;var r=h-o;var m=((s*(d-b))+(r*(p-o)))/(Math.pow(s,2)+Math.pow(r,2));var l,g;if(m<=0){l=b;g=o}else{if(m>=1){l=a;g=h}else{l=b+m*s;g=o+m*r}}return{distance:Math.sqrt(Math.pow(l-d,2)+Math.pow(g-p,2)),x:l,y:g}};OpenLayers.Layer.ArcGIS93Rest=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{format:"png"},isBaseLayer:true,initialize:function(e,d,g,b){var a=[];g=OpenLayers.Util.upperCaseObject(g);a.push(e,d,g,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));if(this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true"){if((b==null)||(!b.isBaseLayer)){this.isBaseLayer=false}if(this.params.FORMAT=="jpg"){this.params.FORMAT=OpenLayers.Util.alphaHack()?"gif":"png"}}},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},getURL:function(g){g=this.adjustBounds(g);var e=this.projection.getCode().split(":");var d=e[e.length-1];var l=this.getImageSize();var m={BBOX:g.toBBOX(),SIZE:l.w+","+l.h,F:"image",BBOXSR:d,IMAGESR:d};if(this.layerDefs){var h=[];var a;for(a in this.layerDefs){if(this.layerDefs.hasOwnProperty(a)){if(this.layerDefs[a]){h.push(a);h.push(":");h.push(this.layerDefs[a]);h.push(";")}}}if(h.length>0){m.LAYERDEFS=h.join("")}}var b=this.getFullRequestString(m);return b},setLayerFilter:function(b,a){if(!this.layerDefs){this.layerDefs={}}if(a){this.layerDefs[b]=a}else{delete this.layerDefs[b]}},clearLayerFilter:function(a){if(a){delete this.layerDefs[a]}else{delete this.layerDefs}},mergeNewParams:function(d){var b=OpenLayers.Util.upperCaseObject(d);var a=[b];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,a)},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},CLASS_NAME:"OpenLayers.Layer.ArcGIS93Rest"});OpenLayers.Layer.KaMap=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,units:null,resolution:OpenLayers.DOTS_PER_INCH,DEFAULT_PARAMS:{i:"jpeg",map:""},initialize:function(e,d,g,b){var a=[];a.push(e,d,g,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},getURL:function(d){d=this.adjustBounds(d);var e=this.map.getResolution();var g=Math.round((this.map.getScale()*10000))/10000;var b=Math.round(d.left/e);var a=-Math.round(d.top/e);return this.getFullRequestString({t:a,l:b,s:g})},addTile:function(d,a){var b=this.getURL(d);return new OpenLayers.Tile.Image(this,a,d,b,this.tileSize)},calculateGridLayout:function(a,u,g){var q=g*this.tileSize.w;var d=g*this.tileSize.h;var o=a.left;var r=Math.floor(o/q)-this.buffer;var p=o/q-r;var h=-p*this.tileSize.w;var s=r*q;var b=a.top;var m=Math.ceil(b/d)+this.buffer;var t=m-b/d;var e=-(t+1)*this.tileSize.h;var l=m*d;return{tilelon:q,tilelat:d,tileoffsetlon:s,tileoffsetlat:l,tileoffsetx:h,tileoffsety:e}},clone:function(a){if(a==null){a=new OpenLayers.Layer.KaMap(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);if(this.tileSize!=null){a.tileSize=this.tileSize.clone()}a.grid=[];return a},getTileBounds:function(d){var g=this.getResolution();var e=g*this.tileSize.w;var b=g*this.tileSize.h;var l=this.getLonLatFromViewPortPx(d);var a=e*Math.floor(l.lon/e);var h=b*Math.floor(l.lat/b);return new OpenLayers.Bounds(a,h,a+e,h+b)},CLASS_NAME:"OpenLayers.Layer.KaMap"});OpenLayers.Layer.MapGuide=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,useHttpTile:false,singleTile:false,useOverlay:false,useAsyncOverlay:true,TILE_PARAMS:{operation:"GETTILEIMAGE",version:"1.2.0"},SINGLE_TILE_PARAMS:{operation:"GETMAPIMAGE",format:"PNG",locale:"en",clip:"1",version:"1.0.0"},OVERLAY_PARAMS:{operation:"GETDYNAMICMAPOVERLAYIMAGE",format:"PNG",locale:"en",clip:"1",version:"2.0.0"},FOLDER_PARAMS:{tileColumnsPerFolder:30,tileRowsPerFolder:30,format:"png",querystring:null},defaultSize:new OpenLayers.Size(300,300),initialize:function(d,b,e,a){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments);if(a==null||a.isBaseLayer==null){this.isBaseLayer=((this.transparent!="true")&&(this.transparent!=true))}if(a&&a.useOverlay!=null){this.useOverlay=a.useOverlay}if(this.singleTile){if(this.useOverlay){OpenLayers.Util.applyDefaults(this.params,this.OVERLAY_PARAMS);if(!this.useAsyncOverlay){this.params.version="1.0.0"}}else{OpenLayers.Util.applyDefaults(this.params,this.SINGLE_TILE_PARAMS)}}else{if(this.useHttpTile){OpenLayers.Util.applyDefaults(this.params,this.FOLDER_PARAMS)}else{OpenLayers.Util.applyDefaults(this.params,this.TILE_PARAMS)}this.setTileSize(this.defaultSize)}},clone:function(a){if(a==null){a=new OpenLayers.Layer.MapGuide(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},getURL:function(a){var e;var b=a.getCenterLonLat();var m=this.map.getCurrentSize();if(this.singleTile){var g={setdisplaydpi:OpenLayers.DOTS_PER_INCH,setdisplayheight:m.h*this.ratio,setdisplaywidth:m.w*this.ratio,setviewcenterx:b.lon,setviewcentery:b.lat,setviewscale:this.map.getScale()};if(this.useOverlay&&!this.useAsyncOverlay){var o={};o=OpenLayers.Util.extend(o,g);o.operation="GETVISIBLEMAPEXTENT";o.version="1.0.0";o.session=this.params.session;o.mapName=this.params.mapName;o.format="text/xml";e=this.getFullRequestString(o);OpenLayers.Request.GET({url:e,async:false})}e=this.getFullRequestString(g)}else{var l=this.map.getResolution();var h=Math.floor((a.left-this.maxExtent.left)/l);h=Math.round(h/this.tileSize.w);var d=Math.floor((this.maxExtent.top-a.top)/l);d=Math.round(d/this.tileSize.h);if(this.useHttpTile){e=this.getImageFilePath({tilecol:h,tilerow:d,scaleindex:this.resolutions.length-this.map.zoom-1})}else{e=this.getFullRequestString({tilecol:h,tilerow:d,scaleindex:this.resolutions.length-this.map.zoom-1})}}return e},getFullRequestString:function(h,g){var b=(g==null)?this.url:g;if(typeof b=="object"){b=b[Math.floor(Math.random()*b.length)]}var o=b;var l=OpenLayers.Util.extend({},this.params);l=OpenLayers.Util.extend(l,h);var e=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getArgs(b));for(var m in l){if(m.toUpperCase() in e){delete l[m]}}var a=OpenLayers.Util.getParameterString(l);a=a.replace(/,/g,"+");if(a!=""){var d=b.charAt(b.length-1);if((d=="&")||(d=="?")){o+=a}else{if(b.indexOf("?")==-1){o+="?"+a}else{o+="&"+a}}}return o},getImageFilePath:function(l,g){var d=(g==null)?this.url:g;if(typeof d=="object"){d=d[Math.floor(Math.random()*d.length)]}var b=d;var e="";var h="";if(l.tilerow<0){e="-"}if(l.tilerow==0){e+="0"}else{e+=Math.floor(Math.abs(l.tilerow/this.params.tileRowsPerFolder))*this.params.tileRowsPerFolder}if(l.tilecol<0){h="-"}if(l.tilecol==0){h+="0"}else{h+=Math.floor(Math.abs(l.tilecol/this.params.tileColumnsPerFolder))*this.params.tileColumnsPerFolder}var a="/S"+Math.floor(l.scaleindex)+"/"+this.params.basemaplayergroupname+"/R"+e+"/C"+h+"/"+(l.tilerow%this.params.tileRowsPerFolder)+"_"+(l.tilecol%this.params.tileColumnsPerFolder)+"."+this.params.format;if(this.params.querystring){a+="?"+this.params.querystring}b+=a;return b},calculateGridLayout:function(a,u,g){var q=g*this.tileSize.w;var d=g*this.tileSize.h;var o=a.left-u.left;var r=Math.floor(o/q)-this.buffer;var p=o/q-r;var h=-p*this.tileSize.w;var s=u.left+r*q;var b=u.top-a.top+d;var m=Math.floor(b/d)-this.buffer;var t=m-b/d;var e=t*this.tileSize.h;var l=u.top-d*m;return{tilelon:q,tilelat:d,tileoffsetlon:s,tileoffsetlat:l,tileoffsetx:h,tileoffsety:e}},CLASS_NAME:"OpenLayers.Layer.MapGuide"});OpenLayers.Layer.MapServer=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{mode:"map",map_imagetype:"png"},initialize:function(e,d,g,b){var a=[];a.push(e,d,g,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);if(b==null||b.isBaseLayer==null){this.isBaseLayer=((this.params.transparent!="true")&&(this.params.transparent!=true))}},clone:function(a){if(a==null){a=new OpenLayers.Layer.MapServer(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},getURL:function(d){d=this.adjustBounds(d);var b=[d.left,d.bottom,d.right,d.top];var e=this.getImageSize();var a=this.getFullRequestString({mapext:b,imgext:b,map_size:[e.w,e.h],imgx:e.w/2,imgy:e.h/2,imgxy:[e.w,e.h]});return a},getFullRequestString:function(h,g){var b=(g==null)?this.url:g;var l=OpenLayers.Util.extend({},this.params);l=OpenLayers.Util.extend(l,h);var a=OpenLayers.Util.getParameterString(l);if(b instanceof Array){b=this.selectUrl(a,b)}var e=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(b));for(var m in l){if(m.toUpperCase() in e){delete l[m]}}a=OpenLayers.Util.getParameterString(l);var o=b;a=a.replace(/,/g,"+");if(a!=""){var d=b.charAt(b.length-1);if((d=="&")||(d=="?")){o+=a}else{if(b.indexOf("?")==-1){o+="?"+a}else{o+="&"+a}}}return o},CLASS_NAME:"OpenLayers.Layer.MapServer"});OpenLayers.Layer.TMS=OpenLayers.Class(OpenLayers.Layer.Grid,{serviceVersion:"1.0.0",isBaseLayer:true,tileOrigin:null,serverResolutions:null,initialize:function(e,d,b){var a=[];a.push(e,d,{},b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a)},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Layer.TMS(this.name,this.url,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},getURL:function(e){e=this.adjustBounds(e);var d=this.map.getResolution();var a=Math.round((e.left-this.tileOrigin.lon)/(d*this.tileSize.w));var l=Math.round((e.bottom-this.tileOrigin.lat)/(d*this.tileSize.h));var h=this.serverResolutions!=null?OpenLayers.Util.indexOf(this.serverResolutions,d):this.map.getZoom();var g=this.serviceVersion+"/"+this.layername+"/"+h+"/"+a+"/"+l+"."+this.type;var b=this.url;if(b instanceof Array){b=this.selectUrl(g,b)}return b+g},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},setMap:function(a){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);if(!this.tileOrigin){this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.bottom)}},CLASS_NAME:"OpenLayers.Layer.TMS"});OpenLayers.Layer.TileCache=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,format:"image/png",serverResolutions:null,initialize:function(d,b,e,a){this.layername=e;OpenLayers.Layer.Grid.prototype.initialize.apply(this,[d,b,{},a]);this.extension=this.format.split("/")[1].toLowerCase();this.extension=(this.extension=="jpg")?"jpeg":this.extension},clone:function(a){if(a==null){a=new OpenLayers.Layer.TileCache(this.name,this.url,this.layername,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},getURL:function(b){var h=this.map.getResolution();var l=this.maxExtent;var q=this.tileSize;var a=Math.round((b.left-l.left)/(h*q.w));var p=Math.round((b.bottom-l.bottom)/(h*q.h));var m=this.serverResolutions!=null?OpenLayers.Util.indexOf(this.serverResolutions,h):this.map.getZoom();function g(u,t){u=String(u);var r=[];for(var s=0;s<t;++s){r.push("0")}return r.join("").substring(0,t-u.length)+u}var e=[this.layername,g(m,2),g(parseInt(a/1000000),3),g((parseInt(a/1000)%1000),3),g((parseInt(a)%1000),3),g(parseInt(p/1000000),3),g((parseInt(p/1000)%1000),3),g((parseInt(p)%1000),3)+"."+this.extension];var o=e.join("/");var d=this.url;if(d instanceof Array){d=this.selectUrl(o,d)}d=(d.charAt(d.length-1)=="/")?d:d+"/";return d+o},addTile:function(d,a){var b=this.getURL(d);return new OpenLayers.Tile.Image(this,a,d,b,this.tileSize)},CLASS_NAME:"OpenLayers.Layer.TileCache"});OpenLayers.Layer.WMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{service:"WMS",version:"1.1.1",request:"GetMap",styles:"",exceptions:"application/vnd.ogc.se_inimage",format:"image/jpeg"},reproject:false,isBaseLayer:true,encodeBBOX:false,noMagic:false,initialize:function(e,d,g,b){var a=[];g=OpenLayers.Util.upperCaseObject(g);a.push(e,d,g,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));if(!this.noMagic&&this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true"){if((b==null)||(!b.isBaseLayer)){this.isBaseLayer=false}if(this.params.FORMAT=="image/jpeg"){this.params.FORMAT=OpenLayers.Util.alphaHack()?"image/gif":"image/png"}}},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Layer.WMS(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},getURL:function(b){b=this.adjustBounds(b);var d=this.getImageSize();var e={BBOX:this.encodeBBOX?b.toBBOX():b.toArray(),WIDTH:d.w,HEIGHT:d.h};var a=this.getFullRequestString(e);return a},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},mergeNewParams:function(d){var b=OpenLayers.Util.upperCaseObject(d);var a=[b];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,a)},getFullRequestString:function(d,b){var a=this.map.getProjection();this.params.SRS=(a=="none")?null:a;return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)},CLASS_NAME:"OpenLayers.Layer.WMS"});OpenLayers.Layer.WorldWind=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{},isBaseLayer:true,lzd:null,zoomLevels:null,initialize:function(e,d,g,l,h,b){this.lzd=g;this.zoomLevels=l;var a=[];a.push(e,d,h,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},getZoom:function(){var b=this.map.getZoom();var a=this.map.getMaxExtent();b=b-Math.log(this.maxResolution/(this.lzd/512))/Math.log(2);return b},getURL:function(g){g=this.adjustBounds(g);var e=this.getZoom();var b=this.map.getMaxExtent();var d=this.lzd/Math.pow(2,this.getZoom());var a=Math.floor((g.left-b.left)/d);var h=Math.floor((g.bottom-b.bottom)/d);if(this.map.getResolution()<=(this.lzd/512)&&this.getZoom()<=this.zoomLevels){return this.getFullRequestString({L:e,X:a,Y:h})}else{return OpenLayers.Util.getImagesLocation()+"blank.gif"}},CLASS_NAME:"OpenLayers.Layer.WorldWind"});OpenLayers.Layer.XYZ=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,sphericalMercator:false,initialize:function(e,d,b){if(b&&b.sphericalMercator||this.sphericalMercator){b=OpenLayers.Util.extend({maxExtent:new OpenLayers.Bounds(-128*156543.0339,-128*156543.0339,128*156543.0339,128*156543.0339),maxResolution:156543.0339,numZoomLevels:19,units:"m",projection:"EPSG:900913"},b)}d=d||this.url;e=e||this.name;var a=[e,d,{},b];OpenLayers.Layer.Grid.prototype.initialize.apply(this,a)},clone:function(a){if(a==null){a=new OpenLayers.Layer.XYZ(this.name,this.url,this.options)}a=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[a]);if(this.tileSize!=null){a.tileSize=this.tileSize.clone()}a.grid=[];return a},getURL:function(a){var e=this.map.getResolution();var l=Math.round((a.left-this.maxExtent.left)/(e*this.tileSize.w));var h=Math.round((this.maxExtent.top-a.top)/(e*this.tileSize.h));var g=this.map.getZoom();var d=Math.pow(2,g);var b=this.url;var o=""+l+h+g;if(b instanceof Array){b=this.selectUrl(o,b)}var m=OpenLayers.String.format(b,{x:l,y:h,z:g});return m},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},setMap:function(a){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);if(!this.tileOrigin){this.tileOrigin=new OpenLayers.LonLat(this.maxExtent.left,this.maxExtent.bottom)}},CLASS_NAME:"OpenLayers.Layer.XYZ"});OpenLayers.Layer.OSM=OpenLayers.Class(OpenLayers.Layer.XYZ,{name:"OpenStreetMap",attribution:"Data CC-By-SA by <a href='http://openstreetmap.org/'>OpenStreetMap</a>",sphericalMercator:true,url:"http://tile.openstreetmap.org/${z}/${x}/${y}.png",CLASS_NAME:"OpenLayers.Layer.OSM"});OpenLayers.Protocol.SQL.Gears=OpenLayers.Class(OpenLayers.Protocol.SQL,{FID_PREFIX:"__gears_fid__",NULL_GEOMETRY:"__gears_null_geometry__",NULL_FEATURE_STATE:"__gears_null_feature_state__",jsonParser:null,wktParser:null,fidRegExp:null,saveFeatureState:true,typeOfFid:"string",db:null,initialize:function(a){if(!this.supported()){return}OpenLayers.Protocol.SQL.prototype.initialize.apply(this,[a]);this.jsonParser=new OpenLayers.Format.JSON();this.wktParser=new OpenLayers.Format.WKT();this.fidRegExp=new RegExp("^"+this.FID_PREFIX);this.initializeDatabase()},initializeDatabase:function(){this.db=google.gears.factory.create("beta.database");this.db.open(this.databaseName);this.db.execute("CREATE TABLE IF NOT EXISTS "+this.tableName+" (fid TEXT UNIQUE, geometry TEXT, properties TEXT,  state TEXT)")},destroy:function(){this.db.close();this.db=null;this.jsonParser=null;this.wktParser=null;OpenLayers.Protocol.SQL.prototype.destroy.apply(this)},supported:function(){return !!(window.google&&google.gears)},read:function(b){b=OpenLayers.Util.applyDefaults(b,this.options);var d,e=[];var a=this.db.execute("SELECT * FROM "+this.tableName);while(a.isValidRow()){d=this.unfreezeFeature(a);if(this.evaluateFilter(d,b.filter)){if(!b.noFeatureStateReset){d.state=null}e.push(d)}a.next()}a.close();var g=new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,requestType:"read",features:e});if(b&&b.callback){b.callback.call(b.scope,g)}return g},unfreezeFeature:function(e){var a;var b=e.fieldByName("geometry");if(b==this.NULL_GEOMETRY){a=new OpenLayers.Feature.Vector()}else{a=this.wktParser.read(b)}a.attributes=this.jsonParser.read(e.fieldByName("properties"));a.fid=this.extractFidFromField(e.fieldByName("fid"));var d=e.fieldByName("state");if(d==this.NULL_FEATURE_STATE){d=null}a.state=d;return a},extractFidFromField:function(a){if(!a.match(this.fidRegExp)&&this.typeOfFid=="number"){a=parseFloat(a)}return a},create:function(b,a){a=OpenLayers.Util.applyDefaults(a,this.options);var d=this.createOrUpdate(b);d.requestType="create";if(a&&a.callback){a.callback.call(a.scope,d)}return d},update:function(b,a){a=OpenLayers.Util.applyDefaults(a,this.options);var d=this.createOrUpdate(b);d.requestType="update";if(a&&a.callback){a.callback.call(a.scope,d)}return d},createOrUpdate:function(g){if(!(g instanceof Array)){g=[g]}var d,a=g.length,b;var e=new Array(a);for(d=0;d<a;d++){b=g[d];var h=this.freezeFeature(b);this.db.execute("REPLACE INTO "+this.tableName+" (fid, geometry, properties, state) VALUES (?, ?, ?, ?)",h);var l=b.clone();l.fid=this.extractFidFromField(h[0]);e[d]=l}return new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,features:e,reqFeatures:g})},freezeFeature:function(b){b.fid=b.fid!=null?""+b.fid:OpenLayers.Util.createUniqueID(this.FID_PREFIX);var e=b.geometry!=null?b.geometry.toString():this.NULL_GEOMETRY;var a=this.jsonParser.write(b.attributes);var d=this.getFeatureStateForFreeze(b);return[b.fid,e,a,d]},getFeatureStateForFreeze:function(a){var b;if(!this.saveFeatureState){b=this.NULL_FEATURE_STATE}else{if(this.createdOffline(a)){b=OpenLayers.State.INSERT}else{b=a.state}}return b},"delete":function(h,d){if(!(h instanceof Array)){h=[h]}d=OpenLayers.Util.applyDefaults(d,this.options);var g,a,e;for(g=0,a=h.length;g<a;g++){e=h[g];if(this.saveFeatureState&&!this.createdOffline(e)){var b=e.clone();b.fid=e.fid;if(b.geometry){b.geometry.destroy();b.geometry=null}b.state=e.state;this.createOrUpdate(b)}else{this.db.execute("DELETE FROM "+this.tableName+" WHERE fid = ?",[e.fid])}}var l=new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,requestType:"delete",reqFeatures:h});if(d&&d.callback){d.callback.call(d.scope,l)}return l},createdOffline:function(a){return(typeof a.fid=="string"&&!!(a.fid.match(this.fidRegExp)))},commit:function(d,r){var b,g=[],l=0,m=0;function p(s){if(++m<l){s.last=false}this.callUserCallback(r,s)}var q,o=[],a=[],e=[];for(var h=d.length-1;h>=0;h--){q=d[h];switch(q.state){case OpenLayers.State.INSERT:o.push(q);break;case OpenLayers.State.UPDATE:a.push(q);break;case OpenLayers.State.DELETE:e.push(q);break}}if(o.length>0){l++;b=OpenLayers.Util.applyDefaults({callback:p,scope:this},r.create);g.push(this.create(o,b))}if(a.length>0){l++;b=OpenLayers.Util.applyDefaults({callback:p,scope:this},r.update);g.push(this.update(a,b))}if(e.length>0){l++;b=OpenLayers.Util.applyDefaults({callback:p,scope:this},r["delete"]);g.push(this["delete"](e,b))}return g},clear:function(){this.db.execute("DELETE FROM "+this.tableName)},callUserCallback:function(a,d){var b=a[d.requestType];if(b&&b.callback){b.callback.call(b.scope,d)}if(d.last&&a.callback){a.callback.call(a.scope)}},CLASS_NAME:"OpenLayers.Protocol.SQL.Gears"});OpenLayers.Rule=OpenLayers.Class({id:null,name:"default",title:null,description:null,context:null,filter:null,elseFilter:false,symbolizer:null,minScaleDenominator:null,maxScaleDenominator:null,initialize:function(a){this.symbolizer={};OpenLayers.Util.extend(this,a);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var a in this.symbolizer){this.symbolizer[a]=null}this.symbolizer=null},evaluate:function(d){var b=this.getContext(d);var a=true;if(this.minScaleDenominator||this.maxScaleDenominator){var e=d.layer.map.getScale()}if(this.minScaleDenominator){a=e>=OpenLayers.Style.createLiteral(this.minScaleDenominator,b)}if(a&&this.maxScaleDenominator){a=e<OpenLayers.Style.createLiteral(this.maxScaleDenominator,b)}if(a&&this.filter){if(this.filter.CLASS_NAME=="OpenLayers.Filter.FeatureId"){a=this.filter.evaluate(d)}else{a=this.filter.evaluate(b)}}return a},getContext:function(b){var a=this.context;if(!a){a=b.attributes||b.data}if(typeof this.context=="function"){a=this.context(b)}return a},clone:function(){var a=OpenLayers.Util.extend({},this);a.symbolizer={};for(var b in this.symbolizer){value=this.symbolizer[b];type=typeof value;if(type==="object"){a.symbolizer[b]=OpenLayers.Util.extend({},value)}else{if(type==="string"){a.symbolizer[b]=value}}}a.filter=this.filter&&this.filter.clone();a.context=this.context&&OpenLayers.Util.extend({},this.context);return new OpenLayers.Rule(a)},CLASS_NAME:"OpenLayers.Rule"});OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:true,initialize:function(d,a){this.styles={"default":new OpenLayers.Style(OpenLayers.Feature.Vector.style["default"]),select:new OpenLayers.Style(OpenLayers.Feature.Vector.style.select),temporary:new OpenLayers.Style(OpenLayers.Feature.Vector.style.temporary),"delete":new OpenLayers.Style(OpenLayers.Feature.Vector.style["delete"])};if(d instanceof OpenLayers.Style){this.styles["default"]=d;this.styles.select=d;this.styles.temporary=d;this.styles["delete"]=d}else{if(typeof d=="object"){for(var b in d){if(d[b] instanceof OpenLayers.Style){this.styles[b]=d[b]}else{if(typeof d[b]=="object"){this.styles[b]=new OpenLayers.Style(d[b])}else{this.styles["default"]=new OpenLayers.Style(d);this.styles.select=new OpenLayers.Style(d);this.styles.temporary=new OpenLayers.Style(d);this.styles["delete"]=new OpenLayers.Style(d);break}}}}}OpenLayers.Util.extend(this,a)},destroy:function(){for(var a in this.styles){this.styles[a].destroy()}this.styles=null},createSymbolizer:function(b,d){if(!b){b=new OpenLayers.Feature.Vector()}if(!this.styles[d]){d="default"}b.renderIntent=d;var a={};if(this.extendDefault&&d!="default"){a=this.styles["default"].createSymbolizer(b)}return OpenLayers.Util.extend(a,this.styles[d].createSymbolizer(b))},addUniqueValueRules:function(b,e,h,a){var g=[];for(var d in h){g.push(new OpenLayers.Rule({symbolizer:h[d],context:a,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:e,value:d})}))}this.styles[b].addRules(g)},CLASS_NAME:"OpenLayers.StyleMap"});OpenLayers.Control.NavToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);this.addControls([new OpenLayers.Control.Navigation(),new OpenLayers.Control.ZoomBox()])},draw:function(){var a=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);this.activateControl(this.controls[0]);return a},CLASS_NAME:"OpenLayers.Control.NavToolbar"});OpenLayers.Filter.Comparison=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,matchCase:true,lowerBoundary:null,upperBoundary:null,initialize:function(a){OpenLayers.Filter.prototype.initialize.apply(this,[a])},evaluate:function(d){var a=false;switch(this.type){case OpenLayers.Filter.Comparison.EQUAL_TO:var b=d[this.property];var g=this.value;if(!this.matchCase&&typeof b=="string"&&typeof g=="string"){a=(b.toUpperCase()==g.toUpperCase())}else{a=(b==g)}break;case OpenLayers.Filter.Comparison.NOT_EQUAL_TO:var b=d[this.property];var g=this.value;if(!this.matchCase&&typeof b=="string"&&typeof g=="string"){a=(b.toUpperCase()!=g.toUpperCase())}else{a=(b!=g)}break;case OpenLayers.Filter.Comparison.LESS_THAN:a=d[this.property]<this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN:a=d[this.property]>this.value;break;case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:a=d[this.property]<=this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:a=d[this.property]>=this.value;break;case OpenLayers.Filter.Comparison.BETWEEN:a=(d[this.property]>=this.lowerBoundary)&&(d[this.property]<=this.upperBoundary);break;case OpenLayers.Filter.Comparison.LIKE:var e=new RegExp(this.value,"gi");a=e.test(d[this.property]);break}return a},value2regex:function(e,b,a){if(e=="."){var d="'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison";OpenLayers.Console.error(d);return null}e=e?e:"*";b=b?b:".";a=a?a:"!";this.value=this.value.replace(new RegExp("\\"+a+"(.|$)","g"),"\\$1");this.value=this.value.replace(new RegExp("\\"+b,"g"),".");this.value=this.value.replace(new RegExp("\\"+e,"g"),".*");this.value=this.value.replace(new RegExp("\\\\.\\*","g"),"\\"+e);this.value=this.value.replace(new RegExp("\\\\\\.","g"),"\\"+b);return this.value},regex2value:function(){var a=this.value;a=a.replace(/!/g,"!!");a=a.replace(/(\\)?\\\./g,function(d,b){return b?d:"!."});a=a.replace(/(\\)?\\\*/g,function(d,b){return b?d:"!*"});a=a.replace(/\\\\/g,"\\");a=a.replace(/\.\*/g,"*");return a},clone:function(){return OpenLayers.Util.extend(new OpenLayers.Filter.Comparison(),this)},CLASS_NAME:"OpenLayers.Filter.Comparison"});OpenLayers.Filter.Comparison.EQUAL_TO="==";OpenLayers.Filter.Comparison.NOT_EQUAL_TO="!=";OpenLayers.Filter.Comparison.LESS_THAN="<";OpenLayers.Filter.Comparison.GREATER_THAN=">";OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO="<=";OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO=">=";OpenLayers.Filter.Comparison.BETWEEN="..";OpenLayers.Filter.Comparison.LIKE="~";OpenLayers.Filter.FeatureId=OpenLayers.Class(OpenLayers.Filter,{fids:null,initialize:function(a){this.fids=[];OpenLayers.Filter.prototype.initialize.apply(this,[a])},evaluate:function(d){for(var b=0,a=this.fids.length;b<a;b++){var e=d.fid||d.id;if(e==this.fids[b]){return true}}return false},clone:function(){var a=new OpenLayers.Filter.FeatureId();OpenLayers.Util.extend(a,this);a.fids=this.fids.slice();return a},CLASS_NAME:"OpenLayers.Filter.FeatureId"});OpenLayers.Filter.Logical=OpenLayers.Class(OpenLayers.Filter,{filters:null,type:null,initialize:function(a){this.filters=[];OpenLayers.Filter.prototype.initialize.apply(this,[a])},destroy:function(){this.filters=null;OpenLayers.Filter.prototype.destroy.apply(this)},evaluate:function(d){switch(this.type){case OpenLayers.Filter.Logical.AND:for(var b=0,a=this.filters.length;b<a;b++){if(this.filters[b].evaluate(d)==false){return false}}return true;case OpenLayers.Filter.Logical.OR:for(var b=0,a=this.filters.length;b<a;b++){if(this.filters[b].evaluate(d)==true){return true}}return false;case OpenLayers.Filter.Logical.NOT:return(!this.filters[0].evaluate(d))}},clone:function(){var d=[];for(var b=0,a=this.filters.length;b<a;++b){d.push(this.filters[b].clone())}return new OpenLayers.Filter.Logical({type:this.type,filters:d})},CLASS_NAME:"OpenLayers.Filter.Logical"});OpenLayers.Filter.Logical.AND="&&";OpenLayers.Filter.Logical.OR="||";OpenLayers.Filter.Logical.NOT="!";OpenLayers.Filter.Spatial=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,distance:null,distanceUnits:null,initialize:function(a){OpenLayers.Filter.prototype.initialize.apply(this,[a])},evaluate:function(d){var a=false;switch(this.type){case OpenLayers.Filter.Spatial.BBOX:case OpenLayers.Filter.Spatial.INTERSECTS:if(d.geometry){var b=this.value;if(this.value.CLASS_NAME=="OpenLayers.Bounds"){b=this.value.toGeometry()}if(d.geometry.intersects(b)){a=true}}break;default:OpenLayers.Console.error(OpenLayers.i18n("filterEvaluateNotImplemented"));break}return a},clone:function(){var a=OpenLayers.Util.applyDefaults({value:this.value&&this.value.clone&&this.value.clone()},this);return new OpenLayers.Filter.Spatial(a)},CLASS_NAME:"OpenLayers.Filter.Spatial"});OpenLayers.Filter.Spatial.BBOX="BBOX";OpenLayers.Filter.Spatial.INTERSECTS="INTERSECTS";OpenLayers.Filter.Spatial.DWITHIN="DWITHIN";OpenLayers.Filter.Spatial.WITHIN="WITHIN";OpenLayers.Filter.Spatial.CONTAINS="CONTAINS";OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function(a){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.components=[];if(a!=null){this.addComponents(a)}},destroy:function(){this.components.length=0;this.components=null},clone:function(){var geometry=eval("new "+this.CLASS_NAME+"()");for(var i=0,len=this.components.length;i<len;i++){geometry.addComponent(this.components[i].clone())}OpenLayers.Util.applyDefaults(geometry,this);return geometry},getComponentsString:function(){var b=[];for(var d=0,a=this.components.length;d<a;d++){b.push(this.components[d].toShortString())}return b.join(",")},calculateBounds:function(){this.bounds=null;if(this.components&&this.components.length>0){this.setBounds(this.components[0].getBounds());for(var b=1,a=this.components.length;b<a;b++){this.extendBounds(this.components[b].getBounds())}}},addComponents:function(d){if(!(d instanceof Array)){d=[d]}for(var b=0,a=d.length;b<a;b++){this.addComponent(d[b])}},addComponent:function(b,a){var e=false;if(b){if(this.componentTypes==null||(OpenLayers.Util.indexOf(this.componentTypes,b.CLASS_NAME)>-1)){if(a!=null&&(a<this.components.length)){var g=this.components.slice(0,a);var d=this.components.slice(a,this.components.length);g.push(b);this.components=g.concat(d)}else{this.components.push(b)}b.parent=this;this.clearBounds();e=true}}return e},removeComponents:function(b){if(!(b instanceof Array)){b=[b]}for(var a=b.length-1;a>=0;--a){this.removeComponent(b[a])}},removeComponent:function(a){OpenLayers.Util.removeItem(this.components,a);this.clearBounds()},getLength:function(){var d=0;for(var b=0,a=this.components.length;b<a;b++){d+=this.components[b].getLength()}return d},getArea:function(){var d=0;for(var b=0,a=this.components.length;b<a;b++){d+=this.components[b].getArea()}return d},getGeodesicArea:function(b){var e=0;for(var d=0,a=this.components.length;d<a;d++){e+=this.components[d].getGeodesicArea(b)}return e},getCentroid:function(){return this.components.length&&this.components[0].getCentroid()},getGeodesicLength:function(b){var e=0;for(var d=0,a=this.components.length;d<a;d++){e+=this.components[d].getGeodesicLength(b)}return e},move:function(b,e){for(var d=0,a=this.components.length;d<a;d++){this.components[d].move(b,e)}},rotate:function(e,b){for(var d=0,a=this.components.length;d<a;++d){this.components[d].rotate(e,b)}},resize:function(e,a,d){for(var b=0;b<this.components.length;++b){this.components[b].resize(e,a,d)}return this},distanceTo:function(l,m){var b=!(m&&m.edge===false);var a=b&&m&&m.details;var o,d;var e=Number.POSITIVE_INFINITY;for(var g=0,h=this.components.length;g<h;++g){o=this.components[g].distanceTo(l,m);distance=a?o.distance:o;if(distance<e){e=distance;d=o;if(e==0){break}}}return d},equals:function(e){var b=true;if(!e||!e.CLASS_NAME||(this.CLASS_NAME!=e.CLASS_NAME)){b=false}else{if(!(e.components instanceof Array)||(e.components.length!=this.components.length)){b=false}else{for(var d=0,a=this.components.length;d<a;++d){if(!this.components[d].equals(e.components[d])){b=false;break}}}}return b},transform:function(g,d){if(g&&d){for(var e=0,a=this.components.length;e<a;e++){var b=this.components[e];b.transform(g,d)}this.bounds=null}return this},intersects:function(e){var b=false;for(var d=0,a=this.components.length;d<a;++d){b=e.intersects(this.components[d]);if(b){break}}return b},getVertices:function(b){var d=[];for(var e=0,a=this.components.length;e<a;++e){Array.prototype.push.apply(d,this.components[e].getVertices(b))}return d},CLASS_NAME:"OpenLayers.Geometry.Collection"});OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,initialize:function(a,b){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=parseFloat(a);this.y=parseFloat(b)},clone:function(a){if(a==null){a=new OpenLayers.Geometry.Point(this.x,this.y)}OpenLayers.Util.applyDefaults(a,this);return a},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x,this.y)},distanceTo:function(h,p){var e=!(p&&p.edge===false);var a=e&&p&&p.details;var b,g,m,d,l,o;if(h instanceof OpenLayers.Geometry.Point){g=this.x;m=this.y;d=h.x;l=h.y;b=Math.sqrt(Math.pow(g-d,2)+Math.pow(m-l,2));o=!a?b:{x0:g,y0:m,x1:d,y1:l,distance:b}}else{o=h.distanceTo(this,p);if(a){o={x0:o.x1,y0:o.y1,x1:o.x0,y1:o.y0,distance:o.distance}}}return o},equals:function(a){var b=false;if(a!=null){b=((this.x==a.x&&this.y==a.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(a.x)&&isNaN(a.y)))}return b},toShortString:function(){return(this.x+", "+this.y)},move:function(a,b){this.x=this.x+a;this.y=this.y+b;this.clearBounds()},rotate:function(e,b){e*=Math.PI/180;var a=this.distanceTo(b);var d=e+Math.atan2(this.y-b.y,this.x-b.x);this.x=b.x+(a*Math.cos(d));this.y=b.y+(a*Math.sin(d));this.clearBounds()},getCentroid:function(){return new OpenLayers.Geometry.Point(this.x,this.y)},resize:function(d,a,b){b=(b==undefined)?1:b;this.x=a.x+(d*b*(this.x-a.x));this.y=a.y+(d*(this.y-a.y));this.clearBounds();return this},intersects:function(b){var a=false;if(b.CLASS_NAME=="OpenLayers.Geometry.Point"){a=this.equals(b)}else{a=b.intersects(this)}return a},transform:function(b,a){if((b&&a)){OpenLayers.Projection.transform(this,b,a);this.bounds=null}return this},getVertices:function(a){return[this]},CLASS_NAME:"OpenLayers.Geometry.Point"});OpenLayers.Geometry.Rectangle=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,width:null,height:null,initialize:function(b,e,d,a){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=b;this.y=e;this.width=d;this.height=a},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x+this.width,this.y+this.height)},getLength:function(){var a=(2*this.width)+(2*this.height);return a},getArea:function(){var a=this.width*this.height;return a},CLASS_NAME:"OpenLayers.Geometry.Rectangle"});OpenLayers.Geometry.Surface=OpenLayers.Class(OpenLayers.Geometry,{initialize:function(){OpenLayers.Geometry.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Geometry.Surface"});OpenLayers.Layer.KaMapCache=OpenLayers.Class(OpenLayers.Layer.KaMap,{IMAGE_EXTENSIONS:{jpeg:"jpg",gif:"gif",png:"png",png8:"png",png24:"png",dithered:"png"},DEFAULT_FORMAT:"jpeg",initialize:function(d,b,e,a){OpenLayers.Layer.KaMap.prototype.initialize.apply(this,arguments);this.extension=this.IMAGE_EXTENSIONS[this.params.i.toLowerCase()||DEFAULT_FORMAT]},getURL:function(a){a=this.adjustBounds(a);var h=this.map.getResolution();var g=Math.round((this.map.getScale()*10000))/10000;var e=Math.round(a.left/h);var d=-Math.round(a.top/h);var o=Math.floor(e/this.tileSize.w/this.params.metaTileSize.w)*this.tileSize.w*this.params.metaTileSize.w;var m=Math.floor(d/this.tileSize.h/this.params.metaTileSize.h)*this.tileSize.h*this.params.metaTileSize.h;var b=this.url;if(b instanceof Array){b=this.selectUrl(paramsString,b)}var l=[b,"/",this.params.map,"/",g,"/",this.params.g.replace(/\s/g,"_"),"/def/t",m,"/l",o,"/t",d,"l",e,".",this.extension];return l.join("")},CLASS_NAME:"OpenLayers.Layer.KaMapCache"});OpenLayers.Layer.MapServer.Untiled=OpenLayers.Class(OpenLayers.Layer.MapServer,{singleTile:true,initialize:function(d,b,g,a){OpenLayers.Layer.MapServer.prototype.initialize.apply(this,arguments);var e="The OpenLayers.Layer.MapServer.Untiled class is deprecated and will be removed in 3.0. Instead, you should use the normal OpenLayers.Layer.MapServer class, passing it the option 'singleTile' as true.";OpenLayers.Console.warn(e)},clone:function(a){if(a==null){a=new OpenLayers.Layer.MapServer.Untiled(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.MapServer.prototype.clone.apply(this,[a]);return a},CLASS_NAME:"OpenLayers.Layer.MapServer.Untiled"});OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{EVENT_TYPES:["beforefeatureadded","beforefeaturesadded","featureadded","featuresadded","beforefeatureremoved","featureremoved","featuresremoved","beforefeatureselected","featureselected","featureunselected","beforefeaturemodified","featuremodified","afterfeaturemodified","vertexmodified","sketchstarted","sketchmodified","sketchcomplete","refresh"],isBaseLayer:false,isFixed:false,isVector:true,features:null,selectedFeatures:null,unrenderedFeatures:null,reportError:true,style:null,styleMap:null,strategies:null,protocol:null,renderers:["SVG","VML","Canvas"],renderer:null,rendererOptions:null,geometryType:null,drawn:false,initialize:function(d,b){this.EVENT_TYPES=OpenLayers.Layer.Vector.prototype.EVENT_TYPES.concat(OpenLayers.Layer.prototype.EVENT_TYPES);OpenLayers.Layer.prototype.initialize.apply(this,arguments);if(!this.renderer||!this.renderer.supported()){this.assignRenderer()}if(!this.renderer||!this.renderer.supported()){this.renderer=null;this.displayError()}if(!this.styleMap){this.styleMap=new OpenLayers.StyleMap()}this.features=[];this.selectedFeatures=[];this.unrenderedFeatures={};if(this.strategies){for(var e=0,a=this.strategies.length;e<a;e++){this.strategies[e].setLayer(this)}}},destroy:function(){if(this.strategies){var d,b,a;for(b=0,a=this.strategies.length;b<a;b++){d=this.strategies[b];if(d.autoDestroy){d.destroy()}}this.strategies=null}if(this.protocol){if(this.protocol.autoDestroy){this.protocol.destroy()}this.protocol=null}this.destroyFeatures();this.features=null;this.selectedFeatures=null;this.unrenderedFeatures=null;if(this.renderer){this.renderer.destroy()}this.renderer=null;this.geometryType=null;this.drawn=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},refresh:function(a){if(this.calculateInRange()&&this.visibility){this.events.triggerEvent("refresh",a)}},assignRenderer:function(){for(var d=0,a=this.renderers.length;d<a;d++){var b=OpenLayers.Renderer[this.renderers[d]];if(b&&b.prototype.supported()){this.renderer=new b(this.div,this.rendererOptions);break}}},displayError:function(){if(this.reportError){OpenLayers.Console.userError(OpenLayers.i18n("browserNotSupported",{renderers:this.renderers.join("\n")}))}},setMap:function(a){OpenLayers.Layer.prototype.setMap.apply(this,arguments);if(!this.renderer){this.map.removeLayer(this)}else{this.renderer.map=this.map;this.renderer.setSize(this.map.getSize())}},afterAdd:function(){if(this.strategies){var d,b,a;for(b=0,a=this.strategies.length;b<a;b++){d=this.strategies[b];if(d.autoActivate){d.activate()}}}},removeMap:function(d){if(this.strategies){var e,b,a;for(b=0,a=this.strategies.length;b<a;b++){e=this.strategies[b];if(e.autoActivate){e.deactivate()}}}},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);this.renderer.setSize(this.map.getSize())},moveTo:function(l,b,m){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var g=true;if(!m){this.renderer.root.style.visibility="hidden";this.div.style.left=-parseInt(this.map.layerContainerDiv.style.left)+"px";this.div.style.top=-parseInt(this.map.layerContainerDiv.style.top)+"px";var h=this.map.getExtent();g=this.renderer.setExtent(h,b);this.renderer.root.style.visibility="visible";if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.div.scrollLeft=this.div.scrollLeft}if(!b&&g){for(var e in this.unrenderedFeatures){var d=this.unrenderedFeatures[e];this.drawFeature(d)}}}if(!this.drawn||b||!g){this.drawn=true;var d;for(var e=0,a=this.features.length;e<a;e++){this.renderer.locked=(e!==(a-1));d=this.features[e];this.drawFeature(d)}}},display:function(a){OpenLayers.Layer.prototype.display.apply(this,arguments);var b=this.div.style.display;if(b!=this.renderer.root.style.display){this.renderer.root.style.display=b}},addFeatures:function(b,o){if(!(b instanceof Array)){b=[b]}var l=!o||!o.silent;if(l){var a={features:b};var h=this.events.triggerEvent("beforefeaturesadded",a);if(h===false){return}b=a.features}for(var d=0,g=b.length;d<g;d++){if(d!=(b.length-1)){this.renderer.locked=true}else{this.renderer.locked=false}var m=b[d];if(this.geometryType&&!(m.geometry instanceof this.geometryType)){var e=OpenLayers.i18n("componentShouldBe",{geomType:this.geometryType.prototype.CLASS_NAME});throw e}this.features.push(m);m.layer=this;if(!m.style&&this.style){m.style=OpenLayers.Util.extend({},this.style)}if(l){if(this.events.triggerEvent("beforefeatureadded",{feature:m})===false){continue}this.preFeatureInsert(m)}this.drawFeature(m);if(l){this.events.triggerEvent("featureadded",{feature:m});this.onFeatureInsert(m)}}if(l){this.events.triggerEvent("featuresadded",{features:b})}},removeFeatures:function(g,a){if(!g||g.length===0){return}if(!(g instanceof Array)){g=[g]}if(g===this.features){g=g.slice()}var e=!a||!a.silent;for(var d=g.length-1;d>=0;d--){if(d!=0&&g[d-1].geometry){this.renderer.locked=true}else{this.renderer.locked=false}var b=g[d];delete this.unrenderedFeatures[b.id];if(e){this.events.triggerEvent("beforefeatureremoved",{feature:b})}this.features=OpenLayers.Util.removeItem(this.features,b);b.layer=null;if(b.geometry){this.renderer.eraseFeatures(b)}if(OpenLayers.Util.indexOf(this.selectedFeatures,b)!=-1){OpenLayers.Util.removeItem(this.selectedFeatures,b)}if(e){this.events.triggerEvent("featureremoved",{feature:b})}}if(e){this.events.triggerEvent("featuresremoved",{features:g})}},destroyFeatures:function(e,a){var d=(e==undefined);if(d){e=this.features}if(e){this.removeFeatures(e,a);for(var b=e.length-1;b>=0;b--){e[b].destroy()}}},drawFeature:function(a,b){if(!this.drawn){return}if(typeof b!="object"){if(!b&&a.state===OpenLayers.State.DELETE){b="delete"}var d=b||a.renderIntent;b=a.style||this.style;if(!b){b=this.styleMap.createSymbolizer(a,d)}}if(!this.renderer.drawFeature(a,b)){this.unrenderedFeatures[a.id]=a}else{delete this.unrenderedFeatures[a.id]}},eraseFeatures:function(a){this.renderer.eraseFeatures(a)},getFeatureFromEvent:function(a){if(!this.renderer){OpenLayers.Console.error(OpenLayers.i18n("getFeatureError"));return null}var b=this.renderer.getFeatureIdFromEvent(a);return this.getFeatureById(b)},getFeatureById:function(e){var d=null;for(var b=0,a=this.features.length;b<a;++b){if(this.features[b].id==e){d=this.features[b];break}}return d},onFeatureInsert:function(a){},preFeatureInsert:function(a){},getDataExtent:function(){var b=null;if(this.features&&(this.features.length>0)){b=new OpenLayers.Bounds();for(var d=0,a=this.features.length;d<a;d++){b.extend(this.features[d].geometry.getBounds())}}return b},CLASS_NAME:"OpenLayers.Layer.Vector"});OpenLayers.Layer.WMS.Untiled=OpenLayers.Class(OpenLayers.Layer.WMS,{singleTile:true,initialize:function(d,b,g,a){OpenLayers.Layer.WMS.prototype.initialize.apply(this,arguments);var e="The OpenLayers.Layer.WMS.Untiled class is deprecated and will be removed in 3.0. Instead, you should use the normal OpenLayers.Layer.WMS class, passing it the option 'singleTile' as true.";OpenLayers.Console.warn(e)},clone:function(a){if(a==null){a=new OpenLayers.Layer.WMS.Untiled(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.WMS.prototype.clone.apply(this,[a]);return a},CLASS_NAME:"OpenLayers.Layer.WMS.Untiled"});OpenLayers.Control.GetFeature=OpenLayers.Class(OpenLayers.Control,{protocol:null,multipleKey:null,toggleKey:null,modifiers:null,multiple:false,click:true,clickout:true,toggle:false,clickTolerance:5,hover:false,box:false,maxFeatures:10,features:null,hoverFeature:null,handlerOptions:null,handlers:null,hoverResponse:null,EVENT_TYPES:["featureselected","featureunselected","clickout","beforefeatureselected","hoverfeature","outfeature"],initialize:function(a){this.EVENT_TYPES=OpenLayers.Control.GetFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);a.handlerOptions=a.handlerOptions||{};OpenLayers.Control.prototype.initialize.apply(this,[a]);this.features={};this.handlers={};if(this.click){this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.selectSingle},this.handlerOptions.click||{})}if(this.box){this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},OpenLayers.Util.extend(this.handlerOptions.box,{boxDivClassName:"olHandlerBoxSelectFeature"}))}if(this.hover){this.handlers.hover=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.selectHover},OpenLayers.Util.extend(this.handlerOptions.hover,{delay:250}))}},activate:function(){if(!this.active){for(var a in this.handlers){this.handlers[a].activate()}}return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.active){for(var a in this.handlers){this.handlers[a].deactivate()}}return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},unselectAll:function(a){var d;for(var b=this.features.length-1;b>=0;--b){d=this.features[b];if(!a||a.except!=d){this.unselect(d)}}},selectSingle:function(a){OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");var b=this.pixelToBounds(a.xy);this.setModifiers(a);this.request(b,{single:true})},selectBox:function(a){if(a instanceof OpenLayers.Bounds){var e=this.map.getLonLatFromPixel(new OpenLayers.Pixel(a.left,a.bottom));var b=this.map.getLonLatFromPixel(new OpenLayers.Pixel(a.right,a.top));var d=new OpenLayers.Bounds(e.lon,e.lat,b.lon,b.lat);this.setModifiers(this.handlers.box.dragHandler.evt);this.request(d)}},selectHover:function(a){var b=this.pixelToBounds(a.xy);this.request(b,{single:true,hover:true})},cancelHover:function(){if(this.hoverResponse){this.protocol.abort(this.hoverResponse);this.hoverResponse=null}},request:function(e,b){b=b||{};var d=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:e});var a=this.protocol.read({maxFeatures:b.single==true?this.maxFeatures:undefined,filter:d,callback:function(g){if(g.code==1){if(g.features.length){if(b.single==true){this.selectBestFeature(g.features,e.getCenterLonLat(),b)}else{this.select(g.features)}}else{if(b.hover){this.hoverSelect()}else{this.events.triggerEvent("clickout");if(this.clickout){this.unselectAll()}}}}OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},scope:this});if(b.hover==true){this.hoverResponse=a}},selectBestFeature:function(b,a,o){o=o||{};if(b.length){var l=new OpenLayers.Geometry.Point(a.lon,a.lat);var m,e,g;var h=Number.MAX_VALUE;for(var d=0;d<b.length;++d){m=b[d];if(m.geometry){g=l.distanceTo(m.geometry,{edge:false});if(g<h){h=g;e=m;if(h==0){break}}}}if(o.hover==true){this.hoverSelect(e)}else{this.select(e||b)}}},setModifiers:function(a){this.modifiers={multiple:this.multiple||(this.multipleKey&&a[this.multipleKey]),toggle:this.toggle||(this.toggleKey&&a[this.toggleKey])}},select:function(e){if(!this.modifiers.multiple&&!this.modifiers.toggle){this.unselectAll()}if(!(e instanceof Array)){e=[e]}var d;for(var b=0,a=e.length;b<a;++b){d=e[b];if(this.features[d.fid||d.id]){if(this.modifiers.toggle){this.unselect(this.features[d.fid||d.id])}}else{cont=this.events.triggerEvent("beforefeatureselected",{feature:d});if(cont!==false){this.features[d.fid||d.id]=d;this.events.triggerEvent("featureselected",{feature:d})}}}},hoverSelect:function(a){var d=a?a.fid||a.id:null;var b=this.hoverFeature?this.hoverFeature.fid||this.hoverFeature.id:null;if(b&&b!=d){this.events.triggerEvent("outfeature",{feature:this.hoverFeature});this.hoverFeature=null}if(d&&d!=b){this.events.triggerEvent("hoverfeature",{feature:a});this.hoverFeature=a}},unselect:function(a){delete this.features[a.fid||a.id];this.events.triggerEvent("featureunselected",{feature:a})},unselectAll:function(){for(var a in this.features){this.unselect(this.features[a])}},setMap:function(b){for(var a in this.handlers){this.handlers[a].setMap(b)}OpenLayers.Control.prototype.setMap.apply(this,arguments)},pixelToBounds:function(b){var g=b.add(-this.clickTolerance/2,this.clickTolerance/2);var a=b.add(this.clickTolerance/2,-this.clickTolerance/2);var d=this.map.getLonLatFromPixel(g);var e=this.map.getLonLatFromPixel(a);return new OpenLayers.Bounds(d.lon,d.lat,e.lon,e.lat)},CLASS_NAME:"OpenLayers.Control.GetFeature"});OpenLayers.Control.Snapping=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforesnap","snap","unsnap"],DEFAULTS:{tolerance:10,node:true,edge:true,vertex:true},greedy:true,precedence:["node","vertex","edge"],resolution:null,geoToleranceCache:null,layer:null,feature:null,point:null,initialize:function(a){Array.prototype.push.apply(this.EVENT_TYPES,OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);this.options=a||{};if(this.options.layer){this.setLayer(this.options.layer)}var b=OpenLayers.Util.extend({},this.options.defaults);this.defaults=OpenLayers.Util.applyDefaults(b,this.DEFAULTS);this.setTargets(this.options.targets);if(this.targets.length===0&&this.layer){this.addTargetLayer(this.layer)}this.geoToleranceCache={}},setLayer:function(a){if(this.active){this.deactivate();this.layer=a;this.activate()}else{this.layer=a}},setTargets:function(b){this.targets=[];if(b&&b.length){var e;for(var d=0,a=b.length;d<a;++d){e=b[d];if(e instanceof OpenLayers.Layer.Vector){this.addTargetLayer(e)}else{this.addTarget(e)}}}},addTargetLayer:function(a){this.addTarget({layer:a})},addTarget:function(a){a=OpenLayers.Util.applyDefaults(a,this.defaults);a.nodeTolerance=a.nodeTolerance||a.tolerance;a.vertexTolerance=a.vertexTolerance||a.tolerance;a.edgeTolerance=a.edgeTolerance||a.tolerance;this.targets.push(a)},removeTargetLayer:function(b){var d;for(var a=this.targets.length-1;a>=0;--a){d=this.targets[a];if(d.layer===b){this.removeTarget(d)}}},removeTarget:function(a){return OpenLayers.Util.removeItem(this.targets,a)},activate:function(){var a=OpenLayers.Control.prototype.activate.call(this);if(a){if(this.layer&&this.layer.events){this.layer.events.on({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this})}}return a},deactivate:function(){var a=OpenLayers.Control.prototype.deactivate.call(this);if(a){if(this.layer&&this.layer.events){this.layer.events.un({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this})}}this.feature=null;this.point=null;return a},onSketchModified:function(a){this.feature=a.feature;this.considerSnapping(a.vertex,a.vertex)},onVertexModified:function(a){this.feature=a.feature;var b=this.layer.map.getLonLatFromViewPortPx(a.pixel);this.considerSnapping(a.vertex,new OpenLayers.Geometry.Point(b.lon,b.lat))},considerSnapping:function(m,e){var a={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY,x:null,y:null};var d=false;var o,h;for(var b=0,g=this.targets.length;b<g;++b){h=this.targets[b];o=this.testTarget(h,e);if(o){if(this.greedy){a=o;a.target=h;d=true;break}else{if((o.rank<a.rank)||(o.rank===a.rank&&o.dist<a.dist)){a=o;a.target=h;d=true}}}}if(d){var l=this.events.triggerEvent("beforesnap",{point:m,x:a.x,y:a.y,distance:a.dist,layer:a.target.layer,snapType:this.precedence[a.rank]});if(l!==false){m.x=a.x;m.y=a.y;this.point=m;this.events.triggerEvent("snap",{point:m,snapType:this.precedence[a.rank],layer:a.target.layer,distance:a.dist})}else{d=false}}if(this.point&&!d){m.x=e.x;m.y=e.y;this.point=null;this.events.triggerEvent("unsnap",{point:m})}},testTarget:function(E,h){var C={node:this.getGeoTolerance(E.nodeTolerance),vertex:this.getGeoTolerance(E.vertexTolerance),edge:this.getGeoTolerance(E.edgeTolerance)};var l=Math.max(C.node,C.vertex,C.edge);var m={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY};var g=false;var d=E.layer.features;var b,a,e,D,r,s,q;var p=this.precedence.length;var o=new OpenLayers.LonLat(h.x,h.y);for(var z=0,B=d.length;z<B;++z){b=d[z];if(b!==this.feature&&!b._sketch&&b.state!==OpenLayers.State.DELETE&&(!E.filter||E.filter.evaluate(b.attributes))){if(b.atPoint(o,l,l)){for(var w=0,t=Math.min(m.rank+1,p);w<t;++w){a=this.precedence[w];if(E[a]){if(a==="edge"){r=b.geometry.distanceTo(h,{details:true});s=r.distance;if(s<=C[a]&&s<m.dist){m={rank:w,dist:s,x:r.x0,y:r.y0};g=true;break}}else{e=b.geometry.getVertices(a==="node");q=false;for(var v=0,u=e.length;v<u;++v){D=e[v];s=D.distanceTo(h);if(s<=C[a]&&(w<m.rank||(w===m.rank&&s<m.dist))){m={rank:w,dist:s,x:D.x,y:D.y};g=true;q=true}}if(q){break}}}}}}}return g?m:null},getGeoTolerance:function(a){var b=this.layer.map.getResolution();if(b!==this.resolution){this.resolution=b;this.geoToleranceCache={}}var d=this.geoToleranceCache[a];if(d===undefined){d=a*b;this.geoToleranceCache[a]=d}return d},destroy:function(){if(this.active){this.deactivate()}delete this.layer;delete this.targets;OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:"OpenLayers.Control.Snapping"});OpenLayers.Format.Filter=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.0.0",version:null,parser:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},write:function(d,b){var a=(b&&b.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=a){var e=OpenLayers.Format.Filter["v"+a.replace(/\./g,"_")];if(!e){throw"Can't find a Filter parser for version "+a}this.parser=new e(this.options)}return this.parser.write(d)},read:function(d){if(typeof d=="string"){d=OpenLayers.Format.XML.prototype.read.apply(this,[d])}var a=this.version;if(!a){a=this.defaultVersion}if(!this.parser||this.parser.VERSION!=a){var e=OpenLayers.Format.Filter["v"+a.replace(/\./g,"_")];if(!e){throw"Can't find a Filter parser for version "+a}this.parser=new e(this.options)}var b=this.parser.read(d);return b},CLASS_NAME:"OpenLayers.Format.Filter"});OpenLayers.Format.SLD=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.0.0",version:null,namedLayersAsArray:false,parser:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},write:function(e,d){var b=(d&&d.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=b){var g=OpenLayers.Format.SLD["v"+b.replace(/\./g,"_")];if(!g){throw"Can't find a SLD parser for version "+b}this.parser=new g(this.options)}var a=this.parser.write(e);return OpenLayers.Format.XML.prototype.write.apply(this,[a])},read:function(g,d){if(typeof g=="string"){g=OpenLayers.Format.XML.prototype.read.apply(this,[g])}var b=g.documentElement;var a=this.version;if(!a){a=b.getAttribute("version");if(!a){a=this.defaultVersion}}if(!this.parser||this.parser.VERSION!=a){var h=OpenLayers.Format.SLD["v"+a.replace(/\./g,"_")];if(!h){throw"Can't find a SLD parser for version "+a}this.parser=new h(this.options)}var e=this.parser.read(g,d);return e},CLASS_NAME:"OpenLayers.Format.SLD"});OpenLayers.Format.Text=OpenLayers.Class(OpenLayers.Format,{defaultStyle:null,extractStyles:true,initialize:function(a){a=a||{};if(a.extractStyles!==false){a.defaultStyle={externalGraphic:OpenLayers.Util.getImagesLocation()+"marker.png",graphicWidth:21,graphicHeight:25,graphicXOffset:-10.5,graphicYOffset:-12.5}}OpenLayers.Format.prototype.initialize.apply(this,[a])},read:function(p){var a=p.split("\n");var b;var l=[];for(var C=0;C<(a.length-1);C++){var B=a[C].replace(/^\s*/,"").replace(/\s*$/,"");if(B.charAt(0)!="#"){if(!b){b=B.split("\t")}else{var r=B.split("\t");var e=new OpenLayers.Geometry.Point(0,0);var m={};var v=this.defaultStyle?OpenLayers.Util.applyDefaults({},this.defaultStyle):null;var w,z,d,t;var q=false;for(var o=0;o<r.length;o++){if(r[o]){if(b[o]=="point"){var u=r[o].split(",");e.y=parseFloat(u[0]);e.x=parseFloat(u[1]);q=true}else{if(b[o]=="lat"){e.y=parseFloat(r[o]);q=true}else{if(b[o]=="lon"){e.x=parseFloat(r[o]);q=true}else{if(b[o]=="title"){m.title=r[o]}else{if(b[o]=="image"||b[o]=="icon"&&v){v.externalGraphic=r[o]}else{if(b[o]=="iconSize"&&v){var s=r[o].split(",");v.graphicWidth=parseFloat(s[0]);v.graphicHeight=parseFloat(s[1])}else{if(b[o]=="iconOffset"&&v){var h=r[o].split(",");v.graphicXOffset=parseFloat(h[0]);v.graphicYOffset=parseFloat(h[1])}else{if(b[o]=="description"){m.description=r[o]}else{if(b[o]=="overflow"){m.overflow=r[o]}else{m[b[o]]=r[o]}}}}}}}}}}}if(q){if(this.internalProjection&&this.externalProjection){e.transform(this.externalProjection,this.internalProjection)}var g=new OpenLayers.Feature.Vector(e,m,v);l.push(g)}}}}return l},CLASS_NAME:"OpenLayers.Format.Text"});OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},addPoint:function(a,b){this.addComponent(a,b)},removePoint:function(a){this.removeComponent(a)},CLASS_NAME:"OpenLayers.Geometry.MultiPoint"});OpenLayers.Handler.Point=OpenLayers.Class(OpenLayers.Handler,{point:null,layer:null,multi:false,drawing:false,mouseDown:false,lastDown:null,lastUp:null,persist:false,layerOptions:null,initialize:function(d,b,a){if(!(a&&a.layerOptions&&a.layerOptions.styleMap)){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{})}OpenLayers.Handler.prototype.initialize.apply(this,arguments)},activate:function(){if(!OpenLayers.Handler.prototype.activate.apply(this,arguments)){return false}var a=OpenLayers.Util.extend({displayInLayerSwitcher:false,calculateInRange:function(){return true}},this.layerOptions);this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,a);this.map.addLayer(this.layer);return true},createFeature:function(a){var b=this.map.getLonLatFromPixel(a);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat));this.callback("create",[this.point.geometry,this.point]);this.point.geometry.clearBounds();this.layer.addFeatures([this.point],{silent:true})},deactivate:function(){if(!OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){return false}if(this.drawing){this.cancel()}this.destroyFeature();if(this.layer.map!=null){this.layer.destroy(false)}this.layer=null;return true},destroyFeature:function(){if(this.layer){this.layer.destroyFeatures()}this.point=null},finalize:function(b){var a=b?"cancel":"done";this.drawing=false;this.mouseDown=false;this.lastDown=null;this.lastUp=null;this.callback(a,[this.geometryClone()]);if(b||!this.persist){this.destroyFeature()}},cancel:function(){this.finalize(true)},click:function(a){OpenLayers.Event.stop(a);return false},dblclick:function(a){OpenLayers.Event.stop(a);return false},modifyFeature:function(a){var b=this.map.getLonLatFromPixel(a);this.point.geometry.x=b.lon;this.point.geometry.y=b.lat;this.callback("modify",[this.point.geometry,this.point]);this.point.geometry.clearBounds();this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.point,this.style)},getGeometry:function(){var a=this.point&&this.point.geometry;if(a&&this.multi){a=new OpenLayers.Geometry.MultiPoint([a])}return a},geometryClone:function(){var a=this.getGeometry();return a&&a.clone()},mousedown:function(a){if(!this.checkModifiers(a)){return true}if(this.lastDown&&this.lastDown.equals(a.xy)){return true}this.drawing=true;if(this.lastDown==null){if(this.persist){this.destroyFeature()}this.createFeature(a.xy)}else{this.modifyFeature(a.xy)}this.lastDown=a.xy;return false},mousemove:function(a){if(this.drawing){this.modifyFeature(a.xy)}return true},mouseup:function(a){if(this.drawing){this.finalize();return false}else{return true}},CLASS_NAME:"OpenLayers.Handler.Point"});OpenLayers.Layer.GML=OpenLayers.Class(OpenLayers.Layer.Vector,{loaded:false,format:null,formatOptions:null,initialize:function(e,d,b){var a=[];a.push(e,b);OpenLayers.Layer.Vector.prototype.initialize.apply(this,a);this.url=d},setVisibility:function(a,b){OpenLayers.Layer.Vector.prototype.setVisibility.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadGML()}},moveTo:function(d,a,b){OpenLayers.Layer.Vector.prototype.moveTo.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadGML()}},loadGML:function(){if(!this.loaded){this.events.triggerEvent("loadstart");OpenLayers.Request.GET({url:this.url,success:this.requestSuccess,failure:this.requestFailure,scope:this});this.loaded=true}},setUrl:function(a){this.url=a;this.destroyFeatures();this.loaded=false;this.loadGML()},requestSuccess:function(d){var e=d.responseXML;if(!e||!e.documentElement){e=d.responseText}var a={};OpenLayers.Util.extend(a,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){a.externalProjection=this.projection;a.internalProjection=this.map.getProjectionObject()}var b=this.format?new this.format(a):new OpenLayers.Format.GML(a);this.addFeatures(b.read(e));this.events.triggerEvent("loadend")},requestFailure:function(a){OpenLayers.Console.userError(OpenLayers.i18n("errorLoadingGML",{url:this.url}));this.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Layer.GML"});OpenLayers.Layer.PointTrack=OpenLayers.Class(OpenLayers.Layer.Vector,{dataFrom:null,initialize:function(b,a){OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments)},addNodes:function(h){if(h.length<2){OpenLayers.Console.error("At least two point features have to be added to createa line from");return}var p=new Array(h.length-1);var l,a,m;for(var d=0,g=h.length;d<g;d++){l=h[d];m=l.geometry;if(!m){var e=l.lonlat;m=new OpenLayers.Geometry.Point(e.lon,e.lat)}else{if(m.CLASS_NAME!="OpenLayers.Geometry.Point"){OpenLayers.Console.error("Only features with point geometries are supported.");return}}if(d>0){var b=(this.dataFrom!=null)?(h[d+this.dataFrom].data||h[d+this.dataFrom].attributes):null;var o=new OpenLayers.Geometry.LineString([a,m]);p[d-1]=new OpenLayers.Feature.Vector(o,b)}a=m}this.addFeatures(p)},CLASS_NAME:"OpenLayers.Layer.PointTrack"});OpenLayers.Layer.PointTrack.dataFrom={SOURCE_NODE:-1,TARGET_NODE:0};OpenLayers.Layer.Vector.RootContainer=OpenLayers.Class(OpenLayers.Layer.Vector,{displayInLayerSwitcher:false,layers:null,initialize:function(b,a){OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments)},display:function(){},getFeatureFromEvent:function(a){var e=this.layers;var d;for(var b=0;b<e.length;b++){d=e[b].getFeatureFromEvent(a);if(d){return d}}},setMap:function(a){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);this.collectRoots();a.events.register("changelayer",this,this.handleChangeLayer)},removeMap:function(a){a.events.unregister("changelayer",this,this.handleChangeLayer);this.resetRoots();OpenLayers.Layer.Vector.prototype.removeMap.apply(this,arguments)},collectRoots:function(){var b;for(var a=0;a<this.map.layers.length;++a){b=this.map.layers[a];if(OpenLayers.Util.indexOf(this.layers,b)!=-1){b.renderer.moveRoot(this.renderer)}}},resetRoots:function(){var b;for(var a=0;a<this.layers.length;++a){b=this.layers[a];if(this.renderer&&b.renderer.getRenderLayerId()==this.id){this.renderer.moveRoot(b.renderer)}}},handleChangeLayer:function(a){var b=a.layer;if(a.property=="order"&&OpenLayers.Util.indexOf(this.layers,b)!=-1){this.resetRoots();this.collectRoots()}},CLASS_NAME:"OpenLayers.Layer.Vector.RootContainer"});OpenLayers.Layer.WFS=OpenLayers.Class(OpenLayers.Layer.Vector,OpenLayers.Layer.Markers,{isBaseLayer:false,tile:null,ratio:2,DEFAULT_PARAMS:{service:"WFS",version:"1.0.0",request:"GetFeature"},featureClass:null,format:null,formatObject:null,formatOptions:null,vectorMode:true,encodeBBOX:false,extractAttributes:false,initialize:function(e,d,g,b){if(b==undefined){b={}}if(b.featureClass||!OpenLayers.Layer.Vector||!OpenLayers.Feature.Vector){this.vectorMode=false}OpenLayers.Util.extend(b,{reportError:false});var a=[];a.push(e,b);OpenLayers.Layer.Vector.prototype.initialize.apply(this,a);if(!this.renderer||!this.vectorMode){this.vectorMode=false;if(!b.featureClass){b.featureClass=OpenLayers.Feature.WFS}OpenLayers.Layer.Markers.prototype.initialize.apply(this,a)}if(this.params&&this.params.typename&&!this.options.typename){this.options.typename=this.params.typename}if(!this.options.geometry_column){this.options.geometry_column="the_geom"}this.params=OpenLayers.Util.applyDefaults(g,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));this.url=d},destroy:function(){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.destroy.apply(this,arguments)}else{OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments)}if(this.tile){this.tile.destroy()}this.tile=null;this.ratio=null;this.featureClass=null;this.format=null;if(this.formatObject&&this.formatObject.destroy){this.formatObject.destroy()}this.formatObject=null;this.formatOptions=null;this.vectorMode=null;this.encodeBBOX=null;this.extractAttributes=null},setMap:function(b){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);var a={extractAttributes:this.extractAttributes};OpenLayers.Util.extend(a,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){a.externalProjection=this.projection;a.internalProjection=this.map.getProjectionObject()}this.formatObject=this.format?new this.format(a):new OpenLayers.Format.GML(a)}else{OpenLayers.Layer.Markers.prototype.setMap.apply(this,arguments)}},moveTo:function(a,b,t){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.moveTo.apply(this,arguments)}else{OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments)}if(t){return false}if(b){if(this.vectorMode){this.renderer.clear()}}if(this.options.minZoomLevel){OpenLayers.Console.warn(OpenLayers.i18n("minZoomLevelError"));if(this.map.getZoom()<this.options.minZoomLevel){return null}}if(a==null){a=this.map.getExtent()}var s=(this.tile==null);var l=(!s&&!this.tile.bounds.containsBounds(a));if(b||s||(!t&&l)){var d=a.getCenterLonLat();var r=a.getWidth()*this.ratio;var m=a.getHeight()*this.ratio;var p=new OpenLayers.Bounds(d.lon-(r/2),d.lat-(m/2),d.lon+(r/2),d.lat+(m/2));var u=this.map.getSize();u.w=u.w*this.ratio;u.h=u.h*this.ratio;var o=new OpenLayers.LonLat(p.left,p.top);var q=this.map.getLayerPxFromLonLat(o);var e=this.getFullRequestString();var h=null;var g=this.params.filter||this.params.FILTER;if(g){h={FILTER:g}}else{h={BBOX:this.encodeBBOX?p.toBBOX():p.toArray()}}if(this.map&&!this.projection.equals(this.map.getProjectionObject())){var v=p.clone();v.transform(this.map.getProjectionObject(),this.projection);if(!g){h.BBOX=this.encodeBBOX?v.toBBOX():v.toArray()}}e+="&"+OpenLayers.Util.getParameterString(h);if(!this.tile){this.tile=new OpenLayers.Tile.WFS(this,q,p,e,u);this.addTileMonitoringHooks(this.tile);this.tile.draw()}else{if(this.vectorMode){this.destroyFeatures();this.renderer.clear()}else{this.clearMarkers()}this.removeTileMonitoringHooks(this.tile);this.tile.destroy();this.tile=null;this.tile=new OpenLayers.Tile.WFS(this,q,p,e,u);this.addTileMonitoringHooks(this.tile);this.tile.draw()}}},addTileMonitoringHooks:function(a){a.onLoadStart=function(){if(this==this.layer.tile){this.layer.events.triggerEvent("loadstart")}};a.events.register("loadstart",a,a.onLoadStart);a.onLoadEnd=function(){if(this==this.layer.tile){this.layer.events.triggerEvent("tileloaded");this.layer.events.triggerEvent("loadend")}};a.events.register("loadend",a,a.onLoadEnd);a.events.register("unload",a,a.onLoadEnd)},removeTileMonitoringHooks:function(a){a.unload();a.events.un({loadstart:a.onLoadStart,loadend:a.onLoadEnd,unload:a.onLoadEnd,scope:a})},onMapResize:function(){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.onMapResize.apply(this,arguments)}else{OpenLayers.Layer.Markers.prototype.onMapResize.apply(this,arguments)}},display:function(){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.display.apply(this,arguments)}else{OpenLayers.Layer.Markers.prototype.display.apply(this,arguments)}},mergeNewParams:function(d){var b=OpenLayers.Util.upperCaseObject(d);var a=[b];return OpenLayers.Layer.HTTPRequest.prototype.mergeNewParams.apply(this,a)},clone:function(a){if(a==null){a=new OpenLayers.Layer.WFS(this.name,this.url,this.params,this.options)}if(this.vectorMode){a=OpenLayers.Layer.Vector.prototype.clone.apply(this,[a])}else{a=OpenLayers.Layer.Markers.prototype.clone.apply(this,[a])}return a},getFullRequestString:function(d,b){var a=this.projection.getCode()||this.map.getProjection();this.params.SRS=(a=="none")?null:a;return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)},commit:function(){if(!this.writer){var a={};if(this.map&&!this.projection.equals(this.map.getProjectionObject())){a.externalProjection=this.projection;a.internalProjection=this.map.getProjectionObject()}this.writer=new OpenLayers.Format.WFS(a,this)}var b=this.writer.write(this.features);OpenLayers.Request.POST({url:this.url,data:b,success:this.commitSuccess,failure:this.commitFailure,scope:this})},commitSuccess:function(d){var a=d.responseText;if(a.indexOf("SUCCESS")!=-1){this.commitReport(OpenLayers.i18n("commitSuccess",{response:a}));for(var b=0;b<this.features.length;b++){this.features[b].state=null}}else{if(a.indexOf("FAILED")!=-1||a.indexOf("Exception")!=-1){this.commitReport(OpenLayers.i18n("commitFailed",{response:a}))}}},commitFailure:function(a){},commitReport:function(b,a){OpenLayers.Console.userError(b)},refresh:function(){if(this.tile){if(this.vectorMode){this.renderer.clear();this.features.length=0}else{this.clearMarkers();this.markers.length=0}this.tile.draw()}},getDataExtent:function(){var a;if(this.vectorMode){a=OpenLayers.Layer.Vector.prototype.getDataExtent.apply(this)}else{a=OpenLayers.Layer.Markers.prototype.getDataExtent.apply(this)}return a},setOpacity:function(a){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.setOpacity.apply(this,[a])}else{OpenLayers.Layer.Markers.prototype.setOpacity.apply(this,[a])}},CLASS_NAME:"OpenLayers.Layer.WFS"});OpenLayers.Strategy.BBOX=OpenLayers.Class(OpenLayers.Strategy,{bounds:null,resolution:null,ratio:2,resFactor:null,response:null,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a){this.layer.events.on({moveend:this.update,scope:this});this.layer.events.on({refresh:this.update,scope:this})}return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){this.layer.events.un({moveend:this.update,scope:this});this.layer.events.un({refresh:this.update,scope:this})}return a},update:function(b){var a=this.getMapBounds();if((b&&b.force)||this.invalidBounds(a)){this.calculateBounds(a);this.resolution=this.layer.map.getResolution();this.triggerRead()}},getMapBounds:function(){var a=this.layer.map.getExtent();if(!this.layer.projection.equals(this.layer.map.getProjectionObject())){a=a.clone().transform(this.layer.map.getProjectionObject(),this.layer.projection)}return a},invalidBounds:function(a){if(!a){a=this.getMapBounds()}var d=!this.bounds||!this.bounds.containsBounds(a);if(!d&&this.resFactor){var b=this.resolution/this.layer.map.getResolution();d=(b>=this.resFactor||b<=(1/this.resFactor))}return d},calculateBounds:function(b){if(!b){b=this.getMapBounds()}var a=b.getCenterLonLat();var e=b.getWidth()*this.ratio;var d=b.getHeight()*this.ratio;this.bounds=new OpenLayers.Bounds(a.lon-(e/2),a.lat-(d/2),a.lon+(e/2),a.lat+(d/2))},triggerRead:function(){this.layer.protocol.abort(this.response);this.layer.events.triggerEvent("loadstart");this.response=this.layer.protocol.read({filter:this.createFilter(),callback:this.merge,scope:this})},createFilter:function(){var a=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:this.bounds,projection:this.layer.projection});if(this.layer.filter){a=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.layer.filter,a]})}return a},merge:function(l){this.layer.destroyFeatures();var g=l.features;if(g&&g.length>0){var h=this.layer.projection;var e=this.layer.map.getProjectionObject();if(!e.equals(h)){var d;for(var b=0,a=g.length;b<a;++b){d=g[b].geometry;if(d){d.transform(h,e)}}}this.layer.addFeatures(g)}this.layer.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Strategy.BBOX"});OpenLayers.Control.SelectFeature=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforefeaturehighlighted","featurehighlighted","featureunhighlighted"],multipleKey:null,toggleKey:null,multiple:false,clickout:true,toggle:false,hover:false,highlightOnly:false,box:false,onBeforeSelect:function(){},onSelect:function(){},onUnselect:function(){},scope:null,geometryTypes:null,layer:null,layers:null,callbacks:null,selectStyle:null,renderIntent:"select",handlers:null,initialize:function(d,a){this.EVENT_TYPES=OpenLayers.Control.SelectFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);if(this.scope===null){this.scope=this}if(d instanceof Array){this.layers=d;this.layer=new OpenLayers.Layer.Vector.RootContainer(this.id+"_container",{layers:d})}else{this.layer=d}var b={click:this.clickFeature,clickout:this.clickoutFeature};if(this.hover){b.over=this.overFeature;b.out=this.outFeature}this.callbacks=OpenLayers.Util.extend(b,this.callbacks);this.handlers={feature:new OpenLayers.Handler.Feature(this,this.layer,this.callbacks,{geometryTypes:this.geometryTypes})};if(this.box){this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},{boxDivClassName:"olHandlerBoxSelectFeature"})}},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);if(this.layers){this.layer.destroy()}},activate:function(){if(!this.active){if(this.layers){this.map.addLayer(this.layer)}this.handlers.feature.activate();if(this.box&&this.handlers.box){this.handlers.box.activate()}}return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.active){this.handlers.feature.deactivate();if(this.handlers.box){this.handlers.box.deactivate()}if(this.layers){this.map.removeLayer(this.layer)}}return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},unselectAll:function(b){var h=this.layers||[this.layer];var g,e;for(var a=0;a<h.length;++a){g=h[a];for(var d=g.selectedFeatures.length-1;d>=0;--d){e=g.selectedFeatures[d];if(!b||b.except!=e){this.unselect(e)}}}},clickFeature:function(a){if(!this.hover){var b=(OpenLayers.Util.indexOf(a.layer.selectedFeatures,a)>-1);if(b){if(this.toggleSelect()){this.unselect(a)}else{if(!this.multipleSelect()){this.unselectAll({except:a})}}}else{if(!this.multipleSelect()){this.unselectAll({except:a})}this.select(a)}}},multipleSelect:function(){return this.multiple||(this.handlers.feature.evt&&this.handlers.feature.evt[this.multipleKey])},toggleSelect:function(){return this.toggle||(this.handlers.feature.evt&&this.handlers.feature.evt[this.toggleKey])},clickoutFeature:function(a){if(!this.hover&&this.clickout){this.unselectAll()}},overFeature:function(b){var a=b.layer;if(this.hover){if(this.highlightOnly){this.highlight(b)}else{if(OpenLayers.Util.indexOf(a.selectedFeatures,b)==-1){this.select(b)}}}},outFeature:function(a){if(this.hover){if(this.highlightOnly){if(a._lastHighlighter==this.id){if(a._prevHighlighter&&a._prevHighlighter!=this.id){delete a._lastHighlighter;var b=this.map.getControl(a._prevHighlighter);if(b){b.highlight(a)}}else{this.unhighlight(a)}}}else{this.unselect(a)}}},highlight:function(d){var b=d.layer;var a=this.events.triggerEvent("beforefeaturehighlighted",{feature:d});if(a!==false){d._prevHighlighter=d._lastHighlighter;d._lastHighlighter=this.id;var e=this.selectStyle||this.renderIntent;b.drawFeature(d,e);this.events.triggerEvent("featurehighlighted",{feature:d})}},unhighlight:function(b){var a=b.layer;b._lastHighlighter=b._prevHighlighter;delete b._prevHighlighter;a.drawFeature(b,b.style||b.layer.style||"default");this.events.triggerEvent("featureunhighlighted",{feature:b})},select:function(d){var a=this.onBeforeSelect.call(this.scope,d);var b=d.layer;if(a!==false){a=b.events.triggerEvent("beforefeatureselected",{feature:d});if(a!==false){b.selectedFeatures.push(d);this.highlight(d);b.events.triggerEvent("featureselected",{feature:d});this.onSelect.call(this.scope,d)}}},unselect:function(b){var a=b.layer;this.unhighlight(b);OpenLayers.Util.removeItem(a.selectedFeatures,b);a.events.triggerEvent("featureunselected",{feature:b});this.onUnselect.call(this.scope,b)},selectBox:function(g){if(g instanceof OpenLayers.Bounds){var o=this.map.getLonLatFromPixel(new OpenLayers.Pixel(g.left,g.bottom));var q=this.map.getLonLatFromPixel(new OpenLayers.Pixel(g.right,g.top));var a=new OpenLayers.Bounds(o.lon,o.lat,q.lon,q.lat);if(!this.multipleSelect()){this.unselectAll()}var p=this.multiple;this.multiple=true;var e=this.layers||[this.layer];var h;for(var b=0;b<e.length;++b){h=e[b];for(var d=0,m=h.features.length;d<m;++d){var r=h.features[d];if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,r.geometry.CLASS_NAME)>-1){if(a.toGeometry().intersects(r.geometry)){if(OpenLayers.Util.indexOf(h.selectedFeatures,r)==-1){this.select(r)}}}}}this.multiple=p}},setMap:function(a){this.handlers.feature.setMap(a);if(this.box){this.handlers.box.setMap(a)}OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.SelectFeature"});OpenLayers.Format.Filter.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ogc:"http://www.opengis.net/ogc",gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"ogc",schemaLocation:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(a){var b={};this.readers.ogc.Filter.apply(this,[a,b]);return b.filter},readers:{ogc:{Filter:function(b,a){var d={fids:[],filters:[]};this.readChildNodes(b,d);if(d.fids.length>0){a.filter=new OpenLayers.Filter.FeatureId({fids:d.fids})}else{if(d.filters.length>0){a.filter=d.filters[0]}}},FeatureId:function(a,b){var d=a.getAttribute("fid");if(d){b.fids.push(d)}},And:function(b,d){var a=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND});this.readChildNodes(b,a);d.filters.push(a)},Or:function(b,d){var a=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.OR});this.readChildNodes(b,a);d.filters.push(a)},Not:function(b,d){var a=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.NOT});this.readChildNodes(b,a);d.filters.push(a)},PropertyIsLessThan:function(b,d){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN});this.readChildNodes(b,a);d.filters.push(a)},PropertyIsGreaterThan:function(b,d){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN});this.readChildNodes(b,a);d.filters.push(a)},PropertyIsLessThanOrEqualTo:function(b,d){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO});this.readChildNodes(b,a);d.filters.push(a)},PropertyIsGreaterThanOrEqualTo:function(b,d){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO});this.readChildNodes(b,a);d.filters.push(a)},PropertyIsBetween:function(b,d){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN});this.readChildNodes(b,a);d.filters.push(a)},PropertyIsLike:function(e,g){var d=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(e,d);var h=e.getAttribute("wildCard");var b=e.getAttribute("singleChar");var a=e.getAttribute("escape");d.value2regex(h,b,a);g.filters.push(d)},Literal:function(a,b){b.value=OpenLayers.String.numericIf(this.getChildValue(a))},PropertyName:function(b,a){a.property=this.getChildValue(b)},LowerBoundary:function(b,a){a.lowerBoundary=OpenLayers.String.numericIf(this.readOgcExpression(b))},UpperBoundary:function(b,a){a.upperBoundary=OpenLayers.String.numericIf(this.readOgcExpression(b))},Intersects:function(a,b){this.readSpatial(a,b,OpenLayers.Filter.Spatial.INTERSECTS)},Within:function(a,b){this.readSpatial(a,b,OpenLayers.Filter.Spatial.WITHIN)},Contains:function(a,b){this.readSpatial(a,b,OpenLayers.Filter.Spatial.CONTAINS)},DWithin:function(a,b){this.readSpatial(a,b,OpenLayers.Filter.Spatial.DWITHIN)},Distance:function(a,b){b.distance=parseInt(this.getChildValue(a));b.distanceUnits=a.getAttribute("units")}}},readSpatial:function(d,e,b){var a=new OpenLayers.Filter.Spatial({type:b});this.readChildNodes(d,a);a.value=a.components[0];delete a.components;e.filters.push(a)},readOgcExpression:function(a){var d={};this.readChildNodes(a,d);var b=d.value;if(!b){b=this.getChildValue(a)}return b},write:function(a){return this.writers.ogc.Filter.apply(this,[a])},writers:{ogc:{Filter:function(d){var e=this.createElementNSPlus("ogc:Filter");var b=d.CLASS_NAME.split(".").pop();if(b=="FeatureId"){for(var a=0;a<d.fids.length;++a){this.writeNode("FeatureId",d.fids[a],e)}}else{this.writeNode(this.getFilterType(d),d,e)}return e},FeatureId:function(a){return this.createElementNSPlus("ogc:FeatureId",{attributes:{fid:a}})},And:function(d){var e=this.createElementNSPlus("ogc:And");var b;for(var a=0;a<d.filters.length;++a){b=d.filters[a];this.writeNode(this.getFilterType(b),b,e)}return e},Or:function(d){var e=this.createElementNSPlus("ogc:Or");var b;for(var a=0;a<d.filters.length;++a){b=d.filters[a];this.writeNode(this.getFilterType(b),b,e)}return e},Not:function(b){var d=this.createElementNSPlus("ogc:Not");var a=b.filters[0];this.writeNode(this.getFilterType(a),a,d);return d},PropertyIsLessThan:function(a){var b=this.createElementNSPlus("ogc:PropertyIsLessThan");this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},PropertyIsGreaterThan:function(a){var b=this.createElementNSPlus("ogc:PropertyIsGreaterThan");this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},PropertyIsLessThanOrEqualTo:function(a){var b=this.createElementNSPlus("ogc:PropertyIsLessThanOrEqualTo");this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},PropertyIsGreaterThanOrEqualTo:function(a){var b=this.createElementNSPlus("ogc:PropertyIsGreaterThanOrEqualTo");this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},PropertyIsBetween:function(a){var b=this.createElementNSPlus("ogc:PropertyIsBetween");this.writeNode("PropertyName",a,b);this.writeNode("LowerBoundary",a,b);this.writeNode("UpperBoundary",a,b);return b},PropertyIsLike:function(a){var b=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{wildCard:"*",singleChar:".",escape:"!"}});this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.regex2value(),b);return b},PropertyName:function(a){return this.createElementNSPlus("ogc:PropertyName",{value:a.property})},Literal:function(a){return this.createElementNSPlus("ogc:Literal",{value:a})},LowerBoundary:function(a){var b=this.createElementNSPlus("ogc:LowerBoundary");this.writeNode("Literal",a.lowerBoundary,b);return b},UpperBoundary:function(a){var b=this.createElementNSPlus("ogc:UpperBoundary");this.writeNode("Literal",a.upperBoundary,b);return b},INTERSECTS:function(a){return this.writeSpatial(a,"Intersects")},WITHIN:function(a){return this.writeSpatial(a,"Within")},CONTAINS:function(a){return this.writeSpatial(a,"Contains")},DWITHIN:function(a){var b=this.writeSpatial(a,"DWithin");this.writeNode("Distance",a,b);return b},Distance:function(a){return this.createElementNSPlus("ogc:Distance",{attributes:{units:a.distanceUnits},value:a.distance})}}},getFilterType:function(a){var b=this.filterMap[a.type];if(!b){throw"Filter writing not supported for rule type: "+a.type}return b},filterMap:{"&&":"And","||":"Or","!":"Not","==":"PropertyIsEqualTo","!=":"PropertyIsNotEqualTo","<":"PropertyIsLessThan",">":"PropertyIsGreaterThan","<=":"PropertyIsLessThanOrEqualTo",">=":"PropertyIsGreaterThanOrEqualTo","..":"PropertyIsBetween","~":"PropertyIsLike",BBOX:"BBOX",DWITHIN:"DWITHIN",WITHIN:"WITHIN",CONTAINS:"CONTAINS",INTERSECTS:"INTERSECTS"},CLASS_NAME:"OpenLayers.Format.Filter.v1"});OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(a){OpenLayers.Geometry.MultiPoint.prototype.initialize.apply(this,arguments)},getLength:function(){var d=0;if(this.components&&(this.components.length>1)){for(var b=1,a=this.components.length;b<a;b++){d+=this.components[b-1].distanceTo(this.components[b])}}return d},getGeodesicLength:function(b){var g=this;if(b){var d=new OpenLayers.Projection("EPSG:4326");if(!d.equals(b)){g=this.clone().transform(b,d)}}var h=0;if(g.components&&(g.components.length>1)){var m,l;for(var e=1,a=g.components.length;e<a;e++){m=g.components[e-1];l=g.components[e];h+=OpenLayers.Util.distVincenty({lon:m.x,lat:m.y},{lon:l.x,lat:l.y})}}return h*1000},CLASS_NAME:"OpenLayers.Geometry.Curve"});OpenLayers.Control.ModifyFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,clickout:true,toggle:true,layer:null,feature:null,vertices:null,virtualVertices:null,selectControl:null,dragControl:null,handlers:null,deleteCodes:null,virtualStyle:null,mode:null,modified:false,radiusHandle:null,dragHandle:null,onModificationStart:function(){},onModification:function(){},onModificationEnd:function(){},initialize:function(e,d){this.layer=e;this.vertices=[];this.virtualVertices=[];this.virtualStyle=OpenLayers.Util.extend({},this.layer.style||this.layer.styleMap.createSymbolizer());this.virtualStyle.fillOpacity=0.3;this.virtualStyle.strokeOpacity=0.3;this.deleteCodes=[46,68];this.mode=OpenLayers.Control.ModifyFeature.RESHAPE;OpenLayers.Control.prototype.initialize.apply(this,[d]);if(!(this.deleteCodes instanceof Array)){this.deleteCodes=[this.deleteCodes]}var h=this;var a={geometryTypes:this.geometryTypes,clickout:this.clickout,toggle:this.toggle,onBeforeSelect:this.beforeSelectFeature,onSelect:this.selectFeature,onUnselect:this.unselectFeature,scope:this};this.selectControl=new OpenLayers.Control.SelectFeature(e,a);var b={geometryTypes:["OpenLayers.Geometry.Point"],snappingOptions:this.snappingOptions,onStart:function(m,l){h.dragStart.apply(h,[m,l])},onDrag:function(m,l){h.dragVertex.apply(h,[m,l])},onComplete:function(l){h.dragComplete.apply(h,[l])}};this.dragControl=new OpenLayers.Control.DragFeature(e,b);var g={keydown:this.handleKeypress};this.handlers={keyboard:new OpenLayers.Handler.Keyboard(this,g)}},destroy:function(){this.layer=null;this.selectControl.destroy();this.dragControl.destroy();OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return(this.selectControl.activate()&&this.handlers.keyboard.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments))},deactivate:function(){var a=false;if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){this.layer.removeFeatures(this.vertices,{silent:true});this.layer.removeFeatures(this.virtualVertices,{silent:true});this.vertices=[];this.dragControl.deactivate();if(this.feature&&this.feature.geometry&&this.feature.layer){this.selectControl.unselect.apply(this.selectControl,[this.feature])}this.selectControl.deactivate();this.handlers.keyboard.deactivate();a=true}return a},beforeSelectFeature:function(a){return this.layer.events.triggerEvent("beforefeaturemodified",{feature:a})},selectFeature:function(a){this.feature=a;this.modified=false;this.resetVertices();this.dragControl.activate();this.onModificationStart(this.feature)},unselectFeature:function(a){this.layer.removeFeatures(this.vertices,{silent:true});this.vertices=[];this.layer.destroyFeatures(this.virtualVertices,{silent:true});this.virtualVertices=[];if(this.dragHandle){this.layer.destroyFeatures([this.dragHandle],{silent:true});delete this.dragHandle}if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});delete this.radiusHandle}this.feature=null;this.dragControl.deactivate();this.onModificationEnd(a);this.layer.events.triggerEvent("afterfeaturemodified",{feature:a,modified:this.modified});this.modified=false},dragStart:function(b,a){if(b!=this.feature&&!b.geometry.parent&&b!=this.dragHandle&&b!=this.radiusHandle){if(this.feature){this.selectControl.clickFeature.apply(this.selectControl,[this.feature])}if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,b.geometry.CLASS_NAME)!=-1){this.selectControl.clickFeature.apply(this.selectControl,[b]);this.dragControl.overFeature.apply(this.dragControl,[b]);this.dragControl.lastPixel=a;this.dragControl.handlers.drag.started=true;this.dragControl.handlers.drag.start=a;this.dragControl.handlers.drag.last=a}}},dragVertex:function(b,a){this.modified=true;if(this.feature.geometry.CLASS_NAME=="OpenLayers.Geometry.Point"){if(this.feature!=b){this.feature=b}this.layer.events.triggerEvent("vertexmodified",{vertex:b.geometry,feature:this.feature,pixel:a})}else{if(b._index){b.geometry.parent.addComponent(b.geometry,b._index);delete b._index;OpenLayers.Util.removeItem(this.virtualVertices,b);this.vertices.push(b)}else{if(b==this.dragHandle){this.layer.removeFeatures(this.vertices,{silent:true});this.vertices=[];if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});this.radiusHandle=null}}else{if(b!==this.radiusHandle){this.layer.events.triggerEvent("vertexmodified",{vertex:b.geometry,feature:this.feature,pixel:a})}}}if(this.virtualVertices.length>0){this.layer.destroyFeatures(this.virtualVertices,{silent:true});this.virtualVertices=[]}this.layer.drawFeature(this.feature,this.selectControl.renderIntent)}this.layer.drawFeature(b)},dragComplete:function(a){this.resetVertices();this.setFeatureState();this.onModification(this.feature);this.layer.events.triggerEvent("featuremodified",{feature:this.feature})},setFeatureState:function(){if(this.feature.state!=OpenLayers.State.INSERT&&this.feature.state!=OpenLayers.State.DELETE){this.feature.state=OpenLayers.State.UPDATE}},resetVertices:function(){if(this.dragControl.feature){this.dragControl.outFeature(this.dragControl.feature)}if(this.vertices.length>0){this.layer.removeFeatures(this.vertices,{silent:true});this.vertices=[]}if(this.virtualVertices.length>0){this.layer.removeFeatures(this.virtualVertices,{silent:true});this.virtualVertices=[]}if(this.dragHandle){this.layer.destroyFeatures([this.dragHandle],{silent:true});this.dragHandle=null}if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});this.radiusHandle=null}if(this.feature&&this.feature.geometry.CLASS_NAME!="OpenLayers.Geometry.Point"){if((this.mode&OpenLayers.Control.ModifyFeature.DRAG)){this.collectDragHandle()}if((this.mode&(OpenLayers.Control.ModifyFeature.ROTATE|OpenLayers.Control.ModifyFeature.RESIZE))){this.collectRadiusHandle()}if(this.mode&OpenLayers.Control.ModifyFeature.RESHAPE){if(!(this.mode&OpenLayers.Control.ModifyFeature.RESIZE)){this.collectVertices()}}}},handleKeypress:function(a){var b=a.keyCode;if(this.feature&&OpenLayers.Util.indexOf(this.deleteCodes,b)!=-1){var d=this.dragControl.feature;if(d&&OpenLayers.Util.indexOf(this.vertices,d)!=-1&&!this.dragControl.handlers.drag.dragging&&d.geometry.parent){d.geometry.parent.removeComponent(d.geometry);this.layer.drawFeature(this.feature,this.selectControl.renderIntent);this.resetVertices();this.setFeatureState();this.onModification(this.feature);this.layer.events.triggerEvent("featuremodified",{feature:this.feature})}}},collectVertices:function(){this.vertices=[];this.virtualVertices=[];var a=this;function b(m){var e,g,o,h;if(m.CLASS_NAME=="OpenLayers.Geometry.Point"){g=new OpenLayers.Feature.Vector(m);g._sketch=true;a.vertices.push(g)}else{var d=m.components.length;if(m.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){d-=1}for(e=0;e<d;++e){o=m.components[e];if(o.CLASS_NAME=="OpenLayers.Geometry.Point"){g=new OpenLayers.Feature.Vector(o);g._sketch=true;a.vertices.push(g)}else{b(o)}}if(m.CLASS_NAME!="OpenLayers.Geometry.MultiPoint"){for(e=0,h=m.components.length;e<h-1;++e){var r=m.components[e];var s=m.components[e+1];if(r.CLASS_NAME=="OpenLayers.Geometry.Point"&&s.CLASS_NAME=="OpenLayers.Geometry.Point"){var p=(r.x+s.x)/2;var l=(r.y+s.y)/2;var q=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(p,l),null,a.virtualStyle);q.geometry.parent=m;q._index=e+1;q._sketch=true;a.virtualVertices.push(q)}}}}}b.call(this,this.feature.geometry);this.layer.addFeatures(this.virtualVertices,{silent:true});this.layer.addFeatures(this.vertices,{silent:true})},collectDragHandle:function(){var e=this.feature.geometry;var a=e.getBounds().getCenterLonLat();var d=new OpenLayers.Geometry.Point(a.lon,a.lat);var b=new OpenLayers.Feature.Vector(d);d.move=function(g,h){OpenLayers.Geometry.Point.prototype.move.call(this,g,h);e.move(g,h)};b._sketch=true;this.dragHandle=b;this.layer.addFeatures([this.dragHandle],{silent:true})},collectRadiusHandle:function(){var m=this.feature.geometry;var a=m.getBounds();var b=a.getCenterLonLat();var o=new OpenLayers.Geometry.Point(b.lon,b.lat);var l=new OpenLayers.Geometry.Point(a.right,a.bottom);var h=new OpenLayers.Feature.Vector(l);var d=(this.mode&OpenLayers.Control.ModifyFeature.RESIZE);var g=(this.mode&OpenLayers.Control.ModifyFeature.RESHAPE);var e=(this.mode&OpenLayers.Control.ModifyFeature.ROTATE);l.move=function(C,B){OpenLayers.Geometry.Point.prototype.move.call(this,C,B);var D=this.x-o.x;var v=this.y-o.y;var E=D-C;var w=v-B;if(e){var q=Math.atan2(w,E);var p=Math.atan2(v,D);var t=p-q;t*=180/Math.PI;m.rotate(t,o)}if(d){var s,z;if(g){s=v/w;z=(D/E)/s}else{var u=Math.sqrt((E*E)+(w*w));var r=Math.sqrt((D*D)+(v*v));s=r/u}m.resize(s,o,z)}};h._sketch=true;this.radiusHandle=h;this.layer.addFeatures([this.radiusHandle],{silent:true})},setMap:function(a){this.selectControl.setMap(a);this.dragControl.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.ModifyFeature"});OpenLayers.Control.ModifyFeature.RESHAPE=1;OpenLayers.Control.ModifyFeature.RESIZE=2;OpenLayers.Control.ModifyFeature.ROTATE=4;OpenLayers.Control.ModifyFeature.DRAG=8;OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{initialize:function(a){OpenLayers.Geometry.Curve.prototype.initialize.apply(this,arguments)},removeComponent:function(a){if(this.components&&(this.components.length>2)){OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments)}},intersects:function(q){var d=false;var p=q.CLASS_NAME;if(p=="OpenLayers.Geometry.LineString"||p=="OpenLayers.Geometry.LinearRing"||p=="OpenLayers.Geometry.Point"){var t=this.getSortedSegments();var r;if(p=="OpenLayers.Geometry.Point"){r=[{x1:q.x,y1:q.y,x2:q.x,y2:q.y}]}else{r=q.getSortedSegments()}var w,l,g,a,v,u,e,b;outer:for(var m=0,o=t.length;m<o;++m){w=t[m];l=w.x1;g=w.x2;a=w.y1;v=w.y2;inner:for(var h=0,s=r.length;h<s;++h){u=r[h];if(u.x1>g){break}if(u.x2<l){continue}e=u.y1;b=u.y2;if(Math.min(e,b)>Math.max(a,v)){continue}if(Math.max(e,b)<Math.min(a,v)){continue}if(OpenLayers.Geometry.segmentsIntersect(w,u)){d=true;break outer}}}}else{d=q.intersects(this)}return d},getSortedSegments:function(){var a=this.components.length-1;var b=new Array(a);for(var d=0;d<a;++d){point1=this.components[d];point2=this.components[d+1];if(point1.x<point2.x){b[d]={x1:point1.x,y1:point1.y,x2:point2.x,y2:point2.y}}else{b[d]={x1:point2.x,y1:point2.y,x2:point1.x,y2:point1.y}}}function e(h,g){return h.x1-g.x1}return b.sort(e)},splitWithSegment:function(w,b){var d=!(b&&b.edge===false);var t=b&&b.tolerance;var a=[];var B=this.getVertices();var s=[];var D=[];var m=false;var g,e,q;var o,v,C;var h={point:true,tolerance:t};var l=null;for(var r=0,p=B.length-2;r<=p;++r){g=B[r];s.push(g.clone());e=B[r+1];C={x1:g.x,y1:g.y,x2:e.x,y2:e.y};q=OpenLayers.Geometry.segmentsIntersect(w,C,h);if(q instanceof OpenLayers.Geometry.Point){if((q.x===w.x1&&q.y===w.y1)||(q.x===w.x2&&q.y===w.y2)||q.equals(g)||q.equals(e)){v=true}else{v=false}if(v||d){if(!q.equals(D[D.length-1])){D.push(q.clone())}if(r===0){if(q.equals(g)){continue}}if(q.equals(e)){continue}m=true;if(!q.equals(g)){s.push(q)}a.push(new OpenLayers.Geometry.LineString(s));s=[q.clone()]}}}if(m){s.push(e.clone());a.push(new OpenLayers.Geometry.LineString(s))}if(D.length>0){var u=w.x1<w.x2?1:-1;var z=w.y1<w.y2?1:-1;l={lines:a,points:D.sort(function(F,E){return(u*F.x-u*E.x)||(z*F.y-z*E.y)})}}return l},split:function(D,b){var q=null;var e=b&&b.mutual;var o,g,p,d;if(D instanceof OpenLayers.Geometry.LineString){var C=this.getVertices();var l,h,B,m,a,s;var v=[];p=[];for(var w=0,r=C.length-2;w<=r;++w){l=C[w];h=C[w+1];B={x1:l.x,y1:l.y,x2:h.x,y2:h.y};d=d||[D];if(e){v.push(l.clone())}for(var u=0;u<d.length;++u){m=d[u].splitWithSegment(B,b);if(m){a=m.lines;if(a.length>0){a.unshift(u,1);Array.prototype.splice.apply(d,a);u+=a.length-2}if(e){for(var t=0,z=m.points.length;t<z;++t){s=m.points[t];if(!s.equals(l)){v.push(s);p.push(new OpenLayers.Geometry.LineString(v));if(s.equals(h)){v=[]}else{v=[s.clone()]}}}}}}}if(e&&p.length>0&&v.length>0){v.push(h.clone());p.push(new OpenLayers.Geometry.LineString(v))}}else{q=D.splitWith(this,b)}if(d&&d.length>1){g=true}else{d=[]}if(p&&p.length>1){o=true}else{p=[]}if(g||o){if(e){q=[p,d]}else{q=d}}return q},splitWith:function(b,a){return b.split(this,a)},getVertices:function(a){var b;if(a===true){b=[this.components[0],this.components[this.components.length-1]]}else{if(a===false){b=this.components.slice(1,this.components.length-1)}else{b=this.components.slice()}}return b},distanceTo:function(m,l){var o=!(l&&l.edge===false);var G=o&&l&&l.details;var u,g={};var z=Number.POSITIVE_INFINITY;if(m instanceof OpenLayers.Geometry.Point){var v=this.getSortedSegments();var t=m.x;var s=m.y;var E;for(var C=0,D=v.length;C<D;++C){E=v[C];u=OpenLayers.Geometry.distanceToSegment(m,E);if(u.distance<z){z=u.distance;g=u;if(z===0){break}}else{if(E.x2>t&&((s>E.y1&&s<E.y2)||(s<E.y1&&s>E.y2))){break}}}if(G){g={distance:g.distance,x0:g.x,y0:g.y,x1:t,y1:s}}else{g=g.distance}}else{if(m instanceof OpenLayers.Geometry.LineString){var e=this.getSortedSegments();var d=m.getSortedSegments();var b,a,r,F,h;var q=d.length;var p={point:true};outer:for(var C=0,D=e.length;C<D;++C){b=e[C];F=b.x1;h=b.y1;for(var B=0;B<q;++B){a=d[B];r=OpenLayers.Geometry.segmentsIntersect(b,a,p);if(r){z=0;g={distance:0,x0:r.x,y0:r.y,x1:r.x,y1:r.y};break outer}else{u=OpenLayers.Geometry.distanceToSegment({x:F,y:h},a);if(u.distance<z){z=u.distance;g={distance:z,x0:F,y0:h,x1:u.x,y1:u.y}}}}}if(!G){g=g.distance}if(z!==0){if(b){u=m.distanceTo(new OpenLayers.Geometry.Point(b.x2,b.y2),l);var w=G?u.distance:u;if(w<z){if(G){g={distance:z,x0:u.x1,y0:u.y1,x1:u.x0,y1:u.y0}}else{g=w}}}}}else{g=m.distanceTo(this,l);if(G){g={distance:g.distance,x0:g.x1,y0:g.y1,x1:g.x0,y1:g.y0}}}}return g},CLASS_NAME:"OpenLayers.Geometry.LineString"});OpenLayers.Format.GPX=OpenLayers.Class(OpenLayers.Format.XML,{extractWaypoints:true,extractTracks:true,extractRoutes:true,extractAttributes:true,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(D){if(typeof D=="string"){D=OpenLayers.Format.XML.prototype.read.apply(this,[D])}var d=[];if(this.extractTracks){var w=D.getElementsByTagName("trk");for(var v=0,z=w.length;v<z;v++){var q={};if(this.extractAttributes){q=this.parseAttributes(w[v])}var o=this.getElementsByTagNameNS(w[v],w[v].namespaceURI,"trkseg");for(var u=0,m=o.length;u<m;u++){var p=this.extractSegment(o[u],"trkpt");d.push(new OpenLayers.Feature.Vector(p,q))}}}if(this.extractRoutes){var a=D.getElementsByTagName("rte");for(var t=0,s=a.length;t<s;t++){var q={};if(this.extractAttributes){q=this.parseAttributes(a[t])}var C=this.extractSegment(a[t],"rtept");d.push(new OpenLayers.Feature.Vector(C,q))}}if(this.extractWaypoints){var b=D.getElementsByTagName("wpt");for(var r=0,z=b.length;r<z;r++){var q={};if(this.extractAttributes){q=this.parseAttributes(b[r])}var h=new OpenLayers.Geometry.Point(b[r].getAttribute("lon"),b[r].getAttribute("lat"));d.push(new OpenLayers.Feature.Vector(h,q))}}if(this.internalProjection&&this.externalProjection){for(var B=0,e=d.length;B<e;B++){d[B].geometry.transform(this.externalProjection,this.internalProjection)}}return d},extractSegment:function(g,h){var e=this.getElementsByTagNameNS(g,g.namespaceURI,h);var b=[];for(var d=0,a=e.length;d<a;d++){b.push(new OpenLayers.Geometry.Point(e[d].getAttribute("lon"),e[d].getAttribute("lat")))}return new OpenLayers.Geometry.LineString(b)},parseAttributes:function(b){var a={};var e=b.firstChild;while(e){if(e.nodeType==1){var d=e.firstChild;if(d.nodeType==3||d.nodeType==4){name=(e.prefix)?e.nodeName.split(":")[1]:e.nodeName;if(name!="trkseg"&&name!="rtept"){a[name]=d.nodeValue}}}e=e.nextSibling}return a},CLASS_NAME:"OpenLayers.Format.GPX"});OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(a){OpenLayers.Geometry.LineString.prototype.initialize.apply(this,arguments)},addComponent:function(a,b){var d=false;var e=this.components.pop();if(b!=null||!a.equals(e)){d=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments)}var g=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[g]);return d},removeComponent:function(a){if(this.components.length>4){this.components.pop();OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);var b=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[b])}},move:function(b,e){for(var d=0,a=this.components.length;d<a-1;d++){this.components[d].move(b,e)}},rotate:function(e,b){for(var d=0,a=this.components.length;d<a-1;++d){this.components[d].rotate(e,b)}},resize:function(g,b,e){for(var d=0,a=this.components.length;d<a-1;++d){this.components[d].resize(g,b,e)}return this},transform:function(g,d){if(g&&d){for(var e=0,a=this.components.length;e<a-1;e++){var b=this.components[e];b.transform(g,d)}this.bounds=null}return this},getCentroid:function(){if(this.components&&(this.components.length>2)){var l=0;var h=0;for(var e=0;e<this.components.length-1;e++){var d=this.components[e];var o=this.components[e+1];l+=(d.x+o.x)*(d.x*o.y-o.x*d.y);h+=(d.y+o.y)*(d.x*o.y-o.x*d.y)}var g=-1*this.getArea();var a=l/(6*g);var m=h/(6*g)}return new OpenLayers.Geometry.Point(a,m)},getArea:function(){var h=0;if(this.components&&(this.components.length>2)){var g=0;for(var e=0,d=this.components.length;e<d-1;e++){var a=this.components[e];var l=this.components[e+1];g+=(a.x+l.x)*(l.y-a.y)}h=-g/2}return h},getGeodesicArea:function(b){var e=this;if(b){var d=new OpenLayers.Projection("EPSG:4326");if(!d.equals(b)){e=this.clone().transform(b,d)}}var h=0;var a=e.components&&e.components.length;if(a>2){var m,l;for(var g=0;g<a-1;g++){m=e.components[g];l=e.components[g+1];h+=OpenLayers.Util.rad(l.x-m.x)*(2+Math.sin(OpenLayers.Util.rad(m.y))+Math.sin(OpenLayers.Util.rad(l.y)))}h=h*6378137*6378137/2}return h},containsPoint:function(r){var z=OpenLayers.Number.limitSigDigs;var q=14;var p=z(r.x,q);var o=z(r.y,q);function w(F,C,E,B,D){return(((C-B)*F)+((B*E)-(C*D)))/(E-D)}var a=this.components.length-1;var l,h,v,e,t,b,g,d;var m=0;for(var s=0;s<a;++s){l=this.components[s];v=z(l.x,q);e=z(l.y,q);h=this.components[s+1];t=z(h.x,q);b=z(h.y,q);if(e==b){if(o==e){if(v<=t&&(p>=v&&p<=t)||v>=t&&(p<=v&&p>=t)){m=-1;break}}continue}g=z(w(o,v,e,t,b),q);if(g==p){if(e<b&&(o>=e&&o<=b)||e>b&&(o<=e&&o>=b)){m=-1;break}}if(g<=p){continue}if(v!=t&&(g<Math.min(v,t)||g>Math.max(v,t))){continue}if(e<b&&(o>=e&&o<b)||e>b&&(o<e&&o>=b)){++m}}var u=(m==-1)?1:!!(m&1);return u},intersects:function(e){var b=false;if(e.CLASS_NAME=="OpenLayers.Geometry.Point"){b=this.containsPoint(e)}else{if(e.CLASS_NAME=="OpenLayers.Geometry.LineString"){b=e.intersects(this)}else{if(e.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){b=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[e])}else{for(var d=0,a=e.components.length;d<a;++d){b=e.components[d].intersects(this);if(b){break}}}}}return b},getVertices:function(a){return(a===true)?[]:this.components.slice(0,this.components.length-1)},CLASS_NAME:"OpenLayers.Geometry.LinearRing"});OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LineString"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},split:function(q,v){var l=null;var u=v&&v.mutual;var r,a,t,p,b;var g=[];var s=[q];for(var h=0,m=this.components.length;h<m;++h){a=this.components[h];p=false;for(var e=0;e<s.length;++e){r=a.split(s[e],v);if(r){if(u){t=r[0];for(var d=0,o=t.length;d<o;++d){if(d===0&&g.length){g[g.length-1].addComponent(t[d])}else{g.push(new OpenLayers.Geometry.MultiLineString([t[d]]))}}p=true;r=r[1]}if(r.length){r.unshift(e,1);Array.prototype.splice.apply(s,r);break}}}if(!p){if(g.length){g[g.length-1].addComponent(a.clone())}else{g=[new OpenLayers.Geometry.MultiLineString(a.clone())]}}}if(g&&g.length>1){p=true}else{g=[]}if(s&&s.length>1){b=true}else{s=[]}if(p||b){if(u){l=[g,s]}else{l=s}}return l},splitWith:function(q,v){var l=null;var u=v&&v.mutual;var r,d,t,p,a,g,s;if(q instanceof OpenLayers.Geometry.LineString){s=[];g=[q];for(var h=0,m=this.components.length;h<m;++h){a=false;d=this.components[h];for(var e=0;e<g.length;++e){r=g[e].split(d,v);if(r){if(u){t=r[0];if(t.length){t.unshift(e,1);Array.prototype.splice.apply(g,t);e+=t.length-2}r=r[1];if(r.length===0){r=[d.clone()]}}for(var b=0,o=r.length;b<o;++b){if(b===0&&s.length){s[s.length-1].addComponent(r[b])}else{s.push(new OpenLayers.Geometry.MultiLineString([r[b]]))}}a=true}}if(!a){if(s.length){s[s.length-1].addComponent(d.clone())}else{s=[new OpenLayers.Geometry.MultiLineString([d.clone()])]}}}}else{l=q.split(this)}if(g&&g.length>1){p=true}else{g=[]}if(s&&s.length>1){a=true}else{s=[]}if(p||a){if(u){l=[g,s]}else{l=s}}return l},CLASS_NAME:"OpenLayers.Geometry.MultiLineString"});OpenLayers.Handler.Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,freehand:false,freehandToggle:"shiftKey",initialize:function(d,b,a){OpenLayers.Handler.Point.prototype.initialize.apply(this,arguments)},createFeature:function(a){var b=this.control.map.getLonLatFromPixel(a);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat));this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([this.point.geometry]));this.callback("create",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.line,this.point],{silent:true})},destroyFeature:function(){OpenLayers.Handler.Point.prototype.destroyFeature.apply(this);this.line=null},removePoint:function(){if(this.point){this.layer.removeFeatures([this.point])}},addPoint:function(a){this.layer.removeFeatures([this.point]);var b=this.control.map.getLonLatFromPixel(a);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat));this.line.geometry.addComponent(this.point.geometry,this.line.geometry.components.length);this.callback("point",[this.point.geometry,this.getGeometry()]);this.callback("modify",[this.point.geometry,this.getSketch()]);this.drawFeature()},freehandMode:function(a){return(this.freehandToggle&&a[this.freehandToggle])?!this.freehand:this.freehand},modifyFeature:function(a){var b=this.control.map.getLonLatFromPixel(a);this.point.geometry.x=b.lon;this.point.geometry.y=b.lat;this.callback("modify",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.line,this.style);this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.line},getGeometry:function(){var a=this.line&&this.line.geometry;if(a&&this.multi){a=new OpenLayers.Geometry.MultiLineString([a])}return a},mousedown:function(a){if(this.lastDown&&this.lastDown.equals(a.xy)){return false}if(this.lastDown==null){if(this.persist){this.destroyFeature()}this.createFeature(a.xy)}else{if((this.lastUp==null)||!this.lastUp.equals(a.xy)){this.addPoint(a.xy)}}this.mouseDown=true;this.lastDown=a.xy;this.drawing=true;return false},mousemove:function(a){if(this.drawing){if(this.mouseDown&&this.freehandMode(a)){this.addPoint(a.xy)}else{this.modifyFeature(a.xy)}}return true},mouseup:function(a){this.mouseDown=false;if(this.drawing){if(this.freehandMode(a)){this.removePoint();this.finalize()}else{if(this.lastUp==null){this.addPoint(a.xy)}this.lastUp=a.xy}return false}return true},dblclick:function(a){if(!this.freehandMode(a)){var b=this.line.geometry.components.length-1;this.line.geometry.removeComponent(this.line.geometry.components[b]);this.removePoint();this.finalize()}return false},CLASS_NAME:"OpenLayers.Handler.Path"});OpenLayers.Control.Split=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforesplit","split","aftersplit"],layer:null,source:null,sourceOptions:null,tolerance:null,edge:true,deferDelete:false,mutual:true,targetFilter:null,sourceFilter:null,handler:null,initialize:function(a){Array.prototype.push.apply(this.EVENT_TYPES,OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);this.options=a||{};if(this.options.source){this.setSource(this.options.source)}},setSource:function(a){if(this.active){this.deactivate();if(this.handler){this.handler.destroy();delete this.handler}this.source=a;this.activate()}else{this.source=a}},activate:function(){var a=OpenLayers.Control.prototype.activate.call(this);if(a){if(!this.source){if(!this.handler){this.handler=new OpenLayers.Handler.Path(this,{done:function(b){this.onSketchComplete({feature:new OpenLayers.Feature.Vector(b)})}},{layerOptions:this.sourceOptions})}this.handler.activate()}else{if(this.source.events){this.source.events.on({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this})}}}return a},deactivate:function(){var a=OpenLayers.Control.prototype.deactivate.call(this);if(a){if(this.source&&this.source.events){this.layer.events.un({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this})}}return a},onSketchComplete:function(a){this.feature=null;return !this.considerSplit(a.feature)},afterFeatureModified:function(b){if(b.modified){var a=b.feature;if(a.geometry instanceof OpenLayers.Geometry.LineString||a.geometry instanceof OpenLayers.Geometry.MultiLineString){this.feature=b.feature;this.considerSplit(b.feature)}}},removeByGeometry:function(d,e){for(var b=0,a=d.length;b<a;++b){if(d[b].geometry===e){d.splice(b,1);break}}},isEligible:function(a){return(a.state!==OpenLayers.State.DELETE)&&(a.geometry instanceof OpenLayers.Geometry.LineString||a.geometry instanceof OpenLayers.Geometry.MultiLineString)&&(this.feature!==a)&&(!this.targetFilter||this.targetFilter.evaluate(a.attributes))},considerSplit:function(d){sourceSplit=false;targetSplit=false;if(!this.sourceFilter||this.sourceFilter.evaluate(d.attributes)){var h=this.layer&&this.layer.features||[];var D,r,l,a;var o=[],C=[];var e=(this.layer===this.source)&&this.mutual;var b={edge:this.edge,tolerance:this.tolerance,mutual:e};var m=[d.geometry];var q,g;var t,s;for(var z=0,B=h.length;z<B;++z){q=h[z];if(this.isEligible(q)){g=[q.geometry];for(var w=0;w<m.length;++w){t=m[w];for(var u=0;u<g.length;++u){D=g[u];if(t.getBounds().intersectsBounds(D.getBounds())){r=t.split(D,b);if(r){a=this.events.triggerEvent("beforesplit",{source:d,target:q});if(a!==false){if(e){s=r[0];if(s.length>1){s.unshift(w,1);Array.prototype.splice.apply(m,s);w+=s.length-3}r=r[1]}if(r.length>1){r.unshift(u,1);Array.prototype.splice.apply(g,r);u+=r.length-3}}}}}}if(g&&g.length>1){this.geomsToFeatures(q,g);this.events.triggerEvent("split",{original:q,features:g});Array.prototype.push.apply(o,g);C.push(q);targetSplit=true}}}if(m&&m.length>1){this.geomsToFeatures(d,m);this.events.triggerEvent("split",{original:d,features:m});Array.prototype.push.apply(o,m);C.push(d);sourceSplit=true}if(sourceSplit||targetSplit){if(this.deferDelete){var p,v=[];for(var z=0,B=C.length;z<B;++z){p=C[z];if(p.state===OpenLayers.State.INSERT){v.push(p)}else{p.state=OpenLayers.State.DELETE;this.layer.drawFeature(p)}}this.layer.destroyFeatures(v,{silent:true});for(var z=0,B=o.length;z<B;++z){o[z].state=OpenLayers.State.INSERT}}else{this.layer.destroyFeatures(C,{silent:true})}this.layer.addFeatures(o,{silent:true});this.events.triggerEvent("aftersplit",{source:d,features:o})}}return sourceSplit},geomsToFeatures:function(d,e){var h=d.clone();delete h.geometry;var g;for(var b=0,a=e.length;b<a;++b){g=h.clone();g.geometry=e[b];g.state=OpenLayers.State.INSERT;e[b]=g}},destroy:function(){if(this.active){this.deactivate()}OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:"OpenLayers.Control.Split"});OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LinearRing"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},getArea:function(){var d=0;if(this.components&&(this.components.length>0)){d+=Math.abs(this.components[0].getArea());for(var b=1,a=this.components.length;b<a;b++){d-=Math.abs(this.components[b].getArea())}}return d},getGeodesicArea:function(b){var e=0;if(this.components&&(this.components.length>0)){e+=Math.abs(this.components[0].getGeodesicArea(b));for(var d=1,a=this.components.length;d<a;d++){e-=Math.abs(this.components[d].getGeodesicArea(b))}}return e},containsPoint:function(a){var g=this.components.length;var d=false;if(g>0){d=this.components[0].containsPoint(a);if(d!==1){if(d&&g>1){var e;for(var b=1;b<g;++b){e=this.components[b].containsPoint(a);if(e){if(e===1){d=1}else{d=false}break}}}}}return d},intersects:function(g){var b=false;var e,a;if(g.CLASS_NAME=="OpenLayers.Geometry.Point"){b=this.containsPoint(g)}else{if(g.CLASS_NAME=="OpenLayers.Geometry.LineString"||g.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){for(e=0,a=this.components.length;e<a;++e){b=g.intersects(this.components[e]);if(b){break}}if(!b){for(e=0,a=g.components.length;e<a;++e){b=this.containsPoint(g.components[e]);if(b){break}}}}else{for(e=0,a=g.components.length;e<a;++e){b=this.intersects(g.components[e]);if(b){break}}}}if(!b&&g.CLASS_NAME=="OpenLayers.Geometry.Polygon"){var d=this.components[0];for(e=0,a=d.components.length;e<a;++e){b=g.containsPoint(d.components[e]);if(b){break}}}return b},distanceTo:function(e,b){var d=!(b&&b.edge===false);var a;if(!d&&this.intersects(e)){a=0}else{a=OpenLayers.Geometry.Collection.prototype.distanceTo.apply(this,[e,b])}return a},CLASS_NAME:"OpenLayers.Geometry.Polygon"});OpenLayers.Geometry.Polygon.createRegularPolygon=function(o,h,b,q){var d=Math.PI*((1/b)-(1/2));if(q){d+=(q/180)*Math.PI}var a,m,l;var p=[];for(var g=0;g<b;++g){a=d+(g*2*Math.PI/b);m=o.x+(h*Math.cos(a));l=o.y+(h*Math.sin(a));p.push(new OpenLayers.Geometry.Point(m,l))}var e=new OpenLayers.Geometry.LinearRing(p);return new OpenLayers.Geometry.Polygon([e])};OpenLayers.Format.GeoRSS=OpenLayers.Class(OpenLayers.Format.XML,{rssns:"http://backend.userland.com/rss2",featureNS:"http://mapserver.gis.umn.edu/mapserver",georssns:"http://www.georss.org/georss",geons:"http://www.w3.org/2003/01/geo/wgs84_pos#",featureTitle:"Untitled",featureDescription:"No Description",gmlParser:null,xy:false,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},createGeometryFromItem:function(s){var r=this.getElementsByTagNameNS(s,this.georssns,"point");var l=this.getElementsByTagNameNS(s,this.geons,"lat");var a=this.getElementsByTagNameNS(s,this.geons,"long");var u=this.getElementsByTagNameNS(s,this.georssns,"line");var p=this.getElementsByTagNameNS(s,this.georssns,"polygon");var d=this.getElementsByTagNameNS(s,this.georssns,"where");var e=this.getElementsByTagNameNS(s,this.georssns,"box");if(r.length>0||(l.length>0&&a.length>0)){var q;if(r.length>0){q=OpenLayers.String.trim(r[0].firstChild.nodeValue).split(/\s+/);if(q.length!=2){q=OpenLayers.String.trim(r[0].firstChild.nodeValue).split(/\s*,\s*/)}}else{q=[parseFloat(l[0].firstChild.nodeValue),parseFloat(a[0].firstChild.nodeValue)]}var m=new OpenLayers.Geometry.Point(parseFloat(q[1]),parseFloat(q[0]))}else{if(u.length>0){var o=OpenLayers.String.trim(this.concatChildValues(u[0])).split(/\s+/);var g=[];var r;for(var b=0,h=o.length;b<h;b+=2){r=new OpenLayers.Geometry.Point(parseFloat(o[b+1]),parseFloat(o[b]));g.push(r)}m=new OpenLayers.Geometry.LineString(g)}else{if(p.length>0){var o=OpenLayers.String.trim(this.concatChildValues(p[0])).split(/\s+/);var g=[];var r;for(var b=0,h=o.length;b<h;b+=2){r=new OpenLayers.Geometry.Point(parseFloat(o[b+1]),parseFloat(o[b]));g.push(r)}m=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(g)])}else{if(d.length>0){if(!this.gmlParser){this.gmlParser=new OpenLayers.Format.GML({xy:this.xy})}var t=this.gmlParser.parseFeature(d[0]);m=t.geometry}else{if(e.length>0){var o=OpenLayers.String.trim(e[0].firstChild.nodeValue).split(/\s+/);var g=[];var r;if(o.length>3){r=new OpenLayers.Geometry.Point(parseFloat(o[1]),parseFloat(o[0]));g.push(r);r=new OpenLayers.Geometry.Point(parseFloat(o[1]),parseFloat(o[2]));g.push(r);r=new OpenLayers.Geometry.Point(parseFloat(o[3]),parseFloat(o[2]));g.push(r);r=new OpenLayers.Geometry.Point(parseFloat(o[3]),parseFloat(o[0]));g.push(r);r=new OpenLayers.Geometry.Point(parseFloat(o[1]),parseFloat(o[0]));g.push(r)}m=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(g)])}}}}}if(m&&this.internalProjection&&this.externalProjection){m.transform(this.externalProjection,this.internalProjection)}return m},createFeatureFromItem:function(o){var g=this.createGeometryFromItem(o);var l=this.getChildValue(o,"*","title",this.featureTitle);var m=this.getChildValue(o,"*","description",this.getChildValue(o,"*","content",this.getChildValue(o,"*","summary",this.featureDescription)));var h=this.getChildValue(o,"*","link");if(!h){try{h=this.getElementsByTagNameNS(o,"*","link")[0].getAttribute("href")}catch(d){h=null}}var a=this.getChildValue(o,"*","id",null);var b={title:l,description:m,link:h};var p=new OpenLayers.Feature.Vector(g,b);p.fid=a;return p},getChildValue:function(e,b,d,h){var g;var a=this.getElementsByTagNameNS(e,b,d);if(a&&a[0]&&a[0].firstChild&&a[0].firstChild.nodeValue){g=a[0].firstChild.nodeValue}else{g=(h==undefined)?"":h}return g},read:function(g){if(typeof g=="string"){g=OpenLayers.Format.XML.prototype.read.apply(this,[g])}var a=null;a=this.getElementsByTagNameNS(g,"*","item");if(a.length==0){a=this.getElementsByTagNameNS(g,"*","entry")}var d=a.length;var e=new Array(d);for(var b=0;b<d;b++){e[b]=this.createFeatureFromItem(a[b])}return e},write:function(d){var e;if(d instanceof Array){e=this.createElementNS(this.rssns,"rss");for(var b=0,a=d.length;b<a;b++){e.appendChild(this.createFeatureXML(d[b]))}}else{e=this.createFeatureXML(d)}return OpenLayers.Format.XML.prototype.write.apply(this,[e])},createFeatureXML:function(p){var h=this.buildGeometryNode(p.geometry);var a=this.createElementNS(this.rssns,"item");var e=this.createElementNS(this.rssns,"title");e.appendChild(this.createTextNode(p.attributes.title?p.attributes.title:""));var b=this.createElementNS(this.rssns,"description");b.appendChild(this.createTextNode(p.attributes.description?p.attributes.description:""));a.appendChild(e);a.appendChild(b);if(p.attributes.link){var m=this.createElementNS(this.rssns,"link");m.appendChild(this.createTextNode(p.attributes.link));a.appendChild(m)}for(var o in p.attributes){if(o=="link"||o=="title"||o=="description"){continue}var l=this.createTextNode(p.attributes[o]);var g=o;if(o.search(":")!=-1){g=o.split(":")[1]}var d=this.createElementNS(this.featureNS,"feature:"+g);d.appendChild(l);a.appendChild(d)}a.appendChild(h);return a},buildGeometryNode:function(b){if(this.internalProjection&&this.externalProjection){b=b.clone();b.transform(this.internalProjection,this.externalProjection)}var a;if(b.CLASS_NAME=="OpenLayers.Geometry.Polygon"){a=this.createElementNS(this.georssns,"georss:polygon");a.appendChild(this.buildCoordinatesNode(b.components[0]))}else{if(b.CLASS_NAME=="OpenLayers.Geometry.LineString"){a=this.createElementNS(this.georssns,"georss:line");a.appendChild(this.buildCoordinatesNode(b))}else{if(b.CLASS_NAME=="OpenLayers.Geometry.Point"){a=this.createElementNS(this.georssns,"georss:point");a.appendChild(this.buildCoordinatesNode(b))}else{throw"Couldn't parse "+b.CLASS_NAME}}}return a},buildCoordinatesNode:function(h){var d=null;if(h.components){d=h.components}var g;if(d){var b=d.length;var e=new Array(b);for(var a=0;a<b;a++){e[a]=d[a].y+" "+d[a].x}g=e.join(" ")}else{g=h.y+" "+h.x}return this.createTextNode(g)},CLASS_NAME:"OpenLayers.Format.GeoRSS"});OpenLayers.Format.KML=OpenLayers.Class(OpenLayers.Format.XML,{kmlns:"http://earth.google.com/kml/2.0",placemarksDesc:"No description available",foldersName:"OpenLayers export",foldersDesc:"Exported on "+new Date(),extractAttributes:true,extractStyles:false,internalns:null,features:null,styles:null,styleBaseUrl:"",fetched:null,maxDepth:0,initialize:function(a){this.regExes={trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s*/g),kmlColor:(/(\w{2})(\w{2})(\w{2})(\w{2})/),kmlIconPalette:(/root:\/\/icons\/palette-(\d+)(\.\w+)/),straightBracket:(/\$\[(.*?)\]/g)};OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(b){this.features=[];this.styles={};this.fetched={};var a={depth:0,styleBaseUrl:this.styleBaseUrl};return this.parseData(b,a)},parseData:function(l,d){if(typeof l=="string"){l=OpenLayers.Format.XML.prototype.read.apply(this,[l])}var g=["Link","NetworkLink","Style","StyleMap","Placemark"];for(var e=0,a=g.length;e<a;++e){var h=g[e];var b=this.getElementsByTagNameNS(l,"*",h);if(b.length==0){continue}switch(h.toLowerCase()){case"link":case"networklink":this.parseLinks(b,d);break;case"style":if(this.extractStyles){this.parseStyles(b,d)}break;case"stylemap":if(this.extractStyles){this.parseStyleMaps(b,d)}break;case"placemark":this.parseFeatures(b,d);break}}return this.features},parseLinks:function(d,e){if(e.depth>=this.maxDepth){return false}var l=OpenLayers.Util.extend({},e);l.depth++;for(var g=0,a=d.length;g<a;g++){var b=this.parseProperty(d[g],"*","href");if(b&&!this.fetched[b]){this.fetched[b]=true;var h=this.fetchLink(b);if(h){this.parseData(h,l)}}}},fetchLink:function(a){var b=OpenLayers.Request.GET({url:a,async:false});if(b){return b.responseText}},parseStyles:function(b,d){for(var e=0,a=b.length;e<a;e++){var g=this.parseStyle(b[e]);if(g){styleName=(d.styleBaseUrl||"")+"#"+g.id;this.styles[styleName]=g}}},parseStyle:function(E){var P={};var N=["LineStyle","PolyStyle","IconStyle","BalloonStyle"];var Z,p,q,B;for(var T=0,t=N.length;T<t;++T){Z=N[T];styleTypeNode=this.getElementsByTagNameNS(E,"*",Z)[0];if(!styleTypeNode){continue}switch(Z.toLowerCase()){case"linestyle":var z=this.parseProperty(styleTypeNode,"*","color");if(z){var d=(z.toString()).match(this.regExes.kmlColor);var Q=d[1];P.strokeOpacity=parseInt(Q,16)/255;var Y=d[2];var V=d[3];var O=d[4];P.strokeColor="#"+O+V+Y}var a=this.parseProperty(styleTypeNode,"*","width");if(a){P.strokeWidth=a}case"polystyle":var z=this.parseProperty(styleTypeNode,"*","color");if(z){var d=(z.toString()).match(this.regExes.kmlColor);var Q=d[1];P.fillOpacity=parseInt(Q,16)/255;var Y=d[2];var V=d[3];var O=d[4];P.fillColor="#"+O+V+Y}var s=this.parseProperty(styleTypeNode,"*","fill");if(s=="0"){P.fillColor="none"}break;case"iconstyle":var F=parseFloat(this.parseProperty(styleTypeNode,"*","scale")||1);var a=32*F;var e=32*F;var l=this.getElementsByTagNameNS(styleTypeNode,"*","Icon")[0];if(l){var v=this.parseProperty(l,"*","href");if(v){var M=this.parseProperty(l,"*","w");var U=this.parseProperty(l,"*","h");var o="http://maps.google.com/mapfiles/kml";if(OpenLayers.String.startsWith(v,o)&&!M&&!U){M=64;U=64;F=F/2}M=M||U;U=U||M;if(M){a=parseInt(M)*F}if(U){e=parseInt(U)*F}var d=v.match(this.regExes.kmlIconPalette);if(d){var S=d[1];var u=d[2];var L=this.parseProperty(l,"*","x");var K=this.parseProperty(l,"*","y");var H=L?L/32:0;var G=K?(7-K/32):7;var D=G*8+H;v="http://maps.google.com/mapfiles/kml/pal"+S+"/icon"+D+u}P.graphicOpacity=1;P.externalGraphic=v}}var J=this.getElementsByTagNameNS(styleTypeNode,"*","hotSpot")[0];if(J){var L=parseFloat(J.getAttribute("x"));var K=parseFloat(J.getAttribute("y"));var C=J.getAttribute("xunits");if(C=="pixels"){P.graphicXOffset=-L*F}else{if(C=="insetPixels"){P.graphicXOffset=-a+(L*F)}else{if(C=="fraction"){P.graphicXOffset=-a*L}}}var m=J.getAttribute("yunits");if(m=="pixels"){P.graphicYOffset=-e+(K*F)+1}else{if(m=="insetPixels"){P.graphicYOffset=-(K*F)+1}else{if(m=="fraction"){P.graphicYOffset=-e*(1-K)+1}}}}P.graphicWidth=a;P.graphicHeight=e;break;case"balloonstyle":var W=OpenLayers.Util.getXmlNodeValue(styleTypeNode);if(W){P.balloonStyle=W.replace(this.regExes.straightBracket,"${$1}")}break;default:}}if(!P.strokeColor&&P.fillColor){P.strokeColor=P.fillColor}var I=E.getAttribute("id");if(I&&P){P.id=I}return P},parseStyleMaps:function(a,r){for(var l=0,m=a.length;l<m;l++){var e=a[l];var d=this.getElementsByTagNameNS(e,"*","Pair");var b=e.getAttribute("id");for(var h=0,q=d.length;h<q;h++){var g=d[h];var p=this.parseProperty(g,"*","key");var o=this.parseProperty(g,"*","styleUrl");if(o&&p=="normal"){this.styles[(r.styleBaseUrl||"")+"#"+b]=this.styles[(r.styleBaseUrl||"")+o]}if(o&&p=="highlight"){}}}},parseFeatures:function(a,o){var e=new Array(a.length);for(var g=0,h=a.length;g<h;g++){var b=a[g];var m=this.parseFeature.apply(this,[b]);if(m){if(this.extractStyles&&m.attributes&&m.attributes.styleUrl){m.style=this.getStyle(m.attributes.styleUrl,o)}if(this.extractStyles){var l=this.getElementsByTagNameNS(b,"*","Style")[0];if(l){var d=this.parseStyle(l);if(d){m.style=OpenLayers.Util.extend(m.style,d)}}}e[g]=m}else{throw"Bad Placemark: "+g}}this.features=this.features.concat(e)},parseFeature:function(b){var d=["MultiGeometry","Polygon","LineString","Point"];var o,g,p,a;for(var l=0,m=d.length;l<m;++l){o=d[l];this.internalns=b.namespaceURI?b.namespaceURI:this.kmlns;g=this.getElementsByTagNameNS(b,this.internalns,o);if(g.length>0){var a=this.parseGeometry[o.toLowerCase()];if(a){p=a.apply(this,[g[0]]);if(this.internalProjection&&this.externalProjection){p.transform(this.externalProjection,this.internalProjection)}}else{OpenLayers.Console.error(OpenLayers.i18n("unsupportedGeometryType",{geomType:o}))}break}}var h;if(this.extractAttributes){h=this.parseAttributes(b)}var q=new OpenLayers.Feature.Vector(p,h);var e=b.getAttribute("id")||b.getAttribute("name");if(e!=null){q.fid=e}return q},getStyle:function(b,a){var d=OpenLayers.Util.removeTail(b);var h=OpenLayers.Util.extend({},a);h.depth++;h.styleBaseUrl=d;if(!this.styles[b]&&!OpenLayers.String.startsWith(b,"#")&&h.depth<=this.maxDepth&&!this.fetched[d]){var g=this.fetchLink(d);if(g){this.parseData(g,h)}}var e=OpenLayers.Util.extend({},this.styles[b]);return e},parseGeometry:{point:function(e){var d=this.getElementsByTagNameNS(e,this.internalns,"coordinates");var g=[];if(d.length>0){var b=d[0].firstChild.nodeValue;b=b.replace(this.regExes.removeSpace,"");g=b.split(",")}var a=null;if(g.length>1){if(g.length==2){g[2]=null}a=new OpenLayers.Geometry.Point(g[0],g[1],g[2])}else{throw"Bad coordinate string: "+b}return a},linestring:function(d,g){var e=this.getElementsByTagNameNS(d,this.internalns,"coordinates");var q=null;if(e.length>0){var b=this.getChildValue(e[0]);b=b.replace(this.regExes.trimSpace,"");b=b.replace(this.regExes.trimComma,",");var a=b.split(this.regExes.splitSpace);var m=a.length;var p=new Array(m);var o,l;for(var h=0;h<m;++h){o=a[h].split(",");l=o.length;if(l>1){if(o.length==2){o[2]=null}p[h]=new OpenLayers.Geometry.Point(o[0],o[1],o[2])}else{throw"Bad LineString point coordinates: "+a[h]}}if(m){if(g){q=new OpenLayers.Geometry.LinearRing(p)}else{q=new OpenLayers.Geometry.LineString(p)}}else{throw"Bad LineString coordinates: "+b}}return q},polygon:function(h){var d=this.getElementsByTagNameNS(h,this.internalns,"LinearRing");var l=d.length;var g=new Array(l);if(l>0){var b;for(var e=0,a=d.length;e<a;++e){b=this.parseGeometry.linestring.apply(this,[d[e],true]);if(b){g[e]=b}else{throw"Bad LinearRing geometry: "+e}}}return new OpenLayers.Geometry.Polygon(g)},multigeometry:function(g){var m,l;var h=[];var d=g.childNodes;for(var b=0,a=d.length;b<a;++b){m=d[b];if(m.nodeType==1){var e=(m.prefix)?m.nodeName.split(":")[1]:m.nodeName;var l=this.parseGeometry[e.toLowerCase()];if(l){h.push(l.apply(this,[m]))}}}return new OpenLayers.Geometry.Collection(h)}},parseAttributes:function(e){var g={};var h=e.getElementsByTagName("ExtendedData");if(h.length){g=this.parseExtendedData(h[0])}var b,q,p;var d=e.childNodes;for(var l=0,m=d.length;l<m;++l){b=d[l];if(b.nodeType==1){q=b.childNodes;if(q.length==1||q.length==3){var p;switch(q.length){case 1:p=q[0];break;case 3:default:p=q[1];break}if(p.nodeType==3||p.nodeType==4){var a=(b.prefix)?b.nodeName.split(":")[1]:b.nodeName;var o=OpenLayers.Util.getXmlNodeValue(p);if(o){o=o.replace(this.regExes.trimSpace,"");g[a]=o}}}}}return g},parseExtendedData:function(b){var e={};var d=b.getElementsByTagName("Data");for(var h=0,m=d.length;h<m;h++){var g=d[h];var o=g.getAttribute("name");var l={};var p=g.getElementsByTagName("value");if(p.length){l.value=this.getChildValue(p[0])}var a=g.getElementsByTagName("displayName");if(a.length){l.displayName=this.getChildValue(a[0])}e[o]=l}return e},parseProperty:function(d,g,b){var h;var a=this.getElementsByTagNameNS(d,g,b);try{h=OpenLayers.Util.getXmlNodeValue(a[0])}catch(l){h=null}return h},write:function(e){if(!(e instanceof Array)){e=[e]}var b=this.createElementNS(this.kmlns,"kml");var g=this.createFolderXML();for(var d=0,a=e.length;d<a;++d){g.appendChild(this.createPlacemarkXML(e[d]))}b.appendChild(g);return OpenLayers.Format.XML.prototype.write.apply(this,[b])},createFolderXML:function(){var g=this.createElementNS(this.kmlns,"name");var e=this.createTextNode(this.foldersName);g.appendChild(e);var a=this.createElementNS(this.kmlns,"description");var b=this.createTextNode(this.foldersDesc);a.appendChild(b);var d=this.createElementNS(this.kmlns,"Folder");d.appendChild(g);d.appendChild(a);return d},createPlacemarkXML:function(g){var l=this.createElementNS(this.kmlns,"name");var d=(g.attributes.name)?g.attributes.name:g.id;l.appendChild(this.createTextNode(d));var e=this.createElementNS(this.kmlns,"description");var h=(g.attributes.description)?g.attributes.description:this.placemarksDesc;e.appendChild(this.createTextNode(h));var b=this.createElementNS(this.kmlns,"Placemark");if(g.fid!=null){b.setAttribute("id",g.fid)}b.appendChild(l);b.appendChild(e);var a=this.buildGeometryNode(g.geometry);b.appendChild(a);return b},buildGeometryNode:function(g){if(this.internalProjection&&this.externalProjection){g=g.clone();g.transform(this.internalProjection,this.externalProjection)}var d=g.CLASS_NAME;var b=d.substring(d.lastIndexOf(".")+1);var a=this.buildGeometry[b.toLowerCase()];var e=null;if(a){e=a.apply(this,[g])}return e},buildGeometry:{point:function(b){var a=this.createElementNS(this.kmlns,"Point");a.appendChild(this.buildCoordinatesNode(b));return a},multipoint:function(a){return this.buildGeometry.collection.apply(this,[a])},linestring:function(b){var a=this.createElementNS(this.kmlns,"LineString");a.appendChild(this.buildCoordinatesNode(b));return a},multilinestring:function(a){return this.buildGeometry.collection.apply(this,[a])},linearring:function(b){var a=this.createElementNS(this.kmlns,"LinearRing");a.appendChild(this.buildCoordinatesNode(b));return a},polygon:function(m){var b=this.createElementNS(this.kmlns,"Polygon");var l=m.components;var g,h,e;for(var d=0,a=l.length;d<a;++d){e=(d==0)?"outerBoundaryIs":"innerBoundaryIs";g=this.createElementNS(this.kmlns,e);h=this.buildGeometry.linearring.apply(this,[l[d]]);g.appendChild(h);b.appendChild(g)}return b},multipolygon:function(a){return this.buildGeometry.collection.apply(this,[a])},collection:function(e){var b=this.createElementNS(this.kmlns,"MultiGeometry");var g;for(var d=0,a=e.components.length;d<a;++d){g=this.buildGeometryNode.apply(this,[e.components[d]]);if(g){b.appendChild(g)}}return b}},buildCoordinatesNode:function(g){var a=this.createElementNS(this.kmlns,"coordinates");var o;var m=g.components;if(m){var l;var h=m.length;var d=new Array(h);for(var e=0;e<h;++e){l=m[e];d[e]=l.x+","+l.y}o=d.join(" ")}else{o=g.x+","+g.y}var b=this.createTextNode(o);a.appendChild(b);return a},CLASS_NAME:"OpenLayers.Format.KML"});OpenLayers.Format.OSM=OpenLayers.Class(OpenLayers.Format.XML,{checkTags:false,interestingTagsExclude:null,areaTags:null,initialize:function(a){var e={interestingTagsExclude:["source","source_ref","source:ref","history","attribution","created_by"],areaTags:["area","building","leisure","tourism","ruins","historic","landuse","military","natural","sport"]};e=OpenLayers.Util.extend(e,a);var g={};for(var b=0;b<e.interestingTagsExclude.length;b++){g[e.interestingTagsExclude[b]]=true}e.interestingTagsExclude=g;var d={};for(var b=0;b<e.areaTags.length;b++){d[e.areaTags[b]]=true}e.areaTags=d;OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},read:function(r){if(typeof r=="string"){r=OpenLayers.Format.XML.prototype.read.apply(this,[r])}var b=this.getNodes(r);var s=this.getWays(r);var l=new Array(s.length);for(var h=0;h<s.length;h++){var p=new Array(s[h].nodes.length);var a=this.isWayArea(s[h])?1:0;for(var g=0;g<s[h].nodes.length;g++){var d=b[s[h].nodes[g]];var q=new OpenLayers.Geometry.Point(d.lon,d.lat);q.osm_id=parseInt(s[h].nodes[g]);p[g]=q;d.used=true}var o=null;if(a){o=new OpenLayers.Geometry.Polygon(new OpenLayers.Geometry.LinearRing(p))}else{o=new OpenLayers.Geometry.LineString(p)}if(this.internalProjection&&this.externalProjection){o.transform(this.externalProjection,this.internalProjection)}var m=new OpenLayers.Feature.Vector(o,s[h].tags);m.osm_id=parseInt(s[h].id);m.fid="way."+m.osm_id;l[h]=m}for(var e in b){var d=b[e];if(!d.used||this.checkTags){var u=null;if(this.checkTags){var t=this.getTags(d.node,true);if(d.used&&!t[1]){continue}u=t[0]}else{u=this.getTags(d.node)}var m=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(d.lon,d.lat),u);if(this.internalProjection&&this.externalProjection){m.geometry.transform(this.externalProjection,this.internalProjection)}m.osm_id=parseInt(e);m.fid="node."+m.osm_id;l.push(m)}d.node=null}return l},getNodes:function(g){var e=g.getElementsByTagName("node");var a={};for(var b=0;b<e.length;b++){var d=e[b];var h=d.getAttribute("id");a[h]={lat:d.getAttribute("lat"),lon:d.getAttribute("lon"),node:d}}return a},getWays:function(l){var h=l.getElementsByTagName("way");var m=[];for(var e=0;e<h.length;e++){var b=h[e];var d={id:b.getAttribute("id")};d.tags=this.getTags(b);var g=b.getElementsByTagName("nd");d.nodes=new Array(g.length);for(var a=0;a<g.length;a++){d.nodes[a]=g[a].getAttribute("ref")}m.push(d)}return m},getTags:function(g,l){var a=g.getElementsByTagName("tag");var d={};var h=false;for(var b=0;b<a.length;b++){var e=a[b].getAttribute("k");d[e]=a[b].getAttribute("v");if(l){if(!this.interestingTagsExclude[e]){h=true}}}return l?[d,h]:d},isWayArea:function(b){var a=false;var e=false;if(b.nodes[0]==b.nodes[b.nodes.length-1]){a=true}if(this.checkTags){for(var d in b.tags){if(this.areaTags[d]){e=true;break}}}return a&&(this.checkTags?e:true)},write:function(e){if(!(e instanceof Array)){e=[e]}this.osm_id=1;this.created_nodes={};var g=this.createElementNS(null,"osm");g.setAttribute("version","0.5");g.setAttribute("generator","OpenLayers "+OpenLayers.VERSION_NUMBER);for(var d=e.length-1;d>=0;d--){var a=this.createFeatureNodes(e[d]);for(var b=0;b<a.length;b++){g.appendChild(a[b])}}return OpenLayers.Format.XML.prototype.write.apply(this,[g])},createFeatureNodes:function(d){var b=[];var g=d.geometry.CLASS_NAME;var e=g.substring(g.lastIndexOf(".")+1);e=e.toLowerCase();var a=this.createXML[e];if(a){b=a.apply(this,[d])}return b},createXML:{point:function(a){var g=null;var d=a.geometry?a.geometry:a;var e=false;if(a.osm_id){g=a.osm_id;if(this.created_nodes[g]){e=true}}else{g=-this.osm_id;this.osm_id++}if(e){b=this.created_nodes[g]}else{var b=this.createElementNS(null,"node")}this.created_nodes[g]=b;b.setAttribute("id",g);b.setAttribute("lon",d.x);b.setAttribute("lat",d.y);if(a.attributes){this.serializeTags(a,b)}this.setState(a,b);return e?[]:[b]},linestring:function(e){var a=[];var m=e.geometry;if(e.osm_id){id=e.osm_id}else{id=-this.osm_id;this.osm_id++}var b=this.createElementNS(null,"way");b.setAttribute("id",id);for(var d=0;d<m.components.length;d++){var h=this.createXML.point.apply(this,[m.components[d]]);if(h.length){h=h[0];var g=h.getAttribute("id");a.push(h)}else{g=m.components[d].osm_id;h=this.created_nodes[g]}this.setState(e,h);var l=this.createElementNS(null,"nd");l.setAttribute("ref",g);b.appendChild(l)}this.serializeTags(e,b);a.push(b);return a},polygon:function(b){var a=OpenLayers.Util.extend({area:"yes"},b.attributes);var d=new OpenLayers.Feature.Vector(b.geometry.components[0],a);d.osm_id=b.osm_id;return this.createXML.linestring.apply(this,[d])}},serializeTags:function(d,e){for(var b in d.attributes){var a=this.createElementNS(null,"tag");a.setAttribute("k",b);a.setAttribute("v",d.attributes[b]);e.appendChild(a)}},setState:function(a,b){if(a.state){var d=null;switch(a.state){case OpenLayers.State.UPDATE:d="modify";case OpenLayers.State.DELETE:d="delete"}if(d){b.setAttribute("action",d)}}},CLASS_NAME:"OpenLayers.Format.OSM"});OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Polygon"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Geometry.MultiPolygon"});OpenLayers.Handler.Polygon=OpenLayers.Class(OpenLayers.Handler.Path,{polygon:null,initialize:function(d,b,a){OpenLayers.Handler.Path.prototype.initialize.apply(this,arguments)},createFeature:function(a){var b=this.control.map.getLonLatFromPixel(a);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat));this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LinearRing([this.point.geometry]));this.polygon=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([this.line.geometry]));this.callback("create",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.polygon,this.point],{silent:true})},destroyFeature:function(){OpenLayers.Handler.Path.prototype.destroyFeature.apply(this);this.polygon=null},drawFeature:function(){this.layer.drawFeature(this.polygon,this.style);this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.polygon},getGeometry:function(){var a=this.polygon&&this.polygon.geometry;if(a&&this.multi){a=new OpenLayers.Geometry.MultiPolygon([a])}return a},dblclick:function(a){if(!this.freehandMode(a)){var b=this.line.geometry.components.length-2;this.line.geometry.removeComponent(this.line.geometry.components[b]);this.removePoint();this.finalize()}return false},CLASS_NAME:"OpenLayers.Handler.Polygon"});OpenLayers.Control.EditingToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(d,b){OpenLayers.Control.Panel.prototype.initialize.apply(this,[b]);this.addControls([new OpenLayers.Control.Navigation()]);var a=[new OpenLayers.Control.DrawFeature(d,OpenLayers.Handler.Point,{displayClass:"olControlDrawFeaturePoint"}),new OpenLayers.Control.DrawFeature(d,OpenLayers.Handler.Path,{displayClass:"olControlDrawFeaturePath"}),new OpenLayers.Control.DrawFeature(d,OpenLayers.Handler.Polygon,{displayClass:"olControlDrawFeaturePolygon"})];this.addControls(a)},draw:function(){var a=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);this.activateControl(this.controls[0]);return a},CLASS_NAME:"OpenLayers.Control.EditingToolbar"});OpenLayers.Format.ArcXML=OpenLayers.Class(OpenLayers.Format.XML,{fontStyleKeys:["antialiasing","blockout","font","fontcolor","fontsize","fontstyle","glowing","interval","outline","printmode","shadow","transparency"],request:null,response:null,initialize:function(a){this.request=new OpenLayers.Format.ArcXML.Request();this.response=new OpenLayers.Format.ArcXML.Response();if(a){if(a.requesttype=="feature"){this.request.get_image=null;var d=this.request.get_feature.query;this.addCoordSys(d.featurecoordsys,a.featureCoordSys);this.addCoordSys(d.filtercoordsys,a.filterCoordSys);if(a.polygon){d.isspatial=true;d.spatialfilter.polygon=a.polygon}else{if(a.envelope){d.isspatial=true;d.spatialfilter.envelope={minx:0,miny:0,maxx:0,maxy:0};this.parseEnvelope(d.spatialfilter.envelope,a.envelope)}}}else{if(a.requesttype=="image"){this.request.get_feature=null;var b=this.request.get_image.properties;this.parseEnvelope(b.envelope,a.envelope);this.addLayers(b.layerlist,a.layers);this.addImageSize(b.imagesize,a.tileSize);this.addCoordSys(b.featurecoordsys,a.featureCoordSys);this.addCoordSys(b.filtercoordsys,a.filterCoordSys)}else{this.request=null}}}OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},parseEnvelope:function(b,a){if(a&&a.length==4){b.minx=a[0];b.miny=a[1];b.maxx=a[2];b.maxy=a[3]}},addLayers:function(e,d){for(var b=0,a=d.length;b<a;b++){e.push(d[b])}},addImageSize:function(b,a){if(a!==null){b.width=a.w;b.height=a.h;b.printwidth=a.w;b.printheight=a.h}},addCoordSys:function(a,b){if(typeof b=="string"){a.id=parseInt(b);a.string=b}else{if(typeof b=="object"&&b.proj!==null){a.id=b.proj.srsProjNumber;a.string=b.proj.srsCode}else{a=b}}},iserror:function(d){var a=null;if(!d){a=(this.response.error!=="")}else{d=OpenLayers.Format.XML.prototype.read.apply(this,[d]);var b=d.documentElement.getElementsByTagName("ERROR");a=(b!==null&&b.length>0)}return a},read:function(h){if(typeof h=="string"){h=OpenLayers.Format.XML.prototype.read.apply(this,[h])}var a=null;if(h&&h.documentElement){if(h.documentElement.nodeName=="ARCXML"){a=h.documentElement}else{a=h.documentElement.getElementsByTagName("ARCXML")[0]}}if(!a){var d,g;try{d=h.firstChild.nodeValue;g=h.firstChild.childNodes[1].firstChild.nodeValue}catch(e){}throw {message:"Error parsing the ArcXML request",error:d,source:g}}var b=this.parseResponse(a);return b},write:function(d){if(!d){d=this.request}var w=this.createElementNS("","ARCXML");w.setAttribute("version","1.1");var m=this.createElementNS("","REQUEST");if(d.get_image!=null){var q=this.createElementNS("","GET_IMAGE");m.appendChild(q);var p=this.createElementNS("","PROPERTIES");q.appendChild(p);var b=d.get_image.properties;if(b.featurecoordsys!=null){var u=this.createElementNS("","FEATURECOORDSYS");p.appendChild(u);if(b.featurecoordsys.id===0){u.setAttribute("string",b.featurecoordsys.string)}else{u.setAttribute("id",b.featurecoordsys.id)}}if(b.filtercoordsys!=null){var s=this.createElementNS("","FILTERCOORDSYS");p.appendChild(s);if(b.filtercoordsys.id===0){s.setAttribute("string",b.filtercoordsys.string)}else{s.setAttribute("id",b.filtercoordsys.id)}}if(b.envelope!=null){var D=this.createElementNS("","ENVELOPE");p.appendChild(D);D.setAttribute("minx",b.envelope.minx);D.setAttribute("miny",b.envelope.miny);D.setAttribute("maxx",b.envelope.maxx);D.setAttribute("maxy",b.envelope.maxy)}var B=this.createElementNS("","IMAGESIZE");p.appendChild(B);B.setAttribute("height",b.imagesize.height);B.setAttribute("width",b.imagesize.width);if(b.imagesize.height!=b.imagesize.printheight||b.imagesize.width!=b.imagesize.printwidth){B.setAttribute("printheight",b.imagesize.printheight);B.setArrtibute("printwidth",b.imagesize.printwidth)}if(b.background!=null){var a=this.createElementNS("","BACKGROUND");p.appendChild(a);a.setAttribute("color",b.background.color.r+","+b.background.color.g+","+b.background.color.b);if(b.background.transcolor!==null){a.setAttribute("transcolor",b.background.transcolor.r+","+b.background.transcolor.g+","+b.background.transcolor.b)}}if(b.layerlist!=null&&b.layerlist.length>0){var l=this.createElementNS("","LAYERLIST");p.appendChild(l);for(var v=0;v<b.layerlist.length;v++){var t=this.createElementNS("","LAYERDEF");l.appendChild(t);t.setAttribute("id",b.layerlist[v].id);t.setAttribute("visible",b.layerlist[v].visible);if(typeof b.layerlist[v].query=="object"){var h=b.layerlist[v].query;if(h.where.length<0){continue}var G=null;if(typeof h.spatialfilter=="boolean"&&h.spatialfilter){G=this.createElementNS("","SPATIALQUERY")}else{G=this.createElementNS("","QUERY")}G.setAttribute("where",h.where);if(typeof h.accuracy=="number"&&h.accuracy>0){G.setAttribute("accuracy",h.accuracy)}if(typeof h.featurelimit=="number"&&h.featurelimit<2000){G.setAttribute("featurelimit",h.featurelimit)}if(typeof h.subfields=="string"&&h.subfields!="#ALL#"){G.setAttribute("subfields",h.subfields)}if(typeof h.joinexpression=="string"&&h.joinexpression.length>0){G.setAttribute("joinexpression",h.joinexpression)}if(typeof h.jointables=="string"&&h.jointables.length>0){G.setAttribute("jointables",h.jointables)}t.appendChild(G)}if(typeof b.layerlist[v].renderer=="object"){this.addRenderer(t,b.layerlist[v].renderer)}}}}else{if(d.get_feature!=null){var q=this.createElementNS("","GET_FEATURES");q.setAttribute("outputmode","newxml");q.setAttribute("checkesc","true");if(d.get_feature.geometry){q.setAttribute("geometry",d.get_feature.geometry)}else{q.setAttribute("geometry","false")}if(d.get_feature.compact){q.setAttribute("compact",d.get_feature.compact)}if(d.get_feature.featurelimit=="number"){q.setAttribute("featurelimit",d.get_feature.featurelimit)}q.setAttribute("globalenvelope","true");m.appendChild(q);if(d.get_feature.layer!=null&&d.get_feature.layer.length>0){var E=this.createElementNS("","LAYER");E.setAttribute("id",d.get_feature.layer);q.appendChild(E)}var z=d.get_feature.query;if(z!=null){var C=null;if(z.isspatial){C=this.createElementNS("","SPATIALQUERY")}else{C=this.createElementNS("","QUERY")}q.appendChild(C);if(typeof z.accuracy=="number"){C.setAttribute("accuracy",z.accuracy)}if(z.featurecoordsys!=null){var g=this.createElementNS("","FEATURECOORDSYS");if(z.featurecoordsys.id==0){g.setAttribute("string",z.featurecoordsys.string)}else{g.setAttribute("id",z.featurecoordsys.id)}C.appendChild(g)}if(z.filtercoordsys!=null){var e=this.createElementNS("","FILTERCOORDSYS");if(z.filtercoordsys.id===0){e.setAttribute("string",z.filtercoordsys.string)}else{e.setAttribute("id",z.filtercoordsys.id)}C.appendChild(e)}if(z.buffer>0){var r=this.createElementNS("","BUFFER");r.setAttribute("distance",z.buffer);C.appendChild(r)}if(z.isspatial){var o=this.createElementNS("","SPATIALFILTER");o.setAttribute("relation",z.spatialfilter.relation);C.appendChild(o);if(z.spatialfilter.envelope){var F=this.createElementNS("","ENVELOPE");F.setAttribute("minx",z.spatialfilter.envelope.minx);F.setAttribute("miny",z.spatialfilter.envelope.miny);F.setAttribute("maxx",z.spatialfilter.envelope.maxx);F.setAttribute("maxy",z.spatialfilter.envelope.maxy);o.appendChild(F)}else{if(typeof z.spatialfilter.polygon=="object"){o.appendChild(this.writePolygonGeometry(z.spatialfilter.polygon))}}}if(z.where!=null&&z.where.length>0){C.setAttribute("where",z.where)}}}}w.appendChild(m);return OpenLayers.Format.XML.prototype.write.apply(this,[w])},addGroupRenderer:function(b,a){var g=this.createElementNS("","GROUPRENDERER");b.appendChild(g);for(var d=0;d<a.length;d++){var e=a[d];this.addRenderer(g,e)}},addRenderer:function(d,b){if(b instanceof Array){this.addGroupRenderer(d,b)}else{var a=this.createElementNS("",b.type.toUpperCase()+"RENDERER");d.appendChild(a);if(a.tagName=="VALUEMAPRENDERER"){this.addValueMapRenderer(a,b)}else{if(a.tagName=="VALUEMAPLABELRENDERER"){this.addValueMapLabelRenderer(a,b)}else{if(a.tagName=="SIMPLELABELRENDERER"){this.addSimpleLabelRenderer(a,b)}else{if(a.tagName=="SCALEDEPENDENTRENDERER"){this.addScaleDependentRenderer(a,b)}}}}}},addScaleDependentRenderer:function(a,b){if(typeof b.lower=="string"||typeof b.lower=="number"){a.setAttribute("lower",b.lower)}if(typeof b.upper=="string"||typeof b.upper=="number"){a.setAttribute("upper",b.upper)}this.addRenderer(a,b.renderer)},addValueMapLabelRenderer:function(m,l){m.setAttribute("lookupfield",l.lookupfield);m.setAttribute("labelfield",l.labelfield);if(typeof l.exacts=="object"){for(var a=0,p=l.exacts.length;a<p;a++){var g=l.exacts[a];var e=this.createElementNS("","EXACT");if(typeof g.value=="string"){e.setAttribute("value",g.value)}if(typeof g.label=="string"){e.setAttribute("label",g.label)}if(typeof g.method=="string"){e.setAttribute("method",g.method)}m.appendChild(e);if(typeof g.symbol=="object"){var b=null;if(g.symbol.type=="text"){b=this.createElementNS("","TEXTSYMBOL")}if(b!=null){var q=this.fontStyleKeys;for(var d=0,h=q.length;d<h;d++){var o=q[d];if(g.symbol[o]){b.setAttribute(o,g.symbol[o])}}e.appendChild(b)}}}}},addValueMapRenderer:function(p,o){p.setAttribute("lookupfield",o.lookupfield);if(typeof o.ranges=="object"){for(var a=0,b=o.ranges.length;a<b;a++){var l=o.ranges[a];var g=this.createElementNS("","RANGE");g.setAttribute("lower",l.lower);g.setAttribute("upper",l.upper);p.appendChild(g);if(typeof l.symbol=="object"){var e=null;if(l.symbol.type=="simplepolygon"){e=this.createElementNS("","SIMPLEPOLYGONSYMBOL")}if(e!=null){if(typeof l.symbol.boundarycolor=="string"){e.setAttribute("boundarycolor",l.symbol.boundarycolor)}if(typeof l.symbol.fillcolor=="string"){e.setAttribute("fillcolor",l.symbol.fillcolor)}if(typeof l.symbol.filltransparency=="number"){e.setAttribute("filltransparency",l.symbol.filltransparency)}g.appendChild(e)}}}}else{if(typeof o.exacts=="object"){for(var d=0,q=o.exacts.length;d<q;d++){var m=o.exacts[d];var h=this.createElementNS("","EXACT");if(typeof m.value=="string"){h.setAttribute("value",m.value)}if(typeof m.label=="string"){h.setAttribute("label",m.label)}if(typeof m.method=="string"){h.setAttribute("method",m.method)}p.appendChild(h);if(typeof m.symbol=="object"){var e=null;if(m.symbol.type=="simplemarker"){e=this.createElementNS("","SIMPLEMARKERSYMBOL")}if(e!=null){if(typeof m.symbol.antialiasing=="string"){e.setAttribute("antialiasing",m.symbol.antialiasing)}if(typeof m.symbol.color=="string"){e.setAttribute("color",m.symbol.color)}if(typeof m.symbol.outline=="string"){e.setAttribute("outline",m.symbol.outline)}if(typeof m.symbol.overlap=="string"){e.setAttribute("overlap",m.symbol.overlap)}if(typeof m.symbol.shadow=="string"){e.setAttribute("shadow",m.symbol.shadow)}if(typeof m.symbol.transparency=="number"){e.setAttribute("transparency",m.symbol.transparency)}if(typeof m.symbol.usecentroid=="string"){e.setAttribute("usecentroid",m.symbol.usecentroid)}if(typeof m.symbol.width=="number"){e.setAttribute("width",m.symbol.width)}h.appendChild(e)}}}}}},addSimpleLabelRenderer:function(h,m){h.setAttribute("field",m.field);var g=["featureweight","howmanylabels","labelbufferratio","labelpriorities","labelweight","linelabelposition","rotationalangles"];for(var e=0,a=g.length;e<a;e++){var d=g[e];if(m[d]){h.setAttribute(d,m[d])}}if(m.symbol.type=="text"){var l=m.symbol;var b=this.createElementNS("","TEXTSYMBOL");h.appendChild(b);var g=this.fontStyleKeys;for(var e=0,a=g.length;e<a;e++){var d=g[e];if(l[d]){b.setAttribute(d,m[d])}}}},writePolygonGeometry:function(l){if(!(l instanceof OpenLayers.Geometry.Polygon)){throw {message:"Cannot write polygon geometry to ArcXML with an "+l.CLASS_NAME+" object.",geometry:l}}var b=this.createElementNS("","POLYGON");for(var g=0,d=l.components.length;g<d;g++){var a=l.components[g];var o=this.createElementNS("","RING");for(var e=0,p=a.components.length;e<p;e++){var m=a.components[e];var h=this.createElementNS("","POINT");h.setAttribute("x",m.x);h.setAttribute("y",m.y);o.appendChild(h)}b.appendChild(o)}return b},parseResponse:function(I){if(typeof I=="string"){var t=new OpenLayers.Format.XML();I=t.read(I)}var a=new OpenLayers.Format.ArcXML.Response();var J=I.getElementsByTagName("ERROR");if(J!=null&&J.length>0){a.error=this.getChildValue(J,"Unknown error.")}else{var z=I.getElementsByTagName("RESPONSE");if(z==null||z.length==0){a.error="No RESPONSE tag found in ArcXML response.";return a}var w=z[0].firstChild.nodeName;if(w=="#text"){w=z[0].firstChild.nextSibling.nodeName}if(w=="IMAGE"){var d=I.getElementsByTagName("ENVELOPE");var F=I.getElementsByTagName("OUTPUT");if(d==null||d.length==0){a.error="No ENVELOPE tag found in ArcXML response."}else{if(F==null||F.length==0){a.error="No OUTPUT tag found in ArcXML response."}else{var D=this.parseAttributes(d[0]);var E=this.parseAttributes(F[0]);if(typeof E.type=="string"){a.image={envelope:D,output:{type:E.type,data:this.getChildValue(F[0])}}}else{a.image={envelope:D,output:E}}}}}else{if(w=="FEATURES"){var o=z[0].getElementsByTagName("FEATURES");var v=o[0].getElementsByTagName("FEATURECOUNT");a.features.featurecount=v[0].getAttribute("count");if(a.features.featurecount>0){var e=o[0].getElementsByTagName("ENVELOPE");a.features.envelope=this.parseAttributes(e[0],typeof(0));var G=o[0].getElementsByTagName("FEATURE");for(var s=0;s<G.length;s++){var m=new OpenLayers.Feature.Vector();var B=G[s].getElementsByTagName("FIELD");for(var h=0;h<B.length;h++){var l=B[h].getAttribute("name");var q=B[h].getAttribute("value");m.attributes[l]=q}var C=G[s].getElementsByTagName("POLYGON");if(C.length>0){var p=C[0].getElementsByTagName("RING");var g=[];for(var u=0;u<p.length;u++){var H=[];H.push(this.parsePointGeometry(p[u]));var r=p[u].getElementsByTagName("HOLE");for(var b=0;b<r.length;b++){H.push(this.parsePointGeometry(r[b]))}r=null;g.push(new OpenLayers.Geometry.Polygon(H));H=null}p=null;if(g.length==1){m.geometry=g[0]}else{m.geometry=new OpenLayers.Geometry.MultiPolygon(g)}}a.features.feature.push(m)}}}else{a.error="Unidentified response type."}}}return a},parseAttributes:function(e,d){var b={};for(var a=0;a<e.attributes.length;a++){if(d=="number"){b[e.attributes[a].nodeName]=parseFloat(e.attributes[a].nodeValue)}else{b[e.attributes[a].nodeName]=e.attributes[a].nodeValue}}return b},parsePointGeometry:function(e){var b=[];var g=e.getElementsByTagName("COORDS");if(g.length>0){var h=this.getChildValue(g[0]);h=h.split(/;/);for(var m=0;m<h.length;m++){var l=h[m].split(/ /);b.push(new OpenLayers.Geometry.Point(parseFloat(l[0]),parseFloat(l[1])))}g=null}else{var a=e.getElementsByTagName("POINT");if(a.length>0){for(var d=0;d<a.length;d++){b.push(new OpenLayers.Geometry.Point(parseFloat(a[d].getAttribute("x")),parseFloat(a[d].getAttribute("y"))))}}a=null}return new OpenLayers.Geometry.LinearRing(b)},CLASS_NAME:"OpenLayers.Format.ArcXML"});OpenLayers.Format.ArcXML.Request=OpenLayers.Class({initialize:function(b){var a={get_image:{properties:{background:null,draw:true,envelope:{minx:0,miny:0,maxx:0,maxy:0},featurecoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},filtercoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},imagesize:{height:0,width:0,dpi:96,printheight:0,printwidth:0,scalesymbols:false},layerlist:[],output:{baseurl:"",legendbaseurl:"",legendname:"",legendpath:"",legendurl:"",name:"",path:"",type:"jpg",url:""}}},get_feature:{layer:"",query:{isspatial:false,featurecoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},filtercoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},buffer:0,where:"",spatialfilter:{relation:"envelope_intersection",envelope:null}}},environment:{separators:{cs:" ",ts:";"}},layer:[],workspaces:[]};return OpenLayers.Util.extend(this,a)},CLASS_NAME:"OpenLayers.Format.ArcXML.Request"});OpenLayers.Format.ArcXML.Response=OpenLayers.Class({initialize:function(b){var a={image:{envelope:null,output:""},features:{featurecount:0,envelope:null,feature:[]},error:""};return OpenLayers.Util.extend(this,a)},CLASS_NAME:"OpenLayers.Format.ArcXML.Response"});OpenLayers.Format.GML=OpenLayers.Class(OpenLayers.Format.XML,{featureNS:"http://mapserver.gis.umn.edu/mapserver",featurePrefix:"feature",featureName:"featureMember",layerName:"features",geometryName:"geometry",collectionName:"FeatureCollection",gmlns:"http://www.opengis.net/gml",extractAttributes:true,xy:true,initialize:function(a){this.regExes={trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s*/g)};OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(e){if(typeof e=="string"){e=OpenLayers.Format.XML.prototype.read.apply(this,[e])}var g=this.getElementsByTagNameNS(e.documentElement,this.gmlns,this.featureName);var d=[];for(var b=0;b<g.length;b++){var a=this.parseFeature(g[b]);if(a){d.push(a)}}return d},parseFeature:function(d){var e=["MultiPolygon","Polygon","MultiLineString","LineString","MultiPoint","Point","Envelope","Box"];var o,h,p,b;for(var m=0;m<e.length;++m){o=e[m];h=this.getElementsByTagNameNS(d,this.gmlns,o);if(h.length>0){var b=this.parseGeometry[o.toLowerCase()];if(b){p=b.apply(this,[h[0]]);if(this.internalProjection&&this.externalProjection){p.transform(this.externalProjection,this.internalProjection)}}else{OpenLayers.Console.error(OpenLayers.i18n("unsupportedGeometryType",{geomType:o}))}break}}var l;if(this.extractAttributes){l=this.parseAttributes(d)}var q=new OpenLayers.Feature.Vector(p,l);q.gml={featureType:d.firstChild.nodeName.split(":")[1],featureNS:d.firstChild.namespaceURI,featureNSPrefix:d.firstChild.prefix};var a=d.firstChild;var g;while(a){if(a.nodeType==1){g=a.getAttribute("fid")||a.getAttribute("id");if(g){break}}a=a.nextSibling}q.fid=g;return q},parseGeometry:{point:function(e){var b,a;var g=[];var b=this.getElementsByTagNameNS(e,this.gmlns,"pos");if(b.length>0){a=b[0].firstChild.nodeValue;a=a.replace(this.regExes.trimSpace,"");g=a.split(this.regExes.splitSpace)}if(g.length==0){b=this.getElementsByTagNameNS(e,this.gmlns,"coordinates");if(b.length>0){a=b[0].firstChild.nodeValue;a=a.replace(this.regExes.removeSpace,"");g=a.split(",")}}if(g.length==0){b=this.getElementsByTagNameNS(e,this.gmlns,"coord");if(b.length>0){var h=this.getElementsByTagNameNS(b[0],this.gmlns,"X");var d=this.getElementsByTagNameNS(b[0],this.gmlns,"Y");if(h.length>0&&d.length>0){g=[h[0].firstChild.nodeValue,d[0].firstChild.nodeValue]}}}if(g.length==2){g[2]=null}if(this.xy){return new OpenLayers.Geometry.Point(g[0],g[1],g[2])}else{return new OpenLayers.Geometry.Point(g[1],g[0],g[2])}},multipoint:function(g){var b=this.getElementsByTagNameNS(g,this.gmlns,"Point");var e=[];if(b.length>0){var a;for(var d=0;d<b.length;++d){a=this.parseGeometry.point.apply(this,[b[d]]);if(a){e.push(a)}}}return new OpenLayers.Geometry.MultiPoint(e)},linestring:function(d,g){var e,b;var r=[];var s=[];e=this.getElementsByTagNameNS(d,this.gmlns,"posList");if(e.length>0){b=this.getChildValue(e[0]);b=b.replace(this.regExes.trimSpace,"");r=b.split(this.regExes.splitSpace);var m=parseInt(e[0].getAttribute("dimension"));var h,q,p,o;for(var l=0;l<r.length/m;++l){h=l*m;q=r[h];p=r[h+1];o=(m==2)?null:r[h+2];if(this.xy){s.push(new OpenLayers.Geometry.Point(q,p,o))}else{s.push(new OpenLayers.Geometry.Point(p,q,o))}}}if(r.length==0){e=this.getElementsByTagNameNS(d,this.gmlns,"coordinates");if(e.length>0){b=this.getChildValue(e[0]);b=b.replace(this.regExes.trimSpace,"");b=b.replace(this.regExes.trimComma,",");var a=b.split(this.regExes.splitSpace);for(var l=0;l<a.length;++l){r=a[l].split(",");if(r.length==2){r[2]=null}if(this.xy){s.push(new OpenLayers.Geometry.Point(r[0],r[1],r[2]))}else{s.push(new OpenLayers.Geometry.Point(r[1],r[0],r[2]))}}}}var t=null;if(s.length!=0){if(g){t=new OpenLayers.Geometry.LinearRing(s)}else{t=new OpenLayers.Geometry.LineString(s)}}return t},multilinestring:function(g){var b=this.getElementsByTagNameNS(g,this.gmlns,"LineString");var e=[];if(b.length>0){var a;for(var d=0;d<b.length;++d){a=this.parseGeometry.linestring.apply(this,[b[d]]);if(a){e.push(a)}}}return new OpenLayers.Geometry.MultiLineString(e)},polygon:function(g){var b=this.getElementsByTagNameNS(g,this.gmlns,"LinearRing");var e=[];if(b.length>0){var a;for(var d=0;d<b.length;++d){a=this.parseGeometry.linestring.apply(this,[b[d],true]);if(a){e.push(a)}}}return new OpenLayers.Geometry.Polygon(e)},multipolygon:function(g){var a=this.getElementsByTagNameNS(g,this.gmlns,"Polygon");var e=[];if(a.length>0){var d;for(var b=0;b<a.length;++b){d=this.parseGeometry.polygon.apply(this,[a[b]]);if(d){e.push(d)}}}return new OpenLayers.Geometry.MultiPolygon(e)},envelope:function(b){var g=[];var a;var h;var p=this.getElementsByTagNameNS(b,this.gmlns,"lowerCorner");if(p.length>0){var m=[];if(p.length>0){a=p[0].firstChild.nodeValue;a=a.replace(this.regExes.trimSpace,"");m=a.split(this.regExes.splitSpace)}if(m.length==2){m[2]=null}if(this.xy){var e=new OpenLayers.Geometry.Point(m[0],m[1],m[2])}else{var e=new OpenLayers.Geometry.Point(m[1],m[0],m[2])}}var l=this.getElementsByTagNameNS(b,this.gmlns,"upperCorner");if(l.length>0){var m=[];if(l.length>0){a=l[0].firstChild.nodeValue;a=a.replace(this.regExes.trimSpace,"");m=a.split(this.regExes.splitSpace)}if(m.length==2){m[2]=null}if(this.xy){var o=new OpenLayers.Geometry.Point(m[0],m[1],m[2])}else{var o=new OpenLayers.Geometry.Point(m[1],m[0],m[2])}}if(e&&o){g.push(new OpenLayers.Geometry.Point(e.x,e.y));g.push(new OpenLayers.Geometry.Point(o.x,e.y));g.push(new OpenLayers.Geometry.Point(o.x,o.y));g.push(new OpenLayers.Geometry.Point(e.x,o.y));g.push(new OpenLayers.Geometry.Point(e.x,e.y));var d=new OpenLayers.Geometry.LinearRing(g);h=new OpenLayers.Geometry.Polygon([d])}return h}},parseAttributes:function(g){var h={};var a=g.firstChild;var e,l,d,p,o,b,m;while(a){if(a.nodeType==1){e=a.childNodes;for(l=0;l<e.length;++l){d=e[l];if(d.nodeType==1){p=d.childNodes;if(p.length==1){o=p[0];if(o.nodeType==3||o.nodeType==4){b=(d.prefix)?d.nodeName.split(":")[1]:d.nodeName;m=o.nodeValue.replace(this.regExes.trimSpace,"");h[b]=m}}else{h[d.nodeName.split(":").pop()]=null}}}break}a=a.nextSibling}return h},write:function(d){if(!(d instanceof Array)){d=[d]}var b=this.createElementNS("http://www.opengis.net/wfs","wfs:"+this.collectionName);for(var a=0;a<d.length;a++){b.appendChild(this.createFeatureXML(d[a]))}return OpenLayers.Format.XML.prototype.write.apply(this,[b])},createFeatureXML:function(p){var m=p.geometry;var g=this.buildGeometryNode(m);var o=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.geometryName);o.appendChild(g);var a=this.createElementNS(this.gmlns,"gml:"+this.featureName);var q=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.layerName);var d=p.fid||p.id;q.setAttribute("fid",d);q.appendChild(o);for(var l in p.attributes){var h=this.createTextNode(p.attributes[l]);var e=l.substring(l.lastIndexOf(":")+1);var b=this.createElementNS(this.featureNS,this.featurePrefix+":"+e);b.appendChild(h);q.appendChild(b)}a.appendChild(q);return a},buildGeometryNode:function(e){if(this.externalProjection&&this.internalProjection){e=e.clone();e.transform(this.internalProjection,this.externalProjection)}var d=e.CLASS_NAME;var b=d.substring(d.lastIndexOf(".")+1);var a=this.buildGeometry[b.toLowerCase()];return a.apply(this,[e])},buildGeometry:{point:function(b){var a=this.createElementNS(this.gmlns,"gml:Point");a.appendChild(this.buildCoordinatesNode(b));return a},multipoint:function(h){var e=this.createElementNS(this.gmlns,"gml:MultiPoint");var d=h.components;var b,g;for(var a=0;a<d.length;a++){b=this.createElementNS(this.gmlns,"gml:pointMember");g=this.buildGeometry.point.apply(this,[d[a]]);b.appendChild(g);e.appendChild(b)}return e},linestring:function(b){var a=this.createElementNS(this.gmlns,"gml:LineString");a.appendChild(this.buildCoordinatesNode(b));return a},multilinestring:function(h){var e=this.createElementNS(this.gmlns,"gml:MultiLineString");var a=h.components;var d,g;for(var b=0;b<a.length;++b){d=this.createElementNS(this.gmlns,"gml:lineStringMember");g=this.buildGeometry.linestring.apply(this,[a[b]]);d.appendChild(g);e.appendChild(d)}return e},linearring:function(b){var a=this.createElementNS(this.gmlns,"gml:LinearRing");a.appendChild(this.buildCoordinatesNode(b));return a},polygon:function(l){var e=this.createElementNS(this.gmlns,"gml:Polygon");var h=l.components;var d,g,b;for(var a=0;a<h.length;++a){b=(a==0)?"outerBoundaryIs":"innerBoundaryIs";d=this.createElementNS(this.gmlns,"gml:"+b);g=this.buildGeometry.linearring.apply(this,[h[a]]);d.appendChild(g);e.appendChild(d)}return e},multipolygon:function(h){var e=this.createElementNS(this.gmlns,"gml:MultiPolygon");var a=h.components;var g,b;for(var d=0;d<a.length;++d){g=this.createElementNS(this.gmlns,"gml:polygonMember");b=this.buildGeometry.polygon.apply(this,[a[d]]);g.appendChild(b);e.appendChild(g)}return e},bounds:function(b){var a=this.createElementNS(this.gmlns,"gml:Box");a.appendChild(this.buildCoordinatesNode(b));return a}},buildCoordinatesNode:function(h){var a=this.createElementNS(this.gmlns,"gml:coordinates");a.setAttribute("decimal",".");a.setAttribute("cs",",");a.setAttribute("ts"," ");var g=[];if(h instanceof OpenLayers.Bounds){g.push(h.left+","+h.bottom);g.push(h.right+","+h.top)}else{var d=(h.components)?h.components:[h];for(var b=0;b<d.length;b++){g.push(d[b].x+","+d[b].y)}}var e=this.createTextNode(g.join(" "));a.appendChild(e);return a},CLASS_NAME:"OpenLayers.Format.GML"});OpenLayers.Format.GeoJSON=OpenLayers.Class(OpenLayers.Format.JSON,{initialize:function(a){OpenLayers.Format.JSON.prototype.initialize.apply(this,[a])},read:function(o,l,a){l=(l)?l:"FeatureCollection";var e=null;var d=null;if(typeof o=="string"){d=OpenLayers.Format.JSON.prototype.read.apply(this,[o,a])}else{d=o}if(!d){OpenLayers.Console.error("Bad JSON: "+o)}else{if(typeof(d.type)!="string"){OpenLayers.Console.error("Bad GeoJSON - no type: "+o)}else{if(this.isValidType(d,l)){switch(l){case"Geometry":try{e=this.parseGeometry(d)}catch(b){OpenLayers.Console.error(b)}break;case"Feature":try{e=this.parseFeature(d);e.type="Feature"}catch(b){OpenLayers.Console.error(b)}break;case"FeatureCollection":e=[];switch(d.type){case"Feature":try{e.push(this.parseFeature(d))}catch(b){e=null;OpenLayers.Console.error(b)}break;case"FeatureCollection":for(var g=0,h=d.features.length;g<h;++g){try{e.push(this.parseFeature(d.features[g]))}catch(b){e=null;OpenLayers.Console.error(b)}}break;default:try{var m=this.parseGeometry(d);e.push(new OpenLayers.Feature.Vector(m))}catch(b){e=null;OpenLayers.Console.error(b)}}break}}}}return e},isValidType:function(d,a){var b=false;switch(a){case"Geometry":if(OpenLayers.Util.indexOf(["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","Box","GeometryCollection"],d.type)==-1){OpenLayers.Console.error("Unsupported geometry type: "+d.type)}else{b=true}break;case"FeatureCollection":b=true;break;default:if(d.type==a){b=true}else{OpenLayers.Console.error("Cannot convert types from "+d.type+" to "+a)}}return b},parseFeature:function(e){var b,h,a,g;a=(e.properties)?e.properties:{};g=(e.geometry&&e.geometry.bbox)||e.bbox;try{h=this.parseGeometry(e.geometry)}catch(d){throw d}b=new OpenLayers.Feature.Vector(h,a);if(g){b.bounds=OpenLayers.Bounds.fromArray(g)}if(e.id){b.fid=e.id}return b},parseGeometry:function(g){if(g==null){return null}var l,h=false;if(g.type=="GeometryCollection"){if(!(g.geometries instanceof Array)){throw"GeometryCollection must have geometries array: "+g}var b=g.geometries.length;var e=new Array(b);for(var a=0;a<b;++a){e[a]=this.parseGeometry.apply(this,[g.geometries[a]])}l=new OpenLayers.Geometry.Collection(e);h=true}else{if(!(g.coordinates instanceof Array)){throw"Geometry must have coordinates array: "+g}if(!this.parseCoords[g.type.toLowerCase()]){throw"Unsupported geometry type: "+g.type}try{l=this.parseCoords[g.type.toLowerCase()].apply(this,[g.coordinates])}catch(d){throw d}}if(this.internalProjection&&this.externalProjection&&!h){l.transform(this.externalProjection,this.internalProjection)}return l},parseCoords:{point:function(a){if(a.length!=2){throw"Only 2D points are supported: "+a}return new OpenLayers.Geometry.Point(a[0],a[1])},multipoint:function(h){var d=[];var g=null;for(var b=0,a=h.length;b<a;++b){try{g=this.parseCoords.point.apply(this,[h[b]])}catch(e){throw e}d.push(g)}return new OpenLayers.Geometry.MultiPoint(d)},linestring:function(h){var d=[];var g=null;for(var b=0,a=h.length;b<a;++b){try{g=this.parseCoords.point.apply(this,[h[b]])}catch(e){throw e}d.push(g)}return new OpenLayers.Geometry.LineString(d)},multilinestring:function(h){var d=[];var b=null;for(var e=0,a=h.length;e<a;++e){try{b=this.parseCoords.linestring.apply(this,[h[e]])}catch(g){throw g}d.push(b)}return new OpenLayers.Geometry.MultiLineString(d)},polygon:function(m){var h=[];var g,b;for(var d=0,a=m.length;d<a;++d){try{b=this.parseCoords.linestring.apply(this,[m[d]])}catch(e){throw e}g=new OpenLayers.Geometry.LinearRing(b.components);h.push(g)}return new OpenLayers.Geometry.Polygon(h)},multipolygon:function(h){var b=[];var g=null;for(var d=0,a=h.length;d<a;++d){try{g=this.parseCoords.polygon.apply(this,[h[d]])}catch(e){throw e}b.push(g)}return new OpenLayers.Geometry.MultiPolygon(b)},box:function(a){if(a.length!=2){throw"GeoJSON box coordinates must have 2 elements"}return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(a[0][0],a[0][1]),new OpenLayers.Geometry.Point(a[1][0],a[0][1]),new OpenLayers.Geometry.Point(a[1][0],a[1][1]),new OpenLayers.Geometry.Point(a[0][0],a[1][1]),new OpenLayers.Geometry.Point(a[0][0],a[0][1])])])}},write:function(g,e){var a={type:null};if(g instanceof Array){a.type="FeatureCollection";var l=g.length;a.features=new Array(l);for(var d=0;d<l;++d){var b=g[d];if(!b instanceof OpenLayers.Feature.Vector){var h="FeatureCollection only supports collections of features: "+b;throw h}a.features[d]=this.extract.feature.apply(this,[b])}}else{if(g.CLASS_NAME.indexOf("OpenLayers.Geometry")==0){a=this.extract.geometry.apply(this,[g])}else{if(g instanceof OpenLayers.Feature.Vector){a=this.extract.feature.apply(this,[g]);if(g.layer&&g.layer.projection){a.crs=this.createCRSObject(g)}}}}return OpenLayers.Format.JSON.prototype.write.apply(this,[a,e])},createCRSObject:function(b){var d=b.layer.projection.toString();var a={};if(d.match(/epsg:/i)){var e=parseInt(d.substring(d.indexOf(":")+1));if(e==4326){a={type:"OGC",properties:{urn:"urn:ogc:def:crs:OGC:1.3:CRS84"}}}else{a={type:"EPSG",properties:{code:e}}}}return a},extract:{feature:function(b){var a=this.extract.geometry.apply(this,[b.geometry]);return{type:"Feature",id:b.fid==null?b.id:b.fid,properties:b.attributes,geometry:a}},geometry:function(e){if(e==null){return null}if(this.internalProjection&&this.externalProjection){e=e.clone();e.transform(this.internalProjection,this.externalProjection)}var a=e.CLASS_NAME.split(".")[2];var d=this.extract[a.toLowerCase()].apply(this,[e]);var b;if(a=="Collection"){b={type:"GeometryCollection",geometries:d}}else{b={type:a,coordinates:d}}return b},point:function(a){return[a.x,a.y]},multipoint:function(d){var e=[];for(var b=0,a=d.components.length;b<a;++b){e.push(this.extract.point.apply(this,[d.components[b]]))}return e},linestring:function(b){var e=[];for(var d=0,a=b.components.length;d<a;++d){e.push(this.extract.point.apply(this,[b.components[d]]))}return e},multilinestring:function(d){var e=[];for(var b=0,a=d.components.length;b<a;++b){e.push(this.extract.linestring.apply(this,[d.components[b]]))}return e},polygon:function(d){var e=[];for(var b=0,a=d.components.length;b<a;++b){e.push(this.extract.linestring.apply(this,[d.components[b]]))}return e},multipolygon:function(e){var d=[];for(var b=0,a=e.components.length;b<a;++b){d.push(this.extract.polygon.apply(this,[e.components[b]]))}return d},collection:function(d){var a=d.components.length;var e=new Array(a);for(var b=0;b<a;++b){e[b]=this.extract.geometry.apply(this,[d.components[b]])}return e}},CLASS_NAME:"OpenLayers.Format.GeoJSON"});OpenLayers.Format.ArcXML.Features=OpenLayers.Class(OpenLayers.Format.XML,{initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(d){var b=new OpenLayers.Format.ArcXML();var a=b.read(d);return a.features.feature}});if(!OpenLayers.Format.GML){OpenLayers.Format.GML={}}OpenLayers.Format.GML.Base=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",wfs:"http://www.opengis.net/wfs"},defaultPrefix:"gml",schemaLocation:null,featureType:null,featureNS:null,geometryName:"geometry",extractAttributes:true,srsName:null,xy:true,geometryTypes:null,singleFeatureType:null,regExes:{trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s*/g)},initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);this.setGeometryTypes();if(a&&a.featureNS){this.setNamespace("feature",a.featureNS)}this.singleFeatureType=!a||(typeof a.featureType==="string")},read:function(g){if(typeof g=="string"){g=OpenLayers.Format.XML.prototype.read.apply(this,[g])}if(g&&g.nodeType==9){g=g.documentElement}var d=[];this.readNode(g,{features:d});if(d.length==0){var e=this.getElementsByTagNameNS(g,this.namespaces.gml,"featureMember");if(e.length){for(var b=0,a=e.length;b<a;++b){this.readNode(e[b],{features:d})}}else{var e=this.getElementsByTagNameNS(g,this.namespaces.gml,"featureMembers");if(e.length){this.readNode(e[0],{features:d})}}}return d},readers:{gml:{featureMember:function(a,b){this.readChildNodes(a,b)},featureMembers:function(a,b){this.readChildNodes(a,b)},name:function(a,b){b.name=this.getChildValue(a)},boundedBy:function(b,d){var a={};this.readChildNodes(b,a);if(a.components&&a.components.length>0){d.bounds=a.components[0]}},Point:function(b,a){var d={points:[]};this.readChildNodes(b,d);if(!a.components){a.components=[]}a.components.push(d.points[0])},coordinates:function(g,l){var m=this.getChildValue(g).replace(this.regExes.trimSpace,"");m=m.replace(this.regExes.trimComma,",");var a=m.split(this.regExes.splitSpace);var h;var e=a.length;var d=new Array(e);for(var b=0;b<e;++b){h=a[b].split(",");if(this.xy){d[b]=new OpenLayers.Geometry.Point(h[0],h[1],h[2])}else{d[b]=new OpenLayers.Geometry.Point(h[1],h[0],h[2])}}l.points=d},coord:function(a,b){var d={};this.readChildNodes(a,d);if(!b.points){b.points=[]}b.points.push(new OpenLayers.Geometry.Point(d.x,d.y,d.z))},X:function(a,b){b.x=this.getChildValue(a)},Y:function(a,b){b.y=this.getChildValue(a)},Z:function(a,b){b.z=this.getChildValue(a)},MultiPoint:function(b,a){var d={components:[]};this.readChildNodes(b,d);a.components=[new OpenLayers.Geometry.MultiPoint(d.components)]},pointMember:function(a,b){this.readChildNodes(a,b)},LineString:function(b,a){var d={};this.readChildNodes(b,d);if(!a.components){a.components=[]}a.components.push(new OpenLayers.Geometry.LineString(d.points))},MultiLineString:function(b,a){var d={components:[]};this.readChildNodes(b,d);a.components=[new OpenLayers.Geometry.MultiLineString(d.components)]},lineStringMember:function(a,b){this.readChildNodes(a,b)},Polygon:function(b,a){var d={outer:null,inner:[]};this.readChildNodes(b,d);d.inner.unshift(d.outer);if(!a.components){a.components=[]}a.components.push(new OpenLayers.Geometry.Polygon(d.inner))},LinearRing:function(b,d){var a={};this.readChildNodes(b,a);d.components=[new OpenLayers.Geometry.LinearRing(a.points)]},MultiPolygon:function(b,a){var d={components:[]};this.readChildNodes(b,d);a.components=[new OpenLayers.Geometry.MultiPolygon(d.components)]},polygonMember:function(a,b){this.readChildNodes(a,b)},GeometryCollection:function(b,a){var d={components:[]};this.readChildNodes(b,d);a.components=[new OpenLayers.Geometry.Collection(d.components)]},geometryMember:function(a,b){this.readChildNodes(a,b)}},feature:{"*":function(d,e){var a;var b=d.localName||d.nodeName.split(":").pop();if(!this.singleFeatureType&&(OpenLayers.Util.indexOf(this.featureType,b)!=-1)){a="_typeName"}else{if(b==this.featureType){a="_typeName"}else{if(d.childNodes.length==0||(d.childNodes.length==1&&d.firstChild.nodeType==3)){if(this.extractAttributes){a="_attribute"}}else{a="_geometry"}}}if(a){this.readers.feature[a].apply(this,[d,e])}},_typeName:function(d,e){var a={components:[],attributes:{}};this.readChildNodes(d,a);if(a.name){a.attributes.name=a.name}var b=new OpenLayers.Feature.Vector(a.components[0],a.attributes);if(!this.singleFeatureType){b.type=d.nodeName.split(":").pop();b.namespace=d.namespaceURI}var g=d.getAttribute("fid")||this.getAttributeNS(d,this.namespaces.gml,"id");if(g){b.fid=g}if(this.internalProjection&&this.externalProjection&&b.geometry){b.geometry.transform(this.externalProjection,this.internalProjection)}if(a.bounds){b.geometry.bounds=a.bounds}e.features.push(b)},_geometry:function(a,b){this.readChildNodes(a,b)},_attribute:function(b,e){var a=b.localName||b.nodeName.split(":").pop();var d=this.getChildValue(b);e.attributes[a]=d}},wfs:{FeatureCollection:function(a,b){this.readChildNodes(a,b)}}},write:function(d){var b;if(d instanceof Array){b="featureMembers"}else{b="featureMember"}var a=this.writeNode("gml:"+b,d);this.setAttributeNS(a,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[a])},writers:{gml:{featureMember:function(a){var b=this.createElementNSPlus("gml:featureMember");this.writeNode("feature:_typeName",a,b);return b},MultiPoint:function(d){var b=this.createElementNSPlus("gml:MultiPoint");for(var a=0;a<d.components.length;++a){this.writeNode("pointMember",d.components[a],b)}return b},pointMember:function(b){var a=this.createElementNSPlus("gml:pointMember");this.writeNode("Point",b,a);return a},MultiLineString:function(d){var b=this.createElementNSPlus("gml:MultiLineString");for(var a=0;a<d.components.length;++a){this.writeNode("lineStringMember",d.components[a],b)}return b},lineStringMember:function(b){var a=this.createElementNSPlus("gml:lineStringMember");this.writeNode("LineString",b,a);return a},MultiPolygon:function(d){var b=this.createElementNSPlus("gml:MultiPolygon");for(var a=0;a<d.components.length;++a){this.writeNode("polygonMember",d.components[a],b)}return b},polygonMember:function(b){var a=this.createElementNSPlus("gml:polygonMember");this.writeNode("Polygon",b,a);return a},GeometryCollection:function(e){var d=this.createElementNSPlus("gml:GeometryCollection");for(var b=0,a=e.components.length;b<a;++b){this.writeNode("geometryMember",e.components[b],d)}return d},geometryMember:function(b){var a=this.createElementNSPlus("gml:geometryMember");var d=this.writeNode("feature:_geometry",b);a.appendChild(d.firstChild);return a}},feature:{_typeName:function(b){var d=this.createElementNSPlus("feature:"+this.featureType,{attributes:{fid:b.fid}});if(b.geometry){this.writeNode("feature:_geometry",b.geometry,d)}for(var a in b.attributes){var e=b.attributes[a];if(e!=null){this.writeNode("feature:_attribute",{name:a,value:e},d)}}return d},_geometry:function(d){if(this.externalProjection&&this.internalProjection){d=d.clone().transform(this.internalProjection,this.externalProjection)}var b=this.createElementNSPlus("feature:"+this.geometryName);var a=this.geometryTypes[d.CLASS_NAME];var e=this.writeNode("gml:"+a,d,b);if(this.srsName){e.setAttribute("srsName",this.srsName)}return b},_attribute:function(a){return this.createElementNSPlus("feature:"+a.name,{value:a.value})}},wfs:{FeatureCollection:function(d){var e=this.createElementNSPlus("wfs:FeatureCollection");for(var b=0,a=d.length;b<a;++b){this.writeNode("gml:featureMember",d[b],e)}return e}}},setGeometryTypes:function(){this.geometryTypes={"OpenLayers.Geometry.Point":"Point","OpenLayers.Geometry.MultiPoint":"MultiPoint","OpenLayers.Geometry.LineString":"LineString","OpenLayers.Geometry.MultiLineString":"MultiLineString","OpenLayers.Geometry.Polygon":"Polygon","OpenLayers.Geometry.MultiPolygon":"MultiPolygon","OpenLayers.Geometry.Collection":"GeometryCollection"}},CLASS_NAME:"OpenLayers.Format.GML.Base"});OpenLayers.Format.WFS=OpenLayers.Class(OpenLayers.Format.GML,{layer:null,wfsns:"http://www.opengis.net/wfs",ogcns:"http://www.opengis.net/ogc",initialize:function(a,b){OpenLayers.Format.GML.prototype.initialize.apply(this,[a]);this.layer=b;if(this.layer.featureNS){this.featureNS=this.layer.featureNS}if(this.layer.options.geometry_column){this.geometryName=this.layer.options.geometry_column}if(this.layer.options.typename){this.featureName=this.layer.options.typename}},write:function(b){var d=this.createElementNS(this.wfsns,"wfs:Transaction");d.setAttribute("version","1.0.0");d.setAttribute("service","WFS");for(var a=0;a<b.length;a++){switch(b[a].state){case OpenLayers.State.INSERT:d.appendChild(this.insert(b[a]));break;case OpenLayers.State.UPDATE:d.appendChild(this.update(b[a]));break;case OpenLayers.State.DELETE:d.appendChild(this.remove(b[a]));break}}return OpenLayers.Format.XML.prototype.write.apply(this,[d])},createFeatureXML:function(h){var d=this.buildGeometryNode(h.geometry);var l=this.createElementNS(this.featureNS,"feature:"+this.geometryName);l.appendChild(d);var b=this.createElementNS(this.featureNS,"feature:"+this.featureName);b.appendChild(l);for(var a in h.attributes){var m=this.createTextNode(h.attributes[a]);var e=a;if(a.search(":")!=-1){e=a.split(":")[1]}var g=this.createElementNS(this.featureNS,"feature:"+e);g.appendChild(m);b.appendChild(g)}return b},insert:function(b){var a=this.createElementNS(this.wfsns,"wfs:Insert");a.appendChild(this.createFeatureXML(b));return a},update:function(p){if(!p.fid){OpenLayers.Console.userError(OpenLayers.i18n("noFID"))}var h=this.createElementNS(this.wfsns,"wfs:Update");h.setAttribute("typeName",this.featurePrefix+":"+this.featureName);h.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);var m=this.createElementNS(this.wfsns,"wfs:Property");var a=this.createElementNS(this.wfsns,"wfs:Name");var d=this.createTextNode(this.geometryName);a.appendChild(d);m.appendChild(a);var o=this.createElementNS(this.wfsns,"wfs:Value");var e=this.buildGeometryNode(p.geometry);if(p.layer){e.setAttribute("srsName",p.layer.projection.getCode())}o.appendChild(e);m.appendChild(o);h.appendChild(m);for(var g in p.attributes){m=this.createElementNS(this.wfsns,"wfs:Property");a=this.createElementNS(this.wfsns,"wfs:Name");a.appendChild(this.createTextNode(g));m.appendChild(a);o=this.createElementNS(this.wfsns,"wfs:Value");o.appendChild(this.createTextNode(p.attributes[g]));m.appendChild(o);h.appendChild(m)}var l=this.createElementNS(this.ogcns,"ogc:Filter");var b=this.createElementNS(this.ogcns,"ogc:FeatureId");b.setAttribute("fid",p.fid);l.appendChild(b);h.appendChild(l);return h},remove:function(b){if(!b.fid){OpenLayers.Console.userError(OpenLayers.i18n("noFID"));return false}var a=this.createElementNS(this.wfsns,"wfs:Delete");a.setAttribute("typeName",this.featurePrefix+":"+this.featureName);a.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);var d=this.createElementNS(this.ogcns,"ogc:Filter");var e=this.createElementNS(this.ogcns,"ogc:FeatureId");e.setAttribute("fid",b.fid);d.appendChild(e);a.appendChild(d);return a},destroy:function(){this.layer=null},CLASS_NAME:"OpenLayers.Format.WFS"});OpenLayers.Layer.ArcIMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{ClientVersion:"9.2",ServiceName:""},tileSize:null,featureCoordSys:"4326",filterCoordSys:"4326",layers:null,async:true,name:"ArcIMS",isBaseLayer:true,DEFAULT_OPTIONS:{tileSize:new OpenLayers.Size(512,512),featureCoordSys:"4326",filterCoordSys:"4326",layers:null,isBaseLayer:true,async:true,name:"ArcIMS"},initialize:function(d,b,a){this.tileSize=new OpenLayers.Size(512,512);this.params=OpenLayers.Util.applyDefaults({ServiceName:a.serviceName},this.DEFAULT_PARAMS);this.options=OpenLayers.Util.applyDefaults(a,this.DEFAULT_OPTIONS);OpenLayers.Layer.Grid.prototype.initialize.apply(this,[d,b,this.params,a]);if(this.transparent){if(!this.isBaseLayer){this.isBaseLayer=false}if(this.format=="image/jpeg"){this.format=OpenLayers.Util.alphaHack()?"image/gif":"image/png"}}if(this.options.layers===null){this.options.layers=[]}},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},getURL:function(e){var a="";e=this.adjustBounds(e);var d=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image",envelope:e.toArray(),tileSize:this.tileSize}));var b=new OpenLayers.Request.POST({url:this.getFullRequestString(),data:d.write(),async:false});if(b!=null){var h=b.responseXML;if(!h||!h.documentElement){h=b.responseText}var g=new OpenLayers.Format.ArcXML();var l=g.read(h);a=this.getUrlOrImage(l.image.output)}return a},getURLasync:function(d,a,g,e){d=this.adjustBounds(d);var b=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image",envelope:d.toArray(),tileSize:this.tileSize}));OpenLayers.Request.POST({url:this.getFullRequestString(),async:true,data:b.write(),callback:function(h){var m=h.responseXML;if(!m||!m.documentElement){m=h.responseText}var l=new OpenLayers.Format.ArcXML();var o=l.read(m);a[g]=this.getUrlOrImage(o.image.output);e.apply(a)},scope:this})},getUrlOrImage:function(a){var b="";if(a.url){b=a.url}else{if(a.data){b="data:image/"+a.type+";base64,"+a.data}}return b},setLayerQuery:function(d,a){for(var b=0;b<this.options.layers.length;b++){if(d==this.options.layers[b].id){this.options.layers[b].query=a;return}}this.options.layers.push({id:d,visible:true,query:a})},getFeatureInfo:function(m,h,q){var b=q.buffer||1;var o=q.callback||function(){};var p=q.scope||window;var a={};OpenLayers.Util.extend(a,this.options);a.requesttype="feature";if(m instanceof OpenLayers.LonLat){a.polygon=null;a.envelope=[m.lon-b,m.lat-b,m.lon+b,m.lat+b]}else{if(m instanceof OpenLayers.Geometry.Polygon){a.envelope=null;a.polygon=m}}var g=new OpenLayers.Format.ArcXML(a);OpenLayers.Util.extend(g.request.get_feature,q);g.request.get_feature.layer=h.id;if(typeof h.query.accuracy=="number"){g.request.get_feature.query.accuracy=h.query.accuracy}else{var l=this.map.getCenter();var e=this.map.getViewPortPxFromLonLat(l);e.x++;var d=this.map.getLonLatFromPixel(e);g.request.get_feature.query.accuracy=d.lon-l.lon}g.request.get_feature.query.where=h.query.where;g.request.get_feature.query.spatialfilter.relation="area_intersection";OpenLayers.Request.POST({url:this.getFullRequestString({CustomService:"Query"}),data:g.write(),callback:function(s){var r=g.parseResponse(s.responseText);if(!g.iserror()){o.call(p,r.features)}else{o.call(p,null)}}})},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},CLASS_NAME:"OpenLayers.Layer.ArcIMS"});OpenLayers.Format.GML.v2=OpenLayers.Class(OpenLayers.Format.GML.Base,{schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd",initialize:function(a){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[a])},readers:{gml:OpenLayers.Util.applyDefaults({outerBoundaryIs:function(b,a){var d={};this.readChildNodes(b,d);a.outer=d.components[0]},innerBoundaryIs:function(b,a){var d={};this.readChildNodes(b,d);a.inner.push(d.components[0])},Box:function(e,b){var g={};this.readChildNodes(e,g);if(!b.components){b.components=[]}var d=g.points[0];var a=g.points[1];b.components.push(new OpenLayers.Bounds(d.x,d.y,a.x,a.y))}},OpenLayers.Format.GML.Base.prototype.readers.gml),feature:OpenLayers.Format.GML.Base.prototype.readers.feature,wfs:OpenLayers.Format.GML.Base.prototype.readers.wfs},write:function(d){var b;if(d instanceof Array){b="wfs:FeatureCollection"}else{b="gml:featureMember"}var a=this.writeNode(b,d);this.setAttributeNS(a,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[a])},writers:{gml:OpenLayers.Util.applyDefaults({Point:function(b){var a=this.createElementNSPlus("gml:Point");this.writeNode("coordinates",[b],a);return a},coordinates:function(e){var d=e.length;var g=new Array(d);var a;for(var b=0;b<d;++b){a=e[b];if(this.xy){g[b]=a.x+","+a.y}else{g[b]=a.y+","+a.x}if(a.z!=undefined){g[b]+=","+a.z}}return this.createElementNSPlus("gml:coordinates",{attributes:{decimal:".",cs:",",ts:" "},value:(d==1)?g[0]:g.join(" ")})},LineString:function(b){var a=this.createElementNSPlus("gml:LineString");this.writeNode("coordinates",b.components,a);return a},Polygon:function(d){var b=this.createElementNSPlus("gml:Polygon");this.writeNode("outerBoundaryIs",d.components[0],b);for(var a=1;a<d.components.length;++a){this.writeNode("innerBoundaryIs",d.components[a],b)}return b},outerBoundaryIs:function(a){var b=this.createElementNSPlus("gml:outerBoundaryIs");this.writeNode("LinearRing",a,b);return b},innerBoundaryIs:function(a){var b=this.createElementNSPlus("gml:innerBoundaryIs");this.writeNode("LinearRing",a,b);return b},LinearRing:function(a){var b=this.createElementNSPlus("gml:LinearRing");this.writeNode("coordinates",a.components,b);return b},Box:function(b){var a=this.createElementNSPlus("gml:Box");this.writeNode("coordinates",[{x:b.left,y:b.bottom},{x:b.right,y:b.top}],a);if(this.srsName){a.setAttribute("srsName",this.srsName)}return a}},OpenLayers.Format.GML.Base.prototype.writers.gml),feature:OpenLayers.Format.GML.Base.prototype.writers.feature,wfs:OpenLayers.Format.GML.Base.prototype.writers.wfs},CLASS_NAME:"OpenLayers.Format.GML.v2"});OpenLayers.Format.GML.v3=OpenLayers.Class(OpenLayers.Format.GML.Base,{schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",curve:false,multiCurve:true,surface:false,multiSurface:true,initialize:function(a){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[a])},readers:{gml:OpenLayers.Util.applyDefaults({featureMembers:function(a,b){this.readChildNodes(a,b)},Curve:function(b,a){var d={points:[]};this.readChildNodes(b,d);if(!a.components){a.components=[]}a.components.push(new OpenLayers.Geometry.LineString(d.points))},segments:function(a,b){this.readChildNodes(a,b)},LineStringSegment:function(b,a){var d={};this.readChildNodes(b,d);if(d.points){Array.prototype.push.apply(a.points,d.points)}},pos:function(b,e){var g=this.getChildValue(b).replace(this.regExes.trimSpace,"");var d=g.split(this.regExes.splitSpace);var a;if(this.xy){a=new OpenLayers.Geometry.Point(d[0],d[1],d[2])}else{a=new OpenLayers.Geometry.Point(d[1],d[0],d[2])}e.points=[a]},posList:function(a,e){var m=this.getChildValue(a).replace(this.regExes.trimSpace,"");var q=m.split(this.regExes.splitSpace);var g=parseInt(a.getAttribute("dimension"))||2;var b,r,p,l;var o=q.length/g;var s=new Array(o);for(var d=0,h=q.length;d<h;d+=g){r=q[d];p=q[d+1];l=(g==2)?undefined:q[d+2];if(this.xy){s[d/g]=new OpenLayers.Geometry.Point(r,p,l)}else{s[d/g]=new OpenLayers.Geometry.Point(p,r,l)}}e.points=s},Surface:function(a,b){this.readChildNodes(a,b)},patches:function(a,b){this.readChildNodes(a,b)},PolygonPatch:function(a,b){this.readers.gml.Polygon.apply(this,[a,b])},exterior:function(b,a){var d={};this.readChildNodes(b,d);a.outer=d.components[0]},interior:function(b,a){var d={};this.readChildNodes(b,d);a.inner.push(d.components[0])},MultiCurve:function(b,a){var d={components:[]};this.readChildNodes(b,d);if(d.components.length>0){a.components=[new OpenLayers.Geometry.MultiLineString(d.components)]}},curveMember:function(a,b){this.readChildNodes(a,b)},MultiSurface:function(b,a){var d={components:[]};this.readChildNodes(b,d);if(d.components.length>0){a.components=[new OpenLayers.Geometry.MultiPolygon(d.components)]}},surfaceMember:function(a,b){this.readChildNodes(a,b)},surfaceMembers:function(a,b){this.readChildNodes(a,b)},pointMembers:function(a,b){this.readChildNodes(a,b)},lineStringMembers:function(a,b){this.readChildNodes(a,b)},polygonMembers:function(a,b){this.readChildNodes(a,b)},geometryMembers:function(a,b){this.readChildNodes(a,b)},Envelope:function(e,b){var g={points:new Array(2)};this.readChildNodes(e,g);if(!b.components){b.components=[]}var d=g.points[0];var a=g.points[1];b.components.push(new OpenLayers.Bounds(d.x,d.y,a.x,a.y))},lowerCorner:function(b,a){var d={};this.readers.gml.pos.apply(this,[b,d]);a.points[0]=d.points[0]},upperCorner:function(b,a){var d={};this.readers.gml.pos.apply(this,[b,d]);a.points[1]=d.points[0]}},OpenLayers.Format.GML.Base.prototype.readers.gml),feature:OpenLayers.Format.GML.Base.prototype.readers.feature,wfs:OpenLayers.Format.GML.Base.prototype.readers.wfs},write:function(d){var b;if(d instanceof Array){b="featureMembers"}else{b="featureMember"}var a=this.writeNode("gml:"+b,d);this.setAttributeNS(a,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[a])},writers:{gml:OpenLayers.Util.applyDefaults({featureMembers:function(d){var e=this.createElementNSPlus("gml:featureMembers");for(var b=0,a=d.length;b<a;++b){this.writeNode("feature:_typeName",d[b],e)}return e},Point:function(b){var a=this.createElementNSPlus("gml:Point");this.writeNode("pos",b,a);return a},pos:function(a){var b=(this.xy)?(a.x+" "+a.y):(a.y+" "+a.x);return this.createElementNSPlus("gml:pos",{value:b})},LineString:function(b){var a=this.createElementNSPlus("gml:LineString");this.writeNode("posList",b.components,a);return a},Curve:function(b){var a=this.createElementNSPlus("gml:Curve");this.writeNode("segments",b,a);return a},segments:function(b){var a=this.createElementNSPlus("gml:segments");this.writeNode("LineStringSegment",b,a);return a},LineStringSegment:function(b){var a=this.createElementNSPlus("gml:LineStringSegment");this.writeNode("posList",b.components,a);return a},posList:function(e){var b=e.length;var g=new Array(b);var a;for(var d=0;d<b;++d){a=e[d];if(this.xy){g[d]=a.x+" "+a.y}else{g[d]=a.y+" "+a.x}}return this.createElementNSPlus("gml:posList",{value:g.join(" ")})},Surface:function(b){var a=this.createElementNSPlus("gml:Surface");this.writeNode("patches",b,a);return a},patches:function(b){var a=this.createElementNSPlus("gml:patches");this.writeNode("PolygonPatch",b,a);return a},PolygonPatch:function(e){var d=this.createElementNSPlus("gml:PolygonPatch",{attributes:{interpolation:"planar"}});this.writeNode("exterior",e.components[0],d);for(var b=1,a=e.components.length;b<a;++b){this.writeNode("interior",e.components[b],d)}return d},Polygon:function(e){var d=this.createElementNSPlus("gml:Polygon");this.writeNode("exterior",e.components[0],d);for(var b=1,a=e.components.length;b<a;++b){this.writeNode("interior",e.components[b],d)}return d},exterior:function(a){var b=this.createElementNSPlus("gml:exterior");this.writeNode("LinearRing",a,b);return b},interior:function(a){var b=this.createElementNSPlus("gml:interior");this.writeNode("LinearRing",a,b);return b},LinearRing:function(a){var b=this.createElementNSPlus("gml:LinearRing");this.writeNode("posList",a.components,b);return b},MultiCurve:function(e){var d=this.createElementNSPlus("gml:MultiCurve");for(var b=0,a=e.components.length;b<a;++b){this.writeNode("curveMember",e.components[b],d)}return d},curveMember:function(b){var a=this.createElementNSPlus("gml:curveMember");if(this.curve){this.writeNode("Curve",b,a)}else{this.writeNode("LineString",b,a)}return a},MultiSurface:function(e){var d=this.createElementNSPlus("gml:MultiSurface");for(var b=0,a=e.components.length;b<a;++b){this.writeNode("surfaceMember",e.components[b],d)}return d},surfaceMember:function(a){var b=this.createElementNSPlus("gml:surfaceMember");if(this.surface){this.writeNode("Surface",a,b)}else{this.writeNode("Polygon",a,b)}return b},Envelope:function(b){var a=this.createElementNSPlus("gml:Envelope");this.writeNode("lowerCorner",b,a);this.writeNode("upperCorner",b,a);if(this.srsName){a.setAttribute("srsName",this.srsName)}return a},lowerCorner:function(a){var b=(this.xy)?(a.left+" "+a.bottom):(a.bottom+" "+a.left);return this.createElementNSPlus("gml:lowerCorner",{value:b})},upperCorner:function(a){var b=(this.xy)?(a.right+" "+a.top):(a.top+" "+a.right);return this.createElementNSPlus("gml:upperCorner",{value:b})}},OpenLayers.Format.GML.Base.prototype.writers.gml),feature:OpenLayers.Format.GML.Base.prototype.writers.feature,wfs:OpenLayers.Format.GML.Base.prototype.writers.wfs},setGeometryTypes:function(){this.geometryTypes={"OpenLayers.Geometry.Point":"Point","OpenLayers.Geometry.MultiPoint":"MultiPoint","OpenLayers.Geometry.LineString":(this.curve===true)?"Curve":"LineString","OpenLayers.Geometry.MultiLineString":(this.multiCurve===false)?"MultiLineString":"MultiCurve","OpenLayers.Geometry.Polygon":(this.surface===true)?"Surface":"Polygon","OpenLayers.Geometry.MultiPolygon":(this.multiSurface===false)?"MultiPolygon":"MultiSurface","OpenLayers.Geometry.Collection":"GeometryCollection"}},CLASS_NAME:"OpenLayers.Format.GML.v3"});OpenLayers.Format.Filter.v1_0_0=OpenLayers.Class(OpenLayers.Format.GML.v2,OpenLayers.Format.Filter.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/ogc/filter/1.0.0/filter.xsd",initialize:function(a){OpenLayers.Format.GML.v2.prototype.initialize.apply(this,[a])},readers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(b,d){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO});this.readChildNodes(b,a);d.filters.push(a)},PropertyIsNotEqualTo:function(b,d){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO});this.readChildNodes(b,a);d.filters.push(a)}},OpenLayers.Format.Filter.v1.prototype.readers.ogc),gml:OpenLayers.Format.GML.v2.prototype.readers.gml,feature:OpenLayers.Format.GML.v2.prototype.readers.feature},writers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(a){var b=this.createElementNSPlus("ogc:PropertyIsEqualTo");this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},PropertyIsNotEqualTo:function(a){var b=this.createElementNSPlus("ogc:PropertyIsNotEqualTo");this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},BBOX:function(a){var d=this.createElementNSPlus("ogc:BBOX");this.writeNode("PropertyName",a,d);var b=this.writeNode("gml:Box",a.value,d);if(a.projection){b.setAttribute("srsName",a.projection)}return d}},OpenLayers.Format.Filter.v1.prototype.writers.ogc),gml:OpenLayers.Format.GML.v2.prototype.writers.gml,feature:OpenLayers.Format.GML.v2.prototype.writers.feature},writeSpatial:function(b,a){var d=this.createElementNSPlus("ogc:"+a);this.writeNode("PropertyName",b,d);var e;if(b.value instanceof OpenLayers.Geometry){e=this.writeNode("feature:_geometry",b.value).firstChild}else{e=this.writeNode("gml:Box",b.value)}if(b.projection){e.setAttribute("srsName",b.projection)}d.appendChild(e);return d},CLASS_NAME:"OpenLayers.Format.Filter.v1_0_0"});OpenLayers.Format.Filter.v1_1_0=OpenLayers.Class(OpenLayers.Format.GML.v3,OpenLayers.Format.Filter.v1,{VERSION:"1.1.0",schemaLocation:"http://www.opengis.net/ogc/filter/1.1.0/filter.xsd",initialize:function(a){OpenLayers.Format.GML.v3.prototype.initialize.apply(this,[a])},readers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(b,e){var d=b.getAttribute("matchCase");var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,matchCase:!(d==="false"||d==="0")});this.readChildNodes(b,a);e.filters.push(a)},PropertyIsNotEqualTo:function(b,e){var d=b.getAttribute("matchCase");var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO,matchCase:!(d==="false"||d==="0")});this.readChildNodes(b,a);e.filters.push(a)}},OpenLayers.Format.Filter.v1.prototype.readers.ogc),gml:OpenLayers.Format.GML.v3.prototype.readers.gml,feature:OpenLayers.Format.GML.v3.prototype.readers.feature},writers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(a){var b=this.createElementNSPlus("ogc:PropertyIsEqualTo",{attributes:{matchCase:a.matchCase}});this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},PropertyIsNotEqualTo:function(a){var b=this.createElementNSPlus("ogc:PropertyIsNotEqualTo",{attributes:{matchCase:a.matchCase}});this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},BBOX:function(a){var d=this.createElementNSPlus("ogc:BBOX");this.writeNode("PropertyName",a,d);var b=this.writeNode("gml:Envelope",a.value);if(a.projection){b.setAttribute("srsName",a.projection)}d.appendChild(b);return d}},OpenLayers.Format.Filter.v1.prototype.writers.ogc),gml:OpenLayers.Format.GML.v3.prototype.writers.gml,feature:OpenLayers.Format.GML.v3.prototype.writers.feature},writeSpatial:function(b,a){var d=this.createElementNSPlus("ogc:"+a);this.writeNode("PropertyName",b,d);var e;if(b.value instanceof OpenLayers.Geometry){e=this.writeNode("feature:_geometry",b.value).firstChild}else{e=this.writeNode("gml:Envelope",b.value)}if(b.projection){e.setAttribute("srsName",b.projection)}d.appendChild(e);return d},CLASS_NAME:"OpenLayers.Format.Filter.v1_1_0"});OpenLayers.Format.SLD.v1=OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0,{namespaces:{sld:"http://www.opengis.net/sld",ogc:"http://www.opengis.net/ogc",gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"sld",schemaLocation:null,defaultSymbolizer:{fillColor:"#808080",fillOpacity:1,strokeColor:"#000000",strokeOpacity:1,strokeWidth:1,strokeDashstyle:"solid",pointRadius:3,graphicName:"square"},initialize:function(a){OpenLayers.Format.Filter.v1_0_0.prototype.initialize.apply(this,[a])},read:function(d,a){a=OpenLayers.Util.applyDefaults(a,this.options);var b={namedLayers:a.namedLayersAsArray===true?[]:{}};this.readChildNodes(d,b);return b},readers:OpenLayers.Util.applyDefaults({sld:{StyledLayerDescriptor:function(a,b){b.version=a.getAttribute("version");this.readChildNodes(a,b)},Name:function(a,b){b.name=this.getChildValue(a)},Title:function(a,b){b.title=this.getChildValue(a)},Abstract:function(a,b){b.description=this.getChildValue(a)},NamedLayer:function(e,g){var d={userStyles:[],namedStyles:[]};this.readChildNodes(e,d);for(var b=0,a=d.userStyles.length;b<a;++b){d.userStyles[b].layerName=d.name}if(g.namedLayers instanceof Array){g.namedLayers.push(d)}else{g.namedLayers[d.name]=d}},NamedStyle:function(b,a){a.namedStyles.push(this.getChildName(b.firstChild))},UserStyle:function(d,a){var e={defaultsPerSymbolizer:true,rules:[]};this.readChildNodes(d,e);var b=new OpenLayers.Style(this.defaultSymbolizer,e);a.userStyles.push(b)},IsDefault:function(b,a){if(this.getChildValue(b)=="1"){a.isDefault=true}},FeatureTypeStyle:function(b,a){var d={rules:[]};this.readChildNodes(b,d);a.rules=d.rules},Rule:function(a,d){var b=new OpenLayers.Rule();this.readChildNodes(a,b);d.rules.push(b)},ElseFilter:function(a,b){b.elseFilter=true},MinScaleDenominator:function(a,b){b.minScaleDenominator=parseFloat(this.getChildValue(a))},MaxScaleDenominator:function(a,b){b.maxScaleDenominator=parseFloat(this.getChildValue(a))},TextSymbolizer:function(b,d){var a=d.symbolizer.Text||{};this.readChildNodes(b,a);d.symbolizer.Text=a},Label:function(b,a){var e={};this.readChildNodes(b,e);if(e.property){a.label="${"+e.property+"}"}else{var d=this.readOgcExpression(b);if(d){a.label=d}}},Font:function(b,a){this.readChildNodes(b,a)},Halo:function(b,a){var d={};this.readChildNodes(b,d);a.haloRadius=d.haloRadius;a.haloColor=d.fillColor;a.haloOpacity=d.fillOpacity},Radius:function(d,b){var a=this.readOgcExpression(d);if(a!=null){b.haloRadius=a}},LineSymbolizer:function(b,d){var a=d.symbolizer.Line||{};this.readChildNodes(b,a);d.symbolizer.Line=a},PolygonSymbolizer:function(b,d){var a=d.symbolizer.Polygon||{};this.readChildNodes(b,a);d.symbolizer.Polygon=a},PointSymbolizer:function(b,d){var a=d.symbolizer.Point||{};this.readChildNodes(b,a);d.symbolizer.Point=a},Stroke:function(b,a){a.stroke=true;this.readChildNodes(b,a)},Fill:function(b,a){a.fill=true;this.readChildNodes(b,a)},CssParameter:function(d,b){var a=d.getAttribute("name");var g=this.cssMap[a];if(g){var e=this.readOgcExpression(d);if(e){b[g]=e}}},Graphic:function(g,e){e.graphic=true;var m={};this.readChildNodes(g,m);var d=["strokeColor","strokeWidth","strokeOpacity","strokeLinecap","fillColor","fillOpacity","graphicName","rotation","graphicFormat"];var l,h;for(var b=0,a=d.length;b<a;++b){l=d[b];h=m[l];if(h!=undefined){e[l]=h}}if(m.opacity!=undefined){e.graphicOpacity=m.opacity}if(m.size!=undefined){e.pointRadius=m.size/2}if(m.href!=undefined){e.externalGraphic=m.href}if(m.rotation!=undefined){e.rotation=m.rotation}},ExternalGraphic:function(a,b){this.readChildNodes(a,b)},Mark:function(a,b){this.readChildNodes(a,b)},WellKnownName:function(a,b){b.graphicName=this.getChildValue(a)},Opacity:function(b,d){var a=this.readOgcExpression(b);if(a){d.opacity=a}},Size:function(b,d){var a=this.readOgcExpression(b);if(a){d.size=a}},Rotation:function(b,d){var a=this.readOgcExpression(b);if(a){d.rotation=a}},OnlineResource:function(a,b){b.href=this.getAttributeNS(a,this.namespaces.xlink,"href")},Format:function(a,b){b.graphicFormat=this.getChildValue(a)}}},OpenLayers.Format.Filter.v1_0_0.prototype.readers),cssMap:{stroke:"strokeColor","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-dasharray":"strokeDashstyle",fill:"fillColor","fill-opacity":"fillOpacity","font-family":"fontFamily","font-size":"fontSize","font-weight":"fontWeight","font-style":"fontStyle"},getCssProperty:function(a){var b=null;for(var d in this.cssMap){if(this.cssMap[d]==a){b=d;break}}return b},getGraphicFormat:function(a){var e,d;for(var b in this.graphicFormats){if(this.graphicFormats[b].test(a)){e=b;break}}return e||this.defautlGraphicFormat},defaultGraphicFormat:"image/png",graphicFormats:{"image/jpeg":/\.jpe?g$/i,"image/gif":/\.gif$/i,"image/png":/\.png$/i},write:function(a){return this.writers.sld.StyledLayerDescriptor.apply(this,[a])},writers:OpenLayers.Util.applyDefaults({sld:{StyledLayerDescriptor:function(g){var b=this.createElementNSPlus("StyledLayerDescriptor",{attributes:{version:this.VERSION,"xsi:schemaLocation":this.schemaLocation}});if(g.name){this.writeNode("Name",g.name,b)}if(g.title){this.writeNode("Title",g.title,b)}if(g.description){this.writeNode("Abstract",g.description,b)}if(g.namedLayers instanceof Array){for(var e=0,a=g.namedLayers.length;e<a;++e){this.writeNode("NamedLayer",g.namedLayers[e],b)}}else{for(var d in g.namedLayers){this.writeNode("NamedLayer",g.namedLayers[d],b)}}return b},Name:function(a){return this.createElementNSPlus("Name",{value:a})},Title:function(a){return this.createElementNSPlus("Title",{value:a})},Abstract:function(a){return this.createElementNSPlus("Abstract",{value:a})},NamedLayer:function(d){var e=this.createElementNSPlus("NamedLayer");this.writeNode("Name",d.name,e);if(d.namedStyles){for(var b=0,a=d.namedStyles.length;b<a;++b){this.writeNode("NamedStyle",d.namedStyles[b],e)}}if(d.userStyles){for(var b=0,a=d.userStyles.length;b<a;++b){this.writeNode("UserStyle",d.userStyles[b],e)}}return e},NamedStyle:function(a){var b=this.createElementNSPlus("NamedStyle");this.writeNode("Name",a,b);return b},UserStyle:function(a){var b=this.createElementNSPlus("UserStyle");if(a.name){this.writeNode("Name",a.name,b)}if(a.title){this.writeNode("Title",a.title,b)}if(a.description){this.writeNode("Abstract",a.description,b)}if(a.isDefault){this.writeNode("IsDefault",a.isDefault,b)}this.writeNode("FeatureTypeStyle",a,b);return b},IsDefault:function(a){return this.createElementNSPlus("IsDefault",{value:(a)?"1":"0"})},FeatureTypeStyle:function(d){var e=this.createElementNSPlus("FeatureTypeStyle");for(var b=0,a=d.rules.length;b<a;++b){this.writeNode("Rule",d.rules[b],e)}return e},Rule:function(l){var h=this.createElementNSPlus("Rule");if(l.name){this.writeNode("Name",l.name,h)}if(l.title){this.writeNode("Title",l.title,h)}if(l.description){this.writeNode("Abstract",l.description,h)}if(l.elseFilter){this.writeNode("ElseFilter",null,h)}else{if(l.filter){this.writeNode("ogc:Filter",l.filter,h)}}if(l.minScaleDenominator!=undefined){this.writeNode("MinScaleDenominator",l.minScaleDenominator,h)}if(l.maxScaleDenominator!=undefined){this.writeNode("MaxScaleDenominator",l.maxScaleDenominator,h)}var d=OpenLayers.Style.SYMBOLIZER_PREFIXES;var g,e;for(var b=0,a=d.length;b<a;++b){g=d[b];e=l.symbolizer[g];if(e){this.writeNode(g+"Symbolizer",e,h)}}return h},ElseFilter:function(){return this.createElementNSPlus("ElseFilter")},MinScaleDenominator:function(a){return this.createElementNSPlus("MinScaleDenominator",{value:a})},MaxScaleDenominator:function(a){return this.createElementNSPlus("MaxScaleDenominator",{value:a})},LineSymbolizer:function(a){var b=this.createElementNSPlus("LineSymbolizer");this.writeNode("Stroke",a,b);return b},Stroke:function(a){var b=this.createElementNSPlus("Stroke");if(a.strokeColor!=undefined){this.writeNode("CssParameter",{symbolizer:a,key:"strokeColor"},b)}if(a.strokeOpacity!=undefined){this.writeNode("CssParameter",{symbolizer:a,key:"strokeOpacity"},b)}if(a.strokeWidth!=undefined){this.writeNode("CssParameter",{symbolizer:a,key:"strokeWidth"},b)}return b},CssParameter:function(a){return this.createElementNSPlus("CssParameter",{attributes:{name:this.getCssProperty(a.key)},value:a.symbolizer[a.key]})},TextSymbolizer:function(a){var b=this.createElementNSPlus("TextSymbolizer");if(a.label!=null){this.writeNode("Label",a.label,b)}if(a.fontFamily!=null||a.fontSize!=null||a.fontWeight!=null||a.fontStyle!=null){this.writeNode("Font",a,b)}if(a.haloRadius!=null||a.haloColor!=null||a.haloOpacity!=null){this.writeNode("Halo",a,b)}if(a.fillColor!=null||a.fillOpacity!=null){this.writeNode("Fill",a,b)}return b},Font:function(a){var b=this.createElementNSPlus("Font");if(a.fontFamily){this.writeNode("CssParameter",{symbolizer:a,key:"fontFamily"},b)}if(a.fontSize){this.writeNode("CssParameter",{symbolizer:a,key:"fontSize"},b)}if(a.fontWeight){this.writeNode("CssParameter",{symbolizer:a,key:"fontWeight"},b)}if(a.fontStyle){this.writeNode("CssParameter",{symbolizer:a,key:"fontStyle"},b)}return b},Label:function(b){var h=this.createElementNSPlus("Label");var l=b.split("${");h.appendChild(this.createTextNode(l[0]));var g,e;for(var d=1,a=l.length;d<a;d++){g=l[d];e=g.indexOf("}");if(e>0){this.writeNode("ogc:PropertyName",{property:g.substring(0,e)},h);h.appendChild(this.createTextNode(g.substring(++e)))}else{h.appendChild(this.createTextNode("${"+g))}}return h},Halo:function(a){var b=this.createElementNSPlus("Halo");if(a.haloRadius){this.writeNode("Radius",a.haloRadius,b)}if(a.haloColor||a.haloOpacity){this.writeNode("Fill",{fillColor:a.haloColor,fillOpacity:a.haloOpacity},b)}return b},Radius:function(a){return node=this.createElementNSPlus("Radius",{value:a})},PolygonSymbolizer:function(a){var b=this.createElementNSPlus("PolygonSymbolizer");if(a.fillColor!=undefined||a.fillOpacity!=undefined){this.writeNode("Fill",a,b)}if(a.strokeWidth!=undefined||a.strokeColor!=undefined||a.strokeOpacity!=undefined||a.strokeDashstyle!=undefined){this.writeNode("Stroke",a,b)}return b},Fill:function(a){var b=this.createElementNSPlus("Fill");if(a.fillColor){this.writeNode("CssParameter",{symbolizer:a,key:"fillColor"},b)}if(a.fillOpacity!=null){this.writeNode("CssParameter",{symbolizer:a,key:"fillOpacity"},b)}return b},PointSymbolizer:function(a){var b=this.createElementNSPlus("PointSymbolizer");this.writeNode("Graphic",a,b);return b},Graphic:function(a){var b=this.createElementNSPlus("Graphic");if(a.externalGraphic!=undefined){this.writeNode("ExternalGraphic",a,b)}else{this.writeNode("Mark",a,b)}if(a.graphicOpacity!=undefined){this.writeNode("Opacity",a.graphicOpacity,b)}if(a.pointRadius!=undefined){this.writeNode("Size",a.pointRadius*2,b)}if(a.rotation!=undefined){this.writeNode("Rotation",a.rotation,b)}return b},ExternalGraphic:function(a){var b=this.createElementNSPlus("ExternalGraphic");this.writeNode("OnlineResource",a.externalGraphic,b);var d=a.graphicFormat||this.getGraphicFormat(a.externalGraphic);this.writeNode("Format",d,b);return b},Mark:function(a){var b=this.createElementNSPlus("Mark");if(a.graphicName){this.writeNode("WellKnownName",a.graphicName,b)}this.writeNode("Fill",a,b);this.writeNode("Stroke",a,b);return b},WellKnownName:function(a){return this.createElementNSPlus("WellKnownName",{value:a})},Opacity:function(a){return this.createElementNSPlus("Opacity",{value:a})},Size:function(a){return this.createElementNSPlus("Size",{value:a})},Rotation:function(a){return this.createElementNSPlus("Rotation",{value:a})},OnlineResource:function(a){return this.createElementNSPlus("OnlineResource",{attributes:{"xlink:type":"simple","xlink:href":a}})},Format:function(a){return this.createElementNSPlus("Format",{value:a})}}},OpenLayers.Format.Filter.v1_0_0.prototype.writers),CLASS_NAME:"OpenLayers.Format.SLD.v1"});OpenLayers.Format.WFST.v1_0_0=OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0,OpenLayers.Format.WFST.v1,{version:"1.0.0",schemaLocations:{wfs:"http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"},initialize:function(a){OpenLayers.Format.Filter.v1_0_0.prototype.initialize.apply(this,[a]);OpenLayers.Format.WFST.v1.prototype.initialize.apply(this,[a])},readers:{wfs:OpenLayers.Util.applyDefaults({WFS_TransactionResponse:function(a,b){b.insertIds=[];b.success=false;this.readChildNodes(a,b)},InsertResult:function(b,a){var d={fids:[]};this.readChildNodes(b,d);a.insertIds.push(d.fids[0])},TransactionResult:function(a,b){this.readChildNodes(a,b)},Status:function(a,b){this.readChildNodes(a,b)},SUCCESS:function(a,b){b.success=true}},OpenLayers.Format.WFST.v1.prototype.readers.wfs),gml:OpenLayers.Format.GML.v2.prototype.readers.gml,feature:OpenLayers.Format.GML.v2.prototype.readers.feature,ogc:OpenLayers.Format.Filter.v1_0_0.prototype.readers.ogc},writers:{wfs:OpenLayers.Util.applyDefaults({Query:function(b){b=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},b);var e=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(b.featureNS?b.featurePrefix+":":"")+b.featureType}});if(b.featureNS){e.setAttribute("xmlns:"+b.featurePrefix,b.featureNS)}if(b.propertyNames){for(var d=0,a=b.propertyNames.length;d<a;d++){this.writeNode("ogc:PropertyName",{property:b.propertyNames[d]},e)}}if(b.filter){this.setFilterProperty(b.filter);this.writeNode("ogc:Filter",b.filter,e)}return e}},OpenLayers.Format.WFST.v1.prototype.writers.wfs),gml:OpenLayers.Format.GML.v2.prototype.writers.gml,feature:OpenLayers.Format.GML.v2.prototype.writers.feature,ogc:OpenLayers.Format.Filter.v1_0_0.prototype.writers.ogc},CLASS_NAME:"OpenLayers.Format.WFST.v1_0_0"});OpenLayers.Format.WFST.v1_1_0=OpenLayers.Class(OpenLayers.Format.Filter.v1_1_0,OpenLayers.Format.WFST.v1,{version:"1.1.0",schemaLocations:{wfs:"http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"},initialize:function(a){OpenLayers.Format.Filter.v1_1_0.prototype.initialize.apply(this,[a]);OpenLayers.Format.WFST.v1.prototype.initialize.apply(this,[a])},readers:{wfs:OpenLayers.Util.applyDefaults({TransactionResponse:function(a,b){b.insertIds=[];b.success=false;this.readChildNodes(a,b)},TransactionSummary:function(a,b){b.success=true},InsertResults:function(a,b){this.readChildNodes(a,b)},Feature:function(b,a){var d={fids:[]};this.readChildNodes(b,d);a.insertIds.push(d.fids[0])}},OpenLayers.Format.WFST.v1.prototype.readers.wfs),gml:OpenLayers.Format.GML.v3.prototype.readers.gml,feature:OpenLayers.Format.GML.v3.prototype.readers.feature,ogc:OpenLayers.Format.Filter.v1_1_0.prototype.readers.ogc},writers:{wfs:OpenLayers.Util.applyDefaults({Query:function(b){b=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},b);var e=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(b.featureNS?b.featurePrefix+":":"")+b.featureType,srsName:b.srsName}});if(b.featureNS){e.setAttribute("xmlns:"+b.featurePrefix,b.featureNS)}if(b.propertyNames){for(var d=0,a=b.propertyNames.length;d<a;d++){this.writeNode("wfs:PropertyName",{property:b.propertyNames[d]},e)}}if(b.filter){this.setFilterProperty(b.filter);this.writeNode("ogc:Filter",b.filter,e)}return e},PropertyName:function(a){return this.createElementNSPlus("wfs:PropertyName",{value:a.property})}},OpenLayers.Format.WFST.v1.prototype.writers.wfs),gml:OpenLayers.Format.GML.v3.prototype.writers.gml,feature:OpenLayers.Format.GML.v3.prototype.writers.feature,ogc:OpenLayers.Format.Filter.v1_1_0.prototype.writers.ogc},CLASS_NAME:"OpenLayers.Format.WFST.v1_1_0"});OpenLayers.Format.SLD.v1_0_0=OpenLayers.Class(OpenLayers.Format.SLD.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd",initialize:function(a){OpenLayers.Format.SLD.v1.prototype.initialize.apply(this,[a])},CLASS_NAME:"OpenLayers.Format.SLD.v1_0_0"});OpenLayers.Protocol.WFS.v1_0_0=OpenLayers.Class(OpenLayers.Protocol.WFS.v1,{version:"1.0.0",CLASS_NAME:"OpenLayers.Protocol.WFS.v1_0_0"});OpenLayers.Protocol.WFS.v1_1_0=OpenLayers.Class(OpenLayers.Protocol.WFS.v1,{version:"1.1.0",CLASS_NAME:"OpenLayers.Protocol.WFS.v1_1_0"});Proj4js={defaultDatum:"WGS84",proxyScript:null,defsLookupService:"http://spatialreference.org/ref",libPath:"../lib/",transform:function(e,b,a){if(!e.readyToUse||!b.readyToUse){this.reportError("Proj4js initialization for "+e.srsCode+" not yet complete");return}if(a.transformed){this.log("point already transformed");return}if((e.srsProjNumber=="900913"&&b.datumCode!="WGS84")||(b.srsProjNumber=="900913"&&e.datumCode!="WGS84")){var d=Proj4js.WGS84;this.transform(e,d,a);a.transformed=false;e=d}if(e.projName=="longlat"){a.x*=Proj4js.common.D2R;a.y*=Proj4js.common.D2R}else{if(e.to_meter){a.x*=e.to_meter;a.y*=e.to_meter}e.inverse(a)}if(e.from_greenwich){a.x+=e.from_greenwich}a=this.datum_transform(e.datum,b.datum,a);if(b.from_greenwich){a.x-=b.from_greenwich}if(b.projName=="longlat"){a.x*=Proj4js.common.R2D;a.y*=Proj4js.common.R2D}else{b.forward(a);if(b.to_meter){a.x/=b.to_meter;a.y/=b.to_meter}}a.transformed=true;return a},datum_transform:function(d,b,a){if(d.compare_datums(b)){return a}if(d.datum_type==Proj4js.common.PJD_NODATUM||b.datum_type==Proj4js.common.PJD_NODATUM){return a}if(d.datum_type==Proj4js.common.PJD_GRIDSHIFT){alert("ERROR: Grid shift transformations are not implemented yet.")}if(b.datum_type==Proj4js.common.PJD_GRIDSHIFT){alert("ERROR: Grid shift transformations are not implemented yet.")}if(d.es!=b.es||d.a!=b.a||d.datum_type==Proj4js.common.PJD_3PARAM||d.datum_type==Proj4js.common.PJD_7PARAM||b.datum_type==Proj4js.common.PJD_3PARAM||b.datum_type==Proj4js.common.PJD_7PARAM){d.geodetic_to_geocentric(a);if(d.datum_type==Proj4js.common.PJD_3PARAM||d.datum_type==Proj4js.common.PJD_7PARAM){d.geocentric_to_wgs84(a)}if(b.datum_type==Proj4js.common.PJD_3PARAM||b.datum_type==Proj4js.common.PJD_7PARAM){b.geocentric_from_wgs84(a)}b.geocentric_to_geodetic(a)}if(b.datum_type==Proj4js.common.PJD_GRIDSHIFT){alert("ERROR: Grid shift transformations are not implemented yet.")}return a},reportError:function(a){},log:function(a){},loadProjDefinition:function(d){if(this.defs[d.srsCode]){return this.defs[d.srsCode]}var b={method:"get",asynchronous:false,onSuccess:this.defsLoadedFromDisk.bind(this,d.srsCode)};var a=this.libPath+"defs/"+d.srsAuth.toUpperCase()+d.srsProjNumber+".js";new OpenLayers.Ajax.Request(a,b);if(this.defs[d.srsCode]){return this.defs[d.srsCode]}if(this.proxyScript){var a=this.proxyScript+this.defsLookupService+"/"+d.srsAuth+"/"+d.srsProjNumber+"/proj4";b.onSuccess=this.defsLoadedFromService.bind(this,d.srsCode);b.onFailure=this.defsFailed.bind(this,d.srsCode);new OpenLayers.Ajax.Request(a,b)}return this.defs[d.srsCode]},defsLoadedFromDisk:function(srsCode,transport){eval(transport.responseText)},defsLoadedFromService:function(a,b){this.defs[a]=b.responseText},defsFailed:function(a){this.reportError("failed to load projection definition for: "+a);OpenLayers.Util.extend(this.defs[a],this.defs.WGS84)},loadProjCode:function(d){if(this.Proj[d]){return}var b={method:"get",asynchronous:false,onSuccess:this.loadProjCodeSuccess.bind(this,d),onFailure:this.loadProjCodeFailure.bind(this,d)};var a=this.libPath+"projCode/"+d+".js";new OpenLayers.Ajax.Request(a,b)},loadProjCodeSuccess:function(projName,transport){eval(transport.responseText);if(this.Proj[projName].dependsOn){this.loadProjCode(this.Proj[projName].dependsOn)}},loadProjCodeFailure:function(a){Proj4js.reportError("failed to find projection file for: "+a)}};Proj4js.Proj=OpenLayers.Class({readyToUse:false,title:null,projName:null,units:null,datum:null,initialize:function(b){this.srsCode=b.toUpperCase();if(this.srsCode.indexOf("EPSG")==0){this.srsCode=this.srsCode;this.srsAuth="epsg";this.srsProjNumber=this.srsCode.substring(5)}else{this.srsAuth="";this.srsProjNumber=this.srsCode}var a=Proj4js.loadProjDefinition(this);if(a){this.parseDefs(a);Proj4js.loadProjCode(this.projName);this.callInit()}},callInit:function(){Proj4js.log("projection script loaded for:"+this.projName);OpenLayers.Util.extend(this,Proj4js.Proj[this.projName]);this.init();this.mapXYToLonLat=this.inverse;this.lonLatToMapXY=this.forward;this.readyToUse=true},parseDefs:function(b){this.defData=b;var g,d;var a=this.defData.split("+");for(var h=0;h<a.length;h++){var e=a[h].split("=");g=e[0].toLowerCase();d=e[1];switch(g.replace(/\s/gi,"")){case"":break;case"title":this.title=d;break;case"proj":this.projName=d.replace(/\s/gi,"");break;case"units":this.units=d.replace(/\s/gi,"");break;case"datum":this.datumCode=d.replace(/\s/gi,"");break;case"nadgrids":this.nagrids=d.replace(/\s/gi,"");break;case"ellps":this.ellps=d.replace(/\s/gi,"");break;case"a":this.a=parseFloat(d);break;case"b":this.b=parseFloat(d);break;case"lat_0":this.lat0=d*Proj4js.common.D2R;break;case"lat_1":this.lat1=d*Proj4js.common.D2R;break;case"lat_2":this.lat2=d*Proj4js.common.D2R;break;case"lat_ts":this.lat_ts=d*Proj4js.common.D2R;break;case"lon_0":this.long0=d*Proj4js.common.D2R;break;case"x_0":this.x0=parseFloat(d);break;case"y_0":this.y0=parseFloat(d);break;case"k_0":this.k0=parseFloat(d);break;case"k":this.k0=parseFloat(d);break;case"R_A":this.R=parseFloat(d);break;case"zone":this.zone=parseInt(d);break;case"south":this.utmSouth=true;break;case"towgs84":this.datum_params=d.split(",");break;case"to_meter":this.to_meter=parseFloat(d);break;case"from_greenwich":this.from_greenwich=d*Proj4js.common.D2R;break;case"pm":d=d.replace(/\s/gi,"");this.from_greenwich=Proj4js.PrimeMeridian[d]?Proj4js.PrimeMeridian[d]*Proj4js.common.D2R:0;break;case"no_defs":break;default:Proj4js.log("Unrecognized parameter: "+g)}}this.deriveConstants()},deriveConstants:function(){if(this.nagrids=="@null"){this.datumCode="none"}if(this.datumCode&&this.datumCode!="none"){var a=Proj4js.Datum[this.datumCode];if(a){this.datum_params=a.towgs84.split(",");this.ellps=a.ellipse;this.datumName=a.datumName}}if(!this.a){var b=Proj4js.Ellipsoid[this.ellps]?Proj4js.Ellipsoid[this.ellps]:Proj4js.Ellipsoid.WGS84;OpenLayers.Util.extend(this,b)}if(this.rf&&!this.b){this.b=(1-1/this.rf)*this.a}if(Math.abs(this.a-this.b)<Proj4js.common.EPSLN){this.sphere=true}this.a2=this.a*this.a;this.b2=this.b*this.b;this.es=(this.a2-this.b2)/this.a2;this.e=Math.sqrt(this.es);this.ep2=(this.a2-this.b2)/this.b2;if(!this.k0){this.k0=1}this.datum=new Proj4js.datum(this)}});Proj4js.Proj.longlat={init:function(){},forward:function(a){return a},inverse:function(a){return a}};Proj4js.defs={WGS84:"+title=long/lat:WGS84 +proj=longlat +ellps=WGS84 +datum=WGS84","EPSG:4326":"+title=long/lat:WGS84 +proj=longlat +a=6378137.0 +b=6356752.31424518 +ellps=WGS84 +datum=WGS84","EPSG:4269":"+title=long/lat:NAD83 +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83"};Proj4js.common={PI:Math.PI,HALF_PI:Math.PI*0.5,TWO_PI:Math.PI*2,FORTPI:0.7853981633974483,R2D:57.2957795131,D2R:0.0174532925199,SEC_TO_RAD:0.00000484813681109536,EPSLN:1e-10,MAX_ITER:20,COS_67P5:0.3826834323650898,AD_C:1.0026,PJD_UNKNOWN:0,PJD_3PARAM:1,PJD_7PARAM:2,PJD_GRIDSHIFT:3,PJD_WGS84:4,PJD_NODATUM:5,SRS_WGS84_SEMIMAJOR:6378137,msfnz:function(d,b,e){var a=d*b;return e/(Math.sqrt(1-a*a))},tsfnz:function(g,e,d){var a=g*d;var b=0.5*g;a=Math.pow(((1-a)/(1+a)),b);return(Math.tan(0.5*(this.HALF_PI-e))/a)},phi2z:function(h,g){var e=0.5*h;var a,b;var d=this.HALF_PI-2*Math.atan(g);for(i=0;i<=15;i++){a=h*Math.sin(d);b=this.HALF_PI-2*Math.atan(g*(Math.pow(((1-a)/(1+a)),e)))-d;d+=b;if(Math.abs(b)<=1e-10){return d}}alert("phi2z has NoConvergence");return(-9999)},qsfnz:function(d,b,e){var a;if(d>1e-7){a=d*b;return((1-d*d)*(b/(1-a*a)-(0.5/d)*Math.log((1-a)/(1+a))))}else{return(2*b)}},asinz:function(a){if(Math.abs(a)>1){a=(a>1)?1:-1}return Math.asin(a)},e0fn:function(a){return(1-0.25*a*(1+a/16*(3+1.25*a)))},e1fn:function(a){return(0.375*a*(1+0.25*a*(1+0.46875*a)))},e2fn:function(a){return(0.05859375*a*a*(1+0.75*a))},e3fn:function(a){return(a*a*a*(35/3072))},mlfn:function(g,e,d,b,a){return(g*a-e*Math.sin(2*a)+d*Math.sin(4*a)-b*Math.sin(6*a))},srat:function(a,b){return(Math.pow((1-a)/(1+a),b))},sign:function(a){if(a<0){return(-1)}else{return(1)}},adjust_lon:function(a){a=(Math.abs(a)<this.PI)?a:(a-(this.sign(a)*this.TWO_PI));return a}};Proj4js.datum=OpenLayers.Class({initialize:function(b){this.datum_type=Proj4js.common.PJD_WGS84;if(b.datumCode&&b.datumCode=="none"){this.datum_type=Proj4js.common.PJD_NODATUM}if(b&&b.datum_params){for(var a=0;a<b.datum_params.length;a++){b.datum_params[a]=parseFloat(b.datum_params[a])}if(b.datum_params[0]!=0||b.datum_params[1]!=0||b.datum_params[2]!=0){this.datum_type=Proj4js.common.PJD_3PARAM}if(b.datum_params.length>3){if(b.datum_params[3]!=0||b.datum_params[4]!=0||b.datum_params[5]!=0||b.datum_params[6]!=0){this.datum_type=Proj4js.common.PJD_7PARAM;b.datum_params[3]*=Proj4js.common.SEC_TO_RAD;b.datum_params[4]*=Proj4js.common.SEC_TO_RAD;b.datum_params[5]*=Proj4js.common.SEC_TO_RAD;b.datum_params[6]=(b.datum_params[6]/1000000)+1}}}if(b){this.a=b.a;this.b=b.b;this.es=b.es;this.ep2=b.ep2;this.datum_params=b.datum_params}},compare_datums:function(a){if(this.datum_type!=a.datum_type){return false}else{if(this.a!=a.a||Math.abs(this.es-a.es)>5e-11){return false}else{if(this.datum_type==Proj4js.common.PJD_3PARAM){return(this.datum_params[0]==a.datum_params[0]&&this.datum_params[1]==a.datum_params[1]&&this.datum_params[2]==a.datum_params[2])}else{if(this.datum_type==Proj4js.common.PJD_7PARAM){return(this.datum_params[0]==a.datum_params[0]&&this.datum_params[1]==a.datum_params[1]&&this.datum_params[2]==a.datum_params[2]&&this.datum_params[3]==a.datum_params[3]&&this.datum_params[4]==a.datum_params[4]&&this.datum_params[5]==a.datum_params[5]&&this.datum_params[6]==a.datum_params[6])}else{if(this.datum_type==Proj4js.common.PJD_GRIDSHIFT){return strcmp(pj_param(this.params,"snadgrids").s,pj_param(a.params,"snadgrids").s)==0}else{return true}}}}}},geodetic_to_geocentric:function(d){var s=d.x;var m=d.y;var e=d.z?d.z:0;var g;var b;var a;var q=0;var r;var o;var l;var h;if(m<-Proj4js.common.HALF_PI&&m>-1.001*Proj4js.common.HALF_PI){m=-Proj4js.common.HALF_PI}else{if(m>Proj4js.common.HALF_PI&&m<1.001*Proj4js.common.HALF_PI){m=Proj4js.common.HALF_PI}else{if((m<-Proj4js.common.HALF_PI)||(m>Proj4js.common.HALF_PI)){Proj4js.reportError("geocent:lat out of range:"+m);return null}}}if(s>Proj4js.common.PI){s-=(2*Proj4js.common.PI)}o=Math.sin(m);h=Math.cos(m);l=o*o;r=this.a/(Math.sqrt(1-this.es*l));g=(r+e)*h*Math.cos(s);b=(r+e)*h*Math.sin(s);a=((r*(1-this.es))+e)*o;d.x=g;d.y=b;d.z=a;return q},geocentric_to_geodetic:function(C){var H=1e-12;var D=(H*H);var h=30;var s;var m;var a;var u;var b;var t;var r;var G;var F;var q;var z;var w;var g;var E;var l=C.x;var e=C.y;var d=C.z?C.z:0;var o;var B;var v;g=false;s=Math.sqrt(l*l+e*e);m=Math.sqrt(l*l+e*e+d*d);if(s/this.a<H){g=true;o=0;if(m/this.a<H){B=Proj4js.common.HALF_PI;v=-this.b;return}}else{o=Math.atan2(e,l)}a=d/m;u=s/m;b=1/Math.sqrt(1-this.es*(2-this.es)*u*u);G=u*(1-this.es)*b;F=a*b;E=0;do{E++;r=this.a/Math.sqrt(1-this.es*F*F);v=s*G+d*F-r*(1-this.es*F*F);t=this.es*r/(r+v);b=1/Math.sqrt(1-t*(2-t)*u*u);q=u*(1-t)*b;z=a*b;w=z*G-q*F;G=q;F=z}while(w*w>D&&E<h);B=Math.atan(z/Math.abs(q));C.x=o;C.y=B;C.z=v;return C},geocentric_to_geodetic_noniter:function(B){var e=B.x;var d=B.y;var a=B.z?B.z:0;var l;var z;var s;var g;var u;var w;var t;var q;var m;var o;var E;var h;var D;var C;var v;var r;var b;e=parseFloat(e);d=parseFloat(d);a=parseFloat(a);b=false;if(e!=0){l=Math.atan2(d,e)}else{if(d>0){l=Proj4js.common.HALF_PI}else{if(d<0){l=-Proj4js.common.HALF_PI}else{b=true;l=0;if(a>0){z=Proj4js.common.HALF_PI}else{if(a<0){z=-Proj4js.common.HALF_PI}else{z=Proj4js.common.HALF_PI;s=-this.b;return}}}}}u=e*e+d*d;g=Math.sqrt(u);w=a*Proj4js.common.AD_C;q=Math.sqrt(w*w+u);o=w/q;h=g/q;E=o*o*o;t=a+this.b*this.ep2*E;r=g-this.a*this.es*h*h*h;m=Math.sqrt(t*t+r*r);D=t/m;C=r/m;v=this.a/Math.sqrt(1-this.es*D*D);if(C>=Proj4js.common.COS_67P5){s=g/C-v}else{if(C<=-Proj4js.common.COS_67P5){s=g/-C-v}else{s=a/D+v*(this.es-1)}}if(b==false){z=Math.atan(D/C)}B.x=l;B.y=z;B.z=s;return B},geocentric_to_wgs84:function(b){if(this.datum_type==Proj4js.common.PJD_3PARAM){b.x+=this.datum_params[0];b.y+=this.datum_params[1];b.z+=this.datum_params[2]}else{var h=this.datum_params[0];var e=this.datum_params[1];var o=this.datum_params[2];var g=this.datum_params[3];var q=this.datum_params[4];var m=this.datum_params[5];var l=this.datum_params[6];var d=l*(b.x-m*b.y+q*b.z)+h;var a=l*(m*b.x+b.y-g*b.z)+e;var r=l*(-q*b.x+g*b.y+b.z)+o;b.x=d;b.y=a;b.z=r}},geocentric_from_wgs84:function(d){if(this.datum_type==Proj4js.common.PJD_3PARAM){d.x-=this.datum_params[0];d.y-=this.datum_params[1];d.z-=this.datum_params[2]}else{var l=this.datum_params[0];var e=this.datum_params[1];var q=this.datum_params[2];var h=this.datum_params[3];var r=this.datum_params[4];var o=this.datum_params[5];var m=this.datum_params[6];var g=(d.x-l)/m;var b=(d.y-e)/m;var a=(d.z-q)/m;d.x=g+o*b-r*a;d.y=-o*g+b+h*a;d.z=r*g-h*b+a}}});Proj4js.Point=OpenLayers.Class({initialize:function(a,d,b){if(typeof a=="object"){this.x=a[0];this.y=a[1];this.z=a[2]||0}else{this.x=a;this.y=d;this.z=b||0}},clone:function(){return new Proj4js.Point(this.x,this.y,this.z)},toString:function(){return("x="+this.x+",y="+this.y)},toShortString:function(){return(this.x+", "+this.y)}});Proj4js.PrimeMeridian={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};Proj4js.Ellipsoid={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},"APL4.":{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS72:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};Proj4js.Datum={WGS84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:""},GGRS87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},NAD83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},NAD27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},OSGB36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"}};Proj4js.WGS84=new Proj4js.Proj("WGS84");Proj4js.Datum.OSB36=Proj4js.Datum.OSGB36;Proj4js.Proj.sterea={dependsOn:"gauss",init:function(){Proj4js.Proj.gauss.init.apply(this);if(!this.rc){Proj4js.reportError("sterea:init:E_ERROR_0");return}this.sinc0=Math.sin(this.phic0);this.cosc0=Math.cos(this.phic0);this.R2=2*this.rc;if(!this.title){this.title="Oblique Stereographic Alternative"}},forward:function(a){a.x=Proj4js.common.adjust_lon(a.x-this.long0);Proj4js.Proj.gauss.forward.apply(this,[a]);sinc=Math.sin(a.y);cosc=Math.cos(a.y);cosl=Math.cos(a.x);k=this.k0*this.R2/(1+this.sinc0*sinc+this.cosc0*cosc*cosl);a.x=k*cosc*Math.sin(a.x);a.y=k*(this.cosc0*sinc-this.sinc0*cosc*cosl);a.x=this.a*a.x+this.x0;a.y=this.a*a.y+this.y0;return a},inverse:function(b){var d,a;b.x=(b.x-this.x0)/this.a;b.y=(b.y-this.y0)/this.a;b.x/=this.k0;b.y/=this.k0;if((rho=Math.sqrt(b.x*b.x+b.y*b.y))){c=2*Math.atan2(rho,this.R2);sinc=Math.sin(c);cosc=Math.cos(c);a=Math.asin(cosc*this.sinc0+b.y*sinc*this.cosc0/rho);d=Math.atan2(b.x*sinc,rho*this.cosc0*cosc-b.y*this.sinc0*sinc)}else{a=this.phic0;d=0}b.x=d;b.y=a;Proj4js.Proj.gauss.inverse.apply(this,[b]);b.x=Proj4js.common.adjust_lon(b.x+this.long0);return b}};Proj4js.Proj.aea={init:function(){if(Math.abs(this.lat1+this.lat2)<Proj4js.common.EPSLN){Proj4js.reportError("aeaInitEqualLatitudes");return}this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e3=Math.sqrt(this.es);this.sin_po=Math.sin(this.lat1);this.cos_po=Math.cos(this.lat1);this.t1=this.sin_po;this.con=this.sin_po;this.ms1=Proj4js.common.msfnz(this.e3,this.sin_po,this.cos_po);this.qs1=Proj4js.common.qsfnz(this.e3,this.sin_po,this.cos_po);this.sin_po=Math.sin(this.lat2);this.cos_po=Math.cos(this.lat2);this.t2=this.sin_po;this.ms2=Proj4js.common.msfnz(this.e3,this.sin_po,this.cos_po);this.qs2=Proj4js.common.qsfnz(this.e3,this.sin_po,this.cos_po);this.sin_po=Math.sin(this.lat0);this.cos_po=Math.cos(this.lat0);this.t3=this.sin_po;this.qs0=Proj4js.common.qsfnz(this.e3,this.sin_po,this.cos_po);if(Math.abs(this.lat1-this.lat2)>Proj4js.common.EPSLN){this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1)}else{this.ns0=this.con}this.c=this.ms1*this.ms1+this.ns0*this.qs1;this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0},forward:function(g){var h=g.x;var e=g.y;this.sin_phi=Math.sin(e);this.cos_phi=Math.cos(e);var b=Proj4js.common.qsfnz(this.e3,this.sin_phi,this.cos_phi);var m=this.a*Math.sqrt(this.c-this.ns0*b)/this.ns0;var d=this.ns0*Proj4js.common.adjust_lon(h-this.long0);var a=m*Math.sin(d)+this.x0;var l=this.rh-m*Math.cos(d)+this.y0;g.x=a;g.y=l;return g},inverse:function(g){var l,a,b,d,h,e;g.x-=this.x0;g.y=this.rh-g.y+this.y0;if(this.ns0>=0){l=Math.sqrt(g.x*g.x+g.y*g.y);b=1}else{l=-Math.sqrt(g.x*g.x+g.y*g.y);b=-1}d=0;if(l!=0){d=Math.atan2(b*g.x,b*g.y)}b=l*this.ns0/this.a;a=(this.c-b*b)/this.ns0;if(this.e3>=1e-10){b=1-0.5*(1-this.es)*Math.log((1-this.e3)/(1+this.e3))/this.e3;if(Math.abs(Math.abs(b)-Math.abs(a))>1e-10){e=this.phi1z(this.e3,a)}else{if(a>=0){e=0.5*PI}else{e=-0.5*PI}}}else{e=this.phi1z(e3,a)}h=Proj4js.common.adjust_lon(d/this.ns0+this.long0);g.x=h;g.y=e;return g},phi1z:function(m,a){var b,d,e;var l=Proj4js.common.asinz(0.5*a);if(m<Proj4js.common.EPSLN){return l}var h=m*m;for(var g=1;g<=25;g++){sinphi=Math.sin(l);cosphi=Math.cos(l);b=m*sinphi;d=1-b*b;e=0.5*d*d/cosphi*(a/(1-h)-sinphi/d+0.5/m*Math.log((1-b)/(1+b)));l=l+e;if(Math.abs(e)<=1e-7){return l}}Proj4js.reportError("aea:phi1z:Convergence error");return null}};function phi4z(e,o,m,l,h,D,C,B,g){var p,z,v,w,t,s,r,q,d,u;g=D;for(u=1;u<=15;u++){p=Math.sin(g);tanphi=Math.tan(g);B=tanphi*Math.sqrt(1-e*p*p);z=Math.sin(2*g);w=o*g-m*z+l*Math.sin(4*g)-h*Math.sin(6*g);t=o-2*m*Math.cos(2*g)+4*l*Math.cos(4*g)-6*h*Math.cos(6*g);s=2*w+B*(w*w+C)-2*D*(B*w+1);r=e*z*(w*w+C-2*D*w)/(2*B);q=2*(D-w)*(B*t-2/z)-2*t;d=s/(r+q);g+=d;if(Math.abs(d)<=1e-10){return(g)}}Proj4js.reportError("phi4z: No convergence");return null}function e4fn(a){var b,d;b=1+a;d=1-a;return(Math.sqrt((Math.pow(b,b))*(Math.pow(d,d))))}Proj4js.Proj.poly={init:function(){var a;if(this.lat0=0){this.lat0=90}this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=Proj4js.common.e0fn(this.es);this.e1=Proj4js.common.e1fn(this.es);this.e2=Proj4js.common.e2fn(this.es);this.e3=Proj4js.common.e3fn(this.es);this.ml0=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(e){var a,h;var m;var q;var g,l;var d;var s,r;var b=e.x;var o=e.y;g=Proj4js.common.adjust_lon(b-this.long0);if(Math.abs(o)<=1e-7){s=this.x0+this.a*g;r=this.y0-this.a*this.ml0}else{a=Math.sin(o);h=Math.cos(o);l=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,o);d=Proj4js.common.msfnz(this.e,a,h);g=a;s=this.x0+this.a*d*Math.sin(g)/a;r=this.y0+this.a*(l-this.ml0+d*(1-Math.cos(g))/a)}e.x=s;e.y=r;return e},inverse:function(d){var r,l;var h;var s;var o;var e,g;var q;var a,m;d.x-=this.x0;d.y-=this.y0;h=this.ml0+d.y/this.a;q=0;if(Math.abs(h)<=1e-7){a=d.x/this.a+this.long0;m=0}else{s=h*h+(d.x/this.a)*(d.x/this.a);q=phi4z(this.es,this.e0,this.e1,this.e2,this.e3,this.al,s,o,m);if(q!=1){return(q)}a=Proj4js.common.adjust_lon((asinz(d.x*o/this.a)/Math.sin(m))+this.long0)}d.x=a;d.y=m;return d}};Proj4js.Proj.equi={init:function(){if(!this.x0){this.x0=0}if(!this.y0){this.y0=0}if(!this.lat0){this.lat0=0}if(!this.long0){this.long0=0}},forward:function(e){var g=e.x;var d=e.y;var b=Proj4js.common.adjust_lon(g-this.long0);var a=this.x0+this.a*b*Math.cos(this.lat0);var h=this.y0+this.a*d;this.t1=a;this.t2=Math.cos(this.lat0);e.x=a;e.y=h;return e},inverse:function(b){b.x-=this.x0;b.y-=this.y0;var a=b.y/this.a;if(Math.abs(a)>Proj4js.common.HALF_PI){Proj4js.reportError("equi:Inv:DataError")}var d=Proj4js.common.adjust_lon(this.long0+b.x/(this.a*Math.cos(this.lat0)));b.x=d;b.y=a}};Proj4js.Proj.merc={init:function(){if(this.lat_ts){if(this.sphere){this.k0=Math.cos(this.lat_ts)}else{this.k0=Proj4js.common.msfnz(this.es,Math.sin(this.lat_ts),Math.cos(this.lat_ts))}}},forward:function(g){var h=g.x;var e=g.y;if(e*Proj4js.common.R2D>90&&e*Proj4js.common.R2D<-90&&h*Proj4js.common.R2D>180&&h*Proj4js.common.R2D<-180){Proj4js.reportError("merc:forward: llInputOutOfRange: "+h+" : "+e);return null}var a,l;if(Math.abs(Math.abs(e)-Proj4js.common.HALF_PI)<=Proj4js.common.EPSLN){Proj4js.reportError("merc:forward: ll2mAtPoles");return null}else{if(this.sphere){a=this.x0+this.a*this.k0*Proj4js.common.adjust_lon(h-this.long0);l=this.y0+this.a*this.k0*Math.log(Math.tan(Proj4js.common.FORTPI+0.5*e))}else{var d=Math.sin(e);var b=Proj4js.common.tsfnz(this.e,e,d);a=this.x0+this.a*this.k0*Proj4js.common.adjust_lon(h-this.long0);l=this.y0-this.a*this.k0*Math.log(b)}g.x=a;g.y=l;return g}},inverse:function(e){var a=e.x-this.x0;var h=e.y-this.y0;var g,d;if(this.sphere){d=Proj4js.common.HALF_PI-2*Math.atan(Math.exp(-h/this.a*this.k0))}else{var b=Math.exp(-h/(this.a*this.k0));d=Proj4js.common.phi2z(this.e,b);if(d==-9999){Proj4js.reportError("merc:inverse: lat = -9999");return null}}g=Proj4js.common.adjust_lon(this.long0+a/(this.a*this.k0));e.x=g;e.y=d;return e}};Proj4js.Proj.utm={dependsOn:"tmerc",init:function(){if(!this.zone){Proj4js.reportError("utm:init: zone must be specified for UTM");return}this.lat0=0;this.long0=((6*Math.abs(this.zone))-183)*Proj4js.common.D2R;this.x0=500000;this.y0=this.utmSouth?10000000:0;this.k0=0.9996;Proj4js.Proj.tmerc.init.apply(this);this.forward=Proj4js.Proj.tmerc.forward;this.inverse=Proj4js.Proj.tmerc.inverse}};Proj4js.Proj.eqdc={init:function(){if(!this.mode){this.mode=0}this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=Proj4js.common.e0fn(this.es);this.e1=Proj4js.common.e1fn(this.es);this.e2=Proj4js.common.e2fn(this.es);this.e3=Proj4js.common.e3fn(this.es);this.sinphi=Math.sin(this.lat1);this.cosphi=Math.cos(this.lat1);this.ms1=Proj4js.common.msfnz(this.e,this.sinphi,this.cosphi);this.ml1=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat1);if(this.mode!=0){if(Math.abs(this.lat1+this.lat2)<Proj4js.common.EPSLN){Proj4js.reportError("eqdc:Init:EqualLatitudes")}this.sinphi=Math.sin(this.lat2);this.cosphi=Math.cos(this.lat2);this.ms2=Proj4js.common.msfnz(this.e,this.sinphi,this.cosphi);this.ml2=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat2);if(Math.abs(this.lat1-this.lat2)>=Proj4js.common.EPSLN){this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)}else{this.ns=this.sinphi}}else{this.ns=this.sinphi}this.g=this.ml1+this.ms1/this.ns;this.ml0=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0);this.rh=this.a*(this.g-this.ml0)},forward:function(e){var g=e.x;var d=e.y;var m=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,d);var l=this.a*(this.g-m);var b=this.ns*Proj4js.common.adjust_lon(g-this.long0);var a=this.x0+l*Math.sin(b);var h=this.y0+this.rh-l*Math.cos(b);e.x=a;e.y=h;return e},inverse:function(e){e.x-=this.x0;e.y=this.rh-e.y+this.y0;var a,l;if(this.ns>=0){var l=Math.sqrt(e.x*e.x+e.y*e.y);var a=1}else{l=-Math.sqrt(e.x*e.x+e.y*e.y);a=-1}var b=0;if(l!=0){b=Math.atan2(a*e.x,a*e.y)}var h=this.g-l/this.a;var d=this.phi3z(this.ml,this.e0,this.e1,this.e2,this.e3);var g=Proj4js.common.adjust_lon(this.long0+b/this.ns);e.x=g;e.y=d;return e},phi3z:function(m,l,h,g,e){var d;var a;d=m;for(var b=0;b<15;b++){a=(m+h*Math.sin(2*d)-g*Math.sin(4*d)+e*Math.sin(6*d))/l-d;d+=a;if(Math.abs(a)<=1e-10){return d}}Proj4js.reportError("PHI3Z-CONV:Latitude failed to converge after 15 iterations");return null}};Proj4js.Proj.tmerc={init:function(){this.e0=Proj4js.common.e0fn(this.es);this.e1=Proj4js.common.e1fn(this.es);this.e2=Proj4js.common.e2fn(this.es);this.e3=Proj4js.common.e3fn(this.es);this.ml0=this.a*Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(d){var a=d.x;var s=d.y;var h=Proj4js.common.adjust_lon(a-this.long0);var e;var B,w;var z=Math.sin(s);var q=Math.cos(s);if(this.sphere){var v=q*Math.sin(h);if((Math.abs(Math.abs(v)-1))<1e-10){Proj4js.reportError("tmerc:forward: Point projects into infinity");return(93)}else{B=0.5*this.a*this.k0*Math.log((1+v)/(1-v));e=Math.acos(q*Math.cos(h)/Math.sqrt(1-v*v));if(s<0){e=-e}w=this.a*this.k0*(e-this.lat0)}}else{var o=q*h;var m=Math.pow(o,2);var r=this.ep2*Math.pow(q,2);var u=Math.tan(s);var C=Math.pow(u,2);e=1-this.es*Math.pow(z,2);var g=this.a/Math.sqrt(e);var l=this.a*Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,s);B=this.k0*g*o*(1+m/6*(1-C+r+m/20*(5-18*C+Math.pow(C,2)+72*r-58*this.ep2)))+this.x0;w=this.k0*(l-this.ml0+g*u*(m*(0.5+m/24*(5-C+9*r+4*Math.pow(r,2)+m/30*(61-58*C+Math.pow(C,2)+600*r-330*this.ep2)))))+this.y0}d.x=B;d.y=w;return d},inverse:function(D){var m,e;var M;var F;var s=6;var q,l;if(this.sphere){var I=Math.exp(D.x/(this.a*this.k0));var H=0.5*(I-1/I);var K=this.lat0+D.y/(this.a*this.k0);var G=Math.cos(K);m=Math.sqrt((1-G*G)/(1+H*H));q=Math.asinz(m);if(K<0){q=-q}if((H==0)&&(G==0)){l=this.long0}else{l=Proj4js.common.adjust_lon(Math.atan2(H,G)+this.long0)}}else{var v=D.x-this.x0;var u=D.y-this.y0;m=(this.ml0+u/this.k0)/this.a;e=m;for(F=0;;F++){M=((m+this.e1*Math.sin(2*e)-this.e2*Math.sin(4*e)+this.e3*Math.sin(6*e))/this.e0)-e;e+=M;if(Math.abs(M)<=Proj4js.common.EPSLN){break}if(F>=s){Proj4js.reportError("tmerc:inverse: Latitude failed to converge");return(95)}}if(Math.abs(e)<Proj4js.common.HALF_PI){var b=Math.sin(e);var N=Math.cos(e);var w=Math.tan(e);var L=this.ep2*Math.pow(N,2);var o=Math.pow(L,2);var z=Math.pow(w,2);var a=Math.pow(z,2);m=1-this.es*Math.pow(b,2);var E=this.a/Math.sqrt(m);var B=E*(1-this.es)/m;var J=v/(E*this.k0);var C=Math.pow(J,2);q=e-(E*w*C/B)*(0.5-C/24*(5+3*z+10*L-4*o-9*this.ep2-C/30*(61+90*z+298*L+45*a-252*this.ep2-3*o)));l=Proj4js.common.adjust_lon(this.long0+(J*(1-C/6*(1+2*z+L-C/20*(5-2*L+28*z-3*o+8*this.ep2+24*a)))/N))}else{q=Proj4js.common.HALF_PI*Proj4js.common.sign(u);l=this.long0}}D.x=l;D.y=q;return D}};Proj4js.defs.GOOGLE="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs";Proj4js.defs["EPSG:900913"]=Proj4js.defs.GOOGLE;Proj4js.Proj.ortho={init:function(a){this.sin_p14=Math.sin(this.lat0);this.cos_p14=Math.cos(this.lat0)},forward:function(d){var a,e;var s;var r;var h;var l;var b=d.x;var m=d.y;s=Proj4js.common.adjust_lon(b-this.long0);a=Math.sin(m);e=Math.cos(m);r=Math.cos(s);l=this.sin_p14*a+this.cos_p14*e*r;h=1;if((l>0)||(Math.abs(l)<=Proj4js.common.EPSLN)){var q=this.a*h*e*Math.sin(s);var o=this.y0+this.a*h*(this.cos_p14*a-this.sin_p14*e*r)}else{Proj4js.reportError("orthoFwdPointError")}d.x=q;d.y=o;return d},inverse:function(b){var l;var h;var e,o;var m;var d;var a,g;b.x-=this.x0;b.y-=this.y0;l=Math.sqrt(b.x*b.x+b.y*b.y);if(l>this.a+1e-7){Proj4js.reportError("orthoInvDataError")}h=Proj4js.common.asinz(l/this.a);e=Math.sin(h);cosi=Math.cos(h);a=this.long0;if(Math.abs(l)<=Proj4js.common.EPSLN){g=this.lat0}g=Proj4js.common.asinz(o*this.sin_p14+(y*e*this.cos_p14)/l);d=Math.abs(lat0)-Proj4js.common.HALF_PI;if(Math.abs(d)<=Proj4js.common.EPSLN){if(this.lat0>=0){a=Proj4js.common.adjust_lon(this.long0+Math.atan2(b.x,-b.y))}else{a=Proj4js.common.adjust_lon(this.long0-Math.atan2(-b.x,b.y))}}d=o-this.sin_p14*Math.sin(g);if((Math.abs(d)>=Proj4js.common.EPSLN)||(Math.abs(x)>=Proj4js.common.EPSLN)){a=Proj4js.common.adjust_lon(this.long0+Math.atan2((b.x*e*this.cos_p14),(d*l)))}b.x=a;b.y=g;return b}};Proj4js.Proj.stere={ssfn_:function(a,d,b){d*=b;return(Math.tan(0.5*(Proj4js.common.HALF_PI+a))*Math.pow((1-d)/(1+d),0.5*b))},TOL:1e-8,NITER:8,CONV:1e-10,S_POLE:0,N_POLE:1,OBLIQ:2,EQUIT:3,init:function(){this.phits=this.lat_ts?this.lat_ts:Proj4js.common.HALF_PI;var a=Math.abs(this.lat0);if((Math.abs(a)-Proj4js.common.HALF_PI)<Proj4js.common.EPSLN){this.mode=this.lat0<0?this.S_POLE:this.N_POLE}else{this.mode=a>Proj4js.common.EPSLN?this.OBLIQ:this.EQUIT}this.phits=Math.abs(this.phits);if(this.es){var b;switch(this.mode){case this.N_POLE:case this.S_POLE:if(Math.abs(this.phits-Proj4js.common.HALF_PI)<Proj4js.common.EPSLN){this.akm1=2*this.k0/Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e))}else{a=Math.sin(this.phits);this.akm1=Math.cos(this.phits)/Proj4js.common.tsfnz(this.e,this.phits,a);a*=this.e;this.akm1/=Math.sqrt(1-a*a)}break;case this.EQUIT:this.akm1=2*this.k0;break;case this.OBLIQ:a=Math.sin(this.lat0);b=2*Math.atan(this.ssfn_(this.lat0,a,this.e))-Proj4js.common.HALF_PI;a*=this.e;this.akm1=2*this.k0*Math.cos(this.lat0)/Math.sqrt(1-a*a);this.sinX1=Math.sin(b);this.cosX1=Math.cos(b);break}}else{switch(this.mode){case this.OBLIQ:this.sinph0=Math.sin(this.lat0);this.cosph0=Math.cos(this.lat0);case this.EQUIT:this.akm1=2*this.k0;break;case this.S_POLE:case this.N_POLE:this.akm1=Math.abs(this.phits-Proj4js.common.HALF_PI)>=Proj4js.common.EPSLN?Math.cos(this.phits)/Math.tan(Proj4js.common.FORTPI-0.5*this.phits):2*this.k0;break}}},forward:function(d){var b=d.x;var h=d.y;var o,l;if(this.sphere){var a,e,m,g;a=Math.sin(h);e=Math.cos(h);m=Math.cos(b);g=Math.sin(b);switch(this.mode){case this.EQUIT:l=1+e*m;if(l<=Proj4js.common.EPSLN){F_ERROR}l=this.akm1/l;o=l*e*g;l*=a;break;case this.OBLIQ:l=1+this.sinph0*a+this.cosph0*e*m;if(l<=Proj4js.common.EPSLN){F_ERROR}l=this.akm1/l;o=l*e*g;l*=this.cosph0*a-this.sinph0*e*m;break;case this.N_POLE:m=-m;h=-h;case this.S_POLE:if(Math.abs(h-Proj4js.common.HALF_PI)<this.TOL){F_ERROR}l=this.akm1*Math.tan(Proj4js.common.FORTPI+0.5*h);o=g*l;l*=m;break}}else{m=Math.cos(b);g=Math.sin(b);a=Math.sin(h);if(this.mode==this.OBLIQ||this.mode==this.EQUIT){X=2*Math.atan(this.ssfn_(h,a,this.e));sinX=Math.sin(X-Proj4js.common.HALF_PI);cosX=Math.cos(X)}switch(this.mode){case this.OBLIQ:A=this.akm1/(this.cosX1*(1+this.sinX1*sinX+this.cosX1*cosX*m));l=A*(this.cosX1*sinX-this.sinX1*cosX*m);o=A*cosX;break;case this.EQUIT:A=2*this.akm1/(1+cosX*m);l=A*sinX;o=A*cosX;break;case this.S_POLE:h=-h;m=-m;a=-a;case this.N_POLE:o=this.akm1*Proj4js.common.tsfnz(this.e,h,a);l=-o*m;break}o=o*g}d.x=o*this.a+this.x0;d.y=l*this.a+this.y0;return d},inverse:function(d){var v=(d.x-this.x0)/this.a;var s=(d.y-this.y0)/this.a;var b,r;var l,a,u=0,e=0,t,h=0,o=0;var m;if(this.sphere){var q,w,g,z;w=Math.sqrt(v*v+s*s);q=2*Math.atan(w/this.akm1);g=Math.sin(q);z=Math.cos(q);b=0;switch(this.mode){case this.EQUIT:if(Math.abs(w)<=Proj4js.common.EPSLN){r=0}else{r=Math.asin(s*g/w)}if(z!=0||v!=0){b=Math.atan2(v*g,z*w)}break;case this.OBLIQ:if(Math.abs(w)<=Proj4js.common.EPSLN){r=this.phi0}else{r=Math.asin(z*sinph0+s*g*cosph0/w)}q=z-sinph0*Math.sin(r);if(q!=0||v!=0){b=Math.atan2(v*g*cosph0,q*w)}break;case this.N_POLE:s=-s;case this.S_POLE:if(Math.abs(w)<=Proj4js.common.EPSLN){r=this.phi0}else{r=Math.asin(this.mode==this.S_POLE?-z:z)}b=(v==0&&s==0)?0:Math.atan2(v,s);break}}else{t=Math.sqrt(v*v+s*s);switch(this.mode){case this.OBLIQ:case this.EQUIT:u=2*Math.atan2(t*this.cosX1,this.akm1);l=Math.cos(u);a=Math.sin(u);if(t==0){e=Math.asin(l*this.sinX1)}else{e=Math.asin(l*this.sinX1+(s*a*this.cosX1/t))}u=Math.tan(0.5*(Proj4js.common.HALF_PI+e));v*=a;s=t*this.cosX1*l-s*this.sinX1*a;o=Proj4js.common.HALF_PI;h=0.5*this.e;break;case this.N_POLE:s=-s;case this.S_POLE:u=-t/this.akm1;e=Proj4js.common.HALF_PI-2*Math.atan(u);o=-Proj4js.common.HALF_PI;h=-0.5*this.e;break}for(m=this.NITER;m--;e=r){a=this.e*Math.sin(e);r=2*Math.atan(u*Math.pow((1+a)/(1-a),h))-o;if(Math.abs(e-r)<this.CONV){if(this.mode==this.S_POLE){r=-r}b=(v==0&&s==0)?0:Math.atan2(v,s);d.x=b;d.y=r;return d}}}}};Proj4js.Proj.mill={init:function(){},forward:function(d){var e=d.x;var b=d.y;dlon=Proj4js.common.adjust_lon(e-this.long0);var a=this.x0+this.R*dlon;var g=this.y0+this.R*Math.log(Math.tan((Proj4js.common.PI/4)+(b/2.5)))*1.25;d.x=a;d.y=g;return d},inverse:function(b){b.x-=this.x0;b.y-=this.y0;var d=Proj4js.common.adjust_lon(this.long0+b.x/this.R);var a=2.5*(Math.atan(Math.exp(b.y/this.R/1.25))-Proj4js.common.PI/4);b.x=d;b.y=a;return b}};Proj4js.Proj.sinu={init:function(){this.R=6370997},forward:function(e){var a,h,b;var g=e.x;var d=e.y;b=Proj4js.common.adjust_lon(g-this.long0);a=this.R*b*Math.cos(d)+this.x0;h=this.R*d+this.y0;e.x=a;e.y=h;return e},inverse:function(d){var b,a,e;d.x-=this.x0;d.y-=this.y0;b=d.y/this.R;if(Math.abs(b)>Proj4js.common.HALF_PI){Proj4js.reportError("sinu:Inv:DataError")}a=Math.abs(b)-Proj4js.common.HALF_PI;if(Math.abs(a)>Proj4js.common.EPSLN){a=this.long0+d.x/(this.R*Math.cos(b));e=Proj4js.common.adjust_lon(a)}else{e=this.long0}d.x=e;d.y=b;return d}};var GEOCENT_LAT_ERROR=1;var COS_67P5=0.3826834323650898;var AD_C=1.0026;function cs_geodetic_to_geocentric(r,d){var t=d.x;var m=d.y;var e=d.z;var g;var b;var a;var q=0;var s;var o;var l;var h;if(m<-HALF_PI&&m>-1.001*HALF_PI){m=-HALF_PI}else{if(m>HALF_PI&&m<1.001*HALF_PI){m=HALF_PI}else{if((m<-HALF_PI)||(m>HALF_PI)){q|=GEOCENT_LAT_ERROR}}}if(!q){if(t>PI){t-=(2*PI)}o=Math.sin(m);h=Math.cos(m);l=o*o;s=r.a/(Math.sqrt(1-r.es*l));g=(s+e)*h*Math.cos(t);b=(s+e)*h*Math.sin(t);a=((s*(1-r.es))+e)*o}d.x=g;d.y=b;d.z=a;return q}function cs_geocentric_to_geodetic(r,C){var e=C.x;var d=C.y;var a=C.z;var l;var B;var t;var g;var v;var z;var u;var q;var m;var o;var F;var h;var E;var D;var w;var s;var b;e=parseFloat(e);d=parseFloat(d);a=parseFloat(a);b=false;if(e!=0){l=Math.atan2(d,e)}else{if(d>0){l=HALF_PI}else{if(d<0){l=-HALF_PI}else{b=true;l=0;if(a>0){B=HALF_PI}else{if(a<0){B=-HALF_PI}else{B=HALF_PI;t=-r.b;return}}}}}v=e*e+d*d;g=Math.sqrt(v);z=a*AD_C;q=Math.sqrt(z*z+v);o=z/q;h=g/q;F=o*o*o;u=a+r.b*r.ep2*F;s=g-r.a*r.es*h*h*h;m=Math.sqrt(u*u+s*s);E=u/m;D=s/m;w=r.a/Math.sqrt(1-r.es*E*E);if(D>=COS_67P5){t=g/D-w}else{if(D<=-COS_67P5){t=g/-D-w}else{t=a/E+w*(r.es-1)}}if(b==false){B=Math.atan(E/D)}C.x=l;C.y=B;C.z=t;return 0}function cs_geocentric_to_wgs84(m,b){if(m.datum_type==PJD_3PARAM){b.x+=m.datum_params[0];b.y+=m.datum_params[1];b.z+=m.datum_params[2]}else{var h=m.datum_params[0];var e=m.datum_params[1];var q=m.datum_params[2];var g=m.datum_params[3];var r=m.datum_params[4];var o=m.datum_params[5];var l=m.datum_params[6];var d=l*(b.x-o*b.y+r*b.z)+h;var a=l*(o*b.x+b.y-g*b.z)+e;var s=l*(-r*b.x+g*b.y+b.z)+q;b.x=d;b.y=a;b.z=s}}function cs_geocentric_from_wgs84(o,d){if(o.datum_type==PJD_3PARAM){d.x-=o.datum_params[0];d.y-=o.datum_params[1];d.z-=o.datum_params[2]}else{var l=o.datum_params[0];var e=o.datum_params[1];var r=o.datum_params[2];var h=o.datum_params[3];var s=o.datum_params[4];var q=o.datum_params[5];var m=o.datum_params[6];var g=(d.x-l)/m;var b=(d.y-e)/m;var a=(d.z-r)/m;d.x=g+q*b-s*a;d.y=-q*g+b+h*a;d.z=s*g-h*b+a}}Proj4js.Proj.vandg={init:function(){this.R=6370997},forward:function(d){var a=d.x;var u=d.y;var B=Proj4js.common.adjust_lon(a-this.long0);var z,v;if(Math.abs(u)<=Proj4js.common.EPSLN){z=this.x0+this.R*B;v=this.y0}var h=Proj4js.common.asinz(2*Math.abs(u/Proj4js.common.PI));if((Math.abs(B)<=Proj4js.common.EPSLN)||(Math.abs(Math.abs(u)-Proj4js.common.HALF_PI)<=Proj4js.common.EPSLN)){z=this.x0;if(u>=0){v=this.y0+Proj4js.common.PI*this.R*Math.tan(0.5*h)}else{v=this.y0+Proj4js.common.PI*this.R*-Math.tan(0.5*h)}}var s=0.5*Math.abs((Proj4js.common.PI/B)-(B/Proj4js.common.PI));var e=s*s;var t=Math.sin(h);var r=Math.cos(h);var q=r/(t+r-1);var o=q*q;var l=q*(2/t-1);var w=l*l;var b=Proj4js.common.PI*this.R*(s*(q-w)+Math.sqrt(e*(q-w)*(q-w)-(w+e)*(o-w)))/(w+e);if(B<0){b=-b}z=this.x0+b;b=Math.abs(b/(Proj4js.common.PI*this.R));if(u>=0){v=this.y0+Proj4js.common.PI*this.R*Math.sqrt(1-b*b-2*s*b)}else{v=this.y0-Proj4js.common.PI*this.R*Math.sqrt(1-b*b-2*s*b)}d.x=z;d.y=v;return d},inverse:function(g){var w;var a,s,v,o,m,l;var q,h;var e;var u;var b;var t;var r;g.x-=this.x0;g.y-=this.y0;b=Proj4js.common.PI*this.R;a=g.x/b;s=g.y/b;v=a*a+s*s;o=-Math.abs(s)*(1+v);m=o-2*s*s+a*a;l=-2*o+1+2*s*s+v*v;r=s*s/l+(2*m*m*m/l/l/l-9*o*m/l/l)/27;e=(o-m*m/3/l)/l;u=2*Math.sqrt(-e/3);b=((3*r)/e)/u;if(Math.abs(b)>1){if(b>=0){b=1}else{b=-1}}t=Math.acos(b)/3;if(g.y>=0){lat=(-u*Math.cos(t+Proj4js.common.PI/3)-m/3/l)*Proj4js.common.PI}else{lat=-(-u*Math.cos(t+PI/3)-m/3/l)*Proj4js.common.PI}if(Math.abs(a)<Proj4js.common.EPSLN){lon=this.long0}lon=Proj4js.common.adjust_lon(this.long0+Proj4js.common.PI*(v-1+Math.sqrt(1+2*(a*a-s*s)+v*v))/2/a);g.x=lon;g.y=lat;return g}};Proj4js.Proj.gauss={init:function(){sphi=Math.sin(this.lat0);cphi=Math.cos(this.lat0);cphi*=cphi;this.rc=Math.sqrt(1-this.es)/(1-this.es*sphi*sphi);this.C=Math.sqrt(1+this.es*cphi*cphi/(1-this.es));this.phic0=Math.asin(sphi/this.C);this.ratexp=0.5*this.C*this.e;this.K=Math.tan(0.5*this.phic0+Proj4js.common.FORTPI)/(Math.pow(Math.tan(0.5*this.lat0+Proj4js.common.FORTPI),this.C)*Proj4js.common.srat(this.e*sphi,this.ratexp))},forward:function(b){var d=b.x;var a=b.y;b.y=2*Math.atan(this.K*Math.pow(Math.tan(0.5*a+Proj4js.common.FORTPI),this.C)*Proj4js.common.srat(this.e*Math.sin(a),this.ratexp))-Proj4js.common.HALF_PI;b.x=this.C*d;return b},inverse:function(e){var d=1e-14;var g=e.x/this.C;var b=e.y;num=Math.pow(Math.tan(0.5*b+Proj4js.common.FORTPI)/this.K,1/this.C);for(var a=Proj4js.common.MAX_ITER;a>0;--a){b=2*Math.atan(num*Proj4js.common.srat(this.e*Math.sin(e.y),-0.5*this.e))-Proj4js.common.HALF_PI;if(Math.abs(b-e.y)<d){break}e.y=b}if(!a){Proj4js.reportError("gauss:inverse:convergence failed");return null}e.x=g;e.y=b;return e}};Proj4js.Proj.omerc={init:function(){if(!this.mode){this.mode=0}if(!this.lon1){this.lon1=0;this.mode=1}if(!this.lon2){this.lon2=0}if(!this.lat2){this.lat2=0}var a=this.b/this.a;var d=1-Math.pow(a,2);var b=Math.sqrt(d);this.sin_p20=Math.sin(this.lat0);this.cos_p20=Math.cos(this.lat0);this.con=1-this.es*this.sin_p20*this.sin_p20;this.com=Math.sqrt(1-d);this.bl=Math.sqrt(1+this.es*Math.pow(this.cos_p20,4)/(1-d));this.al=this.a*this.bl*this.k0*this.com/this.con;if(Math.abs(this.lat0)<Proj4js.common.EPSLN){this.ts=1;this.d=1;this.el=1}else{this.ts=Proj4js.common.tsfnz(this.e,this.lat0,this.sin_p20);this.con=Math.sqrt(this.con);this.d=this.bl*this.com/(this.cos_p20*this.con);if((this.d*this.d-1)>0){if(this.lat0>=0){this.f=this.d+Math.sqrt(this.d*this.d-1)}else{this.f=this.d-Math.sqrt(this.d*this.d-1)}}else{this.f=this.d}this.el=this.f*Math.pow(this.ts,this.bl)}if(this.mode!=0){this.g=0.5*(this.f-1/this.f);this.gama=Proj4js.common.asinz(Math.sin(this.alpha)/this.d);this.longc=this.longc-Proj4js.common.asinz(this.g*Math.tan(this.gama))/this.bl;this.con=Math.abs(this.lat0);if((this.con>Proj4js.common.EPSLN)&&(Math.abs(this.con-Proj4js.common.HALF_PI)>Proj4js.common.EPSLN)){this.singam=Math.sin(this.gama);this.cosgam=Math.cos(this.gama);this.sinaz=Math.sin(this.alpha);this.cosaz=Math.cos(this.alpha);if(this.lat0>=0){this.u=(this.al/this.bl)*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz)}else{this.u=-(this.al/this.bl)*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz)}}else{Proj4js.reportError("omerc:Init:DataError")}}else{this.sinphi=Math.sin(this.at1);this.ts1=Proj4js.common.tsfnz(this.e,this.lat1,this.sinphi);this.sinphi=Math.sin(this.lat2);this.ts2=Proj4js.common.tsfnz(this.e,this.lat2,this.sinphi);this.h=Math.pow(this.ts1,this.bl);this.l=Math.pow(this.ts2,this.bl);this.f=this.el/this.h;this.g=0.5*(this.f-1/this.f);this.j=(this.el*this.el-this.l*this.h)/(this.el*this.el+this.l*this.h);this.p=(this.l-this.h)/(this.l+this.h);this.dlon=this.lon1-this.lon2;if(this.dlon<-Proj4js.common.PI){this.lon2=this.lon2-2*Proj4js.common.PI}if(this.dlon>Proj4js.common.PI){this.lon2=this.lon2+2*Proj4js.common.PI}this.dlon=this.lon1-this.lon2;this.longc=0.5*(this.lon1+this.lon2)-Math.atan(this.j*Math.tan(0.5*this.bl*this.dlon)/this.p)/this.bl;this.dlon=Proj4js.common.adjust_lon(this.lon1-this.longc);this.gama=Math.atan(Math.sin(this.bl*this.dlon)/this.g);this.alpha=Proj4js.common.asinz(this.d*Math.sin(this.gama));if(Math.abs(this.lat1-this.lat2)<=Proj4js.common.EPSLN){Proj4js.reportError("omercInitDataError")}else{this.con=Math.abs(this.lat1)}if((this.con<=Proj4js.common.EPSLN)||(Math.abs(this.con-HALF_PI)<=Proj4js.common.EPSLN)){Proj4js.reportError("omercInitDataError")}else{if(Math.abs(Math.abs(this.lat0)-Proj4js.common.HALF_PI)<=Proj4js.common.EPSLN){Proj4js.reportError("omercInitDataError")}}this.singam=Math.sin(this.gam);this.cosgam=Math.cos(this.gam);this.sinaz=Math.sin(this.alpha);this.cosaz=Math.cos(this.alpha);if(this.lat0>=0){this.u=(this.al/this.bl)*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz)}else{this.u=-(this.al/this.bl)*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz)}}},forward:function(D){var o;var e,K;var J;var I,w,d;var h,E,G;var C,r,H;var z,F;var B;var a;var l;var g=D.x;var m=D.y;e=Math.sin(m);a=Proj4js.common.adjust_lon(g-this.longc);H=Math.sin(this.bl*a);if(Math.abs(Math.abs(m)-Proj4js.common.HALF_PI)>Proj4js.common.EPSLN){l=Proj4js.common.tsfnz(this.e,m,e);C=this.el/(Math.pow(l,this.bl));B=0.5*(C-1/C);w=0.5*(C+1/C);z=(B*this.singam-H*this.cosgam)/w;h=Math.cos(this.bl*a);if(Math.abs(h)<1e-7){r=this.al*this.bl*a}else{r=this.al*Math.atan((B*this.cosgam+H*this.singam)/h)/this.bl;if(h<0){r=r+Proj4js.common.PI*this.al/this.bl}}}else{if(m>=0){z=this.singam}else{z=-this.singam}r=this.al*m/this.bl}if(Math.abs(Math.abs(z)-1)<=Proj4js.common.EPSLN){Proj4js.reportError("omercFwdInfinity")}F=0.5*this.al*Math.log((1-z)/(1+z))/this.bl;r=r-this.u;var v=this.x0+F*this.cosaz+r*this.sinaz;var u=this.y0+r*this.cosaz-F*this.sinaz;D.x=v;D.y=u;return D},inverse:function(z){var K;var m;var g;var e,J;var I;var G,u,d;var h,B,E;var C,o,w,v,l;var F,r,H;var a;var D;z.x-=this.x0;z.y-=this.y0;D=0;C=z.x*this.cosaz-z.y*this.sinaz;o=z.y*this.cosaz+z.x*this.sinaz;o=o+this.u;w=Math.exp(-this.bl*C/this.al);v=0.5*(w-1/w);u=0.5*(w+1/w);F=Math.sin(this.bl*o/this.al);r=(F*this.cosgam+v*this.singam)/u;if(Math.abs(Math.abs(r)-1)<=Proj4js.common.EPSLN){lon=this.longc;if(r>=0){lat=Proj4js.common.HALF_PI}else{lat=-Proj4js.common.HALF_PI}}else{h=1/this.bl;l=Math.pow((this.el/Math.sqrt((1+r)/(1-r))),h);lat=Proj4js.common.phi2z(this.e,l);m=this.longc-Math.atan2((v*this.cosgam-F*this.singam),h)/this.bl;lon=Proj4js.common.adjust_lon(m)}z.x=lon;z.y=lat;return z}};Proj4js.Proj.lcc={init:function(){if(!this.lat2){this.lat2=this.lat0}if(!this.k0){this.k0=1}if(Math.abs(this.lat1+this.lat2)<Proj4js.common.EPSLN){Proj4js.reportError("lcc:init: Equal Latitudes");return}var p=this.b/this.a;this.e=Math.sqrt(1-p*p);var l=Math.sin(this.lat1);var g=Math.cos(this.lat1);var o=Proj4js.common.msfnz(this.e,l,g);var b=Proj4js.common.tsfnz(this.e,this.lat1,l);var h=Math.sin(this.lat2);var e=Math.cos(this.lat2);var m=Proj4js.common.msfnz(this.e,h,e);var a=Proj4js.common.tsfnz(this.e,this.lat2,h);var d=Proj4js.common.tsfnz(this.e,this.lat0,Math.sin(this.lat0));if(Math.abs(this.lat1-this.lat2)>Proj4js.common.EPSLN){this.ns=Math.log(o/m)/Math.log(b/a)}else{this.ns=l}this.f0=o/(this.ns*Math.pow(b,this.ns));this.rh=this.a*this.f0*Math.pow(d,this.ns);if(!this.title){this.title="Lambert Conformal Conic"}},forward:function(g){var h=g.x;var e=g.y;if(e<=90&&e>=-90&&h<=180&&h>=-180){}else{Proj4js.reportError("lcc:forward: llInputOutOfRange: "+h+" : "+e);return null}var a=Math.abs(Math.abs(e)-Proj4js.common.HALF_PI);var d;if(a>Proj4js.common.EPSLN){d=Proj4js.common.tsfnz(this.e,e,Math.sin(e));rh1=this.a*this.f0*Math.pow(d,this.ns)}else{a=e*this.ns;if(a<=0){Proj4js.reportError("lcc:forward: No Projection");return null}rh1=0}var b=this.ns*Proj4js.common.adjust_lon(h-this.long0);g.x=this.k0*(rh1*Math.sin(b))+this.x0;g.y=this.k0*(this.rh-rh1*Math.cos(b))+this.y0;return g},inverse:function(g){var l,a,d;var e,h;x=(g.x-this.x0)/this.k0;y=(this.rh-(g.y-this.y0)/this.k0);if(this.ns>0){l=Math.sqrt(x*x+y*y);a=1}else{l=-Math.sqrt(x*x+y*y);a=-1}var b=0;if(l!=0){b=Math.atan2((a*x),(a*y))}if((l!=0)||(this.ns>0)){a=1/this.ns;d=Math.pow((l/(this.a*this.f0)),a);e=Proj4js.common.phi2z(this.e,d);if(e==-9999){return null}}else{e=-Proj4js.common.HALF_PI}h=Proj4js.common.adjust_lon(b/this.ns+this.long0);g.x=h;g.y=e;return g}};Proj4js.Proj.laea={init:function(){this.sin_lat_o=Math.sin(this.lat0);this.cos_lat_o=Math.cos(this.lat0)},forward:function(b){var a=b.x;var o=b.y;var h=Proj4js.common.adjust_lon(a-this.long0);var t=Math.sin(o);var q=Math.cos(o);var d=Math.sin(h);var e=Math.cos(h);var m=this.sin_lat_o*t+this.cos_lat_o*q*e;if(m==-1){Proj4js.reportError("laea:fwd:Point projects to a circle of radius "+2*R);return null}var l=this.a*Math.sqrt(2/(1+m));var s=l*q*d+this.x0;var r=l*(this.cos_lat_o*t-this.sin_lat_o*q*e)+this.x0;b.x=s;b.y=r;return b},inverse:function(h){h.x-=this.x0;h.y-=this.y0;var e=Math.sqrt(h.x*h.x+h.y*h.y);var d=e/(2*this.a);if(d>1){Proj4js.reportError("laea:Inv:DataError");return null}var m=2*Proj4js.common.asinz(d);var b=Math.sin(m);var a=Math.cos(m);var l=this.long0;if(Math.abs(e)>Proj4js.common.EPSLN){var g=Proj4js.common.asinz(this.sin_lat_o*a+this.cos_lat_o*b*h.y/e);var d=Math.abs(this.lat0)-Proj4js.common.HALF_PI;if(Math.abs(d)>Proj4js.common.EPSLN){d=a-this.sin_lat_o*Math.sin(g);if(d!=0){l=Proj4js.common.adjust_lon(this.long0+Math.atan2(h.x*b*this.cos_lat_o,d*e))}}else{if(this.lat0<0){l=Proj4js.common.adjust_lon(this.long0-Math.atan2(-h.x,h.y))}else{l=Proj4js.common.adjust_lon(this.long0+Math.atan2(h.x,-h.y))}}}else{g=this.lat0}h.x=l;h.y=g;return h}};Proj4js.Proj.aeqd={init:function(){this.sin_p12=Math.sin(this.lat0);this.cos_p12=Math.cos(this.lat0)},forward:function(d){var b=d.x;var o=d.y;var h;var a=Math.sin(d.y);var e=Math.cos(d.y);var r=Proj4js.common.adjust_lon(b-this.long0);var q=Math.cos(r);var l=this.sin_p12*a+this.cos_p12*e*q;if(Math.abs(Math.abs(l)-1)<Proj4js.common.EPSLN){h=1;if(l<0){Proj4js.reportError("aeqd:Fwd:PointError");return}}else{var m=Math.acos(l);h=m/Math.sin(m)}d.x=this.x0+this.a*h*e*Math.sin(r);d.y=this.y0+this.a*h*(this.cos_p12*a-this.sin_p12*e*q);return d},inverse:function(b){b.x-=this.x0;b.y-=this.y0;var l=Math.sqrt(b.x*b.x+b.y*b.y);if(l>(2*Proj4js.common.HALF_PI*this.a)){Proj4js.reportError("aeqdInvDataError");return}var g=l/this.a;var e=Math.sin(g);var o=Math.cos(g);var a=this.long0;var h;if(Math.abs(l)<=Proj4js.common.EPSLN){h=this.lat0}else{h=Proj4js.common.asinz(o*this.sin_p12+(b.y*e*this.cos_p12)/l);var d=Math.abs(this.lat0)-Proj4js.common.HALF_PI;if(Math.abs(d)<=Proj4js.common.EPSLN){if(lat0>=0){a=Proj4js.common.adjust_lon(this.long0+Math.atan2(b.x,-b.y))}else{a=Proj4js.common.adjust_lon(this.long0-Math.atan2(-b.x,b.y))}}else{d=o-this.sin_p12*Math.sin(h);if((Math.abs(d)<Proj4js.common.EPSLN)&&(Math.abs(b.x)<Proj4js.common.EPSLN)){}else{var m=Math.atan2((b.x*e*this.cos_p12),(d*l));a=Proj4js.common.adjust_lon(this.long0+Math.atan2((b.x*e*this.cos_p12),(d*l)))}}}b.x=a;b.y=h;return b}};Proj4js.Proj.moll={init:function(){},forward:function(d){var a=d.x;var m=d.y;var h=Proj4js.common.adjust_lon(a-this.long0);var g=m;var e=Proj4js.common.PI*Math.sin(m);for(var l=0;;l++){var b=-(g+Math.sin(g)-e)/(1+Math.cos(g));g+=b;if(Math.abs(b)<Proj4js.common.EPSLN){break}if(l>=50){Proj4js.reportError("moll:Fwd:IterationError")}}g/=2;if(Proj4js.common.PI/2-Math.abs(m)<Proj4js.common.EPSLN){h=0}var q=0.900316316158*this.R*h*Math.cos(g)+this.x0;var o=1.4142135623731*this.R*Math.sin(g)+this.y0;d.x=q;d.y=o;return d},inverse:function(e){var b;var a;e.x-=this.x0;var a=e.y/(1.4142135623731*this.R);if(Math.abs(a)>0.999999999999){a=0.999999999999}var b=Math.asin(a);var g=Proj4js.common.adjust_lon(this.long0+(e.x/(0.900316316158*this.R*Math.cos(b))));if(g<(-Proj4js.common.PI)){g=-Proj4js.common.PI}if(g>Proj4js.common.PI){g=Proj4js.common.PI}a=(2*b+Math.sin(2*b))/Proj4js.common.PI;if(Math.abs(a)>1){a=1}var d=Math.asin(a);e.x=g;e.y=d;return e}};OpenLayers.Util.extend(OpenLayers.Lang.en,{"mf.layertree.opacity":"Opacity","mf.layertree.remove":"Remove","mf.layertree.zoomToExtent":"Zoom to extent","mf.print.mapTitle":"Title","mf.print.comment":"Comments","mf.print.loadingConfig":"Loading the configuration...","mf.print.serverDown":"The print service is not working","mf.print.unableToPrint":"Unable to print","mf.print.generatingPDF":"Generating PDF...","mf.print.dpi":"DPI","mf.print.scale":"Scale","mf.print.rotation":"Rotation","mf.print.print":"Print","mf.print.resetPos":"Reset Pos.","mf.print.layout":"Layout","mf.print.addPage":"Add page","mf.print.remove":"Remove page","mf.print.clearAll":"Clear all","mf.print.pdfReady":"Your PDF document is ready.","mf.print.noPage":'No page selected, click on the "Add page" button to add one.',"mf.print.print-tooltip":"Generate a PDF with at least the extent shown on the map","mf.error":"Error","mf.warning":"Warning","mf.information":"Information","mf.recenter.x":"X","mf.recenter.y":"Y","mf.recenter.submit":"Recenter","mf.recenter.missingCoords":"Some coordinates are missing.","mf.recenter.outOfRangeCoords":"Submitted coordinates (${myX}, ${myY}) are not in the map area<br />and must be within following ranges:<br/>${coordX} between ${minCoordX} and ${maxCoordX},<br />${coordY} between ${minCoordY} and ${maxCoordY}","mf.recenter.ws.error":"An error occured when accessing the distant webservice:","mf.recenter.ws.service":"Selected service"});Ext.namespace("mapfish.widgets");mapfish.widgets.RadioTreeNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{renderElements:function(g,q,p,r){this.indentMarkup=g.parentNode?g.parentNode.ui.getChildIndent():"";var h=typeof q.checked=="boolean";var l=g.attributes.radioGrp||"radioGrp";var d=q.href?q.href:Ext.isGecko?"":"#";var e=['<li class="x-tree-node"><div ext:tree-node-id="',g.id,'" class="x-tree-node-el x-tree-node-leaf x-unselectable ',q.cls,'" unselectable="on">','<span class="x-tree-node-indent">',this.indentMarkup,"</span>",'<img src="',this.emptyIcon,'" class="x-tree-ec-icon x-tree-elbow" />','<img src="',q.icon||this.emptyIcon,'" class="x-tree-node-icon',(q.icon?" x-tree-node-inline-icon":""),(q.iconCls?" "+q.iconCls:""),'" unselectable="on" />',h?('<input class="x-tree-node-cb" type="radio" id="'+g.id+'" name="'+l+'" '+(q.checked?'checked="checked" />':"/>")):"",'<a hidefocus="on" class="x-tree-node-anchor" href="',d,'" tabIndex="1" ',q.hrefTarget?' target="'+q.hrefTarget+'"':"",'><span unselectable="on">',g.text,"</span></a></div>",'<ul class="x-tree-node-ct" style="display:none;"></ul>',"</li>"].join("");var b;if(r!==true&&g.nextSibling&&(b=g.nextSibling.ui.getEl())){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",b,e)}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",p,e)}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var o=this.elNode.childNodes;this.indentNode=o[0];this.ecNode=o[1];this.iconNode=o[2];var m=3;if(h){this.checkbox=o[3];m++}this.anchor=o[m];this.textNode=o[m].firstChild},_unused_renderElements:function(l,d,g,b){mapfish.widgets.RadioTreeNodeUI.superclass.renderElements.apply(this,arguments);var h=Ext.DomQuery.selectNode(".x-tree-node-cb",this.elNode);var e=l.attributes.radioGrp||"radioGrp";h.setAttribute("type","radio");h.setAttribute("id",l.id);h.setAttribute("name",e)},onRadioChange:function(){var a=this.checkbox.checked;this.node.attributes.checked=a;this.fireEvent("radiochange",this.node,a)}});mapfish.widgets.LayerTreeEventModel=Ext.extend(Ext.tree.TreeEventModel,{delegateClick:function(b,a){if(!this.beforeEvent(b)){return}if(b.getTarget("input[type=checkbox]",1)){this.onCheckboxClick(b,this.getNode(b))}else{if(b.getTarget("input[type=radio]",1)){this.onRadioClick(b,this.getNode(b))}else{if(b.getTarget(".x-tree-ec-icon",1)){this.onIconClick(b,this.getNode(b))}else{if(this.getNodeTarget(b)){this.onNodeClick(b,this.getNode(b))}}}}},onRadioClick:function(b,a){if(!a.ui.onRadioChange){OpenLayers.Console.error("Invalid TreeNodeUI Class, no onRadioChange is available");return}a.ui.onRadioChange(b)}});mapfish.widgets.LayerTree=function(a){Ext.apply(this,a);mapfish.widgets.LayerTree.superclass.constructor.call(this)};Ext.extend(mapfish.widgets.LayerTree,Ext.tree.TreePanel,{separator:":",model:null,showWmsLegend:false,rootVisible:false,animate:true,autoScroll:true,loader:new Ext.tree.TreeLoader({}),enableDD:false,containerScroll:true,ascending:true,_automaticModel:true,layerNameToLayer:{},baseLayerNames:[],layersWithSublayers:{},layerToNodeIds:{},nodeIdToNode:{},nodeIdToLayers:{},hasCheckbox:function(a){return typeof(a.attributes.checked)=="boolean"},setNodeChecked:function(a,e,b){var d=(a instanceof Ext.data.Node)?a:this.getNodeById(a);if(!d||!this.hasCheckbox(d)){return}if(e===undefined){e=!d.attributes.checked}d.attributes.checked=e;if(d.ui&&d.ui.checkbox){d.ui.checkbox.checked=e}if(b||(b===undefined)){d.fireEvent("checkchange",d,e)}},updateDisabled:function(){var a=this.map.getScale();this.getRootNode().cascade(function(b){if((b.attributes.minscale&&a<b.attributes.minscale)||(b.attributes.maxscale&&a>b.attributes.maxscale)){b.disable()}else{b.enable()}},this)},_updateCachedObjects:function(){if(!this.map){OpenLayers.Console.error("map Object needs to be available when calling _updateCachedObjects");return}this.layerNameToLayer={};this.baseLayerNames=[];this.layersWithSublayers={};this.layerToNodeIds={};this.nodeIdToNode={};this.nodeIdToLayers={};Ext.each(this.map.layers,function(b){var a=b.name;this.layerNameToLayer[a]=b;if(b.isBaseLayer){this.baseLayerNames.push(a)}},this);this.getRootNode().cascade(function(d){if(!d.attributes.layerNames){return true}var e=d.attributes.layerNames;for(var b=0;b<e.length;b++){var a=e[b];if(a.indexOf(this.separator)!=-1){var a=a.split(this.separator)[0];this.layersWithSublayers[a]=true}if(!this.nodeIdToLayers[d.id]){this.nodeIdToLayers[d.id]=[]}this.nodeIdToLayers[d.id].push(this.layerNameToLayer[a])}},this);this.getRootNode().cascade(function(e){var d=e.attributes.checked;var g=e.attributes.layerNames;if(!g){return}for(var b=0;b<g.length;b++){var a=g[b];if(!a){continue}if(!this.layerToNodeIds[a]){this.layerToNodeIds[a]=[]}this.layerToNodeIds[a].push(e.id);this.nodeIdToNode[e.id]=e}},this)},_updateCheckboxAncestors:function(){var e={};var d=this;function b(m){if(!d.hasCheckbox(m)){throw new Error(arguments.callee.name+" should only be called on checkbox nodes")}var l=[];m.eachChild(function(o){if(d.hasCheckbox(o)){l.push(o)}},this);if(l.length==0){return m.attributes.checked}var h=true;Ext.each(l,function(o){if(!b(o)){h=false;return false}},this);d.setNodeChecked(m,h,false);delete e[m.id];return h}var a=[];this.getRootNode().cascade(function(h){if(this.hasCheckbox(h)){a.push(h);e[h.id]=true}},this);var g;while(g=a.shift()){if(e[g.id]){b(g)}}},_handleModelChange:function LT__handleModelChange(u,p,e){var h={};if(u){u.cascade(function(v){this.setNodeChecked(v,p,false)},this)}this._updateCheckboxAncestors();if(!this.map){return}this._updateCachedObjects();function m(){var v={};Ext.each(this.map.layers,function(B){var z=B.name;v[z]=B.visibility;h[z]=false;if(!(B instanceof OpenLayers.Layer.WMS)&&!(B instanceof OpenLayers.Layer.WMS.Untiled)&&!(B instanceof OpenLayers.Layer.MapServer)){return}if(!this.layersWithSublayers[B.name]){return}if(B.isBaseLayer){OpenLayers.Console.error("Using sublayers on a base layer is not supported (base layer is "+z+")")}if(!B._origLayers){B._origLayers=B.params.LAYERS||B.params.layers}var D=B._origLayers;if(D instanceof Array){for(var w=0;w<D.length;w++){var C=D[w];v[z+this.separator+C]=B.visibility;h[z+this.separator+C]=false}}},this);return v}function g(w){var v={};this.getRootNode().cascade(function(D){var C=D.attributes.checked;var F=D.attributes.layerNames;var E=null;if(!F){return}for(var B=0;B<F.length;B++){var z=F[B];if(!z){continue}if(w[z]==undefined){OpenLayers.Console.error("Invalid layer: ",z)}if(D.attributes.radio){E=D.attributes.radioGrp||"radioGrp";if(!d[E]){d[E]={}}d[E][z]=C}if(v[z]){continue}if(D==u){if(this.baseLayerNames.indexOf(z)!=-1){s=z}if(E){o[0]=E;o[1]=z}v[z]=true}h[z]=D.labelled;w[z]=C}},this);return w}function r(z,w,C){var B=0;for(var v=0;v<this.baseLayerNames.length;v++){if(z[this.baseLayerNames[v]]){B++}}if(B==1){return z}for(var v=0;v<this.baseLayerNames.length;v++){z[this.baseLayerNames[v]]=false}if(w){z[w]=true;return z}if(!C){return z}z[C]=true;return z}function t(z,C,w){for(var B in w){for(var v in w[B]){if(C[0]==B){z[v]=v==C[1]}else{z[v]=w[B][v]}}}return z}function a(E){for(var z in E){var C=this.layerToNodeIds[z];if(!C){continue}for(var B=0;B<C.length;B++){var D=this.nodeIdToNode[C[B]];if(!D){continue}var F=D.attributes.layerNames;if(!F){OpenLayers.Console.error("unexpected state");continue}var v=true;for(var w=0;w<F.length;w++){var z=F[w];if(!z){continue}if(!E[z]){v=false;break}}this.setNodeChecked(D,v,false)}}}function b(M){var v={};var G={};for(var P in M){var w=M[P];var D=h[P];var N=P.split(this.separator);if(N.length!=2){continue}delete M[P];delete h[P];P=N[0];var z=N[1];if(!v[P]){v[P]=[];G[P]=[]}if(w){v[P].push(z);G[P].push(D)}}for(P in v){if(M[P]!==undefined){delete M[P];delete h[P]}}for(var P in M){var Q=this.layerNameToLayer[P];if(!Q){OpenLayers.Console.error("Non existing layer name",P);continue}if(this.baseLayerNames.indexOf(P)!=-1){if(M[P]){this.map.setBaseLayer(Q)}}else{Q.setVisibility(M[P])}}for(var P in v){var Q=this.layerNameToLayer[P];var B=v[P];var J=G[P];if(Q.isBaseLayer){OpenLayers.Console.error("base layer for sublayer are not supported");return}if(B.length==0){Q.setVisibility(false,true)}else{if(!this.enableDD){if(!Q._origLayers){OpenLayers.Console.error("Assertion failure")}var C=Q._origLayers;var O=[];var F=[];for(var K=0;K<C.length;K++){var I=C[K];if(B.indexOf(I)!=-1){var L=J[B.indexOf(I)];O.push(I);if(L){F.push(this.openlayersNS+":"+I+"_label")}else{F.push(this.openlayersNS+":"+I)}}}B=O;J=F}var H=Q.params.LAYERS?"LAYERS":"layers";var E=Q.params.STYLES?"STYLES":"styles";if(!mapfish.Util.arrayEqual(Q.params[H],B)||e){Q.params[H]=B;Q.params[E]=J;Q.redraw()}Q.setVisibility(true,true)}}}var q;if(this.map.baseLayer){q=this.map.baseLayer.name}var s;var d={};var o=[];var l=m.call(this);l=g.call(this,l);r.call(this,l,s,q);t.call(this,l,o,d);a.call(this,l);b.call(this,l)},_extractOLModel:function LT__extractOLModel(){var p=[];var e=this.map.layers.slice();if(!this.ascending){e.reverse()}for(var q=0;q<e.length;q++){var g=e[q];var h=[];if(g instanceof OpenLayers.Layer.WMS||g instanceof OpenLayers.Layer.WMS.Untiled||g instanceof OpenLayers.Layer.MapServer){var o=g.params.LAYERS||g.params.layers;if(o instanceof Array){for(var m=0;m<o.length;m++){var r=o[m];var a;if(this.showWmsLegend){a=mapfish.Util.getIconUrl(g.url,{layer:r})}var b={text:r,checked:g.getVisibility(),icon:a,layerName:g.name+this.separator+r,children:[],cls:"cf-wms-node"};if(this.ascending){h.push(b)}else{h.unshift(b)}}}}var d={text:g.name,checked:g.getVisibility(),layerName:(h.length>0?null:g.name),children:h};if(!g.displayInLayerSwitcher){d.uiProvider=function(){};d.uiProvider.prototype={render:function(){},renderIndent:function(){}}}p.push(d)}return p},_updateOrder:function(){this._updateCachedObjects();function e(p,m){for(var o=0;o<p.length;o++){var h=p[o];if(h.name==m){return o}}return -1}var a=this.map.layers.slice();var g={};var b=[];this.getRootNode().cascade(function(h){if(this.ascending){b.push(h)}else{b.unshift(h)}},this);Ext.each(b,function(h){var l=this.nodeIdToLayers[h.id];if(!l){return}Ext.each(l,function(p){var o=p.name;if(g[o]){return}g[o]=true;var m=e(a,o);if(m==-1||!this.layerNameToLayer[o]){throw new Error("Layer "+o+" not available")}a.splice(m,1);a.push(this.layerNameToLayer[o])},this)},this);this._updateCheckboxAncestors();this.map.layers=a;for(var d=0;d<this.map.layers.length;d++){this.map.setLayerZIndex(this.map.layers[d],d)}},_fixupModel:function(){this.getRootNode().cascade(function(b){var a=b.attributes;if(!a.layerNames&&a.layerName){a.layerNames=[a.layerName];delete a.layerName}},this);if(this.map){this._updateCachedObjects()}this.getRootNode().cascade(function(b){var d;if(!b.attributes.radio&&(!this.map||!(d=this.nodeIdToLayers[b.id]))){return}var a=false;if(d){a=true;Ext.each(d,function(e){if(!e.isBaseLayer){a=false;return false}},this)}if(a||b.attributes.radio){b.attributes.uiProvider=mapfish.widgets.RadioTreeNodeUI;if(b.ui){b.ui=new mapfish.widgets.RadioTreeNodeUI(b)}}},this)},initComponent:function(){this.eventModel=new mapfish.widgets.LayerTreeEventModel(this);mapfish.widgets.LayerTree.superclass.initComponent.call(this);this.addListener("checkchange",function e(l,h){this._handleModelChange(l,h)},this);this.addListener("radiochange",function b(l,h){this._handleModelChange(l,h)},this);this._automaticModel=!this.model;if(!this.model){this.model=this._extractOLModel()}var a={text:"Root",draggable:false,id:"source",children:this.model,leaf:false};function g(h){var o=new Ext.tree.TreeNode(h);var m=h.children;o.leaf=!m;if(!m){return o}for(var l=0;l<m.length;l++){if(!m[l]){continue}o.appendChild(g(m[l]))}return o}var d=g(a);this.setRootNode(d);this._fixupModel();this.addListener("dragdrop",function(){this._updateOrder(arguments)},this);if(!this._automaticModel){this._handleModelChange(null,null);if(this.enableDD){this._updateOrder()}}},onRender:function(b,a){if(!this.el){this.el=document.createElement("div")}mapfish.widgets.LayerTree.superclass.onRender.apply(this,arguments)}});Ext.reg("layertree",mapfish.widgets.LayerTree);Ext.ux.SliderTip=Ext.extend(Ext.Tip,{minWidth:10,offsets:[0,-10],init:function(a){a.on("dragstart",this.onSlide,this);a.on("drag",this.onSlide,this);a.on("dragend",this.hide,this);a.on("destroy",this.destroy,this)},onSlide:function(a){this.show();this.body.update(this.getText(a));this.doAutoWidth();this.el.alignTo(a.thumb,"b-t?",this.offsets)},getText:function(a){return a.getValue()}});Ext.data.DynamicJsonReader=function(a){Ext.data.DynamicJsonReader.superclass.constructor.call(this,a,[])};Ext.extend(Ext.data.DynamicJsonReader,Ext.data.JsonReader,{getRecordType:function(e){var d=0,a=[];for(var b in e[0]){a[d++]=b}this.recordType=Ext.data.Record.create(a);return this.recordType},readRecords:function(o){this.jsonData=o;var s=this.meta;var sid=s.id;var totalRecords=0;if(s.totalProperty){var v=parseInt(eval("o."+s.totalProperty),10);if(!isNaN(v)){totalRecords=v}}var root=s.root?eval("o."+s.root):o;var recordType=this.getRecordType(root);var fields=recordType.prototype.fields;var records=[];for(var i=0;i<root.length;i++){var n=root[i];var values={};var id=(n[sid]!==undefined&&n[sid]!==""?n[sid]:null);for(var j=0,jlen=fields.length;j<jlen;j++){var f=fields.items[j];var map=f.mapping||f.name;var v=n[map]!==undefined?n[map]:f.defaultValue;v=f.convert(v);values[f.name]=v}var record=new recordType(values,id);record.json=n;records[records.length]=record}return{records:records,totalRecords:totalRecords||records.length}}});Ext.grid.DynamicColumnModel=function(d){var h=[];var m=d.reader.recordType;var b=m.prototype.fields;for(var e=0,a=b.keys.length;e<a;e++){var l=b.keys[e];var g=m.getField(l);h[e]={header:g.name,dataIndex:g.name}}Ext.grid.DynamicColumnModel.superclass.constructor.call(this,h)};Ext.extend(Ext.grid.DynamicColumnModel,Ext.grid.ColumnModel,{});OpenLayers.Control.Identify=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,map:null,queryLayers:null,draw:function(){this.handler=new OpenLayers.Handler.Box(this,{done:this.handleSelect},{keyMask:this.keyMask})},getBounds:function(a){var e=this.map.getLonLatFromPixel(new OpenLayers.Pixel(a.left,a.bottom));var b=this.map.getLonLatFromPixel(new OpenLayers.Pixel(a.right,a.top));var d=new OpenLayers.Bounds(e.lon,e.lat,b.lon,b.lat);return d},handleSelect:function(a){var b;if(!a.x){var d=this.getBounds(a);b="BBOX(the_geom, "+d.toBBOX()+")"}else{var e=this.map.getLonLatFromPixel(a);b="CONTAINS(the_geom, POINT("+e.lon+" "+e.lat+"))"}WGX.Search.search({enablePrint:this.enablePrint,zoomTo:false,queryLayers:this.queryLayers,cqlfilter:b})},activate:function(){this.map.div.style.cursor="pointer";return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){this.map.div.style.cursor="";WGX.Search.clearResults();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.Identify"});OpenLayers.Control.SimpleIdentify=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,map:null,queryLayers:null,initialize:function(b,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.layer=b;this.handler=new OpenLayers.Handler.Click(this,{click:this.handleSelect})},handleSelect:function(b){var a=this.map.getLonLatFromPixel(b.xy);WGX.Search.search({enablePrint:this.enablePrint,zoomTo:false,queryLayers:this.queryLayers,suppressResultsPanel:true,cqlfilter:"CONTAINS(the_geom, POINT("+a.lon+" "+a.lat+"))"})},activate:function(){this.map.div.style.cursor="pointer";return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.map!==null){this.map.div.style.cursor="";WGX.Search.clearResults();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)}},CLASS_NAME:"OpenLayers.Control.SimpleIdentify"});OpenLayers.Control.DeleteFeature=OpenLayers.Class(OpenLayers.Control,{initialize:function(b,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.layer=b;this.handler=new OpenLayers.Handler.Feature(this,b,{click:this.clickFeature})},activate:function(){WGX.MapLabelFactory.removeMode=true;return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){WGX.MapLabelFactory.removeMode=false;return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},clickFeature:function(a){if(a.fid==undefined){this.layer.destroyFeatures([a])}else{a.state=OpenLayers.State.DELETE;this.layer.events.triggerEvent("afterfeaturemodified",{feature:a});a.renderIntent="select";this.layer.drawFeature(a)}},setMap:function(a){this.handler.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.DeleteFeature"});OpenLayers.Control.ActiveMeasure=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["measure","measurepartial","activemeasure"],handlerOptions:null,callbacks:null,displaySystem:"metric",geodesic:false,displaySystemUnits:{geographic:["dd"],english:["mi","ft","in"],metric:["km","m"]},label:null,partialDelay:300,delayedTrigger:null,persist:false,initialize:function(b,a){this.EVENT_TYPES=OpenLayers.Control.ActiveMeasure.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);this.callbacks=OpenLayers.Util.extend({done:this.measureComplete,point:this.measurePartial,modify:this.measureMove},this.callbacks);this.handlerOptions=OpenLayers.Util.extend({persist:this.persist},this.handlerOptions);this.handler=new b(this,this.callbacks,this.handlerOptions)},activate:function(){this.label=WGX.MapLabel({allowHTML:true});return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){this.label.destroy();this.label=null;return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},cancel:function(){this.handler.cancel()},updateHandler:function(b,a){var d=this.active;if(d){this.deactivate()}this.handler=new b(this,this.callbacks,a);this.movehandler=new OpenLayers.Handler.Hover(this,{move:this.measureMove});if(d){this.activate()}},measureMove:function(a,b){this.activePoint=a;if(this.currentPoint&&!this.firstPoint){var e=a.clone();var d=new OpenLayers.Geometry.LineString([this.currentPoint,e]);b.geometry.segmentmeasure=this.measure(d,"activemeasure")}b.geometry.measure=this.measure(b.geometry,"activemeasure")},measureComplete:function(a){this.currentPoint=null;this.firstPoint=true;if(this.delayedTrigger){window.clearTimeout(this.delayedTrigger)}},measurePartial:function(a,b){if(this.currentPoint!=null){this.firstPoint=false}this.currentPoint=a.clone();this.delayedTrigger=window.setTimeout(OpenLayers.Function.bind(function(){this.measure(b,"measurepartial")},this),this.partialDelay)},measure:function(e,b){var d,a;if(e.CLASS_NAME.indexOf("LineString")>-1){d=this.getBestLength(e);a=1}else{d=this.getBestArea(e);a=2}this.events.triggerEvent(b,{measure:d[0],units:d[1],order:a,geometry:e,label:this.label,point:this.activePoint});return d[0].toFixed(2)+" "+d[1]},getBestArea:function(h){var b=this.displaySystemUnits[this.displaySystem];var g,e;for(var d=0,a=b.length;d<a;++d){g=b[d];e=this.getArea(h,g);if(e>1){break}}return[e,g]},getArea:function(h,a){var b,d;if(this.geodesic){b=h.getGeodesicArea(this.map.getProjectionObject());d="m"}else{b=h.getArea();d=this.map.getUnits()}var g=OpenLayers.INCHES_PER_UNIT[a];if(g){var e=OpenLayers.INCHES_PER_UNIT[d];b*=Math.pow((e/g),2)}return b},getBestLength:function(h){var b=this.displaySystemUnits[this.displaySystem];var g,e;for(var d=0,a=b.length;d<a;++d){g=b[d];e=this.getLength(h,g);if(e>1){break}}return[e,g]},getLength:function(h,a){var b,d;if(this.geodesic){b=h.getGeodesicLength(this.map.getProjectionObject());d="m"}else{b=h.getLength();d=this.map.getUnits()}var g=OpenLayers.INCHES_PER_UNIT[a];if(g){var e=OpenLayers.INCHES_PER_UNIT[d];b*=(e/g)}return b},CLASS_NAME:"OpenLayers.Control.ActiveMeasure"});OpenLayers.Control.InsertLabel=OpenLayers.Class(OpenLayers.Control,{initialize:function(b,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.layer=b;this.handler=new OpenLayers.Handler.Click(this,{click:this.clickHandler})},clickHandler:function(d){if(!WGX.MapLabelFactory.checkForEditing()){var b=d.object;var a=b.getLonLatFromPixel(d.xy);WGX.MapLabel({text:"",style:WGX.MapStyle.labelStyle,lonlat:a,editable:true})}},activate:function(){this.layer.map.div.style.cursor="text";return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){this.layer.map.div.style.cursor="";return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.InsertLabel"});Ext.namespace("WGX");Ext.namespace("WGX.Print");Ext.namespace("WGX.Tool");Ext.BLANK_IMAGE_URL="http://rs2.adc4gis.com/js/ext/2.2.1/resources/images/default/s.gif";var $=jQuery.noConflict();Ext.onReady(function(){WGX.Popup=WGX.Popup();WGX.Layout=WGX.Layout();WGX.Init()});WGX.Init=function(){$("#site-title").text(WGX.Config.SITE_TITLE);document.title=WGX.Config.SITE_TITLE+" "+document.title;$(".x-tool-collapse-south").remove();WGX.Toolbar.setContent();WGX.LayerTree.setDefaultLayer();WGX.Search.QuickSearch.render();$("#loading,#loading-mask").hide();$("#loading-mask").css({opacity:0.7});$(".close-icon").live("click",function(a){$("#loading-mask, .mask-popup").hide()});$(".about-action").live("click",function(a){a.preventDefault();new InfoPopup("About WG Xtreme","fragments/credits.html")});$(".help-action").click(function(a){a.preventDefault();new InfoPopup("WGX Help","fragments/help.html")});if(localStorage.getItem("disclaimer")!=="off"){$.get("fragments/disclaimer.html",function(b){b=b.replace(/%SITE_TITLE%/g,WGX.Config.SITE_TITLE);var a=new InfoPopup({title:"Welcome to WGX",html:b,modal:true,closable:false});$(".agree-action").live("click",function(d){a.close()});$(".disagree-action").live("click",function(d){document.location="http://www.google.com"});$(".no-disclaimer-action").live("click",function(d){if(this.checked){localStorage.setItem("disclaimer","off")}else{localStorage.removeItem("disclaimer")}})})}WGX.NavigationWidget.resetOrbCoordinates(true);WGX.TabSwitcher.setInitialTab();WGX.Map.zoomToInitialExtent()};WGX.Util=function(){var a=navigator;return{IE:a.userAgent.match(/msie/gi),IE6:a.userAgent.match(/msie 6/gi),loadJSONP:function(d,e,g){var b="wgxjson"+(+new Date());d=d+"?"+$.param(e).replace("%3F",b);window[b]=g;$.getScript(d)}}}();if(typeof localStorage==="undefined"){localStorage={setItem:function(d,e,g){if(g===undefined){g=356}var b=new Date();b.setTime(b.getTime()+(356*24*60*60*1000));var a="; expires="+b.toGMTString();document.cookie=d+"="+e+a+"; path=/"},getItem:function(b){var e=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var g=a[d];while(g.charAt(0)==" "){g=g.substring(1,g.length)}if(g.indexOf(e)==0){return g.substring(e.length,g.length)}}return null},removeItem:function(a){this.setItem(a,"",-1)}}}if(!Array.prototype.forEach){Array.prototype.forEach=function(b){var a=this.length>>>0;if(typeof b!="function"){throw new TypeError()}var e=arguments[1];for(var d=0;d<a;d++){if(d in this){b.call(e,this[d],d,this)}}}}if(!window.console||!console.firebug){var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];window.console={};for(var i=0;i<names.length;++i){window.console[names[i]]=function(){}}}WGX.Config={SITE_TITLE:"Dodge County, WI",MAP_UNITS:"ft",GEOSERVER_PROXY:"http://geo1.adceval.com/wfs",ARCGIS_PROXY:"ags/WMSServer",ARGGIS_PRINT_PROXY:"DodgeCoWi/DodgeImageryDynamic/MapServer/WMSServer",PARCEL_LAYER:"Parcels",WMS_SERVERS:["http://geo1.adceval.com/wms","http://geo2.adceval.com/wms","http://geo3.adceval.com/wms","http://geo4.adceval.com/wms","http://geo5.adceval.com/wms"],GEOSERVER_NAMESPACE:"DodgeCoWi",ALL_LAYERS:["Towns","dnr_wetland_2006","fema_flooplain_zonea_ae_2008","ssurgo_soils","Parcels","Sections","Railroads","PublicLands","HydroLine","HydroPoly","HoriconMarsh","CountyParks","CitiesVillages","WildGooseTrail","Streets","AddressPoints","SurroundingCounties"],OV_LAYERS:["Towns","Parcels","Sections","Railroads","PublicLands","HydroLine","HydroPoly","HoriconMarsh","CountyParks","CitiesVillages","WildGooseTrail","Streets","AddressPoints","SurroundingCounties"],SOURCE_EPSG:"EPSG:103413",MAX_EXTENT:"-89.85799714517,42.83745899078847,-88.03245373621,43.98517287191737",INITIAL_EXTENT:"-89.010705,43.194684,-88.399589,43.633573",MAX_FEATURES_SHOWN:50};Proj4js.defs["EPSG:103413"]="+proj=tmerc +lat_0=41.47222222222222 +lon_0=-88.77500000000001 +k=1.0000346418 +x_0=263347.7263906528 +y_0=0.00762001524003048 +ellps=GRS80 +to_meter=0.3048006096012192 +no_defs";WGX.MapTools=function(){var b=new OpenLayers.Projection("EPSG:4326");var a=new OpenLayers.Projection(WGX.Config.SOURCE_EPSG);var d=new OpenLayers.Format.GeoJSON();return{getParser:function(){return d},projToOpenLayers:function(e){var g=e.clone();return g.transform(b,a)},projToSource:function(e){var g=e.clone();return g.transform(a,b)}}}();WGX.MapStyle=function(){var e={fill:true,fillColor:"#FF0000",fillOpacity:0.6,stroke:true,strokeColor:"#000000",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",pointRadius:6,graphicName:"circle",label:"",labelAlign:"cm",fontColor:"#000000",fontFamily:"sans-serif",fontSize:"11px",fontWeight:"normal"};var d={backgroundColor:"#231F20",color:"#fff",padding:"5px",fontSize:"11px",filter:"alpha(opacity=60)",opacity:0.6};var a=new OpenLayers.Style();a.addRules([new OpenLayers.Rule({symbolizer:{Point:{pointRadius:4,graphicName:"square",fillColor:"#ffffff",fillOpacity:1,strokeWidth:1,strokeOpacity:1,strokeColor:"#ff3333"},Line:{strokeWidth:3,strokeOpacity:1,strokeColor:"#ff0000"},Polygon:{strokeWidth:2,strokeOpacity:1,strokeColor:"#ff0000",fillColor:"#ffffff",fillOpacity:0.5}}})]);var b={style:$.extend(e,{}),labelStyle:$.extend(d,{}),setFeatureStyle:function(g){g.feature.style=$.extend(b.style,{})},getMeasureStyle:function(){return new OpenLayers.StyleMap({"default":a})}};return b}();OpenLayers._getScriptLocation=function(){return"http://rs3.adc4gis.com/js/openlayers/2.8/"};WGX.Map=function(){var m;var r=document;var g=false;var w=false;var s=false;var o;var d=r.getElementById("ovmap-toggle");var t=OpenLayers.Bounds.fromString(WGX.Config.MAX_EXTENT);t=WGX.MapTools.projToOpenLayers(t);var l=OpenLayers.Bounds.fromString(WGX.Config.INITIAL_EXTENT);l=WGX.MapTools.projToOpenLayers(l);var v={controls:[new OpenLayers.Control.ScaleLine({topOutUnits:"mi",topInUnits:"mi",bottomOutUnits:"ft",bottomInUnits:"ft"}),new OpenLayers.Control.Navigation({handleRightClicks:true})],maxExtent:t,maxResolution:495.2534423828129,projection:new OpenLayers.Projection(WGX.Config.SOURCE_EPSG),displayProjection:new OpenLayers.Projection("EPSG:4326"),units:WGX.Config.MAP_UNITS,allOverlays:true,tiled:"true",numZoomLevels:17,eventListeners:{zoomend:function(){w=true},moveend:function(){if(g){if(w){o.zoomToExtent(a.getExtent());o.zoomOut()}else{o.panTo(a.getExtent().getCenterLonLat())}}w=false}},tilesOrigin:t.left+","+t.bottom};var a=new OpenLayers.Map("olmap",v);var q=new OpenLayers.Layer.WMS("Ortho",WGX.Config.ARCGIS_PROXY,{srs:WGX.Config.SOURCE_EPSG,layers:["0"],format:"image/jpeg",tiled:"true",tilesOrigin:t.left+","+t.bottom},{buffer:0});a.addLayer(q);var h=(WGX.Config.GEOSERVER_NAMESPACE+":"+WGX.Config.ALL_LAYERS.join(","+WGX.Config.GEOSERVER_NAMESPACE+":")).split(",");var p=new OpenLayers.Layer.WMS("Fused",WGX.Config.WMS_SERVERS,{srs:WGX.Config.SOURCE_EPSG,layers:WGX.Config.ALL_LAYERS,styles:h,format:WGX.Util.IE6?"image/gif":"image/png",tiled:"true",tilesOrigin:t.left+","+t.bottom,transparent:"true"});a.addLayer(p);var b=new OpenLayers.Layer.Vector("Markup",{eventListeners:{beforefeatureadded:WGX.MapStyle.setFeatureStyle}});a.addLayer(b);$(d).click(function(z){z.stopPropagation();g=!g;if(g){d.className="ovmap-close-icon";$("#ovmap").show();if(o===undefined){u()}o.zoomToExtent(a.getExtent())}else{d.className="ovmap-open-icon";$("#ovmap").hide()}});function u(){o=new OpenLayers.Map("ovmap",{controls:[],maxExtent:t,maxResolution:495.2534423828129,projection:new OpenLayers.Projection(WGX.Config.SOURCE_EPSG),displayProjection:new OpenLayers.Projection("EPSG:4326"),units:WGX.Config.MAP_UNITS,allOverlays:true,tiled:"true",numZoomLevels:17,tilesOrigin:t.left+","+t.bottom});var z=new OpenLayers.Layer.WMS("Overview",WGX.Config.WMS_SERVERS,{srs:WGX.Config.SOURCE_EPSG,layers:WGX.Config.OV_LAYERS,styles:"",format:WGX.Util.IE6?"image/gif":"image/png",tiled:"true",tilesOrigin:t.left+","+t.bottom,transparent:"true"});o.addLayer(z)}var e={getMap:function(){return a},zoomToInitialExtent:function(){var z=OpenLayers.Util.getParameters();if(z.lon&&z.lat&&z.zoom&&!s){var B=new OpenLayers.LonLat(z.lon,z.lat);a.setCenter(B,parseInt(z.zoom));s=true}else{a.zoomToExtent(l);a.zoomTo(1)}},getOverviewMap:function(){return o},getVectorLayer:function(){return b},getFusedLayer:function(){return p},identifyAll:function(z){if(!m){m=new Ext.Window({title:"Identify All",layout:"fit",width:500,height:300,plain:true,autoScroll:true,closeAction:"hide",html:z.text})}else{m.body.dom.innerHTML=z.text}m.show()},idprint:function(){var z=$(".olPopupContent").html();WGX.printNotes=z.replace(/<br\/?>/gi,"\n").replace(/<[^>]*>/gi,"").replace("Print","");WGX.Toolbar.getPrint().print();WGX.printNotes=""}};return e}();WGX.MapLabel=function(d){var r=d||{};var h=WGX.MapLabelFactory;var a=WGX.Map.getMap();var m=document.createElement("div");m.className="map-label";if(r.style){var p;for(p in r.style){m.style[p]=r.style[p]}}function l(){if(r.lonlat){var o=a.getPixelFromLonLat(r.lonlat);var s=r.pointMode?-10:12;var t=r.pointMode?-15:12;m.style.top=o.y-t-parseInt(a.layerContainerDiv.style.top)+"px";m.style.left=o.x-s-parseInt(a.layerContainerDiv.style.left)+"px"}}function e(){if(typeof r.text==="undefined"){m.style.display="none"}else{m.style.display="block";if(r.allowHTML!==true){m.innerHTML=r.text.replace(/</gi,"&lt;")}else{m.innerHTML=r.text}}}l();e();a.layerContainerDiv.appendChild(m);function q(){if(h.removeMode){g.destroy();return}if(g.mode!=="editing"){m.innerHTML='<input style="color:'+r.style.color+';"/>';m.firstChild.value=r.text;m.firstChild.onkeydown=function(o){o=o||window.event;if(o.keyCode===13){m.firstChild.blur()}};m.firstChild.onblur=b;m.firstChild.focus();g.mode="editing"}}function b(){if(m.firstChild.value===""){g.destroy()}else{g.setText(m.firstChild.value);setTimeout(function(){g.mode="normal"},500)}}var g={id:r.id||null,mode:"normal",getLabel:function(){return m},update:function(){l()},setPosition:function(o){r.lonlat=o;l()},setPositionFromPoint:function(o){r.lonlat=o;r.pointMode=true;l()},setText:function(o){r.text=o;e()},destroy:function(){h.remove(m);a.layerContainerDiv.removeChild(m);m=null;r=null}};h.add(g);if(r.editable){m.style.cursor="pointer";m.onclick=q;q()}return g};WGX.MapLabelFactory=function(){var d=[];var b=WGX.Map.getMap();var a={removeMode:false,add:function(e){d.push(e)},remove:function(e){d.forEach(function(h,g){if(h.getLabel()===e){d.splice(g,1);h=null;return false}})},update:function(){d.forEach(function(g,e){g.update()})},removeAll:function(){d.forEach(function(g,e){g.destroy()});$(".map-label").remove()},destroy:function(){a.removeAll();d=null;b.events.unregister("zoomend",b,a.update)},findById:function(g){var e=null;d.forEach(function(l,h){if(l.id===g){e=l;return false}});return e},checkForEditing:function(){var e=false;d.forEach(function(h,g){if(h.mode==="editing"){e=true;return false}});return e}};b.events.register("zoomend",b,a.update);return a}();WGX.LayerTree=function(){var b;var a;var m=WGX.Map.getMap();var d="Fused:"+WGX.Config.GEOSERVER_NAMESPACE;function g(o){return WGX.Config.GEOSERVER_PROXY+"?LAYER="+o+"&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&FORMAT=image%2Fpng&WIDTH=16&HEIGHT=16&LEGEND_OPTIONS=forceLabels:off"}function l(){return' <img src="img/pixel.gif" class="toggle-label" onclick="WGX.LayerTree.triggerLabelToggle(event);" title="Click to toggle labels on and off"> <small>Labels</small>'}b=[{text:"Overlay layers",expanded:true,children:[{id:"defaultlayer",text:"Parcels"+l(),layerName:"Fused:Parcels",checked:true,icon:"img/parcel.png",minscale:1,maxscale:25000,disabled:true},{text:"Address Points"+l(),layerName:"Fused:AddressPoints",checked:false,icon:g("AddressPoints"),minscale:1,maxscale:25000,disabled:true},{text:"Public Lands",layerName:"Fused:PublicLands",checked:false,icon:g("PublicLands")},{text:"Horicon Marsh",layerName:"Fused:HoriconMarsh",checked:true,icon:g("HoriconMarsh")},{text:"County Parks",layerName:"Fused:CountyParks",checked:false,icon:g("CountyParks")},{text:"Wild Goose Trail",layerName:"Fused:WildGooseTrail",checked:false,icon:g("WildGooseTrail")},{text:"SSURGO Soils",layerName:"Fused:ssurgo_soils",checked:false,maxscale:8000,icon:g("ssurgo_soils")},{text:"DNR Wetlands",layerName:"Fused:dnr_wetland_2006",checked:false,maxscale:8000,icon:g("dnr_wetland_2006")},{text:"FEMA Floodplains",layerName:"Fused:fema_flooplain_zonea_ae_2008",checked:false,maxscale:8000,icon:g("fema_flooplain_zonea_ae_2008")}]},{text:"Base Layers",expanded:true,children:[{text:"Cities & Villages",layerName:"Fused:CitiesVillages",checked:true,icon:g("CitiesVillages")},{text:"Towns",layerName:"Fused:Towns",checked:true,icon:g("Towns")},{text:"Sections",layerName:"Fused:Sections",checked:false,icon:g("Sections"),minscale:1,maxscale:100000,disabled:true},{text:"Streets",layerName:"Fused:Streets",checked:true,icon:g("Centerline")},{text:"Railroads",layerName:"Fused:Railroads",checked:false,icon:g("Railroads")},{text:"Lakes and Rivers",layerName:"Fused:HydroPoly",checked:true,icon:g("HydroPoly")},{text:"Rivers and Streams",layerName:"Fused:HydroLine",checked:false,icon:g("HydroLine"),minscale:1,maxscale:100000,disabled:true},{text:"Surrounding Counties",layerName:"Fused:SurroundingCounties",checked:true,icon:g("SurroundingCounties")}]},{text:"Aerial Imagery",expanded:true,children:[{text:"2006 Ortho Photo",layerNames:["Ortho:0"],checked:false,icon:"img/pixel.gif",minscale:1,maxscale:100000,disabled:true}]}];a=new mapfish.widgets.LayerTree({id:"layertree",title:"Layers",openlayersNS:WGX.Config.GEOSERVER_NAMESPACE,region:"north",height:100,map:m,model:b,showWmsLegend:true,border:false,useArrows:true});var e="";function h(o,q,r){if(!q||q.childrenRendered){return}var p=q.attributes.layerNames[0];e=p.replace(/^.*:/,"");WGX.Tool.Identify.setIdentifyLayers(e)}a.getSelectionModel().addListener("beforeselect",h);m.events.register("zoomend",m,function(){a.updateDisabled()});return{getTree:function(){return a},getActiveLayer:function(){return e},setDefaultLayer:function(){a.selModel.select(a.getNodeById("defaultlayer"));h(null,a.getNodeById("defaultlayer"),null)},getPrettyName:function(u){var r;function q(B){var C=document.createElement("span");C.innerHTML=B;B=C.innerText||C.textContent;C=null;B=B.replace(" Points","");B=B.replace(" Labels","");return B.replace(/ies([\s$])/g,"y$1").replace(/([^s])s([\s$])/g,"$1$2")}for(var t=0,v=b.length;t<v;t++){var z=b[t];if(z.children){var o=z.children;for(var s=0,p=o.length;s<p;s++){var w=o[s];r=w.layerNames[0];if(r&&r.match(new RegExp(u+"$","i"))){return q(w.text)}}}else{r=z.layerNames[0];if(r&&r===u){return q(w.text)}}}return u},triggerLabelToggle:function(t){t=t||window.event;var q=t.target||t.srcElement;t.stopPropagation?t.stopPropagation():t.cancelBubble=true;t.preventDefault?t.preventDefault():t.returnValue=false;var s=a.getChecked();var u=q.parentNode.innerText||q.parentNode.textContent;u=u.replace(" Labels","");for(var p=0,o=s.length;p<o;p++){var r=s[p];if(r.attributes.text.match(new RegExp(u,"g"))){r.labelled=!r.labelled;$(q).toggleClass("toggle-label-on");a._handleModelChange(r,true,true)}}}}}();WGX.Popup=function(){var g=null;var l=null;var a=new Ext.Panel({region:"center",autoScroll:true,html:""});var h=new Ext.Window({title:"",closable:true,closeAction:"hide",width:250,height:330,x:jQuery(window).width()-259,y:106,plain:true,shadow:false,layout:"border",items:[a],listeners:{beforehide:function(){var m=WGX.Map.locator;if(m!==undefined){m.unselectAll()}}},bbar:[{text:"Print Map with Data",tooltip:"Prints the details in this popup along with the current map view.",handler:function(){WGX.Tool.Print.print()}},{text:"Print Data",tooltip:"Prints only the details in this popup",handler:function(){WGX.Tool.Print.print(true)}}]});function d(o){var q=o.attributes;var p="<table class='popup-table'>";for(var m in q){var r=q[m];if(r!==null){p+="<tr><td>"+m.toUpperCase()+":</td><td><u>"+r+"</u></td></tr>"}}p+="</table>";return p}function b(o){var p=o.attributes;var q="";for(var m in p){var r=p[m];if(r!==null){q+=m.toUpperCase()+": "+r+"\n"}}return q}h.show();h.hide();var e={loadData:function(m,o){if(g===null){g=a.body.dom}if(l!==m.fid){g.innerHTML=d(m);l=m.fid;h.setTitle(WGX.LayerTree.getPrettyName(l.replace(/\.[^\.]*$/,""))+"Info")}if(o){WGX.Print.Advanced.setNotes(b(m));h.getBottomToolbar().show()}else{h.getBottomToolbar().hide()}h.show()},hideWindow:function(){h.hide();WGX.Print.Advanced.clearNotes()}};return e};InfoPopup=function(g,b){var a={title:g,url:b};if(typeof g==="object"){a=g}var e=new Ext.Window({title:a.title,closable:a.closable===undefined?true:a.closable,closeAction:"close",width:400,height:330,modal:a.modal||false,autoScroll:true,bodyStyle:{backgroundColor:"#fff",padding:"5px"},shadow:false,html:a.html||"",listeners:{close:function(){d()}}});e.show();if(a.url){e.load(a.url)}function d(){delete e}return{close:function(){e.close()}}};WGX.Toolbar=function(){var a=WGX.Tool;var q=[];var o=new mapfish.widgets.toolbar.Toolbar({map:WGX.Map.getMap(),configurable:false});o.autoHeight=false;o.height=25;function l(t){if(l.cache[t]){var w=l.cache[t];for(var u=0,r=w.length;u<r;u++){w[u].show()}}else{var s=new Ext.Toolbar.Spacer();var z=new Ext.Toolbar.Separator();var v=new Ext.Toolbar.Spacer();o.add(s,z,v);l.cache[t]=[s,z,v]}}l.cache=[];function p(){for(var s=0,r=l.cache.length;s<r;s++){var t=l.cache[s];for(var v=0,u=t.length;v<u;v++){t[v].hide()}}}function h(){a.ZoomFull.show();a.ZoomIn.show();a.ZoomOut.show();a.Pan.show();a.NavigationHistory.show()}function e(){l(0);a.ToggleDrawing.show();l(1);a.ParcelInfo.show();a.Measure.show();a.MeasureArea.show();l(2);a.Bookmark.show();a.Print.show()}function b(){a.ToggleDrawing.hide();a.ParcelInfo.hide();a.Measure.hide();a.MeasureArea.hide();a.Bookmark.hide();a.Print.hide()}function g(){l(3);a.ToggleStandard.show();l(4);a.DrawPoint.show();a.DrawLine.show();a.DrawPoly.show();a.InsertLabel.show();a.ModifyFeature.show();a.DeleteFeature.show();a.ClearMarkup.show();l(5);a.Stroke.show();a.Fill.show();a.Point.show();a.Label.show()}function m(){a.ToggleStandard.hide();a.DrawPoint.hide();a.DrawLine.hide();a.DrawPoly.hide();a.InsertLabel.hide();a.ModifyFeature.hide();a.DeleteFeature.hide();a.ClearMarkup.hide();a.Stroke.hide();a.Fill.hide();a.Point.hide();a.Label.hide()}var d={getToolbar:function(){return o},setContent:function(){h();e();o.activate()},switchToolbar:function(r){p();switch(r){case"drawing":b();g();break;case"standard":m();e();break}a.Pan.activate()}};return d}();WGX.Search=function(){var b=WGX.Map.getMap();var d=WGX.Config.GEOSERVER_PROXY;var a=WGX.MapTools.getParser();var e=false;var p=WGX.Config.MAX_FEATURES_SHOWN;var h=false;var o;var m=new OpenLayers.Layer.Vector("ol_Locator_Feature",{styleMap:new OpenLayers.StyleMap({"default":{fillColor:"#0000ff",fillOpacity:0,strokeColor:"#0000ff",strokeOpacity:1,strokeWidth:2,pointRadius:7,cursor:"pointer"},select:{strokeColor:"#ff0000",strokeWidth:4}})});b.addLayer(m);var l=new OpenLayers.Control.SelectFeature(m,{onSelect:function(q){WGX.Popup.loadData(q,h)},onUnselect:function(q){WGX.Popup.hideWindow()}});b.addControl(l);var g={search:function(r){if(!e){g.clearResults();if(r.resetToolbar){WGX.Tool.Pan.activate()}o=r.queryLayers||o;h=r.enablePrint;l.activate();b.div.style.cursor="progress";e=true;var q={request:"GetFeature",typename:o,version:"1.0.0",maxfeatures:p,outputformat:"json",cql_filter:r.cqlfilter,format_options:"callback:?"};WGX.Util.loadJSONP(d,q,function(v){var t=a.read(v);var s=t.length;if(s>0){if(s===p){humanMsg.displayMsg("Results limited to first "+p+" results")}var u=t[0];m.addFeatures(t);if(!r.suppressResultsPanel){WGX.Results.loadFeatureSet(r.queryLayers+" ("+s+")",t)}if(!r.isAddress){l.select(u)}WGX.Results.loadFeatureSet(r.queryLayers+" ("+s+")",t);if(r.zoomTo!==false){if(s===1){b.setCenter(u.geometry.bounds.getCenterLonLat(),7)}else{b.zoomToExtent(m.getDataExtent())}}}else{humanMsg.displayMsg("No Features Found")}e=false;b.div.style.cursor=""})}},zoomByFeatureId:function(r){var q={request:"GetFeature",typename:o,version:"1.0.0",maxfeatures:1,outputformat:"json",featureId:r,format_options:"callback:?"};WGX.Util.loadJSONP(d,q,function(u){var t=a.read(u)[0]||null;if(t){var s=t.geometry.getBounds().getCenterLonLat();b.setCenter(s,7)}})},clearResults:function(){WGX.Popup.hideWindow();m.removeFeatures(m.features);l.deactivate();WGX.Results.clearResults()},unselectAll:function(){l.unselectAll()},select:function(q){l.unselectAll();l.select(q)}};return g}();WGX.Results=function(){var g=document;var a=null;function e(o,l){var p=new Ext.grid.DynamicColumnModel(l);p.defaultSortable=false;var m=new Ext.grid.GridPanel({border:false,title:"All Results for "+o,store:l,closable:true,cm:p,layout:"fit",layoutConfig:{autoFill:true,forcefit:true},listeners:{beforedestroy:function(){a.collapse()},rowdblclick:function(r,s){var q=l.getAt(s);WGX.Search.zoomByFeatureId(q.data.FID)}},selModel:new Ext.grid.RowSelectionModel({singleSelect:true,listeners:{beforerowselect:function(){var q=arguments[3];if(q.data.FID){b(l,q)}}}}),enableColLock:true});a.removeAll();a.insert(0,m);a.activate(m);a.expand()}function b(o,m){var r=o.features;var s=m.data.FID;for(var q=0,l=r.length;q<l;q++){var p=r[q];if(p.fid===s){WGX.Search.select(p);break}}}function d(m){var l=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:m}),reader:new Ext.data.DynamicJsonReader({root:"...my root, yours will be different..."}),remoteSort:true});e(l)}function h(q){var p={results:[]};for(var o=0,l=q.length;o<l;o++){var m=q[o];m.attributes.FID=m.fid;p.results.push(q[o].attributes)}return p}return{getTabPanel:function(){return a},setTabPanel:function(l){a=l},clearResults:function(){try{a.items[0].destroy()}catch(l){a.collapse()}},loadFeatureSet:function(p,m){var l=new Ext.data.Store({reader:new Ext.data.DynamicJsonReader({root:"results",id:"fid"})});var o=h(m);l.loadData(o);l.features=m;e(p,l)},highlightResult:function(l){}}}();WGX.TabSwitcher=function(){var g=true,d=document.getElementById("navigation"),e=WGX.Map.getMap();function b(h,l){if(!g){$(e.div).appendTo(l.body.dom);WGX.Map.getMap().updateSize()}if(l.useSimpleNavigation){d.style.display="block";WGX.Tool.SimpleParcelInfo.activate()}else{d.style.display="none";WGX.Tool.SimpleParcelInfo.deactivate()}g=false}var a=new Ext.TabPanel({region:"center",margins:"0 5 0 0",deferredRender:false,activeTab:0,frame:false,plain:true,border:true,listeners:{tabchange:b},items:[{title:"GIS",contentEl:"olmap",tbar:WGX.Toolbar.getToolbar()}]});return{getPanel:function(){return a},isSimpleNavigation:function(){return d.style.display==="block"},setInitialTab:function(){var h=location.pathname.replace(/\//g,"");switch(h){case"gis":a.setActiveTab(1);break;default:}}}}();WGX.NavigationWidget=function(){var a=WGX.Map.getMap(),h=286,g=106,d=a.getControlsByClass("OpenLayers.Control.Navigation")[0],q,m=false,b;function o(){var s,r;function t(u){s=(u.clientX-h)*8;r=(u.clientY-g)*8}$(".nav-widget-pan").bind("click","dblclick",function(u){u.stopPropagation()}).mousedown(function(u){u.stopPropagation();t(u);a.pan(s,r);b=setInterval(function(){a.pan(s,r)},300);this.onmousemove=function(v){t(v)}}).mouseup(function(u){u.stopPropagation();this.onmousemove=null;clearInterval(b)});a.events.register("mouseup",a,function(){$(".nav-widget-pan")[0].onmousemove=null;clearInterval(b)})}function p(){$(".nav-widget-zoom-in").bind("click","dblclick",function(r){r.stopPropagation()}).mousedown(function(r){r.stopPropagation();a.zoomIn();b=setInterval(function(){a.zoomIn()},300)}).mouseup(function(r){r.stopPropagation();clearInterval(b)});$(".nav-widget-zoom-out").bind("click","dblclick",function(r){r.stopPropagation()}).mousedown(function(r){r.stopPropagation();a.zoomOut();b=setInterval(function(){a.zoomOut()},300)}).mouseup(function(r){r.stopPropagation();clearInterval(b)})}function l(){o();p();if(!q){q=WGX.Tool.SimpleParcelInfo}if(!$.browser.msie){$(".nav-widget").hover(function(){$(this).stop().fadeTo(300,1)},function(){$(this).stop().fadeTo(300,0.8)})}$(".nav-collapse").click(function(r){r.stopPropagation();$(".nav-widget").hide();$(".nav-expand").show()});$(".nav-expand").click(function(r){r.stopPropagation();$(this).hide();$(".nav-widget").show()});m=true}var e={resetOrbCoordinates:function(r){if(r){h=286}else{h=70}if(!m){l()}}};return e}();WGX.Tool.ZoomFull=function(){var b=false;var a=new Ext.Toolbar.Button({iconCls:"tb_zoomfull",tooltip:"<b>Full Extent</b>: Zoom to maximum map extent",toggleGroup:"map",handler:function(){WGX.Map.zoomToInitialExtent()}});var d={show:function(){if(b){a.show()}else{a=WGX.Toolbar.getToolbar().add(a);b=true}},hide:function(){a.hide()}};return d}();WGX.Tool.ZoomIn=function(){var b=false;var e=new OpenLayers.Control.ZoomBox({title:"<b>Zoom In</b>: Click in the map or use the left mouse button and drag to create a rectangle"});var a=new Ext.Toolbar.Button({iconCls:"tb_zoomin",toggleGroup:"map"});var d={show:function(){if(b){a.show()}else{a=WGX.Toolbar.getToolbar().addControl(e,a);b=true}},hide:function(){a.hide()}};return d}();WGX.Tool.ZoomOut=function(){var b=false;var e=new OpenLayers.Control.ZoomBox({out:true,title:"<b>Zoom Out</b>: Click in the map or use the left mouse button and drag to create a rectangle"});var a=new Ext.Toolbar.Button({iconCls:"tb_zoomout",toggleGroup:"map"});var d={show:function(){if(b){a.show()}else{a=WGX.Toolbar.getToolbar().addControl(e,a);b=true}},hide:function(){a.hide()}};return d}();WGX.Tool.Pan=function(){var b=false;var e=new OpenLayers.Control({isDefault:true,title:"<b>Pan/Zoom</b>: Keep the left mouse button pressed and drag the map, use mouse wheel or double click to zoom, shift click to draw a zoom box"});var a=new Ext.Toolbar.Button({iconCls:"tb_pan",toggleGroup:"map"});var d={show:function(){if(b){a.show()}else{a=WGX.Toolbar.getToolbar().addControl(e,a);b=true}},hide:function(){a.hide()},activate:function(){a.toggle(true)}};return d}();WGX.Tool.Identify=function(){var b=false;var e=new OpenLayers.Control.Identify({map:WGX.Map.getMap(),title:"<b>Identify</b>: Get feature information for the current active layer by clicking on the map"});var a=new Ext.Toolbar.Button({iconCls:"tb_identify",toggleGroup:"map"});var d={show:function(){if(b){a.show()}else{a=WGX.Toolbar.getToolbar().addControl(e,a);b=true}},hide:function(){a.hide()},setIdentifyLayers:function(g){e.queryLayers=g}};return d}();WGX.Tool.IdentifyAll=function(){var b=false;var e=new OpenLayers.Control.WMSGetFeatureInfo({title:"<b>Identify All</b>: Get feature information from all layers by clicking on the map",url:WGX.Config.GEOSERVER_PROXY,layerUrls:WGX.Config.WMS_SERVERS,layers:[WGX.Map.getFusedLayer()],eventListeners:{getfeatureinfo:WGX.Map.identifyAll},queryVisible:true});var a=new Ext.Toolbar.Button({iconCls:"tb_identify_all",toggleGroup:"map"});var d={show:function(){if(b){a.show()}else{a=WGX.Toolbar.getToolbar().addControl(e,a);b=true}},hide:function(){a.hide()}};return d}();WGX.Tool.ParcelInfo=function(){var b=false;var e=new OpenLayers.Control.Identify({map:WGX.Map.getMap(),title:"<b>Parcel Information</b>: Get feature information for the parcels layer by clicking on the map"});e.queryLayers=WGX.Config.PARCEL_LAYER;e.enablePrint=true;var a=new Ext.Toolbar.Button({iconCls:"tb_identify",toggleGroup:"map"});var d={show:function(){if(b){a.show()}else{a=WGX.Toolbar.getToolbar().addControl(e,a);b=true}},hide:function(){a.hide()}};return d}();WGX.Tool.SimpleParcelInfo=function(){var a=false;var d=new OpenLayers.Control.SimpleIdentify({map:WGX.Map.getMap()});d.queryLayers=WGX.Config.PARCEL_LAYER;d.enablePrint=true;var b={activate:function(){if(!a){WGX.Map.getMap().addControl(d)}d.activate()},deactivate:function(){d.deactivate()}};return b}();WGX.Tool.Measure=function(){var b=false;var g=new OpenLayers.Control.ActiveMeasure(OpenLayers.Handler.Path,{title:"<b>Measure Distance</b>: Get distance by clicking the map to draw a line; double click to end; hold shift key and left click to draw freehand",persist:true,displaySystem:"english",handlerOptions:{layerOptions:{styleMap:WGX.MapStyle.getMeasureStyle()}},eventListeners:{activemeasure:e,measure:e}});var a=new Ext.Toolbar.Button({iconCls:"tb_measure",toggleGroup:"map"});function e(p){var l;var o=p.geometry.measure||"";var m="";if(p.type==="activemeasure"){var h=p.point;l=new OpenLayers.LonLat(h.x,h.y);if(p.geometry.segmentmeasure){m=p.geometry.segmentmeasure;if(m==="0.00 in"){m=""}}}else{l=p.geometry.getBounds().getCenterLonLat()}if(o){if(m){m="Segment: "+m+"<br/>"}p.label.setText("<b>Distance</b><br/>"+m+"Total: "+o);p.label.setPositionFromPoint(l)}}var d={show:function(){if(b){a.show()}else{a=WGX.Toolbar.getToolbar().addControl(g,a);b=true}},hide:function(){a.hide()}};return d}();WGX.Tool.MeasureArea=function(){var b=false;var g=new OpenLayers.Control.ActiveMeasure(OpenLayers.Handler.Polygon,{title:"<b>Measure Area</b>: Get area by clicking the map to draw a polygon; double click to end; hold shift key and left click to draw freehand",persist:true,displaySystem:"english",handlerOptions:{layerOptions:{styleMap:WGX.MapStyle.getMeasureStyle()}},eventListeners:{activemeasure:e,measure:e}});var a=new Ext.Toolbar.Button({iconCls:"tb_measure_area",toggleGroup:"map"});function e(q){var l;var o=q.geometry.measure||"";var m="";if(q.type==="activemeasure"){var h=q.point;l=new OpenLayers.LonLat(h.x,h.y);if(q.geometry.segmentmeasure){m=q.geometry.segmentmeasure;if(m==="0.00 in"){m=""}}}else{l=q.geometry.getBounds().getCenterLonLat()}if(o){var p=0;if(q.units==="in"){p=q.measure/12}else{if(q.units==="mi"){p=q.measure*27878400}else{p=q.measure}}p=p/43560;o=p.toFixed(2)+" acr."}if(o){if(m){m="Segment: "+m+"<br/>"}q.label.setText("<b>Area</b><br/>"+m+"Total: "+o);q.label.setPositionFromPoint(l)}}var d={show:function(){if(b){a.show()}else{a=WGX.Toolbar.getToolbar().addControl(g,a);b=true}},hide:function(){a.hide()}};return d}();WGX.Tool.Navigation=function(){var d=false;var g=new Ext.menu.Menu();var a=new Ext.menu.Menu();var h=new Ext.menu.Menu({items:[{text:"Town",icon:Ext.BLANK_IMAGE_URL,menu:g},{text:"City/Village",icon:Ext.BLANK_IMAGE_URL,menu:a},{text:"TRS",icon:Ext.BLANK_IMAGE_URL}]});var b=new Ext.Toolbar.Button({iconCls:"tb_navigation",tooltip:"<b>Navigation</b>: Zoom to a Municipality or TRS",menu:h});var e={show:function(){if(d){b.show()}else{WGX.Toolbar.getToolbar().add(b);d=true}},hide:function(){b.hide()}};return e}();WGX.Tool.NavigationHistory=function(){var d=false;var h=new OpenLayers.Control.NavigationHistory();WGX.Map.getMap().addControl(h);h.activate();var g=new Ext.Toolbar.Button({iconCls:"tb_back",tooltip:"<b>Previous View</b>: See previous extent viewed on the map",disabled:false,handler:h.previous.trigger});var b=new Ext.Toolbar.Button({iconCls:"tb_next",tooltip:"<b>Next View</b>: See next extent viewed on the map",disabled:true,handler:h.next.trigger});function a(){h.previous.events.register("activate",g,function(){this.setDisabled(false)});h.previous.events.register("deactivate",g,function(){this.setDisabled(true)});h.next.events.register("activate",b,function(){this.setDisabled(false)});h.next.events.register("deactivate",b,function(){this.setDisabled(true)})}var e={show:function(){if(d){g.show();b.show()}else{var l=WGX.Toolbar.getToolbar();l.add(g);l.add(b);a();d=true}},hide:function(){g.hide();b.hide()}};return e}();WGX.Tool.Print=function(){var d=false;var a=false;var b=new mapfish.widgets.print.PrintAction({map:WGX.Map.getMap(),configUrl:"print-config.json",text:"",layerTree:WGX.LayerTree.getTree(),iconCls:"tb_print",tooltip:"<b>Quick Print</b>: Print the current view of the map",fillSpec:function(g){mapfish.widgets.print.PrintAction.prototype.fillSpec.call(this,g);WGX.Print.Advanced.fillSpec(g);if(g.spec.comment==="Notes:"){g.spec.layout="8.5x11 quickprint"}else{g.spec.layout=a?"8.5x11 data":"8.5x11 landscape"}a=false}});var e={show:function(){if(d){b.show()}else{WGX.Toolbar.getToolbar().add(b);d=true}},hide:function(){b.hide()},print:function(g){a=g||false;b.print()}};return e}();WGX.Tool.DrawPoint=function(){var b=false;var e=new OpenLayers.Control.DrawFeature(WGX.Map.getVectorLayer(),OpenLayers.Handler.Point,{title:"<b>Draw Point</b>: Draw a point on the map by clicking the mouse"});var a=new Ext.Toolbar.Button({iconCls:"tb_drawpoint",toggleGroup:"map"});var d={show:function(){if(b){a.show()}else{a=WGX.Toolbar.getToolbar().addControl(e,a);b=true}},hide:function(){a.hide()}};return d}();WGX.Tool.DrawLine=function(){var b=false;var e=new OpenLayers.Control.DrawFeature(WGX.Map.getVectorLayer(),OpenLayers.Handler.Path,{title:"<b>Draw Line</b>: Draw a line on the map by clicking the mouse; double click mouse to end line; hold shift key and left mouse button down to draw freehand"});var a=new Ext.Toolbar.Button({iconCls:"tb_drawline",toggleGroup:"map"});var d={show:function(){if(b){a.show()}else{a=WGX.Toolbar.getToolbar().addControl(e,a);b=true}},hide:function(){a.hide()}};return d}();WGX.Tool.DrawPoly=function(){var b=false;var e=new OpenLayers.Control.DrawFeature(WGX.Map.getVectorLayer(),OpenLayers.Handler.Polygon,{title:"<b>Draw Polygon</b>: Draw a polygon on the map by clicking the mouse; double click mouse to end line; hold shift key and left mouse button down to draw freehand"});var a=new Ext.Toolbar.Button({iconCls:"tb_drawpolygon",toggleGroup:"map"});var d={show:function(){if(b){a.show()}else{a=WGX.Toolbar.getToolbar().addControl(e,a);b=true}},hide:function(){a.hide()}};return d}();WGX.Tool.InsertLabel=function(){var b=false;var e=new OpenLayers.Control.InsertLabel(WGX.Map.getVectorLayer(),{title:"<b>Insert Label</b>: Insert a label on the map by clicking a point and entering in some text."});var a=new Ext.Toolbar.Button({iconCls:"tb_label",toggleGroup:"map"});var d={show:function(){if(b){a.show()}else{a=WGX.Toolbar.getToolbar().addControl(e,a);b=true}},hide:function(){a.hide()}};return d}();WGX.Tool.ModifyFeature=function(){var b=false;var e=new OpenLayers.Control.ModifyFeature(WGX.Map.getVectorLayer(),{title:"<b>Modify Feature</b>: Modify a drawn feature on the map by clicking on the feature and adjusting the points"});var a=new Ext.Toolbar.Button({iconCls:"tb_modify",toggleGroup:"map"});var d={show:function(){if(b){a.show()}else{a=WGX.Toolbar.getToolbar().addControl(e,a);b=true}},hide:function(){a.hide()}};return d}();WGX.Tool.DeleteFeature=function(){var b=false;var e=new OpenLayers.Control.DeleteFeature(WGX.Map.getVectorLayer(),{title:"<b>Delete Feature</b>: Delete a drawn feature on the map by clicking on the feature"});var a=new Ext.Toolbar.Button({iconCls:"tb_delete",toggleGroup:"map"});var d={show:function(){if(b){a.show()}else{a=WGX.Toolbar.getToolbar().addControl(e,a);b=true}},hide:function(){a.hide()}};return d}();WGX.Tool.ClearMarkup=function(){var b=false;var a=new Ext.Toolbar.Button({iconCls:"tb_clear",tooltip:"<b>Clear Markup</b>: Clear all markup drawn on the map",handler:function(){WGX.Map.getVectorLayer().destroyFeatures();WGX.MapLabelFactory.removeAll()}});var d={show:function(){if(b){a.show()}else{WGX.Toolbar.getToolbar().add(a);b=true}},hide:function(){a.hide()}};return d}();WGX.Tool.Stroke=function(){var g=false;var e=WGX.MapStyle.style;var d=new Ext.Slider({width:80,vertical:false,minValue:0,maxValue:10,increment:1,value:10,plugins:new Ext.ux.SliderTip({getText:function(p){var o=p.getValue()+"0%";if(o=="100%"){o+=" (No Transparency)"}else{if(o=="00%"){o="0% (No Stroke)"}}return o}}),listeners:{change:function(o,p){p=p/10;$("#stroke_opts .drawoptions").css("opacity",p);e.strokeOpacity=p}}});var l=new Ext.Slider({width:80,vertical:false,minValue:1,maxValue:16,increment:1,value:e.strokeWidth,plugins:new Ext.ux.SliderTip(),listeners:{change:function(o,p){e.strokeWidth=p}}});var m=function(o,p){if(p){e.strokeDashstyle=o.text.toLowerCase().replace(/ /gi,"")}};var b=new Ext.menu.Menu({items:[{text:"No Stroke",checked:false,checkHandler:function(o,p){e.stroke=!p;if(p){$("#stroke_text").css("text-decoration","line-through")}else{$("#stroke_text").css("text-decoration","")}}},{text:"Dash Type",iconCls:"tb_dash",menu:{items:[{text:"Solid",checked:true,group:"dashtype",checkHandler:m},{text:"Dot",checked:false,group:"dashtype",checkHandler:m},{text:"Dash",checked:false,group:"dashtype",checkHandler:m},{text:"Dash Dot",checked:false,group:"dashtype",checkHandler:m},{text:"Long Dash",checked:false,group:"dashtype",checkHandler:m},{text:"Long Dash Dot",checked:false,group:"dashtype",checkHandler:m}]}},{text:"Opacity",iconCls:"tb_opacity",menu:new Ext.menu.Menu({items:[new Ext.menu.Adapter(d)]})},{text:"Color",iconCls:"tb_color",menu:new Ext.menu.ColorMenu({handler:function(o,p){if(typeof p!="object"){$("#stroke_opts .drawoptions").css("background-color","#"+p);e.strokeColor="#"+p}}})},{text:"Width",iconCls:"tb_width",menu:new Ext.menu.Menu({items:[new Ext.menu.Adapter(l)]})}]});var a=new Ext.Toolbar.Button({id:"stroke_opts",text:"<div class='drawoptions'></div> &nbsp; &nbsp; &nbsp; <span id='stroke_text'>Stroke</span>",menu:b});var h={show:function(){if(g){a.show()}else{WGX.Toolbar.getToolbar().add(a);jQuery("#stroke_opts .drawoptions").css({backgroundColor:e.strokeColor});g=true}},hide:function(){a.hide()}};return h}();WGX.Tool.Fill=function(){var d=false;var b=WGX.MapStyle.style;var h=new Ext.Slider({width:80,vertical:false,minValue:0,maxValue:10,increment:1,value:8,plugins:new Ext.ux.SliderTip({getText:function(m){var l=m.getValue()+"0%";if(l=="100%"){l+=" (No Transparency)"}else{if(l=="00%"){l="0% (No Fill)"}}return l}}),listeners:{change:function(l,m){m=m/10;$("#fill_opts .drawoptions").css("opacity",m);b.fillOpacity=m}}});var g=new Ext.menu.Menu({items:[{text:"No Fill",checked:false,checkHandler:function(l,m){b.fill=!m;if(m){$("#fill_text").css("text-decoration","line-through")}else{$("#fill_text").css("text-decoration","")}}},{text:"Opacity",iconCls:"tb_opacity",menu:new Ext.menu.Menu({items:[new Ext.menu.Adapter(h)]})},{text:"Color",iconCls:"tb_color",menu:new Ext.menu.ColorMenu({handler:function(l,m){if(typeof m!="object"){$("#fill_opts .drawoptions").css("background-color","#"+m);b.fillColor="#"+m}}})}]});var a=new Ext.Toolbar.Button({id:"fill_opts",text:"<div class='drawoptions'></div> &nbsp; &nbsp; &nbsp; <span id='fill_text'>Fill</span>",menu:g});var e={show:function(){if(d){a.show()}else{WGX.Toolbar.getToolbar().add(a);jQuery("#fill_opts .drawoptions").css({backgroundColor:b.fillColor,opacity:b.fillOpacity});d=true}},hide:function(){a.hide()}};return e}();WGX.Tool.Point=function(){var g=false;var e=WGX.MapStyle.style;var b=new Ext.Slider({width:80,vertical:false,minValue:1,maxValue:26,increment:1,value:e.pointRadius,plugins:new Ext.ux.SliderTip(),listeners:{change:function(m,o){e.pointRadius=o}}});var l=function(m,o){if(o){e.graphicName=m.text.toLowerCase().replace(/ /gi,"")}};var d=new Ext.menu.Menu({items:[{text:"Radius",iconCls:"tb_radius",menu:new Ext.menu.Menu({items:[new Ext.menu.Adapter(b)]})},{text:"Shape",iconCls:"tb_shape",menu:{items:[{text:"Circle",checked:true,group:"shapetype",checkHandler:l},{text:"Square",checked:false,group:"shapetype",checkHandler:l},{text:"Star",checked:false,group:"shapetype",checkHandler:l},{text:"X",checked:false,group:"shapetype",checkHandler:l},{text:"Cross",checked:false,group:"shapetype",checkHandler:l},{text:"Triangle",checked:false,group:"shapetype",checkHandler:l}]}}]});var a=new Ext.Toolbar.Button({text:"<span id='point_text'>Point</span>",menu:d});var h={show:function(){if(g){a.show()}else{WGX.Toolbar.getToolbar().add(a);g=true}},hide:function(){a.hide()}};return h}();WGX.Tool.Label=function(){var e=false;var a=WGX.MapStyle.labelStyle;var h=new Ext.Slider({width:80,vertical:false,minValue:1,maxValue:26,increment:1,value:11,plugins:new Ext.ux.SliderTip(),listeners:{change:function(m,o){a.fontSize=o}}});var d=new Ext.Slider({width:80,vertical:false,minValue:0,maxValue:10,increment:1,value:a.opacity*10,plugins:new Ext.ux.SliderTip({getText:function(o){var m=o.getValue()+"0%";if(m=="100%"){m+=" (No Transparency)"}else{if(m=="00%"){m="0% (No Label)"}}return m}}),listeners:{change:function(m,o){$("#label_opts .drawoptions").css("opacity",o/10);if(WGX.Util.IE){a.filter="alpha(opacity="+(o*10)+")"}else{a.opacity=o/10}}}});var l=new Ext.menu.Menu({items:[{text:"Font Size",iconCls:"tb_size",menu:new Ext.menu.Menu({items:[new Ext.menu.Adapter(h)]})},{text:"Opacity",iconCls:"tb_opacity",menu:new Ext.menu.Menu({items:[new Ext.menu.Adapter(d)]})},{text:"Color",iconCls:"tb_color",menu:new Ext.menu.ColorMenu({handler:function(m,o){if(typeof o!="object"){$("#label_opts .drawoptions").css("color","#"+o);a.color="#"+o}}})},{text:"Background",iconCls:"tb_color",menu:new Ext.menu.ColorMenu({handler:function(m,o){if(typeof o!="object"){$("#label_opts .drawoptions").css("background-color","#"+o);a.backgroundColor="#"+o}}})}]});var b=new Ext.Toolbar.Button({id:"label_opts",text:"<div class='drawoptions'>a</div> &nbsp; &nbsp; &nbsp; <span id='label_text'>Label</span>",menu:l});var g={show:function(){if(e){b.show()}else{WGX.Toolbar.getToolbar().add(b);jQuery("#label_opts .drawoptions").css({backgroundColor:a.backgroundColor,color:a.color,opacity:a.opacity});e=true}},hide:function(){b.hide()}};return g}();WGX.Tool.ToggleStandard=function(){var b=false;var a=new Ext.Toolbar.Button({iconCls:"tb_standard",tooltip:"<b>Standard Mode</b>: Opens standard toolbar.",handler:function(){WGX.Toolbar.switchToolbar("standard")}});var d={show:function(){if(b){a.show()}else{WGX.Toolbar.getToolbar().add(a);b=true}},hide:function(){a.hide()}};return d}();WGX.Tool.ToggleDrawing=function(){var b=false;var a=new Ext.Toolbar.Button({iconCls:"tb_drawing",tooltip:"<b>Draw Mode</b>: Opens drawing toolbar to markup the map.",handler:function(){WGX.Toolbar.switchToolbar("drawing")}});var d={show:function(){if(b){a.show()}else{WGX.Toolbar.getToolbar().add(a);b=true}},hide:function(){a.hide()}};return d}();WGX.Tool.Bookmark=function(){var b=false;var g=document;var h=g.createElement("div");h.className="mask-popup bookmark";var e=new OpenLayers.Control.Permalink();e.map=WGX.Map.getMap();var a=new Ext.Toolbar.Button({iconCls:"tb_bookmark",tooltip:"<b>Map Link</b>: Get a link to this exact map view to bookmark and share with others.",handler:function(){var m=e.createParams();var l=location.href.replace(location.search,"")+"?"+$.param(m);h.innerHTML="<div class='close-icon'></div>Map Link<br/><a href="+l+">"+l+"</a>";$(h).show();$("#loading-mask").show()}});var d={show:function(){if(b){a.show()}else{WGX.Toolbar.getToolbar().add(a);g.body.appendChild(h);b=true}},hide:function(){a.hide()}};return d}();WGX.Search.Address=function(){var b=new Ext.FormPanel({labelWidth:70,border:false,defaultType:"textfield",items:[{xtype:"label",html:"<p>Enter your search criteria below:</p><br/>"},{id:"search-address-focus",fieldLabel:"House #",name:"housenumber",width:150,enableKeyEvents:true,listeners:{keyup:function(g,d){if(d.browserEvent.keyCode===d.ENTER){Ext.getCmp("search-address-submit").initialConfig.handler()}}}},{fieldLabel:"Street Name",name:"streetname",width:150,enableKeyEvents:true,listeners:{keyup:function(g,d){if(d.browserEvent.keyCode===d.ENTER){Ext.getCmp("search-address-submit").initialConfig.handler()}}}}],buttons:[{id:"search-address-submit",text:"Search",handler:function(){var e=b.getForm().getValues();var g=[],d;if(e.housenumber){d=e.housenumber.replace(/\./g,"");d=/^([NSEW]?).*?(\d*)$/i.exec(d);if(d[1]!==""){g.push(" ADD1 = '"+d[1].toUpperCase()+"' ")}if(d[2]!==""){g.push(" ADD2 = '"+d[2]+"' ")}}if(e.streetname){d=e.streetname.replace(/\./g,"");d=/^([NSEW]?).*?(.*)$/i.exec(d);if(d[1]!==""){g.push(" ADD3 = '"+d[1].toUpperCase()+"' ")}if(d[2]!==""){g.push(" ADD4 LIKE '%"+d[2].toUpperCase()+"%' ")}}WGX.Search.search({resetToolbar:true,isAddress:true,queryLayers:"AddressPoints",cqlfilter:g.join("AND")})}},{text:"Clear Results",handler:function(){b.getForm().reset();WGX.Search.clearResults()},tooltip:"Clears both search form and results on the map"}]});var a=new Ext.Panel({title:"Address Search",border:false,autoScroll:true,items:[b,{border:false,autoLoad:"fragments/address-help.html"}],listeners:{expand:function(){Ext.getCmp("search-address-focus").focus()}}});return{getPanel:function(){return a}}}();WGX.Search.Parcel=function(){var b=new Ext.FormPanel({labelWidth:70,border:false,items:[{xtype:"label",html:"<p>Enter your search criteria below:</p><br/>"},new Ext.form.TextField({id:"search-parcel-focus",fieldLabel:"PIN",name:"first",width:140,enableKeyEvents:true,listeners:{keyup:function(g,d){if(d.browserEvent.keyCode===d.ENTER){Ext.getCmp("search-parcel-submit").initialConfig.handler()}}}})],buttons:[{id:"search-parcel-submit",text:"Submit",isFormField:true,handler:function(){var d=b.getForm().getValues();WGX.Search.search({enablePrint:true,resetToolbar:true,queryLayers:"Parcels",cqlfilter:"gispin = '"+d.first.replace(/-/g,"")+"'"})}},{text:"Clear Results",isFormField:true,handler:function(){b.getForm().reset();WGX.Search.clearResults()},tooltip:"Clears both search form and results on the map"}]});var a=new Ext.Panel({title:"Parcel Search",border:false,items:b,listeners:{expand:function(){Ext.getCmp("search-parcel-focus").focus()}}});return{getPanel:function(){return a}}}();WGX.Search.QuickSearch=function(){var a=new Ext.FormPanel({frame:false,border:false,layout:"fit",items:new Ext.form.TextField({id:"quicksearch",name:"first",emptyText:"Quick Search: Enter Parcel Number",enableKeyEvents:true,listeners:{keyup:function(h,g){if(g.browserEvent.keyCode===g.ENTER){var d=h.getValue();b(d)}}}})});function b(d){WGX.Search.search({enablePrint:true,queryLayers:"Parcels",cqlfilter:"gispin = '"+d.replace(/-/g,"")+"'"})}return{getForm:function(){return a},render:function(){a.render("quick-search");$(".quick-search-go").click(function(){var e=Ext.getCmp("quicksearch").getValue();b(e)});if(location.search&&location.search.match(/pin/gi)){var d=new RegExp("pin=([0-9.]*)").exec(location.search)[1];b(d)}}}}();WGX.Print.Advanced=function(){var g=location.host;var b="";var e=new mapfish.widgets.print.SimpleForm({xtype:"print-simple",formConfig:{labelWidth:65,defaults:{width:140,listWidth:140},items:[{id:"advanced-print-focus",xtype:"textfield",fieldLabel:"Title",name:"mapTitle"},{xtype:"textarea",fieldLabel:"Notes",name:"comment",height:100}]},border:false,map:WGX.Map.getMap(),layerTree:WGX.LayerTree.getTree(),configUrl:"print-config.json",fillSpec:function(h){mapfish.widgets.print.SimpleForm.prototype.fillSpec.call(this,h);d.fillSpec(h);var l=e.formPanel.getForm().getValues();h.spec.mapTitle=l.mapTitle;h.spec.comment="Notes: "+(l.notes||"")}});var a=new Ext.Panel({title:"Advanced Print",border:false,items:e,listeners:{expand:function(){e.enable();Ext.getCmp("advanced-print-focus").focus()},collapse:function(){e.disable()}}});var d={getPanel:function(){return a},generatePrintUrl:function(h){try{if(h.match(WGX.Config.ARCGIS_PROXY)){return"http://localhost:8080/geoprint/agsproxy/"+WGX.Config.ARGGIS_PRINT_PROXY}}catch(l){}return"http://localhost:8080/geoserver176/wms"},setNotes:function(h){b=h},clearNotes:function(){b=""},fillSpec:function(l){l.spec.mapTitle=WGX.Config.SITE_TITLE;l.spec.comment=b||"Notes:";l.spec.layers[0].baseURL=d.generatePrintUrl(l.spec.layers[0].baseURL);l.spec.layers[1].baseURL=d.generatePrintUrl(l.spec.layers[1].baseURL);var m=l.spec.legends;if(m){for(var o=0,h=m.length;o<h;o++){var p=m[o];p.icon=p.icon.replace(WGX.Config.GEOSERVER_PROXY,"http://localhost:8080/geoserver176/wms");p.icon=p.icon.replace(g,"localhost:8080/geoprint");p.name=p.name.replace(/<.*$/,"")}}}};return d}();Ext.BLANK_IMAGE_URL="http://rs1.adc4gis.com/js/ext/2.2.1/resources/images/default/s.gif";WGX.Layout=function(){Ext.QuickTips.init();function d(){return jQuery(window).height()-jQuery("#header").outerHeight()-jQuery("#footer").outerHeight()}function a(){return jQuery(window).width()}var b=new Ext.Panel({layout:"border",renderTo:"main",border:false,frame:false,width:a(),height:d(),items:[{region:"west",id:"sidebar",split:true,splitTooltip:true,width:245,xtype:"panel",minWidth:200,collapsible:true,collapseMode:"mini",floatable:false,animCollapse:false,useSplitTips:true,collapsibleSplitTip:"Double click to expand/collapse sidebar.  Click and drag to adjust sidebar width.",margins:"0 0 0 5",layout:"accordion",defaults:{bodyStyle:{padding:"5px"}},items:[WGX.LayerTree.getTree(),WGX.Search.Parcel.getPanel(),WGX.Search.Address.getPanel(),WGX.Print.Advanced.getPanel()]},WGX.TabSwitcher.getPanel(),{region:"south",id:"south-panel",split:true,height:150,minSize:100,maxSize:500,collapsible:true,collapsed:true,collapseMode:"mini",collapsibleSplitTip:"Double click to expand/collapse sidebar.  Click and drag to adjust sidebar height.",floatable:false,animCollapse:false,xtype:"tabpanel",deferredRender:true,activeTab:0,plain:true,afterRender:function(){Ext.Panel.prototype.afterRender.apply(this,arguments);WGX.Results.setTabPanel(this)}}]});window.onresize=function(){b.setHeight(d());b.setWidth(a())};return{getPanel:function(){return b}}};