/*
  OpenLayers.js -- OpenLayers Map Viewer Library

  Copyright 2005-2007 MetaCarta, Inc., released under the BSD license.
  Please see http://svn.openlayers.org/trunk/openlayers/release-license.txt
  for the full text of the license.

  Includes compressed code under the following licenses:

  (For uncompressed versions of the code used please see the
  OpenLayers SVN repository: <http://openlayers.org/>)

*/

/* Contains portions of Prototype.js:
 *
 * Prototype JavaScript framework, version 1.4.0
 *  (c) 2005 Sam Stephenson <sam@conio.net>
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://prototype.conio.net/
 *
/*--------------------------------------------------------------------------*/

/**  
 *  
 *  Contains portions of Rico <http://openrico.org/>
 * 
 *  Copyright 2005 Sabre Airline Solutions  
 *  
 *  Licensed under the Apache License, Version 2.0 (the "License"); you
 *  may not use this file except in compliance with the License. You
 *  may obtain a copy of the License at
 *  
 *         http://www.apache.org/licenses/LICENSE-2.0  
 *  
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 *  implied. See the License for the specific language governing
 *  permissions and limitations under the License. 
 *
**/

/*
 *---------------------------------------------------------------------------------
 * Copyright (C) 2007 - Regione Autonoma della Sardegna <www.regione.sardegna.it>
 * Tutti i diritti riservati.
 *
 * Autore - CORE Soluzioni Informatiche srl Bologna <www.corenet.it>
 *
 * Questo programma e' stato sviluppato nell'ambito del progetto RAS SIT2COM
 *----------------------------------------------------------------------------------
**/

ROJA_VERSION='2.2.2';
var serializeFunction=function(){
var _1={};
var _2=eval(this.CLASS_NAME);
var _3=_2.prototype.serializable;
if(_3!=null){
var _4;
var _5=_3.args;
if(_5){
for(_4=0;_4<_5.length;++_4){
_1[_5[_4]]=OpenLayers.Class.serialize(this[_5[_4]]);
}
}
var _6=_3.props;
if(_6){
for(_4=0;_4<_6.length;++_4){
_1[_6[_4]]=OpenLayers.Class.serialize(this[_6[_4]]);
}
}
}
_1.CLASS_NAME=this.CLASS_NAME;
return _1;
};
OpenLayers.Class.recursionDepth=20;
OpenLayers.Class.serialize=function(_7,_8){
var _9;
_8=(_8!=undefined)?_8+1:0;
if(!(_7 instanceof Function)){
if(_8<=OpenLayers.Class.recursionDepth){
if(_7&&_7.serialize instanceof Function){
_9=_7.serialize();
}else{
if(_7 instanceof Array){
_9=new Array(_7.length);
for(var i=0;i<_7.length;++i){
_9[i]=OpenLayers.Class.serialize(_7[i],_8);
}
}else{
if(_7 instanceof Object){
_9={};
var _b;
for(var _c in _7){
_b=OpenLayers.Class.serialize(_7[_c],_8);
if(_b!==undefined){
_9[_c]=OpenLayers.Class.serialize(_7[_c],_8);
}
}
}else{
_9=_7;
}
}
}
}
}
return _9;
};
OpenLayers.Class.deserialize=function(_d,_e){
var _f,index,key;
_e=(_e!=undefined)?_e+1:1;
if(_d instanceof Function){
var msg="Cannot serialize functions";
OpenLayers.Console.error(msg);
}else{
if(_e<=OpenLayers.Class.recursionDepth){
if(!_d){
_f=_d;
}else{
if(!_d.CLASS_NAME||!(_d.CLASS_NAME.indexOf("OpenLayers")==0||_d.CLASS_NAME.indexOf("Roja")==0)){
if(_d instanceof Array){
_f=new Array(_d.length);
for(index=0;index<_d.length;++index){
_f[index]=OpenLayers.Class.deserialize(_d[index],_e);
}
}else{
if(_d instanceof Object){
_f={};
for(key in _d){
_f[key]=OpenLayers.Class.deserialize(_d[key],_e);
}
}else{
_f=_d;
}
}
}else{
var _11=eval(_d.CLASS_NAME);
if(!_11.prototype.serializable){
var msg="Unable to deserialize.  CLASS_NAME: "+_d.CLASS_NAME;
throw Error(msg);
}
var _12=_11.prototype.serializable.args;
var _13=[];
if(_12){
for(index=0;index<_12.length;++index){
key=_12[index];
if(_d[key]===undefined){
var msg="Deserializing failed.  "+_d.CLASS_NAME+" requires argument: "+key;
throw Error(msg);
}
_13.push(OpenLayers.Class.deserialize(_d[key],_e));
}
}
var _14={};
var _15=_11.prototype.serializable.props;
if(_15){
for(index=0;index<_15.length;++index){
key=_15[index];
_14[key]=OpenLayers.Class.deserialize(_d[key],_e);
}
}
if(_d.CLASS_NAME=="OpenLayers.Map"||_d.CLASS_NAME=="Roja.Map"){
_f=_14;
}else{
OpenLayers.Util.applyDefaults(_14,_11.prototype);
_f=_11.apply(_14,_13);
_f=_14;
}
}
}
}
}
return _f;
};
OpenLayers.Layer.Markers.prototype.initialize=function(_16,_17){
OpenLayers.Layer.prototype.initialize.apply(this,arguments);
if(this.markers==null){
this.markers=[];
}
};
OpenLayers.Layer.Vector.prototype.initialize=function(_18,_19){
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();
}
if(this.features==null){
this.features=[];
}
this.selectedFeatures=[];
this.unrenderedFeatures={};
if(this.strategies){
for(var i=0,len=this.strategies.length;i<len;i++){
this.strategies[i].setLayer(this);
}
}
};
OpenLayers.Renderer.SVG.prototype.supported=function(){
var _1b="http://www.w3.org/TR/SVG11/feature#";
return (document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(_1b+"SVG","1.1")||document.implementation.hasFeature(_1b+"BasicStructure","1.1")));
};
OpenLayers.Map.prototype.serializable={"props":["layers","center","zoom","bounds","projection","units","maxResolution","numZoomLevels","maxExtent"]};
OpenLayers.Bounds.prototype.serializable={"props":[],"args":["left","bottom","right","top"]};
OpenLayers.Layer.Image.prototype.serializable={"props":["numZoomLevels","maxResolution","minResolution","maxExtent","wrapDateLine","displayOutsideMaxExtent","isBaseLayer","displayInLayerSwitcher","visibility","opacity"],"args":["name","url","extent","size"]};
OpenLayers.Layer.Vector.prototype.serializable={"props":["numZoomLevels","maxResolution","minResolution","maxExtent","wrapDateLine","displayOutsideMaxExtent","isBaseLayer","displayInLayerSwitcher","visibility","opacity","geometryType","isFixed","isVector","features","selectedFeatures","style"],"args":["name"]};
OpenLayers.LonLat.prototype.serializable={"props":[],"args":["lon","lat"]};
OpenLayers.Geometry.LineString.prototype.serializable={"args":["components"],"props":["componentTypes"]};
OpenLayers.Geometry.LinearRing.prototype.serializable={"args":["components"],"props":["componentTypes"]};
OpenLayers.Geometry.Polygon.prototype.serializable={"args":["components"],"props":["componentTypes"]};
OpenLayers.Geometry.MultiPolygon.prototype.serializable={"args":["components"],"props":["componentTypes"]};
OpenLayers.Geometry.Point.prototype.serializable={"args":["x","y"],"props":[]};
OpenLayers.Feature.Vector.prototype.serializable={"args":["geometry","attributes","style"],"props":[]};
OpenLayers.Size.prototype.serializable={"props":[],"args":["w","h"]};
OpenLayers.Icon.prototype.serializable={"props":[],"args":["url","size","offset"]};
OpenLayers.Pixel.prototype.serializable={"props":[],"args":["x","y"]};
OpenLayers.Layer.Markers.prototype.serializable={"props":["markers","numZoomLevels","maxResolution","minResolution","maxExtent","wrapDateLine","displayOutsideMaxExtent","isBaseLayer","displayInLayerSwitcher","visibility","opacity"],"args":["name","options"]};
OpenLayers.Layer.TMS.prototype.serializable={"args":["name","url","options"],"props":["serviceVersion","tileOrigin","isBaseLayer","layername","type","numZoomLevels","maxResolution","minResolution","maxExtent","wrapDateLine","displayOutsideMaxExtent","displayInLayerSwitcher","visibility","opacity","backgroundColor","overlay","transitionEffect"]};
OpenLayers.Layer.WMS.prototype.serializable={"args":["name","url","params","options"],"props":["reproject","encodeBBOX","layername","type","numZoomLevels","maxResolution","minResolution","maxExtent","wrapDateLine","displayOutsideMaxExtent","isBaseLayer","displayInLayerSwitcher","visibility","opacity"]};
OpenLayers.Marker.prototype.serializable={"props":[],"args":[]};
OpenLayers.Projection.prototype.serializable={"props":["proj","projCode"],"args":["projCode"]};
OpenLayers.Map.prototype.serialize=serializeFunction;
OpenLayers.Bounds.prototype.serialize=serializeFunction;
OpenLayers.Layer.Image.prototype.serialize=serializeFunction;
OpenLayers.Layer.Vector.prototype.serialize=serializeFunction;
OpenLayers.LonLat.prototype.serialize=serializeFunction;
OpenLayers.Geometry.LineString.prototype.serialize=serializeFunction;
OpenLayers.Geometry.Point.prototype.serialize=serializeFunction;
OpenLayers.Geometry.Polygon.prototype.serialize=serializeFunction;
OpenLayers.Geometry.MultiPolygon.prototype.serialize=serializeFunction;
OpenLayers.Geometry.LinearRing.prototype.serialize=serializeFunction;
OpenLayers.Feature.Vector.prototype.serialize=serializeFunction;
OpenLayers.Layer.Vector.prototype.serialize=serializeFunction;
OpenLayers.Size.prototype.serialize=serializeFunction;
OpenLayers.Marker.prototype.serialize=serializeFunction;
OpenLayers.Icon.prototype.serialize=serializeFunction;
OpenLayers.Pixel.prototype.serialize=serializeFunction;
OpenLayers.Layer.Markers.prototype.serialize=serializeFunction;
OpenLayers.Layer.TMS.prototype.serialize=serializeFunction;
OpenLayers.Layer.WMS.prototype.serialize=serializeFunction;
OpenLayers.Projection.prototype.serialize=serializeFunction;

Roja={};
OpenLayers.VERSION_NUMBER="$Revision: 1.9 $";

var Prototype={Version:"1.5.1_rc3",Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:(document.createElement("div").__proto__!==document.createElement("form").__proto__)},ScriptFragment:"<script[^>]*>([\x01-\uffff]*?)</script>",JSONFilter:/^\/\*-secure-\s*(.*)\s*\*\/\s*$/,emptyFunction:function(){
},K:function(x){
return x;
}};
var Class={create:function(){
return function(){
this.initialize.apply(this,arguments);
};
}};
var Abstract=new Object();
Object.extend=function(_2,_3){
for(var _4 in _3){
_2[_4]=_3[_4];
}
return _2;
};
Object.extend(Object,{inspect:function(_5){
try{
if(_5===undefined){
return "undefined";
}
if(_5===null){
return "null";
}
return _5.inspect?_5.inspect():_5.toString();
}
catch(e){
if(e instanceof RangeError){
return "...";
}
throw e;
}
},toJSON:function(_6){
var _7=typeof _6;
switch(_7){
case "undefined":
case "function":
case "unknown":
return;
case "boolean":
return _6.toString();
}
if(_6===null){
return "null";
}
if(_6.toJSON){
return _6.toJSON();
}
if(_6.ownerDocument===document){
return;
}
var _8=[];
for(var _9 in _6){
var _a=Object.toJSON(_6[_9]);
if(_a!==undefined){
_8.push(_9.toJSON()+": "+_a);
}
}
return "{"+_8.join(", ")+"}";
},keys:function(_b){
var _c=[];
for(var _d in _b){
_c.push(_d);
}
return _c;
},values:function(_e){
var _f=[];
for(var _10 in _e){
_f.push(_e[_10]);
}
return _f;
},clone:function(_11){
return Object.extend({},_11);
}});
Function.prototype.bind=function(){
var _12=this,args=$A(arguments),object=args.shift();
return function(){
return _12.apply(object,args.concat($A(arguments)));
};
};
Function.prototype.bindAsEventListener=function(_13){
var _14=this,args=$A(arguments),_13=args.shift();
return function(_15){
return _14.apply(_13,[(_15||window.event)].concat(args).concat($A(arguments)));
};
};
Object.extend(Number.prototype,{toColorPart:function(){
return this.toPaddedString(2,16);
},succ:function(){
return this+1;
},times:function(_16){
$R(0,this,true).each(_16);
return this;
},toPaddedString:function(_17,_18){
var _19=this.toString(_18||10);
return "0".times(_17-_19.length)+_19;
},toJSON:function(){
return isFinite(this)?this.toString():"null";
}});
Date.prototype.toJSON=function(){
return "\""+this.getFullYear()+"-"+(this.getMonth()+1).toPaddedString(2)+"-"+this.getDate().toPaddedString(2)+"T"+this.getHours().toPaddedString(2)+":"+this.getMinutes().toPaddedString(2)+":"+this.getSeconds().toPaddedString(2)+"\"";
};
var Try={these:function(){
var _1a;
for(var i=0,length=arguments.length;i<length;i++){
var _1c=arguments[i];
try{
_1a=_1c();
break;
}
catch(e){
}
}
return _1a;
}};
var PeriodicalExecuter=Class.create();
PeriodicalExecuter.prototype={initialize:function(_1d,_1e){
this.callback=_1d;
this.frequency=_1e;
this.currentlyExecuting=false;
this.registerCallback();
},registerCallback:function(){
this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},stop:function(){
if(!this.timer){
return;
}
clearInterval(this.timer);
this.timer=null;
},onTimerEvent:function(){
if(!this.currentlyExecuting){
try{
this.currentlyExecuting=true;
this.callback(this);
}
finally{
this.currentlyExecuting=false;
}
}
}};
Object.extend(String,{interpret:function(_1f){
return _1f==null?"":String(_1f);
},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});
Object.extend(String.prototype,{gsub:function(_20,_21){
var _22="",source=this,match;
_21=arguments.callee.prepareReplacement(_21);
while(source.length>0){
if(match=source.match(_20)){
_22+=source.slice(0,match.index);
_22+=String.interpret(_21(match));
source=source.slice(match.index+match[0].length);
}else{
_22+=source,source="";
}
}
return _22;
},sub:function(_23,_24,_25){
_24=this.gsub.prepareReplacement(_24);
_25=_25===undefined?1:_25;
return this.gsub(_23,function(_26){
if(--_25<0){
return _26[0];
}
return _24(_26);
});
},scan:function(_27,_28){
this.gsub(_27,_28);
return this;
},truncate:function(_29,_2a){
_29=_29||30;
_2a=_2a===undefined?"...":_2a;
return this.length>_29?this.slice(0,_29-_2a.length)+_2a:this;
},strip:function(){
return this.replace(/^\s+/,"").replace(/\s+$/,"");
},stripTags:function(){
return this.replace(/<\/?[^>]+>/gi,"");
},stripScripts:function(){
return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");
},extractScripts:function(){
var _2b=new RegExp(Prototype.ScriptFragment,"img");
var _2c=new RegExp(Prototype.ScriptFragment,"im");
return (this.match(_2b)||[]).map(function(_2d){
return (_2d.match(_2c)||["",""])[1];
});
},evalScripts:function(){
return this.extractScripts().map(function(_2e){
return eval(_2e);
});
},escapeHTML:function(){
var _2f=arguments.callee;
_2f.text.data=this;
return _2f.div.innerHTML;
},unescapeHTML:function(){
var div=document.createElement("div");
div.innerHTML=this.stripTags();
return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject("",function(_31,_32){
return _31+_32.nodeValue;
}):div.childNodes[0].nodeValue):"";
},toQueryParams:function(_33){
var _34=this.strip().match(/([^?#]*)(#.*)?$/);
if(!_34){
return {};
}
return _34[1].split(_33||"&").inject({},function(_35,_36){
if((_36=_36.split("="))[0]){
var key=decodeURIComponent(_36.shift());
var _38=_36.length>1?_36.join("="):_36[0];
if(_38!=undefined){
_38=decodeURIComponent(_38);
}
if(key in _35){
if(_35[key].constructor!=Array){
_35[key]=[_35[key]];
}
_35[key].push(_38);
}else{
_35[key]=_38;
}
}
return _35;
});
},toArray:function(){
return this.split("");
},succ:function(){
return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1);
},times:function(_39){
var _3a="";
for(var i=0;i<_39;i++){
_3a+=this;
}
return _3a;
},camelize:function(){
var _3c=this.split("-"),len=_3c.length;
if(len==1){
return _3c[0];
}
var _3d=this.charAt(0)=="-"?_3c[0].charAt(0).toUpperCase()+_3c[0].substring(1):_3c[0];
for(var i=1;i<len;i++){
_3d+=_3c[i].charAt(0).toUpperCase()+_3c[i].substring(1);
}
return _3d;
},capitalize:function(){
return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase();
},underscore:function(){
return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase();
},dasherize:function(){
return this.gsub(/_/,"-");
},inspect:function(_3f){
var _40=this.gsub(/[\x00-\x1f\\]/,function(_41){
var _42=String.specialChar[_41[0]];
return _42?_42:"\\u00"+_41[0].charCodeAt().toPaddedString(2,16);
});
if(_3f){
return "\""+_40.replace(/"/g,"\\\"")+"\"";
}
return "'"+_40.replace(/'/g,"\\'")+"'";
},toJSON:function(){
return this.inspect(true);
},unfilterJSON:function(_43){
return this.sub(_43||Prototype.JSONFilter,"#{1}");
},evalJSON:function(_44){
var _45=this.unfilterJSON();
try{
if(!_44||(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(_45))){
return eval("("+_45+")");
}
}
catch(e){
}
throw new SyntaxError("Badly formed JSON string: "+this.inspect());
},include:function(_46){
return this.indexOf(_46)>-1;
},startsWith:function(_47){
return this.indexOf(_47)===0;
},endsWith:function(_48){
var d=this.length-_48.length;
return d>=0&&this.lastIndexOf(_48)===d;
},empty:function(){
return this=="";
},blank:function(){
return /^\s*$/.test(this);
}});
if(Prototype.Browser.WebKit||Prototype.Browser.IE){
Object.extend(String.prototype,{escapeHTML:function(){
return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
},unescapeHTML:function(){
return this.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">");
}});
}
String.prototype.gsub.prepareReplacement=function(_4a){
if(typeof _4a=="function"){
return _4a;
}
var _4b=new Template(_4a);
return function(_4c){
return _4b.evaluate(_4c);
};
};
String.prototype.parseQuery=String.prototype.toQueryParams;
Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});
with(String.prototype.escapeHTML){
div.appendChild(text);
}
var Template=Class.create();
Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
Template.prototype={initialize:function(_4d,_4e){
this.template=_4d.toString();
this.pattern=_4e||Template.Pattern;
},evaluate:function(_4f){
return this.template.gsub(this.pattern,function(_50){
var _51=_50[1];
if(_51=="\\"){
return _50[2];
}
return _51+String.interpret(_4f[_50[3]]);
});
}};
var $break=new Object();
var $continue=new Object();
var Enumerable={each:function(_52){
var _53=0;
try{
this._each(function(_54){
_52(_54,_53++);
});
}
catch(e){
if(e!=$break){
throw e;
}
}
return this;
},eachSlice:function(_55,_56){
var _57=-_55,slices=[],array=this.toArray();
while((_57+=_55)<array.length){
slices.push(array.slice(_57,_57+_55));
}
return slices.map(_56);
},all:function(_58){
var _59=true;
this.each(function(_5a,_5b){
_59=_59&&!!(_58||Prototype.K)(_5a,_5b);
if(!_59){
throw $break;
}
});
return _59;
},any:function(_5c){
var _5d=false;
this.each(function(_5e,_5f){
if(_5d=!!(_5c||Prototype.K)(_5e,_5f)){
throw $break;
}
});
return _5d;
},collect:function(_60){
var _61=[];
this.each(function(_62,_63){
_61.push((_60||Prototype.K)(_62,_63));
});
return _61;
},detect:function(_64){
var _65;
this.each(function(_66,_67){
if(_64(_66,_67)){
_65=_66;
throw $break;
}
});
return _65;
},findAll:function(_68){
var _69=[];
this.each(function(_6a,_6b){
if(_68(_6a,_6b)){
_69.push(_6a);
}
});
return _69;
},grep:function(_6c,_6d){
var _6e=[];
this.each(function(_6f,_70){
var _71=_6f.toString();
if(_71.match(_6c)){
_6e.push((_6d||Prototype.K)(_6f,_70));
}
});
return _6e;
},include:function(_72){
var _73=false;
this.each(function(_74){
if(_74==_72){
_73=true;
throw $break;
}
});
return _73;
},inGroupsOf:function(_75,_76){
_76=_76===undefined?null:_76;
return this.eachSlice(_75,function(_77){
while(_77.length<_75){
_77.push(_76);
}
return _77;
});
},inject:function(_78,_79){
this.each(function(_7a,_7b){
_78=_79(_78,_7a,_7b);
});
return _78;
},invoke:function(_7c){
var _7d=$A(arguments).slice(1);
return this.map(function(_7e){
return _7e[_7c].apply(_7e,_7d);
});
},max:function(_7f){
var _80;
this.each(function(_81,_82){
_81=(_7f||Prototype.K)(_81,_82);
if(_80==undefined||_81>=_80){
_80=_81;
}
});
return _80;
},min:function(_83){
var _84;
this.each(function(_85,_86){
_85=(_83||Prototype.K)(_85,_86);
if(_84==undefined||_85<_84){
_84=_85;
}
});
return _84;
},partition:function(_87){
var _88=[],falses=[];
this.each(function(_89,_8a){
((_87||Prototype.K)(_89,_8a)?_88:falses).push(_89);
});
return [_88,falses];
},pluck:function(_8b){
var _8c=[];
this.each(function(_8d,_8e){
_8c.push(_8d[_8b]);
});
return _8c;
},reject:function(_8f){
var _90=[];
this.each(function(_91,_92){
if(!_8f(_91,_92)){
_90.push(_91);
}
});
return _90;
},sortBy:function(_93){
return this.map(function(_94,_95){
return {value:_94,criteria:_93(_94,_95)};
}).sort(function(_96,_97){
var a=_96.criteria,b=_97.criteria;
return a<b?-1:a>b?1:0;
}).pluck("value");
},toArray:function(){
return this.map();
},zip:function(){
var _99=Prototype.K,args=$A(arguments);
if(typeof args.last()=="function"){
_99=args.pop();
}
var _9a=[this].concat(args).map($A);
return this.map(function(_9b,_9c){
return _99(_9a.pluck(_9c));
});
},size:function(){
return this.toArray().length;
},inspect:function(){
return "#<Enumerable:"+this.toArray().inspect()+">";
}};
Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});
var $A=Array.from=function(_9d){
if(!_9d){
return [];
}
if(_9d.toArray){
return _9d.toArray();
}else{
var _9e=[];
for(var i=0,length=_9d.length;i<length;i++){
_9e.push(_9d[i]);
}
return _9e;
}
};
if(Prototype.Browser.WebKit){
$A=Array.from=function(_a0){
if(!_a0){
return [];
}
if(!(typeof _a0=="function"&&_a0=="[object NodeList]")&&_a0.toArray){
return _a0.toArray();
}else{
var _a1=[];
for(var i=0,length=_a0.length;i<length;i++){
_a1.push(_a0[i]);
}
return _a1;
}
};
}
Object.extend(Array.prototype,Enumerable);
if(!Array.prototype._reverse){
Array.prototype._reverse=Array.prototype.reverse;
}
Object.extend(Array.prototype,{_each:function(_a3){
for(var i=0,length=this.length;i<length;i++){
_a3(this[i]);
}
},clear:function(){
this.length=0;
return this;
},first:function(){
return this[0];
},last:function(){
return this[this.length-1];
},compact:function(){
return this.select(function(_a5){
return _a5!=null;
});
},flatten:function(){
return this.inject([],function(_a6,_a7){
return _a6.concat(_a7&&_a7.constructor==Array?_a7.flatten():[_a7]);
});
},without:function(){
var _a8=$A(arguments);
return this.select(function(_a9){
return !_a8.include(_a9);
});
},indexOf:function(_aa){
for(var i=0,length=this.length;i<length;i++){
if(this[i]==_aa){
return i;
}
}
return -1;
},reverse:function(_ac){
return (_ac!==false?this:this.toArray())._reverse();
},reduce:function(){
return this.length>1?this:this[0];
},uniq:function(_ad){
return this.inject([],function(_ae,_af,_b0){
if(0==_b0||(_ad?_ae.last()!=_af:!_ae.include(_af))){
_ae.push(_af);
}
return _ae;
});
},clone:function(){
return [].concat(this);
},size:function(){
return this.length;
},inspect:function(){
return "["+this.map(Object.inspect).join(", ")+"]";
},toJSON:function(){
var _b1=[];
this.each(function(_b2){
var _b3=Object.toJSON(_b2);
if(_b3!==undefined){
_b1.push(_b3);
}
});
return "["+_b1.join(", ")+"]";
}});
Array.prototype.toArray=Array.prototype.clone;
function $w(_b4){
_b4=_b4.strip();
return _b4?_b4.split(/\s+/):[];
}
if(Prototype.Browser.Opera){
Array.prototype.concat=function(){
var _b5=[];
for(var i=0,length=this.length;i<length;i++){
_b5.push(this[i]);
}
for(var i=0,length=arguments.length;i<length;i++){
if(arguments[i].constructor==Array){
for(var j=0,arrayLength=arguments[i].length;j<arrayLength;j++){
_b5.push(arguments[i][j]);
}
}else{
_b5.push(arguments[i]);
}
}
return _b5;
};
}
var Hash=function(_b8){
if(_b8 instanceof Hash){
this.merge(_b8);
}else{
Object.extend(this,_b8||{});
}
};
Object.extend(Hash,{toQueryString:function(obj){
var _ba=[];
_ba.add=arguments.callee.addPair;
this.prototype._each.call(obj,function(_bb){
if(!_bb.key){
return;
}
var _bc=_bb.value;
if(_bc&&typeof _bc=="object"){
if(_bc.constructor==Array){
_bc.each(function(_bd){
_ba.add(_bb.key,_bd);
});
}
return;
}
_ba.add(_bb.key,_bc);
});
return _ba.join("&");
},toJSON:function(_be){
var _bf=[];
this.prototype._each.call(_be,function(_c0){
var _c1=Object.toJSON(_c0.value);
if(_c1!==undefined){
_bf.push(_c0.key.toJSON()+": "+_c1);
}
});
return "{"+_bf.join(", ")+"}";
}});
Hash.toQueryString.addPair=function(key,_c3,_c4){
key=encodeURIComponent(key);
if(_c3===undefined){
this.push(key);
}else{
this.push(key+"="+(_c3==null?"":encodeURIComponent(_c3)));
}
};
Object.extend(Hash.prototype,Enumerable);
Object.extend(Hash.prototype,{_each:function(_c5){
for(var key in this){
var _c7=this[key];
if(_c7&&_c7==Hash.prototype[key]){
continue;
}
var _c8=[key,_c7];
_c8.key=key;
_c8.value=_c7;
_c5(_c8);
}
},keys:function(){
return this.pluck("key");
},values:function(){
return this.pluck("value");
},merge:function(_c9){
return $H(_c9).inject(this,function(_ca,_cb){
_ca[_cb.key]=_cb.value;
return _ca;
});
},remove:function(){
var _cc;
for(var i=0,length=arguments.length;i<length;i++){
var _ce=this[arguments[i]];
if(_ce!==undefined){
if(_cc===undefined){
_cc=_ce;
}else{
if(_cc.constructor!=Array){
_cc=[_cc];
}
_cc.push(_ce);
}
}
delete this[arguments[i]];
}
return _cc;
},toQueryString:function(){
return Hash.toQueryString(this);
},inspect:function(){
return "#<Hash:{"+this.map(function(_cf){
return _cf.map(Object.inspect).join(": ");
}).join(", ")+"}>";
},toJSON:function(){
return Hash.toJSON(this);
}});
function $H(_d0){
if(_d0 instanceof Hash){
return _d0;
}
return new Hash(_d0);
}
if(function(){
var i=0,Test=function(_d2){
this.key=_d2;
};
Test.prototype.key="foo";
for(var _d3 in new Test("bar")){
i++;
}
return i>1;
}()){
Hash.prototype._each=function(_d4){
var _d5=[];
for(var key in this){
var _d7=this[key];
if((_d7&&_d7==Hash.prototype[key])||_d5.include(key)){
continue;
}
_d5.push(key);
var _d8=[key,_d7];
_d8.key=key;
_d8.value=_d7;
_d4(_d8);
}
};
}
ObjectRange=Class.create();
Object.extend(ObjectRange.prototype,Enumerable);
Object.extend(ObjectRange.prototype,{initialize:function(_d9,end,_db){
this.start=_d9;
this.end=end;
this.exclusive=_db;
},_each:function(_dc){
var _dd=this.start;
while(this.include(_dd)){
_dc(_dd);
_dd=_dd.succ();
}
},include:function(_de){
if(_de<this.start){
return false;
}
if(this.exclusive){
return _de<this.end;
}
return _de<=this.end;
}});
var $R=function(_df,end,_e1){
return new ObjectRange(_df,end,_e1);
};
var Ajax={getTransport:function(){
return Try.these(function(){
return new XMLHttpRequest();
},function(){
return new ActiveXObject("Msxml2.XMLHTTP");
},function(){
return new ActiveXObject("Microsoft.XMLHTTP");
})||false;
},activeRequestCount:0};
Ajax.Responders={responders:[],_each:function(_e2){
this.responders._each(_e2);
},register:function(_e3){
if(!this.include(_e3)){
this.responders.push(_e3);
}
},unregister:function(_e4){
this.responders=this.responders.without(_e4);
},dispatch:function(_e5,_e6,_e7,_e8){
this.each(function(_e9){
if(typeof _e9[_e5]=="function"){
try{
_e9[_e5].apply(_e9,[_e6,_e7,_e8]);
}
catch(e){
}
}
});
}};
Object.extend(Ajax.Responders,Enumerable);
Ajax.Responders.register({onCreate:function(){
Ajax.activeRequestCount++;
},onComplete:function(){
Ajax.activeRequestCount--;
}});
Ajax.Base=function(){
};
Ajax.Base.prototype={setOptions:function(_ea){
this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:""};
Object.extend(this.options,_ea||{});
this.options.method=this.options.method.toLowerCase();
if(typeof this.options.parameters=="string"){
this.options.parameters=this.options.parameters.toQueryParams();
}
}};
Ajax.Request=Class.create();
Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Request.prototype=Object.extend(new Ajax.Base(),{_complete:false,initialize:function(url,_ec){
this.transport=Ajax.getTransport();
this.setOptions(_ec);
this.request(url);
},request:function(url){
this.url=url;
this.method=this.options.method;
var _ee=Object.clone(this.options.parameters);
if(!["get","post"].include(this.method)){
_ee["_method"]=this.method;
this.method="post";
}
this.parameters=_ee;
if(_ee=Hash.toQueryString(_ee)){
if(this.method=="get"){
this.url+=(this.url.include("?")?"&":"?")+_ee;
}else{
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){
_ee+="&_=";
}
}
}
try{
if(this.options.onCreate){
this.options.onCreate(this.transport);
}
Ajax.Responders.dispatch("onCreate",this,this.transport);
this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);
if(this.options.asynchronous){
setTimeout(function(){
this.respondToReadyState(1);
}.bind(this),10);
}
this.transport.onreadystatechange=this.onStateChange.bind(this);
this.setRequestHeaders();
this.body=this.method=="post"?(this.options.postBody||_ee):null;
this.transport.send(this.body);
if(!this.options.asynchronous&&this.transport.overrideMimeType){
this.onStateChange();
}
}
catch(e){
this.dispatchException(e);
}
},onStateChange:function(){
var _ef=this.transport.readyState;
if(_ef>1&&!((_ef==4)&&this._complete)){
this.respondToReadyState(this.transport.readyState);
}
},setRequestHeaders:function(){
var _f0={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,"Accept":"text/javascript, text/html, application/xml, text/xml, */*"};
if(this.method=="post"){
_f0["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){
_f0["Connection"]="close";
}
}
if(typeof this.options.requestHeaders=="object"){
var _f1=this.options.requestHeaders;
if(typeof _f1.push=="function"){
for(var i=0,length=_f1.length;i<length;i+=2){
_f0[_f1[i]]=_f1[i+1];
}
}else{
$H(_f1).each(function(_f3){
_f0[_f3.key]=_f3.value;
});
}
}
for(var _f4 in _f0){
this.transport.setRequestHeader(_f4,_f0[_f4]);
}
},success:function(){
return !this.transport.status||(this.transport.status>=200&&this.transport.status<300);
},respondToReadyState:function(_f5){
var _f6=Ajax.Request.Events[_f5];
var _f7=this.transport,json=this.evalJSON();
if(_f6=="Complete"){
try{
this._complete=true;
(this.options["on"+this.transport.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(_f7,json);
}
catch(e){
this.dispatchException(e);
}
var _f8=this.getHeader("Content-type");
if(_f8&&_f8.strip().match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)){
this.evalResponse();
}
}
try{
(this.options["on"+_f6]||Prototype.emptyFunction)(_f7,json);
Ajax.Responders.dispatch("on"+_f6,this,_f7,json);
}
catch(e){
this.dispatchException(e);
}
if(_f6=="Complete"){
this.transport.onreadystatechange=Prototype.emptyFunction;
}
},getHeader:function(_f9){
try{
return this.transport.getResponseHeader(_f9);
}
catch(e){
return null;
}
},evalJSON:function(){
try{
var _fa=this.getHeader("X-JSON");
return _fa?_fa.evalJSON():null;
}
catch(e){
return null;
}
},evalResponse:function(){
try{
return eval((this.transport.responseText||"").unfilterJSON());
}
catch(e){
this.dispatchException(e);
}
},dispatchException:function(_fb){
(this.options.onException||Prototype.emptyFunction)(this,_fb);
Ajax.Responders.dispatch("onException",this,_fb);
}});
Ajax.Updater=Class.create();
Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(_fc,url,_fe){
this.container={success:(_fc.success||_fc),failure:(_fc.failure||(_fc.success?null:_fc))};
this.transport=Ajax.getTransport();
this.setOptions(_fe);
var _ff=this.options.onComplete||Prototype.emptyFunction;
this.options.onComplete=(function(_100,_101){
this.updateContent();
_ff(_100,_101);
}).bind(this);
this.request(url);
},updateContent:function(){
var _102=this.container[this.success()?"success":"failure"];
var _103=this.transport.responseText;
if(!this.options.evalScripts){
_103=_103.stripScripts();
}
if(_102=$(_102)){
if(this.options.insertion){
new this.options.insertion(_102,_103);
}else{
_102.update(_103);
}
}
if(this.success()){
if(this.onComplete){
setTimeout(this.onComplete.bind(this),10);
}
}
}});
Ajax.PeriodicalUpdater=Class.create();
Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(_104,url,_106){
this.setOptions(_106);
this.onComplete=this.options.onComplete;
this.frequency=(this.options.frequency||2);
this.decay=(this.options.decay||1);
this.updater={};
this.container=_104;
this.url=url;
this.start();
},start:function(){
this.options.onComplete=this.updateComplete.bind(this);
this.onTimerEvent();
},stop:function(){
this.updater.options.onComplete=undefined;
clearTimeout(this.timer);
(this.onComplete||Prototype.emptyFunction).apply(this,arguments);
},updateComplete:function(_107){
if(this.options.decay){
this.decay=(_107.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=_107.responseText;
}
this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000);
},onTimerEvent:function(){
this.updater=new Ajax.Updater(this.container,this.url,this.options);
}});
function $(_108){
if(arguments.length>1){
for(var i=0,elements=[],length=arguments.length;i<length;i++){
elements.push($(arguments[i]));
}
return elements;
}
if(typeof _108=="string"){
_108=document.getElementById(_108);
}
return Element.extend(_108);
}
if(Prototype.BrowserFeatures.XPath){
document._getElementsByXPath=function(_10a,_10b){
var _10c=[];
var _10d=document.evaluate(_10a,$(_10b)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for(var i=0,length=_10d.snapshotLength;i<length;i++){
_10c.push(_10d.snapshotItem(i));
}
return _10c;
};
document.getElementsByClassName=function(_10f,_110){
var q=".//*[contains(concat(' ', @class, ' '), ' "+_10f+" ')]";
return document._getElementsByXPath(q,_110);
};
}else{
document.getElementsByClassName=function(_112,_113){
var _114=($(_113)||document.body).getElementsByTagName("*");
var _115=[],child;
for(var i=0,length=_114.length;i<length;i++){
child=_114[i];
if(Element.hasClassName(child,_112)){
_115.push(Element.extend(child));
}
}
return _115;
};
}
if(!window.Element){
var Element={};
}
Element.extend=function(_117){
var F=Prototype.BrowserFeatures;
if(!_117||!_117.tagName||_117.nodeType==3||_117._extended||F.SpecificElementExtensions||_117==window){
return _117;
}
var _119={},tagName=_117.tagName,cache=Element.extend.cache,T=Element.Methods.ByTag;
if(!F.ElementExtensions){
Object.extend(_119,Element.Methods),Object.extend(_119,Element.Methods.Simulated);
}
if(T[tagName]){
Object.extend(_119,T[tagName]);
}
for(var _11a in _119){
var _11b=_119[_11a];
if(typeof _11b=="function"&&!(_11a in _117)){
_117[_11a]=cache.findOrStore(_11b);
}
}
_117._extended=Prototype.emptyFunction;
return _117;
};
Element.extend.cache={findOrStore:function(_11c){
return this[_11c]=this[_11c]||function(){
return _11c.apply(null,[this].concat($A(arguments)));
};
}};
Element.Methods={visible:function(_11d){
return $(_11d).style.display!="none";
},toggle:function(_11e){
_11e=$(_11e);
Element[Element.visible(_11e)?"hide":"show"](_11e);
return _11e;
},hide:function(_11f){
$(_11f).style.display="none";
return _11f;
},show:function(_120){
$(_120).style.display="";
return _120;
},remove:function(_121){
_121=$(_121);
_121.parentNode.removeChild(_121);
return _121;
},update:function(_122,html){
html=typeof html=="undefined"?"":html.toString();
$(_122).innerHTML=html.stripScripts();
setTimeout(function(){
html.evalScripts();
},10);
return _122;
},replace:function(_124,html){
_124=$(_124);
html=typeof html=="undefined"?"":html.toString();
if(_124.outerHTML){
_124.outerHTML=html.stripScripts();
}else{
var _126=_124.ownerDocument.createRange();
_126.selectNodeContents(_124);
_124.parentNode.replaceChild(_126.createContextualFragment(html.stripScripts()),_124);
}
setTimeout(function(){
html.evalScripts();
},10);
return _124;
},inspect:function(_127){
_127=$(_127);
var _128="<"+_127.tagName.toLowerCase();
$H({"id":"id","className":"class"}).each(function(pair){
var _12a=pair.first(),attribute=pair.last();
var _12b=(_127[_12a]||"").toString();
if(_12b){
_128+=" "+attribute+"="+_12b.inspect(true);
}
});
return _128+">";
},recursivelyCollect:function(_12c,_12d){
_12c=$(_12c);
var _12e=[];
while(_12c=_12c[_12d]){
if(_12c.nodeType==1){
_12e.push(Element.extend(_12c));
}
}
return _12e;
},ancestors:function(_12f){
return $(_12f).recursivelyCollect("parentNode");
},descendants:function(_130){
return $A($(_130).getElementsByTagName("*")).each(Element.extend);
},firstDescendant:function(_131){
_131=$(_131).firstChild;
while(_131&&_131.nodeType!=1){
_131=_131.nextSibling;
}
return $(_131);
},immediateDescendants:function(_132){
if(!(_132=$(_132).firstChild)){
return [];
}
while(_132&&_132.nodeType!=1){
_132=_132.nextSibling;
}
if(_132){
return [_132].concat($(_132).nextSiblings());
}
return [];
},previousSiblings:function(_133){
return $(_133).recursivelyCollect("previousSibling");
},nextSiblings:function(_134){
return $(_134).recursivelyCollect("nextSibling");
},siblings:function(_135){
_135=$(_135);
return _135.previousSiblings().reverse().concat(_135.nextSiblings());
},match:function(_136,_137){
if(typeof _137=="string"){
_137=new Selector(_137);
}
return _137.match($(_136));
},up:function(_138,_139,_13a){
_138=$(_138);
if(arguments.length==1){
return $(_138.parentNode);
}
var _13b=_138.ancestors();
return _139?Selector.findElement(_13b,_139,_13a):_13b[_13a||0];
},down:function(_13c,_13d,_13e){
_13c=$(_13c);
if(arguments.length==1){
return _13c.firstDescendant();
}
var _13f=_13c.descendants();
return _13d?Selector.findElement(_13f,_13d,_13e):_13f[_13e||0];
},previous:function(_140,_141,_142){
_140=$(_140);
if(arguments.length==1){
return $(Selector.handlers.previousElementSibling(_140));
}
var _143=_140.previousSiblings();
return _141?Selector.findElement(_143,_141,_142):_143[_142||0];
},next:function(_144,_145,_146){
_144=$(_144);
if(arguments.length==1){
return $(Selector.handlers.nextElementSibling(_144));
}
var _147=_144.nextSiblings();
return _145?Selector.findElement(_147,_145,_146):_147[_146||0];
},getElementsBySelector:function(){
var args=$A(arguments),element=$(args.shift());
return Selector.findChildElements(element,args);
},getElementsByClassName:function(_149,_14a){
return document.getElementsByClassName(_14a,_149);
},readAttribute:function(_14b,name){
_14b=$(_14b);
if(Prototype.Browser.IE){
if(!_14b.attributes){
return null;
}
var t=Element._attributeTranslations;
if(t.values[name]){
return t.values[name](_14b,name);
}
if(t.names[name]){
name=t.names[name];
}
var _14e=_14b.attributes[name];
return _14e?_14e.nodeValue:null;
}
return _14b.getAttribute(name);
},getHeight:function(_14f){
return $(_14f).getDimensions().height;
},getWidth:function(_150){
return $(_150).getDimensions().width;
},classNames:function(_151){
return new Element.ClassNames(_151);
},hasClassName:function(_152,_153){
if(!(_152=$(_152))){
return;
}
var _154=_152.className;
if(_154.length==0){
return false;
}
if(_154==_153||_154.match(new RegExp("(^|\\s)"+_153+"(\\s|$)"))){
return true;
}
return false;
},addClassName:function(_155,_156){
if(!(_155=$(_155))){
return;
}
Element.classNames(_155).add(_156);
return _155;
},removeClassName:function(_157,_158){
if(!(_157=$(_157))){
return;
}
Element.classNames(_157).remove(_158);
return _157;
},toggleClassName:function(_159,_15a){
if(!(_159=$(_159))){
return;
}
Element.classNames(_159)[_159.hasClassName(_15a)?"remove":"add"](_15a);
return _159;
},observe:function(){
Event.observe.apply(Event,arguments);
return $A(arguments).first();
},stopObserving:function(){
Event.stopObserving.apply(Event,arguments);
return $A(arguments).first();
},cleanWhitespace:function(_15b){
_15b=$(_15b);
var node=_15b.firstChild;
while(node){
var _15d=node.nextSibling;
if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
_15b.removeChild(node);
}
node=_15d;
}
return _15b;
},empty:function(_15e){
return $(_15e).innerHTML.blank();
},descendantOf:function(_15f,_160){
_15f=$(_15f),_160=$(_160);
while(_15f=_15f.parentNode){
if(_15f==_160){
return true;
}
}
return false;
},scrollTo:function(_161){
_161=$(_161);
var pos=Position.cumulativeOffset(_161);
window.scrollTo(pos[0],pos[1]);
return _161;
},getStyle:function(_163,_164){
_163=$(_163);
_164=_164=="float"?"cssFloat":_164.camelize();
var _165=_163.style[_164];
if(!_165){
var css=document.defaultView.getComputedStyle(_163,null);
_165=css?css[_164]:null;
}
if(_164=="opacity"){
return _165?parseFloat(_165):1;
}
return _165=="auto"?null:_165;
},getOpacity:function(_167){
return $(_167).getStyle("opacity");
},setStyle:function(_168,_169,_16a){
_168=$(_168);
var _16b=_168.style;
for(var _16c in _169){
if(_16c=="opacity"){
_168.setOpacity(_169[_16c]);
}else{
_16b[(_16c=="float"||_16c=="cssFloat")?(_16b.styleFloat===undefined?"cssFloat":"styleFloat"):(_16a?_16c:_16c.camelize())]=_169[_16c];
}
}
return _168;
},setOpacity:function(_16d,_16e){
_16d=$(_16d);
_16d.style.opacity=(_16e==1||_16e==="")?"":(_16e<0.00001)?0:_16e;
return _16d;
},getDimensions:function(_16f){
_16f=$(_16f);
var _170=$(_16f).getStyle("display");
if(_170!="none"&&_170!=null){
return {width:_16f.offsetWidth,height:_16f.offsetHeight};
}
var els=_16f.style;
var _172=els.visibility;
var _173=els.position;
var _174=els.display;
els.visibility="hidden";
els.position="absolute";
els.display="block";
var _175=_16f.clientWidth;
var _176=_16f.clientHeight;
els.display=_174;
els.position=_173;
els.visibility=_172;
return {width:_175,height:_176};
},makePositioned:function(_177){
_177=$(_177);
var pos=Element.getStyle(_177,"position");
if(pos=="static"||!pos){
_177._madePositioned=true;
_177.style.position="relative";
if(window.opera){
_177.style.top=0;
_177.style.left=0;
}
}
return _177;
},undoPositioned:function(_179){
_179=$(_179);
if(_179._madePositioned){
_179._madePositioned=undefined;
_179.style.position=_179.style.top=_179.style.left=_179.style.bottom=_179.style.right="";
}
return _179;
},makeClipping:function(_17a){
_17a=$(_17a);
if(_17a._overflow){
return _17a;
}
_17a._overflow=_17a.style.overflow||"auto";
if((Element.getStyle(_17a,"overflow")||"visible")!="hidden"){
_17a.style.overflow="hidden";
}
return _17a;
},undoClipping:function(_17b){
_17b=$(_17b);
if(!_17b._overflow){
return _17b;
}
_17b.style.overflow=_17b._overflow=="auto"?"":_17b._overflow;
_17b._overflow=null;
return _17b;
}};
Object.extend(Element.Methods,{childOf:Element.Methods.descendantOf,childElements:Element.Methods.immediateDescendants});
if(Prototype.Browser.Opera){
Element.Methods._getStyle=Element.Methods.getStyle;
Element.Methods.getStyle=function(_17c,_17d){
switch(_17d){
case "left":
case "top":
case "right":
case "bottom":
if(Element._getStyle(_17c,"position")=="static"){
return null;
}
default:
return Element._getStyle(_17c,_17d);
}
};
}else{
if(Prototype.Browser.IE){
Element.Methods.getStyle=function(_17e,_17f){
_17e=$(_17e);
_17f=(_17f=="float"||_17f=="cssFloat")?"styleFloat":_17f.camelize();
var _180=_17e.style[_17f];
if(!_180&&_17e.currentStyle){
_180=_17e.currentStyle[_17f];
}
if(_17f=="opacity"){
if(_180=(_17e.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){
if(_180[1]){
return parseFloat(_180[1])/100;
}
}
return 1;
}
if(_180=="auto"){
if((_17f=="width"||_17f=="height")&&(_17e.getStyle("display")!="none")){
return _17e["offset"+_17f.capitalize()]+"px";
}
return null;
}
return _180;
};
Element.Methods.setOpacity=function(_181,_182){
_181=$(_181);
var _183=_181.getStyle("filter"),style=_181.style;
if(_182==1||_182===""){
style.filter=_183.replace(/alpha\([^\)]*\)/gi,"");
return _181;
}else{
if(_182<0.00001){
_182=0;
}
}
style.filter=_183.replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+(_182*100)+")";
return _181;
};
Element.Methods.update=function(_184,html){
_184=$(_184);
html=typeof html=="undefined"?"":html.toString();
var _186=_184.tagName.toUpperCase();
if(["THEAD","TBODY","TR","TD"].include(_186)){
var div=document.createElement("div");
switch(_186){
case "THEAD":
case "TBODY":
div.innerHTML="<table><tbody>"+html.stripScripts()+"</tbody></table>";
depth=2;
break;
case "TR":
div.innerHTML="<table><tbody><tr>"+html.stripScripts()+"</tr></tbody></table>";
depth=3;
break;
case "TD":
div.innerHTML="<table><tbody><tr><td>"+html.stripScripts()+"</td></tr></tbody></table>";
depth=4;
}
$A(_184.childNodes).each(function(node){
_184.removeChild(node);
});
depth.times(function(){
div=div.firstChild;
});
$A(div.childNodes).each(function(node){
_184.appendChild(node);
});
}else{
_184.innerHTML=html.stripScripts();
}
setTimeout(function(){
html.evalScripts();
},10);
return _184;
};
}else{
if(Prototype.Browser.Gecko){
Element.Methods.setOpacity=function(_18a,_18b){
_18a=$(_18a);
_18a.style.opacity=(_18b==1)?0.999999:(_18b==="")?"":(_18b<0.00001)?0:_18b;
return _18a;
};
}
}
}
Element._attributeTranslations={names:{colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",datetime:"dateTime",accesskey:"accessKey",tabindex:"tabIndex",enctype:"encType",maxlength:"maxLength",readonly:"readOnly",longdesc:"longDesc"},values:{_getAttr:function(_18c,_18d){
return _18c.getAttribute(_18d,2);
},_flag:function(_18e,_18f){
return $(_18e).hasAttribute(_18f)?_18f:null;
},style:function(_190){
return _190.style.cssText.toLowerCase();
},title:function(_191){
var node=_191.getAttributeNode("title");
return node.specified?node.nodeValue:null;
}}};
(function(){
Object.extend(this,{href:this._getAttr,src:this._getAttr,disabled:this._flag,checked:this._flag,readonly:this._flag,multiple:this._flag});
}).call(Element._attributeTranslations.values);
Element.Methods.Simulated={hasAttribute:function(_193,_194){
var t=Element._attributeTranslations,node;
_194=t.names[_194]||_194;
node=$(_193).getAttributeNode(_194);
return node&&node.specified;
}};
Element.Methods.ByTag={};
Object.extend(Element,Element.Methods);
if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div").__proto__){
window.HTMLElement={};
window.HTMLElement.prototype=document.createElement("div").__proto__;
Prototype.BrowserFeatures.ElementExtensions=true;
}
Element.hasAttribute=function(_196,_197){
if(_196.hasAttribute){
return _196.hasAttribute(_197);
}
return Element.Methods.Simulated.hasAttribute(_196,_197);
};
Element.addMethods=function(_198){
var F=Prototype.BrowserFeatures,T=Element.Methods.ByTag;
if(arguments.length==2){
var _19a=_198;
_198=arguments[1];
}
if(!_19a){
Object.extend(Element.Methods,_198||{});
}else{
if(_19a.constructor==Array){
_19a.each(extend);
}else{
extend(_19a);
}
}
function extend(_19b){
_19b=_19b.toUpperCase();
if(!Element.Methods.ByTag[_19b]){
Element.Methods.ByTag[_19b]={};
}
Object.extend(Element.Methods.ByTag[_19b],_198);
}
function copy(_19c,_19d,_19e){
_19e=_19e||false;
var _19f=Element.extend.cache;
for(var _1a0 in _19c){
var _1a1=_19c[_1a0];
if(!_19e||!(_1a0 in _19d)){
_19d[_1a0]=_19f.findOrStore(_1a1);
}
}
}
function findDOMClass(_1a2){
var _1a3;
var _1a4={"OPTGROUP":"OptGroup","TEXTAREA":"TextArea","P":"Paragraph","FIELDSET":"FieldSet","UL":"UList","OL":"OList","DL":"DList","DIR":"Directory","H1":"Heading","H2":"Heading","H3":"Heading","H4":"Heading","H5":"Heading","H6":"Heading","Q":"Quote","INS":"Mod","DEL":"Mod","A":"Anchor","IMG":"Image","CAPTION":"TableCaption","COL":"TableCol","COLGROUP":"TableCol","THEAD":"TableSection","TFOOT":"TableSection","TBODY":"TableSection","TR":"TableRow","TH":"TableCell","TD":"TableCell","FRAMESET":"FrameSet","IFRAME":"IFrame"};
if(_1a4[_1a2]){
_1a3="HTML"+_1a4[_1a2]+"Element";
}
if(window[_1a3]){
return window[_1a3];
}
_1a3="HTML"+_1a2+"Element";
if(window[_1a3]){
return window[_1a3];
}
_1a3="HTML"+_1a2.capitalize()+"Element";
if(window[_1a3]){
return window[_1a3];
}
window[_1a3]={};
window[_1a3].prototype=document.createElement(_1a2).__proto__;
return window[_1a3];
}
if(F.ElementExtensions){
copy(Element.Methods,HTMLElement.prototype);
copy(Element.Methods.Simulated,HTMLElement.prototype,true);
}
if(F.SpecificElementExtensions){
for(var tag in Element.Methods.ByTag){
var _1a6=findDOMClass(tag);
if(typeof _1a6=="undefined"){
continue;
}
copy(T[tag],_1a6.prototype);
}
}
Object.extend(Element,Element.Methods);
delete Element.ByTag;
};
var Toggle={display:Element.toggle};
Abstract.Insertion=function(_1a7){
this.adjacency=_1a7;
};
Abstract.Insertion.prototype={initialize:function(_1a8,_1a9){
this.element=$(_1a8);
this.content=_1a9.stripScripts();
if(this.adjacency&&this.element.insertAdjacentHTML){
try{
this.element.insertAdjacentHTML(this.adjacency,this.content);
}
catch(e){
var _1aa=this.element.tagName.toUpperCase();
if(["TBODY","TR"].include(_1aa)){
this.insertContent(this.contentFromAnonymousTable());
}else{
throw e;
}
}
}else{
this.range=this.element.ownerDocument.createRange();
if(this.initializeRange){
this.initializeRange();
}
this.insertContent([this.range.createContextualFragment(this.content)]);
}
setTimeout(function(){
_1a9.evalScripts();
},10);
},contentFromAnonymousTable:function(){
var div=document.createElement("div");
div.innerHTML="<table><tbody>"+this.content+"</tbody></table>";
return $A(div.childNodes[0].childNodes[0].childNodes);
}};
var Insertion=new Object();
Insertion.Before=Class.create();
Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){
this.range.setStartBefore(this.element);
},insertContent:function(_1ac){
_1ac.each((function(_1ad){
this.element.parentNode.insertBefore(_1ad,this.element);
}).bind(this));
}});
Insertion.Top=Class.create();
Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){
this.range.selectNodeContents(this.element);
this.range.collapse(true);
},insertContent:function(_1ae){
_1ae.reverse(false).each((function(_1af){
this.element.insertBefore(_1af,this.element.firstChild);
}).bind(this));
}});
Insertion.Bottom=Class.create();
Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){
this.range.selectNodeContents(this.element);
this.range.collapse(this.element);
},insertContent:function(_1b0){
_1b0.each((function(_1b1){
this.element.appendChild(_1b1);
}).bind(this));
}});
Insertion.After=Class.create();
Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){
this.range.setStartAfter(this.element);
},insertContent:function(_1b2){
_1b2.each((function(_1b3){
this.element.parentNode.insertBefore(_1b3,this.element.nextSibling);
}).bind(this));
}});
Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(_1b4){
this.element=$(_1b4);
},_each:function(_1b5){
this.element.className.split(/\s+/).select(function(name){
return name.length>0;
})._each(_1b5);
},set:function(_1b7){
this.element.className=_1b7;
},add:function(_1b8){
if(this.include(_1b8)){
return;
}
this.set($A(this).concat(_1b8).join(" "));
},remove:function(_1b9){
if(!this.include(_1b9)){
return;
}
this.set($A(this).without(_1b9).join(" "));
},toString:function(){
return $A(this).join(" ");
}};
Object.extend(Element.ClassNames.prototype,Enumerable);
var Selector=Class.create();
Selector.prototype={initialize:function(_1ba){
this.expression=_1ba.strip();
this.compileMatcher();
},compileMatcher:function(){
if(Prototype.BrowserFeatures.XPath&&!(/\[[\w-]*?:/).test(this.expression)){
return this.compileXPathMatcher();
}
var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;
if(Selector._cache[e]){
this.matcher=Selector._cache[e];
return;
}
this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];
while(e&&le!=e&&(/\S/).test(e)){
le=e;
for(var i in ps){
p=ps[i];
if(m=e.match(p)){
this.matcher.push(typeof c[i]=="function"?c[i](m):new Template(c[i]).evaluate(m));
e=e.replace(m[0],"");
break;
}
}
}
this.matcher.push("return h.unique(n);\n}");
eval(this.matcher.join("\n"));
Selector._cache[this.expression]=this.matcher;
},compileXPathMatcher:function(){
var e=this.expression,ps=Selector.patterns,x=Selector.xpath,le,m;
if(Selector._cache[e]){
this.xpath=Selector._cache[e];
return;
}
this.matcher=[".//*"];
while(e&&le!=e&&(/\S/).test(e)){
le=e;
for(var i in ps){
if(m=e.match(ps[i])){
this.matcher.push(typeof x[i]=="function"?x[i](m):new Template(x[i]).evaluate(m));
e=e.replace(m[0],"");
break;
}
}
}
this.xpath=this.matcher.join("");
Selector._cache[this.expression]=this.xpath;
},findElements:function(root){
root=root||document;
if(this.xpath){
return document._getElementsByXPath(this.xpath,root);
}
return this.matcher(root);
},match:function(_1c0){
return this.findElements(document).include(_1c0);
},toString:function(){
return this.expression;
},inspect:function(){
return "#<Selector:"+this.expression.inspect()+">";
}};
Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(m){
if(m[1]=="*"){
return "";
}
return "[local-name()='"+m[1].toLowerCase()+"' or local-name()='"+m[1].toUpperCase()+"']";
},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:"[@#{1}]",attr:function(m){
m[3]=m[5]||m[6];
return new Template(Selector.xpath.operators[m[2]]).evaluate(m);
},pseudo:function(m){
var h=Selector.xpath.pseudos[m[1]];
if(!h){
return "";
}
if(typeof h==="function"){
return h(m);
}
return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);
},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]","empty":"[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]","checked":"[@checked]","disabled":"[@disabled]","enabled":"[not(@disabled)]","not":function(m){
var e=m[6],p=Selector.patterns,x=Selector.xpath,le,m,v;
var _1c7=[];
while(e&&le!=e&&(/\S/).test(e)){
le=e;
for(var i in p){
if(m=e.match(p[i])){
v=typeof x[i]=="function"?x[i](m):new Template(x[i]).evaluate(m);
_1c7.push("("+v.substring(1,v.length-1)+")");
e=e.replace(m[0],"");
break;
}
}
}
return "[not("+_1c7.join(" and ")+")]";
},"nth-child":function(m){
return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",m);
},"nth-last-child":function(m){
return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",m);
},"nth-of-type":function(m){
return Selector.xpath.pseudos.nth("position() ",m);
},"nth-last-of-type":function(m){
return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",m);
},"first-of-type":function(m){
m[6]="1";
return Selector.xpath.pseudos["nth-of-type"](m);
},"last-of-type":function(m){
m[6]="1";
return Selector.xpath.pseudos["nth-last-of-type"](m);
},"only-of-type":function(m){
var p=Selector.xpath.pseudos;
return p["first-of-type"](m)+p["last-of-type"](m);
},nth:function(_1d1,m){
var mm,formula=m[6],predicate;
if(formula=="even"){
formula="2n+0";
}
if(formula=="odd"){
formula="2n+1";
}
if(mm=formula.match(/^(\d+)$/)){
return "["+_1d1+"= "+mm[1]+"]";
}
if(mm=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){
if(mm[1]=="-"){
mm[1]=-1;
}
var a=mm[1]?Number(mm[1]):1;
var b=mm[2]?Number(mm[2]):0;
predicate="[((#{fragment} - #{b}) mod #{a} = 0) and "+"((#{fragment} - #{b}) div #{a} >= 0)]";
return new Template(predicate).evaluate({fragment:_1d1,a:a,b:b});
}
}}},criteria:{tagName:"n = h.tagName(n, r, \"#{1}\", c);   c = false;",className:"n = h.className(n, r, \"#{1}\", c); c = false;",id:"n = h.id(n, r, \"#{1}\", c);        c = false;",attrPresence:"n = h.attrPresence(n, r, \"#{1}\"); c = false;",attr:function(m){
m[3]=(m[5]||m[6]);
return new Template("n = h.attr(n, r, \"#{1}\", \"#{3}\", \"#{2}\"); c = false;").evaluate(m);
},pseudo:function(m){
if(m[6]){
m[6]=m[6].replace(/"/g,"\\\"");
}
return new Template("n = h.pseudo(n, \"#{1}\", \"#{6}\", r, c); c = false;").evaluate(m);
},descendant:"c = \"descendant\";",child:"c = \"child\";",adjacent:"c = \"adjacent\";",laterSibling:"c = \"laterSibling\";"},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|\s)/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\]]*?)\4|([^'"][^\]]*?)))?\]/},handlers:{concat:function(a,b){
for(var i=0,node;node=b[i];i++){
a.push(node);
}
return a;
},mark:function(_1db){
for(var i=0,node;node=_1db[i];i++){
node._counted=true;
}
return _1db;
},unmark:function(_1dd){
for(var i=0,node;node=_1dd[i];i++){
node._counted=undefined;
}
return _1dd;
},index:function(_1df,_1e0,_1e1){
_1df._counted=true;
if(_1e0){
for(var _1e2=_1df.childNodes,i=_1e2.length-1,j=1;i>=0;i--){
node=_1e2[i];
if(node.nodeType==1&&(!_1e1||node._counted)){
node.nodeIndex=j++;
}
}
}else{
for(var i=0,j=1,_1e2=_1df.childNodes;node=_1e2[i];i++){
if(node.nodeType==1&&(!_1e1||node._counted)){
node.nodeIndex=j++;
}
}
}
},unique:function(_1e4){
if(_1e4.length==0){
return _1e4;
}
var _1e5=[],n;
for(var i=0,l=_1e4.length;i<l;i++){
if(!(n=_1e4[i])._counted){
n._counted=true;
_1e5.push(Element.extend(n));
}
}
return Selector.handlers.unmark(_1e5);
},descendant:function(_1e7){
var h=Selector.handlers;
for(var i=0,results=[],node;node=_1e7[i];i++){
h.concat(results,node.getElementsByTagName("*"));
}
return results;
},child:function(_1ea){
var h=Selector.handlers;
for(var i=0,results=[],node;node=_1ea[i];i++){
for(var j=0,children=[],child;child=node.childNodes[j];j++){
if(child.nodeType==1&&child.tagName!="!"){
results.push(child);
}
}
}
return results;
},adjacent:function(_1ee){
for(var i=0,results=[],node;node=_1ee[i];i++){
var next=this.nextElementSibling(node);
if(next){
results.push(next);
}
}
return results;
},laterSibling:function(_1f1){
var h=Selector.handlers;
for(var i=0,results=[],node;node=_1f1[i];i++){
h.concat(results,Element.nextSiblings(node));
}
return results;
},nextElementSibling:function(node){
while(node=node.nextSibling){
if(node.nodeType==1){
return node;
}
}
return null;
},previousElementSibling:function(node){
while(node=node.previousSibling){
if(node.nodeType==1){
return node;
}
}
return null;
},tagName:function(_1f6,root,_1f8,_1f9){
_1f8=_1f8.toUpperCase();
var _1fa=[],h=Selector.handlers;
if(_1f6){
if(_1f9){
if(_1f9=="descendant"){
for(var i=0,node;node=_1f6[i];i++){
h.concat(_1fa,node.getElementsByTagName(_1f8));
}
return _1fa;
}else{
_1f6=this[_1f9](_1f6);
}
if(_1f8=="*"){
return _1f6;
}
}
for(var i=0,node;node=_1f6[i];i++){
if(node.tagName.toUpperCase()==_1f8){
_1fa.push(node);
}
}
return _1fa;
}else{
return root.getElementsByTagName(_1f8);
}
},id:function(_1fc,root,id,_1ff){
var _200=$(id),h=Selector.handlers;
if(!_1fc&&root==document){
return _200?[_200]:[];
}
if(_1fc){
if(_1ff){
if(_1ff=="child"){
for(var i=0,node;node=_1fc[i];i++){
if(_200.parentNode==node){
return [_200];
}
}
}else{
if(_1ff=="descendant"){
for(var i=0,node;node=_1fc[i];i++){
if(Element.descendantOf(_200,node)){
return [_200];
}
}
}else{
if(_1ff=="adjacent"){
for(var i=0,node;node=_1fc[i];i++){
if(Selector.handlers.previousElementSibling(_200)==node){
return [_200];
}
}
}else{
_1fc=h[_1ff](_1fc);
}
}
}
}
for(var i=0,node;node=_1fc[i];i++){
if(node==_200){
return [_200];
}
}
return [];
}
return (_200&&Element.descendantOf(_200,root))?[_200]:[];
},className:function(_202,root,_204,_205){
if(_202&&_205){
_202=this[_205](_202);
}
return Selector.handlers.byClassName(_202,root,_204);
},byClassName:function(_206,root,_208){
if(!_206){
_206=Selector.handlers.descendant([root]);
}
var _209=" "+_208+" ";
for(var i=0,results=[],node,nodeClassName;node=_206[i];i++){
nodeClassName=node.className;
if(nodeClassName.length==0){
continue;
}
if(nodeClassName==_208||(" "+nodeClassName+" ").include(_209)){
results.push(node);
}
}
return results;
},attrPresence:function(_20b,root,attr){
var _20e=[];
for(var i=0,node;node=_20b[i];i++){
if(Element.hasAttribute(node,attr)){
_20e.push(node);
}
}
return _20e;
},attr:function(_210,root,attr,_213,_214){
if(!_210){
_210=root.getElementsByTagName("*");
}
var _215=Selector.operators[_214],results=[];
for(var i=0,node;node=_210[i];i++){
var _217=Element.readAttribute(node,attr);
if(_217===null){
continue;
}
if(_215(_217,_213)){
results.push(node);
}
}
return results;
},pseudo:function(_218,name,_21a,root,_21c){
if(_218&&_21c){
_218=this[_21c](_218);
}
if(!_218){
_218=root.getElementsByTagName("*");
}
return Selector.pseudos[name](_218,_21a,root);
}},pseudos:{"first-child":function(_21d,_21e,root){
for(var i=0,results=[],node;node=_21d[i];i++){
if(Selector.handlers.previousElementSibling(node)){
continue;
}
results.push(node);
}
return results;
},"last-child":function(_221,_222,root){
for(var i=0,results=[],node;node=_221[i];i++){
if(Selector.handlers.nextElementSibling(node)){
continue;
}
results.push(node);
}
return results;
},"only-child":function(_225,_226,root){
var h=Selector.handlers;
for(var i=0,results=[],node;node=_225[i];i++){
if(!h.previousElementSibling(node)&&!h.nextElementSibling(node)){
results.push(node);
}
}
return results;
},"nth-child":function(_22a,_22b,root){
return Selector.pseudos.nth(_22a,_22b,root);
},"nth-last-child":function(_22d,_22e,root){
return Selector.pseudos.nth(_22d,_22e,root,true);
},"nth-of-type":function(_230,_231,root){
return Selector.pseudos.nth(_230,_231,root,false,true);
},"nth-last-of-type":function(_233,_234,root){
return Selector.pseudos.nth(_233,_234,root,true,true);
},"first-of-type":function(_236,_237,root){
return Selector.pseudos.nth(_236,"1",root,false,true);
},"last-of-type":function(_239,_23a,root){
return Selector.pseudos.nth(_239,"1",root,true,true);
},"only-of-type":function(_23c,_23d,root){
var p=Selector.pseudos;
return p["last-of-type"](p["first-of-type"](_23c,_23d,root),_23d,root);
},getIndices:function(a,b,_242){
if(a==0){
return b>0?[b]:[];
}
return $R(1,_242).inject([],function(memo,i){
if(0==(i-b)%a&&(i-b)/a>=0){
memo.push(i);
}
return memo;
});
},nth:function(_245,_246,root,_248,_249){
if(_245.length==0){
return [];
}
if(_246=="even"){
_246="2n+0";
}
if(_246=="odd"){
_246="2n+1";
}
var h=Selector.handlers,results=[],indexed=[],m;
h.mark(_245);
for(var i=0,node;node=_245[i];i++){
if(!node.parentNode._counted){
h.index(node.parentNode,_248,_249);
indexed.push(node.parentNode);
}
}
if(_246.match(/^\d+$/)){
_246=Number(_246);
for(var i=0,node;node=_245[i];i++){
if(node.nodeIndex==_246){
results.push(node);
}
}
}else{
if(m=_246.match(/^(-?\d*)?n(([+-])(\d+))?/)){
if(m[1]=="-"){
m[1]=-1;
}
var a=m[1]?Number(m[1]):1;
var b=m[2]?Number(m[2]):0;
var _24e=Selector.pseudos.getIndices(a,b,_245.length);
for(var i=0,node,l=_24e.length;node=_245[i];i++){
for(var j=0;j<l;j++){
if(node.nodeIndex==_24e[j]){
results.push(node);
}
}
}
}
}
h.unmark(_245);
h.unmark(indexed);
return results;
},"empty":function(_250,_251,root){
for(var i=0,results=[],node;node=_250[i];i++){
if(node.tagName=="!"||(node.firstChild&&!node.innerHTML.match(/^\s*$/))){
continue;
}
results.push(node);
}
return results;
},"not":function(_254,_255,root){
var h=Selector.handlers,selectorType,m;
var _258=new Selector(_255).findElements(root);
h.mark(_258);
for(var i=0,results=[],node;node=_254[i];i++){
if(!node._counted){
results.push(node);
}
}
h.unmark(_258);
return results;
},"enabled":function(_25a,_25b,root){
for(var i=0,results=[],node;node=_25a[i];i++){
if(!node.disabled){
results.push(node);
}
}
return results;
},"disabled":function(_25e,_25f,root){
for(var i=0,results=[],node;node=_25e[i];i++){
if(node.disabled){
results.push(node);
}
}
return results;
},"checked":function(_262,_263,root){
for(var i=0,results=[],node;node=_262[i];i++){
if(node.checked){
results.push(node);
}
}
return results;
}},operators:{"=":function(nv,v){
return nv==v;
},"!=":function(nv,v){
return nv!=v;
},"^=":function(nv,v){
return nv.startsWith(v);
},"$=":function(nv,v){
return nv.endsWith(v);
},"*=":function(nv,v){
return nv.include(v);
},"~=":function(nv,v){
return (" "+nv+" ").include(" "+v+" ");
},"|=":function(nv,v){
return ("-"+nv.toUpperCase()+"-").include("-"+v.toUpperCase()+"-");
}},matchElements:function(_274,_275){
var _276=new Selector(_275).findElements(),h=Selector.handlers;
h.mark(_276);
for(var i=0,results=[],element;element=_274[i];i++){
if(element._counted){
results.push(element);
}
}
h.unmark(_276);
return results;
},findElement:function(_278,_279,_27a){
if(typeof _279=="number"){
_27a=_279;
_279=false;
}
return Selector.matchElements(_278,_279||"*")[_27a||0];
},findChildElements:function(_27b,_27c){
var _27d=_27c.join(","),_27c=[];
_27d.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(m){
_27c.push(m[1].strip());
});
var _27f=[],h=Selector.handlers;
for(var i=0,l=_27c.length,selector;i<l;i++){
selector=new Selector(_27c[i].strip());
h.concat(_27f,selector.findElements(_27b));
}
return (l>1)?h.unique(_27f):_27f;
}});
function $$(){
return Selector.findChildElements(document,$A(arguments));
}
var Form={reset:function(form){
$(form).reset();
return form;
},serializeElements:function(_282,_283){
var data=_282.inject({},function(_285,_286){
if(!_286.disabled&&_286.name){
var key=_286.name,value=$(_286).getValue();
if(value!=null){
if(key in _285){
if(_285[key].constructor!=Array){
_285[key]=[_285[key]];
}
_285[key].push(value);
}else{
_285[key]=value;
}
}
}
return _285;
});
return _283?data:Hash.toQueryString(data);
}};
Form.Methods={serialize:function(form,_289){
return Form.serializeElements(Form.getElements(form),_289);
},getElements:function(form){
return $A($(form).getElementsByTagName("*")).inject([],function(_28b,_28c){
if(Form.Element.Serializers[_28c.tagName.toLowerCase()]){
_28b.push(Element.extend(_28c));
}
return _28b;
});
},getInputs:function(form,_28e,name){
form=$(form);
var _290=form.getElementsByTagName("input");
if(!_28e&&!name){
return $A(_290).map(Element.extend);
}
for(var i=0,matchingInputs=[],length=_290.length;i<length;i++){
var _292=_290[i];
if((_28e&&_292.type!=_28e)||(name&&_292.name!=name)){
continue;
}
matchingInputs.push(Element.extend(_292));
}
return matchingInputs;
},disable:function(form){
form=$(form);
Form.getElements(form).invoke("disable");
return form;
},enable:function(form){
form=$(form);
Form.getElements(form).invoke("enable");
return form;
},findFirstElement:function(form){
return $(form).getElements().find(function(_296){
return _296.type!="hidden"&&!_296.disabled&&["input","select","textarea"].include(_296.tagName.toLowerCase());
});
},focusFirstElement:function(form){
form=$(form);
form.findFirstElement().activate();
return form;
},request:function(form,_299){
form=$(form),_299=Object.clone(_299||{});
var _29a=_299.parameters;
_299.parameters=form.serialize(true);
if(_29a){
if(typeof _29a=="string"){
_29a=_29a.toQueryParams();
}
Object.extend(_299.parameters,_29a);
}
if(form.hasAttribute("method")&&!_299.method){
_299.method=form.method;
}
return new Ajax.Request(form.readAttribute("action"),_299);
}};
Object.extend(Form,Form.Methods);
Form.Element={focus:function(_29b){
$(_29b).focus();
return _29b;
},select:function(_29c){
$(_29c).select();
return _29c;
}};
Form.Element.Methods={serialize:function(_29d){
_29d=$(_29d);
if(!_29d.disabled&&_29d.name){
var _29e=_29d.getValue();
if(_29e!=undefined){
var pair={};
pair[_29d.name]=_29e;
return Hash.toQueryString(pair);
}
}
return "";
},getValue:function(_2a0){
_2a0=$(_2a0);
var _2a1=_2a0.tagName.toLowerCase();
return Form.Element.Serializers[_2a1](_2a0);
},clear:function(_2a2){
$(_2a2).value="";
return _2a2;
},present:function(_2a3){
return $(_2a3).value!="";
},activate:function(_2a4){
_2a4=$(_2a4);
try{
_2a4.focus();
if(_2a4.select&&(_2a4.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(_2a4.type))){
_2a4.select();
}
}
catch(e){
}
return _2a4;
},disable:function(_2a5){
_2a5=$(_2a5);
_2a5.blur();
_2a5.disabled=true;
return _2a5;
},enable:function(_2a6){
_2a6=$(_2a6);
_2a6.disabled=false;
return _2a6;
}};
Object.extend(Form.Element,Form.Element.Methods);
Object.extend(Element.Methods.ByTag,{"FORM":Object.clone(Form.Methods),"INPUT":Object.clone(Form.Element.Methods),"SELECT":Object.clone(Form.Element.Methods),"TEXTAREA":Object.clone(Form.Element.Methods)});
var Field=Form.Element;
var $F=Form.Element.getValue;
Form.Element.Serializers={input:function(_2a7){
switch(_2a7.type.toLowerCase()){
case "checkbox":
case "radio":
return Form.Element.Serializers.inputSelector(_2a7);
default:
return Form.Element.Serializers.textarea(_2a7);
}
},inputSelector:function(_2a8){
return _2a8.checked?_2a8.value:null;
},textarea:function(_2a9){
return _2a9.value;
},select:function(_2aa){
return this[_2aa.type=="select-one"?"selectOne":"selectMany"](_2aa);
},selectOne:function(_2ab){
var _2ac=_2ab.selectedIndex;
return _2ac>=0?this.optionValue(_2ab.options[_2ac]):null;
},selectMany:function(_2ad){
var _2ae,length=_2ad.length;
if(!length){
return null;
}
for(var i=0,_2ae=[];i<length;i++){
var opt=_2ad.options[i];
if(opt.selected){
_2ae.push(this.optionValue(opt));
}
}
return _2ae;
},optionValue:function(opt){
return Element.extend(opt).hasAttribute("value")?opt.value:opt.text;
}};
Abstract.TimedObserver=function(){
};
Abstract.TimedObserver.prototype={initialize:function(_2b2,_2b3,_2b4){
this.frequency=_2b3;
this.element=$(_2b2);
this.callback=_2b4;
this.lastValue=this.getValue();
this.registerCallback();
},registerCallback:function(){
setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},onTimerEvent:function(){
var _2b5=this.getValue();
var _2b6=("string"==typeof this.lastValue&&"string"==typeof _2b5?this.lastValue!=_2b5:String(this.lastValue)!=String(_2b5));
if(_2b6){
this.callback(this.element,_2b5);
this.lastValue=_2b5;
}
}};
Form.Element.Observer=Class.create();
Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){
return Form.Element.getValue(this.element);
}});
Form.Observer=Class.create();
Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){
return Form.serialize(this.element);
}});
Abstract.EventObserver=function(){
};
Abstract.EventObserver.prototype={initialize:function(_2b7,_2b8){
this.element=$(_2b7);
this.callback=_2b8;
this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){
this.registerFormCallbacks();
}else{
this.registerCallback(this.element);
}
},onElementEvent:function(){
var _2b9=this.getValue();
if(this.lastValue!=_2b9){
this.callback(this.element,_2b9);
this.lastValue=_2b9;
}
},registerFormCallbacks:function(){
Form.getElements(this.element).each(this.registerCallback.bind(this));
},registerCallback:function(_2ba){
if(_2ba.type){
switch(_2ba.type.toLowerCase()){
case "checkbox":
case "radio":
Event.observe(_2ba,"click",this.onElementEvent.bind(this));
break;
default:
Event.observe(_2ba,"change",this.onElementEvent.bind(this));
break;
}
}
}};
Form.Element.EventObserver=Class.create();
Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){
return Form.Element.getValue(this.element);
}});
Form.EventObserver=Class.create();
Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){
return Form.serialize(this.element);
}});
if(!window.Event){
var Event=new Object();
}
Object.extend(Event,{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,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,element:function(_2bb){
return $(_2bb.target||_2bb.srcElement);
},isLeftClick:function(_2bc){
return (((_2bc.which)&&(_2bc.which==1))||((_2bc.button)&&(_2bc.button==1)));
},pointerX:function(_2bd){
return _2bd.pageX||(_2bd.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(_2be){
return _2be.pageY||(_2be.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
},stop:function(_2bf){
if(_2bf.preventDefault){
_2bf.preventDefault();
_2bf.stopPropagation();
}else{
_2bf.returnValue=false;
_2bf.cancelBubble=true;
}
},findElement:function(_2c0,_2c1){
var _2c2=Event.element(_2c0);
while(_2c2.parentNode&&(!_2c2.tagName||(_2c2.tagName.toUpperCase()!=_2c1.toUpperCase()))){
_2c2=_2c2.parentNode;
}
return _2c2;
},observers:false,_observeAndCache:function(_2c3,name,_2c5,_2c6){
if(!this.observers){
this.observers=[];
}
if(_2c3.addEventListener){
this.observers.push([_2c3,name,_2c5,_2c6]);
_2c3.addEventListener(name,_2c5,_2c6);
}else{
if(_2c3.attachEvent){
this.observers.push([_2c3,name,_2c5,_2c6]);
_2c3.attachEvent("on"+name,_2c5);
}
}
},unloadCache:function(){
if(!Event.observers){
return;
}
for(var i=0,length=Event.observers.length;i<length;i++){
Event.stopObserving.apply(this,Event.observers[i]);
Event.observers[i][0]=null;
}
Event.observers=false;
},observe:function(_2c8,name,_2ca,_2cb){
_2c8=$(_2c8);
_2cb=_2cb||false;
if(name=="keypress"&&(Prototype.Browser.WebKit||_2c8.attachEvent)){
name="keydown";
}
Event._observeAndCache(_2c8,name,_2ca,_2cb);
},stopObserving:function(_2cc,name,_2ce,_2cf){
_2cc=$(_2cc);
_2cf=_2cf||false;
if(name=="keypress"&&(Prototype.Browser.WebKit||_2cc.attachEvent)){
name="keydown";
}
if(_2cc.removeEventListener){
_2cc.removeEventListener(name,_2ce,_2cf);
}else{
if(_2cc.detachEvent){
try{
_2cc.detachEvent("on"+name,_2ce);
}
catch(e){
}
}
}
}});
if(Prototype.Browser.IE){
Event.observe(window,"unload",Event.unloadCache,false);
}
var Position={includeScrollOffsets:false,prepare:function(){
this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;
},realOffset:function(_2d0){
var _2d1=0,valueL=0;
do{
_2d1+=_2d0.scrollTop||0;
valueL+=_2d0.scrollLeft||0;
_2d0=_2d0.parentNode;
}while(_2d0);
return [valueL,_2d1];
},cumulativeOffset:function(_2d2){
var _2d3=0,valueL=0;
do{
_2d3+=_2d2.offsetTop||0;
valueL+=_2d2.offsetLeft||0;
_2d2=_2d2.offsetParent;
}while(_2d2);
return [valueL,_2d3];
},positionedOffset:function(_2d4){
var _2d5=0,valueL=0;
do{
_2d5+=_2d4.offsetTop||0;
valueL+=_2d4.offsetLeft||0;
_2d4=_2d4.offsetParent;
if(_2d4){
if(_2d4.tagName=="BODY"){
break;
}
var p=Element.getStyle(_2d4,"position");
if(p=="relative"||p=="absolute"){
break;
}
}
}while(_2d4);
return [valueL,_2d5];
},offsetParent:function(_2d7){
if(_2d7.offsetParent){
return _2d7.offsetParent;
}
if(_2d7==document.body){
return _2d7;
}
while((_2d7=_2d7.parentNode)&&_2d7!=document.body){
if(Element.getStyle(_2d7,"position")!="static"){
return _2d7;
}
}
return document.body;
},within:function(_2d8,x,y){
if(this.includeScrollOffsets){
return this.withinIncludingScrolloffsets(_2d8,x,y);
}
this.xcomp=x;
this.ycomp=y;
this.offset=this.cumulativeOffset(_2d8);
return (y>=this.offset[1]&&y<this.offset[1]+_2d8.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_2d8.offsetWidth);
},withinIncludingScrolloffsets:function(_2db,x,y){
var _2de=this.realOffset(_2db);
this.xcomp=x+_2de[0]-this.deltaX;
this.ycomp=y+_2de[1]-this.deltaY;
this.offset=this.cumulativeOffset(_2db);
return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_2db.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_2db.offsetWidth);
},overlap:function(mode,_2e0){
if(!mode){
return 0;
}
if(mode=="vertical"){
return ((this.offset[1]+_2e0.offsetHeight)-this.ycomp)/_2e0.offsetHeight;
}
if(mode=="horizontal"){
return ((this.offset[0]+_2e0.offsetWidth)-this.xcomp)/_2e0.offsetWidth;
}
},page:function(_2e1){
var _2e2=0,valueL=0;
var _2e3=_2e1;
do{
_2e2+=_2e3.offsetTop||0;
valueL+=_2e3.offsetLeft||0;
if(_2e3.offsetParent==document.body){
if(Element.getStyle(_2e3,"position")=="absolute"){
break;
}
}
}while(_2e3=_2e3.offsetParent);
_2e3=_2e1;
do{
if(!window.opera||_2e3.tagName=="BODY"){
_2e2-=_2e3.scrollTop||0;
valueL-=_2e3.scrollLeft||0;
}
}while(_2e3=_2e3.parentNode);
return [valueL,_2e2];
},clone:function(_2e4,_2e5){
var _2e6=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
_2e4=$(_2e4);
var p=Position.page(_2e4);
_2e5=$(_2e5);
var _2e8=[0,0];
var _2e9=null;
if(Element.getStyle(_2e5,"position")=="absolute"){
_2e9=Position.offsetParent(_2e5);
_2e8=Position.page(_2e9);
}
if(_2e9==document.body){
_2e8[0]-=document.body.offsetLeft;
_2e8[1]-=document.body.offsetTop;
}
if(_2e6.setLeft){
_2e5.style.left=(p[0]-_2e8[0]+_2e6.offsetLeft)+"px";
}
if(_2e6.setTop){
_2e5.style.top=(p[1]-_2e8[1]+_2e6.offsetTop)+"px";
}
if(_2e6.setWidth){
_2e5.style.width=_2e4.offsetWidth+"px";
}
if(_2e6.setHeight){
_2e5.style.height=_2e4.offsetHeight+"px";
}
},absolutize:function(_2ea){
_2ea=$(_2ea);
if(_2ea.style.position=="absolute"){
return;
}
Position.prepare();
var _2eb=Position.positionedOffset(_2ea);
var top=_2eb[1];
var left=_2eb[0];
var _2ee=_2ea.clientWidth;
var _2ef=_2ea.clientHeight;
_2ea._originalLeft=left-parseFloat(_2ea.style.left||0);
_2ea._originalTop=top-parseFloat(_2ea.style.top||0);
_2ea._originalWidth=_2ea.style.width;
_2ea._originalHeight=_2ea.style.height;
_2ea.style.position="absolute";
_2ea.style.top=top+"px";
_2ea.style.left=left+"px";
_2ea.style.width=_2ee+"px";
_2ea.style.height=_2ef+"px";
},relativize:function(_2f0){
_2f0=$(_2f0);
if(_2f0.style.position=="relative"){
return;
}
Position.prepare();
_2f0.style.position="relative";
var top=parseFloat(_2f0.style.top||0)-(_2f0._originalTop||0);
var left=parseFloat(_2f0.style.left||0)-(_2f0._originalLeft||0);
_2f0.style.top=top+"px";
_2f0.style.left=left+"px";
_2f0.style.height=_2f0._originalHeight;
_2f0.style.width=_2f0._originalWidth;
}};
if(Prototype.Browser.WebKit){
Position.cumulativeOffset=function(_2f3){
var _2f4=0,valueL=0;
do{
_2f4+=_2f3.offsetTop||0;
valueL+=_2f3.offsetLeft||0;
if(_2f3.offsetParent==document.body){
if(Element.getStyle(_2f3,"position")=="absolute"){
break;
}
}
_2f3=_2f3.offsetParent;
}while(_2f3);
return [valueL,_2f4];
};
}
Element.addMethods();

var Rico={Version:"2.0 beta2",loadRequested:1,loadComplete:2,init:function(){
try{
document.execCommand("BackgroundImageCache",false,true);
}
catch(err){
}
this.preloadMsgs="";
var _1=document.getElementsByTagName("script");
this.baseHref=location.protocol+"//"+location.host;
this.loadedFiles={};
this.loadQueue=[];
this.windowIsLoaded=false;
this.onLoadCallbacks=[];
for(var i=0;i<_1.length;i++){
if(!_1[i].src){
continue;
}
var _3=_1[i].src;
var _4=_3.lastIndexOf("/");
var _5=_3.substring(0,_4+1);
var _6=_3.substring(_4+1);
this.loadedFiles[_6]=this.loadComplete;
if(_6=="rico.js"){
this.jsDir=_5;
this.cssDir=_5+"css/";
this.imgDir=_5+"images/";
this.htmDir=_5;
this.xslDir=_5;
}
}
if(typeof Prototype=="undefined"){
this.include("prototype.js");
}
this.include("ricoCommon.js");
var _7=function(){
Rico.windowLoaded();
};
if(window.addEventListener){
window.addEventListener("load",_7,false);
}else{
if(window.attachEvent){
window.attachEvent("onload",_7);
}
}
this.onLoad(function(){
Rico.writeDebugMsg("Pre-load messages:\n"+Rico.preloadMsgs);
});
},moduleDependencies:{Accordion:["ricoBehaviors.js","ricoEffects.js","ricoComponents.js"],Color:["ricoColor.js"],Corner:["ricoStyles.js"],DragAndDrop:["ricoDragDrop.js"],Effect:["ricoEffects.js"],Calendar:["ricoCalendar.js","ricoCalendar.css"],Tree:["ricoTree.js","ricoTree.css"],ColorPicker:["ricoColorPicker.js","ricoStyles.js"],SimpleGrid:["ricoCommon.js","ricoGridCommon.js","ricoGrid.css","ricoSimpleGrid.js"],LiveGrid:["ricoCommon.js","ricoGridCommon.js","ricoGrid.css","ricoBehaviors.js","ricoLiveGrid.js"],CustomMenu:["ricoMenu.js","ricoMenu.css"],LiveGridMenu:["+CustomMenu","ricoLiveGridMenu.js"],LiveGridAjax:["+LiveGrid","ricoLiveGridAjax.js"],LiveGridForms:["+LiveGridAjax","+LiveGridMenu","+Accordion","+Corner","ricoLiveGridForms.js","ricoLiveGridForms.css"],SpreadSheet:["+SimpleGrid","ricoSheet.js"]},loadModule:function(_8){
var _9=this.moduleDependencies[_8];
if(!_9){
return;
}
for(var i=0;i<_9.length;i++){
if(_9[i].substring(0,1)=="+"){
this.loadModule(_9[i].slice(1));
}else{
this.include(_9[i]);
}
}
},include:function(_b){
if(this.loadedFiles[_b]){
return;
}
this.addPreloadMsg("include: "+_b);
var _c=_b.substr(_b.lastIndexOf(".")+1);
switch(_c.toLowerCase()){
case "js":
this.loadQueue.push(_b);
this.loadedFiles[_b]=this.loadRequested;
this.checkLoadQueue();
return;
case "css":
var el=document.createElement("link");
el.type="text/css";
el.rel="stylesheet";
el.href=this.cssDir+_b;
this.loadedFiles[_b]=this.loadComplete;
document.getElementsByTagName("head")[0].appendChild(el);
return;
}
},checkLoadQueue:function(){
if(this.loadQueue.length==0){
return;
}
if(this.inProcess){
return;
}
this.addScriptToDOM(this.loadQueue.shift());
},addScriptToDOM:function(_e){
this.addPreloadMsg("addScriptToDOM: "+_e);
var js=document.createElement("script");
js.type="text/javascript";
js.src=this.jsDir+_e;
this.loadedFiles[_e]=this.loadRequested;
this.inProcess=_e;
var _10=document.getElementsByTagName("head")[0];
if(_e.substring(0,4)=="rico"){
_10.appendChild(js);
}else{
if(/WebKit|Khtml/i.test(navigator.userAgent)){
_10.appendChild(js);
this.includeLoaded(_e);
}else{
js.onload=js.onreadystatechange=function(){
if(js.readyState&&js.readyState!="loaded"&&js.readyState!="complete"){
return;
}
js.onreadystatechange=js.onload=null;
Rico.includeLoaded(_e);
};
_10.appendChild(js);
}
}
},includeLoaded:function(_11){
this.addPreloadMsg("loaded: "+_11);
this.loadedFiles[_11]=this.loadComplete;
if(_11==this.inProcess){
this.inProcess=null;
this.checkLoadQueue();
this.checkIfComplete();
}
},windowLoaded:function(){
this.windowIsLoaded=true;
this.checkIfComplete();
},checkIfComplete:function(){
var _12=this.windowIsLoaded?"":"window";
for(var _13 in this.loadedFiles){
if(this.loadedFiles[_13]==this.loadRequested){
_12+=" "+_13;
}
}
this.addPreloadMsg("waitingFor: "+_12);
if(_12.length==0){
this.addPreloadMsg("Processing callbacks");
while(this.onLoadCallbacks.length>0){
var _14=this.onLoadCallbacks.pop();
if(_14){
_14();
}
}
}
},onLoad:function(_15){
this.onLoadCallbacks.push(_15);
this.checkIfComplete();
},isKonqueror:navigator.userAgent.toLowerCase().indexOf("konqueror")>=0,startTime:new Date(),timeStamp:function(){
var _16=new Date();
return (_16.getTime()-this.startTime.getTime())+": ";
},setDebugArea:function(id,_18){
if(!this.debugArea||_18){
var _19=document.getElementById(id);
if(!_19){
return;
}
this.debugArea=_19;
_19.value="";
}
},addPreloadMsg:function(msg){
this.preloadMsgs+=Rico.timeStamp()+msg+"\n";
},writeDebugMsg:function(msg,_1c){
if(this.debugArea){
if(_1c){
this.debugArea.value="";
}
this.debugArea.value+=this.timeStamp()+msg+"\n";
}
}};
Rico.init();

if(typeof Rico=="undefined"){
throw ("Cannot find the Rico object");
}
if(typeof Prototype=="undefined"){
throw ("Rico requires the Prototype JavaScript framework");
}
Rico.prototypeVersion=parseFloat(Prototype.Version.split(".")[0]+"."+Prototype.Version.split(".")[1]);
if(Rico.prototypeVersion<1.3){
throw ("Rico requires Prototype JavaScript framework version 1.3 or greater");
}
var RicoUtil={getDirectChildrenByTag:function(e,_2){
var _3=new Array();
var _4=e.childNodes;
_2=_2.toLowerCase();
for(var i=0;i<_4.length;i++){
if(_4[i]&&_4[i].tagName&&_4[i].tagName.toLowerCase()==_2){
_3.push(_4[i]);
}
}
return _3;
},createXmlDocument:function(){
if(document.implementation&&document.implementation.createDocument){
var _6=document.implementation.createDocument("","",null);
if(_6.readyState==null){
_6.readyState=1;
_6.addEventListener("load",function(){
_6.readyState=4;
if(typeof _6.onreadystatechange=="function"){
_6.onreadystatechange();
}
},false);
}
return _6;
}
if(window.ActiveXObject){
return Try.these(function(){
return new ActiveXObject("MSXML2.DomDocument");
},function(){
return new ActiveXObject("Microsoft.DomDocument");
},function(){
return new ActiveXObject("MSXML.DomDocument");
},function(){
return new ActiveXObject("MSXML3.DomDocument");
})||false;
}
return null;
},getInnerText:function(el){
if(typeof el=="string"){
return el;
}
if(typeof el=="undefined"){
return el;
}
var cs=el.childNodes;
var l=cs.length;
var _a="";
for(var i=0;i<l;i++){
switch(cs[i].nodeType){
case 1:
if(Element.getStyle(cs[i],"display")=="none"){
continue;
}
switch(cs[i].tagName.toLowerCase()){
case "img":
_a+=cs[i].alt||cs[i].title||cs[i].src;
break;
case "input":
if(cs[i].type=="hidden"){
continue;
}
case "select":
case "textarea":
_a+=$F(cs[i])||"";
break;
default:
_a+=this.getInnerText(cs[i]);
break;
}
break;
case 3:
_a+=cs[i].nodeValue;
break;
}
}
return _a;
},getContentAsString:function(_c,_d){
if(_d){
return this._getEncodedContent(_c);
}
if(typeof _c.xml!="undefined"){
return this._getContentAsStringIE(_c);
}
return this._getContentAsStringMozilla(_c);
},_getEncodedContent:function(_e){
if(_e.innerHTML){
return _e.innerHTML;
}
switch(_e.childNodes.length){
case 0:
return "";
case 1:
return _e.firstChild.nodeValue;
default:
return _e.childNodes[1].nodeValue;
}
},_getContentAsStringIE:function(_f){
var _10="";
for(var i=0;i<_f.childNodes.length;i++){
var n=_f.childNodes[i];
if(n.nodeType==4){
_10+=n.nodeValue;
}else{
_10+=n.xml;
}
}
return _10;
},_getContentAsStringMozilla:function(_13){
var _14=new XMLSerializer();
var _15="";
for(var i=0;i<_13.childNodes.length;i++){
var n=_13.childNodes[i];
if(n.nodeType==4){
_15+=n.nodeValue;
}else{
_15+=_14.serializeToString(n);
}
}
return _15;
},docElement:function(){
return (document.compatMode&&document.compatMode.indexOf("CSS")!=-1)?document.documentElement:document.getElementsByTagName("body")[0];
},windowHeight:function(){
return window.innerHeight?window.innerHeight:this.docElement().clientHeight;
},windowWidth:function(){
return this.docElement().clientWidth;
},docScrollLeft:function(){
if(window.pageXOffset){
return window.pageXOffset;
}else{
if(document.documentElement&&document.documentElement.scrollLeft){
return document.documentElement.scrollLeft;
}else{
if(document.body){
return document.body.scrollLeft;
}else{
return 0;
}
}
}
},docScrollTop:function(){
if(window.pageYOffset){
return window.pageYOffset;
}else{
if(document.documentElement&&document.documentElement.scrollTop){
return document.documentElement.scrollTop;
}else{
if(document.body){
return document.body.scrollTop;
}else{
return 0;
}
}
}
},nan2zero:function(n){
if(typeof (n)=="string"){
n=parseInt(n);
}
return isNaN(n)||typeof (n)=="undefined"?0:n;
},eventKey:function(e){
if(typeof (e.keyCode)=="number"){
return e.keyCode;
}else{
if(typeof (e.which)=="number"){
return e.which;
}else{
if(typeof (e.charCode)=="number"){
return e.charCode;
}
}
}
return -1;
},getPreviosSiblingByTagName:function(el,_1b){
var sib=el.previousSibling;
while(sib){
if((sib.tagName==_1b)&&(sib.style.display!="none")){
return sib;
}
sib=sib.previousSibling;
}
return null;
},getParentByTagName:function(el,_1e,_1f){
var par=el;
_1e=_1e.toLowerCase();
while(par){
if(par.tagName&&par.tagName.toLowerCase()==_1e){
if(!_1f||par.className.indexOf(_1f)>=0){
return par;
}
}
par=par.parentNode;
}
return null;
},wrapChildren:function(el,cls,id,_24){
var tag=_24||"div";
var _26=document.createElement(tag);
if(id){
_26.id=id;
}
if(cls){
_26.className=cls;
}
while(el.firstChild){
_26.appendChild(el.firstChild);
}
el.appendChild(_26);
return _26;
},formatPosNumber:function(_27,_28,_29,_2a){
var a=_27.toFixed(_28).split(/\./);
if(_29){
var rgx=/(\d+)(\d{3})/;
while(rgx.test(a[0])){
a[0]=a[0].replace(rgx,"$1"+_29+"$2");
}
}
return a.join(_2a);
},DOMNode_insertAfter:function(_2d,_2e){
var _2f=_2e.parentNode;
if(_2f.lastChild==_2e){
return _2f.appendChild(_2d);
}else{
return _2f.insertBefore(_2d,_2e.nextSibling);
}
},positionCtlOverIcon:function(ctl,_31){
if(ctl.style.display=="none"){
ctl.style.display="block";
}
var _32=Position.page(_31);
var _33=Prototype.Browser.IE?1:2;
var _34=this.nan2zero(Element.getStyle(_31,"padding-left"));
ctl.style.left=(_32[0]+_34+_33)+"px";
var _35=this.docScrollTop();
var _36=_32[1]+_33+_35;
var _37=ctl.offsetHeight;
var _38=_31.offsetHeight;
if(_36+_38+_37<this.windowHeight()+_35){
_36+=_38;
}else{
_36=Math.max(_36-_37,_35);
}
ctl.style.top=_36+"px";
},createFormField:function(_39,_3a,_3b,id,_3d){
if(typeof _3d!="string"){
_3d=id;
}
if(Prototype.Browser.IE){
var s=_3a+" id=\""+id+"\"";
if(_3b){
s+=" type=\""+_3b+"\"";
}
if(_3a.match(/^(form|input|select|textarea|object|button|img)$/)){
s+=" name=\""+_3d+"\"";
}
var _3f=document.createElement("<"+s+" />");
}else{
var _3f=document.createElement(_3a);
if(_3b){
_3f.type=_3b;
}
_3f.id=id;
if(typeof _3f.name=="string"){
_3f.name=_3d;
}
}
_39.appendChild(_3f);
return _3f;
},getCookie:function(_40){
var arg=_40+"=";
var _42=arg.length;
var _43=document.cookie.length;
var i=0;
while(i<_43){
var j=i+_42;
if(document.cookie.substring(i,j)==arg){
var _46=document.cookie.indexOf(";",j);
if(_46==-1){
_46=document.cookie.length;
}
return unescape(document.cookie.substring(j,_46));
}
i=document.cookie.indexOf(" ",i)+1;
if(i==0){
break;
}
}
return null;
},setCookie:function(_47,_48,_49,_4a,_4b){
var c=_47+"="+escape(_48);
if(typeof (_49)=="number"){
var _4d=new Date();
_4d.setTime(_4d.getTime()+(_49*24*60*60*1000));
c+="; expires="+_4d.toGMTString();
}
if(typeof (_4a)=="string"){
c+="; path="+_4a;
}
if(typeof (_4b)=="string"){
c+="; domain="+_4b;
}
document.cookie=c;
}};
var RicoTranslate={phrases:{},thouSep:",",decPoint:".",langCode:"en",re:/^(\W*)\b(.*)\b(\W*)$/,dateFmt:"mm/dd/yyyy",timeFmt:"hh:nn:ss a/pm",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],addPhrase:function(_4e,_4f){
this.phrases[_4e]=_4f;
},getPhrase:function(_50){
var _51=_50.split(/\t/);
var _52,translated="";
for(var i=0;i<_51.length;i++){
if(this.re.exec(_51[i])){
_52=this.phrases[RegExp.$2];
translated+=(typeof _52=="string")?RegExp.$1+_52+RegExp.$3:_51[i];
}else{
translated+=_51[i];
}
}
return translated;
}};
if(!Date.prototype.formatDate){
Date.prototype.formatDate=function(fmt){
var d=this;
var _56=(typeof fmt=="string")?_56=fmt:"translateDate";
switch(_56){
case "locale":
case "localeDateTime":
return d.toLocaleString();
case "localeDate":
return d.toLocaleDateString();
case "translate":
case "translateDateTime":
_56=RicoTranslate.dateFmt+" "+RicoTranslate.timeFmt;
break;
case "translateDate":
_56=RicoTranslate.dateFmt;
break;
}
return _56.replace(/(yyyy|mmmm|mmm|mm|dddd|ddd|dd|hh|nn|ss|a\/p)/gi,function($1){
switch($1.toLowerCase()){
case "yyyy":
return d.getFullYear();
case "mmmm":
return RicoTranslate.monthNames[d.getMonth()];
case "mmm":
return RicoTranslate.monthNames[d.getMonth()].substr(0,3);
case "mm":
return (d.getMonth()+1).toPaddedString(2);
case "m":
return (d.getMonth()+1);
case "dddd":
return RicoTranslate.dayNames[d.getDay()];
case "ddd":
return RicoTranslate.dayNames[d.getDay()].substr(0,3);
case "dd":
return d.getDate().toPaddedString(2);
case "d":
return d.getDate();
case "hh":
return ((h=d.getHours()%12)?h:12).toPaddedString(2);
case "h":
return ((h=d.getHours()%12)?h:12);
case "HH":
return d.getHours().toPaddedString(2);
case "H":
return d.getHours();
case "nn":
return d.getMinutes().toPaddedString(2);
case "ss":
return d.getSeconds().toPaddedString(2);
case "a/p":
return d.getHours()<12?"a":"p";
}
});
};
}
if(!Date.prototype.setISO8601){
Date.prototype.setISO8601=function(_58){
if(!_58){
return false;
}
var d=_58.match(/(\d\d\d\d)(?:-?(\d\d)(?:-?(\d\d)(?:[T ](\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|(?:([-+])(\d\d)(?::?(\d\d))?)?)?)?)?)?/);
if(!d){
return false;
}
var _5a=0;
var _5b=new Date(d[1],0,1);
if(d[2]){
_5b.setMonth(d[2]-1);
}
if(d[3]){
_5b.setDate(d[3]);
}
if(d[4]){
_5b.setHours(d[4]);
}
if(d[5]){
_5b.setMinutes(d[5]);
}
if(d[6]){
_5b.setSeconds(d[6]);
}
if(d[7]){
_5b.setMilliseconds(Number("0."+d[7])*1000);
}
if(d[8]){
if(d[10]&&d[11]){
_5a=(Number(d[10])*60)+Number(d[11]);
}
_5a*=((d[9]=="-")?1:-1);
_5a-=_5b.getTimezoneOffset();
}
var _5c=(Number(_5b)+(_5a*60*1000));
this.setTime(Number(_5c));
return true;
};
}
if(!Date.prototype.toISO8601String){
Date.prototype.toISO8601String=function(_5d,_5e){
if(!_5d){
var _5d=6;
}
if(!_5e){
var _5e="Z";
var _5f=this;
}else{
var d=_5e.match(/([-+])([0-9]{2}):([0-9]{2})/);
var _61=(Number(d[2])*60)+Number(d[3]);
_61*=((d[1]=="-")?-1:1);
var _5f=new Date(Number(Number(this)+(_61*60000)));
}
var _62=function(num){
return ((num<10)?"0":"")+num;
};
var str="";
str+=_5f.getUTCFullYear();
if(_5d>1){
str+="-"+_62(_5f.getUTCMonth()+1);
}
if(_5d>2){
str+="-"+_62(_5f.getUTCDate());
}
if(_5d>3){
str+="T"+_62(_5f.getUTCHours())+":"+_62(_5f.getUTCMinutes());
}
if(_5d>5){
var _65=Number(_5f.getUTCSeconds()+"."+((_5f.getUTCMilliseconds()<100)?"0":"")+_62(_5f.getUTCMilliseconds()));
str+=":"+_62(_65);
}else{
if(_5d>4){
str+=":"+_62(_5f.getUTCSeconds());
}
}
if(_5d>3){
str+=_5e;
}
return str;
};
}
if(!String.prototype.formatDate){
String.prototype.formatDate=function(fmt){
var s=this.replace(/-/g,"/");
var d=new Date(s);
return isNaN(d)?this:d.formatDate(fmt);
};
}
if(!Number.prototype.formatNumber){
Number.prototype.formatNumber=function(fmt){
if(isNaN(this)){
return "NaN";
}
var n=this;
if(typeof fmt.multiplier=="number"){
n*=fmt.multiplier;
}
var _6b=typeof fmt.decPlaces=="number"?fmt.decPlaces:0;
var _6c=typeof fmt.thouSep=="string"?fmt.thouSep:RicoTranslate.thouSep;
var _6d=typeof fmt.decPoint=="string"?fmt.decPoint:RicoTranslate.decPoint;
var _6e=fmt.prefix||"";
var _6f=fmt.suffix||"";
var _70=typeof fmt.negSign=="string"?fmt.negSign:"L";
_70=_70.toUpperCase();
var s,cls;
if(n<0){
s=RicoUtil.formatPosNumber(-n,_6b,_6c,_6d);
if(_70=="P"){
s="("+s+")";
}
s=_6e+s;
if(_70=="L"){
s="-"+s;
}
if(_70=="T"){
s+="-";
}
cls="negNumber";
}else{
cls=n==0?"zeroNumber":"posNumber";
s=_6e+RicoUtil.formatPosNumber(n,_6b,_6c,_6d);
}
return "<span class='"+cls+"'>"+s+_6f+"</span>";
};
}
if(!String.prototype.formatNumber){
String.prototype.formatNumber=function(fmt){
var n=parseFloat(this);
return isNaN(n)?this:n.formatNumber(fmt);
};
}
Rico.Shim=Class.create();
if(Prototype.Browser.IE){
Rico.Shim.prototype={initialize:function(_74){
this.ifr=document.createElement("iframe");
this.ifr.style.position="absolute";
this.ifr.style.display="none";
this.ifr.src="javascript:false;";
_74.parentNode.appendChild(this.ifr);
this.DivRef=_74;
},hide:function(){
this.ifr.style.display="none";
},show:function(){
this.ifr.style.width=this.DivRef.offsetWidth;
this.ifr.style.height=this.DivRef.offsetHeight;
this.ifr.style.top=this.DivRef.style.top;
this.ifr.style.left=this.DivRef.style.left;
this.ifr.style.zIndex=this.DivRef.currentStyle.zIndex-1;
this.ifr.style.display="block";
}};
}else{
Rico.Shim.prototype={initialize:function(){
},hide:function(){
},show:function(){
}};
}
Rico.Shadow=Class.create();
Rico.Shadow.prototype={initialize:function(_75){
this.div=document.createElement("div");
this.div.style.position="absolute";
if(typeof this.div.style.filter=="undefined"){
new Image().src=Rico.imgDir+"shadow.png";
new Image().src=Rico.imgDir+"shadow_ur.png";
new Image().src=Rico.imgDir+"shadow_ll.png";
this.createShadow();
this.offset=5;
}else{
this.div.style.backgroundColor="#888";
this.div.style.filter="progid:DXImageTransform.Microsoft.Blur(makeShadow=1, shadowOpacity=0.3, pixelRadius=3)";
this.offset=0;
}
this.div.style.display="none";
_75.parentNode.appendChild(this.div);
this.DivRef=_75;
},createShadow:function(){
var tab=document.createElement("table");
tab.style.height="100%";
tab.style.width="100%";
tab.cellSpacing=0;
tab.dir="ltr";
var tr1=tab.insertRow(-1);
tr1.style.height="8px";
var _78=tr1.insertCell(-1);
_78.style.width="8px";
var _79=tr1.insertCell(-1);
_79.style.background="transparent url("+Rico.imgDir+"shadow_ur.png"+") no-repeat right bottom";
var tr2=tab.insertRow(-1);
var _7b=tr2.insertCell(-1);
_7b.style.background="transparent url("+Rico.imgDir+"shadow_ll.png"+") no-repeat right bottom";
var _7c=tr2.insertCell(-1);
_7c.style.background="transparent url("+Rico.imgDir+"shadow.png"+") no-repeat right bottom";
this.div.appendChild(tab);
},hide:function(){
this.div.style.display="none";
},show:function(){
this.div.style.width=this.DivRef.offsetWidth+"px";
this.div.style.height=this.DivRef.offsetHeight+"px";
this.div.style.top=(parseInt(this.DivRef.style.top)+this.offset)+"px";
this.div.style.left=(parseInt(this.DivRef.style.left)+this.offset)+"px";
this.div.style.zIndex=parseInt(Element.getStyle(this.DivRef,"z-index"))-1;
this.div.style.display="block";
}};
Rico.Popup=Class.create();
Rico.Popup.prototype={initialize:function(_7d,_7e){
this.options={hideOnEscape:true,hideOnClick:true,ignoreClicks:false,position:"absolute",shadow:true};
Object.extend(this.options,_7d||{});
if(_7e){
this.setDiv(_7e);
}
},setDiv:function(_7f,_80){
this.divPopup=$(_7f);
var _81=this.options.position=="auto"?Element.getStyle(this.divPopup,"position").toLowerCase():this.options.position;
if(!this.divPopup||_81!="absolute"){
return;
}
this.closeFunc=_80||this.closePopup.bindAsEventListener(this);
this.shim=new Rico.Shim(this.divPopup);
if(this.options.shadow){
this.shadow=new Rico.Shadow(this.divPopup);
}
if(this.options.hideOnClick){
Event.observe(document,"click",this.closeFunc);
}
if(this.options.hideOnEscape){
Event.observe(document,"keyup",this._checkKey.bindAsEventListener(this));
}
if(this.options.ignoreClicks){
this.ignoreClicks();
}
},ignoreClicks:function(){
Event.observe(this.divPopup,"click",this._ignoreClick.bindAsEventListener(this));
},_ignoreClick:function(e){
if(e.stopPropagation){
e.stopPropagation();
}else{
e.cancelBubble=true;
}
return true;
},_checkKey:function(e){
if(RicoUtil.eventKey(e)==27){
this.closeFunc();
}
return true;
},openPopup:function(_84,top){
if(typeof _84=="number"){
this.divPopup.style.left=_84+"px";
}
if(typeof top=="number"){
this.divPopup.style.top=top+"px";
}
this.divPopup.style.display="block";
if(this.shim){
this.shim.show();
}
if(this.shadow){
this.shadow.show();
}
},closePopup:function(){
if(this.shim){
this.shim.hide();
}
if(this.shadow){
this.shadow.hide();
}
this.divPopup.style.display="none";
}};
Rico.includeLoaded("ricoCommon.js");

Rico.ContentTransitionBase=function(){
};
Rico.ContentTransitionBase.prototype={initialize:function(_1,_2,_3){
if(typeof _1=="string"){
_1=$$(_1);
}
if(typeof _2=="string"){
_2=$$(_2);
}
this.titles=_1;
this.contents=_2;
this.options=Object.extend({duration:200,steps:8,rate:Rico.Effect.easeIn},_3||{});
this.hoverSet=new Rico.HoverSet(_1,_3);
_2.each(function(p){
if(p){
Element.hide(p);
}
});
this.selectionSet=new Rico.SelectionSet(_1,Object.extend(this.options,{onSelect:this.select.bind(this)}));
if(this.initContent){
this.initContent();
}
},reset:function(){
this.selectionSet.reset();
},select:function(_5){
if(this.selected==this.contentOf(_5)){
return;
}
var _6=this.contentOf(_5);
if(this.transition){
if(this.selected){
var _7=this.transition(_6);
if(_7){
Rico.animate(_7,this.options);
}
}else{
Element.show(_6);
}
}else{
if(this.selected){
Element.hide(this.selected);
}
Element.show(_6);
}
this.selected=_6;
},add:function(_8,_9){
this.titles.push(_8);
this.contents.push(_9);
this.hoverSet.add(_8);
this.selectionSet.add(_8);
this.selectionSet.select(_8);
},remove:function(_a){
},removeAll:function(){
this.hoverSet.removeAll();
this.selectionSet.removeAll();
},openByIndex:function(_b){
this.selectionSet.selectIndex(_b);
},contentOf:function(_c){
return this.contents[this.titles.indexOf(_c)];
}};
Rico.ContentTransition=Class.create();
Rico.ContentTransition.prototype=Object.extend(new Rico.ContentTransitionBase(),{});
Rico.SlidingPanel=Class.create();
Rico.SlidingPanel.prototype={initialize:function(_d){
this.panel=_d;
this.options=arguments[1]||{};
this.closed=true;
this.showing=false;
this.openEffect=this.options.openEffect;
this.closeEffect=this.options.closeEffect;
this.animator=new Rico.Effect.Animator();
Element.makeClipping(this.panel);
},toggle:function(){
if(!this.showing){
this.open();
}else{
this.close();
}
},open:function(){
if(this.closed){
this.showing=true;
Element.show(this.panel);
this.options.disabler.disableNative();
}
this.animator.play(this.openEffect,{onFinish:function(){
Element.undoClipping($(this.panel));
}.bind(this),rate:Rico.Effect.easeIn});
},close:function(){
Element.makeClipping(this.panel);
this.animator.stop();
this.showing=false;
this.animator.play(this.closeEffect,{onFinish:function(){
Element.hide(this.panel);
this.options.disabler.enableNative();
}.bind(this),rate:Rico.Effect.easeOut});
}};
Rico.Accordion=Class.create();
Rico.Accordion.prototype=Object.extend(new Rico.ContentTransitionBase(),{initContent:function(){
this.selected.style.height=this.options.panelHeight+"px";
},transition:function(p){
if(!this.options.noAnimate){
return new Rico.AccordionEffect(this.selected,p,this.options.panelHeight);
}else{
p.style.height=this.options.panelHeight+"px";
if(this.selected){
Element.hide(this.selected);
}
Element.show(p);
}
}});
Rico.TabbedPanel=Class.create();
Rico.TabbedPanel.prototype=Object.extend(new Rico.ContentTransitionBase(),{initContent:function(){
if(false&&(this.options.panelHeight=="auto"||this.options.panelWidth=="auto")){
var _f=0,maxht=0;
for(var i=0;i<this.contents.length;i++){
var d=Element.getDimensions(this.contents[i]);
_f=Math.max(_f,d.width);
maxht=Math.max(maxht,d.height);
}
if(this.options.panelWidth=="auto"){
this.options.panelWidth=_f;
}
if(this.options.panelHeight=="auto"){
this.options.panelHeight=maxht;
}
}
if(typeof this.options.panelWidth=="number"){
this.options.panelWidth+="px";
}
if(typeof this.options.panelHeight=="number"){
this.options.panelHeight+="px";
}
if(Rico.Corner){
this.options.color="transparent";
this.options.corners="top";
for(var i=0;i<this.titles.length;i++){
if(this.titles[i]){
if(this.options.panelHdrWidth){
this.titles[i].style.width=this.options.panelHdrWidth;
}
Rico.Corner.round(this.titles[i],this.options);
}
}
}
this.transition(this.selected);
},transition:function(p){
if(this.selected){
Element.hide(this.selected);
}
Element.show(p);
if(this.options.panelHeight){
p.style.height=this.options.panelHeight;
}
if(this.options.panelWidth){
p.style.width=this.options.panelWidth;
}
}});
Rico.SlidingPanel.top=function(_13,_14){
var _15=Object.extend({disabler:Rico.Controls.defaultDisabler},arguments[2]||{});
var _16=_15.height||Element.getDimensions(_14)[1]||_14.offsetHeight;
var top=_15.top||Position.positionedOffset(_13)[1];
_15.openEffect=new Rico.Effect.SizeFromTop(_13,_14,top,_16,{baseHeight:_16});
_15.closeEffect=new Rico.Effect.SizeFromTop(_13,_14,top,1,{baseHeight:_16});
_13.style.height="0px";
_14.style.top=-_16+"px";
return new Rico.SlidingPanel(_13,_15);
};
Rico.SlidingPanel.bottom=function(_18){
var _19=Object.extend({disabler:Rico.Controls.blankDisabler},arguments[1]||{});
var _1a=_19.height||Element.getDimensions(_18).height;
var top=Position.positionedOffset(_18)[1];
_19.openEffect=new Rico.Effect.SizeFromBottom(_18,top-_1a,_1a);
_19.closeEffect=new Rico.Effect.SizeFromBottom(_18,top,1);
return new Rico.SlidingPanel(_18,_19);
};
Rico.includeLoaded("ricoComponents.js");

Rico.DragAndDrop=Class.create();
Rico.DragAndDrop.prototype={initialize:function(_1){
this.dropZones=new Array();
this.draggables=new Array();
this.currentDragObjects=new Array();
this.dragElement=null;
this.lastSelectedDraggable=null;
this.currentDragObjectVisible=false;
this.interestedInMotionEvents=false;
this._mouseDown=this._mouseDownHandler.bindAsEventListener(this);
this._mouseMove=this._mouseMoveHandler.bindAsEventListener(this);
this._mouseUp=this._mouseUpHandler.bindAsEventListener(this);
this.mapDiv=_1;
},registerDropZone:function(_2){
this.dropZones[this.dropZones.length]=_2;
},deregisterDropZone:function(_3){
var _4=new Array();
var j=0;
for(var i=0;i<this.dropZones.length;i++){
if(this.dropZones[i]!=_3){
_4[j++]=this.dropZones[i];
}
}
this.dropZones=_4;
},clearDropZones:function(){
this.dropZones=new Array();
},registerDraggable:function(_7){
this.draggables[this.draggables.length]=_7;
this._addMouseDownHandler(_7);
},clearSelection:function(){
for(var i=0;i<this.currentDragObjects.length;i++){
this.currentDragObjects[i].deselect();
}
this.currentDragObjects=new Array();
this.lastSelectedDraggable=null;
},hasSelection:function(){
return this.currentDragObjects.length>0;
},setStartDragFromElement:function(e,_a){
this.origPos=RicoUtil.toDocumentPosition(_a);
this.startx=e.screenX-this.origPos.x;
this.starty=e.screenY-this.origPos.y;
var _b=Roja.Util.findPosX(this.mapDiv);
var _c=Roja.Util.findPosY(this.mapDiv);
this.startx+=_b;
this.starty+=_c;
this.interestedInMotionEvents=this.hasSelection();
this._terminateEvent(e);
},updateSelection:function(_d,_e){
if(!_e){
this.clearSelection();
}
if(_d.isSelected()){
this.currentDragObjects.removeItem(_d);
_d.deselect();
if(_d==this.lastSelectedDraggable){
this.lastSelectedDraggable=null;
}
}else{
this.currentDragObjects[this.currentDragObjects.length]=_d;
_d.select();
this.lastSelectedDraggable=_d;
}
},_mouseDownHandler:function(e){
if(arguments.length==0){
e=event;
}
var _10=e.which!=undefined;
if((_10&&e.which!=1)||(!_10&&e.button!=1)){
return;
}
var _11=e.target?e.target:e.srcElement;
var _12=_11.draggable;
var _13=_11;
while(_12==null&&_13.parentNode){
_13=_13.parentNode;
_12=_13.draggable;
}
if(_12==null){
return;
}
this.updateSelection(_12,e.ctrlKey);
if(this.hasSelection()){
for(var i=0;i<this.dropZones.length;i++){
this.dropZones[i].clearPositionCache();
}
}
this.setStartDragFromElement(e,_12.getMouseDownHTMLElement());
},_mouseMoveHandler:function(e){
var _16=e.which!=undefined;
if(!this.interestedInMotionEvents){
return;
}
if(!this.hasSelection()){
return;
}
if(!this.currentDragObjectVisible){
this._startDrag(e);
}
if(!this.activatedDropZones){
this._activateRegisteredDropZones();
}
this._updateDraggableLocation(e);
this._updateDropZonesHover(e);
this._terminateEvent(e);
},_makeDraggableObjectVisible:function(e){
if(!this.hasSelection()){
return;
}
var _18;
if(this.currentDragObjects.length>1){
_18=this.currentDragObjects[0].getMultiObjectDragGUI(this.currentDragObjects);
}else{
_18=this.currentDragObjects[0].getSingleObjectDragGUI();
}
if(RicoUtil.getElementsComputedStyle(_18,"position")!="absolute"){
_18.style.position="absolute";
}
if(_18.parentNode==null||_18.parentNode.nodeType==11){
document.body.appendChild(_18);
}
this.dragElement=_18;
this._updateDraggableLocation(e);
this.currentDragObjectVisible=true;
},_leftOffset:function(e){
return e.offsetX?document.body.scrollLeft:0;
},_topOffset:function(e){
return e.offsetY?document.body.scrollTop:0;
},_updateDraggableLocation:function(e){
var _1c=this.dragElement.style;
_1c.left=(e.screenX+this._leftOffset(e)-this.startx)+"px";
_1c.top=(e.screenY+this._topOffset(e)-this.starty)+"px";
},_updateDropZonesHover:function(e){
var n=this.dropZones.length;
for(var i=0;i<n;i++){
if(!this._mousePointInDropZone(e,this.dropZones[i])){
this.dropZones[i].hideHover();
}
}
for(var i=0;i<n;i++){
if(this._mousePointInDropZone(e,this.dropZones[i])){
if(this.dropZones[i].canAccept(this.currentDragObjects)){
this.dropZones[i].showHover();
}
}
}
},_startDrag:function(e){
for(var i=0;i<this.currentDragObjects.length;i++){
this.currentDragObjects[i].startDrag();
}
this._makeDraggableObjectVisible(e);
},_mouseUpHandler:function(e){
if(!this.hasSelection()){
return;
}
var _23=e.which!=undefined;
if((_23&&e.which!=1)||(!_23&&e.button!=1)){
return;
}
this.interestedInMotionEvents=false;
if(this.dragElement==null){
this._terminateEvent(e);
return;
}
if(this._placeDraggableInDropZone(e)){
this._completeDropOperation(e);
}else{
this._terminateEvent(e);
}
Event.stopObserving(document.body,"mousemove",this._mouseMove);
Event.stopObserving(document.body,"mouseup",this._mouseUp);
},_retTrue:function(){
return true;
},_completeDropOperation:function(e){
if(this.dragElement!=this.currentDragObjects[0].getMouseDownHTMLElement()){
if(this.dragElement.parentNode!=null){
this.dragElement.parentNode.removeChild(this.dragElement);
}
}
this._deactivateRegisteredDropZones();
this._endDrag();
this.clearSelection();
this.dragElement=null;
this.currentDragObjectVisible=false;
this._terminateEvent(e);
},_doCancelDragProcessing:function(){
this._cancelDrag();
if(this.dragElement!=this.currentDragObjects[0].getMouseDownHTMLElement()&&this.dragElement){
if(this.dragElement.parentNode!=null){
this.dragElement.parentNode.removeChild(this.dragElement);
}
}
this._deactivateRegisteredDropZones();
this.dragElement=null;
this.currentDragObjectVisible=false;
},_placeDraggableInDropZone:function(e){
var _26=false;
var n=this.dropZones.length;
for(var i=0;i<n;i++){
if(this._mousePointInDropZone(e,this.dropZones[i])){
if(this.dropZones[i].canAccept(this.currentDragObjects)){
this.dropZones[i].hideHover();
this.dropZones[i].accept(this.currentDragObjects);
_26=true;
break;
}
}
}
return _26;
},_cancelDrag:function(){
for(var i=0;i<this.currentDragObjects.length;i++){
this.currentDragObjects[i].cancelDrag();
}
},_endDrag:function(){
for(var i=0;i<this.currentDragObjects.length;i++){
this.currentDragObjects[i].endDrag();
}
},_mousePointInDropZone:function(e,_2c){
var _2d=_2c.getAbsoluteRect();
return e.clientX>_2d.left+this._leftOffset(e)&&e.clientX<_2d.right+this._leftOffset(e)&&e.clientY>_2d.top+this._topOffset(e)&&e.clientY<_2d.bottom+this._topOffset(e);
},_addMouseDownHandler:function(_2e){
htmlElement=_2e.getMouseDownHTMLElement();
if(htmlElement!=null){
htmlElement.draggable=_2e;
Event.observe(htmlElement,"mousedown",this._onmousedown.bindAsEventListener(this));
Event.observe(htmlElement,"mousedown",this._mouseDown);
}
},_activateRegisteredDropZones:function(){
var n=this.dropZones.length;
for(var i=0;i<n;i++){
var _31=this.dropZones[i];
if(_31.canAccept(this.currentDragObjects)){
_31.activate();
}
}
this.activatedDropZones=true;
},_deactivateRegisteredDropZones:function(){
var n=this.dropZones.length;
for(var i=0;i<n;i++){
this.dropZones[i].deactivate();
}
this.activatedDropZones=false;
},_onmousedown:function(){
Event.observe(document.body,"mousemove",this._mouseMove);
Event.observe(document.body,"mouseup",this._mouseUp);
},_terminateEvent:function(e){
if(e.stopPropagation!=undefined){
e.stopPropagation();
}else{
if(e.cancelBubble!=undefined){
e.cancelBubble=true;
}
}
if(e.preventDefault!=undefined){
e.preventDefault();
}else{
e.returnValue=false;
}
},initializeEventHandlers:function(){
if(typeof document.implementation!="undefined"&&document.implementation.hasFeature("HTML","1.0")&&document.implementation.hasFeature("Events","2.0")&&document.implementation.hasFeature("CSS","2.0")){
document.addEventListener("mouseup",this._mouseUpHandler.bindAsEventListener(this),false);
document.addEventListener("mousemove",this._mouseMoveHandler.bindAsEventListener(this),false);
}else{
document.attachEvent("onmouseup",this._mouseUpHandler.bindAsEventListener(this));
document.attachEvent("onmousemove",this._mouseMoveHandler.bindAsEventListener(this));
}
}};
var dndMgr=new Rico.DragAndDrop();
dndMgr.initializeEventHandlers();
Rico.Draggable=Class.create();
Rico.Draggable.prototype={initialize:function(_35,_36){
this.type=_35;
this.htmlElement=$(_36);
this.selected=false;
},getMouseDownHTMLElement:function(){
return this.htmlElement;
},select:function(){
this.selected=true;
if(this.showingSelected){
return;
}
var _37=this.getMouseDownHTMLElement();
var _38=Rico.Color.createColorFromBackground(_37);
_38.isBright()?_38.darken(0.033):_38.brighten(0.033);
this.saveBackground=RicoUtil.getElementsComputedStyle(_37,"backgroundColor","background-color");
_37.style.backgroundColor=_38.asHex();
this.showingSelected=true;
},deselect:function(){
this.selected=false;
if(!this.showingSelected){
return;
}
var _39=this.getMouseDownHTMLElement();
_39.style.backgroundColor=this.saveBackground;
this.showingSelected=false;
},isSelected:function(){
return this.selected;
},startDrag:function(){
},cancelDrag:function(){
},endDrag:function(){
},getSingleObjectDragGUI:function(){
return this.htmlElement;
},getMultiObjectDragGUI:function(_3a){
return this.htmlElement;
},getDroppedGUI:function(){
return this.htmlElement;
},toString:function(){
return this.type+":"+this.htmlElement+":";
}};
Rico.Dropzone=Class.create();
Rico.Dropzone.prototype={initialize:function(_3b){
this.htmlElement=$(_3b);
this.absoluteRect=null;
},getHTMLElement:function(){
return this.htmlElement;
},clearPositionCache:function(){
this.absoluteRect=null;
},getAbsoluteRect:function(){
if(this.absoluteRect==null){
var _3c=this.getHTMLElement();
var pos=RicoUtil.toViewportPosition(_3c);
this.absoluteRect={top:pos.y,left:pos.x,bottom:pos.y+_3c.offsetHeight,right:pos.x+_3c.offsetWidth};
}
return this.absoluteRect;
},activate:function(){
var _3e=this.getHTMLElement();
if(_3e==null||this.showingActive){
return;
}
this.showingActive=true;
this.saveBackgroundColor=_3e.style.backgroundColor;
var _3f="#ffea84";
var _40=Rico.Color.createColorFromBackground(_3e);
if(_40==null){
_3e.style.backgroundColor=_3f;
}else{
_40.isBright()?_40.darken(0.2):_40.brighten(0.2);
_3e.style.backgroundColor=_40.asHex();
}
},deactivate:function(){
var _41=this.getHTMLElement();
if(_41==null||!this.showingActive){
return;
}
_41.style.backgroundColor=this.saveBackgroundColor;
this.showingActive=false;
this.saveBackgroundColor=null;
},showHover:function(){
var _42=this.getHTMLElement();
if(_42==null||this.showingHover){
return;
}
this.saveBorderWidth=_42.style.borderWidth;
this.saveBorderStyle=_42.style.borderStyle;
this.saveBorderColor=_42.style.borderColor;
this.showingHover=true;
_42.style.borderWidth="1px";
_42.style.borderStyle="solid";
_42.style.borderColor="#ffff00";
},hideHover:function(){
var _43=this.getHTMLElement();
if(_43==null||!this.showingHover){
return;
}
_43.style.borderWidth=this.saveBorderWidth;
_43.style.borderStyle=this.saveBorderStyle;
_43.style.borderColor=this.saveBorderColor;
this.showingHover=false;
},canAccept:function(_44){
return true;
},accept:function(_45){
var _46=this.getHTMLElement();
if(_46==null){
return;
}
n=_45.length;
for(var i=0;i<n;i++){
var _48=_45[i].getDroppedGUI();
if(RicoUtil.getElementsComputedStyle(_48,"position")=="absolute"){
_48.style.position="static";
_48.style.top="";
_48.style.top="";
}
_46.appendChild(_48);
}
}};
RicoUtil=Object.extend(RicoUtil,{getElementsComputedStyle:function(_49,_4a,_4b){
if(arguments.length==2){
_4b=_4a;
}
var el=$(_49);
if(el.currentStyle){
return el.currentStyle[_4a];
}else{
return document.defaultView.getComputedStyle(el,null).getPropertyValue(_4b);
}
},createXmlDocument:function(){
if(document.implementation&&document.implementation.createDocument){
var doc=document.implementation.createDocument("","",null);
if(doc.readyState==null){
doc.readyState=1;
doc.addEventListener("load",function(){
doc.readyState=4;
if(typeof doc.onreadystatechange=="function"){
doc.onreadystatechange();
}
},false);
}
return doc;
}
if(window.ActiveXObject){
return Try.these(function(){
return new ActiveXObject("MSXML2.DomDocument");
},function(){
return new ActiveXObject("Microsoft.DomDocument");
},function(){
return new ActiveXObject("MSXML.DomDocument");
},function(){
return new ActiveXObject("MSXML3.DomDocument");
})||false;
}
return null;
},getContentAsString:function(_4e){
return _4e.xml!=undefined?this._getContentAsStringIE(_4e):this._getContentAsStringMozilla(_4e);
},_getContentAsStringIE:function(_4f){
var _50="";
for(var i=0;i<_4f.childNodes.length;i++){
var n=_4f.childNodes[i];
if(n.nodeType==4){
_50+=n.nodeValue;
}else{
_50+=n.xml;
}
}
return _50;
},_getContentAsStringMozilla:function(_53){
var _54=new XMLSerializer();
var _55="";
for(var i=0;i<_53.childNodes.length;i++){
var n=_53.childNodes[i];
if(n.nodeType==4){
_55+=n.nodeValue;
}else{
_55+=_54.serializeToString(n);
}
}
return _55;
},toViewportPosition:function(_58){
return this._toAbsolute(_58,true);
},toDocumentPosition:function(_59){
return this._toAbsolute(_59,false);
},_toAbsolute:function(_5a,_5b){
if(navigator.userAgent.toLowerCase().indexOf("msie")==-1){
return this._toAbsoluteMozilla(_5a,_5b);
}
var x=0;
var y=0;
var _5e=_5a;
while(_5e){
var _5f=0;
var _60=0;
if(_5e!=_5a){
var _5f=parseInt(this.getElementsComputedStyle(_5e,"borderLeftWidth"));
var _60=parseInt(this.getElementsComputedStyle(_5e,"borderTopWidth"));
_5f=isNaN(_5f)?0:_5f;
_60=isNaN(_60)?0:_60;
}
x+=_5e.offsetLeft-_5e.scrollLeft+_5f;
y+=_5e.offsetTop-_5e.scrollTop+_60;
_5e=_5e.offsetParent;
}
if(_5b){
x-=this.docScrollLeft();
y-=this.docScrollTop();
}
return {x:x,y:y};
},_toAbsoluteMozilla:function(_61,_62){
var x=0;
var y=0;
var _65=_61;
while(_65){
x+=_65.offsetLeft;
y+=_65.offsetTop;
_65=_65.offsetParent;
}
_65=_61;
while(_65&&_65!=document.body&&_65!=document.documentElement){
if(_65.scrollLeft){
x-=_65.scrollLeft;
}
if(_65.scrollTop){
y-=_65.scrollTop;
}
_65=_65.parentNode;
}
if(_62){
x-=this.docScrollLeft();
y-=this.docScrollTop();
}
return {x:x,y:y};
},docScrollLeft:function(){
if(window.pageXOffset){
return window.pageXOffset;
}else{
if(document.documentElement&&document.documentElement.scrollLeft){
return document.documentElement.scrollLeft;
}else{
if(document.body){
return document.body.scrollLeft;
}else{
return 0;
}
}
}
},docScrollTop:function(){
if(window.pageYOffset){
return window.pageYOffset;
}else{
if(document.documentElement&&document.documentElement.scrollTop){
return document.documentElement.scrollTop;
}else{
if(document.body){
return document.body.scrollTop;
}else{
return 0;
}
}
}
}});
Rico.includeLoaded("ricoDragDrop.js");

Rico.Color=Class.create();
Rico.Color.prototype={initialize:function(_1,_2,_3){
this.rgb={r:_1,g:_2,b:_3};
},setRed:function(r){
this.rgb.r=r;
},setGreen:function(g){
this.rgb.g=g;
},setBlue:function(b){
this.rgb.b=b;
},setHue:function(h){
var _8=this.asHSB();
_8.h=h;
this.rgb=Rico.Color.HSBtoRGB(_8.h,_8.s,_8.b);
},setSaturation:function(s){
var _a=this.asHSB();
_a.s=s;
this.rgb=Rico.Color.HSBtoRGB(_a.h,_a.s,_a.b);
},setBrightness:function(b){
var _c=this.asHSB();
_c.b=b;
this.rgb=Rico.Color.HSBtoRGB(_c.h,_c.s,_c.b);
},darken:function(_d){
var _e=this.asHSB();
this.rgb=Rico.Color.HSBtoRGB(_e.h,_e.s,Math.max(_e.b-_d,0));
},brighten:function(_f){
var hsb=this.asHSB();
this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,Math.min(hsb.b+_f,1));
},blend:function(_11){
this.rgb.r=Math.floor((this.rgb.r+_11.rgb.r)/2);
this.rgb.g=Math.floor((this.rgb.g+_11.rgb.g)/2);
this.rgb.b=Math.floor((this.rgb.b+_11.rgb.b)/2);
},isBright:function(){
var hsb=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 Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b);
},toString:function(){
return this.asHex();
}};
Rico.Color.createFromHex=function(_13){
if(_13.length==4){
var _14=_13;
var _13="#";
for(var i=1;i<4;i++){
_13+=(_14.charAt(i)+_14.charAt(i));
}
}
if(_13.indexOf("#")==0){
_13=_13.substring(1);
}
var red=_13.substring(0,2);
var _17=_13.substring(2,4);
var _18=_13.substring(4,6);
return new Rico.Color(parseInt(red,16),parseInt(_17,16),parseInt(_18,16));
};
Rico.Color.createColorFromBackground=function(_19){
var _1a=Element.getStyle(_19,"background-color");
if(_1a.match(/^(transparent|rgba\(0,\s*0,\s*0,\s*0\))$/i)&&_19.parentNode){
return Rico.Color.createColorFromBackground(_19.parentNode);
}
if(_1a==null){
return new Rico.Color(255,255,255);
}
if(_1a.indexOf("rgb(")==0){
var _1b=_1a.substring(4,_1a.length-1);
var _1c=_1b.split(",");
return new Rico.Color(parseInt(_1c[0]),parseInt(_1c[1]),parseInt(_1c[2]));
}else{
if(_1a.indexOf("#")==0){
return Rico.Color.createFromHex(_1a);
}else{
return new Rico.Color(255,255,255);
}
}
};
Rico.Color.HSBtoRGB=function(hue,_1e,_1f){
var red=0;
var _21=0;
var _22=0;
if(_1e==0){
red=parseInt(_1f*255+0.5);
_21=red;
_22=red;
}else{
var h=(hue-Math.floor(hue))*6;
var f=h-Math.floor(h);
var p=_1f*(1-_1e);
var q=_1f*(1-_1e*f);
var t=_1f*(1-(_1e*(1-f)));
switch(parseInt(h)){
case 0:
red=(_1f*255+0.5);
_21=(t*255+0.5);
_22=(p*255+0.5);
break;
case 1:
red=(q*255+0.5);
_21=(_1f*255+0.5);
_22=(p*255+0.5);
break;
case 2:
red=(p*255+0.5);
_21=(_1f*255+0.5);
_22=(t*255+0.5);
break;
case 3:
red=(p*255+0.5);
_21=(q*255+0.5);
_22=(_1f*255+0.5);
break;
case 4:
red=(t*255+0.5);
_21=(p*255+0.5);
_22=(_1f*255+0.5);
break;
case 5:
red=(_1f*255+0.5);
_21=(p*255+0.5);
_22=(q*255+0.5);
break;
}
}
return {r:parseInt(red),g:parseInt(_21),b:parseInt(_22)};
};
Rico.Color.RGBtoHSB=function(r,g,b){
var hue;
var _2c;
var _2d;
var _2e=(r>g)?r:g;
if(b>_2e){
_2e=b;
}
var _2f=(r<g)?r:g;
if(b<_2f){
_2f=b;
}
_2d=_2e/255;
if(_2e!=0){
_2c=(_2e-_2f)/_2e;
}else{
_2c=0;
}
if(_2c==0){
hue=0;
}else{
var _30=(_2e-r)/(_2e-_2f);
var _31=(_2e-g)/(_2e-_2f);
var _32=(_2e-b)/(_2e-_2f);
if(r==_2e){
hue=_32-_31;
}else{
if(g==_2e){
hue=2+_30-_32;
}else{
hue=4+_31-_30;
}
}
hue=hue/6;
if(hue<0){
hue=hue+1;
}
}
return {h:hue,s:_2c,b:_2d};
};
Rico.Corner={round:function(e,_34){
var e=$(e);
this._setOptions(_34);
var _35=this.options.color=="fromElement"?this._background(e):this.options.color;
var _36=this.options.bgColor=="fromParent"?this._background(e.parentNode):this.options.bgColor;
this._roundCornersImpl(e,_35,_36);
},_roundCornersImpl:function(e,_38,_39){
if(this.options.border){
this._renderBorder(e,_39);
}
if(this._isTopRounded()){
this._roundTopCorners(e,_38,_39);
}
if(this._isBottomRounded()){
this._roundBottomCorners(e,_38,_39);
}
},_renderBorder:function(el,_3b){
var _3c="1px solid "+this._borderColor(_3b);
var _3d="border-left: "+_3c;
var _3e="border-right: "+_3c;
var _3f="style='"+_3d+";"+_3e+"'";
el.innerHTML="<div "+_3f+">"+el.innerHTML+"</div>";
},_roundTopCorners:function(el,_41,_42){
var _43=this._createCorner(_42);
for(var i=0;i<this.options.numSlices;i++){
_43.appendChild(this._createCornerSlice(_41,_42,i,"top"));
}
el.style.paddingTop="0px";
el.insertBefore(_43,el.firstChild);
},_roundBottomCorners:function(el,_46,_47){
var _48=this._createCorner(_47);
for(var i=(this.options.numSlices-1);i>=0;i--){
_48.appendChild(this._createCornerSlice(_46,_47,i,"bottom"));
}
el.style.paddingBottom=0;
el.appendChild(_48);
},_createCorner:function(_4a){
var _4b=document.createElement("div");
_4b.style.backgroundColor=(this._isTransparent()?"transparent":_4a);
return _4b;
},_createCornerSlice:function(_4c,_4d,n,_4f){
var _50=document.createElement("span");
var _51=_50.style;
_51.backgroundColor=_4c;
_51.display="block";
_51.height="1px";
_51.overflow="hidden";
_51.fontSize="1px";
var _52=this._borderColor(_4c,_4d);
if(this.options.border&&n==0){
_51.borderTopStyle="solid";
_51.borderTopWidth="1px";
_51.borderLeftWidth="0px";
_51.borderRightWidth="0px";
_51.borderBottomWidth="0px";
_51.height="0px";
_51.borderColor=_52;
}else{
if(_52){
_51.borderColor=_52;
_51.borderStyle="solid";
_51.borderWidth="0px 1px";
}
}
if(!this.options.compact&&(n==(this.options.numSlices-1))){
_51.height="2px";
}
this._setMargin(_50,n,_4f);
this._setBorder(_50,n,_4f);
return _50;
},_setOptions:function(_53){
this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false};
Object.extend(this.options,_53||{});
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(_54,_55){
if(_54=="transparent"){
return _55;
}else{
if(this.options.border){
return this.options.border;
}else{
if(this.options.blend){
return this._blend(_55,_54);
}else{
return "";
}
}
}
},_setMargin:function(el,n,_58){
var _59=this._marginSize(n);
var _5a=_58=="top"?this._whichSideTop():this._whichSideBottom();
if(_5a=="left"){
el.style.marginLeft=_59+"px";
el.style.marginRight="0px";
}else{
if(_5a=="right"){
el.style.marginRight=_59+"px";
el.style.marginLeft="0px";
}else{
el.style.marginLeft=_59+"px";
el.style.marginRight=_59+"px";
}
}
},_setBorder:function(el,n,_5d){
var _5e=this._borderSize(n);
var _5f=_5d=="top"?this._whichSideTop():this._whichSideBottom();
if(_5f=="left"){
el.style.borderLeftWidth=_5e+"px";
el.style.borderRightWidth="0px";
}else{
if(_5f=="right"){
el.style.borderRightWidth=_5e+"px";
el.style.borderLeftWidth="0px";
}else{
el.style.borderLeftWidth=_5e+"px";
el.style.borderRightWidth=_5e+"px";
}
}
if(this.options.border!=false){
el.style.borderLeftWidth=_5e+"px";
}
el.style.borderRightWidth=_5e+"px";
},_marginSize:function(n){
if(this._isTransparent()){
return 0;
}
var _61=[5,3,2,1];
var _62=[3,2,1,0];
var _63=[2,1];
var _64=[1,0];
if(this.options.compact&&this.options.blend){
return _64[n];
}else{
if(this.options.compact){
return _63[n];
}else{
if(this.options.blend){
return _62[n];
}else{
return _61[n];
}
}
}
},_borderSize:function(n){
var _66=[5,3,2,1];
var _67=[2,1,1,1];
var _68=[1,0];
var _69=[0,2,0,0];
if(this.options.compact&&(this.options.blend||this._isTransparent())){
return 1;
}else{
if(this.options.compact){
return _68[n];
}else{
if(this.options.blend){
return _67[n];
}else{
if(this.options.border){
return _69[n];
}else{
if(this._isTransparent()){
return _66[n];
}
}
}
}
}
return 0;
},_hasString:function(str){
for(var i=1;i<arguments.length;i++){
if(str.indexOf(arguments[i])>=0){
return true;
}
}
return false;
},_blend:function(c1,c2){
var cc1=Rico.Color.createFromHex(c1);
cc1.blend(Rico.Color.createFromHex(c2));
return cc1;
},_background:function(el){
try{
return Rico.Color.createColorFromBackground(el).asHex();
}
catch(err){
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(el){
return el.childNodes.length==1&&el.childNodes[0].nodeType==3;
}};
Rico.includeLoaded("ricoStyles.js");

Roja.transformXml=function(_1,_2){
var _3;
if(navigator.appVersion.indexOf("MSIE")!=-1){
_3=this.transformIE(_1,_2);
}else{
_3=this.transformMOZ(_1,_2);
}
return _3;
};
Roja.transformIE=function(_4,_5){
var _6=_4;
if(!(_6.firstChild)){
_6=new ActiveXObject("Microsoft.XMLDOM");
_6.async=false;
_6.loadXML(_4);
}
var _7=_6.transformNode(_5);
return _7;
};
Roja.transformMOZ=function(_8,_9){
var _a=new XSLTProcessor();
_a.importStylesheet(_9);
var _b=document.implementation.createDocument("","",null);
var _c=_8;
if(!(_c instanceof Document)){
_c=_b.loadXML(_8);
}
var _d=_a.transformToDocument(_c);
var _e=new XMLSerializer();
var _f=_e.serializeToString(_d);
return _f;
};
if(navigator.userAgent.indexOf("Gecko")!=-1){
Document.prototype.loadXML=function(str){
var _11=new DOMParser();
var _12=_11.parseFromString(str,"text/xml");
return _12;
};
}

Roja.ArcXML=OpenLayers.Class({});

Roja.Control=OpenLayers.Class(OpenLayers.Control,{over:null,title:null});

NONE=0;
ROUTES_LOADED=1;
UNKNOWN_ADDRESS=11;
MULTI_ADDRESS=12;
SERVER_ERROR=13;
RESPONSE_ERROR=14;
Roja.Directions=OpenLayers.Class({id:null,map:null,routepanel:null,div:null,displayClass:"",routingUrl:null,routingPars:"serviceName=ControllerServlet&xmlRequest=",xslPath:"../resources/xsl/buildRoutingResponse.xsl",xsl:null,errorRoutingMessage:"error on route service",errorXSLLoadingMessage:"file xsl not loaded",routeStyle:null,numGeocodes:null,geocodes:null,totaltime:null,totaldistance:null,routeinstructions:null,routepreference:null,routegeometry:null,gmlns:"http://www.opengis.net/gml",xls:"http://www.opengis.net/xls",vectorLayer:null,markersLayer:null,events:null,loading:null,EVENT_TYPES:["loadComplete","loadFailure","drawComplete","drawFailure"],fallThrough:false,status_code:null,iconStart:"routing/start_shadow.png",iconVia1:"routing/via_shadow.png",iconVia2:"routing/via_shadow.png",iconStop:"routing/stop_shadow.png",iconPath:"routing/start_shadow.png",iconSize:new OpenLayers.Size(68,48),restrictedAreaSize:null,iconNumberPath:"routing/numeretti/tondi/",iconNumberSize:new OpenLayers.Size(20,20),iconNumberPosition:"center",tollerance:0,onlyOneMarkerBalloon:false,initialize:function(_1){
this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(".","");
OpenLayers.Util.extend(this,_1);
this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
this.geocodes=new Array();
var _1={displayInLayerSwitcher:false};
this.vectorLayer=new OpenLayers.Layer.Vector("Route",_1);
this.markersLayer=new Roja.Layer.Markers("GeocodedAddresses",_1);
this.events=new OpenLayers.Events(this,this,this.EVENT_TYPES,this.fallThrough);
this.events.register("loadComplete",this,this.stopLoading);
this.events.register("loadFailure",this,this.stopLoading);
this.loading=new Roja.Control.LoadingMessage();
if((this.map!=null)&&(this.loading!=null)){
this.map.addControl(this.loading);
}
var _2=this.successXsl.bind(this);
var _3=this.failureXsl.bind(this);
new OpenLayers.Ajax.Request(this.xslPath,{method:"get",parameters:null,onComplete:_2,onFailure:_3});
},display:function(_4){
if(this.vectorLayer!=null&&this.markersLayer!=null){
this.vectorLayer.setVisibility(_4);
this.markersLayer.setVisibility(_4);
}
},stopLoading:function(){
if(this.map!=null&&this.loading!=null){
this.loading.stopLoad();
}
},destroy:function(){
if(this.map!=null){
if(this.vectorLayer!=null){
this.map.removeLayer(this.vectorLayer,true);
this.vectorLayer=null;
}
if(this.markersLayer!=null){
this.map.removeLayer(this.markersLayer,true);
this.markersLayer=null;
}
}
this.map=null;
this.div=null;
this.xsl=null;
this.geocodes=null;
this.totaltime=null;
this.totaldistance=null;
this.routeinstructions=null;
this.routegeometry=null;
if(this.events){
this.events.destroy();
}
this.events=null;
},load:function(_5){
this.loading.startLoad();
var _6="";
var _7="";
var _8;
var _9=arguments[0];
var _a;
switch(arguments.length){
case 3:
_a=arguments[1];
_8=arguments[2];
break;
case 4:
_6=arguments[1];
_a=arguments[2];
_8=arguments[3];
break;
case 5:
_6=arguments[1];
_7=arguments[2];
_a=arguments[3];
_8=arguments[4];
break;
default:
return;
}
if(this.map.getLayer(this.vectorLayer.id)==null){
this.map.addLayer(this.vectorLayer);
this.vectorLayer.map.events.register("mouseout",this.vectorLayer,this.vectorLayer.redraw);
}
if(this.map.getLayer(this.markersLayer.id)==null){
this.map.addLayer(this.markersLayer);
}
var _b=this.successRoute.bind(this);
var _c=this.failureRoute.bind(this);
var _d=this.createRoutingRequest(_8,_9,_6,_7,_a,"","","","3003");
this.routepreference=_8;
var _e=this.routingPars+_d;
this.status_code=NONE;
var _f=this.routingUrl;
if(Roja.Proxy&&this.routingUrl.startsWith("http")){
_f=Roja.Proxy+Roja.Util.escapeUri(this.routingUrl);
}
new OpenLayers.Ajax.Request(_f+_e,{method:"get",parameters:null,onComplete:_b,onFailure:_c});
},successXsl:function(_10){
this.xsl=_10.responseXML;
},failureXsl:function(_11){
alert(this.errorXSLLoadingMessage);
},setRoutePanel:function(_12){
this.routepanel=_12;
},successRoute:function(_13){
var _14=_13.responseXML;
if(!_14||_13.fileType!="XML"){
_14=OpenLayers.parseXMLString(_13.responseText);
}
if(this.map!=null){
this.drawOnMap(_14);
}
var xml=_13.responseText;
var _16=Roja.transformXml(xml,this.xsl);
_16=_16.replace(/&lt;/g,"<");
_16=_16.replace(/&gt;/g,">");
if(this.routepanel!=null){
document.getElementById(this.routepanel).innerHTML=_16;
}
this.loadData(_14);
},loadData:function(_17){
this.status_code=NONE;
this.loadGeocodes(_17);
if(this.status_code==NONE){
this.loadRoutes(_17);
this.loadInstructionPoints();
this.loadTotalTime(_17);
this.loadTotalDistance(_17);
}
OpenLayers.Console.debug(this.status_code);
if(this.status_code>10){
this.events.triggerEvent("loadFailure");
}else{
this.events.triggerEvent("loadComplete");
}
},getStatusCode:function(){
return this.status_code;
},failureRoute:function(_18){
alert(this.errorRoutingMessage);
this.status_code=SERVER_ERROR;
},geocodedMarkersClear:function(){
if(this.markersLayer.markers!=null){
while(this.markersLayer.markers.length>0){
var _19=this.markersLayer.markers[0];
this.markersLayer.removeMarker(_19);
_19.destroy();
}
}
},loadGeocodes:function(_1a){
this.geocodes=new Array();
if(_1a.getElementsByTagName("RouteGeometry").length>0){
this.geocodedMarkersClear();
var _1b=_1a.getElementsByTagName("GeocodeResponseList");
if(_1b==null||_1b.length==0){
_1b=_1a.getElementsByTagName("WayPointEncodeResponseList");
}
this.numGeocodes=_1b.length;
var i;
for(i=0;i<_1b.length;i++){
var _1d=null;
if(_1b[i]!=null&&_1b[i].getElementsByTagName("EncodedWayPoint")!=null&&_1b[i].getElementsByTagName("EncodedWayPoint").length>0){
_1d=_1b[i].getElementsByTagName("EncodedWayPoint")[0];
}else{
_1d=_1b[i];
}
var _1e=OpenLayers.Ajax.getElementsByTagNameNS(_1d,this.gmlns,"gml","pos");
if(_1e.length==0){
_1e=_1d.getElementsByTagName("pos");
}
var pos=_1e[0].firstChild.nodeValue;
var x=pos.substring(0,pos.indexOf(" "));
var y=pos.substring(pos.indexOf(" "));
x=parseFloat(x);
y=parseFloat(y);
var _22=null;
if(i==0){
_22=OpenLayers.ImgPath+this.iconStart;
}else{
if(i==_1b.length-1){
_22=OpenLayers.ImgPath+this.iconStop;
}else{
if(i==1){
_22=OpenLayers.ImgPath+this.iconVia1;
}else{
if(i==2){
_22=OpenLayers.ImgPath+this.iconVia2;
}
}
}
}
var _23={lonlat:new OpenLayers.LonLat(x,y),iconUrl:_22,iconSize:this.iconSize,popupsize:new OpenLayers.Size(160,80),restrictedAreaSize:this.restrictedAreaSize,title:"Indirizzo"};
var _24=null;
if(_1d.getElementsByTagName("POI")!=null&&_1d.getElementsByTagName("POI").length>0){
_24=new Roja.Marker.POI(_1d,_23);
}else{
_24=new Roja.Marker.GeocodedAddress(_1d,_23);
}
if(this.map!=null){
this.markersLayer.addMarker(_24);
var _25="<font style=\"font-family:Verdana;font-size:9px;color:black;\">"+_24.title+"</font><br/><font"+" style=\"font-family:Verdana;font-size:9px;color:black;font-weight:bold;\">"+_24.description+"</font>";
_24.createPopup(_25,false);
if(this.onlyOneMarkerBalloon){
var _26={markersLayer:this.markersLayer,numGeocodes:this.numGeocodes,onlyOneMarkerBalloon:this.onlyOneMarkerBalloon};
_24.events.register("mousedown",_24,this.resetPopups.bindAsEventListener(_26));
}
}
this.geocodes.push(_24);
}
}else{
var _27=_1a.getElementsByTagName("GeocodeResponse")[0];
if(_27==null){
return;
}
var _28=_27.getElementsByTagName("freeFormAddress");
if(_28.length>0){
this.status_code=UNKNOWN_ADDRESS;
}else{
var _29=_27.getElementsByTagName("GeocodeResponseList");
var i;
for(i=0;i<_29.length;i++){
var _27=_29[i];
var _2a=_27.getAttribute("numberOfGeocodedAddresses");
if(_2a>1){
this.status_code=MULTI_ADDRESS;
i=_29.length;
}
}
}
}
},loadInstructionPoints:function(){
var _2b=this.routeinstructions.getInstructions();
var _2c=0;
for(i=0;i<_2b.length;i++){
var _2d=_2b[i];
for(j=0;j<_2d.length;j++){
_2c++;
var _2e=_2d[j];
var _2f=null;
var _30=_2e.getGeometry();
if(_30!=null&&_30.geometrypointlist.length>0){
var _31=_30.geometrypointlist[0];
if(_2c<10){
_2f=OpenLayers.ImgPath+this.iconNumberPath+"0"+_2c+".png";
}else{
_2f=OpenLayers.ImgPath+this.iconNumberPath+_2c+".png";
}
var _32={lonlat:new OpenLayers.LonLat(_31.x,_31.y),iconUrl:_2f,iconSize:this.iconNumberSize,title:"Manovra",position:this.iconNumberPosition};
var _33=new Roja.Marker(_32);
var _34={markersLayer:this.markersLayer,numGeocodes:this.numGeocodes,onlyOneMarkerBalloon:this.onlyOneMarkerBalloon};
if(this.map!=null){
this.markersLayer.addMarker(_33);
_33.events.register("mousedown",_33,this.resetPopups.bindAsEventListener(_34));
_33.createPopup(_2e.getInstruction(),false);
}
}
}
}
},resetPopups:function(evt){
var _36;
if(this.onlyOneMarkerBalloon){
_36=0;
}else{
_36=this.numGeocodes;
}
for(var i=_36;i<this.markersLayer.markers.length;i++){
this.markersLayer.markers[i].popup.hide();
}
},showManovreMarkers:function(_38){
for(var i=this.numGeocodes;i<this.markersLayer.markers.length;i++){
this.markersLayer.markers[i].display(_38);
}
},showManovreMarker:function(_3a,_3b){
this.showManovreMarkers(false);
this.resetPopups(null);
this.markersLayer.markers[_3a].display(_3b);
this.markersLayer.markers[_3a].popup.show();
},moveToMarker:function(_3c){
this.map.setCenter(this.markersLayer.markers[_3c].lonlat);
},getNumGeocodes:function(){
return (this.numGeocodes);
},getGeocodes:function(){
return (this.geocodes);
},drawOnMap:function(_3d){
this.loadRouteGeometry(_3d);
if(this.getRouteGeometry().getFullGeometry()==null){
this.events.triggerEvent("drawFailure");
return;
}
var _3e={};
if(this.routeStyle!=null){
_3e={style:this.routeStyle};
}
var _3f=this.getRouteGeometry().getFullGeometry().getGeometry(_3e);
this.vectorLayer.destroyFeatures();
this.vectorLayer.addFeatures([_3f]);
var _40=this.getRouteGeometry().getFullGeometry().getGeometryPOI(_3e);
if(_40!=null&&_40.length>0){
for(index=0;index<_40.length;index++){
this.vectorLayer.addFeatures([_40[index]]);
}
}
var _41=_3d.getElementsByTagName("RouteSummary")[0];
var _42=_41.getElementsByTagName("BoundingBox")[0];
var _43=_42.getElementsByTagName("pos");
var _44=_43[0].firstChild.nodeValue;
var _45=parseFloat(_44.substring(0,_44.indexOf(" ")))+this.tollerance;
var _46=parseFloat(_44.substring(_44.indexOf(" ")+1))+this.tollerance;
var _47=_43[1].firstChild.nodeValue;
var _48=parseFloat(_47.substring(0,_47.indexOf(" ")))+this.tollerance;
var _49=parseFloat(_47.substring(_47.indexOf(" ")+1))+this.tollerance;
var _4a=new OpenLayers.Bounds(_45,_46,_48,_49);
this.map.zoomToExtent(_4a);
if(this.map.getZoom()==0){
this.map.setCenter(map.getInitialCenter(),0);
}
this.events.triggerEvent("drawComplete");
},createRoutingRequest:function(_4b,_4c,_4d,_4e,end,_50,_51,_52,_53){
var _54="<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>"+"<ControllerRequest xmlns=\"http://www.corenet.it/followmeplus\" xmlns:xls=\"http://www.opengis.net/xls\">"+"<DetermineRouteRequest distanceUnit=\"M\" xmlns=\"http://www.opengis.net/xls\">"+"<RoutePlan>"+"<RoutePreference>"+_4b+"</RoutePreference>"+"<WayPointList>"+"<StartPoint>";
var _55=Roja.Util.transformXMLJStoXMLString(_4c);
var _56=new OpenLayers.parseXMLString(_55);
if((_56.firstChild!=null)&&(_56.firstChild.tagName!="parsererror")&&(_56.getElementsByTagName("parsererror").length==0)){
_54+=_55;
}else{
_54+="<Address countryCode=\"IT\">"+"<freeFormAddress>"+_4c+"</freeFormAddress>"+"</Address>";
}
_54+="</StartPoint>";
if(_4d!=""){
var _57=Roja.Util.transformXMLJStoXMLString(_4d);
var _58=new OpenLayers.parseXMLString(_57);
_54+="<ViaPoint>";
if(((_58.firstChild!=null))&&(_58.firstChild.tagName!="parsererror")&&(_58.getElementsByTagName("parsererror").length==0)){
_54+=_57;
}else{
_54+="<Address countryCode=\"IT\">"+"<freeFormAddress>"+_4d+"</freeFormAddress>"+"</Address>";
}
_54+="</ViaPoint>";
}
if(_4e!=""){
var _59=Roja.Util.transformXMLJStoXMLString(_4e);
var _5a=new OpenLayers.parseXMLString(_59);
_54+="<ViaPoint>";
if((_5a.firstChild!=null)&&(_5a.firstChild.tagName!="parsererror")&&(_5a.getElementsByTagName("parsererror").length==0)){
_54+=_59;
}else{
_54+="<Address countryCode=\"IT\">"+"<freeFormAddress>"+_4e+"</freeFormAddress>"+"</Address>";
}
_54+="</ViaPoint>";
}
var _5b=Roja.Util.transformXMLJStoXMLString(end);
var _5c=new OpenLayers.parseXMLString(_5b);
_54+="<EndPoint>";
if(((_5c.firstChild!=null))&&(_5c.firstChild.tagName!="parsererror")&&(_5c.getElementsByTagName("parsererror").length==0)){
_54+=_5b;
}else{
_54+="<Address countryCode=\"IT\">"+"<freeFormAddress>"+end+"</freeFormAddress>"+"</Address>";
}
_54+="</EndPoint>"+"</WayPointList>"+"</RoutePlan>";
if(_50!=""||_51!=""||_52!=""){
_54+="<xls:RouteInstructionsRequest ";
if(_50!=""){
_54+="format=\""+_50+"\"";
}
if(_51!=""){
_54+=" provideGeometry=\""+_51+"\"";
}
if(_52!=""){
_54+=" provideBoundingBox=\""+_52+"\"";
}
_54+="/>";
}
_54+="<xls:RouteMapRequest>"+"<Output>"+"</Output>"+"</xls:RouteMapRequest>"+"</DetermineRouteRequest>";
if(_53!=""){
_54+="<EPSGOutput>"+_53+"</EPSGOutput>";
}
_54+="</ControllerRequest>";
return _54;
},loadRoutes:function(_5d){
this.routeinstructions=new Roja.Route.RouteInstructions(_5d);
if(this.routeinstructions.getInstructions()!=null){
if(this.routeinstructions.getInstructions().length>0){
this.status_code=ROUTES_LOADED;
}
}else{
this.status_code=RESPONSE_ERROR;
}
},loadTotalTime:function(_5e){
this.totaltime=new Roja.Route.TotalTime(_5e);
if(!((this.totaltime.getHours()!=null)&&(this.totaltime.getMinutes()!=null)&&(this.totaltime.getSeconds()))){
this.status_code=RESPONSE_ERROR;
}
},loadTotalDistance:function(_5f){
this.totaldistance=new Roja.Route.TotalDistance(_5f);
if(!((this.totaldistance.getValue()!=null)&&(this.totaldistance.getUom()!=null))){
this.status_code=RESPONSE_ERROR;
}
},loadRouteGeometry:function(_60){
this.routegeometry=new Roja.Route.RouteGeometry(_60);
if(this.routegeometry.getFullGeometry()==null){
this.status_code=RESPONSE_ERROR;
}
},getRouteInstructions:function(){
return this.routeinstructions;
},getRoutePreference:function(){
return this.routepreference;
},getTotalTime:function(){
return this.totaltime;
},getTotalDistance:function(){
return this.totaldistance;
},getRouteGeometry:function(){
return this.routegeometry;
},reset:function(){
this.markersLayer.clearMarkers();
this.vectorLayer.destroyFeatures();
this.display(false);
this.status_code=NONE;
this.geocodes=new Array();
this.totaltime=null;
this.totaldistance=null;
this.routeinstructions=null;
this.routegeometry=null;
},CLASS_NAME:"Roja.Directions"});

NONE=0;
ADDRESS_LOADED=1;
UNKNOWN_ADDRESS=11;
MULTI_ADDRESS=12;
SERVER_ERROR=13;
Roja.Address=OpenLayers.Class({id:null,map:null,addresspanel:null,div:null,displayClass:"",geocodeUrl:null,geocodePars:"serviceName=locationservice&xmlRequest=",xslPath:null,xsl:null,errorGeocodeMessage:"error on geocode service",errorXSLLoadingMessage:"file xsl not loaded",geocodedAddr:null,gmlns:"http://www.opengis.net/gml",xls:"http://www.opengis.net/xls",markersLayer:null,events:null,loading:null,EVENT_TYPES:["loadComplete","loadFailure","drawComplete","drawFailure"],fallThrough:false,status_code:null,xmlResponseService:null,iconUrl:"signal_shadow.png",iconSize:new OpenLayers.Size(68,48),restrictedAreaSize:null,idButton:null,idInput:null,initialize:function(_1){
this.displayClass=this.CLASS_NAME.replace("Roja.","Roja").replace(".","");
OpenLayers.Util.extend(this,_1);
this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
this.markersLayer=new Roja.Layer.Markers("GeocodedAddresses");
this.markersLayer.displayInLayerSwitcher=false;
this.events=new OpenLayers.Events(this,this,this.EVENT_TYPES,this.fallThrough);
this.events.register("loadComplete",this,this.stopLoading);
this.events.register("loadFailure",this,this.stopLoading);
this.loading=new Roja.Control.LoadingMessage();
if((this.map!=null)&&(this.loading!=null)){
this.map.addControl(this.loading);
}
if(this.idButton!=null){
var _2=$(this.idButton);
OpenLayers.Event.observe(_2,"click",this.goToAddress.bind(this));
}
if(this.xslPath!=null){
var _3=this.successXsl.bind(this);
var _4=this.failureXsl.bind(this);
new OpenLayers.Ajax.Request(this.xslPath,{method:"get",parameters:null,onComplete:_3,onFailure:_4});
}
},stopLoading:function(){
if(this.map!=null&&this.loading!=null){
this.loading.stopLoad();
}
},goToAddress:function(){
if(this.idInput!=null){
var _5=$(this.idInput).value;
this.load(_5);
}
},destroy:function(){
if(this.map!=null){
if(this.markersLayer!=null){
this.map.removeLayer(this.markersLayer,true);
this.markersLayer=null;
}
}
this.map=null;
this.div=null;
this.xsl=null;
if(this.events){
this.events.destroy();
}
this.events=null;
},load:function(_6){
if(_6!=null&&_6.length==0){
alert("Attenzione, inserire un indirizzo per la ricerca.");
return;
}
if(this.map!=null){
this.loading.startLoad();
if(this.map.getLayer(this.markersLayer.id)==null){
this.markersLayer.displayInLayerSwitcher=false;
this.map.addLayer(this.markersLayer);
}
}
var _7=this.successAddress.bind(this);
var _8=this.failureAddress.bind(this);
var _9=this.createFreeFormAddressRequest(_6);
var _a=this.geocodePars+_9;
this.status_code=NONE;
var _b=this.geocodeUrl;
if(Roja.Proxy&&this.geocodeUrl.startsWith("http")){
_b=Roja.Proxy+Roja.Util.escapeUri(this.geocodeUrl);
}
new OpenLayers.Ajax.Request(_b+_a,{method:"get",parameters:null,onComplete:_7,onFailure:_8});
},successXsl:function(_c){
this.xsl=_c.responseXML;
},failureXsl:function(_d){
alert(this.errorXSLLoadingMessage);
},setAddressPanel:function(_e){
this.addresspanel=_e;
},successAddress:function(_f){
if(_f.responseXML==null){
return;
}
var _10=_f.responseXML;
if(!_10||_f.fileType!="XML"){
_10=OpenLayers.parseXMLString(_f.responseText);
}
this.xmlResponseService=_10;
if(this.map!=null){
this.drawOnMap(_10);
}
if(this.xsl!=null){
var xml=_f.responseText;
var _12=Roja.transformXml(xml,this.xsl);
_12=_12.replace(/&lt;/g,"<");
_12=_12.replace(/&gt;/g,">");
if(this.addresspanel!=null){
document.getElementById(this.addresspanel).innerHTML=_12;
}
}
this.loadData(_10);
},loadData:function(_13){
this.status_code=NONE;
this.loadGeocodes(_13);
OpenLayers.Console.debug(this.status_code);
if(this.status_code>10){
this.events.triggerEvent("loadFailure");
}else{
this.events.triggerEvent("loadComplete");
}
},getStatusCode:function(){
return this.status_code;
},failureAddress:function(_14){
alert(this.errorGeocodeMessage);
this.status_code=SERVER_ERROR;
return;
},geocodedMarkersClear:function(){
if(this.markersLayer.markers!=null){
while(this.markersLayer.markers.length>0){
var _15=this.markersLayer.markers[0];
this.markersLayer.removeMarker(_15);
_15.destroy();
}
}
},loadGeocodes:function(_16){
var _17=_16.getElementsByTagName("GeocodedAddress");
if(_17.length==0){
return;
}
var _18=_16.getElementsByTagName("GeocodedAddress")[0];
var _19=_18.getElementsByTagName("freeFormAddress");
if((_19.length>0)||(_17.length>1)){
this.events.triggerEvent("drawFailure");
if(_19.length>0){
this.status_code=UNKNOWN_ADDRESS;
}else{
this.status_code=MULTI_ADDRESS;
}
return;
}
if(_16.getElementsByTagName("StreetAddress").length>0){
this.status_code=ADDRESS_LOADED;
var _18=_16.getElementsByTagName("GeocodedAddress")[0];
var _1a=OpenLayers.Ajax.getElementsByTagNameNS(_18,this.gmlns,"gml","pos");
var pos=_1a[0].firstChild.nodeValue;
var x=pos.substring(0,pos.indexOf(" "));
var y=pos.substring(pos.indexOf(" "));
this.geocodedMarkersClear();
var _1e={lonlat:new OpenLayers.LonLat(x,y),iconUrl:OpenLayers.ImgPath+this.iconUrl,iconSize:this.iconSize,restrictedAreaSize:this.restrictedAreaSize,title:"Indirizzo"};
this.geocodedAddr=new Roja.Marker.GeocodedAddress(_18,_1e);
var _1f=new Roja.Marker(_1e);
if(this.map!=null){
this.markersLayer.addMarker(_1f);
var _20="<font style=\"font-family:Verdana;font-size:9px;color:black;\">Indirizzo</font><br/><font"+" style=\"font-family:Verdana;font-size:9px;color:black;font-weight:bold;\">"+this.geocodedAddr.description+"</font>";
_1f.createPopup(_20,true);
}
}
},drawOnMap:function(_21){
var _22=_21.getElementsByTagName("GeocodedAddress");
if(_22.length==0){
return;
}
var _23=_21.getElementsByTagName("GeocodedAddress")[0];
var _24=_23.getElementsByTagName("freeFormAddress");
if((_24.length>0)||(_22.length>1)){
this.events.triggerEvent("drawFailure");
return;
}
var _23=_21.getElementsByTagName("GeocodedAddress")[0];
var _25=OpenLayers.Ajax.getElementsByTagNameNS(_23,this.gmlns,"gml","pos");
var pos=_25[0].firstChild.nodeValue;
var x=pos.substring(0,pos.indexOf(" "));
var y=pos.substring(pos.indexOf(" "));
var _29=OpenLayers.Ajax.getElementsByTagNameNS(_23,this.gmlns,"gml","Envelope");
if(_29.length>0){
var _2a=OpenLayers.Ajax.getElementsByTagNameNS(_29[0],this.gmlns,"gml","pos")[0];
var _2b=OpenLayers.Ajax.getElementsByTagNameNS(_29[0],this.gmlns,"gml","pos")[1];
var _2c=_2a.firstChild.nodeValue.substring(0,pos.indexOf(" "));
var _2d=_2a.firstChild.nodeValue.substring(pos.indexOf(" "));
var _2e=_2b.firstChild.nodeValue.substring(0,pos.indexOf(" "));
var _2f=_2b.firstChild.nodeValue.substring(pos.indexOf(" "));
var _30=new OpenLayers.Bounds(_2c,_2d,_2e,_2f);
map.zoomToExtent(_30);
if(map.getZoom()==0){
map.setCenter(map.getInitialCenter(),0);
}
}else{
var _31=new OpenLayers.LonLat(x,y);
this.map.setCenter(_31,this.map.getNumZoomLevels()-1);
this.events.triggerEvent("drawComplete");
}
},createFreeFormAddressRequest:function(_32){
var _33="<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>";
var _34=Roja.Util.transformXMLJStoXMLString(_32);
var _35=new OpenLayers.parseXMLString(_34);
if((_35.firstChild!=null)&&(_35.firstChild.tagName!="parsererror")&&(_35.getElementsByTagName("Address").length>0)){
_33+="<GeocodeRequest xmlns=\"http://www.opengis.net/xls\">";
_33+=_34;
_33+="</GeocodeRequest>";
}else{
_33+="<GeocodeRequest xmlns=\"http://www.opengis.net/xls\">"+"<Address countryCode=\"IT\">"+"<freeFormAddress>"+_32+"</freeFormAddress>"+"</Address>"+"</GeocodeRequest>";
}
return _33;
},reset:function(){
this.markersLayer.clearMarkers();
this.status_code=NONE;
},getStatusCode:function(){
return this.status_code;
},getGeocodes:function(){
return this.geocodedAddr;
},CLASS_NAME:"Roja.Address"});

Roja.Format=OpenLayers.Class(OpenLayers.Format,{});

Roja.Layer=OpenLayers.Class({group:null,legendUrl:null,backgroundColor:null,loading:null,loading:null,setLoading:function(){
this.events.register("loadstart",this,this.startLoading);
this.events.register("loadend",this,this.stopLoading);
this.events.register("loadcancel",this,this.stopLoading);
},startLoading:function(_1){
if(this.loading==null){
this.loading=new Roja.Control.LoadingMessage();
if((this.map!=null)&&(this.loading!=null)){
this.map.addControl(this.loading);
}
}
this.loading.startLoad();
},stopLoading:function(_2){
if(this.map!=null&&this.loading!=null){
this.loading.stopLoad();
}
},CLASS_NAME:"Roja.Layer"});

Roja.Map=OpenLayers.Class(OpenLayers.Map,{namespaceURI:"http://www.regione.sardegna.it/",namespacePrefix:"dbu",layerMinZoomLevel:null,initialCenter:null,latShift:null,layerMinZoomLevelImgPath:null,minZoomLevel:0,layerMinZoomLevelBounds:null,copyrightControl:null,floatingDivList:null,widthImageFixed:null,heightImageFixed:null,backgroundColor:null,initialize:function(_1,_2){
if(arguments.length===1&&typeof _1==="object"){
_2=_1;
_1=_2&&_2.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);
OpenLayers.Util.extend(this,_2);
this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");
this.div=OpenLayers.Util.getElement(_1);
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 id=this.div.id+"_OpenLayers_ViewPort";
this.viewPortDiv=OpenLayers.Util.createDiv(id,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);
id=this.div.id+"_OpenLayers_Container";
this.layerContainerDiv=OpenLayers.Util.createDiv(id);
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!=null){
var _4=true;
var _5=document.getElementsByTagName("link");
for(var i=0,len=_5.length;i<len;++i){
if(OpenLayers.Util.isEquivalentUrl(_5.item(i).href,this.theme)){
_4=false;
break;
}
}
if(_4){
var _7=document.createElement("link");
_7.setAttribute("rel","stylesheet");
_7.setAttribute("type","text/css");
_7.setAttribute("href",this.theme);
document.getElementsByTagName("head")[0].appendChild(_7);
}
}
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 i=0,len=this.controls.length;i<len;i++){
this.addControlToMap(this.controls[i]);
}
this.popups=[];
this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);
OpenLayers.Event.observe(window,"unload",this.unloadDestroy);
this.div.style.overflowY="auto";
if(this.backgroundColor!=null){
this.viewPortDiv.style.backgroundColor=this.backgroundColor;
}
this.floatingDivList=new Array();
if(this.initialCenter==null){
this.initialCenter=this.maxExtent.getCenterLonLat();
}
if(this.latShift!=null){
this.initialCenter.lat+=this.latShift;
}
},setCenter:function(_8,_9,_a,_b){
if(!this.center&&!this.isValidLonLat(_8)){
_8=this.maxExtent.getCenterLonLat();
}
if(this.backgroundColor!=null){
this.viewPortDiv.style.backgroundColor=this.backgroundColor;
}
if(this.restrictedExtent!=null){
if(_8==null){
_8=this.getCenter();
}
if(_9==null){
_9=this.getZoom();
}
var _c=this.getResolutionForZoom(_9);
var _d=this.calculateBounds(_8,_c);
if(!this.restrictedExtent.containsBounds(_d)){
var _e=this.restrictedExtent.getCenterLonLat();
if(_d.getWidth()>this.restrictedExtent.getWidth()){
_8=new OpenLayers.LonLat(_e.lon,_8.lat);
}else{
if(_d.left<this.restrictedExtent.left){
_8=_8.add(this.restrictedExtent.left-_d.left,0);
}else{
if(_d.right>this.restrictedExtent.right){
_8=_8.add(this.restrictedExtent.right-_d.right,0);
}
}
}
if(_d.getHeight()>this.restrictedExtent.getHeight()){
_8=new OpenLayers.LonLat(_8.lon,_e.lat);
}else{
if(_d.bottom<this.restrictedExtent.bottom){
_8=_8.add(0,this.restrictedExtent.bottom-_d.bottom);
}else{
if(_d.top>this.restrictedExtent.top){
_8=_8.add(0,this.restrictedExtent.top-_d.top);
}
}
}
}
}
var _f=_b||((this.isValidZoomLevel(_9))&&(_9!=this.getZoom()));
if(this.layerMinZoomLevelImgPath!=null&&this.layerMinZoomLevelBounds==null){
if(this.widthImageFixed!=null&&this.heightImageFixed!=null){
var _10=this.widthImageFixed;
var _11=this.heightImageFixed;
this.layerMinZoomLevelBounds=this.calculateBoundsMinZoomLevel(this.initialCenter,this.getMaxResolution(),new OpenLayers.Size(_10-2,_11));
this.layerMinZoomLevelGraphicLayer=new OpenLayers.Layer.Image(this.layerMinZoomLevel,this.layerMinZoomLevelImgPath,this.layerMinZoomLevelBounds,new OpenLayers.Size(_10,_11));
this.layerMinZoomLevelGraphicLayer.imageSize=new OpenLayers.Size(_10,_11);
this.layerMinZoomLevelGraphicLayer.imageOffset=new OpenLayers.Pixel(-1,0);
}else{
this.layerMinZoomLevelBounds=this.calculateBounds(this.initialCenter,this.getMaxResolution());
this.layerMinZoomLevelGraphicLayer=new OpenLayers.Layer.Image(this.layerMinZoomLevel,this.layerMinZoomLevelImgPath,this.layerMinZoomLevelBounds,this.size);
}
this.layerMinZoomLevelGraphicLayer.setIsBaseLayer(false);
this.layerMinZoomLevelGraphicLayer.setVisibility(true);
this.layerMinZoomLevelGraphicLayer.displayInLayerSwitcher=false;
this.addLayer(this.layerMinZoomLevelGraphicLayer);
this.layerMinZoomLevelGraphicLayer.setZIndex(this.Z_INDEX_BASE["Overlay"]-5);
}
var _12=this.getLayerByName(this.layerMinZoomLevel);
if(this.layerMinZoomLevel!=null){
if(this.getZoom()>0&&_9==0){
_8=this.initialCenter;
}
}
var _13=(this.isValidLonLat(_8))&&(!_8.equals(this.center));
if(_f||_13||!_a){
if(!_a){
this.events.triggerEvent("movestart");
}
if(_13){
if((!_f)&&(this.center)){
this.centerLayerContainer(_8);
}
this.center=_8.clone();
}
if((_f)||(this.layerContainerOrigin==null)){
this.layerContainerOrigin=this.center.clone();
this.layerContainerDiv.style.left="0px";
this.layerContainerDiv.style.top="0px";
}
if(_f){
this.zoom=_9;
this.viewRequestID++;
}
var _14=this.getExtent();
this.baseLayer.moveTo(_14,_f,_a);
for(var i=0;i<this.layers.length;i++){
var _16=this.layers[i];
if(!_16.isBaseLayer){
var _17;
var _18=_16.calculateInRange();
_17=(_16.visibility&&_18);
if(_16.inRange!=_18){
_16.inRange=_18;
this.events.triggerEvent("changelayer");
}
if(_16.WMSSwitcher){
var _19=false;
_17=true;
for(var y=0;y<_16.layers.length;y++){
_18=_16.layers[y].calculateInRange(this.getZoom());
if(_18&&_16.layers[y].visibility){
}
if(_18!=_16.layers[y].inRange){
_16.layers[y].inRange=_18;
_19=true;
}
}
if(_19){
this.events.triggerEvent("changelayer");
}
}
if(_17){
_16.moveTo(_14,_f,_a);
}else{
_16.display(false);
}
}
}
if(_f){
for(var i=0;i<this.popups.length;i++){
this.popups[i].updatePosition();
}
}
this.events.triggerEvent("move");
if(_f){
this.events.triggerEvent("zoomend");
if(_12!=null){
if(this.getZoom()>0){
_12.setVisibility(false);
}else{
_12.setVisibility(true);
_12.tile.imgDiv.style.display="block";
}
}
}
}
if(!_a){
this.events.triggerEvent("moveend");
}
},isValidZoomLevel:function(_1b){
return ((_1b!=null)&&(_1b>=this.minZoomLevel)&&(_1b<this.getNumZoomLevels()));
},getLayerByName:function(_1c){
var _1d=null;
for(var i=0;i<this.layers.length;i++){
var _1f=this.layers[i];
if((_1f.name!=null)&&(_1f.name==_1c)){
_1d=_1f;
}
}
return _1d;
},zoomToExtent:function(_20){
if(!this.isValidLonLat(_20.getCenterLonLat())&&this.zoom==0){
return false;
}
this.setCenter(_20.getCenterLonLat(),this.getZoomForExtent(_20));
},getInitialCenter:function(){
return this.initialCenter;
},addPopup:function(_21,_22){
OpenLayers.Map.prototype.addPopup.apply(this,arguments);
if(_21 instanceof Roja.Popup&&OpenLayers.Element.visible(_21.div)==true){
_21.updateTopPosition();
}
},addLayer:function(_23){
_23.div.className="olLayerDiv";
OpenLayers.Map.prototype.addLayer.apply(this,arguments);
},calculateBoundsMinZoomLevel:function(_24,_25,_26){
var _27=null;
if(_24==null){
_24=this.getCenter();
}
if(_25==null){
_25=this.getResolution();
}
if((_24!=null)&&(_25!=null)){
var _28=_26.w*_25;
var _29=_26.h*_25;
_27=new OpenLayers.Bounds(_24.lon-_28/2,_24.lat-_29/2,_24.lon+_28/2,_24.lat+_29/2);
}
return _27;
},setBackgroundColor:function(_2a){
this.backgroundColor=_2a;
if(_2a!=null){
this.viewPortDiv.style.backgroundColor=_2a;
}
},CLASS_NAME:"Roja.Map"});

Roja.Marker=OpenLayers.Class(OpenLayers.Marker,{id:null,iconUrl:null,iconSize:null,popup:null,popupsize:null,position:null,restrictedAreaSize:null,visible:true,restrictedDiv:null,initialize:function(_1){
OpenLayers.Util.extend(this,_1);
if(this.iconSize==null){
this.iconSize=new OpenLayers.Size(35,35);
}
var _2;
if(this.position=="center"){
_2=-this.iconSize.h/2;
}else{
_2=-this.iconSize.h;
}
if(this.iconUrl!=null){
var _3=new OpenLayers.Pixel(-(this.iconSize.w/2),_2);
this.icon=new OpenLayers.Icon(this.iconUrl,this.iconSize,_3);
}else{
if(this.icon==null){
var _3=new OpenLayers.Pixel(-(this.iconSize.w/2),_2);
this.icon=new OpenLayers.Icon(OpenLayers.ImgPath+"marker.png",this.iconSize,_3);
}
}
if(this.restrictedAreaSize!=null){
this.icon.imageDiv.style.position="relative";
this.restrictedDiv=document.createElement("img");
var _4=document.createElement("br");
this.restrictedDiv.style.width=this.restrictedAreaSize.w+"px";
this.restrictedDiv.style.height=this.restrictedAreaSize.h+"px";
this.restrictedDiv.src=OpenLayers.ImgPath+"dot.gif";
var _5=this.icon.size.w/2-this.restrictedAreaSize.w/2;
this.restrictedDiv.style.left=_5+"px";
this.restrictedDiv.style.top=0+"px";
this.restrictedDiv.style.position="absolute";
this.icon.imageDiv.appendChild(this.restrictedDiv);
this.restrictedDiv.style.cursor="pointer";
this.events=new OpenLayers.Events(this,this.restrictedDiv,null);
this.events.register("dblclick",this,this.stopevent);
this.events.register("mousedown",this,this.stopevent);
this.events.register("click",this,this.markerClick.bind(this));
}else{
this.icon.imageDiv.style.cursor="pointer";
this.events=new OpenLayers.Events(this,this.icon.imageDiv,null);
this.events.register("dblclick",this,this.stopevent);
this.events.register("mousedown",this,this.stopevent);
this.events.register("click",this,this.markerClick.bind(this));
}
},hideMarker:function(){
this.icon.display(false);
this.visible=false;
},createPopup:function(_6,_7){
if(_7==null){
_7=false;
}
this.icon.position=this.position;
var _8={lonlat:this.lonlat,text:_6,anchor:this.icon};
var _9=new Roja.Popup(_8);
_9.setBackgroundColor("transparent");
this.map.addPopup(_9);
if(_7){
_9.show();
}else{
_9.hide();
}
this.popupcloser=document.getElementById(_9.id+"_popupcloser");
var _a=_9.hide.bindAsEventListener(_9);
OpenLayers.Event.observe(this.popupcloser,"click",_a);
this.popup=_9;
return _9;
},setPopup:function(_b,_c){
if(_c==null){
_c=false;
}
_b.setBackgroundColor("transparent");
if(_c){
_b.show();
}else{
_b.hide();
}
this.map.addPopup(_b);
this.popupcloser=document.getElementById(_b.id+"_popupcloser");
if(this.popupcloser!=null){
var _d=_b.hide.bindAsEventListener(_b);
OpenLayers.Event.observe(this.popupcloser,"click",_d);
}
this.popup=_b;
return _b;
},stopevent:function(_e){
OpenLayers.Event.stop(_e,true);
},markerClick:function(_f){
if(this.popup!=null){
if(this.popup.visible()==true){
this.popup.hide();
}else{
this.popup.show();
if(this.map.layerMinZoomLevel!=null&&this.map.getZoom()>0){
var _10=this.map.getExtent();
var _11=this.map.getCenter();
var x=_11.lon;
var y=_11.lat;
if((this.lonlat.lon+this.popup.size.w/2*this.map.getResolution())>_10.right){
x=x+((this.lonlat.lon+this.popup.size.w/2*this.map.getResolution())-_10.right);
}
if((_10.left>this.lonlat.lon-this.popup.size.w/2*this.map.getResolution())){
x=x-((_10.left-this.lonlat.lon+this.popup.size.w/2*this.map.getResolution()));
}
if((this.lonlat.lat+this.popup.size.h*this.map.getResolution()+this.icon.size.h*this.map.getResolution())>_10.top){
y=y+((this.lonlat.lat+this.popup.size.h*this.map.getResolution()+this.icon.size.h*this.map.getResolution())-_10.top);
}
this.map.setCenter(new OpenLayers.LonLat(x,y),this.map.getZoom());
}
}
}
OpenLayers.Event.stop(_f,true);
},display:function(_14){
this.icon.display(_14);
this.icon.imageDiv.style.visibility=(_14)?"visible":"hidden";
this.visible=_14;
},destroy:function(){
this.map=null;
this.events.destroy();
this.events=null;
if(this.icon!=null){
this.icon.destroy();
this.icon=null;
}
if(this.popup!=null){
this.popup.destroy();
this.popup=null;
}
},CLASS_NAME:"Roja.Marker"});

Roja.Popup=OpenLayers.Class(OpenLayers.Popup,{text:null,anchor:null,firstTimeShow:false,initialize:function(_1){
var _2=true;
if(navigator.appVersion.indexOf("MSIE")!=-1){
_2=false;
}
OpenLayers.Util.extend(this,_1);
if(this.id==null||this.id==""){
this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
}
if(this.contentSize==null){
this.contentSize=new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);
}
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.groupDiv=OpenLayers.Util.createDiv(null,null,null,null,"relative",null,"hidden");
var id=this.div.id+"_contentDiv";
this.contentDiv=OpenLayers.Util.createDiv(id,null,this.contentSize.clone(),null,"relative",null,"hidden");
this.contentDiv.className="RojaControlPopup";
this.groupDiv.appendChild(this.contentDiv);
this.div.appendChild(this.groupDiv);
this.setSize(this.contentSize);
},destroy:function(){
if(this.map!=null){
this.map.removePopup(this);
this.map=null;
}
if(this.events!=null){
this.events.destroy();
this.events=null;
}
this.div=null;
},draw:function(px){
var _5=true;
if(navigator.appVersion.indexOf("MSIE")!=-1){
_5=false;
}
if(px==null){
if((this.lonlat!=null)&&(this.map!=null)){
px=this.map.getLayerPxFromLonLat(this.lonlat);
}
}
this.setSize(this.contentSize);
this.setBackgroundColor();
this.setBorder();
if(this.contentHTML==null||this.contentHTML==""){
var _6="<div id=\"popupelement\" style=\"padding-left:90px; width: 310px; text-align: left;\">";
if(_5==false){
var _7=navigator.appVersion.split("MSIE");
var _8=parseFloat(_7[1]);
if(_8<6.5){
_6=_6+"<div onclick=\"OpenLayers.Event.stop(event,true);\" onmouseup=\"OpenLayers.Event.stop(event,true);\" onmousedown=\"OpenLayers.Event.stop(event,true);\" style=\"background: url("+OpenLayers.ImgPath+"balloon_up.gif) no-repeat top left; width: 150px; height: 30px;\" >"+"<div style=\"background: #ffffff url("+OpenLayers.ImgPath+"chiusura.gif) no-repeat top right; float: right; width: 15px; height: 15px; margin-top: 10px;margin-right: 8px;cursor: pointer;\" id=\""+this.id+"_popupcloser\"></div>"+"</div>";
}else{
_6=_6+"<div onclick=\"OpenLayers.Event.stop(event,true);\" onmouseup=\"OpenLayers.Event.stop(event,true);\" onmousedown=\"OpenLayers.Event.stop(event,true);\" style=\"background: url("+OpenLayers.ImgPath+"balloon_up.png) no-repeat top left; width: 150px; height: 30px;\" >"+"<div style=\"background: #ffffff url("+OpenLayers.ImgPath+"chiusura.gif) no-repeat top right; float: right; width: 15px; height: 15px; margin-top: 10px;margin-right: 8px;cursor: pointer;\" id=\""+this.id+"_popupcloser\"></div>"+"</div>";
}
}else{
_6=_6+"<div onclick=\"OpenLayers.Event.stop(event,true);\" onmouseup=\"OpenLayers.Event.stop(event,true);\" onmousedown=\"OpenLayers.Event.stop(event,true);\" style=\"background: url("+OpenLayers.ImgPath+"balloon_up.png) no-repeat top left; width: 150px; height: 30px;\" >"+"<div style=\"background: #ffffff url("+OpenLayers.ImgPath+"chiusura.gif) no-repeat top right; float: right; width: 15px; height: 15px; margin-top: 10px;margin-right: 8px;cursor: pointer;\" id=\""+this.id+"_popupcloser\"></div>"+"</div>";
}
if(this.text!=null){
_6=_6+"<div onclick=\"OpenLayers.Event.stop(event,true);\" onmouseup=\"OpenLayers.Event.stop(event,true);\" onmousedown=\"OpenLayers.Event.stop(event,true);\" style=\"background: #ffffff; border: 2px solid #F39E00; border-top: 0px;border-bottom: 0px;width: 146px!important;width: 150px; float: left;font-family:Verdana;font-size:9px;color:black;padding-top:0px;padding-bottom:0px;\"><p style=\"margin:0px;padding:0px;padding-left:10px;padding-right:10px;\">"+this.text+"</p></div>";
}
if(_5==false){
_6=_6+"<div style=\"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+OpenLayers.ImgPath+"balloon_down.png');width:310px; height: 71px; float: left;\"></div></div>";
}else{
_6=_6+"<div style=\"background: url("+OpenLayers.ImgPath+"balloon_down.png) no-repeat bottom left; width:310px; height: 71px; float: left;\"></div></div>";
}
this.setContentHTML(_6);
}else{
this.setContentHTML(this.contentHTML);
}
this.moveTo(px);
return this.div;
},moveTo:function(px){
if(this.anchor!=null){
var _a=this.map.getLonLatFromPixel(px);
_a.lon=_a.lon-this.size.w*this.map.getResolution()/2;
if(this.anchor.position=="center"){
_a.lat=_a.lat+this.size.h*this.map.getResolution()+this.anchor.size.h/2*this.map.getResolution();
}else{
_a.lat=_a.lat+this.size.h*this.map.getResolution()+this.anchor.size.h*this.map.getResolution();
}
px=this.map.getPixelFromLonLat(_a);
}
if((px!=null)&&(this.div!=null)){
this.div.style.left=px.x+"px";
this.div.style.top=px.y+"px";
}
},show:function(){
OpenLayers.Element.show(this.div);
if(this.firstTimeShow==false){
this.updateTopPosition();
this.firstTimeShow=true;
}
},updateTopPosition:function(){
this.contentDiv.style.height="";
if(this.contentDiv.firstChild!=null){
var _b=Math.abs(parseInt(this.contentDiv.offsetHeight)-this.size.h);
this.div.style.top=(parseInt(this.div.style.top)-_b)+"px";
this.div.style.height=(parseInt(this.div.style.height)+_b)+"px";
var _c=new OpenLayers.Size(this.size.w,this.div.style.height);
this.setSize(_c);
}
},registerEvents:function(){
},CLASS_NAME:"Roja.Popup"});
OpenLayers.Popup.WIDTH=310;
OpenLayers.Popup.HEIGHT=77;
OpenLayers.Popup.COLOR="white";
OpenLayers.Popup.OPACITY=1;
OpenLayers.Popup.BORDER="0px";

Roja.Renderer=OpenLayers.Class(OpenLayers.Renderer,{});

Roja.Route=OpenLayers.Class({});

Roja.S3D=OpenLayers.Class({map:null,url:null,initialize:function(_1,_2){
this.map=_1;
this.url=_2;
},callSardegna3D:function(){
var _3=this.map.getExtent();
var _4=this.url;
if(Roja.Proxy&&this.url.startsWith("http")){
_4=Roja.Proxy+Roja.Util.escapeUri(this.url);
}
window.open(_4+"&minx="+_3.left+"&maxx="+_3.right+"&miny="+_3.bottom+"&maxy="+_3.top);
},CLASS_NAME:"Roja.S3D"});

Roja.String=OpenLayers.Class({buffer:null,initialize:function(){
this.buffer=[];
},append:function(_1){
this.buffer.push(_1);
return this;
},toString:function(){
return this.buffer.join("");
},CLASS_NAME:"Roja.String"});

Roja.Tile=OpenLayers.Class(OpenLayers.Tile,{});

Roja.Util=new Object();
Roja.createUrl=function(_1,_2){
var _3=document.createElement("a");
_3.href="#";
_3.innerHTML=_2;
_3.events=new OpenLayers.Events(this,_3,null);
var _4={"link":_1};
_3.events.register("click",_3,OpenLayers.Function.bindAsEventListener(Roja.openUrl,_4));
return _3;
};
Roja.openUrl=function(){
var _5=(this.link).toLowerCase();
_5=_5.replace(/ /g,"");
_5=_5.replace(/ /g,"");
_5=_5.replace(/'/g,"");
var _6=new Object();
_6=window.open(_5,"","");
_6.focus();
};
Roja.Util.findPosX=function(_7){
var _8=0;
if(_7.offsetParent){
while(1){
_8+=_7.offsetLeft;
if(!_7.offsetParent){
break;
}
_7=_7.offsetParent;
}
}else{
if(_7.x){
_8+=_7.x;
}
}
return _8;
};
Roja.Util.findPosY=function(_9){
var _a=0;
if(_9.offsetParent){
while(1){
_a+=_9.offsetTop;
if(!_9.offsetParent){
break;
}
_9=_9.offsetParent;
}
}else{
if(_9.y){
_a+=_9.y;
}
}
return _a;
};
OpenLayers.Proxy="";
Roja.Util.escapeUri=function(_b){
return (_b.substring(_b.indexOf("http://")+7));
};
Roja.Util.transformXMLJStoXMLString=function(_c){
var _d=_c;
_d=_d.replace(/&lt;/g,"<");
_d=_d.replace(/&gt;/g,">");
return _d;
};
OpenLayers.IMAGE_RELOAD_ATTEMPTS=1;
OpenLayers.Util.onImageLoadError=function(){
this._attempts=(this._attempts)?(this._attempts+1):1;
if(this._attempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS){
this.src=this.src;
}else{
this.style.visibility="hidden";
}
this.style.display="";
};
OpenLayers.Util.onImageLoad=function(){
if(!this.viewRequestID||(this.map&&this.viewRequestID==this.map.viewRequestID)){
this.style.backgroundColor=null;
this.style.display="";
this.style.visibility="visible";
}
};

Roja.ArcXML.AxlLayer=OpenLayers.Class({layerId:null,xml:null,dataSetName:null,urlRenderer:null,initialize:function(_1,_2,_3){
var _4=new Array();
_4.push(_3);
OpenLayers.Util.extend(this,_4);
this.layerId=_1;
this.dataSetName=_2;
},getXML:function(){
this.xml="<LAYER id=\""+this.layerId+"\"";
if(this[0]){
if(this[0].name){
this.xml+=" name=\""+this[0].name+"\"";
}else{
this.xml+=" name=\""+this.layerId+"\"";
}
if(this[0].type){
this.xml+=" type=\""+this[0].type+"\"";
}else{
this.xml+=" type=\"featureclass\"";
}
this.xml+=">";
}else{
this.xml+=" name=\""+this.layerId+"\" type=\"featureclass\">";
}
if(this[0].valueMapRenderer){
this.xml+="<DATASET fromlayer=\""+this.dataSetName+"\"/> <GROUPRENDERER>";
this.xml+=this[0].valueMapRenderer.getXML();
this.xml+="</GROUPRENDERER>";
}else{
if(this[0].urlRenderer){
this.loadURL(this[0].urlRenderer,this);
}
}
this.xml+=" </LAYER>";
return this.xml;
},loadURL:function(_5,_6){
if(Roja.Proxy&&_5.startsWith("http")){
_5=Roja.Proxy+Roja.Util.escapeUri(_5);
}
var _7=function(_8){
this.xml+=_8.responseText;
};
var _9=function(){
OpenLayers.Console.error("The URL you requested was not found: "+this[0].urlRenderer);
};
new OpenLayers.Ajax.Request(_5,{method:"get",asynchronous:false,onComplete:OpenLayers.Function.bind(_7,_6),onFailure:OpenLayers.Function.bind(_9,_6)});
},CLASS_NAME:"Roja.ArcXML.AxlLayer"});

Roja.ArcXML.AxlLayerDef=OpenLayers.Class({layerId:null,xml:null,urlRenderer:null,initialize:function(id,_2){
var _3=new Array();
_3.push(_2);
OpenLayers.Util.extend(this,_3);
OpenLayers.Util.extend(this,_2);
this.layerId=id;
},getXML:function(){
this.xml="<LAYERDEF id=\""+this.layerId+"\"";
if(this[0]){
if(this[0].name){
this.xml+=" name=\""+this[0].name+"\"";
}else{
this.xml+=" name=\""+this.layerId+"\"";
}
if(this[0].visible){
this.xml+=" visible=\""+this[0].visible+"\"";
}else{
this.xml+=" visible=\"true\"";
}
this.xml+=">";
if(this[0].query){
this.xml+=this[0].query.getXML();
}
if(this[0].simpleRenderer){
this.xml+="<GROUPRENDERER>";
for(var i=0;i<this[0].simpleRenderer.length;i++){
this.xml+="<SIMPLERENDERER>"+this[0].simpleRenderer[i].getXML()+"</SIMPLERENDERER>";
}
this.xml+="</GROUPRENDERER>";
}
if(this[0].simpleLabelRenderer){
this.xml+="<GROUPRENDERER>";
for(var i=0;i<this[0].simpleLabelRenderer.length;i++){
this.xml+=this[0].simpleLabelRenderer[i].getXML();
}
this.xml+="</GROUPRENDERER>";
}
if(this.urlRenderer){
this.loadURL(this.urlRenderer,this);
}
}else{
this.xml+=" name=\""+this.layerId+"\" visible=\"true\">";
}
this.xml+="</LAYERDEF>";
return this.xml;
},loadURL:function(_5,_6){
if(Roja.Proxy&&_5.startsWith("http")){
_5=Roja.Proxy+Roja.Util.escapeUri(_5);
}
var _7=this.successLoadURL.bind(this);
var _8=this.failureLoadURL.bind(this);
new OpenLayers.Ajax.Request(_5,{method:"get",asynchronous:false,onComplete:_7,onFailure:_8});
},successLoadURL:function(_9){
this.xml+=_9.responseText;
},failureLoadURL:function(_a){
OpenLayers.Console.error("The URL you requested was not found: "+this.urlRenderer);
},setUrlRenderer:function(_b){
this.urlRenderer=_b;
},CLASS_NAME:"Roja.ArcXML.AxlLayerDef"});

Roja.ArcXML.ChartSymbol=OpenLayers.Class({initialize:function(_1){
var _2=new Array();
_2.push(_1);
OpenLayers.Util.extend(this,_2);
},getXML:function(){
var _3="<CHARTSYMBOL";
if(this[0]){
if(this[0].antialiasing){
_3+=" antialiasing=\""+this[0].antialiasing+"\"";
}
if(this[0].maxsize){
_3+=" maxsize=\""+this[0].maxsize+"\"";
}
if(this[0].maxvalue){
_3+=" maxvalue=\""+this[0].maxvalue+"\"";
}
if(this[0].minsize){
_3+=" minsize=\""+this[0].minsize+"\"";
}
if(this[0].minvalue){
_3+=" minvalue=\""+this[0].minvalue+"\"";
}
if(this[0].mode){
_3+=" mode=\""+this[0].mode+"\"";
}
if(this[0].outline){
_3+=" outline=\""+this[0].outline+"\"";
}
if(this[0].shadow){
_3+=" shadow=\""+this[0].shadow+"\"";
}
if(this[0].size){
_3+=" size=\""+this[0].size+"\"";
}
if(this[0].sizefield){
_3+=" sizefield=\""+this[0].sizefield+"\"";
}
if(this[0].transparency){
_3+=" transparency=\""+this[0].transparency+"\"";
}
_3+=">";
if(this[0].chartValue){
for(var i=0;i<this[0].chartValue.length;i++){
_3+=this[0].chartValue[i].getXML();
}
}
}
_3+="</CHARTSYMBOL>";
return _3;
},CLASS_NAME:"Roja.ArcXML.ChartSymbol"});

Roja.ArcXML.ChartValue=OpenLayers.Class({initialize:function(_1){
var _2=new Array();
_2.push(_1);
OpenLayers.Util.extend(this,_2);
},getXML:function(){
var _3="<CHARTVALUE";
if(this[0].color){
_3+=" color=\""+this[0].color+"\"";
}
if(this[0].lookupfield){
_3+=" lookupfield=\""+this[0].lookupfield+"\"";
}
if(this[0].lower){
_3+=" lower=\""+this[0].lower+"\"";
}
if(this[0].upper){
_3+=" upper=\""+this[0].upper+"\"";
}
if(this[0].value){
_3+=" value=\""+this[0].value+"\"";
}
_3+=" />";
return _3;
},CLASS_NAME:"Roja.ArcXML.ChartValue"});

Roja.ArcXML.Exact=OpenLayers.Class({initialize:function(_1){
var _2=new Array();
_2.push(_1);
OpenLayers.Util.extend(this,_2);
},getXML:function(){
var _3="<EXACT";
if(this[0].label){
_3+=" label=\""+this[0].label+"\"";
}
if(this[0].method){
_3+=" method=\""+this[0].method+"\"";
}
if(this[0].value){
_3+=" value=\""+this[0].value+"\"";
}
_3+=">";
_3+=this[0].simplePolygonSymbol.getXML();
_3+="</EXACT>";
return _3;
},CLASS_NAME:"Roja.ArcXML.Exact"});

Roja.ArcXML.Query=OpenLayers.Class({initialize:function(_1){
var _2=new Array();
_2.push(_1);
OpenLayers.Util.extend(this,_2);
},getXML:function(){
var _3="<QUERY";
if(this[0].where){
_3+=" where=\""+this[0].where+"\"";
}
_3+=" />";
return _3;
},CLASS_NAME:"Roja.ArcXML.Query"});

Roja.ArcXML.SimpleLabelRenderer=OpenLayers.Class({initialize:function(_1){
var _2=new Array();
_2.push(_1);
OpenLayers.Util.extend(this,_2);
},getXML:function(){
var _3="<SIMPLELABELRENDERER";
if(this[0]){
if(this[0].field){
_3+=" field=\""+this[0].field+"\"";
}
if(this[0].featureweight){
_3+=" featureweight=\""+this[0].featureweight+"\"";
}
if(this[0].howmanylabels){
_3+=" howmanylabels=\""+this[0].howmanylabels+"\"";
}
if(this[0].labelbufferratio){
_3+=" labelbufferratio=\""+this[0].labelbufferratio+"\"";
}
if(this[0].labelpriorities){
_3+=" labelpriorities=\""+this[0].labelpriorities+"\"";
}
if(this[0].labelweight){
_3+=" labelweight=\""+this[0].labelweight+"\"";
}
if(this[0].linelabelposition){
_3+=" linelabelposition=\""+this[0].linelabelposition+"\"";
}
if(this[0].rotationalangles){
_3+=" rotationalangles=\""+this[0].rotationalangles+"\"";
}
_3+=">";
if(this[0].chartSymbol){
_3+=this[0].chartSymbol.getXML();
}
}
_3+="</SIMPLELABELRENDERER>";
return _3;
},CLASS_NAME:"Roja.ArcXML.SimpleLabeledRenderer"});

Roja.ArcXML.SimpleLabelRenderer=OpenLayers.Class({initialize:function(_1){
var _2=new Array();
_2.push(_1);
OpenLayers.Util.extend(this,_2);
},getXML:function(){
var _3="<SIMPLELABELRENDERER";
if(this[0]){
if(this[0].field){
_3+=" field=\""+this[0].field+"\"";
}
if(this[0].featureweight){
_3+=" featureweight=\""+this[0].featureweight+"\"";
}
if(this[0].howmanylabels){
_3+=" howmanylabels=\""+this[0].howmanylabels+"\"";
}
if(this[0].labelbufferratio){
_3+=" labelbufferratio=\""+this[0].labelbufferratio+"\"";
}
if(this[0].labelpriorities){
_3+=" labelpriorities=\""+this[0].labelpriorities+"\"";
}
if(this[0].labelweight){
_3+=" labelweight=\""+this[0].labelweight+"\"";
}
if(this[0].linelabelposition){
_3+=" linelabelposition=\""+this[0].linelabelposition+"\"";
}
if(this[0].rotationalangles){
_3+=" rotationalangles=\""+this[0].rotationalangles+"\"";
}
_3+=">";
if(this[0].chartSymbol){
_3+=this[0].chartSymbol.getXML();
}
}
_3+="</SIMPLELABELRENDERER>";
return _3;
},CLASS_NAME:"Roja.ArcXML.SimpleLabeledRenderer"});

Roja.ArcXML.SimpleLineSymbol=OpenLayers.Class({initialize:function(_1){
var _2=new Array();
_2.push(_1);
OpenLayers.Util.extend(this,_2);
},getXML:function(){
var _3="<SIMPLELINESYMBOL";
if(this[0].antialiasing){
_3+=" antialiasing=\""+this[0].antialiasing+"\"";
}
if(this[0].captype){
_3+=" captype=\""+this[0].captype+"\"";
}
if(this[0].color){
_3+=" color=\""+this[0].color+"\"";
}
if(this[0].jointype){
_3+=" jointype=\""+this[0].jointype+"\"";
}
if(this[0].overlap){
_3+=" overlap=\""+this[0].overlap+"\"";
}
if(this[0].transparency){
_3+=" transparency=\""+this[0].transparency+"\"";
}
if(this[0].type){
_3+=" type=\""+this[0].type+"\"";
}
if(this[0].width){
_3+=" width=\""+this[0].width+"\"";
}
_3+="/>";
return _3;
},CLASS_NAME:"Roja.ArcXML.SimpleLineSymbol"});

Roja.ArcXML.SimpleMarkerSymbol=OpenLayers.Class({initialize:function(_1){
var _2=new Array();
_2.push(_1);
OpenLayers.Util.extend(this,_2);
},getXML:function(){
var _3="<SIMPLEMARKERSYMBOL";
if(this[0].antialiasing){
_3+=" antialiasing=\""+this[0].antialiasing+"\"";
}
if(this[0].color){
_3+=" color=\""+this[0].color+"\"";
}
if(this[0].outline){
_3+=" outline=\""+this[0].outline+"\"";
}
if(this[0].overlap){
_3+=" overlap=\""+this[0].overlap+"\"";
}
if(this[0].shadow){
_3+=" shadow=\""+this[0].shadow+"\"";
}
if(this[0].transparency){
_3+=" transparency=\""+this[0].transparency+"\"";
}
if(this[0].type){
_3+=" type=\""+this[0].type+"\"";
}
if(this[0].usecentroid){
_3+=" usecentroid=\""+this[0].usecentroid+"\"";
}
if(this[0].width){
_3+=" width=\""+this[0].width+"\"";
}
_3+="/>";
return _3;
},CLASS_NAME:"Roja.ArcXML.SimpleMarkerSymbol"});

Roja.ArcXML.SimplePolygonSymbol=OpenLayers.Class({initialize:function(_1){
var _2=new Array();
_2.push(_1);
OpenLayers.Util.extend(this,_2);
},getXML:function(){
var _3="";
if(this[0].simpleRenderer){
_3+="<SIMPLERENDERER>";
}
_3+=" <SIMPLEPOLYGONSYMBOL";
if(this[0].antialiasing){
_3+=" antialiasing=\""+this[0].antialiasing+"\"";
}
if(this[0].boundary){
_3+=" boundary=\""+this[0].boundary+"\"";
}
if(this[0].boundarycaptype){
_3+=" boundarycaptype=\""+this[0].boundarycaptype+"\"";
}
if(this[0].boundarycolor){
_3+=" boundarycolor=\""+this[0].boundarycolor+"\"";
}
if(this[0].boundaryjointype){
_3+=" boundaryjointype=\""+this[0].boundaryjointype+"\"";
}
if(this[0].boundarytransparency){
_3+=" boundarytransparency=\""+this[0].boundarytransparency+"\"";
}
if(this[0].boundarywidth){
_3+=" boundarywidth=\""+this[0].boundarywidth+"\"";
}
if(this[0].fillcolor){
_3+=" fillcolor=\""+this[0].fillcolor+"\"";
}
if(this[0].fillinterval){
_3+=" fillinterval=\""+this[0].fillinterval+"\"";
}
if(this[0].filltransparency){
_3+=" filltransparency=\""+this[0].filltransparency+"\"";
}
if(this[0].filltype){
_3+=" filltype=\""+this[0].filltype+"\"";
}
if(this[0].overlap){
_3+=" overlap=\""+this[0].overlap+"\"";
}
if(this[0].transparency){
_3+=" transparency=\""+this[0].transparency+"\"";
}
_3+="/>";
if(this[0].simpleRenderer){
_3+=" </SIMPLERENDERER>";
}
return _3;
},CLASS_NAME:"Roja.ArcXML.SimplePolygonSymbol"});

Roja.ArcXML.ValueMapRenderer=OpenLayers.Class({lookupField:null,initialize:function(_1,_2){
this.lookupField=_1;
var _3=new Array();
_3.push(_2);
OpenLayers.Util.extend(this,_3);
},getXML:function(){
var _4="<VALUEMAPRENDERER lookupfield=\""+this.lookupField+"\">";
if(this[0].exact){
for(var i=0;i<this[0].exact.length;i++){
_4+=this[0].exact[i].getXML();
}
}
_4+="</VALUEMAPRENDERER>";
return _4;
},CLASS_NAME:"Roja.ArcXML.ValueMapRenderer"});

Roja.Control.CustomButton=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,functionToCall:null,className:null,initialize:function(_1){
OpenLayers.Control.prototype.initialize.apply(this,arguments);
this.displayClass=this.CLASS_NAME.replace("Roja.","Roja").replace(".","")+this.className;
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this,arguments);
return this.div;
},trigger:function(){
this.functionToCall();
},CLASS_NAME:"Roja.Control.CustomButton"});

Roja.Control.DragPan=OpenLayers.Class(OpenLayers.Control.DragPan,{panMap:function(xy){
this.panned=true;
var _2=this.handler.last.x-xy.x;
var _3=this.handler.last.y-xy.y;
var _4=this.map.getSize();
var _5=new OpenLayers.Pixel(_4.w/2+_2,_4.h/2+_3);
var _6=this.map.getLonLatFromViewPortPx(_5);
if(this.map.getLayerByName(this.map.layerMinZoomLevel)==null||this.map.getZoom()>0){
this.map.setCenter(_6,null,this.handler.dragging);
}
},panMapDone:function(xy){
if(this.panned){
this.panMap(xy);
this.panned=false;
}
},CLASS_NAME:"Roja.Control.DragPan"});

Roja.Control.FixedPans=OpenLayers.Class(OpenLayers.Control.KeyboardDefaults,{speedFactor:5,slideFactor:10,sizeEstOvest:null,sizeNordSud:null,sizeNeSeSoNo:null,positionNord:null,positionNordEst:null,positionEst:null,positionSudEst:null,positionSud:null,positionSudOvest:null,positionOvest:null,positionNordOvest:null,initialize:function(_1){
OpenLayers.Control.KeyboardDefaults.prototype.initialize.apply(this,arguments);
if(this.sizeNordSud==null){
this.sizeNordSud=new OpenLayers.Size(29,8);
}
if(this.sizeEstOvest==null){
this.sizeEstOvest=new OpenLayers.Size(8,29);
}
if(this.sizeNeSeSoNo==null){
this.sizeNeSeSoNo=new OpenLayers.Size(18,19);
}
},destroy:function(){
if(this.handler){
this.handler.destroy();
}
this.handler=null;
OpenLayers.Control.KeyboardDefaults.prototype.destroy.apply(this,arguments);
},draw:function(){
this.handler=new OpenLayers.Handler.Keyboard(this,{"keypress":this.defaultKeyPress});
this.activate();
var _2=this.sizeNordSud.w/2;
var _3=this.sizeEstOvest.h/2;
var _4=this.sizeNordSud.w/2;
var _5=this.sizeEstOvest.h/2;
if(this.positionNord==null){
this.positionNord=new OpenLayers.Pixel(((this.map.getSize().w/2)-_2),0);
}
if(this.positionNordEst==null){
this.positionNordEst=new OpenLayers.Pixel(this.map.getSize().w-this.sizeNeSeSoNo.w,0);
}
if(this.positionEst==null){
this.positionEst=new OpenLayers.Pixel(this.map.getSize().w-this.sizeEstOvest.w,((this.map.getSize().h)/2)-_3);
}
if(this.positionSudEst==null){
this.positionSudEst=new OpenLayers.Pixel(this.map.getSize().w-this.sizeNeSeSoNo.w,(this.map.getSize().h)-this.sizeNeSeSoNo.h);
}
if(this.positionSud==null){
this.positionSud=new OpenLayers.Pixel((this.map.getSize().w/2)-_4,this.map.getSize().h-this.sizeNordSud.h);
}
if(this.positionSudOvest==null){
this.positionSudOvest=new OpenLayers.Pixel(0,this.map.getSize().h-this.sizeNeSeSoNo.h);
}
if(this.positionOvest==null){
this.positionOvest=new OpenLayers.Pixel(0,((this.map.getSize().h)/2)-_5);
}
if(this.positionNordOvest==null){
this.positionNordOvest=new OpenLayers.Pixel(0,0);
}
this.divNord=OpenLayers.Util.createDiv("divNord",this.positionNord,this.sizeNordSud,null,"absolute",null);
this.divNord.style.left=this.positionNord.x+"px";
this.divNord.style.top=this.positionNord.y+"px";
this.divNord.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;
this.map.viewPortDiv.appendChild(this.divNord);
this.divImgNord=document.createElement("img");
this.divImgNord.id="imgNord";
this.divImgNord.src=OpenLayers.ImgPath+"fixedpan/nord_off.gif";
this.divImgNord.style.cursor="pointer";
this.divNord.appendChild(this.divImgNord);
OpenLayers.Event.observe(this.divImgNord,"mousedown",this.panNord.bind(this));
OpenLayers.Event.observe(this.divImgNord,"mouseover",this.panNordOver.bind(this));
OpenLayers.Event.observe(this.divImgNord,"mouseout",this.panNordOut.bind(this));
OpenLayers.Event.observe(this.divImgNord,"dblclick",this.stopevent);
this.divNordEst=OpenLayers.Util.createDiv("divNordEst",this.positionNordEst,this.sizeNeSeSoNo,null,"absolute",null);
this.divNordEst.style.left=this.positionNordEst.x+"px";
this.divNordEst.style.top=this.positionNordEst.y+"px";
this.divNordEst.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;
this.map.viewPortDiv.appendChild(this.divNordEst);
this.divImgNordEst=document.createElement("img");
this.divImgNordEst.id="imgNordEst";
this.divImgNordEst.src=OpenLayers.ImgPath+"fixedpan/nord_est_off.gif";
this.divImgNordEst.style.cursor="pointer";
this.divNordEst.appendChild(this.divImgNordEst);
OpenLayers.Event.observe(this.divImgNordEst,"mousedown",this.panNordEst.bind(this));
OpenLayers.Event.observe(this.divImgNordEst,"mouseover",this.panNordEstOver.bind(this));
OpenLayers.Event.observe(this.divImgNordEst,"mouseout",this.panNordEstOut.bind(this));
OpenLayers.Event.observe(this.divImgNordEst,"dblclick",this.stopevent);
this.divEst=OpenLayers.Util.createDiv("divEst",this.positionEst,this.sizeEstOvest,null,"absolute",null);
this.divEst.style.left=this.positionEst.x+"px";
this.divEst.style.top=this.positionEst.y+"px";
this.divEst.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;
this.map.viewPortDiv.appendChild(this.divEst);
this.divImgEst=document.createElement("img");
this.divImgEst.id="imgEst";
this.divImgEst.src=OpenLayers.ImgPath+"fixedpan/est_off.gif";
this.divImgEst.style.cursor="pointer";
this.divEst.appendChild(this.divImgEst);
OpenLayers.Event.observe(this.divImgEst,"mousedown",this.panEst.bind(this));
OpenLayers.Event.observe(this.divImgEst,"mouseover",this.panEstOver.bind(this));
OpenLayers.Event.observe(this.divImgEst,"mouseout",this.panEstOut.bind(this));
OpenLayers.Event.observe(this.divImgEst,"dblclick",this.stopevent);
this.divSudEst=OpenLayers.Util.createDiv("divSudEst",this.positionSudEst,this.sizeNeSeSoNo,null,"absolute",null);
this.divSudEst.style.left=this.positionSudEst.x+"px";
this.divSudEst.style.top=this.positionSudEst.y+"px";
this.divSudEst.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;
this.map.viewPortDiv.appendChild(this.divSudEst);
this.divImgSudEst=document.createElement("img");
this.divImgSudEst.id="imgSudEst";
this.divImgSudEst.src=OpenLayers.ImgPath+"fixedpan/sud_est_off.gif";
this.divImgSudEst.style.cursor="pointer";
this.divSudEst.appendChild(this.divImgSudEst);
OpenLayers.Event.observe(this.divImgSudEst,"mousedown",this.panSudEst.bind(this));
OpenLayers.Event.observe(this.divImgSudEst,"mouseover",this.panSudEstOver.bind(this));
OpenLayers.Event.observe(this.divImgSudEst,"mouseout",this.panSudEstOut.bind(this));
OpenLayers.Event.observe(this.divImgSudEst,"dblclick",this.stopevent);
this.divSud=OpenLayers.Util.createDiv("divSud",this.positionSud,this.sizeNordSud,null,"absolute",null);
this.divSud.style.left=this.positionSud.x+"px";
this.divSud.style.top=this.positionSud.y+"px";
this.divSud.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;
this.map.viewPortDiv.appendChild(this.divSud);
this.divImgSud=document.createElement("img");
this.divImgSud.id="imgSud";
this.divImgSud.src=OpenLayers.ImgPath+"fixedpan/sud_off.gif";
this.divImgSud.style.cursor="pointer";
this.divSud.appendChild(this.divImgSud);
OpenLayers.Event.observe(this.divImgSud,"mousedown",this.panSud.bind(this));
OpenLayers.Event.observe(this.divImgSud,"mouseover",this.panSudOver.bind(this));
OpenLayers.Event.observe(this.divImgSud,"mouseout",this.panSudOut.bind(this));
OpenLayers.Event.observe(this.divImgSud,"dblclick",this.stopevent);
this.divSudOvest=OpenLayers.Util.createDiv("divSudOvest",this.positionSudOvest,this.sizeNeSeSoNo,null,"absolute",null);
this.divSudOvest.style.left=this.positionSudOvest.x+"px";
this.divSudOvest.style.top=this.positionSudOvest.y+"px";
this.divSudOvest.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;
this.map.viewPortDiv.appendChild(this.divSudOvest);
this.divImgSudOvest=document.createElement("img");
this.divImgSudOvest.id="imgSudOvest";
this.divImgSudOvest.src=OpenLayers.ImgPath+"fixedpan/sud_ovest_off.gif";
this.divImgSudOvest.style.cursor="pointer";
this.divSudOvest.appendChild(this.divImgSudOvest);
OpenLayers.Event.observe(this.divImgSudOvest,"mousedown",this.panSudOvest.bind(this));
OpenLayers.Event.observe(this.divImgSudOvest,"mouseover",this.panSudOvestOver.bind(this));
OpenLayers.Event.observe(this.divImgSudOvest,"mouseout",this.panSudOvestOut.bind(this));
OpenLayers.Event.observe(this.divImgSudOvest,"dblclick",this.stopevent);
this.divOvest=OpenLayers.Util.createDiv("divOvest",this.positionOvest,this.sizeEstOvest,null,"absolute",null);
this.divOvest.style.left=this.positionOvest.x+"px";
this.divOvest.style.top=this.positionOvest.y+"px";
this.divOvest.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;
this.map.viewPortDiv.appendChild(this.divOvest);
this.divImgOvest=document.createElement("img");
this.divImgOvest.id="imgOvest";
this.divImgOvest.src=OpenLayers.ImgPath+"fixedpan/ovest_off.gif";
this.divImgOvest.style.cursor="pointer";
this.divOvest.appendChild(this.divImgOvest);
OpenLayers.Event.observe(this.divImgOvest,"mousedown",this.panOvest.bind(this));
OpenLayers.Event.observe(this.divImgOvest,"mouseover",this.panOvestOver.bind(this));
OpenLayers.Event.observe(this.divImgOvest,"mouseout",this.panOvestOut.bind(this));
OpenLayers.Event.observe(this.divImgOvest,"dblclick",this.stopevent);
this.divNordOvest=OpenLayers.Util.createDiv("divNordOvest",this.positionNordOvest,this.sizeNeSeSoNo,null,"absolute",null);
this.divNordOvest.style.left=this.positionNordOvest.x+"px";
this.divNordOvest.style.top=this.positionNordOvest.y+"px";
this.divNordOvest.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;
this.map.viewPortDiv.appendChild(this.divNordOvest);
this.divImgNordOvest=document.createElement("img");
this.divImgNordOvest.id="imgNordOvest";
this.divImgNordOvest.src=OpenLayers.ImgPath+"fixedpan/nord_ovest_off.gif";
this.divImgNordOvest.style.cursor="pointer";
this.divNordOvest.appendChild(this.divImgNordOvest);
OpenLayers.Event.observe(this.divImgNordOvest,"mousedown",this.panNordOvest.bind(this));
OpenLayers.Event.observe(this.divImgNordOvest,"mouseover",this.panNordOvestOver.bind(this));
OpenLayers.Event.observe(this.divImgNordOvest,"mouseout",this.panNordOvestOut.bind(this));
OpenLayers.Event.observe(this.divImgNordOvest,"dblclick",this.stopevent);
},stopevent:function(_6){
if(_6.stopPropagation){
OpenLayers.Event.stop(_6,true);
}else{
_6.cancelBubble=true;
}
},pan:function(){
if(this.cont==null){
this.cont=this.speedFactor;
}
if(this.cont<=this.slideFactor){
this.map.pan(this.dx,this.dy,{animate:false});
this.cont=this.cont+this.speedFactor;
setTimeout(this.pan.bind(this),1);
}else{
this.cont=this.speedFactor;
}
},panNord:function(_7){
if(this.map.zoom==0){
return false;
}
this.dx=0;
this.dy=-this.speedFactor;
this.pan();
OpenLayers.Event.stop(_7);
},panNordOver:function(_8){
this.divImgNord.src=OpenLayers.ImgPath+"fixedpan/nord_on.gif";
},panNordOut:function(_9){
this.divImgNord.src=OpenLayers.ImgPath+"fixedpan/nord_off.gif";
},panNordEst:function(_a){
if(this.map.zoom==0){
return false;
}
this.dx=this.speedFactor;
this.dy=-this.speedFactor;
this.pan();
OpenLayers.Event.stop(_a);
},panNordEstOver:function(_b){
this.divImgNordEst.src=OpenLayers.ImgPath+"fixedpan/nord_est_on.gif";
},panNordEstOut:function(_c){
this.divImgNordEst.src=OpenLayers.ImgPath+"fixedpan/nord_est_off.gif";
},panEst:function(_d){
if(this.map.zoom==0){
return false;
}
this.dx=this.speedFactor;
this.dy=0;
this.pan();
OpenLayers.Event.stop(_d);
},panEstOver:function(_e){
this.divImgEst.src=OpenLayers.ImgPath+"fixedpan/est_on.gif";
},panEstOut:function(_f){
this.divImgEst.src=OpenLayers.ImgPath+"fixedpan/est_off.gif";
},panSudEst:function(evt){
if(this.map.zoom==0){
return false;
}
this.dx=this.speedFactor;
this.dy=this.speedFactor;
this.pan();
OpenLayers.Event.stop(evt);
},panSudEstOver:function(evt){
this.divImgSudEst.src=OpenLayers.ImgPath+"fixedpan/sud_est_on.gif";
},panSudEstOut:function(evt){
this.divImgSudEst.src=OpenLayers.ImgPath+"fixedpan/sud_est_off.gif";
},panSud:function(evt){
if(this.map.zoom==0){
return false;
}
this.dx=0;
this.dy=this.speedFactor;
this.pan();
OpenLayers.Event.stop(evt);
},panSudOver:function(evt){
this.divImgSud.src=OpenLayers.ImgPath+"fixedpan/sud_on.gif";
},panSudOut:function(evt){
this.divImgSud.src=OpenLayers.ImgPath+"fixedpan/sud_off.gif";
},panSudOvest:function(evt){
if(this.map.zoom==0){
return false;
}
this.dx=-this.speedFactor;
this.dy=this.speedFactor;
this.pan();
OpenLayers.Event.stop(evt);
},panSudOvestOver:function(evt){
this.divImgSudOvest.src=OpenLayers.ImgPath+"fixedpan/sud_ovest_on.gif";
},panSudOvestOut:function(evt){
this.divImgSudOvest.src=OpenLayers.ImgPath+"fixedpan/sud_ovest_off.gif";
},panOvest:function(evt){
if(this.map.zoom==0){
return false;
}
this.dx=-this.speedFactor;
this.dy=0;
this.pan();
OpenLayers.Event.stop(evt);
},panOvestOver:function(evt){
this.divImgOvest.src=OpenLayers.ImgPath+"fixedpan/ovest_on.gif";
},panOvestOut:function(evt){
this.divImgOvest.src=OpenLayers.ImgPath+"fixedpan/ovest_off.gif";
},panNordOvest:function(evt){
if(this.map.zoom==0){
return false;
}
this.dx=-this.speedFactor;
this.dy=-this.speedFactor;
this.pan();
OpenLayers.Event.stop(evt);
},panNordOvestOver:function(evt){
this.divImgNordOvest.src=OpenLayers.ImgPath+"fixedpan/nord_ovest_on.gif";
},panNordOvestOut:function(evt){
this.divImgNordOvest.src=OpenLayers.ImgPath+"fixedpan/nord_ovest_off.gif";
},CLASS_NAME:"Roja.Control.FixedPans"});

Roja.Control.FloatingPanel=OpenLayers.Class(Roja.Control,{size:null,position:null,title:null,idname:null,zIndex:"9999",childElement:null,external:false,initialize:function(_1){
Roja.Control.prototype.initialize.apply(this,[_1]);
this.idname=OpenLayers.Util.createUniqueID("FloatingPanel");
},destroy:function(){
if(this.div!=null){
OpenLayers.Event.stopObservingElement(this.div);
OpenLayers.Event.stopObservingElement(this.div);
}
if(this.floatingEvents){
this.floatingEvents.destroy();
}
this.floatingEvents=null;
this.childElement=null;
this.size=null;
this.position=null;
this.title=null;
this.idname=null;
this.div=null;
Roja.Control.prototype.destroy.apply(this,arguments);
},draw:function(){
if(this.div!=null){
this.external=true;
var _2=null;
var _3=null;
if(this.div.style.width){
_2=this.div.style.width;
}else{
if(this.size!=null){
_2=this.size.w;
}else{
_2="250px";
}
}
if(this.div.style.height){
_3=this.div.style.height;
this.div.style.height="";
}else{
if(this.size!=null){
_3=this.size.h;
}else{
_3="400px";
}
}
this.size=new OpenLayers.Size(_2,_3);
}
Roja.Control.prototype.draw.apply(this,arguments);
this.div.className="RojaControlFloatingPanel";
if(!this.external){
this.div.id=this.idname+"Container";
this.div.style.left=this.position.x+"px";
this.div.style.top=this.position.y+"px";
}
this.titlePanel=document.createElement("div");
this.titlePanel.className="titlePanel";
this.titlePanel.style.width=this.size.w+"px";
this.titlePanel.style.cursor="default";
this.spanTitle=document.createElement("span");
this.spanTitle.className="titleSpan";
this.divtext=document.createElement("div");
this.divtext.className="titleText";
this.divtext.innerHTML=this.title;
this.spanTitle.appendChild(this.divtext);
this.statusbarimg=document.createElement("div");
this.statusbarimg.className="statusBarImg";
this.spanTitle.appendChild(this.statusbarimg);
if(!this.external){
this.imgReset=document.createElement("img");
this.imgReset.id="sbImgReset"+this.idname;
this.imgReset.src=OpenLayers.ImgPath+"floating/reset.gif";
this.imgReset.style.cursor="pointer";
this.statusbarimg.appendChild(this.imgReset);
}
this.imgNascondi=document.createElement("img");
this.imgNascondi.id="sbImgNascondi"+this.idname;
this.imgNascondi.src=OpenLayers.ImgPath+"floating/nascondi.gif";
this.imgNascondi.style.cursor="pointer";
this.statusbarimg.appendChild(this.imgNascondi);
if(!this.external){
this.imgChiusura=document.createElement("img");
this.imgChiusura.id="sbImgChiusura"+this.idname;
this.imgChiusura.src=OpenLayers.ImgPath+"floating/chiusura.gif";
this.imgChiusura.style.cursor="pointer";
this.statusbarimg.appendChild(this.imgChiusura);
}
if(!this.external){
this.floatingEvents=new OpenLayers.Events(this,this.div,null,true);
this.floatingEvents.register("mousemove",this,this.controlposition);
this.floatingEvents=new OpenLayers.Events(this,this.imgReset,null,true);
this.floatingEvents.register("click",this,this.resetPosition);
}
this.floatingEvents=new OpenLayers.Events(this,this.imgNascondi,null,true);
this.floatingEvents.register("click",this,this.toggleChild);
if(!this.external){
this.floatingEvents=new OpenLayers.Events(this,this.imgChiusura,null,true);
this.floatingEvents.register("click",this,this.showHideFloating);
}
this.titlePanel.appendChild(this.spanTitle);
if(!this.external){
this.titlePanel.style.cursor="move";
}
this.div.appendChild(this.titlePanel);
this.childElement=document.createElement("div");
this.childElement.id=this.idname+"Child";
this.childElement.style.top="0px";
this.childElement.style.left="0px";
this.childElement.style.width=this.size.w+"px";
this.childElement.style.height=this.size.h+"px";
this.childElement.className="child";
this.div.appendChild(this.childElement);
OpenLayers.Event.observe(this.div,"DOMMouseScroll",this.stopLocalEvent);
OpenLayers.Event.observe(this.div,"mousewheel",this.stopLocalEvent);
if(!this.external){
var _4=this.controlposition.bindAsEventListener(this);
OpenLayers.Event.observe(document,"mousemove",_4);
OpenLayers.Event.observe(document.body,"mousemove",_4);
}
this.overflowEvents=new OpenLayers.Events(this,this.div,null,true);
this.overflowEvents.register("mousedown",this,this.mouseDownEvent);
this.overflowEvents.register("mouseup",this,this.mouseUpEvent);
this.events=new OpenLayers.Events(this,this.childElement,null);
this.events.register("click",this.childElement,this.stopevent);
var _5={div:this.div,zIndex:this.zIndex};
this.events.register("mousedown",this.childElement,OpenLayers.Function.bindAsEventListener(this.mouseDownEventOnChild,_5));
this.events.register("dblclick",this.childElement,this.stopevent);
this.events=new OpenLayers.Events(this,this.titlePanel,null);
this.events.register("click",this.titlePanel,this.stopevent);
this.events.register("dblclick",this.titlePanel,this.stopevent);
this.map.events.unregister("moveend",this,this.update);
this.map.floatingDivList.push(this);
if(!this.external){
this.setRicoDragDrop();
}
return this.div;
},stopLocalEvent:function(_6){
if(_6.stopPropagation){
OpenLayers.Event.stop(_6,true);
}else{
_6.cancelBubble=true;
}
},addDummyContent:function(_7){
var _8=document.createElement("span");
_8.innerHTML=_7;
this.childElement.appendChild(_8);
},setRicoDragDrop:function(){
var _9=this.map.viewPortDiv;
this.dndMgr=new Rico.DragAndDrop(_9);
this.dndMgr.initializeEventHandlers();
this.dndMgr.registerDraggable(new Rico.Draggable("",this.div));
this.map.events.register("mousedown",this.div,this.dndMgr._mouseDown);
this.map.events.register("mousemove",this.div,this.dndMgr._mouseMove);
this.map.events.register("mouseup",this.div,this.dndMgr._mouseUp);
},orderBrotherFloatingElement:function(){
this.map.floatingDivList.sort(function(a,b){
return b.div.style.zIndex-a.div.style.zIndex;
});
var i;
for(i=0;i<this.map.floatingDivList.length;i++){
this.map.floatingDivList[i].div.style.zIndex=this.zIndex-i;
}
},mouseDownEvent:function(_d){
document.onselectstart=function(){
return false;
};
this.div.style.zIndex=this.zIndex+1;
},mouseDownEventOnChild:function(_e){
this.div.style.zIndex=this.zIndex+1;
OpenLayers.Event.stop(_e,true);
},mouseUpEvent:function(_f){
this.orderBrotherFloatingElement();
},baseLayerDraw:function(){
this.draw();
this.map.events.unregister("changebaselayer",this,this.baseLayerDraw);
},stopevent:function(evt){
OpenLayers.Event.stop(evt,true);
},setdndMgrFloating:function(){
this.dndMgr.registerDraggable(new Rico.Draggable("test-rico-dnd",this.idname+"Container"));
},controlposition:function(evt){
var _12=(this.div.style.left.substring(0,this.div.style.left.indexOf("px")))*1+this.div.offsetWidth*0.5;
var _13=(this.div.style.top.substring(0,this.div.style.top.indexOf("px")))*1+this.div.offsetHeight*0.5;
var _14=(this.map.div.style.left.substring(0,this.map.div.style.left.indexOf("px")))*1+this.map.div.offsetWidth*1;
var _15=(this.map.div.style.top.substring(0,this.map.div.style.top.indexOf("px")))*1+this.map.div.offsetHeight*1;
var _16=(this.map.div.style.left.substring(0,this.map.div.style.left.indexOf("px")))*1;
var _17=(this.div.style.top.substring(0,this.div.style.top.indexOf("px")))*1;
var _18=(this.map.div.style.top.substring(0,this.map.div.style.top.indexOf("px")))*1;
if((_12>_14)||(_13>_15)||(_12<_16)||(_17<_18)){
this.dndMgr.clearSelection();
this.resetPosition(null);
}
var _19=document.getElementById("sbImgReset"+this.idname);
if(_19!=null){
if(((this.div.style.left!=this.position.x+"px")||(this.div.style.top!=this.position.y+"px"))&&!(_19.src.match(OpenLayers.ImgPath+"floating/resetUnpinned.gif"))){
_19.src=OpenLayers.ImgPath+"floating/resetUnpinned.gif";
}
}
},resetPosition:function(evt){
var _1b=document.getElementById("sbImgReset"+this.idname);
if(_1b!=null){
_1b.src=OpenLayers.ImgPath+"floating/reset.gif";
}
this.div.style.left=this.position.x+"px";
this.div.style.top=this.position.y+"px";
this.orderBrotherFloatingElement();
},toggleChild:function(){
if(document.getElementById(this.childElement.id)==null){
this.div.appendChild(this.childElement);
var _1c=document.getElementById("sbImgNascondi"+this.idname);
if(_1c!=null){
_1c.src=OpenLayers.ImgPath+"floating/nascondi.gif";
}
}else{
this.div.removeChild(this.childElement);
var _1c=document.getElementById("sbImgNascondi"+this.idname);
if(_1c!=null){
_1c.src=OpenLayers.ImgPath+"floating/ripristina.gif";
}
}
},showHideFloating:function(){
if(this.div.style.display=="none"){
this.div.style.display="block";
}else{
this.div.style.display="none";
}
},getContentContainer:function(){
return this.childElement.id;
},CLASS_NAME:"Roja.Control.FloatingPanel"});

Roja.Control.LoadingMessage=OpenLayers.Class(Roja.Control,{element:null,div:null,imgFileName:"loading.gif",initialize:function(_1){
Roja.Control.prototype.initialize.apply(this,[_1]);
},destroy:function(){
if(!this.element){
return;
}
this.element.removeChild(this.img);
this.div.removeChild(this.element);
this.img=null;
this.element=null;
this.imgFileName=null;
Roja.Control.prototype.destroy.apply(this,arguments);
},draw:function(){
Roja.Control.prototype.draw.apply(this,arguments);
this.img=document.createElement("img");
this.img.className=this.displayClass;
this.img.src=OpenLayers.Util.getImagesLocation()+this.imgFileName;
this.element=document.createElement("div");
this.element.className=this.displayClass+"Background";
this.element.appendChild(this.img);
this.div.appendChild(this.element);
this.div.style.display="none";
return this.div;
},startLoad:function(){
this.div.style.display="block";
},stopLoad:function(){
this.div.style.display="none";
},setImgFileName:function(_2){
this.imgFileName=_2;
},CLASS_NAME:"Roja.Control.LoadingMessage"});

Roja.Control.MouseDefaults=OpenLayers.Class(OpenLayers.Control.MouseDefaults,{defaultMouseMove:function(_1){
this.mousePosition=_1.xy.clone();
if(this.mouseDragStart!=null){
if(this.zoomBox){
var _2=Math.abs(this.mouseDragStart.x-_1.xy.x);
var _3=Math.abs(this.mouseDragStart.y-_1.xy.y);
this.zoomBox.style.width=Math.max(1,_2)+"px";
this.zoomBox.style.height=Math.max(1,_3)+"px";
if(_1.xy.x<this.mouseDragStart.x){
this.zoomBox.style.left=_1.xy.x+"px";
}else{
this.zoomBox.style.left=this.mouseDragStart.x-2+"px";
}
if(_1.xy.y<this.mouseDragStart.y){
this.zoomBox.style.top=_1.xy.y+"px";
}else{
this.zoomBox.style.top=this.mouseDragStart.y-2+"px";
}
this.performedDrag=true;
}else{
if(this.map.getLayerByName(this.map.layerMinZoomLevel)==null||this.map.getZoom()>0){
var _2=this.mouseDragStart.x-_1.xy.x;
var _3=this.mouseDragStart.y-_1.xy.y;
var _4=this.map.getSize();
var _5=new OpenLayers.Pixel(_4.w/2+_2,_4.h/2+_3);
var _6=this.map.getLonLatFromViewPortPx(_5);
this.map.setCenter(_6,null,true);
this.mouseDragStart=_1.xy.clone();
this.map.div.style.cursor="move";
this.performedDrag=true;
}else{
this.performedDrag=false;
}
}
}
},CLASS_NAME:"Roja.Control.MouseDefaults"});

Roja.Control.Navigation=OpenLayers.Class(OpenLayers.Control.Navigation,{initialize:function(_1){
OpenLayers.Control.Navigation.prototype.initialize.apply(this,arguments);
},activate:function(){
this.dragPan.activate();
this.wheelHandler.activate();
this.zoomBox.activate();
this.map.div.style.cursor="move";
return Roja.Control.prototype.activate.apply(this,arguments);
},deactivate:function(){
this.zoomBox.deactivate();
this.dragPan.deactivate();
this.wheelHandler.deactivate();
return Roja.Control.prototype.deactivate.apply(this,arguments);
},draw:function(){
this.map.events.register("dblclick",this,this.defaultDblClick);
this.dragPan=new Roja.Control.DragPan({map:this.map});
this.zoomBox=new Roja.Control.ZoomBox({map:this.map,keyMask:OpenLayers.Handler.MOD_SHIFT});
this.dragPan.draw();
this.zoomBox.draw();
this.wheelHandler=new OpenLayers.Handler.MouseWheel(this,{"up":this.wheelUp,"down":this.wheelDown});
this.activate();
},defaultDblClick:function(_2){
OpenLayers.Event.stop(_2);
return false;
},wheelChange:function(_3,_4){
var _5=this.map.getZoom()+_4;
if(!this.map.isValidZoomLevel(_5)){
return;
}
var _6=this.map.getSize();
var _7=_6.w/2-_3.xy.x;
var _8=_3.xy.y-_6.h/2;
var _9=this.map.baseLayer.resolutions[_5];
var _a=this.map.getLonLatFromPixel(_3.xy);
var _b=new OpenLayers.LonLat(_a.lon+_7*_9,_a.lat+_8*_9);
this.map.setCenter(_b,_5);
},wheelUp:function(_c){
this.wheelChange(_c,1);
},wheelDown:function(_d){
this.wheelChange(_d,-1);
},CLASS_NAME:"Roja.Control.Navigation"});

Roja.Control.Panel=OpenLayers.Class(OpenLayers.Control.Panel,{events:null,redraw:function(){
if(this.active){
for(var i=0;i<this.controls.length;i++){
var _2=this.controls[i].panel_div;
var _3=this.div.childNodes;
var _4=false;
for(var j=0;j<_3.length&&!_4;j++){
var _6=_3[j];
if(_6==_2){
_4=true;
}
}
if(!_4){
this.div.appendChild(_2);
}else{
_2=_6;
}
if(this.controls[i].active){
_2.className=this.controls[i].displayClass+"ItemActive";
}else{
_2.className=this.controls[i].displayClass+"ItemInactive";
}
if(this.controls[i].over){
_2.className=this.controls[i].displayClass+"ItemOver";
}
}
}
},addControls:function(_7){
if(!(_7 instanceof Array)){
_7=[_7];
}
this.controls=this.controls.concat(_7);
for(var i=0;i<_7.length;i++){
var _9=document.createElement("div");
var _a=_7[i].title;
if(_a!=null){
_9.title=_7[i].title;
}
var _b=document.createTextNode(" ");
_7[i].panel_div=_9;
OpenLayers.Event.observe(_7[i].panel_div,"click",OpenLayers.Function.bind(this.onClick,this,_7[i]));
OpenLayers.Event.observe(_7[i].panel_div,"mouseover",OpenLayers.Function.bind(this.onMouseOver,this,_7[i]));
OpenLayers.Event.observe(_7[i].panel_div,"mouseout",OpenLayers.Function.bind(this.onMouseOut,this,_7[i]));
OpenLayers.Event.observe(_7[i].panel_div,"mousedown",OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop));
}
if(this.map){
for(var i=0;i<_7.length;i++){
this.map.addControl(_7[i]);
_7[i].deactivate();
}
this.redraw();
}
},onMouseOver:function(_c,_d){
OpenLayers.Event.stop(_d?_d:window.event);
_c.over=true;
this.redraw();
},onMouseOut:function(_e,_f){
_e.over=false;
this.redraw();
},CLASS_NAME:"Roja.Control.Panel"});

Roja.Control.NavToolbar=OpenLayers.Class(Roja.Control.Panel,{initialize:function(_1){
Roja.Control.Panel.prototype.initialize.apply(this,[_1]);
var _2={title:"zoom in"};
var _3={title:"zoom out"};
var _4={title:"pan"};
this.addControls([new Roja.Control.ZoomBox(_2),new Roja.Control.ZoomBoxOut(_3),new Roja.Control.Navigation(_4)]);
},draw:function(){
var _5=Roja.Control.Panel.prototype.draw.apply(this,arguments);
this.activateControl(this.controls[0]);
return _5;
},CLASS_NAME:"Roja.Control.NavToolbar"});

Roja.Control.OverviewMap=OpenLayers.Class(Roja.Control,{element:null,ovmap:null,size:new OpenLayers.Size(180,90),layers:null,minRatio:8,maxRatio:32,iconUrl:"overview.jpg",mapOptions:null,initialize:function(_1){
this.layers=new Array();
Roja.Control.prototype.initialize.apply(this,[_1]);
},destroy:function(){
if(!this.mapDiv){
return;
}
this.mapDiv.removeChild(this.extentRectangle);
this.extentRectangle=null;
this.rectEvents.destroy();
this.rectEvents=null;
if(this.ovmap){
this.ovmap.destroy();
this.ovmap=null;
}
if(this.title){
this.title.removeChild(this.spanTitle);
this.spanTitle=null;
this.title=null;
this.element.removeChild(this.title);
}
this.element.removeChild(this.mapDiv);
this.mapDiv=null;
this.mapDivEvents.destroy();
this.mapDivEvents=null;
this.div.removeChild(this.element);
this.element=null;
this.elementEvents.destroy();
this.elementEvents=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.unregister("moveend",this,this.update);
this.map.events.unregister("changebaselayer",this,this.baseLayerDraw);
Roja.Control.prototype.destroy.apply(this,arguments);
},draw:function(){
Roja.Control.prototype.draw.apply(this,arguments);
if(this.layers.length==0){
this.graphicLayer=new Roja.Layer.Image("Overview",OpenLayers.ImgPath+this.iconUrl,this.layerBounds,this.size);
this.graphicLayer.setIsBaseLayer(false);
this.graphicLayer.setVisibility(false);
this.map.addLayer(this.graphicLayer);
var _2=this.graphicLayer.clone();
_2.setIsBaseLayer(true);
this.layers=[_2];
}
this.element=document.createElement("div");
this.element.className=this.displayClass+"Element";
this.element.style.display="";
this.element.title="";
this.mapDiv=document.createElement("div");
this.mapDiv.className=this.displayClass+"Img";
this.mapDiv.style.width=this.size.w+"px";
this.mapDiv.style.height=this.size.h+"px";
this.mapDiv.id=OpenLayers.Util.createUniqueID("CoreOverviewMap");
this.extentRectangle=document.createElement("div");
this.extentRectangle.style.position="absolute";
this.extentRectangle.style.zIndex=1000;
this.extentRectangle.style.overflow="hidden";
this.extentRectangle.style.backgroundImage="url("+OpenLayers.Util.getImagesLocation()+"blank.gif)";
this.extentRectangle.className=this.displayClass+"ExtentRectangle";
this.mapDiv.appendChild(this.extentRectangle);
this.element.appendChild(this.mapDiv);
this.div.appendChild(this.element);
this.map.events.register("moveend",this,this.update);
this.elementEvents=new OpenLayers.Events(this,this.element,null,true,{includeXY:true});
this.elementEvents.register("mousedown",this,function(e){
OpenLayers.Event.stop(e);
});
this.elementEvents.register("click",this,function(e){
OpenLayers.Event.stop(e);
});
this.elementEvents.register("dblclick",this,function(e){
OpenLayers.Event.stop(e);
});
this.rectEvents=new OpenLayers.Events(this,this.extentRectangle,null,true,{includeXY:true});
this.rectEvents.register("mouseout",this,this.rectMouseOut);
this.rectEvents.register("mousedown",this,this.rectMouseDown);
this.rectEvents.register("mousemove",this,this.rectMouseMove);
this.rectEvents.register("mouseup",this,this.rectMouseUp);
this.rectEvents.register("click",this,function(e){
OpenLayers.Event.stop(e);
});
this.rectEvents.register("dblclick",this,this.rectDblClick);
this.mapDivEvents=new OpenLayers.Events(this,this.mapDiv,null,true,{includeXY:true});
this.mapDivEvents.register("click",this,this.mapDivClick);
this.div.className=this.displayClass+"Container";
if(this.map.getExtent()){
this.update();
}
return this.div;
},rectMouseOut:function(_7){
if(this.rectDragStart!=null){
if(this.performedRectDrag){
this.rectMouseMove(_7);
var _8=this.getRectPxBounds();
if((_8.top<=0)||(_8.left<=0)||(_8.bottom>=this.size.h-this.hComp)||(_8.right>=this.size.w-this.wComp)){
this.updateMapToRect();
}else{
return;
}
}
document.onselectstart=null;
this.rectDragStart=null;
}
},rectMouseDown:function(_9){
if(!OpenLayers.Event.isLeftClick(_9)){
return;
}
this.rectDragStart=_9.xy.clone();
this.performedRectDrag=false;
OpenLayers.Event.stop(_9);
},rectMouseMove:function(_a){
if(this.map.getLayerByName(this.map.layerMinZoomLevel)==null||this.map.getZoom()>0){
if(this.rectDragStart!=null){
var _b=this.rectDragStart.x-_a.xy.x;
var _c=this.rectDragStart.y-_a.xy.y;
var _d=this.getRectPxBounds();
var _e=_d.top;
var _f=_d.left;
var _10=Math.abs(_d.getHeight());
var _11=_d.getWidth();
var _12=Math.max(0,(_e-_c));
_12=Math.min(_12,this.ovmap.size.h-this.hComp-_10);
var _13=Math.max(0,(_f-_b));
_13=Math.min(_13,this.ovmap.size.w-this.wComp-_11);
this.setRectPxBounds(new OpenLayers.Bounds(_13,_12+_10,_13+_11,_12));
this.rectDragStart=_a.xy.clone();
this.performedRectDrag=true;
OpenLayers.Event.stop(_a);
}
}
},rectMouseUp:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
if(this.performedRectDrag){
this.updateMapToRect();
OpenLayers.Event.stop(evt);
}
document.onselectstart=null;
this.rectDragStart=null;
},rectDblClick:function(evt){
this.performedRectDrag=false;
OpenLayers.Event.stop(evt);
},mapDivClick:function(evt){
if(this.map.getLayerByName(this.map.layerMinZoomLevel)==null||this.map.getZoom()>0){
var _17=this.getRectPxBounds();
var _18=_17.getCenterPixel();
var _19=evt.xy.x-_18.x;
var _1a=evt.xy.y-_18.y;
var top=_17.top;
var _1c=_17.left;
var _1d=Math.abs(_17.getHeight());
var _1e=_17.getWidth();
var _1f=Math.max(0,(top+_1a));
_1f=Math.min(_1f,this.ovmap.size.h-_1d);
var _20=Math.max(0,(_1c+_19));
_20=Math.min(_20,this.ovmap.size.w-_1e);
this.setRectPxBounds(new OpenLayers.Bounds(_20,_1f+_1d,_20+_1e,_1f));
this.updateMapToRect();
OpenLayers.Event.stop(evt);
}
},update:function(){
if(this.ovmap==null){
this.createMap();
}
if(!this.isSuitableOverview()&&this.map.getZoom()==0){
this.updateOverview();
}
this.updateRectToMap();
},isSuitableOverview:function(){
var _21=this.map.getExtent();
var _22=this.map.maxExtent;
var _23=new OpenLayers.Bounds(Math.max(_21.left,_22.left),Math.max(_21.bottom,_22.bottom),Math.min(_21.right,_22.right),Math.min(_21.top,_22.top));
var _24=this.ovmap.getResolution()/this.map.getResolution();
return ((_24>this.minRatio)&&(_24<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(_23)));
},updateOverview:function(){
var _25=this.map.getResolution();
var _26=this.ovmap.getResolution();
var _27=_26/_25;
if(_27>this.maxRatio){
_26=this.minRatio*_25;
}else{
if(_27<=this.minRatio){
_26=this.maxRatio*_25;
}
}
this.ovmap.setCenter(this.map.center,this.ovmap.getZoomForResolution(_26));
this.updateRectToMap();
},createMap:function(){
var _28=OpenLayers.Util.extend({controls:[],maxResolution:"auto"},this.mapOptions);
this.ovmap=new OpenLayers.Map(this.mapDiv.id,_28);
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;
},updateRectToMap:function(){
if(this.map.units!="degrees"){
if(this.ovmap.getProjection()&&(this.map.getProjection()!=this.ovmap.getProjection())){
alert("The overview map only works when it is in the same projection as the main map");
}
}
var _29=this.getRectBoundsFromMapBounds(this.map.getExtent());
if(_29){
this.setRectPxBounds(_29);
}
},updateMapToRect:function(){
var _2a=this.getRectPxBounds();
var _2b=this.getMapBoundsFromRectBounds(_2a);
this.map.setCenter(_2b.getCenterLonLat(),this.map.zoom);
},getRectPxBounds:function(){
var top=parseInt(this.extentRectangle.style.top);
var _2d=parseInt(this.extentRectangle.style.left);
var _2e=parseInt(this.extentRectangle.style.height);
var _2f=parseInt(this.extentRectangle.style.width);
return new OpenLayers.Bounds(_2d,top+_2e,_2d+_2f,top);
},setRectPxBounds:function(_30){
var top=Math.max(_30.top,0);
var _32=Math.max(_30.left,0);
var _33=Math.min(_30.top+Math.abs(_30.getHeight()),this.ovmap.size.h-this.hComp);
var _34=Math.min(_30.left+_30.getWidth(),this.ovmap.size.w-this.wComp);
this.extentRectangle.style.top=parseInt(top)+"px";
this.extentRectangle.style.left=parseInt(_32)+"px";
this.extentRectangle.style.height=parseInt(Math.max(_33-top,0))+"px";
this.extentRectangle.style.width=parseInt(Math.max(_34-_32,0))+"px";
},getRectBoundsFromMapBounds:function(_35){
var _36=new OpenLayers.LonLat(_35.left,_35.bottom);
var _37=new OpenLayers.LonLat(_35.right,_35.top);
var _38=this.getOverviewPxFromLonLat(_36);
var _39=this.getOverviewPxFromLonLat(_37);
var _3a=null;
if(_38&&_39){
_3a=new OpenLayers.Bounds(_38.x,_38.y,_39.x,_39.y);
}
return _3a;
},getMapBoundsFromRectBounds:function(_3b){
var _3c=new OpenLayers.Pixel(_3b.left,_3b.bottom);
var _3d=new OpenLayers.Pixel(_3b.right,_3b.top);
var _3e=this.getLonLatFromOverviewPx(_3c);
var _3f=this.getLonLatFromOverviewPx(_3d);
return new OpenLayers.Bounds(_3e.lon,_3e.lat,_3f.lon,_3f.lat);
},getLonLatFromOverviewPx:function(_40){
var _41=this.ovmap.size;
var res=this.ovmap.getResolution();
var _43=this.ovmap.getExtent().getCenterLonLat();
var _44=_40.x-(_41.w/2);
var _45=_40.y-(_41.h/2);
return new OpenLayers.LonLat(_43.lon+_44*res,_43.lat-_45*res);
},getOverviewPxFromLonLat:function(_46){
var res=this.ovmap.getResolution();
var _48=this.ovmap.getExtent();
var px=null;
if(_48){
px=new OpenLayers.Pixel(Math.round(1/res*(_46.lon-_48.left)),Math.round(1/res*(_48.top-_46.lat)));
}
return px;
},show:function(){
this.element.style.display="block";
},hide:function(){
this.element.style.display="none";
},CLASS_NAME:"Roja.Control.OverviewMap"});

Roja.Control.PanZoomButton=OpenLayers.Class(Roja.Control.NavToolbar,{imageLocation:"toolbar/internal/",mode:"zoombox",initialize:function(_1){
Roja.Control.NavToolbar.prototype.initialize.apply(this,arguments);
this.image=document.createElement("img");
if(!this.position){
this.position=new OpenLayers.Pixel(Roja.Control.PanZoomButton.X,Roja.Control.PanZoomButton.Y);
}
},draw:function(){
Roja.Control.NavToolbar.prototype.draw.apply(this,arguments);
this.drawSingleButton();
OpenLayers.Event.observe(this.div,"mousedown",this.onMouseDown.bind(this));
return this.div;
},drawSingleButton:function(){
this.image=document.createElement("img");
switch(this.mode){
case "zoombox":
this.image.src=OpenLayers.ImgPath+this.imageLocation+"pan_off.gif";
break;
case "pan":
this.image.src=OpenLayers.ImgPath+this.imageLocation+"zin_off.gif";
break;
}
this.div.appendChild(this.image);
},redraw:function(){
},onMouseDown:function(_2){
switch(this.mode){
case "zoombox":
this.activateControl(this.controls[2]);
this.image.src=OpenLayers.ImgPath+this.imageLocation+"zin_off.gif";
this.mode="pan";
break;
case "pan":
this.activateControl(this.controls[0]);
this.image.src=OpenLayers.ImgPath+this.imageLocation+"pan_off.gif";
this.mode="zoombox";
break;
}
OpenLayers.Event.stop(_2);
},CLASS_NAME:"Roja.Control.PanZoomButton"});
Roja.Control.PanZoomButton.X=0;
Roja.Control.PanZoomButton.Y=0;

Roja.Control.S3D=OpenLayers.Class(OpenLayers.Control,{S3D:null,initialize:function(_1){
OpenLayers.Control.prototype.initialize.apply(this,arguments);
},activate:function(){
this.S3D.callSardegna3D();
return OpenLayers.Control.prototype.activate.apply(this,arguments);
},CLASS_NAME:"Roja.Control.S3D"});

Roja.Control.SimpleLayerSwitcher=OpenLayers.Class(OpenLayers.Control.LayerSwitcher,{layerStates:null,baseLayers:null,ascending:true,rightPosition:false,layerMoreDiv:null,overlayDiv:null,overlayDivOpened:false,titleMore:null,outGroupText:"Altri temi",outGroupDiv:null,groups:{display:{}},initialize:function(_1){
OpenLayers.Control.prototype.initialize.apply(this,arguments);
this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME);
this.layerStates=[];
hackCSSLayerSwitcherOverlayDivSize=0;
},destroy:function(){
OpenLayers.Event.stopObservingElement(this.div);
this.clearLayersArray();
this.map.events.unregister("addlayer",this,this.redraw);
this.map.events.unregister("changelayer",this,this.redraw);
this.map.events.unregister("removelayer",this,this.redraw);
this.map.events.unregister("changebaselayer",this,this.redraw);
this.map.events.unregister("zoomend",this,this.redraw);
OpenLayers.Control.prototype.destroy.apply(this,arguments);
},setMap:function(_2){
OpenLayers.Control.prototype.setMap.apply(this,arguments);
this.map.events.register("addlayer",this,this.redraw);
this.map.events.register("changelayer",this,this.redraw);
this.map.events.register("removelayer",this,this.redraw);
this.map.events.register("changebaselayer",this,this.redraw);
this.map.events.register("zoomend",this,this.redraw);
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this);
if(this.rightPosition){
this.div.style.right=this.position.x;
this.div.style.left="";
}
this.loadContents();
this.redraw();
return this.div;
},clearLayersArray:function(){
var _3=this["baseLayers"];
if(_3){
for(var i=0;i<_3.length;i++){
var _5=_3[i];
OpenLayers.Event.stopObservingElement(_5.inputElem);
OpenLayers.Event.stopObservingElement(_5.labelSpan);
}
}
if(this.layerMoreDiv!=null){
this.layerMoreDiv.innerHTML="";
this.layerMoreDiv=null;
this.overlayDiv.innerHTML="";
this.overlayDiv=null;
}
this.div.innerHTML="";
},checkRedraw:function(){
var _6=false;
if(!this.layerStates.length||(this.map.layers.length!=this.layerStates.length)){
_6=true;
}else{
for(var i=0;i<this.layerStates.length;i++){
var _8=this.layerStates[i];
var _9=this.map.layers[i];
if((_8.name!=_9.name)||(_8.inRange!=_9.inRange)||(_8.id!=_9.id)||(_8.visibility!=_9.visibility)){
_6=true;
break;
}
}
}
return _6;
},redraw:function(){
if(!this.checkRedraw()){
return this.div;
}
this.clearLayersArray();
var _a=false;
this.layerStates=[];
for(var i=0;i<this.map.layers.length;i++){
var _c=this.map.layers[i];
if(_c.CLASS_NAME=="Roja.Layer.WMS"&&_c.layers!=null&&_c.layers.length>0){
for(var j=0;j<_c.layers.length;j++){
var _e={"name":_c.logicalName,"visibility":_c.visibility,"inRange":_c.inRange,"id":_c.id};
this.layerStates.push(_e);
}
}else{
var _e={"name":_c.name,"visibility":_c.visibility,"inRange":_c.inRange,"id":_c.id};
this.layerStates.push(_e);
}
}
var _f=this.getAllLayers();
if(!this.ascending){
_f.reverse();
}
if(this.layerMoreDiv){
var _10=this.overlayDiv.childNodes;
for(var k=0;k<_10.length;k++){
var _12=_10[k];
_12.getElementsByTagName("input")[0].checked=false;
_12.getElementsByTagName("input")[0].defaultChecked=false;
}
}
var _13=false;
for(var i=0;i<_f.length&&_13==false;i++){
if(_f[i].group!=null&&_f[i].group!=""&&_f[i].displayInLayerSwitcher==true){
_13=true;
}
}
var j=0;
var _14=[];
for(var i=0;i<_f.length;i++){
var _c=_f[i];
var _15=_c.isBaseLayer;
if(_c.displayInLayerSwitcher&&_15){
j++;
var _16=(_15)?(_c==this.map.baseLayer):_c.getVisibility();
var _17=document.createElement("div");
_17.id=this.id+"_layerdiv_"+j;
if(_16){
_17.className="buttonClassSelected";
}else{
_17.className="buttonClassUnselected";
}
var _18={"inputElem":_17,"layer":_c,"layerSwitcher":this};
OpenLayers.Event.observe(_17,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputClick,_18));
var _19=document.createElement("span");
_19.innerHTML=_c.name;
OpenLayers.Event.observe(_19,"click",OpenLayers.Function.bindAsEventListener(this.onInputClick,_18));
_17.appendChild(_19);
_14.push(_17);
}else{
if(_c.displayInLayerSwitcher&&!_15){
if(this.layerMoreDiv==null){
this.layerMoreDiv=document.createElement("div");
this.layerMoreDiv.id=this.id+"_layermorediv";
this.layerMoreDiv.className="buttonClassUnselected moreDivUnselected";
var _19=document.createElement("span");
_19.innerHTML=this.titleMore;
this.layerMoreDiv.appendChild(_19);
this.overlayDiv=document.createElement("div");
this.overlayDiv.id=this.id+"_overlaydiv";
this.overlayDiv.className="overlayDiv hidden";
var _18={"layerMoreDiv":this.layerMoreDiv,"overlayDiv":this.overlayDiv,"layerSwitcher":this};
OpenLayers.Event.observe(this.layerMoreDiv,"mouseover",OpenLayers.Function.bindAsEventListener(this.showOverlayDivEvent,_18));
OpenLayers.Event.observe(this.layerMoreDiv,"mouseout",OpenLayers.Function.bindAsEventListener(this.hideOverlayDiv,_18));
OpenLayers.Event.observe(this.overlayDiv,"mouseover",OpenLayers.Function.bindAsEventListener(this.showOverlayDivEvent,_18));
OpenLayers.Event.observe(this.overlayDiv,"mouseout",OpenLayers.Function.bindAsEventListener(this.hideOverlayDiv,_18));
this.div.appendChild(this.overlayDiv);
}
var _1a=document.createElement("div");
_1a.id="div_"+_c.name;
if(_13){
_1a.className="layerDiv";
}
var _1b=document.createElement("input");
_1b.id="input_"+_c.name+"_"+i;
_1b.name=_c.name;
_1b.type="checkbox";
_1b.value=_c.name;
_1b.className="inputLayerDiv";
var _16=null;
var _1c=null;
if(_c.CLASS_NAME=="Roja.WMSLayer"){
_16=_c.calculateInRange(this.map.getZoom())&&_c.getVisibility();
_1c=_c.calculateInRange(this.map.getZoom());
}else{
_16=_c.calculateInRange()&&_c.getVisibility();
_1c=_c.calculateInRange();
}
if(!_1c){
_1b.disabled="disabled";
}else{
_1b.disabled="";
}
_1b.checked=_16;
_1b.defaultChecked=_16;
var _18={"overlay":_c,"inputElem":_1b,"layerSwitcher":this};
OpenLayers.Event.observe(_1b,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputOverlayClick,_18));
OpenLayers.Event.observe(_1b,"keyup",OpenLayers.Function.bindAsEventListener(this.onInputOverlayKeyPress,_18));
_1a.appendChild(_1b);
var _19=document.createElement("span");
_19.innerHTML=_c.name;
_19.className="titleLayer";
_1a.appendChild(_19);
OpenLayers.Event.observe(_19,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputOverlayClick,_18));
if(this.overlayDivOpened){
this.showOverlayDiv();
}
if(_13){
this.insertLayerDivToOverlay(_1a,_c,_16,_1c);
}else{
this.overlayDiv.appendChild(_1a);
}
}
}
}
if(_13&&this.outGroupDiv!=null){
this.overlayDiv.removeChild(this.outGroupDiv);
this.overlayDiv.appendChild(this.outGroupDiv);
}
if(this.layerMoreDiv!=null){
this.div.appendChild(this.layerMoreDiv);
}
for(var i=0;i<_14.length;i++){
this.div.appendChild(_14[i]);
}
return this.div;
},setLegend:function(_1d,div){
if(div!=null){
_1d.legendId=div.id;
var _1f=_1d.getFullRequestString({REQUEST:"getlegendgraphic",LAYER:_1d.params.LAYERS,format:"image/png",sld:_1d.params.SLD,HEIGHT:null,WIDTH:null});
if(_1d.legendImage!=null){
div.removeChild(_1d.legendImage);
_1d.legendImage=null;
}
_1d.legendImage=OpenLayers.Util.createImage(null,0,0,_1f);
_1d.imgId=_1d.legendImage.id;
div.appendChild(_1d.legendImage);
}
},insertLayerDivToOverlay:function(_20,_21,_22,_23){
var _24=null;
var _25=false;
var _26=this.overlayDiv.childNodes;
if(_21.group==null||_21.group==""){
_21.group=this.outGroupText;
}
if(_26!=null&&_26.length>0){
for(var k=0;k<_26.length&&_24==null;k++){
var _28=_26[k];
if(_28.id=="div_"+_21.group.replace(/ /,"_")){
_24=_28;
}else{
if(_28.id>"div_"+_21.group.replace(/ /,"_")){
var _29=this.createGroupDiv(_21);
this.overlayDiv.insertBefore(_29,_28);
_24=_29;
}
}
}
if(_24==null){
var _29=this.createGroupDiv(_21);
this.overlayDiv.appendChild(_29);
_24=_29;
}
}else{
var _29=this.createGroupDiv(_21);
this.overlayDiv.appendChild(_29);
_24=_29;
}
if(!_24.getElementsByTagName("input")[0].checked&&!_24.getElementsByTagName("input")[0].defaultChecked){
_24.getElementsByTagName("input")[0].checked=_22;
_24.getElementsByTagName("input")[0].defaultChecked=_22;
}
if(_24.getElementsByTagName("input")[0].disabled&&_23==true){
_24.getElementsByTagName("input")[0].disabled="";
}
var _2a=_24.getElementsByTagName("div")[0];
var _2b=_2a.getElementsByTagName("div");
var _2c=false;
if(_2b!=null&&_2b.length>0){
for(var k=0;k<_2b.length&&_2c==false;k++){
var _2d=_2b[k];
if(_2d.id>"div_"+_21.name){
_2a.insertBefore(_20,_2d);
_2c=true;
}
}
if(_2c==false){
_2a.appendChild(_20);
}
}
if(_2c==false){
_2a.appendChild(_20);
}
},createGroupDiv:function(_2e){
var _2f=document.createElement("div");
_2f.id="div_"+_2e.group.replace(/ /,"_");
var _30=document.createElement("span");
_30.innerHTML="<img src='"+baseUrl+"/roja/resources/img/plus2.gif' />";
_2f.appendChild(_30);
_30.className="IconMenutitleGroup";
var _31=document.createElement("input");
_31.id="input_"+_2e.group;
_31.name=_2e.group;
_31.type="checkbox";
_31.value=_2e.group;
_31.className="inputGroupLayerDiv";
_31.disabled="disabled";
var _32={groupDiv:_2f,layerSwitcher:this,inputElem:_31};
OpenLayers.Event.observe(_31,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputGroupClick,_32));
_2f.appendChild(_31);
var _33=document.createElement("span");
_33.innerHTML=_2e.group;
_2f.appendChild(_33);
_33.className="titleGroup";
var _34=document.createElement("div");
_34.id="div_content_"+_2e.group.replace(/ /,"_");
_34.style.display="none";
if(this.groups.display[_34.id]=="block"){
_34.style.display="block";
}
var _32={contentDiv:_34,groups:this.groups};
OpenLayers.Event.observe(_33,"mouseup",OpenLayers.Function.bindAsEventListener(this.onTitleGroupClick,_32));
OpenLayers.Event.observe(_30,"mouseup",OpenLayers.Function.bindAsEventListener(this.onTitleGroupClick,_32));
_2f.appendChild(_34);
if(_2e.group==this.outGroupText){
this.outGroupDiv=_2f;
}
return _2f;
},onInputGroupClick:function(e){
var _36=!this.inputElem.checked;
var _37=this.groupDiv.getElementsByTagName("input");
this.inputElem.checked=_36;
this.inputElem.defaultChecked=_36;
for(var i=1;i<_37.length;i++){
_37[i].checked=_36;
}
this.layerSwitcher.updateMap();
this.layerSwitcher.redraw();
OpenLayers.Event.stop(e);
},onTitleGroupClick:function(e){
if(this.contentDiv.style.display=="none"){
this.contentDiv.style.display="block";
this.groups.display[this.contentDiv.id]="block";
this.contentDiv.parentNode.children[0].innerHTML="<img src='"+baseUrl+"/roja/resources/img/minus2.gif' />";
}else{
this.contentDiv.style.display="none";
this.groups.display[this.contentDiv.id]="none";
this.contentDiv.parentNode.children[0].innerHTML="<img src='"+baseUrl+"/roja/resources/img/plus2.gif' />";
}
OpenLayers.Event.stop(e);
},showOverlayDivEvent:function(e){
this.overlayDiv.className=this.overlayDiv.className.replace("hidden","show");
this.layerMoreDiv.className=this.layerMoreDiv.className.replace("moreDivUnselected","moreDivSelected");
this.layerSwitcher.overlayDivOpened=true;
var _3b=navigator.appVersion.split("MSIE");
var _3c=parseFloat(_3b[1]);
},showOverlayDiv:function(){
this.overlayDiv.className=this.overlayDiv.className.replace("hidden","show");
this.layerMoreDiv.className=this.layerMoreDiv.className.replace("moreDivUnselected","moreDivSelected");
this.overlayDivOpened=true;
},hideOverlayDiv:function(e){
this.overlayDiv.className=this.overlayDiv.className.replace("show","hidden");
this.layerMoreDiv.className=this.layerMoreDiv.className.replace("moreDivSelected","moreDivUnselected");
this.layerSwitcher.overlayDivOpened=false;
},onInputClick:function(e){
if(this.layer.minZoomVisibleLevel!=null){
if(this.layer.minZoomVisibleLevel>this.layer.map.zoom){
alert(mapNotVisible);
OpenLayers.Event.stop(e);
return;
}
}
this.layer.map.setBaseLayer(this.layer);
if(this.layer.backgroundColor!=null){
this.layer.map.viewPortDiv.style.backgroundColor=this.layer.backgroundColor;
this.layer.map.backgroundColor=this.layer.backgroundColor;
}else{
this.layer.map.viewPortDiv.style.backgroundColor=null;
}
if(this.layerSwitcher.overlay){
this.layerSwitcher.overlay.setVisibility(false);
}
if(this.layer.overlay){
this.layerSwitcher.overlay=this.layer.map.getLayerByName(this.layer.overlay);
this.layerSwitcher.overlay.setVisibility(true);
}
OpenLayers.Event.stop(e);
},onInputOverlayClick:function(e){
if(!this.inputElem.disabled){
this.inputElem.checked=!this.inputElem.checked;
this.overlay.setVisibility(this.inputElem.checked);
this.layerSwitcher.updateMap();
}else{
}
OpenLayers.Event.stop(e);
},onInputOverlayKeyPress:function(evt){
if(evt.keyCode==32){
if(!this.inputElem.disabled){
this.inputElem.checked=!this.inputElem.checked;
this.overlay.setVisibility(this.inputElem.checked);
}else{
alert(zoomLevelInvalid);
}
}
OpenLayers.Event.stop(evt);
},onLayerClick:function(e){
this.updateMap();
},updateMap:function(){
var _42=[];
var _43=[];
var _44=this.overlayDiv.childNodes;
if(_44!=null&&_44.length>0){
for(var k=0;k<_44.length;k++){
var _46=_44[k];
var _47=_46.getElementsByTagName("div");
if(_47!=null&&_47.length>0){
for(var i=0;i<_47.length;i++){
var _49=_47[i];
var _4a=_49.getElementsByTagName("input")[0];
var _4b=this.getLayerByName(_4a.name);
if(_4b){
_42.push(_4b);
_43.push(_4a.checked);
}
}
}
}
}
for(var k=0;k<_42.length;k++){
_42[k].setVisibility(_43[k]);
}
this.redrawRojaWMSLayer();
},loadContents:function(){
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);
},ignoreEvent:function(evt){
OpenLayers.Event.stop(evt);
},mouseDown:function(evt){
this.isMouseDown=true;
this.ignoreEvent(evt);
},mouseUp:function(evt){
if(this.isMouseDown){
this.isMouseDown=false;
this.ignoreEvent(evt);
}
},getAllLayers:function(){
var _4f=[];
for(var i=0;i<this.map.layers.length;i++){
var _51=this.map.layers[i];
if(_51.CLASS_NAME=="Roja.Layer.WMS"&&_51.layers!=null&&_51.layers.length>0){
for(var j=0;j<_51.layers.length;j++){
_4f.push(_51.layers[j]);
}
}else{
_4f.push(_51);
}
}
return _4f;
},getAllTMSLayers:function(){
var _53=[];
for(var i=0;i<this.map.layers.length;i++){
var _55=this.map.layers[i];
if(_55.CLASS_NAME=="Roja.Layer.RasTMS"||_55.CLASS_NAME=="OpenLayers.Layer.TMS"){
_53.push(_55);
}
}
return _53;
},getLayerByName:function(_56){
var _57=[];
for(var i=0;i<this.map.layers.length;i++){
var _59=this.map.layers[i];
if(_59.CLASS_NAME=="Roja.Layer.WMS"&&_59.layers!=null&&_59.layers.length>0){
for(var j=0;j<_59.layers.length;j++){
if(_59.layers[j].name==_56){
return _59.layers[j];
}
}
}else{
if(_59.name&&_59.name==_56){
return _59;
}
}
}
return null;
},redrawRojaWMSLayer:function(){
var _5b=this.map.layers;
for(var i=0;i<_5b.length;i++){
var _5d=_5b[i];
if(_5d.CLASS_NAME=="Roja.Layer.WMS"){
_5d.redraw();
}
}
this.map.events.triggerEvent("changelayer");
},CLASS_NAME:"Roja.Control.SimpleLayerSwitcher"});

Roja.Control.UrlOnMap=OpenLayers.Class(Roja.Control,{element:null,text:"",href:"http://www.cgrit.it/",isCopyright:true,initialize:function(_1){
Roja.Control.prototype.initialize.apply(this,[_1]);
},destroy:function(){
if(!this.element){
return;
}
this.element.removeChild(this.address);
this.div.removeChild(this.element);
this.address=null;
this.element=null;
Roja.Control.prototype.destroy.apply(this,arguments);
},draw:function(){
Roja.Control.prototype.draw.apply(this,arguments);
if(this.isCopyright){
this.map.copyrightControl=this;
}
this.address=Roja.createUrl(this.href,this.text);
this.address.className=this.displayClass+"Address";
this.element=document.createElement("div");
this.element.className=this.displayClass+"Background";
this.element.style.display="";
this.element.title="";
this.element.appendChild(this.address);
this.div.appendChild(this.element);
this.events=new OpenLayers.Events(this,this.div,null);
this.events.register("dblclick",this.div,this.stopevent);
var _2={"link":this.href};
return this.div;
},penUrl:function(){
var _3=(this.link).toLowerCase();
_3=_3.replace(/ /g,"");
_3=_3.replace(/ /g,"");
_3=_3.replace(/'/g,"");
var _4=new Object();
_4=window.open(_3,"","");
_4.focus();
},stopevent:function(_5){
OpenLayers.Event.stop(_5,false);
},redraw:function(){
if(this.href!=""){
if(this.span!=null){
this.element.removeChild(this.span);
this.span=null;
}
if(this.address==null){
this.address=document.createElement("a");
this.element.appendChild(this.address);
}
this.address.className=this.displayClass+"Address";
this.address.href=this.href;
this.address.innerHTML=this.text;
this.address.target="_blank";
}else{
if(this.address!=null){
this.element.removeChild(this.address);
this.address=null;
}
if(this.span==null){
this.span=document.createElement("span");
this.element.appendChild(this.span);
}
this.span.className=this.displayClass+"Span";
this.span.innerHTML=this.text;
this.span.target="_blank";
}
},setUrl:function(_6,_7){
this.text=_7;
this.href=_6;
this.redraw();
},show:function(){
this.element.style.display="block";
},hide:function(){
this.element.style.display="none";
},CLASS_NAME:"Roja.Control.UrlOnMap"});

Roja.Control.ZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoom,{small:false,imageLocation:"/",zoomStopWidth:13,zoomStopHeight:8,slider:null,sliderIcon:"slider.gif",zoombarIcon:"zoombar.gif",sliderSize:new OpenLayers.Size(13,15),sliderEvents:null,zoomBarDiv:null,divEvents:null,moveCursoStyle:"move",events:null,mapCenter:null,mapZoomLevel:1,EVENT_TYPES:["drawComplete"],initialize:function(){
OpenLayers.Control.PanZoom.prototype.initialize.apply(this,arguments);
this.events=new OpenLayers.Events(this,this,this.EVENT_TYPES,this.fallThrough,{includeXY:true});
},destroy:function(){
if(this.slider!=null){
this.div.removeChild(this.slider);
this.slider=null;
}
if(this.sliderEvents!=null){
this.sliderEvents.destroy();
this.sliderEvents=null;
}
if(this.zoomBarDiv!=null){
this.div.removeChild(this.zoombarDiv);
this.zoomBarDiv=null;
}
if(this.divEvents!=null){
this.divEvents.destroy();
this.divEvents=null;
}
this.events.destroy();
this.events=null;
this.map.events.unregister("zoomend",this,this.moveZoomBar);
this.map.events.unregister("changebaselayer",this,this.redraw);
OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments);
},setMap:function(_1){
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(px){
Roja.Control.prototype.draw.apply(this,arguments);
px=this.position.clone();
this.buttons=[];
var sz=new OpenLayers.Size(16,16);
var _4=new OpenLayers.Size(14,14);
var _5=new OpenLayers.Pixel(px.x+20+sz.w/2,px.y+10+sz.w/2);
if(this.small){
_5=new OpenLayers.Pixel(px.x+5+sz.w/2,px.y-11+sz.w/2);
}
this._addButton("ombratop","ombratop.gif",_5.add(-14,3),0);
this._addButton("ombraplus","ombrasquare.gif",_5.add(4,sz.h*3+13),_4);
if(!this.small){
var _6=new OpenLayers.Size(14,this.zoomStopHeight*(this.map.getNumZoomLevels()+1));
this._addButton("ombrabar","ombrasquare.gif",_5.add(+2,sz.h*4+9),_6);
}else{
this._addButton("ombratop","ombratop.gif",_5.add(-14,3),0);
this._addButton("ombraplus","ombrasquare.gif",_5.add(4,sz.h*3+13),_4);
}
this._addButton("panup","north-mini.gif",_5.add(0,-1),sz);
px.y=_5.y+sz.h;
this._addButton("panleft","west-mini.gif",_5.add(-sz.w-1,sz.h),sz);
this._addButton("zoomworld","zoom-world-mini.gif",_5.add(0,sz.h),sz);
this._addButton("panright","east-mini.gif",_5.add(sz.w+1,sz.h),sz);
this._addButton("pandown","south-mini.gif",_5.add(0,sz.h*2+1),sz);
this._addButton("zoomin","zoom-plus-mini.gif",_5.add(0,sz.h*3+9),sz);
if(!this.small){
_5=this._addZoomBar(_5.add(+1,sz.h*4+9));
}
if(!this.small){
this._addButton("ombraminus","ombrasquare.gif",_5.add(3,sz.h/2+4),_4);
this._addButton("zoomout","zoom-minus-mini.gif",_5.add(-1,sz.h/2),sz);
}else{
this._addButton("ombraminus","ombrasquare.gif",_5.add(2,sz.h*3+29),sz);
this._addButton("zoomout","zoom-minus-mini.gif",_5.add(0,sz.h*3+27),sz);
}
return this.div;
},_addButton:function(id,_8,xy,sz){
var _b=OpenLayers.Util.getImagesLocation()+_8;
var _c=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+id,xy,sz,_b,"absolute");
this.div.appendChild(_c);
OpenLayers.Util.extend(_c,{zoombar:this});
OpenLayers.Event.observe(_c,"mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,_c));
OpenLayers.Event.observe(_c,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick,_c));
OpenLayers.Event.observe(_c,"click",OpenLayers.Function.bindAsEventListener(this.doubleClick,_c));
_c.action=id;
_c.map=this.map;
if(!this.slideRatio){
var _d=this.slideFactor;
var _e=function(){
return _d;
};
}else{
var _f=this.slideRatio;
var _e=function(dim){
return this.map.getSize()[dim]*_f;
};
}
_c.getSlideFactor=_e;
this.buttons.push(_c);
return _c;
},_addZoomBar:function(_11){
var _12=OpenLayers.Util.getImagesLocation();
var id="OpenLayers_Control_PanZoomBar_Slider"+this.map.id;
var _14=this.map.getNumZoomLevels()-1-this.map.getZoom();
var _15=OpenLayers.Util.createAlphaImageDiv(id,_11.add(-1,_14*this.zoomStopHeight),this.sliderSize,_12+this.imageLocation+this.sliderIcon,"absolute");
this.slider=_15;
this.sliderEvents=new OpenLayers.Events(this,_15,null,true,{includeXY:true});
this.sliderEvents.register("mousedown",this,this.zoomBarDown);
this.sliderEvents.register("mousemove",this,this.zoomBarDrag);
this.sliderEvents.register("mouseup",this,this.zoomBarUp);
this.sliderEvents.register("dblclick",this,this.doubleClick);
this.sliderEvents.register("click",this,this.doubleClick);
sz=new OpenLayers.Size();
sz.h=this.zoomStopHeight*(this.map.getNumZoomLevels()+1);
sz.w=this.zoomStopWidth;
var div=null;
if(OpenLayers.Util.alphaHack()){
var id="OpenLayers_Control_PanZoomBar"+this.map.id;
div=OpenLayers.Util.createAlphaImageDiv(id,_11,new OpenLayers.Size(sz.w,this.zoomStopHeight),_12+this.zoombarIcon,"absolute",null,"crop");
div.style.height=sz.h;
}else{
div=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,_11,sz,_12+this.zoombarIcon);
}
this.zoombarDiv=div;
this.divEvents=new OpenLayers.Events(this,div,null,true,{includeXY:true});
this.divEvents.register("mousedown",this,this.divClick);
this.divEvents.register("mousemove",this,this.passEventToSlider);
this.divEvents.register("dblclick",this,this.doubleClick);
this.divEvents.register("click",this,this.doubleClick);
var _17=navigator.appVersion.indexOf("MSIE");
if(_17!=-1){
this.divEvents.register("mouseover",this,this.removeOffset);
}
this.div.appendChild(div);
this.startTop=parseInt(div.style.top);
this.div.appendChild(_15);
this.map.events.register("zoomend",this,this.moveZoomBar);
_11=_11.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());
return _11;
},buttonDown:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
switch(this.action){
case "panup":
this.map.pan(0,-50);
break;
case "pandown":
this.map.pan(0,50);
break;
case "panleft":
this.map.pan(-50,0);
break;
case "panright":
this.map.pan(50,0);
break;
case "zoomin":
this.map.zoomIn();
break;
case "zoomout":
this.map.zoomOut();
break;
case "zoomworld":
if(this.zoombar.mapCenter==null){
this.map.zoomToExtent(this.map.getMaxExtent());
}else{
this.map.setCenter(this.zoombar.mapCenter,this.zoombar.mapZoomLevel);
}
break;
}
OpenLayers.Event.stop(evt);
},decodeParameters:function(_19){
_19=_19.replace(/&lt;/g,"<");
_19=_19.replace(/&gt;/g,">");
return _19;
},passEventToSlider:function(evt){
this.sliderEvents.handleBrowserEvent(evt);
},removeOffset:function(evt){
this.zoombarDiv.offsets=null;
},divClick:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
var y=evt.xy.y;
var top=OpenLayers.Util.pagePosition(evt.object)[1];
var _1f=Math.floor((y-top)/this.zoomStopHeight);
this.map.zoomTo((this.map.getNumZoomLevels()-1)-_1f);
OpenLayers.Event.stop(evt);
},zoomBarDown:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
this.map.events.register("mousemove",this,this.passEventToSlider);
this.map.events.register("mouseup",this,this.passEventToSlider);
this.mouseDragStart=evt.xy.clone();
this.zoomStart=evt.xy.clone();
this.div.style.cursor=this.moveCursoStyle;
this.zoombarDiv.offsets=null;
OpenLayers.Event.stop(evt);
},zoomBarDrag:function(evt){
if(this.mouseDragStart!=null){
var _22=this.mouseDragStart.y-evt.xy.y;
var _23=OpenLayers.Util.pagePosition(this.zoombarDiv);
if((evt.clientY-_23[1])>0&&(evt.clientY-_23[1])<parseInt(this.zoombarDiv.style.height)-2){
var _24=parseInt(this.slider.style.top)-_22;
this.slider.style.top=_24+"px";
}
this.mouseDragStart=evt.xy.clone();
OpenLayers.Event.stop(evt);
}
},zoomBarUp:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
if(this.zoomStart){
this.div.style.cursor="";
this.map.events.unregister("mouseup",this,this.passEventToSlider);
this.map.events.unregister("mousemove",this,this.passEventToSlider);
var _26=this.zoomStart.y-evt.xy.y;
this.map.zoomTo(this.map.zoom+Math.round(_26/this.zoomStopHeight));
this.moveZoomBar();
this.mouseDragStart=null;
OpenLayers.Event.stop(evt);
}
},moveZoomBar:function(){
var _27=((this.map.getNumZoomLevels()-1)-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;
this.slider.style.top=_27+"px";
},CLASS_NAME:"Roja.Control.ZoomBar"});

Roja.Control.ZoomBox=OpenLayers.Class(OpenLayers.Control.ZoomBox,{zoomClickEnabled:true,type:OpenLayers.Control.TYPE_TOOL,activate:function(){
this.map.div.style.cursor="crosshair";
return OpenLayers.Control.prototype.activate.apply(this,arguments);
},deactivate:function(){
this.map.div.style.cursor="";
return OpenLayers.Control.prototype.deactivate.apply(this,arguments);
},zoomBox:function(_1){
if(_1 instanceof OpenLayers.Bounds){
var _2=this.map.getLonLatFromPixel(new OpenLayers.Pixel(_1.left,_1.bottom));
var _3=this.map.getLonLatFromPixel(new OpenLayers.Pixel(_1.right,_1.top));
var _4=new OpenLayers.Bounds(_2.lon,_2.lat,_3.lon,_3.lat);
if(this.map.getZoomForExtent(_4)>0){
this.map.zoomToExtent(_4);
}
}else{
if(this.zoomClickEnabled){
this.map.setCenter(this.map.getLonLatFromPixel(_1),this.map.getZoom()+1);
}
}
},CLASS_NAME:"Roja.Control.ZoomBox"});

Roja.Control.ZoomBoxOut=OpenLayers.Class(Roja.Control,{zoomClickEnabled:true,type:OpenLayers.Control.TYPE_TOOL,activate:function(){
this.map.div.style.cursor="crosshair";
return OpenLayers.Control.prototype.activate.apply(this,arguments);
},deactivate:function(){
this.map.div.style.cursor="";
return OpenLayers.Control.prototype.deactivate.apply(this,arguments);
},draw:function(){
this.handler=new OpenLayers.Handler.Box(this,{done:this.zoomBoxOut});
},zoomBoxOut:function(_1){
if(_1 instanceof OpenLayers.Bounds){
var _2=Math.abs(_1.right-_1.left);
var _3=Math.abs(_1.top-_1.bottom);
var _4=Math.min((this.map.size.h/_3),(this.map.size.w/_2));
var _5=this.map.getExtent();
var _6=this.map.getLonLatFromPixel(_1.getCenterPixel());
var _7=_6.lon-(_5.getWidth()/2)*_4;
var _8=_6.lon+(_5.getWidth()/2)*_4;
var _9=_6.lat-(_5.getHeight()/2)*_4;
var _a=_6.lat+(_5.getHeight()/2)*_4;
var _b=new OpenLayers.Bounds(_7,_9,_8,_a);
this.map.zoomToExtent(_b);
}else{
if(this.zoomClickEnabled){
if(this.map.layerMinZoomLevel){
if(this.map.getLayerByName(this.map.layerMinZoomLevel)==null||this.map.getZoom()>0){
var _c=this.map.getLonLatFromPixel(_1);
var _d=this.map.getZoom()-1;
if(!this.map.center&&!this.map.isValidLonLat(_c)){
_c=this.map.maxExtent.getCenterLonLat();
}
if(this.map.restrictedExtent!=null){
if(_c==null){
_c=this.map.getCenter();
}
if(_d==null){
_d=this.map.getZoom();
}
var _e=this.map.getResolutionForZoom(_d);
var _5=this.map.calculateBounds(_c,_e);
if(!this.map.restrictedExtent.containsBounds(_5)){
return;
}
}
this.map.setCenter(this.map.getLonLatFromPixel(_1),this.map.getZoom()-1);
}
}else{
var _c=this.map.getLonLatFromPixel(_1);
var _d=this.map.getZoom()-1;
if(!this.map.center&&!this.map.isValidLonLat(_c)){
_c=this.map.maxExtent.getCenterLonLat();
}
if(this.map.restrictedExtent!=null){
if(_c==null){
_c=this.map.getCenter();
}
if(_d==null){
_d=this.map.getZoom();
}
var _e=this.map.getResolutionForZoom(_d);
var _5=this.map.calculateBounds(_c,_e);
if(!this.map.restrictedExtent.containsBounds(_5)){
return;
}
}
this.map.setCenter(this.map.getLonLatFromPixel(_1),this.map.getZoom()-1);
}
}
}
},CLASS_NAME:"Roja.Control.ZoomBoxOut"});

Roja.Control.FloatingPanel.AutoCompleteFind=OpenLayers.Class(Roja.Control.FloatingPanel,{iconUrl:"signal_shadow.png",iconSize:new OpenLayers.Size(68,48),restrictedAreaSize:null,link:null,url:null,balloonTip:null,markersLayer:null,marker:null,currValue:"",lista:null,listBounds:null,bounds:null,selectedIndex:0,name:"",fallThrough:false,events:null,NONE:0,LOAD_COMPLETE:1,LOAD_ERROR:11,NO_ELEMENTS:12,INCONSISTENCE_TEXT:13,EVENT_TYPES:["loadComplete","loadFailure"],status_code:null,initialize:function(_1){
Roja.Control.FloatingPanel.prototype.initialize.apply(this,[_1]);
this.idname=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
this.events=new OpenLayers.Events(this,this,this.EVENT_TYPES,this.fallThrough);
},destroy:function(){
if(!this.divRicercaComune){
return;
}
if(this.divHref){
OpenLayers.Event.stopObserving(this.divHref,"click",this.setLocalita.bind(this));
this.divLi.removeChild(this.divHref);
if(this.divUl!=null){
this.divUl.removeChild(this.divLi);
if(this.divMenu!=null){
this.divMenu.removeChild(this.divUl);
}
}
this.divHref=null;
this.divLi=null;
this.divUl=null;
}
if(this.iframe){
this.div.removeChild(this.iframe);
this.iframe=null;
}
OpenLayers.Event.stopObserving(this.input,"click",this.selectInputField.bind(this));
OpenLayers.Event.stopObserving(this.divVai,"click",this.submitLocalita.bind(this));
OpenLayers.Event.stopObserving(this.input,"keyup",this.complete.bind(this));
OpenLayers.Event.stopObserving(this.input,"keydown",this.scrollLocalita.bind(this));
this.divInput.removeChild(this.input);
this.divInput.removeChild(this.divMenu);
this.divFindComuniChild.removeChild(this.spanTitleComune);
this.divFindComuni.removeChild(this.divVai);
this.divFindComuni.removeChild(this.divInput);
this.divFindComuni.removeChild(this.divFindComuniChild);
this.divRicercaComune.removeChild(this.divFindComuni);
this.childElement.removeChild(this.divRicercaComune);
this.input=null;
this.divMenu=null;
this.spanTitleComune=null;
this.divVai=null;
this.divInput=null;
this.divFindComuniChild=null;
this.divFindComuni=null;
this.divRicercaComune=null;
this.currValue=null;
this.name=null;
this.lista=null;
this.selectedIndex=null;
this.url=null;
for(var i=0;i<this.map.popups.length;i++){
this.map.popups[i].destroy();
}
this.marker=null;
if(this.markersLayer!=null){
this.markersLayer.clearMarkers();
this.map.removeLayer(this.markersLayer,true);
this.markersLayer=null;
}
this.balloonTip=null;
this.listBounds=null;
this.bounds=null;
this.link=null;
Roja.Control.FloatingPanel.prototype.destroy.apply(this,arguments);
},draw:function(){
Roja.Control.FloatingPanel.prototype.draw.apply(this,arguments);
this.childElement.className="RojaAutoCompleteFindFloatingPanel";
var _3=navigator.appVersion.split("MSIE");
var _4=parseFloat(_3[1]);
if(_4<6.5){
this.iframe=document.createElement("iframe");
this.iframe.className=this.displayClass+"iframe";
this.div.appendChild(this.iframe);
}
this.divRicercaComune=document.createElement("div");
this.divRicercaComune.className="ricercacomune";
this.divRicercaComune.id="ricercacomune";
this.childElement.appendChild(this.divRicercaComune);
this.divFindComuni=document.createElement("div");
this.divFindComuni.className="size95 findcomuni floating";
this.divFindComuni.style.zIndex="1003";
this.divFindComuni.id="findcomuni";
this.divRicercaComune.appendChild(this.divFindComuni);
this.divFindComuniChild=document.createElement("div");
this.divFindComuniChild.className="size100 floating alignleft";
this.divFindComuni.appendChild(this.divFindComuniChild);
this.spanTitleComune=document.createElement("span");
this.spanTitleComune.innerHTML="Comune";
this.divFindComuniChild.appendChild(this.spanTitleComune);
this.divInput=document.createElement("div");
this.divInput.className="floating divInputText";
this.divInput.id="divInputText";
this.divFindComuni.appendChild(this.divInput);
this.input=document.createElement("input");
this.input.className="size100";
this.input.type="text";
this.input.id="complete-field";
this.input.name="comune";
this.input.setAttribute("autocomplete","off");
this.divInput.appendChild(this.input);
OpenLayers.Event.observe(this.input,"click",this.selectInputField.bind(this));
OpenLayers.Event.observe(this.input,"keyup",this.complete.bind(this));
OpenLayers.Event.observe(this.input,"keydown",this.scrollLocalita.bind(this));
this.divMenu=document.createElement("div");
this.divMenu.className="menu";
this.divMenu.id="menu-popup";
this.divMenu.style.display="none";
this.divMenu.innerHTML="<br/>";
this.divInput.appendChild(this.divMenu);
this.divVai=document.createElement("input");
this.divVai.className="inputButton";
this.divVai.id="complete-button";
this.divVai.style.marginLeft="5px";
this.divVai.value="Vai";
this.divVai.type="button";
this.divVai.alt="";
this.divVai.scr=OpenLayers.ImgPath+"submit.gif";
this.divVai.title="Avvia la ricerca";
this.divFindComuni.appendChild(this.divVai);
OpenLayers.Event.observe(this.divVai,"click",this.submitLocalita.bind(this));
this.div.style.width=this.size.w+"px";
this.markersLayer=new Roja.Layer.Markers("MarkersLayer");
this.markersLayer.displayInLayerSwitcher=false;
this.map.addLayer(this.markersLayer);
if(this.markersLayer!=null){
this.markersLayer.display(true);
}
return this.div;
},getStatusCode:function(){
return this.status_code;
},getSearchResultElements:function(){
return this.listBounds;
},selectInputField:function(_5){
var _6=this.input.select();
},complete:function(_7){
var _8=this.requestSuccess.bind(this);
var _9=this.requestFailure.bind(this);
var _a=this.input.value;
if(_a==""){
this.clearTable();
this.currValue=_a;
return true;
}
if(_a==this.currValue){
return true;
}else{
this.currValue=_a;
}
var _b=this.url+escape(_a);
if(Roja.Proxy&&this.url.startsWith("http")){
_b=Roja.Proxy+Roja.Util.escapeUri(_b);
}
this.status_code=this.NONE;
var _c=new OpenLayers.Ajax.Request(_b,{method:"get",parameters:null,onComplete:_8,onFailure:_9});
},requestSuccess:function(_d){
if(_d.responseText!=""||_d.responseXML!=null){
var _e=_d.responseXML;
if(!_e||_d.fileType!="XML"){
_e=OpenLayers.parseXMLString(_d.responseText);
}
if(this.markersLayer.markers!=null){
this.markersLayer.clearMarkers();
}
var _f=this.divMenu;
var doc=_e;
this.lista=doc.getElementsByTagName("Lista").item(0);
var _11=this.lista;
this.clearTable();
if(_11!=null){
var _12=new String(_11.getAttribute("ricerca"));
var _13=new String(this.currValue);
if(_12.toLowerCase()!=_13.toLowerCase()){
this.status_code=this.INCONSISTENCE_TEXT;
this.events.triggerEvent("loadFailure");
return;
}
var _14=_11.getElementsByTagName("LimiteAmministrativo").length;
if(_14>0){
_f=this.divMenu;
_f.style.display="block";
_f.style.visibility="visible";
}
this.divMenu.innerHTML="";
this.divUl=document.createElement("ul");
this.divMenu.appendChild(this.divUl);
this.listBounds=[];
for(loop=0;loop<_14;loop++){
var _15=_11.getElementsByTagName("LimiteAmministrativo").item(loop);
var _16=_15.getElementsByTagName("NomeLocalita").item(0);
var _17=(_15.getElementsByTagName("CodiceIstat")[0]).childNodes[0].nodeValue;
var _18=_16.childNodes[0].nodeValue;
var _19=(_15.getElementsByTagName("MinX")[0]).childNodes[0].nodeValue;
var _1a=(_15.getElementsByTagName("MinY")[0]).childNodes[0].nodeValue;
var _1b=(_15.getElementsByTagName("MaxX")[0]).childNodes[0].nodeValue;
var _1c=(_15.getElementsByTagName("MaxY")[0]).childNodes[0].nodeValue;
_19=_19.replace(",",".");
_1a=_1a.replace(",",".");
_1b=_1b.replace(",",".");
_1c=_1c.replace(",",".");
var _1d=(new Number(_19)).valueOf();
var _1e=(new Number(_1a)).valueOf();
var _1f=(new Number(_1b)).valueOf();
var _20=(new Number(_1c)).valueOf();
var _21=(_1d+_1f)/2;
var _22=(_1e+_20)/2;
var _23=new OpenLayers.LonLat(parseFloat(_21),parseFloat(_22));
var _24={id:_17,lonlat:_23,iconUrl:OpenLayers.ImgPath+this.iconUrl,iconSize:this.iconSize,restrictedAreaSize:this.restrictedAreaSize};
var _25=new OpenLayers.Bounds(_1d,_1e,_1f,_20);
var _26=new Roja.Marker(_24);
_26.display(false);
this.markersLayer.addMarker(_26);
var _27={id:_17,bounds:_25,text:_18};
this.listBounds.push(_27);
this.divLi=document.createElement("li");
this.divUl.appendChild(this.divLi);
if(loop==0){
this.divLi.className="selected";
}
this.divHref=document.createElement("a");
this.divHref.id=_17;
this.divHref.href="#";
this.divHref.innerHTML=_18;
this.divLi.appendChild(this.divHref);
OpenLayers.Event.observe(this.divHref,"click",this.setLocalita.bind(this));
}
if(_11.childNodes.length>0){
var dim=20*_14;
if(dim<200){
_f.style.height=dim+"px";
}else{
_f.style.height="200px";
}
}else{
_f.style.height="";
}
_f.scrollTop=0;
this.input.focus();
this.status_code=this.LOAD_COMPLETE;
this.divInput.style.position="relative";
}else{
this.status_code=this.NO_ELEMENTS;
}
}else{
this.status_code=this.NO_ELEMENTS;
this.clearTable();
}
if(this.status_code>10){
this.events.triggerEvent("loadFailure");
}else{
this.div.style.zIndex=this.zIndex+1;
this.input.focus();
if(this.divFindComuni!=null){
this.divFindComuni.style.overflow="visible";
}
if(this.autocomplete){
if(this.lista==null||this.lista.length==0){
return;
}
}else{
if(this.lista!=null){
if(this.divFindComuni!=null){
this.divFindComuni.style.overflow="visible";
}
}
}
this.events.triggerEvent("loadComplete");
}
},requestFailure:function(_29){
this.clearTable();
this.status_code=this.LOAD_ERROR;
this.events.triggerEvent("loadFailure");
},scrollLocalita:function(e){
var _2b=13;
var _2c=38;
var _2d=40;
var key=0;
key=e.keyCode||e.which;
if(key==_2b){
if(this.divUl!=null){
this.marker=this.markersLayer.markers[this.selectedIndex];
var _2f=this.listBounds[this.selectedIndex];
this.bounds=_2f["bounds"];
this.name=_2f["text"];
this.input.value=this.name;
this.currValue=this.name;
this.clearTable();
this.submitLocalita(e);
}else{
if(this.input.value!=""){
this.submitLocalita(e);
}
}
}else{
if(key==_2c){
var _30=this.selectedIndex;
if(this.selectedIndex==0){
return true;
}else{
this.selectedIndex--;
var _31=this.divMenu;
var _32=_31.getElementsByTagName("li");
for(i=0;i<_32.length;i++){
var _33=_32[i];
if(i!=0&&this.selectedIndex!=0){
_32[0].className="";
}
if(i==_30){
_33.className="";
}
if(i==this.selectedIndex){
_33.className="selected";
var dim=20*(_32.lengt+1);
if(dim>=200){
dim=200;
}
if(((i+1)*20)>_31.scrollTop||((i+1)*20)<dim){
_31.scrollTop=_31.scrollTop-18;
}
}
}
}
}else{
if(key==_2d){
var _30=this.selectedIndex;
var _31=this.divMenu;
var _35=_31.getElementsByTagName("li");
if(this.selectedIndex==(_35.length-1)){
return true;
}else{
this.selectedIndex++;
for(i=0;i<_35.length;i++){
var _33=_35[i];
if(i!=0&&this.selectedIndex!=0){
_35[0].className="";
}
if(i==_30){
_33.className="";
}
if(i==this.selectedIndex){
_33.className="selected";
var dim=20*(_35.length+1);
if(dim>=200){
dim=200;
}
if(((i+1)*20)>dim){
_31.scrollTop=_31.scrollTop+20;
}
}
}
}
}
}
}
},setLocalita:function(evt){
var _37=null;
var _38=null;
_37=evt.target||evt.srcElement;
_38=_37.id;
var _39=null;
var ele=this.input.select();
for(i=0;i<this.markersLayer.markers.length;i++){
_39=this.markersLayer.markers[i];
if(_38==_39.id){
break;
}
}
var _3b=null;
for(i=0;i<this.listBounds.length;i++){
_3b=this.listBounds[i];
if(_38==_3b["id"]){
break;
}
}
if(_39!=null&&_3b!=null){
var _3c=null;
if(this.divFindComuni!=null){
this.divFindComuni.style.overflow="hidden";
}
this.name=_3b["text"];
this.input.value=this.name;
this.currValue=this.name;
this.marker=_39;
this.bounds=_3b["bounds"];
this.clearTable();
}
},submitLocalita:function(evt){
this.input.focus();
if(this.divUl!=null||this.marker==null){
return true;
}
this.map.zoomToExtent(this.bounds);
this.marker.display(true);
var _3e=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_img");
var _3f="<div style=\"width:150px;float:left;text-align:center;margin-top:0px;margin-bottom:0px;padding-bottom:0px;\">"+"<a id=\"linkComunas_"+this.idname+"\" class=\"comuni\" style = \"cursor:pointer;\" title=\""+this.balloonTip+"\" target=\"_blank\">"+"<font style=\"font-family:Verdana;font-size:9px;font-weight:bold;\">"+this.name+"</font>"+"</a>"+"</div>";
this.marker.createPopup(_3f,true);
OpenLayers.Event.observe(document.getElementById("linkComunas_"+this.idname),"click",this.openComunas.bind(this));
},openComunas:function(){
var url=(this.link+this.name).toLowerCase();
url=url.replace(/ /g,"");
url=url.replace(/'/g,"");
var _41=new Object();
_41=window.open(url,"","");
_41.focus();
},clearTable:function(){
if(this.divUl!=null){
this.divMenu.removeChild(this.divUl);
this.divUl=null;
}
this.divMenu.style.height="";
this.divMenu.style.display="none";
this.divMenu.style.visibility="hidden";
this.selectedIndex=0;
this.listBounds=null;
},setUrl:function(_42){
this.url=_42;
},reset:function(){
this.input.value="";
this.markersLayer.clearMarkers();
},CLASS_NAME:"Roja.Control.FloatingPanel.AutoCompleteFind"});

Roja.Control.FloatingPanel.FindObject=OpenLayers.Class(Roja.Control.FloatingPanel,{layer:null,testo:null,key:null,autocomplete:false,url:null,iconUrl:null,iconSize:null,restrictedAreaSize:null,markersLayer:null,lista:null,selectedIndex:0,currValue:"",name:"",marker:null,listBounds:null,bounds:null,NAMESPACEURIGML:"http://www.opengis.net/gml",NAMESPACEPREFIXGML:"gml",fallThrough:false,events:null,NONE:0,LOAD_COMPLETE:1,LOAD_ERROR:11,NO_OBJECTS:12,EVENT_TYPES:["loadComplete","loadFailure"],status_code:null,initialize:function(_1){
Roja.Control.FloatingPanel.prototype.initialize.apply(this,[_1]);
this.events=new OpenLayers.Events(this,this,this.EVENT_TYPES,this.fallThrough);
},destroy:function(){
if(!this.divRicercaOggetto){
return;
}
if(this.divHref){
if(this.autocomplete){
OpenLayers.Event.stopObserving(this.divHref,"click",this.setObject.bind(this));
}else{
OpenLayers.Event.stopObserving(this.divHref,"click",this.showObject.bind(this));
}
this.divLi.removeChild(this.divHref);
if(this.divUl!=null){
this.divUl.removeChild(this.divLi);
if(this.divMenu!=null){
this.divMenu.removeChild(this.divUl);
}
}
this.divHref=null;
this.divLi=null;
this.divUl=null;
}
if(this.iframe){
this.div.removeChild(this.iframe);
this.iframe=null;
}
OpenLayers.Event.stopObserving(this.input,"click",this.selectInputField.bind(this));
if(this.autocomplete){
OpenLayers.Event.stopObserving(this.divVai,"click",this.submitObject.bind(this));
}else{
OpenLayers.Event.stopObserving(this.divVai,"click",this.complete.bind(this));
}
if(this.autocomplete){
OpenLayers.Event.stopObserving(this.input,"keyup",this.complete.bind(this));
}else{
OpenLayers.Event.stopObserving(this.input,"keyup",this.focusInputField.bind(this));
}
OpenLayers.Event.stopObserving(this.input,"keydown",this.scrollObject.bind(this));
this.divInput.removeChild(this.input);
this.divInput.removeChild(this.divMenu);
this.divFindOggettiChild.removeChild(this.spanTitleOggetto);
this.divFindOggetti.removeChild(this.divVai);
this.divFindOggetti.removeChild(this.divInput);
this.divFindOggetti.removeChild(this.divFindOggettiChild);
this.divRicercaOggetto.removeChild(this.divFindOggetti);
this.childElement.removeChild(this.divRicercaOggetto);
this.input=null;
this.divMenu=null;
this.spanTitleOggetto=null;
this.divVai=null;
this.divInput=null;
this.divFindOggettiChild=null;
this.divFindOggetti=null;
this.divRicercaOggetto=null;
if(this.divLoadingMessage){
this.childElement.removeChild(this.divRicercaOggetto);
this.divLoadingMessage=null;
}
this.currValue=null;
this.name=null;
this.lista=null;
this.selectedIndex=null;
this.url=null;
for(var i=0;i<this.map.popups.length;i++){
this.map.popups[i].destroy();
}
this.marker=null;
if(this.markersLayer!=null){
if(this.markersLayer.markers!=null){
while(this.markersLayer.markers.length>0){
var _3=this.markersLayer.markers[0];
this.markersLayer.removeMarker(_3);
_3.destroy();
}
}
this.map.removeLayer(this.markersLayer,true);
this.markersLayer=null;
}
this.NAMESPACEURIGML=null;
this.map.namespaceURI=null;
this.NAMESPACEPREFIXGML=null;
this.map.namespacePrefix=null;
this.layer=null;
this.key=null;
this.autocomplete=null;
this.listBounds=null;
this.bounds=null;
Roja.Control.FloatingPanel.prototype.destroy.apply(this,arguments);
},draw:function(){
Roja.Control.FloatingPanel.prototype.draw.apply(this,arguments);
var _4=navigator.appVersion.split("MSIE");
var _5=parseFloat(_4[1]);
if(_5<6.5){
this.iframe=document.createElement("iframe");
this.iframe.className=this.displayClass+"iframe";
this.div.appendChild(this.iframe);
}
this.divRicercaOggetto=document.createElement("div");
this.divRicercaOggetto.className="ricercaoggetto";
this.divRicercaOggetto.id="ricercaoggetto";
this.childElement.appendChild(this.divRicercaOggetto);
this.divFindOggetti=document.createElement("div");
this.divFindOggetti.className="size95 findoggetti floating";
this.divFindOggetti.style.zIndex="1003";
this.divFindOggetti.id="findoggetti";
this.divRicercaOggetto.appendChild(this.divFindOggetti);
this.divFindOggettiChild=document.createElement("div");
this.divFindOggettiChild.className="size100 floating alignleft";
this.divFindOggetti.appendChild(this.divFindOggettiChild);
this.spanTitleOggetto=document.createElement("span");
this.spanTitleOggetto.innerHTML=this.testo;
this.divFindOggettiChild.appendChild(this.spanTitleOggetto);
this.divInput=document.createElement("div");
this.divInput.className="floating divInputText";
this.divInput.id="divInputText";
this.divFindOggetti.appendChild(this.divInput);
this.input=document.createElement("input");
this.input.className="size100";
this.input.type="text";
this.input.id="complete-field";
this.input.name="Oggetto";
this.divInput.appendChild(this.input);
OpenLayers.Event.observe(this.input,"click",this.selectInputField.bind(this));
if(this.autocomplete){
OpenLayers.Event.observe(this.input,"keyup",this.complete.bind(this));
}else{
OpenLayers.Event.observe(this.input,"keyup",this.focusInputField.bind(this));
}
OpenLayers.Event.observe(this.input,"keydown",this.scrollObject.bind(this));
this.divMenu=document.createElement("div");
this.divMenu.className="menu";
this.divMenu.id="menu-popup";
this.divMenu.style.display="none";
this.divMenu.innerHTML="<br/>";
this.divInput.appendChild(this.divMenu);
this.divVai=document.createElement("input");
this.divVai.className="inputButton";
this.divVai.id="complete-button";
this.divVai.style.marginLeft="5px";
this.divVai.style.width="35px";
this.divVai.style.height="18px";
this.divVai.value="Vai";
this.divVai.type="button";
this.divVai.alt="";
this.divVai.scr=OpenLayers.ImgPath+"submit.gif";
this.divVai.title="Avvia la ricerca";
this.divFindOggetti.appendChild(this.divVai);
if(this.autocomplete){
OpenLayers.Event.observe(this.divVai,"click",this.submitObject.bind(this));
}else{
OpenLayers.Event.observe(this.divVai,"click",this.complete.bind(this));
}
this.div.style.width=this.size.w+"px";
if(!this.autocomplete){
var _6={position:new OpenLayers.Pixel(180,50),imgFileName:"clessidra.gif"};
this.loadingMessage=new Roja.Control.LoadingMessage(_6);
this.divLoadingMessage=this.loadingMessage.draw();
this.childElement.appendChild(this.divLoadingMessage);
}
this.markersLayer=new Roja.Layer.Markers("MarkersLayer");
this.markersLayer.displayInLayerSwitcher=false;
this.map.addLayer(this.markersLayer);
if(this.markersLayer!=null){
this.markersLayer.display(true);
}
this.divFindOggetti.style.position="relative";
return this.div;
},getStatusCode:function(){
return this.status_code;
},getSearchResultElements:function(){
return this.listBounds;
},selectInputField:function(_7){
var _8=this.input.select();
},focusInputField:function(_9){
this.div.style.zIndex=this.zIndex+1;
var _a=this.input.focus();
},complete:function(_b){
var _c=this.requestSuccess.bind(this);
var _d=this.requestFailure.bind(this);
var _e=this.input.value;
if(_e==""){
this.clearTable();
this.currValue=_e;
return true;
}
if(_e==this.currValue){
return true;
}else{
this.currValue=_e;
}
var _f=this.url;
if(!this.autocomplete){
this.loadingMessage.startLoad();
}
if(Roja.Proxy&&this.url.startsWith("http")){
_f=Roja.Proxy+Roja.Util.escapeUri(this.url);
}
_f=_f+"version=1.0.0&request=GetFeature&typeName="+this.layer+"&FILTER=<Filter><PropertyIsLike wildCard='*' singleChar='.' escape='!' matchCase=\"false\">"+"<PropertyName>"+this.key+"</PropertyName><Literal>"+_e+"*</Literal></PropertyIsLike>"+"</Filter>&PROPERTYNAME="+this.key;
this.status_code=this.NONE;
var req=new OpenLayers.Ajax.Request(_f,{method:"get",onComplete:_c,onFailure:_d});
},requestSuccess:function(_11){
if(_11.responseText!=""||_11.responseXML!=null){
var _12=_11.responseXML;
if(!_12||_11.fileType!="XML"){
_12=OpenLayers.parseXMLString(_11.responseText);
}
if(this.markersLayer.markers!=null){
while(this.markersLayer.markers.length>0){
var _13=this.markersLayer.markers[0];
this.markersLayer.removeMarker(_13);
}
}
if(!this.autocomplete){
this.loadingMessage.stopLoad();
}
var _14=this.divMenu;
var doc=_12;
this.clearTable();
var _16=_12.documentElement.getElementsByTagName("ServiceException").item(0);
if(_16!=null&!this.autocomplete){
this.currValue="";
OpenLayers.Console.debug("Errore nella chiamata wfs: "+_11.responseText);
alert("Il servizio di ricerca non e' al momento disponible");
this.status_code=this.LOAD_ERROR;
this.events.triggerEvent("loadFailure");
return false;
}
var _17=OpenLayers.Ajax.getElementsByTagNameNS(_12.documentElement,this.NAMESPACEURIGML,this.NAMESPACEPREFIXGML,"featureMember");
this.lista=_17;
if(_17!=null){
var _18=_17.length;
if(_18>0){
_14=this.divMenu;
_14.style.display="block";
_14.style.visibility="visible";
}
if(_18==0){
this.currValue="";
if(!this.autocomplete){
OpenLayers.Console.debug("Errore nella chiamata wfs: "+_11.responseText);
alert("Oggetto non trovato");
}
this.status_code=this.NO_OBJECTS;
this.events.triggerEvent("loadFailure");
return false;
}
this.divMenu.innerHTML="";
this.divUl=document.createElement("ul");
this.divMenu.appendChild(this.divUl);
this.listBounds=[];
for(j=0;j<_17.length;j++){
var _19=_17[j];
if(_19!=null){
var _1a=OpenLayers.Ajax.getElementsByTagNameNS(_19,this.NAMESPACEURIGML,this.NAMESPACEPREFIXGML,"coordinates")[0];
if(_1a!=null){
var _1b=(new String(_1a.childNodes[0].nodeValue)).valueOf();
var pos=_1b.indexOf(" ");
var _1d=_1b.substring(0,pos);
var _1e=_1b.substring(pos+1);
pos=_1d.indexOf(",");
var _1f=(new Number(_1d.substring(0,pos))).valueOf();
var _20=(new Number(_1d.substring(pos+1))).valueOf();
pos=_1e.indexOf(",");
var _21=(new Number(_1e.substring(0,pos))).valueOf();
var _22=(new Number(_1e.substring(pos+1))).valueOf();
var _23=(_1f+_21)/2;
var _24=(_20+_22)/2;
var _25=new OpenLayers.LonLat(parseFloat(_23),parseFloat(_24));
var _26=OpenLayers.Ajax.getElementsByTagNameNS(_19,this.map.namespaceURI,this.map.namespacePrefix,this.key)[0];
var _27=_26.childNodes[0].nodeValue;
var _28={id:"oggetto"+j,lonlat:_25,iconUrl:this.iconUrl,iconSize:this.iconSize,restrictedAreaSize:this.restrictedAreaSize};
var _29=new OpenLayers.Bounds(_1f,_20,_21,_22);
var _13=new Roja.Marker(_28);
_13.display(false);
this.markersLayer.addMarker(_13);
var _2a={id:"oggetto"+j,bounds:_29,text:_27};
this.listBounds.push(_2a);
this.divLi=document.createElement("li");
this.divUl.appendChild(this.divLi);
if(j==0){
this.divLi.className="selected";
}
this.divHref=document.createElement("a");
this.divHref.id="oggetto"+j;
this.divHref.href="#";
this.divHref.innerHTML=_27;
this.divLi.appendChild(this.divHref);
if(this.autocomplete){
OpenLayers.Event.observe(this.divHref,"click",this.setObject.bind(this));
}else{
OpenLayers.Event.observe(this.divHref,"click",this.showObject.bind(this));
}
}
}
}
if(_17.length>0){
var dim=20*(_18+1);
if(dim<200){
_14.style.height=dim+"px";
}else{
_14.style.height="200px";
}
}else{
_14.style.height="";
}
_14.scrollTop=0;
this.input.focus();
this.status_code=this.LOAD_COMPLETE;
}else{
this.status_code=this.NO_OBJECTS;
}
}else{
this.status_code=this.NO_OBJECTS;
this.clearTable();
if(this.markersLayer.markers!=null){
while(this.markersLayer.markers.length>0){
var _13=this.markersLayer.markers[0];
this.markersLayer.removeMarker(_13);
}
}
}
if(this.status_code>10){
this.events.triggerEvent("loadFailure");
}else{
this.input.focus();
if(this.divFindOggetti!=null){
this.divFindOggetti.style.overflow="visible";
}
if(this.autocomplete){
if(this.lista==null||this.lista.length==0){
return;
}
}else{
if(this.lista!=null){
if(this.divFindOggetti!=null){
this.divFindOggetti.style.overflow="visible";
}
}
}
this.events.triggerEvent("loadComplete");
}
},showObject:function(evt){
this.setObject(evt);
this.submitObject(evt);
},requestFailure:function(_2d){
this.clearTable();
this.status_code=this.LOAD_ERROR;
this.events.triggerEvent("loadFailure");
if(!this.autocomplete){
this.loadingMessage.stopLoad();
alert("Il servizio di ricerca non e' al momento disponible");
}
},scrollObject:function(e){
var _2f=13;
var _30=38;
var _31=40;
var key=0;
key=e.keyCode||e.which;
if(key==_2f){
if(this.divUl!=null){
this.marker=this.markersLayer.markers[this.selectedIndex];
var _33=this.listBounds[this.selectedIndex];
this.bounds=_33["bounds"];
this.name=_33["text"];
this.input.value=this.name;
this.currValue=this.name;
this.clearTable();
this.submitObject(e);
}else{
if(this.input.value!=""){
if(this.autocomplete){
this.submitObject(e);
}else{
this.complete(e);
}
}
}
}else{
if(key==_30){
var _34=this.selectedIndex;
if(this.selectedIndex==0){
return true;
}else{
this.selectedIndex--;
var _35=this.divMenu;
var _36=_35.getElementsByTagName("li");
for(i=0;i<_36.length;i++){
var _37=_36[i];
if(i!=0&&this.selectedIndex!=0){
_36[0].className="";
}
if(i==_34){
_37.className="";
}
if(i==this.selectedIndex){
_37.className="selected";
var dim=20*(_36.lengt+1);
if(dim>=200){
dim=200;
}
if(((i+1)*20)>_35.scrollTop||((i+1)*20)<dim){
_35.scrollTop=_35.scrollTop-18;
}
}
}
}
}else{
if(key==_31){
var _34=this.selectedIndex;
var _35=this.divMenu;
var _39=_35.getElementsByTagName("li");
if(this.selectedIndex==(_39.length-1)){
return true;
}else{
this.selectedIndex++;
for(i=0;i<_39.length;i++){
var _37=_39[i];
if(i!=0&&this.selectedIndex!=0){
_39[0].className="";
}
if(i==_34){
_37.className="";
}
if(i==this.selectedIndex){
_37.className="selected";
var dim=20*(_39.length+1);
if(dim>=200){
dim=200;
}
if(((i+1)*20)>dim){
_35.scrollTop=_35.scrollTop+20;
}
}
}
}
}
}
}
},setObject:function(evt){
var _3b=null;
var _3c=null;
_3b=evt.target||evt.srcElement;
_3c=_3b.id;
var _3d=null;
var ele=this.input.select();
for(i=0;i<this.markersLayer.markers.length;i++){
_3d=this.markersLayer.markers[i];
if(_3c==_3d.id){
break;
}
}
var _3f=null;
for(i=0;i<this.listBounds.length;i++){
_3f=this.listBounds[i];
if(_3c==_3f["id"]){
break;
}
}
if(_3d!=null&&_3f!=null){
var _40=null;
if(this.divFindOggetti!=null){
this.divFindOggetti.style.overflow="hidden";
}
this.name=_3f["text"];
this.input.value=this.name;
this.currValue=this.name;
this.marker=_3d;
this.bounds=_3f["bounds"];
this.clearTable();
}
},submitObject:function(evt){
this.input.focus();
if(this.divUl!=null||this.marker==null){
return true;
}
this.map.zoomToExtent(this.bounds);
var _42="<font style=\"font-weight:bold;\">"+this.name+"</font>";
this.marker.createPopup(_42,true);
this.marker.display(true);
},clearTable:function(){
if(this.divUl!=null){
this.divMenu.removeChild(this.divUl);
this.divUl=null;
}
this.divMenu.style.height="";
this.divMenu.style.display="none";
this.divMenu.style.visibility="hidden";
this.selectedIndex=0;
for(var i=0;i<this.map.popups.length;i++){
this.map.popups[i].destroy();
}
this.listBounds=null;
},setUrl:function(_44){
this.url=_44;
},CLASS_NAME:"Roja.Control.FloatingPanel.FindObject"});

Roja.Control.FloatingPanel.Gazetteer=OpenLayers.Class(Roja.Control.FloatingPanel,{gazetteerObj:null,currValueComune:"",listaComuni:null,selectedIndexComune:0,urlFindComune:null,nameComune:"",htmlbottomdiv:null,initialize:function(_1){
Roja.Control.FloatingPanel.prototype.initialize.apply(this,[_1]);
this.idname=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
this.events=new OpenLayers.Events(this,this,this.EVENT_TYPES,this.fallThrough);
var _2={"searchGazetteerEle":this};
this.gazetteerObj.events.register("loadComplete",this.gazetteerObj,this.loadComplete.bindAsEventListener(_2));
this.gazetteerObj.events.register("loadFailure",this.gazetteerObj,this.loadFailure.bindAsEventListener(_2));
},loadComplete:function(e){
if(this.searchGazetteerEle.bottomdiv!=null){
this.searchGazetteerEle.bottomdiv.innerHTML=this.searchGazetteerEle.htmlbottomdiv;
this.searchGazetteerEle.bottomdiv.className=this.searchGazetteerEle.bottomdiv.className.replace("hidden","show");
OpenLayers.Console.debug(this.searchGazetteerEle.bottomdiv.className);
}
},loadFailure:function(){
if(this.searchGazetteerEle.bottomdiv!=null){
this.searchGazetteerEle.bottomdiv.innerHTML=this.searchGazetteerEle.htmlbottomdiv;
this.searchGazetteerEle.bottomdiv.className=this.searchGazetteerEle.bottomdiv.className.replace("show","hidden");
OpenLayers.Console.debug(this.searchGazetteerEle.bottomdiv.className);
}
},destroy:function(){
for(var i=0;i<this.map.popups.length;i++){
this.map.popups[i].destroy();
}
if(this.gazetteerObj.markersLayer!=null){
if(this.gazetteerObj.markersLayer.markers!=null){
while(this.gazetteerObj.markersLayer.markers.length>0){
var _5=this.gazetteerObj.markersLayer.markers[0];
this.gazetteerObj.markersLayer.removeMarker(_5);
_5.destroy();
}
}
this.map.removeLayer(this.gazetteerObj.markersLayer,true);
this.gazetteerObj.markersLayer=null;
}
if(this.divHrefComune){
OpenLayers.Event.stopObserving(this.divHrefComune,"click",this.setLocalitaComune.bind(this));
this.divLiComune.removeChild(this.divHrefComune);
if(this.divUlComune!=null){
this.divUlComune.removeChild(this.divLiComune);
if(this.divMenuComune!=null){
this.divMenuComune.removeChild(this.divUlComune);
}
}
this.divHrefComune=null;
this.divLiComune=null;
this.divUlComune=null;
}
if(this.iframe){
this.div.removeChild(this.iframe);
this.iframe=null;
}
OpenLayers.Event.stopObserving(this.inputComune,"click",this.selectInputFieldComune.bind(this));
OpenLayers.Event.stopObserving(this.inputComune,"keyup",this.completeComune.bind(this));
OpenLayers.Event.stopObserving(this.inputComune,"keydown",this.scrollLocalitaComune.bind(this));
OpenLayers.Event.stopObserving(this.gazetteerObj.input,"click",this.gazetteerObj.selectInputField.bind(this.gazetteerObj));
OpenLayers.Event.stopObserving(this.gazetteerObj.input,"keyup",this.gazetteerObj.focusInputField.bind(this.gazetteerObj));
OpenLayers.Event.stopObserving(this.gazetteerObj.input,"keydown",this.scrollLocalita.bind(this));
OpenLayers.Event.stopObserving(this.divVai,"click",this.goToToponym.bind(this));
this.divInputComune.removeChild(this.inputComune);
this.divInputComune.removeChild(this.divMenuComune);
this.divInput.removeChild(this.gazetteerObj.input);
this.divFindToponimiChild.removeChild(this.spanTitleToponimo);
this.divFindToponimi.removeChild(this.divVai);
this.divFindToponimi.removeChild(this.divFindToponimiChild);
this.gazetteerObj.divRicercaToponimo.removeChild(this.divFindToponimi);
this.childElement.removeChild(this.gazetteerObj.divRicercaToponimo);
this.divFindComuniChild.removeChild(this.spanTitleComune);
this.divFindComuni.removeChild(this.divFindComuniChild);
this.gazetteerObj.input=null;
this.gazetteerObj.divMenu=null;
this.inputComune=null;
this.divMenuComune=null;
this.divInputComune=null;
this.spanTitleToponimo=null;
this.divVai=null;
this.divInput=null;
this.divFindToponimiChild=null;
this.divFindToponimi=null;
this.gazetteerObj.divRicercaToponimo=null;
if(this.divLoadingMessage){
this.childElement.removeChild(this.gazetteerObj.divRicercaToponimo);
this.divLoadingMessage=null;
}
this.gazetteerObj.currValue=null;
this.currValueComune=null;
this.gazetteerObj.name=null;
this.gazetteerObj.lista=null;
this.nameComune=null;
this.listaComuni=null;
this.selectedIndexComune=null;
this.gazetteerObj.url=null;
this.urlFindComune=null;
this.gazetteerObj.crnet_isMoz=null;
this.gazetteerObj.crnet_isIE=null;
this.gazetteerObj.loading=null;
this.gazetteerObj.marker=null;
this.gazetteerObj.listBounds=null;
this.gazetteerObj.bounds=null;
Roja.Control.FloatingPanel.prototype.destroy.apply(this,arguments);
},draw:function(){
Roja.Control.FloatingPanel.prototype.draw.apply(this,arguments);
this.childElement.className="RojaGazetteerFloatingPanel";
var _6=navigator.appVersion.split("MSIE");
var _7=parseFloat(_6[1]);
if(_7<6.5){
this.iframe=document.createElement("iframe");
this.iframe.className=this.displayClass+"iframe";
this.div.appendChild(this.iframe);
}
this.gazetteerObj.divRicercaToponimo=document.createElement("div");
this.gazetteerObj.divRicercaToponimo.className="ricercatoponimo";
this.gazetteerObj.divRicercaToponimo.id="ricercatoponimi";
this.gazetteerObj.divRicercaToponimo.style.visibility="visible";
this.gazetteerObj.divRicercaToponimo.style.display="block";
this.childElement.appendChild(this.gazetteerObj.divRicercaToponimo);
this.divFindComuni=document.createElement("div");
this.divFindComuni.className="size95 findcomuni floating";
this.divFindComuni.style.zIndex="1003";
this.divFindComuni.id="findcomuni";
this.gazetteerObj.divRicercaToponimo.appendChild(this.divFindComuni);
this.divFindComuniChild=document.createElement("div");
this.divFindComuniChild.className="size100 floating alignleft";
this.divFindComuni.appendChild(this.divFindComuniChild);
this.spanTitleComune=document.createElement("span");
this.spanTitleComune.innerHTML="Comune";
this.divFindComuniChild.appendChild(this.spanTitleComune);
this.divInputComune=document.createElement("div");
this.divInputComune.className="floating divInputText";
this.divInputComune.id="divInputText";
this.divFindComuni.appendChild(this.divInputComune);
this.inputComune=document.createElement("input");
this.inputComune.className="size100";
this.inputComune.type="text";
this.inputComune.id="complete-field-comune";
this.inputComune.name="comune";
this.inputComune.setAttribute("autocomplete","on");
this.divInputComune.appendChild(this.inputComune);
OpenLayers.Event.observe(this.inputComune,"click",this.selectInputFieldComune.bind(this));
OpenLayers.Event.observe(this.inputComune,"keyup",this.completeComune.bind(this));
OpenLayers.Event.observe(this.inputComune,"keydown",this.scrollLocalitaComune.bind(this));
this.divMenuComune=document.createElement("div");
this.divMenuComune.className="menu";
this.divMenuComune.id="menu-popup-comune";
this.divMenuComune.style.display="none";
this.divMenuComune.innerHTML="<br/>";
this.divInputComune.appendChild(this.divMenuComune);
this.divFindToponimi=document.createElement("div");
this.divFindToponimi.className="size95 findtoponimi floating";
this.divFindToponimi.style.zIndex="1003";
this.divFindToponimi.id="findtoponimi";
this.gazetteerObj.divRicercaToponimo.appendChild(this.divFindToponimi);
this.divFindToponimiChild=document.createElement("div");
this.divFindToponimiChild.className="size100 floating alignleft";
this.divFindToponimi.appendChild(this.divFindToponimiChild);
this.spanTitleToponimo=document.createElement("span");
this.spanTitleToponimo.innerHTML="Toponimo";
this.divFindToponimiChild.appendChild(this.spanTitleToponimo);
this.divInput=document.createElement("div");
this.divInput.className="floating divInputToponimo";
this.divInput.id="divInputToponimo";
this.divFindToponimi.appendChild(this.divInput);
this.gazetteerObj.input=document.createElement("input");
this.gazetteerObj.input.className="size100";
this.gazetteerObj.input.type="text";
this.gazetteerObj.input.id="complete-field";
this.gazetteerObj.input.name="toponimo";
this.gazetteerObj.input.setAttribute("autocomplete","off");
this.divInput.appendChild(this.gazetteerObj.input);
OpenLayers.Event.observe(this.gazetteerObj.input,"click",this.gazetteerObj.selectInputField.bind(this.gazetteerObj));
OpenLayers.Event.observe(this.gazetteerObj.input,"keyup",this.gazetteerObj.focusInputField.bind(this.gazetteerObj));
OpenLayers.Event.observe(this.gazetteerObj.input,"keydown",this.scrollLocalita.bind(this));
this.divVai=document.createElement("input");
this.divVai.className="inputButton";
this.divVai.id="complete-button";
this.divVai.style.marginLeft="5px";
this.divVai.style.width="35px";
this.divVai.style.height="18px";
this.divVai.value="Vai";
this.divVai.type="button";
this.divVai.alt="Avvia la ricerca";
this.divVai.scr=OpenLayers.ImgPath+"submit.gif";
this.divVai.title="Avvia la ricerca";
this.divFindToponimi.appendChild(this.divVai);
OpenLayers.Event.observe(this.divVai,"click",this.goToToponym.bind(this));
this.div.style.width=this.size.w;
if(this.htmlbottomdiv!=null){
this.bottomdiv=document.createElement("div");
this.div.appendChild(this.bottomdiv);
this.events=new OpenLayers.Events(this,this.bottomdiv,null);
this.events.register("dblclick",this.bottomdiv,this.stopevent);
this.events.register("mousedown",this.bottomdiv,this.stopevent);
this.events.register("mouseup",this.bottomdiv,this.stopevent);
this.bottomdiv.id=this.id+"_bottomdiv";
this.bottomdiv.style.width=this.size.w;
this.bottomdiv.className="panelbottom hidden";
this.bottomdiv.innerHTML=this.htmlbottomdiv;
}
this.divFindComuni.style.position="relative";
return this.div;
},goToToponym:function(){
var _8=this.gazetteerObj.input.value;
if(_8==""){
this.gazetteerObj.clearTable();
if(this.gazetteerObj.istatComune!=null){
this.submitLocalitaComune();
}
return true;
}else{
this.gazetteerObj.complete();
}
},selectInputFieldComune:function(_9){
var _a=this.inputComune.select();
},completeComune:function(_b){
var _c=this.requestSuccessComune.bind(this);
var _d=this.requestFailureComune.bind(this);
if(this.divFindToponimi!=null){
this.divFindToponimi.style.overflow="hidden";
}
var _e=this.inputComune.value;
if(_e==""){
this.clearTableComune();
this.gazetteerObj.istatComune=null;
this.currValueComune=_e;
return true;
}
if(_e==this.currValueComune){
return true;
}else{
this.currValueComune=_e;
}
var _f=this.urlFindComune+escape(_e);
if(Roja.Proxy&&this.urlFindComune.startsWith("http")){
_f=Roja.Proxy+Roja.Util.escapeUri(_f);
}
this.status_code=this.NONE;
var req=new OpenLayers.Ajax.Request(_f,{method:"get",parameters:null,onComplete:_c,onFailure:_d});
},requestSuccessComune:function(_11){
if(_11.responseText!=""||_11.responseXML!=null){
var _12=_11.responseXML;
if(!_12||_11.fileType!="XML"){
_12=OpenLayers.parseXMLString(_11.responseText);
}
if(this.gazetteerObj.markersLayer.markers!=null){
this.gazetteerObj.markersLayer.clearMarkers();
}
var _13=this.divMenuComune;
var doc=_12;
this.listaComuni=doc.getElementsByTagName("Lista").item(0);
var _15=this.listaComuni;
this.clearTableComune();
if(_15!=null){
var _16=new String(_15.getAttribute("ricerca"));
var _17=new String(this.currValueComune);
if(_16.toLowerCase()!=_17.toLowerCase()){
this.status_code=this.INCONSISTENCE_TEXT;
this.events.triggerEvent("loadFailure");
return;
}
var _18=_15.getElementsByTagName("LimiteAmministrativo").length;
if(_18>0){
_13=this.divMenuComune;
_13.style.display="block";
_13.style.visibility="visible";
}
this.divMenuComune.innerHTML="";
this.divUlComune=document.createElement("ul");
this.divMenuComune.appendChild(this.divUlComune);
this.gazetteerObj.listBounds=[];
for(loop=0;loop<_18;loop++){
var _19=_15.getElementsByTagName("LimiteAmministrativo").item(loop);
var _1a=_19.getElementsByTagName("NomeLocalita").item(0);
var _1b=(_19.getElementsByTagName("CodiceIstat")[0]).childNodes[0].nodeValue;
var _1c=_1a.childNodes[0].nodeValue;
var _1d=(_19.getElementsByTagName("MinX")[0]).childNodes[0].nodeValue;
var _1e=(_19.getElementsByTagName("MinY")[0]).childNodes[0].nodeValue;
var _1f=(_19.getElementsByTagName("MaxX")[0]).childNodes[0].nodeValue;
var _20=(_19.getElementsByTagName("MaxY")[0]).childNodes[0].nodeValue;
_1d=_1d.replace(",",".");
_1e=_1e.replace(",",".");
_1f=_1f.replace(",",".");
_20=_20.replace(",",".");
var _21=(new Number(_1d)).valueOf();
var _22=(new Number(_1e)).valueOf();
var _23=(new Number(_1f)).valueOf();
var _24=(new Number(_20)).valueOf();
var _25=(_21+_23)/2;
var _26=(_22+_24)/2;
var _27=new OpenLayers.LonLat(parseFloat(_25),parseFloat(_26));
var _28={id:_1b,lonlat:_27,iconUrl:this.gazetteerObj.iconUrl,iconSize:this.gazetteerObj.iconSize,restrictedAreaSize:this.gazetteerObj.restrictedAreaSize};
var _29=new OpenLayers.Bounds(_21,_22,_23,_24);
var _2a=new Roja.Marker(_28);
_2a.display(false);
this.gazetteerObj.markersLayer.addMarker(_2a);
var _2b={id:_1b,bounds:_29,text:_1c};
this.gazetteerObj.listBounds.push(_2b);
this.divLiComune=document.createElement("li");
this.divUlComune.appendChild(this.divLiComune);
if(loop==0){
this.divLiComune.className="selected";
}
this.divHrefComune=document.createElement("a");
this.divHrefComune.id=_1b;
this.divHrefComune.href="#";
this.divHrefComune.innerHTML=_1c;
this.divLiComune.appendChild(this.divHrefComune);
OpenLayers.Event.observe(this.divHrefComune,"click",this.setLocalitaComune.bind(this));
}
if(_15.childNodes.length>0){
var dim=20*_18;
if(dim<200){
_13.style.height=dim+"px";
}else{
_13.style.height="200px";
}
}else{
_13.style.height="";
}
_13.scrollTop=0;
this.inputComune.focus();
this.status_code=this.LOAD_COMPLETE;
}else{
this.status_code=this.NO_ELEMENTS;
}
}else{
this.status_code=this.NO_ELEMENTS;
this.clearTableComune();
}
if(this.status_code>10){
this.events.triggerEvent("loadFailure");
}else{
this.events.triggerEvent("loadComplete");
}
},requestFailureComune:function(_2d){
this.clearTableComune();
this.status_code=this.LOAD_ERROR;
this.events.triggerEvent("loadFailure");
},clearTableComune:function(){
if(this.divUlComune!=null){
this.divMenuComune.removeChild(this.divUlComune);
this.divUlComune=null;
}
this.divMenuComune.style.height="";
this.divMenuComune.style.display="none";
this.divMenuComune.style.visibility="hidden";
this.selectedIndexComune=0;
this.gazetteerObj.listBounds=null;
},scrollLocalitaComune:function(e){
this.div.style.zIndex=this.zIndex+1;
this.inputComune.focus();
if(this.divFindComuni!=null){
this.divFindComuni.style.overflow="visible";
}
var _2f=13;
var _30=38;
var _31=40;
var key=0;
if(this.autocomplete){
if(this.listaComuni==null||this.listaComuni.length==0){
return;
}
}else{
if(this.listaComuni!=null){
if(this.divFindComuni!=null){
this.divFindComuni.style.overflow="visible";
}
}
}
key=e.keyCode||e.which;
if(key==_2f){
if(this.divUlComune!=null){
this.gazetteerObj.marker=this.gazetteerObj.markersLayer.markers[this.selectedIndexComune];
var _33=this.gazetteerObj.listBounds[this.selectedIndexComune];
this.gazetteerObj.bounds=_33["bounds"];
this.gazetteerObj.istatComune=_33["id"];
this.nameComune=_33["text"];
this.inputComune.value=this.nameComune;
this.currValueComune=this.nameComune;
this.clearTableComune();
this.submitLocalitaComune();
}else{
if(this.gazetteerObj.divMenu==null||this.gazetteerObj.divMenu.style.visibility=="hidden"){
this.goToToponym();
}
}
}else{
if(key==_30){
var _34=this.selectedIndexComune;
if(this.selectedIndexComune==0){
return true;
}else{
this.selectedIndexComune--;
var _35=this.divMenuComune;
var _36=_35.getElementsByTagName("li");
for(i=0;i<_36.length;i++){
var _37=_36[i];
if(i!=0&&this.selectedIndexComune!=0){
_36[0].className="";
}
if(i==_34){
_37.className="";
}
if(i==this.selectedIndexComune){
_37.className="selected";
var dim=20*(_36.lengt+1);
if(dim>=200){
dim=200;
}
if(((i+1)*20)>_35.scrollTop||((i+1)*20)<dim){
_35.scrollTop=_35.scrollTop-18;
}
}
}
}
}else{
if(key==_31){
var _34=this.selectedIndexComune;
var _35=this.divMenuComune;
var _39=_35.getElementsByTagName("li");
if(this.selectedIndexComune==(_39.length-1)){
return true;
}else{
this.selectedIndexComune++;
for(i=0;i<_39.length;i++){
var _37=_39[i];
if(i!=0&&this.selectedIndexComune!=0){
_39[0].className="";
}
if(i==_34){
_37.className="";
}
if(i==this.selectedIndexComune){
_37.className="selected";
var dim=20*(_39.length+1);
if(dim>=200){
dim=200;
}
if(((i+1)*20)>dim){
_35.scrollTop=_35.scrollTop+20;
}
}
}
}
}
}
}
},submitLocalitaComune:function(evt){
this.inputComune.focus();
if(this.divUlComune!=null||this.gazetteerObj.marker==null){
return true;
}
this.gazetteerObj.input.style.display="block";
this.map.zoomToExtent(this.gazetteerObj.bounds);
this.gazetteerObj.marker.display(true);
var _3b=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_img");
var _3c="<div style=\"width:150px;float:left;text-align:center;margin-top:0px;margin-bottom:0px;padding-bottom:0px;\">"+"<a id=\"linkComunas_"+this.idname+"\" class=\"comuni\" style = \"cursor:pointer;\" title=\""+this.balloonTip+"\" target=\"_blank\">"+"<font style=\"font-family:Verdana;font-size:9px;font-weight:bold;\">"+this.nameComune+"</font>"+"</a>"+"</div>";
this.gazetteerObj.marker.createPopup(_3c,true);
OpenLayers.Event.observe(document.getElementById("linkComunas_"+this.idname),"click",this.openComunas.bind(this));
},setLocalitaComune:function(evt){
this.gazetteerObj.input.style.display="block";
var _3e=null;
var _3f=null;
_3e=evt.target||evt.srcElement;
_3f=_3e.id;
var _40=null;
var ele=this.inputComune.select();
for(i=0;i<this.gazetteerObj.markersLayer.markers.length;i++){
_40=this.gazetteerObj.markersLayer.markers[i];
if(_3f==_40.id){
break;
}
}
var _42=null;
for(i=0;i<this.gazetteerObj.listBounds.length;i++){
_42=this.gazetteerObj.listBounds[i];
if(_3f==_42["id"]){
break;
}
}
if(_40!=null&&_42!=null){
var _43=null;
if(this.divFindComuni!=null){
this.divFindComuni.style.overflow="hidden";
}
this.nameComune=_42["text"];
this.inputComune.value=this.nameComune;
this.currValueComune=this.nameComune;
this.gazetteerObj.marker=_40;
this.gazetteerObj.bounds=_42["bounds"];
this.gazetteerObj.istatComune=_3f;
this.clearTableComune();
}
},scrollLocalita:function(e){
var _45=13;
var _46=38;
var _47=40;
var key=0;
key=e.keyCode||e.which;
if(key==_45){
if(this.gazetteerObj.divMenu==null||this.gazetteerObj.divMenu.style.visibility=="hidden"){
this.goToToponym();
}
}
},openComunas:function(){
var url=(this.link+this.nameComune).toLowerCase();
url=url.replace(/ /g,"");
url=url.replace(/'/g,"");
var _4a=new Object();
_4a=window.open(url,"","");
_4a.focus();
},toggleChild:function(){
if(document.getElementById(this.childElement.id)==null){
this.div.appendChild(this.childElement);
if(this.bottomdiv!=null){
this.div.appendChild(this.bottomdiv);
}
var _4b=document.getElementById("sbImgNascondi"+this.idname);
if(_4b!=null){
_4b.src=OpenLayers.ImgPath+"floating/nascondi.gif";
}
}else{
this.div.removeChild(this.childElement);
if(this.bottomdiv!=null){
this.div.removeChild(this.bottomdiv);
}
var _4b=document.getElementById("sbImgNascondi"+this.idname);
if(_4b!=null){
_4b.src=OpenLayers.ImgPath+"floating/ripristina.gif";
}
}
},CLASS_NAME:"Roja.Control.FloatingPanel.Gazetteer"});

Roja.Control.FloatingPanel.HTML=OpenLayers.Class(Roja.Control.FloatingPanel,{html:null,initialize:function(_1){
Roja.Control.FloatingPanel.prototype.initialize.apply(this,[_1]);
},destroy:function(){
},draw:function(){
Roja.Control.FloatingPanel.prototype.draw.apply(this,arguments);
this.setContentHtml();
return this.div;
},setContentHtml:function(){
var _2=navigator.appVersion.split("MSIE");
var _3=parseFloat(_2[1]);
if(_3<6.5){
this.iframe=document.createElement("iframe");
this.iframe.className=this.displayClass+"iframe";
this.div.appendChild(this.iframe);
}
this.divHtml=document.createElement("div");
this.divHtml.className="htmlFloatingPanel";
this.divHtml.style.overflow="auto";
if(navigator.appVersion.indexOf("MSIE")!=-1){
this.divHtml.style.width=(Math.ceil((201/206)*this.size.w))+"px";
}else{
this.divHtml.style.width=(Math.ceil((196/206)*this.size.w))+"px";
}
this.divHtml.style.height=this.size.h+"px";
this.divHtml.innerHTML=this.html;
this.childElement.appendChild(this.divHtml);
},CLASS_NAME:"Roja.Control.FloatingPanel.HTML"});

Roja.Control.FloatingPanel.LayerSwitcher=OpenLayers.Class(Roja.Control.FloatingPanel,{layerStates:null,layersDiv:null,baseLayersDiv:null,baseLayers:null,dataLbl:null,dataLayersDiv:null,dataLayers:null,minimizeDiv:null,maximizeDiv:null,ascending:true,groups:{groupDivs:{},checked:{},layers:{},display:{}},initialize:function(_1){
Roja.Control.FloatingPanel.prototype.initialize.apply(this,[_1]);
this.layerStates=[];
},destroy:function(){
OpenLayers.Event.stopObservingElement(this.div);
this.clearLayersArray("base");
this.clearLayersArray("data");
this.map.events.unregister("addlayer",this,this.redraw);
this.map.events.unregister("changelayer",this,this.redraw);
this.map.events.unregister("removelayer",this,this.redraw);
this.map.events.unregister("changebaselayer",this,this.redraw);
Roja.Control.FloatingPanel.prototype.destroy.apply(this,arguments);
},setMap:function(_2){
OpenLayers.Control.prototype.setMap.apply(this,arguments);
this.map.events.register("addlayer",this,this.redraw);
this.map.events.register("changelayer",this,this.redraw);
this.map.events.register("removelayer",this,this.redraw);
this.map.events.register("changebaselayer",this,this.redraw);
},draw:function(){
Roja.Control.FloatingPanel.prototype.draw.apply(this,arguments);
this.div.style.width=this.size.w+"px";
this.childElement.className=this.displayClass;
this.childElement.style.height="";
this.childElement.style.maxHeight=this.size.h+"px";
var _3=navigator.appVersion.split("MSIE");
var _4=parseFloat(_3[1]);
if(_4<6.5){
this.iframe=document.createElement("iframe");
this.iframe.className=this.displayClass+"iframe";
this.div.appendChild(this.iframe);
}
this.loadContents();
this.redraw();
return this.div;
},loadContents:function(){
this.layersDiv=document.createElement("div");
this.layersDiv.id="layersDiv";
this.layersDiv.style.maxHeight=this.size.h+"px";
this.layersDiv.style.overflowY="auto";
this.layersDiv.style.overflowX="hidden";
this.baseLbl=document.createElement("div");
this.baseLbl.className="layersLabel";
this.baseLbl.id="baseLayerLabel";
this.baseLbl.innerHTML="Base Layer";
this.baseLayersDiv=document.createElement("div");
this.baseLayersDiv.id="baseLayersDiv";
this.baseLayersDiv.className="dataOrBaseLayersDiv";
this.dataLbl=document.createElement("div");
this.dataLbl.className="layersLabel";
this.dataLbl.id="dataLayerLabel";
this.dataLbl.innerHTML="Overlays";
this.dataLayersDiv=document.createElement("div");
this.dataLayersDiv.id="baseLayersDiv";
this.dataLayersDiv.className="dataOrBaseLayersDiv";
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.childElement.appendChild(this.layersDiv);
var _5=OpenLayers.Util.getImagesLocation();
var sz=new OpenLayers.Size(18,18);
},clearLayersArray:function(_7){
var _8=this[_7+"Layers"];
if(_8){
for(var i=0;i<_8.length;i++){
var _a=_8[i];
OpenLayers.Event.stopObservingElement(_a.inputElem);
OpenLayers.Event.stopObservingElement(_a.labelSpan);
}
}
this[_7+"LayersDiv"].innerHTML="";
this[_7+"Layers"]=[];
this.groups.groupDivs={};
},checkRedraw:function(){
var _b=false;
if(!this.layerStates.length||(this.map.layers.length!=this.layerStates.length)){
_b=true;
}else{
for(var i=0;i<this.layerStates.length;i++){
var _d=this.layerStates[i];
var _e=this.map.layers[i];
if((_d.name!=_e.name)||(_d.inRange!=_e.inRange)||(_d.id!=_e.id)||(_d.visibility!=_e.visibility)){
_b=true;
break;
}
}
}
return _b;
},redraw:function(){
if(!this.checkRedraw()){
return this.div;
}
this.clearLayersArray("base");
this.clearLayersArray("data");
var _f=false;
var _10=false;
var i;
var _12;
this.layerStates=[];
for(i=0;i<this.map.layers.length;i++){
_12=this.map.layers[i];
this.layerStates[i]={"name":_12.name,"visibility":_12.visibility,"inRange":_12.inRange,"id":_12.id};
if(_12.group&&!_12.isBaseLayer){
_12.group=_12.group.replace(/\/$/,"");
_12.group=_12.group.replace(/^\//,"");
this.createGroupDiv(_12.group);
}
}
var _13=this.map.layers.slice();
if(!this.ascending){
_13.reverse();
}
for(i=0;i<_13.length;i++){
_12=_13[i];
var _14=_12.isBaseLayer;
var _15=null;
if(_12.displayInLayerSwitcher){
if(_14){
_10=true;
}else{
_f=true;
}
var _16=(_14)?(_12==this.map.baseLayer):_12.getVisibility();
var _17=document.createElement("div");
var _18="layerDiv"+(_16?"Active":"Inactive");
var _19=document.createElement("input");
_19.id="input_"+_12.name;
_19.name=(_14)?"baseLayers":_12.name;
_19.type=(_14)?"radio":"checkbox";
_19.value=_12.name;
_19.checked=_16;
_19.defaultChecked=_16;
if(!_14&&!_12.inRange){
_19.disabled=true;
}
var _1a={"inputElem":_19,"layer":_12,"layerSwitcher":this};
OpenLayers.Event.observe(_19,"mousedown",OpenLayers.Function.bindAsEventListener(this.onInputClick,_1a));
OpenLayers.Event.observe(_19,"mouseup",OpenLayers.Event.stop);
var _1b=document.createElement("span");
if(!_14&&!_12.inRange){
_1b.style.color="gray";
_18="layerDiv"+"OutOfRange";
}
_1b.innerHTML=_12.name;
_1b.style.verticalAlign=(_14)?"bottom":"baseline";
_1b.className="labelSpan";
OpenLayers.Event.observe(_1b,"click",OpenLayers.Function.bindAsEventListener(this.onInputClick,_1a));
_17.className=_18;
var _1c=(_14)?this.baseLayers:this.dataLayers;
_1c.push({"layer":_12,"inputElem":_19,"labelSpan":_1b});
if(!_14){
if(!_12.group){
_15=this.dataLayersDiv;
}else{
var _1d=_12.group;
var div=this.groups.groupDivs[_1d];
this.appendLayerToGroups(_12);
_15=div;
}
}else{
_15=this.baseLayersDiv;
}
_17.appendChild(_19);
_17.appendChild(_1b);
if(_12.buttonDropLayer===true){
this.addDropLayerButton(_12,_17);
}
if(_12.buttonMoveLayer===true){
this.addMoveLayerButton(_12,_17);
}
if(_12.buttonOpacity===true){
this.addOpacityLayerButton(_12,_17);
}
if(_12.buttonZoomToExtent===true){
this.addZoomToLayerExtentButton(_12,_17);
}
_15.appendChild(_17);
}
}
this.dataLbl.style.display=(_f)?"":"none";
this.baseLbl.style.display=(_10)?"":"none";
this.layersDiv.style.height="";
if(this.layersDiv.offsetHeight>this.size.h){
this.layersDiv.style.height=this.layersDiv.style.maxHeight;
}
return this.div;
},onInputClick:function(e){
if(!this.inputElem.disabled){
if(this.inputElem.type=="radio"){
this.inputElem.checked=true;
if(this.layer.layerMinZoomLevelGraphicLayerUrl){
this.layer.map.layerMinZoomLevelGraphicLayer.url=OpenLayers.ImgPath+this.layer.layerMinZoomLevelGraphicLayerUrl;
}
this.layer.map.setBaseLayer(this.layer);
this.layer.map.copyrightControl.setUrl(this.layer.copyrightUrl,this.layer.copyrightTitle);
if(this.layer.backgroundColor!=null){
this.layer.map.viewPortDiv.style.backgroundColor=this.layer.backgroundColor;
}else{
this.layer.map.viewPortDiv.style.backgroundColor=null;
}
}else{
this.inputElem.checked=!this.inputElem.checked;
this.layerSwitcher.updateMap();
}
}
OpenLayers.Event.stop(e);
},onInputGroupClick:function(e){
var _21=!this.inputElem.checked;
var _22=this.groupDiv.getElementsByTagName("input");
this.inputElem.checked=_21;
this.layerSwitcher.groups.checked[this.inputElem.value]=_21;
for(var i=0;i<_22.length;i++){
_22[i].checked=_21;
this.layerSwitcher.groups.checked[_22[i].value]=_21;
}
var _24=this.layerSwitcher.dataLayers;
for(var j=0;j<_24.length;j++){
var _26=_24[j];
if(this.layerSwitcher.isInGroup(this.inputElem.value,_26.layer)){
_26.inputElem.checked=_21;
_26.layer.setVisibility(_21);
if(!_26.layer.calculateInRange()){
_26.layer.display(false);
}
}
}
this.layerSwitcher.redraw();
OpenLayers.Event.stop(e);
},onLayerClick:function(e){
this.updateMap();
},onGroupClick:function(e){
var _29=this.layergroup;
var div=this.groups.groupDivs[_29];
if(div){
var _2b=(div.style.display!="block"?true:false);
this.layerswitcher.colapseGroup(_29,_2b);
}
this.layerswitcher.layersDiv.style.height="";
if(this.layerswitcher.layersDiv.offsetHeight>this.layerswitcher.size.h){
this.layerswitcher.layersDiv.style.height=this.layerswitcher.layersDiv.style.maxHeight;
}
},colapseGroup:function(_2c,_2d){
var div=this.groups.groupDivs[_2c];
if(div){
div.style.display=(_2d===true?"block":"none");
this.groups.display[_2c]=div.style.display;
}
},updateMap:function(){
var i;
var _30;
for(i=0;i<this.baseLayers.length;i++){
_30=this.baseLayers[i];
if(_30.inputElem.checked){
this.map.setBaseLayer(_30.layer,false);
}
}
for(i=0;i<this.dataLayers.length;i++){
_30=this.dataLayers[i];
_30.layer.setVisibility(_30.inputElem.checked);
}
},createGroupDiv:function(_31){
var _32=_31.split("/");
var _33=_32[_32.length-1];
var _34=this.groups.groupDivs[_31];
var _35=document.createElement("div");
_35.className="groupName";
if(!_34){
var _36=this.groups.groupDivs[_32.slice(0,_32.length-2).join("/")];
if(!_36){
if(_32.length==1){
_36=this.dataLayersDiv;
}else{
_36=this.createGroupDiv(_32.slice(0,_32.length-1).join("/"));
}
}
_34=document.createElement("div");
_34.className="layerGroup";
if(!this.groups.display[_31]){
this.groups.display[_31]="block";
}
_34.style.display=this.groups.display[_31];
this.groups.groupDivs[_31]=_34;
var _37=document.createElement("span");
_37.className="groupLabel";
_37.innerHTML=_33;
OpenLayers.Event.observe(_37,"mouseup",OpenLayers.Function.bindAsEventListener(this.onGroupClick,{layergroup:_31,groups:this.groups,layerswitcher:this}));
var _38=document.createElement("input");
_38.id="input_"+_32.join("_");
_38.name=_32.join("_");
_38.type="checkbox";
_38.value=_31;
_38.checked=false;
_38.defaultChecked=false;
if(!this.groups.checked[_31]){
this.groups.checked[_31]=false;
}
if(this.groups.layers[_31]){
this.groups.checked[_31]=false;
for(var i=0;i<this.groups.layers[_31].length;i++){
if(this.groups.layers[_31][i].getVisibility()==true){
this.groups.checked[_31]=true;
}
}
}
_38.checked=this.groups.checked[_31];
_38.defaultChecked=this.groups.checked[_31];
if(!this.groups.layers[_31]){
this.groups.layers[_31]=[];
}
var _3a={groupDiv:_34,layerSwitcher:this,inputElem:_38};
OpenLayers.Event.observe(_38,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputGroupClick,_3a));
_35.appendChild(_38);
_35.appendChild(_37);
_36.appendChild(_35);
_36.appendChild(_34);
}
return this.groups.groupDivs[_31];
},appendLayerToGroups:function(_3b){
var _3c=_3b.group.split("/");
var _3d=null;
for(var i=1;i<=_3c.length;i++){
_3d=_3c.slice(0,i).join("/");
if(!this.isInGroup(_3d,_3b)){
this.groups.layers[_3d].push(_3b);
if(_3b.getVisibility()==true){
this.groups.checked[_3d]=true;
}
}
}
},isInGroup:function(_3f,_40){
for(var j=0;j<this.groups.layers[_3f].length;j++){
if(this.groups.layers[_3f][j].id==_40.id){
return true;
}
}
return false;
},CLASS_NAME:"Roja.Control.FloatingPanel.LayerSwitcher"});

Roja.Control.FloatingPanel.Legend=OpenLayers.Class(Roja.Control.FloatingPanel,{initialize:function(_1){
Roja.Control.FloatingPanel.prototype.initialize.apply(this,[_1]);
},destroy:function(){
Roja.Control.FloatingPanel.prototype.destroy.apply(this,arguments);
},setMap:function(_2){
OpenLayers.Control.prototype.setMap.apply(this,arguments);
this.map.events.register("addlayer",this,this.redraw);
this.map.events.register("changelayer",this,this.redraw);
this.map.events.register("removelayer",this,this.redraw);
},draw:function(){
Roja.Control.FloatingPanel.prototype.draw.apply(this,arguments);
this.childElement.className=this.displayClass;
var _3=navigator.appVersion.split("MSIE");
var _4=parseFloat(_3[1]);
if(_4<6.5){
this.iframe=document.createElement("iframe");
this.iframe.className=this.displayClass+"iframe";
this.div.appendChild(this.iframe);
}
this.legendDiv=document.createElement("div");
this.legendDiv.className="LegendDiv";
this.childElement.appendChild(this.legendDiv);
this.childElement.style.height="";
this.childElement.style.maxHeight=this.size.h+"px";
this.legendDiv.style.overflow="auto";
this.legendDiv.style.maxHeight=this.size.h+"px";
this.redraw();
return this.div;
},redraw:function(){
this.legendDiv.innerHTML="";
this.legendDiv.style.height="";
if(this.map==null){
return;
}
var i;
for(i=0;i<this.map.layers.length;i++){
layer=this.map.layers[i];
if(layer.WMSSwitcher){
for(var y=0;y<layer.layers.length;y++){
var _7=layer.layers[y];
if(_7.legendUrl!=null&&_7.legendUrl!=""&&_7.visibility&&_7.displayInLayerSwitcher){
var _8=document.createElement("div");
_8.className="line";
this.legendDiv.appendChild(_8);
var _9=document.createElement("div");
_9.className="left";
_8.appendChild(_9);
var _a=document.createElement("img");
_a.src=_7.legendUrl;
if(_a.src.match("getlegendgraphic")){
_a.src+="&WIDTH="+_9.offsetWidth;
}
_9.appendChild(_a);
if(_7.legendName==true){
var _b=document.createElement("div");
_b.className="right";
_8.appendChild(_b);
var _c=document.createElement("span");
_c.innerHTML=_7.logicalName;
_b.appendChild(_c);
}else{
_9.style.width="100%";
}
}
}
}
if(!layer.isBaseLayer&&layer.displayInLayerSwitcher&&layer.visibility){
var _8=document.createElement("div");
_8.className="line";
this.legendDiv.appendChild(_8);
var _9=document.createElement("div");
_9.className="left";
_8.appendChild(_9);
var _a=document.createElement("img");
_a.src=layer.legendUrl;
if(_a.src.match("getlegendgraphic")){
_a.src+="&WIDTH="+_9.offsetWidth;
}
_a.style.width="100%";
_9.appendChild(_a);
var _b=document.createElement("div");
_b.className="right";
_8.appendChild(_b);
var _c=document.createElement("span");
_c.innerHTML=layer.name;
_b.appendChild(_c);
}
}
if(this.size!=null&&this.size.h!=null){
if(this.legendDiv.offsetHeight>this.size.h){
this.legendDiv.style.height=this.legendDiv.style.maxHeight;
}
}
},toggleChild:function(){
Roja.Control.FloatingPanel.prototype.toggleChild.apply(this,arguments);
if(document.getElementById(this.childElement.id)!=null){
this.redraw();
}
},CLASS_NAME:"Roja.Control.FloatingPanel.Legend"});

Roja.Control.FloatingPanel.Overview=OpenLayers.Class(Roja.Control.FloatingPanel,{ovmap:null,layers:null,minRatio:8,maxRatio:32,mapOptions:null,layerBounds:null,imageUrl:null,zoomboxHideLevel:0,initialize:function(_1){
if(!_1.imageUrl){
this.imageUrl=OpenLayers.ImgPath+"overview.jpg";
}else{
this.imageUrl=_1.imageUrl;
}
this.layers=new Array();
Roja.Control.FloatingPanel.prototype.initialize.apply(this,[_1]);
},destroy:function(){
this.map.events.un({"moveend":this.update,scope:this});
if(!this.mapDiv){
return;
}
this.rectEvents.destroy();
this.rectEvents=null;
if(this.ovmap!=null){
this.ovmap.destroy();
this.ovmap=null;
}
this.childElement.removeChild(this.mapDiv);
this.mapDiv=null;
this.childElement=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});
Roja.Control.FloatingPanel.prototype.destroy.apply(this,arguments);
},draw:function(){
Roja.Control.FloatingPanel.prototype.draw.apply(this,arguments);
this.div.style.height="";
if(this.layers.length==0){
this.graphicLayer=new Roja.Layer.Image("Overview",this.imageUrl,this.layerBounds,this.size);
this.graphicLayer.setIsBaseLayer(false);
this.graphicLayer.setVisibility(false);
this.graphicLayer.displayInLayerSwitcher=false;
this.map.addLayer(this.graphicLayer);
var _2=this.graphicLayer.clone();
_2.setIsBaseLayer(true);
this.layers=[_2];
}
this.mapDiv=document.createElement("div");
this.mapDiv.id=OpenLayers.Util.createUniqueID(this.idname);
this.mapDiv.className="mapDiv";
this.childElement.appendChild(this.mapDiv);
this.map.events.register("moveend",this,this.update);
if(!this.external){
this.map.events.register("mouseup",this,this.moveStartOverview);
this.map.events.register("mousemove",this,this.moveStartOverview);
}
this.rectEvents=new OpenLayers.Events(this,this.mapDiv,null,true,{includeXY:true});
this.rectEvents.register("mouseout",this,this.rectMouseOut);
this.rectEvents.register("mousedown",this,this.rectMouseDown);
this.rectEvents.register("mousemove",this,this.rectMouseMove);
this.rectEvents.register("mouseup",this,this.rectMouseUp);
this.rectEvents.register("click",this,function(e){
OpenLayers.Event.stop(e);
});
if(this.map.getExtent()){
this.update();
}
return this.div;
},baseLayerDraw:function(){
this.draw();
this.map.events.unregister("changebaselayer",this,this.baseLayerDraw);
},rectMouseOut:function(_4){
if(this.mouseDragStart!=null&&OpenLayers.Util.mouseLeft(_4,this.ovmap.div)){
if(this.zoomBox){
this.removeZoomBox();
}
this.mouseDragStart=null;
}
},rectMouseDown:function(_5){
if(this.zoomBox!=null){
this.removeZoomBox();
}
if(!OpenLayers.Event.isLeftClick(_5)){
return;
}
if(navigator.appVersion.indexOf("MSIE")!=-1){
_5.xy.x=_5.xy.x-4;
_5.xy.y=_5.xy.y-4;
}else{
_5.xy.x=_5.xy.x-2;
_5.xy.y=_5.xy.y-2;
}
this.mouseDragStart=_5.xy.clone();
this.performedDrag=false;
this.startViaKeyboard=true;
this.ovmap.div.style.cursor="crosshair";
this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.mouseDragStart,null,null,"absolute","2px solid red");
this.zoomBox.style.fontSize="1px";
this.zoomBox.style.zIndex=this.ovmap.Z_INDEX_BASE["Popup"]-1;
this.ovmap.viewPortDiv.appendChild(this.zoomBox);
this.performedDrag=true;
OpenLayers.Event.stop(_5);
},rectMouseMove:function(_6){
if(this.mouseDragStart!=null){
_6.xy.x=_6.xy.x-2;
_6.xy.y=_6.xy.y-2;
var _7=Math.abs(this.mouseDragStart.x-_6.xy.x);
var _8=Math.abs(this.mouseDragStart.y-_6.xy.y);
this.zoomBox.style.width=Math.max(1,_7)+"px";
this.zoomBox.style.height=Math.max(1,_8)+"px";
if(_6.xy.x<this.mouseDragStart.x){
this.zoomBox.style.left=_6.xy.x+"px";
}
if(_6.xy.y<this.mouseDragStart.y){
this.zoomBox.style.top=_6.xy.y+"px";
}
this.performedDrag=true;
}
},rectMouseUp:function(_9){
if(!OpenLayers.Event.isLeftClick(_9)){
return;
}
this.zoomBoxEnd(_9);
document.onselectstart=null;
this.mouseDragStart=null;
},zoomBoxEnd:function(_a){
if(this.mouseDragStart!=null){
_a.xy.x=_a.xy.x-2;
_a.xy.y=_a.xy.y-2;
if(Math.abs(this.mouseDragStart.x-_a.xy.x)>5||Math.abs(this.mouseDragStart.y-_a.xy.y)>5){
var _b=this.ovmap.getLonLatFromViewPortPx(this.mouseDragStart);
var _c=this.ovmap.getLonLatFromViewPortPx(_a.xy);
var _d=Math.max(_b.lat,_c.lat);
var _e=Math.min(_b.lat,_c.lat);
var _f=Math.min(_b.lon,_c.lon);
var _10=Math.max(_b.lon,_c.lon);
var _11=new OpenLayers.Bounds(_f,_e,_10,_d);
if(this.map.getZoomForExtent(_11)>0){
if(!this.map.isValidLonLat(_11.getCenterLonLat())){
if(this.zoomBox!=null){
this.removeZoomBox();
}
this.map.zoomTo(0);
return false;
}
this.map.zoomToExtent(_11);
}else{
if(this.zoomBox!=null){
this.removeZoomBox();
}
this.map.zoomTo(this.map.getZoomForExtent(_11));
}
}else{
var _c=this.ovmap.getLonLatFromViewPortPx(_a.xy);
if(!this.map.isValidLonLat(new OpenLayers.LonLat((_c.lon),(_c.lat)))){
if(this.zoomBox!=null){
this.removeZoomBox();
}
this.map.zoomTo(0);
return false;
}
this.map.setCenter(new OpenLayers.LonLat((_c.lon),(_c.lat)),this.map.getZoom()+1);
}
}
},update:function(){
if(document.getElementById(this.childElement.id)==null){
return;
}
if(this.ovmap==null){
this.createMap();
}
if(!this.isSuitableOverview()&&this.map.getZoom()==0){
this.updateOverview();
}
this.updateRectToMap();
},moveStartOverview:function(){
var _12=document.getElementById(this.mapDiv.id);
if(this.ovmap&&this.ovmap!=null&&_12&&_12!=null){
this.ovmap.events.triggerEvent("movestart");
}
},updateOverview:function(){
var _13=this.map.getResolution();
var _14=this.ovmap.getResolution();
var _15=_14/_13;
if(_15>this.maxRatio){
_14=this.minRatio*_13;
}else{
if(_15<=this.minRatio){
_14=this.maxRatio*_13;
}
}
this.ovmap.setCenter(this.map.center,this.ovmap.getZoomForResolution(_14));
this.updateRectToMap();
},createMap:function(){
var _16=OpenLayers.Util.extend({controls:[],maxResolution:"auto"},this.mapOptions);
this.ovmap=new Roja.Map(this.mapDiv.id,_16);
this.ovmap.addLayers(this.layers);
this.ovmap.zoomTo(0);
},updateRectToMap:function(){
if(this.zoomBox!=null){
this.removeZoomBox();
}
if(this.map.units!="degrees"){
if(this.ovmap.getProjection()&&(this.map.getProjection()!=this.ovmap.getProjection())){
alert("The overview map only works when it is in the same projection as the main map");
}
}
var _17=this.getRectBoundsFromMapBounds(this.map.getExtent());
if(this.map.getZoom()>this.zoomboxHideLevel){
if(_17){
this.setRectPxBounds(_17);
}
}
},setRectPxBounds:function(_18){
var _19;
var top=Math.max(_18.top,0);
var _1b=Math.max(_18.left,0);
var _1c=_18.top+Math.abs(_18.getHeight());
var _1d=_18.left+_18.getWidth();
this.zoomBox=OpenLayers.Util.createDiv("zoomBox",null,null,null,"absolute","2px solid red");
this.zoomBox.style.fontSize="1px";
this.zoomBox.style.top=parseInt(top)+"px";
this.zoomBox.style.left=parseInt(_1b)+"px";
this.zoomBox.style.height=parseInt(Math.max(_1c-top,0))+"px";
this.zoomBox.style.width=parseInt(Math.max(_1d-_1b,0))+"px";
this.zoomBox.style.zIndex=this.ovmap.Z_INDEX_BASE["Popup"]-1;
this.ovmap.viewPortDiv.appendChild(this.zoomBox);
},updateMapToRect:function(){
var _1e=this.getRectPxBounds();
var _1f=this.getMapBoundsFromRectBounds(_1e);
this.map.setCenter(_1f.getCenterLonLat(),this.map.zoom);
},stopevent:function(evt){
OpenLayers.Event.stop(evt,true);
},removeZoomBox:function(){
this.ovmap.viewPortDiv.removeChild(this.zoomBox);
this.zoomBox=null;
},isSuitableOverview:function(){
var _21=this.map.getExtent();
var _22=this.map.maxExtent;
var _23=new OpenLayers.Bounds(Math.max(_21.left,_22.left),Math.max(_21.bottom,_22.bottom),Math.min(_21.right,_22.right),Math.min(_21.top,_22.top));
var _24=this.ovmap.getResolution()/this.map.getResolution();
return ((_24>this.minRatio)&&(_24<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(_23)));
},getRectBoundsFromMapBounds:function(_25){
var _26=new OpenLayers.LonLat(_25.left,_25.bottom);
var _27=new OpenLayers.LonLat(_25.right,_25.top);
var _28=this.getOverviewPxFromLonLat(_26);
var _29=this.getOverviewPxFromLonLat(_27);
var _2a=null;
if(_28&&_29){
_2a=new OpenLayers.Bounds(_28.x,_28.y,_29.x,_29.y);
}
return _2a;
},getOverviewPxFromLonLat:function(_2b){
var res=this.ovmap.getResolution();
var _2d=this.ovmap.getExtent();
var px=null;
if(_2d){
px=new OpenLayers.Pixel(Math.round(1/res*(_2b.lon-_2d.left)),Math.round(1/res*(_2d.top-_2b.lat)));
}
return px;
},getMapBoundsFromRectBounds:function(_2f){
var _30=new OpenLayers.Pixel(_2f.left,_2f.bottom);
var _31=new OpenLayers.Pixel(_2f.right,_2f.top);
var _32=this.getLonLatFromOverviewPx(_30);
var _33=this.getLonLatFromOverviewPx(_31);
return new OpenLayers.Bounds(_32.lon,_32.lat,_33.lon,_33.lat);
},toggleChild:function(){
Roja.Control.FloatingPanel.prototype.toggleChild.apply(this);
this.update();
},CLASS_NAME:"Roja.Control.FloatingPanel.Overview"});

Roja.Control.FloatingPanel.Overview.Simple=OpenLayers.Class(Roja.Control.FloatingPanel.Overview,{size:new OpenLayers.Size(168,104),position:null,initialize:function(_1){
Roja.Control.FloatingPanel.Overview.prototype.initialize.apply(this,[_1]);
},floatingPanelDraw:function(){
Roja.Control.prototype.draw.apply(this,arguments);
this.div.className="RojaControlFloatingPanelOverviewSimple";
this.titlePanel=document.createElement("div");
this.titlePanel.className="titlePanel";
this.titlePanel.style.width=this.size.w+"px";
this.titlePanel.style.cursor="default";
this.spanTitle=document.createElement("span");
this.spanTitle.className="titleSpan";
this.divtext=document.createElement("div");
this.divtext.className="titleText";
this.divtext.innerHTML=this.title;
this.spanTitle.appendChild(this.divtext);
this.statusbarimg=document.createElement("div");
this.statusbarimg.className="statusBarImg";
this.spanTitle.appendChild(this.statusbarimg);
this.imgNascondi=document.createElement("img");
this.imgNascondi.id="sbImgNascondi"+this.idname;
this.imgNascondi.src=OpenLayers.ImgPath+"floating/nascondiSimple.gif";
this.imgNascondi.style.cursor="pointer";
this.statusbarimg.appendChild(this.imgNascondi);
this.floatingEvents=new OpenLayers.Events(this,this.imgNascondi,null,true);
this.floatingEvents.register("click",this,this.toggleChild);
this.titlePanel.appendChild(this.spanTitle);
this.div.appendChild(this.titlePanel);
this.childElement=document.createElement("div");
this.childElement.id=this.idname+"Child";
this.childElement.style.top="0px";
this.childElement.style.left="0px";
this.childElement.style.width=this.size.w+"px";
this.childElement.style.height=this.size.h+"px";
this.childElement.className="child";
this.div.appendChild(this.childElement);
OpenLayers.Event.observe(this.div,"DOMMouseScroll",this.stopLocalEvent);
OpenLayers.Event.observe(this.div,"mousewheel",this.stopLocalEvent);
this.overflowEvents=new OpenLayers.Events(this,this.div,null,true);
this.overflowEvents.register("mousedown",this,this.mouseDownEvent);
this.overflowEvents.register("mouseup",this,this.mouseUpEvent);
this.events=new OpenLayers.Events(this,this.childElement,null);
this.events.register("click",this.childElement,this.stopevent);
var _2={div:this.div,zIndex:this.zIndex};
this.events.register("mousedown",this.childElement,OpenLayers.Function.bindAsEventListener(this.mouseDownEventOnChild,_2));
this.events.register("dblclick",this.childElement,this.stopevent);
this.events=new OpenLayers.Events(this,this.titlePanel,null);
this.events.register("click",this.titlePanel,this.stopevent);
this.events.register("dblclick",this.titlePanel,this.stopevent);
this.map.events.unregister("moveend",this,this.update);
this.map.floatingDivList.push(this);
return this.div;
},draw:function(){
this.floatingPanelDraw();
this.div.style.height="";
if(this.layers.length==0){
this.graphicLayer=new Roja.Layer.Image("Overview",this.imageUrl,this.layerBounds,this.size);
this.graphicLayer.setIsBaseLayer(false);
this.graphicLayer.setVisibility(false);
this.graphicLayer.displayInLayerSwitcher=false;
this.map.addLayer(this.graphicLayer);
var _3=this.graphicLayer.clone();
_3.setIsBaseLayer(true);
this.layers=[_3];
}
this.mapDiv=document.createElement("div");
this.mapDiv.id=OpenLayers.Util.createUniqueID(this.idname);
this.mapDiv.className="mapDiv";
this.childElement.appendChild(this.mapDiv);
this.map.events.register("moveend",this,this.update);
this.rectEvents=new OpenLayers.Events(this,this.mapDiv,null,true,{includeXY:true});
this.rectEvents.register("mouseout",this,this.rectMouseOut);
this.rectEvents.register("mousedown",this,this.rectMouseDown);
this.rectEvents.register("mousemove",this,this.rectMouseMove);
this.rectEvents.register("mouseup",this,this.rectMouseUp);
this.rectEvents.register("click",this,function(e){
OpenLayers.Event.stop(e);
});
if(this.map.getExtent()){
this.update();
}
return this.div;
},toggleChild:function(){
if(document.getElementById(this.childElement.id)==null){
this.div.appendChild(this.childElement);
var _5=document.getElementById("sbImgNascondi"+this.idname);
if(_5!=null){
_5.src=OpenLayers.ImgPath+"floating/nascondiSimple.gif";
}
}else{
this.div.removeChild(this.childElement);
var _5=document.getElementById("sbImgNascondi"+this.idname);
if(_5!=null){
_5.src=OpenLayers.ImgPath+"floating/ripristinaSimple.gif";
}
}
},CLASS_NAME:"Roja.Control.FloatingPanel.Overview.Simple"});

Roja.Control.FloatingPanel.SearchAddress=OpenLayers.Class(Roja.Control.FloatingPanel,{idname:null,addressObj:null,htmlbottomdiv:null,initialize:function(_1){
Roja.Control.FloatingPanel.prototype.initialize.apply(this,[_1]);
this.idname=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
var _2={"searchAddressEle":this};
this.addressObj.events.register("loadComplete",this.addressObj,this.loadComplete.bindAsEventListener(_2));
this.addressObj.events.register("loadFailure",this.addressObj,this.loadFailure.bindAsEventListener(_2));
},destroy:function(){
Roja.Control.FloatingPanel.prototype.destroy.apply(this,arguments);
},loadComplete:function(e){
this.searchAddressEle.bottomdiv.innerHTML=this.searchAddressEle.htmlbottomdiv;
this.searchAddressEle.bottomdiv.className=this.searchAddressEle.bottomdiv.className.replace("hidden","show");
OpenLayers.Console.debug(this.searchAddressEle.bottomdiv.className);
},loadFailure:function(){
this.searchAddressEle.bottomdiv.innerHTML=this.searchAddressEle.htmlbottomdiv;
this.searchAddressEle.bottomdiv.className=this.searchAddressEle.bottomdiv.className.replace("hidden","show");
OpenLayers.Console.debug(this.searchAddressEle.bottomdiv.className);
},draw:function(){
Roja.Control.FloatingPanel.prototype.draw.apply(this,arguments);
this.childElement.className="RojaSearchAddressFloatingPanel";
var _4=navigator.appVersion.split("MSIE");
var _5=parseFloat(_4[1]);
if(_5<6.5){
this.iframe=document.createElement("iframe");
this.iframe.className=this.displayClass+"iframe";
this.div.appendChild(this.iframe);
}
this.divFindIndirizzi=document.createElement("div");
this.divFindIndirizzi.className="ricercaindirizzo floating";
this.divFindIndirizzi.style.zIndex="1003";
this.divFindIndirizzi.id="findindirizzi";
this.childElement.appendChild(this.divFindIndirizzi);
this.divFindComuniChild=document.createElement("div");
this.divFindComuniChild.className="size95 floating alignleft labelindirizzo";
this.divFindIndirizzi.appendChild(this.divFindComuniChild);
this.spanTitleComune=document.createElement("span");
this.spanTitleComune.innerHTML="Indirizzo";
this.divFindComuniChild.appendChild(this.spanTitleComune);
this.divInput=document.createElement("div");
this.divInput.className="floating divInputText";
this.divInput.id="divInputText";
this.divFindIndirizzi.appendChild(this.divInput);
this.input=document.createElement("input");
this.input.className="size100";
this.input.type="text";
this.input.id="address-field";
this.input.name="indirizzo";
this.input.setAttribute("autocomplete","off");
this.divInput.appendChild(this.input);
this.divVai=document.createElement("input");
this.divVai.className="inputButton";
this.divVai.id="complete-button";
this.divVai.style.marginLeft="0.45em";
this.divVai.style.width="3.15em";
this.divVai.style.height="1.62em";
this.divVai.value="Vai";
this.divVai.type="button";
this.divVai.alt="";
this.divVai.scr=OpenLayers.ImgPath+"submit.gif";
this.divVai.title="Avvia la ricerca";
this.divFindIndirizzi.appendChild(this.divVai);
OpenLayers.Event.observe(this.divVai,"click",this.goToAddress.bind(this));
this.div.style.width=this.size.w;
if(this.htmlbottomdiv!=null){
this.bottomdiv=document.createElement("div");
this.div.appendChild(this.bottomdiv);
this.events=new OpenLayers.Events(this,this.bottomdiv,null);
this.events.register("dblclick",this.bottomdiv,this.stopevent);
this.events.register("mousedown",this.bottomdiv,this.stopevent);
this.events.register("mouseup",this.bottomdiv,this.stopevent);
this.bottomdiv.id=this.id+"_bottomdiv";
this.bottomdiv.style.width=this.size.w;
this.bottomdiv.style.height="1.4em";
this.bottomdiv.className="panelbottom hidden";
this.bottomdiv.innerHTML=this.htmlbottomdiv;
}
return this.div;
},goToAddress:function(){
var _6=this.input.value;
this.addressObj.load(_6);
},setContentBottomDiv:function(_7){
this.htmlbottomdiv=_7;
},reset:function(){
this.childElement.innerHTML=this.html;
this.childElement.style.height="";
if(this.htmlbottomdiv!=null){
this.bottomdiv.innerHTML=this.htmlbottomdiv;
}
},toggleChild:function(){
if(document.getElementById(this.childElement.id)==null){
this.div.appendChild(this.childElement);
if(this.bottomdiv!=null){
this.div.appendChild(this.bottomdiv);
}
var _8=document.getElementById("sbImgNascondi"+this.idname);
if(_8!=null){
_8.src=OpenLayers.ImgPath+"floating/nascondi.gif";
}
}else{
this.div.removeChild(this.childElement);
if(this.bottomdiv!=null){
this.div.removeChild(this.bottomdiv);
}
var _8=document.getElementById("sbImgNascondi"+this.idname);
if(_8!=null){
_8.src=OpenLayers.ImgPath+"floating/ripristina.gif";
}
}
},CLASS_NAME:"Roja.Control.FloatingPanel.SearchAddress"});

Roja.Control.FloatingPanel.Route=OpenLayers.Class(Roja.Control.FloatingPanel,{html:null,htmlbottomdiv:null,initialize:function(_1){
Roja.Control.FloatingPanel.prototype.initialize.apply(this,[_1]);
},destroy:function(){
Roja.Control.FloatingPanel.prototype.destroy.apply(this,arguments);
},resetPosition:function(_2){
Roja.Control.FloatingPanel.prototype.resetPosition.apply(this,arguments);
this.childElement.style.overflowY="auto";
},mouseDownEvent:function(_3){
this.childElement.style.overflowY="hidden";
Roja.Control.FloatingPanel.prototype.mouseDownEvent.apply(this,arguments);
this.dndMgr._mouseDownHandler(_3);
},mouseUpEvent:function(_4){
this.dndMgr._mouseUp(_4);
Roja.Control.FloatingPanel.prototype.mouseUpEvent.apply(this,arguments);
this.childElement.style.overflowY="auto";
},draw:function(){
Roja.Control.FloatingPanel.prototype.draw.apply(this,arguments);
this.childElement.style.width=this.size.w+"px";
this.childElement.innerHTML=this.html;
this.childElement.style.height="";
this.childElement.style.maxHeight=this.size.h+"px";
this.childElement.style.overflowY="auto";
this.childElement.className="olRouteFloatingPanel";
if(this.htmlbottomdiv!=null){
this.bottomdiv=document.createElement("div");
this.div.appendChild(this.bottomdiv);
this.events=new OpenLayers.Events(this,this.bottomdiv,null);
this.events.register("dblclick",this.bottomdiv,this.stopevent);
this.events.register("mousedown",this.bottomdiv,this.stopevent);
this.events.register("mouseup",this.bottomdiv,this.stopevent);
this.bottomdiv.id=this.idname+"Bottom";
this.bottomdiv.style.width=this.size.w+"px";
this.bottomdiv.className="panelbottom";
this.bottomdiv.innerHTML=this.htmlbottomdiv;
}
return this.div;
},setRicoDragDrop:function(){
var _5=this.map.viewPortDiv;
this.dndMgr=new Rico.DragAndDrop(_5);
this.dndMgr.initializeEventHandlers();
this.dndMgr.registerDraggable(new Rico.Draggable("",this.div));
this.map.events.register("mousedown",this.div,this.dndMgr._mouseDown);
this.map.events.register("mousemove",this.div,this.dndMgr._mouseMove);
this.map.events.register("mouseup",this.div,this.dndMgr._mouseUp);
},toggleChild:function(){
if(document.getElementById(this.childElement.id)==null){
this.div.appendChild(this.childElement);
if(this.bottomdiv!=null){
this.div.appendChild(this.bottomdiv);
}
var _6=document.getElementById("sbImgNascondi"+this.idname);
if(_6!=null){
_6.src=OpenLayers.ImgPath+"floating/nascondi.gif";
}
}else{
this.div.removeChild(this.childElement);
if(this.bottomdiv!=null){
this.div.removeChild(this.bottomdiv);
}
var _6=document.getElementById("sbImgNascondi"+this.idname);
if(_6!=null){
_6.src=OpenLayers.ImgPath+"floating/ripristina.gif";
}
}
},setContentBottomDiv:function(_7){
this.htmlbottomdiv=_7;
},reset:function(){
this.childElement.innerHTML=this.html;
this.childElement.style.height="";
if(this.htmlbottomdiv!=null){
this.bottomdiv.innerHTML=this.htmlbottomdiv;
}
},CLASS_NAME:"Roja.Control.RouteFloatingPanel"});

Roja.Layer.ArcXML=OpenLayers.Class(OpenLayers.Layer.Grid,Roja.Layer,{reproject:false,isBaseLayer:true,tileOrigin:null,initialize:function(_1,_2,_3){
var _4=new Array();
_4.push(_1,_2,{},_3);
OpenLayers.Layer.Grid.prototype.initialize.apply(this,_4);
Roja.Layer.prototype.setLoading.apply(this,arguments);
},destroy:function(){
OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments);
},clone:function(_5){
if(_5==null){
_5=new Roja.Layer.ArcXML(this.name,this.url,this.options);
}
_5=OpenLayers.Layer.Grid.prototype.clone.apply(this,[_5]);
return _5;
},addTile:function(_6,_7){
if(!_7){
_7=new OpenLayers.Pixel();
}
return new Roja.Tile.ArcXML(this,_7,_6,this.url,this.tileSize);
},setMap:function(_8){
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:"Roja.Layer.ArcXML"});

Roja.Layer.GeoRSS=OpenLayers.Class(OpenLayers.Layer.Markers,Roja.Layer,{location:null,features:null,selectedFeature:null,type:null,iconUrl:null,iconSize:null,restrictedAreaSize:null,initialize:function(_1,_2,_3,_4){
OpenLayers.Layer.Markers.prototype.initialize.apply(this,[_1,_4]);
this.location=_2;
this.features=new Array();
this.type=_3;
if(this.type=="url"){
var _5=_2;
if(Roja.Proxy&&_2.startsWith("http")){
_5=Roja.Proxy+Roja.Util.escapeUri(_2);
}
OpenLayers.loadURL(_5,null,this,this.parseData);
}else{
this.parseData(OpenLayers.parseXMLString(_2));
}
Roja.Layer.prototype.setLoading.apply(this,arguments);
},destroy:function(){
this.clearFeatures();
this.features=null;
OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);
},parseData:function(_6){
var _7=null;
if(this.type=="url"){
_7=_6.responseXML;
if(!_7||_6.fileType!="XML"){
_7=OpenLayers.parseXMLString(_6.responseText);
}
}else{
_7=_6;
}
this.name=null;
try{
this.name=_7.getElementsByTagNameNS("*","title")[0].firstChild.nodeValue;
}
catch(e){
this.name=_7.getElementsByTagName("title")[0].firstChild.nodeValue;
}
var _8=null;
try{
_8=_7.getElementsByTagNameNS("*","item");
}
catch(e){
_8=_7.getElementsByTagName("item");
}
if(_8.length==0){
try{
_8=_7.getElementsByTagNameNS("*","entry");
}
catch(e){
_8=_7.getElementsByTagName("entry");
}
}
for(var i=0;i<_8.length;i++){
var _6={};
var _a=OpenLayers.Util.getNodes(_8[i],"georss:where");
var _b=OpenLayers.Util.getNodes(_8[i],"georss:point");
var _c=OpenLayers.Util.getNodes(_8[i],"geo:lat");
var _d=OpenLayers.Util.getNodes(_8[i],"geo:long");
if(_a.length>0){
var _e=OpenLayers.Util.getNodes(_a[0],"gml:Point");
var _f=OpenLayers.Util.getNodes(_e[0],"gml:pos");
var _10=_f[0].firstChild.nodeValue.split(" ");
if(_10.length!=2){
var _10=_f[0].firstChild.nodeValue.split(",");
}
}else{
if(_b.length>0){
var _10=_b[0].firstChild.nodeValue.split(" ");
if(_10.length!=2){
var _10=_b[0].firstChild.nodeValue.split(",");
}
}else{
if(_c.length>0&&_d.length>0){
var _10=[parseFloat(_c[0].firstChild.nodeValue),parseFloat(_d[0].firstChild.nodeValue)];
}else{
continue;
}
}
}
_10=new OpenLayers.LonLat(parseFloat(_10[1]),parseFloat(_10[0]));
var _11="Untitled";
try{
_11=OpenLayers.Util.getNodes(_8[i],"title")[0].firstChild.nodeValue;
}
catch(e){
_11="Untitled";
}
var _12=null;
try{
_12=_8[i].getElementsByTagNameNS("*","description");
}
catch(e){
_12=_8[i].getElementsByTagName("description");
}
if(_12.length==0){
try{
_12=_8[i].getElementsByTagNameNS("*","summary");
}
catch(e){
_12=_8[i].getElementsByTagName("summary");
}
}
var _13="No description.";
try{
_13=_12[0].firstChild.nodeValue;
}
catch(e){
_13="No description.";
}
try{
var _14=OpenLayers.Util.getNodes(_8[i],"guid")[0].firstChild.nodeValue;
}
catch(e){
try{
var _14=OpenLayers.Util.getNodes(_8[i],"guid")[0].getAttribute("href");
}
catch(e){
}
}
var _15="";
try{
_15=OpenLayers.Util.getNodes(_8[i],"category")[0].firstChild.nodeValue;
}
catch(e){
_15="";
}
var _16=_15.substring(_15.indexOf("/")+1);
var _17=null;
if(_16!=""){
var _18=new OpenLayers.Size(20,34);
var _19=new OpenLayers.Pixel(-(_18.w/2),-_18.h);
_17=new OpenLayers.Icon(_16,_18,_19);
}else{
_17=OpenLayers.Marker.defaultIcon();
}
_17.imageDiv.style.cursor="pointer";
_6.icon=_17;
_6.popupSize=new OpenLayers.Size(250,120);
var _1a=OpenLayers.ImgPath+"/logo.gif";
if((_11!=null)&&(_13!=null)){
contentHTML="<div class=\"olLayerGeoRSSTitle\">";
if(_14){
contentHTML+="<a id=\"address"+this.id+"_"+i+"\" class=\"link\" href=\"#\" onclick=\"window.open('"+_14+"','"+_11+"')\">";
}
contentHTML+=_11;
if(_14){
contentHTML+="</a>";
}
contentHTML+="</div>";
contentHTML+="<div style=\"\" class=\"olLayerGeoRSSDescription\">";
contentHTML+="<img alt=\"Logo\" src=\""+_1a+"\"/><br/>";
contentHTML+=_13;
contentHTML+="</div>";
_6["popupContentHTML"]=contentHTML;
}
var _1b={lonlat:_10,iconSize:this.iconSize,iconUrl:this.iconUrl,restrictedAreaSize:this.restrictedAreaSize};
var _1c=new Roja.Marker(_1b);
this.addMarker(_1c);
_1c.createPopup(contentHTML,false);
var _1d={"georss":this,"marker":_1c};
_1c.events.register("click",_1c,this.markerClick.bindAsEventListener(_1d));
}
},markerClick:function(evt){
var _1f=this.georss.markers;
for(var i=0;i<_1f.length;i++){
if(_1f[i]!=this.marker){
_1f[i].popup.hide();
}
}
},clearFeatures:function(){
if(this.features!=null){
while(this.features.length>0){
var _21=this.features[0];
OpenLayers.Util.removeItem(this.features,_21);
_21.destroy();
}
}
},CLASS_NAME:"Roja.Layer.GeoRSS"});

Roja.Layer.Image=OpenLayers.Class(OpenLayers.Layer.Image,Roja.Layer,{initialize:function(_1,_2,_3,_4,_5){
OpenLayers.Layer.Image.prototype.initialize.apply(this,[_1,_2,_3,_4,_5]);
Roja.Layer.prototype.setLoading.apply(this,arguments);
},destroy:function(){
OpenLayers.Layer.prototype.destroy.apply(this,arguments);
},CLASS_NAME:"Roja.Layer.Image"});

Roja.Layer.Markers=OpenLayers.Class(OpenLayers.Layer.Markers,Roja.Layer,{initialize:function(_1,_2,_3){
OpenLayers.Layer.Markers.prototype.initialize.apply(this,[_1,_2,_3]);
Roja.Layer.prototype.setLoading.apply(this,arguments);
},removeMarker:function(_4){
OpenLayers.Util.removeItem(this.markers,_4);
if((_4.icon!=null)&&(_4.icon.imageDiv!=null)&&(_4.icon.imageDiv.parentNode==this.div)){
this.div.removeChild(_4.icon.imageDiv);
_4.drawn=false;
}
if(_4.popup!=null){
this.map.removePopup(_4.popup);
_4.popup.destroy();
}
},display:function(_5){
OpenLayers.Layer.Markers.prototype.display.apply(this,arguments);
var i;
for(i=0;i<this.markers.length;i++){
var _7=this.markers[i];
if(_7.popup!=null&&!_5){
_7.popup.hide();
}
}
},CLASS_NAME:"Roja.Layer.Markers"});

Roja.Layer.RasTMS=OpenLayers.Class(OpenLayers.Layer.Grid,Roja.Layer,{reproject:false,isBaseLayer:true,tileOrigin:null,emptyImg:null,initialize:function(_1,_2,_3){
var _4=new Array();
_4.push(_1,_2,{},_3);
OpenLayers.Layer.Grid.prototype.initialize.apply(this,_4);
Roja.Layer.prototype.setLoading.apply(this,arguments);
},destroy:function(){
OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments);
},clone:function(_5){
if(_5==null){
_5=new Roja.Layer.RasTMS(this.name,this.url,this.options);
}
_5=OpenLayers.Layer.Grid.prototype.clone.apply(this,[_5]);
return _5;
},getURL:function(_6){
var _7=this.map.getResolution();
var _8=Math.ceil((this.map.getMaxExtent().top-this.map.getMaxExtent().bottom)/(_7*this.tileSize.h));
var x=((_6.left-this.tileOrigin.lon)/(_7*this.tileSize.w))+1;
var y=_8-((_6.bottom-this.tileOrigin.lat)/(_7*this.tileSize.h));
var z=this.map.numZoomLevels-this.map.getZoom();
var _c=this.layername+"/"+z+"/"+y+"/"+x+"."+this.type;
var _d=this.url;
if(_d instanceof Array){
_d=this.selectUrl(_c,_d);
}
return _d+_c;
},addTile:function(_e,_f){
var url=this.getURL(_e);
return new Roja.Tile.Image(this,_f,_e,url,this.tileSize);
},setMap:function(map){
OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);
if(!this.tileOrigin){
this.tileOrigin=new OpenLayers.LonLat(this.maxExtent.left,this.maxExtent.bottom);
}
},setTileOrigin:function(_12){
if(_12!=null){
this.tileOrigin=_12;
}
},CLASS_NAME:"Roja.Layer.RasTMS"});

Roja.Layer.RasGMLMarker=OpenLayers.Class(OpenLayers.Layer.Markers,Roja.Layer,{name:null,typeName:null,filterName:null,url:null,options:null,dragging:null,restrictedAreaSize:null,initialize:function(_1,_2,_3){
OpenLayers.Layer.Markers.prototype.initialize.apply(this,[_1]);
this.name=_1;
this.url=_2;
this.options=_3;
if(_3.filterName!=null){
this.filterName=_3.filterName;
}
if(_3.typeName!=null){
this.typeName=_3.typeName;
}
this.url=_2+"&typeName="+this.typeName;
Roja.Layer.prototype.setLoading.apply(this,arguments);
},destroy:function(){
OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);
this.zoomLevel=this.bounds=this.url=null;
},loadUrl:function(){
var _4=this.url;
if(Roja.Proxy&&this.url.startsWith("http")){
_4=Roja.Proxy+Roja.Util.escapeUri(this.url);
}
this.bounds=this.map.getExtent();
this.zoomLevel=this.map.getNumZoomLevels()-this.map.getZoom()-1;
_4+="&FILTER=<Filter><And><PropertyIsGreaterThanOrEqualTo><PropertyName>LIV_ZOOM</PropertyName><Literal>"+this.zoomLevel+"</Literal></PropertyIsGreaterThanOrEqualTo><PropertyIsEqualTo><PropertyName>"+this.options.filterName+"</PropertyName><Literal>"+this.name+"</Literal></PropertyIsEqualTo></And></Filter>";
new OpenLayers.Ajax.Request(_4,{method:"get",asynchronous:true,onComplete:this.parseData.bind(this)});
},parseData:function(_5){
g=new OpenLayers.Format.GML();
if(_5.responseText==""||_5.responseText==null){
OpenLayers.Console.log("Nessun marker presente nell'extent della mappa");
return;
}else{
features=g.read(_5.responseText);
}
for(var _6 in features){
var _7=new Array();
if(features[_6].geometry!=null){
lonlat=new OpenLayers.LonLat(features[_6].geometry.x,features[_6].geometry.y);
marker=new Roja.Marker.MappeTematiche(lonlat,features[_6].attributes.NOME,(features[_6].attributes.LINK_SCHEDA?features[_6].attributes.LINK_SCHEDA:null),features[_6].attributes.POS_ETICHETTA,this.options);
this.addMarker(marker);
}
}
},drawMarker:function(_8){
var px=this.map.getLayerPxFromLonLat(_8.lonlat);
if(px==null){
_8.display(false);
}else{
var _a=_8.draw(px);
if(!_8.drawn){
this.div.appendChild(_a);
_8.drawn=true;
}else{
this.div.removeChild(this.div.firstChild);
}
}
},setMap:function(_b){
if(this.map==null){
this.map=_b;
this.maxExtent=this.maxExtent||this.map.maxExtent;
this.projection=this.projection||this.map.projection;
this.units=this.units||this.map.units;
this.initResolutions();
if(!this.isBaseLayer){
this.inRange=this.calculateInRange();
var _c=((this.visibility)&&(this.inRange));
this.div.style.display=_c?"":"none";
}
this.setTileSize();
}
this.map.events.register("moveend",this,this.loadUrl);
this.map.events.register("mousemove",this,this.mouseMoveEvt);
},moveTo:function(_d,_e,_f){
this.clearMarkers();
OpenLayers.Layer.prototype.moveTo.apply(this,arguments);
if(_e||!this.drawn){
for(i=0;i<this.markers.length;i++){
this.drawMarker(this.markers[i]);
}
this.drawn=true;
}
},mouseMoveEvt:function(evt){
var _11=this.map.getSize();
if(this.dragging&&(evt.xy.x>=(_11.w-20)||evt.xy.y>=(_11.h-20)||evt.xy.x<=20||evt.xy.y<=20)){
this.loadUrl();
}
},removeMarker:function(_12){
OpenLayers.Util.removeItem(this.markers,_12);
if(_12.div!=null){
this.div.removeChild(_12.div);
_12.drawn=false;
}
},CLASS_NAME:"Roja.Layer.RasGMLMarker"});

Roja.Layer.RSS=OpenLayers.Class(Roja.Layer.GeoRSS,Roja.Layer,{feedRSSURL:null,serviceURL:null,actionValue:null,completeURL:null,initialize:function(_1,_2,_3,_4){
this.feedRSSURL=_1;
this.serviceURL=_2;
this.actionValue=_3;
this.completeURL=_2+"?action="+this.actionValue+"&urlFeedRSS="+this.feedRSSURL;
Roja.Layer.GeoRSS.prototype.initialize.apply(this,["RSS",this.completeURL,"url",_4]);
Roja.Layer.prototype.setLoading.apply(this,arguments);
},CLASS_NAME:"Roja.Layer.RSS"});

Roja.Layer.WMS=OpenLayers.Class(OpenLayers.Layer.WMS,Roja.Layer,{ratio:2,tile:null,doneLoading:false,boundsInitial:null,legendId:null,legendImage:null,layers:null,initialize:function(_1,_2,_3,_4,_5){
var _6=[];
_3=OpenLayers.Util.upperCaseObject(_3);
this.layers=_5;
if(_4&&_4.legendId&&_3&&!_3.SLD){
_4.legendId=null;
}
_6.push(_1,_2,_3,_4);
OpenLayers.Layer.WMS.prototype.initialize.apply(this,_6);
Roja.Layer.prototype.setLoading.apply(this,arguments);
},controlLayer:function(_7){
var _8=false;
return _8;
},setSld:function(_9){
this.params.SLD=_9;
},setLegend:function(id){
if(id!=null&&id!=""){
this.legendId=id;
var _b=this.getFullRequestString({REQUEST:"getlegendgraphic",LAYER:this.params.LAYERS,format:"image/png",sld:this.params.SLD,HEIGHT:null,WIDTH:null});
if(this.legendImage!=null){
OpenLayers.Util.getElement(this.legendId).removeChild(this.legendImage);
this.legendImage=null;
}
this.legendImage=OpenLayers.Util.createImage(null,0,0,_b);
this.imgId=this.legendImage.id;
OpenLayers.Util.getElement(this.legendId).appendChild(this.legendImage);
}
},deleteSld:function(){
this.params.SLD=null;
},deleteLegend:function(){
if(this.legendId!=null&&this.legendId!=""){
if(this.legendImage!=null){
OpenLayers.Util.getElement(this.legendId).removeChild(this.legendImage);
this.legendImage=null;
}
}
},addTile:function(_c,_d){
return new Roja.Tile.Image(this,_d,_c,null,this.tileSize);
},getURL:function(_e){
_e=this.adjustBounds(_e);
var _f=this.getImageSize();
var _10=[];
if(this.layers){
for(var i=0;i<this.layers.length;i++){
this.layers[i].inRange=this.layers[i].calculateInRange(this.map.getZoom());
if(this.layers[i].visibility&&this.layers[i].inRange){
_10.push(this.layers[i].physicalName);
}
}
}
if(_10.length>0||this.params.LAYERS){
return this.getFullRequestString({BBOX:this.encodeBBOX?_e.toBBOX():_e.toArray(),WIDTH:_f.w,HEIGHT:_f.h,LAYERS:this.params.LAYERS?this.params.LAYERS:_10,SLD:this.params.SLD,TRANSPARENT:this.params.TRANSPARENT?this.params.TRANSPARENT:"TRUE"});
}
return null;
},setMap:function(map){
if(this.map==null){
this.map=map;
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 _13=((this.visibility)&&(this.inRange));
this.div.style.display=_13?"":"none";
}
this.setTileSize();
}
if(this.legendId){
this.setLegend(this.legendId);
}
},getFullRequestString:function(_14,_15){
var _16="";
if(this.options.projection!=null){
_16=this.options.projection;
}else{
_16=this.map.getProjection();
}
this.params.SRS=(_16=="none")?null:_16;
return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments);
},CLASS_NAME:"Roja.Layer.WMS"});

Roja.Marker.GeocodedAddress=OpenLayers.Class(Roja.Marker,{popup:null,popupsize:new OpenLayers.Size(50,50),title:"Title",description:"A custom description",xlsns:"http://www.opengis.net/xls",typeprefix:null,officialname:null,postalcode:null,buildingnumber:null,municipality:null,countrysecondarysubdivision:null,countrysubdivision:null,popupcloser:null,xmldata:null,initialize:function(_1,_2){
Roja.Marker.prototype.initialize.apply(this,[_2]);
this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
if(_2){
if(_2.popupsize!=null){
this.popupsize=_2.popupsize;
}
if(_2.title!=null){
this.title=_2.title;
}
}
if(_1){
var _3=_1.getElementsByTagName("Street")[0];
if(_3.firstChild!=null){
this.description=_3.firstChild.nodeValue;
this.officialname=_3.firstChild.nodeValue;
var _4=_1.getElementsByTagName("Place");
var i;
for(i=0;i<_4.length;i++){
var _6=null;
var _7=_4[i].firstChild;
if(_7!=null){
_6=_7.nodeValue;
}
var _8=_4[i].getAttribute("type");
if(_8=="Municipality"){
this.municipality=_6;
}else{
if(_8=="CountrySecondarySubdivision"){
this.countrysecondarysubdivision=_6;
}else{
if(_8=="CountrySubdivision"){
this.countrysubdivision=_6;
}
}
}
}
}else{
this.typeprefix=_3.getAttribute("typePrefix");
this.officialname=_3.getAttribute("officialName");
var _9=_1.getElementsByTagName("PostalCode")[0];
if(_9!=null){
if(_9.firstChild!=null){
this.postalcode=_9.firstChild.nodeValue;
}
}
var _a=_1.getElementsByTagName("Building")[0];
if(_a!=null){
this.buildingnumber=_a.getAttribute("number");
}
var _4=_1.getElementsByTagName("Place");
var i;
for(i=0;i<_4.length;i++){
var _6=null;
var _7=_4[i].firstChild;
if(_7!=null){
_6=_7.nodeValue;
}
var _8=_4[i].getAttribute("type");
if(_8=="Municipality"){
this.municipality=_6;
}else{
if(_8=="CountrySecondarySubdivision"){
this.countrysecondarysubdivision=_6;
}else{
if(_8=="CountrySubdivision"){
this.countrysubdivision=_6;
}
}
}
}
this.description="";
if(this.typeprefix!=null&&this.typeprefix!=""){
this.description+=this.typeprefix+" ";
}
if(this.officialname!=null&&this.officialname!=""){
this.description+=this.officialname+" ";
}
if(this.buildingnumber!=null&&this.buildingnumber!=""){
this.description+=","+this.buildingnumber+" ";
}
if(this.postalcode!=null&&this.postalcode!=""){
this.description+=this.postalcode+" ";
}
if(this.municipality!=null&&this.municipality!=""){
this.description+=this.municipality+" ";
}
if(this.countrysecondarysubdivision!=null&&this.countrysecondarysubdivision!=""&&this.countrysecondarysubdivision!=this.municipality){
this.description+=this.countrysecondarysubdivision+" ";
}
if(this.countrysubdivision!=null&&this.countrysubdivision!=""){
this.description+=this.countrysubdivision;
}
}
}
},stopevent:function(_b){
OpenLayers.Event.stop(_b,true);
},destroy:function(){
if(this.popupcloser!=null){
Event.stopObservingElement(this.popupcloser);
this.popupcloser=null;
}
if(this.popup!=null){
this.popup.destroy();
this.popup=null;
}
Roja.Marker.prototype.destroy.apply(this,arguments);
},getTypePrefix:function(){
return this.typeprefix;
},getOfficialName:function(){
return this.officialname;
},getPostalCode:function(){
return this.postalcode;
},getBuildingNumber:function(){
return this.buildingnumber;
},getMunicipality:function(){
return this.municipality;
},getCountrySecondarySusbdivision:function(){
return this.countrysecondarysubdivision;
},getCountrySubdivision:function(){
return this.countrysubdivision;
},CLASS_NAME:"Roja.Marker.GeocodedAddress"});

Roja.Marker.POI=OpenLayers.Class(Roja.Marker,{popup:null,popupsize:new OpenLayers.Size(50,50),title:"Title",description:"A custom description",xlsns:"http://www.opengis.net/xls",name:null,poi_id:null,alias:null,nomecomune:null,codistat:null,lingua:null,idtipo:null,nometipo:null,source:null,popupcloser:null,xmldata:null,initialize:function(_1,_2){
Roja.Marker.prototype.initialize.apply(this,[_2]);
this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
if(_2){
if(_2.popupsize!=null){
this.popupsize=_2.popupsize;
}
if(_2.title!=null){
this.title=_2.title;
}
}
if(_1){
var _3=_1.getElementsByTagName("POI")[0];
var _4=_3.getElementsByTagName("POIInfoList")[0];
this.poi_id=_3.getAttribute("ID");
this.name=_3.getAttribute("POIName");
var _5=_4.getElementsByTagName("POIInfo");
var _6=0;
for(_6=0;_6<_5.length;_6++){
var _7=_5[_6].getAttribute("name");
if(_7=="Alias"){
this.alias=_5[_6].getAttribute("value");
}else{
if(_7=="NomeComune"){
this.nomecomune=_5[_6].getAttribute("value");
}else{
if(_7=="codISTAT"){
this.codistat=_5[_6].getAttribute("value");
}else{
if(_7=="Lingua"){
this.lingua=_5[_6].getAttribute("value");
}else{
if(_7=="IdTipo"){
this.idtipo=_5[_6].getAttribute("value");
}else{
if(_7=="NomeTipo"){
this.nometipo=_5[_6].getAttribute("value");
}else{
if(_7=="source"){
this.source=_5[_6].getAttribute("value");
}
}
}
}
}
}
}
}
if(_6>0){
this.description="";
if(this.name!=null&&this.name!=""){
this.description+=this.name+" ";
}
if(this.nometipo!=null&&this.nometipo!=""){
this.description+="("+this.nometipo+") ";
}
if(this.codistat!=null&&this.codistat!=""){
this.description+=this.codistat+" ";
}
if(this.nomecomune!=null&&this.nomecomune!=""){
this.description+=this.nomecomune;
}
}else{
this.description=this.name;
}
}
},stopevent:function(_8){
OpenLayers.Event.stop(_8,true);
},destroy:function(){
if(this.popupcloser!=null){
Event.stopObservingElement(this.popupcloser);
this.popupcloser=null;
}
if(this.popup!=null){
this.popup.destroy();
this.popup=null;
}
Roja.Marker.prototype.destroy.apply(this,arguments);
},getPOIID:function(){
return this.poi_id;
},getName:function(){
return this.name;
},getAlias:function(){
return this.alias;
},getNomeComune:function(){
return this.nomecomune;
},getCodISTAT:function(){
return this.codistat;
},getLingua:function(){
return this.lingua;
},getSource:function(){
return this.source;
},getIDTipo:function(){
return this.idtipo;
},CLASS_NAME:"Roja.Marker.POI"});

Roja.Marker.MappeTematiche=OpenLayers.Class(OpenLayers.Marker,{name:null,url:null,align:null,options:null,initialize:function(_1,_2,_3,_4,_5){
OpenLayers.Marker.prototype.initialize.apply(this,[_5]);
this.lonlat=_1;
this.name=_2;
this.url=_3;
this.align=_4;
this.options=_5;
},draw:function(px){
this.div=document.createElement("div");
this.div.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_div_");
if(this.options.markerIconSize!=null){
var _7=px.y-this.options.markerIconSize.h;
var _8=px.x-this.options.markerIconSize.w;
this.div.style.top=_7+"px";
this.div.style.left=_8+"px";
}else{
this.div.style.top=px.y+"px";
this.div.style.left=px.x+"px";
}
this.div.className="RojaMarkerMappeTematiche";
this.localEvents=new OpenLayers.Events(this,this.div,null,true);
this.localEvents.register("click",this.div,this.stopevent);
this.localEvents.register("mousedown",this.div,this.stopevent);
this.localEvents.register("mouseup",this.div,this.openLink.bind(this));
this.localEvents.register("mouseover",this.div,this.pointOnMouseOver.bind(this));
this.localEvents.register("mouseout",this.div,this.pointOnMouseOut.bind(this));
var _9=document.createElement("img");
_9.id=this.div.id+"_innerImage";
_9.src=OpenLayers.ImgPath+"punto.gif";
_9.style.display="block";
var _a=document.createElement("img");
_a.setAttribute("id",this.div.id+"_innerImageSel");
_a.setAttribute("title",this.name+": vai alla scheda di dettaglio");
if(this.options){
_a.setAttribute("src",this.options.markerIconSel);
_a.style.display="none";
}
var _b=document.createElement("span");
_b.setAttribute("id",this.div.id+"_spanText1");
_b.className="span1";
if(this.align=="centerright"){
_b.style.left="15px";
}else{
_b.style.right="105%";
}
_b.innerHTML=(this.name);
var _c=document.createElement("span");
_c.setAttribute("id",this.div.id+"_spanText2");
_c.className="span2";
if(this.align=="centerright"){
_c.style.left="15px";
}else{
_c.style.right="105%";
}
_c.innerHTML=(this.name);
if(this.url!=null){
var _d=document.createElement("a");
_d.title=this.name;
this.div.appendChild(_d);
_d.appendChild(_9);
_d.appendChild(_a);
_d.appendChild(_b);
_d.appendChild(_c);
this.div.appendChild(_d);
}else{
this.div.appendChild(_9);
this.div.appendChild(_a);
this.div.appendChild(spanText);
}
return this.div;
},stopevent:function(_e){
OpenLayers.Event.stop(_e,true);
},openLink:function(_f){
var url=this.url;
url=url.replace(/ /g,"");
url=url.replace(/'/g,"");
var _11=new Object();
_11=window.open(url,"","");
_11.focus();
OpenLayers.Event.stop(_f,true);
},pointOnMouseOver:function(evt){
document.getElementById(this.div.id+"_innerImage").style.display="none";
document.getElementById(this.div.id+"_innerImageSel").style.display="block";
document.getElementById(this.div.id+"_spanText1").style.textDecoration="underline";
document.getElementById(this.div.id+"_spanText2").style.textDecoration="underline";
},pointOnMouseOut:function(id){
document.getElementById(this.div.id+"_innerImage").style.display="block";
document.getElementById(this.div.id+"_innerImageSel").style.display="none";
document.getElementById(this.div.id+"_spanText1").style.textDecoration="none";
document.getElementById(this.div.id+"_spanText2").style.textDecoration="none";
},CLASS_NAME:"Roja.Marker.MappeTematiche"});

Roja.Route.Distance=OpenLayers.Class({value:null,uom:null,initialize:function(_1,_2){
this.value=_1;
this.uom=_2;
},getValue:function(){
return this.value;
},getUom:function(){
return this.uom;
},CLASS_NAME:"Roja.Route.Distance"});

Roja.Route.GeometryPolygon=OpenLayers.Class({xlsns:"http://www.opengis.net/xls",stylePOI:{strokeColor:"#7F7F7F",strokeOpacity:0.5,strokeWidth:4,pointRadius:2,pointerEvents:"visiblePainted"},style:{strokeColor:"#0000FF",strokeOpacity:0.7,strokeWidth:5,pointRadius:6,pointerEvents:"visiblePainted"},geometrypointlist:null,geometrypointlistPOI:null,geometry:null,geometryPOI:null,initialize:function(_1,_2){
OpenLayers.Util.extend(this,_2);
var _3=[];
if(_1!=null){
var _4=_1.getElementsByTagName("LineString");
for(j=0;j<_4.length;j++){
var _5=_4[j].getElementsByTagName("pos");
for(i=0;i<_5.length;i++){
var _6=_5[i].firstChild.nodeValue;
var x=_6.substring(0,_6.indexOf(" "));
var y=_6.substring(_6.indexOf(" "));
x=parseFloat(x);
y=parseFloat(y);
var _9=new OpenLayers.Geometry.Point(x,y);
_3.push(_9);
}
}
}
this.geometrypointlist=_3;
},destroy:function(){
this.geometry=null;
},addPOILines:function(_a){
if(_a==null){
return;
}
var _b=new Array();
var _c=_a.getElementsByTagName("RouteInstructionsList");
if(_c==null||_c.length==0){
return;
}
var _d=_c[0].getElementsByTagName("RouteInstruction");
if(_d==null||_d.length==0){
return;
}
var _e=0;
for(_e=0;_e<_d.length;_e++){
var _f=_d[_e].getAttribute("description");
var _10=new Array();
if(_f.indexOf("-fromPOI")!=-1){
actualLineString=_d[_e].getElementsByTagName("LineString")[0];
nextLineString=_d[_e+1].getElementsByTagName("LineString")[0];
actualPos=actualLineString.getElementsByTagName("pos")[0].firstChild.nodeValue;
nextPos=nextLineString.getElementsByTagName("pos")[0].firstChild.nodeValue;
var x1=actualPos.substring(0,actualPos.indexOf(" "));
var y1=actualPos.substring(actualPos.indexOf(" "));
x1=parseFloat(x1);
y1=parseFloat(y1);
var _13=new OpenLayers.Geometry.Point(x1,y1);
_10.push(_13);
var x2=nextPos.substring(0,nextPos.indexOf(" "));
var y2=nextPos.substring(nextPos.indexOf(" "));
x2=parseFloat(x2);
y2=parseFloat(y2);
var _16=new OpenLayers.Geometry.Point(x2,y2);
_10.push(_16);
_b.push(_10);
}
if(_f.indexOf("-toPOI")!=-1){
actualLineString=_d[_e].getElementsByTagName("LineString")[0];
actualPos=actualLineString.getElementsByTagName("pos")[1].firstChild.nodeValue;
prevPos=actualLineString.getElementsByTagName("pos")[0].firstChild.nodeValue;
var x1=actualPos.substring(0,actualPos.indexOf(" "));
var y1=actualPos.substring(actualPos.indexOf(" "));
x1=parseFloat(x1);
y1=parseFloat(y1);
var _13=new OpenLayers.Geometry.Point(x1,y1);
var x2=prevPos.substring(0,prevPos.indexOf(" "));
var y2=prevPos.substring(prevPos.indexOf(" "));
x2=parseFloat(x2);
y2=parseFloat(y2);
var _16=new OpenLayers.Geometry.Point(x2,y2);
_10.push(_16);
_10.push(_13);
_b.push(_10);
}
}
this.geometrypointlistPOI=_b;
},getGeometry:function(_17){
if(this.geometrypointlist==null){
return null;
}
var _18=this.style;
OpenLayers.Util.extend(this,_17);
if((this.geometry==null)||_18!=this.style){
this.geometry=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(this.geometrypointlist),null,this.style);
}
return this.geometry;
},getGeometryPOI:function(_19){
if(this.geometrypointlistPOI==null||this.geometrypointlistPOI.length==0){
return null;
}
OpenLayers.Util.extend(this,_19);
this.geometryPOI=new Array();
var _1a;
for(_1a=0;_1a<this.geometrypointlistPOI.length;_1a++){
var _1b;
_1b=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(this.geometrypointlistPOI[_1a]),null,this.stylePOI);
this.geometryPOI.push(_1b);
}
return this.geometryPOI;
},CLASS_NAME:"Roja.Route.GeometryPolygon"});

Roja.Route.Instruction=OpenLayers.Class({distance:null,instruction:null,geometry:null,initialize:function(_1){
var _2=_1.getElementsByTagName("distance")[0];
this.distance=new Roja.Route.Distance(_2.getAttribute("value"),_2.getAttribute("uom"));
this.instruction=_1.getElementsByTagName("Instruction")[0].firstChild.nodeValue;
this.geometry=new Roja.Route.GeometryPolygon(_1.getElementsByTagName("RouteInstructionGeometry")[0]);
if(_1!=null&&_1.getElementsByTagName("DetermineRouteResponse")!=null&&_1.getElementsByTagName("DetermineRouteResponse").length>0){
this.geometry.addPOILines(_1.getElementsByTagName("DetermineRouteResponse")[0]);
}
},destroy:function(){
this.distance=null;
this.instruction=null;
this.geometry=null;
},getDistance:function(){
return this.distance;
},getInstruction:function(){
var _3=this.instruction;
if(this.instruction.indexOf("CDATA")>0){
_3=this.instruction.substring(9,this.instruction.length-3);
}
return _3;
},getGeometry:function(){
return this.geometry;
},CLASS_NAME:"Roja.Route.Instruction"});

Roja.Route.RouteGeometry=OpenLayers.Class({fullgeometrypointlist:null,fullgeometry:null,initialize:function(_1){
var _2=[];
if(_1.getElementsByTagName("RouteGeometry").length==0){
return;
}
var _3=_1.getElementsByTagName("RouteGeometry")[0];
this.fullgeometry=new Roja.Route.GeometryPolygon(_3);
this.fullgeometry.addPOILines(_1);
},destroy:function(){
this.fullgeometry=null;
},getFullGeometry:function(){
return this.fullgeometry;
},CLASS_NAME:"Roja.Route.RouteGeometry"});

Roja.Route.RouteInstructions=OpenLayers.Class({xlsns:"http://www.opengis.net/xls",instructions:null,initialize:function(_1){
var _2=_1.getElementsByTagName("RouteInstruction");
var i;
var _4=0;
var _5=null;
this.instructions=new Array();
for(i=0;i<_2.length;i++){
var _6=_2[i];
var _7=new Roja.Route.Instruction(_6);
var _8=_6.getAttribute("description");
if(_8.lastIndexOf("POI")>0){
_8=_8.split("-",1)[0];
}
_8=_8.substring(_8.lastIndexOf("step")+4);
if((_8*1)>_4){
if(_5!=null){
this.instructions.push(_5);
}
_5=new Array();
_4++;
}
_5.push(_7);
}
if((_2.length>0)&&(_5!=null)){
this.instructions.push(_5);
}
},destroy:function(){
this.instructions=null;
},getInstructions:function(){
return this.instructions;
},CLASS_NAME:"Roja.Route.RouteInstructions"});

Roja.Route.TotalDistance=OpenLayers.Class(Roja.Route.Distance,{initialize:function(_1){
if(_1==null){
return;
}
var _2=_1.getElementsByTagName("TotalDistance");
if(_2.length==0){
return;
}
var _3=_1.getElementsByTagName("TotalDistance")[0];
var _4=new Array(_3.getAttribute("value"),_3.getAttribute("uom"));
Roja.Route.Distance.prototype.initialize.apply(this,_4);
},CLASS_NAME:"Roja.Route.TotalDistance"});

Roja.Route.TotalTime=OpenLayers.Class({hours:null,minutes:null,seconds:null,initialize:function(_1){
var _2=_1.getElementsByTagName("TotalTime");
if(_2.length==0){
return;
}
var _3=_1.getElementsByTagName("TotalTime")[0].firstChild.nodeValue;
this.seconds=_3.substring(_3.lastIndexOf("M")+1,_3.lastIndexOf("S"));
this.minutes=_3.substring(_3.lastIndexOf("H")+1,_3.lastIndexOf("M"));
this.hours=_3.substring(_3.lastIndexOf("T")+1,_3.lastIndexOf("H"));
if(this.seconds==""){
this.seconds=0;
}
if(this.minutes==""){
this.minutes=0;
}
if(this.hours==""){
this.hours=0;
}
},destroy:function(){
},getHours:function(){
return this.hours;
},getMinutes:function(){
return this.minutes;
},getSeconds:function(){
return this.seconds;
},CLASS_NAME:"Roja.Route.TotalTime"});

Roja.Tile.ArcXML=OpenLayers.Class(OpenLayers.Tile.Image,{requestUrl:null,EVENT_TYPES:["loadComplete","noResponseArcims","errorResponseArcims","successResponseArcims"],events:null,fallThrough:false,doneLoading:false,initialize:function(_1,_2,_3,_4,_5){
OpenLayers.Tile.prototype.initialize.apply(this,arguments);
this.frame=document.createElement("div");
this.frame.style.overflow="hidden";
this.frame.style.position="absolute";
this.events=new OpenLayers.Events(this,this,this.EVENT_TYPES,this.fallThrough);
this.requestUrl=_4;
this.loadTile();
},loadTile:function(_6){
if(_6){
this.bounds=_6;
}
var _7="<ARCXML version=\"1.1\"><REQUEST><GET_IMAGE><PROPERTIES><ENVELOPE minx=\""+this.bounds.left+"\" miny=\""+this.bounds.bottom+"\" maxx=\""+this.bounds.right+"\" maxy=\""+this.bounds.top+"\" /><IMAGESIZE height=\""+this.size.h+"\" width=\""+this.size.w+"\" /><LAYERLIST nodefault=\"true\" order=\"true\">";
if(this.layer.options.AxlLayer){
if(!this.layer.options.AxlLayerDef){
this.layer.options.AxlLayerDef={};
}
var x=this.layer.options.AxlLayerDef.length;
for(var y=0;y<this.layer.options.AxlLayer.length;x++,y++){
this.layer.options.AxlLayerDef[x]=new Roja.ArcXML.AxlLayerDef(this.layer.options.AxlLayer[y].layerId);
}
}
if(this.layer.options.AxlLayerDef){
for(var i=0;i<this.layer.options.AxlLayerDef.length;i++){
_7+=this.layer.options.AxlLayerDef[i].getXML();
}
}
_7+="</LAYERLIST></PROPERTIES>";
if(this.layer.options.AxlLayer){
for(var i=0;i<this.layer.options.AxlLayer.length;i++){
_7+=this.layer.options.AxlLayer[i].getXML();
}
}
_7+="</GET_IMAGE></REQUEST></ARCXML>";
var _b=this.requestUrl;
if(Roja.Proxy&&this.url.startsWith("http")){
_b=Roja.Proxy+Roja.Util.escapeUri(this.requestUrl);
}
var _c=this.requestSuccess.bind(this);
new OpenLayers.Ajax.Request(_b,{method:"post",asynchronous:true,postBody:_7,onComplete:_c});
},requestSuccess:function(_d){
var _e;
if(_d.responseText==""||_d.responseText==null){
return;
}else{
if(_d.fileType!="XML"){
_e=OpenLayers.parseXMLString(_d.responseText);
}
}
if((_e.firstChild==null)||(_e.firstChild.tagName=="parsererror")){
this.events.triggerEvent("noResponseArcims");
OpenLayers.Console.error("Error in response from server.");
}else{
if(_e.getElementsByTagName("ERROR")[0]!=null){
this.events.triggerEvent("errorResponseArcims");
OpenLayers.Console.error("Error in response from server: "+_d.responseText);
}else{
this.events.triggerEvent("successResponseArcims");
this.url=_e.getElementsByTagName("OUTPUT")[0].getAttribute("url");
}
}
this.doneLoading=true;
this.events.triggerEvent("loadComplete");
},draw:function(){
if(!this.doneLoading){
var _f=this.drawImgDiv.bind(this);
this.events.register("loadComplete",this,_f);
}
this.drawn=true;
return true;
},drawImgDiv:function(){
if(this.layer!=this.layer.map.baseLayer&&this.layer.reproject){
this.bounds=this.getBoundsFromBaseLayer(this.position);
}
if(!OpenLayers.Tile.prototype.draw.apply(this,arguments)){
return false;
}
if(this.imgDiv==null){
this.initImgDiv();
}
this.imgDiv.viewRequestID=this.layer.map.viewRequestID;
OpenLayers.Util.modifyDOMElement(this.frame,null,this.position,this.size);
if(this.layer.alpha){
this.show();
OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,null,this.layer.imageSize,this.url);
}else{
this.imgDiv.src=this.url;
this.show();
OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,this.layer.imageSize);
}
var _10=function(){
this.doneLoading=true;
this.events.triggerEvent("loadend");
};
OpenLayers.Event.observe(this.imgDiv,"load",_10.bindAsEventListener(this));
},moveTo:function(_11,_12,_13){
if(this.layer!=this.layer.map.baseLayer&&this.layer.reproject){
_11=this.getBoundsFromBaseLayer(_12);
}
this.loadTile(_11);
OpenLayers.Tile.prototype.moveTo.apply(this,arguments);
},CLASS_NAME:"Roja.Tile.ArcXML"});

Roja.Tile.Image=OpenLayers.Class(OpenLayers.Tile.Image,{initialize:function(_1,_2,_3,_4,_5){
OpenLayers.Tile.Image.prototype.initialize.apply(this,arguments);
},initImgDiv:function(){
var _6=this.layer.imageOffset;
var _7=this.layer.getImageSize();
if(this.layerAlphaHack){
this.imgDiv=OpenLayers.Util.createAlphaImageDiv(null,_6,_7,null,"relative",null,null,null,true);
}else{
this.imgDiv=OpenLayers.Util.createImage(null,_6,_7,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 _8=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(_8,this));
}else{
OpenLayers.Event.observe(this.imgDiv,"load",OpenLayers.Function.bind(_8,this));
}
var _9=function(){
this.layer.events.triggerEvent("loadend");
if(this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS){
_8.call(this);
}
};
OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(_9,this));
},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();
}
var _a=this.layer.getURL(this.bounds);
if(_a!=null){
this.url=this.layer.getURL(this.bounds);
OpenLayers.Util.modifyDOMElement(this.frame,null,this.position,this.size);
var _b=this.layer.getImageSize();
if(this.layerAlphaHack){
OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,null,_b,this.url);
}else{
OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,_b);
this.imgDiv.src=this.url;
}
}else{
this.imgDiv.style.display="none";
this.layer.events.triggerEvent("loadend");
this.isLoading=false;
this.layer.numLoadingTiles=0;
}
return true;
}});

Roja.Control.Info=OpenLayers.Class(OpenLayers.Control,{info:null,initialize:function(_1){
OpenLayers.Control.prototype.initialize.apply(this,[_1]);
},draw:function(){
this.handler=new OpenLayers.Handler.Drag(this,{"down":this.defaultMouseDown});
},defaultMouseDown:function(_2){
if(this.info.CLASS_NAME=="Roja.Control.FloatingPanel.Info.GetFeatureInfo"){
if(this.info.layers.length==0){
alert("Nessun tema visibile sulla mappa.");
return;
}
}
var _3=this.map.getLonLatFromPixel(new OpenLayers.Pixel(_2.x,_2.y));
var _4=this.map.getLonLatFromPixel(new OpenLayers.Pixel(_2.x,_2.y));
t=this.info.getTolerance();
t/=2;
_3.lon-=t;
_3.lat-=t;
_4.lon+=t;
_4.lat+=t;
var _5=new OpenLayers.Bounds(_3.lon,_3.lat,_4.lon,_4.lat);
this.info.setBounds(_5);
if(this.info.CLASS_NAME=="Roja.Control.FloatingPanel.Info.GetFeatureInfo"){
this.info.setMousePosition({x:_2.x,y:_2.y});
}
this.map.addControl(this.info);
},CLASS_NAME:"Roja.Control.Info"});

Roja.Control.Relations=OpenLayers.Class(OpenLayers.Control.ZoomBox,{relations:null,initialize:function(_1){
OpenLayers.Control.prototype.initialize.apply(this,arguments);
},type:OpenLayers.Control.TYPE_TOOL,activate:function(){
this.map.div.style.cursor="crosshair";
return OpenLayers.Control.prototype.activate.apply(this,arguments);
},deactivate:function(){
this.map.div.style.cursor="";
return OpenLayers.Control.prototype.deactivate.apply(this,arguments);
},draw:function(){
this.handler=new OpenLayers.Handler.Box(this,{done:this.defaultMouseDown});
},defaultMouseDown:function(_2){
if(_2 instanceof OpenLayers.Bounds){
var _3=this.map.getLonLatFromPixel(new OpenLayers.Pixel(_2.left,_2.bottom));
var _4=this.map.getLonLatFromPixel(new OpenLayers.Pixel(_2.right,_2.top));
var _5=new OpenLayers.Bounds(_3.lon,_3.lat,_4.lon,_4.lat);
}else{
var _3=this.map.getLonLatFromPixel(new OpenLayers.Pixel(_2.x,_2.y));
var _4=this.map.getLonLatFromPixel(new OpenLayers.Pixel(_2.x,_2.y));
var _5=new OpenLayers.Bounds(_3.lon,_3.lat,_4.lon,_4.lat);
}
this.relations.setBounds(_5);
this.map.addControl(this.relations);
},CLASS_NAME:"Roja.Control.Relations"});

Roja.Control.FloatingPanel.Info=OpenLayers.Class(Roja.Control.FloatingPanel,{url:null,featureCount:50,tolerance:50,loading:null,statusCode:null,divInfo:null,initialize:function(_1){
Roja.Control.FloatingPanel.prototype.initialize.apply(this,[_1]);
},destroy:function(){
Roja.Control.FloatingPanel.prototype.destroy.apply(this,arguments);
},draw:function(){
if(this.statusCode=="loading"){
return;
}
if(this.div==null){
Roja.Control.FloatingPanel.prototype.draw.apply(this,arguments);
}else{
if(this.childElement==null){
Roja.Control.FloatingPanel.prototype.draw.apply(this,arguments);
}
this.childElement.innerHTML="";
}
this.div.style.width=this.size.w;
this.childElement.style.height="";
this.childElement.style.maxHeight=this.size.h+"px";
this.childElement.style.overflow="auto";
var _2=navigator.appVersion.split("MSIE");
var _3=parseFloat(_2[1]);
this.divInfo=document.createElement("div");
this.divInfo.className="Info";
this.divInfo.id="Info";
this.childElement.appendChild(this.divInfo);
this.loadFeature();
this.statusCode="loading";
this.div.style.display="none";
if(this.loading==null){
this.loading=new Roja.Control.LoadingMessage();
if(this.loading!=null){
this.map.addControl(this.loading);
}
}
this.loading.startLoad();
return this.div;
},loadFeature:function(){
},setBounds:function(_4){
this.extent=_4;
},getTolerance:function(){
return this.tolerance;
},CLASS_NAME:"Roja.Control.FloatingPanel.Info"});

Roja.Control.FloatingPanel.Info.GetFeature=OpenLayers.Class(Roja.Control.FloatingPanel.Info,{layerPhysicalName:null,layerLogicalName:null,geometryField:"AA01_GEOMETRIA",fields:[],xml:null,initialize:function(_1){
Roja.Control.FloatingPanel.Info.prototype.initialize.apply(this,[_1]);
},destroy:function(){
Roja.Control.FloatingPanel.Info.prototype.destroy.apply(this,arguments);
},loadFeature:function(_2){
var _3=this.url;
if(Roja.Proxy&&this.url.startsWith("http")){
_3=Roja.Proxy+Roja.Util.escapeUri(this.url);
}
if(!(this.url&&this.layerPhysicalName&&this.layerLogicalName&&this.featureCount&&this.fields)){
OpenLayers.Console.error("Some parameters are missing");
}else{
_3=_3+"version=1.0.0&request=GetFeature&typeName="+this.layerPhysicalName+"&BBOX="+this.extent.left+","+this.extent.bottom+","+this.extent.right+","+this.extent.top;
for(var i=0;i<this.fields.length;i++){
if(i==0){
_3+="&PropertyName=";
}else{
_3+=",";
}
_3+=this.fields[i].physicalName;
}
}
new OpenLayers.Ajax.Request(_3,{method:"get",asynchronous:true,onComplete:this.successLoadFeature.bind(this),onFailure:this.errorLoadFeature.bind(this)});
},successLoadFeature:function(_5){
var _6=_5.responseXML;
if((_6&&_6.getElementsByTagName("ServiceException")[0]!=null)||this.statusCode=="loadFailure"){
OpenLayers.Console.error("Error in response from server: "+_5.responseText);
this.divInfo.innerHTML="<b>Errore nella richiesta, contattare l'amministratore.<b>";
}else{
if(_6){
var _7={};
for(var i=0;i<this.fields.length;i++){
var _9;
if(this.fields[i].physicalName.search(/:/)!=-1){
var _a=this.fields[i].physicalName.split(":")[0];
var _b=this.fields[i].physicalName.split(":")[1];
_9=OpenLayers.Ajax.getElementsByTagNameNS(_6,this.map.namespaceURI,_a,_b);
}else{
_9=_5.responseXML.getElementsByTagName(this.fields[i].physicalName);
}
_7[i]=new Array(_9.length);
for(var n=0;n<_9.length;n++){
_7[i][n]=_9.item(n).firstChild.data;
}
}
for(var n=0;n<_7[0].length;n++){
var _d=document.createElement("div");
_d.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_div_table_");
if(_7[0].length>1){
_d.style.display="none";
}else{
_d.style.display="block";
}
var _e=document.createElement("a");
_e.name=this.layerLogicalName;
_e.href="#";
_e.setAttribute("onclick","var table = document.getElementById('"+_d.id+"');"+"table.style.display == 'block' ? "+"table.style.display = 'none': table.style.display = 'block';");
if(_7[0].length>1){
_e.appendChild(document.createTextNode(n+1+". "+this.layerLogicalName));
}else{
_e.appendChild(document.createTextNode(this.layerLogicalName));
}
var _f=document.createElement("table");
var _10=document.createElement("tbody");
_f.appendChild(_10);
_d.appendChild(_f);
for(var i=0;i<this.fields.length;i++){
var row=document.createElement("tr");
var _12=document.createElement("td");
_12.appendChild(document.createTextNode(this.fields[i].logicalName));
var _13=document.createElement("td");
_13.appendChild(document.createTextNode(_7[i][n]));
row.appendChild(_12);
row.appendChild(_13);
_10.appendChild(row);
}
var div=document.createElement("div");
div.appendChild(_e);
_e.parentNode.innerHTML=_e.parentNode.innerHTML;
div.appendChild(_d);
div.style.clear="both";
this.divInfo.appendChild(div);
}
}
}
this.div.style.display="block";
this.loading.stopLoad();
this.statusCode="loadComplete";
},errorLoadFeature:function(_15){
OpenLayers.Console.error("Loading error");
this.statusCode="loadFailure";
},CLASS_NAME:"Roja.Control.FloatingPanel.Info.GetFeature"});

Roja.Control.FloatingPanel.Info.GetFeatureInfo=OpenLayers.Class(Roja.Control.FloatingPanel.Info,{layers:[],xy:null,xslPath:"../resources/xsl/buildGetFeatureInfoArcgis.xsl",info_format:"text/html",xsl:null,srs:"EPSG:3003",EVENT_TYPES:["loadComplete","loadFailure"],fallThrough:false,events:null,contextPath:null,initialize:function(_1){
Roja.Control.FloatingPanel.Info.prototype.initialize.apply(this,[_1]);
this.events=new OpenLayers.Events(this,this,this.EVENT_TYPES,this.fallThrough);
var _2=this.successXsl.bind(this);
var _3=this.failureXsl.bind(this);
new OpenLayers.Ajax.Request(this.xslPath,{method:"get",parameters:null,onComplete:_2,onFailure:_3});
},destroy:function(){
Roja.Control.FloatingPanel.Info.prototype.destroy.apply(this,arguments);
},loadFeature:function(){
var _4=this.url;
if(Roja.Proxy&&this.url.startsWith("http")){
_4=Roja.Proxy+Roja.Util.escapeUri(this.url);
}
if(!(this.url&&this.layers&&this.featureCount)){
OpenLayers.Console.error("Some parameters are missing");
}else{
_4+="REQUEST=GetFeatureInfo"+"&INFO_FORMAT="+this.info_format+"&FORMAT=jpeg"+"&SRS="+this.srs+"&VERSION=1.1.1"+"&HEIGHT="+this.map.size.h+"&WIDTH="+this.map.size.w+"&X="+this.xy.x+"&Y="+this.xy.y+"&BBOX="+this.map.getExtent().toBBOX()+"&FEATURE_COUNT="+this.featureCount+"&QUERY_LAYERS="+this.layers.join(",")+"&LAYERS="+this.layers.join(",")+"&STYLES="+"";
}
new OpenLayers.Ajax.Request(_4,{method:"get",parameters:null,onComplete:this.successLoadFeature.bind(this),onFailure:this.errorLoadFeature.bind(this)});
},successLoadFeature:function(_5){
if((_5.responseXML&&_5.responseXML.getElementsByTagName("ServiceException")[0]!=null)||this.statusCode=="loadFailure"){
OpenLayers.Console.error("Error in response from server: "+_5.responseText);
this.divInfo.innerHTML="<b>Errore nella richiesta, contattare l'amministratore.<b>";
}else{
if(_5.responseText){
if(this.info_format.toUpperCase()=="TEXT/HTML"){
var _6=6;
var r=_5.responseText;
var _8=r.substring(r.indexOf("<body>")+_6,r.indexOf("</body>"));
if(this.stringClean(_8)==""){
this.divInfo.innerHTML="<b>Nessun oggetto trovato nell'area selezionata.</b>";
}else{
this.divInfo.innerHTML=_5.responseText;
}
}else{
var _9=_5.responseText;
_9=this.replaceSpecialChars(_9);
var _a=Roja.transformXml(_9,this.xsl);
_a=_a.replace(/&lt;/g,"<");
_a=_a.replace(/&gt;/g,">");
_a=_a.substring(_a.indexOf("<body>"));
_a=_a.substring(0,_a.indexOf("</body>"));
this.divInfo.innerHTML=_a;
}
}
}
this.statusCode="loadComplete";
this.events.triggerEvent("loadComplete");
this.div.style.display="block";
this.div.style.height=this.size.h+"px";
var _b=this.size.h-25;
this.childElement.style.height=_b+"px";
if(document.getElementById(this.childElement.id)==null){
this.div.appendChild(this.childElement);
var _c=document.getElementById("sbImgNascondi"+this.idname);
if(_c!=null){
_c.src=OpenLayers.ImgPath+"floating/nascondi.gif";
}
}
this.loading.stopLoad();
},stringClean:function(_d){
return _d.replace(/\s|\r|\n|\t/g,"");
},replaceSpecialChars:function(_e){
var _f=_e.replace("&","&amp;");
_f=_f.replace(/�/gi,"&agrave;");
_f=_f.replace(/�/gi,"&egrave;");
_f=_f.replace(/�/gi,"&eacute;");
_f=_f.replace(/�/gi,"&igrave;");
_f=_f.replace(/�/gi,"&ograve;");
_f=_f.replace(/�/gi,"&ugrave;");
return _f;
},errorLoadFeature:function(_10){
OpenLayers.Console.error("WMS loading error");
this.statusCode="loadFailure";
this.events.triggerEvent("loadFailure");
},setMousePosition:function(xy){
this.xy=xy;
},successXsl:function(_12){
this.xsl=_12.responseXML;
},failureXsl:function(_13){
alert(this.errorXSLLoadingMessage);
},toggleChild:function(){
if(document.getElementById(this.childElement.id)==null){
this.div.appendChild(this.childElement);
var _14=document.getElementById("sbImgNascondi"+this.idname);
if(_14!=null){
_14.src=OpenLayers.ImgPath+"floating/nascondi.gif";
}
this.div.style.height=this.size.h+"px";
}else{
this.div.removeChild(this.childElement);
var _14=document.getElementById("sbImgNascondi"+this.idname);
if(_14!=null){
_14.src=OpenLayers.ImgPath+"floating/ripristina.gif";
}
this.div.style.height="";
}
},CLASS_NAME:"Roja.Control.FloatingPanel.Info.GetFeatureInfo"});

Roja.Control.FloatingPanel.Relations=OpenLayers.Class(Roja.Control.FloatingPanel,{layerName:null,extent:null,urlWfs:null,propertynames:[],features:[],relations:[],loading:null,statusCode:null,initialize:function(_1){
Roja.Control.FloatingPanel.prototype.initialize.apply(this,[_1]);
},destroy:function(){
Roja.Control.FloatingPanel.prototype.destroy.apply(this,arguments);
},draw:function(){
if(this.statusCode=="loading"){
return;
}
if(this.div==null){
Roja.Control.FloatingPanel.prototype.draw.apply(this,arguments);
}else{
this.childElement.innerHTML="";
}
this.div.style.width=this.size.w;
this.childElement.style.height="";
this.childElement.style.maxHeight=this.size.h+"px";
this.childElement.style.overflow="auto";
var _2=navigator.appVersion.split("MSIE");
var _3=parseFloat(_2[1]);
if(_3<6.5){
this.iframe=document.createElement("iframe");
this.iframe.className=this.displayClass+"iframe";
this.div.appendChild(this.iframe);
}
this.divRicercaRelations=document.createElement("div");
this.divRicercaRelations.className="ricercarelations";
this.divRicercaRelations.id="ricercarelations";
this.childElement.appendChild(this.divRicercaRelations);
this.loadFeature();
this.statusCode="loading";
this.div.style.display="none";
if(this.loading==null){
this.loading=new Roja.Control.LoadingMessage();
if(this.loading!=null){
this.map.addControl(this.loading);
}
}
this.loading.startLoad();
return this.div;
},setBounds:function(_4){
this.extent=_4;
},addRelation:function(_5){
this.relations.push(_5);
},loadFeature:function(){
var _6=this.urlWfs;
if(Roja.Proxy&&this.urlWfs.startsWith("http")){
_6=Roja.Proxy+Roja.Util.escapeUri(this.urlWfs);
}
_6+="version=1.0.0&request=GetFeature&typeName="+this.layerName+"&BBOX="+this.extent.left+","+this.extent.bottom+","+this.extent.right+","+this.extent.top;
var i;
for(i=0;i<this.propertynames.length;i++){
if(i==0){
_6+="&PropertyName=";
}else{
_6+=",";
}
_6+=this.propertynames[i];
}
OpenLayers.Console.debug("Url wfs: "+_6);
new OpenLayers.Ajax.Request(_6,{method:"get",parameters:null,onComplete:this.parseLoadFeature.bind(this),onFailure:this.errorLoadFeature.bind(this)});
},parseLoadFeature:function(_8){
var _9=_8.responseXML;
var _a=_8.responseText;
if(!_9||_8.fileType!="XML"){
_9=OpenLayers.parseXMLString(_8.responseText);
}
OpenLayers.Console.debug("Risposta wfs: "+_8.responseText);
var g=new OpenLayers.Format.GML();
this.features=g.read(_8.responseText);
this.divContainer=document.createElement("div");
this.divContainer.id="Container";
this.divContainer.className="container";
this.divRicercaRelations.appendChild(this.divContainer);
this.divUl=document.createElement("ol");
this.divContainer.appendChild(this.divUl);
for(i=0;i<this.relations.length;i++){
var _c=this.relations[i];
_c.setFeatures(this.features);
this.divLi=document.createElement("li");
this.divUl.appendChild(this.divLi);
this.divHref=document.createElement("a");
this.divHref.id=_c.name+i;
this.divHref.href="#";
this.divHref.innerHTML=_c.name;
this.divLi.appendChild(this.divHref);
this.divTable=document.createElement("div");
this.divTable.className="table";
this.divTable.style.display="none";
this.divTable.style.visibility="hidden";
this.divTable.id=_c.id;
this.divHref.parentNode.appendChild(this.divTable);
this.table=document.createElement("table");
this.table.className="table";
this.divTable.appendChild(this.table);
OpenLayers.Event.observe(this.divHref,"click",_c.setTableRelation.bind(_c));
var _d={loadingObj:this.loading,relations:this};
_c.events.register("loadStart",_c,this.startLoadingMessage.bindAsEventListener(_d));
_c.events.register("loadComplete",_c,this.stopLoadingMessage.bindAsEventListener(_d));
_c.events.register("loadFailure",_c,this.stopLoadingMessage.bindAsEventListener(_d));
_c.events.register("loadComplete",_c,this.controlDivHeight.bindAsEventListener(_d));
_c.events.register("loadFailure",_c,this.controlDivHeight.bindAsEventListener(_d));
_c.events.register("divVisibilityChanged",_c,this.controlDivHeight.bindAsEventListener(_d));
}
this.div.style.display="block";
this.loading.stopLoad();
this.statusCode="loadComplete";
},startLoadingMessage:function(_e){
this.loadingObj.startLoad();
},stopLoadingMessage:function(_f){
this.loadingObj.stopLoad();
},controlDivHeight:function(evt){
if(this.relations.divContainer.offsetHeight>this.relations.size.h){
this.relations.childElement.style.height=this.relations.childElement.style.maxHeight;
}else{
this.relations.childElement.style.height="";
}
},errorLoadFeature:function(_11){
alert("errore nel caricamento degli oggetti selezionati");
this.statusCode="loadFailure";
},CLASS_NAME:"Roja.Control.FloatingPanel.Relations"});

Roja.Format.GeoRSS=OpenLayers.Class(OpenLayers.Format.GeoRSS,{gmlns:"http://www.opengis.net/gml/3.1.1",buildGeometryNode:function(_1){
var _2;
if(_1.CLASS_NAME=="OpenLayers.Geometry.Polygon"){
_2=this.createElementNS(this.georssns,"georss:polygon");
_2.appendChild(this.buildCoordinatesNode(_1.components[0]));
}else{
if(_1.CLASS_NAME=="OpenLayers.Geometry.LineString"){
_2=this.createElementNS(this.georssns,"georss:line");
_2.appendChild(this.buildCoordinatesNode(_1));
}else{
if(_1.CLASS_NAME=="OpenLayers.Geometry.Point"){
_2=this.createElementNS(this.georssns,"georss:where");
var _3=this.createElementNS(this.gmlns,"gml:point");
_2.appendChild(_3);
var _4=this.createElementNS(this.gmlns,"gml:pos");
_3.appendChild(_4);
_4.appendChild(this.buildCoordinatesNode(_1));
}else{
throw "Couldn't parse "+_1.CLASS_NAME;
}
}
}
return _2;
},CLASS_NAME:"Roja.Format.GeoRSS"});

Roja.Key=OpenLayers.Class({column:null,relationColumn:null,initialize:function(_1){
OpenLayers.Util.extend(this,_1);
},CLASS_NAME:"Roja.Key"});

Roja.Field=OpenLayers.Class({physicalName:null,logicalName:null,type:null,initialize:function(_1){
OpenLayers.Util.extend(this,_1);
},CLASS_NAME:"Roja.Field"});

Roja.Relation=OpenLayers.Class({id:null,name:null,idTable:null,org:null,idEnte:null,urlInfoserver:null,maxRows:null,columns:null,keys:null,features:[],EVENT_TYPES:["loadStart","loadComplete","loadFailure","divVisibilityChanged"],fallThrough:false,initialize:function(_1){
OpenLayers.Util.extend(this,_1);
this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
this.events=new OpenLayers.Events(this,this,this.EVENT_TYPES,this.fallThrough);
},destroy:function(){
},setTableRelation:function(_2){
this.events.triggerEvent("divVisibilityChanged");
this.events.triggerEvent("loadStart");
var _3=this.createRequestServirepe();
var _4=this.urlInfoserver;
if(Roja.Proxy&&this.urlInfoserver.startsWith("http")){
_4=Roja.Proxy+Roja.Util.escapeUri(this.urlInfoserver);
}
_4+="Rp018TableValue.ejb-test?";
OpenLayers.Console.debug("Url servirepe: "+_4);
OpenLayers.Console.debug("xml richiesta "+_3);
new OpenLayers.Ajax.Request(_4+"serviceName=Rp018TableValue&methodType=ejb&xmlRequest="+_3,{method:"get",parameters:null,onComplete:this.parseTableRelation.bind(this),onFailure:this.errorTableRelation.bind(this)});
},setFeatures:function(_5){
this.features=_5;
},createRequestServirepe:function(){
var _6="";
for(j=0;j<this.keys.length;j++){
var _7=this.keys[j];
var _8=_7.column;
var _9=_7.relationColumn;
var _a="";
for(k=0;k<this.features.length;k++){
var _b=this.features[k];
if(k!=0){
_6=_6+"$or$";
}
if(k==0){
if(j!=0){
_6=_6+"$and$";
}
_6=_6+"($";
}
if(_9=="fid"){
var _c=_b.fid.lastIndexOf(".");
if(_c!=-1){
_a=_b.fid.substring(_c+1);
}else{
_a=_b.fid;
}
}else{
_a=_b.attributes[_9];
}
_6=_6+_8+"$=$"+_a;
if(k==this.features.length-1){
_6=_6+"$)";
}
}
}
OpenLayers.Console.debug("filtro richiesta "+_6);
var _d="<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+"<cr:Richiesta xmlns:rp=\"http://www.corenet.it/repertorio\" "+"xmlns:cr=\"http://www.corenet.it\">"+"<cr:Operazione>esegui_richiesta</cr:Operazione>"+"<rp:RequestTableValue OnlyVisibleColumnOutput=\"true\">"+"<rp:IdentTable>"+"<rp:IdEnte>"+"<rp:Org>"+this.org+"</rp:Org>"+"<rp:IdEnteParz>"+this.idEnte+"</rp:IdEnteParz>"+"</rp:IdEnte>"+"<rp:IdTable>"+"<rp:IdTableParz>"+this.idTable+"</rp:IdTableParz>"+"</rp:IdTable>"+"</rp:IdentTable>";
if(this.columns!=null){
for(j=0;j<this.columns.length;j++){
var _e=this.columns[j];
_d+="<rp:SelectColumn>"+"<rp:IdColumnParz>"+_e+"</rp:IdColumnParz>"+"</rp:SelectColumn>";
}
}
_d+="<rp:Filter>"+"<rp:Expression>"+_6+"</rp:Expression>"+"</rp:Filter>"+"<rp:MaxRows>"+this.maxRows+"</rp:MaxRows>"+"</rp:RequestTableValue>"+"</cr:Richiesta>";
return _d;
},parseTableRelation:function(_f){
var _10=_f.responseXML;
var _11=_f.responseText;
if(!_10||_f.fileType!="XML"){
_10=OpenLayers.parseXMLString(_f.responseText);
}
OpenLayers.Console.debug("Risposta servirepe: "+_f.responseText);
this.divTable=document.getElementById(this.id);
if(this.divTable!=null){
if(this.divTable.style.display=="none"){
this.divTable.style.display="block";
this.divTable.style.visibility="visible";
}else{
this.divTable.style.display="none";
this.divTable.style.visibility="hidden";
this.events.triggerEvent("divVisibilityChanged");
this.events.triggerEvent("loadComplete");
return;
}
this.divTable.innerHTML="";
this.table=document.createElement("table");
this.divTable.appendChild(this.table);
this.table.border="1";
var _12=null;
var _13=_10.getElementsByTagName("Column");
this.divRow=this.table.insertRow(-1);
var _14=[];
for(i=0;i<_13.length;i++){
var _15=_13[i];
var _16=_15.getElementsByTagName("ColumnLogicalName")[0];
if(_16!=null){
_12=_16.childNodes[0].nodeValue;
}
var _17=_15.getElementsByTagName("IdColumnParz")[0];
if(_17!=null){
columnId=_17.childNodes[0].nodeValue;
}
this.divColumn=this.divRow.insertCell(-1);
this.divColumn.innerHTML=_12;
var _18={logicalName:_12,id:columnId};
_14.push(_18);
}
var _19=_10.getElementsByTagName("Row");
if(_19.length==0){
this.divTable.innerHTML="nessun dato presente nell'area selezionata";
this.events.triggerEvent("loadComplete");
return;
}
for(i=0;i<_19.length;i++){
this.divRow=this.table.insertRow(-1);
var _1a=_19[i];
for(j=0;j<_14.length;j++){
var id="";
var _1c="";
var _1d=_14[j]["id"];
var _1e=_1a.getElementsByTagName("Field");
for(k=0;k<_1e.length;k++){
var _1f=_1e[k];
var _20=_1f.getElementsByTagName("IdColumnParz")[0];
if(_20!=null){
id=_20.childNodes[0].nodeValue;
}
if(id==_1d){
var _21=_1f.getElementsByTagName("Value")[0];
if(_21!=null){
if(_21.childNodes[0]!=null){
_1c=_21.childNodes[0].nodeValue;
}else{
_1c=" ";
}
}
this.divColumn=this.divRow.insertCell(-1);
this.divColumn.innerHTML=_1c;
break;
}
}
}
}
}
this.events.triggerEvent("loadComplete");
},setRelations:function(evt){
},errorTableRelation:function(_23){
alert("errore nel caricamento dei valori della tabella relazione");
this.events.triggerEvent("loadFailure");
},CLASS_NAME:"Roja.Relation"});

Roja.Control.WMSSwitcher=OpenLayers.Class(OpenLayers.Control,{layers:null,labelDiv:null,layersDiv:null,layerSwitcherDiv:null,groups:{groupDivs:{},checked:{},layers:{},display:{}},dataLayers:[],initialize:function(_1){
this.groups.groupDivs={};
this.groups.checked={};
this.groups.layers={};
this.groups.display={};
this.layerSwitcherDiv=_1.layersDiv;
this.layerSwitcher=_1;
},destroy:function(){
this.clearLayersArray();
this.map.events.unregister("addlayer",this,this.redraw);
this.map.events.unregister("changelayer",this,this.redraw);
this.map.events.unregister("removelayer",this,this.redraw);
this.map.events.unregister("changebaselayer",this,this.redraw);
OpenLayers.Control.prototype.destroy.apply(this,arguments);
},setMap:function(_2){
OpenLayers.Control.prototype.setMap.apply(this,arguments);
this.map.events.register("addlayer",this,this.redraw);
this.map.events.register("changelayer",this,this.redraw);
this.map.events.register("removelayer",this,this.redraw);
this.map.events.register("changebaselayer",this,this.redraw);
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this);
this.redraw();
return this.div;
},clearLayersArray:function(){
this.groups.groupDivs={};
this.dataLayers=[];
},redraw:function(_3){
this.clearLayersArray();
if(this.layerSwitcher.dataLayersDiv.childNodes.length<2){
this.labelDiv=document.createElement("div");
this.labelDiv.className="WMSlabelDiv";
this.labelDiv.id="WMSlabelDiv";
this.labelDiv.innerHTML="WMS Layers";
this.layersDiv=document.createElement("div");
this.layersDiv.id="WMSlayersDiv";
this.layersDiv.className="WMSlayersDiv";
this.layerSwitcher.dataLayersDiv.appendChild(this.labelDiv);
this.layerSwitcher.dataLayersDiv.appendChild(this.layersDiv);
}
this.layersDiv.innerHTML="";
this.divImgLoad=document.createElement("div");
this.divImgLoad.style.margin="5px";
this.layersDiv.appendChild(this.divImgLoad);
this.imgLoad=document.createElement("img");
this.imgLoad.src=OpenLayers.ImgPath+"loading.gif";
this.divImgLoad.appendChild(this.imgLoad);
this.layers=this.getWMSLayers();
for(var i=0;i<this.layers.length;i++){
if(i==0){
this.layersDiv.removeChild(this.divImgLoad);
}
var _5=this.layers[i];
if(_5.group){
_5.group=_5.group.replace(/\/$/,"");
_5.group=_5.group.replace(/^\//,"");
this.createGroupDiv(_5.group);
}
}
for(var i=0;i<this.layers.length;i++){
var _5=this.layers[i];
if(_3){
for(var ii=0;ii<_3.length;ii++){
if(_5.physicalName==_3[ii]){
_5.visibility=true;
break;
}
}
}
if(_5.displayInLayerSwitcher){
var _7=_5.visibility;
var _8=document.createElement("div");
_8.style.width="auto";
var _9=document.createElement("input");
_9.id="input_"+_5.logicalName;
_9.name=_5.logicalName;
_9.type="checkbox";
_9.value=_5.logicalName;
_9.checked=_7;
_9.defaultChecked=_7;
_5.inRange=_5.calculateInRange(this.map.getZoom());
if(!_5.inRange){
_9.disabled=true;
}
var _a={"inputElem":_9,"layer":_5,"WMSSwitcher":this};
OpenLayers.Event.observe(_9,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputClick,_a));
var _b=document.createElement("span");
if(!_5.inRange){
_b.style.color="gray";
}
_b.innerHTML=_5.logicalName;
_b.style.verticalAlign="baseline";
_b.className="labelSpan";
OpenLayers.Event.observe(_b,"click",OpenLayers.Function.bindAsEventListener(this.onInputClick,_a));
var br=document.createElement("br");
var _d=this.dataLayers;
_d.push({"layer":_5,"inputElem":_9,"labelSpan":_b});
if(!_5.group){
this.layersDiv.appendChild(_8);
_8.appendChild(_9);
_8.appendChild(_b);
_8.appendChild(br);
}else{
var _e=_5.group;
var _f=this.groups.groupDivs[_e];
this.appendLayerToGroups(_5);
_f.appendChild(_8);
_8.appendChild(_9);
_8.appendChild(_b);
_8.appendChild(br);
}
}
}
this.layerSwitcher.layersDiv.style.height=this.layerSwitcher.layersDiv.style.maxHeight;
this.layerSwitcher.layersDiv.style.overflowX="auto";
this.layerSwitcher.layersDiv.style.overflowY="auto";
return this.div;
},getWMSLayers:function(){
var _10=[];
for(var i=0;i<this.map.layers.length;i++){
if(this.map.layers[i].CLASS_NAME=="Roja.Layer.WMS"&&(!this.map.layers[i].isBaseLayer)){
for(var y=0;y<this.map.layers[i].layers.length;y++){
this.map.layers[i].layers[y].WMSLayer=this.map.layers[i];
}
this.map.layers[i].WMSSwitcher=this;
_10=_10.concat(this.map.layers[i].layers);
}
}
return _10;
},onInputClick:function(e){
if(!this.inputElem.disabled){
this.layer.visibility=!this.inputElem.checked;
this.inputElem.checked=!this.inputElem.checked;
this.layer.WMSLayer.redraw();
this.WMSSwitcher.map.events.triggerEvent("changelayer");
}
OpenLayers.Event.stop(e);
},ignoreEvent:function(evt){
OpenLayers.Event.stop(evt);
},mouseDown:function(evt){
this.isMouseDown=true;
this.ignoreEvent(evt);
},mouseUp:function(evt){
if(this.isMouseDown){
this.isMouseDown=false;
this.ignoreEvent(evt);
}
},createGroupDiv:function(_17){
var _18=_17.split("/");
var _19=_18[_18.length-1];
var _1a=this.groups.groupDivs[_17];
var _1b=document.createElement("div");
_1b.className="groupName";
if(!_1a){
var _1c=this.groups.groupDivs[_18.slice(0,_18.length-1).join("/")];
if(!_1c){
if(_18.length==1){
_1c=this.layersDiv;
}else{
_1c=this.createGroupDiv(_18.slice(0,_18.length-1).join("/"));
}
}
_1a=document.createElement("div");
_1a.className="layerGroup";
if(!this.groups.display[_17]){
this.groups.display[_17]="none";
}
_1a.style.display=this.groups.display[_17];
this.groups.groupDivs[_17]=_1a;
var _1d=document.createElement("span");
_1d.className="groupLabel";
_1d.innerHTML=_19;
OpenLayers.Event.observe(_1d,"mouseup",OpenLayers.Function.bindAsEventListener(this.onGroupClick,{layergroup:_17,groups:this.groups,layerswitcher:this}));
var _1e=document.createElement("input");
_1e.id="input_"+_18.join("_");
_1e.name=_18.join("_");
_1e.type="checkbox";
_1e.value=_17;
_1e.checked=false;
_1e.defaultChecked=false;
if(!this.groups.checked[_17]){
this.groups.checked[_17]=false;
}
if(this.groups.layers[_17]){
this.groups.checked[_17]=false;
for(var i=0;i<this.groups.layers[_17].length;i++){
if(this.groups.layers[_17][i].visibility==true){
this.groups.checked[_17]=true;
break;
}
}
}
_1e.checked=this.groups.checked[_17];
_1e.defaultChecked=this.groups.checked[_17];
if(!this.groups.layers[_17]){
this.groups.layers[_17]=[];
}
var _20={groupDiv:_1a,layerSwitcher:this,inputElem:_1e};
OpenLayers.Event.observe(_1e,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputGroupClick,_20));
_1b.appendChild(_1e);
_1b.appendChild(_1d);
_1c.appendChild(_1b);
_1c.appendChild(_1a);
}
return this.groups.groupDivs[_17];
},onGroupClick:function(e){
var _22=this.layergroup;
var div=this.groups.groupDivs[_22];
if(div){
var _24=(div.style.display!="block"?true:false);
this.layerswitcher.colapseGroup(_22,_24);
}
this.layerswitcher.layersDiv.style.height="";
},appendLayerToGroups:function(_25){
var _26=_25.group.split("/");
var _27=null;
for(var i=1;i<=_26.length;i++){
_27=_26.slice(0,i).join("/");
if(!this.isInGroup(_27,_25)){
this.groups.layers[_27].push(_25);
if(_25.visibility==true){
this.groups.checked[_27]=true;
}
}
}
},isInGroup:function(_29,_2a){
for(var j=0;j<this.groups.layers[_29].length;j++){
if(this.groups.layers[_29][j].physicalName==_2a.physicalName){
return true;
}
}
return false;
},colapseGroup:function(_2c,_2d){
var div=this.groups.groupDivs[_2c];
if(div){
div.style.display=(_2d===true?"block":"none");
this.groups.display[_2c]=div.style.display;
}
},onInputGroupClick:function(e){
var _30=!this.inputElem.checked;
var _31=this.groupDiv.getElementsByTagName("input");
this.inputElem.checked=_30;
this.layerSwitcher.groups.checked[this.inputElem.value]=_30;
for(var i=0;i<_31.length;i++){
_31[i].checked=_30;
this.layerSwitcher.groups.checked[_31[i].value]=_30;
}
var _33=null;
var _34=this.layerSwitcher.dataLayers;
for(var j=0;j<_34.length;j++){
var _36=_34[j];
if(this.layerSwitcher.isInGroup(this.inputElem.value,_36.layer)){
_36.inputElem.checked=_30;
_36.layer.visibility=_30;
_33=_36.layer.WMSLayer;
}
}
if(_33!=null){
_33.redraw();
}
this.layerSwitcher.map.events.triggerEvent("changelayer");
OpenLayers.Event.stop(e);
},CLASS_NAME:"Roja.Control.WMSSwitcher"});

Roja.WMSLayer=OpenLayers.Class({physicalName:null,logicalName:null,group:null,visibility:false,minZoomLevel:null,maxZoomLevel:null,inRange:true,displayInLayerSwitcher:true,legendUrl:null,legendName:true,name:true,initialize:function(_1){
OpenLayers.Util.extend(this,_1);
if(!this.logicalName){
this.logicalName=this.physicalName;
}
this.name=this.logicalName;
},calculateInRange:function(_2){
var _3=true;
if(this.minZoomLevel!=null&&this.maxZoomLevel!=null){
_3=((_2>=this.minZoomLevel)&&(_2<=this.maxZoomLevel));
}
return _3;
},getVisibility:function(){
return this.visibility;
},setVisibility:function(_4){
this.visibility=_4;
},CLASS_NAME:"Roja.WMSLayer"});

Roja.Control.ZoomBack=OpenLayers.Class(OpenLayers.Control,{zoomsArray:[],numZoom:6,isZoom:true,initialize:function(_1){
OpenLayers.Control.prototype.initialize.apply(this,arguments);
},activate:function(){
this.zoomBack();
return OpenLayers.Control.prototype.activate.apply(this,arguments);
},setMap:function(_2){
OpenLayers.Control.prototype.setMap.apply(this,arguments);
this.map.events.register("moveend",this,this.addZoom);
},zoomBack:function(){
if(this.zoomsArray.length>1){
this.zoomsArray.pop();
var _3=this.zoomsArray[this.zoomsArray.length-1];
this.isZoom=false;
this.map.zoomToExtent(_3);
this.isZoom=true;
}else{
var _3=this.zoomsArray[0];
this.isZoom=false;
this.map.zoomToExtent(_3);
this.isZoom=true;
}
},addZoom:function(){
if(this.isZoom){
var _4=this.map.getExtent();
if(this.zoomsArray.length<this.numZoom){
this.zoomsArray.push(_4);
}else{
var _5=this.zoomsArray;
this.zoomsArray=[];
for(var ii=0;ii<_5.length;ii++){
if(ii!=1){
this.zoomsArray.push(_5[ii]);
}
}
this.zoomsArray.push(_4);
}
}
},CLASS_NAME:"Roja.Control.ZoomBack"});

Roja.Gazetteer=OpenLayers.Class({iconUrl:null,iconSize:null,restrictedAreaSize:null,currValue:"",lista:null,url:null,max_rows_toponyms_search:"200",COD_ERR_NO_TOPONIMI:"SITRAS-RTO-001",COD_ERR_TROPPI_TOPONIMI:"SITRAS-RTO-002",crnet_isMoz:false,crnet_isIE:false,rtns:"http://www.corenet.it/ricercatoponimi",loading:null,markersLayer:null,name:"",marker:null,listBounds:null,bounds:null,fallThrough:false,events:null,istatComune:null,input:null,divMenu:null,divRicercaToponimo:null,NONE:0,LOAD_COMPLETE:1,LOAD_ERROR:11,NO_TOPONIMI:12,TOOMUCH_TOPONIMI:13,INCONSISTENCE_TEXT:14,NO_MULTITOPONIMI:15,EVENT_TYPES:["loadComplete","loadFailure"],status_code:null,gazetteerpanel:null,toponimi_types:[],initialize:function(_1){
OpenLayers.Util.extend(this,_1);
this.idname=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
this.events=new OpenLayers.Events(this,this,this.EVENT_TYPES,this.fallThrough);
if(this.crnet_isMoz=navigator.userAgent.indexOf("Gecko")!=-1){
this.crnet_isMoz=true;
}
if(navigator.appVersion.indexOf("MSIE")!=-1){
this.crnet_isIE=true;
}
this.markersLayer=new Roja.Layer.Markers("MarkersLayer");
this.markersLayer.displayInLayerSwitcher=false;
this.map.addLayer(this.markersLayer);
if(this.markersLayer!=null){
this.markersLayer.display(true);
}
},destroy:function(){
for(var i=0;i<this.map.popups.length;i++){
this.map.popups[i].destroy();
}
if(this.markersLayer!=null){
if(this.markersLayer.markers!=null){
while(this.markersLayer.markers.length>0){
var _3=thismarkersLayer.markers[0];
this.markersLayer.removeMarker(_3);
_3.destroy();
}
}
this.map.removeLayer(this.markersLayer,true);
this.markersLayer=null;
}
if(this.divHref){
OpenLayers.Event.stopObserving(this.divHref,"click",this.showLocalita.bind(this));
this.divLi.removeChild(this.divHref);
this.divResponse.removeChild(this.divLi);
this.divMenu.removeChild(this.divResponse);
this.divHref=null;
this.divLi=null;
this.divResponse=null;
}
if(this.iframe){
this.div.removeChild(this.iframe);
this.iframe=null;
}
this.input=null;
this.divMenu=null;
this.currValue=null;
this.name=null;
this.lista=null;
this.url=null;
this.crnet_isMoz=null;
this.crnet_isIE=null;
this.loading=null;
this.marker=null;
this.listBounds=null;
this.bounds=null;
OpenLayers.Control.FloatingPanel.prototype.destroy.apply(this,arguments);
},setGazetteerPanel:function(_4){
if(_4!=null&&_4!=""){
this.gazetteerpanel=document.getElementById(_4);
}
},selectInputField:function(_5){
var _6=this.input.select();
},focusInputField:function(_7){
var _8=this.input.focus();
},getStatusCode:function(){
return this.status_code;
},getSearchResultElements:function(){
return this.listBounds;
},complete:function(_9){
var _a=this.input.value;
this.currValue=_a;
var _b="<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+"<cr:Richiesta xmlns=\"http://www.corenet.it/ricercatoponimi\" xmlns:cr=\"http://www.corenet.it\" xmlns:rt=\"http://www.corenet.it/ricercatoponimi\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.corenet.it/ricercatoponimi http://www.corenet.it/ricercatoponimi/ricercatoponimi.xsd\">"+"<cr:Operazione>esegui_richiesta</cr:Operazione>"+"<rt:RichiestaRicercaToponimi>"+"<rt:Testo like=\"true\">"+_a+"</rt:Testo>";
if(this.toponimi_types.length>0){
for(var i=0;i<this.toponimi_types.length;i++){
_b+="<rt:Tipo>"+this.toponimi_types[i]+"</rt:Tipo>";
}
}else{
_b+="<rt:Tipo>T103</rt:Tipo>"+"<rt:Tipo>C401A</rt:Tipo>"+"<rt:Tipo>T145</rt:Tipo>"+"<rt:Tipo>C401B</rt:Tipo>"+"<rt:Tipo>C638A</rt:Tipo>"+"<rt:Tipo>L645</rt:Tipo>"+"<rt:Tipo>AL005</rt:Tipo>"+"<rt:Tipo>T122P</rt:Tipo>"+"<rt:Tipo>BA055</rt:Tipo>"+"<rt:Tipo>P320</rt:Tipo>"+"<rt:Tipo>T109</rt:Tipo>"+"<rt:Tipo>C421</rt:Tipo>"+"<rt:Tipo>C638</rt:Tipo>"+"<rt:Tipo>C639</rt:Tipo>";
}
if(this.istatComune!=null){
_b=_b+"<rt:Comune>"+this.istatComune+"</rt:Comune>";
}
_b=_b+"<rt:MaxRows>"+this.max_rows_toponyms_search+"</rt:MaxRows>"+"</rt:RichiestaRicercaToponimi>"+"</cr:Richiesta>";
var _d="xmlRequest="+_b;
var _e=this.url;
if(Roja.Proxy&&this.url.startsWith("http")){
_e=Roja.Proxy+Roja.Util.escapeUri(this.url);
}
var _f=this.requestSuccess.bind(this);
var _10=this.requestFailure.bind(this);
if(this.loading==null){
this.loading=new Roja.Control.LoadingMessage();
if(this.loading!=null){
this.map.addControl(this.loading);
}
}
this.loading.startLoad();
this.status_code=this.NONE;
var req=new OpenLayers.Ajax.Request(_e+_d,{method:"GET",asynchronous:true,parameters:null,onComplete:_f,onFailure:_10});
},requestSuccess:function(_12){
if(_12.responseText!=""||_12.responseXML!=null){
var _13=_12.responseXML;
if(!_13||_12.fileType!="XML"){
_13=OpenLayers.parseXMLString(_12.responseText);
}
var _14=this.gazetteerpanel;
var _15=_13;
this.removeOldMarkers();
this.loading.stopLoad();
var _16=_15.getElementsByTagName("Errore")[0];
if(_16!=null){
var _17=_16.getElementsByTagName("CodiceErrore")[0];
if(_17!=null&&_17.childNodes[0].nodeValue==this.COD_ERR_NO_TOPONIMI){
this.status_code=this.NO_TOPONIMI;
var _18=_16.getElementsByTagName("DescrizioneErrore")[0];
var _19=_18.childNodes[0].nodeValue;
this.clearTable();
if(this.divRicercaToponimo&&this.divRicercaToponimo!=null){
this.divRicercaToponimo.style.visibility="hidden";
this.divRicercaToponimo.style.display="none";
}
this.divResponseError=document.createElement("div");
this.divResponseError.className="gazetteerResponseError";
this.divResponseError.id="gazetteerResponseError";
this.gazetteerpanel.appendChild(this.divResponseError);
this.divResponseTitle=document.createElement("div");
this.divResponseTitle.className="ambiguosResponseTitle";
this.divResponseError.appendChild(this.divResponseTitle);
this.divTitle=document.createElement("div");
this.divTitle.className="size100 centerAlign";
this.divResponseTitle.appendChild(this.divTitle);
this.divSpanTitle=document.createElement("span");
this.divSpanTitle.className="title";
this.divTitle.appendChild(this.divSpanTitle);
this.divSpanTitle.innerHTML="Attenzione!";
this.divTitle=document.createElement("div");
this.divTitle.className="size100 centerAlign";
this.divResponseTitle.appendChild(this.divTitle);
this.divSpanTitle=document.createElement("span");
this.divSpanTitle.className="title";
this.divTitle.appendChild(this.divSpanTitle);
this.divSpanTitle.innerHTML="Toponimo sconosciuto";
this.divError=document.createElement("div");
this.divError.className="size100 margint";
this.divResponseError.appendChild(this.divError);
this.divSpanError=document.createElement("span");
this.divSpanError.className="erroraddress";
this.divError.appendChild(this.divSpanError);
this.divSpanError.innerHTML=this.input.value;
this.divError=document.createElement("div");
this.divError.className="size100";
this.divResponseError.appendChild(this.divError);
this.divSpanError=document.createElement("span");
this.divError.appendChild(this.divSpanError);
this.divSpanError.innerHTML="non corrisponde a nessun toponimo valido";
this.divError=document.createElement("div");
this.divError.className="size100 margint";
this.divResponseError.appendChild(this.divError);
this.divSpanError=document.createElement("span");
this.divSpanError.className="title";
this.divError.appendChild(this.divSpanError);
this.divSpanError.innerHTML="Controlla";
this.divError=document.createElement("div");
this.divError.className="size95 floating margint";
this.divResponseError.appendChild(this.divError);
this.divSpanError=document.createElement("span");
this.divError.appendChild(this.divSpanError);
this.divSpanError.innerHTML="- che il nome del toponimo sia scritto correttamente";
this.events.triggerEvent("loadComplete");
return false;
}else{
if(_17!=null&&_17.childNodes[0].nodeValue==this.COD_ERR_TROPPI_TOPONIMI){
this.status_code=this.TOOMUCH_TOPONIMI;
var _18=_16.getElementsByTagName("DescrizioneErrore")[0];
var _19=_18.childNodes[0].nodeValue;
this.clearTable();
if(this.divRicercaToponimo&&this.divRicercaToponimo!=null){
this.divRicercaToponimo.style.visibility="hidden";
this.divRicercaToponimo.style.display="none";
}
this.divResponseError=document.createElement("div");
this.divResponseError.className="gazetteerResponseError";
this.divResponseError.id="gazetteerResponseError";
this.gazetteerpanel.appendChild(this.divResponseError);
this.divResponseTitle=document.createElement("div");
this.divResponseTitle.className="ambiguosResponseTitle";
this.divResponseError.appendChild(this.divResponseTitle);
this.divTitle=document.createElement("div");
this.divTitle.className="size100 centerAlign";
this.divResponseTitle.appendChild(this.divTitle);
this.divSpanTitle=document.createElement("span");
this.divSpanTitle.className="title";
this.divTitle.appendChild(this.divSpanTitle);
this.divSpanTitle.innerHTML="Attenzione!";
this.divTitle=document.createElement("div");
this.divTitle.className="size100 centerAlign";
this.divResponseTitle.appendChild(this.divTitle);
this.divSpanTitle=document.createElement("span");
this.divSpanTitle.className="title";
this.divTitle.appendChild(this.divSpanTitle);
this.divSpanTitle.innerHTML="Localit? sconosciuta";
this.divError=document.createElement("div");
this.divError.className="size100 margint";
this.divResponseError.appendChild(this.divError);
this.divSpanError=document.createElement("span");
this.divSpanError.className="erroraddress";
this.divError.appendChild(this.divSpanError);
this.divSpanError.innerHTML=this.input.value;
this.divError=document.createElement("div");
this.divError.className="size100";
this.divResponseError.appendChild(this.divError);
this.divSpanError=document.createElement("span");
this.divError.appendChild(this.divSpanError);
this.divSpanError.innerHTML="non corrisponde a nessuna localit? valida";
this.divError=document.createElement("div");
this.divError.className="size100 margint";
this.divResponseError.appendChild(this.divError);
this.divSpanError=document.createElement("span");
this.divSpanError.className="title";
this.divError.appendChild(this.divSpanError);
this.divSpanError.innerHTML="Controlla";
this.divError=document.createElement("div");
this.divError.className="size95 floating margint";
this.divResponseError.appendChild(this.divError);
this.divSpanError=document.createElement("span");
this.divError.appendChild(this.divSpanError);
this.divSpanError.innerHTML="- che il nome della localit? sia scritto correttamente";
this.events.triggerEvent("loadComplete");
return false;
}
}
}
var _1a=OpenLayers.Ajax.getElementsByTagNameNS(_15,this.rtns,"rt","Testo")[0];
if(this.currValue!=_1a.childNodes[0].nodeValue){
this.status_code=this.INCONSISTENCE_TEXT;
this.currValue="";
this.clearTable();
this.events.triggerEvent("loadFailure");
return false;
}else{
this.lista=OpenLayers.Ajax.getElementsByTagNameNS(_15,this.rtns,"rt","RispostaRicercaToponimi")[0];
this.clearTable();
var _1b=this.lista.childNodes.length;
if(_1b==0){
this.status_code=this.NO_TOPONIMI;
this.currValue="";
this.events.triggerEvent("loadFailure");
return false;
}else{
if(_1b==1){
this.listBounds=[];
for(loop=0;loop<_1b;loop++){
var _1c=this.lista.childNodes.item(loop);
var _1d=OpenLayers.Ajax.getElementsByTagNameNS(_1c,this.rtns,"rt","Dizione")[0];
var _1e=OpenLayers.Ajax.getElementsByTagNameNS(_1d,this.rtns,"rt","Alias")[0];
var _1f=_1e.childNodes[0].nodeValue;
var _20=OpenLayers.Ajax.getElementsByTagNameNS(_1d,this.rtns,"rt","Envelope")[0];
var _21=_20.getAttribute("minX");
var _22=_20.getAttribute("minY");
var _23=_20.getAttribute("maxX");
var _24=_20.getAttribute("maxY");
var _25=_1f;
var _26="toponimo"+loop;
this.updateListMarkersBounds(_26,_25,_21,_22,_23,_24);
}
var _27=this.listBounds[0];
var _28=null;
this.name=_27["text"];
this.input.value=this.name;
this.currValue=this.name;
this.marker=this.markersLayer.markers[0];
this.bounds=_27["bounds"];
this.clearTable();
this.submitLocalita();
this.status_code=this.NO_MULTITOPONIMI;
}else{
_14=this.gazetteerpanel;
this.divMenu=document.createElement("div");
this.divMenu.className="menutoponimi";
this.divMenu.id="menu-popup";
this.divMenu.style.display="block";
this.divMenu.style.visibility="visible";
var _29=navigator.appVersion.split("MSIE");
var _2a=parseFloat(_29[1]);
if(_2a<6.5){
this.divMenu.style.width="";
}else{
this.divMenu.style.width="100%";
}
if(this.divRicercaToponimo&&this.divRicercaToponimo!=null){
this.divRicercaToponimo.style.visibility="hidden";
this.divRicercaToponimo.style.display="none";
}
this.divMenu.innerHTML="";
this.gazetteerpanel.appendChild(this.divMenu);
this.listBounds=[];
this.divResponse=document.createElement("div");
this.divResponse.className="size100 floating";
this.divMenu.appendChild(this.divResponse);
this.divResponseTitle=document.createElement("div");
this.divResponseTitle.className="size100 floating ambiguosResponseTitle";
this.divResponse.appendChild(this.divResponseTitle);
this.divSpanTitle=document.createElement("span");
this.divSpanTitle.className="title";
this.divResponseTitle.appendChild(this.divSpanTitle);
this.divSpanTitle.innerHTML="Forse cercavi:";
for(loop=0;loop<_1b;loop++){
var _1c=this.lista.childNodes.item(loop);
var _1d=OpenLayers.Ajax.getElementsByTagNameNS(_1c,this.rtns,"rt","Dizione")[0];
var _1e=OpenLayers.Ajax.getElementsByTagNameNS(_1d,this.rtns,"rt","Alias")[0];
var _1f=_1e.childNodes[0].nodeValue;
var _20=OpenLayers.Ajax.getElementsByTagNameNS(_1d,this.rtns,"rt","Envelope")[0];
var _21=_20.getAttribute("minX");
var _22=_20.getAttribute("minY");
var _23=_20.getAttribute("maxX");
var _24=_20.getAttribute("maxY");
var _2b=OpenLayers.Ajax.getElementsByTagNameNS(_1c,this.rtns,"rt","Comune")[0];
var _2c=_2b.getAttribute("nome");
this.divLi=document.createElement("div");
this.divLi.className="size100 floating toponimo";
this.divResponse.appendChild(this.divLi);
this.divHref=document.createElement("a");
var _25=_1f;
var _26="toponimo"+loop;
this.divHref.id=_26;
this.divHref.href="#";
this.divHref.innerHTML=_25;
this.divLi.appendChild(this.divHref);
if(_2c!=null&&_2c!=""&&_2c.length>1){
this.divTesto=document.createElement("div");
this.divTesto.className="size100 floating";
this.divResponse.appendChild(this.divTesto);
this.divSpanTesto=document.createElement("span");
this.divSpanTesto.className="ricercatoponimo";
this.divTesto.appendChild(this.divSpanTesto);
this.divSpanTesto.innerHTML=_2c.substring(0,1).toUpperCase()+_2c.substring(1).toLowerCase();
}
this.updateListMarkersBounds(_26,_25,_21,_22,_23,_24);
OpenLayers.Event.observe(this.divHref,"click",this.showLocalita.bind(this));
this.status_code=this.LOAD_COMPLETE;
}
if(this.lista.childNodes.length>0){
var _2d=_14.style.height;
var _2d=_2d.substring(0,_2d.length-2);
_2d=(new Number(_2d).valueOf())-1;
this.divMenu.style.height=_2d+"px";
}else{
this.divMenu.style.height="";
}
}
}
}
}else{
this.status_code=this.NO_TOPONIMI;
this.loading.stopLoad();
this.clearTable();
this.removeOldMarkers();
}
if(this.status_code>10){
this.events.triggerEvent("loadFailure");
}else{
this.events.triggerEvent("loadComplete");
}
},requestFailure:function(_2e){
this.status_code=this.LOAD_ERROR;
this.loading.stopLoad();
this.clearTable();
if(this.divRicercaToponimo&&this.divRicercaToponimo!=null){
this.divRicercaToponimo.style.visibility="hidden";
this.divRicercaToponimo.style.display="none";
}
this.divResponseError=document.createElement("div");
this.divResponseError.className="gazetteerResponseError";
this.divResponseError.id="gazetteerResponseError";
this.gazetteerpanel.appendChild(this.divResponseError);
this.divResponseTitle=document.createElement("div");
this.divResponseTitle.className="ambiguosResponseTitle";
this.divResponseError.appendChild(this.divResponseTitle);
this.divTitle=document.createElement("div");
this.divTitle.className="size100 centerAlign";
this.divResponseTitle.appendChild(this.divTitle);
this.divSpanTitle=document.createElement("span");
this.divSpanTitle.className="title";
this.divTitle.appendChild(this.divSpanTitle);
this.divSpanTitle.innerHTML="Attenzione!";
this.divTitle=document.createElement("div");
this.divTitle.className="size100 centerAlign";
this.divResponseTitle.appendChild(this.divTitle);
this.divSpanTitle=document.createElement("span");
this.divSpanTitle.className="title";
this.divTitle.appendChild(this.divSpanTitle);
this.divSpanTitle.innerHTML="Il servizio di ricerca toponimi non e' al momento disponibile.";
this.events.triggerEvent("loadComplete");
},clearTable:function(){
if(this.divMenu!=null){
this.divMenu.style.display="none";
this.divMenu.style.visibility="hidden";
}
this.listBounds=null;
for(var i=0;i<this.map.popups.length;i++){
this.map.popups[i].destroy();
}
},showLocalita:function(evt){
if(this.divMenu!=null){
this.divMenu.style.height="";
this.divMenu.style.width="";
this.divMenu.style.display="none";
this.divMenu.style.visibility="hidden";
if(this.divMenu&&this.divMenu!=null){
this.gazetteerpanel.removeChild(this.divMenu);
}
this.divMenu=null;
if(this.divRicercaToponimo&&this.divRicercaToponimo!=null){
this.divRicercaToponimo.style.visibility="visible";
this.divRicercaToponimo.style.display="block";
}
}
this.events.triggerEvent("loadFailure");
this.setLocalita(evt);
this.submitLocalita(evt);
},submitLocalita:function(evt){
this.focusInputField();
if(this.marker==null){
return true;
}
this.map.zoomToExtent(this.bounds);
var _32="<font style=\"font-weight:bold;\">"+this.name+"</font>";
this.marker.createPopup(_32,true);
this.marker.display(true);
},setLocalita:function(evt){
var _34=null;
var _35=null;
if(this.crnet_isIE){
_35=evt.srcElement;
}else{
_35=evt.originalTarget;
}
if(_35==null){
var _36=window.event;
_35=_36.srcElement;
}
_34=_35.id;
this.selectInputField();
var _37=null;
for(i=0;i<this.markersLayer.markers.length;i++){
_37=this.markersLayer.markers[i];
if(_34==_37.id){
break;
}
}
var _38=null;
for(i=0;i<this.listBounds.length;i++){
_38=this.listBounds[i];
if(_34==_38["id"]){
break;
}
}
if(_37!=null&&_38!=null){
var _39=null;
this.name=_38["text"];
this.input.value=this.name;
this.currValue=this.name;
this.marker=_37;
this.bounds=_38["bounds"];
this.clearTable();
}
},setUrl:function(_3a){
this.url=_3a;
},setMaxRowsToponymsSearch:function(_3b){
this.max_rows_toponyms_search=_3b;
},removeOldMarkers:function(){
if(this.markersLayer.markers!=null){
while(this.markersLayer.markers.length>0){
var _3c=this.markersLayer.markers[0];
this.markersLayer.removeMarker(_3c);
}
}
},updateListMarkersBounds:function(_3d,_3e,_3f,_40,_41,_42){
var _43=_3f.replace(",",".");
var _44=_40.replace(",",".");
var _45=_41.replace(",",".");
var _46=_42.replace(",",".");
var _47=(new Number(_43)).valueOf();
var _48=(new Number(_44)).valueOf();
var _49=(new Number(_45)).valueOf();
var _4a=(new Number(_46)).valueOf();
var _4b=new OpenLayers.Bounds(_47,_48,_49,_4a);
var _4c=(_47+_49)/2;
var _4d=(_48+_4a)/2;
var _4e=new OpenLayers.LonLat(parseFloat(_4c),parseFloat(_4d));
var _4f={id:_3d,lonlat:_4e,iconUrl:this.iconUrl,iconSize:this.iconSize,restrictedAreaSize:this.restrictedAreaSize};
var _50=new Roja.Marker(_4f);
_50.display(false);
this.markersLayer.addMarker(_50);
var _51={id:_3d,bounds:_4b,text:_3e};
this.listBounds.push(_51);
},CLASS_NAME:"Roja.Gazetteer"});

Roja.Control.Info.OpenCtwAdapter=OpenLayers.Class(Roja.Control.Info,{ctwAdapterUrl:null,initialize:function(_1){
Roja.Control.Info.prototype.initialize.apply(this,[_1]);
},draw:function(){
this.handler=new OpenLayers.Handler.Drag(this,{"down":this.defaultMouseDown});
},defaultMouseDown:function(_2){
var _3=this.map.getLonLatFromPixel(new OpenLayers.Pixel(_2.x,_2.y));
var _4=this.map.getLonLatFromPixel(new OpenLayers.Pixel(_2.x,_2.y));
var _5=new OpenLayers.Bounds(_3.lon,_3.lat,_4.lon,_4.lat);
var _6=this.map.getScale();
var _7=this.map.size;
var _8="<?xml version='1.0' encoding='UTF-8'?>"+"<ctw_state xmlns='http://schemas.corenet.it/ctw' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://schemas.corenet.it/ctw http://schemas.corenet.it/xsd/ctw/1_0/stato.xsd'>"+"<dwg_state>"+"<dwg>"+"<pnt x='"+_3.lon+"' y='"+_3.lat+"'/>"+"</dwg>"+"</dwg_state>"+"<img_state height='"+_7.h+"' scale='"+Math.round(_6)+"' width='"+_7.w+"'>"+"<env maxX='"+_5.right+"' maxY='"+_5.top+"' minX='"+_5.left+"' minY='"+_5.bottom+"'/>"+"</img_state>"+"<thm_state>"+"<thm active='false' metadati='false' name='foto2001' visible='true'/>"+"<thm active='false' metadati='false' name='inviluppo_foto2001' visible='true'/>"+"<thm active='false' metadati='false' name='point1' visible='true'/>"+"<thm active='false' metadati='false' name='Morfologia' visible='true'/>"+"<thm active='false' metadati='false' name='Volo 2002' visible='false'/>"+"</thm_state>"+"<oth_state>"+"<org value='01'/>"+"<id_ente value='1'/>"+"<descr_ente value='01'/>"+"<profilo value='fotocoste'/>"+"<map_service value='sit_adm_01_fotocoste'/>"+"<utente_login value='fotocoste'/>"+"</oth_state>"+"</ctw_state>";
var _9=this.ctwAdapterUrl+_8;
var _a=new Roja.Layer.Markers("");
this.map.addLayer(_a);
var _b={lonlat:_3,iconSize:new OpenLayers.Size(68,48),iconUrl:OpenLayers.ImgPath+"signal_shadow.png"};
var _c=new Roja.Marker(_b);
_a.addMarker(_c);
var _d="<strong>Coordinate</strong><br />x:"+_5.right+"<br />y:"+_5.top+"<br /><a rel=\"blank\" href=\""+_9+"\">vedi scheda</a>";
_c.createPopup(_d,true);
},CLASS_NAME:"Roja.Control.Info.OpenCtwAdapter"});

NONE=0;
PARCEL_LOADED=1;
UNKNOWN_PARCEL=11;
SERVER_ERROR=13;
Roja.Control.FindParcel=OpenLayers.Class(Roja.Control,{id:null,div:null,findParcelUrl:null,checkUIUUrl:null,istat:null,sezione:null,foglio:null,mappale:null,sub:null,findParcelPars:"serviceName=s3100geocodificaevalidazioneparticella&methodType=ejb&attachmentNumber=0&xmlRequest=",checkUIUPars:"serviceName=s3006validazioneuiu&methodType=ejb&attachmentNumber=0&xmlRequest=",findParcelResult:null,findCartographyResult:null,checkUIUResult:null,namespace_uri_geocodificaparticelle:"http://www.sigmater.it/geocodificaparticelle",namespace_prefix_geocodificaparticelle:"gc",namespace_uri_catasto:"http://www.sigmater.it/catasto",namespace_prefix_catasto:"ct",namespace_uri_gml:"http://www.opengis.net/gml",namespace_prefix_gml:"gml",markersLayer:null,events:null,loading:null,EVENT_TYPES:["loadComplete","loadFailure"],fallThrough:false,status_code:null,iconUrl:"signal_shadow.png",iconSize:new OpenLayers.Size(68,48),restrictedAreaSize:null,pointParcel:null,initialize:function(_1){
Roja.Control.prototype.initialize.apply(this,[_1]);
this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
this.markersLayer=new Roja.Layer.Markers("GeocodedParcel");
this.markersLayer.displayInLayerSwitcher=false;
this.events=new OpenLayers.Events(this,this,this.EVENT_TYPES,this.fallThrough);
this.events.register("loadComplete",this,this.stopLoading);
this.events.register("loadFailure",this,this.stopLoading);
},draw:function(){
this.loading=new Roja.Control.LoadingMessage();
if((this.map!=null)&&(this.loading!=null)){
this.map.addControl(this.loading);
}
if(this.div!=null){
Roja.Control.prototype.draw.apply(this,arguments);
this.div.className="RojaControlFindParcel";
this.span=document.createElement("span");
this.span.innerHTML="Sezione: ";
this.div.appendChild(this.span);
this.input=document.createElement("input");
this.input.type="text";
this.input.id="sezione";
this.input.value="";
if(this.sezione!=null&&this.sezione!=""){
this.input.value=this.sezione;
}
this.input.style.marginLeft="16px";
this.div.appendChild(this.input);
this.br=document.createElement("br");
this.div.appendChild(this.br);
this.span=document.createElement("span");
this.span.innerHTML="Foglio: ";
this.div.appendChild(this.span);
this.input=document.createElement("input");
this.input.type="text";
this.input.id="foglio";
this.input.value="";
if(this.foglio!=null&&this.foglio!=""){
this.input.value=this.foglio;
}
this.input.style.marginLeft="26px";
this.input.style.marginTop="5px";
this.div.appendChild(this.input);
this.br=document.createElement("br");
this.div.appendChild(this.br);
this.span=document.createElement("span");
this.span.innerHTML="Mappale: ";
this.div.appendChild(this.span);
this.input=document.createElement("input");
this.input.type="text";
this.input.id="mappale";
this.input.value="";
if(this.mappale!=null&&this.mappale!=""){
this.input.value=this.mappale;
}
this.input.style.marginLeft="10px";
this.input.style.marginTop="5px";
this.div.appendChild(this.input);
this.br=document.createElement("br");
this.div.appendChild(this.br);
this.span=document.createElement("span");
this.span.innerHTML="Subalterno: ";
this.div.appendChild(this.span);
this.input=document.createElement("input");
this.input.type="text";
this.input.id="sub";
this.input.value="";
if(this.sub!=null&&this.sub!=""){
this.input.value=this.sub;
}
this.input.style.marginTop="5px";
this.div.appendChild(this.input);
this.br=document.createElement("br");
this.div.appendChild(this.br);
this.input=document.createElement("input");
this.input.type="button";
this.input.value="trova particella";
this.input.style.marginTop="5px";
this.input.style.cursor="pointer";
this.div.appendChild(this.input);
OpenLayers.Event.observe(this.input,"click",this.load.bind(this));
this.divcatasto=document.createElement("div");
this.divcatasto.id="catasto";
this.divcatasto.className="catasto";
this.div.appendChild(this.divcatasto);
}
return this.div;
},stopLoading:function(){
if(this.map!=null&&this.loading!=null){
this.loading.stopLoad();
}
},destroy:function(){
if(this.map!=null){
if(this.markersLayer!=null){
this.map.removeLayer(this.markersLayer,true);
this.markersLayer=null;
}
}
this.map=null;
this.div=null;
if(this.events){
this.events.destroy();
}
this.events=null;
Roja.Control.prototype.destroy.apply(this,arguments);
},loadParcel:function(_2,_3,_4,_5,_6){
this.reset();
if(this.div!=null){
document.getElementById("catasto").style.display="none";
document.getElementById("catasto").innerHTML="";
}
var _7=null;
if(_6&&_6!=null&&_6.length==6){
_7=_6;
}else{
_7=this.istat;
}
if(_2!=""&&_2!=null&&_2.length>1){
alert("La sezione \ufffd composta da un solo carattere.");
return;
}
if(_3==""||_3==null||_4==""||_4==null){
alert("Mancano i dati della particella catastale che si vuole cercare.");
return;
}
if(_3!=""&&_3!=null&&_3.length>5){
alert("Il foglio \ufffd composto al massimo da 5 numeri.");
return;
}
if(_4!=""&&_4!=null&&_4.length>5){
alert("Il mappale \ufffd composto al massimo da 5 numeri.");
return;
}
if(_5!=""&&_5!=null&&_5.length>4){
alert("Il subalterno \ufffd composto al massimo da 4 caratteri.");
return;
}
if(_7==""||_7==null||_7.length!=6){
alert("Manca il codice istat del comune in cui si vuole cercare la particella.");
return;
}
if(_2!=""&&_2!=null&&_2.length==1){
_2=_2.toUpperCase();
pattern=/[A-Z]/;
if(!pattern.test(_2)){
alert("La sezione deve essere un carattere compreso tra la A e la Z.");
return;
}
}
var _8=this.successParcel.bind(this);
var _9=this.failureParcel.bind(this);
var _a=this.createFindParcelRequest(_2,_3,_4,_5,_7);
var _b=this.findParcelPars+_a;
this.status_code=NONE;
var _c=this.findParcelUrl;
if(Roja.Proxy&&this.findParcelUrl.startsWith("http")){
_c=Roja.Proxy+Roja.Util.escapeUri(this.findParcelUrl);
}
if(this.map!=null){
this.loading.startLoad();
if(this.map.getLayer(this.markersLayer.id)==null){
this.markersLayer.displayInLayerSwitcher=false;
this.map.addLayer(this.markersLayer);
}
}
if(_2!=null&&_2!=""){
this.sezione=_2;
}else{
this.sezione=null;
}
this.foglio=_3;
this.mappale=_4;
if(_5!=null&&_5!=""){
this.sub=_5;
}else{
this.sub=null;
}
new OpenLayers.Ajax.Request(_c+_b,{method:"get",parameters:null,onComplete:_8,onFailure:_9});
},load:function(){
this.reset();
var _d=document.getElementById("sezione").value;
var _e=document.getElementById("foglio").value;
var _f=document.getElementById("mappale").value;
var sub=document.getElementById("sub").value;
var _11=this.istat;
if(this.div!=null){
document.getElementById("catasto").style.display="none";
document.getElementById("catasto").innerHTML="";
}
if(_d!=""&&_d!=null&&_d.length>1){
alert("La sezione \ufffd composta da un solo carattere.");
return;
}
if(_e==""||_e==null||_f==""||_f==null){
alert("Mancano i dati della particella catastale che si vuole cercare.");
return;
}
if(_e!=""&&_e!=null&&_e.length>5){
alert("Il foglio \ufffd composto al massimo da 5 numeri.");
return;
}
if(_f!=""&&_f!=null&&_f.length>5){
alert("Il mappale \ufffd composto al massimo da 5 numeri.");
return;
}
if(sub!=""&&sub!=null&&sub.length>4){
alert("Il subalterno \ufffd composto al massimo da 4 caratteri.");
return;
}
if(_11==""||_11==null||_11.length!=6){
alert("Manca il codice istat del comune in cui si vuole cercare la particella.");
return;
}
if(_d!=""&&_d!=null&&_d.length==1){
_d=_d.toUpperCase();
pattern=/[A-Z]/;
if(!pattern.test(_d)){
alert("La sezione deve essere un carattere compreso tra la A e la Z.");
return;
}
}
var _12=this.successParcel.bind(this);
var _13=this.failureParcel.bind(this);
var _14=this.createFindParcelRequest(_d,_e,_f,sub,_11);
var par=this.findParcelPars+_14;
this.status_code=NONE;
var uri=this.findParcelUrl;
if(Roja.Proxy&&this.findParcelUrl.startsWith("http")){
uri=Roja.Proxy+Roja.Util.escapeUri(this.findParcelUrl);
}
if(this.map!=null){
this.loading.startLoad();
if(this.map.getLayer(this.markersLayer.id)==null){
this.markersLayer.displayInLayerSwitcher=false;
this.map.addLayer(this.markersLayer);
}
}
if(_d!=null&&_d!=""){
this.sezione=_d;
}else{
this.sezione=null;
}
this.foglio=_e;
this.mappale=_f;
if(sub!=null&&sub!=""){
this.sub=sub;
}else{
this.sub=null;
}
new OpenLayers.Ajax.Request(uri+par,{method:"get",parameters:null,onComplete:_12,onFailure:_13});
},setParcelPanel:function(div){
this.div=div;
},successParcel:function(_18){
this.status_code=NONE;
if(_18.responseXML==null&&_18.responseText==null){
return;
}
var _19=_18.responseXML;
if(!_19||_18.fileType!="XML"){
_19=OpenLayers.parseXMLString(_18.responseText);
}
var _1a=OpenLayers.Ajax.getElementsByTagNameNS(_19,this.namespace_uri_geocodificaparticelle,this.namespace_prefix_geocodificaparticelle,"ValiditaCensuario");
if(_1a!=null){
var _1b=_1a[0];
if(_1b!=null&&_1b.firstChild!=null){
var _1c=_1b.firstChild.nodeValue;
if(_1c!=null){
if(_1c.toUpperCase()!="VALIDO"){
this.findParcelResult=_1c;
this.status_code=UNKNOWN_PARCEL;
if(this.div!=null){
if(_1c.toUpperCase()=="CESSATO"){
document.getElementById("catasto").style.display="block";
document.getElementById("catasto").innerHTML="Particella cessata";
}else{
document.getElementById("catasto").style.display="block";
document.getElementById("catasto").innerHTML="Particella inesistente";
}
}
}else{
this.findParcelResult=_1c;
this.status_code=PARCEL_LOADED;
}
}else{
this.status_code=UNKNOWN_PARCEL;
if(this.div!=null){
document.getElementById("catasto").style.display="block";
document.getElementById("catasto").innerHTML="Particella non trovata";
}
}
}else{
this.status_code=UNKNOWN_PARCEL;
if(this.div!=null){
document.getElementById("catasto").style.display="block";
document.getElementById("catasto").innerHTML="Particella non trovata";
}
}
}else{
this.status_code=UNKNOWN_PARCEL;
if(this.div!=null){
document.getElementById("catasto").style.display="block";
document.getElementById("catasto").innerHTML="Particella non trovata";
}
}
if(this.status_code==PARCEL_LOADED){
var _1d=OpenLayers.Ajax.getElementsByTagNameNS(_19,this.namespace_uri_gml,this.namespace_prefix_gml,"Point");
var _1e=OpenLayers.Ajax.getElementsByTagNameNS(_19,this.namespace_uri_geocodificaparticelle,this.namespace_prefix_geocodificaparticelle,"ValiditaCartografia")[0];
if(_1e!=null&&_1e.firstChild!=null){
var _1f=_1e.firstChild.nodeValue;
if(_1f!=null&&_1f!=""){
this.findCartographyResult=_1f;
}
if(_1f!=null&&_1f.toUpperCase()=="ESISTENTE"){
if(_1d!=null){
var _20=null;
var _21=null;
var _22=_1d[0];
var _23=OpenLayers.Ajax.getElementsByTagNameNS(_22,this.namespace_uri_gml,this.namespace_prefix_gml,"pos")[0];
var _24=OpenLayers.Ajax.getElementsByTagNameNS(_22,this.namespace_uri_gml,this.namespace_prefix_gml,"coordinates")[0];
var _25=OpenLayers.Ajax.getElementsByTagNameNS(_22,this.namespace_uri_gml,this.namespace_prefix_gml,"coord")[0];
if(_23!=null){
if(_23.firstChild!=null){
var pos=_23.firstChild.nodeValue;
if(pos!=""){
var _27=pos.indexOf(" ");
_20=(new Number(pos.substring(0,_27))).valueOf();
_21=(new Number(pos.substring(_27+1))).valueOf();
}
}
}
if(_24!=null){
if(_24.firstChild!=null){
var pos=_24.firstChild.nodeValue;
if(pos!=""){
var _27=pos.indexOf(" ");
_20=(new Number(pos.substring(0,_27))).valueOf();
_21=(new Number(pos.substring(_27+1))).valueOf();
}
}
}
if(_25!=null){
var _28=OpenLayers.Ajax.getElementsByTagNameNS(_25,this.namespace_uri_gml,this.namespace_prefix_gml,"X")[0];
var _29=OpenLayers.Ajax.getElementsByTagNameNS(_25,this.namespace_uri_gml,this.namespace_prefix_gml,"Y")[0];
if(_28!=null&&_28.firstChild!=null&&_29!=null&&_29.firstChild!=null){
_20=(new Number(_28.firstChild.nodeValue)).valueOf();
_21=(new Number(_29.firstChild.nodeValue)).valueOf();
}
}
if(_20!=null&&_21!=null){
var _2a="<span style=\"font-weight:bold;\">Particella</span><br/><br/>";
if(this.sezione!=""&&this.sezione!=null){
_2a+="Sezione: "+this.sezione+" ";
}
_2a+="Foglio: "+this.foglio+" Mappale: "+this.mappale;
if(this.sub!=""&&this.sub!=null){
_2a+=" Subalterno: "+this.sub;
}
this.pointParcel=new OpenLayers.LonLat(_20,_21);
this.loadGeocodes(new OpenLayers.LonLat(_20,_21),_2a);
}
}else{
if(this.div!=null){
document.getElementById("catasto").style.display="block";
document.getElementById("catasto").innerHTML="Particella valida con cartografia inesistente";
}
}
}else{
if(this.div!=null){
document.getElementById("catasto").style.display="block";
document.getElementById("catasto").innerHTML="Particella valida con cartografia inesistente";
}
}
}else{
if(this.div!=null){
document.getElementById("catasto").style.display="block";
document.getElementById("catasto").innerHTML="Particella valida con cartografia inesistente";
}
}
}
if(this.status_code>10){
this.events.triggerEvent("loadFailure");
}else{
if(this.checkUIUUrl!=null&&this.checkUIUUrl!=""){
this.checkUIU();
}else{
this.events.triggerEvent("loadComplete");
}
}
},failureParcel:function(_2b){
if(this.div!=null){
document.getElementById("catasto").style.display="block";
document.getElementById("catasto").innerHTML="Si \ufffd verificato un errore nel servizio.";
}
this.findParcelResult=null;
this.status_code=SERVER_ERROR;
this.events.triggerEvent("loadFailure");
return;
},checkUIU:function(){
var _2c=this.successCheckUIU.bind(this);
var _2d=this.failureCheckUIU.bind(this);
var _2e=this.createCheckUIURequest();
var par=this.checkUIUPars+_2e;
var uri=this.checkUIUUrl;
if(Roja.Proxy&&this.checkUIUUrl.startsWith("http")){
uri=Roja.Proxy+Roja.Util.escapeUri(this.checkUIUUrl);
}
new OpenLayers.Ajax.Request(uri+par,{method:"get",parameters:null,onComplete:_2c,onFailure:_2d});
},successCheckUIU:function(_31){
if(_31.responseXML==null&&_31.responseText==null){
return;
}
var _32=_31.responseXML;
if(!_32||_31.fileType!="XML"){
_32=OpenLayers.parseXMLString(_31.responseText);
}
var _33=OpenLayers.Ajax.getElementsByTagNameNS(_32,this.namespace_uri_catasto,this.namespace_prefix_catasto,"Validita");
if(_33!=null){
var _34=_33[0];
if(_34!=null&&_34.firstChild!=null){
var _35=_34.firstChild.nodeValue;
if(_35!=null){
if(_35.toUpperCase()!="VALIDO"){
this.checkUIUResult=_35;
if(this.div!=null){
if(_35.toUpperCase()=="CESSATO"){
document.getElementById("catasto").style.display="block";
document.getElementById("catasto").innerHTML=document.getElementById("catasto").innerHTML+"<br/>Uiu cessata";
}else{
document.getElementById("catasto").style.display="block";
document.getElementById("catasto").innerHTML=document.getElementById("catasto").innerHTML+"<br/>Uiu inesistente";
}
}
}else{
this.checkUIUResult=_35;
}
}else{
if(this.div!=null){
document.getElementById("catasto").style.display="block";
document.getElementById("catasto").innerHTML=document.getElementById("catasto").innerHTML+"<br/>Uiu non trovata";
}
}
}else{
if(this.div!=null){
document.getElementById("catasto").style.display="block";
document.getElementById("catasto").innerHTML=document.getElementById("catasto").innerHTML+"<br/>Uiu non trovata";
}
}
}else{
if(this.div!=null){
document.getElementById("catasto").style.display="block";
document.getElementById("catasto").innerHTML=document.getElementById("catasto").innerHTML+"<br/>Uiu non trovata";
}
}
if(this.status_code>10){
this.events.triggerEvent("loadFailure");
}else{
this.events.triggerEvent("loadComplete");
}
},failureCheckUIU:function(_36){
if(this.div!=null){
document.getElementById("catasto").style.display="block";
document.getElementById("catasto").innerHTML=document.getElementById("catasto").innerHTML+"<br/>Si \ufffd verificato un errore nel servizio di validazione delle UIU.";
}
this.checkUIUResult=null;
if(this.status_code>10){
this.events.triggerEvent("loadFailure");
}else{
this.events.triggerEvent("loadComplete");
}
return;
},geocodedMarkersClear:function(){
if(this.markersLayer.markers!=null){
while(this.markersLayer.markers.length>0){
var _37=this.markersLayer.markers[0];
this.markersLayer.removeMarker(_37);
_37.destroy();
}
}
},loadGeocodes:function(_38,_39){
var _3a={lonlat:_38,iconUrl:OpenLayers.ImgPath+this.iconUrl,iconSize:this.iconSize,restrictedAreaSize:this.restrictedAreaSize};
var _3b=new Roja.Marker(_3a);
_3b.display(true);
this.markersLayer.addMarker(_3b);
_3b.createPopup(_39,true);
var _3c=new OpenLayers.Bounds(_38.lon,_38.lat,_38.lon,_38.lat);
map.zoomToExtent(_3c);
},createFindParcelRequest:function(_3d,_3e,_3f,sub,_41){
istatProv=_41.substring(0,3);
istatComune=_41.substring(3);
var _42="<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+"<s3:Richiesta xmlns=\"http://www.sigmater.it/geocodificaparticelle\" xmlns:ct=\"http://www.sigmater.it/catasto\" xmlns:s3=\"http://www.sigmater.it\" xmlns:aa=\"http://www.sigmater.it/ambitiamministrativi\">"+"<s3:Operazione>esegui_richiesta</s3:Operazione>"+"<S3RichiestaValidazioneEGeocodificaParticella>"+"<ct:IdentificativoParticella>"+"<aa:IdentificativoComune>"+"<aa:IdentificativoIstatComune>"+"<aa:CodiceISTATComune>"+istatComune+"</aa:CodiceISTATComune>"+"<aa:CodiceISTATProvincia>"+istatProv+"</aa:CodiceISTATProvincia>"+"</aa:IdentificativoIstatComune>"+"</aa:IdentificativoComune>"+"<ct:IdentificativoParzialeParticella>";
if(_3d!=""&&_3d!=null){
_42+="<ct:Sezione>"+_3d.toUpperCase()+"</ct:Sezione>";
}
_42+="<ct:Foglio>"+_3e+"</ct:Foglio>"+"<ct:Mappale>"+_3f+"</ct:Mappale>";
if(sub!=""&&sub!=null){
_42+="<ct:Subalterno>"+sub.toUpperCase()+"</ct:Subalterno>";
}
_42+="</ct:IdentificativoParzialeParticella>"+"</ct:IdentificativoParticella>"+"</S3RichiestaValidazioneEGeocodificaParticella>"+"</s3:Richiesta>";
return _42;
},createCheckUIURequest:function(){
istatProv=this.istat.substring(0,3);
istatComune=this.istat.substring(3);
var _43="<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+"<s3:Richiesta xmlns=\"http://www.sigmater.it/catasto\" xmlns:s3=\"http://www.sigmater.it\" xmlns:aa=\"http://www.sigmater.it/ambitiamministrativi\">"+"<s3:Operazione>esegui_richiesta</s3:Operazione>"+"<S3RichiestaValidazioneUIU>"+"<IdentificativoUIU>"+"<aa:IdentificativoComune>"+"<aa:IdentificativoIstatComune>"+"<aa:CodiceISTATComune>"+istatComune+"</aa:CodiceISTATComune>"+"<aa:CodiceISTATProvincia>"+istatProv+"</aa:CodiceISTATProvincia>"+"</aa:IdentificativoIstatComune>"+"</aa:IdentificativoComune>"+"<IdentificativoParzialeUIU>";
if(this.sezione!=""&&this.sezione!=null){
_43+="<Sezione>"+this.sezione.toUpperCase()+"</Sezione>";
}
_43+="<Foglio>"+this.foglio+"</Foglio>"+"<Mappale>"+this.mappale+"</Mappale>";
if(this.sub!=""&&this.sub!=null){
_43+="<Subalterno>"+this.sub.toUpperCase()+"</Subalterno>";
}
_43+="</IdentificativoParzialeUIU>"+"</IdentificativoUIU>"+"</S3RichiestaValidazioneUIU>"+"</s3:Richiesta>";
return _43;
},reset:function(){
this.markersLayer.clearMarkers();
this.status_code=NONE;
this.sezione=null;
this.foglio=null;
this.mappale=null;
this.sub=null;
this.findParcelResult=null;
this.findCartographyResult=null;
this.checkUIUResult=null;
},getSezione:function(){
return this.sezione;
},getFoglio:function(){
return this.foglio;
},getMappale:function(){
return this.mappale;
},getSub:function(){
return this.sub;
},setSezione:function(_44){
this.sezione=_44;
},setFoglio:function(_45){
this.foglio=_45;
},setMappale:function(_46){
this.mappale=_46;
},setSub:function(sub){
this.sub=sub;
},getStatusCode:function(){
return this.status_code;
},getFindParcelResult:function(){
return this.fndParcelResult;
},CLASS_NAME:"Roja.Control.FindParcel"});

NONE=0;
PARCEL_LOADED=1;
UNKNOWN_PARCEL=11;
SERVER_ERROR=13;
Roja.Control.FindParcelWFS=OpenLayers.Class(Roja.Control,{id:null,div:null,findParcelUrl:null,belfiore:null,sezione:null,foglio:null,mappale:null,typeName:null,findParcelPars:"request=GetFeature&version=1.1.0&typeName=cat:PARTICELLECATASTO&outputFormat=GML2&FILTER=",findParcelResult:null,findCartographyResult:null,namespace_uri_geocodificaparticelle:"http://www.sigmater.it/geocodificaparticelle",namespace_prefix_geocodificaparticelle:"gc",namespace_uri_catasto:"http://www.regione.sardegna.it/",namespace_prefix_catasto:"cat",namespace_uri_gml:"http://www.opengis.net/gml",namespace_prefix_gml:"gml",markersLayer:null,geometryLayer:null,events:null,loading:null,EVENT_TYPES:["loadComplete","loadFailure"],fallThrough:false,status_code:null,iconUrl:"signal_shadow.png",iconSize:new OpenLayers.Size(68,48),restrictedAreaSize:null,pointParcel:null,initialize:function(_1){
Roja.Control.prototype.initialize.apply(this,[_1]);
this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
this.markersLayer=new Roja.Layer.Markers("ParcelMarker");
this.markersLayer.displayInLayerSwitcher=false;
var _2={};
if(_1.styleMap!=null){
_2={styleMap:_1.styleMap};
}
this.geometryLayer=new OpenLayers.Layer.Vector("ParcelGeometry",_2);
this.geometryLayer.displayInLayerSwitcher=false;
this.events=new OpenLayers.Events(this,this,this.EVENT_TYPES,this.fallThrough);
this.events.register("loadComplete",this,this.stopLoading);
this.events.register("loadFailure",this,this.stopLoading);
},draw:function(){
this.loading=new Roja.Control.LoadingMessage();
if((this.map!=null)&&(this.loading!=null)){
this.map.addControl(this.loading);
}
if(this.div!=null){
Roja.Control.prototype.draw.apply(this,arguments);
this.div.className="RojaControlFindParcel";
this.span=document.createElement("span");
this.span.innerHTML="Belfiore: ";
this.div.appendChild(this.span);
this.inputBelfiore=document.createElement("input");
this.inputBelfiore.type="text";
this.inputBelfiore.id="belfiore";
this.inputBelfiore.value="";
if(this.belfiore!=null&&this.belfiore!=""){
this.inputBelfiore.value=this.belfiore;
}
this.div.appendChild(this.inputBelfiore);
this.inputBelfiore.style.marginLeft="8px";
this.span=document.createElement("span");
this.span.innerHTML="Sezione: ";
this.div.appendChild(this.span);
this.inputSezione=document.createElement("input");
this.inputSezione.type="text";
this.inputSezione.id="sezione";
this.inputSezione.value="";
if(this.sezione!=null&&this.sezione!=""){
this.inputSezione.value=this.sezione;
}
this.inputSezione.style.marginLeft="8px";
this.div.appendChild(this.inputSezione);
this.span=document.createElement("span");
this.span.innerHTML="Foglio: ";
this.div.appendChild(this.span);
this.inputFoglio=document.createElement("input");
this.inputFoglio.type="text";
this.inputFoglio.id="foglio";
this.inputFoglio.value="";
if(this.foglio!=null&&this.foglio!=""){
this.inputFoglio.value=this.foglio;
}
this.div.appendChild(this.inputFoglio);
this.inputFoglio.style.marginLeft="18px";
this.span=document.createElement("span");
this.span.innerHTML="Mappale: ";
this.div.appendChild(this.span);
this.inputMappale=document.createElement("input");
this.inputMappale.type="text";
this.inputMappale.id="mappale";
this.inputMappale.value="";
if(this.mappale!=null&&this.mappale!=""){
this.inputMappale.value=this.mappale;
}
this.div.appendChild(this.inputMappale);
this.input=document.createElement("input");
this.input.type="button";
this.input.value="trova";
this.input.style.cursor="pointer";
this.div.appendChild(this.input);
OpenLayers.Event.observe(this.input,"click",this.load.bind(this));
this.divcatasto=document.createElement("div");
this.divcatasto.id="catasto";
this.divcatasto.className="catasto";
this.div.appendChild(this.divcatasto);
}
return this.div;
},stopLoading:function(){
if(this.map!=null&&this.loading!=null){
this.loading.stopLoad();
}
},destroy:function(){
if(this.map!=null){
if(this.markersLayer!=null){
this.map.removeLayer(this.markersLayer,true);
this.markersLayer=null;
}
if(this.geometryLayer!=null){
this.map.removeLayer(this.geometryLayer,true);
this.geometryLayer=null;
}
}
this.map=null;
this.div=null;
if(this.events){
this.events.destroy();
}
this.events=null;
Roja.Control.prototype.destroy.apply(this,arguments);
},loadParcel:function(_3,_4,_5,_6){
this.reset();
this.status_code=NONE;
this.findParcelResult=null;
if(this.div!=null&&this.divcatasto!=null){
this.divcatasto.style.display="none";
this.divcatasto.innerHTML="";
}
if(_4!=""&&_4!=null&&_4.length>1){
alert("La sezione \ufffd composta da un solo carattere.");
return;
}
if(_5==""||_5==null||_6==""||_6==null){
alert("Mancano i dati della particella catastale che si vuole cercare.");
return;
}
if(_5!=""&&_5!=null&&_5.length>5){
alert("Il foglio \ufffd composto al massimo da 5 numeri.");
return;
}
if(_6!=""&&_6!=null&&_6.length>5){
alert("Il mappale \ufffd composto al massimo da 5 numeri.");
return;
}
if(_3==""||_3==null||_3.length!=4){
alert("Manca il codice belfiore del comune in cui si vuole cercare la particella.");
return;
}
if(_4!=""&&_4!=null&&_4.length==1){
_4=_4.toUpperCase();
pattern=/[A-Z]/;
if(!pattern.test(_4)){
alert("La sezione deve essere un carattere compreso tra la A e la Z.");
return;
}
}
var _7=this.successParcel.bind(this);
var _8=this.failureParcel.bind(this);
var _9=this.createFindParcelRequest(_4,_5,_6,_3);
var _a=this.findParcelPars+_9;
this.status_code=NONE;
var _b=this.findParcelUrl;
if(Roja.Proxy&&this.findParcelUrl.startsWith("http")){
_b=Roja.Proxy+Roja.Util.escapeUri(this.findParcelUrl);
}
if(this.map!=null){
this.loading.startLoad();
if(this.map.getLayer(this.geometryLayer.id)==null){
this.geometryLayer.displayInLayerSwitcher=false;
this.map.addLayer(this.geometryLayer);
}
if(this.map.getLayer(this.markersLayer.id)==null){
this.markersLayer.displayInLayerSwitcher=false;
this.map.addLayer(this.markersLayer);
}
}
if(_4!=null&&_4!=""){
this.sezione=_4;
}else{
this.sezione=null;
}
this.foglio=_5;
this.mappale=_6;
new OpenLayers.Ajax.Request(_b+_a,{method:"get",parameters:null,onComplete:_7,onFailure:_8});
},load:function(){
this.reset();
var _c=this.inputSezione.value;
var _d=this.inputFoglio.value;
var _e=this.inputMappale.value;
var _f=this.inputBelfiore.value;
this.loadParcel(_f,_c,_d,_e);
},successParcel:function(_10){
this.status_code=NONE;
this.findParcelResult=null;
if(_10.responseXML==null&&_10.responseText==null){
return;
}
var _11=_10.responseXML;
if(!_11||_10.fileType!="XML"){
_11=OpenLayers.parseXMLString(_10.responseText);
}
var _12,polygon;
var p;
var _14=OpenLayers.Ajax.getElementsByTagNameNS(_11,this.namespace_uri_gml,this.namespace_prefix_gml,"Box");
var _15=OpenLayers.Util.getXmlNodeValue(OpenLayers.Ajax.getElementsByTagNameNS(_14[0],this.namespace_uri_gml,this.namespace_prefix_gml,"coordinates")[0]);
var _16=_15.split(" ");
var _17=_16[0].split(",");
var _18=_16[1].split(",");
var _19=parseFloat(_17[0]);
var _1a=parseFloat(_17[1]);
var _1b=parseFloat(_18[0]);
var _1c=parseFloat(_18[1]);
var _1d=_19+(Math.abs(_1b-_19)/2);
var _1e=_1a+(Math.abs(_1c-_1a)/2);
var _1f=new OpenLayers.LonLat(_1d,_1e);
var _20=OpenLayers.Ajax.getElementsByTagNameNS(_11,this.namespace_uri_catasto,this.namespace_prefix_catasto,"FOGLIO");
if(_20[0]==null){
if(this.div!=null&&this.divcatasto!=null){
this.divcatasto.style.display="block";
this.divcatasto.innerHTML="Particella non esistente";
}
this.findLotResult="Particella non esistente";
this.status_code=UNKNOWN_PARCEL;
this.events.triggerEvent("loadFailure");
this.stopLoading();
return;
}
this.foglio=OpenLayers.Util.getXmlNodeValue(_20[0]);
_20=OpenLayers.Ajax.getElementsByTagNameNS(_11,this.namespace_uri_catasto,this.namespace_prefix_catasto,"SEZIONE");
this.sezione=OpenLayers.Util.getXmlNodeValue(_20[0]);
_20=OpenLayers.Ajax.getElementsByTagNameNS(_11,this.namespace_uri_catasto,this.namespace_prefix_catasto,"NUMERO");
this.mappale=OpenLayers.Util.getXmlNodeValue(_20[0]);
var _15="<span style=\"font-weight:bold;\">Particella</span><br/><br/>";
if(this.sezione!=""&&this.sezione!=null){
_15+="Sezione: "+this.sezione+"; ";
}
_15+="Foglio: "+this.foglio+"; Mappale: "+this.mappale;
if(this.sub!=""&&this.sub!=null){
_15+="; Subalterno: "+this.sub;
}
this.loadGeocodes(_1f,_15);
var gml=new OpenLayers.Format.GML();
this.geometryLayer.addFeatures(gml.read(_11));
this.findLotResult="Particella trovata";
this.status_code=PARCEL_LOADED;
this.events.triggerEvent("loadComplete");
},failureParcel:function(_22){
if(this.div!=null&&this.divcatasto!=null){
this.divcatasto.style.display="block";
this.divcatasto.innerHTML="Errore di sistema.";
}
this.findParcelResult="Errore di sistema.";
this.status_code=SERVER_ERROR;
this.events.triggerEvent("loadFailure");
return;
},geocodedMarkersClear:function(){
if(this.markersLayer.markers!=null){
while(this.markersLayer.markers.length>0){
var _23=this.markersLayer.markers[0];
this.markersLayer.removeMarker(_23);
_23.destroy();
}
}
},geometryFeaturesClear:function(){
if(this.geometryLayer.features!=null){
while(this.geometryLayer.features.length>0){
var _24=this.geometryLayer.features[0];
this.geometry.removeFeature(_24);
_24.destroy();
}
}
},loadGeocodes:function(_25,_26){
var _27={lonlat:_25,iconUrl:OpenLayers.ImgPath+this.iconUrl,iconSize:this.iconSize,restrictedAreaSize:this.restrictedAreaSize};
var _28=new Roja.Marker(_27);
_28.display(true);
this.markersLayer.addMarker(_28);
_28.createPopup(_26,true);
var _29=new OpenLayers.Bounds(_25.lon,_25.lat,_25.lon,_25.lat);
map.zoomToExtent(_29);
this.loading.stopLoad();
},createFindParcelRequest:function(_2a,_2b,_2c,_2d){
var _2e="<Filter><And>"+"<PropertyIsEqualTo>"+"<PropertyName>CODICECOMUNE</PropertyName><Literal>"+_2d+"</Literal>"+"</PropertyIsEqualTo>"+"<PropertyIsEqualTo>"+"<PropertyName>FOGLIO</PropertyName><Literal>"+_2b+"</Literal>"+"</PropertyIsEqualTo>"+"<PropertyIsEqualTo>"+"<PropertyName>NUMERO</PropertyName><Literal>"+_2c+"</Literal>"+"</PropertyIsEqualTo>";
if(_2a!=""&&_2a!=null){
_2e+="<PropertyIsEqualTo>"+"<PropertyName>SEZIONE</PropertyName><Literal>"+_2a.toUpperCase()+"</Literal>"+"</PropertyIsEqualTo>";
}
_2e+="</And></Filter>";
return _2e;
},reset:function(){
this.markersLayer.clearMarkers();
this.geometryLayer.destroyFeatures();
this.status_code=NONE;
this.sezione=null;
this.foglio=null;
this.mappale=null;
this.findParcelResult=null;
this.findCartographyResult=null;
this.checkUIUResult=null;
},CLASS_NAME:"Roja.Control.FindParcelWFS"});

Roja.Format.OLON=OpenLayers.Class(OpenLayers.Format.JSON,{initialize:function(_1){
OpenLayers.Format.JSON.prototype.initialize.apply(this,[_1]);
},read:function(_2,_3){
var _4=OpenLayers.Format.JSON.prototype.read(_2,_3);
var _5=OpenLayers.Class.deserialize(_4);
return _5;
},write:function(_6,_7){
var _8=OpenLayers.Class.serialize(_6);
var _9=OpenLayers.Format.JSON.prototype.write(_8,_7);
return _9;
},CLASS_NAME:"Roja.Format.OLON"});

var serializeFunction=function(){
var _1={};
var _2=eval(this.CLASS_NAME);
var _3=_2.prototype.serializable;
if(_3!=null){
var _4;
var _5=_3.args;
if(_5){
for(_4=0;_4<_5.length;++_4){
_1[_5[_4]]=OpenLayers.Class.serialize(this[_5[_4]]);
}
}
var _6=_3.props;
if(_6){
for(_4=0;_4<_6.length;++_4){
_1[_6[_4]]=OpenLayers.Class.serialize(this[_6[_4]]);
}
}
}
_1.CLASS_NAME=this.CLASS_NAME;
return _1;
};
Roja.Map.prototype.serialize=serializeFunction;
Roja.Layer.RasTMS.prototype.serialize=serializeFunction;
Roja.Marker.prototype.serialize=serializeFunction;
Roja.Popup.prototype.serialize=serializeFunction;
Roja.Marker.GeocodedAddress.prototype.serialize=serializeFunction;
Roja.Marker.POI.prototype.serialize=serializeFunction;
Roja.WMSLayer.prototype.serialize=serializeFunction;
Roja.Layer.WMS.prototype.serialize=serializeFunction;
Roja.Map.prototype.serializable={"props":["layers","center","zoom","bounds","projection","units","maxResolution","numZoomLevels","backgroundColor"]};
Roja.Layer.RasTMS.prototype.serializable={"args":["name","url","options"],"props":["emptyImg","isBaseLayer","layername","type","numZoomLevels","maxResolution","minResolution","maxExtent","wrapDateLine","displayOutsideMaxExtent","isBaseLayer","displayInLayerSwitcher","visibility","opacity"]};
Roja.Marker.prototype.serializable={"props":["lonlat","icon","id","iconUrl","iconSize","popup","popupsize","position","visible"],"args":[]};
Roja.Popup.prototype.serializable={"props":["id","lonlat","size","contentHTML","text","anchor","firstTimeShow"],"args":[]};
Roja.Marker.GeocodedAddress.prototype.serializable={"props":["lonlat","icon","id","iconUrl","iconSize","popup","popupsize","position"],"args":["xmldata"]};
Roja.Marker.POI.prototype.serializable={"props":["lonlat","icon","id","iconUrl","iconSize","popup","popupsize","position"],"args":[]};
Roja.WMSLayer.prototype.serializable={"props":["physicalName","logicalName","minZoomLevel","maxZoomLevel","visibility","legendUrl","displayInLayerSwitcher","legendName","group"],"args":[]};
Roja.Layer.WMS.prototype.serializable={"args":["name","url","params","options","layers"],"props":["reproject","encodeBBOX","layername","type","numZoomLevels","maxResolution","minResolution","maxExtent","wrapDateLine","displayOutsideMaxExtent","isBaseLayer","displayInLayerSwitcher","visibility","group","opacity","layers"]};

